Great collection of pyrocms addons that are useful on day to day development. The good news is; This all are free. It can be download fork and contribute anytime to my github repo.
Collection Includes:
Modules
- Calendar
- Cron
- FAQ
- Galleries
- Galleries - using streams
- Imagepicker
- mystream - Manage various streams and fields with simple GUI (different from pyrocms deafult stream module)
- News - using streams
- Newsletter
- Sliders - File folder as a slider
- Sliders - using streams and multiple widgets nivo slider as default
- Slider - Bootstrap slider
- Slider - Flex slider
- Testimonials
- Choice - Manage choice options from database.
Field Types
- Template
- Captcha
- Decimal
- File_folders
- Image crop
- Imagepicker / filepicker
- Markdown
- Multiple
- Page
- Pyronav
- Related
- Simple captcha
Plugins
- addthis
- excerpt
- social
- tiny
- uri
Widgets
- Image - Display image on website from files module directly
- Nivo slider - Nivoslider independent from module and dependent on Files module
- Flex Slider - Slider widget from Files module
- Child Pages - Display child pages as a widget in grid and accordion format
Themes
- Bootstrap theme


| int |
ADJ_SCOPE
Adjusted scope, either the element we are registering the event
on or the custom object passed in by the listener, int constant
|
| int |
EL
Element to bind, int constant
|
| int |
FN
Function to execute, int constant
|
| int |
SCOPE
Object passed in by the user that will be returned as a
parameter to the callback, int constant
|
| int |
TYPE
Type of event, int constant
|
| int |
WFN
Function wrapped for scope correction and cleanup, int constant
|
Class YAHOO.util.Event
Object | +--YAHOO.util.Event
class
YAHOO.util.Event
Field Summary [top]
Method Summary [top]
| boolean |
addListener
(<Object> el, <String> sType, <Function> fn, <Object> oScope, <boolean> bOverride)
Appends an event handler
|
| void |
clearCache
()
Clears the element cache
|
| int |
getCharCode
(<Event> ev)
Returns the charcode for an event
|
| Event |
getEvent
(e)
Finds the event in the window object, the caller's arguments, or
in the arguments of another method in the callstack.
|
| int |
getPageX
(<Event> ev)
Returns the event's pageX
|
| int |
getPageY
(<Event> ev)
Returns the event's pageY
|
| HTMLElement |
getRelatedTarget
(<Event> ev)
Returns the event's related target
|
| HTMLElement |
getTarget
(<Event> ev, <boolean> resolveTextNode)
Returns the event's target element
|
| Date |
getTime
(<Event> ev)
Returns the time of the event.
|
| void |
preventDefault
(<Event> ev)
Prevents the default behavior of the event
|
| boolean |
removeListener
(<Object> el, <String> sType, <Function> fn)
Removes an event handler
|
| void |
stopEvent
(<Event> ev)
Convenience method for stopPropagation + preventDefault
|
| void |
stopPropagation
(<Event> ev)
Stops event propagation
|
Field Detail [top]
ADJ_SCOPE
int
ADJ_SCOPE
Adjusted scope, either the element we are registering the event
on or the custom object passed in by the listener, int constant
EL
int
EL
Element to bind, int constant
FN
int
FN
Function to execute, int constant
SCOPE
int
SCOPE
Object passed in by the user that will be returned as a
parameter to the callback, int constant
TYPE
int
TYPE
Type of event, int constant
WFN
int
WFN
Function wrapped for scope correction and cleanup, int constant
Constructor Detail [top]
YAHOO.util.Event
YAHOO.util.Event
()
Method Detail [top]
addListener
boolean
addListener
(<Object> el, <String> sType, <Function> fn, <Object> oScope, <boolean> bOverride)
Appends an event handler
- Parameters:
-
el
- The html element to assign the event to -
sType
- The type of event to append -
fn
- The method the event invokes -
oScope
- An arbitrary object that will be passed as a parameter to the handler -
bOverride
- If true, the obj passed in becomes the execution scope of the listener
- Returns:
- True if the action was successful or defered, false if one or more of the elements could not have the event bound to it.
clearCache
void
clearCache
()
Clears the element cache
getCharCode
int
getCharCode
(<Event> ev)
Returns the charcode for an event
- Parameters:
-
ev
- the event
- Returns:
- the event's charCode
getEvent
Event
getEvent
(e)
Finds the event in the window object, the caller's arguments, or
in the arguments of another method in the callstack. This is
executed automatically for events registered through the event
manager, so the implementer should not normally need to execute
this function at all.
- Parameters:
-
the
- event parameter from the handler
- Returns:
- the event
getPageX
int
getPageX
(<Event> ev)
Returns the event's pageX
- Parameters:
-
ev
- the event
- Returns:
- the event's pageX
getPageY
int
getPageY
(<Event> ev)
Returns the event's pageY
- Parameters:
-
ev
- the event
- Returns:
- the event's pageY
getRelatedTarget
HTMLElement
getRelatedTarget
(<Event> ev)
Returns the event's related target
- Parameters:
-
ev
- the event
- Returns:
- the event's relatedTarget
getTarget
HTMLElement
getTarget
(<Event> ev, <boolean> resolveTextNode)
Returns the event's target element
- Parameters:
-
ev
- the event -
resolveTextNode
- when set to true the target's parent will be returned if the target is a text node
- Returns:
- the event's target
getTime
Date
getTime
(<Event> ev)
Returns the time of the event. If the time is not included, the
event is modified using the current time.
- Parameters:
-
ev
- the event
- Returns:
- the time of the event
preventDefault
void
preventDefault
(<Event> ev)
Prevents the default behavior of the event
- Parameters:
-
ev
- the event
removeListener
boolean
removeListener
(<Object> el, <String> sType, <Function> fn)
Removes an event handler
- Parameters:
-
el
- the html element or the id of the element to assign the event to. -
sType
- the type of event to remove -
fn
- the method the event invokes
- Returns:
- true if the unbind was successful, false otherwise
stopEvent
void
stopEvent
(<Event> ev)
Convenience method for stopPropagation + preventDefault
- Parameters:
-
ev
- the event
stopPropagation
void
stopPropagation
(<Event> ev)
Stops event propagation
- Parameters:
-
ev
- the event


News Manager Settings
Save
Sources
CNN
Washington Post
Reuters
Mashable
The Root
Gizmodo
Jezebel
New York Times
Seattle Times
LA Times
Denver Post
Chicago Times
Pro Football Talk
The Gothamist
ABC News
Guardian
PBS
NPR
BBC
Slashdot
The Economist
Slate
Techcrunch
Hacker News
Deadspin
Wired
ESPN
ProPublica
Time Magazine
The Wall-Street Journal
Add Source
Label
RSS Feed URL
Custom Sources
No custom sources have been added.


11 May 2013 - An investigation has been launched into a preliminary report of the detection of a wild poliovirus type 1 (WPV1) in the Banadir region of Somalia. This is the first WPV to be reported from Somalia since 25 March 2007. The virus was isolated from specimens collected on 21 April 2013 from a 32-month-old girl, who became ill due to acute flaccid paralysis on 18 April 2013, and from specimens collected from 3 of her close contacts.
An investigation team is on site; genetic sequencing of the virus is on-going to determine its origin. The preliminary results of these investigations will be reported as soon as possible.
Given that substantial areas of central and southern Somalia have not conducted vaccination activities since 2009, the confirmation of WPV circulation would constitute a serious national and international risk to public health.
A surveillance alert, highlighting the need for urgent active searches for additional cases of acute flaccid paralysis (AFP) and suspect polio in all health facilities, has been issued for all of Somalia and bordering areas of northern Kenya and eastern Ethiopia. All countries in the WHO Regions of Africa and the Eastern Mediterranean are advised to heighten their surveillance for poliovirus.
An immediate vaccination response with oral polio vaccine (OPV) is being planned to begin on May 14-16 to reach more than 350,000 children under the age of five in all the 16 districts of Banadir region, with a series of subsequent activities, including nationwide OPV campaigns, under discussion.
WHO’s International Travel and Health recommends that all travellers to and from polio-infected areas be fully vaccinated against polio.


Prodigy API Docs
Overview
The Prodigy API is an open API for getting info on Prodigy data.
All info is stored in an array.
Authentication
No Authentication is required.
Ratelimiting
You can make up to 500 requests an hour.
Status Codes
Note
When you specify an ID for an object, the ID starts at 0 in the URL.


My Weather
Enter city name:
Search
{{cityName}}
{{tempDay}} ̊
{{today | date : "HH:MM, dd MMMM, yyyy"}}
{{conditionDay}}
Today
48 Hours Forecast
Feels Like: {{feels}}
Wind: {{wind}} km/h
Humidity: {{humidity}}%
{{cityName}}


Distressed PMC depositors hold protest at RBI
by PTIDistressed depositors of scam-hit PMC Bank on Wednesday held a day-long protest outside the RBI office in New Delhi, demanding their “hard earned” money be returned at the earliest.
A delegation of the depositors met a senior official of the Reserve Bank of India, who assured them efforts were on to address their problem.
Delhi resident Rajinder Singh, who says to have a deposit of about Rs 20 lakh in the bank, said that authorities should give them a time frame for refund of his money.
Another depositor Jagpreet Singh, having three accounts in the bank, said that most of the affected people were senior citizens who had put in their life savings in the Punjab and Maharashtra Cooperative Bank.
The affected depositors raised slogans against the Reserve Bank, alleging that the central bank did not do its job. They also alleged political connections behind the scam.
Statutory inspection of PMC by the RBI revealed large group exposure toward Housing Development and Infrastructure Limited (HDIL) Group companies to the tune of approximately Rs 6,226.01 crore (inclusive of interest accrued in the related accounts).
Out of total exposure of Rs 6,226.01 crore as of end-March, 2019 to the HDIL group, only Rs 439.58 crore was disclosed to the RBI and remaining Rs 5,786.43 crore remained undisclosed.
As on September 23, 2019 (date of imposition of RBI directions), total depositors of the bank were 9,15,775. However, as on November 5, 2019, with withdrawal limit being increased to Rs 50,000, almost 78 per cent of the depositors will be able to withdraw entire amount deposited with PMC bank, thereby addressing depositors interest, Parliament was informed on Tuesday.
- Get Free Trial
- Hurry! Prices Increase Soon
Existing users, please Sign in here
Thank you for being a loyal user of Portfolio.
Portfolio will be a paid section hereon.
Please Subscribe to get access to one of our early bird packs. Or click on Free Trial to get 14 days free trial.
What You'll Get
-
Web + Mobile
Access exclusive content of the Hindu Businessline across desktops, tablet and mobile device.
-
Exclusive Portfolio and Investment Advice, Banking, Lifestyle and Specials
Get diverse set of perspectives from our trusted experts on Portfolio, Banking, Economy, Environment and others.
-
Ad free experience
Experience cleaner site with zero ads and faster load times.
-
Personalised dashboard
Customize your preference and get a personalized recommendation of stories based on your interest.
- Get Free Trial
- Hurry! Prices Increase Soon
Existing users, please Sign in here


