RubyMotion Debugging Guide for iOS and OS X
This article covers how to debug RubyMotion iOS and OS X projects using the builtin debugging facility. RubyMotion apps can be debugged either on the simulator or the device.
At the time of this writing, the debugging experience in RubyMotion is still a work in progress, and this document might change any time to reflect the progresses that have been made in this regard.
1. Synopsis
The RubyMotion debugger for iOS and OS X projects is based on LLDB, the LLVM Debugger.
LLDB is traditionally used to debug programs written in C-based languages, however, RubyMotion brings Ruby support to LLDB, allowing it to connect and introspect RubyMotion processes.
|
Note
|
The LLDB support is at this point experimental and also quite low-level. Our goal is to build a higher-level, friendlier debugger on top of LLDB that will provide a better experience for Ruby developers. |
This document aims at covering the main features that one might need in order to debug a RubyMotion app with LLDB. This document is not a complete LLDB manual. We highly recommend reading the official LLDB documentation if an exhaustive guide is needed.
|
Note
|
In this guide we will use the longhand versions of all debugger commands, but most, if not all, have shorthand versions which you can find in the the official LLDB documentation. |
2. Debugging Symbols
The RubyMotion compiler implements the DWARF debugging format metadata for the Ruby language. This allows external programs such as debuggers or profilers to retrieve source-level information about an existing RubyMotion application.
For iOS and OS X apps, the metadata is saved under a .dSYM bundle file at the same level as the .app bundle, in the build directory of your project.
Both development
and release
modes have debugging symbols, however, as the release
mode activates compilation optimizations, the debugging experience will be better under the development
mode. For example, in the release
mode, certain local variables and arguments might not be accessible in the debugger as they could be optimized.
3. Starting the Debugger
In order to start the debugger, the debug
option can be set to any value on the appropriate rake target.
When working with the simulator
rake task, the debugger will directly attach itself to the app and replace the interactive shell (REPL).
$ rake simulator debug=1
When working with the device
rake task, the build system will start the iOS debugging server on the device then remotely attach the debugger on your shell right after the application has been deployed on the device.
$ rake device debug=1
3.1. Entering Commands Before Starting
By default the application will run right after the debugger is started. Sometimes you might want to perform commands before the application starts.
This can be done by setting the no_continue
option to any value. If set, the debugger will not continue to the application and will give you a chance to change the debugging environment (for example, setting a breakpoint). You can type the continue
command once you are ready to move on.
$ rake debug=1 no_continue=1
[...]
(lldb) breakpoint set --file hello_view.rb --line 10
Breakpoint 3: no locations (pending).
WARNING: Unable to resolve breakpoint to any actual locations.
(lldb) c
Process 87523 resuming
[...]
3.2. Saving Commands
It is also possible to save on disk commands you want the debugger to perform automatically when running your application.
The debugger will honor the debugger_cmds file in the root directory of your project. If this file exists, its content will be interpreted as a list of debugger commands separated by a newline character.
Only use the name of the file not the full path : hello_view.rb:10 and not app/hello_view.rb:10.
$ echo "breakpoint set --file hello_view.rb --line 10" > debugger_cmds
$ rake debug=1
[...]
4. Managing Breakpoints
To set a breakpoint to a given location in the source code, use the breakpoint
command and pass the location where the debugger should break, using the --line
option.
As an example, the following command sets a breakpoint on the 10th line of the hello_view.rb file.
(lldb) breakpoint set --file hello_view.rb --line 10
The breakpoint list command can be used to list the breakpoints that have been set in the current debugger environment.
(lldb) breakpoint list
Current breakpoints:
1: name = 'rb_exc_raise', locations = 1, resolved = 1
1.1: where = Hello`rb_exc_raise, address = 0x00049d70, resolved, hit count = 0
2: name = 'malloc_error_break', locations = 1, resolved = 1
2.1: where = libsystem_malloc.dylib`malloc_error_break, address = 0x030b47f9, resolved, hit count = 0
3: file = 'hello_view.rb', line = 10, locations = 1, resolved = 1
3.1: where = Hello`rb_scope__drawRect:__ + 1034 at hello_view.rb:10, address = 0x0000964a, resolved, hit count = 1
As you can see our breakpoint hello_view.rb:10
is right there and is enabled. The breakpoint enable and breakpoint disable commands can respectively enable or disable a given breakpoint using its number.
Since our breakpoint is number 3 in the list, we can disable it like this:
(lldb) breakpoint disable 3
1 breakpoints disabled.
5. Getting the Backtrace
Once you hit a breakpoint, it is often interesting to check out the execution backtrace, which will tell you where the method is called from.
This can be done by using the thread backtrace command.
(lldb) thread backtrace
* thread #1: tid = 0x36e013, 0x0000964a Hello`rb_scope__drawRect:__(self=0x08fa34d0, rect=0x08f8d8a0) + 1034 at hello_view.rb:10, queue = 'com.apple.main-thread, stop reason = breakpoint 3.1
frame #0: 0x0000964a Hello`rb_scope__drawRect:__(self=0x08fa34d0, rect=0x08f8d8a0) + 1034 at hello_view.rb:10
frame #1: 0x00009d77 Hello`__unnamed_9 + 231
frame #2: 0x0065be43 UIKit`-[UIView(CALayerDelegate) drawLayer:inContext:] + 504
frame #3: 0x024bb800 QuartzCore`+[CATransaction flush] + 52
frame #4: 0x005eed70 UIKit`_UIApplicationHandleEvent + 683
frame #5: 0x03add6e1 GraphicsServices`PurpleEventCallback + 46
frame #6: 0x01da8ffb CoreFoundation`CFRunLoopRunInMode + 123
frame #7: 0x005ec8be UIKit`-[UIApplication _run] + 840
frame #8: 0x005eeabb UIKit`UIApplicationMain + 1225
frame #9: 0x000024cc Hello`main(argc=1, argv=0xbfffec0c) + 156 at main.mm:15
Backtrace frames in your code can be identified with the rb_scope__
prefix and the file:line
information.
5.1. Frames
Here, the very first frame in the backtrace is the method defined in the breakpoint location: drawRect:
. The other frames below the breakpoint are native iOS calls. As we can see, our drawRect:
method is called by the UIView
class, which makes sense.
The frame
command lets you switch to a specific frame in the backtrace. By default you will be at the top frame (#0), but assuming you want to go down to frame #2, in order to inspect its context, you can type the following command to do so.
(lldb) frame select 2
frame #2: 0x0065be43 UIKit`-[UIView(CALayerDelegate) drawLayer:inContext:] + 504
UIKit`-[UIView(CALayerDelegate) drawLayer:inContext:] + 504:
-> 0x65be43: calll 0x6156b5 ; UIGraphicsPopContext
0x65be48: addl $108, %esp
0x65be4b: popl %esi
0x65be4c: popl %edi
Obviously it mainly matters when you want to go down to a specific Ruby-defined location in the backtrace, otherwise you’ll only get assembly, as illustrated by the preceding example.
5.2. Threads
The thread backtrace command only returns the backtrace of the current thread. When dealing with a multithreaded program, you may sometimes want to print the backtrace of all running threads, for instance when you are debugging a race condition.
The following command will print the backtrace of all the running threads in the terminal.
(lldb) thread backtrace all
* thread #1: tid = 0x36e013, 0x0000964a Hello`rb_scope__drawRect:__(self=0x08fa34d0, rect=0x08f8d8a0) + 1034 at hello_view.rb:10, queue = 'com.apple.main-thread, stop reason = breakpoint 3.1
frame #0: 0x0000964a Hello`rb_scope__drawRect:__(self=0x08fa34d0, rect=0x08f8d8a0) + 1034 at hello_view.rb:10
frame #1: 0x00009d77 Hello`__unnamed_9 + 231
frame #2: 0x0065be43 UIKit`-[UIView(CALayerDelegate) drawLayer:inContext:] + 504
frame #3: 0x024bb800 QuartzCore`+[CATransaction flush] + 52
frame #4: 0x005eed70 UIKit`_UIApplicationHandleEvent + 683
frame #5: 0x03add6e1 GraphicsServices`PurpleEventCallback + 46
frame #6: 0x01da8ffb CoreFoundation`CFRunLoopRunInMode + 123
frame #7: 0x005ec8be UIKit`-[UIApplication _run] + 840
frame #8: 0x005eeabb UIKit`UIApplicationMain + 1225
frame #9: 0x000024cc Hello`main(argc=1, argv=0xbfffec0c) + 156 at main.mm:15
thread #2: tid = 0x36e04e, 0x031bf992 libsystem_kernel.dylib`kevent64 + 10, queue = 'com.apple.libdispatch-manager
frame #0: 0x031bf992 libsystem_kernel.dylib`kevent64 + 10
frame #1: 0x02de018e libdispatch.dylib`_dispatch_mgr_invoke + 238
frame #2: 0x02ddfeca libdispatch.dylib`_dispatch_mgr_thread + 60
thread #3: tid = 0x36e04f, 0x031bf046 libsystem_kernel.dylib`__workq_kernreturn + 10
frame #0: 0x031bf046 libsystem_kernel.dylib`__workq_kernreturn + 10
frame #1: 0x03182dcf libsystem_pthread.dylib`_pthread_wqthread + 372
thread #4: tid = 0x36e050, 0x031bdd2e libsystem_kernel.dylib`accept$UNIX2003 + 10
frame #0: 0x031bdd2e libsystem_kernel.dylib`accept$UNIX2003 + 10
frame #1: 0x001397b6 Hello`-[RMREPL start] + 134
frame #2: 0x015567a7 Foundation`-[NSThread main] + 76
frame #3: 0x01556706 Foundation`__NSThread__main__ + 1275
frame #4: 0x031815fb libsystem_pthread.dylib`_pthread_body + 144
frame #5: 0x03181485 libsystem_pthread.dylib`_pthread_start + 130
Similar to switching frames, the debugger will let you switch threads using the thread select command. This can be useful if you want to inspect a specific Ruby method frame in another running thread. The following command will switch the debugger prompt to the thread #4.
(lldb) thread select 4
* thread #4: tid = 0x36e050, 0x031bdd2e libsystem_kernel.dylib`accept$UNIX2003 + 10
frame #0: 0x031bdd2e libsystem_kernel.dylib`accept$UNIX2003 + 10
libsystem_kernel.dylib`accept$UNIX2003 + 10:
-> 0x31bdd2e: jae 0x31bdd3e ; accept$UNIX2003 + 26
0x31bdd30: calll 0x31bdd35 ; accept$UNIX2003 + 17
0x31bdd35: popl %edx
0x31bdd36: movl 29423(%edx), %edx
6. Inspecting Objects
After checking the backtrace, you may want to inspect the objects around. The debugger will let you print them using specialized commands.
6.1. Local Variables
We just hit our breakpoint defined in the drawRect:(rect)
method. As you can see from the breakpoint, we are inside a function that accepts two arguments: self
and rect
. rect
is definitely our CGRect
argument, but what is self
?
In RubyMotion, the self
argument is a pointer to the self
object exposed in Ruby, which represents a reference to the receiver of the method. In the debugger, self
is visible as the first argument of the method.
We can inspect the values of both self
and rect
by using the print-ruby-object
command. This RubyMotion-defined command sends the inspect
message to the given object and returns its value. The command can also be called using the pro
shortcut which we will use as a convenience.
frame #0: 0x0000964a Hello`rb_scope__drawRect:__(self=0x08fa34d0, rect=0x08f8d8a0) + 1034 at hello_view.rb:10
7 end
8 text = "ZOMG!"
9 else
-> 10 bgcolor = UIColor.blackColor
11 text = @touches ? "Touched #{@touches} times!" : "Hello RubyMotion!"
12 end
13
(lldb) print-ruby-object self
#<HelloView:0x8fa34d0>
(lldb) pro rect
#<CGRect origin=#<CGPoint x=0.0 y=0.0> size=#<CGSize width=320.0 height=568.0>>
The list of local variables can be printed using the frame variable command. The list will also include the addresses of each local variable.
(lldb) frame variable
(void *) self = 0x08fa34d0
(void *) rect = 0x08f8d8a0
(void *) bgcolor = 0x08f931c0
(void *) red = 0x00000004
(void *) green = 0x00000004
(void *) blue = 0x00000004
(void *) text = 0x09c55230
(void *) font = 0x00000004
These local variables can also be individually inspected on the terminal by using the pro
command.
(lldb) pro bgcolor
#<UICachedDeviceWhiteColor:0x8f931c0>
(lldb) pro text
"Hello RubyMotion!"
 Instance Variables
Instance variables of an object can be printed using the print-ruby-ivar
command, or its convenience shortcut pri
.
If the command is given two arguments, the first one is the object on which the instance variable will be retrieved, and the second one must be a string representing the instance variable that you want to get. Make sure to include the @
character in the name.
(lldb) pri self "@touches"
2
When called with only one argument, the command assumes that you want to retrieve the given instance variable from self
.
(lldb) pri "@touches"
2
7. Control Flow
The next
command will continue the execution of the program until the next source-level location. This is usually the very next line in the Ruby source code. This means that the debugger has not yet executed the line that it indicates is the current line, keep this in mind when inspecting variables and their values.
* thread #1: tid = 0x3702a0, 0x0000964a Hello`rb_scope__drawRect:__(self=0x08ed1600, rect=0x08d91620) + 1034 at hello_view.rb:10, queue = 'com.apple.main-thread, stop reason = breakpoint 3.1
frame #0: 0x0000964a Hello`rb_scope__drawRect:__(self=0x08ed1600, rect=0x08d91620) + 1034 at hello_view.rb:10
7 end
8 text = "ZOMG!"
9 else
-> 10 bgcolor = UIColor.blackColor
11 text = @touches ? "Touched #{@touches} times!" : "Hello RubyMotion!"
12 end
13
(lldb) next
Process 87162 stopped
* thread #1: tid = 0x3702a0, 0x000096c9 Hello`rb_scope__drawRect:__(self=0x08ed1600, rect=0x08d91620) + 1161 at hello_view.rb:11, queue = 'com.apple.main-thread, stop reason = step over
frame #0: 0x000096c9 Hello`rb_scope__drawRect:__(self=0x08ed1600, rect=0x08d91620) + 1161 at hello_view.rb:11
8 text = "ZOMG!"
9 else
10 bgcolor = UIColor.blackColor
-> 11 text = @touches ? "Touched #{@touches} times!" : "Hello RubyMotion!"
12 end
13
14 bgcolor.set
The continue
command will continue the execution of the program until it reaches a breakpoint.
(lldb) continue
Process 87162 resuming
When the program runs, you can always stop its execution and go back to the debugger prompt by typing the control`c+ (
^C`) keyboard shortcut.
^C
Process 87162 stopped
[...]
(lldb)
If you want to quit the debugger, just type the quit
command and confirm that you want to exit. It will terminate the application and return you back to the shell prompt.
(lldb) quit
Quitting LLDB will detach from one or more processes. Do you really want to proceed: [Y/n] y
$


