This guide covers how to create, organize and generate a Living Style Guide with DocumentCSS.
Tags Reference
DocumentCSS uses comments in your stylesheets to generate your style guide documentation. Tags are used in conjunction to add structure to it.
Prefixed with the @ symbol, tags tell DocumentCSS that there is additional information about the code. For example the tag @description is used to indicate where the description of a style begins.
Use the following tags to structure your Living Style Guide:
Tag
Use To
@page
Declare a markdown file as a page in your site.
@stylesheet
Declare a stylesheet file as page in your site.
@styles
Declare a comment as a style inside of a stylesheet.
@demo
Add an iframe with a demo and html views.
@iframe
Adds a simple iframe.
@parent
Specify the parent of a page or stylesheet.
@group
Specify groups of stylesheets or pages in the sidebar.
Use this tag inside of a markdown file to represent content that doesn't belong to part of the application structure. Anything that you write below this tag will appear as the description of the page.
Arguments
NAME
The unique name of the page. The name is used as a reference for other tags.
TITLE
The title of the page used for display purposes.
Example:
@page logo-standards Logo Standards
The following guidelines will show your how to use the logo.
With this configuration a page will be created called logo-standards.html. The h1 on the page will be Logo Standards:
@stylesheet
Use this tag inside of a stylesheet (CSS, Less, or SCSS) to declare a stylesheet that you want to document in your Living Style Guide. Anything that you write below this tag will appear as the description of the page.
Arguments
NAME
The unique name of the stylesheet. The name is used as a reference for other tags.
TITLE
The title of the page used for display purposes.
Example:
/**
* @stylesheet buttons.css Buttons
*
* There are different button styles that you can use.
**/
This will create a page in the styleguide directory called buttons.css.html:
Like with the @page tag, anything you write below the tag will be used as a description in the page. Note that because you are adding this content inside of a code file you will need to wrap it in a code comment.
@styles
Use this tag inside of a stylesheet that is already using the @stylesheet tag to create a subsection inside of the page and document a set of styles.
Arguments
NAME
The unique name of the style. The name is used as a reference for other tags.
TITLE
The title of the style used for display purposes.
Example:
/**
* @stylesheet buttons.css Buttons
*
* There are different button styles that can be used:
**/
/**
* @styles buttons-sizes Button Sizes
*
* Use button sizes to define the hierarhy between the actions in your page.
**/
This will create the section Button Sizes on the page buttons.css.html:
@demo
Use this tag to add a demonstration of an html file that shows your styles in action. The demo will
render as well an html tab with the markup used for the demo.
Arguments
SRC
The source of the html file.
HEIGHT
The height of the html page. If a height is not provided, the height is determined as the content of the body.
Example:
/**
* @stylesheet buttons.css Buttons
*
* Here's an example of our default button:
*
* @demo demos/buttons/demo.html
**/
This will show the contents of the demo.html under the Buttons section. The html markup will also be rendered on a separate tab:
@iframe
Use this tag to add a demonstration of and html file without showing the markup used for it.
Arguments
SRC
The source of the html file.
HEIGHT
The height of the html page. If a height is not provided, the height is determined as the content of the body.
Example:
/**
* @stylesheet buttons.css Buttons
*
* Here's an example of our default button:
*
* @iframe demos/buttons/demo.html 160
**/
This will show the contents of the demo.html right below the section Forms with a height of 160px. The html markup won't be rendered on a separate tab.
@parent
You can use this tag inside of a markdown file or stylesheet to specify its parent.
Arguments
NAME
The unique name of the parent. The name is used as a reference for other tags.
ORDER
The placement of the children in relation to their siblings. The order starts with 0 and defaults to alphabetical.
Example:
/**
* @stylesheet buttons.css Buttons
* @parent styles
*
* Here's an example of our default button:
*
* @iframe demos/buttons.html
**/
With this configuration the stylesheet buttons.css will show under the Styles section:
@group
You can use this tag to group pages or stylesheets in the sidenav of your Living Style Guide.
Arguments
NAME
The unique name of the group. The name is used as a reference for other tags.
ORDER
The placement of the children in relation to their siblings. The order starts with 0 and defaults to alphabetical.
TITLE
The title that will be shown in the sidebar.
Example:
@page styles Styles
@group styles.colors 0 Colors
@group styles.typography 1 Typography
@group styles.forms-elements 2 Form Elements
This is my style guide.
This will create the groups: Colors, Typography, and Form Elements under the sidebar shown for the Styles section:
Creating a Page
Now that you have a grasp on what tags are used for, let's dive into how to create your Living Style Guide.
The first step is to create a page which will be used as the index of your styleguide. To create this page you can create a file in the styles directory called styles.md, and inside add the tag @page. Your code should look something like this:
@page styles Styles
This is my style guide.
Anything after the line with the tag will be used as text on your page.
Using Markdown
With DocumentCSS you can use markdown to semantically structure your documention. Markdown is great becuase is a lightweight markup that won't clutter the comments inside of your style sheets. For example, if you want to call out a piece of text to be displayed as code in markdown you can simply wrap the text in `. For example:
This Markdown:
`code`
Will display in the generated HTML as:
code
Will display on the page as:
code
Reference this markdown cheatsheet created by gitbub to learn more about how to use markdown in your docs.
Hyperlinking
To create links within your documentation simply use the NAME of the page or stylesheet that has been documented using the tags @page or @stylesheet and wrap it in []. For example:
The following page
@page accesibility Accesibility
Can be hyperlinked like this:
Referece [accesibility] for more details.
For links external to your style guide, use markdown.
Adding images
You can use regular markdown to add images to your style guide.
Documenting a Stylesheet
To document a stylesheet, open an existing stylesheet or create a new one. You can use .CSS, .Less, or .SCSS extensions. Then, at the top of your document add the @stylesheet tag inside of a css comment. As with the page tag, you can add a description right below it. For example:
/**
* @stylesheet buttons.less Buttons
*
* Global style definitions for all button elements.
*/
This will create a page called buttons.less.html in the directory that you chose to generate your documentation in.
Documenting Styles
The next step is to use the @styles tag to organize the styles inside of your stylesheet. For example, inside of your stylesheet for buttons, you may have styles for colors, sizes, and variations. You can use the @styles tag to create sections and document them separately. Besides adding structure to your document, doing this will also allow you to hyperlink directly to that section, as well as to show it on the summary of links at the top of the documentation for that stylesheet.
Here's an example of how this tag can be used:
/**
* @stylesheet buttons.less Buttons
*
* Global style definitions for all button elements.
*
*/
/**
* @styles buttons-sizes Button Sizes 1
*
* There are 3 button sizes that can be used:
*/
btn-small {
...
}
/**
* @styles buttons-colors Button Colors 0
*
* Use the color variations to denote importance of each action type :
*/
btn-success {
...
}
Creating Demos
Creating demos allows you to include markup and css in your Living Style Guide to demonstrate your styles in action. For this, create an HTML file inside of your demos directory as it was indicated under the File Organization section.
Inside of this HTML file add the necessary markup and css classes needed for your demo and link your project stylesheet. For example:
This will render in your Living Style Guide page as:
Note that next to the "demo" tab there is an "HTML". This tab shows any markup inside of your demo, so it's a really nice way of showing your styles in action and how is the markup setup. But if for some reason you don't want to show the markup, you can use instead the tag @iframe which will not render the HTML and the tabs at all. For example:
Have in mind that before your demos can be visible on your Living Style Guide, you will need to copy them into the directory that you chose to generate your documentation in (styleguide in our example). You can do this by simply copying the demo directory inside of it. To automate this task you can use a task manager like grunt.
Since your demos and your overall project will be using the same source styles, your live demos will change whenever your design changes.
Organizing the Docs
DocumentCSS allows you to organize your documentation independently of how your styles are organized. This is very powerful as you can create a custom information achitecture that better fits your particular needs of presenting your Living Style Guide.
Parent-child Relations
To create a hierarchy in your documentation your can use the tag @parent. This tag tells DocumentCSS that your @page or @stylesheet has a "parent", and will make it display under that "parent" on the sidebar. For example:
/**
* @stylesheet checkboxes.css Checkboxes
* @parent forms 2
/**
In this example the Checkboxes page will show up in the sidebar under the Forms section in the 3rd position.
Creating Groups
You can also group pages with headings in the sidebar. For this select the parent page where you want to create the group. Then add the tag @group followed by:
The unique NAME of the group that will be used as reference for other tags,
The ORDER in which you want your group to show on.
The TITLE or heading of your group that will be visible on the page.
This will create the groups: Branding, Baseline Elements, and Design Assets under the sidebar shown for the Styles section.
Updating the Top Menu
While the sidebar is generated via the @parent and @group tags, the top menu on your Living Style Guide is hardcoded in the theme files. To change the navigation menu items, you have to edit the theme file layout.mustache.
There are two ways to do this:
Create an entirely new theme by copying the default theme and editing it. This is useful if you want to make a lot of changes to the theme.
Copy and edit only the layout.mustache template file. This is useful if you’re not going to make any other changes to the theme. To do this:
Copy layout.mustache to a folder called templates in your project (like theme/templates).
Make any modifications you have to the layout.mustache file.
Tell DocumentJS to look for this new theme in your documentjs.json like this:
When you generate the site, be sure to use the -f flag to force DocumentJS to re-generate the theme files:
> documentjs -f
Generating the Site
To generate your Living Style Guide site open up a terminal in your project's directory and run:
> ./node_modules/.bin/documentjs
This will generate your site in the styleguide directory.
Simple Command
If you want an easier way to run this command, first install DocumentJS globally (so it can be run anywhere on your computer):
> npm install -g documentjs
Now you can just run this command in any directory with a documentjs.json file:
> documentjs
Viewing Your Site
Now you just need a way to host your generated site from styleguide. If you're not sure how to do this and are on a Windows computer, you'll need to research it on your own. If you are using a Mac or a Linux machine, use a terminal navigate to the styleguide directory and use python to start a server:
> cd styleguide
> python -m SimpleHTTPServer
You should see something like the following:
Serving HTTP on <IP_ADDRESS> port 8000 ...
Open up a browser and navigate to http://localhost:8000 (if the number above is not 8000, use whatever number you see in your terminal instead). You should see any pages that you have created so far!
Automatically Detecting Changes
If you'd like DocumentJS to rebuild the site every time you make changes, you can use the -w (watch) flag while you're working on the site so you don't have to run the documentjs command every time:
Tags Reference
DocumentCSS uses comments in your stylesheets to generate your style guide documentation. Tags are used in conjunction to add structure to it.
Prefixed with the
@
symbol, tags tell DocumentCSS that there is additional information about the code. For example the tag@description
is used to indicate where the description of a style begins.Use the following tags to structure your Living Style Guide:
For additional functionality consult the tags full listing.
@page
Use this tag inside of a markdown file to represent content that doesn't belong to part of the application structure. Anything that you write below this tag will appear as the description of the page.
NAME
TITLE
Example:
With this configuration a page will be created called logo-standards.html. The
h1
on the page will be Logo Standards:@stylesheet
Use this tag inside of a stylesheet (CSS, Less, or SCSS) to declare a stylesheet that you want to document in your Living Style Guide. Anything that you write below this tag will appear as the description of the page.
NAME
TITLE
Example:
This will create a page in the styleguide directory called buttons.css.html:
Like with the
@page
tag, anything you write below the tag will be used as a description in the page. Note that because you are adding this content inside of a code file you will need to wrap it in a code comment.@styles
Use this tag inside of a stylesheet that is already using the
@stylesheet
tag to create a subsection inside of the page and document a set of styles.NAME
TITLE
Example:
This will create the section Button Sizes on the page buttons.css.html:
@demo
Use this tag to add a demonstration of an html file that shows your styles in action. The demo will render as well an html tab with the markup used for the demo.
SRC
HEIGHT
Example:
This will show the contents of the demo.html under the Buttons section. The html markup will also be rendered on a separate tab:
@iframe
Use this tag to add a demonstration of and html file without showing the markup used for it.
SRC
HEIGHT
Example:
This will show the contents of the demo.html right below the section Forms with a height of 160px. The html markup won't be rendered on a separate tab.
@parent
You can use this tag inside of a markdown file or stylesheet to specify its parent.
NAME
ORDER
Example:
With this configuration the stylesheet buttons.css will show under the Styles section:
@group
You can use this tag to group pages or stylesheets in the sidenav of your Living Style Guide.
NAME
ORDER
TITLE
Example:
This will create the groups: Colors, Typography, and Form Elements under the sidebar shown for the Styles section:
Creating a Page
Now that you have a grasp on what tags are used for, let's dive into how to create your Living Style Guide.
The first step is to create a page which will be used as the index of your styleguide. To create this page you can create a file in the
styles
directory calledstyles.md
, and inside add the tag @page. Your code should look something like this:Anything after the line with the tag will be used as text on your page.
Using Markdown
With DocumentCSS you can use markdown to semantically structure your documention. Markdown is great becuase is a lightweight markup that won't clutter the comments inside of your style sheets. For example, if you want to call out a piece of text to be displayed as
code
in markdown you can simply wrap the text in`
. For example:code
Reference this markdown cheatsheet created by gitbub to learn more about how to use markdown in your docs.
Hyperlinking
To create links within your documentation simply use the
NAME
of the page or stylesheet that has been documented using the tags@page
or@stylesheet
and wrap it in[]
. For example:The following page
Can be hyperlinked like this:
For links external to your style guide, use markdown.
Adding images
You can use regular markdown to add images to your style guide.
Documenting a Stylesheet
To document a stylesheet, open an existing stylesheet or create a new one. You can use .CSS, .Less, or .SCSS extensions. Then, at the top of your document add the @stylesheet tag inside of a css comment. As with the page tag, you can add a description right below it. For example:
This will create a page called
buttons.less.html
in the directory that you chose to generate your documentation in.Documenting Styles
The next step is to use the @styles tag to organize the styles inside of your stylesheet. For example, inside of your stylesheet for buttons, you may have styles for colors, sizes, and variations. You can use the
@styles
tag to create sections and document them separately. Besides adding structure to your document, doing this will also allow you to hyperlink directly to that section, as well as to show it on the summary of links at the top of the documentation for that stylesheet.Here's an example of how this tag can be used:
Creating Demos
Creating demos allows you to include markup and css in your Living Style Guide to demonstrate your styles in action. For this, create an HTML file inside of your
demos
directory as it was indicated under the File Organization section.Inside of this HTML file add the necessary markup and css classes needed for your demo and link your project stylesheet. For example:
Then, link this demo to your documentation using the @demo tag:
This will render in your Living Style Guide page as:
Note that next to the "demo" tab there is an "HTML". This tab shows any markup inside of your demo, so it's a really nice way of showing your styles in action and how is the markup setup. But if for some reason you don't want to show the markup, you can use instead the tag @iframe which will not render the HTML and the tabs at all. For example:
Will render in your Living Style Guide page as:
Have in mind that before your demos can be visible on your Living Style Guide, you will need to copy them into the directory that you chose to generate your documentation in (styleguide
in our example). You can do this by simply copying thedemo
directory inside of it. To automate this task you can use a task manager like grunt.Organizing the Docs
DocumentCSS allows you to organize your documentation independently of how your styles are organized. This is very powerful as you can create a custom information achitecture that better fits your particular needs of presenting your Living Style Guide.
Parent-child Relations
To create a hierarchy in your documentation your can use the tag @parent. This tag tells DocumentCSS that your
@page
or@stylesheet
has a "parent", and will make it display under that "parent" on the sidebar. For example:In this example the Checkboxes page will show up in the sidebar under the Forms section in the 3rd position.
Creating Groups
You can also group pages with headings in the sidebar. For this select the parent page where you want to create the group. Then add the tag @group followed by:
NAME
of the group that will be used as reference for other tags,ORDER
in which you want your group to show on.TITLE
or heading of your group that will be visible on the page.Example:
This will create the groups: Branding, Baseline Elements, and Design Assets under the sidebar shown for the Styles section.
Updating the Top Menu
While the sidebar is generated via the
@parent
and@group
tags, the top menu on your Living Style Guide is hardcoded in the theme files. To change the navigation menu items, you have to edit the theme filelayout.mustache
.There are two ways to do this:
layout.mustache
template file. This is useful if you’re not going to make any other changes to the theme. To do this:layout.mustache
to a folder calledtemplates
in your project (liketheme/templates
).layout.mustache
file.documentjs.json
like this:-f
flag to force DocumentJS to re-generate the theme files:Generating the Site
To generate your Living Style Guide site open up a terminal in your project's directory and run:
This will generate your site in the
styleguide
directory.Simple Command
If you want an easier way to run this command, first install DocumentJS globally (so it can be run anywhere on your computer):
Now you can just run this command in any directory with a
documentjs.json
file:Viewing Your Site
Now you just need a way to host your generated site from
styleguide
. If you're not sure how to do this and are on a Windows computer, you'll need to research it on your own. If you are using a Mac or a Linux machine, use a terminal navigate to thestyleguide
directory and use python to start a server:You should see something like the following:
Open up a browser and navigate to
http://localhost:8000
(if the number above is not 8000, use whatever number you see in your terminal instead). You should see any pages that you have created so far!Automatically Detecting Changes
If you'd like DocumentJS to rebuild the site every time you make changes, you can use the
-w
(watch) flag while you're working on the site so you don't have to run thedocumentjs
command every time:Continue to the next guide:
> Customizing DocumentCSS.


Testing Ajax
Customer ID
Customer Name
Customer Address
Save
Clear
Customer ID
Customer Name
Customer Address
Action


Dijit comes bundled with three themes. MFU is compliant with dijit/dojo's themes
Choose your theme :
tundra
claro
nihilo
soria


///////////////////////////////////////////////////////////
// boundarycheck.cpp, v1.1
//
// Windows Leaks Detector, 2006
// http://sourceforge.net/projects/winleak
//<EMAIL_ADDRESS>//
// COMPILATION:
// Create empty "Win32 Console Application" project, and
// add this file. Tested with VS2005, but should work
// with other compilers too.
//
// REQUIRES: Windows XP/2000
//
// DESCRIPTION:
// Demonstrates 2 approaches to design of "Memory Boundary
// Check" feature, which should verify that the application
// does not access memory outside of dynamically allocated
// blocks. The feature will be implemented in "Windows Leaks
// Detector" project, and assumes that our code will receive
// all calls to HeapAlloc and HeapFree. In current module
// new allocation functions are called directly.
// The boundary check is not intended to verify access to
// statically allocated memory.
//
// Approach 1:
// Allocate bigger memory buffer than requested, and write
// signature block before and after the returned chunk.
// When the memory is released by application - verify that
// signature blocks are unchanged.
// (+) low memory overhead
// (+) no run-time overhead
// (+) checks both beginning and end of block
// (-) does not alert until the memory is released
// (-) checks write operations only
//
// Approach 2:
// Allocate block of N+1 pages, where N is the minimal number
// of full pages to contain the requested buffer size. The
// extra page will be protected by PAGE_GUARD flag, and the
// pointer returned to the user will be calculated so the
// requested buffer will end at the end of last "unguarded"
// page - so next byte after the block will be located in
// the guarded page. Any attempt to access the memory after
// the allocated block will generate STATUS_GUARD_PAGE_VIOLATION
// exception.
// (+) no run-time overhead
// (+) alerts at the time of out-of-bound access, when the
// full call stack is available
// (+) checks both read and write access
// (-) high memory overhead (may cause run-time overhead),
// depends on the page size (the default in XP/2000 is 4K).
// (-) checks only overflow at the end of the block (in
// similar way the beginning of the block can be protected,
// but not both at same time, unless the size of allocated
// block is multiple of page size)
// NOTE: when the memory overflow in not acceptable, this
// technique can be applied to part of allocations:
// 1. Only for allocation of buffers over certain size. This
// way the ratio between requested and allocated memory will
// be limited. Anyway, we are mostly interested in overflow
// control when arrays (e.g. string buffers) are allocated.
// 2. Only for cases where the 1st approach indicated an
// overflow, and we want to find the violating code.
//
////////////////////////////////////////////////////////////
// Following define is required in order to compile
// exception-related code.
// See MSDN for AddVectoredExceptionHandler
#define _WIN32_WINNT 0x0500
// defines the signature to be placed before and after
// the actual allocated block
static const unsigned char SIGNATURE[] = {0xAB, 0x43, 0xDE, 0x72};
static const unsigned int SIZEOF_SIGNATURE = sizeof(SIGNATURE);
///////////////////////////////////////////////
// This function will replace the regular "malloc". In this
// example the "main" function will invoke it directly, but
// in "Windows Leaks Detector" project this code can be placed
// inside the hook function for HeapAlloc
///////////////////////////////////////////////
void * malloc_signature(size_t size)
{
// The actual allocated block will contain:
// + the memory block to be returned to the user
// + 2 signature borders - before and after user's block
// + additional size_t value, to store the size of the
// block which the user requested. Note, that, when
// integrated to Leaks Detector, this field will
// not be required, as anyway the size is stored as
// part of internal structures.
char * tmp = (char *) malloc(size + (SIZEOF_SIGNATURE * 2) + sizeof(size_t));
if (tmp == NULL) return NULL;
// Layout of the memory block will be:
// [size of data][signature border][user's data][signature border]
// Store the size of user's block
*reinterpret_cast<size_t*>(tmp) = size;
tmp += sizeof(size_t);
// Store the signature before the block
memcpy(tmp, SIGNATURE, SIZEOF_SIGNATURE);
tmp += SIZEOF_SIGNATURE; // now "tmp" points to beginning of user's data
// Store the signature after the block
memcpy(tmp + size, SIGNATURE, SIZEOF_SIGNATURE);
// Return the pointer to user's data
return tmp;
}
///////////////////////////////////////////////
// free_signature is called to release blocks,
// allocated by malloc_signature. For Leaks Detector
// project this code will be executed as part of
// hook function for HeapFree, when the block
// will be identified as having signature protection
// (based on internal data for allocation block)
///////////////////////////////////////////////
void free_signature(void * p)
{
char * orig = static_cast<char*>(p);
// the pointer returned to the user in "malloc_signature"
// is shifted by size of (int + signature block)
// from the beginning of actual block allocated by
// "malloc" (or HeapAlloc in general), so we need
// to restore the original pointer.
orig -= (SIZEOF_SIGNATURE + sizeof(size_t));
// read the size of user's block
// in Leaks Detector application this data will be
// stored as part of info for allocation block
size_t allocation_size = *(reinterpret_cast<size_t*>(orig));
// print error message if one of the signature
// blocks (or both) were changed
if (!bStartOK) {
if (!bEndOK) {
printf("Warning: block of size %d is corrupt - before and after\n", allocation_size);
} else {
printf("Warning: block of size %d is corrupt - before\n", allocation_size);
}
} else if (!bEndOK) {
printf("Warning: block of size %d is corrupt - after\n", allocation_size);
}
// release the original bloch, allocated by "malloc"
free (orig);
}
///////////////////////////////////////////////
// This function will be invoked automatically
// by Windows each time an exception occurs,
// even before it reaches frame-based application
// exception handler (such as try-catch in C++).
// Only when the application is being debugged, the
// debugger will get a notification first - which is
// even better, as a live call stack and all relevant
// context will be available.
///////////////////////////////////////////////
LONG WINAPI MyExceptionsHandler(PEXCEPTION_POINTERS ExceptionInfo)
{
// check the type of exception
if (ExceptionInfo->ExceptionRecord->ExceptionCode == STATUS_GUARD_PAGE_VIOLATION)
{
printf("Access violation caught - print call stack, activate a breakpoint etc.\n");
// when STATUS_GUARD_PAGE_VIOLATION exception is raised, the
// protection of the page is automatically reset to READ/WRITE,
// so next attempt to access same memory won't fail
return EXCEPTION_CONTINUE_EXECUTION;
}
// global variable to hold handle to exception handle
PVOID gExHandler = NULL;
// global variable, which will receive system page size
DWORD gPageSize = 0;
///////////////////////////////////////////////
// This function must be called before any
// protected allocation is made.
// It will initialize all global variables, and
// set the exception handler.
///////////////////////////////////////////////
void protected_init()
{
// query the System Info in order to get page size
SYSTEM_INFO si;
::GetSystemInfo(&si);
gPageSize = si.dwPageSize;
printf("Page size is: %ld\n", gPageSize);
// set "MyExceptionsHandler" function as the first
// exception handler. In case of memory access violation
// we want out function to be called, while the
// call stack remain unchanged.
// Notes:
// 1) In order for this code to compile, we had to put
// #define _WIN32_WINNT 0x0500
// at the beginning of the file, before the include of
// <windows.h> header.
// 2) There should be a clean-up function, which will
// call "RemoveVectoredExceptionHandler" with returned
// handler. In current code it is not implemented.
// 3) If there's a debugger attached to this process, it
// will receive the notification before our handler.
gExHandler = ::AddVectoredExceptionHandler(1 /*call me first*/, MyExceptionsHandler);
if (gExHandler == NULL)
printf("Failed to set MyExceptionsHandler\n");
}
///////////////////////////////////////////////
// Similary to "malloc_signature", this function
// will be invoked by "main" instead of a call
// to malloc/new. In "Windows Leaks Detector" project
// this code can be placed inside the hook function
// for HeapAlloc
///////////////////////////////////////////////
void * malloc_protected(size_t size)
{
// calculate the number of full pages required to cover
// the requested data size.
// (size / gPageSize) will give the number of full
// pages contained in "size"
// (size % gPageSize) will be bigger than 0 in case
// there's a reminder of division
// operation - additional page is required
unsigned int iTotalPagesForData = ((unsigned long)size / gPageSize) +
((unsigned long)size % gPageSize == 0) ? 0 : 1;
// allocate virtual memory of size "iTotalPagesForData + 1" pages,
// to accomodate the requesed buffer + guarded page.
char * pRegionStart = (char*) ::VirtualAlloc(NULL, (iTotalPagesForData +1 ) * gPageSize, MEM_COMMIT, PAGE_READWRITE);
if (pRegionStart == NULL) {
printf("VirtualAlloc returned NULL\n");
return NULL;
}
// set PAGE_GUARD protection on last allocated page. On any
// read/write access to this page STATUS_GUARD_PAGE_VIOLATION
// exception will be raised.
// Notes:
// 1) VirtualProtection can't be set on part of a page,
// but only on whole pages. For this reason we can't
// just set protection on a "border" around allocated
// block, and have to allocate much more memory
// then requested by user.
// 2) After the exception is raised, the page permissions will
// be changed to PAGE_READWRITE, as we specified
// (PAGE_GUARD | PAGE_READWRITE) protection.
// For this reason PAGE_GUARD flag can't be used alone,
// but has to be or'ed with other flag.
DWORD dwOldProtect;
if (! ::VirtualProtect(pRegionStart + (iTotalPagesForData * gPageSize), gPageSize, PAGE_GUARD | PAGE_READWRITE, &dwOldProtect)) {
printf("VirtualProtecd failrd\n");
return NULL;
}
// when we will go "size" bytes back from the guarded page,
// we will promise that the the pointer returned to user
// points to a safe buffer of requested size, but the first
// byte after this buffer is guarded.
return pRegionStart + (iTotalPagesForData * gPageSize - size);
}
///////////////////////////////////////////////
// Releases memory allocated by "malloc_protected"
///////////////////////////////////////////////
void free_protected(void *p)
{
// query the address of the page containing "p"
// Instead, we could keep the original address
// returned by VirtualAlloc as part of the info
// of allocation block (in Leaks Detector)
MEMORY_BASIC_INFORMATION memInfo;
::VirtualQuery(p, &memInfo, sizeof(MEMORY_BASIC_INFORMATION));
// release the memory
if (! ::VirtualFree(memInfo.AllocationBase, 0 /*has to be 0 for MEM_RELEASE*/, MEM_RELEASE))
printf("Failed to release virtual memory\n");
}
*(arr10 - 1) = '\0'; // 10: overflow before the block
arr10[10] = '\0'; // 10: overflow after the block
*(arr11 - 1) = '\0'; // 11: overflow before the block
arr12[12] = '\0'; // 12: overflow after the block
// error messages will be printed when releasing the buffers
free_signature (arr10);
free_signature (arr11);
free_signature (arr12);