|
Graphitti
A toolkit/software architecture to ease creating high-performance neural network simulators
|
Device functions for vertices. More...
Go to the source code of this file.
Functions | |
| __device__ void | preSpikingSynapsesSpikeHitDevice (const BGSIZE iEdg, AllSpikingSynapsesDeviceProperties *allEdgesDevice) |
| __device__ void | postSpikingSynapsesSpikeHitDevice (const BGSIZE iEdg, AllSpikingSynapsesDeviceProperties *allEdgesDevice) |
| __device__ void | postSTDPSynapseSpikeHitDevice (const BGSIZE iEdg, AllSTDPSynapsesDeviceProperties *allEdgesDevice) |
| __global__ void | advanceLIFNeuronsDevice (int totalVertices, int maxEdges, int maxSpikes, const BGFLOAT deltaT, uint64_t simulationStep, float *randNoise, AllIFNeuronsDeviceProperties *allVerticesDevice, AllSpikingSynapsesDeviceProperties *allEdgesDevice, EdgeIndexMap *edgeIndexMapDevice, bool fAllowBackPropagation) |
| __global__ void | advanceIZHNeuronsDevice (int totalVertices, int maxEdges, int maxSpikes, const BGFLOAT deltaT, uint64_t simulationStep, float *randNoise, AllIZHNeuronsDeviceProperties *allVerticesDevice, AllSpikingSynapsesDeviceProperties *allEdgesDevice, EdgeIndexMap *edgeIndexMapDevice, bool fAllowBackPropagation) |
| __global__ void advanceIZHNeuronsDevice | ( | int | totalVertices, |
| int | maxEdges, | ||
| int | maxSpikes, | ||
| const BGFLOAT | deltaT, | ||
| uint64_t | simulationStep, | ||
| float * | randNoise, | ||
| AllIZHNeuronsDeviceProperties * | allVerticesDevice, | ||
| AllSpikingSynapsesDeviceProperties * | allEdgesDevice, | ||
| EdgeIndexMap * | edgeIndexMapDevice, | ||
| bool | fAllowBackPropagation | ||
| ) |
CUDA code for advancing izhikevich neurons
| [in] | totalVertices | Number of vertices. |
| [in] | maxEdges | Maximum number of synapses per neuron. |
| [in] | maxSpikes | Maximum number of spikes per neuron per epoch. |
| [in] | deltaT | Inner simulation step duration. |
| [in] | simulationStep | The current simulation step. |
| [in] | randNoise | Pointer to device random noise array. |
| [in] | allVerticesDevice | Pointer to Neuron structures in device memory. |
| [in] | allEdgesDevice | Pointer to Synapse structures in device memory. |
| [in] | edgeIndexMap | Inverse map, which is a table indexed by an input neuron and maps to the synapses that provide input to that neuron. |
| [in] | fAllowBackPropagation | True if back propagaion is allowed. |
Definition at line 196 of file AllVerticesDeviceFuncs_d.cu.
| __global__ void advanceLIFNeuronsDevice | ( | int | totalVertices, |
| int | maxEdges, | ||
| int | maxSpikes, | ||
| const BGFLOAT | deltaT, | ||
| uint64_t | simulationStep, | ||
| float * | randNoise, | ||
| AllIFNeuronsDeviceProperties * | allVerticesDevice, | ||
| AllSpikingSynapsesDeviceProperties * | allEdgesDevice, | ||
| EdgeIndexMap * | edgeIndexMapDevice, | ||
| bool | fAllowBackPropagation | ||
| ) |
CUDA code for advancing LIF neurons
| [in] | totalVertices | Number of vertices. |
| [in] | maxEdges | Maximum number of synapses per neuron. |
| [in] | maxSpikes | Maximum number of spikes per neuron per epoch. |
| [in] | deltaT | Inner simulation step duration. |
| [in] | simulationStep | The current simulation step. |
| [in] | randNoise | Pointer to de/vice random noise array. |
| [in] | allVerticesDevice | Pointer to Neuron structures in device memory. |
| [in] | allEdgesDevice | Pointer to Synapse structures in device memory. |
| [in] | edgeIndexMap | Inverse map, which is a table indexed by an input neuron and maps to the synapses that provide input to that neuron. |
| [in] | fAllowBackPropagation | True if back propagaion is allowed. |
Definition at line 91 of file AllVerticesDeviceFuncs_d.cu.
| __device__ void postSpikingSynapsesSpikeHitDevice | ( | const BGSIZE | iEdg, |
| AllSpikingSynapsesDeviceProperties * | allEdgesDevice | ||
| ) |
Prepares Synapse for a spike hit (for back propagation).
| [in] | iEdg | Index of the Synapse to update. |
| [in] | allEdgesDevice | Pointer to AllSpikingSynapsesDeviceProperties structures on device memory. |
Definition at line 46 of file AllVerticesDeviceFuncs_d.cu.
| __device__ void postSTDPSynapseSpikeHitDevice | ( | const BGSIZE | iEdg, |
| AllSTDPSynapsesDeviceProperties * | allEdgesDevice | ||
| ) |
Prepares Synapse for a spike hit (for back propagation).
| [in] | iEdg | Index of the Synapse to update. |
| [in] | allEdgesDevice | Pointer to AllSTDPSynapsesDeviceProperties structures on device memory. |
Definition at line 54 of file AllVerticesDeviceFuncs_d.cu.
| __device__ void preSpikingSynapsesSpikeHitDevice | ( | const BGSIZE | iEdg, |
| AllSpikingSynapsesDeviceProperties * | allEdgesDevice | ||
| ) |
Prepares Synapse for a spike hit.
| [in] | iEdg | Index of the Synapse to update. |
| [in] | allEdgesDevice | Pointer to AllSpikingSynapsesDeviceProperties structures on device memory. |
Definition at line 22 of file AllVerticesDeviceFuncs_d.cu.


NCS Student Guide Profile
Roll Number
First name
First Name is Required.
Enter correct First Name.
Last Name
Last Name is Required.
Enter correct Last Name.
Gender:
Male
Female
Age
Age is Required.
Only Above 13 years Old are allowed.
Sorry {{userForm.age.$viewValue}} years old are not Allowed.
Email
Email Address is Required.
Enter Correct Email Address.
Enter Correct Email Address.
Batch
Batch is Required.
Mobile Number
Mobile Number is Required.
Enter Correct Mobile Number.
Enter Correct Mobile Number.
Branch
Branch is Required.
New Password
Password is Required.
Password should contain at least one number, one lowercase and one uppercase character.
Password should be greater than 8 letters.
Password Can't be more than 100 letters.
Confirm Password
Confirm Password is Required.
Password Doesn't Match.
Submit


Features
- No images. The windows, including their controls, gradients and shadows, are drawn with the canvas tag.
- Windows can be focused, dragged, resized, maximized, minimized, restored and closed.
- Adjustable rounded corner radius.
- Dynamically create new windows on demand.
- Create modal dialog windows
- Optional "desktop" toolbars
- Minimal HTML markup required.
- Tested in Firefox 2, Internet Explorer 6 & 7, Safari 2, and Opera 9.
- Validates as XHTML 1.0 Strict if you use no target attributes in your anchors and validates as XHTML 1.0 Transitional if you do.
- Gracefully degrades without javascript.
Bugs
- Scrollbars show through GUI in Firefox on the Mac. This is a known bug.
- In Opera 9, though the scrollbars in windows do not show through windows with a higher z-index, you can grab and scroll a scrollbar in a window that is behind another window with a higher z-index.
- Also see the tickets on Google Code.
Change Log
v0.5 - 11/17/2007
v0.6 - 11/26/2007
- Fixed the IE6 select issue
- Added a couple more class options
- Minor code optimizations
v0.7 - 12/03/2007
- Added minimize functionality (Scott F. Frederick)
- Added mouseover "title" to close, maximize, and minimize buttons (Scott F. Frederick)
- Added onmouseover "title" to minimized window buttons displaying full header title (Scott F. Frederick)
- The close, maximize, and minimize buttons are now individually optional
- Added the MochaWindow and MochaWindowForm classes
- Added several options for setting the properties and style of new windows
- Added additional ajax and iframe support
- Reconfigured how the core class is loaded so it is easier to access the class methods
- Added optional toolbars to the "desktop"
- Added modal dialog windows
- Code optimizations
Coming in the Next Update to v0.7
- Iframes now resize when you resize a window
- Fixed it so that if the desktop toolbars are removed the rest of the code still works
- Removed the inline javascript from the example html
- Added optional autohide to the dock (Scott F. Frederick)
- Added the following options to new windows: onContentLoaded, onClose, onMinimize, onMaximize, onFocus, and onResize
- Pulled the slider function out of the core class


Select notes by clicking the circles. Selecting nothing selects everything.
Use the buttons on the right to find new notes that are similar to or different from your selection, or to delete your selection. Click on a note to see it's source document.


The night sky is beautiful with its many starts that shine so bright
Click more for information on stars


FreshBasket
Conceptual App Design
Fresh basket is a conceptual app that was designed in conjunction with Malak Alwawi, Cinqu’a Jackson, and Elizabeth Bissinger.
To learn more please hover over the tile. Press view to be redirected to FreshBaskets webiste.


--- layout: post title: vegan chocolate pumpkin swirl muffins date: 2010-11-05 23:42:53.000000000 -04:00 type: post published: true status: publish categories: - breakfast & brunch - muffins - vegan - vegetarian tags: - chocolate - muffin - pumpkin - vegan meta: jabber_published: '1289014974' _wp_old_slug: '' email_notification: '1289014975' _oembed_3c43f84e1da5a19e3ec6a6861f9a096b: author: login: sophie email<EMAIL_ADDRESS>display_name: Pika first_name: '' last_name: '' ---
No words, all action.


Recent Price Increase
0;else other_content">
{{ increase.id }} | {{ increase.order_id }} | {{ increase.increase_reason_id }} |
{{ increase.date_entered | date: 'MMM d, y' }} | {{ increase.note }}
Currently, there are no recent price increase cases in the database.


Junit testing...
All of these answers are correct
- Has a setUp method useful for initializing variables
- Should be used throughout development
- Uses assert statements instead of print statements
- Provides ability to test specific methods
There are no hints for this question