V1.x.x - June 24th 2018 (Deprecated)
- works with Expressjs >= 4.x.x version
- works with Typescript >= 2.4.x version
- works with Nodejs >= 8.10.x version
V2.x.x - August 10th 2018
There are no breaking changes from V1.x.x to V2.x.x. You can easily upgrade.
- works with Expressjs >= 4.x.x version
- works with Typescript >= 2.4.x version
- works with Nodejs >= 8.10.x version
Why V2.x.x is released in less time?
We have added lot of new API methods (without breaking V1.x API) and features to make developer lives easier. To have a proper tracking, we have preferred V2.x.x


Simulating species migration and range dynamics under stable or changing environmental conditions based on a simple, raster-based, stochastic migration model. Providing accessibility for considering species migration in niche-based species distribution models.
| Version: | 1.0-3 |
| Depends: | raster, R (≥ 2.15.0) |
| Published: | 2015-01-30 |
| Author: | Michael P. Nobis [cre, aut], Signe Normand [ctb] |
| Maintainer: | Michael P. Nobis <michael.nobis at wsl.ch> |
| License: | GPL (≥ 3) |
| URL: | http://purl.oclc.org/wsl/kissmig |
| NeedsCompilation: | yes |
| Materials: | NEWS |
| CRAN checks: | kissmig results |
| Reference manual: | kissmig.pdf |
| Package source: | kissmig_1.0-3.tar.gz |
| Windows binaries: | r-devel: kissmig_1.0-3.zip, r-release: kissmig_1.0-3.zip, r-oldrel: kissmig_1.0-3.zip |
| OS X binaries: | r-release: kissmig_1.0-3.tgz, r-oldrel: kissmig_1.0-3.tgz |
Please use the canonical form https://CRAN.R-project.org/package=kissmig to link to this page.


You have successfully purchased the items listed below. You will receive a summary of your orders through your email. If you have any questions just email us at<EMAIL_ADDRESS>Thank you, OpenTechCollaborative


Nokia teases the launch of a new phone next month
by Michael AllisonAfter launching the Nokia 6.2 and 7.2, it seems Nokia still wants to release new phones in 2019. The firm has announced a new phone launching this December.
While HMD Global hasn’t given any hints about what this new phone could be, there are a few guesses. The Nokia 8.1 hasn’t seen a successor like the 7.1 line has, or the firm could be refreshing the Nokia 9. NokiaPowerUser has been reporting a Nokia 9 successors, dubbed the Nokia 9.1 Pureview. While it’s unlikely that Nokia would launch such a flagship without much fanfare, it isn’t like big launches helped sell the Nokia 8, 8 Sirroco or 9.
We’ll find out more about this new handset come December 5.