Brand
Logos
Colours
Typefaces
Includes
Below is a reference of all the includes available for pages within the website.
Layouts
Below is a reference of all the layouts available for pages within the website.
Icons
The sprite sheet contains the following icons for use in the website. Combine the icons with Modulifier & Typografier classes for lots of variability.
Icons
Sample code for using SVG icon spritesheets mixed with a text label, using the below classes.

<svg><use xlink:href="/images/icons.svg#icon-id"></use></svg>

Icon label

Icon classes
Classes that can be used on elements & combined to make nicely aligned icons and labels.
Typography
The modular typography uses a system generated by Typografier. There are multiple sizes and spacing classes available—all based on the font-size and line-height to create a harmonious vertical rhythm.
Size adjustments
Typografier generates font-sizes and line-heights for different screen widths that are more appropriate for the available space.
Vertical spacing
The vertical spacing classes generated by Typografier provide a range of different sizes for both top & bottom padding and bottom margins. These same sizes would be applied to the island classes.
Horizontal spacing
The horizontal spacing classes generated by Typografier provide range of different sizes for left & right padding. These same sizes would be applied to the island classes.
Font sizes
There are multiple font-sizes available based on a typographic scale. The font-sizes and line-heights increase as the screen gets wider to better use the available space.
Utility classes
Modules
Modulifier generates a series of simple, default CSS components that can be used throughout the site, or as basic building blocks for more complex patterns.
Images & embed containers
Embed containers should be used for all content images, enforcing aspect ratios but also giving browsers a placeholder for the graphic before it loads to prevent unnecessary text reflows.

