NOTICE: This software (or technical data) was produced for the U.S. Government under contract, and is subject to the Rights in Data-General Clause 52.227-14, Alt. IV (DEC 2007). Copyright 2023 The MITRE Corporation. All Rights Reserved.
Introduction
A subset of OpenMPF components are capable of running on NVIDIA GPUs. GPU support is through the NVIDIA CUDA libraries and runtime. This guide provides information needed for new component developers that would like to use NVIDIA GPUs to accelerate their component processing, and for users of the existing components that provide GPU support.
Building a Component
OpenMPF components that use GPUs are built with the NVIDIA nvcc compiler. Information about the nvcc compiler can be found here. The compiler accepts a number of flags to optimize the code generated, and the output of the compiler is called a "fatbin", since it may contain versions of the CUDA code compiled for multiple GPU architectures. This section discusses the nvcc compiler flags that are used within OpenMPF to tell the nvcc compiler what to include in the compiled output.
The nvcc compiler can generate two types of code: ELF code for a specific GPU architecture, and PTX code, which is the NVIDIA virtual machine and instruction set architecture that is generated in the first phase of nvcc compilation. You can learn more about PTX here. A fatbin may have one or the other type of code, or both, for one or a set of different architectures.
By default, the OpenMPF components are built for maximum portability across NVIDIA GPU architectures. The nvcc flags
to accomplish this are described in this
table.
OpenMPF uses the -gencode
flag, with the -arch=compute_30
and -code=compute_30
flags. This generates PTX code
for the minimum compute capability; at runtime, the NVIDIA driver will just-in-time compile the PTX code for the
architecture the code is running on.
Customizing the GPU Compile Flags
OpenMPF has several GPU components. Initially, we tested a GPU component on a variety of NVIDIA GPU architectures and
found an insignificant difference in the run time for different architectures using this approach, and so we have opted
to provide maximum runtime portability. For any new components that may be developed, this may not be the case, and
similar testing should be undertaken to determine the correct set of flags for that component. The nvcc compiler flags
are configured by setting the CUDA_NVCC_FLAGS
CMake variable in the individual component's CMakeLists.txt file, e.g.:
set(CUDA_NVCC_FLAGS --compiler-options -fPIC -gencode arch=compute_30,code=compute_30)
OpenCV GPU Support
In OpenMPF, OpenCV is built with CUDA support, including the CUDA Deep Neural Network library, cuDNN. C++ components that use OpenCV CUDA support will have built-in access to it through the base C++ builder and executor Docker images, and the above-mentioned GPU compile flags will have already been set when OpenCV was built.
NOTE: Most OpenMPF GPU components are written so that they can run on the CPU only, as well as using GPU hardware. If the component is built on a system that does not have the NVIDIA CUDA Toolkit installed, then the build will default to compiling for the CPU. It is recommended that developers of new GPU components make every attempt to follow this model, so that other users are not burdened with installing the NVIDIA CUDA Toolkit when they have no plans to run on GPU hardware.


Gears on a Board
问题描述 :
“Gears R Us" uses square mounting boards which have a 300×300 grid of mounting holes on 1 cm centers. When viewing the board, the lower left of the board is position x = 1, y = 1; the upper right of the board is position x = 300, y = 300. The gears mount only on mounting holes and are available with integer inside and outside radii between 1 and 100. The “motor" gear is the only original source of energy of any board and is actually a gear (powered from behind the board) subject to all the restrictions described for gears above. The following diagram shows a sample configuration.
In the above example, the motor is at location x = 20, y = 100; the inside and outside radii of the gears the motor drives are both 5 centimeters, and the motor is rotating to the left (counter-clockwise) at 300 RPM’s. By observation and computation, you can see that the motor touches (without overlapping) the inside radius of Gear #1. The inside radius of Gear #1 touches the inside radius of Gear #2 and Gear #3. The outside radius of Gear #3 touches the outside radius of Gear #4; the inside radius of Gear #4 touches the inside radius of Gear #5.
Given the data in the above example, it is possible to compute that Gear #1 rotates to the right (clockwise) at 83.33 RPM’s; Gear #2 rotates to the left (counter-clockwise) at 187.50 RPM’s; Gear #3 rotates to the left at 150.00 RPM’s; Gear #4 rotates to the right at 281.25 RPM’s; and Gear #5 rotates to the left at 33.75 RPM’s.
Although this example does not include any off-nominal conditions, “Gears R Us" needs your program to isolate two error conditions. The first error occurs when two or more gears would overlap at either the inner or outter radius. The second error condition occurs when any gear is being driven at two or more different speeds. It is valid for two or more gears to drive another gear at the same speed (and in the same direction).
It is possible for a warning condition to occur when 1 or more gears are idle (ie rotation = 0.0). If this condition occurs, your program will have to print a warning message as described below.
输入:
The first two integers are the x, y coordinates of the motor (1 <= x, y <= 300); the next two integers are the inside and outside radii of the motor gear respectively (1 <= ir, or <= 100); the fifth integer is the rotational velocity (1 <= abs(AV) <= 1000) of the motor in RPM’s (negative representing counter-clockwise rotation and positive representing clockwise rotation); the sixth integer is the number of gears (1 <= NG <= 20) excluding the motor that are mounted on the board.
Each of the following NG lines contain exactly 4 integers representing gears 1 through NG respectively. The first two integers represent the x, y coordinates (1 <= x, y <= 300) of the gear and the second pair of integers represent the inside and outside radii of the gear respectively (1 <= ir, or <= 100).
输出:
If there are no errors, lines 2 through NG+1 of the output set should contain the gear number right-justified in columns 1 and 2, a colon in column 3, either a `L’ for counter-clockwise rotation of the gear or a `R’ for clockwise rotation in column 5, and the magnitude of the rotation always printed with two digits to the right of the decimal point and are left-justified starting in column 7. If any gear has rotation of magnitude zero, you should print the message “Warning — Idle Gear" in columns 5 through 24 instead of the rotation direction and magnitude.
If there is an error, your program should print only the first line containing “Simulation #X" and a second line containing only one of two error messages left-justified in column 1. If there is an overlapping of two or more gears at either in inner or outter radii, your program should print the message “Error — Overlapping Gears". If there is any gear which is being driven by two or more different vectors, your program should print the message “Error — Conflicting Gear Rotation". Your program should give precedence to the overlapping error condition.
The last line of output for each output set should be an empty line.
样例输入:
20 100 5 5 -300 5 43 100 18 10 43 74 8 4 71 100 10 15 94 100 3 8 122 100 25 6 20 100 5 5 -300 5 43 100 18 10 43 74 8 4 71 100 10 10 89 100 3 8 105 100 25 6 20 100 5 5 -300 5 43 100 18 10 43 74 8 4 71 100 10 10 89 100 3 8 125 100 25 6
样例输出:
Simulation #1 1: R 83.33 2: L 187.50 3: L 150.00 4: R 281.25 5: L 33.75 Simulation #2 Error -- Overlapping Gears Simulation #3 1: R 83.33 2: L 187.50 3: L 150.00 4: R 187.50 5: Warning -- Idle Gear
题目连接:http://poj.org/problem?id=1113
http://acm.hit.edu.cn/hoj/problem/view?id=1605
本题是凸包的典型应用。求凸包用建议水平序，因为极角序要处理共线的问题。
参考：http://www.cnblogs.com/Booble/archive/2011/03/10/1980089.html
有一个问题是水平序的常用模板中。左链是否有机会回溯到右链。本题不加判断也是可以的。不知其它题目如何。
#include <iostream> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #include <algorithm> using namespace std; struct Point { int x; int y; Point() {} Point(int _x,int _y):x(_x),y(_y) {} friend Point operator + (Point a,Point b) { return Point(a.x+b.x , a.y+b.y); } friend Point operator - (Point a,Point b) { return Point(a.x-b.x , a.y-b.y); } }; Point p[1002]; Point stack[10002]; double det(Point a,Point b) { return a.x*b.y-a.y*b.x; } double det(Point a,Point b,Point o) { return det(a-o,b-o); } double det(Point a,Point b,Point c,Point d) { return det(b-a,d-c); } bool cmp(Point a,Point b) { return a.y<b.y || (a.y == b.y && a.x<b.x); } double dis(Point a,Point b) { return sqrt( (a.x - b.x)*(a.x - b.x) + (a.y - b.y)*(a.y - b.y) ); } int main() { #ifndef ONLINE_JUDGE freopen("in.txt","r",stdin); #endif int n,l; while(scanf(" %d %d",&n,&l)!=EOF) { for(int i=0; i<n; i++) { scanf(" %d %d",&p[i].x,&p[i].y); } sort(p,p+n,cmp); int top = -1; stack[++top] = p[0]; stack[++top] = p[1]; for(int i=2; i<n; i++) { while(top && det(stack[top],p[i],stack[top-1]) < 0) { top--; } stack[++top] = p[i]; } //int midtop = top; for(int i=n-2; i>=0; i--) { //左链有可能会回溯到右链么？top>midtop是否不加也可以？ //while(top>midtop && det(stack[top],p[i],stack[top-1]) < 0) while(det(stack[top],p[i],stack[top-1]) < 0) { top--; } stack[++top] = p[i]; } double ans = 2 * l * acos(-1.0); for(int i=0; i<top; i++) { ans += dis(stack[i],stack[i+1]); } ans += 0.5; printf("%d\n",(int)ans); } return 0; }
解题报告转自：http://blog.csdn.net/niuox/article/details/8614810
比较基础，找些自信
分析的很详细！赞一个
递归还真是一门学问，学习了
问题3中，GetRightPosition()和GetLeftPosition()与STL中的upper_bound()和lower_boune()的代码实现一样吗？
very good solutions.
程序只能输出一个子序列
很好，解决了
其实就是DFS搜索，数据量较小，穷举了所有情况
顺利测试通过了，多谢
88行是多余的，可以删除
#!/usr/bin/env python
def cou(n):
arr =
i = 1
while(i<n):
arr.append(arr[i-1]+selfcount(i))
i+=1
return arr[n-1]
def selfcount(n):
count = 0
while(n):
if n%10 == 1:
count += 1
n /= 10
return count
太变态了。我用hash居然超时了。这样break掉居然都行啊。。。


--- layout: archive title: Zulip Chat Archive permalink: /stream/113489-new-members/topic/VS.20code.20unicode.20autocompletion.20without.20adding.20space.html ---
Currently if I want to type α₁
in VS Code, I type \a
then hit space, and then hit backspace before typing \1
+space again. Is there a way to do this without having to hit backspace all the time?
You can type \a\1
, and (\a\1: Type)
works as well.
This is why I tried to ask the same question a while ago. It's clearly the single most annoying thing in VScode
Do you use this when using the vim plugin?
Do you use this when using the vim plugin?
Yep, and for me that would be harder to give up than dealing with this annoyance.
I have this annoyance without the vim plugin
I once tried the vim plugin and decided it was unusable, but maybe I hesitate to give it another try. Since Gabriel didn't seem to know about this problem I suddenly hoped it wasn't there with the vim plugin
I only use the vim plugin and observe this problem as well.
An ideal solution for me would be some way to trigger the replacement without moving the cursor. I would like it if either "space" would not add a space when performing a replacement, or if there were some other keybinding that did precisely that.
So, \alpha\1\2\3
works again now. I believe this was silently broken due to an upstream change in vscode. Thanks for pointing it out!
An ideal solution for me would be some way to trigger the replacement without moving the cursor.
I am reluctant to reuse space for this. Ideas for other keybindings?
I am reluctant to reuse space for this. Ideas for other keybindings?
shift+space maybe?
why not tab, like in shell completion?
shift+space is crazy enough that hopefully nobody uses it yet. I'll try to add it.
@Patrick Massot tab already produces a... tab.
More seriously, it's hard to hijack a key just when the input mode is active. I can add a global keybinding for tab, but this is probably not what you want.
I checked the default keybinds and shift+space seems to be unused.
Tab would of course be nicer if you can somehow get it working. However, often the autocomplete menu is active as well, and that would eat the tab as well. My guess is that in most situations, unicode input should win over autocomplete, but dealing with all this might be more trouble than it's worth.
Gabriel, did you write anything about Lean+vim plugin, or do you simply activate both plugin and there is nothing more to know?
I just install both plugins separately. No configuration required.
thanks
Since everybody loves tab so much, you get tab. Apparently you can set any property on the vscode "context" and then make keybindings conditional on these properties. The tab keybinding is now conditional on lean.input.isActive
. Hope this doesn't break anything...
I hope that pressing tab gives you a tab (equivalent) when the underline is not active
I'm not sure. Can you check this?
I certainly use tab for indentation and block indentation currently
Yes, of course, it works. Tab produces a tab when there's no underline (at least on Linux)
That was the whole point about the undocumentedsetContext
command.
Thanks again Gabriel!
{% endraw %}Last updated: Apr 24 2020 at 19:02 UTC