ELIN-W160 is a powerful and compact System-on-Module with multiradio wireless capabilities, Linux OS, dual Ethernet RMII and a range of other interfaces. The wireless support includes Bluetooth v4.0 with Classic Bluetooth and Bluetooth low energy, plus Wi-Fi with dual-band support for 2.4 GHz and the full 5 GHz band. In the powerful 600 MHz TI Sitara ARM Cortex A8 CPU, custom applications can easily be integrated on top of the Yocto based Linux distribution. This allows for high-performing and cost-effective solutions, such as gateways with advanced protocol conversion and cloud access for Internet of Things applications leveraging the wide base of packages available in Yocto.
The module combines powerful hardware and multiple wireless interfaces, which isolates the complex RF design and certifications from the rest of your product. The module is designed for a long life cycle, has an extended operating temperature range, and is suitable for industrial, vehicle, medical, security, and other demanding applications. ELIN-W160 has a U.FL antenna connector for a wide selection of certified antennas. No trimming or tuning is required during manufacturing of customer end-devices, since the module has pre-calibrated radio parameters and MAC addresses stored in on-board EEPROM. The module provides modular radio type approvals for Europe, US and Canada (R&TTE, FCC, IC), EMC certification, and Bluetooth qualification, which simplifies and shortens the integration work.
| CPU | 600 MHz TI Sitara ARM Cortex A8 |
| RAM | 256 MB DDR3 |
| Flash memory | 512 MB NAND |
| Wi-Fi IEEE 802.11 |
a, b, g, single-stream n (65 Mbps), d, e, h, i, k, r, s 2.4 GHz channels: 1-13 5 GHz channels: 36-165 (U-NII Band 1, 2, 2e, 3) |
| Bluetooth | v2.1+EDR (Classic Bluetooth) v4.0 (Bluetooth low energy) Bluetooth EDR 2 Mbps and 3 Mbps rates |
| Wireless range | 500 m (maximum) |
| Output power | 19 dBm |
| ADC | 4 x 12 bit 200kS/s |
| Ethernet RMII | 2 x 10/100 Mbits/s + MDIO |
| GPIO | 16 |
| I2C | 2 x 400kHz |
| JTAG | 1 |
| SDIO | 1 x SDIO 2.0, 48MHz |
| SPI | 2 x 48 MHz |
| UART | 4 x 3.6 Mbaud |
| USB | 2 x USB 2.0 OTG |
| Regulated Output | 1.8 VDC and 3.3 VDC |
| Antenna Connector | 1 x U.FL |
| Operating system | Yocto based Linux distribution |
| Linux kernel | 3.17 |
| Root file system | UBIFS |
| RF parameters | Available in on-board EEPROM |
| MAC addresses | Available in on-board EEPROM |
| Bluetooth stack | Bluez 4 Bluetooth/Bluetooth low energy |
| Wi-Fi security | WEP64/128 WPA-EAP-TLS, WPA-PSK WPA2-EAP-TLS, WPA2-PSK TKIP and AES hardware accelerator |
| Wi-Fi op. modes | Infrastructure (BSS) Software AP (DFS channels excluded) |
| Hardware crypto accelerators | AES, SHA, MD5, RNG |
| Internal support for Wi-Fi and Bluetooth co-existence |
| Power supply | 3.6 - 5.5 VDC |
| Power Consumption | Idle: 151 mA @ 5.0V Wireless transmit: 312 mA @ 5V RTC only: 195uA @ 5.0V |
| EVK-W16 | Evaluation kit for ELIN-W160 and ODIN-W16 Series |
| ELIN-W160 module with U.FL connector for external antennta |
| Dimensions | 44x50x9.6 mm (including connectors) |
| Weight | 14 g |
| Mounting |
Dual high speed board-to-board stacking
connectors 3 holes for mechanical fastening |
| Operating temperature | –40°C to +85°C |
Our website (http://www.u-blox.com/) is a rich pool of information. Product information, technical documents can be accessed 24h a day.
By E-mailContact the closest Technical Support office by email. Use our service pool email addresses rather than any personal email address of our staff. This makes sure that your request is processed as soon as possible. You will find the contact details at the end of the document.
Helpful information when contacting technical supportWhen contacting Technical Support, have the following information ready:
For contact information, see www.u-blox.com/contact-us. For more product details and ordering information, see the product data sheet.
For Terms & Condition please see the u-blox homepage www.u-blox.com.


Winner
Board
| Hand 1 | Hand 2 | Hand 3 | Hand 4 | Hand 5 |
|
|
|
|
|
|
| Hand 6 | Hand 7 | Hand 8 | Hand 9 | Hand 10 |
|
|
|
|
|
|
Determine Winner
Random Deal
Clear Table
Toggle Four Color Cards


Diskbalancer is a command line tool that distributes data evenly on all disks of a datanode. This tool is different from Balancer which takes care of cluster-wide data balancing. Data can have uneven spread between disks on a node due to several reasons. This can happen due to large amount of writes and deletes or due to a disk replacement. This tool operates against a given datanode and moves blocks from one disk to another.
Disk Balancer operates by creating a plan and goes on to execute that plan on the datanode. A plan is a set of statements that describe how much data should move between two disks. A plan is composed of multiple move steps. A move step has source disk, destination disk and number of bytes to move. A plan can be executed against an operational data node. Disk balancer should not interfere with other processes since it throttles how much data is copied every second. Please note that disk balancer is not enabled by default on a cluster. To enable diskbalancer dfs.disk.balancer.enabled must be set to true in hdfs-site.xml.
The following sections discusses what commands are supported by disk balancer and how to use them.
The plan command can be run against a given datanode by running
hdfs diskbalancer -plan node1.mycluster.com
The command accepts Generic Options.
The plan command also has a set of parameters that allows user to control the output and execution of the plan.
| COMMAND_OPTION | Description |
|---|---|
| -out | Allows user to control the output location of the plan file. |
| -bandwidth | Since datanode is operational and might be running other jobs, diskbalancer limits the amount of data moved per second. This parameter allows user to set the maximum bandwidth to be used. This is not required to be set since diskBalancer will use the default bandwidth if this is not specified. |
| -thresholdPercentage | Since we operate against a snap-shot of datanode, the move operations have a tolerance percentage to declare success. If user specifies 10% and move operation is say 20GB in size, if we can move 18GB that operation is considered successful. This is to accommodate the changes in datanode in real time. This parameter is not needed and a default is used if not specified. |
| -maxerror | Max error allows users to specify how many block copy operations must fail before we abort a move step. Once again, this is not a needed parameter and a system-default is used if not specified. |
| -v | Verbose mode, specifying this parameter forces the plan command to print out a summary of the plan on stdout. |
| -fs | - Specifies the namenode to use. if not specified default from config is used. |
The plan command writes two output files. They are <nodename>.before.json which captures the state of the cluster before the diskbalancer is run, and <nodename>.plan.json.
Execute command takes a plan command executes it against the datanode that plan was generated against.
hdfs diskbalancer -execute /system/diskbalancer/nodename.plan.json
This executes the plan by reading datanode’s address from the plan file.
Query command gets the current status of the diskbalancer from a datanode.
hdfs diskbalancer -query nodename.mycluster.com
| COMMAND_OPTION | Description |
|---|---|
| -v | Verbose mode, Prints out status of individual moves |
Cancel command cancels a running plan. Restarting datanode has the same effect as cancel command since plan information on the datanode is transient.
hdfs diskbalancer -cancel /system/diskbalancer/nodename.plan.json
or
hdfs diskbalancer -cancel planID -node nodename
Plan ID can be read from datanode using query command.
Report command provides detailed report of specified node(s) or top nodes that will benefit from running disk balancer. The node(s) can be specified by a host file or comma-separated list of nodes.
hdfs diskbalancer -fs http://namenode.uri -report -node <file://> | [<DataNodeID|IP|Hostname>,...]
or
hdfs diskbalancer -fs http://namenode.uri -report -top topnum
There is a set of diskbalancer settings that can be controlled via hdfs-site.xml
| Setting | Description |
|---|---|
| dfs.disk.balancer.enabled | This parameter controls if diskbalancer is enabled for a cluster. if this is not enabled, any execute command will be rejected by the datanode.The default value is false. |
| dfs.disk.balancer.max.disk.throughputInMBperSec | This controls the maximum disk bandwidth consumed by diskbalancer while copying data. If a value like 10MB is specified then diskbalancer on the average will only copy 10MB/S. The default value is 10MB/S. |
| dfs.disk.balancer.max.disk.errors | sets the value of maximum number of errors we can ignore for a specific move between two disks before it is abandoned. For example, if a plan has 3 pair of disks to copy between , and the first disk set encounters more than 5 errors, then we abandon the first copy and start the second copy in the plan. The default value of max errors is set to 5. |
| dfs.disk.balancer.block.tolerance.percent | The tolerance percent specifies when we have reached a good enough value for any copy step. For example, if you specify 10% then getting close to 10% of the target value is good enough. |
| dfs.disk.balancer.plan.threshold.percent | The percentage threshold value for volume Data Density in a plan. If the absolute value of volume Data Density which is out of threshold value in a node, it means that the volumes corresponding to the disks should do the balancing in the plan. The default value is 10. |
Disk balancer generates two output files. The nodename.before.json contains the state of cluster that we read from the namenode. This file contains detailed information about datanodes and volumes.
if you plan to post this file to an apache JIRA, you might want to replace your hostnames and volume paths since it may leak your personal information.
You can also trim this file down to focus only on the nodes that you want to report in the JIRA.
The nodename.plan.json contains the plan for the specific node. This plan file contains as a series of steps. A step is executed as a series of move operations inside the datanode.
To diff the state of a node before and after, you can either re-run a plan command and diff the new nodename.before.json with older before.json or run report command against the node.
To see the progress of a running plan, please run query command with option -v. This will print out a set of steps – Each step represents a move operation from one disk to another.
The speed of move is limited by the bandwidth that is specified. The default value of bandwidth is set to 10MB/sec. if you do a query with -v option you will see the following values.
"sourcePath" : "/data/disk2/hdfs/dn", "destPath" : "/data/disk3/hdfs/dn", "workItem" : "startTime" :<PHONE_NUMBER>493, "secondsElapsed" : 16486, "bytesToCopy" :<PHONE_NUMBER>53, "bytesCopied" :<PHONE_NUMBER>88, "errorCount" : 0, "errMsg" : null, "blocksCopied" : 1287, "maxDiskErrors" : 5, "tolerancePercent" : 10, "bandwidth" : 10
source path - is the volume we are copying from.
dest path - is the volume to where we are copying to.
start time - is current time in milliseconds.
seconds elapsed - is updated whenever we update the stats. This might be slower than the wall clock time.
bytes to copy - is number of bytes we are supposed to copy. We copy plus or minus a certain percentage. So often you will see bytesCopied – as a value lesser than bytes to copy. In the default case, getting within 10% of bytes to move is considered good enough.
bytes copied - is the actual number of bytes that we moved from source disk to destination disk.
error count - Each time we encounter an error we will increment the error count. As long as error count remains less than max error count (default value is 5), we will try to complete this move. if we hit the max error count we will abandon this current step and execute the next step in the plan.
error message - Currently a single string that reports the last error message. Older messages should be in the datanode log.
blocks copied - Number of blocks copied.
max disk errors - The configuration used for this move step. currently it will report the default config value, since the user interface to control these values per step is not in place. It is a future work item. The default or the command line value specified in plan command is used for this value.
tolerance percent - This represents how much off we can be while moving data. In a busy cluster this allows admin to say, compute a plan, but I know this node is being used so it is okay if disk balancer can reach +/- 10% of the bytes to be copied.
bandwidth - This is the maximum aggregate source disk bandwidth used by the disk balancer. After moving a block disk balancer computes how many seconds it should have taken to move that block with the specified bandwidth. If the actual move took less time than expected, then disk balancer will sleep for that duration. Please note that currently all moves are executed sequentially by a single thread.


The page allows you to copy quotas on all filesystems for some user to
one or more other users. There are three ways of choosing which users to
copy to :
- All Users
- Quotas will be copied to every other user on your system.
- Selected Users
- Quotas will be copied to the user or users selected.
- Members of Selected Groups
- Quotas will be copied to all users who have one of the selected groups
as their primary or a secondary group.


Here is the list of what the hold strategies are. Highest priorities hold cards are listed from top to bottom. Basic Scenarios covers the hold strategies 1 through 9. The Advance Scenarios covers all other hold strategies.
| # | Hold Strategy |
| 1 | Royal Flush - Straight Flush - 4 of Kind |
| 2 | 4 to a Royal Flush |
| 3 | Full House, Flush, Straight, 3 of Kind |
| 4 | 4 to a Straight Flush |
| 5 | Two Pair |
| 6 | High Pair |
| 7 | 3 to a Royal Flush |
| 8 | 4 to a Flush |
| 9 | Low Pair |
| 10 | 4 to an outside straight |
| 11 | 2 suited high cards |
| 12 | 3 to a Straight Flush |
| 13 | Unsuited High Cards |
| 14 | Suited High Cards including 10 |
| 15 | One High Card |
| 16 | Discard everything |


--- layout: home title: Andy Tran subtitle: Data Scientist ---
To do this, I specialize in recommender systems, natural language processing, and deploying machine learning models with use interfaces.


About
"Seattle-based pop star makes her indie debut with a hauntingly beautiful album"
- John Tirckle, Music Today Post"Jane Doe is one of the scene's breakout stars"
- John Tirckle, Music Today Post"Seattle-based pop star makes her indie debut with a hauntingly beautiful album"
- John Tirckle, Music Today Post"Jane Doe is one of the scene's breakout stars"
- John Tirckle, Music Today Post


Here's how it works: Enter in the information below and submit the form. It will then take you over to another page in which each player will have an opportunity to get their picture taken! From there, you can select who goes first and what order. Once you start your game, it will cycle through each player or team allowing players to add/subtract points, skip, or end the game. What you can do is assign someone to look over the dice rolling or send the device around for the players to roll their own dice.
Currently only the DEFAULT type of game is available.


Quality, delicious Sea Food
Jimmmy Sea's
Start Bootstrap
Home
(current)
Menu
Gallery
Hours
Previous
Next


Dr Jen Gunter, author of The Vagina Bible, warns waxing or shaving creates “microscopic trauma” that can lead to infections.
While the purpose of pubic hair is somewhat of a mystery, going “au naturel” is thought to protect the skin by acting as a barrier against the outside world.
Getting a Brazilian may also reduce sexual pleasure, with pubic hair being connected to nerve endings that might help arousal, Dr Gunter added.
Pubic hair “grooming” has almost become the norm, with many blaming the porn industry.
Scientists from the University of California, San Francisco (UCSF), asked more than 3,300 women about their downstairs grooming.
Of which, 83.8% claimed to wax, shave or epilate their pubic hair, with just 16.2% leaving it intact.
“Hygiene” was the most commonly reported reason (59%) for women removing their hair.
But Dr Gunter warns waxing, shaving or “sugaring” – mixing sugar, lemon juice and water to create a wax-like gel – may do more harm than good.
“You are causing microscopic trauma to the skin,” she told the BBC.
The gynaecologist added she sees women with cuts, grazes and even infections when hair removal goes awry.
“Pubic hair has a function, it is probably a mechanical barrier and protection for the skin,” she said.
“It may also have a role in sexual functioning because each pubic hair is attached to a nerve ending, that’s why it hurts to remove it.”
Why do we have pubic hair?
The role of pubic hair is not fully understood.
Read Also; Court remands woman for allegedly abandoning five-day-old baby
Most experts think it is involved in the release of pheromones, chemicals that trigger arousal.
Pheromones are thought to be “get trapped in pubic hair when glands release an odourless secretion on the skin that combines with bacteria decomposed by the secretion of (other) glands”, according to an expert from Columbia University in New York.
This produces a scent that varies from person-to-person.
Some studies suggest women are attracted to pheromones that differ significantly from their own because it suggests genetic diversity, the expert added.
Other theories as to pubic hair’s purpose include warmth or helping the vagina stay “clean”.
“Pubic hair prevents dirt and particles from entering the vagina,” the Columbian scientist reported.
Critics argue, however, if warmth was the reason, men would surely have more hair along their penis and around their scrotum.
The protection theory also falls short because men do not have similar cushioning around the opening of their urethra.
Humans are thought to have removed their hair as far back as prehistoric times.
“Tweezers” made of shells have even been found in ancient caves.
The Egyptians also reportedly associated body hair with uncleanliness.
Removing pubic hair may have some benefits, by protecting against body lice.
The tiny insects live on coarse human hair, like that found around the genitals, according to the NHS.
Pubic lice
Find out about pubic lice, including what they look like, how you get them, symptoms, when to seek medical advic…
Body lice spread via skin-to-skin contact, usually sex.
As well as thriving on the genitals, the insects can also set up home on the armpits, legs, chest, abdomen, back, face, and even the eyebrows and eyelashes.
Basically, anywhere with hair, aside from the scalp.
These days, women are less likely to remove their pubic hair out of a fear of lice.
“The increased prevalence of pornography that depicts bare genitalia, popular magazines and television are primary drivers of the trend in the United States,” the UCSF scientists wrote in the journal JAMA Dermatology.
In their study, 875 women (31.5%) claimed they groomed their pubic hair because they felt it “made their genitals more attractive”.
And 586 (21.1%) said it is their “partner’s preference”.
Asked when they would remove their pubic hair, most (55.6%) said before sex.
This was followed by before a holiday (45.7%) and to prepare for a “healthcare professional visit” (40%).
For those who still want to go hair-free “down there”, Dr Gunter urges them to use a clean razor and shave in the direction of the hair.
Going “against the grain” increases the risk of ingrown hairs, which can become infected.
And for those who go for a wax, ensure the technician does not “double dip” the wooden sticks used.
This could spread bacteria between clients, Dr Gunter added.
(www.newnow.co.uk)


rainbow series
`Prev `__
R
`Next `__
--------------
**rainbow series**: n.
Any of several series of technical manuals distinguished by cover color.
The original rainbow series was the NCSC security manuals (see `*Orange
Book* <../O/Orange-Book.html>`__). These are now available `via the
web `__. the term has
also been commonly applied to the PostScript reference set. Which books
are meant by “\ *the* rainbow series” unqualified is thus dependent on
one's local technical culture.
--------------
+-------------------------------+----------------------------+---------------------------+
| `Prev `__ | `Up <../R.html>`__ | `Next `__ |
+-------------------------------+----------------------------+---------------------------+
| rain dance | `Home <../index.html>`__ | random |
+-------------------------------+----------------------------+---------------------------+


MaTrEx
Exploring Specialized Skill Training in Virtual Reality
Introduction
Problem Statement
Today, 60% of the open skilled production positions in the manufacturing industry are unfulfilled. Despite automation, skilled workers will still be needed to apply problem-solving capabilities, perform analysis and manage production. One reason manufacturers are finding it difficult to fill positions, both skilled and unskilled, is the lack of trade school opportunities for young women and men.
The Solution
Through MaTrEx, short for Maintenance and Training through Extended Reality, we proposed the development of robust Virtual Reality training programs, offering a way for skilled professionals to train on-site technicians and to perform remote diagnostics over Virtual Reality, potentially in real-time. To achieve this, we make use of digital twins - a virtual model of a real machine with data collected through IoT devices. The professionals can use the immersive effect to explain the instrument’s working or help pinpoint the cause of a malfunction, thus making it a derivative of Assisted Reality powered by Digital Twins. The inception of the project took place during Accenture’s Hack The Reality Hackathon.
Team
- Prabhav Bhatnagar
- Vivek Raman
- Adhiraj Bhagawati
- Adhyan Mall
- Projjal Gupta
My Role
I took the lead role and coordinated the project while providing overall guidance to the members. I handled the core VR interactions, the Multiplayer aspect, and communication between the application and IoT devices.
Tech Stack
- Unity3D
- OpenVR
- PhotonSDK
- Oculus VR and Windows MR Headsets
- Arduino
- Blender
Modules
We planned the solution in a modular fashion, the key modules being:
- Virtual Realy Environment
- The Networking Module
- The IoT module
- User Interface and Dashboard
How they all fit together
- The prototype comprises a room in Virtual Reality that is simple, spacious, and free of distractions.
- The room is shared by a trainer and N trainees. They can remotely join the room through the application.
- A “digital twin”, a 3D model resembling and connected to a machine in the real world, also exists in this room.
- As the trainer interacts with the digital twin, the trainees can observe and also interact with it.
- This can also facilitate ad-hoc remote maintenance by streaming diagnostic data in real-time using IoT.
- Each session can be recorded and replayed for re-training or reference.
Implementation
Virtual Reality Environment
The Virtual Reality Environment was designed my Adhyan Mall. We had to experiment a lot with the size and scale to make sure it was comfortable for the actors and created a productive learning environment. We built the VR interactions on top of OpenVR for its multi-vendor support, meaning that in the multi-actor scenario, there would be no restriction on the hardware being used. One actor can use a top of the line Occulus Vive while the other can use a budget Windows MR and the application would comply.
The Networking Module
The networking module was buit on top of the Photon SDK for Unity. This was my first time working with a networking SDK and it turned out to be a great learning opportunity. I built a small prototype sans the VR functionality to test out the SDK. The most important thing I noted was that Photon spawn shared network entities in a network pool. So if I have a multiplayer character, it would exist on my system and on the network pool, and if another person on the same network as a shared entity, it would exist in his system and the pool. The action 2 entity actor 1 would see would be the data pulled from the pull.
With that in mind, when I started to incorporate VR, a glaring problem arose. The OpenVR script that handles the VR functionality was a Singleton. That is, only one instance of such an entity could exist in a system. So whenever multiple such entities would be created on the network pool by actors for sharing, they would be deleted. This problem was solved by creating a dummy entity that would be a mimic for the VR entity and lacking the Singleton constraint, be able to exist in the pool.
With that problem solved, we had a functional networked VR.
The IoT module
For the prototype, since we lacked proper equipment, we made a functioning proof of concept by using a heat-sensor with an Arduino and establishing a connection with unity using MQTT protocol.
User Interface and Dashboard
We implemented a simple user interface and dashboard which would give actors the data in the VR environment in a graphical format.
Features
- Training of (multiple) on-site workers on potentially different sites by remote professionals. Training in VR provides an effective learning experience by training people in the most realistic way possible, without the situation actually happening in real life.
- The database of these sessions can be revisited in VR for future reference. One key advantage of VR is that the sharing of virtual content can lead to more robust replication and representative sampling. A database of standardized content will allow the training of on-site workers more efficiently.
- Ad-hoc maintenance where a remote profession can review the digital twin with real-time data and provide guidance to the on-site workers. These sessions can even be recorded for a particular model for future reference and maintenance.
- A Pooling session where multiple professions get access to the digital twin and each follows their approach which is simulated and the optimal solution is implemented. Since it’s multiplayer, multiple numbers of on-site workers can also work on the model or get trained to work with the necessary parts of the model.
Challenges
- We tested with the few VR headsets as we could get our hands on. We would like to stress test further how many people can feaseably learn in such a test environment.
- Considerable need for storage space for the projects and recording of VR sessions.
- Lack of actual machinery to test with a major constrant. We created a simulated proof of concept which should be feaseable to scale.
Results & Future Work
The experiment serves as a proof of concept that Virtual Reality can serve as a viable platform for demonstration training on the Industrial Scale.
Future plans include conducting more in-depth user testing and analyzing their experience juxtaposed against conventional training methods.
Additionally, the team would like to explore the effect of various kinds of input mappings on the learning experience along with the possibility of the addition of more tactile elements like haptic responses to make the environment more immersive.
The project and it's findings were accepted as a poster for presentation at IndiaHCI'19.
Check out the project's Github Repository.
Impact
One of the biggest implication of this project is the possibilty of XR as a Service (XAAS) paradigm. Being modular in nature, the solution can be scaled on an industrial scale. The solution can be modeled as a Service that the industries can subscribe to for continual support and packaged at multiple layers based on the generalized needs of the industry.
As an organization providing this solution, there will be continual returns for the services provided. As soon as one industry adopts it, it will trigger a trend in which every industry wanting a bite of the pie.


Idealogue
We're sorry, but something went wrong.
We've been notified about this issue and we'll take a look at it shortly.


Get Involved
Community Discussion
- The GitHub issues list is the place for discussion of Node.js core features.
- For real-time chat about Node.js development go to
irc.freenode.net
in the#node.js
channel with an IRC client or connect in your web browser to the channel using freenode's WebChat. - The official Node.js Twitter account is nodejs.
- The Node.js Foundation calendar with all public team meetings.
- Node.js Everywhere is the official Node.js Monthly Newsletter.
- Node.js Collection is a collection of community-curated content on Medium.
- The Community Committee is a top-level committee in the Node.js Foundation focused on community-facing efforts.
Learning
- Official API reference documentation details the Node.js API.
- NodeSchool.io will teach you Node.js concepts via interactive command-line games.
- Stack Overflow Node.js tag collects new information every day.
- The DEV Community Node.js tag is a place to share Node.js projects, articles and tutorials as well as start discussions and ask for feedback on Node.js-related topics. Developers of all skill-levels are welcome to take part.
- Nodeiflux is a friendly community of Node.js backend developers supporting each other on Discord.


Utility-first
They come with all sorts of predesigned components like buttons, cards, and alerts that might help you move quickly at first, but cause more pain than they cure when it comes time to make your site stand out with a custom design.
Tailwind is different.
Instead of opinionated predesigned components, Tailwind provides low-level utility classes that let you build completely custom designs without ever leaving your HTML.
Getting a new business off the ground is a lot of hard work. Here are five ideas you can use to find your first customers.

Marketing

Finding customers for your new business

Getting a new business off the ground is a lot of hard work. Here are five ideas you can use to find your first customers.

If you're sick of fighting the framework, overriding unwanted styles, and battling specificity wars, Tailwind was made for you.
Learn more about Tailwind's utility-first workflow →
Responsive to the core
Every Tailwind utility also comes with responsive variants, making it extremely easy to build responsive interfaces without resorting to custom CSS.
Tailwind uses an intuitive {screen}:
prefix that makes it easy to notice responsive classes in your markup while keeping the original class name recognizable and intact.
Learn more about responsive design with Tailwind →
Component-friendly
While you can do a lot with just utility classes, as a project grows it can be useful to codify common patterns into higher level abstractions.
Tailwind provides tools for extracting component classes from repeated utility patterns, making it easy to update multiple instances of a component from one place:

<button class="bg-blue-500 hover:bg-blue-600 text-white font-bold py-2 px-4 rounded">
Button
</button>

<button class="btn btn-blue">
Button
</button>

Learn more about extracting components with Tailwind →
Designed to be customized
If it makes sense to be customizable, Tailwind lets you customize it. This includes colors, border sizes, font weights, spacing utilities, breakpoints, shadows, and tons more.
Tailwind is written in PostCSS and configured in JavaScript, which means you have the full power of a real programming language at your fingertips.
Tailwind is more than a CSS framework, it's an engine for creating design systems.
// tailwind.config.js
module.exports = {
theme: {
screens: {
tablet: '768px',
desktop: '1024px',
},
colors: {
primary: {
100: '#ebf8ff',
300: '#90cdf4',
500: '#4299e1',
700: '#2b6cb0',
900: '#2a4365',
},
secondary: {
100: '#fffff0',
300: '#faf089',
500: '#ecc94b',
700: '#b7791f',
900: '#744210',
},
},
extend: {
boxShadow: {
huge: '0 30px 60px -15px rgba(0, 0, 0, .25)'
}
}
}
}


Grading
Turning in work and late policy
Late work will receive no credit. However, you have one free "late day" that you can use at anytime during the quarter on a homework assignment. A late day gives you one extra day to turn in your homework without penalty. The purpose of this late day is to help you deal with unexpected events, including getting sick, going to the doctor, or any other events that might cause you to turn in your homework late.If you'd like to use a late day, please email the professor and the TA to let us know.
You will turn in project milestones and homework via Github.
Cheating policy
I have a no tolerance policy on cheating, which includes copying from friends and plagarism. If you get caught cheating, you will get an F in this class and I will turn you into the univerisity's academic integrity group.
Quizzes
I will give you full credit on your lowest quiz grade for the quarter. That way, if you need to miss a class and there is a quiz, you won't be penalized. If you take all of the quizzes, I will replace your lowest quiz score with full credit.
Grade breakdown
Your grade will be composed of the following items:| Item | Percent | Description |
|---|---|---|
| Quizzes | 24% | Eight quizzes worth 3% each |
| Homework | 24% | Four homework assignments worth 6% each |
| Project | 52% | Proposal 5%, milestone 1 5%, milestone 2 5%, demo 10%, peer grade 5%, sprint planning 5%, final project 17% |
Grade scale
I grade on a straight grade scale. Although most of the points in this class will come towards the end of the quarter, the milestones will help give you a sense of how well you are doing on the final project.| Grade | Score |
|---|---|
| A | [93, 100] |
| A- | [90, 93) |
| B+ | [87, 90) |
| B | [83, 87) |
| B- | [80, 83) |
| C+ | [77, 80) |
| C | [73, 77) |
| C- | [70, 73) |
| D | [60, 70) |
| F | [0, 60) |


Truffles
Kaifu
Smally's
Leon Grill
Subway
Biryani House
Aqni
McDonald's
Street 24
KFC
Burger King
Plated


List of all members.
Public Member Functions |
| | XmlDocumentPersistence (Document doc) |
| | Build a new document saver/loader by XML Bareplan.XmlDocumentPersistence class.
|
| override void | Save (string f) |
| | Save the specified f.
|
| override Document | Load (string f) |
| | Ignoring the stored document, if it exists, loads a new document.
|
| | DocumentPersistence (Document doc) |
| | Creates a new instance, prepared to load and save documents.
|
Public Attributes |
|
const string | DefaultExt = "bar" |
|
const string | TasksTag = "tasks" |
|
const string | TaskTag = "task" |
|
const string | StepsTag = "steps" |
|
const string | InitialDateTag = "initialdate" |
|
const string | DateTag = "date" |
Additional Inherited Members |
| Document | Document [get, set] |
| | The document saved or loaded.
|
Constructor & Destructor Documentation
| Bareplan.Core.XmlDocumentPersistence.XmlDocumentPersistence |
( |
Document |
doc | ) |
|
Build a new document saver/loader by XML Bareplan.XmlDocumentPersistence class.
- Parameters:
-
| doc | The document, that can be null if its going to be loaded. |
Member Function Documentation
| override Document Bareplan.Core.XmlDocumentPersistence.Load |
( |
string |
f | ) |
|
|
virtual |
| override void Bareplan.Core.XmlDocumentPersistence.Save |
( |
string |
f | ) |
|
|
virtual |
The documentation for this class was generated from the following file:
- C:/Users/baltasarq/Dropbox/prys/bareplan/Core/XmlPersistence.cs


在Objective-C中如何定义Block
文章目录
Declaration
- As a
local variable
:
|
|
- As a
property
:
|
|
- As a
method parameter
:
|
|
- As an
argument to a method call
:
|
|
- As a
typedef
:
|
|
Hint
It is still a good idea to declare block properties as having copy semantics since a block assigned to a strong property will in fact be copied.
Apple recommends this as well:
You should specify copy as the property attribute, because a block needs to be copied to keep track of its captured state outside of the original scope. This isn’t something you need to worry about when using Automatic Reference Counting, as it will happen automatically, but it’s best practice for the property attribute to show the resultant behavior.
原文作者: Fong Ray
原文链接: http://fangr.cc/2017/05/31/how-to-declare-block-in-oc/
许可协议: 知识共享署名-非商业性使用 4.0 国际许可协议


自定义图表¶
比可用图表，NGX-图表库等还出口都用作添砖加瓦图表组件和佣工。 就像传说，轴，尺寸帮手，渐变，形状的东西，一系列的形状，都可以直接导入到你的应用程序和您的组件使用。这可以让你把它们混合起来并实现用例是，预先制作图表不支持创建自定义的图表。
你可以找到如何使用这些组件在这里建立一个自定义图表示例: https://github.com/swimlane/ngx-charts/tree/master/demo/combo-chart
上述组合，图表的演示可以在这里看到: https://swimlane.github.io/ngx-charts/#/ngx-charts/combo-chart
The charts under the ‘Demos’ group in our demo page are not distributed with the library. However, their code is available and can be copied directly into your project. We encourage you to submit a pull request for your custom charts to be listed in our ‘Demos’ section, because they may help other people that have the same use case as you.
指针创建或调整时，自定义图表¶
为了开发新的图表，首先建立示范项目的shell启动。
If you start by copying an existing chart from src (recommended), be sure to rename your new component(s) and their selectors, as well as the module that contains them (if applicable).
If you discover the tooltip does not display correctly, try exporting the new chart as a module along with ChartCommonModule and import it into the demo’s app.module.ts file.
对于这样的一个例子，看看大多数任何排行榜中的src文件夹
Always a good idea to give back. Use this link to learn how to contribute to github repos: http://kbroman.org/github_tutorial/pages/fork.html


--- layout: post authors: ["Greg Wilson"] title: "Jonathan Dursi Joins Compute Canada" date: 2013-08-30 time: "14:00:00" tags: ["Noticed"] ---
Jonathan Dursi, a long-time supporter of Software Carpentry and one of our first instructors, has been named Interim Chief Technology Officer for Compute Canada. Congratulations!


Job Description
Specific responsibilities include:
Requirements:
Develop and maintain company-wide data analytics systems and processes that provide precise visibility into how our users interact with our games
Consult with product owners and game teams to improve game design and monetization mechanics by utilizing data and designing impactful A/B experiments
Working directly with product owners to collect analytics requirements, instrument games and delivering daily reports and visuals
Provide regular, timely reporting and performance monitoring to studio teams and key business stakeholders
Perform strategic analyses of portfolio-wide user data to recommend ongoing product optimization and innovation
Mentor analysts and business partners in analytics, statistics, and experimental design
5+ years of experience in data analytics, especially in big data environments
3+ years of management experience
Bachelor’s degree in Information Technology, Computer Science, Operations Research, Economics, Mathematics or related field – Master preferred
Seriously good SQL skills – distributed querying experience (Hive/Pig/Presto) a huge plus
Experience with turning large amounts of raw data into actionable intelligence that is critical for business decisions
Proven ability to conceive and test hypotheses based on inconclusive or incomplete data from unstructured data and creating structures that lend themselves to analysis
Knows correlation from causation, can identify and manage biases in data, and understands the implications of sample size on the interpretation of results
Background in hands on statistical analysis and familiarity with core statistical functions, including multivariate regression, correlation models, and analysis of variance
Mobile Gaming experience is a huge plus


{{! Copyright 2015, Jakob Korherr Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. }} {{< start}} {{$pageContent}} {{$dialog}}
{{/dialog}} {{/pageContent}} {{/ start}}


12th edition of Man Ghana slated for December 7
by Simon Asare, GNAAccra, Nov. 21, GNA - The National Bodybuilding Championship dubbed "Man Ghana'' is set for December 7, as Ghana's finest bodybuilding athletes converge at the National Theatre to battle for honours.
This year's championship, which is the 12th edition and would see various athletes compete in Bodybuilding, Men's Physique and Women's Bikini contest.
Speaking at the launch of the championship at the Media Center of the Accra Sports, Mr. Abdul Hay Yartey, President of the Ghana Bodybuilding and Fitness Association (GBFA), was delighted with the progress made by his outfit over the past years.
''Despite the little support, the Man Ghana championship has produced numerous Champions who have won laurels for the country. The GBFA through the Man Ghana event have encourage other fitness activities and bodybuilding events all targeted at keeping our athletes in shape.
''Successful athletes at this year's championship would make it into the national bodybuilding team, the Black Muscles, who are set to have a busy schedule in 2020 as they would be competition in various international events,'' he said.
Registration for the championship would end on November 30 with pre-judging set for December 6, 2019.
The Man Ghana since its inception in 2006 has produced six past winners including Samuel Asante, Christopher Andoh, Yaw Azure, Cyril Kofi Adja, Junior Agogo and Kofi Salia.
GNA


The aluminumairfoil of the jet was designed to be as smooth as the aloe leaf, providing a wind-resistant layer over the aircraft that ensured a successful journey. [G|D]
John had a bespokebrolly made of alveolar fabric, which was specially tailored so as to keep him dry during the summer monsoons. [G|D]
The astronomer was amazed when she saw the massive bolt of electricity, accompanied by the sweet aroma of ozone in the night sky. [G|D]
The farmer was proud of his anatomically-correct coop, which was built with strong almond wood, ensuring the safety of his beloved chickens. [G|D]


@* * Copyright 2017 HM Revenue & Customs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *@ @import models.taxhistory.Employment @import utils.Currency @(nino: String, taxYear: Int, employments: Seq[Employment], sideBarLink: Option[Html] = None, headerNavLink: Option[Html] = None)(implicit request: Request[_], messages: Messages) @analyticsAdditionalJs = { ga('send', { hitType: 'event', eventCategory: 'content - view', eventAction: 'TaxHistory', eventLabel: 'EmploymentDetails'}); } @views.html.main_template(title = Messages("employmenthistory.title"), bodyClasses = None, sidebarLinks = None, headerNavLink = headerNavLink, analyticsAdditionalJs = Some(analyticsAdditionalJs)) {
| Organisation name | @employment.employerName |
|---|---|
| PAYE reference | @employment.payeReference |
| Taxable pay | @if(employment.taxablePayTotal.isDefined){ @Currency(employment.taxablePayTotal.getOrElse(0)) } else { @Messages("employmenthistory.nopaydata") } |
| Income tax | @if(employment.taxTotal.isDefined){ @Currency(employment.taxTotal.getOrElse(0)) } else { @Messages("employmenthistory.nopaydata") } |


--- layout: post title: "No Title" ---
In Microsoft’s future of productivity all jobs involve people either creating presentations or viewing presentations.


Import service: done uploading
Done uploading file
Okay, Houston, we've had a problem here: "${error}"
Created image is now available at: ${uri}
Image parameters
- Filename: "${info['filename']}"
- Width: ${info['x']}px
- Height: ${info['y']}px
- Channels: ${info['ch']}
- Z slices: ${info['z']}
- T frames: ${info['t']}


analyzer module¶
Analyzes raw data to produce values of interest for the metrics dictionary.
-
analyzer.
produceBeats
(data)¶ Finds the beats in the ECG strip.
Parameters: data – numpy array with data Returns: numpy array with indices of peaks
-
analyzer.
produceDuration
(data)¶ Calculates time duration of the ECG strip.
Parameters: data – numpy array with data Returns: float duration of signal
-
analyzer.
produceMeanHR
(numBeats, duration)¶ Calculates mean heart rate from data.
Parameters: - numBeats – integer number of beats in ECG strip
- duration – float duration of strip
Returns: mean heart rate as integer beats per minute
-
analyzer.
produceNumBeats
(peakInds)¶ Counts the number of beats in the ECG strip.
Parameters: peakInds – numpy array with indices of peaks Returns: integer number of beats in ECG strip
-
analyzer.
produceNumpy
(data)¶ Produces a 2-row numpy array from the raw data
Parameters: rawData – list of lists time and voltage Returns: numpy array
-
analyzer.
produceTimesOfBeats
(data, peakInds)¶ Calculates timepoints at which beats occurred.
Parameters: - data – numpy array with data
- peakInds – nump array with indices of peaks
Returns: numpy array of times at which beats occurred
-
analyzer.
produceVoltageExtremes
(data)¶ Calculates minimum and maximum lead voltages.
Parameters: data – numpy array with data Returns: tuple of floats: minimum and maximum voltages


TCP Dump Notes
These are notes I made while surfing the web looking into TCP Dump. You will most likely need to use sudo
to run most of the commands, but I'm leaving it off to make it shorter.
About TCP Dump
- It has more filtering capabilities and can filter while capturing packets, but it doesn't have the analytical tools that something like wireshark has1.
Some Examples
Listing interfaces
You can ask tcpdump
which interfaces it is able to listen to2.
tcpdump -D
Capture packets on an interface
To capture packets on an interface you pass its name to the -i
flag2 (here the interface I'll use is eno1
).
tcpdump -i eno1
Save the packet capture to a file
The default behavior is for tcpdump
to send the output to standard output, to have it save the packets to a files use the -w
flag2 (you can call it anything, I'll call it dump.pcap
).
tcpdump -i eno1 -w dump.pcap
Increase the verbosity of the capture
To increase the amount if information that's captured, pass multiple v
arguments2 (in this case I'll use -vvv
).
tcpdump -i eno1 -vvv -w dump.pcap
Filtering
By IP address
You can get all the packets being sent or received by a host using the host
argument3.
tcpdump host <IP_ADDRESS>
By Sender IP Address
By Target IP Address
To filter out all the packets except those that are going to a specific target use the dst host
argument2.
tcpdump -i eno1 dst host <IP_ADDRESS>
Sender and Target IP Addresses
You can combine parameters using the logical operators and
, or
, and not
3.
tcpdump 'src <IP_ADDRESS> and dst <IP_ADDRESS>'
The single quotes are optional and are just used to group the arguments together.
By Subnet
By port and/or protocol
If you want to only catch activity on a certain port and by a certain protocol then you use the port
argument and the name of the protocol (e.g. udp
)3. This would catch all the tcp
traffic over SSH.
tcpdump tcp port 22
You can use tcp
, udp
, or icmp
for the protocols and add multiple ports using a comma4.
tcpdump tcp port 22,80
Turn off hostname and port translation
The default behavior for tcpdump
is to translate the hostnames and ports to something human-readable if possible. To turn this off you pass in the -n
argument3. Since this stops having to look things up it will reduce the amount of overhead needed by tcpdump
.
tcpdump -n -i eno1 port 22
Links
- (Wireshark Revealed5) The tcpdump website
- (Wireshark Revealed5) A friendly tutorial
- (Wireshark Revealed5) The official man page
Sources
Footnotes:
Diogenes, Y. & Ozkaya, E. (2018). Cybersecurity, Attack and Defense Strategies : infrastructure security with Red Team and Blue Team tactics. Birmingham, UK: Packt Publishing.]
Johansen, G. (2017). Digital forensics and incident response : an intelligent way to respond to attacks. Birmingham, UK: Packt Publishing.
Beltrame, J. (2017). Penetration testing bootcamp : quickly get up and running with pentesting techniques. Birmingham, UK: Packt Publishing.
McPhee. & Beltrame, J. (2016). Penetration testing with Raspberry Pi : learn the art of building a low-cost, portable hacking arsenal using Raspberry Pi 3 and Kali Linux 2. Birmingham, UK: Packt Publishing.
Baxter, J., Orzach, Y. & Mishra, C. (2017). Wireshark revealed : essential skills for IT professionals : get up and running with Wireshark to analyze your network effectively. Birmingham, UK: Packt Publishing.


Winter 2015
-
Petrified Forest National Park
Serious winter backpacking, temperatures below 20, but amazing solitude and views of the Milky Way.
-
Big Bend National Park
We hiked up Emory Peak, over 6,000 feet. Beautiful views of the Chisos Mountains, and we saw a bear!


1)
Did Uncle John come by flight?
2)
The boat sailed down the river.
3)
The train blew a whistle and went through the tunnel.
4)
Cindy saw a coconut falling from a tree.
5)
I sat beside my best friend today.
6)
That man got off the moving bus.
7)
The baby crawled and hid behind the curtains.
8)
There are many plants that live under water.
9)
All the friends met at the City Center.
10)
Tommy ran across the field and got the football.


