bright_id
stringlengths 11
257
| bright_doc
stringlengths 25
9.18M
| bright_split
stringclasses 8
values | scandi_id
stringlengths 3
7
| scandi_url
stringlengths 31
143
| scandi_title
stringlengths 1
79
| scandi_text
stringlengths 15
118k
| scandi_language
stringclasses 4
values | scandi_dist
float64 0.2
1.75
|
---|---|---|---|---|---|---|---|---|
Pony/builtin-Integer-.txt |
Integer[A: Integer[A] val]¶
[Source]
trait val Integer[A: Integer[A] val] is
Real[A] val
Implements¶
Real[A] val
Constructors¶
create¶
[Source]
new val create(
value: A)
: Real[A] val^
Parameters¶
value: A
Returns¶
Real[A] val^
from[B: ((I8 val | I16 val | I32 val | I64 val | I128 val | ILong val | ISize val | U8 val | U16 val | U32 val | U64 val | U128 val | ULong val | USize val | F32 val | F64 val) & Real[B] val)]¶
[Source]
new val from[B: ((I8 val | I16 val | I32 val |
I64 val | I128 val | ILong val |
ISize val | U8 val | U16 val |
U32 val | U64 val | U128 val |
ULong val | USize val | F32 val |
F64 val) & Real[B] val)](
a: B)
: Real[A] val^
Parameters¶
a: B
Returns¶
Real[A] val^
min_value¶
[Source]
new val min_value()
: Real[A] val^
Returns¶
Real[A] val^
max_value¶
[Source]
new val max_value()
: Real[A] val^
Returns¶
Real[A] val^
Public Functions¶
add_unsafe¶
[Source]
Unsafe operation.
If the operation overflows, the result is undefined.
fun box add_unsafe(
y: A)
: A
Parameters¶
y: A
Returns¶
A
sub_unsafe¶
[Source]
Unsafe operation.
If the operation overflows, the result is undefined.
fun box sub_unsafe(
y: A)
: A
Parameters¶
y: A
Returns¶
A
mul_unsafe¶
[Source]
Unsafe operation.
If the operation overflows, the result is undefined.
fun box mul_unsafe(
y: A)
: A
Parameters¶
y: A
Returns¶
A
div_unsafe¶
[Source]
Integer division, rounded towards zero.
Unsafe operation.
If y is 0, the result is undefined.
If the operation overflows, the result is undefined.
fun box div_unsafe(
y: A)
: A
Parameters¶
y: A
Returns¶
A
divrem_unsafe¶
[Source]
Calculates the quotient of this number and y and the remainder.
Unsafe operation.
If y is 0, the result is undefined.
If the operation overflows, the result is undefined.
fun box divrem_unsafe(
y: A)
: (A , A)
Parameters¶
y: A
Returns¶
(A , A)
rem_unsafe¶
[Source]
Calculates the remainder of this number divided by y.
Unsafe operation.
If y is 0, the result is undefined.
If the operation overflows, the result is undefined.
fun box rem_unsafe(
y: A)
: A
Parameters¶
y: A
Returns¶
A
fld_unsafe¶
[Source]
Floored division, rounded towards negative infinity,
as opposed to div which rounds towards zero.
Unsafe Operation
If y is 0, the result is undefined.
If the operation overflows, the result is undefined.
fun box fld_unsafe(
y: A)
: A
Parameters¶
y: A
Returns¶
A
mod_unsafe¶
[Source]
Calculates the modulo of this number after floored division by y.
Unsafe Operation.
If y is 0, the result is undefined.
If the operation overflows, the result is undefined.
fun box mod_unsafe(
y: A)
: A
Parameters¶
y: A
Returns¶
A
add_partial¶
[Source]
Add y to this number.
If the operation overflows this function errors.
fun box add_partial(
y: A)
: A ?
Parameters¶
y: A
Returns¶
A ?
sub_partial¶
[Source]
Subtract y from this number.
If the operation overflows/underflows this function errors.
fun box sub_partial(
y: A)
: A ?
Parameters¶
y: A
Returns¶
A ?
mul_partial¶
[Source]
Multiply y with this number.
If the operation overflows this function errors.
fun box mul_partial(
y: A)
: A ?
Parameters¶
y: A
Returns¶
A ?
div_partial¶
[Source]
Divides this number by y, rounds the result towards zero.
If y is 0 or the operation overflows, this function errors.
fun box div_partial(
y: A)
: A ?
Parameters¶
y: A
Returns¶
A ?
rem_partial¶
[Source]
Calculates the remainder of this number divided by y.
The result has the sign of the dividend.
If y is 0 or the operation overflows, this function errors.
fun box rem_partial(
y: A)
: A ?
Parameters¶
y: A
Returns¶
A ?
divrem_partial¶
[Source]
Divides this number by y and calculates the remainder of the operation.
If y is 0 or the operation overflows, this function errors.
fun box divrem_partial(
y: A)
: (A , A) ?
Parameters¶
y: A
Returns¶
(A , A) ?
fld_partial¶
[Source]
Floored integer division, rounded towards negative infinity.
If y is 0 or the operation overflows, this function errors
fun box fld_partial(
y: A)
: A ?
Parameters¶
y: A
Returns¶
A ?
mod_partial¶
[Source]
Calculates the modulo of this number and y after floored division (fld).
The result has the sign of the divisor.
If y is 0 or the operation overflows, this function errors.
fun box mod_partial(
y: A)
: A ?
Parameters¶
y: A
Returns¶
A ?
neg_unsafe¶
[Source]
Unsafe operation.
If the operation overflows, the result is undefined.
fun box neg_unsafe()
: A
Returns¶
A
addc¶
[Source]
Add y to this integer and return the result and a flag indicating overflow.
fun box addc(
y: A)
: (A , Bool val)
Parameters¶
y: A
Returns¶
(A , Bool val)
subc¶
[Source]
Subtract y from this integer and return the result and a flag indicating overflow.
fun box subc(
y: A)
: (A , Bool val)
Parameters¶
y: A
Returns¶
(A , Bool val)
mulc¶
[Source]
Multiply y with this integer and return the result and a flag indicating overflow.
fun box mulc(
y: A)
: (A , Bool val)
Parameters¶
y: A
Returns¶
(A , Bool val)
divc¶
[Source]
Divide this integer by y and return the result and a flag indicating overflow or division by zero.
fun box divc(
y: A)
: (A , Bool val)
Parameters¶
y: A
Returns¶
(A , Bool val)
remc¶
[Source]
Calculate the remainder of this number divided by y and return the result and a flag indicating division by zero or overflow.
The result will have the sign of the dividend.
fun box remc(
y: A)
: (A , Bool val)
Parameters¶
y: A
Returns¶
(A , Bool val)
fldc¶
[Source]
Divide this integer by y and return the result, rounded towards negative infinity and a flag indicating overflow or division by zero.
fun box fldc(
y: A)
: (A , Bool val)
Parameters¶
y: A
Returns¶
(A , Bool val)
modc¶
[Source]
Calculate the modulo of this number after floored division by y and return the result and a flag indicating division by zero or overflow.
The result will have the sign of the divisor.
fun box modc(
y: A)
: (A , Bool val)
Parameters¶
y: A
Returns¶
(A , Bool val)
op_and¶
[Source]
fun box op_and(
y: A)
: A
Parameters¶
y: A
Returns¶
A
op_or¶
[Source]
fun box op_or(
y: A)
: A
Parameters¶
y: A
Returns¶
A
op_xor¶
[Source]
fun box op_xor(
y: A)
: A
Parameters¶
y: A
Returns¶
A
op_not¶
[Source]
fun box op_not()
: A
Returns¶
A
bit_reverse¶
[Source]
Reverse the order of the bits within the integer.
For example, 0b11101101 (237) would return 0b10110111 (183).
fun box bit_reverse()
: A
Returns¶
A
bswap¶
[Source]
fun box bswap()
: A
Returns¶
A
add¶
[Source]
fun box add(
y: A)
: A
Parameters¶
y: A
Returns¶
A
sub¶
[Source]
fun box sub(
y: A)
: A
Parameters¶
y: A
Returns¶
A
mul¶
[Source]
fun box mul(
y: A)
: A
Parameters¶
y: A
Returns¶
A
div¶
[Source]
fun box div(
y: A)
: A
Parameters¶
y: A
Returns¶
A
divrem¶
[Source]
fun box divrem(
y: A)
: (A , A)
Parameters¶
y: A
Returns¶
(A , A)
rem¶
[Source]
fun box rem(
y: A)
: A
Parameters¶
y: A
Returns¶
A
neg¶
[Source]
fun box neg()
: A
Returns¶
A
fld¶
[Source]
fun box fld(
y: A)
: A
Parameters¶
y: A
Returns¶
A
mod¶
[Source]
fun box mod(
y: A)
: A
Parameters¶
y: A
Returns¶
A
eq¶
[Source]
fun box eq(
y: box->A)
: Bool val
Parameters¶
y: box->A
Returns¶
Bool val
ne¶
[Source]
fun box ne(
y: box->A)
: Bool val
Parameters¶
y: box->A
Returns¶
Bool val
lt¶
[Source]
fun box lt(
y: box->A)
: Bool val
Parameters¶
y: box->A
Returns¶
Bool val
le¶
[Source]
fun box le(
y: box->A)
: Bool val
Parameters¶
y: box->A
Returns¶
Bool val
ge¶
[Source]
fun box ge(
y: box->A)
: Bool val
Parameters¶
y: box->A
Returns¶
Bool val
gt¶
[Source]
fun box gt(
y: box->A)
: Bool val
Parameters¶
y: box->A
Returns¶
Bool val
min¶
[Source]
fun box min(
y: A)
: A
Parameters¶
y: A
Returns¶
A
max¶
[Source]
fun box max(
y: A)
: A
Parameters¶
y: A
Returns¶
A
hash¶
[Source]
fun box hash()
: USize val
Returns¶
USize val
hash64¶
[Source]
fun box hash64()
: U64 val
Returns¶
U64 val
string¶
fun box string()
: String iso^
Returns¶
String iso^
i8¶
[Source]
fun box i8()
: I8 val
Returns¶
I8 val
i16¶
[Source]
fun box i16()
: I16 val
Returns¶
I16 val
i32¶
[Source]
fun box i32()
: I32 val
Returns¶
I32 val
i64¶
[Source]
fun box i64()
: I64 val
Returns¶
I64 val
i128¶
[Source]
fun box i128()
: I128 val
Returns¶
I128 val
ilong¶
[Source]
fun box ilong()
: ILong val
Returns¶
ILong val
isize¶
[Source]
fun box isize()
: ISize val
Returns¶
ISize val
u8¶
[Source]
fun box u8()
: U8 val
Returns¶
U8 val
u16¶
[Source]
fun box u16()
: U16 val
Returns¶
U16 val
u32¶
[Source]
fun box u32()
: U32 val
Returns¶
U32 val
u64¶
[Source]
fun box u64()
: U64 val
Returns¶
U64 val
u128¶
[Source]
fun box u128()
: U128 val
Returns¶
U128 val
ulong¶
[Source]
fun box ulong()
: ULong val
Returns¶
ULong val
usize¶
[Source]
fun box usize()
: USize val
Returns¶
USize val
f32¶
[Source]
fun box f32()
: F32 val
Returns¶
F32 val
f64¶
[Source]
fun box f64()
: F64 val
Returns¶
F64 val
i8_unsafe¶
[Source]
fun box i8_unsafe()
: I8 val
Returns¶
I8 val
i16_unsafe¶
[Source]
fun box i16_unsafe()
: I16 val
Returns¶
I16 val
i32_unsafe¶
[Source]
fun box i32_unsafe()
: I32 val
Returns¶
I32 val
i64_unsafe¶
[Source]
fun box i64_unsafe()
: I64 val
Returns¶
I64 val
i128_unsafe¶
[Source]
fun box i128_unsafe()
: I128 val
Returns¶
I128 val
ilong_unsafe¶
[Source]
fun box ilong_unsafe()
: ILong val
Returns¶
ILong val
isize_unsafe¶
[Source]
fun box isize_unsafe()
: ISize val
Returns¶
ISize val
u8_unsafe¶
[Source]
fun box u8_unsafe()
: U8 val
Returns¶
U8 val
u16_unsafe¶
[Source]
fun box u16_unsafe()
: U16 val
Returns¶
U16 val
u32_unsafe¶
[Source]
fun box u32_unsafe()
: U32 val
Returns¶
U32 val
u64_unsafe¶
[Source]
fun box u64_unsafe()
: U64 val
Returns¶
U64 val
u128_unsafe¶
[Source]
fun box u128_unsafe()
: U128 val
Returns¶
U128 val
ulong_unsafe¶
[Source]
fun box ulong_unsafe()
: ULong val
Returns¶
ULong val
usize_unsafe¶
[Source]
fun box usize_unsafe()
: USize val
Returns¶
USize val
f32_unsafe¶
[Source]
fun box f32_unsafe()
: F32 val
Returns¶
F32 val
f64_unsafe¶
[Source]
fun box f64_unsafe()
: F64 val
Returns¶
F64 val
compare¶
[Source]
fun box compare(
that: box->A)
: (Less val | Equal val | Greater val)
Parameters¶
that: box->A
Returns¶
(Less val | Equal val | Greater val)
| pony | 3864880 | https://sv.wikipedia.org/wiki/Anogcodes%20ustulatus | Anogcodes ustulatus | Anogcodes ustulatus är en skalbaggsart som först beskrevs av Giovanni Antonio Scopoli 1763. Anogcodes ustulatus ingår i släktet Anogcodes, och familjen blombaggar. Arten har ej påträffats i Sverige.
Källor
Externa länkar
Blombaggar
ustulatus | swedish | 1.369233 |
Pony/debug-DebugStream-.txt |
DebugStream¶
[Source]
type DebugStream is
(DebugOut val | DebugErr val)
Type Alias For¶
(DebugOut val | DebugErr val)
| pony | 4684882 | https://sv.wikipedia.org/wiki/Delphinium%20delavayi | Delphinium delavayi | Delphinium delavayi är en ranunkelväxtart som beskrevs av Adrien René Franchet. Delphinium delavayi ingår i släktet storriddarsporrar, och familjen ranunkelväxter.
Underarter
Arten delas in i följande underarter:
D. d. baoshanense
D. d. lasiandrum
D. d. pogonanthum
Källor
Externa länkar
Storriddarsporrar
delavayi | swedish | 1.248612 |
Pony/src-term-ansi_term-.txt |
ansi_term.pony
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387use "time"
use "signals"
use @ioctl[I32](fx: I32, cmd: ULong, ...) if posix
struct _TermSize
var row: U16 = 0
var col: U16 = 0
var xpixel: U16 = 0
var ypixel: U16 = 0
primitive _EscapeNone
primitive _EscapeStart
primitive _EscapeSS3
primitive _EscapeCSI
primitive _EscapeMod
type _EscapeState is
( _EscapeNone
| _EscapeStart
| _EscapeSS3
| _EscapeCSI
| _EscapeMod
)
class _TermResizeNotify is SignalNotify
let _term: ANSITerm tag
new create(term: ANSITerm tag) =>
_term = term
fun apply(times: U32): Bool =>
_term.size()
true
primitive _TIOCGWINSZ
fun apply(): ULong =>
ifdef linux then
21523
elseif osx or bsd then
1074295912
else
0
end
actor ANSITerm
"""
Handles ANSI escape codes from stdin.
"""
let _timers: Timers
var _timer: (Timer tag | None) = None
let _notify: ANSINotify
let _source: DisposableActor
var _escape: _EscapeState = _EscapeNone
var _esc_num: U8 = 0
var _esc_mod: U8 = 0
embed _esc_buf: Array[U8] = Array[U8]
var _closed: Bool = false
new create(
notify: ANSINotify iso,
source: DisposableActor,
timers: Timers = Timers)
=>
"""
Create a new ANSI term.
"""
_timers = timers
_notify = consume notify
_source = source
ifdef not windows then
SignalHandler(recover _TermResizeNotify(this) end, Sig.winch())
end
_size()
be apply(data: Array[U8] iso) =>
"""
Receives input from stdin.
"""
if _closed then
return
end
for c in (consume data).values() do
match _escape
| _EscapeNone =>
if c == 0x1B then
_escape = _EscapeStart
_esc_buf.push(0x1B)
else
_notify(this, c)
end
| _EscapeStart =>
match c
| 'b' =>
// alt-left
_esc_mod = 3
_left()
| 'f' =>
// alt-right
_esc_mod = 3
_right()
| 'O' =>
_escape = _EscapeSS3
_esc_buf.push(c)
| '[' =>
_escape = _EscapeCSI
_esc_buf.push(c)
else
_esc_flush()
end
| _EscapeSS3 =>
match c
| 'A' => _up()
| 'B' => _down()
| 'C' => _right()
| 'D' => _left()
| 'H' => _home()
| 'F' => _end()
| 'P' => _fn_key(1)
| 'Q' => _fn_key(2)
| 'R' => _fn_key(3)
| 'S' => _fn_key(4)
else
_esc_flush()
end
| _EscapeCSI =>
match c
| 'A' => _up()
| 'B' => _down()
| 'C' => _right()
| 'D' => _left()
| 'H' => _home()
| 'F' => _end()
| '~' => _keypad()
| ';' =>
_escape = _EscapeMod
| if (c >= '0') and (c <= '9') =>
// Escape number.
_esc_num = (_esc_num * 10) + (c - '0')
_esc_buf.push(c)
else
_esc_flush()
end
| _EscapeMod =>
match c
| 'A' => _up()
| 'B' => _down()
| 'C' => _right()
| 'D' => _left()
| 'H' => _home()
| 'F' => _end()
| '~' => _keypad()
| if (c >= '0') and (c <= '9') =>
// Escape modifier.
_esc_mod = (_esc_mod * 10) + (c - '0')
_esc_buf.push(c)
else
_esc_flush()
end
end
end
// If we are in the middle of an escape sequence, set a timer for 25 ms.
// If it fires, we send the escape sequence as if it was normal data.
if _escape isnt _EscapeNone then
if _timer isnt None then
try _timers.cancel(_timer as Timer tag) end
end
let t = recover
object is TimerNotify
let term: ANSITerm = this
fun ref apply(timer: Timer, count: U64): Bool =>
term._timeout()
false
end
end
let timer = Timer(consume t, 25000000)
_timer = timer
_timers(consume timer)
end
be prompt(value: String) =>
"""
Pass a prompt along to the notifier.
"""
_notify.prompt(this, value)
be size() =>
_size()
fun ref _size() =>
"""
Pass the window size to the notifier.
"""
let ws: _TermSize = _TermSize
ifdef posix then
@ioctl(0, _TIOCGWINSZ(), ws) // do error handling
_notify.size(ws.row, ws.col)
end
be dispose() =>
"""
Stop accepting input, inform the notifier we have closed, and dispose of
our source.
"""
if not _closed then
_esc_clear()
_notify.closed()
_source.dispose()
_closed = true
end
be _timeout() =>
"""
Our timer since receiving an ESC has expired. Send the buffered data as if
it was not an escape sequence.
"""
_timer = None
_esc_flush()
fun ref _mod(): (Bool, Bool, Bool) =>
"""
Set the modifier bools.
"""
let r = match _esc_mod
| 2 => (false, false, true)
| 3 => (false, true, false)
| 4 => (false, true, true)
| 5 => (true, false, false)
| 6 => (true, false, true)
| 7 => (true, true, false)
| 8 => (true, true, true)
else (false, false, false)
end
_esc_mod = 0
r
fun ref _keypad() =>
"""
An extended key.
"""
match _esc_num
| 1 => _home()
| 2 => _insert()
| 3 => _delete()
| 4 => _end()
| 5 => _page_up()
| 6 => _page_down()
| 11 => _fn_key(1)
| 12 => _fn_key(2)
| 13 => _fn_key(3)
| 14 => _fn_key(4)
| 15 => _fn_key(5)
| 17 => _fn_key(6)
| 18 => _fn_key(7)
| 19 => _fn_key(8)
| 20 => _fn_key(9)
| 21 => _fn_key(10)
| 23 => _fn_key(11)
| 24 => _fn_key(12)
| 25 => _fn_key(13)
| 26 => _fn_key(14)
| 28 => _fn_key(15)
| 29 => _fn_key(16)
| 31 => _fn_key(17)
| 32 => _fn_key(18)
| 33 => _fn_key(19)
| 34 => _fn_key(20)
end
fun ref _up() =>
"""
Up arrow.
"""
(let ctrl, let alt, let shift) = _mod()
_notify.up(ctrl, alt, shift)
_esc_clear()
fun ref _down() =>
"""
Down arrow.
"""
(let ctrl, let alt, let shift) = _mod()
_notify.down(ctrl, alt, shift)
_esc_clear()
fun ref _left() =>
"""
Left arrow.
"""
(let ctrl, let alt, let shift) = _mod()
_notify.left(ctrl, alt, shift)
_esc_clear()
fun ref _right() =>
"""
Right arrow.
"""
(let ctrl, let alt, let shift) = _mod()
_notify.right(ctrl, alt, shift)
_esc_clear()
fun ref _delete() =>
"""
Delete key.
"""
(let ctrl, let alt, let shift) = _mod()
_notify.delete(ctrl, alt, shift)
_esc_clear()
fun ref _insert() =>
"""
Insert key.
"""
(let ctrl, let alt, let shift) = _mod()
_notify.insert(ctrl, alt, shift)
_esc_clear()
fun ref _home() =>
"""
Home key.
"""
(let ctrl, let alt, let shift) = _mod()
_notify.home(ctrl, alt, shift)
_esc_clear()
fun ref _end() =>
"""
End key.
"""
(let ctrl, let alt, let shift) = _mod()
_notify.end_key(ctrl, alt, shift)
_esc_clear()
fun ref _page_up() =>
"""
Page up key.
"""
(let ctrl, let alt, let shift) = _mod()
_notify.page_up(ctrl, alt, shift)
_esc_clear()
fun ref _page_down() =>
"""
Page down key.
"""
(let ctrl, let alt, let shift) = _mod()
_notify.page_down(ctrl, alt, shift)
_esc_clear()
fun ref _fn_key(i: U8) =>
"""
Function key.
"""
(let ctrl, let alt, let shift) = _mod()
_notify.fn_key(i, ctrl, alt, shift)
_esc_clear()
fun ref _esc_flush() =>
"""
Pass a partial or unrecognised escape sequence to the notifier.
"""
for c in _esc_buf.values() do
_notify(this, c)
end
_esc_clear()
fun ref _esc_clear() =>
"""
Clear the escape state.
"""
if _timer isnt None then
try _timers.cancel(_timer as Timer tag) end
_timer = None
end
_escape = _EscapeNone
_esc_buf.clear()
_esc_num = 0
_esc_mod = 0
| pony | 155190 | https://da.wikipedia.org/wiki/Use%20Your%20Fingers | Use Your Fingers | Use Your Fingers udkom d. 18. July 1995 og er Bloodhound Gangs første album.
Titlen stammer fra en joke omkring sex, som en ven af gruppen har benyttet ofte.
Numre
[1:23] – "Rip Taylor Is God"
[2:39] – "We Are The Knuckleheads"
[3:05] – "Legend In My Spare Time"
[0:22] – "B.H.G.P.S.A."
[2:59] – "Mama Say"
[4:23] – "Kids In America" (cover af Kim Wilde's 1981 hit)
[3:56] – "You're Pretty When I'm Drunk"
[0:19] – "The Evils Of Placenta Hustling"
[3:05] – "One Way"
[0:58] – "Shitty Record Offer"
[2:26] – "Go Down"
[0:09] – "Earlameyer The Butt Pirate"
[2:50] – "No Rest For The Wicked"
[2:28] – "She Ain't Got No Legs"
[0:04] – "We Like Meat"
[2:36] – "Coo Coo Ca Choo"
[3:02] – "Rang Dang"
[0:56] – "Nightmare At The Apollo"
[2:20] – "K.I.D.S. Incorporated"
[0:47] – Untitled Hidden Track
Bloodhound Gang-album | danish | 1.233458 |
Pony/ini-IniMap-.txt |
IniMap¶
[Source]
type IniMap is
HashMap[String val, HashMap[String val, String val, HashEq[String val] val] ref, HashEq[String val] val] ref
Type Alias For¶
HashMap[String val, HashMap[String val, String val, HashEq[String val] val] ref, HashEq[String val] val] ref
| pony | 1022579 | https://sv.wikipedia.org/wiki/V%C3%A4rldsm%C3%A4sterskapet%20i%20handboll%20f%C3%B6r%20damer%202011 | Världsmästerskapet i handboll för damer 2011 | Världsmästerskapet i handboll för damer 2011 var det 20:e världsmästerskapet i handboll för damer som spelades i delstaten São Paulo i Brasilien den 2–18 december 2011 , och därmed var Brasilien första stat i Amerika där ett seniorvärldsmästerskap i handboll avgjordes. Norge vann finalen över Frankrike med 32-24 och blev världsmästare för andra gången. Spanien tog bronset efter seger mot Danmark med 24-18.
Hemmalag
Den 13 juli 2007 meddelade det internationella handbollsförbundet (IHF) att tre ansökningar gjorts om att få arrangera slutomgångarna:
Nederländerna hade tidigare anordnat turneringen två gånger 1971 och 1986, men slutomgången hade aldrig tidigare spelats i Sydamerika eller Oceanien.
Den 23 maj 2008 meddelade det internationella handbollsförbundet att bara Brasilien hade fortsatt intresse i att få arrangera, och att man förväntade sig fatta beslutet av arrangör på ett möte i oktober 2008, men först i februari 2009 kunde det brasilianska handbollsförbundet meddela officiellt att Brasilien skulle anordna turneringen.
Kvalificerade länder
Följande länder var kvalificerade för Handbolls-VM 2011:
Värdnation
Regerande världsmästare
Not: Inom parentes står det hur många platser varje kontinent hade, vilket gav totalt 22 länder. Utöver dessa hade värdnationen och de regerande världsmästarna varsin direktplats till turneringen
{| class="wikitable" style="margin-left:1em;"
|-
! colspan="2" style="width:240px;"|Europa (11 platser)
! style="width:130px;"|Afrika (3 platser)
! style="width:120px;"|Asien (4 platser)
! style="width:120px;"|Amerika (3 platser)
! style="width:120px;"|Oceanien (1 plats)
|- style="vertical-align:top;"
| style="padding-left:4px;"|
| style="padding-left:4px;"|
| style="padding-left:4px;"|
| style="padding-left:4px;"|
| style="padding-left:4px;"|
| style="padding-left:4px;"|
|}
Lottningen
Gruppindelningen lottades fram klockan 21:00 (lokal tid) den 2 juli 2011 i São Bernardo do Campo, Brasilien. Seedningen tillkännagavs den 24 juni 2011.
Gruppindelning
Efter att lottningen var avklarad spelade följande länder i grupperna :
Gruppspel
Spelsystem
De 24 lagen som var med i VM spelade i fyra grupper om sex lag i varje där alla mötte alla en gång. Matcherna spelades mellan den 2 och 9 december 2011. Därefter gick de fyra bästa lagen i varje grupp vidare till åttondelsfinaler, medan lag fem och sex i varje grupp spelade i "President's Cup" där gruppfemmorna gjorde upp om platserna 17–20 och gruppsexorna gjorde upp om platserna 21–24.
Grupp A
Not: S = Spelade matcher, V = Vinster, O = Oavgjorda matcher, F = Förluster, GM = Gjorda mål, IM = Insläppta mål, MS = Målskillnad, P = Poäng
Grupp B
Not: S = Spelade matcher, V = Vinster, O = Oavgjorda matcher, F = Förluster, GM = Gjorda mål, IM = Insläppta mål, MS = Målskillnad, P = Poäng
Grupp C
Not: S = Spelade matcher, V = Vinster, O = Oavgjorda matcher, F = Förluster, GM = Gjorda mål, IM = Insläppta mål, MS = Målskillnad, P = Poäng
Grupp D
Not: S = Spelade matcher, V = Vinster, O = Oavgjorda matcher, F = Förluster, GM = Gjorda mål, IM = Insläppta mål, MS = Målskillnad, P = Poäng
Slutspel
Åttondelsfinaler
Kvartsfinaler
Semifinaler
Bronsmatch
Final
Placeringsmatcher
5:e till 8:e plats
Match om 7:e plats
Match om 5:e plats
President's Cup
21:a till 24:e plats
Match om 23:e plats
Match om 21:a plats
17:e till 20:e plats
Match om 19:e plats
Match om 17:e plats
Slutplaceringar
Källor
Fotnoter
Externa länkar
Officiell hemsida för Handbolls-VM 2011
Resultat för Handbolls-VM 2011
2011 i Brasilien
Internationella handbollstävlingar i Brasilien
Handbollssäsongen 2011/2012
Handboll
Internationella sportevenemang i São Paulo
2011
São Paulo under 2000-talet | swedish | 1.190536 |
Pony/builtin-AsioEventNotify-.txt |
AsioEventNotify¶
[Source]
trait tag AsioEventNotify
| pony | 8755 | https://sv.wikipedia.org/wiki/AE | AE | AE eller Ae kan syfta på:
AE – ISO: 31-1, se Astronomisk enhet
AE – landskod för Förenade Arabemiraten
.ae – nationell toppdomän för Förenade Arabemiraten
AE – ett bild- och videoredigeringsprogram till datorn, se Adobe After Effects
AE – ett företag, se AB Atomenergi
Æ – en ligatur
Ae, Skottland – en by i Dumfries and Galloway, Skottland
Ae – det åldrade hjonet i Rigstula, se Rig | swedish | 1.189545 |
Pony/pony_check-ForAll4-.txt |
ForAll4[T1: T1, T2: T2, T3: T3, T4: T4]¶
[Source]
class ref ForAll4[T1: T1, T2: T2, T3: T3, T4: T4]
Constructors¶
create¶
[Source]
new ref create(
gen1': Generator[T1] val,
gen2': Generator[T2] val,
gen3': Generator[T3] val,
gen4': Generator[T4] val,
h: TestHelper val)
: ForAll4[T1, T2, T3, T4] ref^
Parameters¶
gen1': Generator[T1] val
gen2': Generator[T2] val
gen3': Generator[T3] val
gen4': Generator[T4] val
h: TestHelper val
Returns¶
ForAll4[T1, T2, T3, T4] ref^
Public Functions¶
apply¶
[Source]
fun ref apply(
prop: {(T1, T2, T3, T4, PropertyHelper) ?}[T1, T2, T3, T4] val)
: None val ?
Parameters¶
prop: {(T1, T2, T3, T4, PropertyHelper) ?}[T1, T2, T3, T4] val
Returns¶
None val ?
| pony | 287467 | https://sv.wikipedia.org/wiki/TTS | TTS | TTS kan syfta på:
Talsyntes (Text To Speech)
Tal och Ton Studioteknik
T-Tauri-stjärna
Teater Teamet Skiftinge
Tvillingtransfusionssyndrom
Girls' Generation-TTS (TaeTiSeo) | swedish | 0.951836 |
Pony/collections-persistent-HashSet-.txt |
HashSet[A: Any #share, H: HashFunction[A] val]¶
[Source]
A set, built on top of persistent Map. This is implemented as map of an
alias of a type to itself.
class val HashSet[A: Any #share, H: HashFunction[A] val] is
Comparable[HashSet[A, H] box] ref
Implements¶
Comparable[HashSet[A, H] box] ref
Constructors¶
create¶
[Source]
new val create()
: HashSet[A, H] val^
Returns¶
HashSet[A, H] val^
Public Functions¶
size¶
[Source]
Return the number of elements in the set.
fun box size()
: USize val
Returns¶
USize val
apply¶
[Source]
Return the value if it is in the set, otherwise raise an error.
fun box apply(
value: val->A)
: val->A ?
Parameters¶
value: val->A
Returns¶
val->A ?
contains¶
[Source]
Check whether the set contains the value.
fun box contains(
value: val->A)
: Bool val
Parameters¶
value: val->A
Returns¶
Bool val
add¶
[Source]
Return a set with the value added.
fun val add(
value: val->A)
: HashSet[A, H] val
Parameters¶
value: val->A
Returns¶
HashSet[A, H] val
sub¶
[Source]
Return a set with the value removed.
fun val sub(
value: val->A)
: HashSet[A, H] val
Parameters¶
value: val->A
Returns¶
HashSet[A, H] val
op_or¶
[Source]
Return a set with the elements of both this and that.
fun val op_or(
that: (HashSet[A, H] val | Iterator[A] ref))
: HashSet[A, H] val
Parameters¶
that: (HashSet[A, H] val | Iterator[A] ref)
Returns¶
HashSet[A, H] val
op_and¶
[Source]
Return a set with the elements that are in both this and that.
fun val op_and(
that: (HashSet[A, H] val | Iterator[A] ref))
: HashSet[A, H] val
Parameters¶
that: (HashSet[A, H] val | Iterator[A] ref)
Returns¶
HashSet[A, H] val
op_xor¶
[Source]
Return a set with elements that are in either this or that, but not both.
fun val op_xor(
that: (HashSet[A, H] val | Iterator[A] ref))
: HashSet[A, H] val
Parameters¶
that: (HashSet[A, H] val | Iterator[A] ref)
Returns¶
HashSet[A, H] val
without¶
[Source]
Return a set with the elements of this that are not in that.
fun val without(
that: (HashSet[A, H] val | Iterator[A] ref))
: HashSet[A, H] val
Parameters¶
that: (HashSet[A, H] val | Iterator[A] ref)
Returns¶
HashSet[A, H] val
eq¶
[Source]
Return true if this and that contain the same elements.
fun box eq(
that: HashSet[A, H] box)
: Bool val
Parameters¶
that: HashSet[A, H] box
Returns¶
Bool val
lt¶
[Source]
Return true if every element in this is also in that, and this has fewer
elements than that.
fun box lt(
that: HashSet[A, H] box)
: Bool val
Parameters¶
that: HashSet[A, H] box
Returns¶
Bool val
le¶
[Source]
Return true if every element in this is also in that.
fun box le(
that: HashSet[A, H] box)
: Bool val
Parameters¶
that: HashSet[A, H] box
Returns¶
Bool val
gt¶
[Source]
Return true if every element in that is also in this, and this has more
elements than that.
fun box gt(
that: HashSet[A, H] box)
: Bool val
Parameters¶
that: HashSet[A, H] box
Returns¶
Bool val
ge¶
[Source]
Return true if every element in that is also in this.
fun box ge(
that: HashSet[A, H] box)
: Bool val
Parameters¶
that: HashSet[A, H] box
Returns¶
Bool val
values¶
[Source]
Return an iterator over the values in the set.
fun box values()
: Iterator[A] ref^
Returns¶
Iterator[A] ref^
compare¶
[Source]
fun box compare(
that: HashSet[A, H] box)
: (Less val | Equal val | Greater val)
Parameters¶
that: HashSet[A, H] box
Returns¶
(Less val | Equal val | Greater val)
ne¶
[Source]
fun box ne(
that: HashSet[A, H] box)
: Bool val
Parameters¶
that: HashSet[A, H] box
Returns¶
Bool val
| pony | 3614785 | https://sv.wikipedia.org/wiki/Hadrops%20halei | Hadrops halei | Hadrops halei är en skalbaggsart som beskrevs av Britton 1987. Hadrops halei ingår i släktet Hadrops och familjen Melolonthidae. Inga underarter finns listade i Catalogue of Life.
Källor
Skalbaggar
halei | swedish | 1.142957 |
Pony/collections-HashEq64-.txt |
HashEq64[A: (Hashable64 #read & Equatable[A] #read)]¶
[Source]
primitive val HashEq64[A: (Hashable64 #read & Equatable[A] #read)] is
HashFunction64[A] val
Implements¶
HashFunction64[A] val
Constructors¶
create¶
[Source]
new val create()
: HashEq64[A] val^
Returns¶
HashEq64[A] val^
Public Functions¶
hash64¶
[Source]
Use the hash function from the type parameter.
fun box hash64(
x: box->A)
: U64 val
Parameters¶
x: box->A
Returns¶
U64 val
eq¶
[Source]
Use the structural equality function from the type parameter.
fun box eq(
x: box->A,
y: box->A)
: Bool val
Parameters¶
x: box->A
y: box->A
Returns¶
Bool val
ne¶
[Source]
fun box ne(
that: HashEq64[A] val)
: Bool val
Parameters¶
that: HashEq64[A] val
Returns¶
Bool val
| pony | 1012927 | https://no.wikipedia.org/wiki/Mar%C4%ABnidene | Marīnidene | {{Infoboks tidligere land
|lokalenavn= Al-Marīnīyūn
|norsknavn=Idrisidene
|flagg=Flag of Morocco (1258-1659).svg
|våpen=Marinid emblem of Morocco.svg
|våpenstørrelse=
|språk= Berber, arabisk
|hovedstad= Fās
|styreform= Monarki
|statsoverhode= Sultan
|religion=Religion
|kirke=Sunniislam
|areal=
|arealår=
|valuta=
|befolkning=
|befolkningsår=
|eksistens=1215–1465
|plassering=Marinid dynasty 1258 - 1420 (AD).PNG}}
Marīnidene (arabisk: ) eller Banū Marīn (; fra berbersk Ayt Mrin'') var et zenateaberbersk marokkansk dynasti. Marīnidene overtok kontrollen over Marokko fra almohadene i 1244, og fra midten av 1300-tallet til 1400-tallet kontrollerte de det meste av al-Maġrib, og de støttet kongedømmet Granada i al-Andalus i det trettende og fjortende århundre. Det siste marīnidiske besetningen på Den iberiske halvøy ble erobret av Castilla i 1344, og i Marokko ble de erstattet av waṭāsidene i 1465. Det var marīnidene som grunnla Fes Jdid og bygde de viktigste monumentene i Fez.
Marīnid-herskere
ʿAbd al-Haqq I (1195–1217)
ʿUṯmān I (1217–1240)
Muḥammad I (1240–1244)
Abū Yaḥyā ibn ʿAbd al-Haqq (1244–1258)
ʿUmar (1258–1259)
Abū Yūsuf Yaʿqub (1259–1286)
Abū Yaʿqub Yūsuf (1286–1306)
Abū Ṯābit ʿĀmir (1307–1308)
Abū ar-Rabīʿ Sulaymān (1308–1310)
Abū SaʿīdʿUṯmān II (1310–1331)
Abū al-Ḥasan ʿAlī (1331–1348)
Abū ʿInān Fāris (1348–1358)
Muḥammad II as-Saʿīd (1359)
Abū Salim ʿAlī II (1359–1361)
Abū ʿUmar Tāšfīn (1361)
Abū az-Zayyānʿ Muḥammad III (1362–1366)
Abū al-FārisʿAbd al-Azīz I (1366–1372)
Abū al-ʿAbbās Aḥmad (1372–1374)
Abū az-Zayyānʿ Muḥammad IV (1384–1386)
Muḥammad V (1386–1387)
Abū al-ʿAbbās Aḥmad (1387–1393)
ʿAbd al-Azīz II (1393–1398)
ʿAbd Allāh (1398–1399)
Abū Saʿīd ʿUṯmān III (1399–1420)
ʿAbd al-Haqq II (1420–1465)
Marīnidvisirer
Askar ibn Tahabrit (1344)
Under Waṭāsidene
Abū Zakariyā Yaḥyā (1420–1448)
ʿAlī ibn Yūsuf (1448–1458)
Yaḥyā ibn Abī Zakariyā Yaḥyā (1458–1459)
Referanser
Marokkos historie
Algeries historie
Tidligere stater i Afrika
Stater og territorier etablert i 1244
Stater og territorier opphørt i 1465 | norwegian_bokmål | 1.173833 |
Pony/capsicum-CapRights0-.txt |
CapRights0¶
[Source]
Version 0 of the capsicum cap_rights_t structure.
class ref CapRights0
Constructors¶
create¶
[Source]
Initialises with no rights.
new ref create()
: CapRights0 ref^
Returns¶
CapRights0 ref^
from¶
[Source]
Initialises with the rights from a FileCaps.
new ref from(
caps: Flags[(FileCreate val | FileChmod val | FileChown val | FileLink val | FileLookup val | FileMkdir val | FileRead val | FileRemove val | FileRename val | FileSeek val | FileStat val | FileSync val | FileTime val | FileTruncate val | FileWrite val | FileExec val), U32 val] box)
: CapRights0 ref^
Parameters¶
caps: Flags[(FileCreate val | FileChmod val | FileChown val | FileLink val | FileLookup val | FileMkdir val | FileRead val | FileRemove val | FileRename val | FileSeek val | FileStat val | FileSync val | FileTime val | FileTruncate val | FileWrite val | FileExec val), U32 val] box
Returns¶
CapRights0 ref^
descriptor¶
[Source]
Initialises with the rights on the given file descriptor.
new ref descriptor(
fd: I32 val)
: CapRights0 ref^
Parameters¶
fd: I32 val
Returns¶
CapRights0 ref^
Public Functions¶
set¶
[Source]
fun ref set(
cap: U64 val)
: None val
Parameters¶
cap: U64 val
Returns¶
None val
unset¶
[Source]
fun ref unset(
cap: U64 val)
: None val
Parameters¶
cap: U64 val
Returns¶
None val
limit¶
[Source]
Limits the fd to the encoded rights.
fun box limit(
fd: I32 val)
: Bool val
Parameters¶
fd: I32 val
Returns¶
Bool val
merge¶
[Source]
Merge the rights in that into this.
fun ref merge(
that: CapRights0 ref)
: None val
Parameters¶
that: CapRights0 ref
Returns¶
None val
remove¶
[Source]
Remove the rights in that from this.
fun ref remove(
that: CapRights0 ref)
: None val
Parameters¶
that: CapRights0 ref
Returns¶
None val
clear¶
[Source]
Clear all rights.
fun ref clear()
: None val
Returns¶
None val
contains¶
[Source]
Check that this is a superset of the rights in that.
fun box contains(
that: CapRights0 ref)
: Bool val
Parameters¶
that: CapRights0 ref
Returns¶
Bool val
| pony | 598493 | https://sv.wikipedia.org/wiki/Comma-separated%20values | Comma-separated values | Comma-separated values (engelska för ’kommaseparerade värden’), CSV, är en grupp textfilsformat som används för att spara och överföra tabelldata. CSV är inte ett standardiserat format. Olika applikationer använder olika separatorer och teckenkodningar.
Vanligen används filändelsen .csv för filer med denna typ av format. För semikolon-separerade filer används ibland filändelsen .skv.
Filstruktur
En tabells celler sparas rad för rad, vänster till höger, uppifrån och ner. Cellernas innehåll sparas som text som avgränsas med ett tecken. Dessa tecken är olika beroende på applikation. Rader separeras vanligen med radbrytning. Kolumner kan (som namnet antyder) separeras av komma, men tab, kolon, semikolon och lodstreck (vertikalstreck) är också vanliga.
Om ett separatortecken ingår i en cells text blir CSV-filen inkorrekt. Vissa CSV-format löser detta att genom att cellen omges av en ytterligare avgränsade, till exempel citattecken. Om citattecknen i sig är med i en cells text så kan detta lösas till exempel genom att tecknet dubbleras.
Exempel
En tabell med Quentin Tarantinos filmer.
CSV-representation av samma tabell sparad med kolon som separator. Notera att citattecken används för att kolon-tecknen i titlarna Kill Bill: Volume 1 och Kill Bill: Volume 2 inte ska göra filen korrupt.
Film:År:Distributör
Reservoir Dogs:1992:Miramax
Pulp Fiction:1994:Miramax
Jackie Brown:1997:Miramax
"Kill Bill: Volume 1":2003:Miramax
"Kill Bill: Volume 2":2004:Miramax
Death Proof:2007:Dimension Films
Inglourious Basterds:2009:Universal Pictures
Django Unchained:2012:Sony Pictures Releasing
The Hateful Eight:2015:The Weinstein Company
Once Upon A Time in Hollywood:2019:Sony Pictures
Referenser
Filformat | swedish | 0.790796 |
Pony/builtin-NullablePointer-.txt |
NullablePointer[A: A]¶
[Source]
A NullablePointer[A] is used to encode a possibly-null type. It should
only be used for structs that need to be passed to and from the C FFI.
An optional type for anything that isn't a struct should be encoded as a
union type, for example (A | None).
struct ref NullablePointer[A: A]
Constructors¶
create¶
[Source]
This re-encodes the type of that from A to NullablePointer[A], allowing
that to be assigned to a field or variable of type NullablePointer[A]. It
doesn't allocate a wrapper object: there is no containing object for that.
new ref create(
that: A)
: NullablePointer[A] ref^
Parameters¶
that: A
Returns¶
NullablePointer[A] ref^
none¶
[Source]
This returns a null pointer typed as a NullablePointer[A].
new ref none()
: NullablePointer[A] ref^
Returns¶
NullablePointer[A] ref^
Public Functions¶
apply¶
[Source]
This re-encodes the type of this from NullablePointer[A] to A, allowing
this to be assigned to a field of variable of type A. If this is a null
pointer, an error is raised.
fun box apply()
: this->A ?
Returns¶
this->A ?
is_none¶
[Source]
Returns true if this is null (ie apply would raise an error).
fun box is_none()
: Bool val
Returns¶
Bool val
| pony | 227652 | https://da.wikipedia.org/wiki/Automatically%20Tuned%20Linear%20Algebra%20Software | Automatically Tuned Linear Algebra Software | Automatically Tuned Linear Algebra Software (ATLAS) er et programbibliotek til lineær algebra. ATLAS tilbyder en moden open source implementation med BLAS API til C og Fortran77.
ATLAS bliver ofte anbefalet som en automatisk optimerende måde at anvende BLAS programbiblioteket på.
ATLAS kører på de fleste Unix-lignende systemer og på Microsoft Windows (via Cygwin). ATLAS er frigivet under en BSD-licens og mange kendte matematikprogrammer anvender ATLAS: Maple, MATLAB, Mathematica og GNU Octave.
Se også
LAPACK
Eksterne henvisninger
math-atlas.sourceforge.net Project homepage
User contribution to ATLAS
A Collaborative guide to ATLAS Development
The FAQ has links to the Quick reference guide to BLAS and Quick reference to ATLAS LAPACK API reference
Microsoft Visual C++ Howto for ATLAS
Matematiske værktøjer
Lineær algebra | danish | 1.192878 |
Pony/pony_check-ForAll-.txt |
ForAll[T: T]¶
[Source]
class ref ForAll[T: T]
Constructors¶
create¶
[Source]
new ref create(
gen': Generator[T] val,
testHelper: TestHelper val)
: ForAll[T] ref^
Parameters¶
gen': Generator[T] val
testHelper: TestHelper val
Returns¶
ForAll[T] ref^
Public Functions¶
apply¶
[Source]
execute
fun ref apply(
prop: {(T, PropertyHelper) ?}[T] val)
: None val ?
Parameters¶
prop: {(T, PropertyHelper) ?}[T] val
Returns¶
None val ?
| pony | 1019516 | https://da.wikipedia.org/wiki/TI-89 | TI-89 | TI-89 og TI-89 Titanium er en tidligere serie af grafiske lommeregnere, der er udviklet af det amerikanske firma Texas Instruments (TI). Serien adskiller sig fra andre af TI's grafiske lommeregnere med samme størrelse ved at have Computer Algebra System (CAS). CAS muliggør symbolsk manipulation af algebraiske udtryk; dermed kan TI-89 løse ligninger med eksakte løsninger. TI-89 kan desuden regne med SI-enheder (se tabel nedenfor) og løse differentialligninger såvel grafisk (se tabel nedenfor) som algebraisk (se fig. 4 & 6).
Beskrivelse
TI-89 er en TI-92 Plus uden QWERTY-tastatur og med mindre display. TI-89 blev optaget i sortimentet, fordi en grafisk lommeregner med QWERTY-tastatur ikke er tilladt at medbringe ved standardiserede tests i USA (Scholastic Assessment Test). Derimod var det tilladt at medbringe en grafisk lommeregner uden QWERTY-tastatur; deraf opstod TI's ønske om at introducere en mindre grafisk lommeregener med CAS.
Specifikationer
Lommeregnerens CAS gør TI-89 i stand til at løse ligninger med eksakte løsninger; i modsætning til TI-83, der kun kan beregne tilnærmede (approksimerede) løsninger. Dertil kommer, at TI-89 understøtter PrettyPrint, der forbedrer indtastningers og løsningers afbildning på displayet. TI-89 har en M68k-processor, der er fremstillet af Motorola. TI-89 har LCD display og Flash-lager. Flash-lageret gør det muligt at gemme variabler, programmer, tabeller, lister, matrixer og/eller spil. TI-89 bruger disse batterier: 4 stk. AAA
TI-89 serien har flere features (uddrag)
Se flere features og kommandoer her:
PrettyPrint (ligesom equation editor og LaTeX)
Beregne trigonometriske værdier eksakt, eksempelvis: og også det tilnærmede resultat
Symbolsk visning af og og (Se tabel nedenfor.)
Regne med komplekse tal
Såvel 2D som 3D tegning af funktions graf (Se fig. 5)
Tegne cirkler
Faktorisere polynomium med kommandoen: factor(polynomium) ; et polynomium med komplekse rødder faktoriserer TI-89 med kommandoen cfactor(polynomium) (Se tabel nedenfor.)
Beregne Taylorpolynomier
Beregne sumrække (summation)
Foretage Chi-i-anden-test
Foretage matrix-beregninger og -manipulation
Foretage vektorregning
Beregne grænseværdier
Ang. sandsynlighedsregning kan TI-89 beregne antal permutationer og antal kombinationer samt beregninger for binominalfordelingen og normalfordeling
Løse ligninger med kommandoen: solve(ligning,) eller nsolve(ligning,) ; kommandoen kan findes ved at taste CATALOG-tasten (se fig. 1 & 2 & 6). En ligning med komplekse løsninger løser TI-89 med kommandoen: csolve(ligning,)
Beregne differenitalkvotienter med kommandoen: d(funktion,) ; kommandoen findes ved at taste: "2nd" "8" (se fig. 1 & 2 & 6).
Beregne ubestemt integraler (stamfunktioner) med kommandoen: ∫(funktion,) ; kommandoen findes ved at taste: "2nd" "7" (se fig. 1 & 2 & 6).
Beregne bestemt integral (arealer) med kommandoen: ∫(funktion,,,) ; kommandoen findes ved at taste: "2nd" "7" (se fig. 1 & 2 & 6).
Regne med eheder (bl.a. SI-enheder) ved at tilføje underscore _ sådan: "diamant" "MODE" (se fig. 1 & 2 & 3)
Løse såvel første ordens differentialligninger som anden ordens differentialligninger grafisk. Grafregneren løser differentialligning grafisk ved at tegne linjeelementer og integralkurver. (Se tabel nedenfor.)
Løse første ordens differentialligninger algebraisk med kommandoen: deSolve( … ) eller desolve( … ) (Se fig. 4).
Løse anden ordens differentialligninger algebraisk med kommandoen: deSolve(… ) (Se tabel nedenfor.)
Historie
Der findes to typer af denne grafregner:
I 1998 kom TI-89 i handlen, Denne oprindelige type findes i to forskellige farver (se fig. 1 & 2).
I 2004 blev det muligt at købe den grå TI-89 Titanium (se fig. 3 & 6). TI-89 Titanium var en nyere model, som skulle fremtidssikre TI-89 serien. TI-89 Titanium har dobbelt så stort Flash-lager som den oprindelige TI-89. TI-89 Titaniums Flash-lager omfatter 256 KB RAM (heraf 188 KB tilgængelig for brugeren). Som et yderligere tiltag til at fremtidssikre lommeregneren havde TI-89 Titanium en integreret USB-port.
Programmering
På TI-98 kan man selv skrive små programmer i programmeringssproget TI-BASIC. Dette er egnet til små matematiske makros. Ved hjælp af en computer kan man også skrive programmer i programmeringssproget C, som via TIGCC bliver oversat og transmitteret via TI-Connect.
TI-89 som app og TI-89 Titanium som online simulator
Den farverige, oprindelige TI-89 (se fig. 1) findes som app til styresystemet Android.
Den grå TI-89 Titanium (se fig. 6) findes som online simulator.
Anvendelse i skoler og universiteter
TI-89 er tilladt i skoler i både USA, Storbritannien og Tyskland. TI-89 er nævnt på Danske Science Gymnasiers hjemmeside.
Flere danske universiteter har nævnt TI-89 på sine hjemmesider: DTU, KU, AU, AAU, RUC & SDU.
Presseomtale
I tidsskriftet Ingeniøren er TI-89 er omtalt som alternativ til det matematiske software Maple, idet TI-89 og Maple har flere kommandoer til fælles.
Flere TI-grafregnere med CAS
TI-89 er en af flere serier grafregnere med CAS
Tabel
TI-89 simulator hører til denne gruppe af CAS-softwares
* løser også triple integraler.
Eksterne henvisninger
Liste af Texas Instruments grafiske lommeregnere (engelsk)
List of computer algebra systems (engelsk)
Referencer
Lommeregnere
Texas Instruments
Computeralgebrasystem | danish | 1.032393 |
Pony/collections-HashEq-.txt |
HashEq[A: (Hashable #read & Equatable[A] #read)]¶
[Source]
primitive val HashEq[A: (Hashable #read & Equatable[A] #read)] is
HashFunction[A] val
Implements¶
HashFunction[A] val
Constructors¶
create¶
[Source]
new val create()
: HashEq[A] val^
Returns¶
HashEq[A] val^
Public Functions¶
hash¶
[Source]
Use the hash function from the type parameter.
fun box hash(
x: box->A)
: USize val
Parameters¶
x: box->A
Returns¶
USize val
eq¶
[Source]
Use the structural equality function from the type parameter.
fun box eq(
x: box->A,
y: box->A)
: Bool val
Parameters¶
x: box->A
y: box->A
Returns¶
Bool val
ne¶
[Source]
fun box ne(
that: HashEq[A] val)
: Bool val
Parameters¶
that: HashEq[A] val
Returns¶
Bool val
| pony | 1974416 | https://sv.wikipedia.org/wiki/Ainigmaptilon%20haswelli | Ainigmaptilon haswelli | Ainigmaptilon haswelli är en korallart som beskrevs av Dean 1926. Ainigmaptilon haswelli ingår i släktet Ainigmaptilon och familjen Primnoidae.
Artens utbredningsområde är Södra Ishavet. Inga underarter finns listade i Catalogue of Life.
Källor
Koralldjur
haswelli | swedish | 1.292571 |
Pony/src-pony_check-pony_check-.txt |
pony_check.pony
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151"""
PonyCheck is a library for property based testing
with tight integration into PonyTest.
## Property Based Testing
In _traditional_ unit testing, the developer specifies one or more input
examples manually for the class or system under test and asserts on certain
output conditions. The difficulty here is to find enough examples to cover
all branches and cases of the class or system under test.
In property based testing, the developer defines a property, a kind of predicate
for the class or system under test that should hold for all kinds or just a
subset of possible input values. The property based testing engine then
generates a big number of random input values and checks if the property holds
for all of them. The developer only needs to specify the possible set of input
values using a Generator.
This testing technique is great for finding edge cases that would easily go
unnoticed with manually constructed test samples. In general it can lead to much
higher coverage than traditional unit testing, with much less code to write.
## How PonyCheck implements Property Based Testing
A property based test in PonyCheck consists of the following:
* A name (mostly for integration into PonyTest)
* One or more generators, depending on how your property is laid out.
There are tons of them defined in the primitive
[Generators](pony_check-Generators.md).
* A `property` method that asserts a certain property for each sample
generated by the [Generator(s)](pony_check-Generator.md) with the help of
[PropertyHelper](pony_check-PropertyHelper.md), which tries to expose a
similar API as [TestHelper](pony_test-TestHelper.md).
* Optionally, the method `params()` can be used to configure how PonyCheck
executes the property by specifying a custom
[PropertyParams](pony_check-PropertyParams.md) object.
The classical list-reverse example:
```pony
use "collections"
use "pony_check"
class ListReverseProperty is Property1[List[USize]]
fun name(): String => "list/reverse"
fun gen(): Generator[List[USize]] =>
Generators.list_of[USize](Generators.usize())
fun property(arg1: List[USize], ph: PropertyHelper) =>
ph.array_eq[USize](arg1, arg1.reverse().reverse())
```
## Integration into PonyTest
There are two ways of integrating a [Property](pony_check-Property1.md) into
[PonyTest](pony_test--index.md):
1. In order to pass your Property to the PonyTest engine, you need to wrap it
inside a [Property1UnitTest](pony_check-Property1UnitTest.md).
```pony
actor Main is TestList
new create(env: Env) => PonyTest(env, this)
fun tag tests(test: PonyTest) =>
test(Property1UnitTest[String](MyStringProperty))
```
2. Run as many [Properties](pony_check-Property1.md) as you wish inside one
PonyTest [UnitTest](pony_test-UnitTest.md) using the convenience function
[PonyCheck.for_all](pony_check-PonyCheck.md#for_all) providing a
[Generator](pony_check-Generator), the [TestHelper](pony_test-TestHelper.md)
and the actual property function. (Note that the property function is supplied
in a second application of the result to `for_all`.)
```pony
class ListReversePropertyWithinAUnitTest is UnitTest
fun name(): String => "list/reverse/forall"
fun apply(h: TestHelper) =>
let gen = recover val Generators.list_of[USize](Generators.usize()) end
PonyCheck.for_all[List[USize]](gen, h)(
{(sample, ph) =>
ph.array_eq[Usize](arg1, arg1.reverse().reverse())
})
// ... possibly more properties, using `PonyCheck.for_all`
```
Independently of how you integrate with [PonyTest](pony_test--index.md),
the PonyCheck machinery will instantiate the provided Generator, and will
execute it for a configurable number of samples.
If the property fails using an assertion method of
[PropertyHelper](pony_check-PropertyHelper.md),
the failed example will be shrunken by the generator
to obtain a smaller and more informative, still failing, sample
for reporting.
"""
use "pony_test"
primitive PonyCheck
fun for_all[T](gen: Generator[T] val, h: TestHelper): ForAll[T] =>
"""
Convenience method for running 1 to many properties as part of
one PonyTest UnitTest.
Example:
```pony
class MyTestWithSomeProperties is UnitTest
fun name(): String => "mytest/withMultipleProperties"
fun apply(h: TestHelper) =>
PonyCheck.for_all[U8](recover Generators.unit[U8](0) end, h)(
{(u, h) =>
h.assert_eq(u, 0)
consume u
})
```
"""
ForAll[T](gen, h)
fun for_all2[T1, T2](
gen1: Generator[T1] val,
gen2: Generator[T2] val,
h: TestHelper)
: ForAll2[T1, T2]
=>
ForAll2[T1, T2](gen1, gen2, h)
fun for_all3[T1, T2, T3](
gen1: Generator[T1] val,
gen2: Generator[T2] val,
gen3: Generator[T3] val,
h: TestHelper)
: ForAll3[T1, T2, T3]
=>
ForAll3[T1, T2, T3](gen1, gen2, gen3, h)
fun for_all4[T1, T2, T3, T4](
gen1: Generator[T1] val,
gen2: Generator[T2] val,
gen3: Generator[T3] val,
gen4: Generator[T4] val,
h: TestHelper)
: ForAll4[T1, T2, T3, T4]
=>
ForAll4[T1, T2, T3, T4](gen1, gen2, gen3, gen4, h)
| pony | 2842795 | https://sv.wikipedia.org/wiki/Phyllonorycter%20triplex | Phyllonorycter triplex | Phyllonorycter triplex är en fjärilsart som först beskrevs av Edward Meyrick 1914. Phyllonorycter triplex ingår i släktet guldmalar, och familjen styltmalar. Inga underarter finns listade i Catalogue of Life.
Källor
Guldmalar
triplex | swedish | 1.329679 |
Pony/src-backpressure-backpressure-.txt |
backpressure.pony
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96"""
# Backpressure Package
The Backpressure package allows Pony programmers to participate in Pony's
runtime backpressure system. The goal of the backpressure system is to prevent
an actor's mailbox from growing at an unbounded rate.
At a high level, the runtime backpressure system works by adjusting the
scheduling of actors. When an actor becomes overloaded, the Pony runtime will
deprioritize scheduling the actors that are sending to it. This change in
scheduling allows the overloaded actor to catch up.
The Pony runtime can detect overloading based on message queue size. However,
the overloading of some types of actors is harder to detect. Let's take the
case of actors like `TCPConnection`.
`TCPConnection` manages a socket for sending data to and receiving data from
another process. TCP connections can experience backpressure from outside
our Pony program that prevents them from sending. There's no way for the Pony
runtime to detect this, so intervention by the programmer is needed.
`TCPConnection` is a single example. This Backpressure package exists to allow
a programmer to indicate to the runtime that a given actor is experiencing
pressure and sending messages to it should be adjusted accordingly.
Any actor that needs to be able to tell the runtime to "send me messages
slower" due to external conditions can do so via this package. Additionally,
actors that maintain their own internal queues of any sort, say for buffering,
are also prime candidates for using this package. If an actor's internal
queue grows too large, it can call `Backpressure.apply` to let the runtime know
it is under pressure.
## Example program
```pony
// Here we have a TCPConnectionNotify that upon construction
// is given a ApplyReleaseBackpressureAuth token. This allows the notifier
// to inform the Pony runtime when to apply and release backpressure
// as the connection experiences it.
// Note the calls to
//
// Backpressure.apply(_auth)
// Backpressure.release(_auth)
//
// that apply and release backpressure as needed
use "backpressure"
use "collections"
use "net"
class SlowDown is TCPConnectionNotify
let _auth: ApplyReleaseBackpressureAuth
let _out: OutStream
new iso create(auth: ApplyReleaseBackpressureAuth, out: OutStream) =>
_auth = auth
_out = out
fun ref throttled(connection: TCPConnection ref) =>
_out.print("Experiencing backpressure!")
Backpressure.apply(_auth)
fun ref unthrottled(connection: TCPConnection ref) =>
_out.print("Releasing backpressure!")
Backpressure.release(_auth)
fun ref connect_failed(conn: TCPConnection ref) =>
None
actor Main
new create(env: Env) =>
let socket = TCPConnection(TCPConnectAuth(env.root),
recover SlowDown(
ApplyReleaseBackpressureAuth(env.root), env.out) end, "", "7669")
```
## Caveat
The runtime backpressure is a powerful system. By intervening, programmers can
create deadlocks. Any call to `Backpressure.apply` should be matched by a
corresponding call to `Backpressure.release`. Authorization via the
`ApplyReleaseBackpressureAuth` capability is required to apply or release
backpressure. By requiring that the caller have a token to apply or release a
backpressure, rouge 3rd party library code can't run wild and unknowingly
interfere with the runtime.
"""
use @pony_apply_backpressure[None]()
use @pony_release_backpressure[None]()
primitive Backpressure
fun apply(auth: ApplyReleaseBackpressureAuth) =>
@pony_apply_backpressure()
fun release(auth: ApplyReleaseBackpressureAuth) =>
@pony_release_backpressure()
| pony | 711793 | https://da.wikipedia.org/wiki/Nmap | Nmap | Nmap (engl: Network Mapper, "Netværkskortlægger") er et gratis og open source hjælpeprogram til netværksanalyse, herunder overvågning af netværkets sikkerhed. Mange system- og netværksadministratorer bruger en sådan type software til opgaver som netværksoversigt, registrering af webservicer, overvågning af værter og datanettets servicekvalitet.
Beskrivelse
Nmap bruger rå Ip-pakker til at bestemme, hvilke værter der er tilgængelige på netværket, hvilke tjenester disse værter tilbyder, hvilke styresystemer (OS-versioner) de kører, hvilken type pakkefiltre/firewalls der er i brug og flere andre egenskaber.
Programmet blev udformet for hurtigt at kunne skanne store netværk, men fungerer også for enkeltstående værter og klienter. Nmap kører på alle større styresystemer, og de officielle binære pakker er tilgængelige til Linux, Windows og Mac OS X.
I tillæg til den klassiske kommandolinje indeholder Nmap suite flere stykker værktøj der kan anvendes via en grafisk brugerflade (GUI) og en resultatviewer (betragter, fremviser). Et hjælpeprogram til dataoverførsel, omdirigering, og debugging, et hjælpeprogram til sammenligning af skanningsresultater ('Ndiff') og et pakkegenererings- og responsanalyseværktøj ('Nping').
Kommandoer
Et eksempel hvor man skanner hele netværksadressen fra 192.168.1.1 til 192.168.1.255.
nmap -T4 -F 192.168.1.0/24
En netværksskanning hvor der også kontrolleres for styresystemet med tilføjelsen "-O" (flag, switch)
nmap -T4 -F -O 192.168.1.0/24
Historie
12. december 1998
Nmap 2.00 frigivet, herunder bestemmelse af styresystemet med fingeraftryk.
11. april 1999
NmapFE, en GTK+ frontend er nu er sammen med Nmap.
7. december 2000
Nmap fås nu også til Windows, ('porteret til Windows')
28. august 2002
Programmet er genskrevet fra programmeringssproget C til C++.
16. september 2003
Nmap 3.45, den første offentlige udgivelse der omfatter identifikation af tjenester, webservicer.
31. august 2004
"Core scan"-motoren omskrevet af versionen 3.70. Ny motor kaldes nu "ultra scan".
13. december 2007
Nmap 4,50, den 10. Jubilæumsversion som omfatter en ny frontend til Zenmap og 2. generationsbestemmelse af styresystem.
30. marts 2009
Specielt produceret Nmap 4.85 BETA5, til at opdage infektioner med "Conficker"-ormen.
16. juli 2009
Nmap 5.00 inkluderer en erstatning for 'Netcat': skanningsværktøjerne Ncat og Ndiff
28. januar 2011
Nmap 5.50 frigivet, herunder den nye Nping, et pakkegenererings- og responsanalyseværktøj ('ping')
21 maj 2012
Nmap 6.00 frigivet med fuld undersstøttelse af internetprotokollen IPv6..
Eksempel : kommando er "nmap -A scanme.nmap.org"
Command:- nmap -A scanme.nmap.org
Starting Nmap 6.47 ( https://nmap.org ) at 2014-12-29 20:02 CET
Nmap scan report for scanme.nmap.org (74.207.244.221)
Host is up (0.16s latency).
Not shown: 997 filtered ports
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 5.3p1 Debian 3ubuntu7.1 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 1024 8d:60:f1:7c:ca:b7:3d:0a:d6:67:54:9d:69:d9:b9:dd (DSA)
|_ 2048 79:f8:09:ac:d4:e2:32:42:10:49:d3:bd:20:82:85:ec (RSA)
80/tcp open http Apache httpd 2.2.14 ((Ubuntu))
|_http-title: Go ahead and ScanMe!
9929/tcp open nping-echo Nping echo
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose|phone|storage-misc|WAP
Running (JUST GUESSING): Linux 2.6.X|3.X|2.4.X (94%), Netgear RAIDiator 4.X (86%)
OS CPE: cpe:/o:linux:linux_kernel:2.6.38 cpe:/o:linux:linux_kernel:3 cpe:/o:netgear:raidiator:4 cpe:/o:linux:linux_kernel:2.4
Aggressive OS guesses: Linux 2.6.38 (94%), Linux 3.0 (92%), Linux 2.6.32 - 3.0 (91%), Linux 2.6.18 (91%), Linux 2.6.39 (90%), Linux 2.6.32 - 2.6.39 (90%), Linux 2.6.38 - 3.0 (90%), Linux 2.6.38 - 2.6.39 (89%), Linux 2.6.35 (88%), Linux 2.6.37 (88%)
No exact OS matches for host (test conditions non-ideal).
Network Distance: 13 hops
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
TRACEROUTE (using port 80/tcp)
HOP RTT ADDRESS
1 14.21 ms 151.217.192.1
2 5.27 ms ae10-0.mx240-iphh.shitty.network (94.45.224.129)
3 13.16 ms hmb-s2-rou-1102.DE.eurorings.net (134.222.120.121)
4 6.83 ms blnb-s1-rou-1041.DE.eurorings.net (134.222.229.78)
5 8.30 ms blnb-s3-rou-1041.DE.eurorings.net (134.222.229.82)
6 9.42 ms as6939.bcix.de (193.178.185.34)
7 24.56 ms 10ge10-6.core1.ams1.he.net (184.105.213.229)
8 30.60 ms 100ge9-1.core1.lon2.he.net (72.52.92.213)
9 93.54 ms 100ge1-1.core1.nyc4.he.net (72.52.92.166)
10 181.14 ms 10ge9-6.core1.sjc2.he.net (184.105.213.173)
11 169.54 ms 10ge3-2.core3.fmt2.he.net (184.105.222.13)
12 164.58 ms router4-fmt.linode.com (64.71.132.138)
13 164.32 ms scanme.nmap.org (74.207.244.221)
OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 28.98 seconds
Galleri
Nmap på film
Nmap har været brugt i film som The Matrix Reloaded, Die Hard 4, Girl With the Dragon Tattoo, og The Bourne Ultimatum..
Noter
Eksterne henvisninger
Datanet-relaterede programmer til UNIX
Sikkerhedssoftware til Windows
Sikkerhedssoftware til OS X
Sikkerhedssoftware til Linux | danish | 0.906618 |
Pony/src-builtin-source_loc-.txt |
source_loc.pony
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30interface val SourceLoc
"""
Represents a location in a Pony source file, as reported by `__loc`.
"""
fun file(): String
"""
Name and path of source file.
"""
fun type_name(): String
"""
Name of nearest class, actor, primitive, struct, interface, or trait.
"""
fun method_name(): String
"""
Name of containing method.
"""
fun line(): USize
"""
Line number within file.
Line numbers start at 1.
"""
fun pos(): USize
"""
Character position on line.
Character positions start at 1.
"""
| pony | 4596978 | https://sv.wikipedia.org/wiki/Tricliceras%20pilosum | Tricliceras pilosum | Tricliceras pilosum är en passionsblomsväxtart som först beskrevs av Carl Ludwig von Willdenow, och fick sitt nu gällande namn av R.B. Fernandes. Tricliceras pilosum ingår i släktet Tricliceras och familjen passionsblomsväxter. Inga underarter finns listade i Catalogue of Life.
Källor
Externa länkar
Passionsblomsväxter
pilosum | swedish | 1.334129 |
Pony/src-builtin-none-.txt |
none.pony
1
2
3primitive None is Stringable
fun string(): String iso^ =>
"None".string()
| pony | 2861973 | https://sv.wikipedia.org/wiki/Norraca%20longipennis | Norraca longipennis | Norraca longipennis är en fjärilsart som beskrevs av Moore 1881. Norraca longipennis ingår i släktet Norraca och familjen tandspinnare. Inga underarter finns listade i Catalogue of Life.
Källor
Tandspinnare
longipennis | swedish | 1.445405 |
Pony/src-debug-debug-.txt |
debug.pony
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74"""
# Debug package
Provides facilities to create output to either `STDOUT` or `STDERR` that will
only appear when the platform is debug configured. To create a binary with
debug configured, pass the `-d` flag to `ponyc` when compiling e.g.:
`ponyc -d`
## Example code
```pony
use "debug"
actor Main
new create(env: Env) =>
Debug.out("This will only be seen when configured for debug info")
env.out.print("This will always be seen")
```
"""
use @fprintf[I32](stream: Pointer[U8] tag, fmt: Pointer[U8] tag, ...)
use @pony_os_stdout[Pointer[U8]]()
use @pony_os_stderr[Pointer[U8]]()
primitive DebugOut
primitive DebugErr
type DebugStream is (DebugOut | DebugErr)
primitive Debug
"""
This is a debug only print utility.
"""
fun apply(
msg: (Stringable | ReadSeq[Stringable]),
sep: String = ", ",
stream: DebugStream = DebugOut)
=>
"""
If platform is debug configured, print either a single stringable or a
sequence of stringables. The default separator is ", ", and the default
output stream is stdout.
"""
ifdef debug then
match msg
| let m: Stringable =>
_print(m.string(), stream)
| let m: ReadSeq[Stringable] =>
_print(sep.join(m.values()), stream)
end
end
fun out(msg: Stringable = "") =>
"""
If platform is debug configured, print message to standard output
"""
_print(msg.string(), DebugOut)
fun err(msg: Stringable = "") =>
"""
If platform is debug configured, print message to standard error
"""
_print(msg.string(), DebugErr)
fun _print(msg: String, stream: DebugStream) =>
ifdef debug then
@fprintf(_stream(stream), "%s\n".cstring(), msg.cstring())
end
fun _stream(stream: DebugStream): Pointer[U8] =>
match stream
| DebugOut => @pony_os_stdout()
| DebugErr => @pony_os_stderr()
end
| pony | 1351505 | https://no.wikipedia.org/wiki/Init | Init | init er i Unix og Unix-lignende operativsystemer den første prosessen som startes under oppstart av datamaskinen. Det er en daemon som kjører inntil systemet slås av. Den er den direkte eller indirekte foreldreprosessen til andre prosesser og adopterer automatisk alle foreldreløse prosesser. Init startes av operativsystemkjernen ved å bruke et hardkodet filnavn; en kjernepanikk inntreffer hvis kjernen er ute av stand til å starte den. Init tildeles vanligvis prosessidentifikator 1.
I UNIX System III og UNIX System V var funksjonaliteten til init forskjellig fra forsknings-Unix og dens BSD derivater. Bruken i de fleste Linux-distribusjoner har tradisjonelt benyttet den tradisjonelle init. En nylig variant på Linux-systemer er systemd, som stort sett er kompatibelt med System V. Slackware bruker BSD-stil oppstart, mens andre som Gentoo har deres egne versjoner.
Flere erstatninger av init-implementasjonen har blitt laget, og prøver å oppheve begrensninger i standardversjonene. De inkluderer launchd, Service Management Facility, systemd og Upstart. I de senere år har systemd blitt tatt i bruk av alle større Linux-distribusjoner.
Eksempel: Init-script i Fedora
Red Hat erstattet SysVinit med systemd i Fedora versjon 15 og i Red Hat Enterprise Linux versjon 7. Her er et eksempel på SysVinit-script for eldre versjoner.
#!/bin/sh
#
# <daemonname> <summary>
#
# chkconfig: <default runlevel(s)> <start> <stop>
# description: <description, split multiple lines with \
# a backslash>
### BEGIN INIT INFO
# Provides:
# Required-Start:
# Required-Stop:
# Should-Start:
# Should-Stop:
# Default-Start:
# Default-Stop:
# Short-Description:
# Description:
### END INIT INFO
# Source function library.
. /etc/rc.d/init.d/functions
exec="/path/to/<daemonname>"
prog="<service name>"
config="<path to major config file>"
[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
lockfile=/var/lock/subsys/$prog
start() {
[ -x $exec ] || exit 5
[ -f $config ] || exit 6
echo -n $"Starting $prog: "
# if not running, start it up here, usually something like "daemon $exec"
retval=$?
echo
[ $retval -eq 0 ] && touch $lockfile
return $retval
}
stop() {
echo -n $"Stopping $prog: "
# stop it here, often "killproc $prog"
retval=$?
echo
[ $retval -eq 0 ] && rm -f $lockfile
return $retval
}
restart() {
stop
start
}
reload() {
restart
}
force_reload() {
restart
}
rh_status() {
# run checks to determine if the service is running or use generic status
status $prog
}
rh_status_q() {
rh_status >/dev/null 2>&1
}
case "$1" in
start)
rh_status_q && exit 0
$1
;;
stop)
rh_status_q || exit 0
$1
;;
restart)
$1
;;
reload)
rh_status_q || exit 7
$1
;;
force-reload)
force_reload
;;
status)
rh_status
;;
condrestart|try-restart)
rh_status_q || exit 0
restart
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
exit 2
esac
exit $?
Referanser
Unix
Unix-varianter | norwegian_bokmål | 0.696063 |
Pony/format-FormatHexBare-.txt |
FormatHexBare¶
[Source]
primitive val FormatHexBare is
FormatSpec val
Implements¶
FormatSpec val
Constructors¶
create¶
[Source]
new val create()
: FormatHexBare val^
Returns¶
FormatHexBare val^
Public Functions¶
eq¶
[Source]
fun box eq(
that: FormatHexBare val)
: Bool val
Parameters¶
that: FormatHexBare val
Returns¶
Bool val
ne¶
[Source]
fun box ne(
that: FormatHexBare val)
: Bool val
Parameters¶
that: FormatHexBare val
Returns¶
Bool val
| pony | 440685 | https://sv.wikipedia.org/wiki/Volvo%20PV651 | Volvo PV651 | Volvo PV651 är en bilmodell som introducerades av Volvo den 23 april 1929. Modellnamnet skall utläsas som: PersonVagn, 6 cylindrar, 5 sittplatser, 1:a serien (modell 650 var samma, men utan kaross, det vill säga endast levererad som chassi).
PV650-652
Planerna på den nya, större efterträdaren till :Volvo ÖV4 hade tagit sin början 1926. :Helmer MasOlle fick åter förtroendet att rita karossen. De amerikanska märken som dominerade den svenska marknaden vid den här tiden och som därför utgjorde Volvos främsta konkurrenter kunde erbjuda sexcylindriga motorer. Därför stod det snart klart för Volvo att man måste göra detsamma. Detta var också ett krav för att kunna slå sig in på marknaden för taxidroskor.
Den nya bilen fick ett kraftigare chassi för att klara den stora motorn och karossen blev plåtklädd. Bilen vägde därmed 1 500 kilo. Taket förblev dock pegamoidklätt. Man höll också kvar vid det gamla byggsättet med en stomme i askträ samt svällare av björk och järn. Framsätena var ställbara och kunde fällas tillbaka för att ge två sängplatser. Kraftiga läderremmar höll ryggstödet i uppfällt läge.
Motorn försågs med en rejäl, sjulagrad vevaxel, ett ovanligt drag vid den här tiden. Bromsarna var mekaniska enligt Bendix-Perrot-systemet och handbromsen verkade fortfarande på kardanaxeln.
I augusti 1929 nådde Volvo break-even och kunde vid årets slut notera en blygsam vinst, 1 965 kronor. Under året sålde man totalt 1 383 vagnar, varav 27 exporterades. Priset i Sverige för PV651 var 6 900 kronor.
I augusti 1930 kom efterträdaren PV652. Den hade modifierad interiör och instrumentering, ny förgasare och framför allt, hydrauliska bromsar. I januari 1932 uppdaterades modellen med ny motor och synkroniserad växellåda.
Volvo byggde, som de flesta andra biltillverkare, inte bara kompletta bilar, utan även "halvfabrikat" i form av nakna chassin för karossering hos någon fristående karossmakare. Några enstaka chassin försågs med vackra öppna kreationer, men huvuddelen gick till kommersiellt bruk, som flak-, skåp- och likbilar, samt ambulanser.
Tekniska data
Motor (1929-32): typ DB, rak sexcylindrig sidventilsmotor
Cylindervolym: 3010 cm3
Borr x slag: 76,2x110 mm
Kompression: 5,1:1
Effekt: 55 hk vid 3000 r/m
Toppfart: 110 km/tim.
Motor (1932-33): typ EB, rak sexcylindrig sidventilsmotor
Cylindervolym: 3366 cm3
Borr x slag: 79,4x110 mm
Effekt: 65 hk vid 3200 r/m
Växellåda
3-växlad manuell, osynkroniserad (1929-31)
4-växlad manuell, osynkroniserad (1931)
3-växlad manuell med frihjul, osynkroniserad 1:a (1932-33)
Hjulbas: 295 cm
Varianter:
PV650: 1929-34, 206 tillverkade, chassi
PV651: 1929-30, mekaniska bromsar
PV652: 1930-33, hydrauliska bromsar
Totalt tillverkades 2 382 PV650/651/652, åren 1929-1934.
PV653-654
Hösten 1933 moderniserades Volvovagnarna med kryssförstärkt ram, mindre 17"-fälgar och helmetallkaross, utan trästomme. Taköppningen var, som vanligt vid den här tiden, täckt av pegamoid, eftersom pressar tillräckligt stora att pressa ett helt tak var ytterst ovanliga.
Därutöver fick bilen nya skärmar, lätt bakåtlutande vindrutestolpar samt ytterst lätt bakåtlutande kylare. Mekaniskt ändrades ingenting.
Volvo saluförde nu två varianter: standardmodellen PV653 och den lyxigare PV654. Den som slog till på den dyrare varianten fick bland annat mer påkostad inredning med armstöd bak och kurvstroppar, dubbla reservhjul, dubbla kromade signalhorn och dubbla bakljus.
Tekniska data
Motor:typ EB, rak sexcylindrig sidventilsmotor
Cylindervolym: 3366 cm3
Borr x slag: 79,4x110 mm
Effekt: 65 hk vid 3200 r/m
Växellåda: 3-växlad manuell med frihjul, osynkroniserad 1:a
Hjulbas: 295 cm
Varianter:
PV653: 1933-34, 230 tillverkade, standardmodell
PV654: 1933-34, 361 tillverkade, lyxmodell
PV655: 1933-35, 62 tillverkade, chassi
PV656-659
1935 började Volvobilarna se mer än lovligt gammalmodiga ut. Grundkarossen hade hängt med sedan 1929. Trots det höll Volvo liv i vagnen med en lätt ansiktslyftning: kylaren försågs med en lätt V-formad kylarmask. Lägg därtill en ny, större motor och Volvo bedömde att ändringarna var tillräckligt stora för att motivera nya modellbeteckningar: PV658 resp. 659.
Bilarna tillverkades till och med 1936 och ersattes därefter av nya :Volvo PV51.
Tekniska data
Motor: typ EC, rak sexcylindrig sidventilsmotor
Cylindervolym: 3670 cm3
Borr x slag: 84,14x110 mm
Effekt: 86 hk
Växellåda: 3-växlad manuell med frihjul, osynkroniserad 1:a
Hjulbas: 295 cm
Varianter:
PV656: 1935-36, 16 tillverkade, chassi
PV657: 1935-37, 55 tillverkade, chassi m hjulbas 355 cm
PV658: 1935-36, 301 tillverkade, standardmodell
PV659: 1935-36, 170 tillverkade, lyxmodell
Referenser
Källor
Volvo 1927-1977, red. Björn-Eric Lindh, Autohistorica, PR-Tryck, Sollentuna 1977 ISSN 0345-1003
Volvo Personvagnar-från 20-tal till 80-tal av Björn-Eric Lindh, 1984.
Volvo 1927-1988, utgiven av Informationsstaben, Volvo Personvagnar AB, Göteborg 1988 PR/PV 880201 s. 14
Volvo 1927-2002 75 år, Informationsavdelningen - Volvo Personvagnar AB, Göteborg 2002 ISSN 1104-9995
Externa länkar
Storvolvoklubben
PV651
Bakhjulsdrivna fordon
Lanseringar 1929 | swedish | 1.100577 |
Pony/src-ini-ini-.txt |
ini.pony
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147"""
# Ini package
The Ini package provides support for parsing
[INI file](https://en.wikipedia.org/wiki/INI_file) formatted text.
* Currently _does not_ support multi-line entries.
* Any keys not in a section will be placed in the section ""
# Example code
```pony
// Parses the file 'example.ini' in the current working directory
// Output all the content
use "ini"
use "files"
actor Main
new create(env:Env) =>
try
let ini_file = File(FilePath(FileAuth(env.root), "example.ini"))
let sections = IniParse(ini_file.lines())?
for section in sections.keys() do
env.out.print("Section name is: " + section)
for key in sections(section)?.keys() do
env.out.print(key + " = " + sections(section)?(key)?)
end
end
end
```
"""
primitive IniIncompleteSection
primitive IniNoDelimiter
type IniError is
( IniIncompleteSection
| IniNoDelimiter
)
interface IniNotify
"""
Notifications for INI parsing.
"""
fun ref apply(section: String, key: String, value: String): Bool
"""
This is called for every valid entry in the INI file. If key/value pairs
occur before a section name, the section can be an empty string. Return
false to halt processing.
"""
fun ref add_section(section: String): Bool =>
"""
This is called for every valid section in the INI file. Return false
to halt processing.
"""
true
fun ref errors(line: USize, err: IniError): Bool =>
"""
This is called for each error encountered. Return false to halt processing.
"""
true
primitive Ini
"""
A streaming parser for INI formatted lines of test.
"""
fun apply(lines: Iterator[String box], f: IniNotify): Bool =>
"""
This accepts a string iterator and calls the IniNotify for each new entry.
If any errors are encountered, this will return false. Otherwise, it
returns true.
"""
var section = ""
var lineno = USize(0)
var ok = true
for line in lines do
lineno = lineno + 1
var current = line.clone()
current.strip()
if current.size() == 0 then
continue
end
try
match current(0)?
| ';' | '#' =>
// Skip comments.
continue
| '[' =>
try
current.delete(current.find("]", 1)?, -1)
current.delete(0)
section = consume current
if not f.add_section(section) then
return ok
end
else
ok = false
if not f.errors(lineno, IniIncompleteSection) then
return false
end
end
else
try
let delim = try
current.find("=")?
else
current.find(":")?
end
let value = current.substring(delim + 1)
value.strip()
current.delete(delim, -1)
current.strip()
try
let comment = try
value.find(";")?
else
value.find("#")?
end
match value(comment.usize() - 1)?
| ' ' | '\t' =>
value.delete(comment, -1)
value.rstrip()
end
end
if not f(section, consume current, consume value) then
return ok
end
else
ok = false
if not f.errors(lineno, IniNoDelimiter) then
return false
end
end
end
end
end
ok
| pony | 1030371 | https://no.wikipedia.org/wiki/Bullis | Bullis | Bullis er en slekt av glansvinger som tilhører underfamilien stjertvinger (Theclinae).
Utseende
Disse stjertvingene har to tynne stjerter på hver bakvinge. Hannens overside er skinnende blå med svarte vingespisser.
Levevis
Larvene lever på parasittiske planter i mistelteinfamilien.
Utbredelse
Slekten er utbredt i Sørøst-Asia, der den forekommer i Thailand, Malaya, Borneo og trolig også Sumatra.
Systematisk inndeling
sommerfugler (Lepidoptera)
gruppe / overfamilie dagsommerfugler (Papilionoidea)
familie glansvinger (Lycaenidae)
delgruppe Lycaeninae (i vid forstand)
stjertvinger (Theclinae)
stamme Iolaini Riley, 1958
slekten Bullis de Nicéville, 1897
Bullis buto (de Nicéville, 1895)
Bullis elioti (Corbet, 1940)
Bullis stigmata (Druce, 1904)
Eksterne lenker
Brower, Andrew V. Z. 2007. Bullis i The Tree of Life Web Project, [http://tolweb.org/ http://tolweb.org
www.funet.fi – Bullis
Stjertvinger
Dyr formelt beskrevet i 1897
Dyr formelt beskrevet av Lionel de Nicéville | norwegian_bokmål | 1.31605 |
Pony/src-term-ansi-.txt |
ansi.pony
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303primitive ANSI
"""
These strings can be embedded in text when writing to a StdStream to create
a text-based UI.
"""
fun up(n: U32 = 0): String =>
"""
Move the cursor up n lines. 0 is the same as 1.
"""
if n <= 1 then
"\x1B[A"
else
"\x1B[" + n.string() + "A"
end
fun down(n: U32 = 0): String =>
"""
Move the cursor down n lines. 0 is the same as 1.
"""
if n <= 1 then
"\x1B[B"
else
"\x1B[" + n.string() + "B"
end
fun right(n: U32 = 0): String =>
"""
Move the cursor right n columns. 0 is the same as 1.
"""
if n <= 1 then
"\x1B[C"
else
"\x1B[" + n.string() + "C"
end
fun left(n: U32 = 0): String =>
"""
Move the cursor left n columns. 0 is the same as 1.
"""
if n <= 1 then
"\x1B[D"
else
"\x1B[" + n.string() + "D"
end
fun cursor(x: U32 = 0, y: U32 = 0): String =>
"""
Move the cursor to line y, column x. 0 is the same as 1. This indexes from
the top left corner of the screen.
"""
if (x <= 1) and (y <= 1) then
"\x1B[H"
else
"\x1B[" + y.string() + ";" + x.string() + "H"
end
fun clear(): String =>
"""
Clear the screen and move the cursor to the top left corner.
"""
"\x1B[H\x1B[2J"
fun erase(direction: _EraseDirection = EraseRight): String =>
"""
Erases content. The direction to erase is dictated by the `direction`
parameter. Use `EraseLeft` to erase everything from the cursor to the
beginning of the line. Use `EraseLine` to erase the entire line. Use
`EraseRight` to erase everything from the cursor to the end of the line.
The default direction is `EraseRight`.
"""
match direction
| EraseRight => "\x1B[0K"
| EraseLeft => "\x1B[1K"
| EraseLine => "\x1B[2K"
end
fun reset(): String =>
"""
Resets all colours and text styles to the default.
"""
"\x1B[0m"
fun bold(state: Bool = true): String =>
"""
Bold text. Does nothing on Windows.
"""
if state then "\x1B[1m" else "\x1B[22m" end
fun underline(state: Bool = true): String =>
"""
Underlined text. Does nothing on Windows.
"""
if state then "\x1B[4m" else "\x1B[24m" end
fun blink(state: Bool = true): String =>
"""
Blinking text. Does nothing on Windows.
"""
if state then "\x1B[5m" else "\x1B[25m" end
fun reverse(state: Bool = true): String =>
"""
Swap foreground and background colour.
"""
if state then "\x1B[7m" else "\x1B[27m" end
fun black(): String =>
"""
Black text.
"""
"\x1B[30m"
fun red(): String =>
"""
Red text.
"""
"\x1B[31m"
fun green(): String =>
"""
Green text.
"""
"\x1B[32m"
fun yellow(): String =>
"""
Yellow text.
"""
"\x1B[33m"
fun blue(): String =>
"""
Blue text.
"""
"\x1B[34m"
fun magenta(): String =>
"""
Magenta text.
"""
"\x1B[35m"
fun cyan(): String =>
"""
Cyan text.
"""
"\x1B[36m"
fun grey(): String =>
"""
Grey text.
"""
"\x1B[90m"
fun white(): String =>
"""
White text.
"""
"\x1B[97m"
fun bright_red(): String =>
"""
Bright red text.
"""
"\x1B[91m"
fun bright_green(): String =>
"""
Bright green text.
"""
"\x1B[92m"
fun bright_yellow(): String =>
"""
Bright yellow text.
"""
"\x1B[93m"
fun bright_blue(): String =>
"""
Bright blue text.
"""
"\x1B[94m"
fun bright_magenta(): String =>
"""
Bright magenta text.
"""
"\x1B[95m"
fun bright_cyan(): String =>
"""
Bright cyan text.
"""
"\x1B[96m"
fun bright_grey(): String =>
"""
Bright grey text.
"""
"\x1B[37m"
fun black_bg(): String =>
"""
Black background.
"""
"\x1B[40m"
fun red_bg(): String =>
"""
Red background.
"""
"\x1B[41m"
fun green_bg(): String =>
"""
Green background.
"""
"\x1B[42m"
fun yellow_bg(): String =>
"""
Yellow background.
"""
"\x1B[43m"
fun blue_bg(): String =>
"""
Blue background.
"""
"\x1B[44m"
fun magenta_bg(): String =>
"""
Magenta background.
"""
"\x1B[45m"
fun cyan_bg(): String =>
"""
Cyan background.
"""
"\x1B[46m"
fun grey_bg(): String =>
"""
Grey background.
"""
"\x1B[100m"
fun white_bg(): String =>
"""
White background.
"""
"\x1B[107m"
fun bright_red_bg(): String =>
"""
Bright red background.
"""
"\x1B[101m"
fun bright_green_bg(): String =>
"""
Bright green background.
"""
"\x1B[102m"
fun bright_yellow_bg(): String =>
"""
Bright yellow background.
"""
"\x1B[103m"
fun bright_blue_bg(): String =>
"""
Bright blue background.
"""
"\x1B[104m"
fun bright_magenta_bg(): String =>
"""
Bright magenta background.
"""
"\x1B[105m"
fun bright_cyan_bg(): String =>
"""
Bright cyan background.
"""
"\x1B[106m"
fun bright_grey_bg(): String =>
"""
Bright grey background.
"""
"\x1B[47m"
primitive EraseLeft
primitive EraseLine
primitive EraseRight
type _EraseDirection is (EraseLeft | EraseLine | EraseRight)
| pony | 3336800 | https://sv.wikipedia.org/wiki/Xylota%20bicolor | Xylota bicolor | Xylota bicolor är en tvåvingeart som beskrevs av Friedrich Hermann Loew 1864. Xylota bicolor ingår i släktet vedblomflugor, och familjen blomflugor. Inga underarter finns listade i Catalogue of Life.
Källor
Vedblomflugor
bicolor | swedish | 1.213781 |
Pony/src-net-auth-.txt |
auth.pony
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23primitive NetAuth
new create(from: AmbientAuth) =>
None
primitive DNSAuth
new create(from: (AmbientAuth | NetAuth)) =>
None
primitive UDPAuth
new create(from: (AmbientAuth | NetAuth)) =>
None
primitive TCPAuth
new create(from: (AmbientAuth | NetAuth)) =>
None
primitive TCPListenAuth
new create(from: (AmbientAuth | NetAuth | TCPAuth)) =>
None
primitive TCPConnectAuth
new create(from: (AmbientAuth | NetAuth | TCPAuth)) =>
None
| pony | 2286222 | https://sv.wikipedia.org/wiki/Ptychadena%20newtoni | Ptychadena newtoni | Ptychadena newtoni är en groddjursart som först beskrevs av Bocage 1886. Ptychadena newtoni ingår i släktet Ptychadena och familjen Ptychadenidae. IUCN kategoriserar arten globalt som starkt hotad. Inga underarter finns listade i Catalogue of Life.
Källor
Externa länkar
Stjärtlösa groddjur
newtoni | swedish | 1.188396 |
Pony/pony_check-PonyCheck-.txt |
PonyCheck¶
[Source]
primitive val PonyCheck
Constructors¶
create¶
[Source]
new val create()
: PonyCheck val^
Returns¶
PonyCheck val^
Public Functions¶
for_all[T: T]¶
[Source]
Convenience method for running 1 to many properties as part of
one PonyTest UnitTest.
Example:
class MyTestWithSomeProperties is UnitTest
fun name(): String => "mytest/withMultipleProperties"
fun apply(h: TestHelper) =>
PonyCheck.for_all[U8](recover Generators.unit[U8](0) end, h)(
{(u, h) =>
h.assert_eq(u, 0)
consume u
})
fun box for_all[T: T](
gen: Generator[T] val,
h: TestHelper val)
: ForAll[T] ref
Parameters¶
gen: Generator[T] val
h: TestHelper val
Returns¶
ForAll[T] ref
for_all2[T1: T1, T2: T2]¶
[Source]
fun box for_all2[T1: T1, T2: T2](
gen1: Generator[T1] val,
gen2: Generator[T2] val,
h: TestHelper val)
: ForAll2[T1, T2] ref
Parameters¶
gen1: Generator[T1] val
gen2: Generator[T2] val
h: TestHelper val
Returns¶
ForAll2[T1, T2] ref
for_all3[T1: T1, T2: T2, T3: T3]¶
[Source]
fun box for_all3[T1: T1, T2: T2, T3: T3](
gen1: Generator[T1] val,
gen2: Generator[T2] val,
gen3: Generator[T3] val,
h: TestHelper val)
: ForAll3[T1, T2, T3] ref
Parameters¶
gen1: Generator[T1] val
gen2: Generator[T2] val
gen3: Generator[T3] val
h: TestHelper val
Returns¶
ForAll3[T1, T2, T3] ref
for_all4[T1: T1, T2: T2, T3: T3, T4: T4]¶
[Source]
fun box for_all4[T1: T1, T2: T2, T3: T3, T4: T4](
gen1: Generator[T1] val,
gen2: Generator[T2] val,
gen3: Generator[T3] val,
gen4: Generator[T4] val,
h: TestHelper val)
: ForAll4[T1, T2, T3, T4] ref
Parameters¶
gen1: Generator[T1] val
gen2: Generator[T2] val
gen3: Generator[T3] val
gen4: Generator[T4] val
h: TestHelper val
Returns¶
ForAll4[T1, T2, T3, T4] ref
eq¶
[Source]
fun box eq(
that: PonyCheck val)
: Bool val
Parameters¶
that: PonyCheck val
Returns¶
Bool val
ne¶
[Source]
fun box ne(
that: PonyCheck val)
: Bool val
Parameters¶
that: PonyCheck val
Returns¶
Bool val
| pony | 788328 | https://no.wikipedia.org/wiki/Hai%20Fu%20gasskraftverk | Hai Fu gasskraftverk | Hai Fu gasskraftverk er et varmekraftverk ved byen Taoyuan i Taiwan. Det har en installert produksjonskapasitet på 980 MW fordelt på to blokker á 490 MW hver. Brenselkilden er naturgass.
Anlegget stod ferdig i 1999, og har teknologi fra ABB. Operatør er EverPower IPP Co, som har sitt hovedkvarter i Taoyuan.
Referanser
Eksterne lenker
ABB – «ABB wins US$ 660-million combined-cycle power plant order in Taiwan», 20. januar 1998.
Varmekraftverk på Taiwan
Gasskraftverk på Taiwan | norwegian_bokmål | 1.174811 |
Pony/strings--index-.txt |
Strings package¶
The Strings package provides utilities for working with sequences of strings.
Public Types¶
primitive CommonPrefix
| pony | 3050553 | https://sv.wikipedia.org/wiki/Prolimacodes | Prolimacodes | Prolimacodes är ett släkte av fjärilar. Prolimacodes ingår i familjen snigelspinnare.
Kladogram enligt Catalogue of Life:
Bildgalleri
Källor
Externa länkar
Snigelspinnare
Prolimacodes | swedish | 1.363794 |
Pony/serialise-DeserialiseAuth-.txt |
DeserialiseAuth¶
[Source]
This is a capability token that allows the holder to deserialise objects. It
does not allow the holder to serialise objects or examine serialised data.
primitive val DeserialiseAuth
Constructors¶
create¶
[Source]
new val create(
auth: AmbientAuth val)
: DeserialiseAuth val^
Parameters¶
auth: AmbientAuth val
Returns¶
DeserialiseAuth val^
Public Functions¶
eq¶
[Source]
fun box eq(
that: DeserialiseAuth val)
: Bool val
Parameters¶
that: DeserialiseAuth val
Returns¶
Bool val
ne¶
[Source]
fun box ne(
that: DeserialiseAuth val)
: Bool val
Parameters¶
that: DeserialiseAuth val
Returns¶
Bool val
| pony | 141369 | https://no.wikipedia.org/wiki/Kassitter | Kassitter | Kassittene var en folkegruppe som i oldtidens nære Østen som kontrollerte Babylonia ca. 1531 f.Kr. og fram til ca. 1155 f.Kr. (kort kronologi) etter det gammelbabylonske riket falt sammen.
Kassittene fikk kontroll over Babylonia etter den hettittiske plyndringen av Babylon i 1531 f.Kr., og etablerte et dynasti som generelt antas å ha vært basert i nettopp denne byen. Senere flyttet styret til den nye byen Dur-Kurigalzu, rundt 30 km vest for dagens Bagdad. På tidspunktet for Babylons fall hadde kassittene allerede vært en del av regionen i halvannet århundre, og noen ganger handlet med Babylons interesser og noen ganger mot. Det er registreringer av kassittiske og babylonske interaksjoner, i sammenheng med militær ansettelse, under regjeringene til babylonske konger Samsu-iluna (1686 til 1648 f.Kr.), Abī-ešuh og Ammī-ditāna.
Opprinnelsen og klassifiseringen til kassittisk som språk, tilsvarende med det sumeriske språket og det hurrittisk språket, er usikkert, og har, i likhet med de to sistnevnte språkene, generert et bredt spekter av spekulasjoner gjennom årene, til og med å knytte det til sanskrit. Den kassittiske religionen er også lite kjent, bortsett fra navnene på noen kassittiske guder. Hovedgudene, kongenes titulære guder, var Shuqamuna og Shumaliya. Som det var typisk i regionen, var det en viss krysspollinering med andre religioner. Etter at Babylon kom innenfor den kassittiske kontrollsfæren, ble dens tradisjonelle bygud Marduk tatt opp i og absorbert i den kassittiske gudeverden.
Historie
Dokumentasjon av den kassittiske perioden avhenger sterkt av de spredte og fragmenterte leirtavlene med skrift fra oldtidsbyen Nippur, et religiøst senter, hvor tusenvis av leirtavler og fragmenter er gravd ut. De omfatter administrative og juridiske tekster, brev, seglinskripsjoner, private votivinskripsjoner og til og med en litterær tekst (vanligvis identifisert som et fragment av et historisk epos). Dessverre er undersøkelsen av mange av disse leirtavlene ennå ikke blitt publisert, blant annet hundrevis som blir oppbevart i Istanbuls arkeologiske museum i hovedstaden i Tyrkia.
Rundt 100 kassittiske skrifttavler er blitt funnet ved Dur-Kurigalzu. Noen få påskrevne byggematerialer av den 17. herskeren Kurigalzu I ble funnet i byen Kisj. Flere leirtavler datert til regjeringstiden til herskeren Agum III som ble funnet på Dilmun i Qal’at al-Bahrain. Totalt er rundt 12 000 dokumenter fra den kassittiske perioden gjenfunnet, hvorav bare rundt 10 % er publisert. Det finnes også en rekke inskripsjoner på bygninger, alle unntatt én skrevet på sumerisk i motsetning til det akkadiske som vanligvis brukes av kassittene. En rekke segler er også funnet. Kudurru, en steinstele eller grensestein som brukt til å registrere landtilskudd og relaterte dokumenter gir en annen kilde til den kassittiske historien. Denne praksisen med stelene med inskripsjoner fortsatte i flere århundrer etter slutten av det kassittiske riket. De var ofte plassert på overflaten, ble mange funnet tidlig og fraktet vekk til museer rundt om i verden.
Det religiøse senteret i oldtidsbyen Nippur var et stort fokus for kassittene. Tidlig ble det utført oppussing av de forskjellige religiøse og administrative bygningene, den første av disse kan dateres til Kurigalzu I. Store konstruksjoner skjedde under herskerne Kadashman-Enlil, Kudur-Enlil og Shagarakti-Shuriash, med mindre reparasjonsarbeid under Adad-shuma -usur og Meli-Shipak. Andre viktige sentra under den kassittiske perioden var Larsa, Sippar og Susa. Kassittene var også veldig aktive i Ur.
På stedet for Isin, som hadde blitt forlatt etter tiden til herskeren Samsu-iluna, skjedde det store gjenoppbyggingsarbeidet på det religiøse distriktet, også på Gula-tempelet. Arbeidet ved Isin ble satt i gang av Kurigalzu I og videreført av Kadashman-Enlil I, og etter en tid av Adad-shuma-usur og Meli-Shipak II. Etter at det kassittiske herskerdynastiet ble styrtet i 1155 f.Kr., fortsatte systemet med provinsadministrasjon og landet forble samlet under det etterfølgende styret, det andre dynastiet i Isin.
Opprinnelse
Opprinnelsen til kassittene er usikker, selv om en rekke teorier har blitt avansert. Flere mistenkte kassittiske navn er registrert i økonomiske dokumenter fra perioden med det tredje Ur-dynastiet (ca. 2112–2004 f.Kr.) i det sørlige Babylon, men deres opprinnelse er tvetydig.
Kassitter ble først rapportert i Babylonia på 1700-tallet f.Kr., spesielt rundt området Sippar. Det 9. årsnavnet til kong Samsu-iluna (1749–1712 f.Kr.) av Babylon, sønnen til Hammurabi nevner dem, det vil si: «År hvor kongen Samsu-iluna (beseiret) hele styrken til hæren / kassittenes tropper».
Etter hvert som det babylonske riket ble svekket i de påfølgende årene, ble kassittene en del av landskapet, og til tider leverte de til og med soldater til Babylon. Hettittene hadde båret bort gudestatuen Marduk, men de kassittiske herskerne tok tilbake dens besittelse, og fraktet Mardukstatuen tilbake til Babylon og gjorde ham religiøst likestilt med kassittiske guddommen Shuqamuna. Babylon under kassittiske herskere, som omdøpte byen til Karanduniasj, gjenoppsto som en politisk og militær makt i Mesopotamia.
Referanser
Litteratur
Abraham, K. (2013): «Kaštiliašu and the Sumundar Canal: A New Middle Babylonian Royal Inscription», Zeitschrift Für Assyriologie & Vorderasiatische Archäologie, 103(2), s. 183–195. DOI: 10.1515/za-2013-0012.
Almamori, Haider Oraibi; Bartelmus, Alexa (2021): «New Light on Dilbat: Kassite Building Activities on the Uraš Temple “E-Ibbi-Anum” at Tell al-Deylam», Zeitschrift für Assyriologie und vorderasiatische Archäologie, 111(2), ,s. 174–190.
Bass, George F., et al. (1989): «The Bronze Age Shipwreck at Ulu Burun: 1986 Campaign», American Journal of Archaeology, 93(1), s. 1–29
Brinkman, J.A. (1969): «The Names of the Last Eight Kings of the Kassite Dynasty», Zeitschrift für Assyriologie und Vorderasiatische Archäologie, 59, s. 231–246
Brinkman, J.A. (1971): «Mu-Ús-Sa Dates in the Kassite Period», Die Welt Des Orients, 6(2).
Ferrara, A.J. (1977): «A Kassite Cylinder Seal from the Arabian Gulf», Bulletin of the American Schools of Oriental Research, no. 225, s. 69–69
Goetze, Albrecht (1964): «The Kassites and Near Eastern Chronology», Journal of Cuneiform Studies, 18(4), s. 97–101,
Oppenheim, Adolf Leo; Reiner, Erica ([1964] 1977): Ancient Mesopotamia: Portrait of a Dead Civilization, revidert utg., University of Chicago Press; ISBN 978-0226631875.
Sommerfield, Walter (1995): The Kassites of Ancient Mesopotamia: Origins, Politics, and Culture, bind 2 av Sasson, J.M., red.: Civilizations of the Ancient Near East, Charles Scribner's Sons. Delvis visning i Google Books
Eksterne lenker
«Provincial administration at Kassite Nippur»', av Daniel A. Nevez, sammendrag av en avhandling med detaljer om kassittiske Nippur og Babylonia. | norwegian_bokmål | 1.026263 |
Pony/collections-ListNode-.txt |
ListNode[A: A]¶
[Source]
A node in a doubly linked list.
See Pony collections.List
class for usage examples.
Each node contains four fields: two link fields (references to the previous and
to the next node in the sequence of nodes), one data field, and the reference to
the List in which it resides.
As you would expect functions are provided to create a ListNode, update a
ListNode's contained item, and pop the item from the ListNode.
Additional functions are provided to operate on a ListNode as part of a Linked
List. These provide for prepending, appending, removal, and safe traversal in
both directions. The Ponylang
collections.List class is the
correct way to create these. Do not attempt to create a Linked List using only
ListNodes.
Example program¶
The functions which are illustrated below are only those which operate on an
individual ListNode.
It outputs:
My node has the item value: My Node item
My node has the updated item value: My updated Node item
Popped the item from the ListNode
The ListNode has no (None) item.
use "collections"
actor Main
new create(env:Env) =>
// Create a new ListNode of type String
let my_list_node = ListNode[String]("My Node item")
try
env.out.print("My node has the item value: "
+ my_list_node.apply()?) // My Node item
end
// Update the item contained in the ListNode
try
my_list_node.update("My updated Node item")?
env.out.print("My node has the updated item value: "
+ my_list_node.apply()?) // My updated Node item
end
// Pop the item from the ListNode
try
my_list_node.pop()?
env.out.print("Popped the item from the ListNode")
my_list_node.apply()? // This will error as the item is now None
else
env.out.print("The ListNode has no (None) item.")
end
class ref ListNode[A: A]
Constructors¶
create¶
[Source]
Create a node. Initially, it is not in any list.
new ref create(
item: (A | None val) = reference)
: ListNode[A] ref^
Parameters¶
item: (A | None val) = reference
Returns¶
ListNode[A] ref^
Public Functions¶
apply¶
[Source]
Return the item, if we have one, otherwise raise an error.
fun box apply()
: this->A ?
Returns¶
this->A ?
update¶
[Source]
Replace the item and return the previous one. Raise an error if we have no
previous value.
fun ref update(
value: (A | None val))
: A^ ?
Parameters¶
value: (A | None val)
Returns¶
A^ ?
pop¶
[Source]
Remove the item from the node, if we have one, otherwise raise an error.
fun ref pop()
: A^ ?
Returns¶
A^ ?
prepend¶
[Source]
Prepend a node to this one. If that is already in a list, it is removed
before it is prepended. Returns true if that was removed from another
list.
If the ListNode is not contained within a List the prepend will fail.
fun ref prepend(
that: ListNode[A] ref)
: Bool val
Parameters¶
that: ListNode[A] ref
Returns¶
Bool val
append¶
[Source]
Append a node to this one. If that is already in a list, it is removed
before it is appended. Returns true if that was removed from another
list.
If the ListNode is not contained within a List the append will fail.
fun ref append(
that: ListNode[A] ref)
: Bool val
Parameters¶
that: ListNode[A] ref
Returns¶
Bool val
remove¶
[Source]
Remove a node from a list.
The ListNode must be contained within a List for this to succeed.
fun ref remove()
: None val
Returns¶
None val
has_prev¶
[Source]
Return true if there is a previous node.
fun box has_prev()
: Bool val
Returns¶
Bool val
has_next¶
[Source]
Return true if there is a next node.
fun box has_next()
: Bool val
Returns¶
Bool val
prev¶
[Source]
Return the previous node.
fun box prev()
: (this->ListNode[A] ref | None val)
Returns¶
(this->ListNode[A] ref | None val)
next¶
[Source]
Return the next node.
fun box next()
: (this->ListNode[A] ref | None val)
Returns¶
(this->ListNode[A] ref | None val)
| pony | 3474344 | https://sv.wikipedia.org/wiki/Iridomyrmex%20notialis | Iridomyrmex notialis | Iridomyrmex notialis är en myrart som beskrevs av Steven O. Shattuck 1993. Iridomyrmex notialis ingår i släktet Iridomyrmex och familjen myror. Inga underarter finns listade i Catalogue of Life.
Bildgalleri
Källor
Externa länkar
Myror
notialis | swedish | 1.302022 |
Pony/7_type-expressions.txt | # Type Expressions
The types we've talked about so far can also be combined in __type expressions__. If you're used to object-oriented programming, you may not have seen these before, but they are common in functional programming. A __type expression__ is also called an __algebraic data type__.
There are three kinds of type expression: __tuples__, __unions__, and __intersections__.
## Tuples
A __tuple__ type is a sequence of types. For example, if we wanted something that was a `String` followed by a `U64`, we would write this:
```pony
var x: (String, U64)
x = ("hi", 3)
x = ("bye", 7)
```
All type expressions are written in parentheses, and the elements of a tuple are separated by a comma. We can also destructure a tuple using assignment:
```pony
(var y, var z) = x
```
Or we can access the elements of a tuple directly:
```pony
var y = x._1
var z = x._2
```
Note that there's no way to assign to an element of a tuple. Instead, you can just reassign the entire tuple, like this:
```pony
x = ("wombat", x._2)
```
__Why use a tuple instead of a class?__ Tuples are a way to express a collection of values that doesn't have any associated code or expected behaviour. Basically, if you just need a quick collection of things, maybe to return more than one value from a function, for example, you can use a tuple.
## Unions
A __union__ type is written like a __tuple__, but it uses a `|` (pronounced "or" when reading the type) instead of a `,` between its elements. Where a tuple represents a collection of values, a union represents a _single_ value that can be any of the specified types.
Unions can be used for tons of stuff that require multiple concepts in other languages. For example, optional values, enumerations, marker values, and more.
```pony
var x: (String | None)
```
Here we have an example of using a union to express an optional type, where `x` might be a `String`, but it also might be `None`.
## Intersections
An __intersection__ uses a `&` (pronounced "and" when reading the type) between its elements. It represents the exact opposite of a union: it is a _single_ value that is _all_ of the specified types, at the same time!
This can be very useful for combining traits or interfaces, for example. Here's something from the standard library:
```pony
type Map[K: (Hashable box & Comparable[K] box), V] is HashMap[K, V, HashEq[K]]
```
That's a fairly complex type alias, but let's look at the constraint of `K`. It's `(Hashable box & Comparable[K] box)`, which means `K` is `Hashable` _and_ it is `Comparable[K]`, at the same time.
## Combining type expressions
Type expressions can be combined into more complex types. Here's another example from the standard library:
```pony
var _array: Array[((K, V) | _MapEmpty | _MapDeleted)]
```
Here we have an array where each element is either a tuple of `(K, V)` or a `_MapEmpty` or a `_MapDeleted`.
Because every type expression has parentheses around it, they are actually easy to read once you get the hang of it. However, if you use a complex type expression often, it can be nice to provide a type alias for it.
```pony
type Number is (Signed | Unsigned | Float)
type Signed is (I8 | I16 | I32 | I64 | I128)
type Unsigned is (U8 | U16 | U32 | U64 | U128)
type Float is (F32 | F64)
```
Those are all type aliases used by the standard library.
__Is `Number` a type alias for a type expression that contains other type aliases?__ Yes! Fun, and convenient.
| pony | 2136884 | https://sv.wikipedia.org/wiki/Heptacarpus%20stylus | Heptacarpus stylus | Heptacarpus stylus är en kräftdjursart som först beskrevs av William Stimpson 1864. Heptacarpus stylus ingår i släktet Heptacarpus och familjen Hippolytidae. Inga underarter finns listade i Catalogue of Life.
Källor
Tiofotade kräftdjur
stylus | swedish | 1.316312 |
Pony/src-process-process_error-.txt |
process_error.pony
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63class val ProcessError
let error_type: ProcessErrorType
let message: (String | None)
new val create(error_type': ProcessErrorType,
message': (String | None) = None)
=>
error_type = error_type'
message = message'
fun string(): String iso^ =>
match message
| let m: String =>
recover
let etc = error_type.string()
let err = String(etc.size() + 2 + m.size())
err.append(consume etc)
err.append(": ")
err.append(m)
err
end
else
error_type.string()
end
type ProcessErrorType is
( ExecveError
| PipeError
| ForkError
| WaitpidError
| WriteError
| KillError
| CapError
| ChdirError
| UnknownError
)
primitive ExecveError
fun string(): String iso^ => "ExecveError".clone()
primitive PipeError
fun string(): String iso^ => "PipeError".clone()
primitive ForkError
fun string(): String iso^ => "ForkError".clone()
primitive WaitpidError
fun string(): String iso^ => "WaitpidError".clone()
primitive WriteError
fun string(): String iso^ => "WriteError".clone()
primitive KillError // Not thrown at this time
fun string(): String iso^ => "KillError".clone()
primitive CapError
fun string(): String iso^ => "CapError".clone()
primitive ChdirError
fun string(): String iso^ => "ChdirError".clone()
primitive UnknownError
fun string(): String iso^ => "UnknownError".clone()
| pony | 2921919 | https://sv.wikipedia.org/wiki/Eressa%20ericssoni | Eressa ericssoni | Eressa ericssoni är en fjärilsart som beskrevs av Rothschild. Eressa ericssoni ingår i släktet Eressa och familjen björnspinnare. Inga underarter finns listade i Catalogue of Life.
Källor
Björnspinnare
ericssoni | swedish | 1.10792 |
Pony/ini-IniNotify-.txt |
IniNotify¶
[Source]
Notifications for INI parsing.
interface ref IniNotify
Public Functions¶
apply¶
[Source]
This is called for every valid entry in the INI file. If key/value pairs
occur before a section name, the section can be an empty string. Return
false to halt processing.
fun ref apply(
section: String val,
key: String val,
value: String val)
: Bool val
Parameters¶
section: String val
key: String val
value: String val
Returns¶
Bool val
add_section¶
[Source]
This is called for every valid section in the INI file. Return false
to halt processing.
fun ref add_section(
section: String val)
: Bool val
Parameters¶
section: String val
Returns¶
Bool val
errors¶
[Source]
This is called for each error encountered. Return false to halt processing.
fun ref errors(
line: USize val,
err: (IniIncompleteSection val | IniNoDelimiter val))
: Bool val
Parameters¶
line: USize val
err: (IniIncompleteSection val | IniNoDelimiter val)
Returns¶
Bool val
| pony | 835512 | https://sv.wikipedia.org/wiki/Common%20Type%20System | Common Type System | Common Type System (CTS) är en standard som specificerar hur datatyper ter sig i ett datorminne. Målet är att låta program som är skrivna i olika programspråk lätt ska kunna utbyta information med varandra. I ett programspråk kan en typ beskrivas som en definition av en mängd med värden (till exempel heltal mellan 0 och 10), och de tillåtna operationerna som kan utföras med dessa värden.
Specifikationen för CTS är en del av Ecma standard 335, "Common Language Infrastructure (CLI) Partitions I to VI." CLI och CTS skapades av Microsoft, och Microsoft .NET framework är en implementation av standarden.
Typkategorier
CTS stödjer följande två typer:
Värdetyper
En värdetyp innehåller direkt sitt värde, och allokeras på stacken eller inuti en struktur. Värdetyper kan vara förimplementerade av runtime eller definierade av användaren. De primitiva typerna (int, char, bool osv.) och strukturer är värdetyper.
Referenstyper
En referenstyp innehåller referensen till värdets plats i minnet, och är allokerade på heapen. Variabler är som pekare och är inte bundna till något specifikt objekt. Klasser, gränssnitt, strängar, delegater, boxade värdetyper och arrayer är exempel på referenstyper.
Följande exempel visar skillnaderna mellan värdetyper och referenstyper.
Imports System
Class Class1
Public Value As Integer = 0
End Class 'Class1
Class Test
Shared Sub Main()
Dim val1 As Integer = 0
Dim val2 As Integer = val1
val2 = 123
Dim ref1 As New Class1()
Dim ref2 As Class1 = ref1
ref2.Value = 123
Console.WriteLine("Värden: {0}, {1}", val1, val2)
Console.WriteLine("Referenser: {0}, {1}", ref1.Value, ref2.Value)
End Sub 'Main
End Class 'Test
Utskriften från exemplet ovan
Värden: 0, 123
Referenser: 123, 123
Boxning
Konvertering av värdetyp till en referenstyp kallas boxning. Detta är möjligt då värdetyper och referenstyper båda ärver basklassen System.Object.
Int32 x = 10;
object o = x ; // Implicit boxning
Console.WriteLine("The Object o = {0}",o); // skriver ut 10
Men en Int32 kan också bli explicit boxad:
Int32 x = 10;
object o = (object) x; // Explicit boxning
Console.WriteLine("The object o = {0}",o); // skriver ut 10
På liknande sätt kan den bli konverterad tillbaka till en värdetyp.
Int32 x = 5;
object o = x; // Implicit boxning
x = o; // Implicit utboxning
Se även
Common Language Infrastructure
Källor
Artikel på engelskspråkiga Wikipedia
Externa länkar
Microsoft developer's guide describing the CTS
built-in types in the .NET Framework
.NET Framework | swedish | 0.832662 |
Pony/src-pony_check-property_unit_test-.txt |
property_unit_test.pony
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157use "pony_test"
class iso Property1UnitTest[T] is UnitTest
"""
Provides plumbing for integration of PonyCheck
[Properties](pony_check-Property1.md) into [PonyTest](pony_test--index.md).
Wrap your properties into this class and use it in a
[TestList](pony_test-TestList.md):
```pony
use "pony_test"
use "pony_check"
class MyProperty is Property1[String]
fun name(): String => "my_property"
fun gen(): Generator[String] =>
Generators.ascii_printable()
fun property(arg1: String, h: PropertyHelper) =>
h.assert_true(arg1.size() > 0)
actor Main is TestList
new create(env: Env) => PonyTest(env, this)
fun tag tests(test: PonyTest) =>
test(Property1UnitTest[String](MyProperty))
```
"""
var _prop1: ( Property1[T] iso | None )
let _name: String
new iso create(p1: Property1[T] iso, name': (String | None) = None) =>
"""
Wrap a [Property1](pony_check-Property1.md) to make it mimic the PonyTest
[UnitTest](pony_test-UnitTest.md).
If `name'` is given, use this as the test name.
If not, use the property's `name()`.
"""
_name =
match name'
| None => p1.name()
| let s: String => s
end
_prop1 = consume p1
fun name(): String => _name
fun ref apply(h: TestHelper) ? =>
let prop = ((_prop1 = None) as Property1[T] iso^)
let params = prop.params()
h.long_test(params.timeout)
let property_runner =
PropertyRunner[T](
consume prop,
params,
h, // treat it as PropertyResultNotify
h, // is also a PropertyLogger for us
h.env
)
h.dispose_when_done(property_runner)
property_runner.run()
class iso Property2UnitTest[T1, T2] is UnitTest
var _prop2: ( Property2[T1, T2] iso | None )
let _name: String
new iso create(p2: Property2[T1, T2] iso, name': (String | None) = None) =>
_name =
match name'
| None => p2.name()
| let s: String => s
end
_prop2 = consume p2
fun name(): String => _name
fun ref apply(h: TestHelper) ? =>
let prop = ((_prop2 = None) as Property2[T1, T2] iso^)
let params = prop.params()
h.long_test(params.timeout)
let property_runner =
PropertyRunner[(T1, T2)](
consume prop,
params,
h, // PropertyResultNotify
h, // PropertyLogger
h.env
)
h.dispose_when_done(property_runner)
property_runner.run()
class iso Property3UnitTest[T1, T2, T3] is UnitTest
var _prop3: ( Property3[T1, T2, T3] iso | None )
let _name: String
new iso create(p3: Property3[T1, T2, T3] iso, name': (String | None) = None) =>
_name =
match name'
| None => p3.name()
| let s: String => s
end
_prop3 = consume p3
fun name(): String => _name
fun ref apply(h: TestHelper) ? =>
let prop = ((_prop3 = None) as Property3[T1, T2, T3] iso^)
let params = prop.params()
h.long_test(params.timeout)
let property_runner =
PropertyRunner[(T1, T2, T3)](
consume prop,
params,
h, // PropertyResultNotify
h, // PropertyLogger
h.env
)
h.dispose_when_done(property_runner)
property_runner.run()
class iso Property4UnitTest[T1, T2, T3, T4] is UnitTest
var _prop4: ( Property4[T1, T2, T3, T4] iso | None )
let _name: String
new iso create(p4: Property4[T1, T2, T3, T4] iso, name': (String | None) = None) =>
_name =
match name'
| None => p4.name()
| let s: String => s
end
_prop4 = consume p4
fun name(): String => _name
fun ref apply(h: TestHelper) ? =>
let prop = ((_prop4 = None) as Property4[T1, T2, T3, T4] iso^)
let params = prop.params()
h.long_test(params.timeout)
let property_runner =
PropertyRunner[(T1, T2, T3, T4)](
consume prop,
params,
h, // PropertyResultNotify
h, // PropertyLogger
h.env
)
h.dispose_when_done(property_runner)
property_runner.run()
| pony | 630613 | https://da.wikipedia.org/wiki/So%20Many%20Tears | So Many Tears | "So Many Tears" () er den anden single single fra, og det fjerde track på, Tupac Shakur's tredje studiealbum Me Against the World. Sangen, indeholder en prøve af Stevie Wonder's "That Girl". Sangen toppede som nr. 6 opå U.S. Rap chart, 21 på U.S. Hip Hop/R&B chart og som nr. 44 på Billboard Hot 100.
"So Many Tears" var en del af 2Pac's Greatest Hits-album fra 1998.
"So Many Tears" blev brugt i Bastards of the Party, en dokumentar om rivaliseringen mellem Bloods og Crips.
Trackliste
Maxi-single
So Many Tears – 3:59
So Many Tears (Key of Z Remix) – 4:23
So Many Tears (Reminizim' Remix) – 4:23
Hard to Imagine af Dramacyd – 4:42
If I Die 2Nite – 3:56
Promo single
So Many Tears
So Many Tears (Key of Z Remix)
So Many Tears (Reminizm' Remix)
If I Die 2Nite
Hitlister
Kilder
eksterne henvisninger
So Many Tears på Discogs
Singler fra 1996
Tupac Shakur-sange
Sange skrevet af Stevie Wonder | danish | 1.362403 |
Pony/pony_check-ValueAndShrink-.txt |
ValueAndShrink[T1: T1]¶
[Source]
Possible return type for
Generator.generate.
Represents a generated value and an Iterator of shrunken values.
type ValueAndShrink[T1: T1] is
(T1^ , Iterator[T1^] ref)
Type Alias For¶
(T1^ , Iterator[T1^] ref)
| pony | 69022 | https://sv.wikipedia.org/wiki/T%20%28SAB%29 | T (SAB) | T är ett signum i SAB.
T Matematik
Ta Matematik: allmänt
Tac Mängdlära
Tad Ordnade algebraiska strukturer
Tag Grafteori
Tak Numerisk analys
Takk Approximationer
Tal Tillämpad matematik
Tala Matematisk programmering
Talaa Linjärprogrammering
Talk Kryptografi
Tam Matematiska lekar
Tb Aritmetik
Tc Algebra
Tce Kombinatorik
Tch Abstrakt algebra
Tchb Ekvationsteori
Tche Linjär och Multilinjär algebra
Tchf Gruppteori
Tck Talteori
Td Matematisk analys
Tda Reella funktioner
Tdb Serier
Tdc Integral- och differentialkalkyl
Tdd Variationskalkyl och optimering
Tdg Funktionalanalys
Tdh Funktioner av komplexa variabler
Te Geometri
Tea Euklidisk geometri
Teh Icke-euklidisk geometri
Tej Trigonometri
Tep Topologi
Tf Mått, mål och vikt
Th Sannolikhetskalkyl och matematisk statistik
Tha Sannolikhetskalkyl
Thi Matematisk statistik
Thib Stickprovsteori
SAB | swedish | 0.867842 |
Pony/builtin-Equatable-.txt |
Equatable[A: Equatable[A] #read]¶
[Source]
interface ref Equatable[A: Equatable[A] #read]
Public Functions¶
eq¶
[Source]
fun box eq(
that: box->A)
: Bool val
Parameters¶
that: box->A
Returns¶
Bool val
ne¶
[Source]
fun box ne(
that: box->A)
: Bool val
Parameters¶
that: box->A
Returns¶
Bool val
| pony | 2140886 | https://sv.wikipedia.org/wiki/Eobrolgus | Eobrolgus | Eobrolgus är ett släkte av kräftdjur. Eobrolgus ingår i familjen Phoxocephalidae.
Kladogram enligt Catalogue of Life:
Källor
Externa länkar
Märlkräftor
Eobrolgus | swedish | 1.040858 |
Pony/ponypath.txt | # `PONYPATH`
When searching for Pony packages, `ponyc` checks both the installation directory (where the standard libraries reside) and any directories listed in the optional environment variable `PONYPATH`.
## Adding to `PONYPATH`
Assuming you just placed new Pony code under a directory called `pony` in your home directory here is how to inform `ponyc` that the directory contains Pony code via adding it to `PONYPATH`.
### Unix/Mac
Edit/add the `rc` file corresponding to your chosen shell (`echo $SHELL` will tell you what shell you are running). For example, if using bash, add the following to your `~/.bashrc`:
```bash
export PONYPATH=$PONYPATH:$HOME/pony
```
(Then run `source ~/.bashrc` to add this variable to a running session. New terminal session will automatically source `~/.bashrc`.)
### Windows
1. Create folder at `C:\Users\<yourusername>\pony`.
2. Right click on "Start" and click on "Control Panel". Select "System and Security", then click on "System".
3. From the menu on the left, select the "Advanced systems settings".
4. Click the "Environment Variables" button at the bottom.
5. Click "New" from the "User variables" section.
6. Type `PONYPATH` into the "Variable name" field.
7. Type `%PONYPATH%;%USERPROFILE%\pony` into the "Variable value" field.
8. Click OK.
You can also add to `PONYPATH` from the command prompt via:
```bash
setx PONYPATH %PONYPATH%;%USERPROFILE%\pony
```
| pony | 3291173 | https://sv.wikipedia.org/wiki/Pycnopogon%20apiformis | Pycnopogon apiformis | Pycnopogon apiformis är en tvåvingeart som först beskrevs av Macquart 1849. Pycnopogon apiformis ingår i släktet Pycnopogon och familjen rovflugor. Inga underarter finns listade i Catalogue of Life.
Källor
Rovflugor
apiformis | swedish | 1.148331 |
Pony/pony_check--index-.txt |
Package
PonyCheck is a library for property based testing
with tight integration into PonyTest.
Property Based Testing¶
In traditional unit testing, the developer specifies one or more input
examples manually for the class or system under test and asserts on certain
output conditions. The difficulty here is to find enough examples to cover
all branches and cases of the class or system under test.
In property based testing, the developer defines a property, a kind of predicate
for the class or system under test that should hold for all kinds or just a
subset of possible input values. The property based testing engine then
generates a big number of random input values and checks if the property holds
for all of them. The developer only needs to specify the possible set of input
values using a Generator.
This testing technique is great for finding edge cases that would easily go
unnoticed with manually constructed test samples. In general it can lead to much
higher coverage than traditional unit testing, with much less code to write.
How PonyCheck implements Property Based Testing¶
A property based test in PonyCheck consists of the following:
A name (mostly for integration into PonyTest)
One or more generators, depending on how your property is laid out.
There are tons of them defined in the primitive
Generators.
A property method that asserts a certain property for each sample
generated by the Generator(s) with the help of
PropertyHelper, which tries to expose a
similar API as TestHelper.
Optionally, the method params() can be used to configure how PonyCheck
executes the property by specifying a custom
PropertyParams object.
The classical list-reverse example:
use "collections"
use "pony_check"
class ListReverseProperty is Property1[List[USize]]
fun name(): String => "list/reverse"
fun gen(): Generator[List[USize]] =>
Generators.list_of[USize](Generators.usize())
fun property(arg1: List[USize], ph: PropertyHelper) =>
ph.array_eq[USize](arg1, arg1.reverse().reverse())
Integration into PonyTest¶
There are two ways of integrating a Property into
PonyTest:
In order to pass your Property to the PonyTest engine, you need to wrap it
inside a Property1UnitTest.
actor Main is TestList
new create(env: Env) => PonyTest(env, this)
fun tag tests(test: PonyTest) =>
test(Property1UnitTest[String](MyStringProperty))
Run as many Properties as you wish inside one
PonyTest UnitTest using the convenience function
PonyCheck.for_all providing a
Generator, the TestHelper
and the actual property function. (Note that the property function is supplied
in a second application of the result to for_all.)
class ListReversePropertyWithinAUnitTest is UnitTest
fun name(): String => "list/reverse/forall"
fun apply(h: TestHelper) =>
let gen = recover val Generators.list_of[USize](Generators.usize()) end
PonyCheck.for_all[List[USize]](gen, h)(
{(sample, ph) =>
ph.array_eq[Usize](arg1, arg1.reverse().reverse())
})
// ... possibly more properties, using `PonyCheck.for_all`
Independently of how you integrate with PonyTest,
the PonyCheck machinery will instantiate the provided Generator, and will
execute it for a configurable number of samples.
If the property fails using an assertion method of
PropertyHelper,
the failed example will be shrunken by the generator
to obtain a smaller and more informative, still failing, sample
for reporting.
Public Types¶
primitive ASCIIAll
primitive ASCIIAllWithNUL
primitive ASCIIDigits
primitive ASCIILetters
primitive ASCIILettersLower
primitive ASCIILettersUpper
primitive ASCIINUL
primitive ASCIINonPrintable
primitive ASCIIPrintable
primitive ASCIIPunctuation
type ASCIIRange
primitive ASCIIWhiteSpace
class CountdownIter
class ForAll
class ForAll2
class ForAll3
class ForAll4
trait GenObj
type GenerateResult
class Generator
primitive Generators
trait IntPairProperty
class IntPairPropertySample
type IntPairUnitTest
trait IntProperty
class IntPropertySample
type IntUnitTest
primitive PonyCheck
class Poperator
trait Property1
class Property1UnitTest
trait Property2
class Property2UnitTest
trait Property3
class Property3UnitTest
trait Property4
class Property4UnitTest
class PropertyHelper
interface PropertyLogger
class PropertyParams
interface PropertyResultNotify
actor PropertyRunner
class Randomness
type ValueAndShrink
type WeightedGenerator
| pony | 5655 | https://sv.wikipedia.org/wiki/Applikationsprogrammeringsgr%C3%A4nssnitt | Applikationsprogrammeringsgränssnitt | Ett API eller applikationsprogrammeringsgränssnitt, av engelskans application programming interface, är en specifikation av hur olika applikationsprogram kan använda och kommunicera med en specifik programvara, som vanligen utgörs av ett dynamiskt länkat bibliotek och som därmed blir en mjukvarukomponent i applikationen. API:et är ett gränssnitt mellan applikationen och biblioteket. Biblioteket blir en mjukvarukomponent i applikationen och utgörs vanligen av en uppsättning funktioner som är tillgängliga för applikationen att anropa, variabler som den kan läsa och/eller ändra, samt datatyper och klasser som den kan använda. Dessa funktioner kan i sin tur använda funktioner, variabler, och så vidare, som inte har gjorts tillgängliga från externa program, utan har kapslats in bakom API:et.
Definition
De flesta programvaror i dagens läge är applikationer som knyter samman annan mjukvarufunktion i olika former och skapar en meningsfull helhet, och denna sammanknytning sker med hjälp av API:er. API:er ger alltså möjlighet att på ett strukturerat sätt återanvända redan utvecklad och kvalitetssäkrad mjukvara som har kapslats in i någon form av kodbibliotek (eng: library). I någon mening kan man säga att ett API är de yttre attributen för en abstrakt datatyp.
Ett välformat API är till sin natur lite "abstrakt" i den meningen att det beskriver en funktion utan att berätta något om hur denna funktion implementeras (ett API som förutsätter något om den underliggande implementationen sägs vara icke välformat).
Olika typer av API:er
Man kan särskilja två olika typer av API:er:
API:er som ger tillgång till olika typer av systemresurser, ofta utan att fästa avseende vid vilket operativsystem programmet ska användas på. Exempel:
Skrivare
Filhantering
Grafikhantering
Radiokretsar (exempelvis WLAN eller Bluetooth)
I detta fall talar man om drivrutins-API:er. API:et används som ett lager mellan högnivåprogrammering och lågnivåresurser (systemresurser).
API:er som ger tillgång till högnivåfunktioner som återanvänds på ett eller annat sätt. Här rör det sig ofta om mjukvara som tillhandahålls av andra leverantörer för olika typer av datahantering eller beräkningar. Exempel:
Matrisberäkningsbibliotek
API:er för att skicka e-post
I detta fall talar man ofta om kommersiella API:er eller högnivå-API:er.
Implementation av ett API
Den programkod som utför det API:et är tänkt att utföra för kallas API:ets implementation. Det existerar ofta ett flertal implementationer för ett visst API, exempelvis för olika operativsystem såsom Windows och olika UNIX-dialekter såsom Linux och Mac OS Classic. Ett API kan implementeras i snart sagt vilket programspråk som helst i vilken operativsystemsmiljö som helst, så länge som det är möjligt för en programmerare att använda det.
Generella och specifika API:er
Man skiljer också på generella och specifika API:er:
Ett generellt API beskriver ett generellt sätt att använda en viss systemresurs eller annan resurs. Exempel är printer-API:er och grafik-API:er såsom OpenGL. Denna typ av API:er tillåter en mjukvaruutvecklare att skapa en programvara som är väldigt flexibel och som kan flyttas mellan olika hårdvaruarkitekturer och operativsystem utan att ändras.
Ett specifikt API ger tillgång till en specifik resurs, ofta en hårdvaruresurs såsom ett specialiserat GPS-chip eller liknande. Denna typ av API:er är vanliga på mer specialiserade hårdvaruarkitekturer.
Vanliga API:er
API:er som många kommer i kontakt med på ett eller annat sätt, exempelvis när man installerar ett nytt program på sin dator, är:
DirectX – för 3D-grafik
GTK+ – för användargränssnitt
OpenGL – för 3D-grafik
Win32 – för applikationsprogrammering på Windows
Open Database Connectivity (ODBC) – för databaser
API och Copyright
2010 stämdes Google av Oracle för att ha implementerat Javakod i Androids operativsystem och sedan distribuerat det. Google hade inte fått tillåtelse att återanvända Java API. Oracle vann tvisten genom ett avgörande i maj 2015.
API:ets kontrakt
Termen kontrakt används ibland som en benämning på en kvasiformell beskrivning på hur, och vilka villkor som ska vara uppfyllda, för att ett API eller en API-funktion ska anropas. Termen kontrakt används också mer formellt i den engelska termen "Design by Contract" (DbC) och avser då en formell specifikation av ett API eller en API-funktion som också utgör en faktisk del av källkoden. Sådana kontrakt möjliggör således kontroll av villkor när anrop till ett API eller API-funktion faktiskt görs. DbC har oftast implementerats i objektorienterade programmeringsspråk.
DbC utvecklades av Bertrand Meyer och har sitt teoretiska ursprung i Tony Hoares Hoare-logik och Jean-Raymond Abrials arbete med Z-notation. "Design by Contract" implementerades först i programmeringsspråket Eiffel och beskrevs först 1986. Stöd för DbC finns idag i flera programmeringsspråk, däribland Ada 2012 och D. Att använda DbC kallas ibland för kontraktsprogrammering.
Ett exempel på kvasiformell beskrivning
Ett kvasiformellt kontrakt för ett matematikbibliotek som tillhandahåller funktionerna Min(...) och Max(...) för heltal kan se ut på följande sätt:
Kontrakt för MinMax
---
Funktioner:
int Max(int a, int b)
Funktion: Max(...) returnerar det större talet av de två inparametrarna a och b
Returvärdets datatyp är heltal (int)
Sidoeffekter: Inga.
int Min(int a, int b)
Funktion: Min(...) returnerar det mindre talet av de två inparametrarna a och b
Returvärdets datatyp är heltal (int)
Sidoeffekter: Inga.
Ett exempel på formell kontraktsbeskrivning i Eiffel
Ett exempel på kontrakt för en funktion för att lägga till element (ELEMENT) i en hashtabell (DICTIONARY) kan se ut så här:
put (x: ELEMENT; key: STRING) is
-- Insert x so that it will be retrievable through key.
require
count ⇐ capacity
not key.empty
do
... Some insertion algorithm ...
ensure
has (x)
item (key) = x
count = old count + 1
end
API-transformator
En API-transformator är en kraftfull lösning som gör att man kan omvandla API-specifikationer till vilket format som helst. Den kan stödja ett brett utbud av olika format.
Referenser
Programutveckling
Teknologisk kommunikation | swedish | 0.837244 |
Pony/files-FileSync-.txt |
FileSync¶
[Source]
primitive val FileSync
Constructors¶
create¶
[Source]
new val create()
: FileSync val^
Returns¶
FileSync val^
Public Functions¶
value¶
[Source]
fun box value()
: U32 val
Returns¶
U32 val
eq¶
[Source]
fun box eq(
that: FileSync val)
: Bool val
Parameters¶
that: FileSync val
Returns¶
Bool val
ne¶
[Source]
fun box ne(
that: FileSync val)
: Bool val
Parameters¶
that: FileSync val
Returns¶
Bool val
| pony | 413351 | https://da.wikipedia.org/wiki/SyncToy | SyncToy | SyncToy er et gratis PowerToy-program fra Microsoft, som er beregnet til automatisk synkronisering (overførsel) af filer, foldere og billeder.
Programmet har en grafisk brugerflade og er skrevet til Microsoft Sync Framework.
SyncToy kan håndtere adskillige foldere samtidig, kan kombinere filer i en sammenhæng og efterligne omdøbte filer og slette samme.
SyncToy 2.1 er sidste udgave af programmet, som blev frigivet den 10. november 2009.
Ekstern henvisning
SyncToy 2.1 Download
Microsoft | danish | 0.717968 |
Pony/pony_check-ForAll2-.txt |
ForAll2[T1: T1, T2: T2]¶
[Source]
class ref ForAll2[T1: T1, T2: T2]
Constructors¶
create¶
[Source]
new ref create(
gen1': Generator[T1] val,
gen2': Generator[T2] val,
h: TestHelper val)
: ForAll2[T1, T2] ref^
Parameters¶
gen1': Generator[T1] val
gen2': Generator[T2] val
h: TestHelper val
Returns¶
ForAll2[T1, T2] ref^
Public Functions¶
apply¶
[Source]
fun ref apply(
prop: {(T1, T2, PropertyHelper) ?}[T1, T2] val)
: None val ?
Parameters¶
prop: {(T1, T2, PropertyHelper) ?}[T1, T2] val
Returns¶
None val ?
| pony | 287467 | https://sv.wikipedia.org/wiki/TTS | TTS | TTS kan syfta på:
Talsyntes (Text To Speech)
Tal och Ton Studioteknik
T-Tauri-stjärna
Teater Teamet Skiftinge
Tvillingtransfusionssyndrom
Girls' Generation-TTS (TaeTiSeo) | swedish | 0.951836 |
Pony/promises-Fulfill-.txt |
Fulfill[A: Any #share, B: Any #share]¶
[Source]
A function from A to B that is called when a promise is fulfilled.
interface iso Fulfill[A: Any #share, B: Any #share]
Public Functions¶
apply¶
[Source]
fun ref apply(
value: A)
: B ?
Parameters¶
value: A
Returns¶
B ?
| pony | 2916004 | https://sv.wikipedia.org/wiki/Amphicallia | Amphicallia | Amphicallia är ett släkte av fjärilar. Amphicallia ingår i familjen björnspinnare.
Kladogram enligt Catalogue of Life:
Bildgalleri
Källor
Externa länkar
Björnspinnare
Amphicallia | swedish | 1.334878 |
Pony/process-WriteError-.txt |
WriteError¶
[Source]
primitive val WriteError
Constructors¶
create¶
[Source]
new val create()
: WriteError val^
Returns¶
WriteError val^
Public Functions¶
string¶
[Source]
fun box string()
: String iso^
Returns¶
String iso^
eq¶
[Source]
fun box eq(
that: WriteError val)
: Bool val
Parameters¶
that: WriteError val
Returns¶
Bool val
ne¶
[Source]
fun box ne(
that: WriteError val)
: Bool val
Parameters¶
that: WriteError val
Returns¶
Bool val
| pony | 3549801 | https://sv.wikipedia.org/wiki/Erigorgus%20variornatus | Erigorgus variornatus | Erigorgus variornatus är en stekelart som först beskrevs av Cameron 1906. Erigorgus variornatus ingår i släktet Erigorgus och familjen brokparasitsteklar. Inga underarter finns listade i Catalogue of Life.
Källor
Brokparasitsteklar
variornatus | swedish | 1.087562 |
Pony/assert--index-.txt |
Assert package¶
Contains runtime assertions. If you are looking for assertion that only run
when your code was compiled with the debug flag, check out Assert. For
assertions that are always enabled, check out Fact.
Public Types¶
primitive Assert
primitive Fact
| pony | 2602898 | https://sv.wikipedia.org/wiki/Agnotecous%20azurensis | Agnotecous azurensis | Agnotecous azurensis är en insektsart som beskrevs av Desutter-grandcolas 2006. Agnotecous azurensis ingår i släktet Agnotecous och familjen syrsor. Inga underarter finns listade i Catalogue of Life.
Källor
Externa länkar
Syrsor
azurensis | swedish | 1.265019 |
Pony/trust-boundary.txt | # Trust Boundary
We mentioned previously that the C-FFI can be used to break pretty much every guarantee that Pony makes. This is because, once you've called into C, you are executing arbitrary machine code that can stomp memory addresses, write to anything, and generally be pretty badly behaved.
## Trust boundaries
When we talk about trust, we don't mean things you trust because you think they are perfect. Instead, we mean things you _have_ to trust in order to get things done, even though you know they are _imperfect_.
In Pony, when you use the C-FFI, you are basically declaring that you trust the C code that's being executed. That's fine, because you may need it to get work done. But what about trusting someone else's code to use the C-FFI? You may need to, but you definitely want to know that it's happening.
## Safe packages
The normal way to handle that is to be sure you're using just the code you need to use in your program. Pretty simple! Don't use some random package from the internet without looking at the code and making sure it doesn't do nasty FFI stuff.
But we can do better than that.
In Pony, you can optionally declare a set of _safe_ packages on the `ponyc` command line, like this:
```sh
ponyc --safe=files:net:process my_project
```
Here, we are declaring that only the `files`, `net` and `process` packages are allowed to use C-FFI calls. We've established our trust boundary: any other packages that try to use C-FFI calls will result in a compile-time error.
| pony | 3842012 | https://sv.wikipedia.org/wiki/Haliplus%20mutchleri | Haliplus mutchleri | Haliplus mutchleri är en skalbaggsart som beskrevs av Wallis. Haliplus mutchleri ingår i släktet Haliplus och familjen vattentrampare. Inga underarter finns listade i Catalogue of Life.
Källor
Vattentrampare
mutchleri | swedish | 1.574064 |
Pony/net-TCPListener-.txt |
TCPListener¶
[Source]
Listens for new network connections.
The following program creates an echo server that listens for
connections on port 8989 and echoes back any data it receives.
use "net"
class MyTCPConnectionNotify is TCPConnectionNotify
fun ref received(
conn: TCPConnection ref,
data: Array[U8] iso,
times: USize)
: Bool
=>
conn.write(String.from_array(consume data))
true
fun ref connect_failed(conn: TCPConnection ref) =>
None
class MyTCPListenNotify is TCPListenNotify
fun ref connected(listen: TCPListener ref): TCPConnectionNotify iso^ =>
MyTCPConnectionNotify
fun ref not_listening(listen: TCPListener ref) =>
None
actor Main
new create(env: Env) =>
TCPListener(TCPListenAuth(env.root),
recover MyTCPListenNotify end, "", "8989")
actor tag TCPListener is
AsioEventNotify tag
Implements¶
AsioEventNotify tag
Constructors¶
create¶
[Source]
Listens for both IPv4 and IPv6 connections.
new tag create(
auth: TCPListenAuth val,
notify: TCPListenNotify iso,
host: String val = "",
service: String val = "0",
limit: USize val = 0,
read_buffer_size: USize val = 16384,
yield_after_reading: USize val = 16384,
yield_after_writing: USize val = 16384)
: TCPListener tag^
Parameters¶
auth: TCPListenAuth val
notify: TCPListenNotify iso
host: String val = ""
service: String val = "0"
limit: USize val = 0
read_buffer_size: USize val = 16384
yield_after_reading: USize val = 16384
yield_after_writing: USize val = 16384
Returns¶
TCPListener tag^
ip4¶
[Source]
Listens for IPv4 connections.
new tag ip4(
auth: TCPListenAuth val,
notify: TCPListenNotify iso,
host: String val = "",
service: String val = "0",
limit: USize val = 0,
read_buffer_size: USize val = 16384,
yield_after_reading: USize val = 16384,
yield_after_writing: USize val = 16384)
: TCPListener tag^
Parameters¶
auth: TCPListenAuth val
notify: TCPListenNotify iso
host: String val = ""
service: String val = "0"
limit: USize val = 0
read_buffer_size: USize val = 16384
yield_after_reading: USize val = 16384
yield_after_writing: USize val = 16384
Returns¶
TCPListener tag^
ip6¶
[Source]
Listens for IPv6 connections.
new tag ip6(
auth: TCPListenAuth val,
notify: TCPListenNotify iso,
host: String val = "",
service: String val = "0",
limit: USize val = 0,
read_buffer_size: USize val = 16384,
yield_after_reading: USize val = 16384,
yield_after_writing: USize val = 16384)
: TCPListener tag^
Parameters¶
auth: TCPListenAuth val
notify: TCPListenNotify iso
host: String val = ""
service: String val = "0"
limit: USize val = 0
read_buffer_size: USize val = 16384
yield_after_reading: USize val = 16384
yield_after_writing: USize val = 16384
Returns¶
TCPListener tag^
Public Behaviours¶
set_notify¶
[Source]
Change the notifier.
be set_notify(
notify: TCPListenNotify iso)
Parameters¶
notify: TCPListenNotify iso
dispose¶
[Source]
Stop listening.
be dispose()
Public Functions¶
local_address¶
[Source]
Return the bound IP address.
fun box local_address()
: NetAddress val
Returns¶
NetAddress val
close¶
[Source]
Dispose of resources.
fun ref close()
: None val
Returns¶
None val
| pony | 1850045 | https://no.wikipedia.org/wiki/Houston%20Texans%20i%20NFL-sesongen%202018 | Houston Texans i NFL-sesongen 2018 | Houston Texans spilte i sin 17. sesong i National Football League (NFL) og femte under hovedtrener Bill O'Brien. Dette var den første sesongen siden 2005 at Rick Smith ikke var lagets general manager, etter at han trakk seg tilbake av personlige grunner. Til tross for å ha startet sesongen 0–3 for første gang på 10 år forbedret Texans på fjoråret etter en seier over Miami Dolphins i uke 8. De satte en lagrekord med ni seiere på rad, som også var en ny NFL-rekord for lengste seierrekke etter å ha startet en sesong med tre strake nederlag. Rekken ble avsluttet med et tap mot Indianapolis Colts i uke 14. Med en seier over New York Jets i uke 15 sikret Texans sin første sesong med 10+ seiere under Bill O'Brien, første siden 2012, og tredje totalt.
Bob McNair, eier og grunnlegger av Texans, døde 23. november 2018 i en alder av 81 år.
Til tross for et tap mot Philadelphia Eagles i uke 16 sikret Texans en tur til sluttspillet etter at New Orleans Saints slo Pittsburgh Steelers senere samme dag. Med en seier over Jacksonville Jaguars i sesongfinalen sikret Texans lagets femte divisjonstittel i AFC South. I sluttspillet tapte de derimot 21–7 i wildcardrunden mot divisjonsrivalene Indianapolis Colts.
Draft
Draftbytter
Texans byttet sitt pick i første runde (#4) samt sitt pikc i fjerde runde (#25) i 2017 til Cleveland Browns mot Clevelands pick i første runde i 2017 (#12).
Texans byttet sitt pick i andre runde (#35), sjette runde i 2017 (#188) og quarterback Brock Osweiler til Cleveland mot Clevelands pick i fjerde runde i 2017 (#142).
Texans byttet sitt pick i femte runde (#141) og offensive tackle Duane Brown til Seattle mot Seattles pick i tredje runde (#80) og et pick i andre runde i 2019.
Texans ble tildelt et kompensasjonspick i tredje runde og to i sjette (#98, #211 og #214).
Personale
Spillerstall ved sesongslutt
NFL Top 100
Preseason
Seriespill
Terminliste
Merk: Divisjonsmotstandere er i fet skrift.
Kampreferater
Uke 1: at New England Patriots
Uke 2: at Tennessee Titans
Uke 3: mot New York Giants
Uke 4: at Indianapolis Colts
Uke 5: mot Dallas Cowboys
Uke 6: mot Buffalo Bills
Battle Red Day
Uke 7: at Jacksonville Jaguars
Uke 8: mot Miami Dolphins
Uke 9: at Denver Broncos
Uke 11: at Washington Redskins
Uke 12: mot Tennessee Titans
Uke 13: mot Cleveland Browns
Uke 14: mot Indianapolis Colts
Uke 15: at New York Jets
Uke 16: at Philadelphia Eagles
Uke 17: mot Jacksonville Jaguars
Tabeller
Divisjon
Conference
Sluttspill
AFC Wild Card Playoffs: mot (6) Indianapolis Colts
Referanser
Eksterne lenker
National Football League-sesongen 2018 etter lag
2018
Sport i USA i 2018
2018 | norwegian_bokmål | 1.221356 |
Pony/net-Proxy-.txt |
Proxy¶
[Source]
interface ref Proxy
Public Functions¶
apply¶
[Source]
fun box apply(
wrap: TCPConnectionNotify iso)
: TCPConnectionNotify iso^
Parameters¶
wrap: TCPConnectionNotify iso
Returns¶
TCPConnectionNotify iso^
| pony | 18198 | https://no.wikipedia.org/wiki/TCP | TCP | Transmission Control Protocol (TCP) er en nettverksprotokoll for forbindelsesorientert, pålitelig overføring av informasjon, og opererer på transportlaget i OSI-modellen for datanett.
I protokollsettet for Internett opererer TCP mellom Internett-protokollen (under) og en applikasjon (over). Applikasjonene trenger som oftest en pålitelig tilkobling mellom endepunktene, noe Internett-protokollen ikke tilbyr alene.
Applikasjonene sender strømmer av 8-biters tegn for å bli sendt gjennom nettverket, og TCP-protokollen deler denne strømmen opp i pakker med en bestemt størrelse (vanligvis bestemt av nettverket som datamaskinen er koblet til). TCP sender så pakkene videre til Internett-protokollen som sørger for at de blir sendt til TCP-modulen i den andre enden av forbindelsen. TCP passer på at ingen pakker forsvinner ved å gi hvert tegn i strømmen et sekvensnummer, som også blir brukt for å forsikre at pakkene blir levert i riktig rekkefølge hos mottakeren.
TCP-modulen i mottakerenden sender så tilbake en kvittering for tegn som er blitt mottatt. Hvis kvitteringen ikke er mottatt innen et visst tidspunkt, vil et tidsavbrudd oppstå. Da vil sender anta at pakken er tapt, og pakken må sendes på nytt. TCP sjekker også at datastrømmen ikke er skadd ved å bruke en sjekksum. Sjekksummen blir beregnet av senderen, og kontrollert hos mottaker, for hver pakke.
Virkemåte
TCP forbindelser har tre faser: opprettelsen av en forbindelse, dataoverføringen og tilslutt avslutningen av forbindelsen. Et treveis håndtrykk blir brukt for å opprette en forbindelse. Et fireveis håndtrykk blir brukt for å avslutte en forbindelse. I opprettelsesfasen av en forbindelse vil parametre som sekvensnummer bli initialisert for å oppnå riktig rekkefølge på pakkene og robusthet.
Opprettelse av en forbindelse (treveis håndtrykk)
Selv om det er mulig for to endepunkter å åpne en forbindelse mellom hverandre samtidig, så vil dette typisk
skje ved at ene enden åpner en socket og venter passivt på at noen skal koble seg til. Dette blir ofte
kalt passiv åpning og er typisk for tjener-enden av en forbindelse. Klientsiden av en forbindelse utfører
en aktiv åpning ved å sende et TCP segment med SYN-flagget satt til tjeneren som en del av treveishåndtrykket.
Tjenersiden skal da besvare en gyldig SYN-forespørsel med SYN/ACK. Til slutt så skal klientsiden av forbindelsen
svare tjeneren med et ACK som fullfører treveishåndtrykket og opprettelsen av en forbindelse.
Dataoverføring
I dataoverføringsfasen har TCP noen mekanismer som avgjør grad av robusthet og pålitelighet.
Et sekvensnummer brukes for å ordne segmentene i riktig rekkefølge, og for å detektere dupliserte data. Sjekksummer
brukes for å detektere feil i segmentene. Kvitteringer og tidsavbrudd brukes for å detektere feil og for å tilpasse
TCP ved tap av segmenter eller ved forsinkelse.
I opprettelsesfasen utveksles innledende sekvensnummer mellom de to endepunktene. Disse sekvensnummerne blir brukt
til å identifisere hvert enkelt tegn i strømmen av tegn. Det er alltid et par av sekvensnummer i hvert TCP-segment. Disse blir referert til som henholdsvis sekvensnummeret og kvitteringsnummeret. En TCP-sender refererer til sitt eget sekvensnummer som sekvensnummer og mottakers sekvensnummer som kvitteringsnummer. For å opprettholde pålitlighet, kvitterer en mottaker et TCP-segment ved å indikere at alle tegn fram til et gitt tegn i den kontinuerlige tegnstrømmen er mottatt. En utvidelse av TCP, kalt SACK (Selective Acknowledgements), tillater en TCP-mottaker å kvittere for blokker av tegn som ikke er i rekkefølge.
Dette gjør at hvis et enkelt tegn i strømmen går tapt så kan TCP kvittere for tegn før dette, og dermed unngå at alle disse tegna må sendes på nytt.
Gjennom bruken av sekvens- og kvitteringsnummer kan TCP levere segmenter i korrekt rekkefølge til mottakerapplikasjonen. Sekvens- og kvitteringsnummer er 32-biters positive heltall som vil rulle rundt til 0 ved det neste tegnet i strømmen etter 232-1.
En 16-bit sjekksum som består av ener-komplementet til ener-komplement summen av innholdet i hodet og datadelen fra
TCP-segmentet blir kalkulert av senderen og inkludert i segmentet når det sendes.
TCP-mottakeren kalkulerer sjekksummen av TCP-hodet og datadelen som er mottatt, og hvis denne ikke avviker fra
sjekksummen senderen kalkulerte så antas segmentet å være intakt og uten feil.
TCP-sjekksummen er ganske svak i forhold til moderne standarder. Datalinklag med stor sannsynlighet for bitfeil,
krever gjerne bedre evne til å korrigere og påvise feil. Hvis TCP skulle bli konstruert på nytt i dag ville mest
sannsynlig en 32-bit syklisk redundanssjekk (CRC) spesifisert som en feilsjekk blitt brukt i stedet for sjekksummen. Den svake sjekksummen er delvis kompensert for ved bruken av CRC eller bedre integritetssjekk
på datalink-laget, under både TCP og IP, slik som for eksempel i en PPP- eller Ethernet-ramme. Imidlertid betyr
ikke dette at 16 bit-sjekksummen til TCP er redundant. Undersøkelser av internettrafikk har vist at programvare-
og maskinvarefeil som introduserer feil i pakker mellom CRC-beskytta hopp er vanlige, og at TCP-sjekksummen
fanger opp de fleste av slike enkle feil. Dette er et eksempel på ende-til-ende-prinsippet.
Kvitteringer for tegn som er sendt, eller fravær av kvitteringer, blir brukt av sendere for å implisitt lære om
tilstanden på nettverket mellom TCP-avsender og -mottaker. Dette sammen med tidtakere gjør at TCP-sendere og -mottakere kan endre oppførselen til flyten av tegn. Dette kalles vanligvis flytkontroll, metningskontroll og/eller metningsunngåelse. TCP bruker et antall mekanismer for å oppnå både robusthet og høy ytelse.
Disse mekanismene inkluderer bruken av et sliding window, slow-start algoritmen, congestion avoidance algoritmen, fast retransmit og fast recovery algoritmene, og så videre. Utvidelser av TCP for å pålitelig kunne håndtere tap, minimalisere feil, håndtere metning og ha en høy overføringshastighet i nettverk med svært høy kapasitet
er områder det forskes på og utvikles standarder for.
Avslutning av en forbindelse (4-veis håndtrykk)
I denne fasen benyttes et 4-veis håndtrykk. Hver ende av forbindelsen avslutter uavhengig av hverandre.
For hvert endepunkt som lukker forbindelsen kreves et par med FIN og ACK segmenter.
TCP-porter
TCP bruker portnummer for å identifisere sender- og mottakerapplikasjoner. Applikasjonen på hver side
av en TCP-forbindelse får tildelt et 16-bit unsigned portnummer. Porter er kategorisert i 3 grunnleggende kategorier: kjente, registrerte, og dynamiske/private. De kjente portene er tildelt av
Internet Assigned Numbers Authority (IANA) og er typisk brukt av systemnivå
eller rotprosesser. Velkjente applikasjoner som kjører som tjenere og venter passivt på tilkoblinger fra
klienter bruker typisk disse portene. Noen eksempler på slike er: FTP (21), Telnet (23), SMTP (25) og HTTP (80).
Registrerte porter blir typisk brukt av brukerapplikasjoner som midlertidige kildeporter når
tjenere kontaktes, men disse portene kan også identifisere kjente tjenester registrert av en tredjepart.
Dynamiske/private porter kan også bruke av sluttbrukerapplikasjoner, men blir ikke så ofte brukt på den måten.
Dynamiske/private porter har ingen mening utenfor en bestemt TCP-forbindelse. TCP-portnummeret lagres i
et felt på 16-bit i TCP-hodet, og 65535 porter er dermed tilgjengelige.
Utviklingen av TCP
TCP er en kompleks protokoll og fortsatt under utvikling. Selv om betydelige utvidelser har blitt gjort og foreslått siden TCP ble dokumentert i RFC 793 i 1981, har den grunnleggende funksjonaliteten få endringer.
RFC 1122, Host Requirements for Internet Hosts, oppklarte noen implementasjonskrav for TCP protokollen. RFC 2581, TCP Congestion Control som er en av de viktigste TCP relaterte RFCene i de senere år
beskriver oppdaterte algoritmer for å unngå urimelig metning. I 2001 ble RFC 3168 publisert som beskriver
explicit congestion notification (ECN) som er en mekanisme for å varsle om metning i nettverket. I dag brukes
TCP til tilnærmet 95 % av all Internett trafikk. Vanlige applikasjoner som bruker TCP er blant annet HTTP/HTTPS
(world wide web), SMTP/POP3/IMAP (e-post) og FTP (filoverføring). Den vidstrakte bruken vitner om at de
opprinnelige utviklerne gjorde en svært god jobb.
Alternativer til TCP
TCP er imidlertid ikke like godt egnet til alle applikasjoner. Derfor har nyere transportlags-protokoller blitt utviklet for å takle noen av svakhetene. For eksempel trenger sanntidsapplikasjoner ofte ikke, og vil
lide av TCP's pålitelige leveringsmekanismer. I slike applikasjoner er det ofte bedre å ha litt tap, feil eller
metning enn å prøve å tilpasse seg. Noen eksempler på slike applikasjoner er sanntids-strømmer av multimedia
(som Internett-radio), sanntidsspill og IP-telefoni. Slike applikasjoner kan velge å bruke
andre transportlagsprotokoller som for eksempel User Datagram Protocol (UDP), Stream Control Transmission Protocol SCTP), eller Datagram Congestion Control Protocol (DCCP)
Litteratur
W. Richard Stevens, TCP/IP Illustrated, Volume 1 : The Protocols, ISBN 0-201-63346-9
Eksterne lenker
RFC793 (Spesifikasjonen)
IANA Port Assignments
Sally Floyd's homepage
John Kristoff's Overview of TCP (Fundamental concepts behind TCP and how it is used to transport data between two endpoints)
When The CRC and TCP Checksum Disagree
Introduction to TCP/IP – with some pictures
The basics of Transmission Control Protocol
Tcp/Ip port numbers. Information for Unix based system administrators
TCP, Transmission Control Protocol
Datanett
Internett-protokoller | norwegian_bokmål | 0.620225 |
Pony/format-FormatOctal-.txt |
FormatOctal¶
[Source]
primitive val FormatOctal is
FormatSpec val
Implements¶
FormatSpec val
Constructors¶
create¶
[Source]
new val create()
: FormatOctal val^
Returns¶
FormatOctal val^
Public Functions¶
eq¶
[Source]
fun box eq(
that: FormatOctal val)
: Bool val
Parameters¶
that: FormatOctal val
Returns¶
Bool val
ne¶
[Source]
fun box ne(
that: FormatOctal val)
: Bool val
Parameters¶
that: FormatOctal val
Returns¶
Bool val
| pony | 1254576 | https://sv.wikipedia.org/wiki/Utf%C3%B6rbart%20och%20l%C3%A4nkbart%20format | Utförbart och länkbart format | Körbart och länkbart format ("Executable and Linkable Format", ELF, tidigare kallat Extensible Linking Format), är ett öppet standardfilformat för körbara filer, objektkod, delade bibliotek och dump av kärnan i systemprogrammet.
Formatet ELF publicerades först i specifikationen för applikationsbinära gränssnitt i System V och senare i verktygsgränssnittsstandarden TIS. Det blev snabbt accepterat hos andra leverantörer av Unix-system. 1999 blev det valt som det standardiserade filformatet för Unix och Unixliknande system på x86 av 86open-projektet.
Till skillnad från många andra proprietära och därmed begränsade filformat, så är ELF väldigt flexibelt och utökningsbart, och det är obundet till processor eller arkitektur. Detta har möjliggjort att det blivit valt som standardformat i många olika operativsystem på många plattformar.
Filformatet används också som ett generellt objekt- och körbarhetsformat för binära kodsegment som används för inbyggda processorsystem som till exempel Atmels AVR-serie.
Referenser
Filformat | swedish | 0.784608 |
Pony/files-FileLink-.txt |
FileLink¶
[Source]
primitive val FileLink
Constructors¶
create¶
[Source]
new val create()
: FileLink val^
Returns¶
FileLink val^
Public Functions¶
value¶
[Source]
fun box value()
: U32 val
Returns¶
U32 val
eq¶
[Source]
fun box eq(
that: FileLink val)
: Bool val
Parameters¶
that: FileLink val
Returns¶
Bool val
ne¶
[Source]
fun box ne(
that: FileLink val)
: Bool val
Parameters¶
that: FileLink val
Returns¶
Bool val
| pony | 4890008 | https://sv.wikipedia.org/wiki/Formula%203%20Euro%20Series%202012 | Formula 3 Euro Series 2012 | Formula 3 Euro Series 2012 var den tionde säsongen av formelbilsmästerskapet Formula 3 Euro Series. Den första tävlingshelgen kördes på Hockenheimring den 28-29 april, och den sista på Hockenheimring den 20-21 oktober. Daniel Juncadella vann förarmästerskapet och Prema Powerteam vann teammästerskapet.
Team och förare
Kalender och resultat
Slutställningar
Race 1 & 3
Race 2
Förarmästerskapet
Noteringar:
† — Föraren gick ej i mål, men blev klassificerad för att ha kört över 90% av racedistansen.
Teammästerskapet
Nationsmästerskapet
Referenser
Externa länkar
Säsonger
F3 Euroseries-säsonger
Motorsportevenemang 2012 | swedish | 1.25822 |
Pony/src-backpressure-auth-.txt |
auth.pony
1
2
3primitive ApplyReleaseBackpressureAuth
new create(from: AmbientAuth) =>
None
| pony | 4958328 | https://sv.wikipedia.org/wiki/Cassipourea%20ruwensorensis | Cassipourea ruwensorensis | Cassipourea ruwensorensis är en tvåhjärtbladig växtart som först beskrevs av Adolf Engler, och fick sitt nu gällande namn av Arthur Hugh Garfit Alston. Cassipourea ruwensorensis ingår i släktet Cassipourea, och familjen Rhizophoraceae. Inga underarter finns listade i Catalogue of Life.
Källor
Malpigiaordningen
ruwensorensis | swedish | 1.409346 |
Pony/builtin-ILong-.txt |
ILong¶
[Source]
primitive val ILong is
SignedInteger[ILong val, ULong val] val
Implements¶
SignedInteger[ILong val, ULong val] val
Constructors¶
create¶
[Source]
new val create(
value: ILong val)
: ILong val^
Parameters¶
value: ILong val
Returns¶
ILong val^
from[A: ((I8 val | I16 val | I32 val | I64 val | I128 val | ILong val | ISize val | U8 val | U16 val | U32 val | U64 val | U128 val | ULong val | USize val | F32 val | F64 val) & Real[A] val)]¶
[Source]
new val from[A: ((I8 val | I16 val | I32 val |
I64 val | I128 val | ILong val |
ISize val | U8 val | U16 val |
U32 val | U64 val | U128 val |
ULong val | USize val | F32 val |
F64 val) & Real[A] val)](
a: A)
: ILong val^
Parameters¶
a: A
Returns¶
ILong val^
min_value¶
[Source]
new val min_value()
: ILong val^
Returns¶
ILong val^
max_value¶
[Source]
new val max_value()
: ILong val^
Returns¶
ILong val^
Public Functions¶
abs¶
[Source]
fun box abs()
: ULong val
Returns¶
ULong val
bit_reverse¶
[Source]
fun box bit_reverse()
: ILong val
Returns¶
ILong val
bswap¶
[Source]
fun box bswap()
: ILong val
Returns¶
ILong val
popcount¶
[Source]
fun box popcount()
: ULong val
Returns¶
ULong val
clz¶
[Source]
fun box clz()
: ULong val
Returns¶
ULong val
ctz¶
[Source]
fun box ctz()
: ULong val
Returns¶
ULong val
clz_unsafe¶
[Source]
fun box clz_unsafe()
: ULong val
Returns¶
ULong val
ctz_unsafe¶
[Source]
fun box ctz_unsafe()
: ULong val
Returns¶
ULong val
bitwidth¶
[Source]
fun box bitwidth()
: ULong val
Returns¶
ULong val
bytewidth¶
[Source]
fun box bytewidth()
: USize val
Returns¶
USize val
min¶
[Source]
fun box min(
y: ILong val)
: ILong val
Parameters¶
y: ILong val
Returns¶
ILong val
max¶
[Source]
fun box max(
y: ILong val)
: ILong val
Parameters¶
y: ILong val
Returns¶
ILong val
fld¶
[Source]
fun box fld(
y: ILong val)
: ILong val
Parameters¶
y: ILong val
Returns¶
ILong val
fld_unsafe¶
[Source]
fun box fld_unsafe(
y: ILong val)
: ILong val
Parameters¶
y: ILong val
Returns¶
ILong val
mod¶
[Source]
fun box mod(
y: ILong val)
: ILong val
Parameters¶
y: ILong val
Returns¶
ILong val
mod_unsafe¶
[Source]
fun box mod_unsafe(
y: ILong val)
: ILong val
Parameters¶
y: ILong val
Returns¶
ILong val
hash¶
[Source]
fun box hash()
: USize val
Returns¶
USize val
addc¶
[Source]
fun box addc(
y: ILong val)
: (ILong val , Bool val)
Parameters¶
y: ILong val
Returns¶
(ILong val , Bool val)
subc¶
[Source]
fun box subc(
y: ILong val)
: (ILong val , Bool val)
Parameters¶
y: ILong val
Returns¶
(ILong val , Bool val)
mulc¶
[Source]
fun box mulc(
y: ILong val)
: (ILong val , Bool val)
Parameters¶
y: ILong val
Returns¶
(ILong val , Bool val)
divc¶
[Source]
fun box divc(
y: ILong val)
: (ILong val , Bool val)
Parameters¶
y: ILong val
Returns¶
(ILong val , Bool val)
remc¶
[Source]
fun box remc(
y: ILong val)
: (ILong val , Bool val)
Parameters¶
y: ILong val
Returns¶
(ILong val , Bool val)
fldc¶
[Source]
fun box fldc(
y: ILong val)
: (ILong val , Bool val)
Parameters¶
y: ILong val
Returns¶
(ILong val , Bool val)
modc¶
[Source]
fun box modc(
y: ILong val)
: (ILong val , Bool val)
Parameters¶
y: ILong val
Returns¶
(ILong val , Bool val)
add_partial¶
[Source]
fun box add_partial(
y: ILong val)
: ILong val ?
Parameters¶
y: ILong val
Returns¶
ILong val ?
sub_partial¶
[Source]
fun box sub_partial(
y: ILong val)
: ILong val ?
Parameters¶
y: ILong val
Returns¶
ILong val ?
mul_partial¶
[Source]
fun box mul_partial(
y: ILong val)
: ILong val ?
Parameters¶
y: ILong val
Returns¶
ILong val ?
div_partial¶
[Source]
fun box div_partial(
y: ILong val)
: ILong val ?
Parameters¶
y: ILong val
Returns¶
ILong val ?
rem_partial¶
[Source]
fun box rem_partial(
y: ILong val)
: ILong val ?
Parameters¶
y: ILong val
Returns¶
ILong val ?
divrem_partial¶
[Source]
fun box divrem_partial(
y: ILong val)
: (ILong val , ILong val) ?
Parameters¶
y: ILong val
Returns¶
(ILong val , ILong val) ?
fld_partial¶
[Source]
fun box fld_partial(
y: ILong val)
: ILong val ?
Parameters¶
y: ILong val
Returns¶
ILong val ?
mod_partial¶
[Source]
fun box mod_partial(
y: ILong val)
: ILong val ?
Parameters¶
y: ILong val
Returns¶
ILong val ?
shl¶
[Source]
fun box shl(
y: ULong val)
: ILong val
Parameters¶
y: ULong val
Returns¶
ILong val
shr¶
[Source]
fun box shr(
y: ULong val)
: ILong val
Parameters¶
y: ULong val
Returns¶
ILong val
shl_unsafe¶
[Source]
fun box shl_unsafe(
y: ULong val)
: ILong val
Parameters¶
y: ULong val
Returns¶
ILong val
shr_unsafe¶
[Source]
fun box shr_unsafe(
y: ULong val)
: ILong val
Parameters¶
y: ULong val
Returns¶
ILong val
string¶
[Source]
fun box string()
: String iso^
Returns¶
String iso^
add_unsafe¶
[Source]
fun box add_unsafe(
y: ILong val)
: ILong val
Parameters¶
y: ILong val
Returns¶
ILong val
sub_unsafe¶
[Source]
fun box sub_unsafe(
y: ILong val)
: ILong val
Parameters¶
y: ILong val
Returns¶
ILong val
mul_unsafe¶
[Source]
fun box mul_unsafe(
y: ILong val)
: ILong val
Parameters¶
y: ILong val
Returns¶
ILong val
div_unsafe¶
[Source]
fun box div_unsafe(
y: ILong val)
: ILong val
Parameters¶
y: ILong val
Returns¶
ILong val
divrem_unsafe¶
[Source]
fun box divrem_unsafe(
y: ILong val)
: (ILong val , ILong val)
Parameters¶
y: ILong val
Returns¶
(ILong val , ILong val)
rem_unsafe¶
[Source]
fun box rem_unsafe(
y: ILong val)
: ILong val
Parameters¶
y: ILong val
Returns¶
ILong val
neg_unsafe¶
[Source]
fun box neg_unsafe()
: ILong val
Returns¶
ILong val
op_and¶
[Source]
fun box op_and(
y: ILong val)
: ILong val
Parameters¶
y: ILong val
Returns¶
ILong val
op_or¶
[Source]
fun box op_or(
y: ILong val)
: ILong val
Parameters¶
y: ILong val
Returns¶
ILong val
op_xor¶
[Source]
fun box op_xor(
y: ILong val)
: ILong val
Parameters¶
y: ILong val
Returns¶
ILong val
op_not¶
[Source]
fun box op_not()
: ILong val
Returns¶
ILong val
add¶
[Source]
fun box add(
y: ILong val)
: ILong val
Parameters¶
y: ILong val
Returns¶
ILong val
sub¶
[Source]
fun box sub(
y: ILong val)
: ILong val
Parameters¶
y: ILong val
Returns¶
ILong val
mul¶
[Source]
fun box mul(
y: ILong val)
: ILong val
Parameters¶
y: ILong val
Returns¶
ILong val
div¶
[Source]
fun box div(
y: ILong val)
: ILong val
Parameters¶
y: ILong val
Returns¶
ILong val
divrem¶
[Source]
fun box divrem(
y: ILong val)
: (ILong val , ILong val)
Parameters¶
y: ILong val
Returns¶
(ILong val , ILong val)
rem¶
[Source]
fun box rem(
y: ILong val)
: ILong val
Parameters¶
y: ILong val
Returns¶
ILong val
neg¶
[Source]
fun box neg()
: ILong val
Returns¶
ILong val
eq¶
[Source]
fun box eq(
y: ILong val)
: Bool val
Parameters¶
y: ILong val
Returns¶
Bool val
ne¶
[Source]
fun box ne(
y: ILong val)
: Bool val
Parameters¶
y: ILong val
Returns¶
Bool val
lt¶
[Source]
fun box lt(
y: ILong val)
: Bool val
Parameters¶
y: ILong val
Returns¶
Bool val
le¶
[Source]
fun box le(
y: ILong val)
: Bool val
Parameters¶
y: ILong val
Returns¶
Bool val
ge¶
[Source]
fun box ge(
y: ILong val)
: Bool val
Parameters¶
y: ILong val
Returns¶
Bool val
gt¶
[Source]
fun box gt(
y: ILong val)
: Bool val
Parameters¶
y: ILong val
Returns¶
Bool val
hash64¶
[Source]
fun box hash64()
: U64 val
Returns¶
U64 val
i8¶
[Source]
fun box i8()
: I8 val
Returns¶
I8 val
i16¶
[Source]
fun box i16()
: I16 val
Returns¶
I16 val
i32¶
[Source]
fun box i32()
: I32 val
Returns¶
I32 val
i64¶
[Source]
fun box i64()
: I64 val
Returns¶
I64 val
i128¶
[Source]
fun box i128()
: I128 val
Returns¶
I128 val
ilong¶
[Source]
fun box ilong()
: ILong val
Returns¶
ILong val
isize¶
[Source]
fun box isize()
: ISize val
Returns¶
ISize val
u8¶
[Source]
fun box u8()
: U8 val
Returns¶
U8 val
u16¶
[Source]
fun box u16()
: U16 val
Returns¶
U16 val
u32¶
[Source]
fun box u32()
: U32 val
Returns¶
U32 val
u64¶
[Source]
fun box u64()
: U64 val
Returns¶
U64 val
u128¶
[Source]
fun box u128()
: U128 val
Returns¶
U128 val
ulong¶
[Source]
fun box ulong()
: ULong val
Returns¶
ULong val
usize¶
[Source]
fun box usize()
: USize val
Returns¶
USize val
f32¶
[Source]
fun box f32()
: F32 val
Returns¶
F32 val
f64¶
[Source]
fun box f64()
: F64 val
Returns¶
F64 val
i8_unsafe¶
[Source]
fun box i8_unsafe()
: I8 val
Returns¶
I8 val
i16_unsafe¶
[Source]
fun box i16_unsafe()
: I16 val
Returns¶
I16 val
i32_unsafe¶
[Source]
fun box i32_unsafe()
: I32 val
Returns¶
I32 val
i64_unsafe¶
[Source]
fun box i64_unsafe()
: I64 val
Returns¶
I64 val
i128_unsafe¶
[Source]
fun box i128_unsafe()
: I128 val
Returns¶
I128 val
ilong_unsafe¶
[Source]
fun box ilong_unsafe()
: ILong val
Returns¶
ILong val
isize_unsafe¶
[Source]
fun box isize_unsafe()
: ISize val
Returns¶
ISize val
u8_unsafe¶
[Source]
fun box u8_unsafe()
: U8 val
Returns¶
U8 val
u16_unsafe¶
[Source]
fun box u16_unsafe()
: U16 val
Returns¶
U16 val
u32_unsafe¶
[Source]
fun box u32_unsafe()
: U32 val
Returns¶
U32 val
u64_unsafe¶
[Source]
fun box u64_unsafe()
: U64 val
Returns¶
U64 val
u128_unsafe¶
[Source]
fun box u128_unsafe()
: U128 val
Returns¶
U128 val
ulong_unsafe¶
[Source]
fun box ulong_unsafe()
: ULong val
Returns¶
ULong val
usize_unsafe¶
[Source]
fun box usize_unsafe()
: USize val
Returns¶
USize val
f32_unsafe¶
[Source]
fun box f32_unsafe()
: F32 val
Returns¶
F32 val
f64_unsafe¶
[Source]
fun box f64_unsafe()
: F64 val
Returns¶
F64 val
compare¶
[Source]
fun box compare(
that: ILong val)
: (Less val | Equal val | Greater val)
Parameters¶
that: ILong val
Returns¶
(Less val | Equal val | Greater val)
| pony | 111360 | https://nn.wikipedia.org/wiki/IC%204687%2C%20IC%204686%20og%20IC%204689 | IC 4687, IC 4686 og IC 4689 | IC 4687, IC 4686 og IC 4689 er ein trio av vekselverkande galaksar som ligg rundt 250 millionar lysår unna jorda i stjernebiletet Påfuglen.
Kjelder
Denne artikkelen i sin heilskap baserer seg på pressemelding STScI-2008-16 frå Space Telescope Science Institute.
Vekselverkande galaksar
Påfuglen
IC-objekt | norwegian_nynorsk | 1.017243 |
Pony/src-files-file_mode-.txt |
file_mode.pony
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110class FileMode
"""
This stores a UNIX-style mode broken out into a Bool for each bit. For other
operating systems, the mapping will be approximate. For example, on Windows,
if the file is readable all the read Bools will be set, and if the file is
writeable, all the write Bools will be set.
The default mode is read/write for the owner, read-only for everyone else.
"""
var setuid: Bool = false
"""`true` if the SETUID bit is set."""
var setgid: Bool = false
"""`true` if the SETGID bit is set."""
var sticky: Bool = false
"""`true` if the sticky bit is set."""
var owner_read: Bool = true
"""`true` if the owning user can read the file."""
var owner_write: Bool = true
"""`true` if the owning user can write to the file."""
var owner_exec: Bool = false
"""`true` if the owning user can execute the file."""
var group_read: Bool = true
"""`true` if members of the owning group can read the file."""
var group_write: Bool = false
"""`true` if members of the owning group can write to the file."""
var group_exec: Bool = false
"""`true` if members of the owning group can execute the file."""
var any_read: Bool = true
"""`true` if every user can read the file."""
var any_write: Bool = false
"""`true` if every user can write to the file."""
var any_exec: Bool = false
"""`true if every user can execute the file."""
fun ref exec() =>
"""
Set the executable flag for everyone.
"""
owner_exec = true
group_exec = true
any_exec = true
fun ref shared() =>
"""
Set the write flag for everyone to the same as owner_write.
"""
group_write = owner_write
any_write = owner_write
fun ref group() =>
"""
Clear all of the any-user flags.
"""
any_read = false
any_write = false
any_exec = false
fun ref private() =>
"""
Clear all of the group and any-user flags.
"""
group_read = false
group_write = false
group_exec = false
any_read = false
any_write = false
any_exec = false
fun u32(): U32 =>
"""
Get the OS specific integer for a file mode. On Windows, if any read flag
is set, the path is made readable, and if any write flag is set, the path
is made writeable.
"""
var m: U32 = 0
ifdef windows then
if owner_read or group_read or any_read then
m = m or 0x100
end
if owner_write or group_write or any_write then
m = m or 0x80
end
else
if setuid then m = m or 0x800 end
if setgid then m = m or 0x400 end
if sticky then m = m or 0x200 end
if owner_read then m = m or 0x100 end
if owner_write then m = m or 0x80 end
if owner_exec then m = m or 0x40 end
if group_read then m = m or 0x20 end
if group_write then m = m or 0x10 end
if group_exec then m = m or 0x8 end
if any_read then m = m or 0x4 end
if any_write then m = m or 0x2 end
if any_exec then m = m or 0x1 end
end
m
| pony | 1458339 | https://sv.wikipedia.org/wiki/Shell%20sort | Shell sort | Shell Sort är en sorteringsalgoritm som uppfanns 1959 av Donald Shell. Algoritmen kan ses som en förbättring av andra enklare sorteringsalgoritmer, vanligtvis Insättningssortering. Det som gör att Shell Sort är effektivare än vanlig insättningssortering är att algoritmen tillåter jämförelse mellan två element som ligger långt ifrån varandra.
Exempelkod
Två funktioner "swapItems" och "compare" antas finnas tillgängliga för ett indexerbart objekt för att kasta om respektive göra jämförelser mellan objektets element.
void
shellSort(int itemSize,
swapFuncType swapItems,
compFuncType compare)
{
itemSize--;
int offset = itemSize / 2;
while (offset > 0) {
bool done = false;
int limit = itemSize - offset;
while (done == false) {
int swap = 0;
done = true;
for (int i = 0; i <= limit; i++) {
if (compare(i, i + offset)) {
swapItems(i, i + offset);
swap = i;
done = false;
}
}
limit = swap - offset;
}
offset = offset / 2;
}
}
Sorteringsalgoritmer | swedish | 0.56014 |
Pony/time-Time-.txt |
Time¶
[Source]
A collection of ways to fetch the current time.
primitive val Time
Constructors¶
create¶
[Source]
new val create()
: Time val^
Returns¶
Time val^
Public Functions¶
now¶
[Source]
The wall-clock adjusted system time with nanoseconds.
Return: (seconds, nanoseconds)
fun box now()
: (I64 val , I64 val)
Returns¶
(I64 val , I64 val)
seconds¶
[Source]
The wall-clock adjusted system time.
fun box seconds()
: I64 val
Returns¶
I64 val
millis¶
[Source]
Monotonic unadjusted milliseconds.
fun box millis()
: U64 val
Returns¶
U64 val
micros¶
[Source]
Monotonic unadjusted microseconds.
fun box micros()
: U64 val
Returns¶
U64 val
nanos¶
[Source]
Monotonic unadjusted nanoseconds.
fun box nanos()
: U64 val
Returns¶
U64 val
cycles¶
[Source]
Processor cycle count. Don't use this for performance timing, as it does
not control for out-of-order execution.
fun box cycles()
: U64 val
Returns¶
U64 val
perf_begin¶
[Source]
Get a cycle count for beginning a performance testing block. This will
will prevent instructions from before this call leaking into the block and
instructions after this call being executed earlier.
fun box perf_begin()
: U64 val
Returns¶
U64 val
perf_end¶
[Source]
Get a cycle count for ending a performance testing block. This will
will prevent instructions from after this call leaking into the block and
instructions before this call being executed later.
fun box perf_end()
: U64 val
Returns¶
U64 val
eq¶
[Source]
fun box eq(
that: Time val)
: Bool val
Parameters¶
that: Time val
Returns¶
Bool val
ne¶
[Source]
fun box ne(
that: Time val)
: Bool val
Parameters¶
that: Time val
Returns¶
Bool val
| pony | 1758949 | https://no.wikipedia.org/wiki/Houston%20Texans%20i%20NFL-sesongen%202020 | Houston Texans i NFL-sesongen 2020 | Houston Texans spilte i sin 19. sesong i National Football League og syvende og siste under hovedtrener Bill O'Brien. Etter nederlaget mot Green Bay Packers i uke 10 var det ikke lenger mulig for dem å tangere eller forbedre på fjorårets sesongresultat på 10–6. Etter å ha startet sesongen 0–4 for første gang siden 2008 ble Bill O'Brien 5. oktober sparket fra stillingene som general manager og hovedtrener. Det var også første gang siden 2017 at Texans ikke klarte å nå ti seiere i seriespillet. Med et nederlag mot Chicago Bears i uke 14 var det ikke lenger mulig for Texans å nå sluttspillet, og 2020-sesongen ble lagets første tapende sesong siden 2017. Det ble Texans’ siste sesong med Deshaun Watson som startende quarterback etter at han stod over 2021-sesongen på grunn av anklager om seksuelle overgrep. Hans siste kamp for Texans var den 2. januar 2021, og den 18. mars 2022 ble han byttet til Cleveland Browns.
Draft
Draftbytter
Texans byttet sitt pick i første runde i 2020 samt picks i første og andre runde i 2021, offensive tackle Julién Davenport og cornerback Johnson Bademosi til Miami mot offensive tackle Laremy Tunsil, wide receiver Kenny Stills, et pick i fjerde runde i 2020 og et pick i sjette runde i 2021.
Texans byttet defensive end Jadeveon Clowney til Seattle mot linebacker Jacob Martin, linebacker Barkevious Mingo, og et pick i tredje runde.
Texans byttet picket i tredje runde de fikk fra Seattle til Las Vegas Raiders (da Oakland Raiders) mot cornerback Gareon Conley.
Texans byttet et betinget pick i fjerde runde (omgjort til pick i tredje runde etter å ha møtt betingelsen) til Cleveland mot running back Duke Johnson.
Texans byttet et pick i sjette runde til New England mot cornerback Keion Crossen.
Texans byttet wide receiver DeAndre Hopkins og et pick i fjerde runde til Arizona mot et pick i andre runde, running back David Johnson, og et pick i fjerde runde i 2021.
Texans byttet et pick i andre runde (#57) til L.A. Rams mot wide receiver Brandin Cooks og et pick i fjerde runde i 2022
Texans byttet et pick i fjerde runde (#136) og to i syvende runde (#248 og #250) til L.A. Rams mot et pick i fjerde runde (#126).
Texans byttet et pick i syvende runde (#240) til New Orleans mot et pick i sjette runde i 2021.
Personale
Nåværende spillerstall
Sesongoppkjøring
Texans' terminliste for sesongoppkjøringen ble annonsert 7. mai, men ble senere kansellert av sikkerhetshensyn på grunn av koronaviruspandemien.
Seriespill
Terminliste
Texans' terminliste i -sesongen ble annonsert 7. mai.
{| class="wikitable" style="text-align:center"
! style=""| Uke
! style=""| Dato
! style=""| Motstander
! style=""| Resultat
! style=""| Stilling
! style=""| Stadion
! style=""| OppsummeringNFL.com
|-style="background:#fcc"
! 1
| 10. september
| at Kansas City Chiefs
| T 20–34
| 0–1
| Arrowhead Stadium
| Oppsummering
|-style="background:#fcc"
! 2
| 20. september
| Baltimore Ravens
| T 16–33
| 0–2
| NRG Stadium
| Oppsummering
|-style="background:#fcc"
! 3
| 27. september
| at Pittsburgh Steelers
| T 21–28
| 0–3
| Heinz Field
| Oppsummering
|-style="background:#fcc"
! 4
| 4. oktober
| Minnesota Vikings
| T 23–31
| 0–4
| NRG Stadium
| Oppsummering
|-style="background:#cfc"
! 5
| 11. oktober
| Jacksonville Jaguars
| S 30–14
| 1–4
| NRG Stadium
| Oppsummering
|-style="background:#fcc"
! 6
| 18. oktober
| at Tennessee Titans
| T 36–42
| 1–5
| Nissan Stadium
| Oppsummering
|-style="background:#fcc"
! 7
| 25. oktober
| Green Bay Packers
| T 20–35
| 1–6
| NRG Stadium
| Oppsummering
|-
! 8
| colspan="6"| Bye
|-style="background:#cfc"
! 9
| 8. november
| at Jacksonville Jaguars
| S 27–25
| 2–6
| TIAA Bank Field
| Oppsummering
|-style="background:#fcc"
! 10
| 15. november
| at Cleveland Browns
| T 7–10
| 2–7
| FirstEnergy Stadium
| Oppsummering
|-style="background:#cfc"
! 11
| 22. november
| New England Patriots
| S 27–20
| 3–7
| NRG Stadium
| Oppsummering
|-style="background:#cfc"
! 12
| 26. november
| at Detroit Lions| S 41–25
| 4–7
| Ford Field
| Oppsummering
|-style="background:#fcc"
! 13
| 6. desember
| Indianapolis Colts| T 20–26
| 4–8
| NRG Stadium
| Oppsummering
|-style="background:#fcc"
! 14
| 13. desember
| at Chicago Bears
| T 7–36
| 4–9
| Soldier Field
| Oppsummering
|-style="background:#fcc"
! 15
| 20. desember
| at Indianapolis Colts| T 20–27
| 4–10
| Lucas Oil Stadium
| Oppsummering
|-style="background:#fcc"
! 16
| 27. desember
| Cincinnati Bengals
| T 31–37
| 4–11
| NRG Stadium
| Oppsummering
|-style="background:#fcc"
! 17
| 3. januar
| Tennessee Titans| T38–41
| 4–12
| NRG Stadium
| Oppsummering
|}Merknader Divisjonsmotstandere er i fet tekst.
Kampreferater
Uke 1: at Kansas City ChiefsNFL Kickoff GameUke 2: mot Baltimore Ravens
Uke 3: at Pittsburgh Steelers
Uke 4: mot Minnesota Vikings
Uke 5: mot Jacksonville Jaguars
Uke 6: at Tennessee Titans
Uke 7: mot Green Bay Packers
Uke 9: at Jacksonville Jaguars
Uke 10: at Cleveland Browns
Uke 11: mot New England Patriots
Uke 12: at Detroit LionsNFL on Thanksgiving Day'''
Uke 13: mot Indianapolis Colts
Uke 14: at Chicago Bears
Uke 15: at Indianapolis Colts
Uke 16: mot Cincinnati Bengals
Uke 17: mot Tennessee Titans
Tabeller
Divisjon
Conference
Referanser
Eksterne lenker
Houston Texans
2020
Sport i USA i 2020 | norwegian_bokmål | 1.13508 |
Pony/process-ProcessMonitor-.txt |
ProcessMonitor¶
[Source]
Fork+execs / creates a child process and monitors it. Notifies a client about
STDOUT / STDERR events.
actor tag ProcessMonitor is
AsioEventNotify tag
Implements¶
AsioEventNotify tag
Constructors¶
create¶
[Source]
Create infrastructure to communicate with a forked child process and
register the asio events. Fork child process and notify our user about
incoming data via the notifier.
new tag create(
auth: StartProcessAuth val,
backpressure_auth: ApplyReleaseBackpressureAuth val,
notifier: ProcessNotify iso,
filepath: FilePath val,
args: Array[String val] val,
vars: Array[String val] val,
wdir: (FilePath val | None val) = reference,
process_poll_interval: U64 val = call)
: ProcessMonitor tag^
Parameters¶
auth: StartProcessAuth val
backpressure_auth: ApplyReleaseBackpressureAuth val
notifier: ProcessNotify iso
filepath: FilePath val
args: Array[String val] val
vars: Array[String val] val
wdir: (FilePath val | None val) = reference
process_poll_interval: U64 val = call
Returns¶
ProcessMonitor tag^
Public Behaviours¶
print¶
[Source]
Print some bytes and append a newline.
be print(
data: (String val | Array[U8 val] val))
Parameters¶
data: (String val | Array[U8 val] val)
write¶
[Source]
Write to STDIN of the child process.
be write(
data: (String val | Array[U8 val] val))
Parameters¶
data: (String val | Array[U8 val] val)
printv¶
[Source]
Print an iterable collection of ByteSeqs.
be printv(
data: ByteSeqIter val)
Parameters¶
data: ByteSeqIter val
writev¶
[Source]
Write an iterable collection of ByteSeqs.
be writev(
data: ByteSeqIter val)
Parameters¶
data: ByteSeqIter val
done_writing¶
[Source]
Set the _done_writing flag to true. If _pending is empty we can close the
_stdin pipe.
be done_writing()
dispose¶
[Source]
Terminate child and close down everything.
be dispose()
timer_notify¶
[Source]
Windows IO polling timer has fired
be timer_notify()
Public Functions¶
expect¶
[Source]
A stdout call on the notifier must contain exactly qty bytes. If
qty is zero, the call can contain any amount of data.
fun ref expect(
qty: USize val = 0)
: None val
Parameters¶
qty: USize val = 0
Returns¶
None val
| pony | 1842399 | https://no.wikipedia.org/wiki/Avis%C3%A5ret%201888 | Avisåret 1888 | Avisåret 1888 er en oversikt over etableringer, nedleggelser, hendelser, prisvinnere og personer med tilknytning til aviser i 1888.
Hendelser
Etableringer
Fødsler
Referanser | norwegian_bokmål | 1.263419 |
Pony/process-StartProcessAuth-.txt |
StartProcessAuth¶
[Source]
primitive val StartProcessAuth
Constructors¶
create¶
[Source]
new val create(
from: AmbientAuth val)
: StartProcessAuth val^
Parameters¶
from: AmbientAuth val
Returns¶
StartProcessAuth val^
Public Functions¶
eq¶
[Source]
fun box eq(
that: StartProcessAuth val)
: Bool val
Parameters¶
that: StartProcessAuth val
Returns¶
Bool val
ne¶
[Source]
fun box ne(
that: StartProcessAuth val)
: Bool val
Parameters¶
that: StartProcessAuth val
Returns¶
Bool val
| pony | 3181561 | https://sv.wikipedia.org/wiki/Australachalcus%20incisicornis | Australachalcus incisicornis | Australachalcus incisicornis är en tvåvingeart som beskrevs av Marc Pollet 2005. Australachalcus incisicornis ingår i släktet Australachalcus och familjen styltflugor. Inga underarter finns listade i Catalogue of Life.
Källor
Styltflugor
incisicornis | swedish | 1.258548 |
Pony/files-FileChown-.txt |
FileChown¶
[Source]
primitive val FileChown
Constructors¶
create¶
[Source]
new val create()
: FileChown val^
Returns¶
FileChown val^
Public Functions¶
value¶
[Source]
fun box value()
: U32 val
Returns¶
U32 val
eq¶
[Source]
fun box eq(
that: FileChown val)
: Bool val
Parameters¶
that: FileChown val
Returns¶
Bool val
ne¶
[Source]
fun box ne(
that: FileChown val)
: Bool val
Parameters¶
that: FileChown val
Returns¶
Bool val
| pony | 2364904 | https://sv.wikipedia.org/wiki/Echinosaura%20sulcarostrum | Echinosaura sulcarostrum | Echinosaura sulcarostrum är en ödleart som beskrevs av Donnelly, Macculloch UGARTE och KIZIRIAN 2006. Echinosaura sulcarostrum ingår i släktet Echinosaura och familjen Gymnophthalmidae. Inga underarter finns listade i Catalogue of Life.
Källor
Fjällbärande kräldjur
sulcarostrum | swedish | 1.185405 |
Pony/5_structs.txt | # Structs
A `struct` is similar to a `class`. There's a couple very important differences. You'll use classes throughout your Pony code. You'll rarely use structs. We'll discuss structs in more depth in the [C-FFI chapter](/c-ffi/index.md) of the tutorial. In the meantime, here's a short introduction to the basics of structs.
## Structs are "classes for FFI"
A `struct` is a class like mechanism used to pass data back and forth with C code via Pony's Foreign Function Interface.
Like classes, Pony structs can contain both fields and methods. Unlike classes, Pony structs have the same binary layout as C structs and can be transparently used in C functions. Structs do not have a type descriptor, which means they cannot be used in algebraic types or implement traits/interfaces.
## What goes in a struct?
The same as a class! A struct is composed of some combination of:
1. Fields
2. Constructors
3. Functions
### Fields
Pony struct fields are defined in the same way as they are for Pony classes, using `embed`, `let`, and `var`. An embed field is embedded in its parent object, like a C struct inside C struct. A var/let field is a pointer to an object allocated separately.
For example:
```pony
struct Inner
var x: I32 = 0
struct Outer
embed inner_embed: Inner = Inner
var inner_var: Inner = Inner
```
### Constructors
Struct constructors, like class constructors, have names. Everything you previously learned about Pony class constructors applies to struct constructors.
```pony
struct Pointer[A]
"""
A Pointer[A] is a raw memory pointer. It has no descriptor and thus can't be
included in a union or intersection, or be a subtype of any interface. Most
functions on a Pointer[A] are private to maintain memory safety.
"""
new create() =>
"""
A null pointer.
"""
compile_intrinsic
new _alloc(len: USize) =>
"""
Space for len instances of A.
"""
compile_intrinsic
```
Here we have two constructors. One that creates a new null Pointer, and another creates a Pointer with space for many instances of the type the Pointer is pointing at. Don't worry if you don't follow everything you are seeing in the above example. The important part is, it should basically look like the class constructor example [we saw earlier](/types/classes.md#what-goes-in-a-class).
### Functions
Like Pony classes, Pony structs can also have functions. Everything you know about functions on Pony classes applies to structs as well.
## We'll see structs again
Structs play an important role in Pony's interactions with code written using C. We'll see them again in [C-FFI section](/c-ffi/index.md) of the tutorial. We probably won't see too much about structs until then.
| pony | 3935397 | https://sv.wikipedia.org/wiki/%C3%96verklass | Överklass | Överklass kan syfta på:
Överklass (biologi) – indelning i Systema naturae
Överklass (samhällsklass) – en samhällsklass
Överklass (programmering) – ett begrepp inom objektorienterad programmering | swedish | 1.321688 |
Pony/encode-base64--index-.txt |
Base64 package¶
The Base64 package contains support for doing Base64 binary-to-text encodings.
We currently have support 3 encodings: PEM, MIME and URL.
To learn more about Base64, we suggest you check out the
wikipedia entry.
Example code¶
use "encode/base64"
actor Main
new create(env: Env) =>
env.out.print(Base64.encode("foobar"))
try
env.out.print(Base64.decode[String iso]("Zm9vYmFy")?)
end
Public Types¶
primitive Base64
| pony | 7972447 | https://sv.wikipedia.org/wiki/EBSCO%20Information%20Services | EBSCO Information Services | EBSCO Information Services är ett företag bildat 1944, med huvudkontor i Ipswich, Massachusetts i USA. Det tillhandahåller resurser till kunder inom universitet, bibliotek, medicin mm. Det tillhandahåller ett tjugotal biblioteksdatabaser, bland annat Business Source Premier, som har index och fulltext i ämnen såsom ekonomi, management, finans, redovisning.
EBSCO Information Services är en underdivision till EBSCO Industries, Inc. som är ett av USA:s största privat och familjeägda företag.
Referenser
Externa länkar
EBSCO:s hemsida
Databaser
Företag bildade 1944 | swedish | 1.403808 |
Pony/pony_bench-Benchmark-.txt |
Benchmark¶
[Source]
type Benchmark is
(MicroBenchmark iso | AsyncMicroBenchmark iso)
Type Alias For¶
(MicroBenchmark iso | AsyncMicroBenchmark iso)
| pony | 339973 | https://sv.wikipedia.org/wiki/Schranz | Schranz | Schranz betecknar en stilriktning inom Hard technon och kommer ursprungligen från Tyskland. Den ger ett hårt, minimalistiskt och snabbt sound (oftast mellan 140 och 160 BPM) som till största delen består av brus och maskinliknande ljud. Schranz påminner om looptechno och kan därför placeras som undergenre till hardtechnon. Namnet är en sammankoppling mellan de tyska verben schreien (skrika) och tanzen (dansa).
Schranz har gett upphov till nya subgenrer, såsom svensk techno och japansk techno (Jtek).
Noterbara Schranz-technoproducenter
Chris Liebing
Basic Implant
Thomas Krome
Felix Kröcher
Adam Beyer
Cari Lekebusch
Oliver Ho
Marco Carola
Joel Mull
Jeff Amadeus
Alex Calver
Thomash Gee
Robert Natus
Sven Vittekind
Arkus P
Waldhaus
Weichentekknik
Frank Kvitta
Viper XXL
Peaky Pounder
Mario Ranieri
Andreas Kraemer
Terra Wan
Sven Väth
Se även
Jtek
Musikgenrer
Hardcore techno | swedish | 1.037645 |
Pony/backpressure-ApplyReleaseBackpressureAuth-.txt |
ApplyReleaseBackpressureAuth¶
[Source]
primitive val ApplyReleaseBackpressureAuth
Constructors¶
create¶
[Source]
new val create(
from: AmbientAuth val)
: ApplyReleaseBackpressureAuth val^
Parameters¶
from: AmbientAuth val
Returns¶
ApplyReleaseBackpressureAuth val^
Public Functions¶
eq¶
[Source]
fun box eq(
that: ApplyReleaseBackpressureAuth val)
: Bool val
Parameters¶
that: ApplyReleaseBackpressureAuth val
Returns¶
Bool val
ne¶
[Source]
fun box ne(
that: ApplyReleaseBackpressureAuth val)
: Bool val
Parameters¶
that: ApplyReleaseBackpressureAuth val
Returns¶
Bool val
| pony | 3286557 | https://sv.wikipedia.org/wiki/Asilus%20servillei | Asilus servillei | Asilus servillei är en tvåvingeart som beskrevs av Macquart 1834. Asilus servillei ingår i släktet Asilus och familjen rovflugor. Inga underarter finns listade i Catalogue of Life.
Källor
Rovflugor
servillei | swedish | 1.181918 |
Pony/encode-base64-Base64-.txt |
Base64¶
[Source]
primitive val Base64
Constructors¶
create¶
[Source]
new val create()
: Base64 val^
Returns¶
Base64 val^
Public Functions¶
encode_pem¶
[Source]
Encode for PEM (RFC 1421).
fun box encode_pem(
data: ReadSeq[U8 val] box)
: String iso^
Parameters¶
data: ReadSeq[U8 val] box
Returns¶
String iso^
encode_mime¶
[Source]
Encode for MIME (RFC 2045).
fun box encode_mime(
data: ReadSeq[U8 val] box)
: String iso^
Parameters¶
data: ReadSeq[U8 val] box
Returns¶
String iso^
encode_url[optional A: Seq[U8 val] iso]¶
[Source]
Encode for URLs (RFC 4648). Padding characters are stripped by default.
fun box encode_url[optional A: Seq[U8 val] iso](
data: ReadSeq[U8 val] box,
pad: Bool val = false)
: A^
Parameters¶
data: ReadSeq[U8 val] box
pad: Bool val = false
Returns¶
A^
encode[optional A: Seq[U8 val] iso]¶
[Source]
Configurable encoding. The defaults are for RFC 4648.
fun box encode[optional A: Seq[U8 val] iso](
data: ReadSeq[U8 val] box,
at62: U8 val = 43,
at63: U8 val = 47,
pad: U8 val = 61,
linelen: USize val = 0,
linesep: String val = "
")
: A^
Parameters¶
data: ReadSeq[U8 val] box
at62: U8 val = 43
at63: U8 val = 47
pad: U8 val = 61
linelen: USize val = 0
linesep: String val = "
"
Returns¶
A^
decode_url[optional A: Seq[U8 val] iso]¶
[Source]
Decode for URLs (RFC 4648).
fun box decode_url[optional A: Seq[U8 val] iso](
data: ReadSeq[U8 val] box)
: A^ ?
Parameters¶
data: ReadSeq[U8 val] box
Returns¶
A^ ?
decode[optional A: Seq[U8 val] iso]¶
[Source]
Configurable decoding. The defaults are for RFC 4648. Missing padding is
not an error. Non-base64 data, other than whitespace (which can appear at
any time), is an error.
fun box decode[optional A: Seq[U8 val] iso](
data: ReadSeq[U8 val] box,
at62: U8 val = 43,
at63: U8 val = 47,
pad: U8 val = 61)
: A^ ?
Parameters¶
data: ReadSeq[U8 val] box
at62: U8 val = 43
at63: U8 val = 47
pad: U8 val = 61
Returns¶
A^ ?
eq¶
[Source]
fun box eq(
that: Base64 val)
: Bool val
Parameters¶
that: Base64 val
Returns¶
Bool val
ne¶
[Source]
fun box ne(
that: Base64 val)
: Bool val
Parameters¶
that: Base64 val
Returns¶
Bool val
| pony | 8614101 | https://sv.wikipedia.org/wiki/Falu%20garnison | Falu garnison | Falu garnison är en garnison inom svenska Försvarsmakten som verkade i olika former åren 1909–2001 och återigen från 2021. Garnisonen är belägen i Falun, Dalarnas län.
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"marker-symbol": "-number",
"marker-color": "302060"
},
"geometry": {
"type": "Point",
"coordinates": [
15.500352,
60.434804
]
}
},
{
"type": "Feature",
"properties": {
"marker-symbol": "-number",
"marker-color": "302060"
},
"geometry": {
"type": "Point",
"coordinates": [
15.650754,
60.605551
]
}
},
{
"type": "Feature",
"properties": {
"marker-symbol": "-number",
"marker-color": "302060"
},
"geometry": {
"type": "Point",
"coordinates": [
15.670581,
60.619097
]
}
},
{
"type": "Feature",
"properties": {
"marker-symbol": "-number",
"marker-color": "302060"
},
"geometry": {
"type": "Point",
"coordinates": [
15.669122,
60.610227
]
}
}
]
}
Historik
Dalregementet hade från 1796 sin mötesplats på Rommehed, söder om Stora Tuna kyrka. När indelningsverket avskaffades och den värnpliktiga armén introducerades i början av 1900-talet, beslutades 1905 att Dalregementet skulle omlokaliseras till ett nyuppfört kasernetablissement inne i centrala Falun. Kasernetablissementet uppfördes efter 1901 års härordnings byggnadsprogram efter Kasernbyggnadsnämndens typritningsserie för infanterietablissement, totalt uppfördes ett 60-tal byggnader. Den 10 oktober 1908 flyttade regementsstab och regementsexpeditionen in på området i Falun och den 29 januari 1909 överlämnades kasernetablissementet till Dalregementet. Kasernetablissementet utgjordes av ett kanslihus, tre bataljonskaserner, matsal, exercishall samt verkstads- och förrådsbyggnader. Under 1970-talet byggdes ett nytt centralförråd. Under 1990-talet anpassades garnisonen för att möta den mekanisering som planerades av Dalabrigaden, där garage, verkstäder och stolplador anpassades för de pansarfordon som kom att tillföras brigaden. Närövningsfältet anpassades med stråk till utbildningen av förare av pansarfordonen.
Garnisonen läggs ner...
Genom försvarsbeslutet 2000 beslutades att Dalregementet och Dalabrigaden skulle avvecklas i juni 2000. Kvar blev en avvecklingsorganisation som fick i uppdrag att avveckla fastigheter från de två förbanden, samt iordningställa lokaler samt övnings- och skjutfält för Dalregementsgruppen. Avvecklingsorganisation upphörde den 30 juni 2001, då avvecklingen bedömdes slutförd. Större delen av kasernetablissementet har sedan 2001 omformats till Dalregementets företagspark samt handelsområde.
... och återinrättas
Genom försvarsbeslutet 2020 beslutades att återinrätta Dalregementet. År 2021 återinrättades Dalregementet och inledningsvis övertogs Dalregementsgruppens befintliga lokaler, vilka ligger inom det gamla kasernetablissementet och bland annat inkluderar C-kasernen. Bygget av ett nytt och ändamålsenligt kasernetablissement kommer påbörjas 2023 och stå färdigt åren 2027–2028. Inför återetableringen av regementet undersöktes tre alternativa platser för att uppföra ett nytt och ändamålsenligt kasernetablissement. Alternativ 1 utgjordes av en privat fastighet vid Högbo sanatorium och öster om det. Alternativ 2 utgjordes av en kommunal fastighet öster om Myrans strövområde. Alternativ 3 utgjordes av en statlig fastighet i den södra delen av Falu övnings- och skjutfält, i linje med Jämmerdalen och trafikplats Norslund. I det korta perspektivet förlades delar av verksamheten inom Dalregementets företagspark samt till landstingets gamla sanatoriebyggnader i Högbo. Den 25 november 2021 meddelade Försvarsmakten, Fortifikationsverket samt Falu kommun att man beslutat sig för att ett nytt kasernetablissement ska uppföras i närheten av nuvarande övningsområdet vid Myrans östra del. Bakgrunden till beslutet är att marken vid alternativ 1 och alternativ 3 var alltför kuperad och skulle medföra alltför omfattande markarbeten, vilket inte ansågs ekonomiskt försvarbart. Alternativ 3 skulle samtidigt medföra att delar av Falu övnings- och skjutfält hade behövts tas i anspråk. Alternativ 2 ansågs ge bäst förutsättningar för att i framtiden växa till att utbilda en brigadplattform. Det nya kasernetablissementet kommer omfatta cirka 40 hektar inhägnad mark och utgöras av kaserner med logement, matsal, idrottshall, förråd och fordonshallar. De tysta områdena med kansli och kaserner kommer finnas i anslutning till Faluns bebyggelse, medan de mer bullriga delarna av kasernetablissementet kommer uppföras mot och i anslutning till övnings- och skjutfältet. Dock beräknas det nya kasernetablissementet stå färdigt först 2028. Fram till dess kommer Dalregementet vara grupperat till både Dalregementets företagspark och till landstingets gamla sanatoriebyggnader i Högbo. De värnpliktiga kommer från augusti 2022 utgå från Högbo, medan regementets administration samt Hemvärnet kommer grupperas till den gamla markan, som ligger längst bort på kaserngården, samt C-kasernen vid Dalregementets företagspark.
Se även
Falu övnings- och skjutfält
Referenser
Noter
Tryckta källor
Vidare läsning
Externa länkar | swedish | 1.200097 |
Pony/collections-MaxHeap-.txt |
MaxHeap[A: Comparable[A] #read]¶
[Source]
type MaxHeap[A: Comparable[A] #read] is
BinaryHeap[A, MaxHeapPriority[A] val] ref
Type Alias For¶
BinaryHeap[A, MaxHeapPriority[A] val] ref
| pony | 3412608 | https://sv.wikipedia.org/wiki/Asaphes%20aphidi | Asaphes aphidi | Asaphes aphidi är en stekelart som först beskrevs av Jean Risbec 1960. Asaphes aphidi ingår i släktet Asaphes och familjen puppglanssteklar. Inga underarter finns listade.
Källor
Puppglanssteklar
aphidi | swedish | 1.010072 |
Pony/platform-dependent-code.txt | # Platform-dependent Code
The Pony libraries, of course, want to abstract platform differences. Sometimes you may want a `use` command that only works under certain circumstances, most commonly only on a particular OS or only for debug builds. You can do this by specifying a condition for a `use` command:
```pony
use "foo" if linux
use "bar" if (windows and debug)
```
Use conditions can use any of the methods defined in `builtin/Platform` as conditions.
There are currently the following booleans defined: `freebsd`, `linux`, `osx`, `posix` => `(freebsd or linux or osx)`, `windows`, `x86`, `arm`, `lp64`, `llp64`, `ilp32`, `native128`, `debug`
They can also use the operators `and`, `or`, `xor` and `not`. As with other expressions in Pony, parentheses __must__ be used to indicate precedence if more than one of `and`, `or` and `xor` is used.
Any use command whose condition evaluates to false is ignored.
| pony | 133988 | https://da.wikipedia.org/wiki/Nvu | Nvu | Nvu (udtales som "N-view") er en WYSIWYG HTML-editor, baseret på Composer komponenten fra Mozilla Application Suite. Dens mål er at være et open source alternativ til proprietært software som Microsoft FrontPage og Macromedia Dreamweaver og den er en meget brugt WYSIWYG editor til Linux. Nvu er designet til at være nem at bruge for ikke tekniske computerbrugere. Viden om HTML eller CSS er ikke et krav.
Hjemmeside
Nvu The Complete Web Authoring System for Linux, Macintosh and Windows
Frie HTML-editorer
Tekst-relaterede programmer til Linux
Internet-software til Linux
Internet-software til OS X
Internet-software til Windows | danish | 0.936164 |
Pony/src-net-udp_socket-.txt |
udp_socket.pony
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573use "collections"
use @pony_os_listen_udp[AsioEventID](owner: AsioEventNotify,
host: Pointer[U8] tag, service: Pointer[U8] tag)
use @pony_os_listen_udp4[AsioEventID](owner: AsioEventNotify,
host: Pointer[U8] tag, service: Pointer[U8] tag)
use @pony_os_listen_udp6[AsioEventID](owner: AsioEventNotify,
host: Pointer[U8] tag, service: Pointer[U8] tag)
use @pony_os_sendto[USize](fd: U32, buffer: Pointer[U8] tag,
size: USize, to: NetAddress tag) ?
use @pony_os_recvfrom[USize](event: AsioEventID, buffer: Pointer[U8] tag,
size: USize, from: NetAddress tag) ?
use @pony_os_multicast_join[None](fd: U32, group: Pointer[U8] tag,
to: Pointer[U8] tag)
use @pony_os_multicast_leave[None](fd: U32, group: Pointer[U8] tag,
to: Pointer[U8] tag)
use @pony_os_multicast_interface[None](fd: U32, from: Pointer[U8] tag)
actor UDPSocket is AsioEventNotify
"""
Creates a UDP socket that can be used for sending and receiving UDP messages.
The following examples create:
* an echo server that listens for connections and returns whatever message it
receives
* a client that connects to the server, sends a message, and prints the
message it receives in response
The server is implemented like this:
```pony
use "net"
class MyUDPNotify is UDPNotify
fun ref received(
sock: UDPSocket ref,
data: Array[U8] iso,
from: NetAddress)
=>
sock.write(consume data, from)
fun ref not_listening(sock: UDPSocket ref) =>
None
actor Main
new create(env: Env) =>
UDPSocket(UDPAuth(env.root),
MyUDPNotify, "", "8989")
```
The client is implemented like this:
```pony
use "net"
class MyUDPNotify is UDPNotify
let _out: OutStream
let _destination: NetAddress
new create(
out: OutStream,
destination: NetAddress)
=>
_out = out
_destination = destination
fun ref listening(sock: UDPSocket ref) =>
sock.write("hello world", _destination)
fun ref received(
sock: UDPSocket ref,
data: Array[U8] iso,
from: NetAddress)
=>
_out.print("GOT:" + String.from_array(consume data))
sock.dispose()
fun ref not_listening(sock: UDPSocket ref) =>
None
actor Main
new create(env: Env) =>
try
let destination =
DNS.ip4(DNSAuth(env.root), "localhost", "8989")(0)?
UDPSocket(UDPAuth(env.root),
recover MyUDPNotify(env.out, consume destination) end)
end
```
"""
var _notify: UDPNotify
var _fd: U32
var _event: AsioEventID
var _readable: Bool = false
var _closed: Bool = false
var _packet_size: USize
var _read_buf: Array[U8] iso
var _read_from: NetAddress iso = NetAddress
embed _ip: NetAddress = NetAddress
new create(
auth: UDPAuth,
notify: UDPNotify iso,
host: String = "",
service: String = "0",
size: USize = 1024)
=>
"""
Listens for both IPv4 and IPv6 datagrams.
"""
_notify = consume notify
_event =
@pony_os_listen_udp(this, host.cstring(), service.cstring())
_fd = @pony_asio_event_fd(_event)
@pony_os_sockname(_fd, _ip)
_packet_size = size
_read_buf = recover Array[U8] .> undefined(size) end
_notify_listening()
_start_next_read()
new ip4(
auth: UDPAuth,
notify: UDPNotify iso,
host: String = "",
service: String = "0",
size: USize = 1024)
=>
"""
Listens for IPv4 datagrams.
"""
_notify = consume notify
_event =
@pony_os_listen_udp4(this, host.cstring(), service.cstring())
_fd = @pony_asio_event_fd(_event)
@pony_os_sockname(_fd, _ip)
_packet_size = size
_read_buf = recover Array[U8] .> undefined(size) end
_notify_listening()
_start_next_read()
new ip6(
auth: UDPAuth,
notify: UDPNotify iso,
host: String = "",
service: String = "0",
size: USize = 1024)
=>
"""
Listens for IPv6 datagrams.
"""
_notify = consume notify
_event =
@pony_os_listen_udp6(this, host.cstring(), service.cstring())
_fd = @pony_asio_event_fd(_event)
@pony_os_sockname(_fd, _ip)
_packet_size = size
_read_buf = recover Array[U8] .> undefined(size) end
_notify_listening()
_start_next_read()
be write(data: ByteSeq, to: NetAddress) =>
"""
Write a single sequence of bytes.
"""
_write(data, to)
be writev(data: ByteSeqIter, to: NetAddress) =>
"""
Write a sequence of sequences of bytes.
"""
for bytes in data.values() do
_write(bytes, to)
end
be set_notify(notify: UDPNotify iso) =>
"""
Change the notifier.
"""
_notify = consume notify
be set_broadcast(state: Bool) =>
"""
Enable or disable broadcasting from this socket.
"""
if not _closed then
if _ip.ip4() then
set_so_broadcast(state)
elseif _ip.ip6() then
@pony_os_multicast_join(_fd, "FF02::1".cstring(), "".cstring())
end
end
be set_multicast_interface(from: String = "") =>
"""
By default, the OS will choose which address is used to send packets bound
for multicast addresses. This can be used to force a specific interface. To
revert to allowing the OS to choose, call with an empty string.
"""
if not _closed then
@pony_os_multicast_interface(_fd, from.cstring())
end
be set_multicast_loopback(loopback: Bool) =>
"""
By default, packets sent to a multicast address will be received by the
sending system if it has subscribed to that address. Disabling loopback
prevents this.
"""
if not _closed then
set_ip_multicast_loop(loopback)
end
be set_multicast_ttl(ttl: U8) =>
"""
Set the TTL for multicast sends. Defaults to 1.
"""
if not _closed then
set_ip_multicast_ttl(ttl)
end
be multicast_join(group: String, to: String = "") =>
"""
Add a multicast group. This can be limited to packets arriving on a
specific interface.
"""
if not _closed then
@pony_os_multicast_join(_fd, group.cstring(), to.cstring())
end
be multicast_leave(group: String, to: String = "") =>
"""
Drop a multicast group. This can be limited to packets arriving on a
specific interface. No attempt is made to check that this socket has
previously added this group.
"""
if not _closed then
@pony_os_multicast_leave(_fd, group.cstring(), to.cstring())
end
be dispose() =>
"""
Stop listening.
"""
if not _closed then
_close()
end
fun local_address(): NetAddress =>
"""
Return the bound IP address.
"""
_ip
be _event_notify(event: AsioEventID, flags: U32, arg: U32) =>
"""
When we are readable, we accept new connections until none remain.
"""
if event isnt _event then
return
end
if not _closed then
if AsioEvent.readable(flags) then
_readable = true
_complete_reads(arg)
_pending_reads()
end
else
ifdef windows then
if AsioEvent.readable(flags) then
_readable = false
_close()
end
end
end
if AsioEvent.disposable(flags) then
@pony_asio_event_destroy(_event)
_event = AsioEvent.none()
end
be _read_again() =>
"""
Resume reading.
"""
if not _closed then
_pending_reads()
end
fun ref _pending_reads() =>
"""
Read while data is available, guessing the next packet length as we go. If
we read 4 kb of data, send ourself a resume message and stop reading, to
avoid starving other actors.
"""
ifdef not windows then
try
var sum: USize = 0
while _readable do
let size = _packet_size
let data = _read_buf = recover Array[U8] .> undefined(size) end
let from = recover NetAddress end
let len =
@pony_os_recvfrom(_event, data.cpointer(), data.space(),
from) ?
if len == 0 then
_readable = false
return
end
data.truncate(len)
_notify.received(this, consume data, consume from)
sum = sum + len
if sum > (1 << 12) then
_read_again()
return
end
end
else
_close()
end
end
fun ref _complete_reads(len: U32) =>
"""
The OS has informed as that len bytes of pending reads have completed.
This occurs only with IOCP on Windows.
"""
ifdef windows then
if _read_buf.space() == 0 then
// Socket has been closed
_readable = false
_close()
return
end
if _closed then
return
end
// Hand back read data
let size = _packet_size
let data = _read_buf = recover Array[U8] .> undefined(size) end
let from = _read_from = recover NetAddress end
data.truncate(len.usize())
_notify.received(this, consume data, consume from)
_start_next_read()
end
fun ref _start_next_read() =>
"""
Start our next receive.
This is used only with IOCP on Windows.
"""
ifdef windows then
try
@pony_os_recvfrom(_event, _read_buf.cpointer(),
_read_buf.space(), _read_from) ?
else
_readable = false
_close()
end
end
fun ref _write(data: ByteSeq, to: NetAddress) =>
"""
Write the datagram to the socket.
"""
if not _closed then
try
@pony_os_sendto(_fd, data.cpointer(), data.size(), to) ?
else
_close()
end
end
fun ref _notify_listening() =>
"""
Inform the notifier that we're listening.
"""
if _fd != -1 then
_notify.listening(this)
else
_notify.not_listening(this)
end
fun ref _close() =>
"""
Inform the notifier that we've closed.
"""
ifdef windows then
// On windows, wait until IOCP read operation has completed or been
// cancelled.
if _closed and not _readable and not _event.is_null() then
@pony_asio_event_unsubscribe(_event)
end
else
// Unsubscribe immediately.
if not _event.is_null() then
@pony_asio_event_unsubscribe(_event)
_readable = false
end
end
_closed = true
if _fd != -1 then
_notify.closed(this)
// On windows, this will also cancel all outstanding IOCP operations.
@pony_os_socket_close(_fd)
_fd = -1
end
fun ref getsockopt(level: I32, option_name: I32, option_max_size: USize = 4): (U32, Array[U8] iso^) =>
"""
General wrapper for UDP sockets to the `getsockopt(2)` system call.
The caller must provide an array that is pre-allocated to be
at least as large as the largest data structure that the kernel
may return for the requested option.
In case of system call success, this function returns the 2-tuple:
1. The integer `0`.
2. An `Array[U8]` of data returned by the system call's `void *`
4th argument. Its size is specified by the kernel via the
system call's `sockopt_len_t *` 5th argument.
In case of system call failure, this function returns the 2-tuple:
1. The value of `errno`.
2. An undefined value that must be ignored.
Usage example:
```pony
// listening() is a callback function for class UDPNotify
fun ref listening(sock: UDPSocket ref) =>
match sock.getsockopt(OSSockOpt.sol_socket(), OSSockOpt.so_rcvbuf(), 4)
| (0, let gbytes: Array[U8] iso) =>
try
let br = Reader.create().>append(consume gbytes)
ifdef littleendian then
let buffer_size = br.u32_le()?
else
let buffer_size = br.u32_be()?
end
end
| (let errno: U32, _) =>
// System call failed
end
```
"""
_OSSocket.getsockopt(_fd, level, option_name, option_max_size)
fun ref getsockopt_u32(level: I32, option_name: I32): (U32, U32) =>
"""
Wrapper for UDP sockets to the `getsockopt(2)` system call where
the kernel's returned option value is a C `uint32_t` type / Pony
type `U32`.
In case of system call success, this function returns the 2-tuple:
1. The integer `0`.
2. The `*option_value` returned by the kernel converted to a Pony `U32`.
In case of system call failure, this function returns the 2-tuple:
1. The value of `errno`.
2. An undefined value that must be ignored.
"""
_OSSocket.getsockopt_u32(_fd, level, option_name)
fun ref setsockopt(level: I32, option_name: I32, option: Array[U8]): U32 =>
"""
General wrapper for UDP sockets to the `setsockopt(2)` system call.
The caller is responsible for the correct size and byte contents of
the `option` array for the requested `level` and `option_name`,
including using the appropriate CPU endian byte order.
This function returns `0` on success, else the value of `errno` on
failure.
Usage example:
```pony
// listening() is a callback function for class UDPNotify
fun ref listening(sock: UDPSocket ref) =>
let sb = Writer
sb.u32_le(7744) // Our desired socket buffer size
let sbytes = Array[U8]
for bs in sb.done().values() do
sbytes.append(bs)
end
match sock.setsockopt(OSSockOpt.sol_socket(), OSSockOpt.so_rcvbuf(), sbytes)
| 0 =>
// System call was successful
| let errno: U32 =>
// System call failed
end
```
"""
_OSSocket.setsockopt(_fd, level, option_name, option)
fun ref setsockopt_u32(level: I32, option_name: I32, option: U32): U32 =>
"""
Wrapper for UDP sockets to the `setsockopt(2)` system call where
the kernel expects an option value of a C `uint32_t` type / Pony
type `U32`.
This function returns `0` on success, else the value of `errno` on
failure.
"""
_OSSocket.setsockopt_u32(_fd, level, option_name, option)
fun ref get_so_error(): (U32, U32) =>
"""
Wrapper for the FFI call `getsockopt(fd, SOL_SOCKET, SO_ERROR, ...)`
"""
_OSSocket.get_so_error(_fd)
fun ref get_so_rcvbuf(): (U32, U32) =>
"""
Wrapper for the FFI call `getsockopt(fd, SOL_SOCKET, SO_RCVBUF, ...)`
"""
_OSSocket.get_so_rcvbuf(_fd)
fun ref get_so_sndbuf(): (U32, U32) =>
"""
Wrapper for the FFI call `getsockopt(fd, SOL_SOCKET, SO_SNDBUF, ...)`
"""
_OSSocket.get_so_sndbuf(_fd)
fun ref set_ip_multicast_loop(loopback: Bool): U32 =>
"""
Wrapper for the FFI call `setsockopt(fd, SOL_SOCKET, IP_MULTICAST_LOOP, ...)`
"""
var word: Array[U8] ref =
_OSSocket.u32_to_bytes4(if loopback then 1 else 0 end)
_OSSocket.setsockopt(_fd, OSSockOpt.sol_socket(), OSSockOpt.ip_multicast_loop(), word)
fun ref set_ip_multicast_ttl(ttl: U8): U32 =>
"""
Wrapper for the FFI call `setsockopt(fd, SOL_SOCKET, IP_MULTICAST_TTL, ...)`
"""
var word: Array[U8] ref = _OSSocket.u32_to_bytes4(ttl.u32())
_OSSocket.setsockopt(_fd, OSSockOpt.sol_socket(), OSSockOpt.ip_multicast_ttl(), word)
fun ref set_so_broadcast(state: Bool): U32 =>
"""
Wrapper for the FFI call `setsockopt(fd, SOL_SOCKET, SO_BROADCAST, ...)`
"""
var word: Array[U8] ref =
_OSSocket.u32_to_bytes4(if state then 1 else 0 end)
_OSSocket.setsockopt(_fd, OSSockOpt.sol_socket(), OSSockOpt.so_broadcast(), word)
fun ref set_so_rcvbuf(bufsize: U32): U32 =>
"""
Wrapper for the FFI call `setsockopt(fd, SOL_SOCKET, SO_RCVBUF, ...)`
"""
_OSSocket.set_so_rcvbuf(_fd, bufsize)
fun ref set_so_sndbuf(bufsize: U32): U32 =>
"""
Wrapper for the FFI call `setsockopt(fd, SOL_SOCKET, SO_SNDBUF, ...)`
"""
_OSSocket.set_so_sndbuf(_fd, bufsize)
| pony | 34253 | https://da.wikipedia.org/wiki/430%27erne | 430'erne | Århundreder: 4. århundrede – 5. århundrede – 6. århundrede
Årtier: 380'erne 390'erne 400'erne 410'erne 420'erne – 430'erne – 440'erne 450'erne 460'erne 470'erne 480'erne
År: 430 431 432 433 434 435 436 437 438 439
Begivenheder
Personer
6. april 432: Pave Celestin 1. dør
Eksterne henvisninger
å
Årtier | danish | 1.301212 |
Pony/bureaucracy-Custodian-.txt |
Custodian¶
[Source]
A Custodian keeps a set of actors to dispose. When the Custodian is disposed,
it disposes of the actors in its set and then clears the set.
Example program¶
Imagine you have a program with 3 actors that you need to shutdown when it
receives a TERM signal. We can set up a Custodian that knows about each
of our actors and when a TERM signal is received, is disposed of.
use "bureaucracy"
use "signals"
actor Actor1
be dispose() => None // dispose of resources here.
actor Actor2
be dispose() => None // dispose of resources here.
actor Actor3
be dispose() => None // dispose of resources here.
actor Main
new create(env: Env) =>
let actor1 = Actor1
let actor2 = Actor2
let actor3 = Actor3
let custodian = Custodian
custodian(actor1)
custodian(actor2)
custodian(actor3)
SignalHandler(TermHandler(custodian), Sig.term())
class TermHandler is SignalNotify
let _custodian: Custodian
new iso create(custodian: Custodian) =>
_custodian = custodian
fun ref apply(count: U32): Bool =>
_custodian.dispose()
true
actor tag Custodian
Constructors¶
create¶
[Source]
new tag create()
: Custodian tag^
Returns¶
Custodian tag^
Public Behaviours¶
apply¶
[Source]
Add an actor to be disposed of.
be apply(
worker: DisposableActor tag)
Parameters¶
worker: DisposableActor tag
remove¶
[Source]
Removes an actor from the set of things to be disposed.
be remove(
worker: DisposableActor tag)
Parameters¶
worker: DisposableActor tag
dispose¶
[Source]
Dispose of the actors in the set and then clear the set.
be dispose()
| pony | 76876 | https://no.wikipedia.org/wiki/ZX%20Spectrum | ZX Spectrum | ZX Spectrum var en liten, britisk hjemmedatamaskin lansert i 1982 av Sinclair Research. Den var basert på en Zilog Z80 CPU som kjørte på 3.5 MHz og kom opprinnelig med enten 16 KiB eller 48 KiB med RAM. Maskinvaren ble designet av Richard Altwasser i Sinclair Research og programvaren ble skrevet av Steve Vickers på kontrakt fra Nine Tiles Ltd, forfatterne av Sinclair BASIC. Sinclairs industriele designer, Rick Dickinson, var ansvarlig for maskinens ytre utseende. Maskinen ble opprinnelig kalt ZX82, men ble senere omdøpt til «Spectrum» av Sinclair for å fremheve maskinens fargegrafikk, i kontrast til svart/hvitt-forgjengerne, ZX80 og ZX81.
I 1986 kjøpte Amstrad opp rettighetene og eierskapet til Spectrum produktene.
Modeller
ZX Spectrum (1982)
Denne modellen kom i flere utgaver, den første i 1982. Den var tilgjengelig med enten 16 eller 48 KiB med RAM og 16 KiB ROM. Eiere av 16K Spectrum kunne oppgradere til 48K ved å kjøpe en ekstern 32 KiB RAM-pakke som kunne monteres i ekspansjons porten. Dette er den originale Spectrum og vil bli husket for sin lille størrelse og gummi-tastene.
ZX Spectrum+ (1984)
Denne 48K Spectrum hadde et mer solid keyboard og en reset-knapp. Det var mulig å kjøpe en oppgraderingspakke for eldre maskiner. De fleste hardnakkede brukere (programmerere og de som spillet mye) mislikte dette nye tastaturet, men i noen kretser hjalp det Spectrum-en til å se mindre ut som et leketøy og mer som en datamaskin.
ZX Spectrum 128K (1986)
Sinclair utviklet 128K-modellen i samarbeid med deres Spanske distributør Investrónica. Investrónica hadde hjulpet med å tilpasse Spectrum+ til det spanske markedet etter at spansk rett fastslo at alle datamaskiner med 64 KiB RAM eller mindre måtte støtte det spanske alfabetet og vise meldinger i Spansk.
Nye funksjoner inkluderte 128 KiB RAM; tre kanals lyd via AY-3-8192 chip-en, MIDI, en RS-232 seriell port, en RGB skjerm port, forbedret BASIC editor og et ekstern numerisk tastatur.
En engelsk versjon fulgte uten det eksterne tastaturet, selv om ROM rutinene og selve porten, nå omdøpt AUX, var igjen.
ZX Spectrum +2 (1986)
+2-en var Amstrads første Spectrum og kom kort tid etter at de hadde kjøpt rettighetene.
Maskinen var større enn Sinclairs makiner og var grå av farge. Den hadde fjærbelastet tastatur, dobbel joystick port og en innebygget kassettspiller og -opptaker, kalt Datacorder (samme som Amstrad CPC 464), men var internt lik 128K modellen.
ZX Spectrum +3 (1987)
+3-en var basert på +2, men hadde en innebygget 3" diskettstasjon (som Amstrad CPC 6128) i stedet for kassettspiller. Den er den eneste Spectrum-en som er i stand til å kjøre CP/M uten ytterligere hardware.
Flere eldre 48K, og noen eldre 128K, spill var ikke kompatibel med maskinen.
ZX Spectrum +3 var den siste offisielle modellen som ble laget, og var i produksjon så sent som desember 1990. Selv om den stod for en tredjedel av alt salg av hjemmedatamaskiner på den tiden, ble produksjonen av modellen stoppet av Amstrad i et forsøk å overføre kunder til deres egen CPC produkter.
ZX Spectrum +2A /+2B (1987)
Ble introdusert for å homogensiere Spectrum produktene til Amstrad. +2A var i stor grad basert på +3 designet, men med en kassettspiller. +2B indikerte at produksjonen ble flyttet fra Hongkong til Taiwan.
Tekniske spesifikasjoner
CPU
Zilog Z80A/NEC μPD780C @ 3.50 MHz (Spectrum 16K, 48K, +) eller 3.5469 MHz (Spectrum 128 og senere)
ROM
16 KiB ROM (BASIC: Spectrum 16/48K, +)
32 KiB ROM (BASIC, Editor: Spectrum 128, +2)
64 KiB ROM (BASIC, Editor, Syntax check, DOS: Spectrum +3, +2A, +2B)
RAM
16 KiB RAM (Spectrum 16K)
48 KiB RAM (Spectrum 48K, +)
128 KiB RAM (Spectrum 128, +2, +3, +2A, +2B)
Skjerm
Tekst: 32×24 tegn
Grafikk: 256×192 pixler, 15 farger (to samtidige farger – "attributter" – per 8×8 pixler, forårsaket attribut krasj)
Lyd
Beeper (1 kanal, 10 oktaver og 10+ semitoner: Spectrum 16K og 48K via intern høyttaler, de andre via TV)
General Instrument AY-3-8912 chip (3 kanaler, 9 oktaver (PLAY kommando); 27 Hz to 110.83 kHz: Spectrum 128, +2, +2A, +3)
I/O
Z80 bus inn/ut
Audio inn/ut for lagring til ekstern kassettspiller (all unntatt Spectrum +2, som hadde en intern kassettspiller)
RF utgang for fjernsyn
RS-232 inn/ut (128K modeller)
MIDI utgang (128K modeller)
RGB skjerm-utgang (128K modeller)
Joystick inngang × 2 (Spectrum +2, +2A, +3)
Ekstern numerisk tastatur-port (Spectrum 128 and +2)
Tilleggs-port (tidligere tastatur-port) (Spectrum +2A, +3)
Parallell printer port (Spectrum +2A, +3)
Port for tilkobling av ekstern diskettstasjon (Spectrum +3)
Lagring
Eksternt kassettspiller (alle bortsett fra +2)
1–8 eksterne ZX Microdrive (ved å bruke ZX Interface 1)
Innebygget kassettspiller (Spectrum +2, +2A)
Innebygget 3" diskett-stasjon (Spectrum +3)
Spectrum i Norge
ZX Spectrum 16K, 48K og + modellene samt en del tilleggsutstyr ble importert til Norge av Viking Data.
Eksterne lenker
World of Spectrum
ZX Spectrum på old-computers.com
Produktanmeldelse i Your Computer, juni 1982
Planet Sinclair
Historiske datamaskiner | norwegian_bokmål | 1.412013 |
Pony/pony_check-Property3-.txt |
Property3[T1: T1, T2: T2, T3: T3]¶
[Source]
trait ref Property3[T1: T1, T2: T2, T3: T3] is
Property1[(T1 , T2 , T3)] ref
Implements¶
Property1[(T1 , T2 , T3)] ref
Public Functions¶
gen1¶
[Source]
The Generator for the first argument to your property3 method.
fun box gen1()
: Generator[T1] box
Returns¶
Generator[T1] box
gen2¶
[Source]
The Generator for the second argument to your property3 method.
fun box gen2()
: Generator[T2] box
Returns¶
Generator[T2] box
gen3¶
[Source]
The Generator for the third argument to your property3 method.
fun box gen3()
: Generator[T3] box
Returns¶
Generator[T3] box
gen¶
[Source]
fun box gen()
: Generator[(T1 , T2 , T3)] box
Returns¶
Generator[(T1 , T2 , T3)] box
property¶
[Source]
fun ref property(
arg1: (T1 , T2 , T3),
h: PropertyHelper val)
: None val ?
Parameters¶
arg1: (T1 , T2 , T3)
h: PropertyHelper val
Returns¶
None val ?
property3¶
[Source]
A method verifying that a certain property holds for all given
arg1,arg2, and arg3
with the help of PropertyHelper h.
fun ref property3(
arg1: T1,
arg2: T2,
arg3: T3,
h: PropertyHelper val)
: None val ?
Parameters¶
arg1: T1
arg2: T2
arg3: T3
h: PropertyHelper val
Returns¶
None val ?
name¶
[Source]
fun box name()
: String val
Returns¶
String val
params¶
[Source]
fun box params()
: PropertyParams val
Returns¶
PropertyParams val
| pony | 287467 | https://sv.wikipedia.org/wiki/TTS | TTS | TTS kan syfta på:
Talsyntes (Text To Speech)
Tal och Ton Studioteknik
T-Tauri-stjärna
Teater Teamet Skiftinge
Tvillingtransfusionssyndrom
Girls' Generation-TTS (TaeTiSeo) | swedish | 0.951836 |
Pony/pony_bench-AsyncOverheadBenchmark-.txt |
AsyncOverheadBenchmark¶
[Source]
Default benchmark for measuring asynchronous overhead.
class iso AsyncOverheadBenchmark is
AsyncMicroBenchmark iso
Implements¶
AsyncMicroBenchmark iso
Constructors¶
create¶
[Source]
new iso create()
: AsyncOverheadBenchmark iso^
Returns¶
AsyncOverheadBenchmark iso^
Public Functions¶
name¶
[Source]
fun box name()
: String val
Returns¶
String val
apply¶
[Source]
fun ref apply(
c: AsyncBenchContinue val)
: None val
Parameters¶
c: AsyncBenchContinue val
Returns¶
None val
config¶
[Source]
fun box config()
: BenchConfig val
Returns¶
BenchConfig val
overhead¶
[Source]
fun box overhead()
: AsyncMicroBenchmark iso^
Returns¶
AsyncMicroBenchmark iso^
before¶
[Source]
fun ref before(
c: AsyncBenchContinue val)
: None val
Parameters¶
c: AsyncBenchContinue val
Returns¶
None val
before_iteration¶
[Source]
fun ref before_iteration(
c: AsyncBenchContinue val)
: None val
Parameters¶
c: AsyncBenchContinue val
Returns¶
None val
after¶
[Source]
fun ref after(
c: AsyncBenchContinue val)
: None val
Parameters¶
c: AsyncBenchContinue val
Returns¶
None val
after_iteration¶
[Source]
fun ref after_iteration(
c: AsyncBenchContinue val)
: None val
Parameters¶
c: AsyncBenchContinue val
Returns¶
None val
| pony | 336105 | https://sv.wikipedia.org/wiki/Succinyl-CoA | Succinyl-CoA | Succinyl-CoA, även känt som succinyl-koenzym A eller bärnstenssyra-CoA är en kemisk förening med formeln C25H40N7O19P3S. Ämnet består av karboxylsyran bärnstenssyra kopplad till koenzym A. Ämnet ingår i citronsyracykeln.
Identifikatorer
PubChem 1111
MeSH succinyl-coenzyme+A
Ämnen i citronsyracykeln
Karboxylsyror
Tioestrar | swedish | 0.991449 |
Pony/collections-Hashable-.txt |
Hashable¶
[Source]
Anything with a hash method is hashable.
interface ref Hashable
Public Functions¶
hash¶
[Source]
fun box hash()
: USize val
Returns¶
USize val
| pony | 3070052 | https://sv.wikipedia.org/wiki/Habrosyne | Habrosyne | Habrosyne är ett släkte av fjärilar som beskrevs av Hübner 1821. Habrosyne ingår i familjen sikelvingar.
Dottertaxa till Habrosyne, i alfabetisk ordning
Habrosyne abrasa
Habrosyne abrasoides
Habrosyne albipuncta
Habrosyne angulifera
Habrosyne argenteipuncta
Habrosyne arizonensis
Habrosyne armata
Habrosyne aurata
Habrosyne aurorina
Habrosyne brevipennis
Habrosyne burmanica
Habrosyne chatfeldti
Habrosyne chekiangensis
Habrosyne chinensis
Habrosyne conscripta
Habrosyne costalis
Habrosyne delineta
Habrosyne dentata
Habrosyne derasa
Habrosyne derasoides
Habrosyne dieckmanni
Habrosyne flavescens
Habrosyne formosana
Habrosyne fraterna
Habrosyne gloriosa
Habrosyne grisea
Habrosyne indica
Habrosyne intermedia
Habrosyne japonica
Habrosyne malaisei
Habrosyne miranda
Habrosyne moellendorffii
Habrosyne nepalensis
Habrosyne nigricans
Habrosyne obscura
Habrosyne ochracea
Habrosyne pallescens
Habrosyne plagiosa
Habrosyne pterographa
Habrosyne pyritoides
Habrosyne rectangulata
Habrosyne roseola
Habrosyne sanguinea
Habrosyne scripta
Habrosyne sumatrana
Habrosyne szechwana
Habrosyne szechwanensis
Habrosyne tapaishana
Habrosyne thibetana
Habrosyne urupina
Habrosyne violacea
Bildgalleri
Källor
Externa länkar
Sikelvingar
Habrosyne | swedish | 1.219516 |
Pony/pony_bench-MicroBenchmark-.txt |
MicroBenchmark¶
[Source]
Synchronous benchmarks must provide this trait. The apply method defines a
single iteration in a sample. Setup and Teardown are defined by the before
and after methods respectively. The before method runs before a sample
of benchmarks and after runs after the all iterations in the sample have
completed. If your benchmark requires setup and/or teardown to occur beween
each iteration of the benchmark, then you can use before_iteration and
after_iteration methods respectively that run before/after each iteration.
trait iso MicroBenchmark
Public Functions¶
name¶
[Source]
fun box name()
: String val
Returns¶
String val
config¶
[Source]
fun box config()
: BenchConfig val
Returns¶
BenchConfig val
overhead¶
[Source]
fun box overhead()
: MicroBenchmark iso^
Returns¶
MicroBenchmark iso^
before¶
[Source]
fun ref before()
: None val ?
Returns¶
None val ?
before_iteration¶
[Source]
fun ref before_iteration()
: None val ?
Returns¶
None val ?
apply¶
[Source]
fun ref apply()
: None val ?
Returns¶
None val ?
after¶
[Source]
fun ref after()
: None val ?
Returns¶
None val ?
after_iteration¶
[Source]
fun ref after_iteration()
: None val ?
Returns¶
None val ?
| pony | 117735 | https://da.wikipedia.org/wiki/NDoc | NDoc | NDoc er et dokumentationsværktøj rettet mod .NET-udviklingsplatformen. NDoc fungerer i høj grad som JavaDoc gør for Java. NDoc muliggør dokumentation for udviklere imellem, og benyttes derfor primært til at give en stringent specifikation af en mængde kodes funktionalitet og grænseflade. NDoc benytter eksterne XML filer som input og sammenholder disse med oversatte assemblies for at give et fuldstændigt billede af den udviklede kode. Opdelingen af kode og dokumentation gør det muligt at skrive (eller flot gennemlæse) dokumentation uden mulighed for at indføre fejl i selve kildekoden. Endvidere er det muligt at skrive, redigere og klargøre dokumentation i forskellige formater uden at skulle oversætte kildekoden på ny.
Brug af værktøjet
NDoc scanner en eller flere .NET assemblies via reflection for at finde informationer som klasser, namespaces etc. Disse informationer sammenholdes med selve dokumentationen som bliver gemt i et specielt XML format. NDoc giver brugeren mulighed for at skjule informationer i dokumentationen selvom de er blevet dokumenterede af en programmør. Derved er det muligt for f.eks. et firma at vedligeholde en fuldstændig dokumentation til intern brug og dele en mere begrænset version til eventuelle kunder og samarbejdspartnere.
XML format
Dette er ikke en fuldstændig gennemgang af de dokumentationsmuligheder NDoc giver, men blot en kort introduktion til tankegangen bag. Følgende er et eksempel på dokumentation i C#, det er dog også muligt at benytte NDoc i andre .NET sprog.
/// <summary>Min klasse.. Printer Hello Wiki</summary>
/// <remarks>Jeg har ingen bemærkninger</remarks>
class MinKlasse {
/// <param name="args">Argument til main. Bliver dog ikke brugt til noget</param>
/// <returns>Et tal der altid er 1</returns>
public static int Main(string[] args) {
System.Console.WriteLine("Hello Wiki");
return 1;
}
}
Som det fremgår af eksemplet benyttes /// til at markere at linje skal læses af NDoc. Det er også muligt at holde selve dokumentationen ude af kildekoden ved at lave eksterne referencer:
/// <include file='mydoc.xml' path='Dokumentation/Klasser[@name="MinKlasse"]/*' />
class MinKlasse {
public static int Main(string[] args) {
System.Console.WriteLine("Hello Wiki");
return 1;
}
}
Med en dertilhørerende dokumentations xml fil:
Min klasse.. Printer Hello Wiki
Jeg har ingen bemærkninger
Generering af XML filer
Idet kommentarer i koden bliver fjernet under oversættelse til assemblies er det nødvendigt at hente alle NDoc linjerne fra kildekoden ud i en ekstern xml fil ved eller før kildekoden bliver oversat. Dette kan gøres ved out'' parameteren på Microsoft C# oversætter eller ved brug af VBCommenter for VB.NET. Rettelser til dokumentation bør ikke foretages i den genererede XML fil da disse vil blive overskrevet ved næste oversættelse af kildekoden.
Generering af dokumentation
Det er muligt både at benytte NDoc på kommandolinjen og som en grafisk klient. For større projekter vil det ofte være praktisk at automatisere dokumentationen ved brug af NDoc via kommandolinjen. Visse output formater (se næste afsnit) kræver specielle andre programmer som skal hentes og installeres.
Output formater
NDoc kan generere dokumentationen i flere forskellige formater:
JavaDoc: JavaDoc er Suns dokumentationsmetode og består af et frameset i HTML.
LaTeX: Generering af Latex, der derefter kan oversættes til DVI, postscript eller PDF.
LinearHTML: Simpel HTML struktur.
MSDN:
MSDN 2003:
VS.NET 2003:
XML''':
Eksterne links
NDoc Code Documentation Generator for .NET
Udviklingsværktøjer
Windows-software | danish | 0.913861 |
Pony/annotations.txt | # Program Annotations
In Pony, we provide a special syntax for implementation-specific annotations to various elements of a program. The basic syntax is a comma-separated list of identifiers surrounded by backslashes:
```pony
\annotation1, annotation2\
```
Here, `annotation1` and `annotation2` can be any valid Pony identifier, i.e. a sequence of alphanumeric characters starting with a letter or an underscore.
## What can be annotated
Annotations are allowed after any scoping keyword or symbol. The full list is:
- `actor`
- `class`
- `struct`
- `primitive`
- `trait`
- `interface`
- `new`
- `fun`
- `be`
- `if` (only as a condition, not as a guard)
- `ifdef`
- `elseif`
- `else`
- `while`
- `repeat`
- `until`
- `for`
- `match`
- `|` (only as a case in a `match` expression)
- `recover`
- `object`
- `{` (only as a lambda)
- `with`
- `try`
- `then` (only when part of a `try` block)
## The effect of annotations
Annotations are entirely implementation-specific. In other words, the Pony compiler (or any other tool that processes Pony programs) is free to take any action for any annotation that it encounters, including not doing anything at all. Annotations starting with `ponyint` are reserved by the compiler for internal use and shouldn't be used by external tools.
### Annotations in the Pony compiler
The following annotations are recognised by the Pony compiler. Note that the Pony compiler will ignore annotations that it doesn't recognise, as well as the annotations described here if they're encountered in an unexpected place.
#### `packed`
Recognised on a `struct` declaration. Removes padding in the associated `struct`, making it ABI-compatible with a packed C structure with compatible members (declared with the `__attribute__((packed))` extension or the `#pragma pack` preprocessor directive in many C compilers).
```pony
struct \packed\ MyPackedStruct
var x: U8
var y: U32
```
#### `likely` and `unlikely`
Recognised on a conditional expression (`if`, `while`, `until` and `|` (as a pattern matching case)). Gives optimisation hints to the compiler on the likelihood of a given conditional expression.
```pony
if \likely\ cond then
foo
end
while \unlikely\ cond then
bar
end
repeat
baz
until \likely\ cond end
match obj
| \likely\ expr => foo
| \unlikely\ let capt: T => bar
end
```
### `nodoc`
Recognised on objects and methods (`actor`, `class`, `struct`, `primitive`, `trait`, `interface`, `new`, `be`, `fun`). Indicates to the documentation system that the item and any of its children shouldn't be included in generated output.
```pony
class \nodoc\Foo
"""
We don't want this class and its methods to appear in generated documentation
"""
```
### `nosupertype`
Recognised on objects(`actor`, `class`, `primitive`, `struct`). A type annotated with `nosupertype` will not be a subtype of any other type (except _), even if the type structurally provides an interface. If a `nosupertype` type has a provides list, a compiler error is reported. As a result, a `nosupertype` type is excluded from both nominal and structural subtyping.
Here's an example of how `nosupertype` can be important:
```pony
class Empty
class Foo
fun foo[A: Any](a: (A | Empty val)) =>
match consume a
| let a': A => None
end
```
The above code won't compile because you could supply `Empty ref`. Doing so results in a compiler error about an unsafe match because we would need to distinguish between `Empty val` and `Empty ref` at runtime.
By adding `nosupertype` to the definition of `Empty`, we declare that `Empty` is not a subtype of `Any` and thereby allow the code to compile as there is no longer an unsafe match.
```pony
class \nosupertype\ Empty
class Foo
fun foo[A: Any](a: (A | Empty val)) =>
match consume a
| let a': A => None
end
```
`nosupertype` is particularly valuable when constructing generic classes like collections that need a marker class to describe "lack of an item".
| pony | 4858452 | https://sv.wikipedia.org/wiki/Cyphostemma%20homblei | Cyphostemma homblei | Cyphostemma homblei är en vinväxtart som först beskrevs av De Wild., och fick sitt nu gällande namn av Descoings. Cyphostemma homblei ingår i släktet Cyphostemma och familjen vinväxter. Inga underarter finns listade i Catalogue of Life.
Källor
Vinväxter
homblei | swedish | 1.502637 |
Pony/src-random-splitmix64-.txt |
splitmix64.pony
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28class SplitMix64 is Random
"""
Very fast Pseudo-Random-Number-Generator
using only 64 bit of state, as detailed at:
http://xoshiro.di.unimi.it/ and http://gee.cs.oswego.edu/dl/papers/oopsla14.pdf
Using [XorOshiro128StarStar](random-XorOshiro128StarStar.md) or [XorOshiro128Plus](random-XorOshiro128Plus.md)
should be prefered unless using only 64 bit of state is a requirement.
"""
// state
var _x: U64
new from_u64(x: U64 = 5489) =>
_x = x
new create(x: U64 = 5489, y: U64 = 0) =>
"""
Only x is used, y is discarded.
"""
_x = x
fun ref next(): U64 =>
_x = _x + U64(0x9e3779b97f4a7c15)
var z: U64 = _x
z = (z xor (z >> 30)) * U64(0xbf58476d1ce4e5b9)
z = (z xor (z >> 27)) * U64(0x94d049bb133111eb)
z xor (z >> 31)
| pony | 3920536 | https://sv.wikipedia.org/wiki/Lucas%E2%80%93Carmichaeltal | Lucas–Carmichaeltal | Lucas–Carmichaeltal är inom matematiken ett sammansatt tal n sådant att om p är en primtalsfaktor av n så är p + 1 en faktor av n + 1.
Av konvention betraktas endast ett tal som ett Lucas–Carmichaeltal om det är udda och kvadratfritt (ej delbart med kvadraten av ett primtal), annars skulle varje kub av ett primtal (till exempel 8 och 27) vara Lucas–Carmichaeltal eftersom n3 + 1 = (n + 1)(n2 − n + 1 alltid är delbart med n + 1.
Det första Lucas–Carmichaeltal är alltså och är alla faktorer av 400.
De första Lucas–Carmichaeltalen är (inklusive deras faktorer):
399 = 3 × 7 × 19
935 = 5 × 11 × 17
2015 = 5 × 13 × 31
2915 = 5 × 11 × 53
4991 = 7 × 23 × 31
5719 = 7 × 19 × 43
7055 = 5 × 17 × 83
8855 = 5 × 7 × 11 × 23
12719 = 7 × 23 × 79
18095 = 5 × 7 × 11 × 47
20705 = 5 × 41 × 101
20999 = 11 × 23 × 83
22847 = 11 × 31 × 67
29315 = 5 × 11 × 13 × 41
31535 = 5 × 7 × 17 × 53
46079 = 11 × 59 × 71
51359 = 7 × 11 × 23 × 291
60059 = 19 × 29 × 109
63503 = 11 × 23 × 251
67199 = 11 × 41 × 149
73535 = 5 × 7 × 11 × 191
76751 = 23 × 47 × 71
80189 = 17 × 53 × 89
81719 = 11 × 17 × 19 × 23
88559 = 19 × 59 × 79
90287 = 17 × 47 × 113
104663 = 13 × 83 × 97
117215 = 5 × 7 × 17 × 197
120581 = 17 × 41 × 173
147455 = 5 × 7 × 11 × 383
152279 = 29 × 59 × 89
155819 = 19 × 59 × 139
162687 = 3 × 7 × 61 × 127
191807 = 7 × 11 × 47 × 53
194327 = 7 × 17 × 23 × 71
196559 = 11 × 107 × 167
214199 = 23 × 67 × 139
218735 = 5 × 11 × 41 × 97
230159 = 47 × 59 × 83
265895 = 5 × 7 × 71 × 107
357599 = 11 × 19 × 29 × 59
388079 = 23 × 47 × 359
390335 = 5 × 11 × 47 × 151
482143 = 31 × 103 × 151
588455 = 5 × 7 × 17 × 23 × 43
653939 = 11 × 13 × 17 × 269
663679 = 31 × 79 × 271
676799 = 19 × 179 × 199
709019 = 17 × 179 × 233
741311 = 53 × 71 × 197
760655 = 5 × 7 × 103 × 211
761039 = 17 × 89 × 503
776567 = 11 × 227 × 311
798215 = 5 × 11 × 23 × 631
880319 = 11 × 191 × 419
895679 = 17 × 19 × 47 × 59
913031 = 7 × 23 × 53 × 107
966239 = 31 × 71 × 439
966779 = 11 × 179 × 491
973559 = 29 × 59 × 569
1010735 = 5 × 11 × 17 × 23 × 47
1017359 = 7 × 23 × 71 × 89
1097459 = 11 × 19 × 59 × 89
1162349 = 29 × 149 × 269
1241099 = 19 × 83 × 787
1256759 = 7 × 17 × 59 × 179
1525499 = 53 × 107 × 269
1554119 = 7 × 53 × 59 × 71
1584599 = 37 × 113 × 379
1587599 = 13 × 97 × 1259
1659119 = 7 × 11 × 29 × 743
1707839 = 7 × 29 × 47 × 179
1710863 = 7 × 11 × 17 × 1307
1719119 = 47 × 79 × 463
1811687 = 23 × 227 × 347
1901735 = 5 × 11 × 71 × 487
1915199 = 11 × 13 × 59 × 227
1965599 = 79 × 139 × 179
2048255 = 5 × 11 × 167 × 223
2055095 = 5 × 7 × 71 × 827
2150819 = 11 × 19 × 41 × 251
2193119 = 17 × 23 × 71 × 79
2249999 = 19 × 79 × 1499
2276351 = 7 × 11 × 17 × 37 × 47
2416679 = 23 × 179 × 587
2581319 = 13 × 29 × 41 × 167
2647679 = 31 × 223 × 383
2756159 = 7 × 17 × 19 × 23 × 53
2924099 = 29 × 59 × 1709
3106799 = 29 × 149 × 719
3228119 = 19 × 23 × 83 × 89
3235967 = 7 × 17 × 71 × 383
…
Det första Lucas–Carmichaeltal med fem faktorer är .
Det är inte känt om något Lucas–Carmichaeltal även är ett Carmichaeltal.
Källor
Unsolved Problems in Number Theory (3rd edition) by Richard Guy (Springer Verlag, 2004), section A13.
PlanetMath
Heltalsmängder | swedish | 0.723383 |
Pony/src-time-timers-.txt |
timers.pony
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189use "collections"
use @pony_asio_event_create[AsioEventID](
owner: AsioEventNotify,
fd: U32,
flags: U32,
nsec: U64,
noisy: Bool)
use @pony_asio_event_setnsec[U32](event: AsioEventID, nsec: U64)
use @pony_asio_event_unsubscribe[None](event: AsioEventID)
use @pony_asio_event_destroy[None](event: AsioEventID)
actor Timers is AsioEventNotify
"""
A hierarchical set of timing wheels.
"""
var _current: U64 = 0
let _slop: USize
embed _map: MapIs[Timer tag, Timer] = MapIs[Timer tag, Timer]
embed _wheel: Array[_TimingWheel] = Array[_TimingWheel](_wheels())
embed _pending: List[Timer] = List[Timer]
var _event: AsioEventID = AsioEvent.none()
new create(slop: USize = 20) =>
"""
Create a timer handler with the specified number of slop bits. No slop bits
means trying for nanosecond resolution. 10 slop bits is approximately
microsecond resolution, 20 slop bits is approximately millisecond
resolution.
"""
_slop = slop
_set_time()
for i in Range(0, _wheels()) do
_wheel.push(_TimingWheel(i))
end
be apply(timer: Timer iso) =>
"""
Sets a timer. Fire it if need be, schedule it on the right timing wheel,
then rearm the timer.
"""
let timer': Timer ref = consume timer
_map(timer') = timer'
timer'._slop(_slop)
_fire(timer')
_advance()
be cancel(timer: Timer tag) =>
"""
Cancels a timer.
"""
try
(_, let timer') = _map.remove(timer)?
timer'._cancel()
if (_map.size() == 0) and (not _event.is_null()) then
// Unsubscribe an existing event.
@pony_asio_event_unsubscribe(_event)
_event = AsioEvent.none()
end
end
be dispose() =>
"""
Dispose of this set of timing wheels.
"""
for wheel in _wheel.values() do
wheel.clear()
end
_map.clear()
if not _event.is_null() then
@pony_asio_event_unsubscribe(_event)
_event = AsioEvent.none()
end
be _event_notify(event: AsioEventID, flags: U32, arg: U32) =>
"""
When the event fires, advance the timing wheels.
"""
if AsioEvent.disposable(flags) then
@pony_asio_event_destroy(event)
elseif event is _event then
_advance()
end
fun ref _advance() =>
"""
Update the current time, process all the timing wheels, and set the event
for the next time we need to advance.
"""
let elapsed = _set_time()
try
for i in Range(0, _wheels()) do
if not _wheel(i)?.advance(_pending, _current, elapsed) then
break
end
end
for timer in _pending.values() do
_fire(timer)
end
end
_pending.clear()
var nsec = _next()
if _event.is_null() then
if nsec != -1 then
// Create a new event.
_event =
@pony_asio_event_create(this, 0, AsioEvent.timer(), nsec, true)
end
else
if nsec != -1 then
// Update an existing event.
@pony_asio_event_setnsec(_event, nsec)
else
// Unsubscribe an existing event.
@pony_asio_event_unsubscribe(_event)
_event = AsioEvent.none()
end
end
fun ref _fire(timer: Timer) =>
"""
Fire a timer if necessary, then schedule it on the correct timing wheel
based on how long it is until it expires.
"""
if not timer._fire(_current) then
try
_map.remove(timer)?
end
return
end
try
let rem = timer._next() - _current
_get_wheel(rem)?.schedule(consume timer)
end
fun _next(): U64 =>
"""
Return the next time at which the timing wheels should be advanced. This is
adjusted for slop, so it yields nanoseconds. If no events are pending, this
returns -1.
"""
var next: U64 = -1
try
for i in Range(0, _wheels()) do
next = next.min(_wheel(i)?.next(_current))
end
end
if next != -1 then
next = next << _slop.u64()
end
next
fun ref _set_time(): U64 =>
"""
Set the current time with precision reduced by the slop bits. Return the
elapsed time.
"""
let previous = _current = Time.nanos() >> _slop.u64()
_current - previous
fun ref _get_wheel(rem: U64): _TimingWheel ? =>
"""
Get the hierarchical timing wheel for the given time until expiration.
"""
let t = rem.min(_expiration_max())
let i = ((t.bitwidth() - t.clz()) - 1).usize() / _bits()
_wheel(i)?
fun tag _expiration_max(): U64 =>
"""
Get the maximum time the timing wheels cover. Anything beyond this is
scheduled on the last timing wheel.
"""
((1 << (_wheels() * _bits())) - 1).u64()
fun tag _wheels(): USize => 4
fun tag _bits(): USize => 6
| pony | 1842421 | https://no.wikipedia.org/wiki/Avis%C3%A5ret%201849 | Avisåret 1849 | Avisåret 1849 er en oversikt over etableringer, nedleggelser, hendelser, prisvinnere og personer med tilknytning til aviser i 1849.
Hendelser
Etableringer
Fødsler
Referanser | norwegian_bokmål | 1.337412 |
Pony/signals-SignalRaise-.txt |
SignalRaise¶
[Source]
Raise a signal.
primitive val SignalRaise
Constructors¶
create¶
[Source]
new val create()
: SignalRaise val^
Returns¶
SignalRaise val^
Public Functions¶
apply¶
[Source]
fun box apply(
sig: U32 val)
: None val
Parameters¶
sig: U32 val
Returns¶
None val
eq¶
[Source]
fun box eq(
that: SignalRaise val)
: Bool val
Parameters¶
that: SignalRaise val
Returns¶
Bool val
ne¶
[Source]
fun box ne(
that: SignalRaise val)
: Bool val
Parameters¶
that: SignalRaise val
Returns¶
Bool val
| pony | 96030 | https://sv.wikipedia.org/wiki/Q-f%C3%B6rkortningar | Q-förkortningar | Q-förkortningar kallas en uppsättning fördefinierade treställiga förkortningar som används vid radiokommunikation, speciellt vid telegrafi. De är fastställda av Internationella Teleunionen (ITU) i Appendix 13 och Appendix 14 av Radioreglementet, som är en bilaga till Internationella Telekonventionen.
Förkortningarna börjar alla med Q, därav namnet, och kan tänkas komma från engelskas question. Q-förkortningen ges frågande innebörd om den följs av ett frågetecken. Utan frågetecken ska Q-förkortningen tolkas som ett påstående eller en uppmaning. (Se nedan). En definition med negativ innebörd kan modifieras till en positiv betydelse genom tillägg av C vid telegrafi. Vid telefoni uttalat Charley vid Q-signaler upptagna i Appendix 13, men YES vid Q-signaler upptagna i Appendix 14. Detta synes inkonsekvent, men så blev i alla fall utslaget vid 1985 års ITU-konferens.
En definition med positiv innebörd kan ändras till negativ betydelse genom tillägg av N vid telegrafi och NO vid telefoni. I lokala trafikföreskrifter har det förekommit föreskrift att den omvända innebörden ska anges genom att ordet NEGATIVE uttalas.
Disposition
Serien QAA … QNZ är reserverad för aeronautisk trafik (definieras av ICAO)
Serien QOA … QQZ är reserverad för sjöfarttrafik (definieras i Radioreglementet Appendix 14)
Serien QRA … QUZ är för allmänt bruk. I delserien QTA – QUZ ingår en hel del koder med tillämpning både för sjöfart och luftfart, främst vid samverkan vid sjöräddning (definieras i Radioreglementet Appendix 13)
Serien QVA/QWA ... QZZ saknar ITU-definitioner, men den tyska polisen har använt vissa delar i denna serie med egna definitioner.
Rysk militär trafik har egna definitioner av Q-signalerna. Föga är känt om tolkningen.
I svensk militär trafik används serien QXA … QZZ med nationella definitioner.
Okänt tillämpningsområde
Vissa Q-koder har en liknande tolkning vid flaggsignalering enligt International Code of Signals.
Som underlag för framtida historieskrivning upptas även vissa äldre lydelser enligt Signalinstruktion för Armén 1938. Ett annat skäl är rimlig tolkning vid läsning av äldre litteratur där Q-signaler nämns. (Se t ex konflikten vid QRJ.) Dessa äldre lydelser finns enbart i den allmänna delen och utmärks genom skrift med denna stil.
Signalen QRR var tidigare vakant, och användes då inofficiellt av radioamatörer som nödanrop. Sedermera tog ITU signalen QRR i anspråk med tillämpning på maskinsändning. För att undvika konflikter ändrade då radioamatörerna sitt inofficiella nödanrop till QRRR.
Bland radioamatörer, speciellt i USA, förekommer en inofficiell definition av serien QNA … QNZ med tillämpning på nättrafik. Från detta bruk måste starkt avrådas, eftersom allvarliga missförstånd kan uppstå om det tolkas enligt Radioreglementets officiella definitioner med tillämpning på flygtrafik.
Förkortningar
=== Kod för aeronautisk trafik <ref>ICAO PANS-ABC_Doc8400–4: The ICAO Q Code 1989 + Signalinstruktion för armén (Signal I A 1945), Försvarets kommandoexpedition, Bokdetaljen, Stockholm 1945 + Sambandsinstruktion för krigsmakten 1968, 3. Telegrafering(SbIK:3) Försvarets bok- och blankettförråd, bokdetaljen, Fack, 172 29, Sundbyberg 1</ref>===
Denna serie består av koderna QAA—QNZ, vilken administreras av ICAO. Serien har reviderats åtskilliga gånger, vilket ibland inneburit att föråldrade koder annullerats, varvid luckor uppstått i den sista revisionen av Doc8400 (1989), vars användning slutligen avskaffades helt och hållet 1999.
För luckorna vid
har komplettering skett med svenska definitioner enligt Signal I A 1945, i tabellen nedan skrivna med liten stil.
Aktualisering till svensk officiell lydelse har skett t o m 1968 enligt SbIK:3.
Båda dessa kompletteringar är i tabellen markerade med asterisk (*).
Övriga fall är fri översättning från engelska i ICAO Doc8400-4.
––––––––––*) Definitionen av dessa koder är enligt SignalI A 1945
Tilläggsignaler
Svaret kan i vissa fall ersättas med <small caps>Ex: QAM SLA 1015 mulet QBA 20 km QBB 800 9/10 QAN 270 gr 25 km/t QFE 1013 mb</small caps>.
Kod för maritim trafik(Oauktoriserad fri översättning från den engelska versionen)
{| class="wikitable"
! style=background:#DDDDDD | Förkortning !! style=background:#DDDDDD | Fråga !! style=background:#DDDDDD | Svar eller anvisning
|-
| QOA || Kan du gå över till telegrafi på 500 kHz?|| Jag kan använda telegrafi på 500 kHz
|-
| QOB || Kan du gå över till telefoni på 2 182 kHz?|| Jag kan använda telefoni på 2 182 kHz
|-
| QOC || Kan du gå över till telefoni på VHF-kanal 16 (156,80 MHz)?|| Jag kan använda telefoni på VHF-kanal 16 (156,80 MHz)
|-
| QOD || Kan du samtala med mig på: 0. Nederländska 1. Engelska 2. Franska 3. Tyska 4. Grekiska 5. Italienska 6. Japanska 7. Norska 8. Ryska 9. Spanska|| Jag kan samtala med dig på: 0. Nederländska 1. Engelska 2. Franska 3. Tyska 4. Grekiska 5. Italienska 6. Japanska 7. Norska 8. Ryska 9. Spanska
|-
| QOE || Har du tagit emot säkerhetsmeddelandet från ...?(Namn och/eller anropssignal)|| Jag har tagit emot säkerhetsmeddelandet från ...(Namn och/eller anropssignal)'
|-
| QOF || Vilken kvalitet har mina signaler för kommersiell trafik?|| 1. Otillräcklig 2. Nätt och jämnt användbar 3. Godtagbar
|-
| QOG || Hur många remsor har du att sända?|| Jag har ... remsor att sända
|-
| QOH || Skall jag sända infasningssignal under ... sekunder?|| Sänd infasningssignal under ... sekunder
|-
| QOI || Skall jag sända min remsa?|| Sänd din remsa
|-
| QOJ || Kan du lyssna på ... kHz eller MHz efter positionsnödsignaler (EPIRB)?|| Jag lyssnar på ... kHz eller MHz efter positionsnödsignaler (EPIRB)
|-
| QOK || Har du tagit emot positionsnödsignalerna (EPIRB) på ... kHz? (eller ... MHz|| Jag har tagit emot positionsnödsignalerna (EPIRB) på ... kHz? (eller ... MHz
|-
| QOL || Har ditt fartyg utrustning för mottagning av selektivanrop?Om så är fallet, vilket är fartygets selektivnummer eller anropssignal? || Mitt fartyg har utrustning för mottagning av selektivanrop.Mitt selektivnummer eller anropssignal är ...
|-
| QOM || På vilka frekvenser kan ditt fartyg nås med selektivanrop? || Mitt fartyg kan nås med selektivanrop på följande frekvens/frekvenser ... (passningstider kan tilläggas vid behov)
|-
| QOO || Kan du sända på vilken arbetsfrekvens som helst? || Jag kan sända på vilken arbetsfrekvens som helst
|-
| QOT || Hör du mitt anrop. Hur länge dröjer det ungefär tills vi kan utväxla trafik? || Jag hör ditt anrop. Väntetid ungefär ... minuter
|}
Allmänna koden
Definitionerna i nedanstående tabell är i huvudsak en oauktoriserad fri översättning av engelska utgåvan av internationella Radioreglementet (RR 1985). I den mån officiella svenska översättningar är kända har dessa använts i st f den oauktoriserade svenska översättningen. Dessa fall är utmärkta med en not. Rent formella ändringar har inte markerats.a)
Förkortningar med lydelse enligt Sambandsinstruktion för krigsmakten, del 3. Telegrafering (SbIK:3 1968) är markerade med asterisk (*).
Förkortningar med fetstil används inom amatörradio.
Förklaringar skrivna med <small caps>Kapitäler</small caps> baseras på Signal I A 1938.–––––––––––––––a) Exempelvis kan engelska you, your vara både singular och plural, som på svenska har numerusskiljande ord (du, ni o s v).
Svensk militär kod
Observera, att flera definitioner är varandra motstridande (t ex jag/Ni) mellan respektive årgångsversioner enligt indikerade referenser.
Inofficiella nättrafik-förkortningar använda i USA
Serien QNA … QNZ är internationellt avdelad för aeronautisk trafik och nedanstående inofficiella förkortningar har helt annan innebörd än de internationella, och allvarliga följder riskeras om man misstolkar användningsområdet.
Nedanstående är försöksvis fri översättning från engelsk originaltext med anpassning till svenska termer.
Sammanhanget avgör om meddelandet ska tolkas som fråga (avslutas i så fall med frågetecken '?') eller ha positiv betydelse.
–––––––––––––––* Endast huvudstationen får använda denna kod
Okänt tillämpningsområde
Referenser
Noter
Telegrafi
Amatörradio
Sambandstjänst | swedish | 0.919517 |
Pony/process--index-.txt |
Process package¶
The Process package provides support for handling Unix style processes.
For each external process that you want to handle, you need to create a
ProcessMonitor and a corresponding ProcessNotify object. Each
ProcessMonitor runs as it own actor and upon receiving data will call its
corresponding ProcessNotify's method.
Example program¶
The following program will spawn an external program and write to it's
STDIN. Output received on STDOUT of the child process is forwarded to the
ProcessNotify client and printed.
use "backpressure"
use "process"
use "files"
actor Main
new create(env: Env) =>
// create a notifier
let client = ProcessClient(env)
let notifier: ProcessNotify iso = consume client
// define the binary to run
let path = FilePath(FileAuth(env.root), "/bin/cat")
// define the arguments; first arg is always the binary name
let args: Array[String] val = ["cat"]
// define the environment variable for the execution
let vars: Array[String] val = ["HOME=/"; "PATH=/bin"]
// create a ProcessMonitor and spawn the child process
let sp_auth = StartProcessAuth(env.root)
let bp_auth = ApplyReleaseBackpressureAuth(env.root)
let pm: ProcessMonitor = ProcessMonitor(sp_auth, bp_auth, consume notifier,
path, args, vars)
// write to STDIN of the child process
pm.write("one, two, three")
pm.done_writing() // closing stdin allows cat to terminate
// define a client that implements the ProcessNotify interface
class ProcessClient is ProcessNotify
let _env: Env
new iso create(env: Env) =>
_env = env
fun ref stdout(process: ProcessMonitor ref, data: Array[U8] iso) =>
let out = String.from_array(consume data)
_env.out.print("STDOUT: " + out)
fun ref stderr(process: ProcessMonitor ref, data: Array[U8] iso) =>
let err = String.from_array(consume data)
_env.out.print("STDERR: " + err)
fun ref failed(process: ProcessMonitor ref, err: ProcessError) =>
_env.out.print(err.string())
fun ref dispose(process: ProcessMonitor ref, child_exit_status: ProcessExitStatus) =>
match child_exit_status
| let exited: Exited =>
_env.out.print("Child exit code: " + exited.exit_code().string())
| let signaled: Signaled =>
_env.out.print("Child terminated by signal: " + signaled.signal().string())
end
Process portability¶
The ProcessMonitor supports spawning processes on Linux, FreeBSD, OSX and
Windows.
Shutting down ProcessMonitor and external process¶
When a process is spawned using ProcessMonitor, and it is not necessary to
communicate to it any further using stdin and stdout or stderr, calling
done_writing() will close stdin to
the child process. Processes expecting input will be notified of an EOF on
their stdin and can terminate.
If a running program needs to be canceled and the
ProcessMonitor should be shut down, calling
dispose will terminate the child process
and clean up all resources.
Once the child process is detected to be closed, the process exit status is
retrieved and ProcessNotify.dispose is
called.
The process exit status can be either an instance of
Exited containing the process exit code in case the
program exited on its own, or (only on posix systems like linux, osx or bsd) an
instance of Signaled containing the signal number that
terminated the process.
Public Types¶
primitive CapError
primitive ChdirError
primitive ExecveError
class Exited
primitive ForkError
primitive KillError
primitive PipeError
class ProcessError
type ProcessErrorType
type ProcessExitStatus
actor ProcessMonitor
interface ProcessNotify
class Signaled
primitive StartProcessAuth
primitive UnknownError
primitive WaitpidError
primitive WriteError
| pony | 835907 | https://sv.wikipedia.org/wiki/Platform%20Invocation%20Services | Platform Invocation Services | Platform Invocation Services, mer känd som P/Invoke, är en funktion i implementationer av Common Language Infrastructure, som till exempel Common Language Runtime, som tillåter hanterad kod att anropa maskinkod i DLL-filer. Maskinkoden refereras av metadata som beskriver funktionen som laddas ifrån DLL-filen.
Användning
När P/Invoke används hanterar exekveringsmotorn (CLR) DLL-filerna och konverterar ohanterade typer till CTS-typer (så kallad parameter marshalling).
Följande sker under denna process:
DLL-filen innehållande funktionen lokaliseras.
Filen laddas in i minnet.
Adressen till funktionen sparas i minnet och argumenten läggs på stacken. Därefter utförs operationerna som vanligt.
P/Invoke är mycket användbart när man vill använda C- och C++-DLL:er kompilerade till maskinkod. Det är också användbart när man vill ha tillgång till Windows API, som helt består av DLL-filer med maskinkod, då det för många av funktionerna i Windows inte finns någon tillgängliga wrappers. Detta resulterar i att man måste skriva en wrapper till till exempel Win32 API.
Exempel
Det första exemplet visar hur du kan få reda vilken version en DLL har:
DllGetVersion funktion vars signatur finns i Windows API:
HRESULT __stdcall DllGetVersion(DLLVERSIONINFO* pdvi)
P/Invoke C#-kod som anropar funktionen DllGetVersion:
[DllImport("shell32.dll")]
static extern int DllGetVersion(ref DLLVERSIONINFO pdvi);
Nästa exempel visar hur man extraherar en ikonfil.
Signaturen för funktionen ExtractIcon :
HICON __stdcall ExtractIcon(HINSTANCE hInst,LPCTSTR lpszExeFileName,UINT nIconIndex);
P/Invoke C#-kod som anropar funktionen ExtractIcon:
[DllImport("shell32.dll")]
static extern IntPtr ExtractIcon(
IntPtr hInst,
[MarshalAs(UnmanagedType.LPStr)] string lpszExeFileName,
uint nIconIndex);
Nästa exempel visar hur man skriver kod som delar ett Event mellan två program på Windows-plattformen:
Signaturen för funktionen CreateEvent:
HANDLE __stdcall CreateEvent(
LPSECURITY_ATTRIBUTES lpEventAttributes,
BOOL bManualReset,
BOOL bInitialState,
LPCTSTR lpName
);
P/Invoke C#-kod som anropar funktionen CreateEvent:
[DllImport("kernel32.dll", SetLastError=true)]
static extern IntPtr CreateEvent(
IntPtr lpEventAttributes,
bool bManualReset,
bool bInitialState,
[MarshalAs(UnmanagedType.LPStr)] string lpName);
Källor
Översättning av artikel på engelskspråkiga Wikipedia
Externa länkar
Platform Invocation Services
tutorial on P/Invoke
a site devoted to P/Invoke
J/Invoke Java access to Win32 API or Linux/Mac OS X shared libraries, similar to P/Invoke
.NET Framework | swedish | 0.79192 |
Pony/aliasing.txt | # Aliasing
__Aliasing__ means having more than one reference to the same object, within the same actor. This can be the case for a variable or a field.
In most programming languages, aliasing is pretty simple. You just assign some variable to another variable, and there you go, you have an alias. The variable you assign to has the same type (or some supertype) as what's being assigned to it, and everything is fine.
In Pony, that works for some reference capabilities, but not all.
## Aliasing and deny guarantees
The reason for this is that the `iso` reference capability denies other `iso` variables that point to the same object. That is, you can only have one `iso` variable pointing to any given object. The same goes for `trn`.
```pony
fun test(a: Wombat iso) =>
var b: Wombat iso = a // Not allowed!
```
Here we have some function that gets passed an isolated Wombat. If we try to alias `a` by assigning it to `b`, we'll be breaking reference capability guarantees, so the compiler will stop us. Instead, we can only store aliases that are compatible with the original capability.
__What can I alias an `iso` as?__ Since an `iso` says no other variable can be used by _any_ actor to read from or write to that object, we can only create aliases to an `iso` that can neither read nor write. Fortunately, we have a reference capability that does exactly that: `tag`. So we can do this and the compiler will be happy:
```pony
fun test(a: Wombat iso) =>
var b: Wombat tag = a // Allowed!
```
__What about aliasing `trn`?__ Since a `trn` says no other variable can be used by _any_ actor to write to that object, we need something that doesn't allow writing but also doesn't prevent our `trn` variable from writing. Fortunately, we have a reference capability that does that too: `box`. So we can do this and the compiler will be happy:
```pony
fun test(a: Wombat trn) =>
var b: Wombat box = a // Allowed!
```
__What about aliasing other stuff?__ For both `iso` and `trn`, the guarantees require that aliases must give up on some ability (reading and writing for `iso`, writing for `trn`). For the other capabilities (`ref`, `val`, `box` and `tag`), aliases allow for the same operations, so such a reference can just be aliased as itself.
## What counts as making an alias?
There are three things that count as making an alias:
1. When you __assign__ a value to a variable or a field.
2. When you __pass__ a value as an argument to a method.
3. When you __call a method__, an alias of the receiver of the call is created. It is accessible as `this` within the method body.
In all three cases, you are making a new _name_ for the object. This might be the name of a local variable, the name of a field, or the name of a parameter to a method.
## Alias types
Occasionally we'll want to talk about the type of an alias generically. An alias type is a way of saying "whatever we can safely alias this thing as". We'll discuss generic types later, which will put this to use, but for now it will help us talk about aliases of capabilities in the future.
We indicate an alias type by putting a `!` at the end. Here's an example:
```pony
fun test(a: A) =>
var b: A! = a
```
Here, we're using `A` as a __type variable__, which we'll cover later. So `A!` means "an alias of whatever type `A` is". We can also use it to talk about capabilities: we could have written the statements about `iso` and `trn` as just `iso!` = `tag` and `trn!` = `box`.
## Ephemeral types
In Pony, every expression has a type. So what's the type of `consume a`? It's not the same type as `a`, because it might not be possible to alias `a`. Instead, it's an __ephemeral__ type. That is, it's a type for a value that currently has no name (it might have a name through some other alias, but not the one we just consumed or destructively read).
To show a type is ephemeral, we put a `^` at the end. For example:
```pony
fun test(a: Wombat iso): Wombat iso^ =>
consume a
```
Here, our function takes an isolated Wombat as a parameter and returns an ephemeral isolated Wombat.
This is useful for dealing with `iso` and `trn` types, and for generic types, but it's also important for constructors. A constructor always returns an ephemeral type, because it's a new object.
| pony | 2793343 | https://sv.wikipedia.org/wiki/Halvslag | Halvslag | Halvslag är en enkel överhandsknop där den arbetande änden av repet har förts över och under den utgående delen. Trots att den är osäker i sig själv är den en värdefull komponent i många olika användbara och pålitliga knutar och knopar.
Knopar | swedish | 1.132222 |
Pony/files-FileExists-.txt |
FileExists¶
[Source]
primitive val FileExists
Constructors¶
create¶
[Source]
new val create()
: FileExists val^
Returns¶
FileExists val^
Public Functions¶
eq¶
[Source]
fun box eq(
that: FileExists val)
: Bool val
Parameters¶
that: FileExists val
Returns¶
Bool val
ne¶
[Source]
fun box ne(
that: FileExists val)
: Bool val
Parameters¶
that: FileExists val
Returns¶
Bool val
| pony | 3010416 | https://sv.wikipedia.org/wiki/Euriphene%20atossa | Euriphene atossa | Euriphene atossa är en fjärilsart som beskrevs av William Chapman Hewitson 1865. Euriphene atossa ingår i släktet Euriphene och familjen praktfjärilar. Inga underarter finns listade i Catalogue of Life.
Bildgalleri
Källor
Externa länkar
Praktfjärilar
atossa | swedish | 1.104606 |
Pony/collections-persistent-HashMap-.txt |
HashMap[K: Any #share, V: Any #share, H: HashFunction[K] val]¶
[Source]
A persistent map based on the Compressed Hash Array Mapped Prefix-tree from
'Optimizing Hash-Array Mapped Tries for Fast and Lean Immutable JVM
Collections' by Michael J. Steindorfer and Jurgen J. Vinju
Usage¶
use "collections/persistent"
actor Main
new create(env: Env) =>
try
let m1 = Map[String, U32] // {}
// Update returns a new map with the provided key set
// to the provided value. The old map is unchanged.
let m2 = m1("a") = 5 // {a: 5}
let m3 = m2("b") = 10 // {a: 5, b: 10}
let m4 = m3.remove("a")? // {b: 10}
// You can create a new map from key value pairs.
let m5 = Map[String, U32].concat([("a", 2); ("b", 3)].values()) // {a: 2, b: 3}
end
class val HashMap[K: Any #share, V: Any #share, H: HashFunction[K] val]
Constructors¶
create¶
[Source]
new val create()
: HashMap[K, V, H] val^
Returns¶
HashMap[K, V, H] val^
Public Functions¶
apply¶
[Source]
Attempt to get the value corresponding to k.
fun val apply(
k: K)
: val->V ?
Parameters¶
k: K
Returns¶
val->V ?
size¶
[Source]
Return the amount of key-value pairs in the Map.
fun val size()
: USize val
Returns¶
USize val
update¶
[Source]
Update the value associated with the provided key.
fun val update(
key: K,
value: val->V)
: HashMap[K, V, H] val
Parameters¶
key: K
value: val->V
Returns¶
HashMap[K, V, H] val
remove¶
[Source]
Try to remove the provided key from the Map.
fun val remove(
k: K)
: HashMap[K, V, H] val ?
Parameters¶
k: K
Returns¶
HashMap[K, V, H] val ?
get_or_else¶
[Source]
Get the value associated with provided key if present. Otherwise,
return the provided alternate value.
fun val get_or_else(
k: K,
alt: val->V)
: val->V
Parameters¶
k: K
alt: val->V
Returns¶
val->V
contains¶
[Source]
Check whether the node contains the provided key.
fun val contains(
k: K)
: Bool val
Parameters¶
k: K
Returns¶
Bool val
concat¶
[Source]
Add the K, V pairs from the given iterator to the map.
fun val concat(
iter: Iterator[(val->K , val->V)] ref)
: HashMap[K, V, H] val
Parameters¶
iter: Iterator[(val->K , val->V)] ref
Returns¶
HashMap[K, V, H] val
add¶
[Source]
Return this Map with the given (key, value) mapping.
fun val add(
key: K,
value: val->V)
: HashMap[K, V, H] val
Parameters¶
key: K
value: val->V
Returns¶
HashMap[K, V, H] val
sub¶
[Source]
Return this Map without the given key.
fun val sub(
key: K)
: HashMap[K, V, H] val
Parameters¶
key: K
Returns¶
HashMap[K, V, H] val
keys¶
[Source]
fun val keys()
: MapKeys[K, V, H] ref
Returns¶
MapKeys[K, V, H] ref
values¶
[Source]
fun val values()
: MapValues[K, V, H] ref
Returns¶
MapValues[K, V, H] ref
pairs¶
[Source]
fun val pairs()
: MapPairs[K, V, H] ref
Returns¶
MapPairs[K, V, H] ref
| pony | 471541 | https://no.wikipedia.org/wiki/OpenStreetMap | OpenStreetMap | OpenStreetMap (OSM) er et dugnadsprosjekt for å lage frie, redigerbare kart over hele verden. Kartene er basert på innsamlede data fra GPSer og andre tilgjengelige frie ressurser. Brukerne kan legge inn veier og kartpunkter ved å bruke forskjellige redigeringsverktøy.
Kartdataene er lisensiert under Open Database License og de ferdiggenererte kartene er lisensiert under Creative Commons Attribution-ShareAlike 2.0-lisens.
Wikikart
OpenStreetMap er en wiki-aktig måte å lage kart på. Som på Wikipedia kan onlinebrukere redigere kartet ved hjelp av webverktøy. Siden håndteringen av kartdata er ganske kompleks, finnes det også skrivebordsverktøy som gir kartografene mulighet til å jobbe med GPS-spor og kartlag i et mer responsivt miljø.
Kartdatabasen i bakkant av OSM sies å ta vare på historiske data, slik at endringer og hærverk kan gjøres om.
Historie
Steve Coast grunnla OpenStreetMap i juli 2004. I april 2006 begynte prosessen med registrere OSM som en stiftelse (ideell organisasjon).
I juli 2007 ble den første internasjonale konferansen holdt – «The State of the Map».
Bruk
OpenStreetmap er tatt i bruk på en rekke digitale tjenester, både på nett og på mobil. Noen fremtredende eksempler i Norge er Snapchat, Enturs reiseplanlegger, appene til Bergen, Oslo & Trondheim bysykkel og Pokémon Go. Andre tjenester har tatt i bruk OpenStreetMap-data i enkelte områder med dårlig dekning av kommersielle kart. Blant annet Facebook og Apple Maps har gjort dette. Tjenester som ikke bruker OpenStreetMap bruker gjerne Google Maps. Etter at Google begynte å ta betalt for å innebygge Maps på tredjepartsnettsider med særlig høy trafikk, har flere tjenester gått over til OpenStreetMap.
OpenStreetMap har mange andre bruksområder også, for eksempel forskning, nødhjelp og logistikkplanlegging.
Å lage et kart
Grunnlagsdataene for å lage et kart blir bygd opp fra grunnen gjennom en omfattende prosess. Vanligvis begynner man med å laste opp logg-data fra GPS, såkalte spor eller tracks. Videre må man manuelt redigere og tegne de forskjellige veiene og punktene. Objektene blir markert med navn, type og klassifiseringer. Nye data blir flettet inn i det komplette datasettet som ligger i OpenStreetMap-databasen, slik at mange kan jobbe med kartet samtidig.
Alle linjer og punkter som eksisterer på OSM-databasen defineres av engelske nøkler og verdier. Nøkkelen beskriver vagt hva slags type objekt punktet eller linjen er. Dette kan være en kategori, som for eksempel «highway» som beskriver at objektet er en vei eller lignende. Verdien av nøkkelen beskriver ofte enda nøyere hva objektet er. Verdier til bruk sammen med «highway» kan være «path» (sti) eller «primary» (hovedvei). Andre nøkkel og verdi-kombinasjoner kan være «natural=wood» og «building=house».
Innhentingen av kartdataene er bare første steg i prosessen med å fremstille brukbare kart. Den lange listen med koordinater og beskrivelser blir klippet opp i geografiske områder i et rutenett. Hver rute rendres, dvs at dataene tegnes opp grafisk i et bilde vha. et automatisk dataprogram, slik at veier blir røde, gule og hvite streker, mens gatenavn følger veiene og pub- og parkeringsikoner blir plassert riktig slik som på kartet over Soho. Det ferdige bildet legges ut på web, og presenteres som én kartflis i kartmosaikken som for eksempel OpenStreetMap bruker. Kartet rendres flere ganger, slik at hvert zoomnivå får riktig detaljrikhet. OpenStreetMap rendrer tiles ved hjelp av mapnik.
Underprosjektet: «OSM for blinde»
Det finnes et eget prosjekt for å gjøre tilgjengelig OSMs kartmaterialet for blinde og bevegelseshemmede ved å legge inn ekstra informasjon. Denne ekstra informasjonen beskriver tilgjengelighet for synshemmede ved å for eksempel merke gangveier med taktile tegn, trafikklys med lydsignal og informasjonstavler i punktskrift. Til bevegelseshemmede kan man legge inn informasjon om trapper, alternative ramper, heis og tilgjengelige innganger. Mer informasjon finnes på siden GPS for synshemmede.
OpenStreetMap på Wikipedia
Kart basert på data fra OpenStreetMap er i bruk på Wikipedia. Det er utviklet en egen karttjeneste for Wikimedia-prosjektene. Denne tjenesten brukes nå på sider på dette prosjektet for å vise kart.
Lisens
Dataene i OpenStreetMap er lisensiert under CC-BY-SA, men det er et anerkjent faktum at en slik lisens ikke er egnet for en geodatabase som OSM. Det er lisensiert under Open Database License.
Verktøy og programvare
Datainnhenting
GPS
GPSBabel – konverterer sporlogger mellom ulike formater
AFTrack – Program for ruting og sporlogging på Symbian (Nokia)
BSGPS – Sporloggingsprogramvare for Windows CE
Trekbuddy - Kartvisning og sporlogging under J2ME (Java for mobile enheter)
Dataredigering
iD – Webbasert redigeringsprogram skrevet i JavaScript. Utviklet av MapBox. Nyere enn Potlatch.
Potlatch – webbasert redigeringsprogram skrevet i Flash
JOSM – Desktop-redigeringsprogram skrevet i Java''
Merkaartor – Desktop-redigeringsprogram som bruker QT
Vespucci – Mobil-redigeringsprogram laget for endringer på farten (skrevet i Java)
StreetComplete – Mobil-redigeringsprogram hvor brukere blir spurt om supplerende informasjon om kartelementer. F. eks. angående veidekke, belysning eller åpningstider.
Kartvisning
Online Ajax-style OpenLayersbasert grensesnitt
OpenStreetMap.org - Den offisielle kartsiden fra OSM.
InformationFreeway.org - En openlayersbasert kartside som kan vise kart med Tiles@home-fliser.
Telefon og GPS
Ruteberegning
Gosmore (software)
Andre komponenter
Kartrendring
Mapnik - kartrendrer
Osmarender bruker XSLT for å generere SVG som en del av det distribuerte systemet for rendring av kartfliser Tiles@home.
Referanser
Eksterne lenker
Project Wiki
Featured map images
informationfreeway.org - Åpent og fritt brukerredigert kart
Gruppevare
Kartografiske organisasjoner
Wiki
Geoinformatikk
Britiske nettsteder | norwegian_bokmål | 1.092073 |
Pony/src-promises-promise-.txt |
promise.pony
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429use "time"
actor Promise[A: Any #share]
"""
A promise to eventually produce a result of type A. This promise can either
be fulfilled or rejected.
Any number of promises can be chained after this one.
"""
var _value: (_Pending | _Reject | A) = _Pending
embed _list: Array[_IThen[A]] = _list.create()
be apply(value: A) =>
"""
Fulfill the promise.
"""
if _value isnt _Pending then
return
end
_value = value
for f in _list.values() do
f(value)
end
_list.clear()
be reject() =>
"""
Reject the promise.
"""
if _value isnt _Pending then
return
end
_value = _Reject
for f in _list.values() do
f.reject()
end
_list.clear()
fun tag next[B: Any #share](
fulfill: Fulfill[A, B],
rejected: Reject[B] = RejectAlways[B])
: Promise[B]
=>
"""
Chain a promise after this one.
When this promise is fulfilled, the result of type A is passed to the
fulfill function, generating in an intermediate result of type B. This
is then used to fulfill the next promise in the chain.
If there is no fulfill function, or if the fulfill function raises an
error, then the next promise in the chain will be rejected.
If this promise is rejected, this step's reject function is called with no
input, generating an intermediate result of type B which is used to
fulfill the next promise in the chain.
If there is no reject function, of if the reject function raises an error,
then the next promise in the chain will be rejected.
"""
let attach = _Then[A, B](consume fulfill, consume rejected)
let promise = attach.promise()
_attach(consume attach)
promise
fun tag flatten_next[B: Any #share](
fulfill: Fulfill[A, Promise[B]],
rejected: Reject[Promise[B]] = RejectAlways[Promise[B]])
: Promise[B]
=>
"""
Chain a promise after this one and unwrap the promise returned from this
one.
`flatten_next` is a companion to `next`. It operates in an identical
fashion except for the type of the fulfilled promise. Whereas `next` takes
a function that returns a type `B`, `flatten_next` takes a function that
returns `Promise[B]`.
Why is `flatten_next` valuable given that next could take a `B` that is of
a type like `Promise[String]`? Let's start with some code to demonstrate the
problem that arises when returning `Promise[Promise[B]]` from `next`.
Let's say we have a library for accessing the GitHub REST API:
```pony
class GitHub
new create(personal_access_token: String)
fun get_repo(repo: String): Promise[Repository]
class Repository
fun get_issue(number: I64): Promise[Issue]
class Issue
fun title(): String
```
And we want to use this promise based API to look up the title of an issue.
Without `flatten_next`, we could attempt to do the following using `next`:
```pony
actor Main
new create(env: Env) =>
let repo: Promise[Repository] =
GitHub("my token").get_repo("ponylang/ponyc")
//
// do something with the repo once the promise is fulfilled
// in our case, get the issue
//
let issue = Promise[Promise[Issue]] =
repo.next[Promise[Issue]](FetchIssue~apply(1))
// once we get the issue, print the title
issue.next[None](PrintIssueTitle~apply(env.out))
primitive FetchIssue
fun apply(number: I64, repo: Repository): Promise[Issue] =>
repo.get_issue(number)
primitive PrintIssueTitle
fun apply(out: OutStream, issue: Promise[Issue]) =>
// O NO! We can't print the title
// We don't have an issue, we have a promise for an issue
```
Take a look at what happens in the example, when we get to
`PrintIssueTitle`, we can't print anything because we "don't have anything".
In order to print the issue title, we need an `Issue` not a
`Promise[Issue]`.
We could solve this by doing something like this:
```pony
primitive PrintIssueTitle
fun apply(out: OutStream, issue: Promise[Issue]) =>
issue.next[None](ActuallyPrintIssueTitle~apply(out))
primitive ActuallyPrintIssueTitle
fun apply(out: OutStream, issue: Issue) =>
out.print(issue.title())
```
That will work, however, it is kind of awful. When looking at:
```pony
let repo: Promise[Repoository] =
GitHub("my token").get_repo("ponylang/ponyc")
let issue = Promise[Promise[Issue]] =
repo.next[Promise[Issue]](FetchIssue~apply(1))
issue.next[None](PrintIssueTitle~apply(env.out))
```
it can be hard to follow what is going on. We can only tell what is
happening because we gave `PrintIssueTitle` a very misleading name; it
doesn't print an issue title.
`flatten_next` addresses the problem of "we want the `Issue`, not the
intermediate `Promise`". `flatten_next` takes an intermediate promise and
unwraps it into the fulfilled type. You get to write your promise chain
without having to worry about intermediate promises.
Updated to use `flatten_next`, our API example becomes:
```pony
actor Main
new create(env: Env) =>
let repo: Promise[Repository] =
GitHub("my token").get_repo("ponylang/ponyc")
let issue = Promise[Issue] =
repo.flatten_next[Issue](FetchIssue~apply(1))
issue.next[None](PrintIssueTitle~apply(env.out))
primitive FetchIssue
fun apply(number: I64, repo: Repository): Promise[Issue] =>
repo.get_issue(number)
primitive PrintIssueTitle
fun apply(out: OutStream, issue: Issue) =>
out.print(issue.title())
```
Our promise `Issue`, is no longer a `Promise[Promise[Issue]]`. By using
`flatten_next`, we have a much more manageable `Promise[Issue]` instead.
Other than unwrapping promises for you, `flatten_next` otherwise acts the
same as `next` so all the same rules apply to fulfillment and rejection.
"""
let outer = Promise[B]
next[None](object iso
var f: Fulfill[A, Promise[B]] = consume fulfill
let p: Promise[B] = outer
fun ref apply(value: A) =>
let fulfill' = f = _PromiseFulFill[A, B]
try
let inner = (consume fulfill').apply(value)?
inner.next[None](
{(fulfilled: B) => p(fulfilled)},
{()? => p.reject(); error})
else
p.reject()
end
end,
object iso
var r: Reject[Promise[B]] = consume rejected
let p: Promise[B] = outer
fun ref apply() =>
let rejected' = r = RejectAlways[Promise[B]]
try
(consume rejected').apply()?
else
p.reject()
end
end)
outer
fun tag add[B: Any #share = A](p: Promise[B]): Promise[(A, B)] =>
"""
Add two promises into one promise that returns the result of both when
they are fulfilled. If either of the promises is rejected then the new
promise is also rejected.
"""
let p' = Promise[(A, B)]
let c =
object
var _a: (A | _None) = _None
var _b: (B | _None) = _None
be fulfill_a(a: A) =>
match _b
| let b: B => p'((a, b))
else _a = a
end
be fulfill_b(b: B) =>
match _a
| let a: A => p'((a, b))
else _b = b
end
end
next[None](
{(a) => c.fulfill_a(a) },
{() => p'.reject() })
p.next[None](
{(b) => c.fulfill_b(b) },
{() => p'.reject() })
p'
fun tag join(ps: Iterator[Promise[A]]): Promise[Array[A] val] =>
"""
Create a promise that is fulfilled when the receiver and all promises in
the given iterator are fulfilled. If the receiver or any promise in the
sequence is rejected then the new promise is also rejected.
Join `p1` and `p2` with an existing promise, `p3`.
```pony
use "promises"
actor Main
new create(env: Env) =>
let p1 = Promise[String val]
let p2 = Promise[String val]
let p3 = Promise[String val]
p3.join([p1; p2].values())
.next[None]({(a: Array[String val] val) =>
for s in a.values() do
env.out.print(s)
end
})
p2("second")
p3("third")
p1("first")
```
"""
Promises[A].join(
[this]
.> concat(ps)
.values())
fun tag select(p: Promise[A]): Promise[(A, Promise[A])] =>
"""
Return a promise that is fulfilled when either promise is fulfilled,
resulting in a tuple of its value and the other promise.
"""
let p' = Promise[(A, Promise[A])]
let s =
object tag
var _complete: Bool = false
let _p: Promise[(A, Promise[A])] = p'
be apply(a: A, p: Promise[A]) =>
if not _complete then
_p((a, p))
_complete = true
end
end
next[None]({(a) => s(a, p) })
p.next[None]({(a)(p = this) => s(a, p) })
p'
fun tag timeout(expiration: U64) =>
"""
Reject the promise after the given expiration in nanoseconds.
"""
Timers.apply(Timer(
object iso is TimerNotify
let _p: Promise[A] = this
fun ref apply(timer: Timer, count: U64): Bool =>
_p.reject()
false
end,
expiration))
be _attach(attach: _IThen[A] iso) =>
"""
Attaches a step asynchronously. If this promise has already been fulfilled
or rejected, immediately fulfill or reject the incoming step. Otherwise,
keep it in a list.
"""
if _value is _Pending then
_list.push(consume attach)
elseif _value is _Reject then
attach.reject()
else
try attach(_value as A) end
end
primitive Promises[A: Any #share]
fun join(ps: Iterator[Promise[A]]): Promise[Array[A] val] =>
"""
Create a promise that is fulfilled when all promises in the given sequence
are fulfilled. If any promise in the sequence is rejected then the new
promise is also rejected. The order that values appear in the final array
is based on when each promise is fulfilled and not the order that they are
given.
Join three existing promises to make a fourth.
```pony
use "promises"
actor Main
new create(env: Env) =>
let p1 = Promise[String val]
let p2 = Promise[String val]
let p3 = Promise[String val]
Promises[String val].join([p1; p2; p3].values())
.next[None]({(a: Array[String val] val) =>
for s in a.values() do
env.out.print(s)
end
})
p2("second")
p3("third")
p1("first")
```
"""
let p' = Promise[Array[A] val]
let ps' = Array[Promise[A]] .> concat(consume ps)
if ps'.size() == 0 then
p'(recover Array[A] end)
return p'
end
let j = _Join[A](p', ps'.size())
for p in ps'.values() do
p.next[None]({(a)(j) => j(a)}, {() => p'.reject()})
end
p'
actor _Join[A: Any #share]
embed _xs: Array[A]
let _space: USize
let _p: Promise[Array[A] val]
new create(p: Promise[Array[A] val], space: USize) =>
(_xs, _space, _p) = (Array[A](space), space, p)
be apply(a: A) =>
_xs.push(a)
if _xs.size() == _space then
let len = _xs.size()
let xs = recover Array[A](len) end
for x in _xs.values() do
xs.push(x)
end
_p(consume xs)
end
primitive _None
class iso _PromiseFulFill[A: Any #share, B: Any #share] is Fulfill[A, Promise[B]]
"""
Fulfill discarding its input value of `A` and returning a promise of type `B`.
"""
new iso create() => None
fun ref apply(value: A): Promise[B] => Promise[B]
| pony | 2340116 | https://sv.wikipedia.org/wiki/Phyllodactylus%20lanei | Phyllodactylus lanei | Phyllodactylus lanei är en ödleart som beskrevs av Smith 1935. Phyllodactylus lanei ingår i släktet Phyllodactylus och familjen geckoödlor. IUCN kategoriserar arten globalt som livskraftig.
Underarter
Arten delas in i följande underarter:
P. l. lupitae
P. l. isabelae
P. l. rupinus
P. l. lanei
Källor
Geckoödlor
lanei | swedish | 1.398029 |
Pony/4_control-structures.txt | # Control Structures
To do real work in a program you have to be able to make decisions, iterate through collections of items and perform actions repeatedly. For this, you need control structures. Pony has control structures that will be familiar to programmers who have used most languages, such as `if`, `while` and `for`, but in Pony, they work slightly differently.
## Conditionals
The simplest control structure is the good old `if`. It allows you to perform some action only when a condition is true.
In Pony it looks like this:
```pony
if condition then
control_body
end
```
Here is a simple example:
```pony
if a > b then
env.out.print("a is bigger")
end
```
Often the condition may be composed of many sub conditions connected by `and` and `or`.
`and` is the same as `&&` in C and `and` in python, and `or` is the same as `||` in C and `or` in python.
__Can I use integers and pointers for the condition like I can in C?__ No. In Pony `if` conditions must have type `Bool`, i.e. they are always true or false. If you want to test whether a number `a` is not 0, then you need to explicitly say `a != 0`. This restriction removes a whole category of potential bugs from Pony programs.
If you want some alternative code for when the condition fails just add an `else`:
```pony
if a > b then
env.out.print("a is bigger")
else
env.out.print("a is not bigger")
end
```
Often you want to test more than one condition in one go, giving you more than two possible outcomes. You can nest `if` statements, but this quickly gets ugly:
```pony
if a == b then
env.out.print("they are the same")
else
if a > b then
env.out.print("a is bigger")
else
env.out.print("b bigger")
end
end
```
As an alternative Pony provides the `elseif` keyword that combines an `else` and an `if`. This works the same as saying `else if` in other languages and you can have as many `elseif`s as you like for each `if`.
```pony
if a == b then
env.out.print("they are the same")
elseif a > b then
env.out.print("a is bigger")
else
env.out.print("b bigger")
end
```
__Why can't I just say "else if" like I do in C? Why the extra keyword?__ The relationship between `if` and `else` in C, and other similar languages, is ambiguous. For example:
```c
// C code
if(a)
if(b)
printf("a and b\n");
else
printf("not a\n");
```
Here it is not obvious whether the `else` is an alternative to the first or the second `if`. In fact here the `else` relates to the `if(b)` so our example contains a bug. Pony avoids this type of bug by handling `if` and `else` differently and the need for `elseif` comes out of that.
## Control structures are expressions
The big difference for control structures between Pony and other languages is that in Pony everything is an expression. In languages like C++ and Java `if` is a statement, not an expression. This means that you can't have an `if` inside an expression, there has to be a separate conditional operator '?'.
In Pony control flow statements like this are all expressions that hand back a value. Your `if` statement hands you back a value. Your `for` loop (which we'll get to a bit later) hands you back a value.
This means you can use `if` directly in a calculation:
```pony
x = 1 + if lots then 100 else 2 end
```
This will give __x__ a value of either 3 or 101, depending on the variable __lots__.
If the `then` and `else` branches of an `if` produce different types then the `if` produces a __union__ of the two.
```pony
var x: (String | Bool) =
if friendly then
"Hello"
else
false
end
```
__But what if my if doesn't have an else?__ Any `else` branch that doesn't exist gives an implicit `None`.
```pony
var x: (String | None) =
if friendly then
"Hello"
end
```
The same rules that apply to the value of an `if` expression applies to loops as well. Let's take a look at what a loop value would look like:
```pony
actor Main
new create(env: Env) =>
var x: (String | None) =
for name in ["Bob"; "Fred"; "Sarah"].values() do
name
end
match x
| let s: String => env.out.print("x is " + s)
| None => env.out.print("x is None")
end
```
This will give __x__ the value "Sarah" as it is the last name in our list. If our loop has 0 iterations, then the value of its `else` block will be the value of __x__. Or if there is no `else` block, the value will be `None`.
```pony
actor Main
new create(env: Env) =>
var x: (String | None) =
for name in Array[String].values() do
name
end
match x
| let s: String => env.out.print("x is " + s)
| None => env.out.print("x is None")
end
```
Here __x__ would be `None`.
You can also avoid needing `None` at all by providing a __default value__ for when the loop has __0 iterations__ by providing an `else` block.
```pony
actor Main
new create(env: Env) =>
var x: String =
for name in Array[String].values() do
name
else
"no names!"
end
env.out.print("x is " + x)
```
And finally, here the value of __x__ is "no names!"
## Loops
`if` allows you to choose what to do, but in order to do something more than once, you want a loop.
### While
Pony `while` loops are very similar to those in other languages. A condition expression is evaluated and if it's true we execute the code inside the loop. When we're done we evaluate the condition again and keep going until it's false.
Here's an example that prints out the numbers 1 to 10:
```pony
var count: U32 = 1
while count <= 10 do
env.out.print(count.string())
count = count + 1
end
```
Just like `if` expressions, `while` is also an expression. The value returned is just the value of the expression inside the loop the last time we go round it. For this example that will be the value given by `count = count + 1` when count is incremented to 11. Since Pony assignments hand back the _old_ value our `while` loop will return 10.
__But what if the condition evaluates to false the first time we try, then we don't go round the loop at all?__ In Pony `while` expressions can also have an `else` block. In general, Pony `else` blocks provide a value when the expression they are attached to doesn't. A `while` doesn't have a value to give if the condition evaluates to false the first time, so the `else` provides it instead.
__So is this like an else block on a while loop in Python?__ No, this is very different. In Python, the `else` is run when the `while` completes. In Pony the `else` is only run when the expression in the `while` isn't.
### Break
Sometimes you want to stop part-way through a loop and give up altogether. Pony has the `break` keyword for this and it is very similar to its counterpart in languages like C++, C#, and Python.
`break` immediately exits from the innermost loop it's in. Since the loop has to return a value `break` can take an expression. This is optional, and if it's left out, the value from the `else` block is returned.
Let's have an example. Suppose you want to go through a list of names, looking for either "Jack" or "Jill". If neither of those appear, you'll just take the last name you're given, and if you're not given any names at all, you'll use "Herbert".
```pony
var name =
while moreNames() do
var name' = getName()
if name' == "Jack" or name' == "Jill" then
break name'
end
name'
else
"Herbert"
end
```
So first we ask if there are any more names to get. If there are then we get a name and see if it's "Jack" or "Jill". If it is we're done and we break out of the loop, handing back the name we've found. If not we try again.
The line `name'` appears at the end of the loop so that will be our value returned from the last iteration if neither "Jack" nor "Jill" is found.
The `else` block provides our value of "Herbert" if there are no names available at all.
__Can I break out of multiple, nested loops like the Java labeled break?__ No, Pony does not support that. If you need to break out of multiple loops you should probably refactor your code or use a worker function.
### Continue
Sometimes you want to stop part-way through one loop iteration and move onto the next. Like other languages, Pony uses the `continue` keyword for this.
`continue` stops executing the current iteration of the innermost loop it's in and evaluates the condition ready for the next iteration.
If `continue` is executed during the last iteration of the loop then we have no value to return from the loop. In this case, we use the loop's `else` expression to get a value. As with the `if` expression, if no `else` expression is provided, `None` is returned.
__Can I continue an outer, nested loop like the Java labeled continue?__ No, Pony does not support that. If you need to continue an outer loop you should probably refactor your code.
### For
For iterating over a collection of items Pony uses the `for` keyword. This is very similar to `foreach` in C#, `for`..`in` in Python and `for` in Java when used with a collection. It is very different to `for` in C and C++.
The Pony `for` loop iterates over a collection of items using an iterator. On each iteration, round the loop, we ask the iterator if there are any more elements to process, and if there are, we ask it for the next one.
The format of `for` loop looks like that:
```pony
for loop_var in collection_iterator do
loop_body
end
```
For example, to print out all the strings in an array:
```pony
for name in ["Bob"; "Fred"; "Sarah"].values() do
env.out.print(name)
end
```
Note the call to `values()` on the array — this is because the loop needs an iterator, not an array.
Like python, pony also support iterating over both index and value like python `enumerate`, like this:
```pony
for (index, value) in ["Bob"; "Fred"; "Sarah"].pairs() do
env.out.print("(" + index.string() + ", " + value + ")")
end
```
The iterator does not have to be of any particular type, but needs to provide the following methods:
```pony
fun has_next(): Bool
fun next(): T?
```
where T is the type of the objects in the collection. You don't need to worry about this unless you're writing your own iterators. To use existing collections, such as those provided in the standard library, you can just use `for` and it will all work. If you do write your own iterators, note that we use structural typing, so your iterator doesn't need to declare that it provides any particular type.
You can think of the above example as being equivalent to:
```pony
let iterator = ["Bob"; "Fred"; "Sarah"].values()
while iterator.has_next() do
let name = iterator.next()?
env.out.print(name)
end
```
Note that the variable __name__ is declared _let_, so you cannot assign to the control variable within the loop.
__Can I use break and continue with for loops?__ Yes, `for` loops can have `else` expressions attached and can use `break` and `continue` just as for `while`.
### Repeat
The final loop construct that Pony provides is `repeat` `until`. Here we evaluate the expression in the loop and then evaluate a condition expression to see if we're done or we should go round again.
This is similar to `do` `while` in C++, C# and Java, except that the termination condition is reversed; i.e. those languages terminate the loop when the condition expression is false, but Pony terminates the loop when the condition expression is true.
The differences between `while` and `repeat` in Pony are:
1. We always go around the loop at least once with `repeat`, whereas with `while` we may not go round at all.
2. The termination condition is reversed.
Suppose we're trying to create something and we want to keep trying until it's good enough:
```pony
actor Main
new create(env: Env) =>
var counter = U64(1)
repeat
env.out.print("hello!")
counter = counter + 1
until counter > 7 end
```
Just like `while` loops, the value given by a `repeat` loop is the value of the expression within the loop on the last iteration, and `break` and `continue` can be used.
__Since you always go round a repeat loop at least once, do you ever need to give it an else expression?__ Yes, you may need to. A `continue` in the last iteration of a `repeat` loop needs to get a value from somewhere, and an `else` expression is used for that.
| pony | 6672676 | https://sv.wikipedia.org/wiki/Busy-waiting | Busy-waiting | Busy-waiting, busy-looping eller spinning är en teknik där en process upprepade gånger kontrollerar om ett tillstånd gäller, exempelvis om en tangentbordsinmatning eller ett datorlås finns tillgängligt. Spinning kan även användas för att generera en godtycklig fördröjning, en teknik som var nödvändig på system som saknade en metod för att vänta en specifik tidslängd. Processorhastigheter varierar kraftigt mellan datorer, speciellt då en del processorer är utformade för att dynamiskt justera hastigheten baserat på externa faktorer, som exempelvis belastningen på operativsystemet. Därför kan spinning som en tidsfördröjningsteknik ofta producera oförutsägbara eller t.o.m. inkonsistenta resultat såvida koden är implementerad för att bestämma hur snabbt processorn kan köra en tom loop, eller om loopkoden kollar en realtidsklocka.
Spinning kan vara en bra strategi i vissa förhållanden, i synnerhet för implementationen av spinlock inom operativsystem som är byggda att köras på SMP-system. I allmänhet ses spinning som ett antimönster och bör undvikas då processortiden skulle kunna användas för att utföra en annan uppgift istället för att slösa på den på en meningslös aktivitet.
Exempel i C
Följande kod skriven i C illustrerar två trådar som delar ett globalt heltal i. Den första tråden använder busy-waiting för att kolla efter en ändring i värdet för i:
#include <stdio.h>
#include <pthread.h>
#include <unistd.h>
#include <stdlib.h>
volatile int i = 0; /* i är global, så den är synlig för alla funktioner.
Den är även volatile, eftersom den
kanske ändras på ett sätt som kompilatorn inte kan förutspå,
här ifrån en annan tråd. */
/* f1 använder ett spinlock för att vänta på i att ska ändras från 0. */
static void *f1(void *p)
{
while (i==0) {
/* gör ingenting - fortsätt vänta om och om igen */
}
printf("i's value has changed to %d.\n", i);
return NULL;
}
static void *f2(void *p)
{
sleep(60); /* vila i 60 sekunder */
i = 99;
printf("t2 has changed the value of i to %d.\n", i);
return NULL;
}
int main()
{
int rc;
pthread_t t1, t2;
rc = pthread_create(&t1, NULL, f1, NULL);
if (rc != 0) {
fprintf(stderr,"pthread f1 failed\n");
return EXIT_FAILURE;
}
rc = pthread_create(&t2, NULL, f2, NULL);
if (rc != 0) {
fprintf(stderr,"pthread f2 failed\n");
return EXIT_FAILURE;
}
pthread_join(t1, NULL);
pthread_join(t2, NULL);
puts("All pthreads finished.");
return 0;
}
I ett fall som detta kan C11:s condition variable användas istället.
Källor
Se även
Polla (mikroprocessor)
Externa länkar
Beskrivning från The Open Group Base Specifications Issue 6, IEEE Std 1003.1, 2004 Edition
Artikeln "User-Level Spin Locks - Threads, Processes & IPC" av Gert Boddaert
Austria SpinLock Class Reference
Antimönster | swedish | 0.765717 |
Pony/callbacks.txt | # Callbacks
Some C APIs let the programmer specify functions that should be called to do pieces of work. For example, the SQLite API has a function called `sqlite3_exec` that executes an SQL statement and calls a function given by the programmer on each row returned by that statement. The functions that are supplied by the programmer are known as "callback functions". Some specific Pony functions can be passed as callback functions.
## Bare functions
Classic Pony functions have a receiver, which acts as an implicit argument to the function. Because of this, classic functions can't be used as callbacks with many C APIs. Instead, you can use _bare functions_, which are functions with no receiver.
You can define a bare function by prefixing the function name with the @ symbol.
```pony
class C
fun @callback() =>
...
```
The function can then be passed as a callback to a C API with the `addressof` operator.
```pony
@setup_callback(addressof C.callback)
```
Note that it is possible to use an object reference instead of a type as the left-hand side of the method access.
Since bare methods have no receiver, they cannot reference the `this` identifier in their body (either explicitly or implicitly through field access), cannot use `this` viewpoint adapted types, and cannot specify a receiver capability.
## Bare lambdas
Bare lambdas are special lambdas defining bare functions. A bare lambda or bare lambda type is specified using the same syntax as other lambda types, with the small variation that it is prefixed with the @ symbol. The underlying value of a bare lambda is equivalent to a C function pointer, which means that a bare lambda can be directly passed as a callback to a C function. The partial application of a bare method yields a bare lambda.
```pony
let callback = @{() => ... }
@setup_callback(callback)
```
Bare lambdas can also be used to define structures containing function pointers. For example:
```pony
struct S
var fun_ptr: @{()}
```
This Pony structure is equivalent to the following C structure:
```c
struct S
{
void(*fun_ptr)();
};
```
In the same vein as bare functions, bare lambdas cannot specify captures, cannot use `this` neither as an identifier nor as a type, and cannot specify a receiver capability. In addition, a bare lambda object always has a `val` capability.
Classic lambda types and bare lambda types can never be subtypes of each other.
## An example
Consider SQLite, mentioned earlier. When the client code calls `sqlite3_exec`, an SQL query is executed against a database, and the callback function is called for each row returned by the SQL statement. Here's the signature for `sqlite3_exec`:
```c
typedef int (*sqlite3_callback)(void*,int,char**, char**);
...
SQLITE_API int SQLITE_STDCALL sqlite3_exec(
sqlite3 *db, /* The database on which the SQL executes */
const char *zSql, /* The SQL to be executed */
sqlite3_callback xCallback, /* Invoke this callback routine */
void *pArg, /* First argument to xCallback() */
char **pzErrMsg /* Write error messages here */
)
{
...
xCallback(pArg, nCol, azVals, azCols)
...
}
```
`sqlite3_callback` is the type of the callback function that will be called by `sqlite3_exec` for each row returned by the `sql` statement. The first argument to the callback function is the pointer `pArg` that was passed to `sqlite3_exec`, the second argument is the number of columns in the row being processed, the third argument is data for each column, and the fourth argument is the name of each column.
Here's the skeleton of some Pony code that uses `sqlite3_exec` to query an SQLite database, with examples of both the bare method way and the bare lambda way:
```pony
use @sqlite3_exec[I32](db: Pointer[None] tag, sql: Pointer[U8] tag,
callback: Pointer[None], data: Pointer[None], err_msg: Pointer[Pointer[U8] tag] tag)
class SQLiteClient
fun client_code() =>
...
@sqlite3_exec(db, sql.cstring(), addressof this.method_callback,
this, addressof zErrMsg)
...
fun @method_callback(client: SQLiteClient, argc: I32,
argv: Pointer[Pointer[U8]], azColName: Pointer[Pointer[U8]]): I32
=>
...
```
```pony
use @sqlite3_exec[I32](db: Pointer[None] tag, sql: Pointer[U8] tag,
callback: Pointer[None], data: Pointer[None], err_msg: Pointer[Pointer[U8] tag] tag)
class SQLiteClient
fun client_code() =>
...
let lambda_callback =
@{(client: SQLiteClient, argc: I32, argv: Pointer[Pointer[U8]],
azColName: Pointer[Pointer[U8]]): I32
=>
...
}
@sqlite3_exec(db, sql.cstring(), lambda_callback, this,
addressof zErrMsg)
...
```
Focusing on the callback-related parts, the callback function is passed using `addressof this.method_callback` (resp. by directly passing the bare lambda) as the third argument to `sqlite3_exec`. The fourth argument is `this`, which will end up being the first argument when the callback function is called. The callback function is called in `sqlite3_exec` by the call to `xCallback`.
| pony | 279758 | https://no.wikipedia.org/wiki/Ruby | Ruby | Ruby er et objektorientert programmeringsspråk som kombinerer syntaks inspirert av Perl med Smalltalks objektorienterte egenskaper. Språket deler også egenskaper med Python, Lisp, Dylan og CLU. Det er et tolket programmeringsspråk. Hovedimplementasjonen er fri programvare.
Historie
Språket ble lagd av Yukihiro "Matz" Matsumoto, som startet jobben med Ruby den 24. februar 1993 og lanserte språket i 1995. Navnet «Ruby» ble valgt som en litt humoristisk referanse til Perl.
Ruby har blitt spesielt populært i webprogrammeringsmiljøer takket være utviklingsmiljøet Ruby on Rails.
Filosofi
Ifølge skaperen ble Ruby utformet etter prinsippet om færrest mulige overraskelser. Med dette mener han at språket skal være fritt for feller og inkonsekvenser som preger andre språk.
Ruby er objektorientert, som vil si at alle databiter er et objekt. Dette omfatter typer, som andre språk ofte definerer som primitive datatyper, som for eksempel et heltall. Hver funksjon er en metode. Alle variabler er en referanse til et objekt, og ikke objektet selv. Ruby støtter arv og import av moduler som såkalte MixIns (å endre deler av funksjonaliteten i en klasse). Prosedyre-syntaks er inkludert, men alle slike prosedyrer skrevet utenfor en selvdefinert klasse blir gjort på klassen av type Object. Siden denne klassen er forelder til alle andre klasser, blir slike prosedyrer synlige for alle klasser og objekter.
Implementasjoner
Det finnes flere vanlige implementasjoner av Ruby. Den offisielle Ruby-tolkeren, ofte kalt MRI (Matz’ Ruby Implementation), er den mest utbredte etter Ruby versjon 1.9 (denne basert på YARV, en virtuell maskin-implementasjon som skal gi høyere ytelse).
JRuby er en versjon basert på Javas virtuelle maskin. Denne integreres lett med Java-baserte tjenerløsninger som for eksempel Tomcat og Glassfish, og kan sømløst kalle Java-API-er fra Ruby og vice versa.
Tilsvarende finnes også IronRuby, som kjører på .NET-/Mono-plattformen. Rubinius er en implementasjon basert på LLVM som virtuell maskin. Også MacRuby er basert på LLVM, men er kun tilgjengelig for Apples eget operativsystem, macOS. MacRuby har som mål å være et alternativ til Objective-C som utviklingsmiljø på Mac.
Lisensiering
Ruby blir distribuert under GPL og Ruby License . De øvrige implementasjonene distribueres under en rekke forskjellige lisenser for åpen kildekode.
Egenskaper
Objektorientert
Avvikshåndtering
Iteratorer
Å sende blokker av kode som parameter
Closures
Overstyring av operatorer
Automatisk fjerning av objekt som ikke lenger er i bruk (garbage collection)
Flertrådshandtering
Lasting av DLL-bibliotek (under Microsoft Windows)
Introspection og reflection.
Stort standardbibliotek.
Støtter innsetting av avhengigheter.
Ruby er objektorientert
Ruby støtter utvikling basert på klasser, og klasser kan arve hverandre:
class Person
def set_name(n)
@name = n
end
def name
@name
end
end
class Worker < Person
def set_title(t)
@title = t
end
def title
@title
end
end
Vi kan nå instansiere en arbeider slik:
w = Worker.new
w.set_name("Petter")
w.set_title("Overbuljongterningpakkmesterassistent")
Siden arbeideren er en person, har han et navn:
w.name
=> "Petter"
Han har også en tittel:
w.title
=> "Overbuljongterningpakkmesterassistent"
Vi kan spørre om objektet (arbeideren vår) er av en gitt klasse:
w.instance_of? Worker
=> true
Vi kan også spørre om objekter er av, eller arvet av en gitt klasse:
w.is_a? Person
=> true
Klasser som ikke oppgir en moderklasse arver automatisk klassen Object. Ruby støtter ikke multippel arv, men gjør bruk av såkalte mixins som lar en klasse gjøre bruk av andre klasser selv om de ikke arver dem direkte.
Ruby støtter avvikshåndtering
Ruby definerer en rekke avviksklasser, og støtter også brukerdefinerte avvik. Avvik fanges opp av en rescue-linje i en begin – end-blokk, eller i en metodedefinisjon:
MyError = Class.new(RuntimeError)
def smell
raise MyError.new("Pang!")
end
def safe_method
smell
puts "Denne linjen vil aldri kjøres..."
rescue RuntimeError => ex
puts ex.message
puts ex.class
end
Kjører vi safe_method vil ruby svare slik:
Pang!
MyError
Kjører vi imidlertid smell direkte, så fanger vi ikke feilen og ruby skriver ut feilinformasjon og avslutter programmet.
Ruby mangler, per dags dato, full støtte for Unicode, men har delvis støtte for UTF-8. I versjon 2.0 er målet full støtte av unicode-strenger.
Mulige overraskelser
Selv om Ruby er utformet etter prinsippet om færrest mulige overraskelser er det store forskjeller fra andre språk som C og Perl.
Lokale variabler må ha navn som starter med små bokstaver, ellers blir de betraktet som konstanter.
0, "" (tom streng) og [] (tom liste/array) evalueres til sant (true). I C blir uttrykket 0 ? 1 : 0 tolket som 0. I Ruby blir dette tolket som 1.
For å indikere flyttall er det ikke nok å legge til et punktum (99.). Fordi nummer kan forveksles med metoder må man legge til en ekstra null (99.0) eller oppgi konverteringen eksplisitt (99.to_f).
Det er ingen egen datatype for skrifttegn. I Ruby versjon 1.8 og tidligere kunne dette føre til et uventet resultat ved avkutting av strenger: ”abc”[0] ga 97 som er den numeriske ASCII-koden for det første tegnet i strengen. I Ruby versjon 1.9 og senere gir dette resultatet "a" som er mer som ventet.
Eksempler
Et klassisk Hello World-eksempel:
puts "Hello World!"
Litt grunnleggende Ruby-kode:
# Alt er objekter
-199.abs # 199
"ruby is cool".length # 12
"Rick".index("c") # 2
"Nice Day Isn't It?".split(//).uniq.sort.join # " '?DINaceinsty"
Lister
Et array:
a =[1, 'hi', 3.14, 1, 2, [4, 5]]
a[2] # 3.14
a.reverse # [[4, 5], 2, 1, 3.14, "hi", 1]
a.flatten.uniq # [1, "hi", 3.14, 2, 4, 5]
En hash-tabell:
hash = {'water' => 'wet', 'fire' => 'hot'}
puts hash['fire']
hash.each_pair do |key, value|
puts "#{key} is #{value}"
end
# Skriver ut: water is wet
# fire is hot
hash.delete_if {|key, value| key == 'water'} # Sletter 'water' => 'wet'
Blokker og iteratorer
To måter å opprette en kodeblokk:
{puts "Hello, World!"}
do puts "Hello, World!" end
Sende en blokk som parameter:
def remember &p
@block =p
end
# Sender med en kodeblokk som parameter og navngir den
remember {|name| puts "Hello, " + name + "!"}
# Kall funksjonen
@block.call("Johnny")
# Skriver ut "Hello, Johnny!"
Iterere over array og enumeratorer:
a =[1, 'hi', 3.14]
a.each {|item| puts item} # Skriver ut hvert element
(3..6).each {|num| puts num} # Skriver ut 1 -6.
Blokker fungerer med mange innebygde metoder:
IO.readlines('file.txt') do |line|
# gjør noe med linjen her.
end
Kvadrere 1 til 10:
(1..10).collect {|x| x*x} => [1, 4, 9, 16, 25, 36, 49, 64, 81, 100]
Klasser
Følgende kode definerer klassen Person. I tillegg til å initialisere den vanlige konstruktøren, har klassen to metoder: En for å overstyre <=>-operatoren for å sortere etter alder. Den andre overstyrer to_s for å få korrekt formatering.
class Person
def initialize(name, age)
@name, @age = name, age
end
def <=>(person)
@age <=> person.age
end
def to_s
"#{@name} (#{@age})"
end
attr_reader :name, :age
end
group = [ Person.new("John", 20),
Person.new("Markus", 63),
Person.new("Ash", 16)
]
puts group.sort.reverse
Koden over skriver ut en liste sortert med den eldste først:
Markus (63)
John (20)
Ash (16)
Referanser
Eksterne lenker
Ruby Application Archive (RAA)
JRuby
The Ruby Documentation project
Ruby Forum
RubyForge
Norske ruby klubb
Full Ruby on Rails Tutorial | norwegian_bokmål | 0.692016 |
Pony/term-ReadlineNotify-.txt |
ReadlineNotify¶
[Source]
Notifier for readline.
interface ref ReadlineNotify
Public Functions¶
apply¶
[Source]
Receives finished lines. The next prompt is set by fulfilling the promise.
If the promise is rejected, readline will stop handling input.
fun ref apply(
line: String val,
prompt: Promise[String val] tag)
: None val
Parameters¶
line: String val
prompt: Promise[String val] tag
Returns¶
None val
tab¶
[Source]
Return tab completion possibilities.
fun ref tab(
line: String val)
: Seq[String val] box
Parameters¶
line: String val
Returns¶
Seq[String val] box
| pony | 41631 | https://sv.wikipedia.org/wiki/Javascript | Javascript | Javascript, i marknadsföringssyfte skrivet JavaScript och förkortat JS, är ett prototyp-baserat skriptspråk som är dynamiskt, svagt typat och hanterar funktioner som första-klass-objekt. Javascript används främst på klientsidan i webbtillämpningar, det vill säga exekveras i en webbläsares Javascriptmotor. Då Javascript används i webbläsare arbetar det mot ett gränssnitt som kallas Document Object Model (DOM). Vanligtvis inbäddas Javascript i, eller inkluderas från, HTML-sidor. Exempel på användningsområden är kontroll av ifyllda fält innan formulär skickas till en server, funktioner för att visa eller dölja delar av en sida och växling av annonsbilder med visst intervall. Javascript kan även användas för mer avancerade funktioner i en webbläsare såsom spel och bildbehandling.
Skriptspråket kan implementeras i andra program än webbläsare. Ett numera vanligt exempel av implementation utanför webbläsaren är Node.js, som tillåter utvecklaren att använda Javascript på serversidan för att kunna arbeta med anslutningar till databaser, skicka e-post-meddelanden och så vidare.
En Javascriptmotor är en specialiserad programvara som exekverar Javascript, särskilt för webbläsare.
Historia och namngivning
Javascript utvecklades ursprungligen av Brendan Eich, då under namnet Mocha som senare ändrades först till Livescript men i och med att Netscape ungefär samtidigt började stödja Sun Microsystems programspråk Java i syfte att kunna ha miniprogram i webbläsaren, valde man att kalla det Javascript, främst i marknadsföringssyfte. Förutom namnet har Javascript inget med programspråket Java att göra förutom att de delar programspråket C:s syntax. Det faktum att namnen liknar varandra har lett till en del förvirring.
Javascript dök för första gången upp i Netscape Navigator 2.0B3, släppt i december 1995.
Microsoft skapade en egen variant av Javascript, som namngavs JScript för att undvika varumärkesintrång. Denna kom i version 3.0 av Internet Explorer. JScript och Javascript skilde sig markant på inbyggda objekt och funktioner vilket ledde fram till behovet av en gemensam standard för skriptspråket, standarden kom att kallas för ECMA-262, även känt som Ecmascript.
Kodexempel
Javascript-koden i detta exempel är inbäddad i HTML-koden med hjälp av en script-tagg och skriver ut texten "Hello, World!":
<script>
console.log('Hello, World!');
</script>
Man kan även skapa en funktion på följande vis.
<script>
function minFunktion() {
console.log('Hello, World!');
}
</script>
Funktionen kan sedan anropas via ett HTML-element, exempelvis genom att klicka på en hyperlänk.
<a href="#" id="link">Klicka här för att köra funktionen</a>
<script>
document.querySelector('#link').addEventListener('click', minFunktion);
</script>
Async/Await och löften
Javascript stöder async/await och löften för att utföra asynkrona operationer. Kombinationsmetoder för flera löften infördes nyligen i Javascript-specifikationen. De möjliggör kombinationen av flera löften, och utföringen av olika operationer beroende på situationen. De införda metoderna är: Promise.race, Promise.all, Promise.allSettled och Promise.any. Exempel på Promise.all:
let löfte1 = fetch(länk);
let löfte2 = 35;
Promise.all([
löfte1,
löfte2
])
.then((data) => {
console.log(data)
})
.catch((err) => {
console.log(err)
});
Syntax
Javascript stöder det mesta av syntaxen i C (till exempel if-satser, while-slingor, switch-satser, osv.).
Som i de flesta skriptspråk är variabeltyper inte knutna till variabeln själv, utan snarare till dess värde. Till exempel så kan variabeln x vara en sträng som innehåller siffror. Det betraktas då inte som ett tal, utan just som en sträng. Den strängen kan sedan konverteras till ett tal dynamiskt, t.ex:
// En funktion så att vi slipper upprepning av kod
function tala_om_variabel_typ(x) {
console.log('Variabeln x är av typen "'+typeof(x)+'" och innehåller värdet ('+x+').');
}
var x = "123"; // Tilldela x en sträng med tecken "1", "2" och "3".
tala_om_variabel_typ(x);
// Detta trick konverterar en sträng med siffror till ett tal.
x-=0; // x=+x fungerar lika bra.
tala_om_variabel_typ(x);
Vilket ger resultatet:Variabeln x är av typen "string" och innehåller värdet (123).
Variabeln x är av typen "number" och innehåller värdet (123).
Javascript stöder olika sätt att testa vilken typ av variabel det handlar om. Man kan även skriva funktioner i Javascript-koden som man kan kalla på senare i HTML-koden.
Till exempel:
<script>
function bytBild() {
document.images["bild"].src = "bild2.jpg";
return true;
}
</script>
Koden ovanför innebär att om funktionen "bytBild" kallas i HTML-koden så kommer bilden med namnet "bild" att ändras till bilden "bild2.jpg". Detta kan vara användbart om man vill göra en knapp som ska se annorlunda ut när man håller musen över den.
Skriptbibliotek och ramverk
För att förenkla användandet av Javascript, DOM och för att undvika återuppfinnandet av hjulet (d.v.s. att man i onödan skriver sådan kod som andra redan har skapat) har erfarna programmerare skrivit Javascript-bibliotek som innehåller funktioner och objekt som man kan återanvända.
Lista på några Javascript-bibliotek och ramverk
Prototypejs
script.aculo.us
Dojo Toolkit
Mochikit
Jquery
Mootools
React
React är ett fritt "front-end" Javascript-bibliotek, som används bl.a. för att bygga enkelsidiga applikationer eller mobilapplikationer med hjälp av React Native. React använder sig ofta av diverse andra bibliotek för att möjligöra mera funktionalitet.
Angular
Angular är ett TypeScript-baserat webb-ramverk för att också bygga enkelsidiga applikationer.
Liknande programspråk
C++
C (programspråk)
Java
Basic
Se även
Ecmascript
JScript
AJAX
JSON
Jaxer
Jquery
Källor
Externa länkar
Javascript
Prototyp-baserade programspråk
Objekt-baserade programspråk
Domänspecifika programspråk | swedish | 0.891813 |
Pony/src-builtin-env-.txt |
env.pony
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104use @pony_os_stdin_setup[Bool]()
use @pony_os_stdout_setup[None]()
class val Env
"""
An environment holds the command line and other values injected into the
program by default by the runtime.
"""
let root: AmbientAuth
"""
The root capability.
"""
let input: InputStream
"""
Stdin represented as an actor.
"""
let out: OutStream
"""Stdout"""
let err: OutStream
"""Stderr"""
let args: Array[String] val
"""The command line used to start the program."""
let vars: Array[String] val
"""The program's environment variables."""
let exitcode: {(I32)} val
"""
Sets the environment's exit code. The exit code of the root environment will
be the exit code of the application, which defaults to 0.
"""
new _create(
argc: U32,
argv: Pointer[Pointer[U8]] val,
envp: Pointer[Pointer[U8]] val)
=>
"""
Builds an environment from the command line. This is done before the Main
actor is created.
"""
root = AmbientAuth._create()
@pony_os_stdout_setup()
input = Stdin._create(@pony_os_stdin_setup())
out = StdStream._out()
err = StdStream._err()
args = _strings_from_pointers(argv, argc.usize())
vars = _strings_from_pointers(envp, _count_strings(envp))
exitcode = {(code: I32) => @pony_exitcode(code) }
new val create(
root': AmbientAuth,
input': InputStream, out': OutStream,
err': OutStream, args': Array[String] val,
vars': Array[String] val,
exitcode': {(I32)} val)
=>
"""
Build an artificial environment. A root capability must be supplied.
"""
root = root'
input = input'
out = out'
err = err'
args = args'
vars = vars'
exitcode = exitcode'
fun tag _count_strings(data: Pointer[Pointer[U8]] val): USize =>
if data.is_null() then
return 0
end
var i: USize = 0
while
let entry = data._apply(i)
not entry.is_null()
do
i = i + 1
end
i
fun tag _strings_from_pointers(
data: Pointer[Pointer[U8]] val,
len: USize)
: Array[String] iso^
=>
let array = recover Array[String](len) end
var i: USize = 0
while i < len do
let entry = data._apply(i = i + 1)
array.push(recover String.copy_cstring(entry) end)
end
array
| pony | 287197 | https://no.wikipedia.org/wiki/Scalable%20Vector%20Graphics | Scalable Vector Graphics | Scalable Vector Graphics (SVG) er et XML-basert filformat for markeringsspråk som beskriver todimensjonal vektorgrafikk. Det er en åpen standard utviklet og vedlikeholdt av World Wide Web Consortium.
Eksempel
Siden SVG-filer kun er tekst, tar de ikke så mye plass og kan redigeres med en vanlig teksteditor om ønskelig. Her er et eksempel på en svg-fil:
<?xml version="1.0" encoding="ASCII" standalone="yes"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
version="1.0" width="520" height="520">
<style type="text/css">
<![CDATA[
path {
fill-opacity:1;stroke:none;stroke-width:1px;stroke-linejoin:miter;stroke-opacity:1
}
]]>
</style>
<defs>
<linearGradient id="dk">
<stop style="stop-color:black;stop-opacity:1" offset="0"/>
<stop style="stop-color:black;stop-opacity:0" offset="1"/>
</linearGradient>
<linearGradient id="lt">
<stop style="stop-color:#ffe681;stop-opacity:1" offset="0"/>
<stop style="stop-color:#ffe681;stop-opacity:0" offset="1"/>
</linearGradient>
<linearGradient x1="136.4" y1="136.4" x2="167.5" y2="167.5" id="tl" xlink:href="#lt" gradientUnits="userSpaceOnUse"/>
<linearGradient x1="136.4" y1="383.6" x2="167.5" y2="352.5" id="bl" xlink:href="#lt" gradientUnits="userSpaceOnUse"/>
<linearGradient x1="383.6" y1="383.6" x2="352.5" y2="352.5" id="br" xlink:href="#dk" gradientUnits="userSpaceOnUse"/>
<linearGradient x1="383.6" y1="136.4" x2="352.5" y2="167.5" id="tr" xlink:href="#dk" gradientUnits="userSpaceOnUse"/>
</defs>
<path style="fill:#d4a000;stroke:black;stroke-width:9" d="M 260,6.3 L 6.3,260 L 260,513.7 L 513.7,260 L 260,6.3 z"/>
<text style="font-size:362px;font-weight:bold;font-family:Times New Roman, serif" y="380" x="200">!</text>
<path style="fill:url(#tl)" d="M 260,12.7 L 260,75 L 75,260 L 12.7,260 L 260,12.7 z"/>
<path style="fill:url(#bl)" d="M 260,507.3 L 260,445 L 75,260 L 12.7,260 L 260,507.3 z"/>
<path style="fill:url(#br)" d="M 260,507.3 L 260,445 L 445,260 L 507.3,260 L 260,507.3 z"/>
<path style="fill:url(#tr)" d="M 260,12.7 L 260,75 L 445,260 L 507.3,260 L 260,12.7 z"/>
</svg>
Støtte på verdensveven
Bruk av SVG-filer på verdensveven er i dag begrenset av manglende støtte fra enkelte eldre nettlesere, hovedsakelig eldre versjoner av Internet Explorer. Mange nettsteder som bruker SVG-filer, slik som Wikipedia, gjør bildene også tilgjengelige som punktgrafikkfiler. Nyere versjoner av moderne nettlesere støtter i det minste formatets grunnleggende funksjonalitet.
Eksterne lenker
XML
Sidebeskrivelsespråk
W3C-standarder | norwegian_bokmål | 0.84516 |
Pony/src-encode-base64-base64-.txt |
base64.pony
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211"""
# Base64 package
The Base64 package contains support for doing Base64 binary-to-text encodings.
We currently have support 3 encodings: PEM, MIME and URL.
To learn more about Base64, we suggest you check out the
[wikipedia entry](https://en.wikipedia.org/wiki/Base64).
## Example code
```pony
use "encode/base64"
actor Main
new create(env: Env) =>
env.out.print(Base64.encode("foobar"))
try
env.out.print(Base64.decode[String iso]("Zm9vYmFy")?)
end
```
"""
use "collections"
use "assert"
primitive Base64
fun encode_pem(data: ReadSeq[U8]): String iso^ =>
"""
Encode for PEM (RFC 1421).
"""
encode(data, '+', '/', '=', 64)
fun encode_mime(data: ReadSeq[U8]): String iso^ =>
"""
Encode for MIME (RFC 2045).
"""
encode(data, '+', '/', '=', 76)
fun encode_url[A: Seq[U8] iso = String iso](
data: ReadSeq[U8],
pad: Bool = false)
: A^
=>
"""
Encode for URLs (RFC 4648). Padding characters are stripped by default.
"""
let c: U8 = if pad then '=' else 0 end
encode[A](data, '-', '_', c)
fun encode[A: Seq[U8] iso = String iso](
data: ReadSeq[U8],
at62: U8 = '+',
at63: U8 = '/',
pad: U8 = '=',
linelen: USize = 0,
linesep: String = "\r\n")
: A^
=>
"""
Configurable encoding. The defaults are for RFC 4648.
"""
let len = ((data.size() + 2) / 3) * 4
let out = recover A(len) end
let lineblocks = linelen / 4
var srclen = data.size()
var blocks = USize(0)
var i = USize(0)
try
while srclen >= 3 do
let in1 = data(i)?
let in2 = data(i + 1)?
let in3 = data(i + 2)?
let out1 = in1 >> 2
let out2 = ((in1 and 0x03) << 4) + (in2 >> 4)
let out3 = ((in2 and 0x0f) << 2) + (in3 >> 6)
let out4 = in3 and 0x3f
out.push(_enc_byte(out1, at62, at63)?)
out.push(_enc_byte(out2, at62, at63)?)
out.push(_enc_byte(out3, at62, at63)?)
out.push(_enc_byte(out4, at62, at63)?)
i = i + 3
blocks = blocks + 1
srclen = srclen - 3
if (lineblocks > 0) and (blocks == lineblocks) then
out.append(linesep)
blocks = 0
end
end
if srclen >= 1 then
let in1 = data(i)?
let in2 = if srclen == 2 then data(i + 1)? else 0 end
let out1 = in1 >> 2
let out2 = ((in1 and 0x03) << 4) + (in2 >> 4)
let out3 = (in2 and 0x0f) << 2
out.push(_enc_byte(out1, at62, at63)?)
out.push(_enc_byte(out2, at62, at63)?)
if srclen == 2 then
out.push(_enc_byte(out3, at62, at63)?)
else
out.push(pad)
end
out.push(pad)
end
if lineblocks > 0 then
out.append(linesep)
end
else
out.clear()
end
out
fun decode_url[A: Seq[U8] iso = Array[U8] iso](data: ReadSeq[U8]): A^ ? =>
"""
Decode for URLs (RFC 4648).
"""
decode[A](data, '-', '_')?
fun decode[A: Seq[U8] iso = Array[U8] iso](
data: ReadSeq[U8],
at62: U8 = '+',
at63: U8 = '/',
pad: U8 = '=')
: A^ ?
=>
"""
Configurable decoding. The defaults are for RFC 4648. Missing padding is
not an error. Non-base64 data, other than whitespace (which can appear at
any time), is an error.
"""
let len = (data.size() * 4) / 3
let out = recover A(len) end
var state = U8(0)
var input = U8(0)
var output = U8(0)
for i in Range(0, data.size()) do
input = data(i)?
let value =
match input
| ' ' | '\t' | '\r' | '\n' => continue
| pad => break
| at62 => 62
| at63 => 63
| if (input >= 'A') and (input <= 'Z') =>
(input - 'A')
| if (input >= 'a') and (input <= 'z') =>
((input - 'a') + 26)
| if (input >= '0') and (input <= '9') =>
((input - '0') + 52)
else
error
end
match state
| 0 =>
output = value << 2
state = 1
| 1 =>
out.push(output or (value >> 4))
output = (value and 0x0f) << 4
state = 2
| 2 =>
out.push(output or (value >> 2))
output = (value and 0x03) << 6
state = 3
| 3 =>
out.push(output or value)
state = 0
else
error
end
end
if output != 0 then
Fact(input != pad)?
match state
| 1 | 2 => out.push(output)
end
end
out
fun _enc_byte(i: U8, at62: U8, at63: U8): U8 ? =>
"""
Encode a single byte.
"""
match i
| 62 => at62
| 63 => at63
| if i < 26 => 'A' + i
| if i < 52 => ('a' - 26) + i
| if i < 62 => ('0' - 52) + i
else
error
end
| pony | 137581 | https://nn.wikipedia.org/wiki/Fibonaccif%C3%B8lgja | Fibonaccifølgja | Fibonaccifølgja er ei følgje av tal der kvart tal unntatt dei to første er summen av dei to føregåande. I sin vidaste definisjon kan dei to første tala vere kva som helst, men mest vanleg er å starte på anten 1 og 1 eller 0 og 1:
eller
.
Historie
Fibonaccifølgja har namn etter Leonardo Fibonacci sitt forsøk på å beskrive populasjonsvekst hjå ei tenkt gruppe kaninar.
Ho blei likevel omtalt mykje tidlegare. Innan gammal indisk matematikk blei ho brukt til å studera prosodi i sanskrit. Innan verselæra på sanskrit ønska ein å finna alle mønster av lange (L) stavingar som er 2 einingar lange, og korte (K) stavingar som er 1 eining lang. Tel ein dei ulike mønstera av L og K med ei viss lengd får ein fibonaccifølgja: Talet på mønster som er m korte statvingar lang er fibonaccitalet Fm + 1.
Å finne fibonaccifølgja
Følgjande program i programmeringsspråket C genererer følgja av fibonaccital som ikkje overstig den maksimale verdien av den største heiltalsdatatypen i standardbiblioteket til C99. Dei to første tala er frivillige argument på kommandolinja.
#include <stdio.h>
#include <stdint.h>
int main(int argc, char *argv[]){
uintmax_t i=1, j=1;
if(argc == 3){
i = strtoll(argv[1], NULL, 0);
j = strtoll(argv[2], NULL, 0);
}
printf("%llu", i);
do{
printf("\n%llu", j);
i = i + j;
if(i < j) break;
printf("\n%llu", i);
j = j + i;
}while(j > i);
putchar('\n');
return 0;
}
Med to eitt-tal som start og 64 bit øvre talgrense, kjem desse 93 tala ut. Dette tek omkring 2 - 10 millisekund på ein moderne PC.
1
1
2
3
5
8
13
21
34
55
89
144
233
377
610
987
1597
2584
4181
6765
10946
17711
28657
46368
75025
121393
196418
317811
514229
832040
1346269
2178309
3524578
5702887
9227465
14930352
24157817
39088169
63245986
102334155
165580141
267914296
433494437
701408733
1134903170
1836311903
2971215073
4807526976
7778742049
12586269025
20365011074
32951280099
53316291173
86267571272
139583862445
225851433717
365435296162
591286729879
956722026041
1548008755920
2504730781961
4052739537881
6557470319842
10610209857723
17167680177565
27777890035288
44945570212853
72723460248141
117669030460994
190392490709135
308061521170129
498454011879264
806515533049393
1304969544928657
2111485077978050
3416454622906707
5527939700884757
8944394323791464
14472334024676221
23416728348467685
37889062373143906
61305790721611591
99194853094755497
160500643816367088
259695496911122585
420196140727489673
679891637638612258
1100087778366101931
1779979416004714189
2880067194370816120
4660046610375530309
7540113804746346429
12200160415121876738
Kjelder
.
.
.
.
Heiltalsfølgjer
Matematiske relasjonar
Rekursjon | norwegian_nynorsk | 0.590057 |
Pony/random-Random-.txt |
Random¶
[Source]
The Random trait should be implemented by all random number generators. The
only method you need to implement is fun ref next(): 64. Once that method
has been implemented, the Random trait provides default implementations of
conversions to other number types.
trait ref Random
Constructors¶
create¶
[Source]
Create with the specified seed. Returned values are deterministic for a
given seed.
new ref create(
x: U64 val = 5489,
y: U64 val = 0)
: Random ref^
Parameters¶
x: U64 val = 5489
y: U64 val = 0
Returns¶
Random ref^
Public Functions¶
has_next¶
[Source]
If used as an iterator, this always has another value.
fun tag has_next()
: Bool val
Returns¶
Bool val
next¶
[Source]
A random integer in [0, 2^64)
fun ref next()
: U64 val
Returns¶
U64 val
u8¶
[Source]
A random integer in [0, 2^8)
fun ref u8()
: U8 val
Returns¶
U8 val
u16¶
[Source]
A random integer in [0, 2^16)
fun ref u16()
: U16 val
Returns¶
U16 val
u32¶
[Source]
A random integer in [0, 2^32)
fun ref u32()
: U32 val
Returns¶
U32 val
u64¶
[Source]
A random integer in [0, 2^64)
fun ref u64()
: U64 val
Returns¶
U64 val
u128¶
[Source]
A random integer in [0, 2^128)
fun ref u128()
: U128 val
Returns¶
U128 val
ulong¶
[Source]
A random integer in [0, ULong.max_value()]
fun ref ulong()
: ULong val
Returns¶
ULong val
usize¶
[Source]
A random integer in [0, USize.max_value()]
fun ref usize()
: USize val
Returns¶
USize val
i8¶
[Source]
A random integer in [-2^7, 2^7)
fun ref i8()
: I8 val
Returns¶
I8 val
i16¶
[Source]
A random integer in [-2^15, 2^15)
fun ref i16()
: I16 val
Returns¶
I16 val
i32¶
[Source]
A random integer in [-2^31, 2^31)
fun ref i32()
: I32 val
Returns¶
I32 val
i64¶
[Source]
A random integer in [-2^63, 2^63)
fun ref i64()
: I64 val
Returns¶
I64 val
i128¶
[Source]
A random integer in [-2^127, 2^127)
fun ref i128()
: I128 val
Returns¶
I128 val
ilong¶
[Source]
A random integer in [ILong.min_value(), ILong.max_value()]
fun ref ilong()
: ILong val
Returns¶
ILong val
isize¶
[Source]
A random integer in [ISize.min_value(), ISize.max_value()]
fun ref isize()
: ISize val
Returns¶
ISize val
int_fp_mult[optional N: ((U8 val | U16 val | U32 val | U64 val | U128 val | ULong val | USize val) & Real[N] val)]¶
[Source]
A random integer in [0, n)
fun ref int_fp_mult[optional N: ((U8 val | U16 val | U32 val |
U64 val | U128 val | ULong val |
USize val) & Real[N] val)](
n: N)
: N
Parameters¶
n: N
Returns¶
N
int[optional N: ((U8 val | U16 val | U32 val | U64 val | U128 val | ULong val | USize val) & Real[N] val)]¶
[Source]
A random integer in [0, n)
Uses fixed-point inversion if platform supports native 128 bit operations
otherwise uses floating-point multiplication.
fun ref int[optional N: ((U8 val | U16 val | U32 val |
U64 val | U128 val | ULong val |
USize val) & Real[N] val)](
n: N)
: N
Parameters¶
n: N
Returns¶
N
int_unbiased[optional N: ((U8 val | U16 val | U32 val | U64 val | U128 val | ULong val | USize val) & Real[N] val)]¶
[Source]
A random integer in [0, n)
Not biased with small values of n like int.
fun ref int_unbiased[optional N: ((U8 val | U16 val | U32 val |
U64 val | U128 val | ULong val |
USize val) & Real[N] val)](
n: N)
: N
Parameters¶
n: N
Returns¶
N
real¶
[Source]
A random number in [0, 1)
fun ref real()
: F64 val
Returns¶
F64 val
shuffle[A: A]¶
[Source]
Shuffle the elements of the array into a random order, mutating the array.
fun ref shuffle[A: A](
array: Array[A] ref)
: None val
Parameters¶
array: Array[A] ref
Returns¶
None val
| pony | 8641195 | https://sv.wikipedia.org/wiki/Ludvig%20I%20av%20Flandern | Ludvig I av Flandern | Ludvig I av Flandern, född 1304, död 1346, var regerande greve av Flandern från 1322 till 1346.
Referenser
Födda 1304
Avlidna 1346
Män
Flanderns regenter | swedish | 1.449485 |
Pony/assert-Assert-.txt |
Assert¶
[Source]
This is a debug only assertion. If the test is false, it will print any
supplied error message to stderr and raise an error.
primitive val Assert
Constructors¶
create¶
[Source]
new val create()
: Assert val^
Returns¶
Assert val^
Public Functions¶
apply¶
[Source]
fun box apply(
test: Bool val,
msg: String val = "")
: None val ?
Parameters¶
test: Bool val
msg: String val = ""
Returns¶
None val ?
eq¶
[Source]
fun box eq(
that: Assert val)
: Bool val
Parameters¶
that: Assert val
Returns¶
Bool val
ne¶
[Source]
fun box ne(
that: Assert val)
: Bool val
Parameters¶
that: Assert val
Returns¶
Bool val
| pony | 3268685 | https://sv.wikipedia.org/wiki/Poecilanthrax%20alcyon | Poecilanthrax alcyon | Poecilanthrax alcyon är en tvåvingeart som först beskrevs av Thomas Say 1824. Poecilanthrax alcyon ingår i släktet Poecilanthrax och familjen svävflugor. Inga underarter finns listade i Catalogue of Life.
Källor
Svävflugor
alcyon | swedish | 1.106375 |
Pony/term-Readline-.txt |
Readline¶
[Source]
Line editing, history, and tab completion.
class ref Readline is
ANSINotify ref
Implements¶
ANSINotify ref
Constructors¶
create¶
[Source]
Create a readline handler to be passed to stdin. It begins blocked. Set an
initial prompt on the ANSITerm to begin processing.
new iso create(
notify: ReadlineNotify iso,
out: OutStream tag,
path: (FilePath val | None val) = reference,
maxlen: USize val = 0)
: Readline iso^
Parameters¶
notify: ReadlineNotify iso
out: OutStream tag
path: (FilePath val | None val) = reference
maxlen: USize val = 0
Returns¶
Readline iso^
Public Functions¶
apply¶
[Source]
Receives input.
fun ref apply(
term: ANSITerm ref,
input: U8 val)
: None val
Parameters¶
term: ANSITerm ref
input: U8 val
Returns¶
None val
prompt¶
[Source]
Set a new prompt, unblock, and handle the pending queue.
fun ref prompt(
term: ANSITerm ref,
value: String val)
: None val
Parameters¶
term: ANSITerm ref
value: String val
Returns¶
None val
closed¶
[Source]
No more input is available.
fun ref closed()
: None val
Returns¶
None val
up¶
[Source]
Previous line.
fun ref up(
ctrl: Bool val = false,
alt: Bool val = false,
shift: Bool val = false)
: None val
Parameters¶
ctrl: Bool val = false
alt: Bool val = false
shift: Bool val = false
Returns¶
None val
down¶
[Source]
Next line.
fun ref down(
ctrl: Bool val = false,
alt: Bool val = false,
shift: Bool val = false)
: None val
Parameters¶
ctrl: Bool val = false
alt: Bool val = false
shift: Bool val = false
Returns¶
None val
left¶
[Source]
Move left.
fun ref left(
ctrl: Bool val = false,
alt: Bool val = false,
shift: Bool val = false)
: None val
Parameters¶
ctrl: Bool val = false
alt: Bool val = false
shift: Bool val = false
Returns¶
None val
right¶
[Source]
Move right.
fun ref right(
ctrl: Bool val = false,
alt: Bool val = false,
shift: Bool val = false)
: None val
Parameters¶
ctrl: Bool val = false
alt: Bool val = false
shift: Bool val = false
Returns¶
None val
home¶
[Source]
Beginning of the line.
fun ref home(
ctrl: Bool val = false,
alt: Bool val = false,
shift: Bool val = false)
: None val
Parameters¶
ctrl: Bool val = false
alt: Bool val = false
shift: Bool val = false
Returns¶
None val
end_key¶
[Source]
End of the line.
fun ref end_key(
ctrl: Bool val = false,
alt: Bool val = false,
shift: Bool val = false)
: None val
Parameters¶
ctrl: Bool val = false
alt: Bool val = false
shift: Bool val = false
Returns¶
None val
delete¶
[Source]
Forward delete.
fun ref delete(
ctrl: Bool val = false,
alt: Bool val = false,
shift: Bool val = false)
: None val
Parameters¶
ctrl: Bool val = false
alt: Bool val = false
shift: Bool val = false
Returns¶
None val
insert¶
[Source]
fun ref insert(
ctrl: Bool val,
alt: Bool val,
shift: Bool val)
: None val
Parameters¶
ctrl: Bool val
alt: Bool val
shift: Bool val
Returns¶
None val
page_up¶
[Source]
fun ref page_up(
ctrl: Bool val,
alt: Bool val,
shift: Bool val)
: None val
Parameters¶
ctrl: Bool val
alt: Bool val
shift: Bool val
Returns¶
None val
page_down¶
[Source]
fun ref page_down(
ctrl: Bool val,
alt: Bool val,
shift: Bool val)
: None val
Parameters¶
ctrl: Bool val
alt: Bool val
shift: Bool val
Returns¶
None val
fn_key¶
[Source]
fun ref fn_key(
i: U8 val,
ctrl: Bool val,
alt: Bool val,
shift: Bool val)
: None val
Parameters¶
i: U8 val
ctrl: Bool val
alt: Bool val
shift: Bool val
Returns¶
None val
size¶
[Source]
fun ref size(
rows: U16 val,
cols: U16 val)
: None val
Parameters¶
rows: U16 val
cols: U16 val
Returns¶
None val
| pony | 205617 | https://no.wikipedia.org/wiki/MOD11 | MOD11 | MOD11 (Modulus11) er en kontrollsifferalgoritme som blant annet benyttes for å validere kontonumre i norske banker, organisasjonsnummer og det siste sifferet i norske fødselsnummer. (Norske fødselsnummer har to kontrollsifre, det nest siste er også et modulo 11-kontrollsiffer, men ved beregningen av dette benyttes det multiplikatorer i en annen og uregelmessig rekkefølge).
Bakgrunn
Kontrollsiffer benyttes for å oppdage feil ved inntasting av f.eks. KID, kontonumre og fødselsnumre. Det benyttes i all hovedsak to algoritmer for dette, MOD10 og MOD11. Disse kontrollsifrene kontrolleres maskinelt ved OCR-lesing i skranken hos banker. En del IT-systemer kontrollerer også disse kontrollsifre for å sikre at brukere ikke har tastet feil. Dette inkluderer nettbanker og lønnssystemer.
Dersom to eller flere siffer i det inntastede felt er feil, øker sjansen for at kontrollsifferet beregnes til det samme, og at feilen ikke oppdages. Den vil likevel ikke være mer enn om lag 9 % for MOD11 – og 10 % for MOD10. Dersom en tilfeldig tallrekke kontrolleres, er sannsynligheten om lag 9 % for at siste siffer stemmer med kontrollsiffer beregningen (MOD11 bruker også tegnet «-» som et kontrolltegn, så det blir elleve varianter).
Denne kontrollsifferalgoritmen er også designet til å oppdage ombytting av sifre. Det er noe økt sjanse for at brukere taster inn f.eks. en KID der to sifre har byttet plass. Derfor brukes et prinsipp med varierende vekttall for hvert siffer i algoritmen nedenfor. I modulus-10 kan det oppdages om to påfølgende siffer har byttet plass, men ikke første og siste i gruppe på tre. Modulus11 vil også oppdage det.
Beregning av kontrollsiffer med Modulus11
Et tenkt kontonummer er 1234.56.78903. Det siste sifferet i kontonummeret er et kontrollsiffer. I dette eksempelet er kontrollsifferet 3. Kontonummeret uten kontrollsiffer (og uten skilletegn) er 1234567890.
Hvert siffer i eksempelet over multipliseres med vekttallene 2,3,4,5,6,7,2,3,4,5 (eventuelt videre ,6,7,2,3 og så videre for tall med flere sifre), regnet fra høyre mot venstre.
0 × 2 = 0
9 × 3 = 27
8 × 4 = 32
7 × 5 = 35
6 × 6 = 36
5 × 7 = 35
4 x 2 = 8
3 x 3 = 9
2 x 4 = 8
1 x 5 = 5
Summen er 0 + 27 + 32 + 35 + 36 + 35 + 8 + 9 + 8 + 5 = 195.
Kontrollsifferet blir nå det tallet som må legges til summen for å få et tall som er delelig med 11.
Summen divideres med 11 og vi noterer «resten» som blir 8 i dette tilfellet. Denne resten trekkes fra 11 og vi får 3 som blir kontrollsifferet.
11 - 8 = kontrollsifferet 3
Komplett og gyldig kontonummer i dette eksempelet er derfor 1234.56.78903.
Dersom summen er delelig med 11 blir også resten 0 og kontrollsifferet 0. Dersom «resten» ved divisjonen blir 1 skal «kontrollsifferet» ha tallverdien 10, da benyttes isteden et minustegn (eller bindestrek) istedenfor kontrollsifferet. Imidlertid gjelder for kontonumre (og også for personnummer) at slike tall isteden skal forkastes slik at for de typene tall kan kontrollsiffer «-» aldri forekomme.
Implementasjoner i forskjellige programmeringspråk
C#
public static bool ValidateMod11(string bankAccountNumber)
{
var normalized = Regex.Replace(bankAccountNumber, @"[\s.]+", string.Empty);
if (normalized.Length != 11)
{
return false;
}
var weights = new[] { 5, 4, 3, 2, 7, 6, 5, 4, 3, 2 };
var sum = 0;
for (var i = 0; i < 10; i++)
{
sum += int.Parse(normalized[i].ToString()) * weights[i];
}
var remainder = sum % 11;
var controlDigit = int.Parse(normalized[10].ToString());
return controlDigit == (remainder == 0 ? 0 : 11 - remainder);
}
JavaScript
function validateKontonummerMod11(kontonummer) {
const weights = [5, 4, 3, 2, 7, 6, 5, 4, 3, 2];
const kontonummerWithoutSpacesAndPeriods = kontonummer.replace(/[\s.]+/g, '');
if (kontonummerWithoutSpacesAndPeriods.length !== 11) {
return false;
} else {
const sjekksiffer = parseInt(kontonummerWithoutSpacesAndPeriods.charAt(10), 10);
const kontonummerUtenSjekksiffer = kontonummerWithoutSpacesAndPeriods.substring(0, 10);
let sum = 0;
for (let index = 0; index < 10; index++) {
sum += parseInt(kontonummerUtenSjekksiffer.charAt(index), 10) * weights[index];
}
const remainder = sum % 11;
return sjekksiffer === (remainder === 0 ? 0 : 11 - remainder);
}
}
Python
def kid_mod11_wiki(a):
cross = sum([int(val)*[2,3,4,5,6,7][idx%6] for idx,val in enumerate(list(str(a))[::-1])])
return "%s%s" % (a,cross % 11 == 10 and '-' or 11-(cross % 11))
Java
public class KontonummerValidator {
public static boolean gyldigKontonummer(String kontonr) {
// Fjern whitespace og punktum fra kontonummer (enkelte liker å formatere kontonummer med 1234.56.78903)
kontonr = StringUtils.remove(kontonr, ' ');
kontonr = StringUtils.remove(kontonr, '.');
// Skal inneholde 11 siffer og kun tall
if (kontonr.length() != 11 || !StringUtils.isNumeric(kontonr)) {
return false;
}
int sisteSiffer = Character.getNumericValue(kontonr.charAt(kontonr.length() - 1));
return getCheckDigit(kontonr) == sisteSiffer;
}
private static int getCheckDigit(String number) {
int lastIndex = number.length() - 1;
int sum = 0;
for (int i = 0; i < lastIndex; i++) {
sum += Character.getNumericValue(number.charAt(i)) * getWeightNumber(i);
}
int remainder = sum % 11;
return getCheckDigitFromRemainder(remainder);
}
private static int getWeightNumber(int i) {
return 7 - (i + 2) % 6;
}
private static int getCheckDigitFromRemainder(int remainder) {
switch (remainder) {
case 0:
return 0;
default:
return 11 - remainder;
}
}
}
Kotlin
fun validMod11(cid: String): Boolean {
val controlDigit = cid[cid.length - 1].toString()
val controlSumNumbers = listOf(
2, 3, 4, 5, 6, 7,
2, 3, 4, 5, 6, 7,
2, 3, 4, 5, 6, 7,
2, 3, 4, 5, 6, 7
)
val number = cid.subSequence(0, cid.length - 1).reversed().toString()
var sum = 0
for(i in number.indices) {
sum += number[i].toString().toInt() * controlSumNumbers[i]
}
val output = when (val sumResult = 11 - sum % 11) {
11 -> "0"
10 -> "-"
else -> sumResult.toString()
}
return output == controlDigit
}
Se også
MOD10
Referanser
Programmering | norwegian_bokmål | 0.863193 |
Pony/scheduling.txt | # Scheduling
The Pony scheduler is not preemptive. This means that your actor has to yield control of the scheduler thread in order for another actor to execute. The normal way to do this is for your behavior to end. If your behavior doesn't end, you will continue to monopolize a scheduler thread and bad things will happen.
## FFI and monopolizing the scheduler
An easy way to monopolize a scheduler thread is to use the FFI facilities of Pony to kick off code that doesn't return for an extended period of time. You do not want to do this. Do not call FFI code that doesn't return in a reasonable amount of time.
## Long running behaviors
Another way to monopolize a scheduler thread is to write a behavior that never exits or takes a really long time to exit.
```pony
be bad_citizen() =>
while true do
_env.out.print("Never gonna give you up. Really gonna make you cry")
end
```
That is some seriously bad citizen code that will hog a scheduler thread forever. Call that behavior a few times and your program will grind to a halt. If you find yourself writing code with loops that will run for a long time, stop and rethink your design. Take a look at the [Timer](https://stdlib.ponylang.io/time-Timer/) class from the standard library. Combine that together with a counter in your class and you can execute the same behavior repeatedly while yielding your scheduler thread to other actors.
| pony | 152260 | https://sv.wikipedia.org/wiki/St%C3%A5ende%20sk%C3%A4mt | Stående skämt | Stående skämt (på engelska running gag) är ett humoristiskt grepp som används i flera filmer, TV-serier med mera. Tekniken bygger på att man väljer en rolig situation och därefter upprepar den konstant genom filmen/avsnittet/serien. Ofta uppstår humorn i ett stående skämt enbart av den konstanta upprepningen.
Exempel på TV-serier där stående skämt förekommer är:
Monty Pythons flygande cirkus använder flera olika stående skämt, bland annat en riddare med en gummikyckling.
Animaniacs
Hipp Hipp!
Anders och Måns bygger mycket av serien på running gags, däribland ett skämt om gynekologer som tittaren aldrig får höra poängen på.
Morgonsoffan
Simpsons använder två stående skämt i nästan varje avsnitt, Couch gag och Chalkboard gag
i serien South Park dör karaktären Kenny i nästan varje avsnitt i säsong 1-5. i senare tid har detta stående skämt stort sett försvunnit.
I Family Guy förstör Peter Clevelands hus när han badar i några episoder. Cleveland säger What the hell innan badkaret börjar sladda ner medan Clevenland säger No No No No No NO tills badkaret ramlar ner och går sönder. I ett avsnitt sade han till och med att han måste sluta bada under Peters hyss.
I den tecknade Pokémon-serien samt Pokémon Chronicles, finns ett stående skämt där nästan alla säger fel namn på Team Rocket medlemmen Butch, istället kallar de honom Biff, Bill, Bob, Buffy, Buttch, Butcher, Hutch, Patch, Hunch, Botch, Buzz, Chuck eller Hootch. Den enda som brukar säga hans namn rätt är hans kompanjon, Cassidy (men även hon säger fel ibland). I ett avsnitt sade han till slut That does it, i'm changing my name.
Humor | swedish | 1.193282 |
Pony/term-EraseRight-.txt |
EraseRight¶
[Source]
primitive val EraseRight
Constructors¶
create¶
[Source]
new val create()
: EraseRight val^
Returns¶
EraseRight val^
Public Functions¶
eq¶
[Source]
fun box eq(
that: EraseRight val)
: Bool val
Parameters¶
that: EraseRight val
Returns¶
Bool val
ne¶
[Source]
fun box ne(
that: EraseRight val)
: Bool val
Parameters¶
that: EraseRight val
Returns¶
Bool val
| pony | 464119 | https://no.wikipedia.org/wiki/Rolls-Royce%20Silver%20Dawn | Rolls-Royce Silver Dawn | Rolls-Royce Silver Dawn er en bilmodell fra den britiske bilprodusenten Rolls-Royce. Silver Dawn var et firedørs karosseri tegnet av John Blatchley og var nær identisk med Bentley VI. Silver Dawn ble bygget fra 1949 til 1955 da den ble avløst av Rolls-Royce Silver Cloud.
Silver Dawn
Bilmodeller introdusert i 1949 | norwegian_bokmål | 1.208901 |
Pony/src-signals-sig-.txt |
sig.pony
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180primitive Sig
"""
Define the portable signal numbers. Other signals can be used, but they are
not guaranteed to be portable.
"""
fun hup(): U32 => 1
fun int(): U32 => 2
fun quit(): U32 => 3
fun ill(): U32 =>
ifdef linux or bsd or osx then 4
else compile_error "no SIGINT"
end
fun trap(): U32 =>
ifdef linux or bsd or osx then 5
else compile_error "no SIGTRAP"
end
fun abrt(): U32 => 6
fun emt(): U32 =>
ifdef bsd or osx then 7
else compile_error "no SIGEMT"
end
fun fpe(): U32 =>
ifdef linux or bsd or osx then 8
else compile_error "no SIGFPE"
end
fun kill(): U32 => 9
fun bus(): U32 =>
ifdef bsd or osx then 10
elseif linux then 7
else compile_error "no SIGBUS"
end
fun segv(): U32 =>
ifdef linux or bsd or osx then 11
else compile_error "no SIGSEGV"
end
fun sys(): U32 =>
ifdef bsd or osx then 12
elseif linux then 31
else compile_error "no SIGSYS"
end
fun pipe(): U32 =>
ifdef linux or bsd or osx then 13
else compile_error "no SIGPIPE"
end
fun alrm(): U32 => 14
fun term(): U32 => 15
fun urg(): U32 =>
ifdef bsd or osx then 16
elseif linux then 23
else compile_error "no SIGURG"
end
fun stkflt(): U32 =>
ifdef linux then 16
else compile_error "no SIGSTKFLT"
end
fun stop(): U32 =>
ifdef bsd or osx then 17
elseif linux then 19
else compile_error "no SIGSTOP"
end
fun tstp(): U32 =>
ifdef bsd or osx then 18
elseif linux then 20
else compile_error "no SIGTSTP"
end
fun cont(): U32 =>
ifdef bsd or osx then 19
elseif linux then 18
else compile_error "no SIGCONT"
end
fun chld(): U32 =>
ifdef bsd or osx then 20
elseif linux then 17
else compile_error "no SIGCHLD"
end
fun ttin(): U32 =>
ifdef linux or bsd or osx then 21
else compile_error "no SIGTTIN"
end
fun ttou(): U32 =>
ifdef linux or bsd or osx then 22
else compile_error "no SIGTTOU"
end
fun io(): U32 =>
ifdef bsd or osx then 23
elseif linux then 29
else compile_error "no SIGIO"
end
fun xcpu(): U32 =>
ifdef linux or bsd or osx then 24
else compile_error "no SIGXCPU"
end
fun xfsz(): U32 =>
ifdef linux or bsd or osx then 25
else compile_error "no SIGXFSZ"
end
fun vtalrm(): U32 =>
ifdef linux or bsd or osx then 26
else compile_error "no SIGVTALRM"
end
fun prof(): U32 =>
ifdef linux or bsd or osx then 27
else compile_error "no SIGPROF"
end
fun winch(): U32 =>
ifdef linux or bsd or osx then 28
else compile_error "no SIGWINCH"
end
fun info(): U32 =>
ifdef bsd or osx then 29
else compile_error "no SIGINFO"
end
fun pwr(): U32 =>
ifdef linux then 30
else compile_error "no SIGPWR"
end
fun usr1(): U32 =>
ifdef bsd or osx then 30
elseif linux then 10
else compile_error "no SIGUSR1"
end
fun usr2(): U32 =>
ifdef not "scheduler_scaling_pthreads" then
ifdef bsd or osx then 31
elseif linux then 12
else compile_error "no SIGUSR2"
end
else
ifdef linux or bsd or osx then
compile_error "SIGUSR2 reserved for runtime use"
else
compile_error "no SIGUSR2"
end
end
fun rt(n: U32): U32 ? =>
ifdef bsd then
if n <= 61 then
65 + n.u32()
else
error
end
elseif linux then
if n <= 32 then
32 + n.u32()
else
error
end
else
compile_error "no SIGRT"
end
| pony | 3087246 | https://sv.wikipedia.org/wiki/Culex%20ocossa | Culex ocossa | Culex ocossa är en tvåvingeart som beskrevs av Dyar och Frederick Knab 1919. Culex ocossa ingår i släktet Culex och familjen stickmyggor. Inga underarter finns listade i Catalogue of Life.
Källor
Stickmyggor
ocossa | swedish | 1.33323 |
Pony/src-bureaucracy-custodian-.txt |
custodian.pony
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73use "collections"
actor Custodian
"""
A Custodian keeps a set of actors to dispose. When the Custodian is disposed,
it disposes of the actors in its set and then clears the set.
## Example program
Imagine you have a program with 3 actors that you need to shutdown when it
receives a TERM signal. We can set up a Custodian that knows about each
of our actors and when a TERM signal is received, is disposed of.
```pony
use "bureaucracy"
use "signals"
actor Actor1
be dispose() => None // dispose of resources here.
actor Actor2
be dispose() => None // dispose of resources here.
actor Actor3
be dispose() => None // dispose of resources here.
actor Main
new create(env: Env) =>
let actor1 = Actor1
let actor2 = Actor2
let actor3 = Actor3
let custodian = Custodian
custodian(actor1)
custodian(actor2)
custodian(actor3)
SignalHandler(TermHandler(custodian), Sig.term())
class TermHandler is SignalNotify
let _custodian: Custodian
new iso create(custodian: Custodian) =>
_custodian = custodian
fun ref apply(count: U32): Bool =>
_custodian.dispose()
true
```
"""
embed _workers: SetIs[DisposableActor] = _workers.create()
be apply(worker: DisposableActor) =>
"""
Add an actor to be disposed of.
"""
_workers.set(worker)
be remove(worker: DisposableActor) =>
"""
Removes an actor from the set of things to be disposed.
"""
_workers.unset(worker)
be dispose() =>
"""
Dispose of the actors in the set and then clear the set.
"""
for worker in _workers.values() do
worker.dispose()
end
_workers.clear()
| pony | 398086 | https://da.wikipedia.org/wiki/Billy%20Bob%20Thornton | Billy Bob Thornton | Billy Bob Thornton (født 4. august 1955) er en amerikansk skuespiller, musiker, instruktør, dramatiker og manuskriptforfatter. Han har været nomineret til en Oscar for bedste mandlige hovedrolle for Sling Blade (1996) og en Oscar for bedste mandlige birolle for A Simple Plan, og har vundet en Oscar for bedste filmatisering ligeledes for Sling Blade, som han også instruerede.
Privat har han været gift fem gange, sidste gang 2000-2003 med skuespilleren Angelina Jolie.
Filmografi
Sling Blade (1996), instruktør, manuskriptforfatter og skuespiller
U Turn (1997), skuespiller
A Simple Plan (1998), skuespiller
Armageddon (1998), skuespiller
The Thin Red Line (1998), skuespiller
Primary Colors (1998), skuespiller
Monster's Ball (1998), skuespiller
Bandits (2001), skuespiller
The Man Who Wasn't There (2001), skuespiller
Bad Santa (2003), skuespiller
Love Actually (2003), skuespiller
Intolerable Cruelty (2003), skuespiller
The Alamo (2004), skuespiller
The Ice Harvest (2005), skuespiller
School for Scoundrels (2006), skuespiller
Mr. Woodcock (2007), skuespiller
Blood In Blood Out (1993), Lightning
Eksterne henvisninger
Skuespillere fra Arkansas
Oscar-nominerede skuespillere | danish | 0.844554 |
Pony/divide-by-zero.txt | # Divide by Zero
What's 1 divided by 0? How about 10 divided by 0? What is the result you get in your favorite programming language?
In math, divide by zero is undefined. There is no answer to that question as the expression 1/0 has no meaning. In many programming languages, the answer is a runtime exception that the user has to handle. In Pony, things are a bit different.
## Divide by zero in Pony
In Pony, *integer division by zero results in zero*. That's right,
```pony
let x = I64(1) / I64(0)
```
results in `0` being assigned to `x`. Baffling right? Well, yes and no. From a mathematical standpoint, it is very much baffling. From a practical standpoint, it is very much not.
While Pony has [Partial division](/expressions/arithmetic.md#partial-and-checked-arithmetic):
```pony
let x =
try
I64(1) /? I64(0)
else
// handle division by zero
end
```
Defining division as partial leads to code littered with `try`s attempting to deal with the possibility of division by zero. Even if you had asserted that your denominator was not zero, you'd still need to protect against divide by zero because, at this time, the compiler can't detect that value dependent typing.
Pony also offers [Unsafe Division](/expressions/arithmetic.md#unsafe-integer-arithmetic), which declares division by zero as undefined, as in C:
```pony
// the value of x is undefined
let x = I64(1) /~ I64(0)
```
But declaring this case as undefined does not help us out here. As a programmer you'd still need to guard that case in order to not poison your program with undefined values or risking terminating your program with a `SIGFPE`. So, in order to maintain a practical API and avoid undefined behaviour, _normal_ division on integers in Pony is defined to be `0`. To avoid `0`s silently creeping through your divisions, use [Partial or Checked Division](/expressions/arithmetic.md#partial-and-checked-arithmetic).
### Divide by zero on floating points
In conformance with IEEE 754, *floating point division by zero results in `inf` or `-inf`*, depending on the sign of the numerator.
If you can assert that your denominator cannot be `0`, it is possible to use [Unsafe Division](/expressions/arithmetic.md#floating-point) to gain some performance:
```pony
let x = F64(1.5) /~ F64(0.5)
```
| pony | 2086576 | https://no.wikipedia.org/wiki/Lyrikk%C3%A5ret%201904 | Lyrikkåret 1904 | Lyrikkåret 1904 er en oversikt over utgivelser, hendelser, prisvinnere og avdøde personer med tilknytning til lyrikk i 1904.
Hendelser
Utgitte verk
Fødsler
|-
|rowspan=2|Juli
|12. || Pablo Neruda || || poet ||align=center|69 ||align=center|1973 ||
|-
|30.|| Salvador Novo || || forfatter, poet, dramatiker, oversetterog programleder på TV ||align=center|69 ||align=center|1974 ||
|August
|26. || Trygve Bjerkrheim || || redaktør, forkynner, lærer og dikter ||align=center|96 ||align=center|2001 ||
|}
Dødsfall
|-
|Juli ||6. || Abaj Qunanbajulij || kasakhisk || poet, komponist og filosof ||align=center|58 ||align=center|1845 ||
|}
Referanser | norwegian_bokmål | 1.488828 |
Pony/src-files-file_stream-.txt |
file_stream.pony
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39actor FileStream is OutStream
"""
Asynchronous access to a File object. Wraps file operations print, write,
printv and writev. The File will be disposed through File._final.
"""
let _file: File
new create(file: File iso) =>
_file = consume file
be print(data: ByteSeq) =>
"""
Print some bytes and insert a newline afterwards.
"""
_file.print(data)
be write(data: ByteSeq) =>
"""
Print some bytes without inserting a newline afterwards.
"""
_file.write(data)
be printv(data: ByteSeqIter) =>
"""
Print an iterable collection of ByteSeqs.
"""
_file.printv(data)
be writev(data: ByteSeqIter) =>
"""
Write an iterable collection of ByteSeqs.
"""
_file.writev(data)
be flush() =>
"""
Flush pending data to write.
"""
_file.flush()
| pony | 462104 | https://sv.wikipedia.org/wiki/Lista%20%C3%B6ver%20fil%C3%A4ndelser | Lista över filändelser | Lista över filändelser:
Siffror
.386 Windowssystemfil
.3ds CAD-format (Autodesk 3ds Max)
.3gp Videoformat som de flesta mobiltelefoner brukar spara videoinspelningar i, formatet hanteras bl.a. av Quicktime och VLC media player
.7z Komprimerad arkivfil, hanteras av 7-Zip
A
.a Filändelse för objektkodsbibliotek. Denna filändelse kan även associeras med biblioteksfiler i Unix
.a21 Filändelse för SOUNDWEB firmwarefiler.
.a26 Filändelse för z26 Atari 2600-emulator ROM Fil
.a78 Filändelse för Atari 7800 ROM-avbildning (IMAGE)
.aaf Advanced Authoring Format - multimediafiler
.acg Microsoft Agent förhandsgranskningsfil
.act Fil skapad av Macromedia Action
.acw Inställningsfil för hjälpmedelsguiden
.adb (Ada-källkod)
.ads (Ada-fil)
.afm Postscript i Font Metrics (Adobe)
.adi Auto CAD plotfile.
.ai Fil till programmet Adobe Illustrator
.amr (Adaptive multirate) Ljudfilsformat baserat på en komprimeringsmetod för tal som används i GSM-mobiltelefoni
.ani Animerad muspekare
.apm Plugin till Arachne för DOS.
.app Datorprogram för Mac OS och Mac OS Classic.
.arc Komprimerad fil. Packad med programmet ARC eller PKPak.
.arj Komprimerad fil. Packad med programmet ARJ. Går att packa upp med Winzip, WinARJ, WinRAR mm.
.asc MS-DOS text med layout, ASCII-fil
.asf Advanced Streaming Format. Uppspelning av ljud och video.
.avr Multimediafil som öppnas med till exempel Quicktime.
.asp Kod för dynamiska internetsidor.
.avi Audio Video Interleaved. Uppspelning av ljud och video.
B
.bat (Batch) Kommandofil som startar flera körbara program i DOS, Windows och OS/2
.bak Backupfil. Säkerhetskopierade filer har oftast denna beteckning.
.bas Fil skriven för programmeringsspråket BASIC
.bfc Portföljfil som synkroniserar samma dokument på två olika ställen i en dator eller mellan flera datorer.
.bin Komprimerad fil/Image fil.
.blend Fil för 3D-programmet Blender.
.bmp Bildfil
.bz2 Fil komprimerad med bzip2-algoritmen
C
.c4d 3D-grafik med Cinema 4D
.cab Cabinet. Komprimerad installationsfil som används av Windows.
.cct Carbon Copy 32 Autopilot.
.ccw Carbon Copy Document.
.cda Ljudspår på en audio-cd.
.cdr Grafikfil från programmet Corel Draw.
.cgi Körbart skript, eller program, på webbserver som följer standarden Common Gateway Interface.
.chk Checkdisk. Filer som skapas av systemverktygen ChkDsk eller ScanDisk.
.chm Compiled HTML Help File. Vanligt format på hjälpfiler i Windows.
.clp Klippbordsfil
.cgm Grafikfil (Computer Graphics Metafile)
.cmf Ljudfiler. Körs med till exempel Music Player
.cob Cobol-källkod
.cpl Windows kontrollpanelsfiler.
.cps PC-Tools-fil.
.cpt Corel Photo Paint.
.crd Kartoteksfil.
.crt Certifikat för Internet.
.cur Muspekare i Windows.
.cwk Claris Works-fil.
.c C-källkod
.cfg Configure. Konfigurationsfil med inställningar sparade för ett specifikt program.
.cgm Computer Graphics Metafile. Bildformat.
.chm Kompilerad HTML-fil
.class Kompilerad Java-klass
.com Programfil under DOS, Windows och OS/2.
.conf Konfigurationsfil
.cpp C++-källkod
.cr2 Canon RAW-fil (foto)
.css Stilmall exempelvis för webbsida
.cue Tillhör en .bin-fil vid CD/DVD-kopiering
D
.dat Datafil. Filändelsen används av flera program.
.db Nyckelfil eller databasfil. Kan innehålla lösenord eller serienummer till ett specifikt program. Kan också vara en databasfil.
.dbf Databasfil som används av Microsoft Access.
.dbx Mappar med e-post i till exempel Microsoft Outlook
.deb Debian-paket
.der Certifikat för Internet
.dev
.dcr Adobe Dreamweaver
.dcm Medicinsk bild i DICOM-format.
.dhtml Dynamisk HTML
.dib Filer i bitmapformat för Windows (Device Independent Bitmap).
.dic Ordboksfil ("dictionary")
.dll (Dynamic-link library) Programbibliotek i Windows.
.dmg Skivavbild. Vanligt format för att distribuera programvara för Mac OS X över Internet. Fungerar på samma sätt som en cd-skiva när den öppnas i Mac OS X. Se även Skivavbild.
.dmp Minnesdumpsfil när Windows kraschar.
.dot Dokumentmall skapad i programmet Microsoft Word.
.dqv Frågefil i Excel
.drv Drivrutin som gör det möjligt att använda en specifik hårdvara.
.drw MicroGrafx-format
.ds Twain-drivrutin. Gör det möjligt att hämta in en bild från en bildläsare eller digitalkamera.
.doc Microsoft Word-dokument fram till och med version 2003
.docx Microsoft Word-dokument från och med version 2007
.dvi Tex/Latex device independent format.
.dvdproj Fil som tillhör iDVD som är ett program i Apples program paket Ilife '06
.dwg Fil i AutoCAD-format
E
.emf (Enhanced Windows Metafile) Vektorgrafiskt bildformat för Windows
.eml Internet e-postmeddelande.
.eps Encapsulated Postscript. Format för vektorgrafik och/eller bitmapbilder. Kan tolkas av många program.
.err Händelsefil vid mjuk- eller hårdvarufel.
.exe Datorprogram i vissa operativsystem (DOS, VMS, Windows m.fl.)
F
.fav Genvägar i Outlookfältet
.fc Filesettings i First Class
.fdf Adobe Acrobat Forms document
.fla Adobe Flash, kan redigeras och sammanställs till Shockwave Flash (.swf)
.flv Adobe Flash Video, Videofil som ofta förekommer på videositer tex Youtube
.fm Filemaker Pro 2.1
.fon Windows punktuppbyggda fontformat. Innehåller beskrivning av hur ett specifikt typsnitt ser ut.
.fp3 Filemaker Pro 3/4/4.1
.fp5 Filemaker Pro 5/5.5/6
.fp7 Filemaker Pro 7/8/8.5
.fpx Kodac FlashPix
.frm Registrering eller orderblankett till ett sharewareprogram, eller ett projekt till Visual Basic 6.0
G
.gba Nintendo Game Boy Advance ROM Image.
.gbc Nintendo Game Boy Color Emulator ROM Image File.
.gid Global indexfil för Windows hjälptextfiler .hlp
.gif (Graphics Interchange Format) Bildformat.
.gm6 GameMaker: Studio 6 Projektfil.
.gm8 GameMaker: Studio 8 Projektfil.
.gm81 GameMaker: Studio 8.1 Projektfil.
.gmk GameMaker: Studio 7 Projektfil.
.gmx Komprimerad GameMaker: Studio-fil.
.gmz GameMaker: Studio-fil
.gra Microsoft Graph
.grp Programgrupp i Windows. Innehåller ikoner som du hittar i startmenyn.
.gz Komprimerad fil. Kan packas upp med gzip/gunzip.
.gzl GoZilla filelist
H
.h C-headerfil
.hlp Hjälptextfil
.ht Fil till programmet Hyper Terminal i Windows.
.htt HyperText Template
.htx Mallfil med HTML-kod med diverse logiska villkor
.html/.htm webbsida ("HyperText Markup Language")
I
.icw Internet Connection Wizard
.iii Intel Video Phone
.img Grafikfil
.indd Dokumentfil från Indesign
.inf Installationsinformation; här finns information om installationen av en hårdvara.
.ins Installationsinformation; han ibland vara Internetkommunikationsrutiner.
.isp Innehåller Internet kommunikationsrutiner.
.isu Innehåller information som behövs när ett program ska avinstalleras från hårddisken. Filen skapas av installationsprogrammet InstallShield.
.ico Bild till ikonen på programikoner och spelikoner
.img Skivavbildsfil
.ini Konfigurationsinställningar för ett specifikt program. Läses in av programmet när det startas.
.iso Skivavbildsfil (ISO 9660)
J
.jbf Fil skapad av Paint Shop Pro. Innehåller små förhandsbilder av bilderna i ett bibliotek eller mapp.
.jif Grafikfil som går att öppna i programmet Paint Shop Pro
.js Javascript
.jsp Java Server Pages
.jar Java-arkivfil
.java Java-källkod
.jpeg/.jpg Bildformat mycket vanligt för fotografier
K
.ksp KSpread-kalkylark
.kwd Kword-dokument
.kdc Kodac Digital Camera File
L
.lit tidigare format för e-böcker som användes av Microsoft Reader. Varken programmet eller formatet säljs längre.
.lbm Grafikfil skapad av programmet Deluxe Paint
.ldb Postlåsningsinformation i Access
.lex Stavningskontrollfil i bland annat Officepaketet
.lha Komprimerad fil packad med programmet LHA.
.lnk Länkfil i Windows 95 och senare. Alla genvägar har denna filändelse.
.log Loggfil med information för löpande eller historisk data.
.lst Lista av något slag
.lwp Textdokument från Lotus Word Pro
.lzh Komprimerad fil packad med programmet LHA. Kan packas upp med Winzip.
.lib Library-fil, används av många program
M
.m m-filer används av programmet Matlab
.m2v MPEG-2, Videoformat som används på digital-TV och DVD
.m3u Spellista fil, för musik filer
.mac Fil innehållande ett makro
.mcc Genväg till The Microsoft Network
.mcw Word 5.1 för Mac för att kunna öppna filen i Windows
.mdb Databasfil till programmet Access
.mde MDE-databas i Access
.mdn Tom databasmall i Access
.mid, .midi Musikfil med helt digital beskrivning av låten
.mmf Ringsignal för mobiltelefoner
.mim Matematik i Måneby sparat spel
.mnf Sparad Microsoft Networksökning
.mov Filmfil, till Apples program "Quicktime"
.mp3 MPEG-1 Audio Layer 3, Vanlig Ljudfil
.mp4 MPEG-4 Part 14, Videoformat
.mpg, .mpeg MPEG-1, Vanligt videoformat
.mp* Microsoft Project
.mpd Microsoft Project 8.0 Project databas
.mpv Filmfil
.mqo 3d-modeller, vanligtvis skapade i programmet «Metasequoia.
.msg Microsoft e-postbrev
.msn Microsoft Network startfönster
.msp Grafikfil skapad av programmet Microsoft Paint
N
.n64 Filändelse för N64 spel ROM eller spel avbildnings fil
.nds Filändelse för Nintendo DS ROM eller spelavbildningsfil
.nfo Informationsfil för Microsoft systeminformation.
.nch Netscape Conference Call-fil
.nsb Novaschem schemafil
O
.o Kompilerad men olänkad programfil
.obd Microsoft Office Binder
.obj Antingen ett ASCII-baserat format för 3D-objekt, eller kompilerad men olänkad programfil
.obt Mall till Office Binder
.obz Guide till Office Binder
.odt OpenDocument-formatet - textbehandlingsdokument
.ods OpenDocument-formatet - kalkylbladsdokument
.odp OpenDocument-formatet - presentationsdokument
.odg OpenDocument-formatet - teckningsdokument
.odc OpenDocument-formatet - diagramdokument
.odf OpenDocument-formatet - formeldokument
.odi OpenDocument-formatet - bilddokument
.odm OpenDocument-formatet - samlade dokument
.ott OpenDocument-formatet - textbehandlingsmall
.ots OpenDocument-formatet - kalkylbladsmall
.otp OpenDocument-formatet - presentationsmall
.otg OpenDocument-formatet - teckningsmall
.otc OpenDocument-formatet - diagramsmall
.otf OpenDocument-formatet - formelmall
.oti OpenDocument-formatet - bildmall
.oth OpenDocument-formatet - webbsidesmall
.oft Microsoft Outlook-objektmall
.old Säkerhetskopia av en textfil. Se .bak
.olk Microsoft Outlook-adressbok
.one Microsofte Office OneNote
.opx Microsoft Organisationsschema
.oqv Frågefil i Excel
.oss Microsoft Officesökning
.ocx OLE-objekt som ger ett program en specifik funktion. Används oftast av program skapade i programmeringsspråket Visual Basic.
.odf Filändelse i Sun Microsystems Calc (inkluderad i Staroffice), OpenOffice.org Calc, ett s.k Spreadsheet formulär.
.ogg Ogg multimediaformat för ljud.
.ogm Komprimerad video container dvs filformat för OGG Vorbis komprimering som innehåller både video och ljud.
P
.p12 PKCS#12-fil, används bland annat för Bank-ID
.pf Windows Prefetch-fil, för cachad programstartsdata. Även filändelse för Alladin systems krypterade fil format.
.pak Komprimerad fil
.par Windows swap-fil
.pbk MSN-telefonlista
.pcd Grafikfil som används på Kodak photo-CD
.pct Grafikfil från Macintosh
.pcv
.pfb Postscript vektortypsnitt
.pics Standardiserat filformat för animationer
.pjg Komprimerad bildfil, hanteras av programmet packJPG
.pm Pagemakerfil
.pot Microsoft Powerpoint-mall
.ppa Tillägg i Microsoft Powerpoint
.pps Microsoft Powerpoint-bildspel
.prel Adobe Premiere Elements, Videoprojektfil
.prd Drivrutin till skrivare
.ps Postscript-fil, vanligen för utskrifter
.psd Grafikfil som är skapad i Adobe Photoshop
.psp Paint Shop Pro-fil
.pst Microsoft Outlook Data File, Personal Folder File
.pwd Lösenordsfil i Windows där alla inställningar om en användare sparas
.pwl Password list, lösenordsfil i Windows
.pcx Grafikfil från Paintbrush
.pdf Portable Document Format för Adobe PDF
.php Kod för dynamiska internetsidor skrivna i PHP
.pif Fil som används av Windows för specialinställningar när ett DOS-program startas
.pl Perl-skript
.pls Spellista för musikspelare
.pmd
.png (Portable Network Graphics) filformat för bilder och grafik; börjar ersätta GIF
.ppt Microsoft Powerpoint-presentation till och med version 2003
.pptx Microsoft Powerpoint-presentation från och med version 2007
.pwn Pawn-skript.
.py Python-skript
Q
.qic Filuppsättning för säkerhetskopiering.
.qry Microsoft Query
.qt Filmklipp som spelas upp med Quicktime
.qtw Drivrutinsfil som används av Quicktime
.qtz Quartz-composer fil som spelas upp av Quicktime
.qxd Quark Express
R
.ra Ljudfil skapad av Real Audio
.ram Real Audio
.rar Komprimerad fil
.raw Bildformat, skapat av Canon
.rb Ruby-script
.rec Fil innehållande ett inspelat makro (datateknik)
.reg Fil som innehåller de nycklar om ett program som återfinns i registereditorn
.rhtml Embedded Ruby, motsvarar PHP/ASP/JSP; används av Ruby on Rails.
.rm Real Media, från Real Networks
.rmp RealJukebox, spellistor med mera till RealPlayer
.rtf (Rich Text Format) format för dokumentfiler
.rpm RPM Package Manager, programpaket för pakethanteraren RPM
S
.scd Microsoft Schedule
.scp Nätverksscript för fjärranslutning
.scr Skärmsläckarfil (Screensaver)
.sdc Secure Download Cabinet
.set Filuppsättning för Microsoft Backup
.sfx Komprimerad fil, självuppackande
.swf Shockwave Flash, från, Adobe, kan ej redigeras och kommer från .fla, används för till exempel spel på internet
.sh Bourne shell-skript
.shs Systemfil till Windows
.sid
.sis Application installer för symbian OS
.sky Krypterad textfil som genereras av programmet SignStudio som används för att skapa märkskyltar till tekniska installationer.
.smc
.smd
.so Shared Object, delat kod eller kodbibliotek i många unix-varianter
.sqm
.srt Undertextfil för bland annat .avi-filer
.sub Subtitle, Undertextfil för videofiler
.svg Bild i SVG (Scalable Vector Graphics)
.swp Virtuell minnesfil i Windows
.sys Systemfil till Windows eller drivrutin för DOS
T
.tap
.tar Tape Archive, konkatenering av filstruktur till en fil
.tex Tex/Latex källfil
.tga Targafil med punktuppbyggd bild
.tif (Tagged Image File-Formated) Grafikfil
.tmp Temporär fil, skapas av ett program medan det är igång.
.ttf Typsnittsfil, innehåller information om True-Type typsnitt.
.tiff Bildfil
.toast Imagefil till brännprogrammet "Toast"
.torrent Bittorrent-filer
.txt Textfil
U
.uae WinUAE spelkonfigurationsfil
.uga Ulead GIF Animator-projektfil
.uha UHARC-arkiv
.uhs Fil tillhörande Universal Hint System
.uin ICQ-registreringsfil
.ul uLAW-ljudfil
.upc Ultimate Paint-fil
.url Genväg (URL) till en plats på Internet
V
.v64 ROM-fil för Nintendo 64 emulatorer
.vbo MS Access Package Deployment References
.vbp MS Visual Basic v. 4.0-6.0-projekt
.vbx Visual Basic-fil
.vcf Telefonbok/Kopia
.vcw MS Visual C++-fil
.voc Ljudfil
.vxd Virtuell drivrutin i Windows
.vcf Telefonbok/Kopia
W
.wdb Databas skapad av Microsoft Works
.win
.wk1 Lotus 1-2-3 version 2
.wk3 Lotus 1-2-3 version 3
.wk4 Lotus 1-2-3 version 4
.wmf (Windows Metafile) Vektorgrafiskt bildformat för Windows
.wp5 Textfil skapad av Wordperfect
.wps Textdokument i Microsoft Works
.wri Dokument från ordbehandlingsprogrammet Windows Write
.wav Enkel ljudfil (wave)
.wma Windows Media Audio, ljudformat från Microsoft
.wmp Windows Media Picture
Windows Media Video.wmv Windows Media Video, videoformat från Microsoft
.wps Textdokument i Microsoft Works
X
.xcf Gimps filformat för bilder
.xlc Diagram i Excel
.xlk Microsoft Excel-säkerhetskopia
.xlt Microsoft Excel-mall
.xlv Excel VBA-modul
.xml Extensible markup language, konfigurations- eller databasfil i XML-format
.xpm Bildfil
.xls Microsoft Excel-arbetsbok till och med version 2003
.xlsx Microsoft Excel-arbetsbok från och med version 2007
.xpi Utökningar för Mozilla Firefox
Y
.yaml/.yml YAML, ett uppmärkningsspråk
Z
.z3d ZModeler 3D Project File
.z64 Nintendo 64 Emulator
.zip Komprimerad arkivfil
Filformat
Filändelser | swedish | 0.833343 |
Pony/serialise-OutputSerialisedAuth-.txt |
OutputSerialisedAuth¶
[Source]
This is a capability token that allows the holder to examine serialised data.
This should only be provided to types that need to write serialised data to
some output stream, such as a file or socket. A type with the SerialiseAuth
capability should usually not also have OutputSerialisedAuth, as the
combination gives the holder the ability to examine the bitwise contents of
any object it has a reference to.
primitive val OutputSerialisedAuth
Constructors¶
create¶
[Source]
new val create(
auth: AmbientAuth val)
: OutputSerialisedAuth val^
Parameters¶
auth: AmbientAuth val
Returns¶
OutputSerialisedAuth val^
Public Functions¶
eq¶
[Source]
fun box eq(
that: OutputSerialisedAuth val)
: Bool val
Parameters¶
that: OutputSerialisedAuth val
Returns¶
Bool val
ne¶
[Source]
fun box ne(
that: OutputSerialisedAuth val)
: Bool val
Parameters¶
that: OutputSerialisedAuth val
Returns¶
Bool val
| pony | 7376277 | https://sv.wikipedia.org/wiki/Sh%C5%ABr%C4%81b-e%20Kab%C4%ABr | Shūrāb-e Kabīr | Shūrāb-e Kabīr (persiska: شوراب کبیر) är en ort i Iran. Den ligger i provinsen Chahar Mahal och Bakhtiari, i den centrala delen av landet, km söder om huvudstaden Teheran. Shūrāb-e Kabīr ligger meter över havet och antalet invånare är .
Terrängen runt Shūrāb-e Kabīr är kuperad åt sydväst, men åt nordost är den platt. Terrängen runt Shūrāb-e Kabīr sluttar söderut. Den högsta punkten i närheten är Kūh-e Shīrāz, meter över havet, km väster om Shūrāb-e Kabīr. Runt Shūrāb-e Kabīr är det ganska tätbefolkat, med invånare per kvadratkilometer. Närmaste större samhälle är Saman, km sydväst om Shūrāb-e Kabīr. Trakten runt Shūrāb-e Kabīr består i huvudsak av gräsmarker.
I trakten råder ett kallt ökenklimat. Årsmedeltemperaturen i trakten är °C. Den varmaste månaden är augusti, då medeltemperaturen är °C, och den kallaste är januari, med °C. Genomsnittlig årsnederbörd är millimeter. Den regnigaste månaden är november, med i genomsnitt mm nederbörd, och den torraste är september, med mm nederbörd.
Kommentarer
Källor
Orter i Chahar Mahal och Bakhtiari | swedish | 1.178657 |
Pony/collections-List-.txt |
List[A: A]¶
[Source]
A doubly linked list.
The following is paraphrased from Wikipedia.
A doubly linked list is a linked data structure that consists of a set of sequentially
linked records called nodes (implemented in Pony via the collections.ListNode class). Each
node contains four fields: two link fields (references to the previous and to the next node in
the sequence of nodes), one data field, and the reference to the List in which it resides. A doubly
linked list can be conceptualized as two singly linked lists formed from the same data items, but
in opposite sequential orders.
As you would expect. functions are provided to perform all the common list operations such as
creation, traversal, node addition and removal, iteration, mapping, filtering, etc.
Example program¶
There are a lot of functions in List. The following code picks out a few common examples.
It outputs:
A new empty list has 0 nodes.
Adding one node to our empty list means it now has a size of 1.
The first (index 0) node has the value: A single String
A list created by appending our second single-node list onto our first has size: 2
The List nodes of our first list are now:
A single String
Another String
Append *moves* the nodes from the second list so that now has 0 nodes.
A list created from an array of three strings has size: 3
First
Second
Third
Mapping over our three-node list produces a new list of size: 3
Each node-value in the resulting list is now far more exciting:
First BOOM!
Second BOOM!
Third BOOM!
Filtering our three-node list produces a new list of size: 2
Second BOOM!
Third BOOM!
The size of our first partitioned list (matches predicate): 1
The size of our second partitioned list (doesn't match predicate): 1
Our matching partition elements are:
Second BOOM!
use "collections"
actor Main
new create(env:Env) =>
// Create a new empty List of type String
let my_list = List[String]()
env.out.print("A new empty list has " + my_list.size().string() + " nodes.") // 0
// Push a String literal onto our empty List
my_list.push("A single String")
env.out.print("Adding one node to our empty list means it now has a size of "
+ my_list.size().string() + ".") // 1
// Get the first element of our List
try env.out.print("The first (index 0) node has the value: "
+ my_list.index(0)?()?.string()) end // A single String
// Create a second List from a single String literal
let my_second_list = List[String].unit("Another String")
// Append the second List to the first
my_list.append_list(my_second_list)
env.out.print("A list created by appending our second single-node list onto our first has size: "
+ my_list.size().string()) // 2
env.out.print("The List nodes of our first list are now:")
for n in my_list.values() do
env.out.print("\t" + n.string())
end
// NOTE: this _moves_ the elements so second_list consequently ends up empty
env.out.print("Append *moves* the nodes from the second list so that now has "
+ my_second_list.size().string() + " nodes.") // 0
// Create a third List from a Seq(ence)
// (In this case a literal array of Strings)
let my_third_list = List[String].from(["First"; "Second"; "Third"])
env.out.print("A list created from an array of three strings has size: "
+ my_third_list.size().string()) // 3
for n in my_third_list.values() do
env.out.print("\t" + n.string())
end
// Map over the third List, concatenating some "BOOM!'s" into a new List
let new_list = my_third_list.map[String]({ (n) => n + " BOOM!" })
env.out.print("Mapping over our three-node list produces a new list of size: "
+ new_list.size().string()) // 3
env.out.print("Each node-value in the resulting list is now far more exciting:")
for n in new_list.values() do
env.out.print("\t" + n.string())
end
// Filter the new list to extract 2 elements
let filtered_list = new_list.filter({ (n) => n.string().contains("d BOOM!") })
env.out.print("Filtering our three-node list produces a new list of size: "
+ filtered_list.size().string()) // 2
for n in filtered_list.values() do
env.out.print("\t" + n.string()) // Second BOOM!\nThird BOOM!
end
// Partition the filtered list
let partitioned_lists = filtered_list.partition({ (n) => n.string().contains("Second") })
env.out.print("The size of our first partitioned list (matches predicate): " + partitioned_lists._1.size().string()) // 1
env.out.print("The size of our second partitioned list (doesn't match predicate): " + partitioned_lists._2.size().string()) // 1
env.out.print("Our matching partition elements are:")
for n in partitioned_lists._1.values() do
env.out.print("\t" + n.string()) // Second BOOM!
end
class ref List[A: A] is
Seq[A] ref
Implements¶
Seq[A] ref
Constructors¶
create¶
[Source]
Always creates an empty list with 0 nodes, len is ignored.
Required method for List to satisfy the Seq interface.
let my_list = List[String]
new ref create(
len: USize val = 0)
: List[A] ref^
Parameters¶
len: USize val = 0
Returns¶
List[A] ref^
unit¶
[Source]
Creates a list with 1 node of element.
let my_list = List[String].unit("element")
new ref unit(
a: A)
: List[A] ref^
Parameters¶
a: A
Returns¶
List[A] ref^
from¶
[Source]
Creates a list equivalent to the provided Array (both node number and order are preserved).
let my_list = List[String].from(["a"; "b"; "c"])
new ref from(
seq: Array[A^] ref)
: List[A] ref^
Parameters¶
seq: Array[A^] ref
Returns¶
List[A] ref^
Public Functions¶
reserve¶
[Source]
Do nothing
Required method for List to satisfy the Seq interface.
fun ref reserve(
len: USize val)
: None val
Parameters¶
len: USize val
Returns¶
None val
size¶
[Source]
Returns the number of items in the list.
let my_list = List[String].from(["a"; "b"; "c"])
my_list.size() // 3
fun box size()
: USize val
Returns¶
USize val
apply¶
[Source]
Get the i-th element, raising an error if the index is out of bounds.
let my_list = List[String].from(["a"; "b"; "c"])
try my_list.apply(1)? end // "b"
fun box apply(
i: USize val = 0)
: this->A ?
Parameters¶
i: USize val = 0
Returns¶
this->A ?
update¶
[Source]
Change the i-th element, raising an error if the index is out of bounds, and
returning the previous value.
let my_list = List[String].from(["a"; "b"; "c"])
try my_list.update(1, "z")? end // Returns "b" and List now contains ["a"; "z"; "c"]
fun ref update(
i: USize val,
value: A)
: A^ ?
Parameters¶
i: USize val
value: A
Returns¶
A^ ?
index¶
[Source]
Gets the i-th node, raising an error if the index is out of bounds.
let my_list = List[String].from(["a"; "b"; "c"])
try my_list.index(0)? end // Returns a ListNode[String] containing "a"
fun box index(
i: USize val)
: this->ListNode[A] ref ?
Parameters¶
i: USize val
Returns¶
this->ListNode[A] ref ?
remove¶
[Source]
Remove the i-th node, raising an error if the index is out of bounds, and
returning the removed node.
let my_list = List[String].from(["a"; "b"; "c"])
try my_list.remove(0)? end // Returns a ListNode[String] containing "a" and List now contains ["b"; "c"]
fun ref remove(
i: USize val)
: ListNode[A] ref ?
Parameters¶
i: USize val
Returns¶
ListNode[A] ref ?
clear¶
[Source]
Empties the list.
fun ref clear()
: None val
Returns¶
None val
head¶
[Source]
Show the head of the list, raising an error if the head is empty.
let my_list = List[String].from(["a"; "b"; "c"])
try my_list.head()? end // Returns a ListNode[String] containing "a"
fun box head()
: this->ListNode[A] ref ?
Returns¶
this->ListNode[A] ref ?
tail¶
[Source]
Show the tail of the list, raising an error if the tail is empty.
let my_list = List[String].from(["a"; "b"; "c"])
try my_list.tail()? end // Returns a ListNode[String] containing "c"
fun box tail()
: this->ListNode[A] ref ?
Returns¶
this->ListNode[A] ref ?
prepend_node¶
[Source]
Adds a node to the head of the list.
let my_list = List[String].from(["a"; "b"; "c"])
let new_head = ListNode[String]("0")
my_list.prepend_node(new_head) // ["0", "a"; "b"; "c"]
fun ref prepend_node(
node: ListNode[A] ref)
: None val
Parameters¶
node: ListNode[A] ref
Returns¶
None val
append_node¶
[Source]
Adds a node to the tail of the list.
let my_list = List[String].from(["a"; "b"; "c"])
let new_tail = ListNode[String]("0")
my_list.append_node(new_head) // ["a"; "b"; "c", "0"]
fun ref append_node(
node: ListNode[A] ref)
: None val
Parameters¶
node: ListNode[A] ref
Returns¶
None val
append_list¶
[Source]
Empties the provided List by appending all elements onto the receiving List.
let my_list = List[String].from(["a"; "b"; "c"])
let other_list = List[String].from(["d"; "e"; "f"])
my_list.append_list(other_list) // my_list is ["a"; "b"; "c"; "d"; "e"; "f"], other_list is empty
fun ref append_list(
that: List[A] ref)
: None val
Parameters¶
that: List[A] ref
Returns¶
None val
prepend_list¶
[Source]
Empties the provided List by prepending all elements onto the receiving List.
let my_list = List[String].from(["a"; "b"; "c"])
let other_list = List[String].from(["d"; "e"; "f"])
my_list.prepend_list(other_list) // my_list is ["d"; "e"; "f"; "a"; "b"; "c"], other_list is empty
fun ref prepend_list(
that: List[A] ref)
: None val
Parameters¶
that: List[A] ref
Returns¶
None val
push¶
[Source]
Adds a new tail value.
let my_list = List[String].from(["a"; "b"; "c"])
my_list.push("d") // my_list is ["a"; "b"; "c"; "d"]
fun ref push(
a: A)
: None val
Parameters¶
a: A
Returns¶
None val
pop¶
[Source]
Removes the tail value, raising an error if the tail is empty.
let my_list = List[String].from(["a"; "b"; "c"])
try my_list.pop() end // Returns "c" and my_list is ["a"; "b"]
fun ref pop()
: A^ ?
Returns¶
A^ ?
unshift¶
[Source]
Adds a new head value.
let my_list = List[String].from(["a"; "b"; "c"])
my_list.unshift("d") // my_list is ["d"; "a"; "b"; "c"]
fun ref unshift(
a: A)
: None val
Parameters¶
a: A
Returns¶
None val
shift¶
[Source]
Removes the head value, raising an error if the head is empty.
let my_list = List[String].from(["a"; "b"; "c"])
try my_list.shift() end // Returns "a" and my_list is ["b"; "c"]
fun ref shift()
: A^ ?
Returns¶
A^ ?
append¶
[Source]
Append len elements from a sequence, starting from the given offset.
When len is -1, all elements of sequence are pushed.
Does not remove elements from sequence.
let my_list = List[String].from(["a"; "b"; "c"])
let other_list = List[String].from(["d"; "e"; "f"])
my_list.append(other_list) // my_list is ["a"; "b"; "c"; "d"; "e"; "f"], other_list is unchanged
fun ref append(
seq: (ReadSeq[A] box & ReadElement[A^] box),
offset: USize val = 0,
len: USize val = call)
: None val
Parameters¶
seq: (ReadSeq[A] box & ReadElement[A^] box)
offset: USize val = 0
len: USize val = call
Returns¶
None val
concat¶
[Source]
Add len iterated elements to the tail of the list, starting from the given
offset.
When len is -1, all elements of iterator are pushed.
Does not remove elements from iterator.
let my_list = List[String].from(["a"; "b"; "c"])
let other_list = List[String].from(["d"; "e"; "f"])
my_list.concat(other_list.values()) // my_list is ["a"; "b"; "c"; "d"; "e"; "f"], other_list is unchanged
fun ref concat(
iter: Iterator[A^] ref,
offset: USize val = 0,
len: USize val = call)
: None val
Parameters¶
iter: Iterator[A^] ref
offset: USize val = 0
len: USize val = call
Returns¶
None val
truncate¶
[Source]
Pop tail elements until the list is len size.
If the list is already smaller than len, do nothing.
let my_list = List[String].from(["a"; "b"; "c"])
my_list.truncate(1) // my_list is ["a"]
fun ref truncate(
len: USize val)
: None val
Parameters¶
len: USize val
Returns¶
None val
clone¶
[Source]
Clone all elements into a new List.
Note: elements are not copied, an additional reference to each element is created in the new List.
let my_list = List[String].from(["a"; "b"; "c"])
let other_list = my_list.clone() // my_list is ["a"; "b"; "c"], other_list is ["a"; "b"; "c"]
fun box clone()
: List[this->A!] ref^
Returns¶
List[this->A!] ref^
map[B: B]¶
[Source]
Builds a new List by applying a function to every element of the List.
let my_list = List[String].from(["a"; "b"; "c"])
let other_list = my_list.map[String]( {(s: String): String => "m: " + s } ) // other_list is ["m: a"; "m: b"; "m: c"]
fun box map[B: B](
f: {(this->A!): B^}[A, B] box)
: List[B] ref^
Parameters¶
f: {(this->A!): B^}[A, B] box
Returns¶
List[B] ref^
flat_map[B: B]¶
[Source]
Builds a new List by applying a function to every element of the List,
producing a new List for each element, then flattened into a single List.
let my_list = List[String].from(["a"; "b"; "c"])
let other_list = my_list.flat_map[String]( {(s: String): List[String] => List[String].from( ["m"; s] )} ) // other_list is ["m"; "a"; "m"; "b"; "m"; c"]
fun box flat_map[B: B](
f: {(this->A!): List[B]}[A, B] box)
: List[B] ref^
Parameters¶
f: {(this->A!): List[B]}[A, B] box
Returns¶
List[B] ref^
filter¶
[Source]
Builds a new List with those elements that satisfy the predicate.
let my_list = List[String].from(["a"; "b"; "c"])
let other_list = my_list.filter( {(s: String): Bool => s == "b" } ) // other_list is ["b"]
fun box filter(
f: {(this->A!): Bool}[A] box)
: List[this->A!] ref^
Parameters¶
f: {(this->A!): Bool}[A] box
Returns¶
List[this->A!] ref^
fold[B: B]¶
[Source]
Folds the elements of the List using the supplied function.
On the first iteration, the B argument in f is the value acc,
on the second iteration B is the result of the first iteration,
on the third iteration B is the result of the second iteration, and so on.
let my_list = List[String].from(["a"; "b"; "c"])
let folded = my_list.fold[String]( {(str: String, s: String): String => str + s }, "z") // "zabc"
fun box fold[B: B](
f: {(B!, this->A!): B^}[A, B] box,
acc: B)
: B
Parameters¶
f: {(B!, this->A!): B^}[A, B] box
acc: B
Returns¶
B
every¶
[Source]
Returns true if every element satisfies the predicate, otherwise returns false.
let my_list = List[String].from(["a"; "b"; "c"])
let all_z = my_list.every( {(s: String): Bool => s == "z"} ) // false
fun box every(
f: {(this->A!): Bool}[A] box)
: Bool val
Parameters¶
f: {(this->A!): Bool}[A] box
Returns¶
Bool val
exists¶
[Source]
Returns true if at least one element satisfies the predicate, otherwise returns false.
let my_list = List[String].from(["a"; "b"; "c"])
let b_exists = my_list.exists( {(s: String): Bool => s == "b"} ) // true
fun box exists(
f: {(this->A!): Bool}[A] box)
: Bool val
Parameters¶
f: {(this->A!): Bool}[A] box
Returns¶
Bool val
partition¶
[Source]
Builds a pair of Lists, the first of which is made up of the elements
satisfying the predicate and the second of which is made up of
those that do not.
let my_list = List[String].from(["a"; "b"; "c"])
(let lt_b, let gt_b) = my_list.partition( {(s: String): Bool => s < "b"} ) // lt_b is ["a"], while gt_b is ["b"; "c"]
fun box partition(
f: {(this->A!): Bool}[A] box)
: (List[this->A!] ref^ , List[this->A!] ref^)
Parameters¶
f: {(this->A!): Bool}[A] box
Returns¶
(List[this->A!] ref^ , List[this->A!] ref^)
drop¶
[Source]
Builds a List by dropping the first n elements.
let my_list = List[String].from(["a"; "b"; "c"])
let other_list = my_list.drop(1) // ["b"; "c"]
fun box drop(
n: USize val)
: List[this->A!] ref^
Parameters¶
n: USize val
Returns¶
List[this->A!] ref^
take¶
[Source]
Builds a List by keeping the first n elements.
let my_list = List[String].from(["a"; "b"; "c"])
let other_list = my_list.drop(1) // ["a"]
fun box take(
n: USize val)
: List[this->A!] ref
Parameters¶
n: USize val
Returns¶
List[this->A!] ref
take_while¶
[Source]
Builds a List of elements satisfying the predicate, stopping at the first false return.
let my_list = List[String].from(["a"; "b"; "c"])
let other_list = my_list.take_while( {(s: String): Bool => s < "b"} ) // ["a"]
fun box take_while(
f: {(this->A!): Bool}[A] box)
: List[this->A!] ref^
Parameters¶
f: {(this->A!): Bool}[A] box
Returns¶
List[this->A!] ref^
reverse¶
[Source]
Builds a new List by reversing the elements in the List.
let my_list = List[String].from(["a"; "b"; "c"])
let other_list = my_list.reverse() // ["c"; "b"; "a"]
fun box reverse()
: List[this->A!] ref^
Returns¶
List[this->A!] ref^
contains[optional B: (A & HasEq[A!] #read)]¶
[Source]
Returns true if the List contains the provided element, otherwise returns false.
let my_list = List[String].from(["a"; "b"; "c"])
let contains_b = my_list.contains[String]("b") // true
fun box contains[optional B: (A & HasEq[A!] #read)](
a: box->B)
: Bool val
Parameters¶
a: box->B
Returns¶
Bool val
nodes¶
[Source]
Return an iterator on the nodes in the List in forward order.
let my_list = List[String].from(["a"; "b"; "c"])
let nodes = my_list.nodes() // node with "a" is before node with "c"
fun box nodes()
: ListNodes[A, this->ListNode[A] ref] ref^
Returns¶
ListNodes[A, this->ListNode[A] ref] ref^
rnodes¶
[Source]
Return an iterator on the nodes in the List in reverse order.
let my_list = List[String].from(["a"; "b"; "c"])
let rnodes = my_list.rnodes() // node with "c" is before node with "a"
fun box rnodes()
: ListNodes[A, this->ListNode[A] ref] ref^
Returns¶
ListNodes[A, this->ListNode[A] ref] ref^
values¶
[Source]
Return an iterator on the values in the List in forward order.
let my_list = List[String].from(["a"; "b"; "c"])
let values = my_list.values() // value "a" is before value "c"
fun box values()
: ListValues[A, this->ListNode[A] ref] ref^
Returns¶
ListValues[A, this->ListNode[A] ref] ref^
rvalues¶
[Source]
Return an iterator on the values in the List in reverse order.
let my_list = List[String].from(["a"; "b"; "c"])
let rvalues = my_list.rvalues() // value "c" is before value "a"
fun box rvalues()
: ListValues[A, this->ListNode[A] ref] ref^
Returns¶
ListValues[A, this->ListNode[A] ref] ref^
| pony | 4228988 | https://sv.wikipedia.org/wiki/Agave%20subsimplex | Agave subsimplex | Agave subsimplex är en sparrisväxtart som beskrevs av William Trelease. Agave subsimplex ingår i släktet Agave och familjen sparrisväxter. Inga underarter finns listade i Catalogue of Life.
Källor
Sparrisväxter
subsimplex | swedish | 1.107628 |
Pony/builtin-I128-.txt |
I128¶
[Source]
primitive val I128 is
SignedInteger[I128 val, U128 val] val
Implements¶
SignedInteger[I128 val, U128 val] val
Constructors¶
create¶
[Source]
new val create(
value: I128 val)
: I128 val^
Parameters¶
value: I128 val
Returns¶
I128 val^
from[A: ((I8 val | I16 val | I32 val | I64 val | I128 val | ILong val | ISize val | U8 val | U16 val | U32 val | U64 val | U128 val | ULong val | USize val | F32 val | F64 val) & Real[A] val)]¶
[Source]
new val from[A: ((I8 val | I16 val | I32 val |
I64 val | I128 val | ILong val |
ISize val | U8 val | U16 val |
U32 val | U64 val | U128 val |
ULong val | USize val | F32 val |
F64 val) & Real[A] val)](
a: A)
: I128 val^
Parameters¶
a: A
Returns¶
I128 val^
min_value¶
[Source]
new val min_value()
: I128 val^
Returns¶
I128 val^
max_value¶
[Source]
new val max_value()
: I128 val^
Returns¶
I128 val^
Public Functions¶
abs¶
[Source]
fun box abs()
: U128 val
Returns¶
U128 val
bit_reverse¶
[Source]
fun box bit_reverse()
: I128 val
Returns¶
I128 val
bswap¶
[Source]
fun box bswap()
: I128 val
Returns¶
I128 val
popcount¶
[Source]
fun box popcount()
: U128 val
Returns¶
U128 val
clz¶
[Source]
fun box clz()
: U128 val
Returns¶
U128 val
ctz¶
[Source]
fun box ctz()
: U128 val
Returns¶
U128 val
clz_unsafe¶
[Source]
Unsafe operation.
If this is 0, the result is undefined.
fun box clz_unsafe()
: U128 val
Returns¶
U128 val
ctz_unsafe¶
[Source]
Unsafe operation.
If this is 0, the result is undefined.
fun box ctz_unsafe()
: U128 val
Returns¶
U128 val
bitwidth¶
[Source]
fun box bitwidth()
: U128 val
Returns¶
U128 val
bytewidth¶
[Source]
fun box bytewidth()
: USize val
Returns¶
USize val
min¶
[Source]
fun box min(
y: I128 val)
: I128 val
Parameters¶
y: I128 val
Returns¶
I128 val
max¶
[Source]
fun box max(
y: I128 val)
: I128 val
Parameters¶
y: I128 val
Returns¶
I128 val
fld¶
[Source]
fun box fld(
y: I128 val)
: I128 val
Parameters¶
y: I128 val
Returns¶
I128 val
fld_unsafe¶
[Source]
fun box fld_unsafe(
y: I128 val)
: I128 val
Parameters¶
y: I128 val
Returns¶
I128 val
mod¶
[Source]
fun box mod(
y: I128 val)
: I128 val
Parameters¶
y: I128 val
Returns¶
I128 val
mod_unsafe¶
[Source]
fun box mod_unsafe(
y: I128 val)
: I128 val
Parameters¶
y: I128 val
Returns¶
I128 val
hash¶
[Source]
fun box hash()
: USize val
Returns¶
USize val
hash64¶
[Source]
fun box hash64()
: U64 val
Returns¶
U64 val
string¶
[Source]
fun box string()
: String iso^
Returns¶
String iso^
mul¶
[Source]
fun box mul(
y: I128 val)
: I128 val
Parameters¶
y: I128 val
Returns¶
I128 val
divrem¶
[Source]
fun box divrem(
y: I128 val)
: (I128 val , I128 val)
Parameters¶
y: I128 val
Returns¶
(I128 val , I128 val)
div¶
[Source]
fun box div(
y: I128 val)
: I128 val
Parameters¶
y: I128 val
Returns¶
I128 val
rem¶
[Source]
fun box rem(
y: I128 val)
: I128 val
Parameters¶
y: I128 val
Returns¶
I128 val
mul_unsafe¶
[Source]
Unsafe operation.
If the operation overflows, the result is undefined.
fun box mul_unsafe(
y: I128 val)
: I128 val
Parameters¶
y: I128 val
Returns¶
I128 val
divrem_unsafe¶
[Source]
Unsafe operation.
If y is 0, the result is undefined.
If the operation overflows, the result is undefined.
fun box divrem_unsafe(
y: I128 val)
: (I128 val , I128 val)
Parameters¶
y: I128 val
Returns¶
(I128 val , I128 val)
div_unsafe¶
[Source]
Unsafe operation.
If y is 0, the result is undefined.
If the operation overflows, the result is undefined.
fun box div_unsafe(
y: I128 val)
: I128 val
Parameters¶
y: I128 val
Returns¶
I128 val
rem_unsafe¶
[Source]
Unsafe operation.
If y is 0, the result is undefined.
If the operation overflows, the result is undefined.
fun box rem_unsafe(
y: I128 val)
: I128 val
Parameters¶
y: I128 val
Returns¶
I128 val
f32¶
[Source]
fun box f32()
: F32 val
Returns¶
F32 val
f64¶
[Source]
fun box f64()
: F64 val
Returns¶
F64 val
f32_unsafe¶
[Source]
Unsafe operation.
If the value doesn't fit in the destination type, the result is undefined.
fun box f32_unsafe()
: F32 val
Returns¶
F32 val
f64_unsafe¶
[Source]
Unsafe operation.
If the value doesn't fit in the destination type, the result is undefined.
fun box f64_unsafe()
: F64 val
Returns¶
F64 val
addc¶
[Source]
fun box addc(
y: I128 val)
: (I128 val , Bool val)
Parameters¶
y: I128 val
Returns¶
(I128 val , Bool val)
subc¶
[Source]
fun box subc(
y: I128 val)
: (I128 val , Bool val)
Parameters¶
y: I128 val
Returns¶
(I128 val , Bool val)
mulc¶
[Source]
fun box mulc(
y: I128 val)
: (I128 val , Bool val)
Parameters¶
y: I128 val
Returns¶
(I128 val , Bool val)
divc¶
[Source]
fun box divc(
y: I128 val)
: (I128 val , Bool val)
Parameters¶
y: I128 val
Returns¶
(I128 val , Bool val)
remc¶
[Source]
fun box remc(
y: I128 val)
: (I128 val , Bool val)
Parameters¶
y: I128 val
Returns¶
(I128 val , Bool val)
fldc¶
[Source]
fun box fldc(
y: I128 val)
: (I128 val , Bool val)
Parameters¶
y: I128 val
Returns¶
(I128 val , Bool val)
modc¶
[Source]
fun box modc(
y: I128 val)
: (I128 val , Bool val)
Parameters¶
y: I128 val
Returns¶
(I128 val , Bool val)
add_partial¶
[Source]
fun box add_partial(
y: I128 val)
: I128 val ?
Parameters¶
y: I128 val
Returns¶
I128 val ?
sub_partial¶
[Source]
fun box sub_partial(
y: I128 val)
: I128 val ?
Parameters¶
y: I128 val
Returns¶
I128 val ?
mul_partial¶
[Source]
fun box mul_partial(
y: I128 val)
: I128 val ?
Parameters¶
y: I128 val
Returns¶
I128 val ?
div_partial¶
[Source]
fun box div_partial(
y: I128 val)
: I128 val ?
Parameters¶
y: I128 val
Returns¶
I128 val ?
rem_partial¶
[Source]
fun box rem_partial(
y: I128 val)
: I128 val ?
Parameters¶
y: I128 val
Returns¶
I128 val ?
divrem_partial¶
[Source]
fun box divrem_partial(
y: I128 val)
: (I128 val , I128 val) ?
Parameters¶
y: I128 val
Returns¶
(I128 val , I128 val) ?
fld_partial¶
[Source]
fun box fld_partial(
y: I128 val)
: I128 val ?
Parameters¶
y: I128 val
Returns¶
I128 val ?
mod_partial¶
[Source]
fun box mod_partial(
y: I128 val)
: I128 val ?
Parameters¶
y: I128 val
Returns¶
I128 val ?
shl¶
[Source]
fun box shl(
y: U128 val)
: I128 val
Parameters¶
y: U128 val
Returns¶
I128 val
shr¶
[Source]
fun box shr(
y: U128 val)
: I128 val
Parameters¶
y: U128 val
Returns¶
I128 val
shl_unsafe¶
[Source]
fun box shl_unsafe(
y: U128 val)
: I128 val
Parameters¶
y: U128 val
Returns¶
I128 val
shr_unsafe¶
[Source]
fun box shr_unsafe(
y: U128 val)
: I128 val
Parameters¶
y: U128 val
Returns¶
I128 val
add_unsafe¶
[Source]
fun box add_unsafe(
y: I128 val)
: I128 val
Parameters¶
y: I128 val
Returns¶
I128 val
sub_unsafe¶
[Source]
fun box sub_unsafe(
y: I128 val)
: I128 val
Parameters¶
y: I128 val
Returns¶
I128 val
neg_unsafe¶
[Source]
fun box neg_unsafe()
: I128 val
Returns¶
I128 val
op_and¶
[Source]
fun box op_and(
y: I128 val)
: I128 val
Parameters¶
y: I128 val
Returns¶
I128 val
op_or¶
[Source]
fun box op_or(
y: I128 val)
: I128 val
Parameters¶
y: I128 val
Returns¶
I128 val
op_xor¶
[Source]
fun box op_xor(
y: I128 val)
: I128 val
Parameters¶
y: I128 val
Returns¶
I128 val
op_not¶
[Source]
fun box op_not()
: I128 val
Returns¶
I128 val
add¶
[Source]
fun box add(
y: I128 val)
: I128 val
Parameters¶
y: I128 val
Returns¶
I128 val
sub¶
[Source]
fun box sub(
y: I128 val)
: I128 val
Parameters¶
y: I128 val
Returns¶
I128 val
neg¶
[Source]
fun box neg()
: I128 val
Returns¶
I128 val
eq¶
[Source]
fun box eq(
y: I128 val)
: Bool val
Parameters¶
y: I128 val
Returns¶
Bool val
ne¶
[Source]
fun box ne(
y: I128 val)
: Bool val
Parameters¶
y: I128 val
Returns¶
Bool val
lt¶
[Source]
fun box lt(
y: I128 val)
: Bool val
Parameters¶
y: I128 val
Returns¶
Bool val
le¶
[Source]
fun box le(
y: I128 val)
: Bool val
Parameters¶
y: I128 val
Returns¶
Bool val
ge¶
[Source]
fun box ge(
y: I128 val)
: Bool val
Parameters¶
y: I128 val
Returns¶
Bool val
gt¶
[Source]
fun box gt(
y: I128 val)
: Bool val
Parameters¶
y: I128 val
Returns¶
Bool val
i8¶
[Source]
fun box i8()
: I8 val
Returns¶
I8 val
i16¶
[Source]
fun box i16()
: I16 val
Returns¶
I16 val
i32¶
[Source]
fun box i32()
: I32 val
Returns¶
I32 val
i64¶
[Source]
fun box i64()
: I64 val
Returns¶
I64 val
i128¶
[Source]
fun box i128()
: I128 val
Returns¶
I128 val
ilong¶
[Source]
fun box ilong()
: ILong val
Returns¶
ILong val
isize¶
[Source]
fun box isize()
: ISize val
Returns¶
ISize val
u8¶
[Source]
fun box u8()
: U8 val
Returns¶
U8 val
u16¶
[Source]
fun box u16()
: U16 val
Returns¶
U16 val
u32¶
[Source]
fun box u32()
: U32 val
Returns¶
U32 val
u64¶
[Source]
fun box u64()
: U64 val
Returns¶
U64 val
u128¶
[Source]
fun box u128()
: U128 val
Returns¶
U128 val
ulong¶
[Source]
fun box ulong()
: ULong val
Returns¶
ULong val
usize¶
[Source]
fun box usize()
: USize val
Returns¶
USize val
i8_unsafe¶
[Source]
fun box i8_unsafe()
: I8 val
Returns¶
I8 val
i16_unsafe¶
[Source]
fun box i16_unsafe()
: I16 val
Returns¶
I16 val
i32_unsafe¶
[Source]
fun box i32_unsafe()
: I32 val
Returns¶
I32 val
i64_unsafe¶
[Source]
fun box i64_unsafe()
: I64 val
Returns¶
I64 val
i128_unsafe¶
[Source]
fun box i128_unsafe()
: I128 val
Returns¶
I128 val
ilong_unsafe¶
[Source]
fun box ilong_unsafe()
: ILong val
Returns¶
ILong val
isize_unsafe¶
[Source]
fun box isize_unsafe()
: ISize val
Returns¶
ISize val
u8_unsafe¶
[Source]
fun box u8_unsafe()
: U8 val
Returns¶
U8 val
u16_unsafe¶
[Source]
fun box u16_unsafe()
: U16 val
Returns¶
U16 val
u32_unsafe¶
[Source]
fun box u32_unsafe()
: U32 val
Returns¶
U32 val
u64_unsafe¶
[Source]
fun box u64_unsafe()
: U64 val
Returns¶
U64 val
u128_unsafe¶
[Source]
fun box u128_unsafe()
: U128 val
Returns¶
U128 val
ulong_unsafe¶
[Source]
fun box ulong_unsafe()
: ULong val
Returns¶
ULong val
usize_unsafe¶
[Source]
fun box usize_unsafe()
: USize val
Returns¶
USize val
compare¶
[Source]
fun box compare(
that: I128 val)
: (Less val | Equal val | Greater val)
Parameters¶
that: I128 val
Returns¶
(Less val | Equal val | Greater val)
| pony | 1182203 | https://sv.wikipedia.org/wiki/Svenska%20Superligan%202010/2011 | Svenska Superligan 2010/2011 | Svenska superligan 2010/2011 var Sveriges högsta serie i innebandy för herrar för säsongen 2010/2011. I augusti 2010 meddelade Västerås IB att man går i konkurs och att man således inte kommer att kunna ha kvar sitt lag i Superligan. Därmed tillfrågades KAIS Mora (som vunnit division 1 norra men som sedan åkt ut i kvalet) om de ville ta Västerås plats, vilket de tackade ja till. Storvreta IBK vann SM-guld efter seger i finalen mot Warberg IC.
Deltagande lag
AIK Innebandy
Balrog B/S
Caperiotäby FC
FC Helsingborg
Hide-a-lite Mullsjö AIS (Nykomlingar)
IBF Falun
IBK Dalen
IK Sirius IBK
KAIS Mora IF (Nykomlingar, tog konkursdrabbade Västerås plats)
Linköping IBK (Nykomlingar)
Pixbo Wallenstam IBK
Storvreta IBK (Regerande mästare)
Umeå City IBK
Warbergs IC 85
Tabell
Nr = Placering, S = Spelade, V = Vinster, O = Oavgjorda, F = Förluster, GM - IM = Gjorda mål - Insläppta mål, MSK = Målskillnad, P = Poäng
Slutspel
Kvartsfinaler
Warberg IC - Linköping IBK: 3-2 i matcher
Warberg IC - Linköping IBK: 9-1
Linköping IBK - Warberg IC: 6-4
Warberg IC - Linköping IBK: 8-6
Linköping IBK - Warberg IC: 6-3
Warberg IC - Linköping IBK: 6-3
IBF Falun - AIK Innebandy: 3-2 i matcher
AIK Innebandy - IBF Falun: 3-4
IBF Falun - AIK Innebandy: 5-6 (efter sudden death)
AIK Innebandy - IBF Falun: 6-5 (efter sudden death)
IBF Falun - AIK Innebandy: 9-3
AIK Innebandy - IBF Falun: 3-5 (efter straffar)
Storvreta IBK - Caperiotäby FC: 3-0 i matcher
Storvreta IBK - Caperiotäby FC: 4-2
Caperiotäby FC - Storvreta IBK: 4-6
Storvreta IBK - Caperiotäby FC: 7-6
Pixbo IBK - IBK Dalen: 3-1 i matcher
IBK Dalen - Pixbo IBK: 5-4 (efter sudden death)
Pixbo IBK - IBK Dalen: 7-4
IBK Dalen - Pixbo IBK: 6-8
Pixbo IBK - IBK Dalen: 5-4
Semifinaler
Warberg IC - IBF Falun: 3-1 i matcher
Warberg IC - IBF Falun: 5-6
IBF Falun - Warberg IC: 3-7
Warberg IC - IBF Falun: 6-4
IBF Falun - Warberg IC: 5-6
Storvreta IBK - Pixbo IBK: 3-0 i matcher
Storvreta IBK - Pixbo IBK: 5-3
Pixbo IBK - Storvreta IBK: 3-5
Storvreta IBK - Pixbo IBK: 8-3
Final
Matchen
SM-finalen spelades för i Malmö Arena, vilket är första gången som finalen för tidigare Elitserien och Svenska Superligan spelas utanför Stockholm. Matchen startade efter att damfinalen var avslutad och den officiella publiksiffran löd 11 253 personer. Finallagen blev till slut Warberg IC som i kvartsfinalen slagit ut Linköping IBK med 3-2 i matcher och sedan vunnit kvartsfinalen med 3-1 i matcher mot IBF Falun. Motståndare var Storvreta IBK som defilerat genom slutspelet, först kvartsfinalvinst mot Caperiotäby FC och sedan semifinalvinst mot Pixbo IBK, båda med 3-0 i matcher.
Matchen skulle komma att bli en av de mest dramatiska rysare som någonsin spelats. Warberg tog ledningen i ett powerplay efter bara några minuter. En liten stund senare kvitterade Storvreta och drog sedan ifrån till 1-3. Warberg reducerade med ett par minuter kvar av första perioden. Storvreta inledde målskyttet i andra perioden, men Warberg kontrade och lyckades till slut kvittera med 3:33 kvar. Inför tredje perioden var ställningen 4-4, men det tog bara ett par minuter för Storvreta att återta ledningen. Dock kvitterade Warberg nästan direkt, och tog ledningen ytterligare fem minuter senare. Storvreta svarade och gjorde två snabba mål (27 sekunders mellanrum). Matchen var inte över för det, utan Warberg kvitterade till 7-7 med fem och en halv minuts spel kvar.
Inget av lagen lyckades göra fler mål under ordinarie matchtid, utan det mest spännande var att en streakare med rosa kalsonger sprang in på planen med en halv minut kvar. Matchen gick till Sudden Death, i vilken dock inget lag lyckades göra mål. Storvreta tog Time Out åtta minuter in i förlängningen strax efter att Mika Kohonen blivit tacklad över sargen, något som Storvreta-spelarna ilsket hävdade borde varit utvisning.
Matchen gick då till straffar. I andra straffrundan satte både Warbergs Jim Canerstam och Storvretas Hannes Öhman sina straffar. Annars var stolparna på målvakternas sida, bland annat så räddade stolpen Storvreta från ett öppet mål då Storvretas målvakt blivit bortdribblad. Då inga fler mål gjordes på de ordinarie fem första straffarna så gick matchen till enskilda straffar. I sjunde straffrundan lyckades Jim Canerstam åter ta sig förbi målvakten och få in bollen i kassen. Domaren visade då på washout och alla undrade några sekunder varför. Reprisen visade tydligt att Canerstam dragit bollen snett bakåt, inte mycket, men så mycket att domaren upptäckte det. Öhman missade nästa straff och ställningen var fortfarande lika. I straffrunda åtta räddade Storvretas målvakt, och när Henrik Stenberg satte sin straff, var matchen avgjord.
Utvisningar
03:40 - Joel Kanebjörk, Storvreta (Otillåten trängning)
27:46 - Fredrik Holtz, Storvreta (Hands)
42:00 - Henrik Olofsson, Warberg (Upprepade förseelser)
Resultat
Sport i Sverige 2010
Sport i Sverige 2011
Innebandysäsongen 2010/2011
2010/2011 | swedish | 1.179303 |
Pony/10_partial-application.txt | # Partial Application
Partial application lets us supply _some_ of the arguments to a constructor, function, or behaviour, and get back something that lets us supply the rest of the arguments later.
## A simple case
A simple case is to create a "callback" function. For example:
```pony
class Foo
var _f: F64 = 0
fun ref addmul(add: F64, mul: F64): F64 =>
_f = (_f + add) * mul
class Bar
fun apply() =>
let foo: Foo = Foo
let f = foo~addmul(3)
f(4)
```
This is a bit of a silly example, but hopefully, the idea is clear. We partially apply the `addmul` function on `foo`, binding the receiver to `foo` and the `add` argument to `3`. We get back an object, `f`, that has an `apply` method that takes a `mul` argument. When it's called, it in turn calls `foo.addmul(3, mul)`.
We can also bind all the arguments:
```pony
let f = foo~addmul(3, 4)
f()
```
Or even none of the arguments:
```pony
let f = foo~addmul()
f(3, 4)
```
## Out of order arguments
Partial application with named arguments allows binding arguments in any order, not just left to right. For example:
```pony
let f = foo~addmul(where mul = 4)
f(3)
```
Here, we bound the `mul` argument but left `add` unbound.
## Partial application is just a lambda
Under the hood, we're assembling an object literal for partial application, just as if you had written a lambda yourself. It captures aliases of some of the lexical scope as fields and has an `apply` function that takes some, possibly reduced, number of arguments. This is actually done as sugar, by rewriting the abstract syntax tree for partial application to be an object literal, before code generation.
That means partial application results in an anonymous class and returns a `ref`. If you need another reference capability, you can wrap partial application in a `recover` expression. It also means that we can't consume unique fields for a lambda, as the apply method might be called many times.
## Partially applying a partial application
Since partial application results in an object with an apply method, we can partially apply the result!
```pony
let f = foo~addmul()
let f2 = f~apply(where mul = 4)
f2(3)
```
| pony | 652206 | https://da.wikipedia.org/wiki/Funktionsapplikation | Funktionsapplikation | Inden for matematik er funktionsapplikation eller funktionsanvendelse synonyme og beskriver det at man anvender/bruger en funktion på en værdi fra funktionens definitionsmængde for at opnå en værdi fra funktionens værdimængde.
Funktionsapplikation foregår også i funktionsprogrammering hvor højereordensfunktioner kan tage andre funktioner som argument. I Lambda-kalkulus er funktionsapplikation udtrykt som en β-reduktion (Beta-reduktion). I Curry-Howard-isomorfien relateres funktionsapplikation til den logiske regel modus ponens.
Repræsentation
Den typiske notation for funktionsanvendelse er f(x) hvor f er funktionen og x er værdien som funktionen anvendes på. Nogle gange nøjes man med at skrive f x, hvilket kan være nyttigt når man udfører currying. Her kan man se dette mellemrum som en operator ligesom + og ×.
Applikation som operator
For at demonstrere at mellemrummet kan ses som en operator, kunne man definere en mere synlig operator $ til at gøre det samme: f $ x = f(x). Her betyder f $ 2 altså "f anvendt på to". Denne $-operator viser sig at være nyttig hvis man samtidigt giver den lav operatorpræcedens og gør den højreassociativ. Hvis man har et matematisk udtryk som f(g(h(j(x)))) vil det kunne omskrives til f $ g $ h $ j $ x. Dette er ved hjælp af funktionskomposition mere tydeligt hvis man skriver (f◦g◦h◦j)(x), altså den sammensatte funktion f◦g◦h◦j anvendt på x. Med $-operatoren vil det også kunne udtrykkes f◦g◦h◦j $ x.
Flere funktionsprogrammeringssprog anvender $ som operator til funktionsanvendelse. For eksempel er den på forhånd defineret i standardbiblioteket for programmeringssproget Haskell.
Matematik | danish | 0.703782 |
Pony/src-collections-map-.txt |
map.pony
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479primitive _MapEmpty
primitive _MapDeleted
type Map[K: (Hashable #read & Equatable[K] #read), V] is
HashMap[K, V, HashEq[K]]
"""
This is a map that uses structural equality on the key.
"""
type MapIs[K, V] is HashMap[K, V, HashIs[K]]
"""
This is a map that uses identity comparison on the key.
"""
class HashMap[K, V, H: HashFunction[K] val]
"""
A quadratic probing hash map. Resize occurs at a load factor of 0.75. A
resized map has 2 times the space. The hash function can be plugged in to the
type to create different kinds of maps.
"""
var _size: USize = 0
var _array: Array[((K, V) | _MapEmpty | _MapDeleted)]
new create(prealloc: USize = 6) =>
"""
Create an array with space for prealloc elements without triggering a
resize. Defaults to 6.
"""
let len = (prealloc * 4) / 3
let n = len.max(8).next_pow2()
_array = _array.init(_MapEmpty, n)
fun size(): USize =>
"""
The number of items in the map.
"""
_size
fun space(): USize =>
"""
The available space in the map. Resize will happen when
size / space >= 0.75.
"""
_array.space()
fun apply(key: box->K!): this->V ? =>
"""
Gets a value from the map. Raises an error if no such item exists.
"""
(let i, let found) = _search(key)
if found then
_array(i)? as (_, this->V)
else
error
end
fun ref update(key: K, value: V): (V^ | None) =>
"""
Sets a value in the map. Returns the old value if there was one, otherwise
returns None. If there was no previous value, this may trigger a resize.
"""
try
(let i, let found) = _search(key)
match _array(i)? = (consume key, consume value)
| (_, let v: V) =>
return consume v
else
_size = _size + 1
if (_size * 4) > (_array.size() * 3) then
_resize(_array.size() * 2)
end
end
end
fun ref upsert(key: K, value: V, f: {(V, V): V^} box): V! =>
"""
Combines a provided value with the current value for the provided key
using the provided function. If the provided key has not been added to
the map yet, it sets its value to the provided value and ignores the
provided function.
As a simple example, say we had a map with I64 values and we wanted to
add 4 to the current value for key "test", which let's say is currently 2.
We call
m.upsert("test", 4, {(current, provided) => current + provided })
This changes the value associated with "test" to 6.
If we have not yet added the key "new-key" to the map and we call
m.upsert("new-key", 4, {(current, provided) => current + provided })
then "new-key" is added to the map with a value of 4.
Returns the value that we set the key to
"""
(let i, let found) = _search(key)
let value' = value
try
if found then
(let pkey, let pvalue) = (_array(i)? = _MapEmpty) as (K^, V^)
let new_value = f(consume pvalue, consume value)
let new_value' = new_value
_array(i)? = (consume pkey, consume new_value)
return _array(i)? as (_, V)
else
let key' = key
_array(i)? = (consume key, consume value)
_size = _size + 1
if (_size * 4) > (_array.size() * 3) then
_resize(_array.size() * 2)
end
end
value'
else
// This is unreachable, since index will never be out-of-bounds
value'
end
fun ref insert(key: K, value: V): V! =>
"""
Set a value in the map. Returns the new value, allowing reuse.
"""
let value' = value
try
(let i, let found) = _search(key)
let key' = key
_array(i)? = (consume key, consume value)
if not found then
_size = _size + 1
if (_size * 4) > (_array.size() * 3) then
_resize(_array.size() * 2)
end
end
value'
else
// This is unreachable, since index will never be out-of-bounds.
value'
end
fun ref insert_if_absent(key: K, value: V): V! =>
"""
Set a value in the map if the key doesn't already exist in the Map.
Saves an extra lookup when doing a pattern like:
```pony
if not my_map.contains(my_key) then
my_map(my_key) = my_value
end
```
Returns the value, the same as `insert`, allowing 'insert_if_absent'
to be used as a drop-in replacement for `insert`.
"""
let value' = value
try
(let i, let found) = _search(key)
let key' = key
if not found then
_array(i)? = (consume key, consume value)
_size = _size + 1
if (_size * 4) > (_array.size() * 3) then
_resize(_array.size() * 2)
end
end
_array(i)? as (_, V)
else
// This is unreachable, since index will never be out-of-bounds.
value'
end
fun ref remove(key: box->K!): (K^, V^) ? =>
"""
Delete a value from the map and return it. Raises an error if there was no
value for the given key.
"""
try
(let i, let found) = _search(key)
if found then
_size = _size - 1
match _array(i)? = _MapDeleted
| (let k: K, let v: V) =>
return (consume k, consume v)
end
end
end
error
fun get_or_else(key: box->K!, alt: this->V): this->V =>
"""
Get the value associated with provided key if present. Otherwise,
return the provided alternate value.
"""
(let i, let found) = _search(key)
if found then
try
_array(i)? as (_, this->V)
else
// This should never happen as we have already
// proven that _array(i) exists
consume alt
end
else
consume alt
end
fun contains(k: box->K!): Bool =>
"""
Checks whether the map contains the key k
"""
(_, let found) = _search(k)
found
fun ref concat(iter: Iterator[(K^, V^)]) =>
"""
Add K, V pairs from the iterator to the map.
"""
for (k, v) in iter do
this(consume k) = consume v
end
fun add[H2: HashFunction[this->K!] val = H](
key: this->K!,
value: this->V!)
: HashMap[this->K!, this->V!, H2]^
=>
"""
This with the new (key, value) mapping.
"""
let r = clone[H2]()
r(key) = value
r
fun sub[H2: HashFunction[this->K!] val = H](key: this->K!)
: HashMap[this->K!, this->V!, H2]^
=>
"""
This without the given key.
"""
let r = clone[H2]()
try r.remove(key)? end
r
fun next_index(prev: USize = -1): USize ? =>
"""
Given an index, return the next index that has a populated key and value.
Raise an error if there is no next populated index.
"""
for i in Range(prev + 1, _array.size()) do
match _array(i)?
| (_, _) => return i
end
end
error
fun index(i: USize): (this->K, this->V) ? =>
"""
Returns the key and value at a given index.
Raise an error if the index is not populated.
"""
_array(i)? as (this->K, this->V)
fun ref compact() =>
"""
Minimise the memory used for the map.
"""
_resize(((_size * 4) / 3).next_pow2().max(8))
fun clone[H2: HashFunction[this->K!] val = H]()
: HashMap[this->K!, this->V!, H2]^
=>
"""
Create a clone. The key and value types may be different due to aliasing
and viewpoint adaptation.
"""
let r = HashMap[this->K!, this->V!, H2](_size)
for (k, v) in pairs() do
r(k) = v
end
r
fun ref clear() =>
"""
Remove all entries.
"""
_size = 0
// Our default prealloc of 6 corresponds to an array alloc size of 8.
let n: USize = 8
_array = _array.init(_MapEmpty, n)
fun _search(key: box->K!): (USize, Bool) =>
"""
Return a slot number and whether or not it's currently occupied.
"""
var idx_del = _array.size()
let mask = idx_del - 1
let h = H.hash(key).usize()
var idx = h and mask
try
for i in Range(0, _array.size()) do
let entry = _array(idx)?
match entry
| (let k: this->K!, _) =>
if H.eq(k, key) then
return (idx, true)
end
| _MapEmpty =>
if idx_del <= mask then
return (idx_del, false)
else
return (idx, false)
end
| _MapDeleted =>
if idx_del > mask then
idx_del = idx
end
end
idx = (h + ((i + (i * i)) / 2)) and mask
end
end
(idx_del, false)
fun ref _resize(len: USize) =>
"""
Change the available space.
"""
let old = _array
let old_len = old.size()
_array = _array.init(_MapEmpty, len)
_size = 0
try
for i in Range(0, old_len) do
match old(i)? = _MapDeleted
| (let k: K, let v: V) =>
this(consume k) = consume v
end
end
end
fun keys(): MapKeys[K, V, H, this->HashMap[K, V, H]]^ =>
"""
Return an iterator over the keys.
"""
MapKeys[K, V, H, this->HashMap[K, V, H]](this)
fun values(): MapValues[K, V, H, this->HashMap[K, V, H]]^ =>
"""
Return an iterator over the values.
"""
MapValues[K, V, H, this->HashMap[K, V, H]](this)
fun pairs(): MapPairs[K, V, H, this->HashMap[K, V, H]]^ =>
"""
Return an iterator over the keys and values.
"""
MapPairs[K, V, H, this->HashMap[K, V, H]](this)
class MapKeys[K, V, H: HashFunction[K] val, M: HashMap[K, V, H] #read] is
Iterator[M->K]
"""
An iterator over the keys in a map.
"""
let _map: M
var _i: USize = -1
var _count: USize = 0
new create(map: M) =>
"""
Creates an iterator for the given map.
"""
_map = map
fun has_next(): Bool =>
"""
True if it believes there are remaining entries. May not be right if values
were added or removed from the map.
"""
_count < _map.size()
fun ref next(): M->K ? =>
"""
Returns the next key, or raises an error if there isn't one. If keys are
added during iteration, this may not return all keys.
"""
_i = _map.next_index(_i)?
_count = _count + 1
_map.index(_i)?._1
class MapValues[K, V, H: HashFunction[K] val, M: HashMap[K, V, H] #read] is
Iterator[M->V]
"""
An iterator over the values in a map.
"""
let _map: M
var _i: USize = -1
var _count: USize = 0
new create(map: M) =>
"""
Creates an iterator for the given map.
"""
_map = map
fun has_next(): Bool =>
"""
True if it believes there are remaining entries. May not be right if values
were added or removed from the map.
"""
_count < _map.size()
fun ref next(): M->V ? =>
"""
Returns the next value, or raises an error if there isn't one. If values
are added during iteration, this may not return all values.
"""
_i = _map.next_index(_i)?
_count = _count + 1
_map.index(_i)?._2
class MapPairs[K, V, H: HashFunction[K] val, M: HashMap[K, V, H] #read] is
Iterator[(M->K, M->V)]
"""
An iterator over the keys and values in a map.
"""
let _map: M
var _i: USize = -1
var _count: USize = 0
new create(map: M) =>
"""
Creates an iterator for the given map.
"""
_map = map
fun has_next(): Bool =>
"""
True if it believes there are remaining entries. May not be right if values
were added or removed from the map.
"""
_count < _map.size()
fun ref next(): (M->K, M->V) ? =>
"""
Returns the next entry, or raises an error if there isn't one. If entries
are added during iteration, this may not return all entries.
"""
_i = _map.next_index(_i)?
_count = _count + 1
_map.index(_i)?
| pony | 4620185 | https://sv.wikipedia.org/wiki/Hibiscus%20cerradoensis | Hibiscus cerradoensis | Hibiscus cerradoensis är en malvaväxtart som beskrevs av M.Y. Menzel, P.A. Fryxell och F.D. Wilson. Hibiscus cerradoensis ingår i Hibiskussläktet som ingår i familjen malvaväxter. Inga underarter finns listade i Catalogue of Life.
Källor
Hibiskussläktet
cerradoensis | swedish | 1.286245 |
Pony/files-FileTime-.txt |
FileTime¶
[Source]
primitive val FileTime
Constructors¶
create¶
[Source]
new val create()
: FileTime val^
Returns¶
FileTime val^
Public Functions¶
value¶
[Source]
fun box value()
: U32 val
Returns¶
U32 val
eq¶
[Source]
fun box eq(
that: FileTime val)
: Bool val
Parameters¶
that: FileTime val
Returns¶
Bool val
ne¶
[Source]
fun box ne(
that: FileTime val)
: Bool val
Parameters¶
that: FileTime val
Returns¶
Bool val
| pony | 823780 | https://sv.wikipedia.org/wiki/Vallokalsunders%C3%B6kning | Vallokalsundersökning | En vallokalsundersökning är en opinionsundersökning som görs bland väljare som nyss avgivit sin röst. Det är en snabb metod att få indikationer om valresultatet och dess variation bland olika väljargrupper
Valu är Sveriges Televisions Vallokalsundersökningar. De har genomförts sedan 1991 med väljare utanför vallokaler vid riksdagsval, EUP-val och folkomröstningar.
Vallokalsundersökningar i Riksdagsval i Sverige
SVT VALU den 15 september 2002, Riksdagsvalet 2002
Så röstade de 8 936 tillfrågade med sina poströster och människor i 80 vallokaler.
Vallokalsundersökningen fick en fullträff på Moderaterna: 15,2 procent (Som blev verkligt valresultat för Moderaterna). Undersökningen uppmärksammade även Folkpartiets snabba framryckning men lyckades inte riktigt fånga upp den tillbakaströmningen som gått från vänsterpartiet tillbaka till Socialdemokraterna, Vänsterpartiets tillbakagång och Socialdemokraternas framgångar.
SVT:s VALU den 17 september 2006, Riksdagsvalet 2006
Så röstade de 12 316 tillfrågade med sina poströster och människor i 90 vallokaler.
Vallokalsundersökningen uppmärksammade allting och gav en korrekt fingervisning och antydde på en borgerlig seger. När sedan under valnatten då rösterna räknades och det rapporterades in så såg det länge ut som att de röda kunde sitta kvar men sedan senare så började det gå tillbaka och bli mer likt vallokalsundersökningen.
Övriga partier
Vallokalsundersökningar i Riksdagsvalet 2010
När vallokalerna stängdes klockan 20:00 på kvällen den 19 september 2010, visade SVT (VALU) och TV4 sina vallokalsundersökningar.
Vallokalsundersökningar i Riksdagsval 2014
När vallokalerna stängdes klockan 20:00 på kvällen den 14 september 2014, visade SVT (Valu) och TV4 sina vallokalsundersökningar.
Viktiga frågor för valet av parti i riksdagsvalet 2014, Valu
Oviktad Valu resultat.
’Fråga: Vilken betydelse har följande frågor för Ditt val av parti i riksdagvalet idag?’
Kommentar: Valu-frågan också innehöll svarsalternativen ”ganska stor betydelse”, ”varken stor eller liten betydelse”, ”ganska liten betydelse” och ”mycket liten betydelse.
Referenser
Externa länkar
Valu 2010, https://web.archive.org/web/20111010140112/http://svt.se/content/1/c8/02/15/63/14/ValuResultat2010_100921.pdf
Opinionsundersökningar | swedish | 1.09189 |
Pony/collections-BinaryHeap-.txt |
BinaryHeap[A: Comparable[A] #read, P: (_BinaryHeapPriority[A] val & (MinHeapPriority[A] val | MaxHeapPriority[A] val))]¶
[Source]
A priority queue implemented as a binary heap. The BinaryHeapPriority type
parameter determines whether this is max-heap or a min-heap.
class ref BinaryHeap[A: Comparable[A] #read, P: (_BinaryHeapPriority[A] val & (MinHeapPriority[A] val | MaxHeapPriority[A] val))]
Constructors¶
create¶
[Source]
Create an empty heap with space for len elements.
new ref create(
len: USize val)
: BinaryHeap[A, P] ref^
Parameters¶
len: USize val
Returns¶
BinaryHeap[A, P] ref^
Public Functions¶
clear¶
[Source]
Remove all elements from the heap.
fun ref clear()
: None val
Returns¶
None val
size¶
[Source]
Return the number of elements in the heap.
fun box size()
: USize val
Returns¶
USize val
peek¶
[Source]
Return the highest priority item in the heap. For max-heaps, the greatest
item will be returned. For min-heaps, the smallest item will be returned.
fun box peek()
: this->A ?
Returns¶
this->A ?
push¶
[Source]
Push an item into the heap.
The time complexity of this operation is O(log(n)) with respect to the size
of the heap.
fun ref push(
value: A)
: None val
Parameters¶
value: A
Returns¶
None val
pop¶
[Source]
Remove the highest priority value from the heap and return it. For
max-heaps, the greatest item will be returned. For min-heaps, the smallest
item will be returned.
The time complexity of this operation is O(log(n)) with respect to the size
of the heap.
fun ref pop()
: A^ ?
Returns¶
A^ ?
append¶
[Source]
Append len elements from a sequence, starting from the given offset.
fun ref append(
seq: (ReadSeq[A] box & ReadElement[A^] box),
offset: USize val = 0,
len: USize val = call)
: None val
Parameters¶
seq: (ReadSeq[A] box & ReadElement[A^] box)
offset: USize val = 0
len: USize val = call
Returns¶
None val
concat¶
[Source]
Add len iterated elements, starting from the given offset.
fun ref concat(
iter: Iterator[A^] ref,
offset: USize val = 0,
len: USize val = call)
: None val
Parameters¶
iter: Iterator[A^] ref
offset: USize val = 0
len: USize val = call
Returns¶
None val
values¶
[Source]
Return an iterator for the elements in the heap. The order of elements is
arbitrary.
fun box values()
: ArrayValues[A, this->Array[A] ref] ref^
Returns¶
ArrayValues[A, this->Array[A] ref] ref^
| pony | 4228988 | https://sv.wikipedia.org/wiki/Agave%20subsimplex | Agave subsimplex | Agave subsimplex är en sparrisväxtart som beskrevs av William Trelease. Agave subsimplex ingår i släktet Agave och familjen sparrisväxter. Inga underarter finns listade i Catalogue of Life.
Källor
Sparrisväxter
subsimplex | swedish | 1.107628 |
Pony/format-FormatHexSmall-.txt |
FormatHexSmall¶
[Source]
primitive val FormatHexSmall is
FormatSpec val
Implements¶
FormatSpec val
Constructors¶
create¶
[Source]
new val create()
: FormatHexSmall val^
Returns¶
FormatHexSmall val^
Public Functions¶
eq¶
[Source]
fun box eq(
that: FormatHexSmall val)
: Bool val
Parameters¶
that: FormatHexSmall val
Returns¶
Bool val
ne¶
[Source]
fun box ne(
that: FormatHexSmall val)
: Bool val
Parameters¶
that: FormatHexSmall val
Returns¶
Bool val
| pony | 1059870 | https://sv.wikipedia.org/wiki/Munktells%20Typ%2030 | Munktells Typ 30 | Munktells Typ 30 var en traktor tillverkad 1927-1935 av Munktells Mekaniska Verkstad i Eskilstuna. Den var till både till utseende och uppbyggnad lik den mindre Typ 22, men var en större och kraftigare maskin. Motorn var tvåcylindrig tvåtakts tändkulemotor med en maximal effekt på 36 hk. Namnet Typ 30 kom av att motorn ansågs ge 30 hk vid "normal belastning". Efter 442 exemplar upphörde tillverkningen 1935 utan att modellen fick någon egentlig ersättare.
Tekniska data Munktells Typ 30
Motor:
Beteckning: Munktells Typ 30 hk
Typ: Tvåcylindrig tvåtakts tändkulemotor med sidoinsprutning
Bränsle: Råolja (diesel)
Cylindervolym: 10,2 l
Max effekt: 36 hk
Transmission:
Växlar: 3 fram, 1 back
Drivning: Bakhjulsdrift
Produktion
Tillverkningsår: 1927-1935
Antal tillverkade: 442
Källor
Från Munktells till Valmet av Olov Hedell, 1994,
Se även
Lista över BM traktormodeller
Externa länkar
Typ 30 hk - Volvo Construction Equipment historisk sida med teknisk information, broschyr (PDF), etc.
Typ 30 | swedish | 1.076596 |
Pony/files-Directory-.txt |
Directory¶
[Source]
Operations on a directory.
The directory-relative functions (open, etc) use the *at interface on FreeBSD
and Linux. This isn't available on OS X prior to 10.10, so it is not used. On
FreeBSD, this allows the directory-relative functions to take advantage of
Capsicum.
class ref Directory
Constructors¶
create¶
[Source]
This will raise an error if the path doesn't exist or it is not a
directory, or if FileRead or FileStat permission isn't available.
new ref create(
from: FilePath val)
: Directory ref^ ?
Parameters¶
from: FilePath val
Returns¶
Directory ref^ ?
Public fields¶
let path: FilePath val¶
[Source]
This is the filesystem path locating this directory on the file system
and an object capability granting access to operate on this directory.
Public Functions¶
entries¶
[Source]
The entries will include everything in the directory, but it is not
recursive. The path for the entry will be relative to the directory, so it
will contain no directory separators. The entries will not include "." or
"..".
fun box entries()
: Array[String val] iso^ ?
Returns¶
Array[String val] iso^ ?
open¶
[Source]
Open a directory relative to this one. Raises an error if the path is not
within this directory hierarchy.
fun box open(
target: String val)
: Directory iso^ ?
Parameters¶
target: String val
Returns¶
Directory iso^ ?
mkdir¶
[Source]
Creates a directory relative to this one. Returns false if the path is
not within this directory hierarchy or if FileMkdir permission is missing.
fun box mkdir(
target: String val)
: Bool val
Parameters¶
target: String val
Returns¶
Bool val
create_file¶
[Source]
Open for read/write, creating if it doesn't exist, preserving the contents
if it does exist.
fun box create_file(
target: String val)
: File iso^ ?
Parameters¶
target: String val
Returns¶
File iso^ ?
open_file¶
[Source]
Open for read only, failing if it doesn't exist.
fun box open_file(
target: String val)
: File iso^ ?
Parameters¶
target: String val
Returns¶
File iso^ ?
info¶
[Source]
Return a FileInfo for this directory. Raise an error if the fd is invalid
or if we don't have FileStat permission.
fun box info()
: FileInfo val ?
Returns¶
FileInfo val ?
chmod¶
[Source]
Set the FileMode for this directory.
fun box chmod(
mode: FileMode box)
: Bool val
Parameters¶
mode: FileMode box
Returns¶
Bool val
chown¶
[Source]
Set the owner and group for this directory. Does nothing on Windows.
fun box chown(
uid: U32 val,
gid: U32 val)
: Bool val
Parameters¶
uid: U32 val
gid: U32 val
Returns¶
Bool val
touch¶
[Source]
Set the last access and modification times of the directory to now.
fun box touch()
: Bool val
Returns¶
Bool val
set_time¶
[Source]
Set the last access and modification times of the directory to the given
values.
fun box set_time(
atime: (I64 val , I64 val),
mtime: (I64 val , I64 val))
: Bool val
Parameters¶
atime: (I64 val , I64 val)
mtime: (I64 val , I64 val)
Returns¶
Bool val
infoat¶
[Source]
Return a FileInfo for some path relative to this directory.
fun box infoat(
target: String val)
: FileInfo val ?
Parameters¶
target: String val
Returns¶
FileInfo val ?
chmodat¶
[Source]
Set the FileMode for some path relative to this directory.
fun box chmodat(
target: String val,
mode: FileMode box)
: Bool val
Parameters¶
target: String val
mode: FileMode box
Returns¶
Bool val
chownat¶
[Source]
Set the FileMode for some path relative to this directory.
fun box chownat(
target: String val,
uid: U32 val,
gid: U32 val)
: Bool val
Parameters¶
target: String val
uid: U32 val
gid: U32 val
Returns¶
Bool val
touchat¶
[Source]
Set the last access and modification times of the directory to now.
fun box touchat(
target: String val)
: Bool val
Parameters¶
target: String val
Returns¶
Bool val
set_time_at¶
[Source]
Set the last access and modification times of the directory to the given
values.
fun box set_time_at(
target: String val,
atime: (I64 val , I64 val),
mtime: (I64 val , I64 val))
: Bool val
Parameters¶
target: String val
atime: (I64 val , I64 val)
mtime: (I64 val , I64 val)
Returns¶
Bool val
symlink¶
[Source]
Link the source path to the link_name, where the link_name is relative to
this directory.
fun box symlink(
source: FilePath val,
link_name: String val)
: Bool val
Parameters¶
source: FilePath val
link_name: String val
Returns¶
Bool val
remove¶
[Source]
Remove the file or directory. The directory contents will be removed as
well, recursively. Symlinks will be removed but not traversed.
fun box remove(
target: String val)
: Bool val
Parameters¶
target: String val
Returns¶
Bool val
rename¶
[Source]
Rename source (which is relative to this directory) to target (which is
relative to the to directory).
fun box rename(
source: String val,
to: Directory box,
target: String val)
: Bool val
Parameters¶
source: String val
to: Directory box
target: String val
Returns¶
Bool val
dispose¶
[Source]
Close the directory.
fun ref dispose()
: None val
Returns¶
None val
| pony | 2151047 | https://sv.wikipedia.org/wiki/Callipallene%20fallax | Callipallene fallax | Callipallene fallax är en havsspindelart som beskrevs av Stock, J.H. 1994. Callipallene fallax ingår i släktet Callipallene och familjen Callipallenidae. Inga underarter finns listade.
Källor
Havsspindlar
fallax | swedish | 1.32667 |
Pony/builtin-Array-.txt |
Array[A: A]¶
[Source]
Contiguous, resizable memory to store elements of type A.
Usage¶
Creating an Array of String:
let array: Array[String] = ["dog"; "cat"; "wombat"]
// array.size() == 3
// array.space() >= 3
Creating an empty Array of String, which may hold at least 10 elements before
requesting more space:
let array = Array[String](10)
// array.size() == 0
// array.space() >= 10
Accessing elements can be done via the apply(i: USize): this->A ? method.
The provided index might be out of bounds so apply is partial and has to be
called within a try-catch block or inside another partial method:
let array: Array[String] = ["dog"; "cat"; "wombat"]
let is_second_element_wobat = try
// indexes start from 0, so 1 is the second element
array(1)? == "wombat"
else
false
end
Adding and removing elements to and from the end of the Array can be done via
push and pop methods. You could treat the array as a LIFO stack using
those methods:
while (array.size() > 0) do
let elem = array.pop()?
// do something with element
end
Modifying the Array can be done via update, insert and delete methods
which alter the Array at an arbitrary index, moving elements left (when
deleting) or right (when inserting) as necessary.
Iterating over the elements of an Array can be done using the values method:
for element in array.values() do
// do something with element
end
Memory allocation¶
Array allocates contiguous memory. It always allocates at least enough memory
space to hold all of its elements. Space is the number of elements the Array
can hold without allocating more memory. The space() method returns the
number of elements an Array can hold. The size() method returns the number
of elements the Array holds.
Different data types require different amounts of memory. Array[U64] with size
of 6 will take more memory than an Array[U8] of the same size.
When creating an Array or adding more elements will calculate the next power
of 2 of the requested number of elements and allocate that much space, with a
lower bound of space for 8 elements.
Here's a few examples of the space allocated when initialising an Array with
various number of elements:
size
space
0
0
1
8
8
8
9
16
16
16
17
32
Call the compact() method to ask the GC to reclaim unused space. There are
no guarantees that the GC will actually reclaim any space.
class ref Array[A: A] is
Seq[A] ref
Implements¶
Seq[A] ref
Constructors¶
create¶
[Source]
Create an array with zero elements, but space for len elements.
new ref create(
len: USize val = 0)
: Array[A] ref^
Parameters¶
len: USize val = 0
Returns¶
Array[A] ref^
init¶
[Source]
Create an array of len elements, all initialised to the given value.
new ref init(
from: A^,
len: USize val)
: Array[A] ref^
Parameters¶
from: A^
len: USize val
Returns¶
Array[A] ref^
from_cpointer¶
[Source]
Create an array from a C-style pointer and length. The contents are not
copied. This must be done only with C-FFI functions that return
pony_alloc'd memory. If a null pointer is given then an empty array
is returned.
new ref from_cpointer(
ptr: Pointer[A] ref,
len: USize val,
alloc: USize val = 0)
: Array[A] ref^
Parameters¶
ptr: Pointer[A] ref
len: USize val
alloc: USize val = 0
Returns¶
Array[A] ref^
Public Functions¶
cpointer¶
[Source]
Return the underlying C-style pointer.
fun box cpointer(
offset: USize val = 0)
: Pointer[A] tag
Parameters¶
offset: USize val = 0
Returns¶
Pointer[A] tag
size¶
[Source]
The number of elements in the array.
fun box size()
: USize val
Returns¶
USize val
space¶
[Source]
The available space in the array.
fun box space()
: USize val
Returns¶
USize val
reserve¶
[Source]
Reserve space for len elements, including whatever elements are already in
the array. Array space grows geometrically.
fun ref reserve(
len: USize val)
: None val
Parameters¶
len: USize val
Returns¶
None val
compact¶
[Source]
Try to remove unused space, making it available for garbage collection. The
request may be ignored.
fun ref compact()
: None val
Returns¶
None val
undefined[optional B: (A & Real[B] val & (I8 val | I16 val | I32 val | I64 val | I128 val | ILong val | ISize val | U8 val | U16 val | U32 val | U64 val | U128 val | ULong val | USize val | F32 val | F64 val))]¶
[Source]
Resize to len elements, populating previously empty elements with random
memory. This is only allowed for an array of numbers.
fun ref undefined[optional B: (A & Real[B] val & (I8 val | I16 val | I32 val |
I64 val | I128 val | ILong val |
ISize val | U8 val | U16 val |
U32 val | U64 val | U128 val |
ULong val | USize val | F32 val |
F64 val))](
len: USize val)
: None val
Parameters¶
len: USize val
Returns¶
None val
read_u8[optional B: (A & Real[B] val & U8 val)]¶
[Source]
Reads a U8 from offset. This is only allowed for an array of U8s.
fun box read_u8[optional B: (A & Real[B] val & U8 val)](
offset: USize val)
: U8 val ?
Parameters¶
offset: USize val
Returns¶
U8 val ?
read_u16[optional B: (A & Real[B] val & U8 val)]¶
[Source]
Reads a U16 from offset. This is only allowed for an array of U8s.
fun box read_u16[optional B: (A & Real[B] val & U8 val)](
offset: USize val)
: U16 val ?
Parameters¶
offset: USize val
Returns¶
U16 val ?
read_u32[optional B: (A & Real[B] val & U8 val)]¶
[Source]
Reads a U32 from offset. This is only allowed for an array of U8s.
fun box read_u32[optional B: (A & Real[B] val & U8 val)](
offset: USize val)
: U32 val ?
Parameters¶
offset: USize val
Returns¶
U32 val ?
read_u64[optional B: (A & Real[B] val & U8 val)]¶
[Source]
Reads a U64 from offset. This is only allowed for an array of U8s.
fun box read_u64[optional B: (A & Real[B] val & U8 val)](
offset: USize val)
: U64 val ?
Parameters¶
offset: USize val
Returns¶
U64 val ?
read_u128[optional B: (A & Real[B] val & U8 val)]¶
[Source]
Reads a U128 from offset. This is only allowed for an array of U8s.
fun box read_u128[optional B: (A & Real[B] val & U8 val)](
offset: USize val)
: U128 val ?
Parameters¶
offset: USize val
Returns¶
U128 val ?
apply¶
[Source]
Get the i-th element, raising an error if the index is out of bounds.
fun box apply(
i: USize val)
: this->A ?
Parameters¶
i: USize val
Returns¶
this->A ?
update_u8[optional B: (A & Real[B] val & U8 val)]¶
[Source]
Write a U8 at offset. This is only allowed for an array of U8s.
fun ref update_u8[optional B: (A & Real[B] val & U8 val)](
offset: USize val,
value: U8 val)
: U8 val ?
Parameters¶
offset: USize val
value: U8 val
Returns¶
U8 val ?
update_u16[optional B: (A & Real[B] val & U8 val)]¶
[Source]
Write a U16 at offset. This is only allowed for an array of U8s.
fun ref update_u16[optional B: (A & Real[B] val & U8 val)](
offset: USize val,
value: U16 val)
: U16 val ?
Parameters¶
offset: USize val
value: U16 val
Returns¶
U16 val ?
update_u32[optional B: (A & Real[B] val & U8 val)]¶
[Source]
Write a U32 at offset. This is only allowed for an array of U8s.
fun ref update_u32[optional B: (A & Real[B] val & U8 val)](
offset: USize val,
value: U32 val)
: U32 val ?
Parameters¶
offset: USize val
value: U32 val
Returns¶
U32 val ?
update_u64[optional B: (A & Real[B] val & U8 val)]¶
[Source]
Write a U64 at offset. This is only allowed for an array of U8s.
fun ref update_u64[optional B: (A & Real[B] val & U8 val)](
offset: USize val,
value: U64 val)
: U64 val ?
Parameters¶
offset: USize val
value: U64 val
Returns¶
U64 val ?
update_u128[optional B: (A & Real[B] val & U8 val)]¶
[Source]
Write a U128 at offset. This is only allowed for an array of U8s.
fun ref update_u128[optional B: (A & Real[B] val & U8 val)](
offset: USize val,
value: U128 val)
: U128 val ?
Parameters¶
offset: USize val
value: U128 val
Returns¶
U128 val ?
update¶
[Source]
Change the i-th element, raising an error if the index is out of bounds.
fun ref update(
i: USize val,
value: A)
: A^ ?
Parameters¶
i: USize val
value: A
Returns¶
A^ ?
insert¶
[Source]
Insert an element into the array. Elements after this are moved up by one
index, extending the array.
When inserting right beyond the last element, at index this.size(),
the element will be appended, similar to push(),
an insert at index 0 prepends the value to the array.
An insert into an index beyond this.size() raises an error.
let array = Array[U8](4) // []
array.insert(0, 0xDE)? // prepend: [0xDE]
array.insert(array.size(), 0xBE)? // append: [0xDE; 0xBE]
array.insert(1, 0xAD)? // insert: [0xDE; 0xAD; 0xBE]
array.insert(array.size() + 1, 0xEF)? // error
fun ref insert(
i: USize val,
value: A)
: None val ?
Parameters¶
i: USize val
value: A
Returns¶
None val ?
delete¶
[Source]
Delete an element from the array. Elements after this are moved down by one
index, compacting the array.
An out of bounds index raises an error.
The deleted element is returned.
fun ref delete(
i: USize val)
: A^ ?
Parameters¶
i: USize val
Returns¶
A^ ?
truncate¶
[Source]
Truncate an array to the given length, discarding excess elements. If the
array is already smaller than len, do nothing.
fun ref truncate(
len: USize val)
: None val
Parameters¶
len: USize val
Returns¶
None val
trim_in_place¶
[Source]
Trim the array to a portion of itself, covering from until to.
Unlike slice, the operation does not allocate a new array nor copy elements.
fun ref trim_in_place(
from: USize val = 0,
to: USize val = call)
: None val
Parameters¶
from: USize val = 0
to: USize val = call
Returns¶
None val
trim¶
[Source]
Return a shared portion of this array, covering from until to.
Both the original and the new array are immutable, as they share memory.
The operation does not allocate a new array pointer nor copy elements.
fun val trim(
from: USize val = 0,
to: USize val = call)
: Array[A] val
Parameters¶
from: USize val = 0
to: USize val = call
Returns¶
Array[A] val
chop[optional B: (A & Any #send)]¶
[Source]
Chops the array in half at the split point requested and returns both
the left and right portions. The original array is trimmed in place and
returned as the left portion. If the split point is larger than the
array, the left portion is the original array and the right portion
is a new empty array.
The operation does not allocate a new array pointer nor copy elements.
The entry type must be sendable so that the two halves can be isolated.
Otherwise, two entries may have shared references to mutable data,
or even to each other, such as in the code below:
class Example
var other: (Example | None) = None
let arr: Array[Example] iso = recover
let obj1 = Example
let obj2 = Example
obj1.other = obj2
obj2.other = obj1
[obj1; obj2]
end
fun iso chop[optional B: (A & Any #send)](
split_point: USize val)
: (Array[A] iso^ , Array[A] iso^)
Parameters¶
split_point: USize val
Returns¶
(Array[A] iso^ , Array[A] iso^)
unchop¶
[Source]
Unchops two iso arrays to return the original array they were chopped from.
Both input arrays are isolated and mutable and were originally chopped from
a single array. This function checks that they are indeed two arrays chopped
from the same original array and can be unchopped before doing the
unchopping and returning the unchopped array. If the two arrays cannot be
unchopped it returns both arrays without modifying them.
The operation does not allocate a new array pointer nor copy elements.
fun iso unchop(
b: Array[A] iso)
: ((Array[A] iso^ , Array[A] iso^) | Array[A] iso^)
Parameters¶
b: Array[A] iso
Returns¶
((Array[A] iso^ , Array[A] iso^) | Array[A] iso^)
copy_from[optional B: (A & Real[B] val & U8 val)]¶
[Source]
Copy len elements from src(src_idx) to this(dst_idx).
Only works for Array[U8].
fun ref copy_from[optional B: (A & Real[B] val & U8 val)](
src: Array[U8 val] box,
src_idx: USize val,
dst_idx: USize val,
len: USize val)
: None val
Parameters¶
src: Array[U8 val] box
src_idx: USize val
dst_idx: USize val
len: USize val
Returns¶
None val
copy_to¶
[Source]
Copy len elements from this(src_idx) to dst(dst_idx).
fun box copy_to(
dst: Array[this->A!] ref,
src_idx: USize val,
dst_idx: USize val,
len: USize val)
: None val
Parameters¶
dst: Array[this->A!] ref
src_idx: USize val
dst_idx: USize val
len: USize val
Returns¶
None val
remove¶
[Source]
Remove n elements from the array, beginning at index i.
fun ref remove(
i: USize val,
n: USize val)
: None val
Parameters¶
i: USize val
n: USize val
Returns¶
None val
clear¶
[Source]
Remove all elements from the array.
fun ref clear()
: None val
Returns¶
None val
push_u8[optional B: (A & Real[B] val & U8 val)]¶
[Source]
Add a U8 to the end of the array. This is only allowed for an array of U8s.
fun ref push_u8[optional B: (A & Real[B] val & U8 val)](
value: U8 val)
: None val
Parameters¶
value: U8 val
Returns¶
None val
push_u16[optional B: (A & Real[B] val & U8 val)]¶
[Source]
Add a U16 to the end of the array. This is only allowed for an array of U8s.
fun ref push_u16[optional B: (A & Real[B] val & U8 val)](
value: U16 val)
: None val
Parameters¶
value: U16 val
Returns¶
None val
push_u32[optional B: (A & Real[B] val & U8 val)]¶
[Source]
Add a U32 to the end of the array. This is only allowed for an array of U8s.
fun ref push_u32[optional B: (A & Real[B] val & U8 val)](
value: U32 val)
: None val
Parameters¶
value: U32 val
Returns¶
None val
push_u64[optional B: (A & Real[B] val & U8 val)]¶
[Source]
Add a U64 to the end of the array. This is only allowed for an array of U8s.
fun ref push_u64[optional B: (A & Real[B] val & U8 val)](
value: U64 val)
: None val
Parameters¶
value: U64 val
Returns¶
None val
push_u128[optional B: (A & Real[B] val & U8 val)]¶
[Source]
Add a U128 to the end of the array. This is only allowed for an array of U8s.
fun ref push_u128[optional B: (A & Real[B] val & U8 val)](
value: U128 val)
: None val
Parameters¶
value: U128 val
Returns¶
None val
push¶
[Source]
Add an element to the end of the array.
fun ref push(
value: A)
: None val
Parameters¶
value: A
Returns¶
None val
pop¶
[Source]
Remove an element from the end of the array.
The removed element is returned.
fun ref pop()
: A^ ?
Returns¶
A^ ?
unshift¶
[Source]
Add an element to the beginning of the array.
fun ref unshift(
value: A)
: None val
Parameters¶
value: A
Returns¶
None val
shift¶
[Source]
Remove an element from the beginning of the array.
The removed element is returned.
fun ref shift()
: A^ ?
Returns¶
A^ ?
append¶
[Source]
Append the elements from a sequence, starting from the given offset.
fun ref append(
seq: (ReadSeq[A] box & ReadElement[A^] box),
offset: USize val = 0,
len: USize val = call)
: None val
Parameters¶
seq: (ReadSeq[A] box & ReadElement[A^] box)
offset: USize val = 0
len: USize val = call
Returns¶
None val
concat¶
[Source]
Add len iterated elements to the end of the array, starting from the given
offset.
fun ref concat(
iter: Iterator[A^] ref,
offset: USize val = 0,
len: USize val = call)
: None val
Parameters¶
iter: Iterator[A^] ref
offset: USize val = 0
len: USize val = call
Returns¶
None val
find¶
[Source]
Find the nth appearance of value from the beginning of the array,
starting at offset and examining higher indices, and using the supplied
predicate for comparisons. Returns the index of the value, or raise an
error if the value isn't present.
By default, the search starts at the first element of the array, returns
the first instance of value found, and uses object identity for
comparison.
fun box find(
value: A!,
offset: USize val = 0,
nth: USize val = 0,
predicate: {(box->A!, box->A!): Bool}[A] val = lambda)
: USize val ?
Parameters¶
value: A!
offset: USize val = 0
nth: USize val = 0
predicate: {(box->A!, box->A!): Bool}[A] val = lambda
Returns¶
USize val ?
contains¶
[Source]
Returns true if the array contains value, false otherwise.
The default predicate checks for matches by identity. To search for matches
by structural equality, pass an object literal such as {(l, r) => l == r}.
fun box contains(
value: A!,
predicate: {(box->A!, box->A!): Bool}[A] val = lambda)
: Bool val
Parameters¶
value: A!
predicate: {(box->A!, box->A!): Bool}[A] val = lambda
Returns¶
Bool val
rfind¶
[Source]
Find the nth appearance of value from the end of the array, starting at
offset and examining lower indices, and using the supplied predicate for
comparisons. Returns the index of the value, or raise an error if the value
isn't present.
By default, the search starts at the last element of the array, returns the
first instance of value found, and uses object identity for comparison.
fun box rfind(
value: A!,
offset: USize val = call,
nth: USize val = 0,
predicate: {(box->A!, box->A!): Bool}[A] val = lambda)
: USize val ?
Parameters¶
value: A!
offset: USize val = call
nth: USize val = 0
predicate: {(box->A!, box->A!): Bool}[A] val = lambda
Returns¶
USize val ?
clone¶
[Source]
Clone the array.
The new array contains references to the same elements that the old array
contains, the elements themselves are not cloned.
fun box clone()
: Array[this->A!] ref^
Returns¶
Array[this->A!] ref^
slice¶
[Source]
Create a new array that is a clone of a portion of this array. The range is
exclusive and saturated.
The new array contains references to the same elements that the old array
contains, the elements themselves are not cloned.
fun box slice(
from: USize val = 0,
to: USize val = call,
step: USize val = 1)
: Array[this->A!] ref^
Parameters¶
from: USize val = 0
to: USize val = call
step: USize val = 1
Returns¶
Array[this->A!] ref^
permute¶
[Source]
Create a new array with the elements permuted.
Permute to an arbitrary order that may include duplicates. An out of bounds
index raises an error.
The new array contains references to the same elements that the old array
contains, the elements themselves are not copied.
fun box permute(
indices: Iterator[USize val] ref)
: Array[this->A!] ref^ ?
Parameters¶
indices: Iterator[USize val] ref
Returns¶
Array[this->A!] ref^ ?
reverse¶
[Source]
Create a new array with the elements in reverse order.
The new array contains references to the same elements that the old array
contains, the elements themselves are not copied.
fun box reverse()
: Array[this->A!] ref^
Returns¶
Array[this->A!] ref^
reverse_in_place¶
[Source]
Reverse the array in place.
fun ref reverse_in_place()
: None val
Returns¶
None val
swap_elements¶
[Source]
Swap the element at index i with the element at index j.
If either i or j are out of bounds, an error is raised.
fun ref swap_elements(
i: USize val,
j: USize val)
: None val ?
Parameters¶
i: USize val
j: USize val
Returns¶
None val ?
keys¶
[Source]
Return an iterator over the indices in the array.
fun box keys()
: ArrayKeys[A, this->Array[A] ref] ref^
Returns¶
ArrayKeys[A, this->Array[A] ref] ref^
values¶
[Source]
Return an iterator over the values in the array.
fun box values()
: ArrayValues[A, this->Array[A] ref] ref^
Returns¶
ArrayValues[A, this->Array[A] ref] ref^
pairs¶
[Source]
Return an iterator over the (index, value) pairs in the array.
fun box pairs()
: ArrayPairs[A, this->Array[A] ref] ref^
Returns¶
ArrayPairs[A, this->Array[A] ref] ref^
| pony | 205617 | https://no.wikipedia.org/wiki/MOD11 | MOD11 | MOD11 (Modulus11) er en kontrollsifferalgoritme som blant annet benyttes for å validere kontonumre i norske banker, organisasjonsnummer og det siste sifferet i norske fødselsnummer. (Norske fødselsnummer har to kontrollsifre, det nest siste er også et modulo 11-kontrollsiffer, men ved beregningen av dette benyttes det multiplikatorer i en annen og uregelmessig rekkefølge).
Bakgrunn
Kontrollsiffer benyttes for å oppdage feil ved inntasting av f.eks. KID, kontonumre og fødselsnumre. Det benyttes i all hovedsak to algoritmer for dette, MOD10 og MOD11. Disse kontrollsifrene kontrolleres maskinelt ved OCR-lesing i skranken hos banker. En del IT-systemer kontrollerer også disse kontrollsifre for å sikre at brukere ikke har tastet feil. Dette inkluderer nettbanker og lønnssystemer.
Dersom to eller flere siffer i det inntastede felt er feil, øker sjansen for at kontrollsifferet beregnes til det samme, og at feilen ikke oppdages. Den vil likevel ikke være mer enn om lag 9 % for MOD11 – og 10 % for MOD10. Dersom en tilfeldig tallrekke kontrolleres, er sannsynligheten om lag 9 % for at siste siffer stemmer med kontrollsiffer beregningen (MOD11 bruker også tegnet «-» som et kontrolltegn, så det blir elleve varianter).
Denne kontrollsifferalgoritmen er også designet til å oppdage ombytting av sifre. Det er noe økt sjanse for at brukere taster inn f.eks. en KID der to sifre har byttet plass. Derfor brukes et prinsipp med varierende vekttall for hvert siffer i algoritmen nedenfor. I modulus-10 kan det oppdages om to påfølgende siffer har byttet plass, men ikke første og siste i gruppe på tre. Modulus11 vil også oppdage det.
Beregning av kontrollsiffer med Modulus11
Et tenkt kontonummer er 1234.56.78903. Det siste sifferet i kontonummeret er et kontrollsiffer. I dette eksempelet er kontrollsifferet 3. Kontonummeret uten kontrollsiffer (og uten skilletegn) er 1234567890.
Hvert siffer i eksempelet over multipliseres med vekttallene 2,3,4,5,6,7,2,3,4,5 (eventuelt videre ,6,7,2,3 og så videre for tall med flere sifre), regnet fra høyre mot venstre.
0 × 2 = 0
9 × 3 = 27
8 × 4 = 32
7 × 5 = 35
6 × 6 = 36
5 × 7 = 35
4 x 2 = 8
3 x 3 = 9
2 x 4 = 8
1 x 5 = 5
Summen er 0 + 27 + 32 + 35 + 36 + 35 + 8 + 9 + 8 + 5 = 195.
Kontrollsifferet blir nå det tallet som må legges til summen for å få et tall som er delelig med 11.
Summen divideres med 11 og vi noterer «resten» som blir 8 i dette tilfellet. Denne resten trekkes fra 11 og vi får 3 som blir kontrollsifferet.
11 - 8 = kontrollsifferet 3
Komplett og gyldig kontonummer i dette eksempelet er derfor 1234.56.78903.
Dersom summen er delelig med 11 blir også resten 0 og kontrollsifferet 0. Dersom «resten» ved divisjonen blir 1 skal «kontrollsifferet» ha tallverdien 10, da benyttes isteden et minustegn (eller bindestrek) istedenfor kontrollsifferet. Imidlertid gjelder for kontonumre (og også for personnummer) at slike tall isteden skal forkastes slik at for de typene tall kan kontrollsiffer «-» aldri forekomme.
Implementasjoner i forskjellige programmeringspråk
C#
public static bool ValidateMod11(string bankAccountNumber)
{
var normalized = Regex.Replace(bankAccountNumber, @"[\s.]+", string.Empty);
if (normalized.Length != 11)
{
return false;
}
var weights = new[] { 5, 4, 3, 2, 7, 6, 5, 4, 3, 2 };
var sum = 0;
for (var i = 0; i < 10; i++)
{
sum += int.Parse(normalized[i].ToString()) * weights[i];
}
var remainder = sum % 11;
var controlDigit = int.Parse(normalized[10].ToString());
return controlDigit == (remainder == 0 ? 0 : 11 - remainder);
}
JavaScript
function validateKontonummerMod11(kontonummer) {
const weights = [5, 4, 3, 2, 7, 6, 5, 4, 3, 2];
const kontonummerWithoutSpacesAndPeriods = kontonummer.replace(/[\s.]+/g, '');
if (kontonummerWithoutSpacesAndPeriods.length !== 11) {
return false;
} else {
const sjekksiffer = parseInt(kontonummerWithoutSpacesAndPeriods.charAt(10), 10);
const kontonummerUtenSjekksiffer = kontonummerWithoutSpacesAndPeriods.substring(0, 10);
let sum = 0;
for (let index = 0; index < 10; index++) {
sum += parseInt(kontonummerUtenSjekksiffer.charAt(index), 10) * weights[index];
}
const remainder = sum % 11;
return sjekksiffer === (remainder === 0 ? 0 : 11 - remainder);
}
}
Python
def kid_mod11_wiki(a):
cross = sum([int(val)*[2,3,4,5,6,7][idx%6] for idx,val in enumerate(list(str(a))[::-1])])
return "%s%s" % (a,cross % 11 == 10 and '-' or 11-(cross % 11))
Java
public class KontonummerValidator {
public static boolean gyldigKontonummer(String kontonr) {
// Fjern whitespace og punktum fra kontonummer (enkelte liker å formatere kontonummer med 1234.56.78903)
kontonr = StringUtils.remove(kontonr, ' ');
kontonr = StringUtils.remove(kontonr, '.');
// Skal inneholde 11 siffer og kun tall
if (kontonr.length() != 11 || !StringUtils.isNumeric(kontonr)) {
return false;
}
int sisteSiffer = Character.getNumericValue(kontonr.charAt(kontonr.length() - 1));
return getCheckDigit(kontonr) == sisteSiffer;
}
private static int getCheckDigit(String number) {
int lastIndex = number.length() - 1;
int sum = 0;
for (int i = 0; i < lastIndex; i++) {
sum += Character.getNumericValue(number.charAt(i)) * getWeightNumber(i);
}
int remainder = sum % 11;
return getCheckDigitFromRemainder(remainder);
}
private static int getWeightNumber(int i) {
return 7 - (i + 2) % 6;
}
private static int getCheckDigitFromRemainder(int remainder) {
switch (remainder) {
case 0:
return 0;
default:
return 11 - remainder;
}
}
}
Kotlin
fun validMod11(cid: String): Boolean {
val controlDigit = cid[cid.length - 1].toString()
val controlSumNumbers = listOf(
2, 3, 4, 5, 6, 7,
2, 3, 4, 5, 6, 7,
2, 3, 4, 5, 6, 7,
2, 3, 4, 5, 6, 7
)
val number = cid.subSequence(0, cid.length - 1).reversed().toString()
var sum = 0
for(i in number.indices) {
sum += number[i].toString().toInt() * controlSumNumbers[i]
}
val output = when (val sumResult = 11 - sum % 11) {
11 -> "0"
10 -> "-"
else -> sumResult.toString()
}
return output == controlDigit
}
Se også
MOD10
Referanser
Programmering | norwegian_bokmål | 0.863193 |
Pony/time-Timer-.txt |
Timer¶
[Source]
The Timer class represents a timer that fires after an expiration
time, and then fires at an interval. When a Timer fires, it calls
the apply method of the TimerNotify object that was passed to it
when it was created.
The following example waits 5 seconds and then fires every 2
seconds, and when it fires the TimerNotify object prints how many
times it has been called:
use "time"
actor Main
new create(env: Env) =>
let timers = Timers
let timer = Timer(Notify(env), 5_000_000_000, 2_000_000_000)
timers(consume timer)
class Notify is TimerNotify
let _env: Env
var _counter: U32 = 0
new iso create(env: Env) =>
_env = env
fun ref apply(timer: Timer, count: U64): Bool =>
_env.out.print(_counter.string())
_counter = _counter + 1
true
class ref Timer
Constructors¶
create¶
[Source]
Create a new timer. The expiration time should be a nanosecond count
until the first expiration. The interval should also be in nanoseconds.
new iso create(
notify: TimerNotify iso,
expiration: U64 val,
interval: U64 val = 0)
: Timer iso^
Parameters¶
notify: TimerNotify iso
expiration: U64 val
interval: U64 val = 0
Returns¶
Timer iso^
abs¶
[Source]
Creates a new timer with an absolute expiration time rather than a relative
time. The expiration time is wall-clock adjusted system time.
new ref abs(
notify: TimerNotify ref,
expiration: (I64 val , I64 val),
interval: U64 val = 0)
: Timer ref^
Parameters¶
notify: TimerNotify ref
expiration: (I64 val , I64 val)
interval: U64 val = 0
Returns¶
Timer ref^
| pony | 820397 | https://no.wikipedia.org/wiki/Avis%C3%A5ret%201620 | Avisåret 1620 | Avisåret 1620 er en oversikt over etableringer, nedleggelser, hendelser, prisvinnere og personer med tilknytning til aviser i 1620.
Hendelser
Etableringer
15. februar: Nieuwe Tijdinghen er et navn som i ettertid er gitt på en flamsk avis uten noen enhetlig tittel utgitt i Antwerpen. Eier og utgiver var Abraham Verhoeven. Richard Verstegan var journalist. Avisen ble nedlagt i 1629.
Fødsler
Dødsfall
… | norwegian_bokmål | 1.376513 |
Pony/6_type-aliases.txt | # Type Aliases
A __type alias__ is just a way to give a different name to a type. This may sound a bit silly: after all, types already have names! However, Pony can express some complicated types, and it can be convenient to have a short way to talk about them.
We'll give a couple examples of using type aliases, just to get the feel of them.
## Enumerations
One way to use type aliases is to express an enumeration. For example, imagine we want to say something must either be Red, Blue or Green. We could write something like this:
```pony
primitive Red
primitive Blue
primitive Green
type Colour is (Red | Blue | Green)
```
There are two new concepts in there. The first is the type alias, introduced with the keyword `type`. It just means that the name that comes after `type` will be translated by the compiler to the type that comes after `is`.
The second new concept is the type that comes after `is`. It's not a single type! Instead, it's a __union__ type. You can read the `|` symbol as __or__ in this context, so the type is "Red or Blue or Green".
A union type is a form of _closed world_ type. That is, it says every type that can possibly be a member of it. In contrast, object-oriented subtyping is usually _open world_, e.g. in Java, an interface can be implemented by any number of classes.
You can also declare constants like in C or Go like this, making use of `apply`,
which can be omitted during call (will be discussed further in [Sugar](/expressions/sugar.md)),
```pony
primitive Red fun apply(): U32 => 0xFF0000FF
primitive Green fun apply(): U32 => 0x00FF00FF
primitive Blue fun apply(): U32 => 0x0000FFFF
type Colour is (Red | Blue | Green)
```
or namespace them like this
```pony
primitive Colours
fun red(): U32 => 0xFF0000FF
fun green(): U32 => 0x00FF00FF
```
You might also want to iterate over the enumeration items like this to print their value for debugging purposes
```pony
primitive ColourList
fun apply(): Array[Colour] =>
[Red; Green; Blue]
for colour in ColourList().values() do
env.out.print(colour().string())
end
```
## Complex types
If a type is complicated, it can be nice to give it a mnemonic name. For example, if we want to say that a type must implement more than one interface, we could say:
```pony
interface HasName
fun name(): String
interface HasAge
fun age(): U32
interface HasFeelings
fun feeling(): String
type Person is (HasName & HasAge & HasFeelings)
```
This use of complex types applies to traits, not just interfaces:
```pony
trait HasName
fun name(): String => "Bob"
trait HasAge
fun age(): U32 => 42
trait HasFeelings
fun feeling(): String => "Great!"
type Person is (HasName & HasAge & HasFeelings)
```
There's another new concept here: the type has a `&` in it. This is similar to the `|` of a __union__ type: it means this is an __intersection__ type. That is, it's something that must be _all_ of `HasName`, `HasAge` _and_ `HasFeelings`.
But the use of `type` here is exactly the same as the enumeration example above, it's just providing a name for a type that is otherwise a bit tedious to type out over and over.
Another example, this time from the standard library, is `SetIs`. Here's the actual definition:
```pony
type SetIs[A] is HashSet[A, HashIs[A!]]
```
Again there's something new here. After the name `SetIs` comes the name `A` in square brackets. That's because `SetIs` is a __generic type__. That is, you can give a `SetIs` another type as a parameter, to make specific kinds of set. If you've used Java or C#, this will be pretty familiar. If you've used C++, the equivalent concept is templates, but they work quite differently.
And again the use of `type` just provides a more convenient way to refer to the type we're aliasing:
```pony
HashSet[A, HashIs[A!]]
```
That's another __generic type__. It means a `SetIs` is really a kind of `HashSet`. Another concept has snuck in, which is `!` types. This is a type that is the __alias__ of another type. That's tricky stuff that you only need when writing complex generic types, so we'll leave it for later.
One more example, again from the standard library, is the `Map` type that gets used a lot. It's actually a type alias. Here's the real definition of `Map`:
```pony
type Map[K: (Hashable box & Comparable[K] box), V] is HashMap[K, V, HashEq[K]]
```
Unlike our previous example, the first type parameter, `K`, has a type associated with it. This is a __constraint__, which means when you parameterise a `Map`, the type you pass for `K` must be a subtype of the constraint.
Also, notice that `box` appears in the type. This is a __reference capability__. It means there is a certain class of operations we need to be able to do with a `K`. We'll cover this in more detail later.
Just like our other examples, all this really means is that `Map` is really a kind of `HashMap`.
## Other stuff
Type aliases get used for a lot of things, but this gives you the general idea. Just remember that a type alias is always a convenience: you could replace every use of the type alias with the full type after the `is`.
In fact, that's exactly what the compiler does.
| pony | 13776 | https://da.wikipedia.org/wiki/Standard%20ML | Standard ML | Standard ML (SML) er et funktionsorienteret programmeringssprog som understøtter moduler, statisk typetjek og typeinferens. Sproget er populært til udvikling af compilere, forskning omkring programmeringssprog og udvikling af systemer til automatisk bevisførelse.
SML er en moderne dialekt af ML som blev brugt i bevisførelsesystemet LCF. Sproget udmærker sig blandt programmeringssprog med en formel specifikation som indeholder en operationel semantik (The Definition of Standard ML fra 1990, revideret i 1997), hvilket betyder at alle operationer i sproget har en formelt defineret betydning.
Sproget
Et Standard ML-program består af en række erklæringer som indeholder udtryk som enten er funktioner, værdier eller sammensatte udtryk som kan reduceres. Standard ML er et funktionsorienteret programmeringssprog med nogle imperative træk. Den primære abstraktion som benyttes er altså funktioner. For eksempel kan fakultetsfunktionen beskrives rekursivt således:
fun fakultet n =
if n = 0 then 1 else n * fakultet (n-1)
En Standard ML-compiler kan således udlede at fakultet må være en funktion som tager et heltal som argument og returnerer et heltal (typen int → int), helt uden at disse typer angives eksplicit. Typeinferensen foregår ved hjælp af Hindley-Milner-algoritmen og gør at programmer i praksis kan udtrykkes kortere.
Samme funktion kan udtrykkes ved hjælp af mønstergenkendelse som vist i følgende eksempel:
fun fakultet 0 = 1
| fakultet n = n * fakultet (n-1)
Mønstergenkendelsen fungerer således at man ikke betragter funktionsargumentet som navnet på én parameter, men et generelt mønster som skal passe med inputværdien. Mønstre prøves fra det øverste mønster og ned, så rækkefølgen har en betydning. Hvis mønstre har variable komponenter (for eksempel n), bliver disse bundet så man kan henvise til dem i den funktionskrop som hører til mønsteret (adskilt med tegnet =).
Typer
De primitive indbyggede typer i Standard ML er: int, real, char, string, bool. Hertil findes en række prædefinerede algebraiske typer og nogle indbyggede, sammensatte typer: tupler og lister. Tupler kan indeholde en fast mængde af værdier med forskellige typer, mens lister kan indeholde vilkårligt mange værdier af én type. For eksempel:
val land = ("Danmark", 5564219, "Der er et yndigt land...")
val sorteret = [1,1,2,3,5,8,13,21,34,55,89]
Foruden en række indbyggede typer, kan man lave synonymer (også kaldet aliaser) til eksisterende typer. For eksempel kan man definere et koordinat som to kommatal, eller en omkreds som et kommatal. Tegnet * i typerne nedenfor er udtryk for den indbyggede sammensatte tupel-type:
type koordinat = real * real
type omkreds = real
Efterfølgende kan man angive typen koordinat i stedet for real * real. Her er ikke tale om en konvertering af værdier.
Foruden synonymer til eksisterende typer er det også muligt at lave nye algebraiske typer. Det er nyttigt til at modellere en række ting. For eksempel kan man beskrive geometriske former i planet:
datatype form = Cirkel of koordinat * omkreds
| Rektangel of koordinat * koordinat
| Trekant of koordinat * koordinat * koordinat
Eller binære træer:
datatype tree = Leaf
| Node of trae * int * trae
Eller køretøjer:
type hjul = int
type gear = int
type tophastighed = int
type hestekraefter = int
datatype koretoj = Bil of tophastighed * hestekraefter
| Tank of tophastighed * hestekraefter
| Cykel of hjul * gear
Det er efterfølgende muligt at konstruere funktioner som behandler disse typer ved hjælp af mønstergenkendelse:
fun antal_elementer Leaf = 0
| antal_elementer (Node (venstre, n, hojre)) =
1 + antal_elementer(venstre) + antal_elementer(hojre)
Det er værd at bemærke at algebraiske datatyper kan være rekursivt definerede, og funktioner som arbejder på disse er derfor ofte også rekursive. Det er også interessant at bemærke hvordan mønstergenkendelse og typeinferens fungerer: Alle tomme træer bliver grebet af første mønster mens ikke-tomme træer bliver matchet således at deres obligatoriske tre parametre (et venstre-træ, en værdi og et højre-træ) får navne som kan bruges i funktionskroppen.
fun miljovenlig (Cykel _) = true
| miljovenlig (_) = false
Man kan også udelade dele af en struktur ved at give dem det særlige variabelnavn _.
Højereordensfunktioner
Funktioner i Standard ML har såkaldt førsteklassestatus, hvilket vil sige at alle funktioner kan betragtes som værdier på lige fod med almindelige værdier som sandhedsværdier, tal, lister og tekst. En konsekvens ved dette er at funktioner kan tage andre funktioner som argument. Det er også muligt at erklære en funktion som ikke har et navn, men blot er en værdi (en såkaldt closure, lambda-udtryk eller anonym funktion).
Følgende er et eksempel som definerer plus som en funktion der tager en 2-tuple som input og returnerer summen af dens første- og andenkomponent:
val plus = (fn (x,y) => x+y)
En funktion kaldes "af højere orden" hvis den tager imod funktioner som argument eller returnerer funktioner som værdi. En strengere definition kræver at begge er tilfældet. Følgende er et eksempel på en funktion, K, som tager et argument x som input og returnerer en funktion, som tager et argument y som input, smider y væk og returnerer x; funktionen er skrevet på tre måder som alle er ækvivalente og gyldige:
fun K x y = x
fun K x = (fn y => x)
val K = (fn x => (fn y => x))
Følgende funktion, fikspunkt, tager imod en funktion f og en startværdi x og begynder at regne f(x), f(f(x)), f(f(f(x))) osv. indtil den finder et punkt hvor det ikke gør nogen forskel om man tilføjer en ekstra anvendelse af funktionen:
fun fikspunkt (f, x) =
if f x = f (f x)
then x
else fikspunkt (f, f x)
Man kan sige at K og fikspunkt er højereordensfunktioner.
Undtagelser
Standard ML understøtter undtagelser ved brugen af to nøgleord: raise og handle. Man kan desuden definere sine egne undtagelser ved exception, der har en syntaks meget lignende den for abstrakte datatyper. Der findes en række indbyggede undtagelser: Empty, Div, Fail, Domain m.fl.
fun max [] = raise Empty
| max [x] = x
| max (x::y::xs) =
if x > y
then max (x::xs)
else max (y::xs)
Moduler
Afsnit mangler.
Implementeringer
MLTon er en optimerende compiler til hele programmer. Den producerer meget effektiv kode sammenlignet med andre Standard ML-compilere.
Standard ML of New Jersey (forkortet SML/NJ) er en compiler med tilhørende værktøjer, biblioteker og interaktiv fortolker.
Poly/ML er en compiler som producerer effektiv kode og understøtter hardware med flere kerner (igennem POSIX-tråde).
Moscow ML er en compiler baseret på CAML Light-runtime-miljøet og understøtter moduler såvel som en stor del af SML Basis-biblioteket.
HaMLet er en SML-fortolker som forsøger at være en tilgængelig og præcis referenceimplementation.
ML Kit tilføjer en spildopsamler og regionsbaseret hukommelseshåndtering, sigtet mod realtidsapplikationer.
SML.NET oversætter til Microsofts Common Language Runtime (CLR) og har udvidelser som muliggør linkning til andre .NET-kode.
SML2c er en batch-compiler og oversætter kun erklæringer på modulniveau (dvs. signaturer, strukturer og funktorer) til C. Den er baseret på SML/NJ 0.67, men understøtter ikke SML/NJ's debugging og profiling. Programmer som kun består af moduler, og som virker i SML/NJ, kan oversættes med sml2c uden ændringer.
Poplog-systemet implementerer en version af Standard ML samtidigt med Common Lisp og Prolog og tillader sammenblandingen af disse sprog.
SML# er en konservativ udvidelse til Standard ML som tilføjer polymorfi på record-typer og evnen til at arbejde sammen med C-kode.
Alice: en fortolker til Standard ML som tilføjer doven evaluering, samtidighed (trådprogrammering og distribuerede beregninger via RPC) og constraintprogrammering.
Disse systemer er alle open source og frit tilgængelige. De fleste er implementeret i Standard ML. Der findes ikke længere kommercielle Standard ML-implementeringer, men et firma kaldet Harlequin producerede engang en kommerciel IDE og compiler til Standard ML under navnet MLWorks. Firmaet eksisterer ikke længere.
Se også
Funktionsprogrammering
Rekursion
Haskell (programmeringssprog)
OCaml (programmeringssprog)
Noter
Eksterne henvisninger
StandardML.dk
Programmeringssprog | danish | 0.674769 |
Pony/format-PrefixSpec-.txt |
PrefixSpec¶
[Source]
trait val PrefixSpec
| pony | 2217158 | https://sv.wikipedia.org/wiki/Ctenolophus%20pectinipalpis | Ctenolophus pectinipalpis | Ctenolophus pectinipalpis är en spindelart som först beskrevs av William Frederick Purcell 1903. Ctenolophus pectinipalpis ingår i släktet Ctenolophus och familjen Idiopidae. Inga underarter finns listade i Catalogue of Life.
Källor
Spindlar
pectinipalpis | swedish | 1.084787 |
Pony/src-collections-persistent-vec-.txt |
vec.pony
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299use mut = "collections"
class val Vec[A: Any #share]
"""
A persistent vector based on the Hash Array Mapped Trie from 'Ideal Hash
Trees' by Phil Bagwell.
"""
let _root: (_VecNode[A] | None)
let _tail: Array[A] val
let _size: USize
let _depth: USize
new val create() =>
_root = None
_tail = recover Array[A] end
_size = 0
_depth = -1
new val _create(
root': (_VecNode[A] | None),
tail': Array[A] val,
size': USize,
depth': USize)
=>
_root = root'
_tail = tail'
_size = size'
_depth = depth'
fun size(): USize =>
"""
Return the amount of values in the vector.
"""
_size
fun _tail_offset(): USize =>
"""
Return the amount of values in the root.
"""
_size - _tail.size()
fun apply(i: USize): val->A ? =>
"""
Get the i-th element, raising an error if the index is out of bounds.
"""
if i < _tail_offset() then
(_root as _VecNode[A])(_depth, i)?
else
_tail(i - _tail_offset())?
end
fun val update(i: USize, value: val->A): Vec[A] ? =>
"""
Return a vector with the i-th element changed, raising an error if the
index is out of bounds.
"""
if i < _tail_offset() then
let root = (_root as _VecNode[A]).update(_depth, i, value)?
_create(root, _tail, _size, _depth)
else
let tail =
recover val _tail.clone() .> update(i - _tail_offset(), value)? end
_create(_root, tail, _size, _depth)
end
fun val insert(i: USize, value: val->A): Vec[A] ? =>
"""
Return a vector with an element inserted. Elements after this are moved
up by one index, extending the vector. An out of bounds index raises an
error.
"""
if i >= _size then error end
var vec = this
var prev = value
for idx in mut.Range(i, _size) do
vec = vec.update(idx, prev = this(idx)?)?
end
vec.push(this(_size - 1)?)
fun val delete(i: USize): Vec[A] ? =>
"""
Return a vector with an element deleted. Elements after this are moved
down by one index, compacting the vector. An out of bounds index raises an
error.
"""
if i >= _size then error end
var vec = pop()?
for idx in mut.Range(i + 1, _size) do
vec = vec.update(idx - 1, this(idx)?)?
end
vec
fun val remove(i: USize, n: USize): Vec[A] ? =>
"""
Return a vector with n elements removed, beginning at index i.
"""
if i >= _size then error end
var vec = this
for _ in mut.Range(0, n) do vec = vec.pop()? end
for idx in mut.Range(i, _size - n) do
vec = vec.update(idx, this(idx + n)?)?
end
vec
fun val push(value: val->A): Vec[A] =>
"""
Return a vector with the value added to the end.
"""
// push tail into root when it becomes full
let size' = _size + 1
let tail = recover val _tail.clone() .> push(value) end
if tail.size() < 32 then
// push value into tail
_create(_root, tail, size', _depth)
elseif _tail_offset() == _Bits.next_pow32(_depth) then
// create new root
// push tail into root
let depth' = _depth + 1
let root' =
match _root
| let r: _VecNode[A] =>
try r.grow_root().push(depth', _tail_offset(), tail)?
else r
end
| None => _VecNode[A](tail)
end
_create(root', recover Array[A] end, size', depth')
else
// push tail into root
let root' =
try (_root as _VecNode[A]).push(_depth, _tail_offset(), tail)?
else _root
end
_create(root', recover Array[A] end, size', _depth)
end
fun val pop(): Vec[A] ? =>
"""
Return a vector with the value at the end removed.
"""
// root is popped when tail is empty
let size' = _size - 1
if _tail.size() > 0 then
let tail = _tail.trim(0, _tail.size() - 1)
_create(_root, tail, size', _depth)
else
(let root, var tail) = (_root as _VecNode[A]).pop(_depth, size')?
tail = tail.trim(0, tail.size() - 1)
if _depth == 0
then _create(None, tail, size', -1)
else _create(root, tail, size', _depth)
end
end
fun val concat(iter: Iterator[val->A]): Vec[A] =>
"""
Return a vector with the values of the given iterator added to the end.
"""
var v = this
for a in iter do
v = v.push(a)
end
v
fun val find(
value: val->A,
offset: USize = 0,
nth: USize = 0,
predicate: {(A, A): Bool} val = {(l: A, r: A): Bool => l is r })
: USize ?
=>
"""
Find the `nth` appearance of `value` from the beginning of the vector,
starting at `offset` and examining higher indices, and using the
supplied `predicate` for comparisons. Returns the index of the value, or
raise an error if the value isn't present.
By default, the search starts at the first element of the vector,
returns the first instance of `value` found, and uses object identity
for comparison.
"""
var n: USize = 0
for i in mut.Range(offset, _size) do
if predicate(this(i)?, value) then
if n == nth then return i end
n = n + 1
end
end
error
fun val contains(
value: val->A,
predicate: {(A, A): Bool} val = {(l: A, r: A): Bool => l is r })
: Bool
=>
"""
Returns true if the vector contains `value`, false otherwise.
"""
for v in values() do
if predicate(v, value) then return true end
end
false
fun val slice(from: USize = 0, to: USize = -1, step: USize = 1): Vec[A] =>
"""
Return a vector that is a clone of a portion of this vector. The range is
exclusive and saturated.
"""
var vec = Vec[A]
for i in mut.Range(0, if _size < to then _size else to end, step) do
try vec.push(this(i)?) end
end
vec
fun val reverse(): Vec[A] =>
"""
Return a vector with the elements in reverse order.
"""
var vec = Vec[A]
for i in mut.Reverse(_size - 1, 0) do
try vec = vec.push(this(i)?) end
end
vec
fun val keys(): VecKeys[A]^ =>
"""
Return an iterator over the indices in the vector.
"""
VecKeys[A](this)
fun val values(): VecValues[A]^ =>
"""
Return an iterator over the values in the vector.
"""
VecValues[A](this)
fun val pairs(): VecPairs[A]^ =>
"""
Return an iterator over the (index, value) pairs in the vector.
"""
VecPairs[A](this)
fun _pow32(n: USize): USize =>
"""
Raise 32 to the power of n.
"""
if n == 0 then
1
else
32 << ((n - 1) * 5)
end
fun _leaf_nodes(): Array[Array[A] val]^ =>
let lns = Array[Array[A] val](_size / 32)
match _root
| let vn: _VecNode[A] => vn.leaf_nodes(lns)
end
if _tail.size() > 0 then lns.push(_tail) end
lns
class VecKeys[A: Any #share]
embed _pairs: VecPairs[A]
new create(v: Vec[A]) => _pairs = VecPairs[A](v)
fun has_next(): Bool => _pairs.has_next()
fun ref next(): USize ? => _pairs.next()?._1
class VecValues[A: Any #share]
embed _pairs: VecPairs[A]
new create(v: Vec[A]) => _pairs = VecPairs[A](v)
fun has_next(): Bool => _pairs.has_next()
fun ref next(): val->A ? => _pairs.next()?._2
class VecPairs[A: Any #share]
let _leaf_nodes: Array[Array[A] val]
var _idx: USize = 0
var _i: USize = 0
new create(v: Vec[A]) =>
_leaf_nodes = v._leaf_nodes()
fun has_next(): Bool =>
_leaf_nodes.size() > 0
fun ref next(): (USize, A) ? =>
var leaves = _leaf_nodes(0)?
let v = leaves(_idx = _idx + 1)?
if _idx == leaves.size() then
_leaf_nodes.shift()?
_idx = 0
end
(_i = _i + 1, v)
| pony | 155527 | https://da.wikipedia.org/wiki/Robinson%20R44 | Robinson R44 | Robinson R44 er en lille 4-sædet helikopter produceret af Robinson Helicopter Company siden 1992.
R44 er en større udgave af Robinsons 2-sædet R22 og har derfor en relativt kraftigere motor og mere indvendig plads.
I Danmark bruges den hovedsageligt af private til hobbybrug, samt af virksomheder til rundflyvninger osv.
Specifikationer (R44 Raven II)
Generelt
Besætning: 1
Passagerer: 3
Løfteevne: 408 kg
Højde: 3,3 m
Længde (ekskl. rotor): 9,0 m
Længde (inkl. rotor): 11,7 m
Hovedrotordiameter: 10,1 m
Halerotordiameter: 1,5 m
Vægt (tom): 726 kg
Vægt (lastet): 1.134 kg
Motor: 1×Lycoming IO-540-AE1A5 6-cylindret luftkølet boksermotor med direkte brændstofindsprøjtning.
Ydelse
Topydelse: 260 hk (100%)
Marchydelse: 205 hk (78%)
Tophastighed: 130 knob (240 km/t)
Marchhastighed: 110 knob (203 km/t)
Rækkevidde: 300 sømil (560 km)
Ved max. gas og løft yder motoren 260 hk – dette er konstruktionen dog ikke designet til. Det er tilladt at belaste motoren så den yder 225 hk i op til 5 minutter, hvilket er max. belastning for transmission og andre udsatte dele.
Andet
R44 benytter oktan 100 flybenzin. Hovedtanken er på 116 liter og reservetanken er på 69 liter. Ved alm. belastning forbrændes der ca. 60 l i timen, hvilket giver en flyvetid på ca. 3 timer.
Eksterne henvisninger
Helikoptere | danish | 0.970423 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.