Media objects
A simple pattern that provides and image beside some text—good for comments with avatars and many other situations. Will usually be combined into larger patterns.

Lorem ipsum dolor sit amet, consectetuer adipiscing elit.

Skip links
A helpful accessibility feature that should be included immediately within the
tag on the top of most pages.

Jump to main content

Jump to main navigation

Pause all animations

Grid
The grids generated by Gridifier provide an array of sizing options—with explicit classes—for each major breakpoint.
Grid sizes
Utility classes
Mix & match classes for grids and units to make any responsive layout necessary for templates.
{% pattern footer/footer text="thank you for stopping by!" %}
| Field name | Data type | Example | |||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
text
required
|
string
|
"thank you for stopping by!" |
Sections
Buttons
{% pattern buttons/basic url="/case-studies/natures-care/" text="view project" %}
| Field name | Data type | Example | |||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
url
required
|
url
|
/case-studies/natures-care/ | |||||||||||||||||||||
text
required
|
text
|
view project |
{% pattern buttons/glow<EMAIL_ADDRESS>text="say hello" target="_blank" %}
| Field name | Data type | Example | |||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
url
required
|
url
|
<EMAIL_ADDRESS>| |||||||||||||||||||||
text
required
|
text
|
say hello | |||||||||||||||||||||
target
required
|
text
|
_blank |
{% pattern buttons/btn-work url="/case-studies/mindu/" text-color="btn-mindu" btn-work-shadow="btn-mindu-shadow" %}
| Field name | Data type | Example | |||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
url
required
|
url
|
/case-studies/mindu/ | |||||||||||||||||||||
text-color
required
|
string
|
"btn-mindu" | |||||||||||||||||||||
btn-work-shadow
required
|
string
|
"btn-mindu-shadow" |
Header
{% pattern banner/banner %}


Extreme Quotes
It's 10 years since the publication of Extreme Programming Explained by Kent Beck. People don't talk much about XP any more, these days it's Agile, Scrum and Lean. I've just read the book though, and found it both provocative and inspirational. For example:
Defects should be notable because they are rare. Major scope adjustment, due to slow progress, should only occur in the first half of the schedule. Initial deployment should occur after only a small percentage of the project budget is spent. The system should be "whole" at the end of the first week.
Can you put your hand on your heart and say you always achieve these goals?
The values of XP are communication, simplicity, feedback, courage and respect. Just think about that. What does it mean for a methodology to have values? Is this a way to build software or a way to live you life? Or both? For me XP is more of a philosophy than a methodology, and the book is a call to action.
I think one of the reasons XP grew into a significant movement is because Beck has such a great turn of phrase:
Start where you are now and move toward the ideal. It's always a people problem. Technique also matters. Align authority and responsibility. Silence is the sound of risk piling up. Satisfaction comes from doing quality work. Conflict and disagreement are the seeds of learning. Write a little test before every change.
Beck says that his vision for XP is:
An always deployable system to which features, chosen by the customer, are added and automatically tested on a fixed heartbeat.
10 years ago this did seem extreme; now it's a standard development approach. One you have to strive to realise and work at and practice for sure, but standard all the same.