In the next tutorial, we will write out the source of the path to be able to start serving files later on.
#include <stdio.h> int main(int argc, char *argv[]) { char path[50]; scanf("%s", path); printf("Hello, %s!\n", path); }
Compile with:
$ gcc main.c
Run with:
$ ./a.out


Today I explored generics properly and I must admit that I’m very sorry i did not take the time earlier
Bottom line : GENERICS ARE GREAT
IO(thoughts) foreach (_.propagandize)
Today I explored generics properly and I must admit that I’m very sorry i did not take the time earlier
Bottom line : GENERICS ARE GREAT
I got a question asked just recently about multi threading and async execution of a page.
About async execution I am a little bit biased because for asp.net I don’t really see a huge benefit most of the time and I really believe it should be used very wisely.
Spawning threads on the other hand is more convient for lengthy operations that are not essential to the execution of the page. I will just copy paste the mail I’ve sent to the other guy. It came with a question on what about cleaning of the objects afterwards
If you use it async asp.net should take care of the cleaning.
I haven’t used the async scenario yet because I jump to separate threads more quickly that way my page isn’t blocked ever and I can update the interface through a timed ajax call to a webservice.
I use the multi threading to send mass emails with progress bar etc.
Once you’ve done it you will see that it is pretty easy to implement and has IMHO more advantages than simply executing a page async because you don’t have to wait for the execution to end.
You start by making a worker class with a parameterised constructor that implements at least the following interface
4 interface IAggregatorWorker
5 {
6 void ExecuteTask();
7 bool KeepRunning { get; set; }
8 }
The execute task method is the method where you do your work as long as KeepRunning is set to true. I believe that sessionstate is unavailable in a spawned thread so you will have to find a way to persist your session objects differently if you are needing them at all.
If you want to add properties for the worker thread to work with you that is no problem it behaves as a normal class as far as i can tell
In your page you start a thread by instantiating your workerclass and setting the properties
45 BLL.MailThreadWorker mtc = new BLL.MailThreadWorker();
46 mtc.Body = tbBody.Text;
47 mtc.Subject = tbSubject.Text;
48 Guid id = Guid.NewGuid();
49 mtc.BaseUrl = Request.Url.DnsSafeHost;
50 mtc.SessionId = id;
51 System.Threading.Thread thread = new System.Threading.Thread( new System.Threading.ThreadStart(mtc.MailingStart));
52 thread.Name = “MailingThread” ;
53 thread.Start();
You can stop or suspend the thread at any time and then you can dispose of your objects that are still hanging around. By setting the property of KeepRunning property of the worker instance to false.
and there you should do your clean-up. The code from the mailingthread is taken from the code beside (i believe is the new word for the file) of my aspx page.
This is a link to an article on msdn that explains it probably a lot cleaner than I ever can. Other good examples to look at what you can do with threading is to look after articles about windows services there are a few that explain the concept really clearly
I have the need to run an ftp server for one of my applications. It is to complement a web application where there is a pretty big datatransfer. Users need to be able to register and upon activation they need to be able to upload movies (20-70MB) to a folder online. These movies need to be made available online and proposed for review to somebody in the company.
So far so good. Were it not that we are running IIS Ftp server for the moment who stores it’s users in the AD of the server. That is not the place where I want to store credentials for my users. Also I wanted to make only one folder available for a user and to accomplish this IIS is just too difficult to manage. Thus again time for an internet hunt and yessss there is is Blackmoon FTP server who allows to do the entire configuration in a sql database or an access database.
Fits like a glove in my opinion :)
I downloaded it, installed it end yes it just works. I can now do the full configuration through the generated DAL from ORM.NET. All it took to integrate an FTP server in my application was one afternoon and that’s it.
You can download blackmoon from their site. They offer a free version for personal use. But even from the enterprise edition with domain license you won’t become poor man :)
http://www.blackmoonftpserver.com
There has been a lot of talk about code generation and ORM software around where I was.
I got curious and embarked on a free codegeneration exploration. Being new to the concept of codegeneration my requirements were the following :
It needs to be faster then the dataset generator of visual studio 2005
It needs to support relations
It needs to support stored procedures or at the very least use dynamic query language that uses parameters to set up queries to the database.
It needs to be with a very very fast learning curve.
It needs to be free (although I also looked at the wilson O/R mapper which is practically free and LLBL codegen which is definetely not free)
These are my findings :
The one that is most easily found is mygeneration with the dOOdads architecture out of the box. Of course you can create your own templates to customize the generated code to you your specific needs and architecture.
my generation can be found at : http://www.mygenerationsoftware.com/portal/default.aspx
It does work fine but the dOOdads architecture does not support relations and these you have to make yourself again. I found it all a bit too much fiddling about and it didn’t meet my 2 of my requirements, thus the search went on.
Next I found ORM.NET, which is the one I am using for the moment. Total setup time of a DAL that is easily queried 1,5 min flat. I was impressed, and best of all it is completely free. Apparently it is written by a consulting firm that used it for their internal needs. They no longer support it and it turned open source.
ORM.NET gets my stars. And I will be using it a lot in simpler scenario’s like websites etc.
ORM.NET can be found at : http://www.olero.com/OrmWeb/index.aspx?p=ORM.ascx
While looking for some documentation on ORM.NET I came across a link to ntiergen.net which can handle about any job. It generates stored procedures for you, along the DAL and the needed classes. You get to configure all your stored procedures beforehand and get the opportunity to create views and complicated queries through their interface. Normally it is priced at $449 but the link I found offers a fully functional licensed version open for the public. I downloaded it and just gave it a brief look as I am very pressed for time at the moment.
nTierGen.NET can be found at http://weblogs.asp.net/gavinjoyce/archive/2004/08/28/222017.aspx
Happy code generating !!!
Today I had to build something so I needed to add multiple functions to the window.onload event
So what I discovered today is when you use the following snippet for attaching events .. They don’t get loaded in the right order by this I mean Firefox fires the one that says yay first and then the again one… IE fires first the latter and then the first. Nothing to be worried about for the moment,in my case at least, but when you need it to initialise some functions.. it can get you into a lot of head scratching.
function myAddEvent(obj, event, listener, useCapture) {
// Non-IE
if(obj.addEventListener) {
if(!useCapture) useCapture = false;
obj.addEventListener(event, listener, useCapture);
return true;
}
// IE
else if(obj.attachEvent) {
return obj.attachEvent(‘on’+event, listener);
}
}
function myListener() {
alert(‘yay’);
}
function myListener2() {
alert(‘yay again’);
}
myAddEvent(window, ‘load’, myListener);
myAddEvent(window, ‘load’, myListener2);
I thought I was busy before I got this thing on my hand. Now it’s even worse.
I don’t know where to crawl first.
I got my MYOB professional partner subscription last week and am trying to integrate it now in the program I’m writing. And I have to say.. It’s not all that hard.. just open the docs and you’re good to go.
 A request can easily take up to 30 seconds to complete. This gives me an excuse to delve into the async pattern. It appeals a lot to me.. but seens as I ‘m always pressed for time I don’t get to experiment all that often.. But this problem does give me the necessity to do it.
