Returns the main thread.
static VALUE rb_thread_s_main(VALUE klass) { return rb_thread_main(); }
Threads are the Ruby implementation for a concurrent programming model.
Programs that require multiple threads of execution are a perfect candidate for Ruby's Thread class.
For example, we can create a new thread separate from the main thread's execution using ::new.
thr = Thread.new { puts "What's the big deal" }
Then we are able to pause the execution of the main thread and allow our new thread to finish, using join:
thr.join #=> "What's the big deal"
If we don't call thr.join
before the main thread
terminates, then all other threads including thr
will be
killed.
Alternatively, you can use an array for handling multiple threads at once, like in the following example:
threads = [] threads << Thread.new { puts "What's the big deal" } threads << Thread.new { 3.times { puts "Threads are fun!" } }
After creating a few threads we wait for them all to finish consecutively.
threads.each { |thr| thr.join }
To retrieve the last value of a thread, use value
thr = Thread.new { sleep 1; "Useful value" } thr.value #=> "Useful value"
In order to create new threads, Ruby provides ::new, ::start, and ::fork. A block must be provided with each of these methods, otherwise a ThreadError will be raised.
When subclassing the Thread class, the
initialize
method of your subclass will be ignored by ::start and ::fork. Otherwise, be sure to call
super in your initialize
method.
For terminating threads, Ruby provides a variety of ways to do this.
The class method ::kill, is meant to exit a given thread:
thr = Thread.new { sleep } Thread.kill(thr) # sends exit() to thr
Alternatively, you can use the instance method exit, or any of its aliases kill or terminate.
thr.exit
Ruby provides a few instance methods for querying the state of a given thread. To get a string with the current thread's state use status
thr = Thread.new { sleep } thr.status # => "sleep" thr.exit thr.status # => false
You can also use alive? to tell if the thread is running or sleeping, and stop? if the thread is dead or sleeping.
Since threads are created with blocks, the same rules apply to other Ruby blocks for variable scope. Any local variables created within this block are accessible to only this thread.
Each fiber has its own bucket for #[] storage. When you set a new fiber-local it is only accessible within this Fiber. To illustrate:
Thread.new { Thread.current[:foo] = "bar" Fiber.new { p Thread.current[:foo] # => nil }.resume }.join
This example uses [] for getting and []= for setting fiber-locals, you can also use keys to list the fiber-locals for a given thread and key? to check if a fiber-local exists.
When it comes to thread-locals, they are accessible within the entire scope of the thread. Given the following example:
Thread.new{ Thread.current.thread_variable_set(:foo, 1) p Thread.current.thread_variable_get(:foo) # => 1 Fiber.new{ Thread.current.thread_variable_set(:foo, 2) p Thread.current.thread_variable_get(:foo) # => 2 }.resume p Thread.current.thread_variable_get(:foo) # => 2 }.join
You can see that the thread-local :foo
carried over into the
fiber and was changed to 2
by the end of the thread.
This example makes use of thread_variable_set to create new thread-locals, and thread_variable_get to reference them.
There is also thread_variables to list all thread-locals, and thread_variable? to check if a given thread-local exists.
When an unhandled exception is raised inside a thread, it will terminate. By default, this exception will not propagate to other threads. The exception is stored and when another thread calls value or join, the exception will be re-raised in that thread.
t = Thread.new{ raise 'something went wrong' } t.value #=> RuntimeError: something went wrong
An exception can be raised from outside the thread using the #raise instance method, which takes the same parameters as Kernel#raise.
Setting ::abort_on_exception = true, #abort_on_exception = true, or $DEBUG = true will cause a subsequent unhandled exception raised in a thread to be automatically re-raised in the main thread.
With the addition of the class method ::handle_interrupt, you can now handle exceptions asynchronously with threads.
Ruby provides a few ways to support scheduling threads in your program.
The first way is by using the class method ::stop, to put the current running thread to sleep and schedule the execution of another thread.
Once a thread is asleep, you can use the instance method wakeup to mark your thread as eligible for scheduling.
You can also try ::pass, which attempts to pass execution to another thread but is dependent on the OS whether a running thread will switch or not. The same goes for priority, which lets you hint to the thread scheduler which threads you want to take precedence when passing execution. This method is also dependent on the OS and may be ignored on some platforms.
Returns the thread debug level. Available only if compiled with THREAD_DEBUG=-1.
static VALUE rb_thread_s_debug(void) { return INT2NUM(rb_thread_debug_enabled); }
Sets the thread debug level. Available only if compiled with THREAD_DEBUG=-1.
static VALUE rb_thread_s_debug_set(VALUE self, VALUE val) { rb_thread_debug_enabled = RTEST(val) ? NUM2INT(val) : 0; return val; }
Returns the status of the global “abort on exception'' condition.
The default is false
.
When set to true
, if any thread is aborted by an exception,
the raised exception will be re-raised in the main thread.
Can also be specified by the global $DEBUG flag or command line option
-d
.
See also ::abort_on_exception=.
There is also an instance level method to set this for a specific thread, see abort_on_exception.
static VALUE rb_thread_s_abort_exc(VALUE _) { return GET_THREAD()->vm->thread_abort_on_exception ? Qtrue : Qfalse; }
When set to true
, if any thread is aborted by an exception,
the raised exception will be re-raised in the main thread. Returns the new
state.
Thread.abort_on_exception = true t1 = Thread.new do puts "In new thread" raise "Exception from thread" end sleep(1) puts "not reached"
This will produce:
In new thread prog.rb:4: Exception from thread (RuntimeError) from prog.rb:2:in `initialize' from prog.rb:2:in `new' from prog.rb:2
See also ::abort_on_exception.
There is also an instance level method to set this for a specific thread, see abort_on_exception=.
static VALUE rb_thread_s_abort_exc_set(VALUE self, VALUE val) { GET_THREAD()->vm->thread_abort_on_exception = RTEST(val); return val; }
Returns the currently executing thread.
Thread.current #=> #<Thread:0x401bdf4c run>
static VALUE thread_s_current(VALUE klass) { return rb_thread_current(); }
Wraps the block in a single, VM-global Mutex#synchronize, returning the value of the block. A thread executing inside the exclusive section will only block other threads which also use the ::exclusive mechanism.
# File prelude.rb, line 8 def exclusive(&block) end
Terminates the currently running thread and schedules another thread to be run.
If this thread is already marked to be killed, ::exit returns the Thread.
If this is the main thread, or the last thread, exit the process.
static VALUE rb_thread_exit(VALUE _) { rb_thread_t *th = GET_THREAD(); return rb_thread_kill(th->self); }
Changes asynchronous interrupt timing.
interrupt means asynchronous event and corresponding procedure by #raise, #kill, signal trap (not supported yet) and main thread termination (if main thread terminates, then all other thread will be killed).
The given hash
has pairs like ExceptionClass =>
:TimingSymbol
. Where the ExceptionClass is the interrupt handled by
the given block. The TimingSymbol can be one of the following symbols:
:immediate
Invoke interrupts immediately.
:on_blocking
Invoke interrupts while BlockingOperation.
:never
Never invoke all interrupts.
BlockingOperation means that the operation will block the calling thread, such as read and write. On CRuby implementation, BlockingOperation is any operation executed without GVL.
Masked asynchronous interrupts are delayed until they are enabled. This method is similar to sigprocmask(3).
Asynchronous interrupts are difficult to use.
If you need to communicate between threads, please consider to use another way such as Queue.
Or use them with deep understanding about this method.
In this example, we can guard from #raise exceptions.
Using the :never
TimingSymbol the RuntimeError exception will always be ignored
in the first block of the main thread. In the second ::handle_interrupt block
we can purposefully handle RuntimeError
exceptions.
th = Thread.new do Thread.handle_interrupt(RuntimeError => :never) { begin # You can write resource allocation code safely. Thread.handle_interrupt(RuntimeError => :immediate) { # ... } ensure # You can write resource deallocation code safely. end } end Thread.pass # ... th.raise "stop"
While we are ignoring the RuntimeError exception, it's safe to write our resource allocation code. Then, the ensure block is where we can safely deallocate your resources.
In the next example, we will guard from the Timeout::Error exception. This will help prevent from leaking resources when Timeout::Error exceptions occur during normal ensure clause. For this example we use the help of the standard library Timeout, from lib/timeout.rb
require 'timeout' Thread.handle_interrupt(Timeout::Error => :never) { timeout(10){ # Timeout::Error doesn't occur here Thread.handle_interrupt(Timeout::Error => :on_blocking) { # possible to be killed by Timeout::Error # while blocking operation } # Timeout::Error doesn't occur here } }
In the first part of the timeout
block, we can rely on
Timeout::Error being ignored. Then in the Timeout::Error =>
:on_blocking
block, any operation that will block the calling thread
is susceptible to a Timeout::Error exception being raised.
It's possible to stack multiple levels of ::handle_interrupt blocks in order to control more than one ExceptionClass and TimingSymbol at a time.
Thread.handle_interrupt(FooError => :never) { Thread.handle_interrupt(BarError => :never) { # FooError and BarError are prohibited. } }
All exceptions inherited from the ExceptionClass parameter will be considered.
Thread.handle_interrupt(Exception => :never) { # all exceptions inherited from Exception are prohibited. }
static VALUE rb_thread_s_handle_interrupt(VALUE self, VALUE mask_arg) { VALUE mask; rb_execution_context_t * volatile ec = GET_EC(); rb_thread_t * volatile th = rb_ec_thread_ptr(ec); volatile VALUE r = Qnil; enum ruby_tag_type state; if (!rb_block_given_p()) { rb_raise(rb_eArgError, "block is needed."); } mask = 0; mask_arg = rb_to_hash_type(mask_arg); rb_hash_foreach(mask_arg, handle_interrupt_arg_check_i, (VALUE)&mask); if (!mask) { return rb_yield(Qnil); } OBJ_FREEZE_RAW(mask); rb_ary_push(th->pending_interrupt_mask_stack, mask); if (!rb_threadptr_pending_interrupt_empty_p(th)) { th->pending_interrupt_queue_checked = 0; RUBY_VM_SET_INTERRUPT(th->ec); } EC_PUSH_TAG(th->ec); if ((state = EC_EXEC_TAG()) == TAG_NONE) { r = rb_yield(Qnil); } EC_POP_TAG(); rb_ary_pop(th->pending_interrupt_mask_stack); if (!rb_threadptr_pending_interrupt_empty_p(th)) { th->pending_interrupt_queue_checked = 0; RUBY_VM_SET_INTERRUPT(th->ec); } RUBY_VM_CHECK_INTS(th->ec); if (state) { EC_JUMP_TAG(th->ec, state); } return r; }
Causes the given thread
to exit, see also ::exit.
count = 0 a = Thread.new { loop { count += 1 } } sleep(0.1) #=> 0 Thread.kill(a) #=> #<Thread:0x401b3d30 dead> count #=> 93947 a.alive? #=> false
static VALUE rb_thread_s_kill(VALUE obj, VALUE th) { return rb_thread_kill(th); }
Returns an array of Thread objects for all threads that are either runnable or stopped.
Thread.new { sleep(200) } Thread.new { 1000000.times {|i| i*i } } Thread.new { Thread.stop } Thread.list.each {|t| p t}
This will produce:
#<Thread:0x401b3e84 sleep> #<Thread:0x401b3f38 run> #<Thread:0x401b3fb0 sleep> #<Thread:0x401bdf4c run>
static VALUE thread_list(VALUE _) { return rb_thread_list(); }
Returns the main thread.
static VALUE rb_thread_s_main(VALUE klass) { return rb_thread_main(); }
Creates a new thread executing the given block.
Any args
given to ::new
will be passed to the block:
arr = [] a, b, c = 1, 2, 3 Thread.new(a,b,c) { |d,e,f| arr << d << e << f }.join arr #=> [1, 2, 3]
A ThreadError exception is raised if ::new is called without a block.
If you're going to subclass Thread, be sure
to call super in your initialize
method, otherwise a ThreadError will be raised.
static VALUE thread_s_new(int argc, VALUE *argv, VALUE klass) { rb_thread_t *th; VALUE thread = rb_thread_alloc(klass); if (GET_VM()->main_thread->status == THREAD_KILLED) rb_raise(rb_eThreadError, "can't alloc thread"); rb_obj_call_init_kw(thread, argc, argv, RB_PASS_CALLED_KEYWORDS); th = rb_thread_ptr(thread); if (!threadptr_initialized(th)) { rb_raise(rb_eThreadError, "uninitialized thread - check `%"PRIsVALUE"#initialize'", klass); } return thread; }
Give the thread scheduler a hint to pass execution to another thread. A running thread may or may not switch, it depends on OS and processor.
static VALUE thread_s_pass(VALUE klass) { rb_thread_schedule(); return Qnil; }
Returns whether or not the asynchronous queue is empty.
Since ::handle_interrupt can be used to defer asynchronous events, this method can be used to determine if there are any deferred events.
If you find this method returns true, then you may finish
:never
blocks.
For example, the following method processes deferred asynchronous events immediately.
def Thread.kick_interrupt_immediately Thread.handle_interrupt(Object => :immediate) { Thread.pass } end
If error
is given, then check only for error
type
deferred events.
th = Thread.new{ Thread.handle_interrupt(RuntimeError => :on_blocking){ while true ... # reach safe point to invoke interrupt if Thread.pending_interrupt? Thread.handle_interrupt(Object => :immediate){} end ... end } } ... th.raise # stop thread
This example can also be written as the following, which you should use to avoid asynchronous interrupts.
flag = true th = Thread.new{ Thread.handle_interrupt(RuntimeError => :on_blocking){ while true ... # reach safe point to invoke interrupt break if flag == false ... end } } ... flag = false # stop thread
static VALUE rb_thread_s_pending_interrupt_p(int argc, VALUE *argv, VALUE self) { return rb_thread_pending_interrupt_p(argc, argv, GET_THREAD()->self); }
Returns the status of the global “report on exception'' condition.
The default is true
since Ruby 2.5.
All threads created when this flag is true will report a message on $stderr if an exception kills the thread.
Thread.new { 1.times { raise } }
will produce this output on $stderr:
#<Thread:...> terminated with exception (report_on_exception is true): Traceback (most recent call last): 2: from -e:1:in `block in <main>' 1: from -e:1:in `times'
This is done to catch errors in threads early. In some cases, you might not want this output. There are multiple ways to avoid the extra output:
If the exception is not intended, the best is to fix the cause of the exception so it does not happen anymore.
If the exception is intended, it might be better to rescue it closer to where it is raised rather then let it kill the Thread.
If it is guaranteed the Thread will be joined
with #join or #value, then it is safe to disable
this report with Thread.current.report_on_exception = false
when starting the Thread. However, this might
handle the exception much later, or not at all if the Thread is never joined due to the parent thread
being blocked, etc.
See also ::report_on_exception=.
There is also an instance level method to set this for a specific thread, see report_on_exception=.
static VALUE rb_thread_s_report_exc(VALUE _) { return GET_THREAD()->vm->thread_report_on_exception ? Qtrue : Qfalse; }
Returns the new state. When set to true
, all threads created
afterwards will inherit the condition and report a message on $stderr if an
exception kills a thread:
Thread.report_on_exception = true t1 = Thread.new do puts "In new thread" raise "Exception from thread" end sleep(1) puts "In the main thread"
This will produce:
In new thread #<Thread:...prog.rb:2> terminated with exception (report_on_exception is true): Traceback (most recent call last): prog.rb:4:in `block in <main>': Exception from thread (RuntimeError) In the main thread
See also ::report_on_exception.
There is also an instance level method to set this for a specific thread, see report_on_exception=.
static VALUE rb_thread_s_report_exc_set(VALUE self, VALUE val) { GET_THREAD()->vm->thread_report_on_exception = RTEST(val); return val; }
Stops execution of the current thread, putting it into a “sleep'' state, and schedules execution of another thread.
a = Thread.new { print "a"; Thread.stop; print "c" } sleep 0.1 while a.status!='sleep' print "b" a.run a.join #=> "abc"
static VALUE thread_stop(VALUE _) { return rb_thread_stop(); }
Attribute Reference—Returns the value of a fiber-local variable (current
thread's root fiber if not explicitly inside a Fiber), using either a symbol or a string name. If
the specified variable does not exist, returns nil
.
[ Thread.new { Thread.current["name"] = "A" }, Thread.new { Thread.current[:name] = "B" }, Thread.new { Thread.current["name"] = "C" } ].each do |th| th.join puts "#{th.inspect}: #{th[:name]}" end
This will produce:
#<Thread:0x00000002a54220 dead>: A #<Thread:0x00000002a541a8 dead>: B #<Thread:0x00000002a54130 dead>: C
#[] and #[]= are not thread-local but fiber-local. This confusion did not exist in Ruby 1.8 because fibers are only available since Ruby 1.9. Ruby 1.9 chooses that the methods behaves fiber-local to save following idiom for dynamic scope.
def meth(newvalue) begin oldvalue = Thread.current[:name] Thread.current[:name] = newvalue yield ensure Thread.current[:name] = oldvalue end end
The idiom may not work as dynamic scope if the methods are thread-local and a given block switches fiber.
f = Fiber.new { meth(1) { Fiber.yield } } meth(2) { f.resume } f.resume p Thread.current[:name] #=> nil if fiber-local #=> 2 if thread-local (The value 2 is leaked to outside of meth method.)
For thread-local variables, please see thread_variable_get and thread_variable_set.
static VALUE rb_thread_aref(VALUE thread, VALUE key) { ID id = rb_check_id(&key); if (!id) return Qnil; return rb_thread_local_aref(thread, id); }
Attribute Assignment—Sets or creates the value of a fiber-local variable, using either a symbol or a string.
See also #[].
For thread-local variables, please see thread_variable_set and thread_variable_get.
static VALUE rb_thread_aset(VALUE self, VALUE id, VALUE val) { return rb_thread_local_aset(self, rb_to_id(id), val); }
Returns the status of the thread-local “abort on exception''
condition for this thr
.
The default is false
.
See also abort_on_exception=.
There is also a class level method to set this for all threads, see ::abort_on_exception.
static VALUE rb_thread_abort_exc(VALUE thread) { return rb_thread_ptr(thread)->abort_on_exception ? Qtrue : Qfalse; }
When set to true
, if this thr
is aborted by an
exception, the raised exception will be re-raised in the main thread.
See also abort_on_exception.
There is also a class level method to set this for all threads, see ::abort_on_exception=.
static VALUE rb_thread_abort_exc_set(VALUE thread, VALUE val) { rb_thread_ptr(thread)->abort_on_exception = RTEST(val); return val; }
Adds proc as a handler for tracing.
See #set_trace_func and Kernel#set_trace_func.
static VALUE thread_add_trace_func_m(VALUE obj, VALUE trace) { thread_add_trace_func(GET_EC(), rb_thread_ptr(obj), trace); return trace; }
Returns true
if thr
is running or sleeping.
thr = Thread.new { } thr.join #=> #<Thread:0x401b3fb0 dead> Thread.current.alive? #=> true thr.alive? #=> false
static VALUE rb_thread_alive_p(VALUE thread) { if (rb_threadptr_dead(rb_thread_ptr(thread))) { return Qfalse; } else { return Qtrue; } }
Returns the current backtrace of the target thread.
static VALUE rb_thread_backtrace_m(int argc, VALUE *argv, VALUE thval) { return rb_vm_thread_backtrace(argc, argv, thval); }
Returns the execution stack for the target thread—an array containing backtrace location objects.
See Thread::Backtrace::Location for more information.
This method behaves similarly to Kernel#caller_locations except it applies to a specific thread.
static VALUE rb_thread_backtrace_locations_m(int argc, VALUE *argv, VALUE thval) { return rb_vm_thread_backtrace_locations(argc, argv, thval); }
Terminates thr
and schedules another thread to be run,
returning the terminated Thread. If this is the
main thread, or the last thread, exits the process.
VALUE rb_thread_kill(VALUE thread) { rb_thread_t *th = rb_thread_ptr(thread); if (th->to_kill || th->status == THREAD_KILLED) { return thread; } if (th == th->vm->main_thread) { rb_exit(EXIT_SUCCESS); } thread_debug("rb_thread_kill: %p (%"PRI_THREAD_ID")\n", (void *)th, thread_id_str(th)); if (th == GET_THREAD()) { /* kill myself immediately */ rb_threadptr_to_kill(th); } else { threadptr_check_pending_interrupt_queue(th); rb_threadptr_pending_interrupt_enque(th, eKillSignal); rb_threadptr_interrupt(th); } return thread; }
Returns a fiber-local for the given key. If the key can't be found, there are several options: With no other arguments, it will raise a KeyError exception; if default is given, then that will be returned; if the optional code block is specified, then that will be run and its result returned. See #[] and Hash#fetch.
static VALUE rb_thread_fetch(int argc, VALUE *argv, VALUE self) { VALUE key, val; ID id; rb_thread_t *target_th = rb_thread_ptr(self); int block_given; rb_check_arity(argc, 1, 2); key = argv[0]; block_given = rb_block_given_p(); if (block_given && argc == 2) { rb_warn("block supersedes default value argument"); } id = rb_check_id(&key); if (id == recursive_key) { return target_th->ec->local_storage_recursive_hash; } else if (id && target_th->ec->local_storage && st_lookup(target_th->ec->local_storage, id, &val)) { return val; } else if (block_given) { return rb_yield(key); } else if (argc == 1) { rb_key_err_raise(rb_sprintf("key not found: %+"PRIsVALUE, key), self, key); } else { return argv[1]; } }
Returns the ThreadGroup which contains the
given thread, or returns nil
if thr
is not a
member of any group.
Thread.main.group #=> #<ThreadGroup:0x4029d914>
VALUE rb_thread_group(VALUE thread) { VALUE group = rb_thread_ptr(thread)->thgroup; return group == 0 ? Qnil : group; }
The calling thread will suspend execution and run this thr
.
Does not return until thr
exits or until the given
limit
seconds have passed.
If the time limit expires, nil
will be returned, otherwise
thr
is returned.
Any threads not joined will be killed when the main program exits.
If thr
had previously raised an exception and the ::abort_on_exception or
$DEBUG flags are not set, (so the exception has not yet been processed), it
will be processed at this time.
a = Thread.new { print "a"; sleep(10); print "b"; print "c" } x = Thread.new { print "x"; Thread.pass; print "y"; print "z" } x.join # Let thread x finish, thread a will be killed on exit. #=> "axyz"
The following example illustrates the limit
parameter.
y = Thread.new { 4.times { sleep 0.1; puts 'tick... ' }} puts "Waiting" until y.join(0.15)
This will produce:
tick... Waiting tick... Waiting tick... tick...
static VALUE thread_join_m(int argc, VALUE *argv, VALUE self) { VALUE limit; rb_hrtime_t rel, *to = 0; /* * This supports INFINITY and negative values, so we can't use * rb_time_interval right now... */ if (!rb_check_arity(argc, 0, 1) || NIL_P(argv[0])) { /* unlimited */ } else if (FIXNUM_P(limit = argv[0])) { rel = rb_sec2hrtime(NUM2TIMET(limit)); to = &rel; } else { to = double2hrtime(&rel, rb_num2dbl(limit)); } return thread_join(rb_thread_ptr(self), to); }
Returns true
if the given string (or symbol) exists as a
fiber-local variable.
me = Thread.current me[:oliver] = "a" me.key?(:oliver) #=> true me.key?(:stanley) #=> false
static VALUE rb_thread_key_p(VALUE self, VALUE key) { ID id = rb_check_id(&key); st_table *local_storage = rb_thread_ptr(self)->ec->local_storage; if (!id || local_storage == NULL) { return Qfalse; } else if (st_is_member(local_storage, id)) { return Qtrue; } else { return Qfalse; } }
Returns an array of the names of the fiber-local variables (as Symbols).
thr = Thread.new do Thread.current[:cat] = 'meow' Thread.current["dog"] = 'woof' end thr.join #=> #<Thread:0x401b3f10 dead> thr.keys #=> [:dog, :cat]
static VALUE rb_thread_keys(VALUE self) { st_table *local_storage = rb_thread_ptr(self)->ec->local_storage; VALUE ary = rb_ary_new(); if (local_storage) { st_foreach(local_storage, thread_keys_i, ary); } return ary; }
Terminates thr
and schedules another thread to be run,
returning the terminated Thread. If this is the
main thread, or the last thread, exits the process.
VALUE rb_thread_kill(VALUE thread) { rb_thread_t *th = rb_thread_ptr(thread); if (th->to_kill || th->status == THREAD_KILLED) { return thread; } if (th == th->vm->main_thread) { rb_exit(EXIT_SUCCESS); } thread_debug("rb_thread_kill: %p (%"PRI_THREAD_ID")\n", (void *)th, thread_id_str(th)); if (th == GET_THREAD()) { /* kill myself immediately */ rb_threadptr_to_kill(th); } else { threadptr_check_pending_interrupt_queue(th); rb_threadptr_pending_interrupt_enque(th, eKillSignal); rb_threadptr_interrupt(th); } return thread; }
show the name of the thread.
static VALUE rb_thread_getname(VALUE thread) { return rb_thread_ptr(thread)->name; }
set given name to the ruby thread. On some platform, it may set the name to pthread and/or kernel.
static VALUE rb_thread_setname(VALUE thread, VALUE name) { rb_thread_t *target_th = rb_thread_ptr(thread); if (!NIL_P(name)) { rb_encoding *enc; StringValueCStr(name); enc = rb_enc_get(name); if (!rb_enc_asciicompat(enc)) { rb_raise(rb_eArgError, "ASCII incompatible encoding (%s)", rb_enc_name(enc)); } name = rb_str_new_frozen(name); } target_th->name = name; if (threadptr_initialized(target_th)) { native_set_another_thread_name(target_th->thread_id, name); } return name; }
Returns whether or not the asynchronous queue is empty for the target thread.
If error
is given, then check only for error
type
deferred events.
See ::pending_interrupt? for more information.
static VALUE rb_thread_pending_interrupt_p(int argc, VALUE *argv, VALUE target_thread) { rb_thread_t *target_th = rb_thread_ptr(target_thread); if (!target_th->pending_interrupt_queue) { return Qfalse; } if (rb_threadptr_pending_interrupt_empty_p(target_th)) { return Qfalse; } if (rb_check_arity(argc, 0, 1)) { VALUE err = argv[0]; if (!rb_obj_is_kind_of(err, rb_cModule)) { rb_raise(rb_eTypeError, "class or module required for rescue clause"); } if (rb_threadptr_pending_interrupt_include_p(target_th, err)) { return Qtrue; } else { return Qfalse; } } else { return Qtrue; } }
Returns the priority of thr. Default is inherited from the current thread which creating the new thread, or zero for the initial main thread; higher-priority thread will run more frequently than lower-priority threads (but lower-priority threads can also run).
This is just hint for Ruby thread scheduler. It may be ignored on some platform.
Thread.current.priority #=> 0
static VALUE rb_thread_priority(VALUE thread) { return INT2NUM(rb_thread_ptr(thread)->priority); }
Sets the priority of thr to integer. Higher-priority threads will run more frequently than lower-priority threads (but lower-priority threads can also run).
This is just hint for Ruby thread scheduler. It may be ignored on some platform.
count1 = count2 = 0 a = Thread.new do loop { count1 += 1 } end a.priority = -1 b = Thread.new do loop { count2 += 1 } end b.priority = -2 sleep 1 #=> 1 count1 #=> 622504 count2 #=> 5832
static VALUE rb_thread_priority_set(VALUE thread, VALUE prio) { rb_thread_t *target_th = rb_thread_ptr(thread); int priority; #if USE_NATIVE_THREAD_PRIORITY target_th->priority = NUM2INT(prio); native_thread_apply_priority(th); #else priority = NUM2INT(prio); if (priority > RUBY_THREAD_PRIORITY_MAX) { priority = RUBY_THREAD_PRIORITY_MAX; } else if (priority < RUBY_THREAD_PRIORITY_MIN) { priority = RUBY_THREAD_PRIORITY_MIN; } target_th->priority = (int8_t)priority; #endif return INT2NUM(target_th->priority); }
Raises an exception from the given thread. The caller does not have to be
thr
. See Kernel#raise
for more information.
Thread.abort_on_exception = true a = Thread.new { sleep(200) } a.raise("Gotcha")
This will produce:
prog.rb:3: Gotcha (RuntimeError) from prog.rb:2:in `initialize' from prog.rb:2:in `new' from prog.rb:2
static VALUE thread_raise_m(int argc, VALUE *argv, VALUE self) { rb_thread_t *target_th = rb_thread_ptr(self); const rb_thread_t *current_th = GET_THREAD(); threadptr_check_pending_interrupt_queue(target_th); rb_threadptr_raise(target_th, argc, argv); /* To perform Thread.current.raise as Kernel.raise */ if (current_th == target_th) { RUBY_VM_CHECK_INTS(target_th->ec); } return Qnil; }
Returns the status of the thread-local “report on exception''
condition for this thr
.
The default value when creating a Thread is the value of the global flag ::report_on_exception.
See also report_on_exception=.
There is also a class level method to set this for all new threads, see ::report_on_exception=.
static VALUE rb_thread_report_exc(VALUE thread) { return rb_thread_ptr(thread)->report_on_exception ? Qtrue : Qfalse; }
When set to true
, a message is printed on $stderr if an
exception kills this thr
. See ::report_on_exception
for details.
See also report_on_exception.
There is also a class level method to set this for all new threads, see ::report_on_exception=.
static VALUE rb_thread_report_exc_set(VALUE thread, VALUE val) { rb_thread_ptr(thread)->report_on_exception = RTEST(val); return val; }
Wakes up thr
, making it eligible for scheduling.
a = Thread.new { puts "a"; Thread.stop; puts "c" } sleep 0.1 while a.status!='sleep' puts "Got here" a.run a.join
This will produce:
a Got here c
See also the instance method wakeup.
VALUE rb_thread_run(VALUE thread) { rb_thread_wakeup(thread); rb_thread_schedule(); return thread; }
Returns the safe level.
This method is obsolete because $SAFE is a process global state. Simply check $SAFE.
static VALUE rb_thread_safe_level(VALUE thread) { rb_warn("Thread#safe_level will be removed in Ruby 3.0"); return UINT2NUM(GET_VM()->safe_level_); }
Establishes proc on thr as the handler for tracing, or
disables tracing if the parameter is nil
.
static VALUE thread_set_trace_func_m(VALUE target_thread, VALUE trace) { rb_execution_context_t *ec = GET_EC(); rb_thread_t *target_th = rb_thread_ptr(target_thread); rb_threadptr_remove_event_hook(ec, target_th, call_trace_func, Qundef); if (NIL_P(trace)) { return Qnil; } else { thread_add_trace_func(ec, target_th, trace); return trace; } }
Returns the status of thr
.
"sleep"
Returned if this thread is sleeping or waiting on I/O
"run"
When this thread is executing
"aborting"
If this thread is aborting
false
When this thread is terminated normally
nil
If terminated with an exception.
a = Thread.new { raise("die now") } b = Thread.new { Thread.stop } c = Thread.new { Thread.exit } d = Thread.new { sleep } d.kill #=> #<Thread:0x401b3678 aborting> a.status #=> nil b.status #=> "sleep" c.status #=> false d.status #=> "aborting" Thread.current.status #=> "run"
See also the instance methods alive? and stop?
static VALUE rb_thread_status(VALUE thread) { rb_thread_t *target_th = rb_thread_ptr(thread); if (rb_threadptr_dead(target_th)) { if (!NIL_P(target_th->ec->errinfo) && !FIXNUM_P(target_th->ec->errinfo)) { return Qnil; } else { return Qfalse; } } else { return rb_str_new2(thread_status_name(target_th, FALSE)); } }
Returns true
if thr
is dead or sleeping.
a = Thread.new { Thread.stop } b = Thread.current a.stop? #=> true b.stop? #=> false
static VALUE rb_thread_stop_p(VALUE thread) { rb_thread_t *th = rb_thread_ptr(thread); if (rb_threadptr_dead(th)) { return Qtrue; } else if (th->status == THREAD_STOPPED || th->status == THREAD_STOPPED_FOREVER) { return Qtrue; } else { return Qfalse; } }
Terminates thr
and schedules another thread to be run,
returning the terminated Thread. If this is the
main thread, or the last thread, exits the process.
VALUE rb_thread_kill(VALUE thread) { rb_thread_t *th = rb_thread_ptr(thread); if (th->to_kill || th->status == THREAD_KILLED) { return thread; } if (th == th->vm->main_thread) { rb_exit(EXIT_SUCCESS); } thread_debug("rb_thread_kill: %p (%"PRI_THREAD_ID")\n", (void *)th, thread_id_str(th)); if (th == GET_THREAD()) { /* kill myself immediately */ rb_threadptr_to_kill(th); } else { threadptr_check_pending_interrupt_queue(th); rb_threadptr_pending_interrupt_enque(th, eKillSignal); rb_threadptr_interrupt(th); } return thread; }
Returns true
if the given string (or symbol) exists as a
thread-local variable.
me = Thread.current me.thread_variable_set(:oliver, "a") me.thread_variable?(:oliver) #=> true me.thread_variable?(:stanley) #=> false
Note that these are not fiber local variables. Please see #[] and #thread_variable_get for more details.
static VALUE rb_thread_variable_p(VALUE thread, VALUE key) { VALUE locals; ID id = rb_check_id(&key); if (!id) return Qfalse; if (LIKELY(!THREAD_LOCAL_STORAGE_INITIALISED_P(thread))) { return Qfalse; } locals = rb_thread_local_storage(thread); if (rb_hash_lookup(locals, ID2SYM(id)) != Qnil) { return Qtrue; } else { return Qfalse; } return Qfalse; }
Returns the value of a thread local variable that has been set. Note that these are different than fiber local values. For fiber local values, please see #[] and #[]=.
Thread local values are carried along with threads, and do not respect fibers. For example:
Thread.new { Thread.current.thread_variable_set("foo", "bar") # set a thread local Thread.current["foo"] = "bar" # set a fiber local Fiber.new { Fiber.yield [ Thread.current.thread_variable_get("foo"), # get the thread local Thread.current["foo"], # get the fiber local ] }.resume }.join.value # => ['bar', nil]
The value “bar” is returned for the thread local, where nil is returned for the fiber local. The fiber is executed in the same thread, so the thread local values are available.
static VALUE rb_thread_variable_get(VALUE thread, VALUE key) { VALUE locals; if (LIKELY(!THREAD_LOCAL_STORAGE_INITIALISED_P(thread))) { return Qnil; } locals = rb_thread_local_storage(thread); return rb_hash_aref(locals, rb_to_symbol(key)); }
Sets a thread local with key
to value
. Note that
these are local to threads, and not to fibers. Please see #thread_variable_get
and #[] for more information.
static VALUE rb_thread_variable_set(VALUE thread, VALUE id, VALUE val) { VALUE locals; if (OBJ_FROZEN(thread)) { rb_frozen_error_raise(thread, "can't modify frozen thread locals"); } locals = rb_thread_local_storage(thread); return rb_hash_aset(locals, rb_to_symbol(id), val); }
Returns an array of the names of the thread-local variables (as Symbols).
thr = Thread.new do Thread.current.thread_variable_set(:cat, 'meow') Thread.current.thread_variable_set("dog", 'woof') end thr.join #=> #<Thread:0x401b3f10 dead> thr.thread_variables #=> [:dog, :cat]
Note that these are not fiber local variables. Please see #[] and #thread_variable_get for more details.
static VALUE rb_thread_variables(VALUE thread) { VALUE locals; VALUE ary; ary = rb_ary_new(); if (LIKELY(!THREAD_LOCAL_STORAGE_INITIALISED_P(thread))) { return ary; } locals = rb_thread_local_storage(thread); rb_hash_foreach(locals, keys_i, ary); return ary; }
Dump the name, id, and status of thr to a string.
static VALUE rb_thread_to_s(VALUE thread) { VALUE cname = rb_class_path(rb_obj_class(thread)); rb_thread_t *target_th = rb_thread_ptr(thread); const char *status; VALUE str, loc; status = thread_status_name(target_th, TRUE); str = rb_sprintf("#<%"PRIsVALUE":%p", cname, (void *)thread); if (!NIL_P(target_th->name)) { rb_str_catf(str, "@%"PRIsVALUE, target_th->name); } if ((loc = threadptr_invoke_proc_location(target_th)) != Qnil) { rb_str_catf(str, " %"PRIsVALUE":%"PRIsVALUE, RARRAY_AREF(loc, 0), RARRAY_AREF(loc, 1)); rb_gc_force_recycle(loc); } rb_str_catf(str, " %s>", status); return str; }
Waits for thr
to complete, using join, and returns its value or raises
the exception which terminated the thread.
a = Thread.new { 2 + 2 } a.value #=> 4 b = Thread.new { raise 'something went wrong' } b.value #=> RuntimeError: something went wrong
static VALUE thread_value(VALUE self) { rb_thread_t *th = rb_thread_ptr(self); thread_join(th, 0); return th->value; }
Marks a given thread as eligible for scheduling, however it may still remain blocked on I/O.
Note: This does not invoke the scheduler, see run for more information.
c = Thread.new { Thread.stop; puts "hey!" } sleep 0.1 while c.status!='sleep' c.wakeup c.join #=> "hey!"
VALUE rb_thread_wakeup(VALUE thread) { if (!RTEST(rb_thread_wakeup_alive(thread))) { rb_raise(rb_eThreadError, "killed thread"); } return thread; }


Description
This is a simple test workflow which just outputs (you guessed it) "Hello World".
Inputs
None
Outputs
Foo
Type
text/plain
Expected Value
"Hello World".


mole-server
The mole-server is built in go and uses mongodb as database. Once both are installed on your stack, do:
Install
go get https://github.com/molejs/mole-server
Configure and run
Configuration of mole server is done via environment variables.
| Name | Description | Default value |
|---|---|---|
MOLE_ADDR |
Server address, e.g :8080 |
:8080 |
MOLE_MONGO_ADDR |
MongoDB server address | <IP_ADDRESS>:27017 |
MOLE_DB_NAME |
MongoDB database name for mole | <IP_ADDRESS>:27017 |
MOLE_KEY |
SSL certificate key | none [1] |
MOLE_CERT |
SSL certificate | none [1] |
[1] If cert and key are not empty the server will be started as an HTTPS server.
To run the server just:
go run server.go
Retrieving logs
curl http://example.com/logs?limit=20&skip=0
Query string params
| Param name | Description | Required | Default value |
|---|---|---|---|
limit |
Max number of logs to retrieve | no | 25 |
skip |
Skip first n logs when retrieving | no | 0 |
All results are ordered by descending creation date. A successful result looks like:
{
"error": false,
"logs": [array of logs]
"count": 10, // The number of logs retrieved
"total": 50 // Total number of logs
}
Reporting logs
curl -X POST --data "{the json log object}" http://example.com/logs
If the request is successful the request will look like:
{
"error": false
}
Errors
All error responses look like:
{
"error": true,
"msg": "error message"
}


You can set the shortcut keys bound to the menu item "%LOCATION%" of %MENU_HOLDER%.
(Same as the app's initial setting)


Vivo S5 leaked renders surface, show conflicting designs - Gizchina.com
by AbdulRate this post
Vivo is about to launch a new smartphone in China dubbed as S5 on November 14, as teased by a number of Vivo official posts so far. However, we got our first look of the device in the form of a leaked promotion advertisement today featuring Chinese singer Cai Xukun who will be the brand ambassador for this phone. And now, not one but two different renders of Vivo S5 surface on the web with uncommon display designs.
We all know the back of the Vivo S5 will feature a diamond-shaped quad-camera layout with an LED flash underneath it from the first-ever leak. But we were never exposed to the front of the phone which has happened now. The first promotional front render of the Vivo S5 shows a hole-punch cutout at the top right corner to accommodate the selfie camera. Whereas, the second set of the phone’s renders say otherwise. In these renders, there exists no punch-hole, notch or whatsoever with a clean full-screen panel without any obstruction. Also, we get to see the fancy gradient colour options the device will be available in.
The two separate renders of the Vivo S5 raises questions about the authentic design of the phone. Maybe it will arrive in two different variants featuring a punch-hole camera on the one and pop-up camera on the another. Anyways, we recommend you to take this piece of information with a pinch of salt until we get more information from Vivo itself.


Dashboard
Department Management
Department Groups
Departments
Department Root URL
Access Control
Staff Management
Control Panel
Manage Staff Profile Fields


Judge orders Trump to pay $2m over misuse of charity
by Rob BeschizzaThe Associated Press reports that a New York judge today ordered President Donald Trump to pay $2m for misusing the Trump Foundation, supposedly a charity but evidently an extension of his political and business interests.
Judge Saliann Scarpulla also signed off on an agreement Thursday to close the Trump Foundation and distribute about $1.7 million in remaining funds to other nonprofit groups. A request for comment was emailed to Trump’s lawyer. New York’s attorney general filed a lawsuit last year alleging Trump and his family illegally operated the foundation as an extension of his businesses and his presidential campaign.


Report: West Ham have considered Stoke City goalkeeper Jack Butland
by Tom ProcterWest Ham United have reportedly considered making a move for Stoke City goalkeeper Jack Butland.
According to a report from 90min, the Hammers gave thought to making a move for the Championship stopper following the struggles of Lukasz Fabianski’s deputy Roberto.
The Spaniard has made an awful start to his London Stadium career after signing in the summer, and has already lost his place in the starting XI to David Martin.
His long-term future at the club is already looking bleak, and 90min say the club have opened talks with Middlesbrough over Darren Randolph.
But they also claim Butland has been discussed, but the club have been ‘unable to move away’ from their former stopper.
TBR’s view – Butland a long-term acquisition
Butland has not been in particularly good form for struggling Stoke, but could be a good pickup by West Ham, who will need a ‘keeper for the long-term soon.
It sounds as though the club are more keen to re-sign Randolph following his £5 million departure in 2017 (BBC Sport).
He would be an upgrade on Roberto, but the club would then have three ageing goalkeepers – perhaps the 26-year-old Butland, who does have nine England caps, shouldn’t be discounted.
Have something to tell us about this article?
Let us know


Syntax:
stream-element-type stream => typespec
Arguments and Values:
stream---a stream.
typespec---a type specifier.
Description:
stream-element-type returns a type specifier that indicates the types of objects that may be read from or written to stream.
Streams created by open have an element type restricted to integer or a subtype of type character.
Examples:
;; Note that the stream must accomodate at least the specified type, ;; but might accomodate other types. Further note that even if it does ;; accomodate exactly the specified type, the type might be specified in ;; any of several ways. (with-open-file (s "test" :element-type '(integer 0 1) :if-exists :error :direction :output) (stream-element-type s)) => INTEGER OR=> (UNSIGNED-BYTE 16) OR=> (UNSIGNED-BYTE 8) OR=> BIT OR=> (UNSIGNED-BYTE 1) OR=> (INTEGER 0 1) OR=> (INTEGER 0 (2))
Side Effects: None.
Affected By: None.
Exceptional Situations:
Should signal an error of type type-error if stream is not a stream.
See Also: None.
Notes: None.


String
methods replace()
, replaceAll()
or replaceFirst()
that have no effect. Such calls can be guaranteed to have no effect when the qualifier and search string are compile-time constants
and the search string is not found in the qualifier. This is redundant and may indicate an error.
Example:
// replacement does nothing
"hello".replace("$value$", value);
New in 2022.1


Pi Types
A Pi type is a type of (dependent) functions. If p_1, … p_n are named or unnamed parameters and B is a type, then \Pi p_1 … p_n -> B is also a type. If B does not refer to variables defined in the parameters, you can write A_1 -> … A_n -> B instead, where A_i are types of the parameters. If A_i has type \Type p_i h_i and B has type \Type p h, then the type of the Pi type is \Type p_max h, where p_max is the maximum of p_1, … p_n, and p. Note that the homotopy level of the Pi type is simply the homotopy level of the codomain.
An expression of the form \Pi p_1 … p_n -> B is equivalent to \Pi p_1 -> \Pi p_2 … p_n -> B. Moreover, if p_1 equals to (x_1 … x_k : A), then it is also equivalent to \Pi (x_1 : A) -> \Pi (x_2 … x_k : A) -> \Pi p_2 … p_n -> B.
A lambda parameter is either a variable or a named parameter. If p_1, … p_n is a sequence of lambda parameters and e is an expression of type E, then \lam p_1 … p_n => e is an expression which has type \Pi p_1 … p_n -> E. If some parameters do not have types, then they will be inferred by the typechecker.
If f is an expression of type \Pi (x : A) -> B and a is an expression of type A, then f a is an expression of type B[a/x].
An expression of the form (\lam x => b) a reduces to b[a/x].
An expression of the form \lam x => f x is equivalent to f if x is not free in f (eta equivalence for Pi types).
Pattern matching
It is possible to use pattern matching in lambda parameters with the following syntax: \lam (p) => e, where p is a pattern. This expression is equivalent to \lam x => \let (p) => x \in e.
Implicit lambdas
An implicit lambda is written as __. When this expression appears inside some other expression, the outer expression is replaced with a lambda and __ is replaced with the argument of this lambda. The outer expression is the closest ancestor of __ in which “it is possible to insert a lambda”. Lambda is never inserted in case arguments, anonymous class extensions, after \new, on the left of the function application, under projections, under \pi or \sigma, and under binary operators.
Examples:
- \case f __ \with { … } == \lam x => \case f x \with { … }
- f __.1 == f (\lam p => p.1)
- __ a + __ `f` g __ (h __ 0) == \lam x y z => x a + y `f` g z (\lam t => h t 0)
- + (f __) __ == \lam x => + (\lam y => f y) x
- __ -> \Sigma __ __ == \lam A B C => A -> \Sigma B C


The Alchemist
Plot
Characters
Map
Quotes
Film Adaptations
Paulo Coelho
Paulo Coelho
Bibliography
Interview
Other Books
Pirate Coelho
Follow Paulo on Facebook


By leaving this household, you will not be able to access any of the accounts, transactions, or budget items again.


What is new in Ring 1.6?¶
In this chapter we will learn about the changes and new features in Ring 1.6 release.
List of changes and new features¶
Ring 1.6 comes with many new features!
- Employee Application
- New Tool: Ring2EXE
- Better Ring For Android
- New Tool : Folder2qrc
- Better Scripts for building Ring
- RingConsoleColors Extension
- RingMurmurHash Extension
- Better Ring Notepad
- Better RingQt
- Better StdLib
- Better RingVM
- Better RingREPL
- Using Tab instead of char(9)
- Using CR as Carriage return
- Using the ! operator as not
- Using && and || operators
- Using ? to print expression then new line
Employee Application¶
The Employee application is added to ring/applications
Developer: Ahmed Hassouna
New Tool: Ring2EXE¶
In Ring 1.6 we have a nice tool called Ring2EXE (Written in Ring itself)
Using Ring2EXE we can distribute applications quickly for Windows, Linux, macOS and Mobile devices
Read the chapter “Distributing Ring Applications using Ring2EXE” for more information!
Better Ring For Android¶
Ring For Android (using RingQt) is updated to use the Ring Object File ( *.ringo ) instead of using many source code files ( *.ring )
The next screen shot is an example of building the cards game for Android
We are using cards.ringo instead of cards.ring
If you have large project (many *.ring files) it will use only one *.ringo file.
To prepare Qt project to distribute RingQt application for Mobile use Ring2EXE
Example
ring2exe cards.ring -dist -mobileqt
Example (2)
ring2exe formdesigner.ring -dist -mobileqt
New Tool: Folder2qrc¶
When we have large RingQt project that contains a lot of images and files, We need to add these files to the resource file ( *.qrc ) when distributing applications for Mobile devices.
Instead of adding these files one by one, Ring 1.6 comes with a simple tool that save our time, It’s called Folder2qrc.
Example:
folder2qrc formdesigner.ring
We determine the main source file while we are in the application folder, and Folder2qrc will check all of the files in the current folder and sub folders, Then add them to the resource file after the mainfile.ringo (In our example this will be formdesigner.ringo)
The output file will be : project.qrc
You can open it and remove the files that you don’t need in the resources!
Better Scripts for building Ring¶
Ring 1.6 comes with better scripts for building Ring from source code.
The updates are tested on 32bit and 64bit systems on Windows, Linux (Ubuntu,Fedora) and macOS.
The scripts for Windows are updated to find the Visual C/C++ compiler based on your Visual Studio version.
RingConsoleColors Extension¶
Using the RingConsoleColors extension we can easily change the colors used in our console applications
For more information check the RingConsoleColors chapter in the documentation.
RingMurmurHash Extension¶
Ring 1.6 comes with the RingMurmurHash extension!
Developer: Hassan Ahmed
Example:
load "murmurhashlib.ring"
key = "Ring Language"
see murmurhash3_x86_32(key, 0, 0) + nl // Output:<PHONE_NUMBER>
see murmurhash3_x86_32(key, 0, 1) + nl // Output: 70eaef35
For more information check the RingMurmurHash chapter in the documentation.
Better Ring Notepad¶
Ring Notepad comes with the next updates
- Automatic setting for the Main File when we Run the application (using the Main file buttons).
- Main File - Automatic save before running.
- When we run GUI application - don’t change the focus to the text box used for the input in the Output Window.
- A button and option to run web applications
For Windows users, Ring 1.6 comes with Apache Web server!
We can run any web application from any folder directly without doing any configuration.
- Tools - Operating System - Terminal (Command Prompt) & Files Manager (Explorer).
So we can quickly open the Command Prompt or the Explorer at the application folder.
Better RingQt¶
RingQt comes with the next updates
- QAllEvents - getkeytext() Method
- QSQLQuery - exec_2() Method
- QDockWidget Events
- AppFile() Function
- IsMobile() Function
- QRegion Class
- QCoreApplication class
Better StdLib¶
StdLib comes with the next updates
Factors() function is updated (Return the output instead of printing it)
Palindrome() function is updated (Return the output instead of printing it)
Using stdlibcore.ring we can use the StdLib functions (Without Classes)
Also this is useful when developing standalone console applications
Because using stdlib.ring (functions & classes) will load libraries like RingLibCurl, RingOpenSSL, etc.
New Functions
- SystemSilent(cCommand) Function : Execute system commands without displaying the output.
- OSCreateOpenFolder(cFolder) : Create folder then change the current folder to this new folder
- OSCopyFolder(cParentFolder,cFolderNameToCopy) : Copy folder to the current directory
- OSDeleteFolder(cFolder) : Delete Folder
- OSCopyFile(cFileName) : Copy File to the current directory
- OSDeleteFile(cFileName) : Delete File
- OSRenameFile(cOldFileName,cNewFileName) : Rename file
Better RingVM¶
RingVM comes with the next updates
- Support using many getter methods in Expressions
- Support using this & self in setter/getter/normal methods without calling setter/getter methods.
- TempName() function is updated (Better Code)
- ExeFileName() function is updated (Better Code)
- Private Attributes - Support re-usage in the class region (After the keyword private)
- Ring API : ring_scanner_runobjstring()
- ring_state_setvar() function
Better RingREPL¶
RingREPL comes with the next updates
- RingREPL will get command line parameters to determine the style.
- Setting RingREPL Style based on Ring Notepad Style.
Using Tab instead of char(9)¶
The variable Tab is defined to be used instead of char(9)
Example (1):
see :one + nl + tab + :two + nl + tab + tab + :three
Output:
one
two
three
You can change the variable to another value
Example (2):
tab = " "
see :one + nl + tab + :two + nl + tab + tab + :three
Output:
one
two
three
Using CR as Carriage return¶
The next example count from 1 to 10 in the same line during 10 seconds
load "stdlibcore.ring"
for x = 1 to 10 see x sleep(1) see cr next
Using the ! operator as not¶
We have = and != in the Ring language
But for the logical operators we have and, or & not
Now we can use the ! operator as not
Example:
if ! false
see "True!" + nl
ok
Output
True!
Using && and || operators¶
In Ring we have the next keywords for the logical operations
- and
- or
- not
Now we have also the next operators
- &&
- ||
- !
Example:
if one() and two()
see "Test1 - Fail" + nl
else
see "Test1 - Pass" + nl
ok
if two() or one()
see "Test2 - Pass" + nl
else
see "Test2 - Fail" + nl
ok
if one() && two()
see "Test3 - Fail" + nl
else
see "Test3 - Pass" + nl
ok
if two() || one()
see "Test4 - Pass" + nl
else
see "Test4 - Fail" + nl
ok
func one return True
func two return False
Output:
Test1 - Pass
Test2 - Pass
Test3 - Pass
Test4 - Pass
Using ? to print expression then new line¶
It’s common to print new line after printing an expression, We can use the ? operator to do that!
Example:
? "Hello, World!"
for x = 1 to 10
? x
next
Output:
Hello, World!
1
2
3
4
5
6
7
8
9
10


Earn 300 points completing the task
Get 200 points from this challenge
Collect 100 points completing this task


GetFilePart()
Syntax
Filename$ = GetFilePart(FullPathName$ [, Mode])Description
Retrieves the file part of a full path.
Parameters
FullPathName$ The full path to get the filename from. Mode (optional) It can be one of the following values: #PB_FileSystem_NoExtension: Get the filename without its extension (if any).
Return value
Returns the file name. For example, if the full path is "C:\PureBasic\PB.exe", the result will be "PB.exe".
Remarks
To retrieve the extension or the path part from a full path, look at the GetExtensionPart() and GetPathPart() functions.
See Also
GetExtensionPart(), GetPathPart()
Supported OS
All


The day to day operations of the PF HOA are run by an all-volunteer Board of Directors, along with help from many other committee volunteers. The Board establishes the annual dues assessment and is responsible for using the money assessed to maintain and improve HOA property and offer programs which are of value to Prairie Fields residents, thereby increasing the value of the neighborhood.
Welcome new board members Brian Kesler and Kyle Kirchhoefer and returning board members Greg Sopa, and Tim Yardley.
For more information, please email<EMAIL_ADDRESS>The Prairie Fields HOA is governed by a Board of Directors (BOD), per the PF HOA BYLAWS. The Board exists to represent and support all members of the homeowners association.
Each member of the Board is elected to a two year term, with an election held in the fall of each year for the vacancies of the following year.
In general, the HOA Board of Directors will have the offices of President, Vice President, Secretary, Treasurer, and Member at Large. The officers are usually elected at the first Board meeting by the Board following the annual association meeting. The term of office for a Board member typically lasts one year. The duties for each office are:
The BOD generally meets at 8:00 PM on the second Monday of each month in the library at Carrie Busey School. The Board may also meet at other times as deemed necessary by the President, and conducts business via email, too. All email items are discussed at the regular monthly board meeting, so that the meeting minutes reflect emailed action. Agendas, minutes, and other related documents from the BOD meetings are available on the Meetings page.


As showed in the picture, there were some unexpected consecutive blank cells within columns, which made several records out of places. Hence, these blank cells were deleted to enable data alignment.
Such as rows from 180 to 454.
Also, the error of one project ID were separated into two cells occurs in different places. Then, these separated cells were merged in Excel document manually.
Such as row 652 to 654, 1901 to 1904.
By using Text Facet function in Agency Name column, it is obviously that there were some spelling errors need to be corrected. To fix it using cluster, cluster would display several groups in which each group included similar agency name. Then, chose reasonable grouping results and merged them into one correct name.
Such as agriculture and ‘agraculture’, commerce and ‘comerce’.
Like the former one, the error of multiple representation in Agency Name was found and resolved. (P.S. Adjusting Radius parameter can change error-tolerance of cluster function, which enable finding similar value in a larger scale. Method and Distance Function also provide more choice to explore cluster for different processing requirements.
Example: ‘agriculture department’, ‘department of agriculture’. Similar issue with transportation department
Inconsistent formats are common mistakes in datasets. In the given dataset, Project ID, Lifecycle Cost and date related columns had this issue. Then edit columns to replace some symbols and use edit cells -> common transforms to change date or number formats.(e.g.,Dates are represented in multiple ways, such as 2012-30-09 and 31/03/2012.)
Solution, applying replace command “value.replace(‘,’,’’)” in GREL and edit cells -> common transforms to change date or number formats.
When checking all records through Duplicates Facet function such as in Project ID column, some duplicate records emerged. This error was fixed by removing these repeated rows.
Such as ‘Unique Investment Identifier<PHONE_NUMBER>13’ ‘012-000002005’ occurred twice.
In the given dataset, there are some blank rows, which may make visualizing data difficult. Thus, Facet by Blank function was used to find blank records. After that, it is easy to remove these rows.(17 blank lines in total)
In the given dataset, there are some one-to-one correspondences between columns such as Agency Name and Agency Code. This means that every agency name must match one corresponding code. But after checking Agency Name and Agency Code, there were some many-to-one records. Then changing wrong value to correct one, the error was fixed.
There were two columns which were initially used to demonstrate project updated time. These then were merged into one column and transform to standard date format as other date records columns.
Solutiondescription: merged them into one column and transform to standard date format using “value +’ ’+cells[‘Updated Time’].value” in GREL.
Summation records (26 rows found) are not useful in data visualization part. Thus, these records were found by Facet by Blank and then removed.


I have just started this blog to document some of the interesting and difficult...ahem..challenging scenarios I faced while supporting people who package applications. I always wanted to write technical articles. I guess this would be a start.
--- layout: post title: "This is the beginning of...." date: 2004-08-16 comments: false ---


Distributed Systems Group - Università degli Studi di Parma
LSDVE 2016, Grenoble, 23 August 2016
In recent years, there has been a growing attention to Location-Based Services, i.e., software-level services that use location data to control features.
The majority of existing Location-Based Services lie on powerful and expensive centralized systems, that only a few large companies can afford.
Moreover, from the privacy viewpoint it is not advisable that all data are controlled by a single organization.
We decided to study a peer-to-peer overlay scheme that fulfills all the requirements that are essential to Location-Based Services.
Traditional peer-to-peer overlay schemes, such as Kademlia [1] or Chord [2], are not particularly suitable for Location-Based Services, since they completely ignore geographical distances between peers of the network.
[1] Petar Maymounkov and David Mazières: "Kademlia: A Peer-to-peer information system based on the XOR Metric", Lecture Notes in Computer Science, April 2002
[2] Robert Morris et al.: "Chord: A scalable peer-to-peer lookup service for internet applications", ACM SIGCOMM 2001, September 2001
| GeoPeer [3] | Globase.KOM [4] | Geodemlia [5] | Overdrive [6] | |
|---|---|---|---|---|
| Mobility of peers | ✓ | |||
| Speed and direction of peers | ✓ | |||
| Geographic broadcast | ✓ | ✓ | ✓ | ✓ |
| Completely peer-to-peer | ✓ | ✓ | ✓ | |
| Adaptive overlay scheme |
[3] Filipe Araújo and Luís Rodrigues: "Geopeer: A Location-Aware Peer-to-Peer System", Network Computing and Applications 2004, August 2004
[4] Aleksandra Kovacevic et al.: "Globase.KOM - A P2P Overlay for Fully Retrievable Location-based Search", IEEE International Conference on Peer-to-Peer Computing, September 2007
[5] Christian Gross et al.: "Geodemlia: Persistent Storage and Reliable Search for Peer-to-Peer Location-Based Services", IEEE International Conference on Peer-to-Peer Computing, September 2013
[6] Bernhard Heep et al.: "Overdrive an overlay-based geocast service for smart traffic applications", Wireless On-demand Network Systems and Services Conference, March 2013
| ADGT [7] | |
|---|---|
| Mobility of peers | ✓ |
| Speed and direction of peers | ✓ |
| Geographic broadcast | ✓ |
| Completely peer-to-peer | ✓ |
| Adaptive overlay scheme | ✓ |
The Adaptive Distributed Geographic Table (ADGT) is the only peer-to-peer overlay scheme that adapts the topology of the network based on peers' movements, speed and direction.
[7] Giacomo Brambilla et al.: "An Adaptive Peer-to-Peer Overlay Scheme for Location-Based Services", IEEE International Symposium on Network Computing and Applications, August 2014
Distance between peers $ p $ and $ q $ is evaluated as the great-circle distance, which is the shortest distance between two points on the surface of a sphere, measured along the surface of the sphere itself.
The neighbourhood of peer $ p $ is defined as the set of peers that are geographically close to $ w_{p} $, in other words, those peers which are located inside a geographical region surrounding $ w_{p} $.
Apart from ADGT, in the other peer-to-peer overlays the neighbourhood of a peer is within a circular region centered on its geographical location.
A vehicle moving slowly
along the streets of a small town
↓
interested in receiving information
from all the directions
A vehicle travelling along a highway
at high speed
↓
concerned with the information
that comes along its travel direction
The region of interest varies depending on the mobility of the vehicle
In ADGT, we have switched from the typical circular region of neighbourhood, to an elliptical one, where both the semi axes of the ellipse depend on the velocity of the peer, i.e., vary depending on the direction and speed of the peer.
The idea behind such elliptical regions is that the higher is the speed of the peer, the higher is the eccentricity of the ellipses.
Also, the direction of the semi-major axis coincides with the direction of movement of the peer.
In ADGT, each peer stores a set of lists of neighbours, called GeoBucket, each list being sorted according to the distance from the center that the GeoBuckets have in common.
Formally, a GeoBucket structure is defined as a group of $ K $ different concentric ellipses, each having a different semi-major axis $ a_{i} $ and semi-minor axis $ b_{i} $, with $ i $ integer $ \in [1, K] $.
ADGT has a peer discovery mechanism similar to the one adopted by Kademlia, that allows GeoBucket to be regularly updated in order to have the latest peers' geographical locations.
ADGT has been intensively evaluated through simulation in different scenarios of mobility, obtaining very promising results [7].
[7] Giacomo Brambilla et al.: "An Adaptive Peer-to-Peer Overlay Scheme for Location-Based Services", IEEE International Symposium on Network Computing and Applications, August 2014
The idea behind our implementation is the complete interoperability among devices as much as possible different – both from the hardware point of view, and in terms of installed software.
While initially web browsers were designed only to display information provided by web servers, they are becoming the real cross-platform technology, being able to truly realize the "write once, run everywhere" unfulfilled promise of Java related technologies.
WebRTC enables data streaming between browser clients without the need to install plugins or third-party software, implying a strong integration between the content presented by the browser and the real-time content.
With WebRTC, web browsers become peers of a real P2P network, being capable to exchange data in an unmediated fashion.
RTCPeerConnection
hides all the complexities of WebRTC to web developers, allowing audio and video streaming using the Secure Real-Time Transport (SRTP) protocol, which is real-time, and provides encryption, message authentication and integrity to transmitted data.
Moreover RTCPeerConnection
offers the Interactive Connectivity Establishment (ICE), a technique to overcome the complexities of real-world networking, where most devices live behind one or more NAT layers, some have anti-virus software that blocks certain ports and protocols, and many are behind proxies and corporate firewalls.
The RTCDataChannel
interface works with RTCPeerConnection
and allows to transfer arbitrary data directly from one peer to another, using the Stream Control Transmission Protocol (SCTP).
The WebSocket
specification defines an API establishing an interactive communication session between a web browser and a server.
With this API, the client and the server can make a persistent full-duplex connection between them and send data to each other at any time.
The Geolocation
API defines a high-level interface to location information associated with the device.
The API itself is agnostic of the underlying location information sources: location can be indiscriminately obtained from a Global Positioning System (GPS), inferred from network signals such as IP address, RFID, Wi-Fi and Bluetooth MAC addresses, and GSM/CDMA cell IDs, as well as user input.
The ADGT protocol has been implemented using web technologies only.
Our implementation, named adgt.js, has been designed as an ECMAScript 6 software library that can be freely used for the realization of P2P-based LBSs.
Signaling methods and protocols, i.e., the mechanisms required to coordinate communication and to send control messages, are not specified by WebRTC.
We have decided to distribute the responsibility to act as signaling servers among all the peers of the network, using DataChannels
.
The peer discovery operation has been implemented in a way that when a peer receives the list of neighbors from the peer that has contacted, the latter acts also as a signaling server between the first and the possible peers which have to be contacted.
Since it is not always possibile to use another peer as a signaling server, e.g., when the peer joins the P2P network, we have implemented a signaling server using the Node.js framework and the WebSocket
protocol.
To design and implement peer-to-peer LBSs with adgt.js is easy, not much different from making a simple web page.
var peer = new Peer(options);
peer.connect();
peer.on('neighbors', function(descriptors) {
//do something
});
peer.on('data', function(data) {
//do something
});
peer.send(data);
peer.move(position);
We have implemented a LBS that illustrates the ease of use of adgt.js and represents a building block for more sophisticated applications.
The LBS shows on a map the peers connected to the network, i.e., visitors of this web page, that are at a maximum distance of 40 km.
Neighbor discovery and connection establishment is entrusted to adgt.js
This LBS only requires to update the geographic location of the peer and change the marker on a map with the position of the browser obtained with the Geolocation
API.
In addition, when a change in the neighborhood happens, all the markers on the map representing neighbors are updated.
adgt.js enables the realization of completely decentralized LBSs, being a cross-platform implementation of the ADGT georeferenced P2P overlay scheme.
In future work, we will investigate the performance of the implemented framework, with respect to technological aspects such as battery drain of mobile devices, also compared with previous results obtained in simulation.
Distributed Systems Group - Università degli Studi di Parma
LSDVE 2016, Grenoble, 23 August 2016


--- layout: base ---
{{ article.short }}
{% if article.tools %} {% for tool in site.tools %} {% for articletool in article.tools %} {% if tool.name == articletool.name %} {% endif %} {% endfor %} {% endfor %} {% endif %} {% if article.themes %} {% for theme in site.themes %} {% for articletheme in article.themes %} {% if theme.name == articletheme.name %} {% endif %} {% endfor %} {% endfor %} {% endif %} {% if article.types %} {% for type in site.types %} {% for articletype in article.types %} {% if type.name == articletype.name %} {% endif %} {% endfor %} {% endfor %} {% endif %}We help civil society and government use data and simple technology, effectively. Societies are successful when communities and governments work together. With our partners, we’re creating an ecosystem that supports informed, empowered and active citizens.
We provide technical advice, guidance for releasing and using open data, and build civic technology platforms that bridge communities and governments and solve people’s problems. Technology is not our focus, but rather a means to achieve our goals.
Our standard courses are taught over two days, but we can tailor them to fit your needs and we can integrate your organisation’s own datasets into the course.
Read more about TrainUpWe are a group of post-corporate, tech and media professionals who cut our teeth in the commercial sector and now use our skills for social good
Are you interested in joining our team and doing work that matters? Check out our job openings
Our founding principles are guided by section 32 of the South African consitution:
Everyone has the right of access to any information held by the state; and any information that is held by another person and that is required for the exercise or protection of any rightsRead more about us


© 2019
| apocarpus apocarpa apocarpum | seed away from each other | |||
| apo | apo | pre | απο off, away, down, from | |
| carpos | carp | noun/m | καρποϛ fruit | |
| us | adj | Latinizing suffix | ||
| Grimmia apocarpa Hedw. Schistidium apocarpum (Hedw.) Bruch & Schimp. in B.S.G. | ||||
| apocladus apoclada apocladum | branches away from each other | |||
| apo | apo | pre | απο off, away, down, from | |
| clados | clad | noun/m | κλαδοϛ branch; shoot | |
| us | adj | Latinizing suffix | ||
| Scleropodium apocladum (Mitt.) Grout | ||||
| apoclitus apoclita apoclitum | bending down | |||
| apoclitos | apoclit | adj | αποκλιτοϛ bending downwards, declining | |
| us | adj | Latinizing suffix | ||
| Primula apoclita Balf. f. & Forrest | ||||
| apocynifolius apocynifolia apocynifolium | leaves like Apocynum | |||
| apocynum | apocyn | noun | apocynon αποκυνον Dog's bane, reputedly poisonous to dogs; variously ascribed to Cynanchum erectum, Aconitum lycoctonum | |
| us Latinizing suffix | ||||
| i | i | cnct | connective vowel used by botanical Latin | |
| folius | foli | adj | folium leaf | |
| Euphorbia apocynifolia Small Hypericum apocynifolium Small | ||||
| apodantherus apodanthera apodantherum | flowering without stalks | |||
| a | a | pre | α- not, without, less | |
| pus | pod | noun/m | πουϛ, ποδοϛ foot | |
| antheros | anther | noun/n | ανϑηροϛ flowering, blooming | |
| us | adj | Latinizing suffix | ||
| apodanthus apodantha apodanthum | flowers without stalks | |||
| a | a | pre | α- not, without, less | |
| pus | pod | noun/m | πουϛ, ποδοϛ foot | |
| anthos | anth | noun/n | ανϑοϛ flower | |
| us | adj | Latinizing suffix | ||
| apodectus apodecta apodectum | accepted, welcome | |||
| apodectos | apodect | adj | αποδεκτοϛ accepted, welcome | |
| us | adj | Latinizing suffix | ||
| apodocarpus apodocarpa apodocarpum | seeds without feet | |||
| a | a | pre | α- not, without, less | |
| pus | pod | noun/m | πουϛ, ποδοϛ foot | |
| o | o | cnct | connective vowel in botanical Latin, usually for Greek words but in some cases, such as color tingeing, for Latin words | |
| carpos | carp | noun/m | καρποϛ fruit | |
| us | adj | Latinizing suffix | ||
| Cladonia apodocarpa Robbins | ||||
| apodotropis apodotropis apodotrope | foot without a keel | |||
| a | a | pre | α- not, without, less | |
| pus | pod | noun/m | πουϛ, ποδοϛ foot | |
| o | o | cnct | connective vowel in botanical Latin, usually for Greek words but in some cases, such as color tingeing, for Latin words | |
| tropis | trop | noun/f | τροπιϛ ship's keel | |
| is | adj | adjectival suffix | ||
| Lupinus apodotropis Heller | ||||
| apodus apoda apodum | stalkless | |||
| a | a | pre | α- not, without, less | |
| pus | pod | noun/m | πουϛ, ποδοϛ foot | |
| us | adj | Latinizing suffix | ||
| aponeurus aponeura aponeurum | veins out, away | |||
| apo | apo | pre | απο off, away, down, from | |
| neuron | neur | noun/n | νευρον sinew, tendon, nerve | |
| us | adj | Latinizing suffix | ||
| Hibiscus aponeurus Sprague & Hutch. | ||||
| apophyllus apophylla apophyllum | leaves away from each other | |||
| apo | apo | pre | απο off, away, down, from | |
| phyllon | phyll | noun/n | φυλλον leaf; foliage | |
| us | adj | Latinizing suffix | ||
| appendiculatus appendiculata appendiculatum | with small appendages | |||
| appendicula | appendicul | noun/f | small appendage | |
| atus | at | adj | adjectival suffix for nouns: possessive of or likeness of something (with, shaped, made)/ for verb participles: a completed action, -ed | |
| Antennaria appendiculata Fern. Decemium appendiculatum (Michx.) Small Andropogon appendiculatus Nees | ||||
| applanatus applanata applanatum | flattened out | |||
| ap | ap | pre | ad to, towards, near | |
| apo απο off, away, down, from | ||||
| planus | plan | adj | even, level, flat | |
| atus | at | adj | adjectival suffix for nouns: possessive of or likeness of something (with, shaped, made)/ for verb participles: a completed action, -ed | |
| Acarospora applanata H. Magn. Cotoneaster applanatus Duthie ex J. H. Veitch | ||||
| applicatus applicata applicatum | near | |||
| applicatus | applicat | adj | attached, close, annexed | |
| appressipilis appressipilis appressipile | with hairs pressed flat | |||
| appressus | appress | padj | apprimo to press to; (also adprimo) | |
| i | i | cnct | connective vowel used by botanical Latin | |
| pilus | pil | noun/m | a hair; a trifle | |
| is | adj | adjectival suffix | ||
| appressipilus appressipila appressipilum | with hairs pressed flat | |||
| appressus | appress | padj | apprimo to press to; (also adprimo) | |
| i | i | cnct | connective vowel used by botanical Latin | |
| pilus | pil | noun/m | a hair; a trifle | |
| us | adj | Latinizing suffix | ||
| Arachis appressipila Krapov. & W. C. Greg. | ||||
| appressus appressa appressum | appressed | |||
| ap | ap | pre | ad to, towards, near | |
| apo απο off, away, down, from | ||||
| pressus | press | ppar | premo to press, squeeze | |
| Lycopodiella appressa (Chapman) Cranfill Gastrolobium appressum C. A. Gardner | ||||
| apricus aprica apricum | sun loving | |||
| apricus | apric | adj | uncovered, lying open; exposed to the sun | |
| Antennaria aprica Greene Eriogonum apricum J.T. Howell Aster apricus (Gray) Rydb. | ||||
| apterus aptera apterum | without wings | |||
| apteros | apter | adj | απτεροϛ without wings | |
| us | adj | Latinizing suffix | ||
| Zizia aptera (Gray) Fern. | ||||
| apulus apula apulum | from Apulia (now Puglia), a province in southern Italy | |||
| apulus | apul | adj | Appulus from Apulia, (now Puglia) north of Calabria, a province in southern Italy (also Apulus) | |
| Myosotis apula L. Neatostema apulum (L.) I. M. Johnst. | ||||
| apus apodi | stalk-less (foot-less) | |||
| a | a | pre | α- not, without, less | |
| pus | pod | noun/m | πουϛ, ποδοϛ foot | |
| Carex apoda Clokey Gigantochloa apus (Schult. & Schult. f.) Kurz |


An increasing transport need is for object serialization. Since nearly everything on the planet understands XML, this is a logical way to transport serialized data (similar to the mechanics behind JSON). In the end, my hope is to be able to access node data in target platforms as native objects--unaware if they were transported as JSON, XML, or carrier pidgeon.
A formal document type definition is located in xmltl.dtd


Functions to help when working with Barks.
This package makes it easier to work with the Bark scale when analyzing and plotting acoustic data. It contains two pairs of functions. The first (bark
and hz
) convert between Hz and Barks. The other (scale_x_bark
and scale_y_bark
) make it easy to plot data in ggplot2 using the Bark scale.
You can use scale_x_bark
and scale_y_bark
within a ggplot
to plot the data in Hz but scaled into Barks. In the following side-by-side comparison of an F1-F2 plot, the figure on the left uses a linear scale. Meanwhile, in the figure on the right, the left and bottom portions of the plot is more compressed.
The plot on the right looks the same as if you had plotted the data in Barks themselves, except the axes are in Hz instead of Barks.
In the following spectrogram plots, we only need to use the Bark scale along the y-axis. In the left panel, which displays the data in a linear scale, F2 takes up the majorty of the plot. Meanwhile, in the plot on the right, F1 is wider and F2 is more compressed.
You can also use barktools
to convert between hz and barks with the hz
and barks
functions:
bark(500)
hz(3)
You can use this to convert entire vectors as well:
Or, more elegantly, with in a tidyverse pipeline:
## # A tibble: 564 x 9
## vowel F1 F2 F3 F4 F1_bark F2_bark F3_bark F4_bark
## <fct> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 GOAT 368. 1018. 2602. 3168. 3.71 8.63 14.8 16.0
## 2 FACE 377. 2032. 2761. 3408. 3.79 13.1 15.2 16.5
## 3 FACE 314. 2179. 2915. 3380. 3.18 13.6 15.5 16.4
## 4 GOOSE 274. 1378. 2235. 3270. 2.76 10.5 13.8 16.2
## 5 FOOT 350. 1624. 2485. 3384. 3.53 11.6 14.5 16.4
## 6 FACE 313. 2181. 2863. 3205. 3.16 13.6 15.4 16.1
## 7 GOOSE 255. 1333. 2313. 3212. 2.55 10.3 14.0 16.1
## 8 THOUGHT 585 969. 2813. 3405 5.63 8.34 15.3 16.5
## 9 THOUGHT 527. 1201. 2733. 3434. 5.15 9.66 15.1 16.5
## 10 FOOT 367. 1594. 2477 3367 3.70 11.5 14.4 16.4
## # … with 554 more rows


Best Fests
Local Eateries Stand Test of Time
Existential Binge Watching
The Decade's Best and Worst Christmas Movies
Top films of the 2010s
The Most Underrated Album From the 2010s
Overrated Hip-Hop of the 2010s
Fashion Dos and Don’ts
Underrated Hip-Hop of the 2010s
The Most Pioneering TV Shows of the 2010s
Changes in LayOUt
Wrong Way!
Top 10 Teams of the Decade
So Listen
Most Influential Musicians
The Decade's Top Scandals
Editor's Desk
From Complicated History to Bright Future
Majors Through the Decade
Voting Through The Decade
Top Ten Games of the Decade
Pour One Out
Calling a Change in Clothes
ILLUSTRATION:
Rilee Lockhart
WEB DEVELOPMENT:
Midge Mazur
© Copyright 2019, The Post, Athens, OH


Fire. Spice. Char. There’s nothing quite like the magic that happens when fresh proteins and bold flavors meet open flame. Satisfy those grilled-kissed cravings with these protein pairings.
Prefer to man your own grill? We respect that. Before you fire things up, grab CAVA Dips + Spreads and add these recipes to your roster.


Created: {{repo.created_at}}
Last commit: {{repo.pushed_at}}
{{repo.description}}
{{repo.owner.login}}
Owner


General support queries. User Guides: https://support.komodoplatform.com/ Support staff: Angelina#6231 gcharang#6833. If you want to ask JL777 a question, use the #ask-jl777 channel.
100 messages
Before 05-Dec-19 12:00 AM
PTYX19-Jun-19 02:02 PM
If you sent from an exchange or another wallet, sometimes the lock time doesn't set properly. To fix it you just send the full balance to yourself using Chameleon, and make sure it's above 10KMD.
Sherdogz19-Jun-19 02:14 PM
@PTYX ok I didn't know you could sent funds to yourself. And yes I'd sent my kmd from an exchange. I'll give it a try thanks!(edited)
Elmis19-Jun-19 02:45 PM
I sent the small quantity of jumblr that I enter in my old account to the new one in Agama Verus and I have not received my jumblr.
When I filled out the document to claim I made a mistake in the amount and maybe that's why it hasn't been sent. What should I do now to solve it if something needs to be done?
jl777c19-Jun-19 02:46 PM
what address?
Elmis19-Jun-19 02:47 PM
the old one is: RA9G36WwA9K95bn8Cbycq5ZnoxhSzzhhBw
jl777c19-Jun-19 02:49 PM
yes the amount you claimed was over double, it triggered an alert
i have it as 553, if that is correct, i can update and it will process immediate
Elmis19-Jun-19 02:50 PM
Yes, that is correct
jl777c19-Jun-19 02:50 PM
updated
refunded
Elmis19-Jun-19 02:53 PM
Thanks, I have also a problem with Hush, just a litle quantity that was in the same address ¿you know something about this one?
jl777c19-Jun-19 02:53 PM
let me check
Elmis19-Jun-19 02:53 PM
received jumblr, thanks
jl777c19-Jun-19 02:54 PM
i dont see that adress in the HUSH claims data
Elmis19-Jun-19 03:09 PM
I send it alone some days later in a new claim document
jl777c19-Jun-19 03:10 PM
maybe make another claim just in case. i have data current as of the weekend, so if you filed before that, it got lost somehow
i will process it next week, if that is ok
Elmis19-Jun-19 03:17 PM
OK I wil do. I also had in that account a small amount of coquis and a slightly larger zilla what should I do to recover them?
jl777c19-Jun-19 03:29 PM
just login with old passphrase and transfer them
Elmis19-Jun-19 03:32 PM
I will try, thanks
JonnyBioICX19-Jun-19 03:42 PM
What wallet is the best for collecting interest on my kmd , i took out of agama and am now workingand using monarch will that wallet work ?
grewalsatinder19-Jun-19 03:43 PM
Verus Wallets
1
Sherdogz19-Jun-19 03:44 PM
@PTYX it works... Thanks for the help.
1
Ricishort19-Jun-19 03:59 PM
Hey i didn't recieved my funds back (No minor transaction either) and i also don't have des public adresse of the account they where stolen from, because i deleted the agama wallet. My questions: -is there another way to get the old adresse back ? -what is the next step if you didn't recieved your funds back yet ?
Appreciate your help
Cryptoon19-Jun-19 04:08 PM
if you have your private keys then you can access your old address from any wallet
Hey, I had some random coins in my old wallet: BNTN, etc. although these early coin offerings may or may not go anywhere, how do I go about checking how many I had and arranging a transfer to my new wallet? Thanks in advance
tomm19-Jun-19 10:06 PM
Hello, how can I claim my coins and check if my coins were stolen ?
was agama wallet disabled? I have blank window after login to my wallet?
tomm19-Jun-19 10:17 PM
I dont undeyrstand how to move my funds from compromise old agama wallet to new adress if I can evel log in to wallet?
can someone tell me very very simple how all this should be done because I dont get that pinned information!
I have coinomi wallet how to move funds there then?
just import private key in coinomi wallet?
The refund Process
We will use a three-step process for processing claim:
1. A special transaction will be sent to your compromised address. It will be for a fraction of a KMD.
2. You need to send all the funds from the compromised address to the destination address you specified in the form.
3. IF and only IF, your address has no disputes, or contradictory claim info, and the proper destination address receives the special payment, a refund tx will be made to the destination address specified in the form. This does not happen automatically (we double-check every claim), so we kindly ask you to be patient. At this point, your claim is already under review and you will be refunded as soon as possible.
Do I need to do that from that Verus Agama?
how can I check if I received that transactions?
tomm19-Jun-19 10:37 PM
yes
i have only 0.000002kmd
yes I created new wallet in agama verus
i copied new address and seed
now I need to import the told seed to verus agama correct?
old seed
THIS "Then send all the funds to the new KMD address created previously" means all my tiny 0.0002 balance correct?
I sent funds to my new adress...
when I checking my address there are strange balances in my history...
which balance should I put when filling claim form?
this from before 5th june?
need to be very exact or just close balance?
I submitted my form for kmd
tomm19-Jun-19 11:10 PM
not exact balance... but I check on explorer and I copied that amount ...
shrk19-Jun-19 11:18 PM
Hi, my verus agama is not connecting to servers and ocean wallet loading blockchain forever. I need just to make 0.0001 transaction. Please tell me what wallet can i use now without downloading full blockchain?
Chubbles19-Jun-19 11:26 PM
How do I get my stuff off the Agama wallet if all I have is the long phrase? Is there a way to get the other key I need?
shrk19-Jun-19 11:27 PM
@Deleted User ok, how can i fix this one? "Connection error! Trying to switch to another server" tried both electrum1 and 2
Chubbles19-Jun-19 11:28 PM
Which channel are they pinned in?
Oh I see it
shrk19-Jun-19 11:28 PM
@Deleted User Verus Agama KMD
mohamedsharif719-Jun-19 11:30 PM
how do i send from my old(compromised) wallet to my new wallet?
the send button is grayed out
agama
i have that downloaded, but when i try to send the KMD from my old wallet to my new wallet, the button is grayed out
@Deleted User
how do i do that?
do i have to download the new wallet and overide the old?
Official Wallet for the OOT coin. . Contribute to Utrum/utrum-wallet development by creating an account on GitHub.
Chubbles19-Jun-19 11:38 PM
so if I fire up that new agama wallet and everything is there am I all set?
mohamedsharif720-Jun-19 12:11 AM
when activating the agama wallet
i get an error saying port 7771 is already in use
what does that mean?
"error starting KMD daemon. port 7771 is already taken"
mohamedsharif720-Jun-19 12:21 AM
awesome!
it's syncing so far
i had the native version of the wallet on agama so i didnt have to set a seed
is there a way for me to switch to the lite, or will i have to create a lite version and send the funds to that seed?
@Deleted User
mohamedsharif720-Jun-19 12:43 AM
got ya
awesome!
thank you @Deleted User
1
zaius33320-Jun-19 02:57 AM
Question guys. I am trying to claim KMD rewards from my ledger but it gives me the message "networkerror when attempting to fetch resource." Any suggestions on how to fix this?
I'm using the atomic labs site for this btw
hyperDEX20-Jun-19 05:26 AM
What browser and computer you using @zaius333
zaius33320-Jun-19 05:27 AM
Firefox
On a pc
Lol I just tried it on chrome and it worked
Thanks you answered my question with another question
1
hyperDEX20-Jun-19 05:44 AM
@zaius333 yeah with firefox you need to enable something for it to work
peddycb20-Jun-19 06:27 AM
hello I have all requests filled for this address RP8q2GmdFdFEv4MRqDbberEwdGZSXhJmWV ...have only partially chips back....I still have to do something?
my claims that I have made I only received 6 claims .... but there are still 4 claims missing


We aren’t looking at a Widowmaker pose here, this isn’t a character who is in part defined by flaunting her sexuality. This pose says to the player base, oh we’ve got all these cool diverse characters, but at any moment we are willing to reduce them to sex symbols to help boost our investment game.
And, boom. That’s all it took. Battle.net devolved into a barroom brawl of Braveheartproportions over a pose that would barely register a PG rating from a Disney film, and Blizzard finally threw up the white flag, with Game Director Jeff Kaplan chiming in, promising to replace the victory pose with a new one.
We’ll replace the pose. We want *everyone* to feel strong and heroic in our community. The last thing we want to do is make someone feel uncomfortable, under-appreciated or misrepresented.
Apologies and we’ll continue to try to do better.
Naturally, the team was accused of caving in from one camp while the “victors” applauded and jeered, which prompted an even longer response.
Well, that escalated quickly…
While I stand by my previous comment, I realize I should have been more clear. As the game director, I have final creative say over what does or does not go into the game. With this particular decision, it was an easy one to make—not just for me, but for the art team as well. We actually already have an alternate pose that we love and we feel speaks more to the character of Tracer. We weren’t entirely happy with the original pose, it was always one that we wrestled with creatively. That the pose had been called into question from an appropriateness standpoint by players in our community did help influence our decision—getting that kind of feedback is part of the reason we’re holding a closed beta test—but it wasn’t the only factor. We made the decision to go with a different pose in part because we shared some of the same concerns, but also because we wanted to create something better.
We wouldn’t do anything to sacrifice our creative vision for Overwatch, and we’re not going to remove something solely because someone may take issue with it. Our goal isn’t to water down or homogenize the world, or the diverse cast of heroes we’ve built within it. We have poured so much of our heart and souls into this game that it would be a travesty for us to do so.
We understand that not everyone will agree with our decision, and that’s okay. That’s what these kinds of public tests are for. This wasn’t pandering or caving, though. This was the right call from our perspective, and we think the game will be just as fun the next time you play it.
If it isn’t, feel free to continue sharing your concerns, thoughts, and feedback about this and other issues you may have with the game, please just keep the discussion respectful.
Hey everyone, this Overwatch game looks pretty great, doesn’t it? It launches for the PlayStation 4, Xbox One, and PC on May 24, but we’re already making community cranky over the most trivial of matters. In short, a potential customer complained, Blizzard agreed with the complaint, made a change to something better, and guess what, the game still looks great!
Finding these little wrinkles and ironing them out, that’s kind of the reason why companies run beta tests. In that regard, this worked out just as it was supposed to. Blizzard couldn’t have compromised its artistic vision because the game isn’t even out yet. Fancy that.


---
layout: post
title: Omzeil cartoon sketches
date: '2015-06-10T19:30:23+02:00'
categories:
- Ello Mobile
- Klare Lijn — Ligne Claire
- Illustration
picture_url: https://film-Storyboards.tumblr.com/post/121229810185/rough-Sketches-for-ello-mobile-newsletter
---
Rough Sketches for Ello Mobile’s newsletter.
The newsletter title reads: “Omzeil jij te hoge roamingkosten?” which roughly translates into “How can you avoid high roaming rates?”. The word “Omzeilen” means “avoid” but “zeilen” also means “sailing”.
The article is about using your mobile while abroad.
Call for a Good Cause
Ello Mobile’s model is unique among Belgian telecommunication and mobile companies. All Ello Mobile’s benefits go to selected charitable projects.


{% extends "layout.html" %} {% block content %}
Text here
Those are the researchers around the world that are carrying our more coding experiments
| # | Researcher's Name | Quantity of Papers |
|---|---|---|
| {{loop.index}} | {{ author[0] }} | {{ author[1] }} |
Those are the affliiations around the world that are carrying our more coding experiments
| # | Institution's Name | Quantity of Papers |
|---|---|---|
| {{loop.index}} | {{ institution[0] }} | {{ institution[1] }} |
This is the distribution of coding experiments during the years
This is the distribution of coding experiments in venues


This string has text-transform: uppercase applied.
This string has text-transform: capitalize applied.
This string has text-transform: LOWERCASE applied. The word lowercase in the previous sentence is written in uppercase.
This string has text-transform: none ApPLIEd.
ﾃﾞﾏﾝﾄﾞﾗﾎﾞ/ﾃｽﾄ/ｶﾀｶﾅ
ぁあぃいぅうぇえぉお


{% extends "app/layout.html" %} {% if http_code == 404 %} {% set title="Page not found" %} {% elif http_code == 403 %} {% set title="Access denied" %} {% else %} {% set title="Sorry, we are experiencing technical difficulties." %} {% endif %} {% block page_title %}{{title}}{% endblock %} {% block inner_content %}
If you entered a web address please check it was correct.
{% elif http_code == 403 %}You do not have permission to access the requested resource.
{% else %}Please try again in a few moments.
{% endif %} {% endblock %}


A brass plaque commemorates the planting of an oak tree on glebe land due north of the lych gate in 1902.
 IT WAS PLANTED TO MARK THE CORONATION OF EDWARD VII IN 1902 BY J G PAYNE, SECOND SON OF THE THEN VICAR OF COGGES, REV. E. J. U. PAYNE.
The Parish Church of St. Mary, Cogges, Oxfordshire.