Home
Search
About
GitHub
The STEM Project
State
(All)
Alabama
Alaska
Arizona
Arkansas
California
Colorado
Connecticut
Delaware
District Of Columbia
Florida
Georgia
Hawaii
Idaho
Illinois
Indiana
Iowa
Kansas
Kentucky
Louisiana
Maine
Maryland
Massachusetts
Michigan
Minnesota
Mississippi
Missouri
Montana
Nebraska
Nevada
New Hampshire
New Jersey
New Mexico
New York
North Carolina
North Dakota
Ohio
Oklahoma
Oregon
Pennsylvania
Rhode Island
South Carolina
South Dakota
Tennessee
Texas
Utah
Vermont
Virginia
Washington
West Virginia
Wisconsin
Wyoming
Major
Biology
Chemistry
Computer Science
Mathematics
Physics
Find my school!


I'm using the emonTx_CT123 code only modified to add two temperature sensors. I have one CT on the main supply to the house.
When the electricity usage goes above about 4.5kW I only seem to get one ready per minute instead of the usual one every five seconds. I also get no temperature readings at the same time.
I'm guessing it may be interference with the wireless signal cause by the higher power usage? I have moved my PI closer to the emontx but it has made no difference.
My other thought was that it could be power supply related, I'm using and old blackberry usb charger to power the board.
Any suggestions?
Cheers
Jon
Re: [SOLVED] Only getting 1 reading every minute when over 4.5kW
Thoughts:
Re: [SOLVED] Only getting 1 reading every minute when over 4.5kW
Thanks for the quick response.
I probably wasn't very clear - the temperatures work all the time apart from when the power usage is high.
Have a look here - http://bev.csdl.biz/emoncms/jonbev&id=1 if you zoom in on yesterday at about 6:30am there is a good example. No temps between 6:30 and 6:45 and only 15 power measurements in the same time period.
Re: [SOLVED] Only getting 1 reading every minute when over 4.5kW
Have you checked the mains voltage into the USB power supply, and the 5 V out, when you're drawing > 4.5 kW. You might just have a loose connection in your house wiring that needs prompt attention.
What about the power supply to the Raspberry Pi that receives the data?
If not that:
There's nothing inherent in the code in the emonTx that I know of that could cause that. So the starting point is, Is the main loop being executed at the correct rate - every 5 s or so? What values are in PayloadTX prior to transmission?
(If those are correct, an easy way to continue testing without wasting power: temporarily overwrite the genuine power with '5000' or some similar value that is known to cause the problem).
How are you receiving the data and processing it - is that where it's falling over? Are you not receiving the data, or are you receiving incorrect values that are being rejected?
Re: [SOLVED] Only getting 1 reading every minute when over 4.5kW
OMG what an idiot!
I installed the event module a while back and set up a rule to email when power > 5000. I guess 1 minute is the timeout on the send email process.
I have removed the rule now.
Thanks for your help Robert.
Re: [SOLVED] Only getting 1 reading every minute when over 4.5kW
Rule no. 1: Look for the most simple and obvious explanation first.
[Face - palm?] Don't worry too much, I've got the baseball cap and the T-shirt!


G’day, my name’s Grant. 👋
Based in Amsterdam, NL originally from Auckland, NZ.
I’m a Product Manager at Bynder and spend most of my time helping build Bynder Orbit.
In my spare time I pretend that I can DJ.
G’day, my name’s Grant. 👋
Based in Amsterdam, NL originally from Auckland, NZ.
I’m a Product Manager at Bynder and spend most of my time helping build Bynder Orbit.
In my spare time I pretend that I can DJ.


Make a New Object!
button demo
Draw a line with a length of:
Draw Line
Draw a rectangle with height:
width:
Draw Rectangle
Draw a circle with radius:
Draw Circle
Clear Canvas
Draw Lines
Just Fun to Click
Free Draw
Save file name as:
Save Piece
Load file of name (ex: "head.png"):
Test Save
Save total object as (ex: 'person1'):
Export Complete Character


Migrating from Aptana Studio 2 to Aptana Studio 3
Welcome to Aptana Studio 3. This is meant as a brief guide for how to get started in Aptana Studio 3 if you are a long-time Aptana Studio 2 user.
Chapters
Migrating Projects
Aptana Studio 2 and Aptana Studio 3 have different workspaces, so you can use the two products simultaneously. In order to work with a project in Aptana Studio 3, you will want to import your project from one workspace to the other.
It is not recommended to edit a project in both Studio 2 and Studio 3. Once you import a project, it is suggested you stick with Studio 3 for editing.
To migrate your projects from Studio 2 to Studio 3
-
From the File menu, select Import to open a "Import" pop-up window.
-
Select General > Existing Projects into Workspace
-
Browse to your Aptana Studio 2 workspace folder by clicking on the top Browse... button. Click Open
-
The "Projects" list will contain a list of all of the projects it has found. Uncheck the ones you do not wish to import.
-
A checkbox will ask you if you wish to copy the projects into your workspace. Generally the answer is "yes," but note that that leaves a copy in the Aptana Studio 2 workspace, and a separate copy in Aptana Studio 3.
-
Click the Finish button.
Migrating Web, PHP and Rails projects
Studio 3 changed a few things underneath the hood regarding how projects are processed. We've attempted to automate the migration process for you as you move from one environment to the other, but it's possible this process may not work in every possible circumstance. You would notice it most specifically with regards to missing content assist. In order to fix this, you'll need to reset the "Natures" on a project.
As a first step, you can try just restarting Aptana Studio. If that doesn't work, try modifying the project natures (bottom of the page here): Importing an Existing Project
Importing connections is a separate step:
-
Select File > Import > Studio/Connections
-
Make sure the "Workspace" radio button is selected, and browse to your Aptana Studio 2 workspace
-
Click Finish. Your connections will show up in the Remote Connections view, and attached to projects.
Unable to render embedded object: File (Screen shot 2011-04-20 at 12.51.09 PM.png) not found.
You can repeat this process multiple times and it will not re-import duplicates.
File View/Remote Connections
File View has been replaced by a "Local Filesystem" node in the Project Explorer view. The "Connections" note is now visible from the "Remote" view, available in Window > Show View > Remote
Another change is that "Untitled Files" of various types (i.e. Untitled HTML File, Untitled CSS File) are no longer supported in the new file wizard. While a useful feature, it led to a great deal of hacked-together workarounds in the underlying code base. We are looking at how we may be able to bring this feature back in a future release.
Content Assist
Studio 3 simplified greatly the concept of adding JavaScript content assist. Rather than a references view that needed to be constantly updated, we've instead allowed the user to drop content assist files into an existing project to get good code assist that way. We've ported over all of the libraries we can from Studio 2, but some work needs to be done in getting content assist files for additional libraries like MootTools and node.js. If you are interested in helping, please let us know.
PHP
Studio 2 utilized the Eclipse PHP Development Tools for PHP support. Studio 3 introduces a separate PHP plugin so that we better integrate PHP support throughout the product, and to reduce the overall install footprint. For those who prefer the PDT editors, you can either install the existing PDT all-in-one distro, and add Aptana Studio, or install PDT into Aptana Studio 3.
Rails
Aptana Studio 3 includes RadRails, so no separate download is required. We've removed some of the helper views from before, as most rails developers are familiar with how to do many of the tasks on the command line that those views facilitated. For more information, see Rails Development.
Customization/Preferences
Formatting preferences are the most notable change, but in general, the defaults should be relative similar. See here for more details: Differences between Studio 2 and Studio 3
Scripting
Aptana Studio 3 introduced the concept of Rubles, Ruby-based scripting bundles based on Textmate bundles. A number of these bundles have been ported already, and a rich SDK exists for users who want to create or extend existing bundles. If you were using Eclipse Monkey, we are investigating adding JavaScript scripting support as another mechanism for Scripting Studio, but there is no firm ETA on that yet. However, everything that could be done in Eclipse Monkey can be done with Rubles, and the documentation and existing Rubles should give plenty of examples.
Previewing Files/Run/Launch Configurations
Studio 2 relied on an internal browser preview utilizing the native platform browser. Studio 3 instead relies on Chromium for previewing, a WebKit-based browser. You can find out more about previewing files here: Preview a project in your web browser.
Launch configurations may be exported and imported using the standard Eclipse export/import mechanism. See here: Exporting and importing preferences.
Colorization/Themes
Aptana Studio 3 uses a different mechanism for colorizing files than Aptana Studio 2 did. There is no converter yet, but you can use any existing Textmate theme you like. If you'd like to create your own theme, you can read more about it.