Maybe I will post my findings later. If the async pattern doesn’t give me a good viable solution to my problem I have another way of going about it. SQL server 2005 supports managed code, which we are all very aware off, so I can reference and consume a webservice and stick all the myob datatable queries in a sql db as xml, index it and it is also searchable.
But first let’s get to the async pattern..
I have been suffering from tendonitis and I found the time was come to take a break. So did my doctor who told me no pc for one month.. Well this has just been horrible because on top of not using a pc I was also banned from writing. In fact it was better to just not use or move my right hand completely.
Uhm, I failed ;-) The writing no problemo I hardly ever write on a piece of paper (Save the trees !!!). The not using my right hand, well i interpreted unless you absolutely have to, because even now I still can’t roll a cigarette with only my left (bad) hand.
The not using a pc .. let’s say : Hello Dragon Natural Speaking. That’s the name of my new friend :) It took a while before it recognized my english, I’m suffering from a bad accent, somewhere between German and Dutch I’m told.
But programming C# or Javascript with natural speaking is not what you want to do, so my pc usage was limited to writing English mails and having English chats or skyping to some the friends.
Anyway I’m back in action now and am not planning to take a break for some time to come.
There is a website out there that remembers them for you. I’ve used them on multiple occasions because my memory for these things seems to be in need of a reboot
Anyway here’s the url : http://www.connectionstrings.com/
After installing Dasblog I had problems with the compression module of Ben Lowery.
In .NET 1.1 I had exactly the same problems. No output was generated to the browser.
I dissected his code and found that it could be greatly simplified, so i decided to rewrite it to a .NET 2.0 version.
The first thing that needed to be done was rewrite the configuration, next get rid of all the inherited streams that were there for no reason in my opinion but to add some headers to the stream. I decided to hook them, the headers, up after I was sure that everything was compressed ok.
In the blowery module you can provide paths in the web.config that need to be excluded and this works well as long as your app is running on a virtual directory and not on a website. If your page is www.foo.com/default2.aspx that needs to be excluded his parser returns efault2.aspx so I changed that to work properly as well.
I’ve provided a zip with this post that contains the module, which you can use freely as long as you leave the copyright notice intact. If you have any questions do not hesitate to ask.
I changed blogs today. My new blog can be found at http://www.flanders.co.nz/blog
Together with the blog I also built a new site.. The only thing that is left to do for me is to migrate the posts from geeks to the new one.
This blog will allow me to post zip files with projects to go with the posts about coding that I do.
I really love .NET 2.0 everything goes pretty quickly. To build my new site I spent about 14 hours that is for designing, lay-out in masterpages, sql database and content input.