commits#show chokes on mode-changing diffs
Closing Command-T window with Ctrl-W q leaves the cursor invisible and breaks Command-T.
Search through file names
Add ignore capability to config
Commit timestamps (eg. in repo#show) seem to be off by about 6 hours
Think about allowing non-unique product references in repo model
Don't barf when hitting repos#show for an empty repo (ie a repo with no commits yet)
Update to Wikitext 2.1.1
Allow links with query strings in internal link syntax (ie. [/hello?there=true link])
Command-T eats up buffer numbers each time the match window is shown


The 7.1-r1 release is based on the latest Android Nougat-MR2 release (7.1.2_r36). We have fixed most issues found in the since 7.1-rc2 and added more features:
This release contains four files. You can choose one of these files depends on your devices.
sha1sum: bbefcdab4167bfa83f7dd6011af072f2b6a00294
sha1sum: f9bbcd09f83e83baa71fe228fe2c2d3e77b1c55a
sha1sum: a9caf47021883bbd439797ef54b828a36b738952
sha1sum: 99b9ca1e0b7a35eabf948858be8b8d2b8366614c
To use an ISO file, Linux users could just dump it into a usb drive to create a bootable usb stick like :
dd if=android-x86-7.1-r1.iso of=/dev/sdX
where /dev/sdX is the device name of your usb drive.
Windows's users can use the tool Win32 Disk Imager to create a bootable usb stick.
Please read this page about how to install it to the device.
In doubt, try the 32-bit files for legacy BIOS devices and 64-bit files for UEFI devices. Please read this page about how to install it to the device.
Except the traditional ISO files, we also package android-x86 files into a Linux package rpm. It allows Linux users to easily install the release into an existing Linux device with a standalone ext4 root partition. On an rpm based device (Fedora/Red Hat/CentOS/SUSE...), just install it like a normal rpm package:sudo rpm -Uvh android-x86-7.1-r1.x86_64.rpm
This will update your older installation like 6.0-r3 or 7.1-rc2 if you have.
On a deb based device (Debian/Ubuntu/LinuxMint/...), please use the alien tool to install it:
sudo apt install alien
sudo alien -ci android-x86-7.1-r1.x86_64.rpm
All files will be installed to the /android-7.1-r1/ subdirectory and boot entries will be added to grub2 menu. Reboot and choose android-x86 item from the menu to boot Android-x86. Alternatively, you can launch Android-x86 in a QEMU virtual machine by the installed qemu-android script:
sudo qemu-android
Note Android-x86 running in QEMU and the real machine (after rebooting) share the same data sub-folder.
To uninstall it :sudo rpm -e android-x86
sudo apt-get remove android-x86
repo init -u git://git.osdn.net/gitroot/android-x86/manifest -b android-x86-7.1-r1
repo sync --no-tags --no-clone-bundle
Read this page for how to compile source code.


#include <hwlib-hd44780.hpp>
Public Member Functions | |
| hd44780 (pin_out &rs, pin_out &e, port_out &data, xy size) | |
| void | command (unsigned char cmd) |
| void | data (unsigned char chr) |
| void | clear () override |
| Public Member Functions inherited from hwlib::terminal | |
| terminal (xy size) | |
| construct a terminal from its size in characters in x and y direction | |
| virtual void | cursor_set (xy target) |
| put the cursor (write location) at x, y | |
| void | putc (char c) |
| write a single character | |
| Public Member Functions inherited from hwlib::ostream | |
| ostream & | operator<< (char c) |
| char output operator | |
| uint_fast16_t | width (void) const |
| return the current field width | |
| uint_fast16_t | width (uint_fast16_t x) |
| set the field width, return the old field width | |
| uint_fast16_t | base (void) const |
| return the numerical radix | |
| uint_fast16_t | base (uint_fast16_t x) |
| set the numerical radix, return the old numerical radix | |
| bool | showpos (void) const |
| return the current showpos setting | |
| bool | showpos (bool x) |
| set the showpos setting, return the old showpos setting | |
| bool | showbase (void) const |
| return the current showbase setting e | |
| bool | showbase (bool x) |
| set the showbase setting, return the old showbase setting | |
| bool | boolalpha (void) const |
| return the current boolalpha setting | |
| bool | boolalpha (bool x) |
| set the noboolalpha setting, return the old noboolalpha setting | |
| char | fill (void) const |
| return the current fill char setting | |
| char | fill (char x) |
| set the fill char setting, return the old fill char setting | |
| Public Member Functions inherited from hwlib::noncopyable | |
| noncopyable (const noncopyable &)=delete | |
| noncopyable & | operator= (const noncopyable &)=delete |
Additional Inherited Members | |
| Public Attributes inherited from hwlib::terminal | |
| const xy | size |
| the size of the terminal in characters in x and y direction | |
| xy | cursor |
| Protected Member Functions inherited from hwlib::terminal | |
| virtual void | flush () |
| The default implementation of flush does nothing. | |
hd44780 character LCD interface
This class implements an interface to an hd44780 character LCD.
The hd44780 is the standard chip for interfacing small dot-character LCD interfaces. It can display the ASCII table characters, 8 characters (0..7) that can be user-defined as 5x7 pixels, and a an upper 128 characters (128...255) that vary with the chip variant, often Japanese characters.
The chip and its digital pins run at 5V. The contrast input can in most cases be connected to 0V (ground), but better is to use a 10k potentiometer between 0V and 5V. Some displays (mostly extended-temperature-range types) need the lower size of this potentiometer tied to a negative voltage, for instance -5V.
The digital interface to the chip has 8 data lines, but the chip can be configured to use only 4. This adds some complexity to the driver software and slows it down a little, but the saving of 4 micro-controller more than compensates for this, hence nearly all software (including this driver) for is for the 4-bit interface. Note for the 4-bit interface the 4 highest data pins (D4..D7) are used. The lower 4 can be left unconnected.
The chip has some locations that can be writen and also read back, but this offers little advantage, so most software (including this driver) only writes to the chip, thus saving another pin. Hence 6 pins (+ ground and 5V) are needed to interface to an hd44780 display: 4 data lines, the R/S line (selects between command and data), and the E line (a strobe for the command).
(Some larger displays use not one but two hd44780 chips. This interface is not compatible with such LCDs.)
Most hd44780 LCDs have a single row of connections, with the following pinout:
But as always, check the datasheet (in this case of the LCD) to be sure!
The hd44780 implements the ostream interface, but it doesn't scroll: while the cursor is outside the visible characters (beyond the end of the line, or beyond the number of lines) any character writes will be ignored. Some characters are treated special:
The best way to get a flicker-free display is to overwite instead of clear-and-then-write: use '\c' to got to the 'origin', then rewrite the whole display, using '\n' to go to a next line (because it clears the remainder of the line).
references:
|
inlineoverridevirtual |
clear the terminal
This function clears the terminal and puts the cursor at (0,0). The default implementation does this by writing spaces to all locations. A concrete implementation might provide a better (faster) way.
Reimplemented from hwlib::terminal.
|
inline |
write a command byte to the LCD
Use this function only for features that are not provided by the console interface, like the definition of the user-defined characters.
|
inline |
write a data byte to the LCD
Use this function only for features that are not provided by the console interface, like the definition of the user-defined characters.


Test Project and Testdata Directories
The test fixture creates a test project environment. Unless you customize the project creation, the test project will have one module with one source root called src
. The files for the test project exist either in a temporary directory or in an in-memory file system, depending on which implementation of TempDirTestFixture
is used.
LightPlatformCodeInsightFixtureTestCase
uses an in-memory implementation; if you set up the test environment by calling IdeaTestFixtureFactory.createCodeInsightFixture
, you can specify the implementation to use.
In your plugin, you normally store the test data for your tests (such as files on which plugin features will be executed and expected output files) in the testdata
directory. This is just a directory under the content root of your plugin, but not under a source root. Files in testdata
are normally not valid source code and must not be compiled.
To specify the location of testdata
, you must override the LightPlatformCodeInsightFixtureTestCase.getTestDataPath()
method. The default implementation assumes running as part of the IntelliJ Platform source tree and is not appropriate for third-party plugins.
To copy files or directories from your testdata
directory to the test project directory, you can use the copyFileToProject()
and copyDirectoryToProject()
methods in the CodeInsightTestFixture
class.
Most operations in plugin tests require a file open in the in-memory editor, in which highlighting, completion and other operations will be performed. The in-memory editor instance is returned by CodeInsightTestFixture.getEditor()
. To copy a file from the testdata
directory to the test project directory and immediately open it in the editor, you can use the CodeInsightTestFixture.configureByFile()
or configureByFiles()
methods. The latter copies multiple files to the test project directory and opens the first of them in the in-memory editor.
Alternatively, you can use one of the other methods which take parameters annotated with @TestDataFile
. These methods copy the specified files from the testdata
directory to the test project directory, open the first of the specified files in the in-memory editor, and then perform the requested operation such as highlighting or code completion.
When a file is opened in the in-memory editor, special markup in the file content can be used to specify the caret position or selection. You can use one of the following markers:
<caret>
specifies the position where the caret should be placed.<selection>
and</selection>
specify the start and end of the text range to be selected.<block>
and</block>
specify the start and end points of the column selection.


Bundles are binary compressed archives that contain a series of commits. This format can be easily transmitted via email or USB stick.
Create a bundle from a range of commit treeish
git bundle create catchup.bundle HEAD~8..HEAD
Create a bundle from a range of time
git bundle create catchup.bundle --since=10.days master
Create a bundle from an entire branch
git bundle create catchup.bundle master
Show contents of a bundle
git ls-remote catchup.bundle
Or just the HEADs
git bundle list-heads catchup.bundle
git bundle verify catchup.bundle
Pull in the blobs from a bundle as if they were a remote, but don't merge them. We'll retrieve them to a new local branch that represents the bundle.
git fetch catchup.bundle master:catchupmaster
Or start a new repo named temprepo
via clone
with the contents of the bundle put into the master
branch
git clone catchup.bundle -b master temprepo
git merge catchupmaster master
Build an email that contains the patch
git email-patch
or to generate a patch file for every file on the current branch that differs from the master branch
git format-patch master
or reroute it all to a unified file
git format-patch master --stdout > myfix.patch
To view the contents of the patch before applying it
git apply --stat myfix.patch
Test the patch application for conflicts
git apply --check myfix.patch
git apply myfix.patch
or using apply-mailbox to apply a series of patches
git am -3 myfix.patch
and if any conflicts are encountered, to continue the process
git am --resolved
or to sign off on the patch using your credentials
git am --signoff


Brief Profile
Tom Luong is a problem solver, currently working for Proofpoint, a
leading cybersecurity company from Sunnyvale, California.
Prior to Proofpoint, he held senior engineering positions in Technology, Financial, Education and Media
companies.
Read more
With more than 13 years of technology industry experience, he can unlock your company potential and advance
your business. Email him to discuss potential work. When he is not
writing
software, he
relaxes.
Tom received his honour bachelor's degree from McMaster University, where he studied computer science and
mathematics. He resides in Toronto with his wife, children and their dog.
Work Experience
2020 Now
Senior Software Engineer
Proofpoint
About Proofpoint
Proofpoint, Inc. is a leading cybersecurity company that protects
organizations’ greatest assets and biggest risks: their people. With
an integrated suite of cloud-based solutions, Proofpoint helps
customers around the world stop targeted threats, safeguard their
data, and make their users more resilient against cyber attacks.
HANDS-ON
- AD Synchronization
- Azure AD Enterprise Identity Service
- Production Support
PROJECTS
- Log Retention: Compression and Upload
- Chrome Extension for Jenkins
- QA Automation
TECHNOLOGIES
- C++ Java C# SQL
- Powershell Bash
2018 2020
Lead Software Engineer
Cox Automotive Canada
About Cox Automotive Canada
Cox Automotive Canada is an organization that tranforms the way the world buys, sells, owns and uses cars
through industry-leading Inventory and Digital Retailing solutions.
-
Delivered online custom automobile lending solutions to most
Canadian banks
-
Ensured proper and trouble-free production deployment with pre and
post-production planning
-
Led a team of professionals to achieve milestones on product
roadmap
HANDS-ON
- Microservices Architecture
- Secure File Transfer
- Team and Project Management
PROJECTS
- Message with Attachment
- Custom Auto-approved Deals
- Fraud Detection
TECHNOLOGIES
- C# .NET Core SQL
- Angular React CSS
- OracleDB NServiceBus RabbitMQ
2016 2018
Senior Software Engineer
Q4
About Q4
Q4 helps clients achieve their IR goals and build trust and confidence in the capital markets, giving them a
competitive advantage as they compete for capital. They offer a full stack of solutions and services public
companies need to solve their most pressing challenges.
-
Signed big tech clients by enhancing app security, audited by
independent third party
-
Increased company profit by saving operating cost, boosting app
performance during peak times
-
Cut vendor costs and reduced their dependency by more affordable
flexible in-house solutions
-
Interviewed, reviewed and on-boarded new hires for the team and
other teams
HANDS-ON
- CMS for Investor Relations
- Compliance Security
- Cloud Computing and Caching
PROJECTS
- Custom website builder
- AWS ETL Solution
- UI Overhaul
TECHNOLOGIES
- C# .NET MVC AWS Lambda
- Angular HTML CSS
- MSSQL NServicebus nginx
2014 2016
Senior Software Engineer
Yangaroo
About Yangaroo
Yangaroo develops secure digital distribution platforms that would deliver music and videos to broadcasters
and other global media outlets. They streamline awards programs to reduce time
for event organizers, judges, and auditors; custom submission criteria and voting/judging rules across
multiple rounds; enable online access to media anywhere and anytime.
HANDS-ON
- Onion Architecture
- Data Submission
- Secure Online Payment
PROJECTS
- Submission Rule Validator
- Video and Audio Streaming
- UI Localization
TECHNOLOGIES
- C# .NET MVC
- AngularJS HTML CSS
- MSSQL Dapper
2009 2013
Software Engineer
Pearson
Built a web-based multilingual School System for school boards to
manage teachers and students including smart class scheduling,
attendance tracking and multilingual report printing
HANDS-ON
- Custom UI Components
- Data Collection
- Data Reporting
PROJECTS
- Full Product Migration to .NET
- English and Arabic Reports
- Smart Course Scheduling
TECHNOLOGIES
- C# .NET WebForms
- HTML CSS JavaScript jQuery
- MSSQL JasperReport
Previous Projects
Deliver confidential information from consumer's browser to bank's
backend systems
- Data encrypted at rest and in transit
-
Customizable upload service to meet various backend needs
Show correct documents to users based on regulation rules at
run-time
- Allowed banks to change logic quickly and efficiently
- Increased product quality yet reduced support resources
Process thousands of press release XML files daily
-
Delivered a new AWS solution using lambda and PostgreDB just
in weeks
- Completely scalable with minimum operation expenses


| Interface | Description |
|---|---|
| Address.Complete |
Check both basic constraints and high level ones.
|
| Address.HighLevelCoherence |
Check coherence on the overall object
Needs basic checking to be green first
|
| Book.All | |
| First |
Description:
|
| Last |
Description:
|
| Person | |
| Second |
Description:
|
| ZipCodeCityCarrier |
Description:
|
| Class | Description |
|---|---|
| AccessTestBusinessObject |
Description:
|
| AccessTestBusinessObjectSub |
Description:
|
| Address | |
| Author | |
| Book | |
| BusinessAddress |
Description:
|
| CompanyAddress |
Description:
|
| Continent |
A continent has a name and a set of
Country s. |
| Country | |
| Customer | |
| Employee |
Description:
|
| Engine | |
| FrenchAddress |
Description:
|
| IllustratedBook |
Add a non-cascaded bean to a book.
|
| Library |
Description:
|
| MaxTestEntity |
Description:
|
| NoValidatorTestEntity |
Description:
|
| PreferredGuest | |
| RecursiveFoo |
Description:
|
| SizeTestEntity |
Description:
|
| XmlEntitySampleBean |
Description: bean used to test constraints described in XML
|
Copyright © 2010–2020 The Apache Software Foundation. All rights reserved.


cf.CellMeasure¶
-
class
cf.
CellMeasure
(measure=None, properties=None, data=None, source=None, copy=True, _use_data=True)[source]¶ Bases:
cf.mixin.propertiesdata.PropertiesData
,cfdm.cellmeasure.CellMeasure
A cell measure construct of the CF data model.
A cell measure construct provides information that is needed about the size or shape of the cells and that depends on a subset of the domain axis constructs. Cell measure constructs have to be used when the size or shape of the cells cannot be deduced from the dimension or auxiliary coordinate constructs without special knowledge that a generic application cannot be expected to have.
The cell measure construct consists of a numeric array of the metric data which spans a subset of the domain axis constructs, and properties to describe the data. The cell measure construct specifies a “measure” to indicate which metric of the space it supplies, e.g. cell horizontal areas, and must have a units property consistent with the measure, e.g. square metres. It is assumed that the metric does not depend on axes of the domain which are not spanned by the array, along which the values are implicitly propagated. CF-netCDF cell measure variables correspond to cell measure constructs.
NetCDF interface
The netCDF variable name of the construct may be accessed with the
nc_set_variable
,nc_get_variable
,nc_del_variable
andnc_has_variable
methods.Initialisation
- Parameters
- measure:
str
, optional Set the measure that indicates which metric given by the data array. Ignored if the source parameter is set.
The measure may also be set after initialisation with the
set_measure
method.- Parameter example:
measure='area'
- properties:
dict
, optional Set descriptive properties. The dictionary keys are property names, with corresponding values. Ignored if the source parameter is set.
Properties may also be set after initialisation with the
set_properties
andset_property
methods.- Parameter example:
properties={'standard_name': 'cell_area'}
- data:
Data
, optional Set the data array. Ignored if the source parameter is set.
The data array may also be set after initialisation with the
set_data
method.- source: optional
Initialize the measure, properties and data from those of source.
- copy:
bool
, optional If False then do not deep copy input parameters prior to initialization. By default arguments are deep copied.
- measure:
Inspection¶
Methods
A full description of the cell measure construct. |
|
Return the canonical identity. |
|
Return all possible identities. |
Attributes
Return a description of the construct type. |
|
A canonical identity. |
Measure¶
Methods
Remove the measure. |
|
Return the measure. |
|
Whether the measure has been set. |
|
Set the measure. |
Attributes
TODO |
Selection¶
Methods
Whether or not the construct identity satisfies conditions. |
|
Whether or not the data has a given dimensionality. |
|
Whether or not the netCDF variable name satisfies conditions. |
|
Whether or not properties satisfy conditions. |
|
Whether or not the construct has given units. |
Properties¶
Methods
Remove a property. |
|
Get a CF property. |
|
Whether a property has been set. |
|
Set a property. |
|
Return all properties. |
|
Remove all properties. |
|
Set properties. |
Attributes
The add_offset CF property. |
|
The calendar CF property. |
|
The comment CF property. |
|
The _FillValue CF property. |
|
The history CF property. |
|
The leap_month CF property. |
|
The leap_year CF property. |
|
The long_name CF property. |
|
The missing_value CF property. |
|
The month_lengths CF property. |
|
The scale_factor CF property. |
|
The standard_name CF property. |
|
The units CF property. |
|
The valid_max CF property. |
|
The valid_min CF property. |
|
The valid_range CF property. |
Units¶
Methods
Override the units. |
|
Override the calendar of date-time units. |
Attributes
The |
Data¶
Attributes
A numpy array deep copy of the data array. |
|
The |
|
An independent numpy array of date-time objects. |
|
Return an element of the data array as a standard Python scalar. |
|
The |
|
True if the data array is scalar. |
|
The number of dimensions in the data array. |
|
A tuple of the data array’s dimension sizes. |
|
The number of elements in the data array. |
|
A numpy array view of the data array. |
Methods
Return a subspace defined by indices |
|
Remove the data. |
|
Return the data. |
|
Whether a data has been set. |
|
Set the data. |
Rearranging elements
Flatten axes of the data |
|
Flip (reverse the direction of) data dimensions. |
|
Expand the shape of the data array. |
|
Roll the data along an axis. |
|
Remove size one axes from the data array. |
|
Interchange two axes of an array. |
|
Permute the axes of the data array. |
Data array mask
Apply masking as defined by the CF conventions. |
|
Count the non-masked elements of the data. |
|
Count the masked elements of the data. |
|
Return the data array missing data value. |
A binary (0 and 1) missing data mask of the data array. |
|
Whether the mask is hard (True) or soft (False). |
|
The mask of the data array. |
|
Mask the array where invalid values occur. |
Changing data values
Called to implement assignment to x[indices] |
|
Mask the array where invalid values occur. |
|
Return a new variable whose data is subspaced. |
|
Set data array elements depending on a condition. |
Miscellaneous
Partition the data array. |
|
Close all files referenced by the construct. |
|
Convert reference time data values to have new units. |
|
Return the commands that would create the cell measure construct. |
|
Set the cyclicity of an axis. |
|
Return or set the period of the data. |
|
Return the name of the file or files containing the data. |
|
Whether or not there are cell bounds. |
Miscellaneous¶
Methods
Join a sequence of variables together. |
|
Return a deep copy. |
|
Whether two instances are the same. |
|
Uncompress the construct. |
Attributes
|
|
Always False. |
|
Always False. |
|
Always False. |
|
A canonical identity. |
Mathematical operations¶
Methods
Trigonometrical and hyperbolic functions
Take the trigonometric inverse cosine of the data element-wise. |
|
Take the inverse hyperbolic cosine of the data element-wise. |
|
Take the trigonometric inverse sine of the data element-wise. |
|
Take the inverse hyperbolic sine of the data element-wise. |
|
Take the trigonometric inverse tangent of the data element-wise. |
|
Take the inverse hyperbolic tangent of the data element-wise. |
|
Take the trigonometric cosine of the data element-wise. |
|
Take the hyperbolic cosine of the data element-wise. |
|
Take the trigonometric sine of the data element-wise. |
|
Take the hyperbolic sine of the data element-wise. |
|
Take the trigonometric tangent of the data element-wise. |
|
Take the hyperbolic tangent of the data array. |
Rounding and truncation
The ceiling of the data, element-wise. |
|
Limit the values in the data. |
|
Floor the data array, element-wise. |
|
Round the data to the nearest integer, element-wise. |
|
Round the data to the given number of decimals. |
|
Truncate the data, element-wise. |
Statistical collapses
Alias for |
|
The unweighted mean the data array. |
|
The unweighted average of the maximum and minimum of the data array. |
|
Alias for |
|
The absolute difference between the maximum and minimum of the data array. |
|
The number of non-missing data elements in the data array. |
|
The sum of the data array. |
|
The unweighted sample standard deviation of the data array. |
|
The unweighted sample variance of the data array. |
Exponential and logarithmic functions
The exponential of the data, element-wise. |
|
The logarithm of the data array. |
Date-time operations¶
Attributes
The day of each date-time data array element. |
|
An independent numpy array of date-time objects. |
|
The hour of each date-time data array element. |
|
The minute of each date-time data array element. |
|
The month of each date-time data array element. |
|
The reference date-time of units of elapsed time. |
|
The second of each date-time data array element. |
|
The year of each date-time data array element. |
Logic functions¶
Truth value testing
Test whether all data elements evaluate to True. |
|
Test whether any data elements evaluate to True. |
Comparison
Test whether all data are element-wise equal to other, broadcastable data. |
|
Whether two instances are the same. |
|
True if two constructs are equal, False otherwise. |
Set operations
The unique elements of the data. |
NetCDF¶
Methods
Remove the netCDF variable name. |
|
Return the netCDF variable name. |
|
Whether the netCDF variable name has been set. |
|
Set the netCDF variable name. |
|
Whether the construct corresponds to an external netCDF variable. |
|
Set external status of a netCDF variable. |
Arithmetic and comparison operations¶
Arithmetic, bitwise and comparison operations are defined as element-wise operations on the data, which yield a new construct or, for augmented assignments, modify the construct’s data in-place.
Comparison operators
The rich comparison operator |
|
The rich comparison operator |
|
The rich comparison operator |
|
The rich comparison operator |
|
The rich comparison operator |
|
The rich comparison operator |
Binary arithmetic operators
The binary arithmetic operation |
|
The binary arithmetic operation |
|
The binary arithmetic operation |
|
The binary arithmetic operation |
|
The binary arithmetic operation |
|
The binary arithmetic operation |
|
The binary arithmetic operations |
|
The binary arithmetic operation |
Binary arithmetic operators with reflected (swapped) operands
The binary arithmetic operation |
|
The binary arithmetic operation |
|
The binary arithmetic operation |
|
The binary arithmetic operation |
|
The binary arithmetic operation |
|
The binary arithmetic operation |
|
The binary arithmetic operations |
|
The binary arithmetic operation |
Augmented arithmetic assignments
The augmented arithmetic assignment |
|
The augmented arithmetic assignment |
|
The augmented arithmetic assignment |
|
The augmented arithmetic assignment |
|
The augmented arithmetic assignment |
|
The augmented arithmetic assignment |
|
The augmented arithmetic assignment |
|
The binary arithmetic operation |
Unary arithmetic operators
The unary arithmetic operation |
|
The unary arithmetic operation |
|
The unary arithmetic operation |
Binary bitwise operators
The binary bitwise operation |
|
The binary bitwise operation |
|
The binary bitwise operation |
|
The binary bitwise operation |
|
The binary bitwise operation |
Binary bitwise operators with reflected (swapped) operands
The binary bitwise operation |
|
The binary bitwise operation |
|
The binary bitwise operation |
|
The binary bitwise operation |
|
The binary bitwise operation |
Augmented bitwise assignments
The augmented bitwise assignment |
|
The augmented bitwise assignment |
|
The augmented bitwise assignment |
|
The augmented bitwise assignment |
|
The augmented bitwise assignment |
Unary bitwise operators
The unary bitwise operation |
Groups¶
Methods
Return the netCDF variable group hierarchy. |
|
Remove the netCDF variable group hierarchy. |
|
Set the netCDF variable group hierarchy. |
Special¶
Methods
Called to implement membership test operators. |
|
Called by the |
|
Return a subspace defined by indices |
|
Called by the |
|
Called to implement assignment to x[indices] |
|
Called by the |
|
Returns a numpy array representation of the data. |
|
Returns a new reference to the data. |
|
TODO |
|
TODO |
|
TODO 1 |


JavaScript is disabled on your browser.
Skip navigation links
Overview
Package
Class
Tree
Deprecated
Index
Help
Prev Letter
Next Letter
Frames
No Frames
All Classes
A
B
C
D
E
F
G
H
I
K
L
M
N
O
P
R
S
T
U
V
W
O
OccupantTest
- Class in
nl.tudelft.jpacman.board
Test suite to confirm that
Unit
s correctly (de)occupy squares.
OccupantTest()
- Constructor for class nl.tudelft.jpacman.board.
OccupantTest
occupy(Square)
- Method in class nl.tudelft.jpacman.board.
Unit
Occupies the target square iff this unit is allowed to as decided by
Square.isAccessibleTo()
.
offerAchievements(IdentifiedPlayer)
- Static method in enum nl.tudelft.jpacman.game.
Achievement
Offers the player achievements (at most MAX_RECOMMENDATIONS) to accomplish given that he has accomplished some other achievements.
onCollision(Class<C1>, Class<C2>, CollisionInteractionMap.CollisionHandler<C1, C2>)
- Method in class nl.tudelft.jpacman.level.
CollisionInteractionMap
Adds a two-way collision interaction to this collection, i.e.
onCollision(Class<C1>, Class<C2>, boolean, CollisionInteractionMap.CollisionHandler<C1, C2>)
- Method in class nl.tudelft.jpacman.level.
CollisionInteractionMap
Adds a collision interaction to this collection.
onPlayerLoseLife(IdentifiedPlayer)
- Method in class nl.tudelft.jpacman.level.
Level
Called when a player that has registered this Level loses one life.
otherStrategyAITest1()
- Method in class nl.tudelft.jpacman.strategy.
ChosenStrategyTest
Other strategy test (for a new implementation of strategy).
A
B
C
D
E
F
G
H
I
K
L
M
N
O
P
R
S
T
U
V
W
Skip navigation links
Overview
Package
Class
Tree
Deprecated
Index
Help
Prev Letter
Next Letter
Frames
No Frames
All Classes


@start_at=10
This is a basic counter done with JS which is included via a separate file but in-lined on the output HTML.


|
Stone Mason
0.0.0
(A really bad) C++ Game Engine (that you should NOT use)
|
#include <string>
#include <random>
#include "openssl/ssl.h"
Go to the source code of this file.
Data Structures | |
| struct | stms::UUID |
| class | stms::_stms_STMSInitializer |
Namespaces | |
| stms | |
| Namespace containing everything StoneMason has to offer! (https://github.com/RotartsiORG/StoneMason) | |
Macros | |
| #define | __STONEMASON_UTIL_HPP |
| #define | __STMS_UNSET_FUNC(numBits) inline uint##numBits##_t resetBit##numBits(uint##numBits##_t in, uint8_t bit) { return in & (UINT##numBits##_MAX ^ (1u << bit)); } |
Enumerations | |
| enum | stms::UUIDType { stms::eUninitialized, stms::eUuid4 } |
Functions | |
| std::default_random_engine & | stms::stmsRand () |
| std::string | stms::toHex (unsigned long long in, uint8_t places=0) |
| UUID | stms::genUUID4 () |
| int | stms::intRand (int min, int max) |
| float | stms::floatRand (float min, float max) |
| void | stms::initAll () |
| bool | stms::getBit (uint64_t in, uint8_t bit) |
| uint8_t | stms::resetBit8 (uint8_t in, uint8_t bit) |
| uint16_t | stms::resetBit16 (uint16_t in, uint8_t bit) |
| uint32_t | stms::resetBit32 (uint32_t in, uint8_t bit) |
| uint64_t | stms::resetBit64 (uint64_t in, uint8_t bit) |
| uint64_t | stms::setBit (uint64_t in, uint8_t bit) |
Variables | |
| constexpr char | stms::hexChars [] = "0123456789abcdef" |
| int(* | stms::sslRand )(unsigned char *, int) |
| _stms_STMSInitializer | stms::stmsInitializer |
| #define __STMS_UNSET_FUNC | ( | numBits | ) | inline uint##numBits##_t resetBit##numBits(uint##numBits##_t in, uint8_t bit) { return in & (UINT##numBits##_MAX ^ (1u << bit)); } |
| #define __STONEMASON_UTIL_HPP |


THE ALBATROSS
by Augustus Earle & Marigold Chew
Being a fine morning, I determined to ascend the mountain. I wore a rather gauche hat. As several parties had before gone up, they had formed a kind of path: at least we endeavoured to trace the same way; but it requires a great deal of nerve to attempt it. Luckily I had swallowed a phial of Dr Gillespie's Brain Tonic for my breakfast. The sides of the mountain are nearly perpendicular; but, after ascending about two hundred feet, it is there entirely covered with wood, which renders the footing much more safe; but in order to get to the wood, the road is so dangerous, that it made me almost tremble to think of it, - slippery grey rocks, and many of them unfortunately loose, so that when we took hold, they separated from the mass, and fell with a horrid rumbling noise. It was a noise not unlike the racket and din I had heard when I inadvertently found myself underneath the stage at the Helsinki Festival of Brusque & Earnest Percussion Music, where I was employed to muck about with the wiring. Here and there were a few patches of grass, the only thing we could depend upon to assist us in climbing, which must be done with extreme caution, for the least slip or false step would dash one to atoms on the rocks below. The rocks were mostly bauxite, with the odd clump of thack. By keeping our eyes constantly looking upwards, and continuing to haul ourselves up, by catching firm hold on this grass, after an hour's painful toil we gained the summit, where we found ourselves on an extended plain, of several miles expanse, which terminates in the peak, composed of dark grey lava, bare and frightful to behold. We stopped to insert our specially-manufactured contact lenses; doing so made such a terrible vision a tad more bearable. We proceeded towards it, the plain gradually rising, but the walking was most fatiguing, over strong rank grass and fern several feet high, with holes concealed under the roots in such a way, that no possible caution could prevent our occasionally falling down into one or other of them, and entirely disappearing, which caused a boisterous laugh amongst the rest; but it frequently happened, while one was making merry at the expense of another, down sunk the laugher himself. By God, that put an end to the cackling! A death-like stillness prevailed in these high regions, and, to my ear, our voices had a strange, unnatural echo, and I fancied our forms appeared gigantic, whilst the air was piercing cold. Icicles began to form on the brims of our hats, so we melted them with the portable bunsen burners we carried in our haversacks. The prospect was altogether very sublime, and filled the mind with awe! Well, my mind, at any rate; I cannot speak for my companions, who were, if truth be told, somewhat cloddish. On the one side, the boundless horizon, heaped up with clouds of silvery brightness, contrasted with some of darker hue, enveloping us in their vapour, and, passing rapidly away, gave us only casual glances of the landscape; and, on the other hand, the sterile and cindery peak, with its venerable head, partly capped with clouds, partly revealing great patches of red cinders, or lava, intermingled with the black rock, produced a most extraordinary and dismal effect. I do not use the words extraordinary and dismal lightly; I give them their full weight, and trust my readers will pause, in contemplative manner, perhaps furrowing their brows. It seemed as though it were still actually burning, to heighten the sublimity of the scene.  The huge albatross appeared here to dread no interloper or enemy; for their young were on the ground completely uncovered, and the old ones were stalking around them. The albatross, as most ornithologists have argued, is a kind of bird. This bird is the largest of the aquatic tribe; and its plumage is of a most delicate white, excepting the back and the tops of its wings, which are grey: they lay but one egg, on the ground, where they form a kind of nest, by scraping the earth round it. They are not as clever as crows, which know how to manipulate small sticks, although to call them - crows, that is - the Isambard Kingdom Brunels of the avian realm is rather exaggerating their abilities. After the young one is hatched, it has to remain a year before it can fly; it is entirely white, and covered with a woolly down, which is very beautiful. It is as beautiful as anything ever painted by the Douanier Rousseau, or Grandma Moses, or even Jackson Pollock. As we approached them, they clapped their beaks, with a very quick motion, which made a great noise. This noise was very different to the noise I had heard from under the stage at that long-ago percussion festival; this was more like one of Lothar Preen's Bagatelles for Hammers & Bakelite, particularly number seventy three, with its maddening, repetitive rhythm. This, and throwing up the contents of the stomach, are the only means of offence and defence they seem to possess. Dobson claimed in one of his pamphlets that in some languages the albatross is called the regurgitato bird, but this is probably spurious, like so much of Dobson's scribbling. The old ones, which are valuable on account of their feathers, my companions made dreadful havoc amongst, knocking on the head all they could come up with. This I had not expected; appalled, I took out my revolver and managed to shoot four of my bloodthirsty pals, which put an end to the bird-massacre; and I aimed at their legs, so there were no human fatalities, for which the Lord be praised.


Universal: Chapter 0
August 21, 2016
The purpose of this chapter is to setup a development environment to start working on our universal app. We will cover Webpack, Babel, PostCSS, ESLint and we will create a DevServer.
Branch: To see the commits of this chapter checkout this branch.
Release: To skip this chapter just clone this release.
Init
Go ahead, create a new directory and jump in
mkdir universal-app && cd universal-app
Initialize a git repository
git init
Create a new branch setup
git checkout -b setup
Set node version to v6
nvm install 6 && nvm use 6
Add a README
echo 'Javascript Universal App' > README.md
Initialize npm (go thru the interactive setup)
npm init
Ignore node_modules
echo node_modules > .gitignore
You are all set!
Diff: to see the diff for this step click here.
Fast-forward: git clone --branch init https://github.com/cazala/universal-app.git --depth=1
Webpack
Webpack is a widely used module bundler, and the first thing to setup
npm install webpack --save-dev
First create a /src
and /dist
directories
mkdir src && mkdir dist
Save the following file as webpack.config.js
var webpack = require('webpack')
var path = require('path')
module.exports = {
context: __dirname,
entry: './src/index.js',
output: {
path: path.resolve('dist'),
filename: 'bundle.js', },
plugins: [ new webpack.NoErrorsPlugin() ],
resolve: {
extensions: ['', '.js', '.json'],
modulesDirectories: ['.', 'src', 'node_modules']
}
}
}
Add /dist
to the .gitignore
file
node_modules
dist
Add build
and start
scripts to your package.json
"build": "webpack --config webpack.config.js",
"start": "node dist/bundle.js",
Test It Out:
Create the following index.js
file inside /src
:
console.log('hello world')
Now just npm run build
and then npm run start
You should see a hello world
in your console, and you will find that you 1 line src/index.js
has become a 51 lines dist/bundle.js
. Yay… right? This will pay off in the future tho, as we start plugging stuff into webpack.
Diff: to see the diff for this step click here.
Fast-forward: git clone --branch webpack https://github.com/cazala/universal-app.git --depth=1
Babel
Babel is a JavaScript compiler. It extends the language capabilities thru syntax transformers, we will need this in order to use ES2015 and React.
Get ready to install a truckload of dependencies
npm install --save babel-core babel-plugin-jsx-display-if babel-plugin-transform-object-rest-spread babel-polyfill babel-preset-es2015 babel-preset-react babel-register babel-runtime babel-loader
Add .babelrc
to configure babel
{
"presets": ["es2015", "react"],
"plugins": [
"transform-object-rest-spread",
"jsx-display-if"
]
}
And finally add loader to webpack.config.js
so webpack transpiles all the .js
files using babel (except the ones in node_modules
)
module: {
loaders: [
{
test: /\.js$/,
loaders: ['babel'],
exclude: /node_modules/
}
]
}
Test It Out:
Save the following as your src/index.js
const obj = { a: 1, b:2, c:3 }
const { a, ...rest } = obj
const spread = { ...rest, d: 4 }
console.log(rest) // { b:2, c: 3}
console.log(spread) // { b:2, c: 3, d: 4 }
Now npm run build
and npm run start
and you should see the rest and spread operators working (thus, babel is working)
Diff: to see the diff for this step click here.
Fast-forward: git clone --branch babel https://github.com/cazala/universal-app.git --depth=1
PostCSS
PostCSS is a tool for transforming CSS with JavaScript, like a Babel for CSS. We will set it up to let us work with autoprefixer, css modules (localized css classnames), css nesting, css variables and what not.

This way we will be able to require(./styles.css)
-
style-loader: It adds a


| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 | // SPDX-License-Identifier: MIT pragma solidity 0.8.3; import "./TellorVars.sol"; import "./interfaces/IOracle.sol"; import "./interfaces/IController.sol"; import "./interfaces/ITreasury.sol"; /** @author Tellor Inc. @title Governance @dev This is the Governance contract which defines the functionality for * proposing and executing votes, handling vote mechanism for voters, * and distributing funds for initiators and disputed reporters depending * on result. */ contract Governance is TellorVars { // Storage uint256 public voteCount; // total number of votes initiated uint256 public disputeFee; // dispute fee for a vote mapping(address => Delegation[]) private delegateInfo; // mapping of delegate addresses to an array of their delegations mapping(bytes4 => bool) private functionApproved; // mapping of function hashes to bools of whether the functions are approved mapping(bytes32 => uint256[]) private voteRounds; //shows if a certain vote has already started mapping(uint256 => Vote) private voteInfo; // mapping of vote IDs to the details of the vote mapping(uint256 => Dispute) private disputeInfo; // mapping of dispute IDs to the details of the dispute mapping(bytes32 => uint256) private openDisputesOnId; // mapping of a price feed ID to the number of disputes enum VoteResult { FAILED, PASSED, INVALID } // status of a potential vote // Structs struct Delegation { address delegate; // address of holder delegating uint256 fromBlock; // block number address started delegating } struct Dispute { bytes32 requestId; // ID of the dispute uint256 timestamp; // timestamp of when the dispute was initiated bytes value; // the value being disputed address reportedMiner; // miner who submitted the 'bad value' will get disputeFee if dispute vote fails } struct Vote { bytes32 identifierHash; // identifier hash of the vote uint256 voteRound; // the round of voting associated with the vote uint256 startDate; // timestamp of when vote was initiated uint256 blockNumber; // block number of when vote was initiated uint256 fee; // fee associated with the vote uint256 tallyDate; // timestamp of when the votes were tallied uint256 doesSupport; // number of votes in favor uint256 against; // number of votes against bool executed; // boolean of is the dispute settled VoteResult result; // VoteResult of did the vote pass? bool isDispute; // boolean of is the vote is is still in dispute uint256 invalidQuery; // whether or not the dispute is invalid bytes data; // data associated with the vote bytes4 voteFunction; // hash of the function associated with the vote address voteAddress; // address of contract to execute function on address initiator; // reporting submitting the 'bad value'-pay disputeFee will get reportedMiner's stake if dispute vote passes mapping(address => bool) voted; // mapping of address to whether or not they voted } // Events event NewDispute( uint256 _disputeId, bytes32 _queryId, uint256 _timestamp, address _reporter ); // Emitted when a new dispute is opened event NewVote(address _contract, bytes4 _function, bytes _data); // Emitted when a new vote is initiated event Voted( uint256 _voteId, bool _supports, address _voter, uint256 _voteWeight, bool _invalidQuery ); // Emitted when an address casts their vote event VoteExecuted(uint256 _disputeId, VoteResult _result); // Emitted when a vote is executed event VoteTallied(uint256 _disputeId, VoteResult _result); // Emitted when all casting for a vote is tallied event DelegateSet(address _delegate, address _delegator); // Emitted when voting delegate is set // Functions /** * @dev Initializes approved function hashes and updates the minimum dispute fees */ constructor() { bytes4[11] memory _funcs = [ bytes4(0x3c46a185), // changeControllerContract(address) 0xe8ce51d7, // changeGovernanceContract(address) 0x1cbd3151, // changeOracleContract(address) 0xbd87e0c9, // changeTreasuryContract(address) 0x740358e6, // changeUint(bytes32,uint256) 0x40c10f19, // mint(address,uint256) 0xe48d4b3b, // setApprovedFunction(bytes4,bool) 0xe280e8e8, // changeMiningLock(uint256) 0x6d53585f, // changeTimeBasedReward(uint256) 0x6274885f, // issueTreasury(uint256,uint256,uint256) 0xf3ff955a // delegateVotingPower(address) ]; // Approve function hashes and update dispute fee for (uint256 _i = 0; _i < _funcs.length; _i++) { functionApproved[_funcs[_i]] = true; } updateMinDisputeFee(); } /** * @dev Helps initialize a dispute by assigning it a disputeId * @param _queryId being disputed * @param _timestamp being disputed */ function beginDispute(bytes32 _queryId, uint256 _timestamp) external { // Ensure mined block is not 0 address _oracle = IController(TELLOR_ADDRESS).addresses( _ORACLE_CONTRACT ); require( IOracle(_oracle).getBlockNumberByTimestamp( _queryId, _timestamp ) != 0, "Mined block is 0" ); address _reporter = IOracle(_oracle).getReporterByTimestamp( _queryId, _timestamp ); bytes32 _hash = keccak256(abi.encodePacked(_queryId, _timestamp)); // Increment vote count and push new vote round voteCount++; uint256 _disputeId = voteCount; voteRounds[_hash].push(_disputeId); // Check if dispute is started within correct time frame if (voteRounds[_hash].length > 1) { uint256 _prevId = voteRounds[_hash][voteRounds[_hash].length - 2]; require( block.timestamp - voteInfo[_prevId].tallyDate < 1 days, "New dispute round must be started within a day" ); // Within a day for new round } else { require( block.timestamp - _timestamp < IOracle(_oracle).miningLock(), "Dispute must be started within 12 hours...same variable as mining lock" ); // New dispute within mining lock openDisputesOnId[_queryId]++; } // Create new vote and dispute Vote storage _thisVote = voteInfo[_disputeId]; Dispute storage _thisDispute = disputeInfo[_disputeId]; // Initialize dispute information - request ID, timestamp, value, etc. _thisDispute.requestId = _queryId; _thisDispute.timestamp = _timestamp; _thisDispute.value = IOracle(_oracle).getValueByTimestamp( _queryId, _timestamp ); _thisDispute.reportedMiner = _reporter; // Initialize vote information - hash, initiator, block number, etc. _thisVote.identifierHash = _hash; _thisVote.initiator = msg.sender; _thisVote.blockNumber = block.number; _thisVote.startDate = block.timestamp; _thisVote.voteRound = voteRounds[_hash].length; _thisVote.isDispute = true; // Calculate dispute fee based on number of current vote rounds uint256 _fee; if (voteRounds[_hash].length == 1) { _fee = disputeFee * 2**(openDisputesOnId[_queryId] - 1); IOracle(_oracle).removeValue(_queryId, _timestamp); } else { _fee = disputeFee * 2**(voteRounds[_hash].length - 1); } _thisVote.fee = (_fee * 9) / 10; require( IController(TELLOR_ADDRESS).approveAndTransferFrom( msg.sender, address(this), _fee ), "Fee must be paid" ); // This is the fork fee (just 100 tokens flat, no refunds. Goes up quickly to dispute a bad vote) // Add an initial tip and change the current staking status of reporter IOracle(_oracle).tipQuery(_queryId, _fee - _thisVote.fee, bytes("")); (uint256 _status, ) = IController(TELLOR_ADDRESS).getStakerInfo( _thisDispute.reportedMiner ); if (_status == 1) { uint256 _stakeCount = IController(TELLOR_ADDRESS).getUintVar( _STAKE_COUNT ); IController(TELLOR_ADDRESS).changeUint( _STAKE_COUNT, _stakeCount - 1 ); updateMinDisputeFee(); } IController(TELLOR_ADDRESS).changeStakingStatus(_reporter, 3); emit NewDispute(_disputeId, _queryId, _timestamp, _reporter); } /** * @dev Allows the sender to set an address as a delegate to vote on disputes * @param _delegate is the address the sender is delegating to */ function delegate(address _delegate) external { Delegation[] storage checkpoints = delegateInfo[msg.sender]; // Check if sender hasn't delegated the specific address, or if the current delegate is from old block number if ( checkpoints.length == 0 || checkpoints[checkpoints.length - 1].fromBlock != block.number ) { // Push a new delegate checkpoints.push( Delegation({ delegate: _delegate, fromBlock: uint128(block.number) }) ); } else { // Else, update old delegate Delegation storage oldCheckPoint = checkpoints[ checkpoints.length - 1 ]; oldCheckPoint.delegate = _delegate; } emit DelegateSet(_delegate, msg.sender); } /** * @dev Queries the balance of _user at a specific _blockNumber * @param _user The address from which the balance will be retrieved * @param _blockNumber The block number when the balance is queried * @return The balance at _blockNumber specified */ function delegateOfAt(address _user, uint256 _blockNumber) public view returns (address) { Delegation[] storage checkpoints = delegateInfo[_user]; // Checks if delegate doesn't exist or has block number greater than queried if ( checkpoints.length == 0 || checkpoints[0].fromBlock > _blockNumber ) { return address(0); } else { if (_blockNumber >= checkpoints[checkpoints.length - 1].fromBlock) return checkpoints[checkpoints.length - 1].delegate; // Binary search of correct delegate address uint256 _min = 0; uint256 _max = checkpoints.length - 2; while (_max > _min) { uint256 _mid = (_max + _min + 1) / 2; if (checkpoints[_mid].fromBlock == _blockNumber) { return checkpoints[_mid].delegate; } else if (checkpoints[_mid].fromBlock < _blockNumber) { _min = _mid; } else { _max = _mid - 1; } } return checkpoints[_min].delegate; } } /** * @dev Executes vote by using result and transferring balance to either * initiator or disputed reporter * @param _disputeId is the ID of the vote being executed */ function executeVote(uint256 _disputeId) external { // Ensure validity of vote ID, vote has been executed, and vote must be tallied Vote storage _thisVote = voteInfo[_disputeId]; require(_disputeId <= voteCount, "Vote ID must be valid"); require(!_thisVote.executed, "Vote has been executed"); require(_thisVote.tallyDate > 0, "Vote must be tallied"); // Ensure vote must be final vote and that time has to be pass (86400 = 24 * 60 * 60 for seconds in a day) require( voteRounds[_thisVote.identifierHash].length == _thisVote.voteRound, "Must be the final vote" ); require( block.timestamp - _thisVote.tallyDate >= 86400 * _thisVote.voteRound, "Vote needs to be tallied and time must pass" ); _thisVote.executed = true; if (!_thisVote.isDispute) { // If vote is not in dispute and passed, execute proper vote function with vote data if (_thisVote.result == VoteResult.PASSED) { address _destination = _thisVote.voteAddress; bool _succ; bytes memory _res; (_succ, _res) = _destination.call( abi.encodePacked(_thisVote.voteFunction, _thisVote.data) ); // Be sure to send enough gas! } emit VoteExecuted(_disputeId, _thisVote.result); } else { Dispute storage _thisDispute = disputeInfo[_disputeId]; if ( voteRounds[_thisVote.identifierHash].length == _thisVote.voteRound ) { openDisputesOnId[_thisDispute.requestId]--; } IController _controller = IController(TELLOR_ADDRESS); uint256 _i; uint256 _voteID; if (_thisVote.result == VoteResult.PASSED) { // If vote is in dispute and passed, iterate through each vote round and transfer the dispute to initiator for ( _i = voteRounds[_thisVote.identifierHash].length; _i > 0; _i-- ) { _voteID = voteRounds[_thisVote.identifierHash][_i - 1]; _thisVote = voteInfo[_voteID]; // If the first vote round, also make sure to slash the reporter and send their balance to the initiator if (_i == 1) { _controller.slashReporter( _thisDispute.reportedMiner, _thisVote.initiator ); } _controller.transfer(_thisVote.initiator, _thisVote.fee); } } else if (_thisVote.result == VoteResult.INVALID) { // If vote is in dispute and is invalid, iterate through each vote round and transfer the dispute to initiator for ( _i = voteRounds[_thisVote.identifierHash].length; _i > 0; _i-- ) { _voteID = voteRounds[_thisVote.identifierHash][_i - 1]; _thisVote = voteInfo[_voteID]; _controller.transfer(_thisVote.initiator, _thisVote.fee); } uint256 _stakeCount = IController(TELLOR_ADDRESS).getUintVar( _STAKE_COUNT ); IController(TELLOR_ADDRESS).changeUint( _STAKE_COUNT, _stakeCount + 1 ); _controller.changeStakingStatus(_thisDispute.reportedMiner, 1); // Change staking status of disputed reporter, but don't slash } else if (_thisVote.result == VoteResult.FAILED) { // If vote is in dispute and fails, iterate through each vote round and transfer the dispute to disputed reporter uint256 _reporterReward = 0; for ( _i = voteRounds[_thisVote.identifierHash].length; _i > 0; _i-- ) { _voteID = voteRounds[_thisVote.identifierHash][_i - 1]; _thisVote = voteInfo[_voteID]; _reporterReward += _thisVote.fee; } _controller.transfer( _thisDispute.reportedMiner, _reporterReward ); uint256 _stakeCount = IController(TELLOR_ADDRESS).getUintVar( _STAKE_COUNT ); IController(TELLOR_ADDRESS).changeUint( _STAKE_COUNT, _stakeCount - 1 ); _controller.changeStakingStatus(_thisDispute.reportedMiner, 1); } emit VoteExecuted(_disputeId, voteInfo[_disputeId].result); } } /** * @dev Proposes a vote for an associated Tellor contract and function, and defines the properties of the vote * @param _contract is the Tellor contract to propose a vote for -> used to calculate identifier hash * @param _function is the Tellor function to propose a vote for -> used to calculate identifier hash * @param _data is the data associated with the vote proposaln -> used to calculate identifier hash * @param _timestamp is the timestamp associated with the vote -> used to calculate identifier hash */ function proposeVote( address _contract, bytes4 _function, bytes calldata _data, uint256 _timestamp ) external { // Update vote count, vote ID, current vote, and timestamp voteCount++; uint256 _disputeId = voteCount; Vote storage _thisVote = voteInfo[_disputeId]; if (_timestamp == 0) { _timestamp = block.timestamp; } // Calculate vote identifier hash and push to vote rounds bytes32 _hash = keccak256( abi.encodePacked(_contract, _function, _data, _timestamp) ); voteRounds[_hash].push(_disputeId); // Ensure new dispute round started within a day if (voteRounds[_hash].length > 1) { uint256 _prevId = voteRounds[_hash][voteRounds[_hash].length - 2]; require( block.timestamp - voteInfo[_prevId].tallyDate < 1 days, "New dispute round must be started within a day" ); // 1 day for new disputes } // Calculate fee to do anything (just 10 tokens flat, no refunds. Goes up quickly to prevent spamming) uint256 _fee = 10e18 * 2**(voteRounds[_hash].length - 1); require( IController(TELLOR_ADDRESS).approveAndTransferFrom( msg.sender, address(this), _fee ), "Fee must be paid" ); // Update information on vote -- hash, vote round, start date, block number, fee, etc. _thisVote.identifierHash = _hash; _thisVote.voteRound = voteRounds[_hash].length; _thisVote.startDate = block.timestamp; _thisVote.blockNumber = block.number; _thisVote.fee = _fee; _thisVote.data = _data; _thisVote.voteFunction = _function; _thisVote.voteAddress = _contract; _thisVote.initiator = msg.sender; // Contract must be a Tellor contract, and function must be approved require( _contract == TELLOR_ADDRESS || _contract == IController(TELLOR_ADDRESS).addresses(_GOVERNANCE_CONTRACT) || _contract == IController(TELLOR_ADDRESS).addresses(_TREASURY_CONTRACT) || _contract == IController(TELLOR_ADDRESS).addresses(_ORACLE_CONTRACT), "Must interact with the Tellor system" ); require(functionApproved[_function], "Function must be approved"); emit NewVote(_contract, _function, _data); } /** * @dev Sets a given function's approved status * @param _func is the hash of the function to change status * @param _val is the boolean of the function's status (approved or not) */ function setApprovedFunction(bytes4 _func, bool _val) public { require( msg.sender == IController(TELLOR_ADDRESS).addresses(_GOVERNANCE_CONTRACT), "Only the Governance contract can change a function's status" ); functionApproved[_func] = _val; } /** * @dev Tallies the votes and begins the 1 day challenge period * @param _disputeId is the dispute id */ function tallyVotes(uint256 _disputeId) external { // Ensure vote has not been executed and that vote has not been tallied Vote storage _thisVote = voteInfo[_disputeId]; require(!_thisVote.executed, "Dispute has been already executed"); require(_thisVote.tallyDate == 0, "Vote should not already be tallied"); // Determine appropriate vote duration and quorum based on dispute status uint256 _duration = 2 days; uint256 _quorum = 0; if (!_thisVote.isDispute) { _duration = 7 days; _quorum = 5; } // Ensure voting is still open require( block.timestamp - _thisVote.startDate > _duration, "Time for voting haven't elapsed" ); // If there are more invalid votes than for and against, result is invalid if ( _thisVote.invalidQuery >= _thisVote.doesSupport && _thisVote.invalidQuery >= _thisVote.against && _thisVote.isDispute ) { _thisVote.result = VoteResult.INVALID; } else if (_thisVote.doesSupport > _thisVote.against) { // If there are more support votes than against votes, and the vote has reached quorum, allow the vote to pass if ( _thisVote.doesSupport >= ((IController(TELLOR_ADDRESS).uints(_TOTAL_SUPPLY) * _quorum) / 100) ) { _thisVote.result = VoteResult.PASSED; Dispute storage _thisDispute = disputeInfo[_disputeId]; // In addition, change staking status of disputed miner as appropriate (uint256 _status, ) = IController(TELLOR_ADDRESS).getStakerInfo( _thisDispute.reportedMiner ); if (_thisVote.isDispute && _status == 3) { IController(TELLOR_ADDRESS).changeStakingStatus( _thisDispute.reportedMiner, 4 ); } } } // If there are more against votes than support votes, the result failed else { _thisVote.result = VoteResult.FAILED; } _thisVote.tallyDate = block.timestamp; // Update time vote was tallied emit VoteTallied(_disputeId, _thisVote.result); } /** * @dev This function updates the minimum dispute fee as a function of the amount * of staked miners */ function updateMinDisputeFee() public { uint256 _stakeAmt = IController(TELLOR_ADDRESS).uints(_STAKE_AMOUNT); uint256 _trgtMiners = IController(TELLOR_ADDRESS).uints(_TARGET_MINERS); uint256 _stakeCount = IController(TELLOR_ADDRESS).uints(_STAKE_COUNT); uint256 _minFee = IController(TELLOR_ADDRESS).uints( _MINIMUM_DISPUTE_FEE ); uint256 _reducer; // Calculate total dispute fee using stake count if (_stakeCount > 0) { _reducer = (((_stakeAmt - _minFee) * (_stakeCount * 1000)) / _trgtMiners) / 1000; } if (_reducer >= _stakeAmt - _minFee) { disputeFee = _minFee; } else { disputeFee = _stakeAmt - _reducer; } } /** * @dev Enables the sender address to cast a vote * @param _disputeId is the ID of the vote * @param _supports is the address's vote: whether or not they support or are against * @param _invalidQuery is whether or not the dispute is valid */ function vote( uint256 _disputeId, bool _supports, bool _invalidQuery ) external { require( delegateOfAt(msg.sender, voteInfo[_disputeId].blockNumber) == address(0), "the vote should not be delegated" ); _vote(msg.sender, _disputeId, _supports, _invalidQuery); } /** * @dev Enables the sender address to cast a vote for other addresses * @param _addys is the array of addresses that the sender votes for * @param _disputeId is the ID of the vote * @param _supports is the address's vote: whether or not they support or are against * @param _invalidQuery is whether or not the dispute is valid */ function voteFor( address[] calldata _addys, uint256 _disputeId, bool _supports, bool _invalidQuery ) external { for (uint256 _i = 0; _i < _addys.length; _i++) { require( delegateOfAt(_addys[_i], voteInfo[_disputeId].blockNumber) == msg.sender, "Sender is not delegated to vote for this address" ); _vote(_addys[_i], _disputeId, _supports, _invalidQuery); } } // Getters /** * @dev Determines if an address voted for a specific vote * @param _disputeId is the ID of the vote * @param _voter is the address of the voter to check for * @return bool of whether or note the address voted for the specific vote */ function didVote(uint256 _disputeId, address _voter) external view returns (bool) { return voteInfo[_disputeId].voted[_voter]; } /** * @dev Returns info on a delegate for a given holder * @param _holder is the address of the holder of TRB tokens * @return address of the delegate at the given holder and block number * @return uint of the block number of the delegate */ function getDelegateInfo(address _holder) external view returns (address, uint256) { if (delegateInfo[_holder].length > 0) { return ( delegateOfAt(_holder, block.number), delegateInfo[_holder][delegateInfo[_holder].length - 1] .fromBlock ); } else { return (address(0), 0); } } /** * @dev Returns info on a dispute for a given ID * @param _disputeId is the ID of a specific dispute * @return bytes32 of the data ID of the dispute * @return uint256 of the timestamp of the dispute * @return bytes memory of the value being disputed * @return address of the reporter being disputed */ function getDisputeInfo(uint256 _disputeId) external view returns ( bytes32, uint256, bytes memory, address ) { Dispute storage _d = disputeInfo[_disputeId]; return (_d.requestId, _d.timestamp, _d.value, _d.reportedMiner); } /** * @dev Returns the number of open disputes for a specific data ID * @param _disputeId is the ID of a specific data feed * @return uint256 of the number of open disputes for the data ID */ function getOpenDisputesOnId(bytes32 _disputeId) external view returns (uint256) { return openDisputesOnId[_disputeId]; } /** * @dev Returns the total number of votes * @return uint256 of the total number of votes */ function getVoteCount() external view returns (uint256) { return voteCount; } /** * @dev Returns info on a vote for a given vote ID * @param _disputeId is the ID of a specific vote * @return bytes32 of the identifier hash of the vote * @return uint256[8] memory of the pertinent round info (vote rounds, start date, fee, etc.) * @return bool[2] memory of whether or not the vote was executed and in dispute * @return VoteResult of the result of the vote * @return bytes memory of the data of the vote * @return bytes4 of the vote function * @return address[2] memory of the addresses of the vote and initiator */ function getVoteInfo(uint256 _disputeId) external view returns ( bytes32, uint256[8] memory, bool[2] memory, VoteResult, bytes memory, bytes4, address[2] memory ) { Vote storage _v = voteInfo[_disputeId]; return ( _v.identifierHash, [ _v.voteRound, _v.startDate, _v.blockNumber, _v.fee, _v.tallyDate, _v.doesSupport, _v.against, _v.invalidQuery ], [_v.executed, _v.isDispute], _v.result, _v.data, _v.voteFunction, [_v.voteAddress, _v.initiator] ); } /** * @dev Returns an array of voting rounds for a given vote * @param _hash is the identifier hash for a vote * @return uint256[] memory of the vote rounds */ function getVoteRounds(bytes32 _hash) external view returns (uint256[] memory) { return voteRounds[_hash]; } /** * @dev Used for future governance contract upgrades. Hardcode old contract address in next upgrade * @param _contract is the contract address to check */ function isApprovedGovernanceContract(address _contract) external returns (bool) { if( _contract == IController(TELLOR_ADDRESS).addresses(_GOVERNANCE_CONTRACT) ) { return true; } else { return false; } } /** * @dev Returns whether or not a function is approved * @param _func is the hash of the function to be checked * @return bool of whether or not the function is approved */ function isFunctionApproved(bytes4 _func) external view returns (bool) { return functionApproved[_func]; } /** * @dev Used during the upgrade process to verify valid Tellor Contracts */ function verify() external pure returns (uint256) { return 9999; } // Internal /** * @dev Allows an address to vote by calculating their total vote weight and updating vote count * for the vote ID * @param _voter is the address casting their vote * @param _disputeId is the vote ID the address is casting their vote for * @param _supports is a boolean of whether the voter supports the dispute * @param _invalidQuery is a boolean of whether the vote believes the dispute is invalid */ function _vote( address _voter, uint256 _disputeId, bool _supports, bool _invalidQuery ) internal { // Ensure that dispute has not been executed and that vote does not exist and is not tallied require(_disputeId <= voteCount, "Vote does not exist"); Vote storage _thisVote = voteInfo[_disputeId]; require(_thisVote.tallyDate == 0, "Vote has already been tallied"); IController _controller = IController(TELLOR_ADDRESS); uint256 voteWeight = _controller.balanceOfAt( _voter, _thisVote.blockNumber ); IOracle _oracle = IOracle(_controller.addresses(_ORACLE_CONTRACT)); ITreasury _treasury = ITreasury( _controller.addresses(_TREASURY_CONTRACT) ); // Add to vote weight of voter based on treasury funds, reports submitted, and total tips voteWeight += _treasury.getTreasuryFundsByUser(_voter); voteWeight += _oracle.getReportsSubmittedByAddress(_voter) * 1e18; voteWeight += _oracle.getTipsByUser(_voter); // Make sure voter can't already be disputed, has already voted, or if balance is 0 (uint256 _status, ) = _controller.getStakerInfo(_voter); require(_status != 3, "Cannot vote if being disputed"); require(!_thisVote.voted[_voter], "Sender has already voted"); require(voteWeight > 0, "User balance is 0"); // Update voting status and increment total queries for support, invalid, or against based on vote _thisVote.voted[_voter] = true; if (_thisVote.isDispute && _invalidQuery) { _thisVote.invalidQuery += voteWeight; } else if (_supports) { _thisVote.doesSupport += voteWeight; } else { _thisVote.against += voteWeight; } emit Voted(_disputeId, _supports, _voter, voteWeight, _invalidQuery); } } |


Direct Pay
12 website
bonusbitcoin.co up to 5,000 satoshi every 15 minute
freebitco.in ( 467 to 44711721 satoshi every 1 Hour )
btcclicks.com (Earn up to 0.00954 mBTC per click) >>
bitter.io (earn more bitcoins by visiting sites on the left panel)
bitfun.co
bitcoinker
bitcoinbow
cryptoaddicted.biz
bestchange.com
neobux.com payment to paypal / payza
refbit.net
Pay to Faucethub.io
17 website
dailyfreebits
satoshididu.com
pentafaucet.com
bitcoinker (300 satoshi 15m)
landoffaucets
luckybtcfaucet.website
freebtcworld.com
goldbit.website
mafiacoins.net
bituniverse.net
huefaucet.xyz
bitlucky.io
btcfaucet.design
bitcoin143.com
Pay to FaucetSystem
Category
huefaucet.xyz
mmofaucet.freeiz.com
bitco.party
Pay to XABO wallet
12 website
goldcoinjar.com ( 200 and 5000 satoshi each 5 minutes)
ganabitsdiarios.com (3000 Satoshis in 20 m)
fieldbitcoins.com
Minining - invest Bitcoin
3 website
hashflare (good company)
genesis mining
bestchange.com
computta (mining your self in your device )


Genesis 31:7
And your father hath deceived me, and changed my wages ten times; but God suffered him not to hurt me.