The t_jmatrix is one way to represent a transformation.
More...
|
| void | jgraphics_matrix_init (t_jmatrix *x, double xx, double yx, double xy, double yy, double x0, double y0) |
| | Set a t_jmatrix to an affine transformation. More...
|
| |
| void | jgraphics_matrix_init_identity (t_jmatrix *x) |
| | Modify a matrix to be an identity transform. More...
|
| |
| void | jgraphics_matrix_init_translate (t_jmatrix *x, double tx, double ty) |
| | Initialize a t_jmatrix to translate (offset) a point. More...
|
| |
| void | jgraphics_matrix_init_scale (t_jmatrix *x, double sx, double sy) |
| | Initialize a t_jmatrix to scale (offset) a point. More...
|
| |
| void | jgraphics_matrix_init_rotate (t_jmatrix *x, double radians) |
| | Initialize a t_jmatrix to rotate (offset) a point. More...
|
| |
| void | jgraphics_matrix_translate (t_jmatrix *x, double tx, double ty) |
| | Apply a translation to an existing matrix. More...
|
| |
| void | jgraphics_matrix_scale (t_jmatrix *x, double sx, double sy) |
| | Apply a scaling to an existing matrix. More...
|
| |
| void | jgraphics_matrix_rotate (t_jmatrix *x, double radians) |
| | Apply a rotation to an existing matrix. More...
|
| |
| void | jgraphics_matrix_invert (t_jmatrix *x) |
| | Invert an existing matrix. More...
|
| |
| void | jgraphics_matrix_multiply (t_jmatrix *result, const t_jmatrix *a, const t_jmatrix *b) |
| | Multiply two matrices: resulting matrix has effect of first applying a and then applying b. More...
|
| |
| void | jgraphics_matrix_transform_point (const t_jmatrix *matrix, double *x, double *y) |
| | Transform a point using a t_jmatrix transormation. More...
|
| |
The t_jmatrix is one way to represent a transformation.
You can use the t_jmatrix in the call to jgraphics_transform(), jgraphics_setmatrix(), and jgraphics_pattern_set_matrix for specifying transformations.
◆ jgraphics_matrix_init()
| void jgraphics_matrix_init |
( |
t_jmatrix * |
x, |
|
|
double |
xx, |
|
|
double |
yx, |
|
|
double |
xy, |
|
|
double |
yy, |
|
|
double |
x0, |
|
|
double |
y0 |
|
) |
| |
Set a t_jmatrix to an affine transformation.
- Parameters
-
◆ jgraphics_matrix_init_identity()
| void jgraphics_matrix_init_identity |
( |
t_jmatrix * |
x | ) |
|
Modify a matrix to be an identity transform.
- Parameters
-
◆ jgraphics_matrix_init_rotate()
| void jgraphics_matrix_init_rotate |
( |
t_jmatrix * |
x, |
|
|
double |
radians |
|
) |
| |
Initialize a t_jmatrix to rotate (offset) a point.
- Parameters
-
| x | The t_jmatrix. |
| radians | The angle or rotation in radians. |
◆ jgraphics_matrix_init_scale()
| void jgraphics_matrix_init_scale |
( |
t_jmatrix * |
x, |
|
|
double |
sx, |
|
|
double |
sy |
|
) |
| |
Initialize a t_jmatrix to scale (offset) a point.
- Parameters
-
| x | The t_jmatrix. |
| sx | The horizontal scale factor. |
| sy | The vertical scale factor. |
◆ jgraphics_matrix_init_translate()
| void jgraphics_matrix_init_translate |
( |
t_jmatrix * |
x, |
|
|
double |
tx, |
|
|
double |
ty |
|
) |
| |
Initialize a t_jmatrix to translate (offset) a point.
- Parameters
-
| x | The t_jmatrix. |
| tx | The amount of x-axis translation. |
| ty | The amount of y-axis translation. |
◆ jgraphics_matrix_invert()
| void jgraphics_matrix_invert |
( |
t_jmatrix * |
x | ) |
|
Invert an existing matrix.
- Parameters
-
◆ jgraphics_matrix_multiply()
Multiply two matrices: resulting matrix has effect of first applying a and then applying b.
- Parameters
-
| result | The resulting product t_jmatrix. |
| a | The first operand. |
| b | The second operand. |
◆ jgraphics_matrix_rotate()
| void jgraphics_matrix_rotate |
( |
t_jmatrix * |
x, |
|
|
double |
radians |
|
) |
| |
Apply a rotation to an existing matrix.
- Parameters
-
| x | The t_jmatrix. |
| radians | The angle or rotation in radians. |
◆ jgraphics_matrix_scale()
| void jgraphics_matrix_scale |
( |
t_jmatrix * |
x, |
|
|
double |
sx, |
|
|
double |
sy |
|
) |
| |
Apply a scaling to an existing matrix.
- Parameters
-
| x | The t_jmatrix. |
| sx | The horizontal scale factor. |
| sy | The vertical scale factor. |
◆ jgraphics_matrix_transform_point()
| void jgraphics_matrix_transform_point |
( |
const t_jmatrix * |
matrix, |
|
|
double * |
x, |
|
|
double * |
y |
|
) |
| |
Transform a point using a t_jmatrix transormation.
- Parameters
-
| matrix | The t_jmatrix. |
| x | The address of the variable holding the x coordinate. |
| y | The address of the variable holding the y coordinate. |
◆ jgraphics_matrix_translate()
| void jgraphics_matrix_translate |
( |
t_jmatrix * |
x, |
|
|
double |
tx, |
|
|
double |
ty |
|
) |
| |
Apply a translation to an existing matrix.
- Parameters
-
| x | The t_jmatrix. |
| tx | The amount of x-axis translation. |
| ty | The amount of y-axis translation. |


This message was intended for {form.first_name.data} {form.last_name.data}. This message has been automatically generated, please do not reply to this message as PowellTech will not receive it. If you did not recently complete a PowellTech © repair, please contact us immediately to be removed from our database; it is also recommended that you change your e-mail password. Please feel free to review the PowellTech Terms of Service and Privacy Policy.
Copyright © 2019 Powell Industries
All Rights Reserved.


Watch any TV show anywhere anytime.
Watch on your TV
Watch on the go
Watch on any computer
Successfully created account.
Your first name is required.
Your last name is required.
An email is required.
This needs to be a valid email.
A password is required.


TCP stands for Transmission Control Protocol and is used in a similar way to packet switching. TCP defrags files into small pieces to make it easier to send. Once at the receiving end it puts all the parts back together to get the original file. IP stands for Internet Protocol and is similar to TCP. IP uses the same defragging method but instead adds an address so that it all goes to the right place. The IP sends the data in the most efficient way possible even if a connection is disrupted. Both TCP and IP work together to make file sharing easier and faster. TCP/IP was first created and used in 1983 and was used so that there would not be a only a central control. The original name was inter-network but was later changed to TCP/IP. Want to learn more, watch the video below


The other queen by Philippa Gregory
About the book
Author: Gregory, Philippa
Title: The other queen
Publication: London : HarperCollins, 2008. ISBN<PHONE_NUMBER>348.
DAISY audio format narrated by Anne Glatt and Marc Rosen. CELA library call number DC34129. 442 pages in the paperback edition; 13 hrs., 37 mins. as a recorded book.
About the story
Set in the 16th century England of Elizabeth I, this historical novel tells the story of Mary, Queen of Scots (1542-1587). It is narrated from the perspectives of three people: in Mary’s own voice, in that of George Talbot, Earl of Shrewsbury, and in that of Bess of Hardwick, his wife. The recorded book is read by two people: Anne Glatt reads Mary and Bess, while Mark Rosen reads George.
Mary is already Queen Elizabeth’s captive at the start of the story. She is sent in exile to live with George and Bess under house arrest, and spends her time plotting escape and the overthrow of her rival. George, ever mindful of the honour of the Talbots, falls in love with her and is torn by his divided loyalties to the two queens. Bess, who primarily cares for her own hard-won riches, is pulled away from the tranquil management of her estates and ruined by the devastating costs of the exiled queen’s court.
The story provides many details about the life the nobility of the period, rife with political intrigue and the threat of war. It moves at a moderate to slow pace.
Recommended?
If you enjoy the post-Reformation politics of the Elizabethan era, you will enjoy this book, which goes into great detail about the people and life at the time. I confess that it did not hold my undivided attention.