Rotation 5: 3D Printing and Scanning
Project Description:
The first project of this rotation was to 3D scan our head with the scanning tablet and then putting it into meshmixer and combine it with another object. I combined mine with a pedestal, putting my head on a pedestal. This project was my first time using meshmixer and I found it pretty diffiuclt to figure out.
The second project of the rotation was to create a useful 3D object. I created a comb using Fusion360. This object is useful because it is portable and I can brush my hair with it. I liked this project of creating something useful.
The third project of this rotation was to make an object that could not be sawed or milled or made using subtraction. I chose to make a box that had circly holes in it. I thought it looked pretty cool even though it broke.
For MakerBot Fifth Gen Replicators there are limitations and rules. The maximum fineness of a peak is 1.55 mm, the minimum thickness of a rounded off standing rectangle is 1.2 mm, the minimum width of a cut is .45 mm, the file must be in .stl as .makerbot, the object must be flat on the platform, and the hollow or opening part must be on the top when it prints.


{% extends "registration/base.html" %} {% block title %}Password reset complete{% endblock %} {% block meta_description %}Password reset complete{% endblock %} {% block main_content %}
Your password has been set. You may go ahead and log in now.
{% endblock %}


Stop your co-workers in their tracks with the stunning new 30-inch diagonal HP LP3065 Flat Panel Monitor. This flagship monitor features best-in-class..
Canon's press material for the EOS 5D states that it 'defines (a) new D-SLR category', while we're not typically too concerned with marketing talk thi..
Canon's press material for the EOS 5D states that it 'defines (a) new D-SLR category', while we're not typically too concerned with marketing talk thi..