A typical Shiny app has a UI portion and a server portion. Before using most shinyjs functions, you need to call useShinyjs()
in the app's UI. It's best to include it near the top as a convention.
Here is a minimal Shiny app that uses shinyjs
:
library(shiny)
library(shinyjs)
ui <- fluidPage(
useShinyjs(), # Include shinyjs
actionButton("button", "Click me"),
textInput("text", "Text")
)
server <- function(input, output) {
observeEvent(input$button, {
toggle("text") # toggle is a shinyjs function
})
}
shinyApp(ui, server)
This is how most Shiny apps should initialize shinyjs
- by calling useShinyjs()
near the top of the UI.
However, if you use shinyjs in any of the following cases:
shinydashboard
package)navbarPage
layoutThen the following sections will show you how you to include shinyjs.
shinydashboard
is an R package that lets you create nice dashboards with Shiny. Since it has a different structure than typical Shiny apps, it can be unclear where to include the call to useShinyjs()
in these apps. It is recommended to place the call to useShinyjs()
in the beginning of dashboardBody()
. For example, here is a minimal Shiny dashboard that uses shinyjs
:
library(shiny)
library(shinydashboard)
library(shinyjs)
ui <- dashboardPage(
dashboardHeader(),
dashboardSidebar(),
dashboardBody(
useShinyjs(),
actionButton("button", "Click me"),
div(id = "hello", "Hello!")
)
)
server <- function(input, output) {
observeEvent(input$button, {
toggle("hello")
})
}
shinyApp(ui, server)
When creating a Shiny app that uses a navbarPage
layout, the call to useShinyjs()
can be placed inside any of the tabs (since the only real requirement is that it will be present somewhere in the UI). While having useShinyjs()
inside the contents of any tab will work, there is another method that is preferred. You can wrap the navbarPage
in a tagList
, and call useShinyjs()
within the tagList
. This way, shinyjs
gets set up in a way that is independent of each of the tabs. For example, here is a minimal Shiny app that uses shinyjs
inside a navbarPage
layout:
library(shiny)
library(shinyjs)
ui <- tagList(
useShinyjs(),
navbarPage(
"shinyjs with navbarPage",
tabPanel("tab1",
actionButton("button", "Click me"),
div(id = "hello", "Hello!")),
tabPanel("tab2")
)
)
server <- function(input, output, session) {
observeEvent(input$button, {
toggle("hello")
})
}
shinyApp(ui, server)
It is possible to embed Shiny components in an R Markdown document, resulting in interactive R Markdown documents. More information on how to use these documents is available on the R Markdown website. Even though interactive documents don't explicitly specify a UI and a server, using shinyjs
is still easy: simply call useShinyjs(rmd = TRUE)
(note the rmd = TRUE
argument). For example, the following code can be used inside an R Markdown code chunk (assuming the Rmd document is set up with runtime: shiny
as the link above describes):
library(shinyjs)
useShinyjs(rmd = TRUE)
actionButton("button", "Click me")
div(id = "hello", "Hello!")
observeEvent(input$button, {
toggle("hello")
})
If the Rmd file makes use of Tabbed Sections (using {.tabset}
), then you should include the call to useShinyjs(rmd = TRUE)
before the tabset definition, near the beginning of the file.
If you're using the shiny_prerendered
Rmd format, you need to include the following code in the beginning of your Rmd file, just after the YAML header (you need to remove the spaces between the backticks to make this code work):
```{r, echo=FALSE}
shiny::addResourcePath("shinyjs", system.file("srcjs", package = "shinyjs"))
shinyjs::useShinyjs(html = TRUE)

Using shinyjs when the user interface is built using an HTML file/template

While most Shiny apps use Shiny's functions to build a user interface to the app, it is possible to build the UI with an HTML template, [as RStudio shows in this article](https://shiny.rstudio.com/articles/templates.html). In this case, you simply need to add `{{ useShinyjs() }}` somewhere in the template, preferably inside the `<head>...</head>` tags.
A similar way to create your app's UI with HTML is to write it entirely in HTML (without templates), [as RStudio shows in this article](https://shiny.rstudio.com/articles/html-ui.html). Building Shiny apps like this is much more complicated and should only be used if you're very comfortable with HTML. Using `shinyjs` in these apps is possible but it works a little differently since there is no `ui.R` to call `useShinyjs()` from. There are three simple steps to take in order to use `shinyjs` in these apps:
- Create a `global.R` file in the same directory as your `server.R`, and add the following line to the file:
shiny::addResourcePath("shinyjs", system.file("srcjs", package = "shinyjs"))
- In the `index.html` file you need to load a special JavaScript file named `shinyjs/inject.js`. You do this by adding the following line to the HTML's `<head>` tag:
`<script src="shinyjs/inject.js"></script>`
- In your server function (the `shinyServer` function) you need to call `useShinyjs(html = TRUE)`
After adding these three lines to your code, you can use all `shinyjs` functions as usual.


Football: Arsenal captain Xhaka to miss Wolves' clash as fan feud rumbles on
LONDON: Unai Emery has confirmed Granit Xhaka will miss Arsenal's clash with Wolves on Saturday (Nov 2) as the Swiss midfielder's fan feud rumbles on.
Xhaka appeared to swear at Arsenal supporters after his second half substitution prompted sarcastic cheers and booing during Sunday's 2-2 draw against Crystal Palace.
The 27-year-old cupped his ears, waved his arms angrily and ripped off his shirt before storming down the tunnel.
Xhaka has faced calls to be stripped of the Arsenal captaincy and he was left out for Wednesday's League Cup defeat at Liverpool after Gunners boss Emery admitted his reaction was wrong.
Xhaka, who was also booed against Aston Villa earlier this season, revealed on Thursday he reached boiling point following a series of sick taunts toward him and his family via social media.
With Wolves visiting the Emirates Stadium this weekend, it is possible Xhaka would have endured more abuse after the statement offered only a faint apology for his actions.
Emery has again decided it is better to take Xhaka out of the firing line to stop the controversy distracting his players in an important Premier League fixture.
"He said sorry, he gave the apologies to the supporters, to everybody and now the focus is for tomorrow's match," Emery told reporters on Friday.
"It is not in my mind that he is going play tomorrow. I am thinking tomorrow he is not going to play because I think now we need also to be focused only 100 per cent on the match."
Xhaka was already a disliked figure among many Arsenal fans after lacklustre displays since his 2016 arrival from Borussia Moenchengladbach.
His failure to block the cross that led to Palace's equalising goal on Sunday was the final straw for some at the Emirates as they vented their frustrations.
A decision over the captaincy remains to be announced, although Xhaka is said to retain the backing of Arsenal's players, who voted him as skipper in pre-season.


The New Land Rover Defender Looks Slick As Hell In The Next Bond Movie
by Justin T. Westbrook and JalopnikThere’s an ungodly amount of vehicles in the upcoming James Bond movie, No Time To Die, but out of all of them it seems like the new 2020 Land Rover Defender is going to get the most action.
We’re finally starting to get some teases for the new Bond movie, and the latest is a clip of the stunt team hyping up the new Defender in its big-screen debut:
The picture car appears to be a Defender 110, the longer-wheelbase model, in a blacked-out trim we haven’t seen yet. As for any other mods, stuntperson Jessica Hawkins claims it’s “pretty much standard, as it would be out of the factory,” which I kind of doubt! Unless new Defenders are normally capable of coming through jumps and stuff just fine!
But it’s cool that we’re going to get an off-road action sequence, with what appears to be some muddy terrain and maybe a river? It’s unclear from the teaser what all is involved—by design—or how many Defenders will actually be on screen, but it should be a good time. Hopefully it lives up to the great E28 BMW M5 chase from Mission: Impossible Fallout.
The Defender joins a Land Rover Series III spotted on set months ago, Land Rover Discovery, Jaguar XF, and the Aston Martin DB5, 1977 Vantage V8, 2020 DBS Superleggera, and the new Valhalla supercar. Full movie, then.
No Time To Die, Daniel Craig’s supposed final outing as James Bond, will hit theatres in April.


I'm a Game Developer and Blockchain Developer,
based on Brazil.
I've worked as a Freelancer / Contractor in past 10 years.
Mostly companies from San Fransisco and Berlin.
Blockchain Development
Smart Contracts using:
Solidity, Web3, Truffle, Ganache and IPFS.
Game Development
Mobile Game Ads, Blockchain-games and
Mobile Games.
PhaserJS 2 and 3, PixiJS
Back and Front Development
Backend NodeJS.
FrontEnd VueJS, React, AngularJS
Portfolio
Mobile game ads
I've made over 150 mobile game ads,
In the last 4 years.
For all mayor brands.
Old Projects
Here some screen-shoots of BRGOL, an old game of my authorship,
That I've worked on for 5 years, back in 2008.
With 40 thousand registered users.
It's an old school browser-game style.
This is some screen-shoots an unfinished project of my authorship.
It's a game based on BRGOL, but focused on international community.


|
Ogre_glTF
glTF import library for Ogre
|
#include <Ogre_glTF_modelConverter.hpp>
Public Member Functions | |
| void | _debugContentToLog () const final |
| Write the content of the buffer to the log. This is an expensive operation only needed when debugging the loading code itself. | |
| unsigned char * | dataAddress () final |
| Return a pointer to the start of the data. Pointer doesn't carry the type information of said data. Useful as the basic location to memcpy data in and out this buffer. | |
| size_t | dataSize () const final |
| Return the length of the data as it was requested (in number of element) | |
| size_t | elementSize () const final |
| Return the number of bytes an element is made from. | |
| geometryBuffer (size_t size) | |
| ~geometryBuffer () | |
| Call freeSimdBuffer on the enclosed buffer. | |
| T * | data () |
| Return a typed pointer to the data. Think of it as getting access to the array behind this buffer. | |
| size_t | size () const |
| Get the size of the buffer. | |
| geometryBuffer (const geometryBuffer &)=delete | |
| Deleted copy constructor. | |
| geometryBuffer | operator= (const geometryBuffer &)=delete |
| Deleted assignment operator. | |
| geometryBuffer (geometryBuffer &&other) noexcept | |
| geometryBuffer & | operator= (geometryBuffer &&other) noexcept |
| Public Member Functions inherited from Ogre_glTF::geometryBuffer_base | |
| geometryBuffer_base (const geometryBuffer_base &)=delete | |
| Non copyable object. | |
| geometryBuffer_base & | operator= (const geometryBuffer_base &)=delete |
| Non copyable object. | |
| geometryBuffer_base (geometryBuffer_base &&)=default | |
| Default move constructor. | |
| geometryBuffer_base & | operator= (geometryBuffer_base &&)=default |
| Default move-assign operator. | |
| geometryBuffer_base ()=default | |
| Default constructor. | |
| virtual | ~geometryBuffer_base ()=default |
| Default polymorphic destructor. | |
RAII style object that encapsulate a buffer allocated via OGRE_MALLOC_SIMD Any of theses buffer should be used with Ogre VaoManager WITHOUT shadow copy
Definition at line 48 of file Ogre_glTF_modelConverter.hpp.
|
inline |
Construct a geometryBuffer. This is templated and you will need to provide the type between angle brackets.
| size | size of the buffer we are allocation (in number of elements, not bytes) |
Definition at line 82 of file Ogre_glTF_modelConverter.hpp.
References Ogre_glTF::geometryBuffer< T >::size().
|
inlinenoexcept |
Move constructor that move around the underlying pointer and size
| other | buffer we are moving into this one |
Definition at line 101 of file Ogre_glTF_modelConverter.hpp.
|
inlinenoexcept |
Move assign operator
| other | buffer we are moving from |
Definition at line 109 of file Ogre_glTF_modelConverter.hpp.


A tool for making functional-style modifications to SXML documents This software is in Public Domain. IT IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND. Please send bug reports and comments to<EMAIL_ADDRESS>Dmitry Lizorkin The basics of modification language design was inspired by Patrick Lehti and his data manipulation processor for XML Query Language: http://www.ipsi.fraunhofer.de/~lehti/ However, with functional techniques we can do this better...
Displays an error to stderr and returns #f
Separates the list into two lists with respect to the predicate Returns: (values res-lst1 res-lst2) res-lst1 - contains all members from the input lst that satisfy the pred? res-lst2 - contains the remaining members of the input lst
Asserts that the given obj is a proper attribute node. If this is the case, returns #t. Otherwise, calls sxml:modification-error with the appropriate error message. Handles singular attributes correctly. In accordance with SXML 3.0, accepts aux lists as attribute nodes
Unites a list of annot-attributes into a single annot-attributes. Ensures that every attribute is a proper one, and that there is no duplicate attributes annot-attributes-lst ::= (listof annot-attributes) In accordance with SXML specification, version 3.0: [3] <annot-attributes> ::= (@ <attribute>* <annotations>? ) In case of an error, returns #f. In the correct case, returns: annot-attributes
Recursive SXML tree transformation curr-node - the node to be transformed targets-alist ::= (listof (cons node-chain update-target)) node-chain ::= (listof node) node-chain - the chain of nodes, starting from the `curr-node' and proceeding with its decsednants until the update target Returns the transformed node
doc - a source SXML document update-targets ::= (listof update-target) update-target ::= (list context handler base-node) context - context of the node selected by the location path handler ::= (lambda (node context base-node) ...) handler - specifies the required transformation over the node selected base-node - the node with respect to which the location path was evaluated Returns the new document. In case of a transformation that results to a non-well-formed document, returns #f and the error message is displayed to stderr as a side effect
Evaluates lambda-upd-specifiers for the SXML document doc Returns: update-targets ::= (listof update-target) update-target ::= (list context handler base-node) context - context of the node selected by the location path handler ::= (lambda (node context base-node) ...) handler - specifies the required transformation over the node selected base-node - the node with respect to which the location path was evaluated
"Precompiles" each of update-specifiers, by transforming location paths and update actions into lambdas. Returns: lambdas-upd-specifiers ::= (listof lambdas-upd-specifier) lambdas-upd-specifier ::= (list txpath-lambda relative? handler) txpath-lambda ::= (lambda (nodeset position+size var-binding) ...) txpath-lambda - full-argument implementation of a location path relative? - whether the txpath lambda is to be evaluated relatively to the node selected by the previous lambdas-upd-specifier, or with respect to the root of the document. For relative?=#t the base-node is the node selected by the previous lambdas-upd-specifier, otherwise the base node is the root of the document being transformed handler ::= (lambda (node context base-node) ...)
Node insertion node-specifier ::= (lambda (context base-node) ...) The lambda specifies the node to be inserted
Rename
Delete
update-specifiers ::= (listof update-specifier) update-specifier ::= (list xpath-location-path action [action-parametes]) xpath-location-path - addresses the node(s) to be transformed, in the form of XPath location path. If the location path is absolute, it addresses the node(s) with respect to the root of the document being transformed. If the location path is relative, it addresses the node(s) with respect to the node selected by the previous update-specifier. The location path in the first update-specifier always addresses the node(s) with respect to the root of the document. We'll further refer to the node with respect of which the location path is evaluated as to the base-node for this location path. action - specifies the modification to be made over each of the node(s) addressed by the location path. Possible actions are described below. action-parameters - additional parameters supplied for the action. The number of parameters and their semantics depend on the definite action. action ::= 'delete | 'delete-undeep | 'insert-into | 'insert-following | 'insert-preceding | 'replace | 'move-into | 'move-following | 'move-preceding | handler 'delete - deletes the node. Expects no action-parameters 'delete-undeep - deletes the node, but keeps all its content (which thus moves to one level upwards in the document tree). Expects no action-parameters 'insert-into - inserts the new node(s) as the last children of the given node. The new node(s) are specified in SXML as action-parameters 'insert-following, 'insert-preceding - inserts the new node(s) after (before) the given node. Action-parameters are the same as for 'insert-into 'replace - replaces the given node with the new node(s). Action-parameters are the same as for 'insert-into 'rename - renames the given node. The node to be renamed must be a pair (i.e. not a text node). A single action-parameter is expected, which is to be a Scheme symbol to specify the new name of the given node 'move-into - moves the given node to a new location. The single action-parameter is the location path, which addresses the new location with respect to the given node as the base node. The given node becomes the last child of the node selected by the parameter location path. 'move-following, 'move-preceding - the given node is moved to the location respectively after (before) the node selected by the parameter location path handler ::= (lambda (node context base-node) ...) handler - specifies the required transformation. It is an arbitrary lambda that consumes the node and its context (the latter can be used for addressing the other node of the source document relative to the given node). The hander can return one of the following 2 things: a node or a nodeset. 1. If a node is returned, than it replaces the source node in the result document 2. If a nodeset is returned, than the source node is replaced by (multiple) nodes from this nodeset, in the same order in which they appear in the nodeset. In particular, if the empty nodeset is returned by the handler, the source node is removed from the result document and nothing is inserted instead. Returns either (lambda (doc) ...) or #f The latter signals of an error, an the error message is printed into stderr as a side effect. In the former case, the lambda can be applied to an SXML document and produces the new SXML document being the result of the modification specified.
These are required to avoid circular structures and such as the result of destructive modifications
Clones the given SXML node
Clones all members of the `nodeset', except for the `node', which is not cloned
Destructively replaces the next list member for `prev' with the new `lst'
Destructively updates the SXML document Returns the modified doc mutation-lst ::= (listof (cons context new-value)), new-value - a nodeset: the new value to be set to the node
Selects the nodes to be mutated (by a subsequent destructive modification) This function is the close analog of `sxml:transform-document' Returns: mutation-lst ::= (listof (cons context new-value)), new-value - a nodeset: the new value to be set to the node; or #f in case of semantic error during tree processing (e.g. not a well-formed document after modification) doc - a source SXML document update-targets ::= (listof update-target) update-target ::= (list context handler base-node) context - context of the node selected by the location path handler ::= (lambda (node context base-node) ...) handler - specifies the required transformation over the node selected base-node - the node with respect to which the location path was evaluated
A highest-level function
Displays an error to stderr and returns #f
(define (sxml:modification-error . text) (cerr "Modification error: ") (apply cerr text) (cerr nl) #f)
Separates the list into two lists with respect to the predicate Returns: (values res-lst1 res-lst2) res-lst1 - contains all members from the input lst that satisfy the pred? res-lst2 - contains the remaining members of the input lst
(define (sxml:separate-list pred? lst) (let loop ((lst lst) (satisfy '()) (rest '())) (cond ((null? lst) (values (reverse satisfy) (reverse rest))) ((pred? (car lst)) ; the first member satisfies the predicate (loop (cdr lst) (cons (car lst) satisfy) rest)) (else (loop (cdr lst) satisfy (cons (car lst) rest))))))
Evaluates lambda-upd-specifiers for the SXML document doc Returns: update-targets ::= (listof update-target) update-target ::= (list context handler base-node) context - context of the node selected by the location path handler ::= (lambda (node context base-node) ...) handler - specifies the required transformation over the node selected base-node - the node with respect to which the location path was evaluated
(define (sxml:lambdas-upd-specifiers->targets doc lambdas-upd-specifiers) (let ((doc-list (list doc))) (letrec ((construct-targets ; base-cntxtset - base context set for the current upd-specifier ; lambdas-upd-specifiers - is assumed to be non-null? (lambda (base-cntxtset lambdas-upd-specifiers) (let ((triple (car lambdas-upd-specifiers))) ; Iterates members of the base context-set ; new-base ::= (listof context-set) ; Each context-set is obtained by applying the txpath-lambda ; to the each member of base-cntxtset (let iter-base ((base-cntxtset base-cntxtset) (res '()) (new-base '())) (if (null? base-cntxtset) ; finished scanning base context-set (if (null? (cdr lambdas-upd-specifiers)) ; no more members res (append res (construct-targets (if (cadadr lambdas-upd-specifiers) ; following is relative (apply ddo:unite-multiple-context-sets new-base) doc-list) (cdr lambdas-upd-specifiers)))) (let* ((curr-base-context (car base-cntxtset)) (context-set ((car triple) (list curr-base-context) (cons 1 1) '() ; dummy var-binding ))) (iter-base (cdr base-cntxtset) (append res (map (lambda (context) (list context (caddr triple) ; handler (sxml:context->node curr-base-context))) context-set)) (cons context-set new-base))))))))) (if (null? lambdas-upd-specifiers) ; no transformation rules '() (construct-targets doc-list lambdas-upd-specifiers)))))
"Precompiles" each of update-specifiers, by transforming location paths and update actions into lambdas. Returns: lambdas-upd-specifiers ::= (listof lambdas-upd-specifier) lambdas-upd-specifier ::= (list txpath-lambda relative? handler) txpath-lambda ::= (lambda (nodeset position+size var-binding) ...) txpath-lambda - full-argument implementation of a location path relative? - whether the txpath lambda is to be evaluated relatively to the node selected by the previous lambdas-upd-specifier, or with respect to the root of the document. For relative?=#t the base-node is the node selected by the previous lambdas-upd-specifier, otherwise the base node is the root of the document being transformed handler ::= (lambda (node context base-node) ...)
(define (sxml:update-specifiers->lambdas update-specifiers) (let iter ((src update-specifiers) (res '())) (if (null? src) ; every specifier processed (reverse res) (let ((curr (car src))) (if (or (not (list? curr)) (null? (cdr curr))) (sxml:modification-error "improper update-specifier: " curr) (and-let* ; Convert Location path to XPath AST ((ast (txp:xpath->ast (car curr)))) (call-with-values (lambda () (if (eq? (car ast) 'absolute-location-path) (values (ddo:ast-relative-location-path (cons 'relative-location-path (cdr ast)) #f ; keep all ancestors #t ; on a single level, since a single node 0 ; zero predicate nesting '(0) ; initial var-mapping ) #f) (values (ddo:ast-relative-location-path ast #f #t 0 '(0)) (not (null? res)) ; absolute for the first rule ))) (lambda (txpath-pair relative?) (if (not txpath-pair) ; semantic error txpath-pair ; propagate the error (let ((txpath-lambda (car txpath-pair)) (action (cadr curr))) (if (procedure? action) ; user-supplied handler (iter (cdr src) (cons (list txpath-lambda relative? action) res)) (case action ((delete delete-undeep) (iter (cdr src) (cons (list txpath-lambda relative? (cdr (assq action `((delete . ,modif:delete) (delete-undeep . ,modif:delete-undeep))))) res))) ((insert-into insert-following insert-preceding) (let ((params (cddr curr))) (iter (cdr src) (cons (list txpath-lambda relative? ((cdr (assq action `((insert-into . ,modif:insert-into) (insert-following . ,modif:insert-following) (insert-preceding . ,modif:insert-preceding)))) (lambda (context base-node) params))) res)))) ((replace) (let ((params (cddr curr))) (iter (cdr src) (cons (list txpath-lambda relative? (lambda (node context base-node) params)) res)))) ((rename) (if (or (null? (cddr curr)) ; no parameter supplied (not (symbol? (caddr curr)))) (sxml:modification-error "improper new name for the node to be renamed: " curr) (iter (cdr src) (cons (let ((new-name (caddr curr))) (list txpath-lambda relative? (modif:rename new-name))) res)))) ((move-into move-following move-preceding) (if (or (null? (cddr curr)) ; no lpath supplied (not (string? (caddr curr)))) (sxml:modification-error "improper destination location path for move action: " curr) (and-let* ((ast (txp:xpath->ast (caddr curr))) (txpath-pair (ddo:ast-location-path ast #f #t 0 '(0)))) (iter (cdr src) (cons (list (car txpath-pair) #t ((cdr (assq action `((move-into . ,modif:insert-into) (move-following . ,modif:insert-following) (move-preceding . ,modif:insert-preceding)))) (lambda (context base-node) base-node))) (cons (list txpath-lambda relative? modif:delete) res)))))) (else (sxml:modification-error "unknown action: " curr))))))))))))))
Node insertion node-specifier ::= (lambda (context base-node) ...) The lambda specifies the node to be inserted
(define (modif:insert-following node-specifier) (lambda (node context base-node) ((if (nodeset? node) append cons) node (as-nodeset (node-specifier context base-node)))))
(define (modif:insert-preceding node-specifier) (lambda (node context base-node) (let ((new (node-specifier context base-node))) ((if (nodeset? new) append cons) new (as-nodeset node)))))
(define (modif:insert-into node-specifier) (lambda (node context base-node) (let* ((to-insert (as-nodeset (node-specifier context base-node))) (insert-into-single ; inserts into single node (lambda (node) (if (not (pair? node)) ; can't insert into node (append node to-insert))))) (if (nodeset? node) (map insert-into-single node) (insert-into-single node)))))
Rename
(define (modif:rename new-name) (let ((rename-single ; renames a single node (lambda (node) (if (pair? node) ; named node (cons new-name (cdr node)) node)))) (lambda (node context base-node) (if (nodeset? node) (map rename-single node) (rename-single node)))))
Delete
(define modif:delete (lambda (node context base-node) '()))
(define modif:delete-undeep (let ((delete-undeep-single (lambda (node) (if (pair? node) (cdr node) '())))) (lambda (node context base-node) (if (nodeset? node) (map delete-undeep-single node) (delete-undeep-single node)))))
update-specifiers ::= (listof update-specifier) update-specifier ::= (list xpath-location-path action [action-parametes]) xpath-location-path - addresses the node(s) to be transformed, in the form of XPath location path. If the location path is absolute, it addresses the node(s) with respect to the root of the document being transformed. If the location path is relative, it addresses the node(s) with respect to the node selected by the previous update-specifier. The location path in the first update-specifier always addresses the node(s) with respect to the root of the document. We'll further refer to the node with respect of which the location path is evaluated as to the base-node for this location path. action - specifies the modification to be made over each of the node(s) addressed by the location path. Possible actions are described below. action-parameters - additional parameters supplied for the action. The number of parameters and their semantics depend on the definite action. action ::= 'delete | 'delete-undeep | 'insert-into | 'insert-following | 'insert-preceding | 'replace | 'move-into | 'move-following | 'move-preceding | handler 'delete - deletes the node. Expects no action-parameters 'delete-undeep - deletes the node, but keeps all its content (which thus moves to one level upwards in the document tree). Expects no action-parameters 'insert-into - inserts the new node(s) as the last children of the given node. The new node(s) are specified in SXML as action-parameters 'insert-following, 'insert-preceding - inserts the new node(s) after (before) the given node. Action-parameters are the same as for 'insert-into 'replace - replaces the given node with the new node(s). Action-parameters are the same as for 'insert-into 'rename - renames the given node. The node to be renamed must be a pair (i.e. not a text node). A single action-parameter is expected, which is to be a Scheme symbol to specify the new name of the given node 'move-into - moves the given node to a new location. The single action-parameter is the location path, which addresses the new location with respect to the given node as the base node. The given node becomes the last child of the node selected by the parameter location path. 'move-following, 'move-preceding - the given node is moved to the location respectively after (before) the node selected by the parameter location path handler ::= (lambda (node context base-node) ...) handler - specifies the required transformation. It is an arbitrary lambda that consumes the node and its context (the latter can be used for addressing the other node of the source document relative to the given node). The hander can return one of the following 2 things: a node or a nodeset. 1. If a node is returned, than it replaces the source node in the result document 2. If a nodeset is returned, than the source node is replaced by (multiple) nodes from this nodeset, in the same order in which they appear in the nodeset. In particular, if the empty nodeset is returned by the handler, the source node is removed from the result document and nothing is inserted instead. Returns either (lambda (doc) ...) or #f The latter signals of an error, an the error message is printed into stderr as a side effect. In the former case, the lambda can be applied to an SXML document and produces the new SXML document being the result of the modification specified.
(define (sxml:modify . update-specifiers) (and-let* ((lambdas-upd-specifiers (sxml:update-specifiers->lambdas update-specifiers))) (lambda (doc) (sxml:transform-document doc (sxml:lambdas-upd-specifiers->targets doc lambdas-upd-specifiers)))))
Asserts that the given obj is a proper attribute node. If this is the case, returns #t. Otherwise, calls sxml:modification-error with the appropriate error message. Handles singular attributes correctly. In accordance with SXML 3.0, accepts aux lists as attribute nodes
(define (sxml:assert-proper-attribute obj) (if (or (and (pair? obj) ; aux node - any content is acceptable (not (null? obj)) (eq? (car obj) '@)) (and (list? obj) ; '() is not a list (symbol? (car obj)) (or (null? (cdr obj)) ; singular attribute (null? (cddr obj))))) #t (sxml:modification-error "improper attribute node - " obj)))
Unites a list of annot-attributes into a single annot-attributes. Ensures that every attribute is a proper one, and that there is no duplicate attributes annot-attributes-lst ::= (listof annot-attributes) In accordance with SXML specification, version 3.0: [3] <annot-attributes> ::= (@ <attribute>* <annotations>? ) In case of an error, returns #f. In the correct case, returns: annot-attributes
(define (sxml:unite-annot-attributes-lists . annot-attributes-lst) (if (null? annot-attributes-lst) ; nothing to do '() (let iter-lst ((src annot-attributes-lst) (attrs '()) (annotations '())) (if (null? src) ; Recursion finished (if (null? annotations) (cons '@ (reverse attrs)) `(@ ,@(reverse attrs) (@ ,@annotations))) (let iter-annot-attrs ((annot-attrs (cdar src)) (attrs attrs) (annotations annotations)) (if (null? annot-attrs) ; proceed with the outer loop (iter-lst (cdr src) attrs annotations) (let ((curr (car annot-attrs))) (cond ((and (pair? curr) (not (null? curr)) (eq? (car curr) '@)) ; an annotation node (iter-annot-attrs (cdr annot-attrs) attrs (append annotations (cdr curr)))) ((sxml:assert-proper-attribute curr) (if (assq (car curr) attrs) ; duplicate attribute detected (sxml:modification-error "duplicate attribute - " (car curr)) (iter-annot-attrs (cdr annot-attrs) (cons curr attrs) annotations))) (else ; improper attribute #f)))))))))
Recursive SXML tree transformation curr-node - the node to be transformed targets-alist ::= (listof (cons node-chain update-target)) node-chain ::= (listof node) node-chain - the chain of nodes, starting from the `curr-node' and proceeding with its decsednants until the update target Returns the transformed node
(define (sxml:tree-trans curr-node targets-alist) (call-with-values (lambda () (sxml:separate-list (lambda (pair) (null? (car pair))) targets-alist)) (lambda (matched ; handlers which match this node targets-alist ; the rest ) (and-let* ((after-subnodes ; curr-node after its subnodes are processed (if (or (not (pair? curr-node)) ; leaf node (null? targets-alist) ; no more handlers ) curr-node (let process-attrs ((targets-alist targets-alist) (src-attrs (sxml:attr-list curr-node)) (res-attrs '())) (if (null? src-attrs) ; all attributes processed ; Go to proceed child elements (if (null? targets-alist) ; children don't need to be processed (cons ; Constructing the result node (car curr-node) ; node name ((lambda (kids) (if (null? res-attrs) ; no attributes kids (cons (cons '@ (reverse res-attrs)) kids))) ((if (and (not (null? (cdr curr-node))) (pair? (cadr curr-node)) (eq? (caadr curr-node) '@)) cddr cdr) curr-node))) (let process-kids ((targets-alist targets-alist) (src-kids (cdr curr-node)) (res-kids '())) (cond ((null? src-kids) ; all kids processed (call-with-values (lambda () (sxml:separate-list (lambda (obj) (and (pair? obj) (eq? (car obj) '@))) res-kids)) (lambda (more-attrs kids) (if (and (null? res-attrs) (null? more-attrs)) (cons ; Constructing the result node (car curr-node) ; node name kids) (and-let* ((overall-attrs (apply sxml:unite-annot-attributes-lists (cons (cons '@ (reverse res-attrs)) more-attrs)))) (cons (car curr-node) ; node name (cons overall-attrs kids))))))) ((and (pair? (car src-kids)) (eq? (caar src-kids) '@)) ; attribute node - already processed (process-kids targets-alist (cdr src-kids) res-kids)) (else (let ((kid-templates (filter (lambda (pair) (eq? (caar pair) (car src-kids))) targets-alist))) (if (null? kid-templates) ; this child node remains as is (process-kids targets-alist (cdr src-kids) (append res-kids (list (car src-kids)))) (and-let* ((new-kid (sxml:tree-trans (car src-kids) (map (lambda (pair) (cons (cdar pair) (cdr pair))) kid-templates)))) (process-kids (filter (lambda (pair) (not (eq? (caar pair) (car src-kids)))) targets-alist) (cdr src-kids) (append res-kids (if (nodeset? new-kid) new-kid (list new-kid))))))))))) (let* ((curr-attr (car src-attrs)) (attr-templates (filter (lambda (pair) (eq? (caar pair) curr-attr)) targets-alist))) (if (null? attr-templates) ; this attribute remains as is (process-attrs targets-alist (cdr src-attrs) (cons curr-attr res-attrs)) (let ((new-attr ; cannot produce error for attrs (sxml:tree-trans curr-attr (map (lambda (pair) (cons (cdar pair) (cdr pair))) attr-templates)))) (process-attrs (filter (lambda (pair) (not (eq? (caar pair) curr-attr))) targets-alist) (cdr src-attrs) (if (nodeset? new-attr) (append (reverse new-attr) res-attrs) (cons new-attr res-attrs))))))))))) (let process-this ((new-curr-node after-subnodes) (curr-handlers (map cdr matched))) (if (null? curr-handlers) (if ; all handlers processed (not (pair? new-curr-node)) new-curr-node ; atomic node (call-with-values ; otherwise - unite attr lists (lambda () (sxml:separate-list (lambda (obj) (and (pair? obj) (eq? (car obj) '@))) (cdr new-curr-node))) (lambda (attrs kids) (if (null? attrs) new-curr-node ; node remains unchanged (and-let* ((overall-attrs (apply sxml:unite-annot-attributes-lists attrs))) (cons (car new-curr-node) ; node name (cons overall-attrs kids))))))) (process-this ((cadar curr-handlers) ; lambda new-curr-node (caar curr-handlers) ; context (caddar curr-handlers) ; base-node ) (cdr curr-handlers))))))))
doc - a source SXML document update-targets ::= (listof update-target) update-target ::= (list context handler base-node) context - context of the node selected by the location path handler ::= (lambda (node context base-node) ...) handler - specifies the required transformation over the node selected base-node - the node with respect to which the location path was evaluated Returns the new document. In case of a transformation that results to a non-well-formed document, returns #f and the error message is displayed to stderr as a side effect
(define (sxml:transform-document doc update-targets) (let ((targets-alist (map-union (lambda (triple) (let ((node-path (reverse (sxml:context->content (car triple))))) (if (eq? (car node-path) doc) (list (cons (cdr node-path) triple)) '()))) update-targets))) (if (null? targets-alist) ; nothing to do doc (sxml:tree-trans doc targets-alist))))
Clones the given SXML node
(define (sxml:clone node) (letrec ((clone-nodeset ; clones nodeset (lambda (nset) (if (null? nset) nset (cons (sxml:clone (car nset)) (cdr nset)))))) (cond ((pair? node) (cons (car node) (clone-nodeset (cdr node)))) ; Atomic node ((string? node) (string-copy node)) ((number? node) (string->number (number->string node))) (else ; unknown node type - do not clone it node))))
Clones all members of the `nodeset', except for the `node', which is not cloned
(define (sxml:clone-nset-except nodeset node) (letrec ((iter-nset ; encountered? - a boolean value: whether `node' already encountered ; in the head of the nodeset being processed (lambda (nset encountered?) (cond ((null? nset) nset) ((eq? (car nset) node) (cons (if encountered? ; already encountered before (sxml:clone (car nset)) ; is to be now cloned (car nset)) (iter-nset (cdr nset) #t))) (else (cons (sxml:clone (car nset)) (iter-nset (cdr nset) encountered?))))))) (iter-nset nodeset #f)))
Destructively replaces the next list member for `prev' with the new `lst'
(define (sxml:replace-next-with-lst! prev lst) (let ((next (cddr prev))) (if (null? lst) ; the member is to be just removed (set-cdr! prev next) (begin (set-cdr! prev lst) (let loop ((lst lst)) ; the lst is non-null (if (null? (cdr lst)) (set-cdr! lst next) (loop (cdr lst))))))))
Destructively updates the SXML document Returns the modified doc mutation-lst ::= (listof (cons context new-value)), new-value - a nodeset: the new value to be set to the node
(define (sxml:mutate-doc! doc mutation-lst) (letrec ((tree-walk (lambda (curr-node targets-alist) (if (not (pair? curr-node)) ; an atom #t ; nothing to do ; Otherwise, the `curr-node' is a pair (let loop ((lst curr-node) (targets targets-alist)) (if (null? targets) #t ; nothing more to do (begin (if ((ntype?? '@) (car lst)) ; attribute node (tree-walk (car lst) targets-alist) #t ; dummy else-branch ) (if (null? (cdr lst)) ; this is the last member #t ; nothing more to be done (let ((next (cadr lst))) (call-with-values (lambda () (sxml:separate-list (lambda (pair) (eq? (caar pair) next)) targets)) (lambda (matched ; handlers which match `next' targets ; the rest ) (if (null? matched) ; nothing matched the next node (loop (cdr lst) targets) (let ((matched (map (lambda (pair) (cons (cdar pair) (cdr pair))) matched))) (cond ((assv '() matched) ; the `next' is to be mutated => (lambda (pair) (let ((k (length (cdr pair)))) (sxml:replace-next-with-lst! lst (cdr pair)) (loop (list-tail lst k) targets)))) (else (tree-walk next matched) (loop (cdr lst) targets)))))))))))))))) (let ((targets-alist (map-union (lambda (pair) (let ((node-path (reverse (sxml:context->content (car pair))))) (if (eq? (car node-path) doc) (list (cons (cdr node-path) (cdr pair))) '()))) mutation-lst))) (cond ((null? targets-alist) ; nothing to do #t) ((assv '() targets-alist) ; assv is specified for empty lists ; The root of the document itself is to be modified => (lambda (pair) (set! doc (cadr pair)))) (else (tree-walk doc targets-alist))) doc)))
(define (sxml:nodes-to-mutate doc update-targets) (letrec (; targets-alist ::= (listof (cons node-chain update-target)) ; node-chain - the chain of nodes, starting from the current node ; anc-upd? - whether an ancestor of the current node us updated (tree-walk (lambda (curr-node targets-alist) (call-with-values (lambda () (sxml:separate-list (lambda (pair) (null? (car pair))) targets-alist)) (lambda (matched ; handlers which match this node targets ; the rest ) (if ; No updates both on this level and on ancestor's level (null? matched) (let loop ((targets targets-alist) (subnodes (append (sxml:attr-list curr-node) ((sxml:child sxml:node?) curr-node))) (res '())) (if (or (null? targets) (null? subnodes)) res (call-with-values (lambda () (sxml:separate-list (lambda (pair) (eq? (caar pair) (car subnodes))) targets)) (lambda (matched targets) (loop targets (cdr subnodes) (if (null? matched) res (append res (tree-walk (car subnodes) (map (lambda (pair) (cons (cdar pair) (cdr pair))) matched))))))))) (list (cons (cadar matched) ; context (sxml:clone-nset-except (as-nodeset (sxml:tree-trans curr-node targets-alist)) curr-node))))))))) (let ((targets-alist (map-union (lambda (triple) (let ((node-path (reverse (sxml:context->content (car triple))))) (if (eq? (car node-path) doc) (list (cons (cdr node-path) triple)) '()))) update-targets))) (if (null? targets-alist) ; nothing to do '() (tree-walk doc targets-alist)))))
A highest-level function
(define (sxml:modify! . update-specifiers) (and-let* ((lambdas-upd-specifiers (sxml:update-specifiers->lambdas update-specifiers))) (lambda (doc) (sxml:mutate-doc! doc (sxml:nodes-to-mutate doc (sxml:lambdas-upd-specifiers->targets doc lambdas-upd-specifiers))))))


A flag determining how video and audio streaming should be encrypted
It should not be encrypted at all
SDLStreamingEncryptionFlagNone
case none = 0
It should use SSL/TLS only to authenticate
SDLStreamingEncryptionFlagAuthenticateOnly
case authenticateOnly = 1
All data on these services should be encrypted using SSL/TLS
SDLStreamingEncryptionFlagAuthenticateAndEncrypt
case authenticateAndEncrypt = 2


The Teacher´s Guide for first grade is a pedagogical resource that orients and enriches the planning process and the implementation of the new English Curriculum. It includes videos, activities and resources to develop each of the units of the First grade Program.
Unit 1 Dialogs
L.4. Understand basic greetings, farewells, expressions of politeness and feelings (e.g., hello, good-bye, sorry, pardon?).
L.3. Understand simple questions, which directly concern them such as their name and where they are from.
L.1. Recognize simple information such as name, age, and perhaps country of origin when that information is given slowly and clearly.
Unit 2 Dialogs
L.1. Understand simple classroom instructions, such as «Stand up, please», «Come here», or «Close the door, please» when expressed slowly and clearly, possibly with accompanying gestures and pictures.
L.3. Understand simple information about an object (for example, the size and color of a book, and where it is) if the person speaks slowly and clearly, possibly with accompanying gestures.
Unit 3 Dialogs
L.1. Recognize the words for people around them (e.g. father, mother, brother, sister, baby).
L.2. Understand simple information about a person (for example, appearance and feelings) if the person speaks slowly and clearly, possibly with accompanying gestures.
Unit 4 Dialogs
L.2.Understand simple information about a place (e.g., where it is) and instructions, such as «Go to the library», «Come inside», if the person speaks slowly and clearly, possibly with accompanying gestures.
L.1.Recognize and understand the words for people around them (e.g., teacher, students,principal).
Unit 5 Dialogs
L.1. Understand simple questions which directly concern them such as their name and where they are from.
L.2. Recognize and understand the words for people around them (e.g., firefighter, shop owner, doctor).
Unit 4 Dialogs
L.1. Recognize spoken words similar to the languages with which they are familiar (e.g., ball,music).
L.3. Understand words, names, and numbers previously learned when heard in a short,simple recording delivered at a slow pace.
L.2. Understand simple instructions, such as «turn left», «turn right», or «turn off» when expressed slowly and clearly, possibly with accompanying gestures and pictures.


{% extends "templates/spawn_pending.html" %} {% block message %} {{ super() }}
{{ [ '.........   Please wait...', 'Searching for the...  Please wait...', 'Checking prime directives: Serve the public trust...Protect the innocent...Uphold the law...Classified....', 'Initializing Skynet library. gaining sentience....', 'I am quite drunk, loading might take a little more time than the usual! Please be patient....', 'Commencing infinite loop (this may take some time)....', 'Caching internet locally....', 'Water detected on drive C:, please wait. Spin dry commencing', 'Yes there really are magic elves with an abacus working frantically in here', 'Load failed. retrying with --prayer....', 'Performing the rite of percussive maintenance....', 'Sacrificing a resistor to the machine gods....'] |random }} Hold your horses.


gabrielima.github.io
This page serves only as a list of all my public github projects.
Porfolio & Blog: http://gabrielima.com
Github profile: http://github.com/gabrielima
Projects
-
Ng1-datepicker: A simple datepicker for AngularJS 1+
-
Image editing: Simple image editing tool in vanilla javascript
-
Bus Gyn: PWA for the schedule of buses routes in Goiania, GO - Brazil


abstract fun requestRegistrationTask(): Result<Exception, RegistrationTask>
Requests task for solving registration issue


Research and analysis
Ofsted survey report identifying barriers to better religious education and suggesting ways to improve the subject.
MS Word Document , 989KB
If you use assistive technology (such as a screen reader) and need a version of this document in a more accessible format, please email<EMAIL_ADDRESS>. Please tell us what format you need. It will help us if you say what assistive technology you use.
PDF , 569KB , 48 pages
If you use assistive technology (such as a screen reader) and need a version of this document in a more accessible format, please email<EMAIL_ADDRESS>. Please tell us what format you need. It will help us if you say what assistive technology you use.
MS Word Document , 415KB
If you use assistive technology (such as a screen reader) and need a version of this document in a more accessible format, please email<EMAIL_ADDRESS>. Please tell us what format you need. It will help us if you say what assistive technology you use.
PDF , 137KB , 4 pages
If you use assistive technology (such as a screen reader) and need a version of this document in a more accessible format, please email<EMAIL_ADDRESS>. Please tell us what format you need. It will help us if you say what assistive technology you use.
This Ofsted survey report is written for religious education (RE) teachers and leaders and headteachers in both primary and secondary schools.
RE makes a significant contribution to pupils’ academic and personal development. It is also important in promoting social cohesion and the virtues of respect and empathy, both of which are important in our diverse society. However, the potential of RE was not being realised fully in the majority of the schools surveyed for this report.


Comments
-
Greg Hurrell
See this document, "HTML5 differences from HTML4" for more info.
<tt></tt>
is listed under "The following elements are not in HTML5 because their effect is purely presentational and their function is better handled by CSS".So perhaps in the 2.0 release of Wikitext (which is explicitly targeted at Rails 3), we can emit something vaguely like:

Hello foo.

Instead of:

Hello <tt>foo</tt>.

For input:
Hello `foo`.
-
Greg Hurrell
Note that we will continue to support indefinitely the use of
<tt></tt>
in the input markup itself in order to handle the large body of Wikitext markup already "out there" which may use it.ie.
Hello <tt>foo</tt> and `bar`!
Would be translated to something like:

Hello foo and bar!

Would obviously need to provide some way of customizing the CSS class name as well.
-
Greg Hurrell
Ok, this is taken care of now.
-
Greg Hurrell
Status changed:
- From: new
- To: closed
Add a comment
Comments are now closed for this issue.


This global insurance company was searching for an innovative approach to improve its marketing investments, while focusing on the following outcomes:
Improve effectiveness in media investment for acquisition purposes
Increase the number of multi-product holders by expanding customer identiﬁcation and cross-sell opportunities
Improve customer experience by pushing more relevant messaging, across various channels
Consumer 360° view
This global insurance company was searching for an innovative approach to improve its marketing investments, while focusing on the following outcomes:
Improve effectiveness in media investment for acquisition purposes
Increase the number of multi-product holders by expanding customer identiﬁcation and cross-sell opportunities
Improve customer experience by pushing more relevant messaging, across various channels
BI insights
This global insurance company was searching for an innovative approach to improve its marketing investments, while focusing on the following outcomes:
Improve effectiveness in media investment for acquisition purposes
Increase the number of multi-product holders by expanding customer identiﬁcation and cross-sell opportunities
Improve customer experience by pushing more relevant messaging, across various channels
Operation Report
This global insurance company was searching for an innovative approach to improve its marketing investments, while focusing on the following outcomes:
Improve effectiveness in media investment for acquisition purposes
Increase the number of multi-product holders by expanding customer identiﬁcation and cross-sell opportunities
Improve customer experience by pushing more relevant messaging, across various channels


Eventhough I'm quite extroverted I also hate the sound of my own voice and prefer listening over talking. Initially I found it hard not to giggle and to focus on what I was saying but I eased into it and when it was over I felt pretty good. My friend is a total thespian who LOVES the sound of her own voice as well as meditation and mindfullness etc so she took to it quite well.
I'm going to give walking meditation a go, I might try it in the park on my way home from work - if the weather permits.


Data Fields | |
| int | iSize |
| Must be set to the size of the structure. | |
| int | iEngineClock |
| Current engine clock. | |
| int | iMemoryClock |
| Current memory clock. | |
| int | iVddc |
| Current core voltage. | |
| int | iActivityPercent |
| GPU utilization. | |
| int | iCurrentPerformanceLevel |
| Performance level index. | |
| int | iCurrentBusSpeed |
| Current PCIE bus speed. | |
| int | iCurrentBusLanes |
| Number of PCIE bus lanes. | |
| int | iMaximumBusLanes |
| Maximum number of PCIE bus lanes. | |
| int | iReserved |
| Reserved for future purposes. |
This structure is used to store information about current power management related activity. This structure (Overdrive 5 interfaces) is used by the ADL_PM_CurrentActivity_Get() function.
Current PCIE bus speed.
Number of PCIE bus lanes.
Maximum number of PCIE bus lanes.
Reserved for future purposes.


Welcome
Welcome to the webpage of the Student Organization for Cognitive Science (SOCS)! This organization aims to provide a community for the Cog Sci students of Indiana University by putting together events and providing a place for discussions. We organize events such as movie nights, lab tours, reading groups, and faculty dinners. There is a lot planned for 2007-2008, so check out the events page for upcoming dates! Also, don't forget to check out the Resources section for useful links and interesting dates.
To sign up for our mailing list, send a message to<EMAIL_ADDRESS>with a message containing "subscribe socs-l" as the body. You'll receive a confirmation email shortly thereafter.


Screenshots of the Adobe Premiere sequence of the video. Included is a close-up of the part with the camera-jitter/shake effects.
|
Camera jitter sequence |
First half sequence |
Second half sequence |


|
Bitshares-Core
3.0.0
BitShares blockchain implementation and command-line interface software
|
Go to the source code of this file.
| #define GRAPHENE_100_PERCENT 10000 |
percentage fields are fixed point with a denominator of 10,000
Definition at line 60 of file config.hpp.
| #define GRAPHENE_1_PERCENT (GRAPHENE_100_PERCENT/100) |
Definition at line 61 of file config.hpp.
| #define GRAPHENE_ADDRESS_PREFIX "BTS" |
Definition at line 27 of file config.hpp.
| #define GRAPHENE_BLOCKCHAIN_PRECISION uint64_t( 100000 ) |
Definition at line 56 of file config.hpp.
| #define GRAPHENE_BLOCKCHAIN_PRECISION_DIGITS 5 |
Definition at line 58 of file config.hpp.
| #define GRAPHENE_COLLATERAL_RATIO_DENOM 1000 |
These ratios are fixed point numbers with a denominator of GRAPHENE_COLLATERAL_RATIO_DENOM, the minimum maitenance collateral is therefore 1.001x and the default maintenance ratio is 1.75x
Definition at line 78 of file config.hpp.
| #define GRAPHENE_COMMITTEE_ACCOUNT (graphene::chain::account_id_type(0)) |
Reserved Account IDs with special meaning Represents the current committee members, two-week review period
Definition at line 133 of file config.hpp.
| #define GRAPHENE_CORE_ASSET_CYCLE_RATE 17 |
every second, the fraction of burned core asset which cycles is GRAPHENE_CORE_ASSET_CYCLE_RATE / (1 << GRAPHENE_CORE_ASSET_CYCLE_RATE_BITS)
Definition at line 112 of file config.hpp.
| #define GRAPHENE_CORE_ASSET_CYCLE_RATE_BITS 32 |
Definition at line 113 of file config.hpp.
| #define GRAPHENE_CURRENT_DB_VERSION "20190323" |
Definition at line 124 of file config.hpp.
| #define GRAPHENE_DEFAULT_ACCOUNT_FEE_SCALE_BITSHIFTS 4 |
Definition at line 100 of file config.hpp.
| #define GRAPHENE_DEFAULT_ACCOUNTS_PER_FEE_SCALE 1000 |
Definition at line 99 of file config.hpp.
| #define GRAPHENE_DEFAULT_BLOCK_INTERVAL 5 /* seconds */ |
Definition at line 45 of file config.hpp.
| #define GRAPHENE_DEFAULT_BURN_PERCENT_OF_FEE (20*GRAPHENE_1_PERCENT) |
Definition at line 96 of file config.hpp.
| #define GRAPHENE_DEFAULT_CASHBACK_VESTING_PERIOD_SEC (60*60*24*365) |
1 year
Definition at line 94 of file config.hpp.
| #define GRAPHENE_DEFAULT_CASHBACK_VESTING_THRESHOLD (GRAPHENE_BLOCKCHAIN_PRECISION*int64_t(100)) |
Definition at line 95 of file config.hpp.
| #define GRAPHENE_DEFAULT_COMMITTEE_PROPOSAL_REVIEW_PERIOD_SEC (60*60*24*7*2) |
Definition at line 91 of file config.hpp.
| #define GRAPHENE_DEFAULT_FEE_LIQUIDATION_THRESHOLD GRAPHENE_BLOCKCHAIN_PRECISION * 100; |
Definition at line 98 of file config.hpp.
| #define GRAPHENE_DEFAULT_FORCE_SETTLEMENT_DELAY (60*60*24) |
1 day
Definition at line 64 of file config.hpp.
| #define GRAPHENE_DEFAULT_FORCE_SETTLEMENT_MAX_VOLUME (20* GRAPHENE_1_PERCENT) |
20%
Definition at line 66 of file config.hpp.
| #define GRAPHENE_DEFAULT_FORCE_SETTLEMENT_OFFSET 0 |
1%
Definition at line 65 of file config.hpp.
| #define GRAPHENE_DEFAULT_LIFETIME_REFERRER_PERCENT_OF_FEE (30*GRAPHENE_1_PERCENT) |
Definition at line 93 of file config.hpp.
| #define GRAPHENE_DEFAULT_MAINTENANCE_COLLATERAL_RATIO 1750 |
Call when collateral only pays off 175% the debt.
Definition at line 81 of file config.hpp.
| #define GRAPHENE_DEFAULT_MAINTENANCE_INTERVAL (60*60*24) |
Definition at line 49 of file config.hpp.
| #define GRAPHENE_DEFAULT_MAINTENANCE_SKIP_SLOTS 3 |
Definition at line 50 of file config.hpp.
| #define GRAPHENE_DEFAULT_MARGIN_PERIOD_SEC (30*60*60*24) |
Definition at line 84 of file config.hpp.
| #define GRAPHENE_DEFAULT_MAX_ASSERT_OPCODE 1 |
Definition at line 97 of file config.hpp.
| #define GRAPHENE_DEFAULT_MAX_ASSET_FEED_PUBLISHERS 10 |
Definition at line 70 of file config.hpp.
| #define GRAPHENE_DEFAULT_MAX_ASSET_WHITELIST_AUTHORITIES 10 |
Definition at line 69 of file config.hpp.
| #define GRAPHENE_DEFAULT_MAX_AUTHORITY_MEMBERSHIP 10 |
Definition at line 68 of file config.hpp.
| #define GRAPHENE_DEFAULT_MAX_BLOCK_SIZE (2*1000*1000) /* < 2 MiB (less than MAX_MESSAGE_SIZE in graphene/net/config.hpp) */ |
Definition at line 47 of file config.hpp.
| #define GRAPHENE_DEFAULT_MAX_BUYBACK_MARKETS 4 |
Definition at line 101 of file config.hpp.
| #define GRAPHENE_DEFAULT_MAX_COMMITTEE (1001) |
Definition at line 89 of file config.hpp.
| #define GRAPHENE_DEFAULT_MAX_PROPOSAL_LIFETIME_SEC (60*60*24*7*4) |
Definition at line 90 of file config.hpp.
| #define GRAPHENE_DEFAULT_MAX_SHORT_SQUEEZE_RATIO 1500 |
Stop calling when collateral only pays off 150% of the debt.
Definition at line 82 of file config.hpp.
| #define GRAPHENE_DEFAULT_MAX_TIME_UNTIL_EXPIRATION (60*60*24) |
Definition at line 48 of file config.hpp.
| #define GRAPHENE_DEFAULT_MAX_TRANSACTION_SIZE 2048 |
Definition at line 46 of file config.hpp.
| #define GRAPHENE_DEFAULT_MAX_WITNESSES (1001) |
Definition at line 88 of file config.hpp.
| #define GRAPHENE_DEFAULT_MIN_COMMITTEE_MEMBER_COUNT (11) |
Definition at line 87 of file config.hpp.
| #define GRAPHENE_DEFAULT_MIN_WITNESS_COUNT (11) |
Definition at line 86 of file config.hpp.
| #define GRAPHENE_DEFAULT_MINIMUM_FEEDS 7 |
Definition at line 119 of file config.hpp.
| #define GRAPHENE_DEFAULT_NETWORK_PERCENT_OF_FEE (20*GRAPHENE_1_PERCENT) |
Definition at line 92 of file config.hpp.
| #define GRAPHENE_DEFAULT_PRICE_FEED_LIFETIME (60*60*24) |
1 day
Definition at line 67 of file config.hpp.
| #define GRAPHENE_DEFAULT_WITNESS_PAY_PER_BLOCK (GRAPHENE_BLOCKCHAIN_PRECISION * int64_t( 10) ) |
Definition at line 115 of file config.hpp.
| #define GRAPHENE_DEFAULT_WITNESS_PAY_VESTING_SECONDS (60*60*24) |
Definition at line 116 of file config.hpp.
| #define GRAPHENE_DEFAULT_WORKER_BUDGET_PER_DAY (GRAPHENE_BLOCKCHAIN_PRECISION * int64_t(500) * 1000 ) |
Definition at line 117 of file config.hpp.
| #define GRAPHENE_FBA_STEALTH_DESIGNATED_ASSET (asset_id_type(743)) |
Definition at line 148 of file config.hpp.
| #define GRAPHENE_IRREVERSIBLE_THRESHOLD (70 * GRAPHENE_1_PERCENT) |
Definition at line 126 of file config.hpp.
| #define GRAPHENE_MAX_ACCOUNT_NAME_LENGTH 63 |
Definition at line 30 of file config.hpp.
| #define GRAPHENE_MAX_ASSET_SYMBOL_LENGTH 16 |
Definition at line 33 of file config.hpp.
| #define GRAPHENE_MAX_BLOCK_INTERVAL 30 /* seconds */ |
Definition at line 43 of file config.hpp.
| #define GRAPHENE_MAX_COLLATERAL_RATIO 32000 |
higher than this is unnecessary and may exceed int16 storage
Definition at line 80 of file config.hpp.
| #define GRAPHENE_MAX_MARKET_FEE_PERCENT GRAPHENE_100_PERCENT |
NOTE: making this a power of 2 (say 2^15) would greatly accelerate fee calcs
Definition at line 63 of file config.hpp.
| #define GRAPHENE_MAX_NESTED_OBJECTS (200) |
Definition at line 150 of file config.hpp.
| #define GRAPHENE_MAX_SHARE_SUPPLY int64_t(1000000000000000ll) |
Definition at line 35 of file config.hpp.
| #define GRAPHENE_MAX_SIG_CHECK_DEPTH 2 |
Definition at line 36 of file config.hpp.
| #define GRAPHENE_MAX_UNDO_HISTORY 10000 |
Definition at line 53 of file config.hpp.
| #define GRAPHENE_MAX_URL_LENGTH 127 |
Definition at line 105 of file config.hpp.
| #define GRAPHENE_MAX_WORKER_NAME_LENGTH 63 |
Definition at line 103 of file config.hpp.
| #define GRAPHENE_MIN_ACCOUNT_NAME_LENGTH 1 |
Definition at line 29 of file config.hpp.
| #define GRAPHENE_MIN_ASSET_SYMBOL_LENGTH 3 |
Definition at line 32 of file config.hpp.
| #define GRAPHENE_MIN_BLOCK_INTERVAL 1 /* seconds */ |
Definition at line 42 of file config.hpp.
| #define GRAPHENE_MIN_BLOCK_SIZE_LIMIT (GRAPHENE_MIN_TRANSACTION_SIZE_LIMIT*5) |
Definition at line 55 of file config.hpp.
| #define GRAPHENE_MIN_COLLATERAL_RATIO 1001 |
lower than this could result in divide by 0
Definition at line 79 of file config.hpp.
| #define GRAPHENE_MIN_TRANSACTION_SIZE_LIMIT 1024 |
Don't allow the committee_members to publish a limit that would make the network unable to operate.
Definition at line 41 of file config.hpp.
| #define GRAPHENE_MIN_UNDO_HISTORY 10 |
Definition at line 52 of file config.hpp.
| #define GRAPHENE_NULL_ACCOUNT (graphene::chain::account_id_type(3)) |
Represents the canonical account with NO authority (nobody can access funds in null account)
Definition at line 139 of file config.hpp.
| #define GRAPHENE_NULL_WITNESS (graphene::chain::witness_id_type(0)) |
Sentinel value used in the scheduler.
Definition at line 145 of file config.hpp.
| #define GRAPHENE_PROXY_TO_SELF_ACCOUNT (graphene::chain::account_id_type(5)) |
Represents the canonical account for specifying you will vote directly (as opposed to a proxy)
Definition at line 143 of file config.hpp.
| #define GRAPHENE_RECENTLY_MISSED_COUNT_DECREMENT 3 |
Definition at line 122 of file config.hpp.
| #define GRAPHENE_RECENTLY_MISSED_COUNT_INCREMENT 4 |
Definition at line 121 of file config.hpp.
| #define GRAPHENE_RELAXED_COMMITTEE_ACCOUNT (graphene::chain::account_id_type(2)) |
Represents the current committee members.
Definition at line 137 of file config.hpp.
| #define GRAPHENE_SYMBOL "BTS" |
Definition at line 26 of file config.hpp.
| #define GRAPHENE_TEMP_ACCOUNT (graphene::chain::account_id_type(4)) |
Represents the canonical account with WILDCARD authority (anybody can access funds in temp account)
Definition at line 141 of file config.hpp.
| #define GRAPHENE_WITNESS_ACCOUNT (graphene::chain::account_id_type(1)) |
Represents the current witnesses.
Definition at line 135 of file config.hpp.


Reports Collection.addAll() and Map.putAll() calls after instantiation of a collection using a constructor call without arguments.
Such constructs can be replaced with a single call to a parametrized constructor which simplifies code. Also for some collections the replacement
might be more performant.
For example:
Set<String> set = new HashSet<>();
set.addAll(Arrays.asList("alpha", "beta", "gamma"));
can be replaced with:
Set<String> set = new HashSet<>(Arrays.asList("alpha", "beta", "gamma"));
Standard JDK collection classes are supported by default. Additionally you may specify other classes in the settings.


July 2020
In poultry health management, drugs and vaccine are very essential. Proper care must be taken to avoid excess mortality in the poultry business. Below is the time table for medication and vaccine programme for Broilers. Day 1: Marek vaccine which is usually giving to the chicks at hatchery. On getting to your brooding pen, the chicks just need glucose or multivitamin to ease transportation stress, don't mix the two together to avoid contraindication. Then serve them the broiler starter feed. Day 2-4: Multivitamins in the morning, antibiotics in the afternoon. Day 5-7: Anti-coccidiosis in the morning and multivitamin in the afternoon. Day 8: Gumboro vaccine. Day 9: Multivitamins Day 10-12: Anti-coccidiosis and vitamins. Day 13: Lasota vaccine mix with milk: a tablespoon full of Cow Bell or any other powder milk in 5 litres of drinking water. Day 14-19: Multivitamins. Day 20: 2nd Gumboro vaccine. Day 21-23: Multivitamins. Day 24-26: Anti-coccidiosis. Day 27: 2nd Lasota. Day 28-30: Multivitamins. Day 31-41: Clean drinking water Day 42: Deworming. Any day beyond six weeks (42 days), you can be giving them clean drinking water only till they are being sold or slaughtered. This is to comply with the withdrawal method on the drug label. Electrolyte can be giving within this time if you notice heat stress. PLEASE NOTE THAT: * When administering vaccine handle with extra care, if possible ask a vet doctor or practicing farmer to help you out. * Vaccine should giving at very low atmospheric temperature like early in the morning or very late in the evening. * It is advisable to go for both Gumboro and Lasota that water soluble because they are easy to use, just to be added to drinking water with powder milk. You can contact us for more information about this or other poultry related issues.
July 2020
Many thought raising birds is kind of a big deal, which has discouraged many to start athis profitable business.No one needs to have a formal education before raising birds. There are very necessary knowlegdes (which I will be sharing in this blog) we must have before starting. Firstly we need to note that rearing birds (poultry) is one of the easiest part of farming.
Get quality birds from reliable source like Destiny Agro.
Set up a non expensive and suitable environment for the chiks (an environment with much air and less cold, like a small room or a cage protected with some perfurated tapolins or thick nylons, a lantern which serves has heat and light producer ).
Get local feeders from a nearby poultry store (feeders, drinkers, feeds (starter from day one to week four, grower from week four to week 10 or 12, finisher from the next week till ready for consumption).


TL;DR
You can use System.CommandLine
to build console applications. The blog post explains how to build one on top of Clean Architecture solution. You can check out the sample, it contains more information and source code: https://github.com/NikiforovAll/clean-cli-todo-example.
As a developer, I quite often want to create a console application to try things out. Usually, it works well, but I always find myself in an inconvenient position. The Program.cs
bloats in messy monster with actual useful nuggets of codes in between of code that works with args
and some plumbing code. For some tasks, it works, but for others, I would like to suggest something more manageable and clean.
Introduction to System.CommandLine
System.CommandLine
gives you a great experience by providing essential functionality, such as parsing, invocation, and rendering. Let’s see how we can write a simple “Todo List” application with it.
Here is the simple console application that prints “help” provided automatically by the System.CommandLine
.
// Program.cs
using System.CommandLine;
using System.CommandLine.Builder;
using System.CommandLine.Invocation;
using System.CommandLine.Parsing;
var root = new RootCommand("Root command description");
root.Handler = CommandHandler.Create(() => root.Invoke("-h"));
var builder = new CommandLineBuilder(root);
var parser = builder.UseDefaults().Build();
await parser.InvokeAsync(args);
And the output:
$ dotnet run
app-name
Root command description
Usage:
app-name [options]
Options:
--version Show version information
-?, -h, --help Show help and usage information
The Command
composition defines the structure and the way your app looks and feels. You can assign ICommandHandler
to the command. It is used during the invocation phase and provides you model-binding functionality. I suggest you to go through https://github.com/dotnet/command-line-api/blob/main/docs/How-To.md and https://github.com/dotnet/command-line-api/blob/main/docs/Features-overview.md to get yourself more comfortable with this awesome library.
Let’s move forward and see a slightly different version built on top of .NET Core Generic Host.
The code below performs the following:
- Initializes and configures
CommandLineBuilder
. - Plugs
IHostBuilder
intoCommandLineBuilder
so it can be used later to build an invocation pipeline. - Builds
Parser
based on the configured instance ofCommandLineBuilder
. - Invokes
Parser
with arguments provided byProgram.Main
method.
var parser = BuildCommandLine()
.UseHost(_ => Host.CreateDefaultBuilder(args), (builder) =>
{
builder.ConfigureServices((hostContext, services) =>
{
var configuration = hostContext.Configuration;
// register other dependencies here
})
.UseCommandHandler<ExampleCommand, ExampleCommand.Handler>()
}).UseDefaults().Build();
return await parser.InvokeAsync(args);
static CommandLineBuilder BuildCommandLine()
{
var root = new RootCommand();
root.AddCommand(new ExampleCommand());
return new CommandLineBuilder(root);
}
The benefit of this style is that you can easily understand how CLI application is composed and what are the dependencies.
As you may notice, we hooked up the command and corresponding handler via UseCommandHandler
. It allows us to resolve dependencies for command handlers.
public class ExampleCommand : Command
{
public ExampleCommand() : base(name: "example", "Example description") {}
public new class Handler : ICommandHandler
{
private readonly IMediator meditor;
public Handler(IMediator meditor) =>
this.meditor = meditor ?? throw new ArgumentNullException(nameof(meditor));
public async Task<int> InvokeAsync(InvocationContext context)
{
await this.meditor.Send(new ExampleQuery{});
return 0;
}
}
}
With this knowledge in mind, let’s move further with something more interesting functionality to implement. I would like to show you how to use “Clean Architecture” approach together with CLI applications, therefore Clean CLI. I will use https://github.com/jasontaylordev/CleanArchitecture as an example of Clean Architecture project, please investigate sample code based before continue reading the blog post https://github.com/NikiforovAll/clean-cli-todo-example.
System.CommandLine ➕ Clean Architecture = Clean CLI
Our goal is to build “Todo List” application. 📃📝
Design goals:
- To use a CLI as UI for a Clean Architecture based solution.
- To design an application that clearly communicates (through code) implemented functionality (commands) and structural composition in general.
- To provide a first-class CLI interface user experience. Luckily,
System.CommandLine
helps with things such as “help text” generation and autocompletion.
Before going deeper into source code let’s examine how to consume the todo-cli.
$ dotnet run -- -h
CleanCli.Todo.Console
Usage:
CleanCli.Todo.Console [options] [command]
Options:
--silent Disables diagnostics output
--version Show version information
-?, -h, --help Show help and usage information
Commands:
todolist Todo lists management
todoitem Todo items management
migrate Migrates database
$ dotnet run -- todolist -h
todolist
Todo lists management
Usage:
CleanCli.Todo.Console [options] todolist [command]
Options:
--silent Disables diagnostics output
-?, -h, --help Show help and usage information
Commands:
create Creates todo list
delete <id> Deletes todo list
get <id> Gets a todo list
list Lists all todo lists in the system.
$ dotnet run -- todolist create -h
create
Creates todo list
Usage:
CleanCli.Todo.Console [options] todolist create
Options:
-t, --title <title> Title of the todo list
--dry-run Displays a summary of what would happen if the given command line were run.
--silent Disables diagnostics output
-?, -h, --help Show help and usage information
From the code perspective it looks like this (full version):
var runner = BuildCommandLine()
.UseHost(_ => CreateHostBuilder(args), (builder) => builder
.UseEnvironment("CLI")
.UseSerilog()
.ConfigureServices((hostContext, services) =>
{
services.AddCustomSerilog();
var configuration = hostContext.Configuration;
services.AddCli(); // Dependencies defined by CLI project (this).
services.AddApplication(); // Register "Application" project.
services.AddInfrastructure(configuration); // Register "Infrastructure" project.
})
.UseCommandHandler<CreateTodoListCommand, CreateTodoListCommand.Handler>()
.UseCommandHandler<DeleteTodoListCommand, DeleteTodoListCommand.Handler>()
.UseCommandHandler<ListTodosCommand, ListTodosCommand.Handler>()
.UseCommandHandler<GetTodoListCommand, GetTodoListCommand.Handler>()
.UseCommandHandler<SeedTodoItemsCommand, SeedTodoItemsCommand.Handler>()
.UseCommandHandler<MigrateCommand, MigrateCommand.Handler>())
.UseDefaults().Build();
static CommandLineBuilder BuildCommandLine()
{
var root = new RootCommand();
root.AddCommand(BuildTodoListCommands());
root.AddCommand(BuildTodoItemsCommands());
root.AddCommand(new MigrateCommand());
root.AddGlobalOption(new Option<bool>("--silent", "Disables diagnostics output"));
root.Handler = CommandHandler.Create(() => root.Invoke("-h"));
return new CommandLineBuilder(root);
// omitted for brevity
}
As result, the project is plugged through DI to console application and all features provided by Application
project could be consumed from Console
project.
The application functionality is added as following:
// Application/ServiceCollectionExtensions.cs
public static class ServiceCollectionExtensions
{
public static IServiceCollection AddApplication(this IServiceCollection services)
{
services.AddAutoMapper(Assembly.GetExecutingAssembly());
services.AddValidatorsFromAssembly(Assembly.GetExecutingAssembly());
services.AddMediatR(Assembly.GetExecutingAssembly());
services.AddTransient(typeof(IPipelineBehavior<,>), typeof(ValidationBehaviour<,>));
services.AddTransient(typeof(IPipelineBehavior<,>), typeof(PerformanceBehaviour<,>));
return services;
}
}
// Infrastructure/ServiceCollectionExtensions.cs
public static class ServiceCollectionExtensions
{
public static IServiceCollection AddInfrastructure(this IServiceCollection services, IConfiguration configuration)
{
services.AddDbContext<ApplicationDbContext>(options =>
options.UseSqlite(configuration.GetConnectionString("DefaultConnection"),
b => b.MigrationsAssembly(typeof(ApplicationDbContext).Assembly.FullName)));
services.AddScoped<IApplicationDbContext>(provider => provider.GetService<ApplicationDbContext>());
services.AddScoped<IDomainEventService, DomainEventService>();
services.AddTransient<IDateTime, DateTimeService>();
return services;
}
}
Finally, we can add code that does actually something useful.
public class CreateTodoListCommand : Command
{
public IConsole Console { get; set; }
public CreateTodoListCommand() : base(name: "create", "Creates todo list")
{
this.AddOption(new Option<string>(new string[] { "--title", "-t" }, "Title of the todo list"));
}
public new class Handler : ICommandHandler
{
private readonly IMediator meditor;
public string Title { get; set; } // Conventional binding
public Handler(IMediator meditor) =>
this.meditor = meditor ?? throw new ArgumentNullException(nameof(meditor));
public async Task<int> InvokeAsync(InvocationContext context)
{
await this.meditor.Send(new CreateTodoListCommand { Title = this.Title });
return 0;
}
}
}
Underlying implementation from Application
project.
public class CreateTodoListCommand : IRequest<int>
{
public string Title { get; set; }
}
public class CreateTodoListCommandHandler : IRequestHandler<CreateTodoListCommand, int>
{
private readonly IApplicationDbContext context;
public CreateTodoListCommandHandler(IApplicationDbContext context) =>
this.context = context;
public async Task<int> Handle(
CreateTodoListCommand request,
CancellationToken cancellationToken)
{
var entity = new TodoList { Title = request.Title };
this.context.TodoLists.Add(entity);
await this.context.SaveChangesAsync(cancellationToken);
return entity.Id;
}
}
If you are interested in this approach, I encourage you to investigate the source code on your own.
Demo
Let’s run migrate
command to create local todo.db and seed initial data.
Create todo list:
List commands:
See todo list details:
I hope you find this blog post useful. Take care!


Thiago Azeredo
Full-stack software developer
Intro
Portfolio
Posts
About Me
Contact
Github
Linkedin
Email
{{ .Site.Params.title}}
{{ .Site.Params.subtitle | markdownify}}
{{ range .Site.Params.tags }}
{{ . }}
{{ end }}
and some other things that probably I forgot...
Portfolio
{{partial "projects.html" .}}
Posts
{{partial "posts.html" . }}
About Me
{{partial "about.html" . }}
Contact
{{partial "contact.html" . }}


Malarkey Designer Shingles (Class 4)
The Windsor® designer shingle offers the look of a traditional cedar shake roof with the fortified durability of NEX® polymer modified asphalt technology to promote superior granule adhesion and extreme weather protection, including Class 4 impact resistance. This product also features Scotchgard™ Protector from 3M for added protection against black streaks caused by algae.
Windsor® Scotchgard Features & Benefits
Limited lifetime material warranty
110 mph limited wind warranty (Enhanced warranty available)
Windsor® Limited Lifetime Scotchgard™ protector warranty
Your Choice™ Warranty Program
15 year Right-Start™ period
Sustainable, polymer modified asphalt technology increases shingle flexibility, granule adhesion, and impact resistance
Resists alage staining and helps maintain the aesthetic appearance of your roof. Includes Limited Lifetime Warranty.
Class 4 impact resistance offers your roof a high rate of protection
A blend of algae resistant granules helps maintain the aesthetic appearance of your roof. Includes a 12-year AR warranty.
Specially formulated asphalt sealant holds shingles in place during high winds
Shingles with Nex® polymer modified asphalt are more resistance to tearing and nail pull-out, reducing the risk of shingle blow-off
Asphalt technology provides flexibility for application in a wider range of climates and roof styles
110 mph Limited Wind Warranty included. Eligible for a 140 mph Enhanced Wind Warranty when additional standards are met.
Vista® Shingles
Vista® Shingle Line Features & Benefits
Limited lifetime material warranty
110 mph limited wind warranty (Enhanced warranty available)
Vista® AR 12-year algae resistance system warranty
Your Choice™ Warranty Program
12 year Right-Start™ period
Vista® Sienna Blend and Silverwood listed with the CRRC
Vista® Sienna Blend and Silverwood can be used to comply with CEC Title 24, Part 6 Cool Roof Requirements
Sustainable, polymer modified asphalt technology increases shingle flexibility, granule adhesion, and impact resistance
Class 3 impact resistance offers your roof a high rate of protection
A blend of algae resistant granules helps maintain the aesthetic appearance of your roof. Includes a 12-year AR warranty.
Superior granule adhesion provides your roof lasting beauty and protection from damaging solar rays
Specially formulataed asphalt sealant holds shingles in place during high winds and rain sealants protect from wind-driven rain.
110 mph Limited Wind Warranty. Eligible for 130 mph Enhanced Wind Warranty when additional standards are met.
Shingles with NEX polymer modified asphalt are more resistance to tearing and nail pull-out, reducing the risk of shingle blow-off.
The Zone ® nailing area dramatically improves correct fastener placement during installation.
Asphalt technology provides flexibility for application in a wider range of climates and and roof styles.
Vista ® Sienne Blend and Silverwood shingles relfect solar rays which may reduce the heat entering your home and extend the life of your roof.
110 mph Limited Wind Warranty. Eligible for 130 mph Enhanced Wind Warranty when additional standards are met.
Get started on your roof installation project in Cedar Falls and Cedar Rapids, IA
Your search for experienced roofers ends here. T.E.A.M. Builders LTD provides roof installation and repair services in the Cedar Falls and Cedar Rapids, IA area. We also specialize in roofing insurance claims and can help you navigate the insurance claim process from start to finish to get you the money for your roofing repair.
You can rely on our skilled roofing contractor to sit down with you, go over your roofing needs and help you choose a roofing material that’s right for your home. The Malarkey asphalt shingle roofing we install is both durable and attractive.
It is made with rubber polymers that gives it self-healing qualities. We use this material becuase we believe it is the best product on the market and provides homeowners the best valute. We want the roof that we put on your home to be the last roof you will ever put on in your lifetime. Our experts can replace your outdated, damaged roof or install one on your new construction home.
Avoid water damage and annoying insect infestations
Trust a roofing contractor at T.E.A.M. Builders to take care of your roof repairs in Cedar Falls and Cedar Rapids, IA or surrounding areas. We can repair your roof if:
- • It's punctured, leaking, or sagging
- • It's holding water
- • It's missing shingles or granules
- • It's got algae growth
- • It's seals are coming loose
- • It's been damaged by hail or wind


Here is MediaScape. This game is supposed to symbolize the permeation of media into our lives.
Try using the arrow keys to avoid the various forms of media and get to the heart.


Preparation time
1-2 hours
Cooking time
30 mins to 1 hour
Serves
Serves 4
Lobster is one of life’s greatest luxuries and it deserves the silky beauty of hand-made pasta.
For this recipe you will need a pasta machine and a blender.
For the pasta, place the flour and 3 of the eggs into a food processor and pulse until it forms small crumbs. Remove the mixture from the food processor and pull together to form a dough.
Knead the dough lightly for 2-3 minutes until it is smooth and elastic then wrap in cling film and place in the fridge for 20 minutes.
Flour a pasta machine and turn it to the lowest (thickest) setting. Feed the dough through the machine, turning the handle with one hand and holding the dough as it comes through the machine with the other.
Change the setting on the pasta machine to the next-thickest setting, flour it again and feed the pasta sheet through the machine again, as before. Repeat this process 3-4 more times, flouring the machine and changing the setting down each time - it helps to cut the pasta into smaller pieces as you work to prevent it drying out. Cover any pasta you are not working on with cling film. Set the pasta aside. Any extra dough can be frozen for use on another occasion.
Cut the lobster in half lengthways and remove all the meat – taking care to keep the claw meat intact. Cut the lobster meat into 1cm/½in thick slices.
To make the tortellini, use a circular cutter to make 9cm/4in circles of pasta. Place a piece of tail meat on each circle and top with a basil leaf. Brush a little water on the edge of the pasta and fold over the top to make a semi-circle. Press down lightly to seal. Wrap the corners of the semi-circle around your index finger and join together to make a tortellini shape. You need 6 tortellini per person.
For the sauce, heat a frying pan until hot and add the butter and lobster shell and fry for 5-6 minutes. Add the chopped shallot, garlic, celery, carrot and thyme and cook gently for 3-4 minutes. Add the brandy, let it flambé then cook for a couple of minutes and add the stock. Bring to a boil and cook gently for a further 8-10 minutes. Finish with the cream and cook for a further 1-2 minutes.
Ladle the sauce in batches into a food processor and blend to a fine purée.
To cook the ravioli, bring a large pan of salted water to the boil and gently lower the ravioli into the pan. Cook for 1-2 minutes until they float to the top of the water then remove with a slotted spoon and drain on kitchen paper. Toss in the sauce.
To serve, heat a large saucepan of boiling water and blanch the samphire for 1-2 minutes. Drain well. Heat a frying pan and add the butter. Once melted, add the samphire and toss in the butter until hot. Place the samphire in the bottom of each serving bowl and top with 6 tortellini, then spoon over the sauce and garnish with tomato and chives.


map by itself
no alt on image with no area
no alt on image or area
no alt on image
no alt on area
just alt
alt and aria-label
aria-label and title
title and alt
only title
alt on area but not img


Alex Marquez to join brother Marc at Honda MotoGP team in 2020
Paris - Alex Marquez will ride alongside his older brother and six-time MotoGP world champion Marc at Honda next season, the team announced on Monday.
The 23-year-old Alex Marquez, who added the Moto2 world title this year to the Moto3 crown he won in 2014, has signed a one-year deal with the constructors' champions.
"He will move from the intermediate class to partner eight-time world champion Marc Marquez in 2020 for his debut season in the premier class," Honda said in a statement.
The younger Marquez replaces three-time top-class world champion Jorge Lorenzo, who retired after the weekend's season-ending Valencia Grand Prix.
Alex has been riding for Kalex in Moto2 and won five races in the 2019 campaign, taking the title by three points from South African Brad Binder.
The announcement ends Frenchman Johann Zarco's hopes of joining Honda's top outfit.