Using Let’s Encrypt as a free, automated, and open Certificate Authority on Ubuntu server. See https://letsencrypt.org/
Requirements
A working Ubuntu 16.04 server running Nginx web server. Determine your Ubuntu version with lsb_release -a
.
Install Certbot
Since Certbot is packaged for your system, all you’ll need to do is apt-get the following packages.
-
sudo apt update
-
sudo apt upgrade
-
sudo apt-get install letsencrypt
Alternative Install
Uses a Certbot maintained PPA.
-
sudo apt update
-
sudo apt install software-properties-common
-
sudo add-repository ppa:certbot/certbot
-
sudo apt update
-
sudo apt install certbot
Nginx
Certbot can be used for Apache or Nginx site. This is not a guide on Nginx, so only the minimum requirements for a very basic site are mentioned here.
Let’s say we have two domains, example.com and another.com. Their static files are served from /var/www/example and /var/www/another. View their example configuration files below.
# Virtual Host configuration for example.com server { listen 80; listen [::]:80; server_name example.com; root /var/www/example; index index.html index.htm; location / { try_files $uri $uri/ =404; } }
# Virtual Host configuration for another.com server { listen 80; listen [::]:80; server_name another.com; root /var/www/another; index index.html index.htm; location / { try_files $uri $uri/ =404; } location = /favicon.ico { log_not_found off; access_log off; } location = /robots.txt { allow all; log_not_found off; access_log off; } location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { expires max; log_not_found off; } }
Enable the sites and reload Nginx.
-
sudo ln -s /etc/nginx/sites-available/example /etc/nginx/sites-enabled/
-
sudo ln -s /etc/nginx/sites-available/another /etc/nginx/sites-enabled/
-
sudo service nginx reload
| Disable a site by deleting the file in /etc/nginx/sites-enabled/ |
Get the certificate
For Nginx on Ubuntu 16.04, we can only get the certificate but cannot fully install it. The following will get a certificate that is valid on the following domains: gruffgoat.com, www.gruffgoat.com, m.gruffgoat.com, werkspc.com, m.werkspc.com, and elk.werkspc.com.
letsencrypt certonly --webroot -w /var/www/example -d example.com -d www.example.com -d m.example.com -w /var/www/another -d another.com -d m.another.com -d elk.another.com
Upon success, you receive a message similar to:
Congratulations! Your certificate and chain have been saved at /etc/letsencrypt/live/example.com/fullchain.pem. Your cert will expire on 2017-01-01. To obtain a new version of the certificate in the future, simply run Let's Encrypt again.
Update configurations for SSL
Now Nginx must be told to use the new certificates. Just add a few lines to both configuration files.
# Also /etc/nginx/sites-available/another # Add these lines to the current configuration within server listen 443 ssl; listen [::]:443; ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers HIGH:!aNULL:!MD5;
-
sudo service nginx reload
Apache Systems
Even though Certbot has a good plugin for Apache, I prefer to perform much of the setup manually.
Get Certificate
Get a certificate that is valid on the following domains: tosamakers.com, www.tosamakers.com, tosaeasttowne.org, www.tosaeasttowne.org, bd-designs.com, and www.bd-designs.com.
letsencrypt certonly --webroot -w /var/www/tosamakers.com/html -d tosamakers.com -d www.tosamakers.com -w /var/www/tosaeasttowne.org/html -d tosaeasttowne.org -d www.tosaeasttowne.org -w /var/www/bd-designs.com/html -d bd-designs.com -d www.bd-designs.com
Upon success, you receive a message similar to:
Congratulations! Your certificate and chain have been saved at /etc/letsencrypt/live/example.com/fullchain.pem. Your cert will expire on 2017-01-01. To obtain a new version of the certificate in the future, simply run Let's Encrypt again.
| Make certain to note the location of the fullchain.pem. |
Configure for SSL
Each domain that uses a certificate must be configured for it. Create a new SSL configuration file for each domain. The example below is the SSL configuration file for tosamakers.com. Note that the SSLCertificateFile and SSLCertificateKeyFile lines point to the location of the fullchain.pem.
# start TOSAMAKERS.COM <IfModule mod_ssl.c> <VirtualHost *:443> ServerName tosamakers.com ServerAlias *.tosamakers.com DocumentRoot /var/www/tosamakers.com/html <Directory /var/www/tosamakers.com/html> Options -Indexes +FollowSymLinks +MultiViews AllowOverride All Order allow,deny allow from all </Directory> SSLCertificateFile /etc/letsencrypt/live/tosaeasttowne.org/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/tosaeasttowne.org/privkey.pem Include /etc/letsencrypt/options-ssl-apache.conf </VirtualHost> </IfModule> # end TOSAMAKERS.COM
This configuration also has the line Include /etc/letsencrypt/options-ssl-apache.conf. The Certbot Apache plugin creates and links to this file. Let’s follow this practice as it makes the configurations more uniform and easier to read. The contents of this file are shown below.
# Baseline setting to Include for SSL sites SSLEngine on # Intermediate configuration, tweak to your needs SSLProtocol all -SSLv2 -SSLv3 SSLCipherSuite ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA SSLHonorCipherOrder on SSLCompression off SSLOptions +StrictRequire # Add vhost name to log entries: LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" vhost_combined LogFormat "%v %h %l %u %t \"%r\" %>s %b" vhost_common #CustomLog /var/log/apache2/access.log vhost_combined #LogLevel warn #ErrorLog /var/log/apache2/error.log # Always ensure Cookies have "Secure" set (JAH 2012/1) #Header edit Set-Cookie (?i)^(.*)(;\s*secure)??((\s*;)?(.*)) "$1; Secure$3$4"
Enable the Sites
The sites are available, now lets enable them.
-
sudo a2ensite tosamakers.com-ssl example.com-ssl
-
Sites may be disabled with
sudo a2dissite
Test and Reload the Configurations
Before reloading the configurations or restarting Apache, it is wise to check the configuration. Typos are easy to make and downtime is expensive.
-
Test with
sudo apachectl -t
-
Reload with
sudo service apache2 reload
-
Or, restart with
sudo service apache2 restart
Renewal on Apache System
-
sudo letsencrypt renew --dry-run --agree-tos
-
Assuming success,
sudo letsencrypt renew --agree-tos
Using certbot-auto
Certbot-auto is for those systems which do not have a certbot package. The command syntax for certbot-auto is the same as it is for letsencrypt.
Renewal
-
Dry run,
sudo ./certbot-auto renew --dry-run
-
Assuming success,
sudo ./certbot-auto renew
new certificate deployed with reload of apache server; fullchain is /etc/letsencrypt/live/yourdomain.com/fullchain.pem
Certbot Manual
I use Certbot manual to manage certificates for servers not running web services, i.e email servers. There are multiple ways to verify your ownership using manual but I prefer using the DNS challenge which requires setting a TXT value in the domain record.
Authenticate and get certificate
-
sudo certbot certonly --manual -d yourdoamin.com --preferred-challenges=dns
This requests permission to log your IP address and then asks:
Please deploy a DNS TXT record under the name _acme-challenge.yourdomain.com with the following value: some_text_provided_on_the_screen
When successful, it concludes with:
Congratulations! Your certificate and chain have been saved at /etc/letsencrypt/live/yourdomain.com/fullchain.pem. Your cert will expire on 2017-10-06. To obtain a new or tweaked version of this certificate in the future, simply run certbot again. To non-interactively renew *all* of your certificates, run "certbot renew"
Move and install certificate
Make a tar archive of your certificates:
-
sudo cd /etc/letsencrypt/archive/yourdomain.com
-
sudo tar -czvf gogoat.tgz *??.pem
, Replace ?? with the latest number. -
sudo chown loginuser:loginuser yourarchive.tgz
, Replace loginuser with your root username. -
sudo mv yourarchive.tgz /home/loginuser
-
Use SCP or WinSCP to move the certificate to the server where it is needed.
-
Once moved, delete the tgz file from the source server.
-
Now switch to the server needing the certificate.
-
Unarchive the tgz.
For my email server, I need the private key concatenated with the full chain.
-
cat privkey.pem > servercert.pem
-
cat fullchain.pem >> servercert.pem
-
Make appropriate backups of your previous certificate chains.
-
Move the new servercert.pem into place.
-
Verify file ownerships and permissions.
-
Chmod on servercert.pem to 400.
-
Restart your services
Renew a manual certificate
To renew a manually installed certificate as created above, use the following command.
sudo certbot certonly --manual --force-renewal -d domain1,domain2 --preferred-challenges=dns
Move and install this renewed certificate as previously shown.
Miscellaneaus Certificate Commands
View and Test Full Certificate Information
View Full Certificate Information
sudo openssl x509 -noout -text -in /etc/letsencrypt/live/yourdomain.com/cert.pem
View Expiration Date
echo | openssl s_client -connect yourdomain.com:443 2>/dev/null | openssl x509 -noout -dates
or
sudo openssl x509 -noout -dates -in /etc/letsencrypt/live/yourdomain.com/cert.pem
View Common Name (top issued domain)
echo | openssl s_client -connect yourdomain.com:443 2>/dev/null | openssl x509 -noout -subject
or
sudo openssl x509 -noout -subject -in /etc/letsencrypt/live/yourdomain.com/cert.pem
View Alternative Names (other issued domains)
echo | openssl s_client -connect yourdomain.com:443 2>/dev/null | openssl x509 -noout -text | grep DNS
or
sudo openssl x509 -noout -text -in /etc/letsencrypt/live/yourdomain.com/cert.pem |grep DNS
Conclusion
The Let’s Encrypt certificate expires in 90 days and there are some methods available to automatically renew the certificate. Based on some additional configuration changes I make on some of my servers, this does not always work and I just make certain to use a hard reminder system.


§431:3-108 Reciprocal insurer. A reciprocal insurer means an unincorporated aggregation of subscribers operating individually and collectively through an attorney-in-fact common to all such persons to provide reciprocal insurance among themselves. [L 1987, c 347, pt of §2]


GenRadar: Self-supervised Probabilistic Camera Synthesis based on Radar Frequencies
If you intend to cite the paper, please use the following Bibtex entry
@article{ditzel2021genradar,
title={GenRadar: Self-Supervised Probabilistic Camera Synthesis Based on Radar Frequencies},
author={Ditzel, Carsten and Dietmayer, Klaus},
journal={IEEE Access},
volume={9},
pages={148994--149042},
year={2021},
publisher={IEEE}
}


Creates ICounters components by their descriptors. More...
Public Member Functions | |
| DefaultCountersFactory () | |
| Create a new instance of the factory. More... | |
| Public Member Functions inherited from PipServices3.Components.Build.Factory | |
| void | Register (object locator, Func< object, object > factory) |
| Registers a component using a factory method. More... | |
| void | RegisterAsType (object locator, Type type) |
| Registers a component using its type (a constructor function). More... | |
| object | CanCreate (object locator) |
| Checks if this factory is able to create component by given locator. More... | |
| object | Create (object locator) |
| Creates a component identified by given locator. More... | |
Creates ICounters components by their descriptors.
| PipServices3.Components.Count.DefaultCountersFactory.DefaultCountersFactory | ( | ) |
Create a new instance of the factory.


Here is my set of skills that implies with web and system development.

John Robert's Perspective
“The two most important days in your life are the day you are born and the day you find out why.”
John Robert's Perspective
“It's never too late to be the person you want to be.”
John Robert's Perspective
“See good in all things.”
John Robert's Perspective