How it works? Come to ANY UPC event and get your card punched (along with select athletic events)! After only 9 punches you can turn your card in for a variety of prizes!
What are the prizes? Well it depends!
If you turn it in at a movie, you will get a free soda & candy!
You’ll be entered for a monthly prize drawing in the month you turn your perks card in
Every turned in perks card will also enter you for a GRAND SEMESTER PRIZE!


'American Chopper' star worried about today's youth: Work ethic was better 15 years ago
by Joshua Nelson“American Chopper” star Paul Teutel Sr. expressed worry about what he sees as a declining level of work ethic in younger American workers.
“I think people still had a better work ethic 15 years ago than it is today, but I think that was the beginning of it,” Teutel told “Fox & Friends” on Wednesday.
He agreed that in many cases young people should consider learning a trade rather than pursuing a costly college degree.
“The trades are almost a dying breed,” Teutel said. “I think it’s the world of computers. People sitting in their room. If you’re working at my shop and you’re working for me, you’re working. You ain’t heating no seat in my shop.”
REP. MCCARTHY: DEMOCRATS 'SO AFRAID' OF FACING TRUMP IN 2020, 'THEY’RE TRYING TO FRAME HIM'
“American Chopper” is the Discovery Channel’s longest-running show. It features Teutel competing with his son, Paul Jr., as they run separate shops creating custom motorcycles in Orange County, N.Y.
Furthermore, Teutel, a supporter of President Trump’s 2016 campaign, also recalled Trump’s appearance on an episode of the show before he was elected.
“It was a really good experience for me,” Teutel told host Brian Kilmeade. Teutel said that he promised Trump that in turn he would appear on “The Celebrity Apprentice,” which he did.
CLICK HERE TO GET THE FOX NEWS APP
Teutel vocally endorsed Trump’s campaign in a video posted to the then-presidential candidate’s Facebook page in 2016.
"He expected nothing but greatness from me, as he does from his family and people that surround him," the reality television star said.
"He's the guy that's going to make America great again!" Teutel added.


This command removes an existing alias named name. This command simply removes the definition of the associated procedure called name. If no alias named name exists, an error message is printed.


RuPaul's Michelle Visage almost caused Divina DiCampo to quit in unaired footage
Divina DiCampo has revealed how Michelle Visage almost made her quit RuPaul’s Drag Race after the judges tore her make-up and outfit to shreds.
The runner-up explained the reason why she was crying so much in week two – and that TV bosses didn’t show the real reason of why she was visibly upset.
She also told how the audience didn’t see parts of the show and revealed how it made her look like a ‘crazy person’ – which made her question her position in the competition.
‘Week two where I’m crying,’ she began.
‘I nearly left that week, I nearly went home. I just thought I don’t need to put myself through this, I already have a good career, I already have a really good fanbase.
‘What you didn’t get to see was when Michelle [Visage] said to Scaredy Kat, “Are we always going to see this make-up on you?” she then said, “Because you have these incredible make-up artists around you, why don’t you ask Blu [Hydrangea] or Cheryl [Hole] or Crystal for some advice?”
On Thursday night The Vivienne beat Divina and Baga Chipz to the top spot after eight weeks of acting, shade and a whole lot of sequins to come out on top.
The final three were put through their paces in the last mega challenge, which saw them learn dance routines from Strictly’s AJ Pritchard and Love Island brother Curtis Pritchard, as well as appear on RuPaul and Michelle Visage’s podcast, What’s The Tee?
Advertisement Advertisement
Finally they had to come up with their own lyrics to RuPaul’s Rock It [To The Moon].
‘The Vivienne has it all, she can serve a look, deliver a line, she is without doubt a terrific drag queen, drag act,’ Graham Norton said in the final deliberations.
Alan Carr agreed and said: She’s got that trademark wit. When she was Trump, oh my God, it was the best Trump I’ve ever seen. It was a comedy masterclass.’
Then RuPaul herself declared: ‘The Viv is a perfect example of a 21st century British Queen. I think she is a great representative of what this competition can turn out.’
RuPaul’s Drag Race UK is available now on BBC iPlayer.
Got a showbiz story?
If you've got a story, video or pictures get in touch with the Metro.co.uk Entertainment team by emailing us<EMAIL_ADDRESS>calling 020 3615 2145 or by visiting our Submit Stuff page - we'd love to hear from you.