New York Citi Bike Trip Histories
Use 201707-citibike-tripdata.csv.zip as dataset
This data has been processed to remove trips that are taken by staff as they service and inspect the system, trips that are taken to/from any of our “test” stations (which we were using more in June and July 2013), and any trips that were below 60 seconds in length (potentially false starts or users trying to re-dock a bike to ensure it's secure).
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import plotly.plotly as py
from datetime import datetime
from plotly.graph_objs import *
from geopy.distance import great_circle
from sklearn.metrics.pairwise import euclidean_distances
from scipy import signal
%matplotlib inline
use pandas to read data
df = pd.read_csv('./201707-citibike-tripdata.csv')
df.head()
df.info()
find out some null or NAN in dataframe, and we find NAN in birth year column
df.isnull().sum()
because birth year is not like real number, we do not use mean to fill missing data; using the most frequency data is more proper to fix it
df['birth year'] = df['birth year'].fillna(df['birth year'].mode()[0])
df.isnull().sum()
detect and fix thhe data
df.describe()
def show_box():
fig, axes = plt.subplots(nrows = 2, ncols = 5, figsize = (15,10))
i = 1
for col in df.columns:
if df[col].dtype == np.float64 or df[col].dtype == np.int64:
ax = plt.subplot(2, 5, i)
plt.boxplot(df[col])
ax.set_title(col)
i += 1
plt.show()
show_box()
df = df.drop(df[df['tripduration'] > 7 * 86400].index)
df = df.drop(df[df['birth year'] < 1917].index)
x1 = len(df['start station id'].unique())
y1 = len(df[['start station id', 'start station name']].drop_duplicates())
x2 = len(df['end station id'].unique())
y2 = len(df[['end station id', 'end station name']].drop_duplicates())
x1 == y1 and x2 == y2
x1 = len(df['start station id'].unique())
y2 = len(df[['start station id', 'start station latitude']].drop_duplicates())
x2 = len(df['end station id'].unique())
y2 = len(df[['end station id', 'end station latitude']].drop_duplicates())
x1 == y1 and x2 == y2
x1 = len(df['start station id'].unique())
y2 = len(df[['start station id', 'start station longitude']].drop_duplicates())
x2 = len(df['end station id'].unique())
y2 = len(df[['end station id', 'end station longitude']].drop_duplicates())
x1 == y1 and x2 == y2
More clear and easy to analyze
print len(df)
show_box()
make in_flow and out_flow generate more easily, so we translate time to timestamp that repersents how many hours from 2017-07-01 00:00:00; and also check timestamp should be positive
def timestamp(df):
tmp = []
t0 = datetime(2017, 7, 1, 0, 0)
for row in df.itertuples():
t1 = datetime.strptime(row[1], '%Y-%m-%d %H:%M:%S')
tm = int((t1 - t0).total_seconds() // 1800)
assert tm >= 0
tmp.append(tm)
df.insert(loc = 0, column = 'timestamp', value = tmp)
start_df = df[['starttime', 'start station id']]
timestamp(start_df)
end_df = df[['stoptime', 'end station id']]
timestamp(end_df)
start_df.head()
end_df.head()
append two columns and put them into set, so we can use len function to know the station number
station_id = list(set(df['start station id'].tolist() + df['end station id'].tolist()))
station_num = len(station_id)
station_num
use end_df and start_df to sum every timestamp, and the outcome is in_flow and out_flow
def cnt_flow(df):
flow = pd.DataFrame(np.zeros((48 * 31, station_num)), columns = station_id)
for row in df.itertuples():
if row[1] < 48 * 31:
flow.loc[row[1], row[3]] += 1
return flow
in_flow = cnt_flow(end_df)
out_flow = cnt_flow(start_df)
in_flow.to_csv('in_flow.csv')
out_flow.to_csv('out_flow.csv')
in_flow.head()
out_flow.head()
there are 634 stations and the average distance between them is 5438.88993843 meters
start_station = df[['start station id', 'start station name', 'start station latitude', 'start station longitude']]
start_station.columns = ['station id', 'station name', 'station latitude', 'station logitude']
end_station = df[['end station id', 'end station name', 'end station latitude', 'end station longitude']]
end_station.columns = ['station id', 'station name', 'station latitude', 'station logitude']
station = start_station.append(end_station, ignore_index = True)
station = station.drop_duplicates()
station = station.reset_index(drop = True)
station_num = len(station)
station.head()
to calculate the distance between stations, using the function great circle in package GeoPy
dist_sum = 0
for i in xrange(station_num):
for j in xrange(station_num):
a = (station.iloc[i, 2], station.iloc[i, 3])
b = (station.iloc[j, 2], station.iloc[j, 3])
dist_sum += great_circle(a, b).meters
print dist_sum / float(station_num * (station_num - 1) / 2) / 2 # divide two again because we calculate (a, b) and (b, a)
represent station by station id
pair_station = df[['start station id', 'end station id', 'starttime', 'stoptime']]
pair_station.head()
pair = {}
for row in pair_station.itertuples():
d = datetime.strptime(row[3], '%Y-%m-%d %H:%M:%S')
d = 'weekday' if d.isoweekday() < 6 else 'weekend'
if pair.get((row[1], row[2], d)):
pair[(row[1], row[2], d)] += 1
else:
pair[(row[1], row[2], d)] = 1
pair = sorted(pair.items(), key=lambda d: d[1])
end_cnt = 0
day_cnt = 0
for key, val in pair[::-1]:
if end_cnt >= 3 and day_cnt >= 3:
break
if 'weekend' in key and end_cnt < 3:
end_cnt += 1
print key, val
if 'weekday' in key and day_cnt < 3:
day_cnt += 1
print key, val
represent station by station id
mean_out_flow = pd.DataFrame(out_flow.mean().tolist(), station_id, columns = ['average flow'])
mean_out_flow.nlargest(3, 'average flow')
mean_in_flow = pd.DataFrame(in_flow.mean().tolist(), station_id, columns = ['average flow'])
mean_in_flow.nlargest(3, 'average flow')
(mean_in_flow + mean_out_flow).nlargest(1, 'average flow')
def cal_and_draw(in_df, out_df):
p_in_flow = in_df.tolist()
p_out_flow = out_df.tolist()
plt.figure(figsize=(15, 15))
plt.xlabel('time (per half hour)')
plt.plot(p_in_flow, label = 'in flow')
plt.plot(p_out_flow, label = 'out flow')
plt.legend()
plt.show()
print euclidean_distances(np.array(p_in_flow).reshape(1, -1), np.array(p_out_flow).reshape(1, -1))[0][0]
p_in_flow = in_flow[519]
p_out_flow = out_flow[519]
cal_and_draw(p_in_flow, p_out_flow)
cal_and_draw(p_in_flow - p_in_flow.mean(), p_out_flow - p_out_flow.mean())
cal_and_draw((p_in_flow - p_in_flow.mean()) / p_in_flow.std(), (p_out_flow - p_out_flow.mean()) / p_out_flow.std())
cal_and_draw(signal.detrend(p_in_flow), signal.detrend(p_out_flow))
a digital filter that can be applied to a set of digital data points for the purpose of smoothing the data, that is, to increase the signal-to-noise ratio without greatly distorting the signal
simple version
the window-length = 5 means smooth over a 2-hour (120 minute) window
for more usage can find here
cal_and_draw(signal.savgol_filter(p_in_flow, window_length = 5, polyorder = 0), signal.savgol_filter(p_out_flow, window_length = 5, polyorder = 0))
duration_df = df[['tripduration', 'gender']]
male_sum = 0
male = 0
female_sum = 0
female = 0
unknown_sum = 0
unknown = 0
for row in duration_df.itertuples():
gen = row[2]
if gen == 0:
unknown += 1
unknown_sum += row[1]
elif gen == 1:
male += 1
male_sum += row[1]
elif gen == 2:
female += 1
female_sum += row[1]
print float(male_sum) / float(male)
print float(female_sum) / float(female)
print float(unknown_sum) / float(unknown)
represent station by station id
in 519 station, there are most males visited in 426 station, there are most females visited, so we can visit there often lol
def keywithmaxval(d):
v = list(d.values())
k = list(d.keys())
return k[v.index(max(v))]
tra_df = df[['start station id', 'end station id', 'gender']]
cnt = {}
cnt2 = {}
for row in tra_df.itertuples():
if row[3] == 2:
if cnt.get(row[1]):
cnt[row[1]] += 1
else:
cnt[row[1]] = 1
if cnt.get(row[2]):
cnt[row[2]] += 1
else:
cnt[row[2]] = 1
if row[3] == 1:
if cnt2.get(row[1]):
cnt2[row[1]] += 1
else:
cnt2[row[1]] = 1
if cnt2.get(row[2]):
cnt2[row[2]] += 1
else:
cnt2[row[2]] = 1
print keywithmaxval(cnt)
print keywithmaxval(cnt2)
519 station, Pershing Square North, is most males visited becourse there are many big companies and good public transport; they can ride bike to company and avoid traffic jam
514 station, 12 Ave & W 40 St, is also many people visited because there are close to New York Line of the Lincoln Tunnel and easily to go to other city


Files CCore/inc/SafeBuf.h CCore/src/SafeBuf.cpp
This class is used to allocate file buffers. It provides a buffer of required length, but if the memory cannot be allocated, the small safeguard internal buffer is used.
class SafeBuf : NoCopy
{
static constexpr ulen SafeLen = 32 ;
char *ptr;
ulen len;
char safebuf[SafeLen];
public:
explicit SafeBuf(ulen len) noexcept;
~SafeBuf();
char * getPtr() const { return ptr; }
ulen getLen() const { return len; }
};


Survey Form - freeCodeCamp
Survey Form: European Cities
This is a required Description
Name
Email
Number
What European Cities have you been to?
Prague
Prague
Favorite European City You Haven't Been To?
Lisbon
Madrid
Budapest
I have been everywhere|
Cost
Culture
What cities arent here that deserve to be?


|
Halide
12.0.0
|
The raw representation of an image passed around by generated Halide code. More...
#include <HalideRuntime.h>
Public Attributes | |
| uint64_t | device |
| A device-handle for e.g. More... | |
| const struct halide_device_interface_t * | device_interface |
| The interface used to interpret the above handle. More... | |
| uint8_t * | host |
| A pointer to the start of the data in main memory. More... | |
| uint64_t | flags |
| flags with various meanings. More... | |
| struct halide_type_t | type |
| The type of each buffer element. More... | |
| int32_t | dimensions |
| The dimensionality of the buffer. More... | |
| halide_dimension_t * | dim |
| The shape of the buffer. More... | |
| void * | padding |
| Pads the buffer up to a multiple of 8 bytes. More... | |
The raw representation of an image passed around by generated Halide code.
It includes some stuff to track whether the image is not actually in main memory, but instead on a device (like a GPU). For a more convenient C++ wrapper, use Halide::Buffer<T>.
Definition at line 1423 of file HalideRuntime.h.
| uint64_t halide_buffer_t::device |
A device-handle for e.g.
GPU memory used to back this buffer.
Definition at line 1425 of file HalideRuntime.h.
Referenced by Halide::Runtime::Internal::make_buffer_copy().
| const struct halide_device_interface_t* halide_buffer_t::device_interface |
The interface used to interpret the above handle.
Definition at line 1428 of file HalideRuntime.h.
| uint8_t* halide_buffer_t::host |
A pointer to the start of the data in main memory.
In terms of the Halide coordinate system, this is the address of the min coordinates (defined below).
Definition at line 1433 of file HalideRuntime.h.
Referenced by Halide::Runtime::Buffer< T, D >::data(), and Halide::Runtime::Internal::make_buffer_copy().
| uint64_t halide_buffer_t::flags |
flags with various meanings.
Definition at line 1436 of file HalideRuntime.h.
| struct halide_type_t halide_buffer_t::type |
The type of each buffer element.
Definition at line 1436 of file HalideRuntime.h.
Referenced by Halide::Runtime::Internal::calc_device_crop_byte_offset(), Halide::Runtime::Internal::calc_device_slice_byte_offset(), and Halide::Runtime::Internal::make_buffer_copy().
| int32_t halide_buffer_t::dimensions |
The dimensionality of the buffer.
Definition at line 1442 of file HalideRuntime.h.
Referenced by Halide::Runtime::Internal::calc_device_crop_byte_offset(), and Halide::Runtime::Internal::make_buffer_copy().
| halide_dimension_t* halide_buffer_t::dim |
The shape of the buffer.
Halide does not own this array - you must manage the memory for it yourself.
Definition at line 1446 of file HalideRuntime.h.
Referenced by Halide::Runtime::Internal::calc_device_crop_byte_offset(), Halide::Runtime::Internal::calc_device_slice_byte_offset(), Halide::Runtime::Internal::make_buffer_copy(), and Halide::Runtime::Buffer< T, D >::make_with_shape_of().
| void* halide_buffer_t::padding |
Pads the buffer up to a multiple of 8 bytes.
Definition at line 1449 of file HalideRuntime.h.


STEEM ENGINE 24h volume Top 10（24小时交易量前10）
Congratulations to JJM and SCT, staying in the top two! 恭喜JJM和SCT，稳居前两名！ JJM과 SCT를 축하합니다.
@virus707 @jayplayco @segyepark @sct @jack8831
NO Symbol Token Name Market Cap Price Chg 24h Vol Supply 1 JJM jjangjjangman $36565395 $0.122 0.00% $7584 300000000 2 SCT steemcoinpan token $143832 $0.277 7.00% $1824 519,229 3 DEC Dark Energy Crystals $121705 $0.00089 9.50% $1816 136,162,504.14 4 AIT AI Channel Token $265930 $0.00222 0.00% $1809 120,000,000 5 ENG Steem Engine Token $1064172 $0.268 0.69% $450.03 3,974,100 6 SSC Super Star Coin $3767344 $0.01884 0.00% $376.73 200,000,000 7 GAMER Krypto Gamers Token $45115 $0.00004 0.00% $337.57 1,233,810,044 8 JCAR joycar token $73869 $0.00074 0.00% $88.55 100000000 9 LTCP LITECOIN Pegged $2204 $68 0.00% $72.28 32.42 10 BETA Steem Monsters Beta Pack $105359 $1.74 -4.10% $70.1 60,693 https://steem-engine.com/?p=tokens 20190523 8：00
This page is synchronized from the post: STEEM ENGINE 24h volume Top 10（24小时交易量前10）20190523 8:00


Orientatioin Programme
The schedule of the Orientation Program
IIIT Kota Foundation Programme Time-Table 2017.


METACITY-MESSAGE(1) METACITY-MESSAGE(1) NAME METACITY-MESSAGE - a command to send a message to Metacity SYNOPSIS METACITY-MESSAGE [restart|reload-theme|enable-keybindings|disable-key‐ bindings] DESCRIPTION This manual page documents briefly the metacity-message. This manual page was written for the Debian distribution because the original program does not have a manual page. metacity-message send a specified message to metacity(1). OPTIONS restart Restart metacity(1) which is running. reload-theme Reload a theme which is specified on gsettings database. enable-keybindings Enable all of keybindings which is specified on gsettings data‐ base. disable-keybindings Disable all of keybindings which is specified on gsettings data‐ base. SEE ALSO metacity(1) AUTHOR This manual page was written by Akira TAGOH<EMAIL_ADDRESS>for the Debian GNU/Linux system (but may be used by others). 28 August 2002 METACITY-MESSAGE(1)


i am a junior developer web of caedablerg company and photographer
Hai, I am Angelina Jolie
Example block-level help text here.
Check me out
I agree to the Terms of Service and Privacy Policy


Service Form
Video Editing
Poster Design
Minecraft Plugin
What type of service do you want?
Your Name
Email
Phone
Textarea
I'm willing to pay some tips
ISOTOPE Studio is just awesome!
I'm the label from a radio button
I'm the label from a radio button
I'm the label from a checkbox
Submit


| Class | ActiveRecord::Observer |
| In: |
/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.0.beta4/lib/active_record/observer.rb
|
| Parent: | ActiveModel::Observer |
Observer classes respond to lifecycle callbacks to implement trigger-like behavior outside the original class. This is a great way to reduce the clutter that normally comes when the model class is burdened with functionality that doesn‘t pertain to the core responsibility of the class. Example:
class CommentObserver < ActiveRecord::Observer def after_save(comment<EMAIL_ADDRESS>"New comment was posted", comment) end end
This Observer sends an email when a Comment#save is finished.
class ContactObserver < ActiveRecord::Observer def after_create(contact) contact.logger.info('New contact added!') end def after_destroy(contact) contact.logger.warn("Contact with an id of #{contact.id} was destroyed!") end end
This Observer uses logger to log when specific callbacks are triggered.
Observers will by default be mapped to the class with which they share a name. So CommentObserver will be tied to observing Comment, ProductManagerObserver to ProductManager, and so on. If you want to name your observer differently than the class you‘re interested in observing, you can use the Observer.observe class method which takes either the concrete class (Product) or a symbol for that class (:product):
class AuditObserver < ActiveRecord::Observer observe :account def after_update(account) AuditTrail.new(account, "UPDATED") end end
If the audit observer needs to watch more than one kind of object, this can be specified with multiple arguments:
class AuditObserver < ActiveRecord::Observer observe :account, :balance def after_update(record) AuditTrail.new(record, "UPDATED") end end
The AuditObserver will now act on both updates to Account and Balance by treating them both as records.
The observer can implement callback methods for each of the methods described in the Callbacks module.
If you‘re using Active Record within Rails, observer classes are usually stored in app/models with the naming convention of app/models/audit_observer.rb.
In order to activate an observer, list it in the config.active_record.observers configuration setting in your config/environment.rb file.
config.active_record.observers = :comment_observer, :signup_observer
Observers will not be invoked unless you define these in your application configuration.
Observers register themselves in the model class they observe, since it is the class that notifies them of events when they occur. As a side-effect, when an observer is loaded its corresponding model class is loaded.
Up to (and including) Rails 2.0.2 observers were instantiated between plugins and application initializers. Now observers are loaded after application initializers, so observed models can make use of extensions.
If by any chance you are using observed models in the initialization you can still load their observers by calling ModelObserver.instance before. Observers are singletons and that call instantiates and registers them.
# File /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.0.beta4/lib/active_record/observer.rb, line 98 98: def self.method_added(method) 99: method = method.to_sym 100: observed_methods << method if ActiveRecord::Callbacks::CALLBACKS.include?(method) 101: end
# File /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.0.beta4/lib/active_record/observer.rb, line 93 93: def initialize 94: super 95: observed_subclasses.each { |klass| add_observer!(klass) } 96: end
# File /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.0.beta4/lib/active_record/observer.rb, line 112 112: def add_observer!(klass) 113: super 114: define_callbacks klass if observe_callbacks? 115: end
# File /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.0.beta4/lib/active_record/observer.rb, line 117 117: def define_callbacks(klass) 118: existing_methods = klass.instance_methods.map(&:to_sym) 119: observer = self 120: observer_name = observer.class.name.underscore.gsub('/', '__') 121: 122: self.class.observed_methods.each do |method| 123: callback = "_notify_#{observer_name}_for_#{method}""_notify_#{observer_name}_for_#{method}" 124: unless existing_methods.include? callback 125: klass.send(:define_method, callback) do # def _notify_user_observer_for_before_save 126: observer.update(method, self) # observer.update(:before_save, self) 127: end # end 128: klass.send(method, callback) # before_save :_notify_user_observer_for_before_save 129: end 130: end 131: end
# File /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.0.beta4/lib/active_record/observer.rb, line 108 108: def observe_callbacks? 109: self.class.observed_methods.any? 110: end


Existing Platforms to create quizzes
- Vialogue: Time Stamped comments for discussion as a discussion forum.
- VideoNote.es: Take time-stamped notes. Can Save on Google Drive and re-open. Click to play part synched with video.
- EdPuzzle: Insert quiz (comment, multiple choice or open-ended) inside the video.
- TedEd: Attach Multiple choice/ Open-ended question to vide, Discussion Forum / or Comments outside of video
- EduCanon: Insert questions (multiple choice, select-all-that-apply etc) inside the video. Give answer.
- HapYak: Insert pop-up quiz within video, annotate video with image and drawing on top of it.
- Blubbr: Insert multiple choice questions within video, give immediate feedback.
Type of Quizzes
Fill in blank
- Provide blank at appropriate location, and type, with clear instructions
Change/Insert specific values to variables correlated with other variables
- Which variable to show, and which to hide?
Indirectly related questions
Multiple choice questions: instead of telling the answer directly, add other options and ask.
- Add other options
- Choose among existing options (visuals)


navigate to GET for get endpoint documentation
navigate to POST for post endpoint documentation
navigate to PUT for put endpoint documentation
navigate to DELETE for delete endpoint documentation
Backend coded by Triston Armstrong


Kitchen Vs Table
Kitchen Vs Table
DBC sounds like a buttkicker, a mental, emotional, and physical obstacle course. Honestly, it sounds like it would and should be overwhelming but it also sounds like one of those challenges in life where you have to keep pushing, climbing, and put all your effort into it because in the end it will pay off. I am not sure how I would see myself in this type of environment. Sure, I did group projects, presentations, seminars, and even studied in groups but I have usually been the introvert. I am deathly afraid of public speaking. Okay maybe not deathly afraid but I do get real nervous. However I may be, I always get the work done and if DBC can teach me to be a better person, teacher, communicator, and anything else that this experience mya lead to I welcome it as long as it doesn’t bite back too hard.  We are literally having an 18 week cram session in what takes months or years at a university or regular academic school.
I am actually a bit excited to learn in this environment but it also makes me nervous because I am afraid I will have nothing to contribute to peer pairings or to other people. I do not come from a computer science background but rather a biology background and so I don’t have the experience nor the coding fluency. Academically I was always at the head of the boat or the middle, but compared to other people in DBC I may be the anchor but I will try my best to pull myself up off the ocean floor for full steam ahead. Even though I am an introvert, I have always asked for help when I needed it and found that I learn much better with other people than by myself.
Posts
-
The Post DBC Experience
Mixed Emotions
DBC was an awesome, maybe one of a kind experience. I pushed through all 4 phases with the mantids, or the improper plural...
-
How to Ask for Help
How to Ask Good Questions
Experienced Questioning
I don't always ask questions online but when I do I try to be as specific as possible...
-
Ruby on Rails
Rails
Ruby and Rails are not the same thing. Ruby is the programming language. Rails is a Rubygem or package library which is installed via...
-
Resolving Conflicts
A Conflict I Experienced
Honestly, I cannot remember a conflict I've experienced off the top of my head that would be exciting to read or...
- My Thinking Ways How do I Think? I am a concrete sequential thinker which according to cgribben.com mean that I am persistent and product oriented. I am practical...
-
SQL Injection
What is SQL?
SQL is short for Structured Query Language. It is a programming language for querying (fancy word for accessing) and managing databases. SQL...
-
Affirmation and Stereotype Threat
My Values
Accomplishment, accountability, compassion, creativity, efficiency, family, friendships, and integrity area few values which come to mind when I recall the times in my...
-
Blocs, Procs, and Lambdas
Ruby Blocks, Procs, Lambdas
Blocks
A ruby block is the piece of code that is executed. This code can be executed using curly brackets {}...
-
Stereotype Threat
What is Stereotype Threat?
To put it simply, stereotype threat is the experience of not living or carrying out your full potential because of stereotypes....
-
A Pair of Minds
Pairing and Feedback
Pairing
Pairing isn't so bad. The peers are all nice and I haven't met someone who was disrespectful during the sessions. Despite...
-
A Little Ruby
A Snippet into Ruby Classes
When and Why Should I use classes?
One question which kept simmering in my head while working on this week's...
-
Ruby Cycle and Looping
Ruby:Enumberable#Cycle
The #cycle method uses a block for each element of an enumerable object (ranges, hash, or array) repeatedly for n times or endlessly if...
- Today's Software Apps vs Law Who Doesn't Like App Efficiency? Innovative technologies usually clash with old ways and methods. There are numerous apps out there which are constantly clashing with...
- What is JS? What is JavaScript and Why Should You Care? Javascript(JS) is an object oriented computer programming language often found as a part of web browsers which...
-
CSS Positioning
Positioning in CSS
Elements on a website can be positioned behind, in front of, or next to by using CSS positioning properties: top, left, right,...
-
My Favorite Websites
My 3 Most Visited Websites
Newcelica.org
This is one of my favorite sites because I own a Celica. I do all...
-
Kitchen Vs Table
Kitchen Vs Table
DBC sounds like a buttkicker, a mental, emotional, and physical obstacle course. Honestly, it sounds like it would and should be overwhelming...


Non pharmacological management of osteoarthritis should be tried first, failure of which should provoke on-demand use of analgesics. A few of these modalities are advised below:
The value of exercise in the control of pain associated with osteoarthritis cannot be overemphasised. It is estimated to be comparable to the magnitude of response when non steroidal anti-inflammatory drugs such as Ibuprofen, are used. Aerobic and strengthening exercises have been shown to help.
Among the causal factors of osteoarthritis is overweight and obesity. Evidence amounts to show that with a 10% in weight loss either by drugs or diet, there is an associated 50% reduction in pain scores from osteoarthritis in obese patients.
Knee braces (if osteoarthritis of the knees) and or walking aids (hip joint involvement) would help to reduce pressures in inflamed joints and thereby aumenting the effect of analgesics.