WEEKDAYS OF ADVENT FROM 17 TO 24
DECEMBER 17
Entrance Antiphon
Rejoice, O heavens, and exult, O earth, for our Lord will come to show mercy to his poor.
Collect
O God, Creator and Redeemer of human nature,
who willed that your Word should take flesh in an ever-virgin womb,
look with favour on our prayers, that your Only Begotten Son,
having taken to himself our humanity, may be pleased to grant us a share in his divinity.
Who lives and reigns with you. . .
FIRST READING
Genesis 49:2.8-10 A reading from the Book of Genesis In those days: Jacob called his sons, and said,
ďAssemble and hear, O sons of Jacob, and listen to The word of the Lord
RESPONSORIAL PSALM
Psalm
72:1-2.3-4ab.7-8.17(R.see 7) R. In his days
shall justice flourish, and great peace for ever. O God, give your judgment to the king, to a king's
son your justice, that he may judge your people in justice, and your poor in right judgment. R. In his days
shall justice flourish, and great peace for ever. May the mountains bring forth peace for the people,
and the hills justice. May he defend the poor of the
people, and save the children of the needy. R. In his days
shall justice flourish, and great peace for ever. In his days shall justice flourish, and great peace
till the moon is no more. He shall rule from sea to sea, from the River to the
bounds of the earth. R. In his days
shall justice flourish, and great peace for ever. May his name endure for ever, his name continue like the sun. Every tribe shall be blessed in him, all nations shall call him blessed. R. In his days
shall justice flourish, and great peace for ever. ALLELUIA Alleluia. Come, O wisdom of the Most High! You order all things with gentle power: come
and teach us the way of prudence. Alleluia. GOSPEL
Matthew 1:1-17 A reading from the holy Gospel according to Matthew The book of the genealogy of Jesus Christ,
the son of David, the son of Abraham. Abraham was the father
of Isaac, and Isaac the father of Jacob, and Jacob the father of Judah and his
brothers, and Judah the father of Perez and Zerah by Tamar, and Perez the
father of Hezron, and Hezron the father of Ram, and Ram the father of
Amminadab, and Amminadab the father of Nahshon, and Nahshon the father of
Salmon, and Salmon the father of Boaz by Rahab, and Boaz the father of Obed by
Ruth, and Obed the father of Jesse, and Jesse the father of David the king. And
David was the father of Solomon by the wife of Uriah, and Solomon the father of
Rehoboam, and Rehoboam the father of Abijah, and Abijah the father of Asa, and
Asa the father of Jehoshaphat, and Jehoshaphat the father of Joram, and Joram
the father of Uzziah, and Uzziah the father of Jotham, and Jotham the father of
Ahaz, and Ahaz the father of Hezekiah, and Hezekiah the father of Manasseh, and
Manasseh the father of Amos, and Amos the father of Josiah, and Josiah the
father of Jechoniah and his brothers, at the time of the deportation to
Babylon. And after the deportation to Babylon: Jechoniah was the father of
Shealtiel, and Shealtiel the father of Zerubbabel, and Zerubbabel the father of
Abiud, and Abiud the father of Eliakim, and Eliakim the father of Azor, and
Azor the father of Zadok, and Zadok the father of Achim, and Achim the father
of Eliud, and Eliud the father of Eleazar, and Eleazar the father of Matthan,
and Matthan the father of Jacob, and Jacob the father of Joseph the husband of
Mary, of whom Jesus was born, who is called Christ. So all
the generations from Abraham to David were fourteen generations, and from David
to the deportation to The Gospel of the Lord
Prayer over the Offerings
Sanctify these gifts of your Church, O Lord, and grant that, through these venerable mysteries,
we may be nourished with the bread of heaven. Through Christ our Lord.
Communion Antiphon
Behold, the Desired of all the nations will come, and the house of the Lord will be filled with glory.
Prayer after Communion Nourished by these divine gifts, almighty God, we ask you to grant our desire:
that, aflame with your Spirit,
we may shine like bright torches before your Christ when he comes. Who lives and reigns for ever and ever.


--- layout: post title: "The Maybe monad" description: "The Maybe sum type forms a monad. An article for object-oriented programmers." date: 2022-04-25 6:50 UTC tags: [Software Design, Functional Programming] --- {% include JB/setup %}
{{ page.description }}
This article is an instalment in an article series about monads.
The Maybe sum type is a useful data type that forms a functor. Like many other useful functors, it also forms a monad.
It can be useful when querying another data structure (like a list or a tree) for a value that may or may not be present. It's also useful when performing a calculation that may not be possible, such as taking the square root of of a number, or calculating the average of a collection of values. A third common use case is when parsing a value, although usually, the Either sum type is often a better option for that task.
A monad must define either a bind or join function. In C#, monadic bind is called SelectMany
. Depending on how you've implemented Maybe<T>
the details of the implementation may vary, but the observable behaviour must always be the same. In this article I'm going to continue to use the Maybe<T>
class first shown in the article about the Maybe functor. (That's not really my favourite implementation, but it doesn't matter.)
In that code base, I chose to implement SelectMany
as an extension method. Why I didn't use an instance method I no longer remember. Again, this doesn't matter.
public static Maybe<TResult> SelectMany<T, TResult>( this Maybe<T> source, Func<T, Maybe<TResult>> selector) { if (source.HasItem) return selector(source.Item); else return new Maybe<TResult>(); }
If the source
has an item, SelectMany
calls selector
with the value and returns the result. If not, the result is an empty Maybe<TResult>
.
Monadic bind becomes useful when you have more than one function that returns a monadic value. Consider, for example, this variation of Average
:
public static Maybe<double> Average(IEnumerable<double> values) { if (values.Any()) return new Maybe<double>(values.Average()); else return new Maybe<double>(); }
You can't calculate the average of an empty collection, so if values
is empty, this function returns an empty Maybe<double>
.
If you only needed this Average
function, then you could use Maybe's functor affordance to map the result. On the other hand, imagine that you'd like to pass the Average
result to this Sqrt
function:
public static Maybe<double> Sqrt(double d) { var result = Math.Sqrt(d); switch (result) { case double.NaN: case double.PositiveInfinity: return new Maybe<double>(); default: return new Maybe<double>(result); } }
This is another calculation that may not be possible. If you try to compose Average
and Sqrt
with Select
(the functor's map function), you'd get a Maybe<Maybe<double>>
. Fortunately, however, monads are functors you can flatten:
[Theory] [InlineData(new double[0], -100)] [InlineData(new double[] { 5, 3 }, 2)] [InlineData(new double[] { 1, -2 }, -100)] public void ComposeAverageAndSqrt(double[] values, double expected) { Maybe<double> actual = Average(values).SelectMany(Sqrt); Assert.Equal(expected, actual.GetValueOrFallback(-100)); }
The SelectMany
method flattens as it goes. Viewed in this way, Scala's flatMap
seems like a more appropriate name.
The above test demonstrates how SelectMany
returns a flattened Maybe<double>
. The first test case has zero elements, so the Average
method is going to return an empty Maybe<double>
. SelectMany
handles that gracefully by returning another empty value.
In the second test case Average
returns a populated value that contains the number 4
. SelectMany
passes 4
to Sqrt
, which returns 2
wrapped in a Maybe<double>
.
In the third test case, the average is -.5
, wrapped in a Maybe<double>
. SelectMany
passes -.5
on to Sqrt
, which returns an empty value.
Monads also enable query syntax in C# (just like they enable other kinds of syntactic sugar in languages like F# and Haskell). As outlined in the monad introduction, however, you must add a special SelectMany
overload:
public static Maybe<TResult> SelectMany<T, U, TResult>( this Maybe<T> source, Func<T, Maybe<U>> k, Func<T, U, TResult> s) { return source.SelectMany(x => k(x).Select(y => s(x, y))); }
As I also mentioned in the monad introduction, it seems to me that you can always implement this overload with the above expression. Once this overload is in place, you can rewrite the above composition in query syntax, if that's more to your liking:
[Theory] [InlineData(new double[0], -100)] [InlineData(new double[] { 5, 3 }, 2)] [InlineData(new double[] { 1, -2 }, -100)] public void ComposeAverageAndSqrtWithQuerySyntax(double[] values, double expected) { Maybe<double> actual = from a in Average(values) from s in Sqrt(a) select s; Assert.Equal(expected, actual.GetValueOrFallback(-100)); }
In this case, query syntax is more verbose, but the behaviour is the same. It's just two different ways of writing the same expression. The C# compiler desugars the query-syntax expression to one that composes with SelectMany
.
In the introduction you learned that if you have a Flatten
or Join
function, you can implement SelectMany
, and the other way around. Since we've already defined SelectMany
for Maybe<T>
, we can use that to implement Join
. In this article I use the name Join
rather than Flatten
. This is an arbitrary choice that doesn't impact behaviour. Perhaps you find it confusing that I'm inconsistent, but I do it in order to demonstrate that the behaviour is the same even if the name is different.
The concept of a monad is universal, but the names used to describe its components differ from language to language. What C# calls SelectMany
, Scala calls flatMap
, and what Haskell calls join
, other languages may call Flatten
.
You can always implement Join
by using SelectMany
with the identity function.
public static Maybe<T> Join<T>(this Maybe<Maybe<T>> source) { return source.SelectMany(x => x); }
Instead of flattening as you go with SelectMany
, you could also use Select
and Join
to compose Average
and Sqrt
:
[Theory] [InlineData(new double[0], -100)] [InlineData(new double[] { 5, 3 }, 2)] [InlineData(new double[] { 1, -2 }, -100)] public void JoinAverageAndSqrt(double[] values, double expected) { Maybe<double> actual = Average(values).Select(Sqrt).Join(); Assert.Equal(expected, actual.GetValueOrFallback(-100)); }
You'd typically not write the composition like this, as it seems more convenient to use SelectMany
, but you could. The behaviour is the same.
Apart from monadic bind, a monad must also define a way to put a normal value into the monad. Conceptually, I call this function return (because that's the name that Haskell uses). You don't, however, have to define a static method called Return
. What's of importance is that the capability exists. For Maybe<T>
in C# the idiomatic way would be to use a constructor. This constructor overload does double duty as monadic return:
public Maybe(T item) { if (item == null) throw new ArgumentNullException(nameof(item)); this.HasItem = true; this.Item = item; }
Why is it that overload, and not the other one? Because if you try to use new Maybe<T>()
as return, you'll find that it breaks the monad laws. Try it. It's a good exercise.
Now that we're on the topic of the monad laws, let's see what they look like for the Maybe monad, starting with the left identity law.
[Theory] [InlineData(0)] [InlineData(1)] [InlineData(2)] public void LeftIdentity(int a) { Func<int, Maybe<int>> @return = i => new Maybe<int>(i); Func<int, Maybe<double>> h = i => i != 0 ? new Maybe<double>(1.0 / i) : new Maybe<double>(); Assert.Equal(@return(a).SelectMany(h), h(a)); }
To provide some variety, h
is another Maybe-valued function - this time one that performs a safe multiplicative inverse. If i
is zero, it returns an empty Maybe<double>
because you can't devide by zero; otherwise, it returns one divided by i
(wrapped in a Maybe<double>
).
In a similar manner, we can showcase the right identity law as a test.
[Theory] [InlineData("")] [InlineData("foo")] [InlineData("42")] [InlineData("1337")] public void RightIdentity(string a) { Maybe<int> f(string s) { if (int.TryParse(s, out var i)) return new Maybe<int>(i); else return new Maybe<int>(); } Func<int, Maybe<int>> @return = i => new Maybe<int>(i); Maybe<int> m = f(a); Assert.Equal(m.SelectMany(@return), m); }
Again, for variety's sake, for f
I've chosen a function that should probably be named TryParseInt
if used in another context.
The last monad law is the associativity law that we can demonstrate like this:
[Theory] [InlineData("bar")] [InlineData("-1")] [InlineData("0")] [InlineData("4")] public void Associativity(string a) { Maybe<int> f(string s) { if (int.TryParse(s, out var i)) return new Maybe<int>(i); else return new Maybe<int>(); } Func<int, Maybe<double>> g = i => Sqrt(i); Func<double, Maybe<double>> h = d => d == 0 ? new Maybe<double>() : new Maybe<double>(1 / d); var m = f(a); Assert.Equal(m.SelectMany(g).SelectMany(h), m.SelectMany(x => g(x).SelectMany(h))); }
Here, I've copy-and-pasted the TryParseInt function I also used in the right identity example, and combined it with the Sqrt
function and a safe multiplicative inverse. The law, however, should hold for all pure functions that type-check. The functions shown here are just examples.
As usual, a parametrised test is no proof that the law holds. I provide the tests only as examples of what the laws looks like.
The Maybe sum type is a versatile and useful data structure that forms a monad. This enables you to compose disparate functions that each may err by failing to return a value.
Next: An Either monad.


Upload Form
UW Cartography Resource Search
Query
Author
Category
File Type
Created Before
Created After
Title
Journal
Publication Year
Sort By:
Alphabetical (title)
Most Recent
Search