text
stringlengths
1
22.8M
is a Japanese singer and actress. Kikkawa achieved early fame portraying Kobeni Hanasaki from Kirarin Revolution Stage 3 and later debuted as a solo singer with the song, "Kikkake wa You!" Career 2006–2010: Pre-debut, Kirarin Revolution Kikkawa auditioned for Morning Musume's 8th generation in 2006 and was one of six finalists out of 6,883 applicants. Despite not making the group, she was accepted into Hello! Project's trainee group, Hello Pro Egg, in 2007. Prior to joining, she had done minor theatre work. In 2008, Kikkawa provided the voice to Kobeni Hanasaki in Kirarin Revolution Stage 3. She became part of the in-show subgroup MilkyWay with Koharu Kusumi from Morning Musume and Sayaka Kitahara from Hello Pro Egg. Kikkawa also released songs for the soundtrack under the name "Kobeni Hanasaki starring You Kikkawa." She also made televised and concert appearances portraying Kobeni in real life. 2011–present: Solo debut In 2011, Kikkawa debuted as a solo singer with the song "Kikkake wa You!" She appeared in the 2011 film Cheerfu11y. In 2013, she played the role of Chava in the Japanese production of Fiddler on the Roof. On May 6, 2015, Kikkawa releases her 9th single, "Hana", which is the longest single among idol artists in Japan, with about 17 and a half minutes in length, with strong influences of Takarazuka. Discography Albums Studio albums Compilation albums Cover albums Singles Regular singles Digital singles Filmography Dad, Chibi is Gone (2019) Film Television Tours References External links Up-Front agency profile Universal J official profile 1992 births Japanese idols Hello! Project members Living people Universal Music Japan artists Japanese women pop singers Japanese voice actresses Voice actresses from Ibaraki Prefecture Singers from Ibaraki Prefecture Up-Front Group
```cuda // your_sha256_hash------------------------- // NVEnc by rigaya // your_sha256_hash------------------------- // // // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // // your_sha256_hash-------------------------- #include <map> #include <array> #include "convert_csp.h" #include "NVEncFilterOverlay.h" #include "NVEncParam.h" #pragma warning (push) #pragma warning (disable: 4819) #include "cuda_runtime.h" #include "device_launch_parameters.h" #pragma warning (pop) #include "rgy_cuda_util_kernel.h" template<typename Type, int bit_depth> __global__ void kernel_run_overlay_plane( uint8_t *__restrict__ pDst, const int dstPitch, const uint8_t *__restrict__ pSrc, const int srcPitch, const int width, const int height, const uint8_t *__restrict__ pOverlay, const int overlayPitch, const uint8_t *__restrict__ pAlpha, const int alphaPitch, const int overlayWidth, const int overlayHeight, const int overlayPosX, const int overlayPosY) { const int ix = blockIdx.x * blockDim.x + threadIdx.x; const int iy = blockIdx.y * blockDim.y + threadIdx.y; if (ix < width && iy < height) { int ret = *(Type *)(pSrc + iy * srcPitch + ix * sizeof(Type)); if ( overlayPosX <= ix && ix < overlayPosX + overlayWidth && overlayPosY <= iy && iy < overlayPosY + overlayHeight) { const int overlaySrc = *(Type *)(pOverlay + (iy - overlayPosY) * overlayPitch + (ix - overlayPosX) * sizeof(Type) ); const int overlayAlpha = *(uint8_t *)(pAlpha + (iy - overlayPosY) * alphaPitch + (ix - overlayPosX) * sizeof(uint8_t)); const float overlayAlphaF = overlayAlpha / 255.0f; float blend = overlaySrc * overlayAlphaF + ret * (1.0f - overlayAlphaF); ret = (int)(blend + 0.5f); } Type *ptr = (Type *)(pDst + iy * dstPitch + ix * sizeof(Type)); ptr[0] = (Type)clamp(ret, 0, (1 << bit_depth) - 1); } } template<typename Type, int bit_depth> RGY_ERR run_overlay_plane( uint8_t *pDst, const int dstPitch, const uint8_t *pSrc, const int srcPitch, const int width, const int height, const uint8_t *pOverlay, const int overlayPitch, const uint8_t *pAlpha, const int alphaPitch, const int overlayWidth, const int overlayHeight, const int overlayPosX, const int overlayPosY, cudaStream_t stream) { dim3 blockSize(64, 8); dim3 gridSize(divCeil(width, blockSize.x), divCeil(height, blockSize.y)); kernel_run_overlay_plane<Type, bit_depth> << <gridSize, blockSize, 0, stream >> > ( pDst, dstPitch, pSrc, srcPitch, width, height, pOverlay, overlayPitch, pAlpha, alphaPitch, overlayWidth, overlayHeight, overlayPosX, overlayPosY); return err_to_rgy(cudaGetLastError()); } RGY_ERR NVEncFilterOverlay::overlayFrame(RGYFrameInfo *pOutputFrame, const RGYFrameInfo *pInputFrame, cudaStream_t stream) { auto prm = std::dynamic_pointer_cast<NVEncFilterParamOverlay>(m_param); if (!prm) { AddMessage(RGY_LOG_ERROR, _T("Invalid parameter type.\n")); return RGY_ERR_INVALID_PARAM; } static const std::map<RGY_CSP, decltype(run_overlay_plane<uint8_t, 8>)*> func_list = { { RGY_CSP_YV12, run_overlay_plane<uint8_t, 8> }, { RGY_CSP_YV12_16, run_overlay_plane<uint16_t, 16> }, { RGY_CSP_YUV444, run_overlay_plane<uint8_t, 8> }, { RGY_CSP_YUV444_16, run_overlay_plane<uint16_t, 16> }, }; if (func_list.count(pInputFrame->csp) == 0) { AddMessage(RGY_LOG_ERROR, _T("unsupported csp %s.\n"), RGY_CSP_NAMES[pInputFrame->csp]); return RGY_ERR_UNSUPPORTED; } for (int iplane = 0; iplane < RGY_CSP_PLANES[pInputFrame->csp]; iplane++) { const auto planeTarget = (RGY_PLANE)iplane; auto planeOut = getPlane(pOutputFrame, planeTarget); const auto planeIn = getPlane(pInputFrame, planeTarget); const auto planeFrame = getPlane(m_frame.inputPtr, planeTarget); const auto planeAlpha = getPlane(m_alpha.inputPtr, planeTarget); const auto posX = (planeTarget != RGY_PLANE_Y && RGY_CSP_CHROMA_FORMAT[pInputFrame->csp] == RGY_CHROMAFMT_YUV420) ? prm->overlay.posX >> 1 : prm->overlay.posX; const auto posY = (planeTarget != RGY_PLANE_Y && RGY_CSP_CHROMA_FORMAT[pInputFrame->csp] == RGY_CHROMAFMT_YUV420) ? prm->overlay.posY >> 1 : prm->overlay.posY; auto sts = func_list.at(pInputFrame->csp)( planeOut.ptr[0], planeOut.pitch[0], planeIn.ptr[0], planeIn.pitch[0], planeIn.width, planeIn.height, planeFrame.ptr[0], planeFrame.pitch[0], planeAlpha.ptr[0], planeAlpha.pitch[0], planeAlpha.width, planeAlpha.height, posX, posY, stream); if (sts != RGY_ERR_NONE) { AddMessage(RGY_LOG_ERROR, _T("error at overlay(%s): %s.\n"), RGY_CSP_NAMES[pInputFrame->csp], get_err_mes(sts)); return sts; } } return RGY_ERR_NONE; } ```
```xml import { basename } from 'path'; import { Node, Project, SyntaxKind } from 'ts-morph'; /** * For Hydrogen v2, the `server.ts` file exports a signature like: * * ``` * export default { * async fetch( * request: Request, * env: Env, * executionContext: ExecutionContext, * ): Promise<Response>; * } * ``` * * Here we parse the AST of that file so that we can: * * 1. Convert the signature to be compatible with Vercel Edge functions * (i.e. `export default (res: Response): Promise<Response>`). * * 2. Track usages of the `env` parameter which (which gets removed), * so that we can create that object based on `process.env`. */ export function patchHydrogenServer( project: Project, serverEntryPoint: string ) { const sourceFile = project.addSourceFileAtPath(serverEntryPoint); const defaultExportSymbol = sourceFile.getDescendantsOfKind( SyntaxKind.ExportAssignment )[0]; const envProperties: string[] = []; if (!defaultExportSymbol) { console.log( `WARN: No default export found in "${basename(serverEntryPoint)}"` ); return; } const objectLiteral = defaultExportSymbol.getFirstChildByKind( SyntaxKind.ObjectLiteralExpression ); if (!Node.isObjectLiteralExpression(objectLiteral)) { console.log( `WARN: Default export in "${basename( serverEntryPoint )}" does not conform to Oxygen syntax` ); return; } const fetchMethod = objectLiteral.getProperty('fetch'); if (!fetchMethod || !Node.isMethodDeclaration(fetchMethod)) { console.log( `WARN: Default export in "${basename( serverEntryPoint )}" does not conform to Oxygen syntax` ); return; } const parameters = fetchMethod.getParameters(); // Find usages of the env object within the fetch method const envParam = parameters[1]; const envParamName = envParam.getName(); if (envParam) { fetchMethod.forEachDescendant(node => { if ( Node.isPropertyAccessExpression(node) && node.getExpression().getText() === envParamName ) { envProperties.push(node.getName()); } }); } // Vercel does not support the Web Cache API, so find // and replace `caches.open()` calls with `undefined` fetchMethod.forEachDescendant(node => { if ( Node.isCallExpression(node) && node.getExpression().getText() === 'caches.open' ) { node.replaceWithText(`undefined /* ${node.getText()} */`); } }); // Remove the 'env' parameter to match Vercel's Edge signature parameters.splice(1, 1); // Construct the new function with the parameters and body of the original fetch method const newFunction = `export default async function(${parameters .map(p => p.getText()) .join(', ')}) ${fetchMethod.getBody()!.getText()}`; defaultExportSymbol.replaceWithText(newFunction); const defaultEnvVars = { SESSION_SECRET: 'foobar', PUBLIC_STORE_DOMAIN: 'mock.shop', }; const envCode = `const env = { ${envProperties .map(name => `${name}: process.env.${name}`) .join(', ')} };\n${Object.entries(defaultEnvVars) .map( ([k, v]) => `if (!env.${k}) { env.${k} = ${JSON.stringify( v )}; console.warn('Warning: ${JSON.stringify( k )} env var not set - using default value ${JSON.stringify(v)}'); }` ) .join('\n')}`; const updatedCodeString = sourceFile.getFullText(); return `${envCode}\n${updatedCodeString}`; } ```
Oberea luluensis is a species of beetle in the family Cerambycidae. It was described by Stephan von Breuning in 1950. References Beetles described in 1950 linearis
Jania Góra is a village in the administrative district of Gmina Świekatowo, within Świecie County, Kuyavian-Pomeranian Voivodeship, in north-central Poland. It lies approximately south-west of Świekatowo, west of Świecie, and north of Bydgoszcz. References Villages in Świecie County
John James Beckley (August 4, 1757 – April 8, 1807) was an American political campaign manager and the first Librarian of the United States Congress, from 1802 to 1807. He is credited with being the first political campaign manager in the United States and for setting the standards for the First Party System. Early years Born in London, Beckley's parents sent him at the age of 11 to the Colony of Virginia as an indentured servant. John James Beckley was sold to the mercantile firm of John Norton & Son in response to a request for a scribe by John Clayton, and he arrived in Virginia just before his 12th birthday. Clayton guided Beckley's continuing education, and in working with Clayton, Beckley was introduced to many influential members of the colony. When Clayton died in December 1773, Beckley chose to remain in Virginia rather than return to London. Contrary to many reports, he was never a student at the College of William and Mary. The Phi Beta Kappa Society had its beginning at the College of William and Mary on December 5, 1776. Since Beckley was not a student at the college, he was not eligible for membership. On December 10, 1778, the constitution of the society was broadened to permit the election of non-students, and a few months later, on April 10, 1779, Beckley was elected. Within a month, as might have been predicted, he was chosen clerk, or secretary. Career In June of 1782, Beckley participated in the first election of the city of Richmond, Virginia and was one of the 12 elected councilmen. In 1783, he was elected mayor of Richmond, a role in which he would serve three times. By this time, he had amassed of rich, unoccupied land in the west, but it was tied up in litigation. Beckley was a Freemason, and in 1785 participated in a fundraising effort which was responsible for constructing Mason's Hall in Richmond. James Madison sponsored him as Clerk of the House in 1789. When the position of Librarian of Congress was established on January 26, 1802, President Thomas Jefferson asked his friend and political ally John Beckley—who also was serving as the Clerk of the House of Representatives—to fill the post. As the first Librarian of Congress he was paid $2 a day. Beckley served concurrently in both positions until his death in 1807. He associated with the radicals (especially fellow immigrants) and became an enthusiastic supporter of the French Revolution. He wrote frequently for Philip Freneau's National Gazette and Benjamin Bache's General Advertiser, becoming known as an articulate exponent of American republicanism. He used the press energetically to denounce Hamilton and the Federalists as crypto-monarchists whose corruption was subversive of American values. He was elected to the American Philosophical Society in 1791. Political activities By 1792, he had started a propaganda machine for the new Republican party that Jefferson and Madison were forming. Thus, he told Madison in May 1795, "I enclose eight copies of the 'Political Observations.' I brought two dozen from New York and have distributed them all. I expect 50 more in a day or two, and shall scatter them also—they were bought and dispersed in great numbers there, and are eagerly enquired after by numbers here—it will be republished in Boston, Portsmouth, Vermont, and at Richmond." Also in 1792, he brought to light Alexander Hamilton's relationship with James Reynolds and his wife Maria. This led to James Monroe, Congressmen Muhlenberg (PA) and Venable (VA) confronting the Treasury Secretary on December 15, 1792. Hamilton denied any financial wrongdoing but admitted to an affair with the wife Maria and paying hush money to her husband. The Republicans agreed to keep the matter confidential and it did not become public until 1797. In 1795, he took the lead in denouncing Jay's Treaty and had emerged as the most visible spokesman of the new Republican Party. Writing under the sobriquet of "A Calm Observer," in 1796 he charged that, among other heinous offenses, George Washington had stolen public funds and that he richly deserved impeachment. In 1796, he managed the Jefferson campaign in Pennsylvania, blanketing the state with agents who passed out 30,000 hand-written tickets, naming all 15 electors (printed tickets were not allowed). Thus, he told one agent, "In a few days a select republican friend from the City will call upon you with a parcel of tickets to be distributed in your County. Any assistance and advice you can furnish him with, as to suitable districts & characters, will I am sure be rendered. He is one of two republican friends, who have undertaken to ride thro' all the middle & lower counties on this business, and bring with them 6 or 8 thousand tickets." Beckley thus became the first American professional campaign manager. Federalists had him removed as House clerk in 1797. His allies in Pennsylvania soon found him a state job and he became even more active in promoting the Jefferson candidacy in 1800. Jefferson rewarded him with his old post of Clerk of the United States House of Representatives; Beckley got the House to add on the title of Librarian of Congress. Family Beckley married Maria Prince, the daughter of a retired ship captain, just before Congress moved from New York to Philadelphia, where the two would live from 1791 until 1801. Their son, Alfred Beckley, was born May 26, 1802. Alfred would go on to found the town of Beckley on the western lands (now in West Virginia), and named it in honor of his father. His home, Wildwood, was listed on the National Register of Historic Places in 1970. References External links 1757 births 1807 deaths Clerks of the United States House of Representatives Librarians of Congress College of William & Mary alumni Mayors of Richmond, Virginia Librarians from London Virginia Democratic-Republicans
```python # -*- coding: utf-8 -*- """ flask.ext ~~~~~~~~~ Redirect imports for extensions. This module basically makes it possible for us to transition from flaskext.foo to flask_foo without having to force all extensions to upgrade at the same time. When a user does ``from flask.ext.foo import bar`` it will attempt to import ``from flask_foo import bar`` first and when that fails it will try to import ``from flaskext.foo import bar``. We're switching from namespace packages because it was just too painful for everybody involved. :copyright: (c) 2015 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ def setup(): from ..exthook import ExtensionImporter importer = ExtensionImporter(['flask_%s', 'flaskext.%s'], __name__) importer.install() setup() del setup ```
This is the progression of world record improvements of the triple jump W45 division of Masters athletics. Key: References External links Masters Athletics Triple Jump list Masters athletics world record progressions Triple jump
Lida Fariman (, born 10 July 1972) is an Iranian sports shooter. She was born in Tabriz. She competed in the women's 10 metre air rifle event at the 1996 Summer Olympics. References 1972 births Living people Iranian female sport shooters Olympic shooters for Iran Shooters at the 1996 Summer Olympics Place of birth missing (living people) Asian Games bronze medalists for Iran Asian Games medalists in shooting Shooters at the 1994 Asian Games Shooters at the 1998 Asian Games Shooters at the 2002 Asian Games Medalists at the 2002 Asian Games 20th-century Iranian women 21st-century Iranian women
Suresh Singh (; born 27 September 1973) is a Malaysian cricketer. A right-handed batsman and right-arm medium pace bowler, he has played for the Malaysia national cricket team since 1995. Biography Born in Labuan in 1973, Suresh Singh made his debut for Malaysia in September 1995, playing in the annual Saudara Cup match against Singapore. He played in the fixture again in 1996, a year in which he played in the Stan Nagaiah Trophy series for the first time. He also played in the series in 1997 and 1998. He played in the 1997 ICC Trophy in Kuala Lumpur and made his List A debut in March 1998, playing two matches for Malaysia in the Wills Cup, a Pakistani domestic one-day competition. He also played in the ACC Trophy in Nepal later in the year. He was then absent from the Malaysian side until 2001, when he returned for that year's Stan Nagaiah Trophy. He also played in the 2001 ICC Trophy in Ontario. He played for Malaysia in a match against the ECB National Academy in February 2003, playing one match in the Stan Nagaiah Trophy series the following month. His next match for Malaysia wasn't until December 2006, when he played the Saudara Cup match against Singapore. He has not played for Malaysia since. References 1973 births Living people People from Labuan Malaysian cricketers Malaysian Sikhs Malaysian sportspeople of Indian descent Malaysian people of Punjabi descent
```java /* * * * path_to_url * * Unless required by applicable law or agreed to in writing, software * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * * */ package easymvp.annotation; import android.os.Bundle; import android.view.View; import java.lang.annotation.Retention; import java.lang.annotation.Target; import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.RetentionPolicy.RUNTIME; /** * Annotation to inject the presenter that already defined in a {@link ActivityView#presenter()}, * a {@link FragmentView#presenter()} or a {@link CustomView#presenter()}. * <p> * It must be applied into the view implementation classes (<code>Activity</code>, <code>Fragment</code> or <code>Custom View</code>), * otherwise it won't work. * <p> * You have access to the presenter instance after super call in {@link android.app.Activity#onCreate(Bundle)}, * {@link android.app.Fragment#onActivityCreated(Bundle)} and {@link View#onAttachedToWindow} methods. * Also during configuration changes, same instance of presenter will be injected. * <p> * Here is an example: * <pre class="prettyprint"> * {@literal @}FragmentView(presenter = MyPresenter.class) * public class MyFragment extends Fragment{ * {@literal @}Presenter * MyPresenter presenter; * * } * * public class MyPresenter extends AbstractPresenter&lt;MyView&gt;{ * * public MyPresenter(){ * * } * } * * interface MyView{ * * } * </pre> * <p> * By default you can't pass any objects to the constructor of presenters, * but you can use <a href="path_to_url">Dagger</a> to inject presenters. * <p> * Here is an example of using dagger: * <pre class="prettyprint"> * {@literal @}FragmentView(presenter = MyPresenter.class) * public class MyFragment extends Fragment{ * * {@literal @}Inject * {@literal @}Presenter * MyPresenter presenter; * * {@literal @}Override * void onCreate(Bundle b){ * SomeComponent.injectTo(this); * } * } * * public class MyPresenter extends AbstractPresenter&lt;MyView&gt;{ * * public MyPresenter(){ * * } * } * interface MyView{ * * } * </pre> * @author Saeed Masoumi (saeed@6thsolution.com) */ @Retention(value = RUNTIME) @Target(value = FIELD) public @interface Presenter { } ```
```c++ /** * @file memfs.cpp * * @copyright 2015-2024 Bill Zissimopoulos */ /* * This file is part of WinFsp. * * You can redistribute it and/or modify it under the terms of the GNU * Foundation. * * in accordance with the commercial license agreement provided in * conjunction with the software. The terms and conditions of any such * commercial license agreement shall govern, supersede, and render * ineffective any application of the GPLv3 license to this software, * notwithstanding of any reference thereto in the software or * associated repository. */ #undef _DEBUG #include "memfs.h" #include <sddl.h> #include <VersionHelpers.h> #include <cassert> #include <map> #include <unordered_map> /* SLOWIO */ #include <thread> #define MEMFS_MAX_PATH 512 FSP_FSCTL_STATIC_ASSERT(MEMFS_MAX_PATH > MAX_PATH, "MEMFS_MAX_PATH must be greater than MAX_PATH."); /* * Define the MEMFS_STANDALONE macro when building MEMFS as a standalone file system. * This macro should be defined in the Visual Studio project settings, Makefile, etc. */ //#define MEMFS_STANDALONE /* * Define the MEMFS_DISPATCHER_STOPPED macro to include DispatcherStopped support. */ #define MEMFS_DISPATCHER_STOPPED /* * Define the MEMFS_NAME_NORMALIZATION macro to include name normalization support. */ #define MEMFS_NAME_NORMALIZATION /* * Define the MEMFS_REPARSE_POINTS macro to include reparse points support. */ #define MEMFS_REPARSE_POINTS /* * Define the MEMFS_NAMED_STREAMS macro to include named streams support. */ #define MEMFS_NAMED_STREAMS /* * Define the MEMFS_DIRINFO_BY_NAME macro to include GetDirInfoByName. */ #define MEMFS_DIRINFO_BY_NAME /* * Define the MEMFS_SLOWIO macro to include delayed I/O response support. */ #define MEMFS_SLOWIO /* * Define the MEMFS_CONTROL macro to include DeviceControl support. */ #define MEMFS_CONTROL /* * Define the MEMFS_EA macro to include extended attributes support. */ #define MEMFS_EA /* * Define the MEMFS_WSL macro to include WSLinux support. */ #define MEMFS_WSL /* * Define the MEMFS_REJECT_EARLY_IRP macro to reject IRP's sent * to the file system prior to the dispatcher being started. */ #if defined(MEMFS_STANDALONE) #define MEMFS_REJECT_EARLY_IRP #endif /* * Define the DEBUG_BUFFER_CHECK macro on Windows 8 or above. This includes * a check for the Write buffer to ensure that it is read-only. * * Since ProcessBuffer support in the FSD, this is no longer a guarantee. */ #if !defined(NDEBUG) //#define DEBUG_BUFFER_CHECK #endif #define MEMFS_SECTOR_SIZE 512 #define MEMFS_SECTORS_PER_ALLOCATION_UNIT 1 /* * Large Heap Support */ typedef struct { DWORD Options; SIZE_T InitialSize; SIZE_T MaximumSize; SIZE_T Alignment; } LARGE_HEAP_INITIALIZE_PARAMS; static INIT_ONCE LargeHeapInitOnce = INIT_ONCE_STATIC_INIT; static HANDLE LargeHeap; static SIZE_T LargeHeapAlignment; static BOOL WINAPI LargeHeapInitOnceF( PINIT_ONCE InitOnce, PVOID Parameter, PVOID *Context) { LARGE_HEAP_INITIALIZE_PARAMS *Params = (LARGE_HEAP_INITIALIZE_PARAMS *)Parameter; LargeHeap = HeapCreate(Params->Options, Params->InitialSize, Params->MaximumSize); LargeHeapAlignment = 0 != Params->Alignment ? FSP_FSCTL_ALIGN_UP(Params->Alignment, 4096) : 16 * 4096; return TRUE; } static inline BOOLEAN LargeHeapInitialize( DWORD Options, SIZE_T InitialSize, SIZE_T MaximumSize, SIZE_T Alignment) { LARGE_HEAP_INITIALIZE_PARAMS Params; Params.Options = Options; Params.InitialSize = InitialSize; Params.MaximumSize = MaximumSize; Params.Alignment = Alignment; InitOnceExecuteOnce(&LargeHeapInitOnce, LargeHeapInitOnceF, &Params, 0); return 0 != LargeHeap; } static inline PVOID LargeHeapAlloc(SIZE_T Size) { return HeapAlloc(LargeHeap, 0, FSP_FSCTL_ALIGN_UP(Size, LargeHeapAlignment)); } static inline PVOID LargeHeapRealloc(PVOID Pointer, SIZE_T Size) { if (0 != Pointer) { if (0 != Size) return HeapReAlloc(LargeHeap, 0, Pointer, FSP_FSCTL_ALIGN_UP(Size, LargeHeapAlignment)); else return HeapFree(LargeHeap, 0, Pointer), 0; } else { if (0 != Size) return HeapAlloc(LargeHeap, 0, FSP_FSCTL_ALIGN_UP(Size, LargeHeapAlignment)); else return 0; } } static inline VOID LargeHeapFree(PVOID Pointer) { if (0 != Pointer) HeapFree(LargeHeap, 0, Pointer); } /* * MEMFS */ static inline UINT64 MemfsGetSystemTime(VOID) { FILETIME FileTime; GetSystemTimeAsFileTime(&FileTime); return ((PLARGE_INTEGER)&FileTime)->QuadPart; } static inline unsigned MemfsUpperChar(unsigned c) { /* * Bit-twiddling upper case char: * * - Let signbit(x) = x & 0x100 (treat bit 0x100 as "signbit"). * - 'A' <= c && c <= 'Z' <=> s = signbit(c - 'A') ^ signbit(c - ('Z' + 1)) == 1 * - c >= 'A' <=> c - 'A' >= 0 <=> signbit(c - 'A') = 0 * - c <= 'Z' <=> c - ('Z' + 1) < 0 <=> signbit(c - ('Z' + 1)) = 1 * - Bit 0x20 = 0x100 >> 3 toggles uppercase to lowercase and vice-versa. * * This is actually faster than `(c - 'a' <= 'z' - 'a') ? (c & ~0x20) : c`, even * when compiled using cmov conditional moves at least on this system (i7-1065G7). * * See path_to_url */ unsigned s = ((c - 'a') ^ (c - ('z' + 1))) & 0x100; return c & ~(s >> 3); } static inline int MemfsWcsnicmp(const wchar_t *s0, const wchar_t *t0, int n) { /* Use fast loop for ASCII and fall back to CompareStringW for general case. */ const wchar_t *s = s0; const wchar_t *t = t0; int v = 0; for (const void *e = t + n; e > (const void *)t; ++s, ++t) { unsigned sc = *s, tc = *t; if (0xffffff80 & (sc | tc)) { v = CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, s0, n, t0, n); if (0 != v) return v - 2; else return _wcsnicmp(s, t, n); } if (0 != (v = MemfsUpperChar(sc) - MemfsUpperChar(tc)) || !tc) break; } return v;/*(0 < v) - (0 > v);*/ } static inline int MemfsFileNameCompare(PWSTR a, int alen, PWSTR b, int blen, BOOLEAN CaseInsensitive) { PWSTR p, endp, partp, q, endq, partq; WCHAR c, d; int plen, qlen, len, res; if (-1 == alen) alen = lstrlenW(a); if (-1 == blen) blen = lstrlenW(b); for (p = a, endp = p + alen, q = b, endq = q + blen; endp > p && endq > q;) { c = d = 0; for (; endp > p && (L':' == *p || L'\\' == *p); p++) c = *p; for (; endq > q && (L':' == *q || L'\\' == *q); q++) d = *q; if (L':' == c) c = 1; else if (L'\\' == c) c = 2; if (L':' == d) d = 1; else if (L'\\' == d) d = 2; res = c - d; if (0 != res) return res; for (partp = p; endp > p && L':' != *p && L'\\' != *p; p++) ; for (partq = q; endq > q && L':' != *q && L'\\' != *q; q++) ; plen = (int)(p - partp); qlen = (int)(q - partq); len = plen < qlen ? plen : qlen; if (CaseInsensitive) res = MemfsWcsnicmp(partp, partq, len); else res = wcsncmp(partp, partq, len); if (0 == res) res = plen - qlen; if (0 != res) return res; } return -(endp <= p) + (endq <= q); } static inline BOOLEAN MemfsFileNameHasPrefix(PWSTR a, PWSTR b, BOOLEAN CaseInsensitive) { int alen = (int)wcslen(a); int blen = (int)wcslen(b); return alen >= blen && 0 == MemfsFileNameCompare(a, blen, b, blen, CaseInsensitive) && (alen == blen || (1 == blen && L'\\' == b[0]) || #if defined(MEMFS_NAMED_STREAMS) (L'\\' == a[blen] || L':' == a[blen])); #else (L'\\' == a[blen])); #endif } #if defined(MEMFS_EA) static inline int MemfsEaNameCompare(PSTR a, PSTR b) { /* EA names are always case-insensitive in MEMFS (to be inline with NTFS) */ int res; res = CompareStringA(LOCALE_INVARIANT, NORM_IGNORECASE, a, -1, b, -1); if (0 != res) res -= 2; else res = _stricmp(a, b); return res; } struct MEMFS_FILE_NODE_EA_LESS { MEMFS_FILE_NODE_EA_LESS() { } bool operator()(PSTR a, PSTR b) const { return 0 > MemfsEaNameCompare(a, b); } }; typedef std::map<PSTR, FILE_FULL_EA_INFORMATION *, MEMFS_FILE_NODE_EA_LESS> MEMFS_FILE_NODE_EA_MAP; #endif typedef struct _MEMFS_FILE_NODE { WCHAR FileName[MEMFS_MAX_PATH]; FSP_FSCTL_FILE_INFO FileInfo; SIZE_T FileSecuritySize; PVOID FileSecurity; PVOID FileData; #if defined(MEMFS_REPARSE_POINTS) SIZE_T ReparseDataSize; PVOID ReparseData; #endif #if defined(MEMFS_EA) MEMFS_FILE_NODE_EA_MAP *EaMap; #endif volatile LONG RefCount; #if defined(MEMFS_NAMED_STREAMS) struct _MEMFS_FILE_NODE *MainFileNode; #endif } MEMFS_FILE_NODE; struct MEMFS_FILE_NODE_LESS { MEMFS_FILE_NODE_LESS(BOOLEAN CaseInsensitive) : CaseInsensitive(CaseInsensitive) { } bool operator()(PWSTR a, PWSTR b) const { return 0 > MemfsFileNameCompare(a, -1, b, -1, CaseInsensitive); } BOOLEAN CaseInsensitive; }; typedef std::map<PWSTR, MEMFS_FILE_NODE *, MEMFS_FILE_NODE_LESS> MEMFS_FILE_NODE_MAP; typedef struct _MEMFS { FSP_FILE_SYSTEM *FileSystem; MEMFS_FILE_NODE_MAP *FileNodeMap; ULONG MaxFileNodes; ULONG MaxFileSize; #ifdef MEMFS_SLOWIO ULONG SlowioMaxDelay; ULONG SlowioPercentDelay; ULONG SlowioRarefyDelay; volatile LONG SlowioThreadsRunning; #endif UINT16 VolumeLabelLength; WCHAR VolumeLabel[32]; } MEMFS; static inline NTSTATUS MemfsFileNodeCreate(PWSTR FileName, MEMFS_FILE_NODE **PFileNode) { static UINT64 IndexNumber = 1; MEMFS_FILE_NODE *FileNode; *PFileNode = 0; FileNode = (MEMFS_FILE_NODE *)malloc(sizeof *FileNode); if (0 == FileNode) return STATUS_INSUFFICIENT_RESOURCES; memset(FileNode, 0, sizeof *FileNode); wcscpy_s(FileNode->FileName, sizeof FileNode->FileName / sizeof(WCHAR), FileName); FileNode->FileInfo.CreationTime = FileNode->FileInfo.LastAccessTime = FileNode->FileInfo.LastWriteTime = FileNode->FileInfo.ChangeTime = MemfsGetSystemTime(); FileNode->FileInfo.IndexNumber = IndexNumber++; *PFileNode = FileNode; return STATUS_SUCCESS; } #if defined(MEMFS_EA) static inline VOID MemfsFileNodeDeleteEaMap(MEMFS_FILE_NODE *FileNode) { if (0 != FileNode->EaMap) { for (MEMFS_FILE_NODE_EA_MAP::iterator p = FileNode->EaMap->begin(), q = FileNode->EaMap->end(); p != q; ++p) free(p->second); delete FileNode->EaMap; FileNode->EaMap = 0; FileNode->FileInfo.EaSize = 0; } } #endif static inline VOID MemfsFileNodeDelete(MEMFS_FILE_NODE *FileNode) { #if defined(MEMFS_EA) MemfsFileNodeDeleteEaMap(FileNode); #endif #if defined(MEMFS_REPARSE_POINTS) free(FileNode->ReparseData); #endif LargeHeapFree(FileNode->FileData); free(FileNode->FileSecurity); free(FileNode); } static inline VOID MemfsFileNodeReference(MEMFS_FILE_NODE *FileNode) { InterlockedIncrement(&FileNode->RefCount); } static inline VOID MemfsFileNodeDereference(MEMFS_FILE_NODE *FileNode) { if (0 == InterlockedDecrement(&FileNode->RefCount)) MemfsFileNodeDelete(FileNode); } static inline VOID MemfsFileNodeGetFileInfo(MEMFS_FILE_NODE *FileNode, FSP_FSCTL_FILE_INFO *FileInfo) { #if defined(MEMFS_NAMED_STREAMS) if (0 == FileNode->MainFileNode) *FileInfo = FileNode->FileInfo; else { *FileInfo = FileNode->MainFileNode->FileInfo; FileInfo->FileAttributes &= ~FILE_ATTRIBUTE_DIRECTORY; /* named streams cannot be directories */ FileInfo->AllocationSize = FileNode->FileInfo.AllocationSize; FileInfo->FileSize = FileNode->FileInfo.FileSize; } #else *FileInfo = FileNode->FileInfo; #endif } #if defined(MEMFS_EA) static inline NTSTATUS MemfsFileNodeGetEaMap(MEMFS_FILE_NODE *FileNode, MEMFS_FILE_NODE_EA_MAP **PEaMap) { #if defined(MEMFS_NAMED_STREAMS) if (0 != FileNode->MainFileNode) FileNode = FileNode->MainFileNode; #endif *PEaMap = FileNode->EaMap; if (0 != *PEaMap) return STATUS_SUCCESS; try { *PEaMap = FileNode->EaMap = new MEMFS_FILE_NODE_EA_MAP(MEMFS_FILE_NODE_EA_LESS()); return STATUS_SUCCESS; } catch (...) { *PEaMap = 0; return STATUS_INSUFFICIENT_RESOURCES; } } static inline NTSTATUS MemfsFileNodeSetEa( FSP_FILE_SYSTEM *FileSystem, PVOID Context, PFILE_FULL_EA_INFORMATION Ea) { MEMFS_FILE_NODE *FileNode = (MEMFS_FILE_NODE *)Context; MEMFS_FILE_NODE_EA_MAP *EaMap; FILE_FULL_EA_INFORMATION *FileNodeEa = 0; MEMFS_FILE_NODE_EA_MAP::iterator p; ULONG EaSizePlus = 0, EaSizeMinus = 0; NTSTATUS Result; Result = MemfsFileNodeGetEaMap(FileNode, &EaMap); if (!NT_SUCCESS(Result)) return Result; if (0 != Ea->EaValueLength) { EaSizePlus = FIELD_OFFSET(FILE_FULL_EA_INFORMATION, EaName) + Ea->EaNameLength + 1 + Ea->EaValueLength; FileNodeEa = (FILE_FULL_EA_INFORMATION *)malloc(EaSizePlus); if (0 == FileNodeEa) return STATUS_INSUFFICIENT_RESOURCES; memcpy(FileNodeEa, Ea, EaSizePlus); FileNodeEa->NextEntryOffset = 0; EaSizePlus = FspFileSystemGetEaPackedSize(Ea); } p = EaMap->find(Ea->EaName); if (p != EaMap->end()) { EaSizeMinus = FspFileSystemGetEaPackedSize(Ea); free(p->second); EaMap->erase(p); } if (0 != Ea->EaValueLength) { try { EaMap->insert(MEMFS_FILE_NODE_EA_MAP::value_type(FileNodeEa->EaName, FileNodeEa)); } catch (...) { free(FileNodeEa); return STATUS_INSUFFICIENT_RESOURCES; } } FileNode->FileInfo.EaSize = FileNode->FileInfo.EaSize + EaSizePlus - EaSizeMinus; return STATUS_SUCCESS; } static inline BOOLEAN MemfsFileNodeNeedEa(MEMFS_FILE_NODE *FileNode) { #if defined(MEMFS_NAMED_STREAMS) if (0 != FileNode->MainFileNode) FileNode = FileNode->MainFileNode; #endif if (0 != FileNode->EaMap) { for (MEMFS_FILE_NODE_EA_MAP::iterator p = FileNode->EaMap->begin(), q = FileNode->EaMap->end(); p != q; ++p) if (0 != (p->second->Flags & FILE_NEED_EA)) return TRUE; } return FALSE; } static inline BOOLEAN MemfsFileNodeEnumerateEa(MEMFS_FILE_NODE *FileNode, BOOLEAN (*EnumFn)(PFILE_FULL_EA_INFORMATION Ea, PVOID), PVOID Context) { #if defined(MEMFS_NAMED_STREAMS) if (0 != FileNode->MainFileNode) FileNode = FileNode->MainFileNode; #endif if (0 != FileNode->EaMap) { for (MEMFS_FILE_NODE_EA_MAP::iterator p = FileNode->EaMap->begin(), q = FileNode->EaMap->end(); p != q; ++p) if (!EnumFn(p->second, Context)) return FALSE; } return TRUE; } #endif static inline VOID MemfsFileNodeMapDump(MEMFS_FILE_NODE_MAP *FileNodeMap) { for (MEMFS_FILE_NODE_MAP::iterator p = FileNodeMap->begin(), q = FileNodeMap->end(); p != q; ++p) FspDebugLog("%c %04lx %6lu %S\n", FILE_ATTRIBUTE_DIRECTORY & p->second->FileInfo.FileAttributes ? 'd' : 'f', (ULONG)p->second->FileInfo.FileAttributes, (ULONG)p->second->FileInfo.FileSize, p->second->FileName); } static inline BOOLEAN MemfsFileNodeMapIsCaseInsensitive(MEMFS_FILE_NODE_MAP *FileNodeMap) { return FileNodeMap->key_comp().CaseInsensitive; } static inline NTSTATUS MemfsFileNodeMapCreate(BOOLEAN CaseInsensitive, MEMFS_FILE_NODE_MAP **PFileNodeMap) { *PFileNodeMap = 0; try { *PFileNodeMap = new MEMFS_FILE_NODE_MAP(MEMFS_FILE_NODE_LESS(CaseInsensitive)); return STATUS_SUCCESS; } catch (...) { return STATUS_INSUFFICIENT_RESOURCES; } } static inline VOID MemfsFileNodeMapDelete(MEMFS_FILE_NODE_MAP *FileNodeMap) { for (MEMFS_FILE_NODE_MAP::iterator p = FileNodeMap->begin(), q = FileNodeMap->end(); p != q; ++p) MemfsFileNodeDelete(p->second); delete FileNodeMap; } static inline SIZE_T MemfsFileNodeMapCount(MEMFS_FILE_NODE_MAP *FileNodeMap) { return FileNodeMap->size(); } static inline MEMFS_FILE_NODE *MemfsFileNodeMapGet(MEMFS_FILE_NODE_MAP *FileNodeMap, PWSTR FileName) { MEMFS_FILE_NODE_MAP::iterator iter = FileNodeMap->find(FileName); if (iter == FileNodeMap->end()) return 0; return iter->second; } #if defined(MEMFS_NAMED_STREAMS) static inline MEMFS_FILE_NODE *MemfsFileNodeMapGetMain(MEMFS_FILE_NODE_MAP *FileNodeMap, PWSTR FileName0) { WCHAR FileName[MEMFS_MAX_PATH]; wcscpy_s(FileName, sizeof FileName / sizeof(WCHAR), FileName0); PWSTR StreamName = wcschr(FileName, L':'); if (0 == StreamName) return 0; StreamName[0] = L'\0'; MEMFS_FILE_NODE_MAP::iterator iter = FileNodeMap->find(FileName); if (iter == FileNodeMap->end()) return 0; return iter->second; } #endif static inline MEMFS_FILE_NODE *MemfsFileNodeMapGetParent(MEMFS_FILE_NODE_MAP *FileNodeMap, PWSTR FileName0, PNTSTATUS PResult) { WCHAR Root[2] = L"\\"; PWSTR Remain, Suffix; WCHAR FileName[MEMFS_MAX_PATH]; wcscpy_s(FileName, sizeof FileName / sizeof(WCHAR), FileName0); FspPathSuffix(FileName, &Remain, &Suffix, Root); MEMFS_FILE_NODE_MAP::iterator iter = FileNodeMap->find(Remain); FspPathCombine(FileName, Suffix); if (iter == FileNodeMap->end()) { *PResult = STATUS_OBJECT_PATH_NOT_FOUND; return 0; } if (0 == (iter->second->FileInfo.FileAttributes & FILE_ATTRIBUTE_DIRECTORY)) { *PResult = STATUS_NOT_A_DIRECTORY; return 0; } return iter->second; } static inline VOID MemfsFileNodeMapTouchParent(MEMFS_FILE_NODE_MAP *FileNodeMap, MEMFS_FILE_NODE *FileNode) { NTSTATUS Result; MEMFS_FILE_NODE *Parent; if (L'\\' == FileNode->FileName[0] && L'\0' == FileNode->FileName[1]) return; Parent = MemfsFileNodeMapGetParent(FileNodeMap, FileNode->FileName, &Result); if (0 == Parent) return; Parent->FileInfo.LastAccessTime = Parent->FileInfo.LastWriteTime = Parent->FileInfo.ChangeTime = MemfsGetSystemTime(); } static inline NTSTATUS MemfsFileNodeMapInsert(MEMFS_FILE_NODE_MAP *FileNodeMap, MEMFS_FILE_NODE *FileNode, PBOOLEAN PInserted) { *PInserted = 0; try { *PInserted = FileNodeMap->insert(MEMFS_FILE_NODE_MAP::value_type(FileNode->FileName, FileNode)).second; if (*PInserted) { MemfsFileNodeReference(FileNode); MemfsFileNodeMapTouchParent(FileNodeMap, FileNode); } return STATUS_SUCCESS; } catch (...) { return STATUS_INSUFFICIENT_RESOURCES; } } static inline VOID MemfsFileNodeMapRemove(MEMFS_FILE_NODE_MAP *FileNodeMap, MEMFS_FILE_NODE *FileNode) { if (FileNodeMap->erase(FileNode->FileName)) { MemfsFileNodeMapTouchParent(FileNodeMap, FileNode); MemfsFileNodeDereference(FileNode); } } static inline BOOLEAN MemfsFileNodeMapHasChild(MEMFS_FILE_NODE_MAP *FileNodeMap, MEMFS_FILE_NODE *FileNode) { BOOLEAN Result = FALSE; WCHAR Root[2] = L"\\"; PWSTR Remain, Suffix; MEMFS_FILE_NODE_MAP::iterator iter = FileNodeMap->upper_bound(FileNode->FileName); for (; FileNodeMap->end() != iter; ++iter) { #if defined(MEMFS_NAMED_STREAMS) if (0 != wcschr(iter->second->FileName, L':')) continue; #endif FspPathSuffix(iter->second->FileName, &Remain, &Suffix, Root); Result = 0 == MemfsFileNameCompare(Remain, -1, FileNode->FileName, -1, MemfsFileNodeMapIsCaseInsensitive(FileNodeMap)); FspPathCombine(iter->second->FileName, Suffix); break; } return Result; } static inline BOOLEAN MemfsFileNodeMapEnumerateChildren(MEMFS_FILE_NODE_MAP *FileNodeMap, MEMFS_FILE_NODE *FileNode, PWSTR PrevFileName0, BOOLEAN (*EnumFn)(MEMFS_FILE_NODE *, PVOID), PVOID Context) { WCHAR Root[2] = L"\\"; PWSTR Remain, Suffix; MEMFS_FILE_NODE_MAP::iterator iter; BOOLEAN IsDirectoryChild; if (0 != PrevFileName0) { WCHAR PrevFileName[MEMFS_MAX_PATH + 256]; size_t Length0 = wcslen(FileNode->FileName); size_t Length1 = 1 != Length0 || L'\\' != FileNode->FileName[0]; size_t Length2 = wcslen(PrevFileName0); assert(MEMFS_MAX_PATH + 256 > Length0 + Length1 + Length2); memcpy(PrevFileName, FileNode->FileName, Length0 * sizeof(WCHAR)); memcpy(PrevFileName + Length0, L"\\", Length1 * sizeof(WCHAR)); memcpy(PrevFileName + Length0 + Length1, PrevFileName0, Length2 * sizeof(WCHAR)); PrevFileName[Length0 + Length1 + Length2] = L'\0'; iter = FileNodeMap->upper_bound(PrevFileName); } else iter = FileNodeMap->upper_bound(FileNode->FileName); for (; FileNodeMap->end() != iter; ++iter) { if (!MemfsFileNameHasPrefix(iter->second->FileName, FileNode->FileName, MemfsFileNodeMapIsCaseInsensitive(FileNodeMap))) break; FspPathSuffix(iter->second->FileName, &Remain, &Suffix, Root); IsDirectoryChild = 0 == MemfsFileNameCompare(Remain, -1, FileNode->FileName, -1, MemfsFileNodeMapIsCaseInsensitive(FileNodeMap)); #if defined(MEMFS_NAMED_STREAMS) IsDirectoryChild = IsDirectoryChild && 0 == wcschr(Suffix, L':'); #endif FspPathCombine(iter->second->FileName, Suffix); if (IsDirectoryChild) { if (!EnumFn(iter->second, Context)) return FALSE; } } return TRUE; } #if defined(MEMFS_NAMED_STREAMS) static inline BOOLEAN MemfsFileNodeMapEnumerateNamedStreams(MEMFS_FILE_NODE_MAP *FileNodeMap, MEMFS_FILE_NODE *FileNode, BOOLEAN (*EnumFn)(MEMFS_FILE_NODE *, PVOID), PVOID Context) { MEMFS_FILE_NODE_MAP::iterator iter = FileNodeMap->upper_bound(FileNode->FileName); for (; FileNodeMap->end() != iter; ++iter) { if (!MemfsFileNameHasPrefix(iter->second->FileName, FileNode->FileName, MemfsFileNodeMapIsCaseInsensitive(FileNodeMap))) break; if (L':' != iter->second->FileName[wcslen(FileNode->FileName)]) break; if (!EnumFn(iter->second, Context)) return FALSE; } return TRUE; } #endif static inline BOOLEAN MemfsFileNodeMapEnumerateDescendants(MEMFS_FILE_NODE_MAP *FileNodeMap, MEMFS_FILE_NODE *FileNode, BOOLEAN (*EnumFn)(MEMFS_FILE_NODE *, PVOID), PVOID Context) { WCHAR Root[2] = L"\\"; MEMFS_FILE_NODE_MAP::iterator iter = FileNodeMap->lower_bound(FileNode->FileName); for (; FileNodeMap->end() != iter; ++iter) { if (!MemfsFileNameHasPrefix(iter->second->FileName, FileNode->FileName, MemfsFileNodeMapIsCaseInsensitive(FileNodeMap))) break; if (!EnumFn(iter->second, Context)) return FALSE; } return TRUE; } typedef struct _MEMFS_FILE_NODE_MAP_ENUM_CONTEXT { BOOLEAN Reference; MEMFS_FILE_NODE **FileNodes; ULONG Capacity, Count; } MEMFS_FILE_NODE_MAP_ENUM_CONTEXT; static inline BOOLEAN MemfsFileNodeMapEnumerateFn(MEMFS_FILE_NODE *FileNode, PVOID Context0) { MEMFS_FILE_NODE_MAP_ENUM_CONTEXT *Context = (MEMFS_FILE_NODE_MAP_ENUM_CONTEXT *)Context0; if (Context->Capacity <= Context->Count) { ULONG Capacity = 0 != Context->Capacity ? Context->Capacity * 2 : 16; PVOID P = realloc(Context->FileNodes, Capacity * sizeof Context->FileNodes[0]); if (0 == P) { FspDebugLog(__FUNCTION__ ": cannot allocate memory; aborting\n"); abort(); } Context->FileNodes = (MEMFS_FILE_NODE **)P; Context->Capacity = Capacity; } Context->FileNodes[Context->Count++] = FileNode; if (Context->Reference) MemfsFileNodeReference(FileNode); return TRUE; } static inline VOID MemfsFileNodeMapEnumerateFree(MEMFS_FILE_NODE_MAP_ENUM_CONTEXT *Context) { if (Context->Reference) { for (ULONG Index = 0; Context->Count > Index; Index++) { MEMFS_FILE_NODE *FileNode = Context->FileNodes[Index]; MemfsFileNodeDereference(FileNode); } } free(Context->FileNodes); } #ifdef MEMFS_SLOWIO /* * SLOWIO * * This is included for two uses: * * 1) For testing winfsp, by allowing memfs to act more like a non-ram file system, * with some IO taking many milliseconds, and some IO completion delayed. * * 2) As sample code for how to use winfsp's STATUS_PENDING capabilities. * */ static inline UINT64 Hash(UINT64 x) { x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9ull; x = (x ^ (x >> 27)) * 0x94d049bb133111ebull; x = x ^ (x >> 31); return x; } static inline ULONG PseudoRandom(ULONG to) { /* John Oberschelp's PRNG */ static UINT64 spin = 0; InterlockedIncrement(&spin); return Hash(spin) % to; } static inline BOOLEAN SlowioReturnPending(FSP_FILE_SYSTEM *FileSystem) { MEMFS *Memfs = (MEMFS *)FileSystem->UserContext; if (0 == Memfs->SlowioMaxDelay) return FALSE; return PseudoRandom(100) < Memfs->SlowioPercentDelay; } static inline VOID SlowioSnooze(FSP_FILE_SYSTEM *FileSystem) { MEMFS *Memfs = (MEMFS *)FileSystem->UserContext; if (0 == Memfs->SlowioMaxDelay) return; ULONG millis = PseudoRandom(Memfs->SlowioMaxDelay + 1) >> PseudoRandom(Memfs->SlowioRarefyDelay + 1); Sleep(millis); } void SlowioReadThread( FSP_FILE_SYSTEM *FileSystem, MEMFS_FILE_NODE *FileNode, PVOID Buffer, UINT64 Offset, UINT64 EndOffset, UINT64 RequestHint) { SlowioSnooze(FileSystem); memcpy(Buffer, (PUINT8)FileNode->FileData + Offset, (size_t)(EndOffset - Offset)); UINT32 BytesTransferred = (ULONG)(EndOffset - Offset); FSP_FSCTL_TRANSACT_RSP ResponseBuf; memset(&ResponseBuf, 0, sizeof ResponseBuf); ResponseBuf.Size = sizeof ResponseBuf; ResponseBuf.Kind = FspFsctlTransactReadKind; ResponseBuf.Hint = RequestHint; // IRP that is being completed ResponseBuf.IoStatus.Status = STATUS_SUCCESS; ResponseBuf.IoStatus.Information = BytesTransferred; // bytes read FspFileSystemSendResponse(FileSystem, &ResponseBuf); MEMFS *Memfs = (MEMFS *)FileSystem->UserContext; InterlockedDecrement(&Memfs->SlowioThreadsRunning); } void SlowioWriteThread( FSP_FILE_SYSTEM *FileSystem, MEMFS_FILE_NODE *FileNode, PVOID Buffer, UINT64 Offset, UINT64 EndOffset, UINT64 RequestHint) { SlowioSnooze(FileSystem); memcpy((PUINT8)FileNode->FileData + Offset, Buffer, (size_t)(EndOffset - Offset)); UINT32 BytesTransferred = (ULONG)(EndOffset - Offset); FSP_FSCTL_TRANSACT_RSP ResponseBuf; memset(&ResponseBuf, 0, sizeof ResponseBuf); ResponseBuf.Size = sizeof ResponseBuf; ResponseBuf.Kind = FspFsctlTransactWriteKind; ResponseBuf.Hint = RequestHint; // IRP that is being completed ResponseBuf.IoStatus.Status = STATUS_SUCCESS; ResponseBuf.IoStatus.Information = BytesTransferred; // bytes written MemfsFileNodeGetFileInfo(FileNode, &ResponseBuf.Rsp.Write.FileInfo); FspFileSystemSendResponse(FileSystem, &ResponseBuf); MEMFS *Memfs = (MEMFS *)FileSystem->UserContext; InterlockedDecrement(&Memfs->SlowioThreadsRunning); } void SlowioReadDirectoryThread( FSP_FILE_SYSTEM *FileSystem, ULONG BytesTransferred, UINT64 RequestHint) { SlowioSnooze(FileSystem); FSP_FSCTL_TRANSACT_RSP ResponseBuf; memset(&ResponseBuf, 0, sizeof ResponseBuf); ResponseBuf.Size = sizeof ResponseBuf; ResponseBuf.Kind = FspFsctlTransactQueryDirectoryKind; ResponseBuf.Hint = RequestHint; // IRP that is being completed ResponseBuf.IoStatus.Status = STATUS_SUCCESS; ResponseBuf.IoStatus.Information = BytesTransferred; // bytes of directory info read FspFileSystemSendResponse(FileSystem, &ResponseBuf); MEMFS *Memfs = (MEMFS *)FileSystem->UserContext; InterlockedDecrement(&Memfs->SlowioThreadsRunning); } #endif /* * FSP_FILE_SYSTEM_INTERFACE */ #if defined(MEMFS_REPARSE_POINTS) static NTSTATUS GetReparsePointByName( FSP_FILE_SYSTEM *FileSystem, PVOID Context, PWSTR FileName, BOOLEAN IsDirectory, PVOID Buffer, PSIZE_T PSize); #endif static NTSTATUS SetFileSizeInternal(FSP_FILE_SYSTEM *FileSystem, PVOID FileNode0, UINT64 NewSize, BOOLEAN SetAllocationSize); static NTSTATUS GetVolumeInfo(FSP_FILE_SYSTEM *FileSystem, FSP_FSCTL_VOLUME_INFO *VolumeInfo) { MEMFS *Memfs = (MEMFS *)FileSystem->UserContext; VolumeInfo->TotalSize = Memfs->MaxFileNodes * (UINT64)Memfs->MaxFileSize; VolumeInfo->FreeSize = (Memfs->MaxFileNodes - MemfsFileNodeMapCount(Memfs->FileNodeMap)) * (UINT64)Memfs->MaxFileSize; VolumeInfo->VolumeLabelLength = Memfs->VolumeLabelLength; memcpy(VolumeInfo->VolumeLabel, Memfs->VolumeLabel, Memfs->VolumeLabelLength); return STATUS_SUCCESS; } static NTSTATUS SetVolumeLabel(FSP_FILE_SYSTEM *FileSystem, PWSTR VolumeLabel, FSP_FSCTL_VOLUME_INFO *VolumeInfo) { MEMFS *Memfs = (MEMFS *)FileSystem->UserContext; Memfs->VolumeLabelLength = (UINT16)(wcslen(VolumeLabel) * sizeof(WCHAR)); if (Memfs->VolumeLabelLength > sizeof Memfs->VolumeLabel) Memfs->VolumeLabelLength = sizeof Memfs->VolumeLabel; memcpy(Memfs->VolumeLabel, VolumeLabel, Memfs->VolumeLabelLength); VolumeInfo->TotalSize = Memfs->MaxFileNodes * Memfs->MaxFileSize; VolumeInfo->FreeSize = (Memfs->MaxFileNodes - MemfsFileNodeMapCount(Memfs->FileNodeMap)) * Memfs->MaxFileSize; VolumeInfo->VolumeLabelLength = Memfs->VolumeLabelLength; memcpy(VolumeInfo->VolumeLabel, Memfs->VolumeLabel, Memfs->VolumeLabelLength); return STATUS_SUCCESS; } static NTSTATUS GetSecurityByName(FSP_FILE_SYSTEM *FileSystem, PWSTR FileName, PUINT32 PFileAttributes, PSECURITY_DESCRIPTOR SecurityDescriptor, SIZE_T *PSecurityDescriptorSize) { MEMFS *Memfs = (MEMFS *)FileSystem->UserContext; MEMFS_FILE_NODE *FileNode; NTSTATUS Result; FileNode = MemfsFileNodeMapGet(Memfs->FileNodeMap, FileName); if (0 == FileNode) { Result = STATUS_OBJECT_NAME_NOT_FOUND; #if defined(MEMFS_REPARSE_POINTS) if (FspFileSystemFindReparsePoint(FileSystem, GetReparsePointByName, 0, FileName, PFileAttributes)) Result = STATUS_REPARSE; else #endif MemfsFileNodeMapGetParent(Memfs->FileNodeMap, FileName, &Result); return Result; } #if defined(MEMFS_NAMED_STREAMS) UINT32 FileAttributesMask = ~(UINT32)0; if (0 != FileNode->MainFileNode) { FileAttributesMask = ~(UINT32)FILE_ATTRIBUTE_DIRECTORY; FileNode = FileNode->MainFileNode; } if (0 != PFileAttributes) *PFileAttributes = FileNode->FileInfo.FileAttributes & FileAttributesMask; #else if (0 != PFileAttributes) *PFileAttributes = FileNode->FileInfo.FileAttributes; #endif if (0 != PSecurityDescriptorSize) { if (FileNode->FileSecuritySize > *PSecurityDescriptorSize) { *PSecurityDescriptorSize = FileNode->FileSecuritySize; return STATUS_BUFFER_OVERFLOW; } *PSecurityDescriptorSize = FileNode->FileSecuritySize; if (0 != SecurityDescriptor) memcpy(SecurityDescriptor, FileNode->FileSecurity, FileNode->FileSecuritySize); } return STATUS_SUCCESS; } static NTSTATUS Create(FSP_FILE_SYSTEM *FileSystem, PWSTR FileName, UINT32 CreateOptions, UINT32 GrantedAccess, UINT32 FileAttributes, PSECURITY_DESCRIPTOR SecurityDescriptor, UINT64 AllocationSize, #if defined(MEMFS_EA) || defined(MEMFS_WSL) PVOID ExtraBuffer, ULONG ExtraLength, BOOLEAN ExtraBufferIsReparsePoint, #endif PVOID *PFileNode, FSP_FSCTL_FILE_INFO *FileInfo) { MEMFS *Memfs = (MEMFS *)FileSystem->UserContext; #if defined(MEMFS_NAME_NORMALIZATION) WCHAR FileNameBuf[MEMFS_MAX_PATH]; #endif MEMFS_FILE_NODE *FileNode; MEMFS_FILE_NODE *ParentNode; NTSTATUS Result; BOOLEAN Inserted; if (MEMFS_MAX_PATH <= wcslen(FileName)) return STATUS_OBJECT_NAME_INVALID; if (CreateOptions & FILE_DIRECTORY_FILE) AllocationSize = 0; FileNode = MemfsFileNodeMapGet(Memfs->FileNodeMap, FileName); if (0 != FileNode) return STATUS_OBJECT_NAME_COLLISION; ParentNode = MemfsFileNodeMapGetParent(Memfs->FileNodeMap, FileName, &Result); if (0 == ParentNode) return Result; if (MemfsFileNodeMapCount(Memfs->FileNodeMap) >= Memfs->MaxFileNodes) return STATUS_CANNOT_MAKE; if (AllocationSize > Memfs->MaxFileSize) return STATUS_DISK_FULL; #if defined(MEMFS_NAME_NORMALIZATION) if (MemfsFileNodeMapIsCaseInsensitive(Memfs->FileNodeMap)) { WCHAR Root[2] = L"\\"; PWSTR Remain, Suffix; size_t RemainLength, BSlashLength, SuffixLength; FspPathSuffix(FileName, &Remain, &Suffix, Root); assert(0 == MemfsFileNameCompare(Remain, -1, ParentNode->FileName, -1, TRUE)); FspPathCombine(FileName, Suffix); RemainLength = wcslen(ParentNode->FileName); BSlashLength = 1 < RemainLength; SuffixLength = wcslen(Suffix); if (MEMFS_MAX_PATH <= RemainLength + BSlashLength + SuffixLength) return STATUS_OBJECT_NAME_INVALID; memcpy(FileNameBuf, ParentNode->FileName, RemainLength * sizeof(WCHAR)); memcpy(FileNameBuf + RemainLength, L"\\", BSlashLength * sizeof(WCHAR)); memcpy(FileNameBuf + RemainLength + BSlashLength, Suffix, (SuffixLength + 1) * sizeof(WCHAR)); FileName = FileNameBuf; } #endif Result = MemfsFileNodeCreate(FileName, &FileNode); if (!NT_SUCCESS(Result)) return Result; #if defined(MEMFS_NAMED_STREAMS) FileNode->MainFileNode = MemfsFileNodeMapGetMain(Memfs->FileNodeMap, FileName); #endif FileNode->FileInfo.FileAttributes = (FileAttributes & FILE_ATTRIBUTE_DIRECTORY) ? FileAttributes : FileAttributes | FILE_ATTRIBUTE_ARCHIVE; if (0 != SecurityDescriptor) { FileNode->FileSecuritySize = GetSecurityDescriptorLength(SecurityDescriptor); FileNode->FileSecurity = (PSECURITY_DESCRIPTOR)malloc(FileNode->FileSecuritySize); if (0 == FileNode->FileSecurity) { MemfsFileNodeDelete(FileNode); return STATUS_INSUFFICIENT_RESOURCES; } memcpy(FileNode->FileSecurity, SecurityDescriptor, FileNode->FileSecuritySize); } #if defined(MEMFS_EA) || defined(MEMFS_WSL) if (0 != ExtraBuffer) { #if defined(MEMFS_EA) if (!ExtraBufferIsReparsePoint) { Result = FspFileSystemEnumerateEa(FileSystem, MemfsFileNodeSetEa, FileNode, (PFILE_FULL_EA_INFORMATION)ExtraBuffer, ExtraLength); if (!NT_SUCCESS(Result)) { MemfsFileNodeDelete(FileNode); return Result; } } #endif #if defined(MEMFS_WSL) if (ExtraBufferIsReparsePoint) { #if defined(MEMFS_REPARSE_POINTS) FileNode->ReparseDataSize = ExtraLength; FileNode->ReparseData = malloc(ExtraLength); if (0 == FileNode->ReparseData && 0 != ExtraLength) { MemfsFileNodeDelete(FileNode); return STATUS_INSUFFICIENT_RESOURCES; } FileNode->FileInfo.FileAttributes |= FILE_ATTRIBUTE_REPARSE_POINT; FileNode->FileInfo.ReparseTag = *(PULONG)ExtraBuffer; /* the first field in a reparse buffer is the reparse tag */ memcpy(FileNode->ReparseData, ExtraBuffer, ExtraLength); #else MemfsFileNodeDelete(FileNode); return STATUS_INVALID_PARAMETER; #endif } #endif } #endif FileNode->FileInfo.AllocationSize = AllocationSize; if (0 != FileNode->FileInfo.AllocationSize) { FileNode->FileData = LargeHeapAlloc((size_t)FileNode->FileInfo.AllocationSize); if (0 == FileNode->FileData) { MemfsFileNodeDelete(FileNode); return STATUS_INSUFFICIENT_RESOURCES; } } Result = MemfsFileNodeMapInsert(Memfs->FileNodeMap, FileNode, &Inserted); if (!NT_SUCCESS(Result) || !Inserted) { MemfsFileNodeDelete(FileNode); if (NT_SUCCESS(Result)) Result = STATUS_OBJECT_NAME_COLLISION; /* should not happen! */ return Result; } MemfsFileNodeReference(FileNode); *PFileNode = FileNode; MemfsFileNodeGetFileInfo(FileNode, FileInfo); #if defined(MEMFS_NAME_NORMALIZATION) if (MemfsFileNodeMapIsCaseInsensitive(Memfs->FileNodeMap)) { FSP_FSCTL_OPEN_FILE_INFO *OpenFileInfo = FspFileSystemGetOpenFileInfo(FileInfo); wcscpy_s(OpenFileInfo->NormalizedName, OpenFileInfo->NormalizedNameSize / sizeof(WCHAR), FileNode->FileName); OpenFileInfo->NormalizedNameSize = (UINT16)(wcslen(FileNode->FileName) * sizeof(WCHAR)); } #endif return STATUS_SUCCESS; } static NTSTATUS Open(FSP_FILE_SYSTEM *FileSystem, PWSTR FileName, UINT32 CreateOptions, UINT32 GrantedAccess, PVOID *PFileNode, FSP_FSCTL_FILE_INFO *FileInfo) { MEMFS *Memfs = (MEMFS *)FileSystem->UserContext; MEMFS_FILE_NODE *FileNode; NTSTATUS Result; if (MEMFS_MAX_PATH <= wcslen(FileName)) return STATUS_OBJECT_NAME_INVALID; FileNode = MemfsFileNodeMapGet(Memfs->FileNodeMap, FileName); if (0 == FileNode) { Result = STATUS_OBJECT_NAME_NOT_FOUND; MemfsFileNodeMapGetParent(Memfs->FileNodeMap, FileName, &Result); return Result; } #if defined(MEMFS_EA) /* if the OP specified no EA's check the need EA count, but only if accessing main stream */ if (0 != (CreateOptions & FILE_NO_EA_KNOWLEDGE) #if defined(MEMFS_NAMED_STREAMS) && (0 == FileNode->MainFileNode) #endif ) { if (MemfsFileNodeNeedEa(FileNode)) { Result = STATUS_ACCESS_DENIED; return Result; } } #endif MemfsFileNodeReference(FileNode); *PFileNode = FileNode; MemfsFileNodeGetFileInfo(FileNode, FileInfo); #if defined(MEMFS_NAME_NORMALIZATION) if (MemfsFileNodeMapIsCaseInsensitive(Memfs->FileNodeMap)) { FSP_FSCTL_OPEN_FILE_INFO *OpenFileInfo = FspFileSystemGetOpenFileInfo(FileInfo); wcscpy_s(OpenFileInfo->NormalizedName, OpenFileInfo->NormalizedNameSize / sizeof(WCHAR), FileNode->FileName); OpenFileInfo->NormalizedNameSize = (UINT16)(wcslen(FileNode->FileName) * sizeof(WCHAR)); } #endif return STATUS_SUCCESS; } static NTSTATUS Overwrite(FSP_FILE_SYSTEM *FileSystem, PVOID FileNode0, UINT32 FileAttributes, BOOLEAN ReplaceFileAttributes, UINT64 AllocationSize, #if defined(MEMFS_EA) PFILE_FULL_EA_INFORMATION Ea, ULONG EaLength, #endif FSP_FSCTL_FILE_INFO *FileInfo) { MEMFS *Memfs = (MEMFS *)FileSystem->UserContext; MEMFS_FILE_NODE *FileNode = (MEMFS_FILE_NODE *)FileNode0; NTSTATUS Result; #if defined(MEMFS_NAMED_STREAMS) MEMFS_FILE_NODE_MAP_ENUM_CONTEXT Context = { TRUE }; ULONG Index; MemfsFileNodeMapEnumerateNamedStreams(Memfs->FileNodeMap, FileNode, MemfsFileNodeMapEnumerateFn, &Context); for (Index = 0; Context.Count > Index; Index++) { LONG RefCount = FspInterlockedLoad32((INT32 *)&Context.FileNodes[Index]->RefCount); if (2 >= RefCount) MemfsFileNodeMapRemove(Memfs->FileNodeMap, Context.FileNodes[Index]); } MemfsFileNodeMapEnumerateFree(&Context); #endif #if defined(MEMFS_EA) MemfsFileNodeDeleteEaMap(FileNode); if (0 != Ea) { Result = FspFileSystemEnumerateEa(FileSystem, MemfsFileNodeSetEa, FileNode, Ea, EaLength); if (!NT_SUCCESS(Result)) return Result; } #endif Result = SetFileSizeInternal(FileSystem, FileNode, AllocationSize, TRUE); if (!NT_SUCCESS(Result)) return Result; if (ReplaceFileAttributes) FileNode->FileInfo.FileAttributes = FileAttributes | FILE_ATTRIBUTE_ARCHIVE; else FileNode->FileInfo.FileAttributes |= FileAttributes | FILE_ATTRIBUTE_ARCHIVE; FileNode->FileInfo.FileSize = 0; FileNode->FileInfo.LastAccessTime = FileNode->FileInfo.LastWriteTime = FileNode->FileInfo.ChangeTime = MemfsGetSystemTime(); MemfsFileNodeGetFileInfo(FileNode, FileInfo); return STATUS_SUCCESS; } static VOID Cleanup(FSP_FILE_SYSTEM *FileSystem, PVOID FileNode0, PWSTR FileName, ULONG Flags) { MEMFS *Memfs = (MEMFS *)FileSystem->UserContext; MEMFS_FILE_NODE *FileNode = (MEMFS_FILE_NODE *)FileNode0; #if defined(MEMFS_NAMED_STREAMS) MEMFS_FILE_NODE *MainFileNode = 0 != FileNode->MainFileNode ? FileNode->MainFileNode : FileNode; #else MEMFS_FILE_NODE *MainFileNode = FileNode; #endif assert(0 != Flags); /* FSP_FSCTL_VOLUME_PARAMS::PostCleanupWhenModifiedOnly ensures this */ if (Flags & FspCleanupSetArchiveBit) { if (0 == (MainFileNode->FileInfo.FileAttributes & FILE_ATTRIBUTE_DIRECTORY)) MainFileNode->FileInfo.FileAttributes |= FILE_ATTRIBUTE_ARCHIVE; } if (Flags & (FspCleanupSetLastAccessTime | FspCleanupSetLastWriteTime | FspCleanupSetChangeTime)) { UINT64 SystemTime = MemfsGetSystemTime(); if (Flags & FspCleanupSetLastAccessTime) MainFileNode->FileInfo.LastAccessTime = SystemTime; if (Flags & FspCleanupSetLastWriteTime) MainFileNode->FileInfo.LastWriteTime = SystemTime; if (Flags & FspCleanupSetChangeTime) MainFileNode->FileInfo.ChangeTime = SystemTime; } if (Flags & FspCleanupSetAllocationSize) { UINT64 AllocationUnit = MEMFS_SECTOR_SIZE * MEMFS_SECTORS_PER_ALLOCATION_UNIT; UINT64 AllocationSize = (FileNode->FileInfo.FileSize + AllocationUnit - 1) / AllocationUnit * AllocationUnit; SetFileSizeInternal(FileSystem, FileNode, AllocationSize, TRUE); } if ((Flags & FspCleanupDelete) && !MemfsFileNodeMapHasChild(Memfs->FileNodeMap, FileNode)) { #if defined(MEMFS_NAMED_STREAMS) MEMFS_FILE_NODE_MAP_ENUM_CONTEXT Context = { FALSE }; ULONG Index; MemfsFileNodeMapEnumerateNamedStreams(Memfs->FileNodeMap, FileNode, MemfsFileNodeMapEnumerateFn, &Context); for (Index = 0; Context.Count > Index; Index++) MemfsFileNodeMapRemove(Memfs->FileNodeMap, Context.FileNodes[Index]); MemfsFileNodeMapEnumerateFree(&Context); #endif MemfsFileNodeMapRemove(Memfs->FileNodeMap, FileNode); } } static VOID Close(FSP_FILE_SYSTEM *FileSystem, PVOID FileNode0) { MEMFS *Memfs = (MEMFS *)FileSystem->UserContext; MEMFS_FILE_NODE *FileNode = (MEMFS_FILE_NODE *)FileNode0; MemfsFileNodeDereference(FileNode); } static NTSTATUS Read(FSP_FILE_SYSTEM *FileSystem, PVOID FileNode0, PVOID Buffer, UINT64 Offset, ULONG Length, PULONG PBytesTransferred) { MEMFS_FILE_NODE *FileNode = (MEMFS_FILE_NODE *)FileNode0; UINT64 EndOffset; if (Offset >= FileNode->FileInfo.FileSize) return STATUS_END_OF_FILE; EndOffset = Offset + Length; if (EndOffset > FileNode->FileInfo.FileSize) EndOffset = FileNode->FileInfo.FileSize; #ifdef MEMFS_SLOWIO if (SlowioReturnPending(FileSystem)) { MEMFS *Memfs = (MEMFS *)FileSystem->UserContext; try { InterlockedIncrement(&Memfs->SlowioThreadsRunning); std::thread(SlowioReadThread, FileSystem, FileNode, Buffer, Offset, EndOffset, FspFileSystemGetOperationContext()->Request->Hint). detach(); return STATUS_PENDING; } catch (...) { InterlockedDecrement(&Memfs->SlowioThreadsRunning); } } SlowioSnooze(FileSystem); #endif memcpy(Buffer, (PUINT8)FileNode->FileData + Offset, (size_t)(EndOffset - Offset)); *PBytesTransferred = (ULONG)(EndOffset - Offset); return STATUS_SUCCESS; } static NTSTATUS Write(FSP_FILE_SYSTEM *FileSystem, PVOID FileNode0, PVOID Buffer, UINT64 Offset, ULONG Length, BOOLEAN WriteToEndOfFile, BOOLEAN ConstrainedIo, PULONG PBytesTransferred, FSP_FSCTL_FILE_INFO *FileInfo) { #if defined(DEBUG_BUFFER_CHECK) SYSTEM_INFO SystemInfo; GetSystemInfo(&SystemInfo); for (PUINT8 P = (PUINT8)Buffer, EndP = P + Length; EndP > P; P += SystemInfo.dwPageSize) __try { *P = *P | 0; assert(!IsWindows8OrGreater()); /* only on Windows 8 we can make the buffer read-only! */ } __except (EXCEPTION_EXECUTE_HANDLER) { /* ignore! */ } #endif MEMFS_FILE_NODE *FileNode = (MEMFS_FILE_NODE *)FileNode0; UINT64 EndOffset; NTSTATUS Result; if (ConstrainedIo) { if (Offset >= FileNode->FileInfo.FileSize) return STATUS_SUCCESS; EndOffset = Offset + Length; if (EndOffset > FileNode->FileInfo.FileSize) EndOffset = FileNode->FileInfo.FileSize; } else { if (WriteToEndOfFile) Offset = FileNode->FileInfo.FileSize; EndOffset = Offset + Length; if (EndOffset > FileNode->FileInfo.FileSize) { Result = SetFileSizeInternal(FileSystem, FileNode, EndOffset, FALSE); if (!NT_SUCCESS(Result)) return Result; } } #ifdef MEMFS_SLOWIO if (SlowioReturnPending(FileSystem)) { MEMFS *Memfs = (MEMFS *)FileSystem->UserContext; try { InterlockedIncrement(&Memfs->SlowioThreadsRunning); std::thread(SlowioWriteThread, FileSystem, FileNode, Buffer, Offset, EndOffset, FspFileSystemGetOperationContext()->Request->Hint). detach(); return STATUS_PENDING; } catch (...) { InterlockedDecrement(&Memfs->SlowioThreadsRunning); } } SlowioSnooze(FileSystem); #endif memcpy((PUINT8)FileNode->FileData + Offset, Buffer, (size_t)(EndOffset - Offset)); *PBytesTransferred = (ULONG)(EndOffset - Offset); MemfsFileNodeGetFileInfo(FileNode, FileInfo); return STATUS_SUCCESS; } NTSTATUS Flush(FSP_FILE_SYSTEM *FileSystem, PVOID FileNode0, FSP_FSCTL_FILE_INFO *FileInfo) { MEMFS_FILE_NODE *FileNode = (MEMFS_FILE_NODE *)FileNode0; /* nothing to flush, since we do not cache anything */ if (0 != FileNode) { #if 0 #if defined(MEMFS_NAMED_STREAMS) if (0 != FileNode->MainFileNode) FileNode->MainFileNode->FileInfo.LastAccessTime = FileNode->MainFileNode->FileInfo.LastWriteTime = FileNode->MainFileNode->FileInfo.ChangeTime = MemfsGetSystemTime(); else #endif FileNode->FileInfo.LastAccessTime = FileNode->FileInfo.LastWriteTime = FileNode->FileInfo.ChangeTime = MemfsGetSystemTime(); #endif MemfsFileNodeGetFileInfo(FileNode, FileInfo); } return STATUS_SUCCESS; } static NTSTATUS GetFileInfo(FSP_FILE_SYSTEM *FileSystem, PVOID FileNode0, FSP_FSCTL_FILE_INFO *FileInfo) { MEMFS_FILE_NODE *FileNode = (MEMFS_FILE_NODE *)FileNode0; MemfsFileNodeGetFileInfo(FileNode, FileInfo); return STATUS_SUCCESS; } static NTSTATUS SetBasicInfo(FSP_FILE_SYSTEM *FileSystem, PVOID FileNode0, UINT32 FileAttributes, UINT64 CreationTime, UINT64 LastAccessTime, UINT64 LastWriteTime, UINT64 ChangeTime, FSP_FSCTL_FILE_INFO *FileInfo) { MEMFS_FILE_NODE *FileNode = (MEMFS_FILE_NODE *)FileNode0; #if defined(MEMFS_NAMED_STREAMS) if (0 != FileNode->MainFileNode) FileNode = FileNode->MainFileNode; #endif if (INVALID_FILE_ATTRIBUTES != FileAttributes) FileNode->FileInfo.FileAttributes = FileAttributes; if (0 != CreationTime) FileNode->FileInfo.CreationTime = CreationTime; if (0 != LastAccessTime) FileNode->FileInfo.LastAccessTime = LastAccessTime; if (0 != LastWriteTime) FileNode->FileInfo.LastWriteTime = LastWriteTime; if (0 != ChangeTime) FileNode->FileInfo.ChangeTime = ChangeTime; MemfsFileNodeGetFileInfo(FileNode, FileInfo); return STATUS_SUCCESS; } static NTSTATUS SetFileSizeInternal(FSP_FILE_SYSTEM *FileSystem, PVOID FileNode0, UINT64 NewSize, BOOLEAN SetAllocationSize) { MEMFS *Memfs = (MEMFS *)FileSystem->UserContext; MEMFS_FILE_NODE *FileNode = (MEMFS_FILE_NODE *)FileNode0; if (SetAllocationSize) { if (FileNode->FileInfo.AllocationSize != NewSize) { if (NewSize > Memfs->MaxFileSize) return STATUS_DISK_FULL; PVOID FileData = LargeHeapRealloc(FileNode->FileData, (size_t)NewSize); if (0 == FileData && 0 != NewSize) return STATUS_INSUFFICIENT_RESOURCES; FileNode->FileData = FileData; FileNode->FileInfo.AllocationSize = NewSize; if (FileNode->FileInfo.FileSize > NewSize) FileNode->FileInfo.FileSize = NewSize; } } else { if (FileNode->FileInfo.FileSize != NewSize) { if (FileNode->FileInfo.AllocationSize < NewSize) { UINT64 AllocationUnit = MEMFS_SECTOR_SIZE * MEMFS_SECTORS_PER_ALLOCATION_UNIT; UINT64 AllocationSize = (NewSize + AllocationUnit - 1) / AllocationUnit * AllocationUnit; NTSTATUS Result = SetFileSizeInternal(FileSystem, FileNode, AllocationSize, TRUE); if (!NT_SUCCESS(Result)) return Result; } if (FileNode->FileInfo.FileSize < NewSize) memset((PUINT8)FileNode->FileData + FileNode->FileInfo.FileSize, 0, (size_t)(NewSize - FileNode->FileInfo.FileSize)); FileNode->FileInfo.FileSize = NewSize; } } return STATUS_SUCCESS; } static NTSTATUS SetFileSize(FSP_FILE_SYSTEM *FileSystem, PVOID FileNode0, UINT64 NewSize, BOOLEAN SetAllocationSize, FSP_FSCTL_FILE_INFO *FileInfo) { MEMFS_FILE_NODE *FileNode = (MEMFS_FILE_NODE *)FileNode0; NTSTATUS Result; Result = SetFileSizeInternal(FileSystem, FileNode0, NewSize, SetAllocationSize); if (!NT_SUCCESS(Result)) return Result; MemfsFileNodeGetFileInfo(FileNode, FileInfo); return STATUS_SUCCESS; } static NTSTATUS CanDelete(FSP_FILE_SYSTEM *FileSystem, PVOID FileNode0, PWSTR FileName) { MEMFS *Memfs = (MEMFS *)FileSystem->UserContext; MEMFS_FILE_NODE *FileNode = (MEMFS_FILE_NODE *)FileNode0; if (MemfsFileNodeMapHasChild(Memfs->FileNodeMap, FileNode)) return STATUS_DIRECTORY_NOT_EMPTY; return STATUS_SUCCESS; } static NTSTATUS Rename(FSP_FILE_SYSTEM *FileSystem, PVOID FileNode0, PWSTR FileName, PWSTR NewFileName, BOOLEAN ReplaceIfExists) { MEMFS *Memfs = (MEMFS *)FileSystem->UserContext; MEMFS_FILE_NODE *FileNode = (MEMFS_FILE_NODE *)FileNode0; MEMFS_FILE_NODE *NewFileNode, *DescendantFileNode; MEMFS_FILE_NODE_MAP_ENUM_CONTEXT Context = { TRUE }; ULONG Index, FileNameLen, NewFileNameLen; BOOLEAN Inserted; NTSTATUS Result; NewFileNode = MemfsFileNodeMapGet(Memfs->FileNodeMap, NewFileName); if (0 != NewFileNode && FileNode != NewFileNode) { if (!ReplaceIfExists) { Result = STATUS_OBJECT_NAME_COLLISION; goto exit; } if (NewFileNode->FileInfo.FileAttributes & FILE_ATTRIBUTE_DIRECTORY) { Result = STATUS_ACCESS_DENIED; goto exit; } } MemfsFileNodeMapEnumerateDescendants(Memfs->FileNodeMap, FileNode, MemfsFileNodeMapEnumerateFn, &Context); FileNameLen = (ULONG)wcslen(FileNode->FileName); NewFileNameLen = (ULONG)wcslen(NewFileName); for (Index = 0; Context.Count > Index; Index++) { DescendantFileNode = Context.FileNodes[Index]; if (MEMFS_MAX_PATH <= wcslen(DescendantFileNode->FileName) - FileNameLen + NewFileNameLen) { Result = STATUS_OBJECT_NAME_INVALID; goto exit; } } if (0 != NewFileNode) { MemfsFileNodeReference(NewFileNode); MemfsFileNodeMapRemove(Memfs->FileNodeMap, NewFileNode); MemfsFileNodeDereference(NewFileNode); } for (Index = 0; Context.Count > Index; Index++) { DescendantFileNode = Context.FileNodes[Index]; MemfsFileNodeMapRemove(Memfs->FileNodeMap, DescendantFileNode); memmove(DescendantFileNode->FileName + NewFileNameLen, DescendantFileNode->FileName + FileNameLen, (wcslen(DescendantFileNode->FileName) + 1 - FileNameLen) * sizeof(WCHAR)); memcpy(DescendantFileNode->FileName, NewFileName, NewFileNameLen * sizeof(WCHAR)); Result = MemfsFileNodeMapInsert(Memfs->FileNodeMap, DescendantFileNode, &Inserted); if (!NT_SUCCESS(Result)) { FspDebugLog(__FUNCTION__ ": cannot insert into FileNodeMap; aborting\n"); abort(); } assert(Inserted); } Result = STATUS_SUCCESS; exit: MemfsFileNodeMapEnumerateFree(&Context); return Result; } static NTSTATUS GetSecurity(FSP_FILE_SYSTEM *FileSystem, PVOID FileNode0, PSECURITY_DESCRIPTOR SecurityDescriptor, SIZE_T *PSecurityDescriptorSize) { MEMFS_FILE_NODE *FileNode = (MEMFS_FILE_NODE *)FileNode0; #if defined(MEMFS_NAMED_STREAMS) if (0 != FileNode->MainFileNode) FileNode = FileNode->MainFileNode; #endif if (FileNode->FileSecuritySize > *PSecurityDescriptorSize) { *PSecurityDescriptorSize = FileNode->FileSecuritySize; return STATUS_BUFFER_OVERFLOW; } *PSecurityDescriptorSize = FileNode->FileSecuritySize; if (0 != SecurityDescriptor) memcpy(SecurityDescriptor, FileNode->FileSecurity, FileNode->FileSecuritySize); return STATUS_SUCCESS; } static NTSTATUS SetSecurity(FSP_FILE_SYSTEM *FileSystem, PVOID FileNode0, SECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR ModificationDescriptor) { MEMFS_FILE_NODE *FileNode = (MEMFS_FILE_NODE *)FileNode0; PSECURITY_DESCRIPTOR NewSecurityDescriptor, FileSecurity; SIZE_T FileSecuritySize; NTSTATUS Result; #if defined(MEMFS_NAMED_STREAMS) if (0 != FileNode->MainFileNode) FileNode = FileNode->MainFileNode; #endif Result = FspSetSecurityDescriptor( FileNode->FileSecurity, SecurityInformation, ModificationDescriptor, &NewSecurityDescriptor); if (!NT_SUCCESS(Result)) return Result; FileSecuritySize = GetSecurityDescriptorLength(NewSecurityDescriptor); FileSecurity = (PSECURITY_DESCRIPTOR)malloc(FileSecuritySize); if (0 == FileSecurity) { FspDeleteSecurityDescriptor(NewSecurityDescriptor, (NTSTATUS (*)())FspSetSecurityDescriptor); return STATUS_INSUFFICIENT_RESOURCES; } memcpy(FileSecurity, NewSecurityDescriptor, FileSecuritySize); FspDeleteSecurityDescriptor(NewSecurityDescriptor, (NTSTATUS (*)())FspSetSecurityDescriptor); free(FileNode->FileSecurity); FileNode->FileSecuritySize = FileSecuritySize; FileNode->FileSecurity = FileSecurity; return STATUS_SUCCESS; } typedef struct _MEMFS_READ_DIRECTORY_CONTEXT { PVOID Buffer; ULONG Length; PULONG PBytesTransferred; } MEMFS_READ_DIRECTORY_CONTEXT; static BOOLEAN AddDirInfo(MEMFS_FILE_NODE *FileNode, PWSTR FileName, PVOID Buffer, ULONG Length, PULONG PBytesTransferred) { UINT8 DirInfoBuf[sizeof(FSP_FSCTL_DIR_INFO) + sizeof FileNode->FileName]; FSP_FSCTL_DIR_INFO *DirInfo = (FSP_FSCTL_DIR_INFO *)DirInfoBuf; WCHAR Root[2] = L"\\"; PWSTR Remain, Suffix; if (0 == FileName) { FspPathSuffix(FileNode->FileName, &Remain, &Suffix, Root); FileName = Suffix; FspPathCombine(FileNode->FileName, Suffix); } memset(DirInfo->Padding, 0, sizeof DirInfo->Padding); DirInfo->Size = (UINT16)(sizeof(FSP_FSCTL_DIR_INFO) + wcslen(FileName) * sizeof(WCHAR)); DirInfo->FileInfo = FileNode->FileInfo; memcpy(DirInfo->FileNameBuf, FileName, DirInfo->Size - sizeof(FSP_FSCTL_DIR_INFO)); return FspFileSystemAddDirInfo(DirInfo, Buffer, Length, PBytesTransferred); } static BOOLEAN ReadDirectoryEnumFn(MEMFS_FILE_NODE *FileNode, PVOID Context0) { MEMFS_READ_DIRECTORY_CONTEXT *Context = (MEMFS_READ_DIRECTORY_CONTEXT *)Context0; return AddDirInfo(FileNode, 0, Context->Buffer, Context->Length, Context->PBytesTransferred); } static NTSTATUS ReadDirectory(FSP_FILE_SYSTEM *FileSystem, PVOID FileNode0, PWSTR Pattern, PWSTR Marker, PVOID Buffer, ULONG Length, PULONG PBytesTransferred) { assert(0 == Pattern); MEMFS *Memfs = (MEMFS *)FileSystem->UserContext; MEMFS_FILE_NODE *FileNode = (MEMFS_FILE_NODE *)FileNode0; MEMFS_FILE_NODE *ParentNode; MEMFS_READ_DIRECTORY_CONTEXT Context; NTSTATUS Result; Context.Buffer = Buffer; Context.Length = Length; Context.PBytesTransferred = PBytesTransferred; if (L'\0' != FileNode->FileName[1]) { /* if this is not the root directory add the dot entries */ ParentNode = MemfsFileNodeMapGetParent(Memfs->FileNodeMap, FileNode->FileName, &Result); if (0 == ParentNode) return Result; if (0 == Marker) { if (!AddDirInfo(FileNode, L".", Buffer, Length, PBytesTransferred)) return STATUS_SUCCESS; } if (0 == Marker || (L'.' == Marker[0] && L'\0' == Marker[1])) { if (!AddDirInfo(ParentNode, L"..", Buffer, Length, PBytesTransferred)) return STATUS_SUCCESS; Marker = 0; } } if (MemfsFileNodeMapEnumerateChildren(Memfs->FileNodeMap, FileNode, Marker, ReadDirectoryEnumFn, &Context)) FspFileSystemAddDirInfo(0, Buffer, Length, PBytesTransferred); #ifdef MEMFS_SLOWIO if (SlowioReturnPending(FileSystem)) { try { InterlockedIncrement(&Memfs->SlowioThreadsRunning); std::thread(SlowioReadDirectoryThread, FileSystem, *PBytesTransferred, FspFileSystemGetOperationContext()->Request->Hint). detach(); return STATUS_PENDING; } catch (...) { InterlockedDecrement(&Memfs->SlowioThreadsRunning); } } SlowioSnooze(FileSystem); #endif return STATUS_SUCCESS; } #if defined(MEMFS_DIRINFO_BY_NAME) static NTSTATUS GetDirInfoByName(FSP_FILE_SYSTEM *FileSystem, PVOID ParentNode0, PWSTR FileName, FSP_FSCTL_DIR_INFO *DirInfo) { MEMFS *Memfs = (MEMFS *)FileSystem->UserContext; MEMFS_FILE_NODE *ParentNode = (MEMFS_FILE_NODE *)ParentNode0; MEMFS_FILE_NODE *FileNode; WCHAR FileNameBuf[MEMFS_MAX_PATH]; size_t ParentLength, BSlashLength, FileNameLength; WCHAR Root[2] = L"\\"; PWSTR Remain, Suffix; ParentLength = wcslen(ParentNode->FileName); BSlashLength = 1 < ParentLength; FileNameLength = wcslen(FileName); if (MEMFS_MAX_PATH <= ParentLength + BSlashLength + FileNameLength) return STATUS_OBJECT_NAME_NOT_FOUND; //STATUS_OBJECT_NAME_INVALID? memcpy(FileNameBuf, ParentNode->FileName, ParentLength * sizeof(WCHAR)); memcpy(FileNameBuf + ParentLength, L"\\", BSlashLength * sizeof(WCHAR)); memcpy(FileNameBuf + ParentLength + BSlashLength, FileName, (FileNameLength + 1) * sizeof(WCHAR)); FileName = FileNameBuf; FileNode = MemfsFileNodeMapGet(Memfs->FileNodeMap, FileName); if (0 == FileNode) return STATUS_OBJECT_NAME_NOT_FOUND; FspPathSuffix(FileNode->FileName, &Remain, &Suffix, Root); FileName = Suffix; FspPathCombine(FileNode->FileName, Suffix); //memset(DirInfo->Padding, 0, sizeof DirInfo->Padding); DirInfo->Size = (UINT16)(sizeof(FSP_FSCTL_DIR_INFO) + wcslen(FileName) * sizeof(WCHAR)); DirInfo->FileInfo = FileNode->FileInfo; memcpy(DirInfo->FileNameBuf, FileName, DirInfo->Size - sizeof(FSP_FSCTL_DIR_INFO)); return STATUS_SUCCESS; } #endif #if defined(MEMFS_REPARSE_POINTS) static NTSTATUS ResolveReparsePoints(FSP_FILE_SYSTEM *FileSystem, PWSTR FileName, UINT32 ReparsePointIndex, BOOLEAN ResolveLastPathComponent, PIO_STATUS_BLOCK PIoStatus, PVOID Buffer, PSIZE_T PSize) { return FspFileSystemResolveReparsePoints(FileSystem, GetReparsePointByName, 0, FileName, ReparsePointIndex, ResolveLastPathComponent, PIoStatus, Buffer, PSize); } static NTSTATUS GetReparsePointByName( FSP_FILE_SYSTEM *FileSystem, PVOID Context, PWSTR FileName, BOOLEAN IsDirectory, PVOID Buffer, PSIZE_T PSize) { MEMFS *Memfs = (MEMFS *)FileSystem->UserContext; MEMFS_FILE_NODE *FileNode; #if defined(MEMFS_NAMED_STREAMS) /* GetReparsePointByName will never receive a named stream */ assert(0 == wcschr(FileName, L':')); #endif FileNode = MemfsFileNodeMapGet(Memfs->FileNodeMap, FileName); if (0 == FileNode) return STATUS_OBJECT_NAME_NOT_FOUND; if (0 == (FileNode->FileInfo.FileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)) return STATUS_NOT_A_REPARSE_POINT; if (0 != Buffer) { if (FileNode->ReparseDataSize > *PSize) return STATUS_BUFFER_TOO_SMALL; *PSize = FileNode->ReparseDataSize; memcpy(Buffer, FileNode->ReparseData, FileNode->ReparseDataSize); } return STATUS_SUCCESS; } static NTSTATUS GetReparsePoint(FSP_FILE_SYSTEM *FileSystem, PVOID FileNode0, PWSTR FileName, PVOID Buffer, PSIZE_T PSize) { MEMFS_FILE_NODE *FileNode = (MEMFS_FILE_NODE *)FileNode0; #if defined(MEMFS_NAMED_STREAMS) if (0 != FileNode->MainFileNode) FileNode = FileNode->MainFileNode; #endif if (0 == (FileNode->FileInfo.FileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)) return STATUS_NOT_A_REPARSE_POINT; if (FileNode->ReparseDataSize > *PSize) return STATUS_BUFFER_TOO_SMALL; *PSize = FileNode->ReparseDataSize; memcpy(Buffer, FileNode->ReparseData, FileNode->ReparseDataSize); return STATUS_SUCCESS; } static NTSTATUS SetReparsePoint(FSP_FILE_SYSTEM *FileSystem, PVOID FileNode0, PWSTR FileName, PVOID Buffer, SIZE_T Size) { MEMFS *Memfs = (MEMFS *)FileSystem->UserContext; MEMFS_FILE_NODE *FileNode = (MEMFS_FILE_NODE *)FileNode0; PVOID ReparseData; NTSTATUS Result; #if defined(MEMFS_NAMED_STREAMS) if (0 != FileNode->MainFileNode) FileNode = FileNode->MainFileNode; #endif if (MemfsFileNodeMapHasChild(Memfs->FileNodeMap, FileNode)) return STATUS_DIRECTORY_NOT_EMPTY; if (0 != FileNode->ReparseData) { Result = FspFileSystemCanReplaceReparsePoint( FileNode->ReparseData, FileNode->ReparseDataSize, Buffer, Size); if (!NT_SUCCESS(Result)) return Result; } ReparseData = realloc(FileNode->ReparseData, Size); if (0 == ReparseData && 0 != Size) return STATUS_INSUFFICIENT_RESOURCES; FileNode->FileInfo.FileAttributes |= FILE_ATTRIBUTE_REPARSE_POINT; FileNode->FileInfo.ReparseTag = *(PULONG)Buffer; /* the first field in a reparse buffer is the reparse tag */ FileNode->ReparseDataSize = Size; FileNode->ReparseData = ReparseData; memcpy(FileNode->ReparseData, Buffer, Size); return STATUS_SUCCESS; } static NTSTATUS DeleteReparsePoint(FSP_FILE_SYSTEM *FileSystem, PVOID FileNode0, PWSTR FileName, PVOID Buffer, SIZE_T Size) { MEMFS_FILE_NODE *FileNode = (MEMFS_FILE_NODE *)FileNode0; NTSTATUS Result; #if defined(MEMFS_NAMED_STREAMS) if (0 != FileNode->MainFileNode) FileNode = FileNode->MainFileNode; #endif if (0 != FileNode->ReparseData) { Result = FspFileSystemCanReplaceReparsePoint( FileNode->ReparseData, FileNode->ReparseDataSize, Buffer, Size); if (!NT_SUCCESS(Result)) return Result; } else return STATUS_NOT_A_REPARSE_POINT; free(FileNode->ReparseData); FileNode->FileInfo.FileAttributes &= ~FILE_ATTRIBUTE_REPARSE_POINT; FileNode->FileInfo.ReparseTag = 0; FileNode->ReparseDataSize = 0; FileNode->ReparseData = 0; return STATUS_SUCCESS; } #endif #if defined(MEMFS_NAMED_STREAMS) typedef struct _MEMFS_GET_STREAM_INFO_CONTEXT { PVOID Buffer; ULONG Length; PULONG PBytesTransferred; } MEMFS_GET_STREAM_INFO_CONTEXT; static BOOLEAN AddStreamInfo(MEMFS_FILE_NODE *FileNode, PVOID Buffer, ULONG Length, PULONG PBytesTransferred) { UINT8 StreamInfoBuf[sizeof(FSP_FSCTL_STREAM_INFO) + sizeof FileNode->FileName]; FSP_FSCTL_STREAM_INFO *StreamInfo = (FSP_FSCTL_STREAM_INFO *)StreamInfoBuf; PWSTR StreamName; StreamName = wcschr(FileNode->FileName, L':'); if (0 != StreamName) StreamName++; else StreamName = L""; StreamInfo->Size = (UINT16)(sizeof(FSP_FSCTL_STREAM_INFO) + wcslen(StreamName) * sizeof(WCHAR)); StreamInfo->StreamSize = FileNode->FileInfo.FileSize; StreamInfo->StreamAllocationSize = FileNode->FileInfo.AllocationSize; memcpy(StreamInfo->StreamNameBuf, StreamName, StreamInfo->Size - sizeof(FSP_FSCTL_STREAM_INFO)); return FspFileSystemAddStreamInfo(StreamInfo, Buffer, Length, PBytesTransferred); } static BOOLEAN GetStreamInfoEnumFn(MEMFS_FILE_NODE *FileNode, PVOID Context0) { MEMFS_GET_STREAM_INFO_CONTEXT *Context = (MEMFS_GET_STREAM_INFO_CONTEXT *)Context0; return AddStreamInfo(FileNode, Context->Buffer, Context->Length, Context->PBytesTransferred); } static NTSTATUS GetStreamInfo(FSP_FILE_SYSTEM *FileSystem, PVOID FileNode0, PVOID Buffer, ULONG Length, PULONG PBytesTransferred) { MEMFS *Memfs = (MEMFS *)FileSystem->UserContext; MEMFS_FILE_NODE *FileNode = (MEMFS_FILE_NODE *)FileNode0; MEMFS_GET_STREAM_INFO_CONTEXT Context; if (0 != FileNode->MainFileNode) FileNode = FileNode->MainFileNode; Context.Buffer = Buffer; Context.Length = Length; Context.PBytesTransferred = PBytesTransferred; if (0 == (FileNode->FileInfo.FileAttributes & FILE_ATTRIBUTE_DIRECTORY) && !AddStreamInfo(FileNode, Buffer, Length, PBytesTransferred)) return STATUS_SUCCESS; if (MemfsFileNodeMapEnumerateNamedStreams(Memfs->FileNodeMap, FileNode, GetStreamInfoEnumFn, &Context)) FspFileSystemAddStreamInfo(0, Buffer, Length, PBytesTransferred); /* ???: how to handle out of response buffer condition? */ return STATUS_SUCCESS; } #endif #if defined(MEMFS_CONTROL) static NTSTATUS Control(FSP_FILE_SYSTEM *FileSystem, PVOID FileNode, UINT32 ControlCode, PVOID InputBuffer, ULONG InputBufferLength, PVOID OutputBuffer, ULONG OutputBufferLength, PULONG PBytesTransferred) { /* MEMFS also supports encryption! See below :) */ if (CTL_CODE(0x8000 + 'M', 'R', METHOD_BUFFERED, FILE_ANY_ACCESS) == ControlCode) { if (OutputBufferLength != InputBufferLength) return STATUS_INVALID_PARAMETER; for (PUINT8 P = (PUINT8)InputBuffer, Q = (PUINT8)OutputBuffer, EndP = P + InputBufferLength; EndP > P; P++, Q++) { if (('A' <= *P && *P <= 'M') || ('a' <= *P && *P <= 'm')) *Q = *P + 13; else if (('N' <= *P && *P <= 'Z') || ('n' <= *P && *P <= 'z')) *Q = *P - 13; else *Q = *P; } *PBytesTransferred = InputBufferLength; return STATUS_SUCCESS; } return STATUS_INVALID_DEVICE_REQUEST; } #endif #if defined(MEMFS_EA) typedef struct _MEMFS_GET_EA_CONTEXT { PFILE_FULL_EA_INFORMATION Ea; ULONG EaLength; PULONG PBytesTransferred; } MEMFS_GET_EA_CONTEXT; static BOOLEAN GetEaEnumFn(PFILE_FULL_EA_INFORMATION Ea, PVOID Context0) { MEMFS_GET_EA_CONTEXT *Context = (MEMFS_GET_EA_CONTEXT *)Context0; return FspFileSystemAddEa(Ea, Context->Ea, Context->EaLength, Context->PBytesTransferred); } static NTSTATUS GetEa(FSP_FILE_SYSTEM *FileSystem, PVOID FileNode0, PFILE_FULL_EA_INFORMATION Ea, ULONG EaLength, PULONG PBytesTransferred) { MEMFS_FILE_NODE *FileNode = (MEMFS_FILE_NODE *)FileNode0; MEMFS_GET_EA_CONTEXT Context; Context.Ea = Ea; Context.EaLength = EaLength; Context.PBytesTransferred = PBytesTransferred; if (MemfsFileNodeEnumerateEa(FileNode, GetEaEnumFn, &Context)) FspFileSystemAddEa(0, Ea, EaLength, PBytesTransferred); return STATUS_SUCCESS; } static NTSTATUS SetEa(FSP_FILE_SYSTEM *FileSystem, PVOID FileNode0, PFILE_FULL_EA_INFORMATION Ea, ULONG EaLength, FSP_FSCTL_FILE_INFO *FileInfo) { MEMFS_FILE_NODE *FileNode = (MEMFS_FILE_NODE *)FileNode0; NTSTATUS Result; Result = FspFileSystemEnumerateEa(FileSystem, MemfsFileNodeSetEa, FileNode, Ea, EaLength); if (!NT_SUCCESS(Result)) return Result; MemfsFileNodeGetFileInfo(FileNode, FileInfo); return STATUS_SUCCESS; } #endif #if defined(MEMFS_DISPATCHER_STOPPED) static VOID DispatcherStopped(FSP_FILE_SYSTEM *FileSystem, BOOLEAN Normally) { FspFileSystemStopServiceIfNecessary(FileSystem, Normally); } #endif static FSP_FILE_SYSTEM_INTERFACE MemfsInterface = { GetVolumeInfo, SetVolumeLabel, GetSecurityByName, #if defined(MEMFS_EA) || defined(MEMFS_WSL) 0, #else Create, #endif Open, #if defined(MEMFS_EA) 0, #else Overwrite, #endif Cleanup, Close, Read, Write, Flush, GetFileInfo, SetBasicInfo, SetFileSize, CanDelete, Rename, GetSecurity, SetSecurity, ReadDirectory, #if defined(MEMFS_REPARSE_POINTS) ResolveReparsePoints, GetReparsePoint, SetReparsePoint, DeleteReparsePoint, #else 0, 0, 0, 0, #endif #if defined(MEMFS_NAMED_STREAMS) GetStreamInfo, #else 0, #endif #if defined(MEMFS_DIRINFO_BY_NAME) GetDirInfoByName, #else 0, #endif #if defined(MEMFS_CONTROL) Control, #else 0, #endif 0, #if defined(MEMFS_EA) || defined(MEMFS_WSL) Create, #endif #if defined(MEMFS_EA) Overwrite, GetEa, SetEa, #else 0, 0, 0, #endif 0, #if defined(MEMFS_DISPATCHER_STOPPED) DispatcherStopped, #else 0, #endif }; /* * Public API */ NTSTATUS MemfsCreateFunnel( ULONG Flags, ULONG FileInfoTimeout, ULONG MaxFileNodes, ULONG MaxFileSize, ULONG SlowioMaxDelay, ULONG SlowioPercentDelay, ULONG SlowioRarefyDelay, PWSTR FileSystemName, PWSTR VolumePrefix, PWSTR RootSddl, MEMFS **PMemfs) { NTSTATUS Result; FSP_FSCTL_VOLUME_PARAMS VolumeParams; BOOLEAN CaseInsensitive = !!(Flags & MemfsCaseInsensitive); BOOLEAN FlushAndPurgeOnCleanup = !!(Flags & MemfsFlushAndPurgeOnCleanup); BOOLEAN SupportsPosixUnlinkRename = !(Flags & MemfsLegacyUnlinkRename); PWSTR DevicePath = MemfsNet == (Flags & MemfsDeviceMask) ? L"" FSP_FSCTL_NET_DEVICE_NAME : L"" FSP_FSCTL_DISK_DEVICE_NAME; UINT64 AllocationUnit; MEMFS *Memfs; MEMFS_FILE_NODE *RootNode; PSECURITY_DESCRIPTOR RootSecurity; ULONG RootSecuritySize; BOOLEAN Inserted; *PMemfs = 0; Result = MemfsHeapConfigure(0, 0, 0); if (!NT_SUCCESS(Result)) return Result; if (0 == RootSddl) RootSddl = L"O:BAG:BAD:P(A;;FA;;;SY)(A;;FA;;;BA)(A;;FA;;;WD)"; if (!ConvertStringSecurityDescriptorToSecurityDescriptorW(RootSddl, SDDL_REVISION_1, &RootSecurity, &RootSecuritySize)) return FspNtStatusFromWin32(GetLastError()); Memfs = (MEMFS *)malloc(sizeof *Memfs); if (0 == Memfs) { LocalFree(RootSecurity); return STATUS_INSUFFICIENT_RESOURCES; } memset(Memfs, 0, sizeof *Memfs); Memfs->MaxFileNodes = MaxFileNodes; AllocationUnit = MEMFS_SECTOR_SIZE * MEMFS_SECTORS_PER_ALLOCATION_UNIT; Memfs->MaxFileSize = (ULONG)((MaxFileSize + AllocationUnit - 1) / AllocationUnit * AllocationUnit); #ifdef MEMFS_SLOWIO Memfs->SlowioMaxDelay = SlowioMaxDelay; Memfs->SlowioPercentDelay = SlowioPercentDelay; Memfs->SlowioRarefyDelay = SlowioRarefyDelay; #endif Result = MemfsFileNodeMapCreate(CaseInsensitive, &Memfs->FileNodeMap); if (!NT_SUCCESS(Result)) { free(Memfs); LocalFree(RootSecurity); return Result; } memset(&VolumeParams, 0, sizeof VolumeParams); VolumeParams.Version = sizeof FSP_FSCTL_VOLUME_PARAMS; VolumeParams.SectorSize = MEMFS_SECTOR_SIZE; VolumeParams.SectorsPerAllocationUnit = MEMFS_SECTORS_PER_ALLOCATION_UNIT; VolumeParams.VolumeCreationTime = MemfsGetSystemTime(); VolumeParams.VolumeSerialNumber = (UINT32)(MemfsGetSystemTime() / (10000 * 1000)); VolumeParams.FileInfoTimeout = FileInfoTimeout; VolumeParams.CaseSensitiveSearch = !CaseInsensitive; VolumeParams.CasePreservedNames = 1; VolumeParams.UnicodeOnDisk = 1; VolumeParams.PersistentAcls = 1; VolumeParams.ReparsePoints = 1; VolumeParams.ReparsePointsAccessCheck = 0; #if defined(MEMFS_NAMED_STREAMS) VolumeParams.NamedStreams = 1; #endif VolumeParams.PostCleanupWhenModifiedOnly = 1; VolumeParams.PostDispositionWhenNecessaryOnly = 1; #if defined(MEMFS_DIRINFO_BY_NAME) VolumeParams.PassQueryDirectoryFileName = 1; #endif VolumeParams.FlushAndPurgeOnCleanup = FlushAndPurgeOnCleanup; #if defined(MEMFS_CONTROL) VolumeParams.DeviceControl = 1; #endif #if defined(MEMFS_EA) VolumeParams.ExtendedAttributes = 1; #endif #if defined(MEMFS_WSL) VolumeParams.WslFeatures = 1; #endif VolumeParams.AllowOpenInKernelMode = 1; #if defined(MEMFS_REJECT_EARLY_IRP) VolumeParams.RejectIrpPriorToTransact0 = 1; #endif VolumeParams.SupportsPosixUnlinkRename = SupportsPosixUnlinkRename; if (0 != VolumePrefix) wcscpy_s(VolumeParams.Prefix, sizeof VolumeParams.Prefix / sizeof(WCHAR), VolumePrefix); wcscpy_s(VolumeParams.FileSystemName, sizeof VolumeParams.FileSystemName / sizeof(WCHAR), 0 != FileSystemName ? FileSystemName : L"-MEMFS"); Result = FspFileSystemCreate(DevicePath, &VolumeParams, &MemfsInterface, &Memfs->FileSystem); if (!NT_SUCCESS(Result)) { MemfsFileNodeMapDelete(Memfs->FileNodeMap); free(Memfs); LocalFree(RootSecurity); return Result; } Memfs->FileSystem->UserContext = Memfs; Memfs->VolumeLabelLength = sizeof L"MEMFS" - sizeof(WCHAR); memcpy(Memfs->VolumeLabel, L"MEMFS", Memfs->VolumeLabelLength); #if 0 FspFileSystemSetOperationGuardStrategy(Memfs->FileSystem, FSP_FILE_SYSTEM_OPERATION_GUARD_STRATEGY_COARSE); #endif /* * Create root directory. */ Result = MemfsFileNodeCreate(L"\\", &RootNode); if (!NT_SUCCESS(Result)) { MemfsDelete(Memfs); LocalFree(RootSecurity); return Result; } RootNode->FileInfo.FileAttributes = FILE_ATTRIBUTE_DIRECTORY; RootNode->FileSecurity = malloc(RootSecuritySize); if (0 == RootNode->FileSecurity) { MemfsFileNodeDelete(RootNode); MemfsDelete(Memfs); LocalFree(RootSecurity); return STATUS_INSUFFICIENT_RESOURCES; } RootNode->FileSecuritySize = RootSecuritySize; memcpy(RootNode->FileSecurity, RootSecurity, RootSecuritySize); Result = MemfsFileNodeMapInsert(Memfs->FileNodeMap, RootNode, &Inserted); if (!NT_SUCCESS(Result)) { MemfsFileNodeDelete(RootNode); MemfsDelete(Memfs); LocalFree(RootSecurity); return Result; } LocalFree(RootSecurity); *PMemfs = Memfs; return STATUS_SUCCESS; } VOID MemfsDelete(MEMFS *Memfs) { FspFileSystemDelete(Memfs->FileSystem); MemfsFileNodeMapDelete(Memfs->FileNodeMap); free(Memfs); } NTSTATUS MemfsStart(MEMFS *Memfs) { #ifdef MEMFS_SLOWIO Memfs->SlowioThreadsRunning = 0; #endif return FspFileSystemStartDispatcher(Memfs->FileSystem, 0); } VOID MemfsStop(MEMFS *Memfs) { FspFileSystemStopDispatcher(Memfs->FileSystem); #ifdef MEMFS_SLOWIO while (Memfs->SlowioThreadsRunning) Sleep(1); #endif } FSP_FILE_SYSTEM *MemfsFileSystem(MEMFS *Memfs) { return Memfs->FileSystem; } NTSTATUS MemfsHeapConfigure(SIZE_T InitialSize, SIZE_T MaximumSize, SIZE_T Alignment) { return LargeHeapInitialize(0, InitialSize, MaximumSize, LargeHeapAlignment) ? STATUS_SUCCESS : STATUS_INSUFFICIENT_RESOURCES; } ```
```java /* * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * * path_to_url * * Unless required by applicable law or agreed to in writing, software * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ package org.apache.shardingsphere.encrypt.rewrite.token.generator.ddl; import lombok.RequiredArgsConstructor; import lombok.Setter; import org.apache.shardingsphere.encrypt.constant.EncryptColumnDataType; import org.apache.shardingsphere.encrypt.exception.metadata.EncryptColumnAlterException; import org.apache.shardingsphere.encrypt.rewrite.token.pojo.EncryptAlterTableToken; import org.apache.shardingsphere.encrypt.rewrite.token.pojo.EncryptColumnToken; import org.apache.shardingsphere.encrypt.rule.EncryptRule; import org.apache.shardingsphere.encrypt.rule.column.EncryptColumn; import org.apache.shardingsphere.encrypt.rule.column.item.AssistedQueryColumnItem; import org.apache.shardingsphere.encrypt.rule.column.item.LikeQueryColumnItem; import org.apache.shardingsphere.encrypt.rule.table.EncryptTable; import org.apache.shardingsphere.encrypt.spi.EncryptAlgorithm; import org.apache.shardingsphere.infra.binder.context.statement.SQLStatementContext; import org.apache.shardingsphere.infra.binder.context.statement.ddl.AlterTableStatementContext; import org.apache.shardingsphere.infra.exception.core.ShardingSpherePreconditions; import org.apache.shardingsphere.infra.rewrite.sql.token.common.generator.CollectionSQLTokenGenerator; import org.apache.shardingsphere.infra.rewrite.sql.token.common.pojo.SQLToken; import org.apache.shardingsphere.infra.rewrite.sql.token.common.pojo.Substitutable; import org.apache.shardingsphere.infra.rewrite.sql.token.common.pojo.generic.RemoveToken; import org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.column.ColumnDefinitionSegment; import org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.column.alter.AddColumnDefinitionSegment; import org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.column.alter.ChangeColumnDefinitionSegment; import org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.column.alter.DropColumnDefinitionSegment; import org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.column.alter.ModifyColumnDefinitionSegment; import org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.column.position.ColumnPositionSegment; import org.apache.shardingsphere.sql.parser.statement.core.segment.dml.column.ColumnSegment; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.LinkedList; import java.util.List; import java.util.Optional; /** * Alter table token generator for encrypt. */ @RequiredArgsConstructor @Setter public final class EncryptAlterTableTokenGenerator implements CollectionSQLTokenGenerator<AlterTableStatementContext> { private final EncryptRule encryptRule; @Override public boolean isGenerateSQLToken(final SQLStatementContext sqlStatementContext) { return sqlStatementContext instanceof AlterTableStatementContext; } @Override public Collection<SQLToken> generateSQLTokens(final AlterTableStatementContext sqlStatementContext) { String tableName = sqlStatementContext.getSqlStatement().getTable().getTableName().getIdentifier().getValue(); EncryptTable encryptTable = encryptRule.getEncryptTable(tableName); Collection<SQLToken> result = new LinkedList<>(getAddColumnTokens(encryptTable, sqlStatementContext.getSqlStatement().getAddColumnDefinitions())); result.addAll(getModifyColumnTokens(encryptTable, sqlStatementContext.getSqlStatement().getModifyColumnDefinitions())); result.addAll(getChangeColumnTokens(encryptTable, sqlStatementContext.getSqlStatement().getChangeColumnDefinitions())); List<SQLToken> dropColumnTokens = getDropColumnTokens(encryptTable, sqlStatementContext.getSqlStatement().getDropColumnDefinitions()); String databaseName = sqlStatementContext.getDatabaseType().getType(); if ("SQLServer".equals(databaseName)) { result.addAll(mergeDropColumnStatement(dropColumnTokens, "", "")); } else if ("Oracle".equals(databaseName)) { result.addAll(mergeDropColumnStatement(dropColumnTokens, "(", ")")); } else { result.addAll(dropColumnTokens); } return result; } private Collection<SQLToken> getAddColumnTokens(final EncryptTable encryptTable, final Collection<AddColumnDefinitionSegment> segments) { Collection<SQLToken> result = new LinkedList<>(); for (AddColumnDefinitionSegment each : segments) { result.addAll(getAddColumnTokens(encryptTable, each)); } return result; } private Collection<SQLToken> getAddColumnTokens(final EncryptTable encryptTable, final AddColumnDefinitionSegment segment) { Collection<SQLToken> result = new LinkedList<>(); for (ColumnDefinitionSegment each : segment.getColumnDefinitions()) { String columnName = each.getColumnName().getIdentifier().getValue(); if (encryptTable.isEncryptColumn(columnName)) { result.addAll(getAddColumnTokens(encryptTable.getEncryptColumn(columnName), segment, each)); } } getAddColumnPositionToken(encryptTable, segment).ifPresent(result::add); return result; } private Collection<SQLToken> getAddColumnTokens(final EncryptColumn encryptColumn, final AddColumnDefinitionSegment addColumnDefinitionSegment, final ColumnDefinitionSegment columnDefinitionSegment) { Collection<SQLToken> result = new LinkedList<>(); result.add(new RemoveToken(columnDefinitionSegment.getStartIndex(), columnDefinitionSegment.getStopIndex())); result.add(new EncryptColumnToken(columnDefinitionSegment.getStopIndex() + 1, columnDefinitionSegment.getStopIndex(), encryptColumn.getCipher().getName(), EncryptColumnDataType.DEFAULT_DATA_TYPE)); encryptColumn.getAssistedQuery().map(optional -> new EncryptColumnToken(addColumnDefinitionSegment.getStopIndex() + 1, addColumnDefinitionSegment.getStopIndex(), ", ADD COLUMN " + optional.getName(), EncryptColumnDataType.DEFAULT_DATA_TYPE)).ifPresent(result::add); encryptColumn.getLikeQuery().map(optional -> new EncryptColumnToken(addColumnDefinitionSegment.getStopIndex() + 1, addColumnDefinitionSegment.getStopIndex(), ", ADD COLUMN " + optional.getName(), EncryptColumnDataType.DEFAULT_DATA_TYPE)).ifPresent(result::add); return result; } private Optional<SQLToken> getAddColumnPositionToken(final EncryptTable encryptTable, final AddColumnDefinitionSegment segment) { Optional<ColumnPositionSegment> columnPositionSegment = segment.getColumnPosition().filter(optional -> null != optional.getColumnName()); if (columnPositionSegment.isPresent()) { String columnName = columnPositionSegment.get().getColumnName().getIdentifier().getValue(); if (encryptTable.isEncryptColumn(columnName)) { return Optional.of(getPositionColumnToken(encryptTable.getEncryptColumn(columnName), segment.getColumnPosition().get())); } } return Optional.empty(); } private EncryptAlterTableToken getPositionColumnToken(final EncryptColumn encryptColumn, final ColumnPositionSegment segment) { return new EncryptAlterTableToken(segment.getColumnName().getStartIndex(), segment.getStopIndex(), encryptColumn.getCipher().getName(), null); } private Collection<SQLToken> getModifyColumnTokens(final EncryptTable encryptTable, final Collection<ModifyColumnDefinitionSegment> segments) { Collection<SQLToken> result = new LinkedList<>(); for (ModifyColumnDefinitionSegment each : segments) { String columnName = each.getColumnDefinition().getColumnName().getIdentifier().getValue(); ShardingSpherePreconditions.checkState(!encryptTable.isEncryptColumn(columnName), () -> new UnsupportedOperationException("Unsupported operation 'modify' for the cipher column")); each.getColumnPosition().flatMap(optional -> getColumnPositionToken(encryptTable, optional)).ifPresent(result::add); } return result; } private Optional<SQLToken> getColumnPositionToken(final EncryptTable encryptTable, final ColumnPositionSegment segment) { if (null == segment.getColumnName()) { return Optional.empty(); } String columnName = segment.getColumnName().getIdentifier().getValue(); return encryptTable.isEncryptColumn(columnName) ? Optional.of(getPositionColumnToken(encryptTable.getEncryptColumn(columnName), segment)) : Optional.empty(); } private Collection<SQLToken> getChangeColumnTokens(final EncryptTable encryptTable, final Collection<ChangeColumnDefinitionSegment> segments) { Collection<SQLToken> result = new LinkedList<>(); for (ChangeColumnDefinitionSegment each : segments) { String columnName = each.getPreviousColumn().getIdentifier().getValue(); ShardingSpherePreconditions.checkState(!encryptTable.isEncryptColumn(columnName), () -> new UnsupportedOperationException("Unsupported operation 'change' for the cipher column")); result.addAll(getChangeColumnTokens(encryptTable, each)); each.getColumnPosition().flatMap(optional -> getColumnPositionToken(encryptTable, optional)).ifPresent(result::add); } return result; } private Collection<SQLToken> getChangeColumnTokens(final EncryptTable encryptTable, final ChangeColumnDefinitionSegment segment) { String previousColumnName = segment.getPreviousColumn().getIdentifier().getValue(); String columnName = segment.getColumnDefinition().getColumnName().getIdentifier().getValue(); isSameEncryptColumn(encryptTable, previousColumnName, columnName); if (!encryptTable.isEncryptColumn(columnName) || !encryptTable.isEncryptColumn(previousColumnName)) { return Collections.emptyList(); } Collection<SQLToken> result = new LinkedList<>(); EncryptColumn previousEncryptColumn = encryptTable.getEncryptColumn(previousColumnName); EncryptColumn encryptColumn = encryptTable.getEncryptColumn(columnName); result.addAll(getPreviousColumnTokens(previousEncryptColumn, segment)); result.addAll(getColumnTokens(previousEncryptColumn, encryptColumn, segment)); return result; } private void isSameEncryptColumn(final EncryptTable encryptTable, final String previousColumnName, final String columnName) { Optional<EncryptAlgorithm> previousEncryptor = encryptTable.findEncryptor(previousColumnName); Optional<EncryptAlgorithm> currentEncryptor = encryptTable.findEncryptor(columnName); if (!previousEncryptor.isPresent() && !currentEncryptor.isPresent()) { return; } ShardingSpherePreconditions.checkState(previousEncryptor.equals(currentEncryptor) && checkPreviousAndAfterHasSameColumnNumber(encryptTable, previousColumnName, columnName), () -> new EncryptColumnAlterException(encryptTable.getTable(), columnName, previousColumnName)); } private boolean checkPreviousAndAfterHasSameColumnNumber(final EncryptTable encryptTable, final String previousColumnName, final String columnName) { EncryptColumn previousEncryptColumn = encryptTable.getEncryptColumn(previousColumnName); EncryptColumn encryptColumn = encryptTable.getEncryptColumn(columnName); if (previousEncryptColumn.getAssistedQuery().isPresent() && !encryptColumn.getAssistedQuery().isPresent()) { return false; } if (previousEncryptColumn.getLikeQuery().isPresent() && !encryptColumn.getLikeQuery().isPresent()) { return false; } return previousEncryptColumn.getAssistedQuery().isPresent() || !encryptColumn.getAssistedQuery().isPresent(); } private Collection<SQLToken> getPreviousColumnTokens(final EncryptColumn previousEncryptColumn, final ChangeColumnDefinitionSegment segment) { Collection<SQLToken> result = new LinkedList<>(); result.add(new RemoveToken(segment.getPreviousColumn().getStartIndex(), segment.getPreviousColumn().getStopIndex())); result.add(new EncryptAlterTableToken(segment.getPreviousColumn().getStopIndex() + 1, segment.getPreviousColumn().getStopIndex(), previousEncryptColumn.getCipher().getName(), null)); return result; } private Collection<SQLToken> getColumnTokens(final EncryptColumn previousEncryptColumn, final EncryptColumn encryptColumn, final ChangeColumnDefinitionSegment segment) { Collection<SQLToken> result = new LinkedList<>(); result.add(new RemoveToken(segment.getColumnDefinition().getColumnName().getStartIndex(), segment.getColumnDefinition().getStopIndex())); result.add(new EncryptColumnToken(segment.getColumnDefinition().getStopIndex() + 1, segment.getColumnDefinition().getStopIndex(), encryptColumn.getCipher().getName(), EncryptColumnDataType.DEFAULT_DATA_TYPE)); previousEncryptColumn.getAssistedQuery().map(optional -> new EncryptColumnToken(segment.getStopIndex() + 1, segment.getStopIndex(), ", CHANGE COLUMN " + optional.getName() + " " + encryptColumn.getAssistedQuery().map(AssistedQueryColumnItem::getName).orElse(""), EncryptColumnDataType.DEFAULT_DATA_TYPE)).ifPresent(result::add); previousEncryptColumn.getLikeQuery().map(optional -> new EncryptColumnToken(segment.getStopIndex() + 1, segment.getStopIndex(), ", CHANGE COLUMN " + optional.getName() + " " + encryptColumn.getLikeQuery().map(LikeQueryColumnItem::getName).orElse(""), EncryptColumnDataType.DEFAULT_DATA_TYPE)).ifPresent(result::add); return result; } private List<SQLToken> getDropColumnTokens(final EncryptTable encryptTable, final Collection<DropColumnDefinitionSegment> segments) { List<SQLToken> result = new ArrayList<>(); for (DropColumnDefinitionSegment each : segments) { result.addAll(getDropColumnTokens(encryptTable, each)); } return result; } private Collection<SQLToken> getDropColumnTokens(final EncryptTable encryptTable, final DropColumnDefinitionSegment segment) { Collection<SQLToken> result = new LinkedList<>(); for (ColumnSegment each : segment.getColumns()) { ShardingSpherePreconditions.checkState(!encryptTable.isEncryptColumn(each.getQualifiedName()), () -> new UnsupportedOperationException("Unsupported operation 'drop' for the cipher column")); } return result; } private Collection<SQLToken> mergeDropColumnStatement(final List<SQLToken> dropSQLTokens, final String leftJoiner, final String rightJoiner) { Collection<SQLToken> result = new LinkedList<>(); Collection<String> dropColumns = new LinkedList<>(); int lastStartIndex = -1; for (int i = 0; i < dropSQLTokens.size(); i++) { SQLToken token = dropSQLTokens.get(i); if (token instanceof RemoveToken) { result.add(0 == i ? token : new RemoveToken(lastStartIndex, ((RemoveToken) token).getStopIndex())); } else { EncryptAlterTableToken encryptAlterTableToken = (EncryptAlterTableToken) token; dropColumns.add(encryptAlterTableToken.getColumnName()); if (i == dropSQLTokens.size() - 1) { result.add(new EncryptAlterTableToken(token.getStartIndex(), encryptAlterTableToken.getStopIndex(), leftJoiner + String.join(",", dropColumns) + rightJoiner, "DROP COLUMN")); } } lastStartIndex = ((Substitutable) token).getStartIndex(); } return result; } } ```
Clinton Adams (December 11, 1918 – May 13, 2002) was an American artist and art historian. He was known for his contributions to the field of lithography. Biography Adams was born in Glendale, California. He worked in the art department of the University of California, Los Angeles, (UCLA) but eventually left to serve in the military. He returned to UCLA in 1946. From 1961 to 1976, he was the Dean of the University of New Mexico. As a painter, Adams worked in several mediums, including oil, acrylic, watercolor painting, and egg tempera. He also produced lithographs, and was the co-author of The Tamarind Book of Lithography (1971), an important description of the process. Among his other writings is American Lithographers (1987), a history of the art in the United States from 1900 to 1960. Adams received the Governor's Award for "Outstanding Contributions to the Arts of New Mexico" in 1985, and in 1992 he became a member of the National Academy of Design. He died of liver cancer on May 13, 2002, in Albuquerque, New Mexico. References External links Clinton Adams papers, 1934-2002 from the Smithsonian Archives of American Art Oral history interview with Clinton Adams, 1974 Mar. 29 from the Archives of American Art Oral history interview with Clinton Adams, 1995 Aug. 2-3 a second interview from the Archives of American Art 1918 births 2002 deaths American art historians American lithographers Deaths from liver cancer Writers from Glendale, California 20th-century American historians American male non-fiction writers UCLA School of the Arts and Architecture faculty University of New Mexico faculty Deaths from cancer in New Mexico American military personnel of World War II 20th-century American male writers Historians from California 20th-century lithographers
Downtown Burbank station is a passenger rail station near downtown Burbank, California. It is served by Metrolink's Antelope Valley Line to Lancaster and Ventura County Line to East Ventura with both terminating at Los Angeles Union Station. A limited number of Amtrak trains stop at this station; with all Amtrak trains stopping at the Burbank Airport–South station, several miles to the northwest of downtown Burbank. Megabus started providing long distance motorcoach service from the station on August 15, 2013, but it has since been discontinued. History The Southern Pacific built their line north of Los Angeles to Burbank by mid-1873. The company rebuilt the station in 1927. That building was destroyed in a fire in 1991. The modern station opened on October 26, 1992 with the inauguration of Metrolink services. References External links Burbank.com: Metrolink Metrolink stations in Los Angeles County, California Buildings and structures in Burbank, California Public transportation in the San Fernando Valley Railway stations in the United States opened in 1992 1992 establishments in California Burbank
The men's discus throw at the 1966 European Athletics Championships was held in Budapest, Hungary, at Népstadion on 30 and 31 August 1966. Medalists Results Final 31 August Qualification 30 August Participation According to an unofficial count, 24 athletes from 14 countries participated in the event. (1) (2) (1) (2) (3) (1) (1) (2) (2) (2) (2) (2) (1) (2) References Discus throw Discus throw at the European Athletics Championships
Hillman Foundation may refer to: The Benji Hillman Foundation, an Israeli foundation that helps soldiers Elsie H. Hillman Foundation of the Hillman Family Foundations, 18 named foundations The Sidney Hillman Foundation, awards prizes to journalists
```c++ /*============================================================================== file LICENSE_1_0.txt or copy at path_to_url ==============================================================================*/ #ifndef BOOST_PHOENIX_SUPPORT_ITERATE_HPP #define BOOST_PHOENIX_SUPPORT_ITERATE_HPP #include <boost/preprocessor/iteration/iterate.hpp> #define BOOST_PHOENIX_IS_ITERATING 0 #define BOOST_PHOENIX_ITERATE() \ <boost/phoenix/support/detail/iterate.hpp> #include <boost/phoenix/support/detail/iterate_define.hpp> #endif ```
```shell Using tags for version control What is stored in a commit? Remote repositories: fetching and pushing Recover lost code Ignore files in git ```
Abode Solicitors Ltd traded as Arc Property Solicitors and was a firm of conveyancing solicitors with offices in Harrogate and London. The firm was recognised by The Lawyer in 2011 as a top 10 UK law firm by revenue per partner. There are around 9000 law firms in the UK. In 2013 the firm was closed down by the Solicitors Regulation Authority following an investigation into the practices of the firm by the Inland Revenue. It is understood that the firm was duping customers into a scheme where they could legally avoid paying SDLT when purchasing a property. The firm made promises to a large number of clients that if there was any investigation into the scheme by HMRC which resulted in SDLT having to be paid, they would refund the fees that they charged for the scheme. These fees propelled Adobe Solicitors Ltd t/a Arc Property Solicitors into the top 10 law firms by revenue in the UK. The firm no longer exists and the money has not been traced. References The Lawyer UK200 The Lawyer revenue per partner list Stephensons External links Official Website Law firms of the United Kingdom
```less /** * path_to_url#custom-mq * rem font-size font-size px * JavaScript breakpoint.less CSS * * xs=0px * sm: <600px * md>=600px & <840px * lg>=840px & <1080px * xl>=1080px & < 1920px * xxl>=1920px */ @custom-media --mdui-viewport-xs (min-width: 0) and (max-width: 599.98px); @custom-media --mdui-viewport-sm-down (max-width: 599.98px); @custom-media --mdui-viewport-sm (min-width: 600px) and (max-width: 839.98px); @custom-media --mdui-viewport-sm-up (min-width: 600px); @custom-media --mdui-viewport-md-down (max-width: 839.98px); @custom-media --mdui-viewport-md (min-width: 840px) and (max-width: 1079.98px); @custom-media --mdui-viewport-md-up (min-width: 840px); @custom-media --mdui-viewport-lg-down (max-width: 1079.98px); @custom-media --mdui-viewport-lg (min-width: 1080px) and (max-width: 1439.98px); @custom-media --mdui-viewport-lg-up (min-width: 1080px); @custom-media --mdui-viewport-xl-down (max-width: 1439.98px); @custom-media --mdui-viewport-xl (min-width: 1440px) and (max-width: 1919.98px); @custom-media --mdui-viewport-xl-up (min-width: 1440px); @custom-media --mdui-viewport-xxl-down (max-width: 1919.98px); @custom-media --mdui-viewport-xxl (min-width: 1920px); @custom-media --mdui-viewport-xxl-up (min-width: 1920px); ```
```go // Code generated by counterfeiter. DO NOT EDIT. package fake import ( "sync" "github.com/hyperledger/fabric-protos-go/common" "github.com/hyperledger/fabric-protos-go/orderer" "github.com/hyperledger/fabric/common/deliverclient/orderers" "github.com/hyperledger/fabric/common/deliverclient/blocksprovider" ) type DeliverClientRequester struct { ConnectStub func(*common.Envelope, *orderers.Endpoint) (orderer.AtomicBroadcast_DeliverClient, func(), error) connectMutex sync.RWMutex connectArgsForCall []struct { arg1 *common.Envelope arg2 *orderers.Endpoint } connectReturns struct { result1 orderer.AtomicBroadcast_DeliverClient result2 func() result3 error } connectReturnsOnCall map[int]struct { result1 orderer.AtomicBroadcast_DeliverClient result2 func() result3 error } SeekInfoHeadersFromStub func(uint64) (*common.Envelope, error) seekInfoHeadersFromMutex sync.RWMutex seekInfoHeadersFromArgsForCall []struct { arg1 uint64 } seekInfoHeadersFromReturns struct { result1 *common.Envelope result2 error } seekInfoHeadersFromReturnsOnCall map[int]struct { result1 *common.Envelope result2 error } invocations map[string][][]interface{} invocationsMutex sync.RWMutex } func (fake *DeliverClientRequester) Connect(arg1 *common.Envelope, arg2 *orderers.Endpoint) (orderer.AtomicBroadcast_DeliverClient, func(), error) { fake.connectMutex.Lock() ret, specificReturn := fake.connectReturnsOnCall[len(fake.connectArgsForCall)] fake.connectArgsForCall = append(fake.connectArgsForCall, struct { arg1 *common.Envelope arg2 *orderers.Endpoint }{arg1, arg2}) stub := fake.ConnectStub fakeReturns := fake.connectReturns fake.recordInvocation("Connect", []interface{}{arg1, arg2}) fake.connectMutex.Unlock() if stub != nil { return stub(arg1, arg2) } if specificReturn { return ret.result1, ret.result2, ret.result3 } return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3 } func (fake *DeliverClientRequester) ConnectCallCount() int { fake.connectMutex.RLock() defer fake.connectMutex.RUnlock() return len(fake.connectArgsForCall) } func (fake *DeliverClientRequester) ConnectCalls(stub func(*common.Envelope, *orderers.Endpoint) (orderer.AtomicBroadcast_DeliverClient, func(), error)) { fake.connectMutex.Lock() defer fake.connectMutex.Unlock() fake.ConnectStub = stub } func (fake *DeliverClientRequester) ConnectArgsForCall(i int) (*common.Envelope, *orderers.Endpoint) { fake.connectMutex.RLock() defer fake.connectMutex.RUnlock() argsForCall := fake.connectArgsForCall[i] return argsForCall.arg1, argsForCall.arg2 } func (fake *DeliverClientRequester) ConnectReturns(result1 orderer.AtomicBroadcast_DeliverClient, result2 func(), result3 error) { fake.connectMutex.Lock() defer fake.connectMutex.Unlock() fake.ConnectStub = nil fake.connectReturns = struct { result1 orderer.AtomicBroadcast_DeliverClient result2 func() result3 error }{result1, result2, result3} } func (fake *DeliverClientRequester) ConnectReturnsOnCall(i int, result1 orderer.AtomicBroadcast_DeliverClient, result2 func(), result3 error) { fake.connectMutex.Lock() defer fake.connectMutex.Unlock() fake.ConnectStub = nil if fake.connectReturnsOnCall == nil { fake.connectReturnsOnCall = make(map[int]struct { result1 orderer.AtomicBroadcast_DeliverClient result2 func() result3 error }) } fake.connectReturnsOnCall[i] = struct { result1 orderer.AtomicBroadcast_DeliverClient result2 func() result3 error }{result1, result2, result3} } func (fake *DeliverClientRequester) SeekInfoHeadersFrom(arg1 uint64) (*common.Envelope, error) { fake.seekInfoHeadersFromMutex.Lock() ret, specificReturn := fake.seekInfoHeadersFromReturnsOnCall[len(fake.seekInfoHeadersFromArgsForCall)] fake.seekInfoHeadersFromArgsForCall = append(fake.seekInfoHeadersFromArgsForCall, struct { arg1 uint64 }{arg1}) stub := fake.SeekInfoHeadersFromStub fakeReturns := fake.seekInfoHeadersFromReturns fake.recordInvocation("SeekInfoHeadersFrom", []interface{}{arg1}) fake.seekInfoHeadersFromMutex.Unlock() if stub != nil { return stub(arg1) } if specificReturn { return ret.result1, ret.result2 } return fakeReturns.result1, fakeReturns.result2 } func (fake *DeliverClientRequester) SeekInfoHeadersFromCallCount() int { fake.seekInfoHeadersFromMutex.RLock() defer fake.seekInfoHeadersFromMutex.RUnlock() return len(fake.seekInfoHeadersFromArgsForCall) } func (fake *DeliverClientRequester) SeekInfoHeadersFromCalls(stub func(uint64) (*common.Envelope, error)) { fake.seekInfoHeadersFromMutex.Lock() defer fake.seekInfoHeadersFromMutex.Unlock() fake.SeekInfoHeadersFromStub = stub } func (fake *DeliverClientRequester) SeekInfoHeadersFromArgsForCall(i int) uint64 { fake.seekInfoHeadersFromMutex.RLock() defer fake.seekInfoHeadersFromMutex.RUnlock() argsForCall := fake.seekInfoHeadersFromArgsForCall[i] return argsForCall.arg1 } func (fake *DeliverClientRequester) SeekInfoHeadersFromReturns(result1 *common.Envelope, result2 error) { fake.seekInfoHeadersFromMutex.Lock() defer fake.seekInfoHeadersFromMutex.Unlock() fake.SeekInfoHeadersFromStub = nil fake.seekInfoHeadersFromReturns = struct { result1 *common.Envelope result2 error }{result1, result2} } func (fake *DeliverClientRequester) SeekInfoHeadersFromReturnsOnCall(i int, result1 *common.Envelope, result2 error) { fake.seekInfoHeadersFromMutex.Lock() defer fake.seekInfoHeadersFromMutex.Unlock() fake.SeekInfoHeadersFromStub = nil if fake.seekInfoHeadersFromReturnsOnCall == nil { fake.seekInfoHeadersFromReturnsOnCall = make(map[int]struct { result1 *common.Envelope result2 error }) } fake.seekInfoHeadersFromReturnsOnCall[i] = struct { result1 *common.Envelope result2 error }{result1, result2} } func (fake *DeliverClientRequester) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() fake.connectMutex.RLock() defer fake.connectMutex.RUnlock() fake.seekInfoHeadersFromMutex.RLock() defer fake.seekInfoHeadersFromMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value } return copiedInvocations } func (fake *DeliverClientRequester) recordInvocation(key string, args []interface{}) { fake.invocationsMutex.Lock() defer fake.invocationsMutex.Unlock() if fake.invocations == nil { fake.invocations = map[string][][]interface{}{} } if fake.invocations[key] == nil { fake.invocations[key] = [][]interface{}{} } fake.invocations[key] = append(fake.invocations[key], args) } var _ blocksprovider.DeliverClientRequester = new(DeliverClientRequester) ```
Kaloyan or Kalojan, also known as Ivan I, Ioannitsa or Johannitsa (; 1170 – October 1207), the Romanslayer, was emperor or tsar of Bulgaria from 1196 to 1207. He was the younger brother of Theodor and Asen, who led the anti-Byzantine uprising of the Bulgarians and Vlachs in 1185. The uprising ended with the restoration of Bulgaria as an independent state. He spent a few years as a hostage in Constantinople in the late 1180s. Theodor, crowned Emperor Peter II, made him his co-ruler after Asen was murdered in 1196. A year later, Peter was also murdered, and Kaloyan became the sole ruler of Bulgaria. After the successful siege of Varna in 1201 against the Byzantine Empire, the defenders and governors of the city were tied and thrown into the moat of the fortress walls and covered with dirt by the Bulgarians. After they were buried alive in this way, Kaloyan declared himself a Bulgarian avenger, adopting the moniker "the Romanslayer" by analogy with the emperor Basil II the Bulgar Slayer, who blinded an entire Bulgarian army of 15,000 people. To obtain an imperial title from the Holy See, Kaloyan entered into correspondence with Pope Innocent III, offering to acknowledge papal primacy. His expansionist policy brought him into conflict with the Byzantine Empire, Hungary, and Serbia. In 1204, King Emeric of Hungary allowed the papal legate who was to deliver a royal crown to Kaloyan to enter Bulgaria only at the Pope's demand. The legate crowned Kaloyan "king of the Bulgarians and Vlachs" on 8 November 1204, but Kaloyan continued to style himself as tsar (emperor). Kaloyan took advantage of the disintegration of the Byzantine Empire after the fall of Constantinople to the Crusaders or "Latins" in 1204. He captured fortresses in the themes of Macedonia and Thrace and supported the local population's riots against the Crusaders. He defeated Baldwin I, Latin Emperor of Constantinople, in the Battle of Adrianople on 14 April 1205. Baldwin was captured and later died in Kaloyan's prison. Kaloyan launched new campaigns against the Crusaders and Romans, capturing or destroying dozens of their fortresses. He died under mysterious circumstances during the siege of Thessalonica in 1207. Early life Kaloyan was the younger brother of Theodor and Asen, noted as the instigators of the uprising of the Bulgarians and Vlachs against the Byzantine Empire in 1185. Theodor was crowned emperor and adopted the name Peter in 1185. Asen became Peter's co-ruler before 1190. They secured the independence of their realm with the assistance of Cuman warriors from the Pontic steppes. Kaloyan, who was still a teenager in 1188, must have been born around 1170, according to historian Alexandru Madgearu. He was baptised Ivan (or John), but he was called Johannitsa ("Little Ivan") because Ivan was also the baptismal name of his elder brother Asen. Kaloyan derived from the Greek expression for John the Handsome (Kallos Ioannis). His Greek enemies also called him Skyloioannes ("John the Dog"), which gave rise to references to Tsar Skaloyan or Scaluian in frescos in the Dragalevtsi Monastery and the Sucevița Monastery. After the Byzantines captured Asen's wife, Kaloyan was sent as a hostage to Constantinople in exchange for her in the spring of 1188. The date of his release is not known, or said to be about 1189 when he escaped. He was back in his homeland when a boyar, Ivanko, murdered Asen in Tarnovo in 1196. Ivanko attempted to obtain the throne with Byzantine support, but Theodor-Peter forced him to flee to the Byzantine Empire. Reign Conflicts with the Byzantine Empire The Byzantine historian Niketas Choniates mentioned that Theodor-Peter designated Kaloyan "to assist him in his labors and share in his rule" at an unspecified time. Kaloyan became the sole ruler of Bulgaria after Theodor-Peter was murdered in 1197. Shortly afterwards he attacked the Byzantine province of Thrace and launched frequent raids against it during the following months. Around this time, he sent a letter to Pope Innocent III, urging him to dispatch an envoy to Bulgaria. He wanted to persuade the pope to acknowledge his rule in Bulgaria. Innocent eagerly entered into correspondence with Kaloyan because the reunification of the Christian denominations under his authority was one of his principal objectives. The Byzantine Emperor Alexios III Angelos made Ivanko the commander of Philippopolis (now Plovdiv in Bulgaria). Ivanko seized two fortresses in the Rhodopi Mountains from Kaloyan, but by 1198 he had made an alliance with him. Cumans and Vlachs from the lands to the north of the river Danube broke into the Byzantine Empire in the spring and autumn of 1199. Choniates, who recorded these events, did not mention that Kaloyan cooperated with the invaders, so it is likely that they crossed Bulgaria without his authorization. Kaloyan captured Braničevo, Velbuzhd (now Kyustendil in Bulgaria), Skopje and Prizren from the Byzantines, most probably in that year, according to historian Alexandru Madgearu. Innocent III's envoy arrived in Bulgaria in late December 1199, bringing a letter from the Pope to Kaloyan. Innocent stated that he was informed that Kaloyan's forefathers had come "from the City of Rome". Kaloyan's answer, written in Old Church Slavonic, has not been preserved, but its content can be reconstructed based on his later correspondence with the Holy See. Kaloyan styled himself "Emperor of the Bulgarians and Vlachs", and asserted that he was the legitimate successor of the rulers of the First Bulgarian Empire. He demanded an imperial crown from the Pope and expressed his wish to put the Bulgarian Orthodox Church under the pope's jurisdiction. The Byzantines captured Ivanko and occupied his lands in 1200. Kaloyan and his Cuman allies launched a new campaign against Byzantine territories in March 1201. He destroyed Constantia (now Simeonovgrad in Bulgaria) and captured Varna. He also supported the rebellion of Dobromir Chrysos and Manuel Kamytzes against Alexios III, but they were both defeated. Roman Mstislavich, prince of Halych and Volhynia, invaded the Cumans' territories, forcing them to return to their homeland in 1201. After the Cuman's retreat, Kaloyan concluded a peace treaty with Alexios III and withdrew his troops from Thrace in late 1201 or in 1202. According to Kaloyan's letter to the Pope, Alexios III was also willing to send an imperial crown to him and to acknowledge the autocephalous (or autonomous) status of the Bulgarian Church. Imperial ambitions Vukan Nemanjić, ruler of Zeta, expelled his brother, Stefan, from Serbia in 1202. Kaloyan gave shelter to Stefan and allowed the Cumans to invade Serbia across Bulgaria. He invaded Serbia himself and captured Niš in the summer of 1203. According to Madgearu he also seized Dobromir Chrysos's realm, including its capital at Prosek. Emeric, King of Hungary, who claimed Belgrade, Braničevo and Niš, intervened in the conflict on Vukan's behalf. The Hungarian army occupied territories which were also claimed by Kaloyan. Since Vukan had already acknowledged papal primacy, Innocent III urged Kaloyan to make peace with him in September. In the same month, the papal legate, John of Casamari, gave a pallium to Basil I, the head of the Bulgarian Church, confirming his rank of archbishop, but denying his elevation to the rank of patriarch. Dissatisfied with the Pope's decision, Kaloyan sent a new letter to Rome, asking Innocent to send cardinals who could crown him emperor. He also informed the Pope that Emeric of Hungary had seized five Bulgarian bishoprics, asking Innocent to arbitrate in the dispute and determine the boundary between Bulgaria and Hungary. In the letter, he styled himself the "Emperor of the Bulgarians". The Pope did not accept Kaloyan's claim to an imperial crown, but dispatched Cardinal Leo Brancaleoni to Bulgaria in early 1204 to crown him king. Kaloyan sent envoys to the crusaders who were besieging Constantinople, offering military support to them if "they would crown him king so that he would be lord of his land of Vlachia", according to Robert of Clari's chronicle. However, the crusaders treated him with disdain and did not accept his offer. The crusaders captured Constantinople on 13April. They elected Baldwin IX of Flanders emperor and agreed to divide the Byzantine Empire among themselves. The papal legate, Brancaleoni, travelled through Hungary, but he was arrested at Keve (now Kovin in Serbia) on the Hungarian–Bulgarian frontier. Emeric of Hungary urged the cardinal to summon Kaloyan to Hungary and to arbitrate in their conflict. Brancaleoni was only released at the Pope's demand in late September or early October. He consecrated Basil primate of the Church of the Bulgarians and Vlachs on 7November. Next day, Brancaleone crowned Kaloyan king. In his subsequent letter to the Pope, Kaloyan styled himself as "King of Bulgaria and Vlachia", but referred to his realm as an empire and to Basil as a patriarch. War with the Crusaders Taking advantage of the disintegration of the Byzantine Empire, Kaloyan captured former Byzantine territories in Thrace. Initially he attempted to secure a peaceful division of the lands with the crusaders (or "Latins"). He asked Innocent III to prevent them from attacking Bulgaria. However, the crusaders wanted to implement their treaty which divided the Byzantine territories between them, including lands that Kaloyan claimed. Kaloyan gave shelter to Byzantine refugees and persuaded them to stir up riots in Thrace and Macedonia against the Latins. The refugees, according to Robert of Clari's account, also pledged they would elect him emperor if he invaded the Latin Empire. The Greek burghers of Adrianople (now Edirne in Turkey) and nearby towns rose up against the Latins in early 1205. Kaloyan promised that he would send them reinforcements before Easter. Considering Kaloyan's cooperation with the rebels a dangerous alliance, Emperor Baldwin decided to launch a counter-attack and ordered the withdrawal of his troops from Asia Minor. He laid siege to Adrianople before he could muster all his troops. Kaloyan hurried to the town at the head of an army of more than 14,000 Bulgarian, Vlach and Cuman warriors. A feigned retreat by the Cumans drew the heavy cavalry of the crusaders into an ambush in the marshes north of Adrianople, enabling Kaloyan to inflict a crushing defeat on them on 14April 1205. Baldwin was captured on the battlefield and died in captivity in Tarnovo. Choniates accused Kaloyan of having tortured and murdered Baldwin because he "seethed with anger" against the crusaders. George Akropolites added that Baldwin's head was "cleaned of all its contents and decorated all round with ornaments" to be used as a goblet by Kaloyan. On the other hand, Baldwin's brother and successor, Henry, informed the pope that Kaloyan behaved respectfully towards the crusaders who had been captured at Adrianople. Kaloyan's troops pillaged Thrace and Macedonia after his victory over the Latins. He launched a campaign against the Kingdom of Thessalonica, laying siege to Serres in late May. He promised free passage to the defenders, but after their surrender he broke his word and took them captive. He continued the campaign and seized Veria and Moglena (now Almopia in Greece). Most inhabitants of Veria were murdered or captured on his orders. Henry (who still ruled the Latin Empire as regent) launched a counter-invasion against Bulgaria in June. He could not capture Adrianople and a sudden flood forced him to lift the siege of Didymoteicho. Kaloyan decided to take vengeance of the townspeople of Philippopolis, who had voluntarily cooperated with the crusaders. With the assistance of the local Paulicians, he seized the town and ordered the murder of the most prominent burghers. The commoners were delivered in chains to Vlachia (a loosely defined territory, located to the south of the lower Danube). He returned to Tarnovo after a riot had broken out against him in the second half of 1205 or early 1206. He "subjected the rebels to harsh punishments and novel methods of execution", according to Choniates. He again invaded Thrace in January 1206. He captured Rousion (now Keşan in Turkey) and massacred its Latin garrison. He then destroyed most of the fortresses along the Via Egnatia, as far as Athira (present-day Büyükçekmece in Turkey). The local inhabitants were captured and forcibly relocated to the lower Danube. Akropolites recorded that thereafter Kaloyan called himself "Romanslayer", with a clear reference to Basil II who had been known as the "Bulgarslayer" after his destruction of the First Bulgarian Empire. The massacre and capture of their compatriots outraged the Greeks in Thrace and Macedonia. They realized that Kaloyan was more hostile to them than the Latins. The burghers of Adrianople and Didymoteicho approached Henry offering their submission. Henry accepted the offer and assisted Theodore Branas in taking possession of the two towns. Kaloyan attacked Didymoteicho in June, but the crusaders forced him to lift the siege. Soon after Henry was crowned emperor on 20August, Kaloyan returned and destroyed Didymoteicho. He then laid siege to Adrianople, but Henry forced him to withdraw his troops from Thrace. Henry also broke into Bulgaria and released 20,000 prisoners in October. Boniface, King of Thessalonica, had meanwhile recaptured Serres. Kaloyan concluded an alliance with Theodore I Laskaris, Emperor of Nicaea. Laskaris had started a war against David Komnenos, Emperor of Trebizond, who was supported by the Latins. He persuaded Kaloyan to invade Thrace, forcing Henry to withdraw his troops from Asia Minor. Kaloyan laid siege to Adrianople in April 1207, using trebuchets, but the defenders resisted. A month later, the Cumans abandoned Kaloyan's camp, because they wanted to return to the Pontic steppes, which compelled Kaloyan to lift the siege. Innocent III urged Kaloyan to make peace with the Latins, but he did not obey. Henry concluded a truce with Laskaris in July 1207. He also had a meeting with Boniface of Thessalonica, who acknowledged his suzerainty at Kypsela in Thrace. However, on his way back to Thessalonica, Boniface was ambushed and killed at Mosynopolis on 4September. According to Geoffrey of Villehardouin local Bulgarians were the perpetrators and they sent Boniface's head to Kaloyan. Robert of Clari and Choniates recorded that Kaloyan had set up the ambush. Boniface was succeeded by his minor son, Demetrius. The child king's mother, Margaret of Hungary, took up the administration of the kingdom. Kaloyan hurried to Thessalonica and laid siege to the town. Death Kaloyan died during the siege of Thessalonica in October 1207, but the circumstances of his death are uncertain. Historian Akropolites (1217/20-1282) stated that he died of pleurisy. He also recorded a rumour claiming that Kaloyan's "death was caused by divine wrath; for it seemed to him that an armed man appeared before him in his sleep and struck his side with a spear". Legends about Saint Demetrius of Thessalonica's intervention on behalf of the besieged town were recorded shortly after Kaloyan's death. Robert of Clari wrote before 1216 that the saint himself came to Kaloyan's tent and "struck him with a lance through the body", causing his death. Stefan Nemanjić wrote down the same legend in 1216 in his hagiography of his father, Stefan Nemanja. John Staurakios, who compiled the legends of Saint Demetrius in the late 13th century, recorded that a man riding on a white horse struck Kaloyan with a lance. Kaloyan, continued Staurakios, associated the attacker with Manastras, the commander of his mercenaries, who thus had to flee before Kaloyan's death. The legend was depicted on the walls of more than five Orthodox churches and monasteries. For instance, a fresco in the Decani Monastery depicts Saint Demetrius slaying Tsar Skaloyan. The contradictory records of Kaloyan's death gave rise to multiple scholarly theories, many of them accepting that he was murdered. Madgearu says Kaloyan was actually murdered by Manastras, who had most probably been hired by Kaloyan's wife and nephew, Boril. Historians Genoveva Cankova-Petkova and Francesco Dall'Aglia also write that Manastras killed Kaloyan, but they assume that the Greeks had persuaded him to turn against the tsar. Grave The location of Kaloyan's grave is unknown. According to the late 13th-century version of the Life of Saint Sava of Serbia, Kaloyan's body was embalmed and delivered to Tarnovo. However, the older version of the same legend, recorded in 1254, does not mention this episode. A golden ring, which was found in a grave near the Church of the Holy Forty Martyrs in Tarnovo in 1972, bears the Cyrillic inscription Kaloianov prăsten ("Kaloyan's ring"). Historian Ivan Dujčev stated that the ring proved that Kaloyan's remains were transferred to the church, which was built in 1230. The identification of the grave as Kaloyan's burial place is controversial, because the ring bearing his name cannot be dated to before the 14th century. Furthermore, the graves of all other royals who were buried in the same place are located within the church, suggesting that the ring was not owned by Kaloyan, but by one of his 14th-century namesakes. Based on the skull found in the same grave and associated with Kaloyan, anthropologist Jordan Jordanov reconstructed Kaloyan's face. Family Kaloyan's wife was a Cuman princess. She gave birth to Kaloyan's only known daughter (whose name is unknown). According to gossip recorded by Alberic of Trois-Fontaines, Kaloyan's wife tried to seduce the Latin Emperor Baldwin who had been imprisoned in Tarnovo. However, the gossip continued, Baldwin refused her, for which she accused him of having tried to seduce her. Outraged by his wife's claim, Kaloyan had Baldwin executed and fed his corpse to the dogs. Based on the story of Potiphar and his wife, the rumour is obviously unreliable, according to Madgearu. After Kaloyan's death, his widow married his successor, Boril. Boril gave Kaloyan's daughter in marriage to the Latin Emperor Henry in 1211. See also Kaloyan Nunatak Notes References Sources Primary sources George Akropolites: The History (Translated with and Introduction and Commentary by Ruth Macrides) (2007). Oxford University Press. . O City of Byzantium, Annals of Niketas Choniatēs (Translated by Harry J. Magoulias) (1984). Wayne State University Press. . The Conquest of Constantinople: Robert of Clari (Translated with introduction and notes by Edgar Holmes McNeal) (1996). Columbia University Press. . Secondary sources External links Villehardouin's account of the Fourth Crusade |- 1207 deaths 13th-century murdered monarchs 12th-century Bulgarian tsars 13th-century Bulgarian tsars Murdered Bulgarian monarchs Christians of the Fourth Crusade Eastern Orthodox monarchs Asen dynasty Bulgarian people of the Byzantine–Bulgarian Wars
YK or yk may refer to: Places Yellowknife, Northwest Territories, the capital of the Northwest Territories of Canada Yogyakarta, a city in Indonesia Yogyakarta railway station, a railway station in Yogyakarta (station code YK) Yukon, a territory in Canada (with any casing, within internet TLD .CA, and as YK for an unofficial postal abbreviation) In business IATA airline codes: YK, former code for Cyprus Turkish Airlines (defunct since June 2010) Avia Traffic Company of Kyrgyzstan (starting between June 2010 and end of 2015) Yugen kaisha, a form of business organization in Japan Other uses Yom Kippur, a Jewish Day of Atonement Yottakelvin, a measure of temperature equal to 1 septillion kelvin, or 1000000000000000000000000K
```javascript import { getLogger } from '@jitsi/logger'; import $ from 'jquery'; import { $iq } from 'strophe.js'; import ConnectionPlugin from './ConnectionPlugin'; const logger = getLogger(__filename); const RAYO_XMLNS = 'urn:xmpp:rayo:1'; /** * */ export default class RayoConnectionPlugin extends ConnectionPlugin { /** * * @param connection */ init(connection) { super.init(connection); this.connection.addHandler( this.onRayo.bind(this), RAYO_XMLNS, 'iq', 'set', null, null); } /** * * @param iq */ onRayo(iq) { logger.info('Rayo IQ', iq); } /* eslint-disable max-params */ /** * * @param to * @param from * @param roomName * @param roomPass * @param focusMucJid */ dial(to, from, roomName, roomPass, focusMucJid) { return new Promise((resolve, reject) => { if (!focusMucJid) { reject(new Error('Internal error!')); return; } const req = $iq({ type: 'set', to: focusMucJid }); req.c('dial', { xmlns: RAYO_XMLNS, to, from }); req.c('header', { name: 'JvbRoomName', value: roomName }).up(); if (roomPass && roomPass.length) { req.c('header', { name: 'JvbRoomPassword', value: roomPass }).up(); } this.connection.sendIQ( req, result => { logger.info('Dial result ', result); // eslint-disable-next-line newline-per-chained-call const resource = $(result).find('ref').attr('uri'); this.callResource = resource.substr('xmpp:'.length); logger.info(`Received call resource: ${this.callResource}`); resolve(); }, error => { logger.info('Dial error ', error); reject(error); }); }); } /* eslint-enable max-params */ /** * */ hangup() { return new Promise((resolve, reject) => { if (!this.callResource) { reject(new Error('No call in progress')); logger.warn('No call in progress'); return; } const req = $iq({ type: 'set', to: this.callResource }); req.c('hangup', { xmlns: RAYO_XMLNS }); this.connection.sendIQ(req, result => { logger.info('Hangup result ', result); this.callResource = null; resolve(); }, error => { logger.info('Hangup error ', error); this.callResource = null; reject(new Error('Hangup error ')); }); }); } } ```
```smalltalk using SixLabors.ImageSharp.Formats.Tiff; using SixLabors.ImageSharp.Formats.Tiff.PhotometricInterpretation; using SixLabors.ImageSharp.PixelFormats; namespace SixLabors.ImageSharp.Tests.Formats.Tiff.PhotometricInterpretation; [Trait("Format", "Tiff")] public class BlackIsZeroTiffColorTests : PhotometricInterpretationTestBase { private static readonly Rgba32 Gray000 = new(0, 0, 0, 255); private static readonly Rgba32 Gray128 = new(128, 128, 128, 255); private static readonly Rgba32 Gray255 = new(255, 255, 255, 255); private static readonly Rgba32 Gray0 = new(0, 0, 0, 255); private static readonly Rgba32 Gray8 = new(136, 136, 136, 255); private static readonly Rgba32 GrayF = new(255, 255, 255, 255); private static readonly Rgba32 Bit0 = new(0, 0, 0, 255); private static readonly Rgba32 Bit1 = new(255, 255, 255, 255); private static readonly byte[] BilevelBytes4X4 = { 0b01010000, 0b11110000, 0b01110000, 0b10010000 }; private static readonly Rgba32[][] BilevelResult4X4 = { new[] { Bit0, Bit1, Bit0, Bit1 }, new[] { Bit1, Bit1, Bit1, Bit1 }, new[] { Bit0, Bit1, Bit1, Bit1 }, new[] { Bit1, Bit0, Bit0, Bit1 } }; private static readonly byte[] BilevelBytes12X4 = { 0b01010101, 0b01010000, 0b11111111, 0b11111111, 0b01101001, 0b10100000, 0b10010000, 0b01100000 }; private static readonly Rgba32[][] BilevelResult12X4 = { new[] { Bit0, Bit1, Bit0, Bit1, Bit0, Bit1, Bit0, Bit1, Bit0, Bit1, Bit0, Bit1 }, new[] { Bit1, Bit1, Bit1, Bit1, Bit1, Bit1, Bit1, Bit1, Bit1, Bit1, Bit1, Bit1 }, new[] { Bit0, Bit1, Bit1, Bit0, Bit1, Bit0, Bit0, Bit1, Bit1, Bit0, Bit1, Bit0 }, new[] { Bit1, Bit0, Bit0, Bit1, Bit0, Bit0, Bit0, Bit0, Bit0, Bit1, Bit1, Bit0 } }; private static readonly byte[] Grayscale4Bytes4X4 = { 0x8F, 0x0F, 0xFF, 0xFF, 0x08, 0x8F, 0xF0, 0xF8 }; private static readonly Rgba32[][] Grayscale4Result4X4 = { new[] { Gray8, GrayF, Gray0, GrayF }, new[] { GrayF, GrayF, GrayF, GrayF }, new[] { Gray0, Gray8, Gray8, GrayF }, new[] { GrayF, Gray0, GrayF, Gray8 } }; private static readonly byte[] Grayscale4Bytes3X4 = { 0x8F, 0x00, 0xFF, 0xF0, 0x08, 0x80, 0xF0, 0xF0 }; private static readonly Rgba32[][] Grayscale4Result3X4 = { new[] { Gray8, GrayF, Gray0 }, new[] { GrayF, GrayF, GrayF }, new[] { Gray0, Gray8, Gray8 }, new[] { GrayF, Gray0, GrayF } }; private static readonly byte[] Grayscale8Bytes4X4 = { 128, 255, 000, 255, 255, 255, 255, 255, 000, 128, 128, 255, 255, 000, 255, 128 }; private static readonly Rgba32[][] Grayscale8Result4X4 = { new[] { Gray128, Gray255, Gray000, Gray255 }, new[] { Gray255, Gray255, Gray255, Gray255 }, new[] { Gray000, Gray128, Gray128, Gray255 }, new[] { Gray255, Gray000, Gray255, Gray128 } }; public static IEnumerable<object[]> BilevelData { get { yield return new object[] { BilevelBytes4X4, 1, 0, 0, 4, 4, BilevelResult4X4 }; yield return new object[] { BilevelBytes4X4, 1, 0, 0, 4, 4, Offset(BilevelResult4X4, 0, 0, 6, 6) }; yield return new object[] { BilevelBytes4X4, 1, 1, 0, 4, 4, Offset(BilevelResult4X4, 1, 0, 6, 6) }; yield return new object[] { BilevelBytes4X4, 1, 0, 1, 4, 4, Offset(BilevelResult4X4, 0, 1, 6, 6) }; yield return new object[] { BilevelBytes4X4, 1, 1, 1, 4, 4, Offset(BilevelResult4X4, 1, 1, 6, 6) }; yield return new object[] { BilevelBytes12X4, 1, 0, 0, 12, 4, BilevelResult12X4 }; yield return new object[] { BilevelBytes12X4, 1, 0, 0, 12, 4, Offset(BilevelResult12X4, 0, 0, 18, 6) }; yield return new object[] { BilevelBytes12X4, 1, 1, 0, 12, 4, Offset(BilevelResult12X4, 1, 0, 18, 6) }; yield return new object[] { BilevelBytes12X4, 1, 0, 1, 12, 4, Offset(BilevelResult12X4, 0, 1, 18, 6) }; yield return new object[] { BilevelBytes12X4, 1, 1, 1, 12, 4, Offset(BilevelResult12X4, 1, 1, 18, 6) }; } } public static IEnumerable<object[]> Grayscale4_Data { get { yield return new object[] { Grayscale4Bytes4X4, 4, 0, 0, 4, 4, Grayscale4Result4X4 }; yield return new object[] { Grayscale4Bytes4X4, 4, 0, 0, 4, 4, Offset(Grayscale4Result4X4, 0, 0, 6, 6) }; yield return new object[] { Grayscale4Bytes4X4, 4, 1, 0, 4, 4, Offset(Grayscale4Result4X4, 1, 0, 6, 6) }; yield return new object[] { Grayscale4Bytes4X4, 4, 0, 1, 4, 4, Offset(Grayscale4Result4X4, 0, 1, 6, 6) }; yield return new object[] { Grayscale4Bytes4X4, 4, 1, 1, 4, 4, Offset(Grayscale4Result4X4, 1, 1, 6, 6) }; yield return new object[] { Grayscale4Bytes3X4, 4, 0, 0, 3, 4, Grayscale4Result3X4 }; yield return new object[] { Grayscale4Bytes3X4, 4, 0, 0, 3, 4, Offset(Grayscale4Result3X4, 0, 0, 6, 6) }; yield return new object[] { Grayscale4Bytes3X4, 4, 1, 0, 3, 4, Offset(Grayscale4Result3X4, 1, 0, 6, 6) }; yield return new object[] { Grayscale4Bytes3X4, 4, 0, 1, 3, 4, Offset(Grayscale4Result3X4, 0, 1, 6, 6) }; yield return new object[] { Grayscale4Bytes3X4, 4, 1, 1, 3, 4, Offset(Grayscale4Result3X4, 1, 1, 6, 6) }; } } public static IEnumerable<object[]> Grayscale8_Data { get { yield return new object[] { Grayscale8Bytes4X4, 8, 0, 0, 4, 4, Grayscale8Result4X4 }; yield return new object[] { Grayscale8Bytes4X4, 8, 0, 0, 4, 4, Offset(Grayscale8Result4X4, 0, 0, 6, 6) }; yield return new object[] { Grayscale8Bytes4X4, 8, 1, 0, 4, 4, Offset(Grayscale8Result4X4, 1, 0, 6, 6) }; yield return new object[] { Grayscale8Bytes4X4, 8, 0, 1, 4, 4, Offset(Grayscale8Result4X4, 0, 1, 6, 6) }; yield return new object[] { Grayscale8Bytes4X4, 8, 1, 1, 4, 4, Offset(Grayscale8Result4X4, 1, 1, 6, 6) }; } } [Theory] [MemberData(nameof(BilevelData))] [MemberData(nameof(Grayscale4_Data))] [MemberData(nameof(Grayscale8_Data))] public void Decode_WritesPixelData(byte[] inputData, ushort bitsPerSample, int left, int top, int width, int height, Rgba32[][] expectedResult) => AssertDecode( expectedResult, pixels => new BlackIsZeroTiffColor<Rgba32>(new TiffBitsPerSample(bitsPerSample, 0, 0)).Decode(inputData, pixels, left, top, width, height)); [Theory] [MemberData(nameof(BilevelData))] public void Decode_WritesPixelData_Bilevel(byte[] inputData, int bitsPerSample, int left, int top, int width, int height, Rgba32[][] expectedResult) => AssertDecode(expectedResult, pixels => new BlackIsZero1TiffColor<Rgba32>().Decode(inputData, pixels, left, top, width, height)); [Theory] [MemberData(nameof(Grayscale4_Data))] public void Decode_WritesPixelData_4Bit(byte[] inputData, int bitsPerSample, int left, int top, int width, int height, Rgba32[][] expectedResult) => AssertDecode( expectedResult, pixels => new BlackIsZero4TiffColor<Rgba32>().Decode(inputData, pixels, left, top, width, height)); [Theory] [MemberData(nameof(Grayscale8_Data))] public void Decode_WritesPixelData_8Bit(byte[] inputData, int bitsPerSample, int left, int top, int width, int height, Rgba32[][] expectedResult) => AssertDecode(expectedResult, pixels => new BlackIsZero8TiffColor<Rgba32>(Configuration.Default).Decode(inputData, pixels, left, top, width, height)); } ```
Reymond Amsalem (, born 19 July 1978) is an Israeli actress. She has appeared in more than 20 films since 2003, and was born in Jerusalem to a family of Moroccan Jews. Selected filmography External links 1978 births Living people Israeli people of Moroccan-Jewish descent Israeli film actresses Israeli television actresses Israeli Mizrahi Jews
```xml import { Checkbox, Input, InputNumber, Radio, Switch } from 'antd'; import generatePicker from 'antd/es/date-picker/generatePicker/index.js'; import type { Dayjs } from 'dayjs'; import dayjs from 'dayjs'; import * as React from 'react'; import type { ValueEditorProps } from 'react-querybuilder'; import { getFirstOption, joinWith, standardClassnames, useValueEditor } from 'react-querybuilder'; import dayjsGenerateConfig from './dayjs'; // eslint-disable-next-line @typescript-eslint/no-explicit-any type AntDValueEditorProps = ValueEditorProps & { extraProps?: Record<string, any> }; const DatePicker = generatePicker(dayjsGenerateConfig); export const AntDValueEditor = (allProps: AntDValueEditorProps) => { const { fieldData, operator, value, handleOnChange, title, className, type, inputType, values = [], listsAsArrays, parseNumbers, separator, valueSource: _vs, disabled, testID, selectorComponent: SelectorComponent = allProps.schema.controls.valueSelector, extraProps, ...props } = allProps; const { valueAsArray, multiValueHandler } = useValueEditor({ handleOnChange, inputType, operator, value, type, listsAsArrays, parseNumbers, values, }); if (operator === 'null' || operator === 'notNull') { return null; } const placeHolderText = fieldData?.placeholder ?? ''; const inputTypeCoerced = ['in', 'notIn'].includes(operator) ? 'text' : inputType || 'text'; if ( (operator === 'between' || operator === 'notBetween') && (type === 'select' || type === 'text') && // Date ranges are handled differently in AntD--see below inputTypeCoerced !== 'date' && inputTypeCoerced !== 'datetime-local' ) { const editors = ['from', 'to'].map((key, i) => { if (type === 'text') { if (inputTypeCoerced === 'time') { return ( <DatePicker.TimePicker key={key} value={valueAsArray[i] ? dayjs(valueAsArray[i], 'HH:mm:ss') : null} className={standardClassnames.valueListItem} disabled={disabled} placeholder={placeHolderText} onChange={d => multiValueHandler(d?.format('HH:mm:ss') ?? '', i)} {...extraProps} /> ); } else if (inputTypeCoerced === 'number') { return ( <InputNumber key={key} type={inputTypeCoerced} value={valueAsArray[i] ?? ''} className={standardClassnames.valueListItem} disabled={disabled} placeholder={placeHolderText} onChange={v => multiValueHandler(v, i)} {...extraProps} /> ); } return ( <Input key={key} type={inputTypeCoerced} value={valueAsArray[i] ?? ''} className={standardClassnames.valueListItem} disabled={disabled} placeholder={placeHolderText} onChange={e => multiValueHandler(e.target.value, i)} {...extraProps} /> ); } return ( <SelectorComponent {...props} key={key} className={standardClassnames.valueListItem} handleOnChange={v => multiValueHandler(v, i)} disabled={disabled} value={valueAsArray[i] ?? getFirstOption(values)} options={values} listsAsArrays={listsAsArrays} /> ); }); return ( <span data-testid={testID} className={className} title={title}> {editors[0]} {separator} {editors[1]} </span> ); } switch (type) { case 'select': case 'multiselect': return ( <SelectorComponent {...props} className={className} handleOnChange={handleOnChange} options={values} value={value} title={title} disabled={disabled} multiple={type === 'multiselect'} listsAsArrays={listsAsArrays} {...extraProps} /> ); case 'textarea': return ( <Input.TextArea value={value} title={title} className={className} disabled={disabled} placeholder={placeHolderText} onChange={e => handleOnChange(e.target.value)} {...extraProps} /> ); case 'switch': return ( <Switch checked={!!value} title={title} className={className} disabled={disabled} onChange={v => handleOnChange(v)} {...extraProps} /> ); case 'checkbox': return ( <span title={title} className={className}> <Checkbox type="checkbox" disabled={disabled} onChange={e => handleOnChange(e.target.checked)} checked={!!value} {...extraProps} /> </span> ); case 'radio': return ( <span className={className} title={title}> {values.map(v => ( <Radio key={v.name} value={v.name} checked={value === v.name} disabled={disabled} onChange={e => handleOnChange(e.target.value)} {...extraProps}> {v.label} </Radio> ))} </span> ); } switch (inputTypeCoerced) { case 'date': case 'datetime-local': { if (operator === 'between' || operator === 'notBetween') { const dayjsArray = valueAsArray.slice(0, 2).map(dayjs) as [Dayjs, Dayjs]; return ( <DatePicker.RangePicker value={dayjsArray.every(d => d.isValid()) ? dayjsArray : undefined} showTime={inputTypeCoerced === 'datetime-local'} className={className} disabled={disabled} placeholder={[placeHolderText, placeHolderText]} // TODO: the function below is currently untested (see the // "should render a date range picker" test in ./AntD.test.tsx) onChange={ /* istanbul ignore next */ dates => { const timeFormat = inputTypeCoerced === 'datetime-local' ? 'THH:mm:ss' : ''; const format = `YYYY-MM-DD${timeFormat}`; const dateArray = dates?.map(d => (d?.isValid() ? d.format(format) : undefined)); handleOnChange( dateArray ? (listsAsArrays ? dateArray : joinWith(dateArray, ',')) : dates ); } } {...extraProps} /> ); } const dateValue = dayjs(value); return ( <DatePicker value={dateValue.isValid() ? dateValue : undefined} showTime={inputTypeCoerced === 'datetime-local'} className={className} disabled={disabled} placeholder={placeHolderText} onChange={(_d, dateString) => handleOnChange(dateString)} {...extraProps} /> ); } case 'time': { const dateValue = dayjs(value, 'HH:mm:ss'); return ( <DatePicker.TimePicker value={dateValue.isValid() ? dateValue : undefined} className={className} disabled={disabled} placeholder={placeHolderText} onChange={d => handleOnChange(d?.format('HH:mm:ss') ?? '')} {...extraProps} /> ); } case 'number': { return ( <InputNumber type={inputTypeCoerced} value={value} title={title} className={className} disabled={disabled} placeholder={placeHolderText} onChange={handleOnChange} {...extraProps} /> ); } } return ( <Input type={inputTypeCoerced} value={value} title={title} className={className} disabled={disabled} placeholder={placeHolderText} onChange={e => handleOnChange(e.target.value)} {...extraProps} /> ); }; ```
Gastropacha sikkima is a moth in the family Lasiocampidae. It is found in India (Darjeeling, Sikkim), northern Thailand, Laos and Taiwan. References Lasiocampidae Moths described in 1879 Moths of Asia Moths of Taiwan
```c++ // Add extra initialization here. // Add 20 items to the combo box. The Resource Editor // has already been used to set the style of the combo // box to CBS_SORT. CString str; for (int i = 1; i <= 20; i++) { str.Format(_T("Item %2d"), i); m_combobox.AddString(str); } // Set the minimum visible item m_combobox.SetMinVisibleItems(10); // Set the cue banner m_combobox.SetCueBanner(_T("Select an item...")); // End of extra initialization. ```
```c++ /// Source : path_to_url /// Author : liuyubobobo /// Time : 2019-09-07 #include <iostream> #include <vector> #include <map> #include <set> using namespace std; /// Memory Search /// Time Complexity: O(n*m*logm) /// Space Complexity: O(n*m) class Solution { private: int MAX; public: int makeArrayIncreasing(vector<int>& arr1, vector<int>& arr2) { set<int> set; for(int e: arr2) set.insert(e); arr2 = vector<int>(set.begin(), set.end()); MAX = arr2.size() + 1; vector<vector<int>> dp(arr1.size(), vector<int>(arr2.size() + 1, -1)); int res = go(arr1, arr2, 0, 0, dp); for(int j = 0; j < arr2.size(); j ++) res = min(res, (arr1[0] != arr2[0]) + go(arr1, arr2, 0, j + 1, dp)); return res >= MAX ? -1 : res; } private: int go(const vector<int>& arr1, const vector<int>& arr2, int i, int j, vector<vector<int>>& dp){ if(i + 1 == arr1.size()) return 0; if(dp[i][j] != -1) return dp[i][j]; int last = j == 0 ? arr1[i] : arr2[j - 1]; int res = MAX; if(arr1[i + 1] > last) res = min(res, go(arr1, arr2, i + 1, 0, dp)); vector<int>::const_iterator iter = upper_bound(arr2.begin(), arr2.end(), last); if(iter != arr2.end()){ int jj = iter - arr2.begin(); res = min(res, 1 + go(arr1, arr2, i + 1, jj + 1, dp)); } return dp[i][j] = res; } }; int main() { vector<int> a1 = {1, 5, 3, 6, 7}, b1 = {1, 3, 2, 4}; cout << Solution().makeArrayIncreasing(a1, b1) << endl; // 1 vector<int> a2 = {1, 5, 3, 6, 7}, b2 = {4, 3, 1}; cout << Solution().makeArrayIncreasing(a2, b2) << endl; // 2 vector<int> a3 = {1, 5, 3, 6, 7}, b3 = {1, 6, 3, 3}; cout << Solution().makeArrayIncreasing(a3, b3) << endl; // -1 return 0; } ```
Guan Xing ( third century), courtesy name Anguo, was an official of the state of Shu Han in the Three Kingdoms period of China. History He was the second son of Guan Yu and a younger brother of Guan Ping. Little information about Guan Xing is found in historical records. The biography of Guan Yu in the Records of the Three Kingdoms contains only a few lines on Guan Xing. In his youth, Guan Xing was knowledgeable, and Zhuge Liang saw him as an exceptional talent. When he reached adulthood (around 19 years old), he served as an official in Shu Han, but died some years later. Guan Xing held the peerage of the Marquis of Hanshou Village (漢壽亭侯), which he inherited from his father. His cause of death was not documented. He had two known sons – Guan Tong (關統) and Guan Yi (關彝). Guan Xing appears as a character in the 14th-century historical novel Romance of the Three Kingdoms, in which he plays a significant role after the death of his father. In Romance of the Three Kingdoms Guan Xing plays a significant role in the 14th-century historical novel Romance of the Three Kingdoms, which romanticises the historical events before and during the Three Kingdoms period of China. In Chapter 81, Guan Xing competes with Zhang Bao, Zhang Fei's son, for the position of leading the vanguard force just before the Battle of Yiling. However, Liu Bei stops them and orders them to become oath brothers in the same manner he did with their fathers many years ago. The two of them then join Wu Ban, who leads the vanguard force into battle. In Chapter 83, Guan Xing slays Pan Zhang, the Wu general who captured his father during the Wu invasion of Jing Province, and retrieves his father's weapon, the Green Dragon Crescent Blade. Later, he executes Mi Fang and Fu Shiren before an altar dedicated to Guan Yu. In Chapter 91, Guan Xing serves as Commander of the Left Guard (帳前左護衛使) and Prancing Dragon General (龍驤將軍) in the Shu army. He follows Zhuge Liang on the Northern Expeditions against Shu's rival state Wei. He dies of illness in Chapter 102. In popular culture Guan Xing is first introduced as a playable character in the eighth instalment of Koei's Dynasty Warriors video game series. Guan Xing's appointment and the Northern Expeditions are depicted in the 2008 film Three Kingdoms: Resurrection of the Dragon. See also Lists of people of the Three Kingdoms References Chen, Shou (3rd century). Records of the Three Kingdoms (Sanguozhi). Luo, Guanzhong (14th century). Romance of the Three Kingdoms (Sanguo Yanyi). Shu Han generals Shu Han government officials 3rd-century deaths Year of birth unknown Guan Yu
```javascript Weak vs Strict equality operator Types of numbers Using assignment operators Double and single quotes Infinity ```
Marco Tulio Ciani Barillas (born March 7, 1987, in Guatemala City, Guatemala) is a Guatemalan footballer currently playing for San Marcos de Arica. Club career San Marcos de Arica (2014–present) Ciani was signed by SM Arica in June 2014. He made his debut on July 19 in the season opener against Colo Colo, coming off the bench for Kevin Harbottle. Career statistics References 1987 births Living people Guatemalan men's footballers Guatemalan expatriate men's footballers Universidad SC players Comunicaciones F.C. players Club Xelajú MC players C.S.D. Municipal players San Marcos de Arica footballers Chilean Primera División players Expatriate men's footballers in Chile Men's association football midfielders Guatemala men's international footballers
Parker Bridge is a truss bridge in the city of Parker, Pennsylvania in the United States. The bridge, constructed in 1934, carries motor vehicles and pedestrians over the Allegheny River. The Parker Bridge is a variation of the Pratt truss bridge, a design invented by the late Charles H. Parker in the 20th century. See also List of crossings of the Allegheny River External links Webpage dedicated to the Parker Bridge and other historic bridges Bridges over the Allegheny River Truss bridges in the United States Bridges completed in 1934 Bridges in Armstrong County, Pennsylvania Road bridges in Pennsylvania Steel bridges in the United States 1934 establishments in Pennsylvania
Motionless in White is an American metalcore band. The discography of the group consists of six full-length albums, two EPs and one demo album. The group is known to combine the metalcore musical style with industrial and gothic influences. The band recorded their demo in 2005 as a four-piece band, and released their debut EP, The Whorror under small independent label, Masquerade Recordings in 2007 when the group achieved a six-member line-up. During the EP recording of When Love Met Destruction, the band signed to Fearless Records where they released their major label debut, Creatures afterward in 2010. The band released their second studio album, Infamous, on November 13, 2012. The band released their third studio album Reincarnate on September 16, 2014. The band signed to Roadrunner Records where they released their fourth studio album Graveyard Shift on May 5, 2017. Their fifth album Disguise was released on June 7, 2019. Their recent album Scoring the End of the World was released on June 10, 2022. Albums Studio albums Demos Extended plays Singles Promotional singles Non-album tracks Music videos References Discography Heavy metal group discographies Discographies of American artists
```smalltalk using System.Threading.Tasks; namespace AspectCore.DynamicProxy { [NonAspect] public interface IAspectActivator { TResult Invoke<TResult>(AspectActivatorContext activatorContext); Task<TResult> InvokeTask<TResult>(AspectActivatorContext activatorContext); ValueTask<TResult> InvokeValueTask<TResult>(AspectActivatorContext activatorContext); } } ```
```c++ // // gettsc.inl // // gives access to the Pentium's (secret) cycle counter // // This software was written by Leonard Janke (janke@unixg.ubc.ca) // in 1996-7 and is entered, by him, into the public domain. #if defined(__WATCOMC__) void GetTSC(unsigned long&); #pragma aux GetTSC = 0x0f 0x31 "mov [edi], eax" parm [edi] modify [edx eax]; #elif defined(__GNUC__) inline void GetTSC(unsigned long& tsc) { asm volatile(".byte 15, 49\n\t" : "=eax" (tsc) : : "%edx", "%eax"); } #elif defined(_MSC_VER) inline void GetTSC(unsigned long& tsc) { unsigned long a; __asm _emit 0fh __asm _emit 31h __asm mov a, eax; tsc=a; } #endif #include <stdio.h> #include <stdlib.h> #include <openssl/rc4.h> void main(int argc,char *argv[]) { unsigned char buffer[1024]; RC4_KEY ctx; unsigned long s1,s2,e1,e2; unsigned char k[16]; unsigned long data[2]; unsigned char iv[8]; int i,num=64,numm; int j=0; if (argc >= 2) num=atoi(argv[1]); if (num == 0) num=256; if (num > 1024-16) num=1024-16; numm=num+8; for (j=0; j<6; j++) { for (i=0; i<10; i++) /**/ { RC4(&ctx,numm,buffer,buffer); GetTSC(s1); RC4(&ctx,numm,buffer,buffer); GetTSC(e1); GetTSC(s2); RC4(&ctx,num,buffer,buffer); GetTSC(e2); RC4(&ctx,num,buffer,buffer); } printf("RC4 (%d bytes) %d %d (%d) - 8 bytes\n",num, e1-s1,e2-s2,(e1-s1)-(e2-s2)); } } ```
Ha Lachma Anya ("This is the bread of affliction") is a declaration that is recited at the beginning of the Magid portion of the Passover Seder. Written in Aramaic, the recitation serves as the first explanation of the purpose of the matzo during the Seder. History Although portions of the Haggadah quote the Torah, scholars trace the origins of the Haggadah to the Talmudic era. Specifically, scholars have identified two major versions of early Haggadot: an Eretz Yisrael version and a Babylonian version. Modern Haggadot are based on the Babylonian version, the earliest complete copies of which are found in the siddurim of Rabbis Amram Gaon and Saadia Gaon. Over time, Ashkenazic, Sephardic, and Mizrahi "sub-versions" developed; however, "there is relatively little difference in the basic text of the Haggadah within the descendants of the Babylonian versions". According to Rabbi Yaakov Lorberbaum's Ma'aseh Nissim, Ha Lachma Anya was first recited after the destruction of the Second Temple in Jerusalem; according to Maimonides, Ha Lachma Anya was not recited before the Temple was destroyed. Shibbolei ha-Leket states that Ha Lachma Anya was instituted in Israel, while the Malbim and Ra'avyah trace the origins to Babylon. David Arnow notes that some sources state that Ha Lachma Anya originated during the Gaonic period (circa 750-1038 CE), while others trace it back as far as the first or second century CE. Some medieval Haggadot added the phrase "we left Egypt hastily" (biv'hilu yatsanu m'mitsrayim) at the beginning of Ha Lachma Anya. Some Haggadot say K'Ha Lachma or Ha K'Lachma, "This is like the bread of affliction", to indicate that the matzah at the Seder is only a replica of that which was eaten by the Israelites in Egypt. Professor David Daube suggests that the wording, “This is the bread” might be misread as a hint of the Christian doctrine of transubstantiation, so some texts altered it to “This is like the bread”. Procedure During the Magid portion of the Passover Seder, participants retell the story of the Exodus from Egypt. The Magid begins with the uncovering and lifting of the matzah on the Seder table and the recitation of Ha Lachma Anya. The words Ha Lachma Anya are written in Aramaic, and it begins with the proclamation that "this is the bread of affliction that our ancestors ate in Egypt". This recitation is based on Deuteronomy 16:3, which states that "[y]ou shall eat unleavened bread, bread of 'ani' (distress) — for you departed from the land of Egypt hurriedly", and the recitation serves as "the first official explanation for matzah in the Hagaddah". Invitation to guests Abravanel teaches that Ha Lachma Anya should be recited at the entrance to the house, with the door open, so that paupers can hear the invitation and enter". Sol Scharfstein also notes that in times past, the head of the household would go out to the street to say Ha Lachma Anya, thus inviting poor people to join him at the Seder. Modern interpretations Anisfeld, Mohr, and Spector have suggested that Ha Lachma Anya adds "a sense of immediacy and urgency to our telling" of the story of the Exodus, and that the recitation "establishes the intimacy of our connection to the ancient Israelites" because participants in the Seder will "eat the same bread they ate" and will "experience the taste and texture of their lives as slaves". Zion and Dishon have also suggested that the reference to matzah in Ha Lachma Anya "is a memorial not of liberation, but of slavery". Isaacs and Scharfstein have also stated that the process of beginning the Magid by looking at matzah "is a visual reminder of events in Egypt" and that the Ha Lachma Anya "also stresses the importance of opening one's house to the poor and sharing one's meals with them, because it is through such generosity that one can aspire to redemption". Full text Gallery See also Afikoman Ma Nishtana References Citations Bibliography Matzo Passover Haggadah of Pesach Aramaic words and phrases Aramaic words and phrases in Jewish prayers and blessings
```yaml commonfields: id: ConvertToSingleElementArray version: -1 name: ConvertToSingleElementArray script: '' type: python tags: - transformer - entirelist comment: Converts a single string to an array of that string. enabled: true args: - name: value default: true description: The string to convert to an array of that string. isArray: true scripttarget: 0 subtype: python3 runas: DBotWeakRole fromversion: 5.0.0 tests: - No tests (auto formatted) dockerimage: demisto/python3:3.10.13.83255 ```
Melanoplus ponderosus, the ponderous spur-throat grasshopper, is a species of spur-throated grasshopper in the family Acrididae. It is found in North America. Subspecies These two subspecies belong to the species Melanoplus ponderosus: Melanoplus ponderosus ponderosus (Scudder, 1875) i Melanoplus ponderosus viola Thomas, 1876 i Data sources: i = ITIS, c = Catalogue of Life, g = GBIF, b = Bugguide.net References External links Melanoplinae Articles created by Qbugbot Insects described in 1875
The Indonesia national futsal team (Indonesian: Tim nasional futsal Indonesia) represents Indonesia in international futsal competitions. Indonesia has played fourteen times at the AFF Futsal Championship and nine times at the AFC Futsal Asian Cup. The team never participates in any World Cup but has won the AFF Futsal Championship only once in 2010. While under the ultimate control of Indonesia's football governing body, PSSI, the one who regulates the activities of the national futsal team is the Indonesia Futsal Federation—futsal governing body of Indonesia and a member association of PSSI. History The history of futsal has been around for a long time in Indonesia. The journey of futsal started in 1998–1999, But it was in 2002 that futsal was officially recognized in Indonesia when this country was asked to host the AFC final round of futsal championships in Jakarta by the AFC. Although relatively new, this sport is quite often found in various regions. This can be seen from the number of futsal fields that have been built in many cities. The first futsal League competition in Indonesia was held in 2006 and called the Indonesia Futsal League (IFL) and the Liga Futsal Wanita Indonesia (LFWI) was held in 2012. But in 2015, IFL changed its name to Indonesia Pro Futsal League (PFL) and LFWI changed the name to Women's Pro Futsal League (WPFL). There are several names that have contributed to the development of futsal in Indonesia. Names such as Wandy Batangtaris, a member of the FIFA Futsal Committee and the Ronny Pattinasarani are mentioned as pioneers and developers of futsal in Indonesia. And there is another one who is very serious about advancing futsal, namely Hary Tanoesoedibjo. Kit For most of the time, the Indonesian national futsal team used whatever kits that were being used by the Indonesia national football team. At the start of 2021, FFI decided to have their own kit supplier for all Indonesia futsal national teams. They chose Specs to be the kit supplier. Specs have been the official kit supplier of all Indonesia futsal national teams ever since, having provided four jerseys for the national teams with first releasing the home jersey on 5 April 2021. Specs released the white-colored away jersey on 24 May 2021. The green-colored third jersey was released on 2 August 2021. Right before the start of the 2022 AFC Futsal Asian Cup, Specs collaborated with Indonesian artist based in Bandung, Stereoflow, to release the street art-inspired fourth jersey on 24 May 2022 which was also intended to be used by Indonesia national amputee football (INAF) team for the 2022 Amputee Football World Cup. Results and fixtures The following is a list of match results in the last 12 months, as well as any future matches that have been scheduled. 2023 Coaching staff Current coaching staff Head coaches list Players Current squad The following 15 players were selected for the 2024 AFC Futsal Asian Cup qualification. Recent call-ups The following players have also been called up to the squad within the last 12 months. Notes PRE = Preliminary squad SUS = Suspended INJ = Withdrew from the roster due to an injury UNF = Withdrew from the roster due to unfit condition RET = Retired from the national team WD = Withdrew from the roster for non-injury related reasons Tournament records FIFA Futsal World Cup AFC Futsal Asian Cup Asian Indoor and Martial Arts Games AFF Futsal Championship Southeast Asian Games *Denotes draws include knockout matches decided on penalty kicks. **Red border color indicates tournament was held on home soil. Notable players Viernes Ricardo Polnaya Socrates "Caca" Matulessy Sayan Karmadi Denny Handoyo Ade Lesmana Yos Adi Wicaksono Jaelani Ladjanibi Vennard Hutabarat Andri Irawan David Sugianto All-time records . Honours Continental AFC Futsal Asian Cup Quarter-Final: 2022 Regional AFF Futsal Championship Champions (1): 2010 Runners-up: 2006, 2008, 2019, 2022 Third place: 2003, 2005, 2009, 2012, 2018 Fourth place: 2013, 2014 Southeast Asian Games Silver medal: 2021 Bronze medal: 2007, 2011, 2013 Fourth place: 2017 Other tournament CFA International Futsal Tournament Runner-up: 2016 MNC Cup Champions (1): 2022 Runners-up: 2019 See also Indonesia national under-20 futsal team Indonesia women's national futsal team Indonesia national football team Indonesia national beach soccer team References External links AFF Futsal Championship on RSSSF Official website National sports teams of Indonesia Asian national futsal teams National
```java /** * * * A Processing/Java library for high performance GPU-Computing (GLSL). * */ package com.thomasdiewald.pixelflow.java.fluid; import com.jogamp.opengl.GL2ES2; import com.thomasdiewald.pixelflow.java.DwPixelFlow; import com.thomasdiewald.pixelflow.java.dwgl.DwGLSLProgram; import com.thomasdiewald.pixelflow.java.dwgl.DwGLTexture; import processing.core.PConstants; import processing.core.PImage; import processing.opengl.PGraphics2D; public class DwFluidParticleSystem2D{ public DwGLSLProgram shader_particleInit ; public DwGLSLProgram shader_particleUpdate; public DwGLSLProgram shader_particleRender; public DwGLTexture.TexturePingPong tex_particles = new DwGLTexture.TexturePingPong(); public DwPixelFlow context; public int particles_x; public int particles_y; public Param param = new Param(); static public class Param{ public float dissipation = 0.8f; public float inertia = 0.2f; } public DwFluidParticleSystem2D(){ } public DwFluidParticleSystem2D(DwPixelFlow context, int num_particels_x, int num_particels_y){ context.papplet.registerMethod("dispose", this); this.resize(context, num_particels_x, num_particels_y); } public void dispose(){ release(); } public void release(){ tex_particles.release(); } public void resize(DwPixelFlow context_, int num_particels_x, int num_particels_y){ context = context_; context.begin(); release(); this.particles_x = num_particels_x; this.particles_y = num_particels_y; // System.out.println("ParticelSystem: size = "+particles_x+"/"+particles_y +" ("+particles_x*particles_y+" objects)"); String dir = DwPixelFlow.SHADER_DIR+"ParticleSystem/"; // create shader shader_particleInit = context.createShader(dir+"particleInit.frag"); shader_particleUpdate = context.createShader(dir+"particleUpdate.frag"); shader_particleRender = context.createShader(dir+"particleRender.glsl", dir+"particleRender.glsl"); shader_particleRender.vert.setDefine("SHADER_VERT", 1); shader_particleRender.frag.setDefine("SHADER_FRAG", 1); // allocate texture tex_particles.resize(context, GL2ES2.GL_RGBA32F, particles_x, particles_y, GL2ES2.GL_RGBA, GL2ES2.GL_FLOAT, GL2ES2.GL_NEAREST, 4, 4); tex_particles.src.clear(0); tex_particles.dst.clear(0); init(); context.end("ParticleSystem.resize"); } public void reset(){ init(); } public void init(){ context.begin(); context.beginDraw(tex_particles.dst); shader_particleInit.begin(); shader_particleInit.uniform2f("wh", particles_x, particles_y); shader_particleInit.drawFullScreenQuad(); shader_particleInit.end(); context.endDraw(); context.end("ParticleSystem.init"); tex_particles.swap(); } public void update(DwFluid2D fluid){ context.begin(); context.beginDraw(tex_particles.dst); shader_particleUpdate.begin(); shader_particleUpdate.uniform2f ("wh_fluid" , fluid.fluid_w, fluid.fluid_h); shader_particleUpdate.uniform2f ("wh_particles" , particles_x, particles_y); shader_particleUpdate.uniform1f ("timestep" , fluid.param.timestep); shader_particleUpdate.uniform1f ("rdx" , 1.0f / fluid.param.gridscale); shader_particleUpdate.uniform1f ("dissipation" , param.dissipation); shader_particleUpdate.uniform1f ("inertia" , param.inertia); shader_particleUpdate.uniformTexture("tex_particles", tex_particles.src); shader_particleUpdate.uniformTexture("tex_velocity" , fluid.tex_velocity.src); shader_particleUpdate.uniformTexture("tex_obstacles", fluid.tex_obstacleC.src); shader_particleUpdate.drawFullScreenQuad(); shader_particleUpdate.end(); context.endDraw(); context.end("ParticleSystem.update"); tex_particles.swap(); } public void render(PGraphics2D dst, PImage sprite, int display_mode){ int[] sprite_tex_handle = new int[1]; if(sprite != null){ sprite_tex_handle[0] = dst.getTexture(sprite).glName; } int w = dst.width; int h = dst.height; dst.beginDraw(); // dst.blendMode(PConstants.BLEND); dst.blendMode(PConstants.ADD); context.begin(); shader_particleRender.begin(); shader_particleRender.uniform2f ("wh_viewport", w, h); shader_particleRender.uniform2i ("num_particles", particles_x, particles_y); shader_particleRender.uniformTexture("tex_particles", tex_particles.src); shader_particleRender.uniformTexture("tex_sprite" , sprite_tex_handle[0]); shader_particleRender.uniform1i ("display_mode" , display_mode); // 0 ... 1px points, 1 = sprite texture, 2 ... falloff points shader_particleRender.drawFullScreenPoints(particles_x * particles_y); shader_particleRender.end(); context.end("ParticleSystem.render"); dst.endDraw(); } } ```
```scss @function inner-border-spread($width) { $top: top($width); $right: right($width); $bottom: bottom($width); $left: left($width); @return min(($top + $bottom) / 2, ($left + $right) / 2); } @function inner-border-hoff($width, $spread) { $left: left($width); $right: right($width); @if $right <= 0 { @return $left - $spread; } @else { @return $spread - $right; } } @function inner-border-voff($width, $spread) { $top: top($width); $bottom: bottom($width); @if $bottom <= 0 { @return $top - $spread; } @else { @return $spread - $bottom; } } @function even($number) { @return ceil($number / 2) == ($number / 2); } @function odd($number) { @return ceil($number / 2) != ($number / 2); } @function inner-border-usesingle-width($width) { $top: top($width); $right: right($width); $bottom: bottom($width); $left: left($width); @if $top == 0 { @if $left + $right == 0 { @return true; } @if $bottom >= $left + $right { @return true; } } @if $bottom == 0 { @if $left + $right == 0 { @return true; } @if $top >= $left + $right { @return true; } } @if $left == 0 { @if $top + $bottom == 0 { @return true; } @if $right >= $top + $bottom { @return true; } } @if $right == 0 { @if $top + $bottom == 0 { @return true; } @if $left >= $top + $bottom { @return true; } } @if $top + $bottom == $left + $right and even($top) == even($bottom) and even($left) == even($right) { @return true; } @return false; } @function inner-border-usesingle-color($color) { $top: top($color); $right: right($color); $bottom: bottom($color); $left: left($color); @if $top == $right == $bottom == $left { @return true; } @return false; } @function inner-border-usesingle($width, $color) { @if inner-border-usesingle-color($color) and inner-border-usesingle-width($width) { @return true; } @return false; } @mixin inner-border($width: 1px, $color: #fff, $blur: 0px) { @if max($width) == 0 { -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; } @else if inner-border-usesingle($width, $color) { $spread: inner-border-spread($width); $hoff: inner-border-hoff($width, $spread); $voff: inner-border-voff($width, $spread); @include single-box-shadow($color-top, $hoff, $voff, $blur, $spread, true); } @else { $width-top: top($width); $width-right: right($width); $width-bottom: bottom($width); $width-left: left($width); $color-top: top($color); $color-right: right($color); $color-bottom: bottom($color); $color-left: left($color); $shadow-top: false; $shadow-right: false; $shadow-bottom: false; $shadow-left: false; @if $width-top > 0 { $shadow-top: $color-top 0 $width-top $blur 0 inset; } @if $width-right > 0 { $shadow-right: $color-right (-1 * $width-right) 0 $blur 0 inset; } @if $width-bottom > 0 { $shadow-bottom: $color-bottom 0 (-1 * $width-bottom) $blur 0 inset; } @if $width-left > 0 { $shadow-left: $color-left $width-left 0 $blur 0 inset; } @include box-shadow($shadow-top, $shadow-bottom, $shadow-right, $shadow-left); } } ```
Islam arrived in Kerala, the Malayalam-speaking region in the south-western tip of India, through Middle Eastern merchants. The Indian coast has an ancient relation with West Asia and the Middle East, even during the pre-Islamic period. Kerala Muslims or Malayali Muslims from north Kerala are generally referred to as Mappilas. Mappilas are but one among the many communities that forms the Muslim population of Kerala. According to some scholars, the Mappilas are the oldest settled Muslim community in South Asia. As per some studies, the term "Mappila" denotes not a single community but a variety of Malayali Muslims from Kerala (former Malabar District) of different origins. Native Muslims of Kerala were known as Mouros da Terra, or Mouros Malabares in medieval period. Settled foreign Muslims of Kerala were known as Mouros da Arabia/Mouros de Meca. Unlike the common misconception, the caste system does exist among the Muslims of Kerala. Muslims in Kerala share a common language (Malayalam) with the rest of the non-Muslim population and have a culture commonly regarded as the Malayali culture. Islam is the second largest practised religion in Kerala (26.56%) next to Hinduism. The calculated Muslim population (Indian Census, 2011) in Kerala state is 8,873,472. Most of the Muslims in Kerala follow Sunni Islam of Shāfiʿī School of thought, while a large minority follow modern movements (such as Salafism) that developed within Sunni Islam. History Kerala has been a major spice exporter since 3000 BCE, according to Sumerian records and it is still referred to as the "Garden of Spices" or as the "Spice Garden of India". Kerala's spices attracted ancient Arabs, Babylonians, Assyrians and Egyptians to the Malabar Coast in the 3rd and 2nd millennia BCE. Phoenicians established trade with Kerala during this period. Arabs and Phoenicians were the first to enter Malabar Coast to trade Spices. The Arabs on the coasts of Yemen, Oman, and the Persian Gulf, must have made the first long voyage to Kerala and other eastern countries. They must have brought the Cinnamon of Kerala to the Middle East. The Greek historian Herodotus (5th century BCE) records that in his time the cinnamon spice industry was monopolized by the Egyptians and the Phoenicians. In the past, there were many Muslim traders in the ports of Malabar. There had been considerable trade relations between Middle East and Malabar Coast even before the time of Prophet Muhammad (c. 570 – 632 AD). Muslim tombstones with ancient dates, short inscriptions in medieval mosques, and rare Arab coin collections are the major sources of early Muslim presence on the Malabar Coast. Islam arrived in Kerala, a part of the larger Indian Ocean rim, via spice and silk traders from the Middle East. Historians do not rule out the possibility of Islam being introduced to Kerala as early as the seventh century CE. Notable has been the occurrence of Cheraman Perumal Tajuddin, the Hindu King that moved to Arabia to meet the Islamic Prophet Muhammad and converted to Islam. Kerala Muslims are generally referred to as the Mappilas. Mappilas are but one among the many communities that forms the Muslim population of Kerala. According to the Legend of Cheraman Perumals, the first Indian mosque was built in 624 AD at Kodungallur with the mandate of the last the ruler (the Cheraman Perumal) of Chera dynasty, who converted to Islam during the lifetime of Prophet Muhammad (c. 570–632). According to Qissat Shakarwati Farmad, the Masjids at Kodungallur, Kollam, Madayi, Barkur, Mangalore, Kasaragod, Kannur, Dharmadam, Panthalayini, and Chaliyam, were built during the era of Malik Dinar, and they are among the oldest Masjids in Indian Subcontinent. It is believed that Malik Dinar died at Thalangara in Kasaragod town. According to popular tradition, Islam was brought to Lakshadweep islands, situated just to the west of Malabar Coast, by Ubaidullah in 661 CE. His grave is believed to be located on the island of Andrott. A few Umayyad (661–750 AD) coins were discovered from Kothamangalam in the eastern part of Ernakulam district. The known earliest mention about Muslims of Kerala is in the Quilon Syrian copper plates of 9th century CE, granted by the ruler of Kollam. A number of foreign accounts have mentioned about the presence of considerable Muslim population in the Malabar Coast. Arab writers such as Al-Masudi of Baghdad (896–956 AD), Muhammad al-Idrisi (1100–1165 AD), Abulfeda (1273–1331 AD), and Al-Dimashqi (1256–1327 AD) mention the Muslim communities in Kerala. Some historians assume that the Mappilas can be considered as the first native, settled Muslim community in South Asia. Al-Biruni (973–1048 CE) appears to be the first writer to call Malabar Coast as Malabar. Authors such as Ibn Khordadbeh and Al-Baladhuri mention Malabar ports in their works. The Arab writers had called this place Malibar, Manibar, Mulibar, and Munibar. Malabar is reminiscent of the word Malanad which means the land of hills. According to William Logan, the word Malabar comes from a combination of the Malayalam word Mala (hill) and the Persian/Arabic word Barr (country/continent). The Kodungallur Mosque, has a granite foundation exhibiting 11th–12th century architectural style. The Arabic inscription on a copper slab within the Madayi Mosque in Kannur records its foundation year as 1124 CE. The monopoly of overseas spice trade from Malabar Coast was safe with the West Asian shipping magnates of Kerala ports. The Muslims were a major financial power to be reckoned with in the kingdoms of Kerala and had great political influence in the Hindu royal courts. Travellers have recorded the considerably huge presence of Muslim merchants and settlements of sojourning traders in most of the ports of Kerala. Immigration, intermarriage and missionary activity/conversion — secured by the common interest in the spice trade — helped in this development. The Koyilandy Jumu'ah Mosque contains an Old Malayalam inscription written in a mixture of Vatteluttu and Grantha scripts which dates back to 10th century CE. It is a rare surviving document recording patronage by a Hindu king (Bhaskara Ravi) to the Muslims of Kerala. A 13th century granite inscription, written in a mixture of Old Malayalam and Arabic, at Muchundi Mosque in Kozhikode mentions a donation by the king to the mosque. The Moroccan traveller Ibn Battutah (14th century) has recorded the considerably huge presence of Muslim merchants and settlements of sojourning traders in most of the ports of Kerala. By the early decades of the 14th century, travellers speak of Calicut (Kozhikode) as the major port city in Kerala. Some of the important administrative positions in the kingdom of Zamorin of Calicut, such as that of the port commissioner, were held by Muslims. The port commissioner, the Shah Bandar, represented commercial interests of the Muslim merchants. In his account, Ibn Battutah mentions Shah Bandars in Calicut as well as Quilon (Ibrahim Shah Bandar and Muhammed Shah Bandar). The Ali Rajas of Arakkal kingdom, based at Kannur, ruled the Lakshadweep Islands. Arabs had the monopoly of trade in Malabar Coast and Indian Ocean until the Portuguese Age of Discovery. The "nakhudas", merchant magnates owning ships, spread their shipping and trading business interests across the Indian Ocean. The arrival of the Portuguese explorers in the late 15th century checked the then well-established and wealthy Muslim community's progress. Following the discovery of sea route from Europe to Kozhikode in 1498, the Portuguese began to expand their territories and ruled the seas between Ormus and the Malabar Coast and south to Ceylon. The Tuhfat Ul Mujahideen written by Zainuddin Makhdoom II (born around 1532) of Ponnani during 16th-century CE is the first-ever known book fully based on the history of Kerala, written by a Keralite. It is written in Arabic and contains pieces of information about the resistance put up by the navy of Kunjali Marakkar alongside the Zamorin of Calicut from 1498 to 1583 against Portuguese attempts to colonize Malabar coast. It was first printed and published in Lisbon. A copy of this edition has been preserved in the library of Al-Azhar University, Cairo. Tuhfatul Mujahideen also describes the history of Mappila Muslim community of Kerala as well as the general condition of Malabar Coast in the 16th century CE. With the end of Portuguese era, Arabs lost their monopoly of trade in Malabar Coast. As the Portuguese tried to establish monopoly in spice trade, bitter naval battles with the zamorin ruler of Calicut became a common sight. The Portuguese naval forces attacked and looted the Muslim dominated port towns in the Kerala. Ships containing trading goods were drowned, often along with the crew. This activities, in the long run, resulted in the Muslims losing control of the spice trade they had dominated for more than five hundred years. Historians note that in the post-Portuguese period, once-rich Muslim traders turned inland (southern interior Malabar) in search of alternative occupations to commerce. By the mid-18th century the majority of the Muslims of Kerala were landless labourers, poor fishermen and petty traders, and the community was in "a psychological retreat". The community tried to reverse the trend during the Mysore invasion of Malabar District (late 18th century). The victory of the English East India Company and princely Hindu confederacy in 1792 over the Kingdom of Mysore placed the Muslims once again in economical and cultural subjection. The subsequent partisan rule of British authorities throughout the 19th and early 20th centuries brought the landless Muslim peasants of Malabar District into a condition of destitution, and this led to a series of uprisings (against the Hindu landlords and British administration). The series of violence eventually exploded as the Mappila Uprising (1921–22). The Muslim material strength - along with modern education, theological reform, and active participation in democratic process - recovered slowly after the 1921-22 Uprising. The Muslim numbers in state and central government posts remained staggeringly low. The Muslim literacy rate was only 5% in 1931. A large number of Muslims of Kerala found extensive employment in the Persian Gulf countries in the following years (c. 1970s). This widespread participation in the "Gulf Rush" produced huge economic and social benefits for the community. A great influx of funds from the earnings of the employed followed. Issues such as widespread poverty, unemployment, and educational backwardness began to change. The Muslims in Kerala are now considered as section of Indian Muslims marked by recovery, change, and positive involvement in the modern world. Malayali Muslim women are now not reluctant to join professional vocations and assuming leadership roles. University of Calicut, with the former Malabar District being its major catchment area, was established in 1968. Calicut International Airport, currently the twelfth busiest airport in India, was inaugurated in 1988. An Indian Institute of Management (IIM) was established at Kozhikode in 1996. Demography The last Indian Census was conducted in 2011. According to the 2011 Census of India, the district-wise distribution of the Muslim population is as shown below: Theological orientations/denominations Most of the Muslims of Kerala follow Sunni Islam of Shāfiʿī school of religious law (known in Kerala as the traditionalist 'Sunnis') while a large minority follow modern movements that developed within Sunni Islam. The latter section consists of majority Salafists (the Mujahids) and the minority Islamists. Both the traditional Sunnis and Mujahids again have been divided to sub-identities. Sunnī Islam Shāfi'ī—mainly two groups (majority of traditional Sunnis in Kerala are Shafiis). Ḥanafī Salafists (the Mujahids)—with different splinter factions (with varying degrees of puritanism). Kerala Nadvathul Mujahideen (K. N. M) is the largest Mujahid organisation in Kerala. Islamists (the Jama'at-i-Islami India)—representing political Islam in Kerala. Shīiah Islam Ahmadiyya Muslim Jama'at – Head Quarters of Ahmadiyya Muslim Community in Kerala is located at Baitul Quddoos, G.H Road Kozhikode (Calicut). Ahmadiyya Muslim Community. Communities Mappilas: The largest community among the Muslims of Kerala. As per some studies, the term "Mappila" denotes not a single community but a variety of Malayali Muslims from north Kerala (former Malabar District) of different ethnic origins. In south Kerala Malayali Muslims are not called Mappilas. A Mappila is either, A descendant of any native convert) to Islam (or) A descendant of a marriage alliance between a Middle Eastern individual and a native low caste woman The term Mappila is still in use in Malayalam to mean "bridegroom" or "son-in-law". Pusalans: Mostly converts from the Mukkuvan caste. Formerly a low status group among the Muslims of Kerala. The other Mappilas used call them "Kadappurattukar", while themselves were known as "Angadikkar". The Kadappurattukar were divided into two endogamous groups on the basis of their occupation, "Valakkar" and "Bepukar". The Bepukar were considered superior to Valakkar. In addition to the two endogamous groups there were other service castes like "Kabaru Kilakkunnavar", "Alakkukar", and "Ossans" in Pusalan settlements. Ossan occupied the lowest position in the old hierarchy. Ossans: the Ossans were the traditional barbers among the Muslims of Kerala. Formed the lowest rank in the old hierarchy, and were an indispensable part of the village community of Muslims of Kerala. Thangals (the Sayyids): Claiming descent from the family of Muhammed. People who had migrated from Middle East. Elders of a number of widely respected Thangal families often served as the focal point of the Muslim community in old Malabar District. Rowthers: The Muslim community originated in Tamilakam. Mainly they settled in Trivandrum, Alapuzha, Kochi, kottayam, kollam, Idukki, Pathanamthitta, Pandalam, Palakkad regions in kerala. Rowther sect is a prominent and prosperous muslim community in Tamil Nadu and Kerala. Vattakkolis (the Bhatkalis) or Navayats: ancient community of Muslims, claiming Arab origin, originally settled at Bhatkal, Uttara Kannada. Speaks Navayati language. Once distributed in the towns of northern Kerala as a mercantile community. They are mainly distributed in the Northern parts of Malabar bordering Karnataka. Nahas: The origin of the name Naha is supposed to be a transformation of "nakhuda" which means captain of ship. Community concentrated mainly in Parappanangadi, south of Kozhikode who trace their origins to Persian ship owners. Marakkars: once multilingual maritime trading community settled in Kerala, Tamil Nadu, the Palk Strait and Sri Lanka. The most famous of the Marakkar were "Kunjali Marakkars", or the naval captains of the Zamorin of Calicut. The Muslims of pure Middle Eastern descent held themselves superior to Marakkars and Marakkars considered themselves superior to Labbais. Keyis: community of wealthy merchants, mainly settled in Kannur, Thalassery and Parappanangadi with Iranian origin. Koyas: Muslim community, in the city of Kozhikode forming a significant majority in Kozhikode and its adjoining areas. May be of Omani origin. It is said that the name is a corruption of “Khawaja”. Held administrative positions in the Kozhikode court of the zamorins. Kurikkals: a community of Muslims, claiming Arab origin, settled around Manjeri in Malappuram District.The family was first settled in Mavvancheri in North Malabar and moved to Manjeri in the beginning of the 16th century. Many of the members of the family served as instructor in the use of fire-arms in the employ of various chiefs of Malabar. Nainars: a community of Tamil origin. Settled only in Cochin, Mattanchery, Fort Kochi and Kodungallur. It is believed that the Nainars first settled in Kerala in the 15th century, entering into contract for certain works with the chiefs of Cochin. Dakhnis or Pathans: "Dakhni" speaking community. Migrated as cavalry men under various chiefs, especially in South Travancore. Some of them came South India along with the invasion of the Coromandel by the Khaljis. Many of the Dakhnis had also come as traders and businessmen. Kutchi Memons: They are a Kutchi speaking Gujarati ethnic group from the Kutch region. They are descended from the Lohana community among Gujarati Hindus.They were mainly traders who had migrated to Central Kerala with the other Gujarati traders. Beary/Byary: Muslims: community Stretching along the Tulunadu region. In Kerala they inhabits the coastal area of Kasargod district.They speak their own tongue which is called Beary language. They are originally mercantile community, hece the name 'beary', from the Sanskrit word 'Vyapari'(merchant). Bohras (Daudi Bohras): Western (Mustaalis) Ismaili Shiah community. Settled in a few major town in Kerala like Kozhikode, Kannur, Kochi and Alappuzha. Bohras migrated from Gujarat to Kerala. They form the major part of the Shia community in Kerala. Culture Literature Mappila Songs (or Mappila Poems) is a famous folklore tradition emerged in c. 16th century. The ballads are compiled in complex blend of Dravidian (Malayalam/Tamil) and Arabic, Persian/Urdu in a modified Arabic script. Mappila songs have a distinct cultural identity, as they sound a mix of the ethos and culture of Dravidian South India as well as West Asia. They deal with themes such as religion, satire, romance, heroism, and politics. Moyinkutty Vaidyar (1875–91) is generally considered as the poet laureate of Mappila Songs. As the modern Malayali Muslim literature developed after the 1921–22 Uprising, religious publications dominated the field. Vaikom Muhammad Basheer (1910–1994), followed by, U. A. Khader, K. T. Muhammed, N. P. Muhammed and Moidu Padiyath are leading Kerala Muslim authors of the modern age. Muslim periodical literature and newspaper dailies – all in Malayalam – are also extensive and critically read among the Muslims. The newspaper known as "Chandrika", founded in 1934, played as significant role in the development of the Muslim community. Kerala Muslim folk arts Oppana was a popular form of social entertainment. It was generally performed by a group of women, as a part of wedding ceremonies a day before the wedding day. The bride, dressed in all finery, covered with gold ornaments, is the chief "spectator"; she sits on a pitham, around which the singing and dancing take place. While the women sing, they clap their hands rhythmically and move around the bride in steps. Kolkkali was a dance form popular among the Muslims. It was performed by a group of dozen young men with two sticks, similar to the Dandiya dance of Gujarat in Western India. Duff Muttu (also called Dubh Muttu) was an art form prevalent among Muslims, using the traditional duff, or daf, also called tappitta. Performers dance to the rhythm as they beat the duff. Arabana muttu was an art form named after the aravana, a hand-held, one-sided flat tambourine or drumlike musical instrument. It is made of wood and animal skin, similar to the duff but a little thinner and bigger. Muttum Viliyum was a traditional orchestral musical performance. It is basically the confluence of three musical instruments—kuzhal, chenda and cheriya chenda. Muttum Viliyum is also known by the name "Cheenimuttu". Vattappattu was an art form once performed in the Malabar region on the eve of the wedding. It was traditionally performed by a group of men from the groom’s side with the putiyappila (the groom) sitting in the middle. Mappila Cuisine The Mappila cuisine is a blend of traditional Kerala, Persian, Yemenese and Arab food culture. This confluence of culinary cultures is best seen in the preparation of most dishes. Kallummakkaya (mussels) curry, irachi puttu (irachi meaning meat), parottas (soft flatbread), Pathiri (a type of rice pancake) and ghee rice are some of the other specialties. The characteristic use of spices is the hallmark of Mappila cuisine—black pepper, cardamom and clove are used profusely. The Malabar version of biryani, popularly known as kuzhi mandi in Malayalam is another popular item, which has an influence from Yemen. Various varieties of biriyanis like Thalassery biriyani, Kannur biriyani, Kozhikode biriyani and Ponnani biriyani are prepared by the Mappila community. The snacks include unnakkaya (deep-fried, boiled ripe banana paste covering a mixture of cashew, raisins and sugar), pazham nirachathu (ripe banana filled with coconut grating, molasses or sugar), muttamala made of eggs, chatti pathiri, a dessert made of flour, like a baked, layered chapati with rich filling, arikkadukka, and more. See also Arabi Malayalam Arabi Malayalam script Onam and Islam Beary Muslims Beary language Tamil Muslim Sri Lankan Moors Nasrani Mappila Bibliography P. Shabna & K. Kalpana (2022) Re-making the self: Discourses of ideal Islamic womanhood in Kerala, Asian Journal of Women's Studies, 28:1, 24-43, References Further reading (The English translation of the historic book Tuhfat Ul Mujahideen written about the society of Kerala by Zainuddin Makhdoom II during sixteenth century CE) Muhsin, S. M. . (2021). Three Fatwas on Marriage in South India (Tiga Fatwa Perkahwinan di India Selatan). Journal of Islam in Asia (E-ISSN 2289-8077), 18(1), 251–282. https://doi.org/10.31436/jia.v18i1.1045 Kerala
```python import json v1_metrics_path = "./V1_Metrics.json" v2_metrics_path = "./V2_Metrics.json" with open(v1_metrics_path, 'r') as file: v1_metrics = json.load(file) with open(v2_metrics_path, 'r') as file: v2_metrics = json.load(file) # Extract names and labels of the metrics def extract_metrics_with_labels(metrics, strip_prefix=None): result = {} for metric in metrics: name = metric['name'] if strip_prefix and name.startswith(strip_prefix): name = name[len(strip_prefix):] labels = {} if 'metrics' in metric and 'labels' in metric['metrics'][0]: labels = metric['metrics'][0]['labels'] result[name] = labels return result v1_metrics_with_labels = extract_metrics_with_labels(v1_metrics) v2_metrics_with_labels = extract_metrics_with_labels( v2_metrics, strip_prefix="otelcol_") # Compare the metrics names and labels common_metrics = {} v1_only_metrics = {} v2_only_metrics = {} for name, labels in v1_metrics_with_labels.items(): if name in v2_metrics_with_labels: common_metrics[name] = labels elif not name.startswith("jaeger_agent"): v1_only_metrics[name] = labels for name, labels in v2_metrics_with_labels.items(): if name not in v1_metrics_with_labels: v2_only_metrics[name] = labels differences = { "common_metrics": common_metrics, "v1_only_metrics": v1_only_metrics, "v2_only_metrics": v2_only_metrics } # Write the differences to a new JSON file differences_path = "./differences.json" with open(differences_path, 'w') as file: json.dump(differences, file, indent=4) print(f"Differences written to {differences_path}") ```
Maradik () is a village in Serbia. It is situated in the Autonomous Province of Vojvodina, in the region of Syrmia (Syrmia District), in Inđija municipality. Maradik is located about 10 km west of Inđija. The village has a 60% Serb ethnic majority and its total population in 2011 was 2,095. Name In Serbian, the village is known as Maradik or Марадик, in Croatian as Maradik, and in Hungarian as Maradék. History After Hungarian Roman Catholic residents of the village were rejected by bishop Josip Juraj Strossmayer in their request to get Hungarian language speaking priest, their representatives went to Budapest to meet reformed bishop to request collective conversion to Protestantism. Ethnic groups (2002 census) Serbs = 1,394 (60.66%) Hungarians = 552 (24.02%) Croats = 105 (4.57%) Yugoslavs = 90 (3.92%) Historical population 1961: 2,651 1971: 2,350 1981: 2,255 1991: 2,120 2002: 2,298 2011: 2,095 References Sources Slobodan Ćurčić, Broj stanovnika Vojvodine, Novi Sad, 1996. See also List of places in Serbia List of cities, towns and villages in Vojvodina Populated places in Syrmia Open-air museums in Serbia
```xml import {ViewEngine} from "../decorators/viewEngine.js"; import {Engine} from "./Engine.js"; @ViewEngine("atpl") export class AtplEngine extends Engine {} ```
Neocompsa tenuissima is a species of beetle in the family Cerambycidae. It was described by Bates in 1885. References Neocompsa Beetles described in 1885
Aysor (in Armenian Այսօր) was an Armenian language publication in Paris, France that was established in 1950 under the editorship of Hovhannes Boghosian and Shavarsh Sevhonkian. Aysor means "today" in Armenian. The paper was published from a printing house that carried the same name. It ceased publication in 1954 after reservations by the French authorities about its politics. References 1950 establishments in France 1954 disestablishments in France Armenian-language newspapers Defunct newspapers published in France Newspapers published in Paris Newspapers established in 1950 Publications disestablished in 1954
Ananeh or Anane () is a lowland region in central portions of the Sanaag region of Somaliland. It is bordered on the northeast by the Gebi Valley to the east by the Hadeed Plateau and on the northwest by the flattening slopes of the Golis-Guban range and to the south by Xudun District and Nugaal Valley. Anane is roughly congruous with the Fiqifuliye District. Anane was notable for serving as the escape route for Sayyid Mohammed Abdullah Hassan's forces northwards to Jidali in the aftermath of the darawiish defeat at Jidbali. References Geography of Somalia
Ricardo Andreutti (otherwise known as Ricky, born June 30, 1987) is a retired footballer who hails from Caracas, Venezuela. Generally, his preferred position was as defensive midfielder. Early life and youth Andreutti was born in Caracas, in 1987. At the age of 18, he joined Italian amateur outfit AC Chioggia Sottomarina which later amalgamated with local rivals ASD Sottomarina Lido to become Clodiense S.S.D. and made a total of five first-team appearances. From there, he would then go to Uruguay and play there. Transfers Petare FC After Uruguay, Andreutti returned to Venezuela to join Petare F.C. Caracas FC In 2013, he was bought by Primera División club Caracas FC for an unknown price to bolster their defensive midfield options. A fan favorite with Caracas FC, he donned the number 15 shirt with them as well. ACD Lara After Leaving Caracas FC, Andreutti joined ACD Lara on a two and a half year deal. Personal life Similar to Andreutti, his father was a full-time footballer and was with Caracas FC when they were known as Caracas Yamaha FC and married Veronica Jordán on December 14, 1984. His last name, Jordán, refers to his maternal side of the family. Their parents ran a motorcycle spare parts business. Three years later, a brother named Victoria was born, adding another member into the Andreutti family. Aged six, he began playing football. As an alternate interest, Ricardo started judo for a while. International Cup Appearances Achievements and honours Copa Venezuela winner (2013) Venezuelan Primera División runners-up (2008-09) References External links Venezuelan men's footballers Venezuelan expatriate men's footballers Footballers from Caracas Venezuelan Primera División players Caracas FC players Asociación Civil Deportivo Lara players Deportivo Miranda F.C. players Men's association football midfielders Living people Venezuelan people of Italian descent 1987 births Venezuelan expatriate sportspeople in Italy Expatriate men's footballers in Italy
The 2014 Pan American Combined Events Cup was held in Ottawa, Ontario, Canada, at the Terry Fox Stadium on July 16–18, 2014. The event was hosted by the Ottawa Lions Track and Field Club, and served also as the Canadian Championships. For the first time, junior categories were included in the cup, while there were also three Canadian competitors in a youth category. A detailed report on the event and an appraisal of the results was given. Complete results were published. Medallists Results Men's Decathlon Senior Key Women's Heptathlon Senior Key Men's Decathlon Junior Key Women's Heptathlon Junior Key Medal table Participation An unofficial count yields the participation of 41 athletes (plus 48 guests and locals) from 10 countries. (6 + 2 guests) (11 + 40 guests) (1) (7) (2) (2 + 2 guests) (1) (3) (1) (7 + 4 guests) See also 2014 in athletics (track and field) References Pan American Combined Events Cup Pan American Combined Events Cup Pan American Combined Events Cup International track and field competitions hosted by Canada Pan American Combined Pan American Combined Events Cup
Love Is My Velocity is a Perth, Australia-based independent record label. Originally started as an indie club night in 2003, it became a record label representing mainly Perth bands in 2006. Love Is My Velocity is Helen McLean, Keong Woo, Katie Lenanton and Matt Giles. Until August 2007 the label exclusively released split 7 inch vinyl singles containing one song each from two upcoming bands. The first was "Bird" / "City Walls and Empires" by The Bank Holidays and Institut Polaire, the second was "Wow" / "It's All the Same to Me" by the Tucker B's and Airport City Shuffle, the third was "Holidayz" / "Hard on a Man" by Josh Fontaine and Joe Bludge, and the fourth and most recent single was "Hot Property" / "I've Got Your Soul" by 7 Day Weekend and Sugar Army. "City Walls and Empires" went on to win WAM song of the year 2006. In August Love is My Velocity released its first CD album by Perth band Bamodi. They plan to release their second CD-LP by the Burton Cool Suit in October and their third in early 2008 by Josh Fontaine. In May 2007 the label expanded into publishing, releasing the Love is My Velocity Cookbook, a guide to Perth music and art made within the cookbook format. The cookbook features recipes provided by 48 local Perth bands and artwork by 60 emerging artists. Two years later the second Love Is My Velocity Cook Book was released. Artists Institut Polaire The Bank Holidays Tucker B's Adem K Airport City Shuffle Josh Fontaine Joe Bludge 7 Day Weekend Sugar Army Bamodi Burton Cool Suit Stina Thomas The Tigers Ghost Drums See also List of record labels External links Official web site MySpace page Cookbook's MySpace page Australian independent record labels Record labels established in 2006 Indie rock record labels
Thomas Bevan (c.1796 – 31 January 1819) was, with fellow Welshman David Jones, the first Christian missionaries to Madagascar, sent by the London Missionary Society. Life and work Bevan was born in the neighbourhood of Neuaddlwyd, Cardiganshire, about 1796. He came from a religious home, and at the age of 8, he was already a reader of the Bible. He experienced conversion near Nantgwynfynydd farm and on 19 November 1810, became a church member at Neuaddlwyd. There, the minister Thomas Phillips (1772–1842) encouraged him to begin preaching. He then went to Phillips's school at Pen-y-banc, and later to colleges at Newtown and, with Jones, at Gosport. It was decided that he should go to Madagascar. He was ordained at Neuaddlwyd, 20–1 August 1817, and married Mary Jones (née Jacob) of Pen-yr-allt Wen in the same district. Bevan and Jones, with their families, sailed for Madagascar on 9 February, arriving in Mauritius on 3 July 1818. Five weeks later, they embarked again, and landed at Tamatave, Madagascar, on 18 August 1818. Here they started a school with ten children. Bevan returned to Mauritius to fetch his family, returning on 6 January 1819. Their own child died on 20 January, Bevan himself died on 31 January, and his wife died on 3 February 1819. They are buried in Tamatave cemetery. References 1796 births 1819 deaths Welsh Protestant missionaries Protestant missionaries in Madagascar British expatriates in Madagascar
```haskell module T7312 where -- this works mac :: Double -> (Double->Double) -> (Double-> Double) mac ac m = \ x -> ac + x * m x -- this doesn't mac2 :: Double -> (->) Double Double -> (->) Double Double mac2 ac m = \ x -> ac + x * m x ```
USS LST-717 was a in the United States Navy during World War II. She was transferred to the Republic of China Navy as ROCS Chung Yeh. Construction and commissioning LST-717 was laid down on 20 June 1944 at Jeffersonville Boat and Machine Company, Jeffersonville, Indiana. Launched on 29 July 1944 and commissioned on 23 August 1944. Service in United States Navy During World War II, LST-717 was assigned to the Asiatic-Pacific theater. She then participated in the Palawan Island landings from 1 to 7 March 1945 and Mindanao Island landings from 17 to 23 April 1945. She was assigned to occupation and China from 2 September 1945 to 12 June 1946. She was decommissioned on 12 June 1946 and was struck from the Naval Register on 12 March 1946. On 12 June 1946, she was then transferred to the Republic of China under the lend-lease program and renamed Chung Yeh. Service in Republic of China Navy On 13 November 1947, she was stranded on the Changshan Island. She was then incorporated into People's Liberation Army Navy in 1953 after her repair. Awards LST-717 have earned the following awards: American Campaign Medal Asiatic-Pacific Campaign Medal (1 battle star) World War II Victory Medal Navy Occupation Service Medal (with Asia clasp) Philippine Presidential Unit Citation Philippine Liberation Medal (1 battle star) Citations Sources LST-542-class tank landing ships Ships built in Jeffersonville, Indiana World War II amphibious warfare vessels of the United States LST-542-class tank landing ships of the Republic of China Navy 1944 ships
Różanystok is a village and former monastery in northeastern Poland, known regionally for both its ornate 18th-century minor basilica and its agricultural magnet school. It lies approximately south-east of Dąbrowa Białostocka, north of Sokółka, and north of the regional capital Białystok. Geography Różanystok, formerly known as Krzywy Stok ("Crooked Slope"), is located in the township of Dąbrowa Białostocka, which is in turn situated in the Podlaskie region's Sokółka County division. From the years 1975-1998 the area was part of the Białystok Voivodeship (1975-1998) administrative district. The Belarusian city of Grodno can be seen from the Basilica's bell tower. Part of the village's geographical boundary is defined by a stone wall that remains from its days as a monastery. Różanystok is a stop on the northeastern Poland PKP train line, which also stops in Białystok, Sokółka, Augustów and Suwałki. History The village is home to a well-known Mary, Mother of God shrine, to which tens of thousands of pilgrims travel each year. The shrine's focus is a 17th-century image of Mary holding the infant Jesus which is believed to be miraculous. A "coronation" celebration for the Różanystok icon was held on June 28, 1981, and the church was named a minor basilica on August 30, 1987. Since 1954, Różanystok has also been the location of a state-run Zespól Szkól Rolniczych (Group Agricultural School). The school's five-year technical program prepares students for work in agriculture and related fields, while its four-year economics program prepares students for work in business and/or advanced studies at the university level. The church complex was used as a military storage depot during World War I, and several of its buildings were destroyed in World War II. Demographics Most of Różanystok's 510 residents, who primarily live in two three-story apartment buildings within the village, attend, work at, or are retired from employment at the school. Images External links Official church homepage Polish Wikipedia entry - includes geographical coordinates and link to Google map Official pilgrimage website (Polish) Rozanystok photos on TrekEarth Villages in Sokółka County Basilica churches in Poland History of Catholicism in Poland
Yên Cư station is a railway station in Vietnam. It serves the town of Hạ Long, in Quảng Ninh Province. Buildings and structures in Quảng Ninh province Railway stations in Vietnam
Ulrich Vig Vinzents (born 4 November 1976) is a Danish former professional footballer who played as a right-back. Club career In Denmark Born in Ringsted, Vinzents started his professional career at Lyngby Boldklub however with a limited amount of play. He moved on to Køge BK and played there for three seasons before coming back to his old club Lyngby. Back in Lyngby Vinzents established himself in the starting eleven and played for four seasons before once again leaving the club, this time to FC Nordsjælland. After a couple of season's at the club he transferred to OB for three seasons before he moved overseas to Sweden and Malmö FF. Malmö FF Vinzents transferred to Malmö FF in 2006 and took a spot in the starting eleven from the start. For the coming five seasons he missed as few as seven games as he was in good form and rid of injuries. For the 2010 season Vinzents showed that he had a good defense as well as offensive skills which he demonstrated frequently by shooting cross balls from the right flank. In 2010 Vinzents finally won his first title as Malmö FF became Swedish champions. Vinzents played 29 out of 30 possible league games and was one of the reasons for the team's successful defence. Vinzents continued to play for the majority of Malmö FF's matches for the 2011 season with 23 Allsvenskan caps and 45 matches in total. He scored his first and only competitive goal for the club against Jönköpings Södra IF in Svenska Cupen on 11 May 2011. Vinzents signed a new contract on 22 June 2011 to keep him at the club for another season. After captain Daniel Andersson decided to focus on his coaching role for the 2012 season Vinzents was given the captain's armband. However as Vinzents had some trouble with injuries throughout the season he only acted as captain for a few matches, most notably in his last match for Malmö FF on 4 November in an away game against AIK. On 1 November 2012, it was announced that Vinzents would leave the club after seven seasons. He was given a farewell ceremony on the pitch at Swedbank Stadion after the last home match of the season against Örebro SK. Career statistics Honours Malmö FF Allsvenskan: 2010 References External links Malmö FF profile SvFF profile 1976 births Living people Danish men's footballers Denmark men's under-21 international footballers Lyngby Boldklub players Køge Boldklub players FC Nordsjælland players Odense Boldklub players Malmö FF players Allsvenskan players Danish Superliga players Danish 1st Division players Danish expatriate men's footballers Expatriate men's footballers in Sweden Men's association football fullbacks People from Ringsted Footballers from Region Zealand Danish expatriate sportspeople in Sweden
Kevin Sparks (born 1963/1964), is an American Republican businessman who is the State Senator for the 31st District, having been duly elected in 2022. The Texas Panhandle and Permian Basin seat, where incumbent Republican Kel Seliger announced his retirement, was effectively won by Sparks after the Republican primary election as he faced no Democratic opponent in the general election. Early life and education Sparks was raised in Midland, Texas, and graduated from the University of Texas at Austin with a business degree. He received the Eagle Scout rank from the Boy Scouts of America in 1978. Career Oil Sparks is president of Discovery Operating, Inc, a family-owned and operated oil and gas company in Midland. He has previously served as a board member of the Natural Gas Producers Association and the Texas Public Policy Foundation. Politics Sparks announced a primary campaign against incumbent Republican Kel Seliger, regarded as a more moderate member of the Republican caucus, in 2022. He was endorsed by former President Donald Trump, United States Senator Ted Cruz, as well as Texas Lieutenant Governor Dan Patrick and quickly became the seat's frontrunner after Seliger announced his retirement. He won the Republican primary in March with over 50% of the vote, avoiding a runoff, and faced no Democratic opponent in the general election in November. Election history 2022 References External links 21st-century American politicians American businesspeople in the oil industry Businesspeople from Texas Date of birth missing (living people) Living people People from Midland, Texas Texas Republicans University of Texas at Austin alumni Year of birth missing (living people)
```python # Use of this source code is governed by a MIT license # that can be found in the LICENSE file. from dokumentor import * NamespaceDoc( "Window", """Window class. It is not possible to create an instance of this class. 'global.window' is already available.""", SeesDocs( "global|global.window|Window" ), NO_Examples, products=["Frontend"] ) NamespaceDoc( "MouseEvent", "Class that describes mouse events.", SeesDocs( "global.window|NMLEvent|Window|WindowEvent|keyEvent|TextInputEvent|MouseEvent|DragEvent" ), NO_Examples ) NamespaceDoc( "MouseDrag", "Class that describes drag events.", SeesDocs( "global.window|NMLEvent|Window|WindowEvent|keyEvent|TextInputEvent|MouseEvent|DragEvent" ), NO_Examples ) NamespaceDoc( "WindowEvent", "Class that describes window events.", SeesDocs( "global.window|NMLEvent|Window|WindowEvent|keyEvent|TextInputEvent|MouseEvent|DragEvent" ), NO_Examples, section="Window" ) NamespaceDoc( "TextInputEvent", "Class that describes textinput events.", SeesDocs( "global.window|NMLEvent|Window|WindowEvent|keyEvent|TextInputEvent|MouseEvent|DragEvent" ), NO_Examples ) NamespaceDoc( "keyEvent", "Class that describes key events.", SeesDocs( "global.window|NMLEvent|Window|WindowEvent|keyEvent|TextInputEvent|MouseEvent|DragEvent" ), NO_Examples ) NamespaceDoc( "NMLEvent", "Class that describes events.", SeesDocs( "global.window|NMLEvent|Window|WindowEvent|keyEvent|TextInputEvent|MouseEvent|DragEvent" ), NO_Examples ) EventDoc( "Window._onready", "Function that is called when the window is ready.", SeesDocs( "global.window|Window|Window._onassetready|Window._onready|Window._onbeforeclose|Window._onfocus|Window._onblur|Window._onmousewheel|Window._onkeydown|Window._onkeyup|Window._ontextinput|Window._onsystemtrayclick|Window._onmousedown|Window._onmouseup|Window._onFileDragEnter|Window.onFileDragLeave|Window._onFileDrag|Window._onFileDrop|Window._onmousemove"), NO_Examples, [ ParamDoc( "event", "EventMessage", "WindowEvent", NO_Default, IS_Obligated ) ] ) EventDoc( "Window._onclose", "Function that is called when the window will be closed.", SeesDocs( "global.window|Window|Window._onassetready|Window._onready|Window._onbeforeclose|Window._onfocus|Window._onblur|Window._onmousewheel|Window._onkeydown|Window._onkeyup|Window._ontextinput|Window._onsystemtrayclick|Window._onmousedown|Window._onmouseup|Window._onFileDragEnter|Window.onFileDragLeave|Window._onFileDrag|Window._onFileDrop|Window._onmousemove"), NO_Examples, [ ParamDoc( "event", "EventMessage", "WindowEvent", NO_Default, IS_Obligated ) ] ) EventDoc( "Window._onassetready", """Function that is called when the window has loaded all the assets.""", SeesDocs( "global.window|Window|Window._onassetready|Window._onready|Window._onbeforeclose|Window._onfocus|Window._onblur|Window._onmousewheel|Window._onkeydown|Window._onkeyup|Window._ontextinput|Window._onsystemtrayclick|Window._onmousedown|Window._onmouseup|Window._onFileDragEnter|Window.onFileDragLeave|Window._onFileDrag|Window._onFileDrop|Window._onmousemove"), NO_Examples, [ ParamDoc( "event", "EventMessage", ObjectDoc([("data", "string in utf8 encoding", "string"), ("tag", "tag name", "string"), ("id", "id of the object", "string")]), NO_Default, IS_Obligated ) ] ) EventDoc( "Window._onfocus", "Function that is called when the window receives the focus.", SeesDocs( "global.window|Window|Window._onassetready|Window._onready|Window._onbeforeclose|Window._onfocus|Window._onblur|Window._onmousewheel|Window._onkeydown|Window._onkeyup|Window._ontextinput|Window._onsystemtrayclick|Window._onmousedown|Window._onmouseup|Window._onFileDragEnter|Window.onFileDragLeave|Window._onFileDrag|Window._onFileDrop|Window._onmousemove"), NO_Examples, NO_Params ) EventDoc( "Window._onblur", "Function that is called when the window looses the focus.", SeesDocs( "global.window|Window|Window._onassetready|Window._onready|Window._onbeforeclose|Window._onfocus|Window._onblur|Window._onmousewheel|Window._onkeydown|Window._onkeyup|Window._ontextinput|Window._onsystemtrayclick|Window._onmousedown|Window._onmouseup|Window._onFileDragEnter|Window.onFileDragLeave|Window._onFileDrag|Window._onFileDrop|Window._onmousemove"), NO_Examples, NO_Params ) EventDoc( "Window._onmousewheel", """Function that is called when the window gets an mouse wheel event.""", SeesDocs( "global.window|Window|Window._onassetready|Window._onready|Window._onbeforeclose|Window._onfocus|Window._onblur|Window._onmousewheel|Window._onkeydown|Window._onkeyup|Window._ontextinput|Window._onsystemtrayclick|Window._onmousedown|Window._onmouseup|Window._onFileDragEnter|Window.onFileDragLeave|Window._onFileDrag|Window._onFileDrop|Window._onmousemove"), NO_Examples, [ ParamDoc( "event", "EventMessage", ObjectDoc([("xrel", "x relative position", "integer"), ("yres", "x relative position", "integer"), ("x_pos", "x position", "integer"), ("y_pos", "y position", "integer") ]), NO_Default, IS_Obligated ) ] ) for i in ["_onkeydown", "_onkeyup" ]: EventDoc( "Window." + i, """Function that is called when the window gets an " + i + " event.""", SeesDocs( "global.window|Window|Window._onassetready|Window._onready|Window._onbeforeclose|Window._onfocus|Window._onblur|Window._onmousewheel|Window._onkeydown|Window._onkeyup|Window._ontextinput|Window._onsystemtrayclick|Window._onmousedown|Window._onmouseup|Window._onFileDragEnter|Window.onFileDragLeave|Window._onFileDrag|Window._onFileDrop|Window._onmousemove"), NO_Examples, [ ParamDoc( "event", "EventMessage", ObjectDoc([ ("keyCode", "keycode used", "integer"), ("location", "location used", "integer"), ("altKey", "alt used", "boolean"), ("ctrlKey", "ctrl used", "boolean"), ("shiftKey", "shift used", "boolean"), ("metaKey", "meta used", "boolean"), ("spaceKey", "space used", "boolean"), ("repeat", "repeating", "boolean") ]), NO_Default, IS_Obligated ) ] ) EventDoc( "Window._ontextinput", """function that is called when the window gets an " + i + " event.""", SeesDocs( "global.window|Window|Window._onassetready|Window._onready|Window._onbeforeclose|Window._onfocus|Window._onblur|Window._onmousewheel|Window._onkeydown|Window._onkeyup|Window._ontextinput|Window._onsystemtrayclick|Window._onmousedown|Window._onmouseup|Window._onFileDragEnter|Window.onFileDragLeave|Window._onFileDrag|Window._onFileDrop|Window._onmousemove"), NO_Examples, [ ParamDoc( "event", "EventMessage", ObjectDoc([("val", "value (utf8)", "string")]), NO_Default, IS_Obligated ) ] ) EventDoc( "Window._onsystemtrayclick", """Function that is called when the window gets an " + i + " event.""", SeesDocs( "Window._onassetready|Window._onready|Window._onbeforeclose|Window._onfocus|Window._onblur|Window._onmousewheel|Window._onkeydown|Window._onkeyup|Window._ontextinput|Window._onsystemtrayclick|Window._onmousedown|Window._onmouseup|Window._onFileDragEnter|Window.onFileDragLeave|Window._onFileDrag|Window._onFileDrop|Window._onmousemove"), NO_Examples, [ ParamDoc( "event", "EventMessage", ObjectDoc([("id", "event id", "integer")]), NO_Default, IS_Obligated ) ] ) for i in ["_onmousedown", "_onmouseup" ]: EventDoc( "Window." + i, """Function that is called when the window gets an " + i + " event.""", SeesDocs( "global.window|Window|Window._onassetready|Window._onready|Window._onbeforeclose|Window._onfocus|Window._onblur|Window._onmousewheel|Window._onkeydown|Window._onkeyup|Window._ontextinput|Window._onsystemtrayclick|Window._onmousedown|Window._onmouseup|Window._onFileDragEnter|Window.onFileDragLeave|Window._onFileDrag|Window._onFileDrop|Window._onmousemove"), NO_Examples, [ ParamDoc( "event", "EventMessage", ObjectDoc([ ("x_pos", "x position", "integer"), ("y_pos", "y position", "integer"), ("clientX", "client x position", "integer"), ("clientY", "client y position", "integer"), ("which", "mouse button", "integer") ]), NO_Default, IS_Obligated ) ] ) for i in ["_onFileDragEnter", "_onFileDragLeave", "_onFileDrag", "_onFileDragDrop" ]: EventDoc( "Window." + i, """function that is called when the window gets an " + i + " event. """, SeesDocs( "global.window|Window|Window._onassetready|Window._onready|Window._onbeforeclose|Window._onfocus|Window._onblur|Window._onmousewheel|Window._onkeydown|Window._onkeyup|Window._ontextinput|Window._onsystemtrayclick|Window._onmousedown|Window._onmouseup|Window._onFileDragEnter|Window.onFileDragLeave|Window._onFileDrag|Window._onFileDrop|Window._onmousemove"), NO_Examples, [ ParamDoc( "event", "EventMessage", ObjectDoc([ ("x_pos", "x position", "integer"), ("y_pos", "y position", "integer"), ("clientX", "client x position", "integer"), ("clientY", "client y position", "integer"), ("files", "Array of filenames", "[string]") ]), NO_Default, IS_Obligated ) ] ) EventDoc( "Window._onmousemove", """function that is called when the window gets an mousemovement event.""", SeesDocs( "global.window|Window|Window._onassetready|Window._onready|Window._onbeforeclose|Window._onfocus|Window._onblur|Window._onmousewheel|Window._onkeydown|Window._onkeyup|Window._ontextinput|Window._onsystemtrayclick|Window._onmousedown|Window._onmouseup|Window._onFileDragEnter|Window.onFileDragLeave|Window._onFileDrag|Window._onFileDrop|Window._onmousemove"), NO_Examples, [ ParamDoc( "event", "EventMessage", ObjectDoc([ ("x_pos", "x position", "integer"), ("y_pos", "y position", "integer"), ("xrel", "relative x position", "integer"), ("yrel", "relative y position", "integer"), ("clientX", "client x position", "integer"), ("clientY", "client y position", "integer"), ("files", "Array of filenames", "[string]") ]), NO_Default, IS_Obligated ) ] ) topics = {"left": "integer", "top": "integer", "innerWidth": "integer", "innerHeight": "integer", "outerHeight": "integer", "title": "string" } for i,typed in topics.items(): FieldDoc( "Window." + i, "Set/Get the windows's " + i + " value.", SeesDocs( "'" + "|".join( topics.keys() ) + "'" ), NO_Examples, IS_Static, IS_Public, IS_ReadWrite, typed, NO_Default ) topics = { "cursor": "string", "titleBarColor": "integer", "titleBarControlOffsetX": "integer", "titleBarControlOffsetY": "integer" } for i,typed in topics.items() : expl = "" if i == 'cursor': expl = "\nAllowed values are 'default'|'arrow'|'beam'|'text'|'pointer'|'grabbing'|'drag'|'hidden'|'none'|'col-resize'" FieldDoc( "Window." + i, "Set/Get the windows's " + i + " value.", SeesDocs( "'" +"|".join( topics.keys() ) + "'" ), NO_Examples, IS_Static, IS_Public, IS_ReadWrite, typed, NO_Default ) FunctionDoc( "Window.setSize", "Set the size of the window.", SeesDocs( "Window.center|Window.setPosition|Window.setSize" ), NO_Examples, IS_Static, IS_Public, IS_Fast, [ParamDoc( "width", "The width to set to", "integer", NO_Default, IS_Obligated ), ParamDoc( "heigth", "The heigth to set to", "integer", NO_Default, IS_Obligated ) ], NO_Returns ) FunctionDoc( "Window.openURL", "Open an url in a new browser session.", SeesDocs( "global.window|Window|Window.exec|Window.openURL|Window.open|Window.close|Window.quit" ), NO_Examples, IS_Static, IS_Public, IS_Slow, [ParamDoc( "url", "The url to open", "string", NO_Default, IS_Obligated ) ], NO_Returns ) FunctionDoc( "Window.exec", "Executes a command in the background.", SeesDocs( "global.window|Window|Window.exec|Window.openURL|Window.open|Window.close|Window.quit" ), NO_Examples, IS_Static, IS_Public, IS_Slow, [ParamDoc( "cmd", "The cmd with its arguments", "string", NO_Default, IS_Obligated ) ], NO_Returns ) FunctionDoc( "Window.openDirDialog", "Opens a directory selection dialog.", SeesDocs( "global.window|Window|Window.exec|Window.openURL|Window.open|Window.close|Window.quit" ), NO_Examples, IS_Static, IS_Public, IS_Slow, [CallbackDoc( "fn", "The callback function", [ParamDoc( "list", "List of the selected items", "[string]", NO_Default, IS_Obligated ) ] ) ], NO_Returns ) FunctionDoc( "Window.openFileDialog", "Opens a file selection dialog.", SeesDocs( "global.window|Window|Window.exec|Window.openURL|Window.open|Window.close|Window.quit" ), NO_Examples, IS_Static, IS_Public, IS_Slow, [ParamDoc( "types", "list of allowed extensions or null", "[string]", NO_Default, IS_Obligated ), CallbackDoc( "fn", "The callback function", [ParamDoc( "list", "List of the selected items", "[string]", NO_Default, IS_Obligated ) ] ) ], NO_Returns ) FunctionDoc( "Window.requestAnimationFrame", "Execute a callback for the next frame.", SeesDocs( "global.window|Window|Window.requestAnimationFrame|Window.setFrame" ), NO_Examples, IS_Static, IS_Public, IS_Fast, [ CallbackDoc( "fn", "The callback function", [ParamDoc( "list", "List of the selected items", "[string]", NO_Default, IS_Obligated ) ] ) ], NO_Returns ) FunctionDoc( "Window.center", "Positions the window in the center.", SeesDocs( "global.window|Window|Window.center|Window.setPosition|Window.setSize" ), NO_Examples, IS_Static, IS_Public, IS_Fast, NO_Params, NO_Returns ) FunctionDoc( "Window.center", "Positions the window in the center.", SeesDocs( "global.window|Window|Window.center|Window.setPosition|Window.setSize" ), NO_Examples, IS_Static, IS_Public, IS_Fast, [ParamDoc( "x_pos", "X position", "integer", 0, IS_Obligated ), ParamDoc( "y_pos", "Y position", "integer", 0, IS_Obligated ) ], NO_Returns ) FunctionDoc( "Window.notify", "Send a notification to the systemtray.", SeesDocs( "global.window|Window|Window.notify|Window.setSystemTray" ), NO_Examples, IS_Static, IS_Public, IS_Fast, [ParamDoc( "title", "Title text", "string", NO_Default, IS_Obligated ), ParamDoc( "body", "Body text", "string", NO_Default, IS_Obligated ), ParamDoc( "sound", "Play sound", "boolean", 'false', IS_Optional ) ], NO_Returns ) FunctionDoc( "Window.quit", "Quits this window instance.", SeesDocs( "global.window|Window|Window.exec|Window.openURL|Window.open|Window.close|Window.quit" ), NO_Examples, IS_Static, IS_Public, IS_Slow, NO_Params, NO_Returns ) FunctionDoc( "Window.close", "Closes this window instance.", SeesDocs( "Window.exec|Window.openURL|Window.open|Window.close|Window.quit" ), NO_Examples, IS_Static, IS_Public, IS_Slow, NO_Params, NO_Returns ) FunctionDoc( "Window.notify", "Send a notification to the systemtray.", SeesDocs( "global.window|Window|Window.notify|Window.setSystemTray" ), NO_Examples, IS_Static, IS_Public, IS_Fast, [ParamDoc( "config", "Systemtray", ObjectDoc([("icon", "Icon name", 'string'), ("menu", "array of objects", ObjectDoc([('id', "identifier", "integer"), ("title", "name", "string")], IS_Array)) ]), NO_Default, IS_Obligated ) ], NO_Returns ) FunctionDoc( "Window.setFrame", "Execute a callback for the next frame.", SeesDocs( "global.window|Window|Window.requestAnimationFrame|Window.setFrame" ), NO_Examples, IS_Static, IS_Public, IS_Fast, [ ParamDoc( "x_pos", "x position", "integer|string", '0|center', IS_Obligated ), ParamDoc( "y_pos", "x position", "integer|string", '0|center', IS_Obligated ), ParamDoc( "hh", "? position", "integer", '0', IS_Obligated ), ParamDoc( "nn", "? position", "integer", '0', IS_Obligated ) ], NO_Returns ) FieldDoc( "Window.canvas", "The main canvas instance.", SeesDocs( "global.window|Window|Canvas" ), NO_Examples, IS_Static, IS_Public, IS_ReadWrite, 'Canvas', NO_Default ) NamespaceDoc( "Navigator", "Navigator/browser description.", SeesDocs("global.window|Window|Navigator|Window.navigator|Window.__nidium__"), [ExampleDoc("console.log(JSON.stringify(window.navigator));")] ) navigator = {"language": ('string', "The systems language. Currently fixed on 'us-en'."), "vibrate": ('boolean', "Can this device vibrate (Currently fixed on 'false')."), "appName": ('string', "The browser name (currently fixed on 'nidium')."), "appVersion": ('string', "The browsers build version."), "platform": ('string', "The systems version ('Win32'|'iPhone Simulator'|'iPhone'|'Macintosh'|'Mac'|'MacOSX'|'FreeBSD'|'DragonFly'|'Linux'|'Unix'|'Posix'|'Unknown')."), "userAgent": ('string', 'The browser identification string.') } for i, details in navigator.items(): FieldDoc("Navigator." + i, "Details for this browser concerning: " + i + "\n" + details[1], SeesDocs("global.window|Window|Navigator|Window.navigator"), [ExampleDoc("console.log('" + i + " is now: ' + window.navigator." + i + ");")], IS_Static, IS_Public, IS_Readonly, details[0], NO_Default ) FieldDoc("Window.navigator", "Details for this browser.", SeesDocs("global.window|Window|Navigator|Window.navigator|global.window"), [ExampleDoc("console.log(JSON.stringify(window.navigator));")], IS_Static, IS_Public, IS_Readonly, "Navigator", NO_Default ) FieldDoc("Window.__nidium__", "Details for this browser's framework.", SeesDocs("global.window|Window|Navigator|Window.navigator|Window.__nidium__|global.window"), [ExampleDoc("console.log(JSON.stringify(window.navigator));")], IS_Static, IS_Public, IS_Readonly, ObjectDoc([("version", "The version of nidium", "string"), ("build", "The build identifier", "string"), ("revision", "The revision identifier", "string")]), NO_Default ) ```
Ishkhanasar () is a village in the Sisian Municipality of the Syunik Province in Armenia. Etymology The village is named in honour of Nikoghayos Poghos Mikaelian (nom de guerre: Ishkhan), a resistance leader during the Armenian genocide. Demographics The Statistical Committee of Armenia reported its population as 271 in 2010, up from 147 at the 2001 census. Gallery References Populated places in Syunik Province
Jens Zimmermann (born 9 September 1981) is a German politician of the Social Democratic Party (SPD) who has been serving as a member of the Bundestag from the state of Hesse since 2013. Political career Zimmermann first became a member of the Bundestag in the 2013 German federal election. He is a member of the Finance Committee and the Committee on the Digital Agenda. In this capacity, he is his parliamentary group's rapporteur on measures against money laundering and terrorist financing. In addition to his committee assignments, Zimmermann is part of the German-British Parliamentary Friendship Group. In the negotiations to form a coalition government under the leadership of Chancellor Angela Merkel following the 2017 federal elections, Zimmermann was part of the working group on digital policy, led Helge Braun, Dorothee Bär and Lars Klingbeil. In similar negotiations to form a so-called traffic light coalition of the SPD, the Green Party and the FDP following the 2021 federal elections, he led his party's delegation in the working group on digital policy; his co-chairs from the other parties were Malte Spitz and Andreas Pinkwart. Other activities Federal Financial Supervisory Authority (BaFin), Member of the Administrative Council Business Forum of the Social Democratic Party of Germany, Member of the Political Advisory Board (since 2018) IG BAU, Member German Alpine Club, Member References External links Bundestag biography 1981 births Living people Alumni of Regent's University London Members of the Bundestag for Hesse Members of the Bundestag 2021–2025 Members of the Bundestag 2017–2021 Members of the Bundestag 2013–2017 Members of the Bundestag for the Social Democratic Party of Germany
..."Let Me Sing" is the ninth studio album by American singer Brenda Lee. The album was released December 9, 1963, on Decca Records and was produced by Owen Bradley. The album was the second and final album studio album released by Brenda Lee in 1963. Background and content ..."Let Me Sing" was recorded in five separate recording sessions between August 20, 1961, and May 29, 1963, at the Bradley Film and Recording Studio in Nashville, Tennessee, United States under the direction of producer Owen Bradley. ..."Let Me Sing" contained twelve tracks like all of her previous albums and contained many cover versions of Pop music songs and standards. The album remakes included "Night and Day" by Cole Porter, Bobby Darin's "You're the Reason I'm Living", "At Last" which was recently covered by Etta James, and "End of the World" by Skeeter Davis. Unlike Lee's previous release of 1963, ..."Let Me Sing" contained more recent cover versions of pop songs, mainly from the late 1950s and early 1960s. Greg Adams of AllMusic called the album's use of Pop standards to sound "fresh" unlike her prior releases. Adams reviewed the album and gave it three out of five stars. Adams stated, "..."Let Me Sing" manages to sound vital where very similar albums failed later in her career. Not surprisingly, Let Me Sing was also Lee's second-to-last Top 40 album." The album was originally released on a rpm LP record upon its initial release, containing six songs on the "A-side" of the record and six songs on the "B-side" of the record. The album has since been reissued on a compact disc in both Paraguay and Japan. Release ..."Let Me Sing" released its first single over a year before its initial release. The first single "Break It to Me Gently" was released in January 1962, peaking at #4 on the Billboard Hot 100 and #46 on the UK Singles Chart in the United Kingdom. Its second single "Losing You" was released one year later in April 1963. The single peaked at #6 on the Billboard Hot 100, #2 on the Billboard Easy Listening chart, and #13 on the Billboard R&B chart. It became Lee's last single to chart on the R&B chart during her recording career. The single would also reach #10 on the UK Singles Chart. The album was officially released on December 9, 1963, on Decca Records, later peaking at #39 on the Billboard 200 albums chart. Track listing Side one "Night and Day" – (Cole Porter) 2:33 "End of the World" – (Sylvia Dee, Arthur Kent) 3:05 "Our Day Will Come" – (Mort Garson, Bob Hilliard) 2:32 "You're the Reason I'm Living" – (Bobby Darin) 2:24 "Break It to Me Gently" – (Diane Lampert, Joe Seneca) 2:35 "Where Are You?" – (Harold Adamson, Jimmy McHugh) 2:59 Side two "When Your Lover Has Gone" – (Einar Aaron Swan) 2:09 "Losing You" – (Pierre Havet, Jean Renard, Carl Sigman) 2:28 "I Wanna Be Around" – (Johnny Mercer, Sadie Vimmerstedt) 2:07 "Out in the Cold Again" – (Rube Bloom, Ted Koehler) 3:08 "At Last" – (Mack Gordon, Harry Warren) 2:18 "There Goes My Heart" – (Benny Davis, Abner Silver) 2:47 Personnel Brenton Banks – strings Harold Bradley – guitar Howard Carpenter – strings Floyd Cramer – piano Dottie Dillard – background vocals Ray Edenton – guitar Buddy Harman – drums Lillian Hunt – strings Anita Kerr – background vocals Douglas Kirkham – drums Brenda Lee – lead vocals Grady Martin – guitar Bob Moore – bass Louis Nunley – background vocals Boots Randolph – saxophone Vernel Richardson – strings Bill Wright – background vocals Sales chart positions Album Singles References 1963 albums Brenda Lee albums Albums produced by Owen Bradley Decca Records albums
The 2012 Ms. Olympia contest was an IFBB professional bodybuilding competition and part of Joe Weider's Olympia Fitness & Performance Weekend 2012 was held on September 28, 2012, at the South Hall in the Las Vegas Convention Center in Winchester, Nevada and in the Orleans Arena at The Orleans Hotel and Casino in Paradise, Nevada. It was the 33rd Ms. Olympia competition held. Other events at the exhibition included the 212 Olympia Showdown, Mr. Olympia, Fitness Olympia, Figure Olympia, and Bikini Olympia contests. Prize money 1st $28,000 2nd $14,000 3rd $8,000 4th $5,000 5th $3,000 6th $2,000 Total: $60,000 Results 1st - Iris Kyle 2nd - Debi Laszewski 3rd - Yaxeni Oriquen-Garcia 4th - Alina Popa 5th - Brigita Brezovac 6th - Sheila Bleck 7th - Monique Jones 8th - Anne Freitas 9th - Michelle Cummings 10th - Sarah Hayes 11th - Kim Buck 12th - Helle Trevino 13th - Lisa Giesbrecht Comparison to previous Olympia results: Same - Iris Kyle +2 - Debi Laszewski -1 - Yaxeni Oriquen-Garcia +1 - Alina Popa -2 - Brigita Brezovac Same - Sheila Bleck +2 - Monique Jones +2 - Helle Trevino Scorecard Attended 15th Ms. Olympia attended - Yaxeni Oriquen-Garcia 14th Ms. Olympia attended - Iris Kyle 4th Ms. Olympia attended - Debi Laszewski 3rd Ms. Olympia attended - Sheila Bleck and Helle Trevino 2nd Ms. Olympia attended - Brigita Brezovac, Kim Buck, Monique Jones, and Alina Popa 1st Ms. Olympia attended - Sarah Hayes, Lisa Giesbrecht, Michelle Cummings, and Anne Freitas Previous year Olympia attendees who did not attend - Dayana Cadeau, Cathy LeFrançois, Heather Foster, Tina Chandler, Nicole Ball, Kim Perez, Mah Ann Mendoza, and Skadi Frei-Seifert Notable events This was Iris Kyle's 8th overall Olympia win, thus tied her with Lenda Murray for the most overall Ms. Olympia wins. This was also Iris's 7th consecutive Ms. Olympia win, breaking the record of six consecutive wins she shared with Lenda Murray and Cory Everson. Debi Lazewski placed 2nd this Olympia, the best placing she has ever had at the Olympia. Although Cathy LeFrançois qualified for the 2012 Ms. Olympia, she didn't find out she qualified until 6 weeks until the Olympia and thus did not attend. The song played during the posedown was Gasolina (Lil Jon remix) by Daddy Yankee, Lil Jon, and Pitbull. 2012 Ms. Olympia Qualified Points standings In the event of a tie, the competitor with the best top five contest placings will be awarded the qualification. If both competitors have the same contest placings, than both will qualify for the Olympia. See also 2012 Mr. Olympia References External links 2012 MS. OLYMPIA & FIGURE OLYMPIA (DOWNLOAD) 2012 WOMEN’S OLYMPIA (DVD) 2012 in bodybuilding Ms. Olympia Ms. Olympia History of female bodybuilding Ms. Olympia 2012
Sergio Fabbrini (born 21 February 1949) is an Italian political scientist. He is Head of the Department of Political Science and Professor of Political science and International relations at Libera Università Internazionale degli Studi Sociali Guido Carli in Rome, where he holds the Intesa Sanpaolo Chair on European Governance. He had also the Pierre Keller Visiting Professorship Chair at the Harvard University, Kennedy School of Government (2019/2020). He is the co-founder and former Director of the LUISS School of Government He is also recurrent professor of Comparative Politics at the Institute of Governmental Studies at the University of California at Berkeley. He contributed to build and then served as Director of the School of International Studies at University of Trento in the period 2006-2009. He was the Editor of the Italian Journal of Political Science (Rivista Italiana di Scienza Politica) in the period 2004-2009. He is also an editorialist for the Italian newspaper "Il Sole 24 ore". For his editorials, he was awarded the “Altiero Spinelli Prize 2017”. Background Fabbrini was born in Pesaro. He did his undergraduate and graduate studies at the University of Trento, Italy. Starting his university studies in 1969, he took the four years degree in Sociology in 1973, graduating with laude with a dissertation on the role of the state in Italian post-second world war economic miracle. Because there was not yet a doctoral program in Italy in the 1970s, he got a three years scholarship (1974–1977), equivalent to a Ph.D. program, for specializing in political economy. His research concerned the place of the state and politics in the theories of classical political economists, thus published in the 1977 dissertation on “Thinking Over the Theory of Value of Classical Political Economists”. He then got the equivalent of a four years post-doc fellowship (1977–1981) to investigate “The political economy of the welfare state”, researching at the Department of Economics, Cambridge University, United Kingdom and Department of Economics at Trento University. In the beginning of the 1980s, thanks to a NATO Fellowship and an Italian CNR Scholarship, he researched for three years at the University of California at Riverside and Berkeley. Since the beginning of the 1990s he has taught periodically at the University of California at Berkeley, Department of Political Science and Institute of Governmental Studies. Scholarly contributions He has published fifteen books, two co-authored books and fourteen edited or co-edited books or journals’ special issues, and more than two hundred scientific articles and essays in seven languages in comparative and European government and politics, American government and politics, international relations and foreign policy, Italian government and politics, and political theory. According to a review in 2010: In books and articles over the last decade, Italian political scientist Sergio Fabbrini has been scrambling to understand [the] recent ebb and flow in transatlantic relations. Anti-Americanism in Europe and anti-Europeanism in the United States, Fabbrini argues in America and Its Critics, have challenged the viability of NATO and, prior to Obama’s election, called into question the ability to cooperate on global concerns from terrorism to global warming. At the same time, however, Fabbrini has devoted several articles and an entire book, Compound Democracies, to the thesis that the United States and Europe are converging at an institutional level as examples of what he calls “compound democracies.” Over the long term, in other words, the two political systems are becoming more alike even as the politicians themselves, in the short term, articulate a different set of political values. Regarding his main recent contributions: (1) he brought the analysis of the European Union (EU) back to the comparative framework; (2) he showed that the EU cannot be analyzed with the categories utilized for nation states; (3) he developed a more comprehensive distinction between national democracies on the basis of their functional logic and institutional structure; (4) he elaborated the original model of ‘compound democracy’ for explaining the functioning logic and the institutional structure of democratic unions of states (as the EU, but also the United States and Switzerland), thus distinguishing between unions of states and nation states; (5) he defined an unprecedented model for understanding political leadership in contemporary governmental systems. Teaching He was Jemolo Fellow at the Nuffield College, Oxford University. He was Jean Monnet Chair Professor at the Robert Schuman Center for Advanced Studies, European University Institute in Florence and Visiting Professor in the Department of Political and Social Sciences, European University Institute in Florence. He was Fulbright Assistant Professor at Harvard University in 1987-1988. He lectured, among others, in Canada (Carlton University), in Mexico (El Colegio de México, Mexico City), in Argentina (University of Buenos Aires and Universitad Abierta Interamericana), in Ecuador (Quito Simon Bolivar University), in China (Nanjing University), in Japan (Osaka University, Tokyo Imperial University and Sapporo University), in Thailand (Chulalongkorn University, Bangkok), in the Philippines (University of Philippines-Diliman, Manila) and in several US and European universities. At the LUISS School of Government he is the director of the Master in International Public Affairs, while teaching in other graduate courses offered by the School. Recognition He won the 2017 “Spinelli Prize for political editorials on Europe”, the 2011 “Capalbio Prize for Europe”, the 2009 “Filippo Burzio Prize for the Political Sciences” and the 2006 “Amalfi European Prize for the Social Sciences”. He was awarded an honorary professorship by the Universidad Interamericana of Buenos Aires (Argentina). He was the Editor of the 9-volumes series on “The Institutions of Contemporary Democracies” for the Italian publisher G. Laterza. He is a referee for academic journals such as “American Political Science Review”, “Comparative Political Studies”, “Perspective on Politics”, “Political Behavior”, “European Journal of Political Research”, “West European Politics” and “European Political Science”. He was member of the Steering Committee of the European Consortium for Political Research (ECPR) Standing Group on European Union. He is currently a member of the executive board of the IPSA (International Political Science Association), Research Committee on "European Unification". He is member of several academic associations and organizations. Personal life Married with Manuela Cescatti, they have two sons. Books by Fabbrini In English and Spanish ‘Institutions and Decision-Making in the EU’, in Ramona Coman, Amandine Crespy and Vivien Schmidt (eds.), Governance and Politics in the Post-Crisis European Union, Cambridge, Cambridge University Press, 2020, Chapter 3, pp. 54-73 ‘The Governance of the European Union: Which Role for National Governments?’, in Jae-Jae Spoon and Nils Ringe (eds.), The European Union and Beyond: Multi-level Governance, Institutions, and Policy-Making, London, Rowman and Littlefield, ECPR Press, 2020, pp.233-252 ‘Decoupling and Federalizing: Europe after the Multiple Crises’, in Mark Harwood, Stefan Moncada and Roderick Pace (eds.), The Future of the European Union: Demisting the Debate, University of Malta: The Institute of European Studies, 2020, pp. 28–41 ‘Between power and influence: the European parliament in a dual constitutional regime’, in Edoardo Bressanelli and Nicola Chelotti (eds.), The European Parliament in Contested Union: Power and Influence Post-Lisbon, London, Routledge, 2020, pp Europe's Future, Decoupling and Reforming, Cambridge, Cambridge University Press, 2019 (with Vivien Schmidt, eds.) ‘Imagining the Future of Europe: Between Multi-Speed Differentiation and Institutional Decopupling’, Special issue, Comparative European Politics, 17, n.2, 2019 (with Raffaele Marchetti, eds.) Still a Western World? Continuity and Change in Global Order, London, Routledge, 2016. (with Uwe Puetter, eds.) ‘Integration Without Supranationalisation: The Central Role of the European Council in Post-Lisbon EU Politics’, Special issue, Journal of European Integration, 38, n. 5, 2016. Which European Union? Europe After the Euro Crisis, Cambridge, Cambridge University Press, 2015. (with Marc Lazar, eds.)The Italian elections: The electoral roots and the political consequences of the 24-25 February 2013 Italian elections, Special Issue, Contemporary Italian Politics, 5, n.2, July 2013 Compound Democracies: Why the United States and Europe Are Becoming Similar, Oxford, New York, N.Y., Oxford University Press, paperback, 2010, revised and updated edition. El ascenso del Principe democratico. Quién gobierna y como se gobiernan las democracias, Buenos Aires, Fonde de Cultura Economica, 2009. America and Its Critics. Virtues and Vices of the Democratic Hyper-power. Cambridge, Polity Press, 2008. (with Michael Cox, eds.), The Transatlantic Relationship: The Marriage Without End?, Symposium in European Political Science, 10, n. 2, March 2011. (with Simona Piattoni, eds.), Italy in the European Union: Redefining National Interest in a Compound Polity, Lanham, Maryland, Rowman and Littlefield, 2008. (ed.), The United States Contested. American Unilateralism and European Discontent. London-New York, Routledge, 2006. (ed.), Democracy and Federalism in the European Union and the United States. Exploring Post-National Governance. London-New York, Routledge, 2005). (with Vincent Della Sala, eds.), Italian Politics: Italy between Europeanization and Domestic Politics. New York, N.Y. Oxford: Berghahn, 2004. p. 276. Italian Politics, vol. 19. (with Simona Piattoni, eds.), Italy in the EU: Pigmy or Giant? The role of Italian actors in the EU policy-making. Special issue of Modern Italy, 9, n.2, November 2004. (with Julio Echeverria, eds.), Gobernancia Global Y Bloques Regionales. Una perspectiva Comparada: Europa, América, Asia. Quito, Ecuador: Corporacion Editora Nacional, 2003. (ed.), Nation, Federalism and Democracy: The EU, Italy and the American Federal Experience. Bologna, Editrici Compositori, 2001. In Italian Prima l'Europa, Milano, Il Sole 24Ore, 2020 Manuale di autodifesa europeista, Roma, Luiss University Press, 2019 Sdoppiamento. Una prospettiva nuova per l’Europa, 2017, seconda edizione, Laterza; Addomesticare il Principe. Perché I leader contano e come controllarli, Venice, Marsilio, 2011 Politica Comparata. Introduzione alle Democrazie Contemporanee. Roma-Bari, Laterza, 2008. L'America e i suoi critici. Virtù e vizi dell' iperpotenza democratica, Bologna: Mulino, 2005, 2° edizione 2006. Tra pressioni e veti. Il cambiamento politico in Italia. Roma-Bari, Laterza, 2000. Il Principe democratico. La leadership nelle democrazie contemporanee, Roma-Bari, Laterza, 1999. Le regole della democrazia. Guida alle riforme. Roma-Bari, Laterza, 1997. Quale democrazia. L'Italia e gli altri. Roma-Bari, Laterza, 1994, 1998 (2nd ed.), 1999 (3rd ed.). Il presidenzialismo degli Stati Uniti. Roma-Bari, Laterza, 1993. Politica e mutamenti sociali. Alternative a confronto sullo stato sociale. Bologna, Il Mulino, 1988. Neoconservatorismo e politica americana. Attori e processi politici in una società in trasformazione. Bologna, Il Mulino, 1986. (with Salvatore Vassallo), Il governo. Gli esecutivi delle democrazie contemporanee. Roma-Bari, Laterza, 1999, 2002 (2nd ed). (with Vincenzo Lippolis and Giulio M. Salerno, eds.), Governare le democrazie. Esecutivi, leader e sfide, special issue of Il Filangieri, Quaderno 2010. (ed.), L’europeizzazione dell’Italia. L’impatto dell’Unione Europea sulle istituzioni e le politiche italiane. Roma-Bari, Laterza, 2003. (ed.), L'Unione Europea. Le istituzioni e gli attori di un sistema sovranazionale. Roma-Bari, Laterza, 2002, p. 373. (with Francesc Morata, eds.), L'Unione Europea: le Politiche Pubbliche. Roma-Bari, Laterza, 2002. (ed.), Robert A. Dahl: Politica e virtù. La teoria democratica del nuovo secolo. Roma-Bari, Laterza, 2001. (with Giuseppe Di Palma and Giorgio Freddi, eds.), Condannata al successo? L’Italia nell’ Europa integrata . Bologna, Il Mulino, 2000. References 1949 births Living people Italian political scientists
```go /* path_to_url Unless required by applicable law or agreed to in writing, software WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ package v1 import ( "strings" "github.com/hashicorp/vault/api" "github.com/libopenstorage/secrets" "github.com/libopenstorage/secrets/vault" ) var ( VaultTLSConnectionDetails = []string{api.EnvVaultCACert, api.EnvVaultClientCert, api.EnvVaultClientKey} ) // IsEnabled return whether a KMS is configured func (kms *KeyManagementServiceSpec) IsEnabled() bool { return len(kms.ConnectionDetails) != 0 } // IsTokenAuthEnabled return whether KMS token auth is enabled func (kms *KeyManagementServiceSpec) IsTokenAuthEnabled() bool { return kms.TokenSecretName != "" } // IsK8sAuthEnabled return whether KMS Kubernetes auth is enabled func (kms *KeyManagementServiceSpec) IsK8sAuthEnabled() bool { return getParam(kms.ConnectionDetails, vault.AuthMethod) == vault.AuthMethodKubernetes && kms.TokenSecretName == "" } // IsVaultKMS return whether Vault KMS is configured func (kms *KeyManagementServiceSpec) IsVaultKMS() bool { return getParam(kms.ConnectionDetails, "KMS_PROVIDER") == secrets.TypeVault } func (kms *KeyManagementServiceSpec) IsAzureMS() bool { return getParam(kms.ConnectionDetails, "KMS_PROVIDER") == secrets.TypeAzure } // IsIBMKeyProtectKMS return whether IBM Key Protect KMS is configured func (kms *KeyManagementServiceSpec) IsIBMKeyProtectKMS() bool { return getParam(kms.ConnectionDetails, "KMS_PROVIDER") == "ibmkeyprotect" } // IsKMIPKMS return whether KMIP KMS is configured func (kms *KeyManagementServiceSpec) IsKMIPKMS() bool { return getParam(kms.ConnectionDetails, "KMS_PROVIDER") == "kmip" } // IsTLSEnabled return KMS TLS details are configured func (kms *KeyManagementServiceSpec) IsTLSEnabled() bool { for _, tlsOption := range VaultTLSConnectionDetails { tlsSecretName := getParam(kms.ConnectionDetails, tlsOption) if tlsSecretName != "" { return true } } return false } // getParam returns the value of the KMS config option func getParam(kmsConfig map[string]string, param string) string { if val, ok := kmsConfig[param]; ok && val != "" { return strings.TrimSpace(val) } return "" } ```
The Devil to Pay is a 1920 American silent mystery film directed by Ernest C. Warde and starring Roy Stewart, Robert McKim and Fritzi Brunette. Cast Roy Stewart as Cullen Grant Robert McKim as Brent Warren Fritzi Brunette as Dare Keeling George Fisher as Larry Keeling Evelyn Selbie as Mrs. Roan Joseph J. Dowling as George Roan Richard Lapan as Dick Roan Mark Fenton as Dr. Jernigan William Marion as Detective Potter References Bibliography Goble, Alan. The Complete Index to Literary Sources in Film. Walter de Gruyter, 1999. External links 1920 films 1920 mystery films English-language mystery films Films directed by Ernest C. Warde American silent feature films 1920s English-language films Pathé Exchange films American black-and-white films 1920s American films Silent American mystery films
The 2020 Judo Grand Prix Tel Aviv was held in Tel Aviv, Israel, from 23 to 25 January 2020. Medal summary Men's events Women's events Source Results Medal table References External links 2020 IJF World Tour 2020 Judo Grand Prix Judo Judo Judo 2020
Marcus M. Marks (March 18, 1858 – August 26, 1934) was an American businessman who was president of the Daylight Saving Association, president of the Clothiers' Association, and Manhattan Borough President from 1914 to 1917. He assisted in establishing the Tuberculosis Preventorium for Children. Biography He was born on March 18, 1858, in Schenectady, New York. In 1877, he started his first business in Passaic, New Jersey, and later started work at the wholesale clothing firm of his father, David Marks & Sons. He was president of the Clothiers' Association of New York, and president of the National Association of Clothiers, president of the Clothing Trade Association of New York, and chairman of the Hospital Saturday and Sunday Association Trade Auxiliary. He later served also as trustee of the Hospital Saturday and Sunday Association, director of the Educational Alliance, member of the Conciliation Committee of the National Civic Federation, director of the National Butchers' and Drovers' Bank. Personal life Marks married the suffragist, Esther Friedman, on May 21, 1890. She died on April 22, 1937. He died on August 26, 1934. Marks was the brother of Louis B. Marks (1869-1939), a leading illumination (lighting) engineer. Louis’ son was songwriter Johnny Marks (1909-1985), who wrote “Rudolph the Red-Nosed Reindeer”. Marcus and Esther Marks had two daughters: Bernice Marks married (and divorced) Robert B. Stearns, co-founder of Bear Stearns. Doris Marks married industrial designer Henry Dreyfuss. References External links 1858 births 1934 deaths Manhattan borough presidents Jewish American people in New York (state) politics Missing middle or first names Politicians from Schenectady, New York Businesspeople from New York City
Search and Rescue Optimal Planning System (SAROPS) is a comprehensive search and rescue (SAR) planning system used by the United States Coast Guard in the planning and execution of almost all SAR cases in and around the United States and the Caribbean. SAROPS has three main components: The Graphical User Interface (GUI), the Environmental Data Server (EDS) and the Simulator (SIM). Using the Commercial Joint Mapping Tool Kit's (C/JMTK) government licensing of the Geographic Information System (GIS) SAROPS can be used in both a coastal and oceanic environment. Built into the simulator is the ability to access global and regional wind and current data sets making SAROPS the most comprehensive and powerful tool available for maritime SAR planners. Historical search planning tools Prior to SAROPS, SAR controllers in the U.S. Coast Guard used the Computer Assisted Search Planning (CASP) and Joint Automated Work Sheets (JAWS), which used dated search planning techniques and algorithms. More specifically, CASP was based on old computing technology and JAWS was taken directly from pen and pencil techniques for shorter durations of drift in coastal environments. Environmental data consisted of low-resolution (1-degree latitude/longitude grid) wind and current information that was applied every 12 hours. For most areas, CASP used monthly-averaged current values while JAWS used one wind and current value during the SAR case. Neither system was capable of accessing timely high-resolution wind nor current model output, which was a significant disadvantage since one of the main components that determine the accuracy of the drift solution is the presence of precise and accurate wind and current information for the given area of interest. Motivation for the development of SAROPS The U.S. Coast Guard uses a systematic approach for search and rescue operations. There are five SAR stages for any case: Awareness, Initial Actions, Planning, Operations and Conclusions. Upon becoming aware of a case from a "MAYDAY" call or other form of communication, SAR controllers work to gather data about the case and more often than not, there are many uncertainties in the initial report. The controller, then, must develop a search area based upon the information, estimate resource availability and capability, promulgate the search plan and deploy the resources. While the assets are conducting a search, the controller begins the process again by gathering additional information, developing a subsequent search, deploying resources and evaluating previous searches. This process continues until the survivors are found and rescued or proper authorities suspend the SAR case. Consequently, there is a need for a tool that is fast, simple, minimizes data entry, minimizes potential for error, can access high-resolution environmental data, and create search action plans that maximize the probability of success. Furthermore, the National Search and Rescue Plan of the United States (2007), challenges search and rescue communities in the following passage: Recognizing the critical importance of reduced response time in successful rescue and similar efforts, a continual focus will be maintained on developing and implementing means to reduce the time required for: a. Receiving alerts and information associated with distress situations; b. Planning and coordinating operations; c. Facility transits and searches; d. Rescues; and e. Providing immediate assistance, such as medical assistance, as appropriate. If this is not motivation enough, a USCG rotary-wing aircraft costs $9–14K per hour and a USCG cutter costs $3–15K per hour to operate. Reducing the time an aircraft is airborne or a cutter is in a search area can considerably reduce taxpayer costs as well as save lives and property. The U.S. Coast Guard contracted Northrop Grumman Corporation, Applied Science Associates (ASA), and Metron Inc., to develop a comprehensive system that included the latest graphical divergence parameters, Leeway divergence parameters, and Monte Carlo methods to improve the probability of success of search cases. SAROPS meets and exceeds these expectations by minimize planning and response time frames. SAROPS components SAROPS is made up of the Graphical User Interface (GUI), the Environmental Data Server (EDS) and the Simulator (SIM). Graphical User Interface (GUI) The Graphical User Interface uses the Environmental Systems Research Institute (ESRI) Geographic Information System (ArcGIS) and has been altered to include U.S. Coast Guard specific applications such as the SAR Tools Extension and SAROPS Extension. The applications have a wizard-based interface and work within the ArcGIS layered environment. Vector and raster charts are available for display as well as search plans, search patterns, search area environmental data, and probability maps. Finally, the GUI provides reports on all search operations. Environmental Data Server (EDS) The Environmental Data Server (EDS) collects and stores environmental information for use within SAROPS. Local SAROPS servers around the United States request environmental information from the EDS based upon the area of interest. Different environmental products are cataloged on the server ranging from observational systems to modeling products. Observations include sea surface temperature, air temperature, visibility, wave height, global/region tides and currents to name a few. High-resolution model output from operational forecast models like the hybrid coordinate ocean model (HYCOM) and Global NRL Coastal Ocean (NCOM) provide temporally and spatially varying wind and current information. Lastly, the EDS is capable of providing objective analysis tools and aggregation. The list of available products is always changing as researchers in the Navy, local universities and research centers continually improve the accuracy and reliability of products and make them available on a consistent basis. SAROPS Simulator (SIM) Definitions Probability of Containment (POC): The likelihood of the search object being contained within the boundaries of some area. It is possible to achieve 100% POC by making the area larger and larger until all possible locations are covered. Probability of Detection (POD): The likelihood of detecting an object or recognizing the search object. Different aircraft, environmental conditions and search object types can give a different probability of detection. Generally, the probability of detection decreases with increasing distance from the search object. Probability of Success (POS): The likelihood that a search object will be found. POS depends upon the POC and the POD. POS = POC x POD Simulator Wizard The simulator wizard makes use of multiple pages of scenario descriptions that are entered by the user in order to compute the possible distress positions and times, subsequent search object drift trajectories, and the effect of completed searches on the search object probabilities. The simulator captures uncertainty in positions, time environmental inputs and leeway parameters. Upon receiving all of the information pertinent to the case, the simulator, using Markov's Monte Carlo method, simulates the drift of up to 10,000 particles for each scenario. For every 20 minutes of drift, the simulator accounts for changes in water current, wind leeway and leeway divergence. The simulator displays the results as a probability density map that can be animated over the drift duration. Figure 1 depicts this type of map. The ensemble trajectory model, random walk and random flight model governing equations are fully explained in Breivik and Allen (2008) and Spaulding, et al. (2005) that is located within O'Donnell, et al. (2005). In short, the goal of the simulator is to maximize the probability of success. Optimal Planning Wizard The optimal planning wizard takes the probability map information as well as another set of user inputs such as the type of resources, on scene conditions and sweep width values to develop search areas that maximize the POS. The search areas can be adjusted by the SAR controller to further maximize POS. Armed with the best possible fit given available resources, the SAR controller can then transmit the search pattern to the search assets. If the search object is not found on the first search, the optimal planning wizard will account for previous unsuccessful searches when recommending subsequent searches. Applications outside of search and rescue SAROPS may be expanded to include other applications outside of search and rescue. These applications may include but are not limited to the projection of fisheries stocks and oil spill projections. Real world use SAROPS was utilized in the response to the Deepwater Horizon explosion and assisted in the ultimate recovery of 115 persons. References External links Software for SAR patterns in GPX - Navigational Algorithms Manual Emergency services in the United States United States Coast Guard Disaster management tools
```objective-c // planetgrid.h // // Longitude/latitude grids for ellipsoidal bodies. // // Initial version by Chris Laurel, claurel@gmail.com // // This program is free software; you can redistribute it and/or // as published by the Free Software Foundation; either version 2 #pragma once #include <celengine/referencemark.h> #include <celrender/linerenderer.h> class Body; class Renderer; class PlanetographicGrid : public ReferenceMark { public: /*! Three different longitude conventions are in use for * solar system bodies: * Westward is for prograde rotators (rotation pole above the ecliptic) * Eastward is for retrograde rotators * EastWest measures longitude both east and west, and is used only * for the Earth and Moon (strictly because of convention.) */ enum LongitudeConvention { EastWest, Westward, Eastward, }; /*! NorthReversed indicates that the north pole for this body is /not/ * the rotation north. It should be set for retrograde rotators in * order to conform with IAU conventions. */ enum NorthDirection { NorthNormal, NorthReversed }; PlanetographicGrid(const Body& _body); ~PlanetographicGrid() = default; void render(Renderer* renderer, const Eigen::Vector3f& pos, float discSizeInPixels, double tdb, const Matrices& m) const override; float boundingSphereRadius() const override; void setIAULongLatConvention(); static void deinit(); private: static celestia::render::LineRenderer *latitudeRenderer; static celestia::render::LineRenderer *equatorRenderer; static celestia::render::LineRenderer *longitudeRenderer; static bool initialized; static void InitializeGeometry(const Renderer&); const Body& body; float minLongitudeStep{ 10.0f }; float minLatitudeStep{ 10.0f }; LongitudeConvention longitudeConvention{ Westward }; NorthDirection northDirection{ NorthNormal }; }; ```
Japanese prehistoric art is a wide-ranging category, spanning the Jōmon (c. 10,000 BCE – 350 BCE) and Yayoi periods (c. 350 BCE – 250 CE), and the entire Japanese archipelago, including Hokkaidō in the north, and the Ryukyu Islands in the south which were politically not part of Japan until the late 19th century. Much about these two periods remains unknown, and debates continue among scholars regarding the nature of the cultures and societies of the period, their number and the extent to which they can be considered to be united, uniform cultures across the archipelago, and across time. Jōmon art The Jōmon people are generally said to have been the first settlers of Japan. Nomadic hunter-gatherers who later practice organized farming and built cities, the Jōmon people are named for the "cord-markings", impressions made with rope, found as decorations on pottery of this time, a term which was first applied to the pottery, and the culture, by American Edward Sylvester Morse. Jōmon pottery is said by many scholars to be the oldest yet discovered in the world. The Jōmon communities consisted of hundreds or even thousands of people, who dwelt in simple houses of wood and thatch set into shallow earthen pits to provide warmth from the soil. They crafted lavishly decorated pottery storage vessels, clay figurines called dogū, and crystal jewels. The oldest examples of Jōmon pottery have flat bottoms, though pointed bottoms (meant to be held in small pits in the earth, like an amphora) became common later. In the Middle Jōmon period (3000-2000 BCE), simple decorations made with cord or through scratching gave way to highly elaborate designs. So-called flame vessels, along with the closely related crown-formed vessels, are among the most distinctive forms from this period; representative forms such as clay figurines of people and animals also appeared around this time. These figurines, called dogū, are often described as "goggle-eyed", and feature elaborate geometrical designs, and short, stubby limbs. Scholars speculate they had religious significance and were used in fertility and healing rituals. Yayoi art The next wave of immigrants was the Yayoi people, named for the district in Tokyo where remnants of their settlements first were found. These people, arriving in Japan about 350 BCE, brought their knowledge of wetland rice cultivation, the manufacture of copper weapons and bronze bells (dōtaku), and wheel-thrown, kiln-fired ceramics. Along with introducing bronze casting and other technologies into the islands, the Yayoi people, who are generally believed to have come from the continent, brought cultural influences from the southern part of China. Chinese expansion under the Qin (221-206 BCE) and Han (206 BCE-220 CE) Dynasties is said to have been one of the primary impetuses for migrations to the Japanese archipelago, which brought with it cultural influences and new technologies. Artifacts brought to the islands at this time had a powerful effect upon the development of Japanese art, by presenting objects to imitate and copy, such as bronze mirror,(Shinju-kyo) from Chinese mythology. The Yayoi people brought Japan into the Iron Age around the 3rd century CE. Yayoi period pottery tends to be smoother than that of Jōmon, and more frequently features decorations made with sticks or combs, rather than rope. See also List of National Treasures of Japan (archaeological materials) References and notes This article covers the art of the Jōmon and Yayoi periods of Japanese history. Japanese art | Yamato period > Prehistoric Prehistoric art Jōmon period Yayoi period
```xml /* * MTSwapChain.mm * */ #include "MTSwapChain.h" #include "MTTypes.h" #include "RenderState/MTRenderPass.h" #include "../TextureUtils.h" #include "../../Core/Assertion.h" #include <LLGL/Platform/NativeHandle.h> #include <LLGL/TypeInfo.h> #ifdef LLGL_OS_IOS @implementation MTSwapChainViewDelegate { LLGL::Canvas* canvas_; } -(nonnull instancetype)initWithCanvas:(LLGL::Canvas&)canvas; { self = [super init]; if (self) canvas_ = &canvas; return self; } - (void)drawInMTKView:(nonnull MTKView *)view { if (canvas_) canvas_->PostDraw(); } - (void)mtkView:(nonnull MTKView *)view drawableSizeWillChange:(CGSize)size { // dummy } @end #endif // /LLGL_OS_IOS namespace LLGL { MTSwapChain::MTSwapChain( id<MTLDevice> device, const SwapChainDescriptor& desc, const std::shared_ptr<Surface>& surface, const RendererInfo& rendererInfo) : SwapChain { desc }, renderPass_ { device, desc } { /* Initialize surface for MetalKit view */ SetOrCreateSurface(surface, SwapChain::BuildDefaultSurfaceTitle(rendererInfo), desc.resolution, desc.fullscreen); /* Allocate and initialize MetalKit view */ view_ = AllocMTKViewAndInitWithSurface(device, GetSurface()); /* Initialize color and depth buffer */ view_.framebufferOnly = NO; //TODO: make this optional with create/bind flag view_.colorPixelFormat = renderPass_.GetColorAttachments()[0].pixelFormat; view_.depthStencilPixelFormat = renderPass_.GetDepthStencilFormat(); view_.sampleCount = renderPass_.GetSampleCount(); /* Show default surface */ if (!surface) ShowSurface(); } bool MTSwapChain::IsPresentable() const { return true; //TODO } void MTSwapChain::Present() { /* Present backbuffer */ [view_ draw]; /* Release mutable render pass as the view's render pass changes between backbuffers */ if (nativeMutableRenderPass_ != nil) { [nativeMutableRenderPass_ release]; nativeMutableRenderPass_ = nil; } } std::uint32_t MTSwapChain::GetCurrentSwapIndex() const { return 0; // dummy } std::uint32_t MTSwapChain::GetNumSwapBuffers() const { return 1; // dummy } std::uint32_t MTSwapChain::GetSamples() const { return static_cast<std::uint32_t>(renderPass_.GetSampleCount()); } Format MTSwapChain::GetColorFormat() const { return MTTypes::ToFormat(view_.colorPixelFormat); } Format MTSwapChain::GetDepthStencilFormat() const { return MTTypes::ToFormat(view_.depthStencilPixelFormat); } const RenderPass* MTSwapChain::GetRenderPass() const { return (&renderPass_); } static NSInteger GetPrimaryDisplayRefreshRate() { constexpr NSInteger defaultRefreshRate = 60; if (const Display* display = Display::GetPrimary()) return static_cast<NSInteger>(display->GetDisplayMode().refreshRate); else return defaultRefreshRate; } bool MTSwapChain::SetVsyncInterval(std::uint32_t vsyncInterval) { if (vsyncInterval > 0) { #ifdef LLGL_OS_MACOS /* Enable display sync in CAMetalLayer */ [(CAMetalLayer*)[view_ layer] setDisplaySyncEnabled:YES]; #endif /* Apply v-sync interval to display refresh rate */ view_.preferredFramesPerSecond = GetPrimaryDisplayRefreshRate() / static_cast<NSInteger>(vsyncInterval); } else { #ifdef LLGL_OS_MACOS /* Disable display sync in CAMetalLayer */ [(CAMetalLayer*)[view_ layer] setDisplaySyncEnabled:NO]; #else /* Set preferred frame rate to default value */ view_.preferredFramesPerSecond = GetPrimaryDisplayRefreshRate(); #endif } return true; } MTLRenderPassDescriptor* MTSwapChain::GetAndUpdateNativeRenderPass( const MTRenderPass& renderPass, std::uint32_t numClearValues, const ClearValue* clearValues) { /* Create copy of native render pass descriptor for the first time */ if (nativeMutableRenderPass_ == nil) nativeMutableRenderPass_ = [GetNativeRenderPass() copy]; /* Update mutable render pass with clear values */ if (renderPass.GetColorAttachments().size() == 1) renderPass.UpdateNativeRenderPass(nativeMutableRenderPass_, numClearValues, clearValues); return nativeMutableRenderPass_; } /* * ======= Private: ======= */ #ifndef LLGL_OS_IOS static NSView* GetContentViewFromNativeHandle(const NativeHandle& nativeHandle) { if ([nativeHandle.responder isKindOfClass:[NSWindow class]]) { /* Interpret responder as NSWindow */ return [(NSWindow*)nativeHandle.responder contentView]; } if ([nativeHandle.responder isKindOfClass:[NSView class]]) { /* Interpret responder as NSView */ return (NSView*)nativeHandle.responder; } LLGL_TRAP("NativeHandle::responder is neither of type NSWindow nor NSView for MTKView"); } #endif MTKView* MTSwapChain::AllocMTKViewAndInitWithSurface(id<MTLDevice> device, Surface& surface) { MTKView* mtkView = nullptr; NativeHandle nativeHandle = {}; GetSurface().GetNativeHandle(&nativeHandle, sizeof(nativeHandle)); /* Create MetalKit view */ #ifdef LLGL_OS_IOS LLGL_ASSERT_PTR(nativeHandle.view); UIView* contentView = nativeHandle.view; /* Allocate MetalKit view */ mtkView = [[MTKView alloc] initWithFrame:contentView.frame device:device]; /* Allocate view delegate to handle re-draw events */ viewDelegate_ = [[MTSwapChainViewDelegate alloc] initWithCanvas:CastTo<Canvas>(GetSurface())]; [viewDelegate_ mtkView:mtkView drawableSizeWillChange:mtkView.bounds.size]; [mtkView setDelegate:viewDelegate_]; #else // LLGL_OS_IOS NSView* contentView = GetContentViewFromNativeHandle(nativeHandle); /* Allocate MetalKit view */ CGRect contentViewRect = [contentView frame]; CGRect relativeViewRect = CGRectMake(0.0f, 0.0f, contentViewRect.size.width, contentViewRect.size.height); mtkView = [[MTKView alloc] initWithFrame:relativeViewRect device:device]; #endif // /LLGL_OS_IOS /* Add MTKView as subview and register rotate/resize layout constraints */ mtkView.translatesAutoresizingMaskIntoConstraints = NO; NSDictionary* viewsDictionary = @{@"mtkView":mtkView}; [contentView addSubview:mtkView]; [contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"|[mtkView]|" options:0 metrics:nil views:viewsDictionary]]; [contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[mtkView]|" options:0 metrics:nil views:viewsDictionary]]; return mtkView; } bool MTSwapChain::ResizeBuffersPrimary(const Extent2D& /*resolution*/) { /* Invoke a redraw to force an update on the resized multisampled framebuffer */ [view_ draw]; return true; } } // /namespace LLGL // ================================================================================ ```
Bartolovci is a village in Croatia. References Populated places in Brod-Posavina County
"Oh No, Not You Again" is a song by English rock band the Rolling Stones, included on their 2005 hit album A Bigger Bang. The song is listed as the tenth track on the album, and was written by Mick Jagger and Keith Richards. Features Mick Jagger on lead, backing vocals and bass, Keith Richards on lead guitar, Ronnie Wood on rhythm guitars, and Watts on drums. Brief history "Oh No, Not You Again" is one of the most well-known tracks from A Bigger Bang, the Stones' first new studio album since 1997's Bridges to Babylon. The song was used in media campaigns and tour promotions for the band. It was the first new song from A Bigger Bang played for a public audience in a surprise performance at the Juilliard School in New York City. Throughout the 2005–2006 A Bigger Bang Tour, which has carried the Stones throughout North America and Europe, "Oh No, Not You Again" has been played continuously and received generally well by fans and critics alike, although critics have noted the similarities in structure to previous Rolling Stones efforts from the early 1970s. The song got significant rock radio airplay in the US, reaching #34 on Billboards Mainstream Rock Tracks in December 2005. Charlie Watts jokingly said that the song's title should also be the name of the album, referring to the band's constant return to the studio. Next single rumors The tune was erroneously believed to be the next single released from A Bigger Bang in Spring 2006. This rumor was proved false when in April 2006 it was announced that the European summer single would be "Biggest Mistake". The Rolling Stones songs 2005 songs Songs written by Jagger–Richards Song recordings produced by Don Was
Kalka is a town in Haryana, India Kalka may also refer to: Khalkha Mongols, a Mongol ethnicity Kalka, South Australia Kalchyk (river) (modern name Kalchyk), a river in Ukraine Kalka, Pomeranian Voivodeship, a village in Kartuzy County, Poland Kałka, a village in Człuchów County, Poland Kalka Mandir, Delhi, an ancient Kali temple in Kalkaji, New Delhi Kalka Dass, Indian politician Kalka (1983 film), a 1983 Indian action film Kalka (1989 film), a 1989 Pakistani action film See also Battle of the Kalka River
Jacques Rougerie may refer to: Jacques Rougerie (architect) (born 1945), French architect-oceanographer Jacques Rougerie (historian) (1932–2022), historian of the Paris Commune Jacques Rougerie (rugby union) (born 1945), French rugby union player
Kent Bede Bernard (born 27 May 1942) is a Trinidadian athlete who competed mainly in the 400 metres. He competed for Trinidad and Tobago in the 1964 Summer Olympics held in Tokyo, Japan in the 4 x 400 metre relay where he won the bronze medal with his teammates Edwin Skinner, Edwin Roberts and Wendell Mottley. References Sports Reference Trinidad and Tobago male sprinters Olympic bronze medalists for Trinidad and Tobago Athletes (track and field) at the 1964 Summer Olympics Olympic athletes for Trinidad and Tobago Athletes (track and field) at the 1966 British Empire and Commonwealth Games Athletes (track and field) at the 1970 British Commonwealth Games Commonwealth Games gold medallists for Trinidad and Tobago Commonwealth Games silver medallists for Trinidad and Tobago Athletes (track and field) at the 1971 Pan American Games 1942 births Living people Commonwealth Games medallists in athletics Michigan Wolverines men's track and field athletes Medalists at the 1964 Summer Olympics Olympic bronze medalists in athletics (track and field) Pan American Games medalists in athletics (track and field) Pan American Games bronze medalists for Trinidad and Tobago Medalists at the 1971 Pan American Games Medallists at the 1966 British Empire and Commonwealth Games
St Andrew's Church is an Anglican church in Leyland, Lancashire, England. It is an active Anglican parish church in the Diocese of Blackburn and the archdeaconry of Blackburn. The church is recorded in the National Heritage List for England as a designated Grade II* listed building. History Historically, the ecclesiastical parish of Leyland was large and encompassed the townships of Leyland, Euxton, Cuerden, Clayton-le-Woods, Whittle-le-Woods, Hoghton, Withnell, Wheelton, and Heapey. There was likely a Norman church on the site of the present structure. In the 12th century, Warine Bussel, baron of Penwortham, gave the church to Evesham Abbey in Worcestershire. From the 14th century, vicars were appointed to Leyland church by the abbey. Following the Dissolution of the Monasteries in the 16th century, the advowson for the church (the right to nominate a priest) was transferred to John Fleetwood of Penwortham. The chancel was built in the 14th century and the tower probably dates from the late 15th or early 16th century. The older nave was replaced 1816–17, to a design by a Mr Longworth. The church was restored in 1874 by Lancaster-based architecture firm Paley and Austin. The nave roof was replaced 1951–53, and the chancel roof in 1956. Present day St Andrew's was designated a Grade II* listed building on 26 July 1951. St Andrew's is an active parish church in the Anglican Diocese of Blackburn, which is part of the Province of York. It is in the archdeaconry of Blackburn and the Deanery of Leyland. St Andrew's is within the Conservative Evangelical tradition of the Church of England. The parish has passed resolutions that rejects the leadership/ordination of women. Architecture Exterior St Andrew's in constructed of stone; its roofs are stone slate and copper. The plan consists of a nave with a square tower to the west and a chancel to the east. North of the chancel is a vestry. The tower is crenellated with four-stage buttresses at its corners and has a moulded plinth. Three sides of the tower have clocks and there are three-light, arched belfry louvres on all sides. The Gothic-style nave has a crenellated parapet and a copper roof. It has five three-light windows in its north and south walls. The windows are arched, with tracery. The chancel is low and narrow in comparison to the nave. Its three-light, arched windows also have tracery. The east window has three lights under a pointed arch, with chamfered mullions. Interior and fittings The inside of the tower measures square. The floor is lower than that of the nave and there are five steps through a tall arch that has chamfered orders. Internally, the nave measures by . There are three galleries. In the southeast corner, there is a chapel. The chancel measures by internally. It is accessed from the nave through a moulded arch with circular piers. There are Perpendicular-style triple sedilia (seats) in the south wall of the chancel, under semi-circular arches. They have moulded labels and next to them is a piscina (basin) with two bowls under a similar arch. Stained glass in the church includes work by Clayton and Bell and Harry Stammers. There are monuments from the 18th and 19th centuries and the Faringdon Chapel in the nave has 19th-century brasses. External features To the east of the chancel there is a small early 19th-century watch and hearse house. It is constructed of ashlar and has a slate roof. The churchyard also contains the war graves of 15 Commonwealth service personnel of World War I, and three of World War II. See also Grade II* listed buildings in Lancashire Listed buildings in Leyland, Lancashire List of ecclesiastical works by Paley and Austin References Citations Sources External links Leyland Leyland Leyland Leyland Paley and Austin buildings Leyland, Lancashire Conservative evangelical Anglican churches in England
Anette Norberg (born 12 November 1966) is a retired Swedish curler from Härnösand. She and her team were the Olympic women's curling champions in 2006 and 2010. After winning the 2006 Women's Curling tournament in Turin over Mirjam Ott's Swiss team, she led her team to victory for gold over Cheryl Bernard's Canadian team in the 2010 Women's Curling tournament in Vancouver; becoming the first skip in the history of curling to successfully defend an Olympic title. Her team that retired after the 2010 Olympics (although she herself continued until 2013) is regarded as one of the best women's curling teams in history, and she is often regarded as one of the best female skips in history, particularly after adding yet another world title in 2011 with a new younger team. Career Norberg started to curl at the age of ten. Norberg won seven European Curling Championships (, , , , , and ) and three World Curling Championships (2005, 2006 and 2011). She also won silver medal at the 2001 Ford World Curling Championship and bronze medals in 1988, 1989, 1991 and 2003 World Championships. Except when she played at third for Elisabeth Högström in the team that won the 1988 European Championship, Norberg has always played the position of skip. After the retirement of her Olympic team, she put together a new team, with Cecilia Östlund, Sara Carlsson, and Liselotta Lennartsson and won her final third world championship gold medal. Norberg announced her decision to retire in April 2013. In 1989 she was inducted into the Swedish Curling Hall of Fame. In 2021, she and her Olympic team mates were inducted into the WCF Hall of Fame. Personal life Apart from curling, Norberg was chief actuary at Nordea, and led a division at Folksam. She is currently a consultant at PricewaterhouseCoopers. Norberg holds a Bachelor of Arts in mathematics from Uppsala University. She has one daughter, curler Therese Westman, and one son, singer Tobias Westman. In September 2014, Norberg revealed that she had been diagnosed with breast cancer in 2013, shortly after she retired. She has since completed treatment, which included chemotherapy and surgery to remove the tumor. In 2006, Norberg appeared in the "Hearts on Fire" music video for Swedish power metal band HammerFall. Norberg appeared as a contestant in Let's Dance 2013. Teams References External links Anette Norberg Swedish Olympic Committee (web archive) Norberg forms new team Living people 1966 births Sportspeople from Härnösand Swedish female curlers Olympic curlers for Sweden Olympic medalists in curling Olympic gold medalists for Sweden Olympic silver medalists for Sweden Curlers at the 1988 Winter Olympics Curlers at the 1992 Winter Olympics Curlers at the 2006 Winter Olympics Curlers at the 2010 Winter Olympics Medalists at the 1988 Winter Olympics Medalists at the 2010 Winter Olympics Medalists at the 2006 Winter Olympics World curling champions European curling champions Swedish curling champions Continental Cup of Curling participants Swedish actuaries
The Bertram F. Bongard Stakes is a listed stakes race for Thoroughbred two-year-olds run in the fall at Belmont Park, New York. At a distance of 7 furlongs, it will be in its 39th running in 2016. The Bongard is a major prep race for up-and-coming young horses and offers a purse of $150,000. Though not restricted to New York bred horses, this is not an open race: it is considered an event on the New York bred schedule. This race was run at a mile and an eighth prior to 1983 and also from 1984 to 1988. It went at seven furlongs in 1983, and from 1996 to the present. It was set at a mile and a sixteenth from 1989 to 1993 and at six furlongs in 1994 and 1995. Run for three-year-olds and up prior to 1984, now it is run for two-year-olds only. Named for Bertram F. Bongard who was a founding director of Eastern New York Thoroughbred Breeders' Association, it was for three-year-olds and up prior to 1984, but is now strictly for two-year-olds. Before 1984, it was called the Bertram F. Bongard Handicap. Winner of the Kentucky Derby and the Preakness Stakes, Funny Cide, won this race in 2003. Past winners 2016 – Mirai (José Ortiz) 2015 – Sudden Surprise (John R. Velazquez) 2014 – Saratoga Heater (Joel Rosario) 2013 – Wired Bryan (John Velazquez) 2012 – Weekend Hideaway 2011 – RACE NOT RUN? 2010 – RACE NOT RUN 2009 – Make Note 2008 – Trinity Magic (Shaun Bridgmohan) 2007 – Big Truck (Ramon Domínguez) 2006 – I'm A Numbers Guy (Stewart Elliott) 2005 – Sharp Humor (Edgar Prado) 2004 – Up Like Thunder (Javier Castellano) 2003 – Flagshipenterprise (Mark Guidry) 2002 – Funny Cide (José A. Santos) 2001 – White Ibis (Robbie Davis) 2000 – Le Grande Danseur (Jorge Chavez) 1999 – Image Maker (Jorge Chavez) 1998 – David (Aaron Gryder) 1997 – Ruby Hill (José A. Santos) 1996 – Patent Pending (Robbie Davis) 1995 – Out To Win (Julie Krone) 1994 – Cyrano (Mike E. Smith) 1993 – Bit of Puddin (Mike E. Smith) 1992 – Over the Brink (Aaron Gryder) 1991 – Phantom Finn (Eddie Maple) 1990 – Well Well Well (Diane Nelson) 1989 – Applebred (Jean-Luc Samyn) 1988 – Gold Oak (Eddie Maple) 1987 – Notebook (José A. Santos) 1986 – Sweet Envoy (Jacinto Vásquez) 1985 – Wild Wood (Michael Venezia) 1984 – Hot Debate (Don MacBeth) 1983 – Master Digby (Ángel Cordero Jr.) 1982 – Fearless Leader (Don MacBeth) 1981 – Accipiter's Hope (Cash Asmussen) 1980 – Fio Rito (Leslie Hulet) 1979 – International (Jorge Velásquez) 1978 – Judging Man (Ángel Cordero Jr.) External links Belmont Park official website Restricted stakes races in the United States Flat horse races for two-year-olds Horse races in New York (state) Belmont Park 1978 establishments in New York (state) Recurring sporting events established in 1978
```go // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. package encoding import ( "fmt" "math" "testing" "github.com/stretchr/testify/require" ) func TestUint32(t *testing.T) { tests := []struct { x uint32 }{ { x: 0, }, { x: 42, }, { x: math.MaxUint32, }, } for _, test := range tests { name := fmt.Sprintf("Encode and Decode %d", test.x) t.Run(name, func(t *testing.T) { enc := NewEncoder(1024) n := enc.PutUint32(test.x) require.Equal(t, 4, n) dec := NewDecoder(enc.Bytes()) actual, err := dec.Uint32() require.NoError(t, err) require.Equal(t, test.x, actual) }) } } func TestUint64(t *testing.T) { tests := []struct { x uint64 }{ { x: 0, }, { x: 42, }, { x: math.MaxUint64, }, } for _, test := range tests { name := fmt.Sprintf("Encode and Decode %d", test.x) t.Run(name, func(t *testing.T) { enc := NewEncoder(1024) n := enc.PutUint64(test.x) require.Equal(t, 8, n) dec := NewDecoder(enc.Bytes()) actual, err := dec.Uint64() require.NoError(t, err) require.Equal(t, test.x, actual) }) } } func TestUvarint(t *testing.T) { tests := []struct { x uint64 n int }{ { x: 0, n: 1, }, { x: 42, n: 1, }, { x: math.MaxUint64, n: 10, }, } for _, test := range tests { name := fmt.Sprintf("Encode and Decode %d", test.n) t.Run(name, func(t *testing.T) { enc := NewEncoder(1024) n := enc.PutUvarint(test.x) require.Equal(t, test.n, n) dec := NewDecoder(enc.Bytes()) actual, err := dec.Uvarint() require.NoError(t, err) require.Equal(t, test.x, actual) }) } } func TestBytes(t *testing.T) { tests := []struct { name string b []byte n int }{ { name: "Encode and Decode Empty Byte Slice", b: []byte(""), n: 1, }, { name: "Encode and Decode Non-Empty Byte Slice", b: []byte("foo bar baz"), n: 12, }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { enc := NewEncoder(1024) n := enc.PutBytes(test.b) require.Equal(t, test.n, n) dec := NewDecoder(enc.Bytes()) actual, err := dec.Bytes() require.NoError(t, err) require.Equal(t, test.b, actual) }) } } func TestEncoderLen(t *testing.T) { enc := NewEncoder(1024) enc.PutUint32(42) require.Equal(t, 4, enc.Len()) enc.PutUint64(42) require.Equal(t, 4+8, enc.Len()) enc.PutUvarint(42) require.Equal(t, 4+8+1, enc.Len()) enc.PutBytes([]byte("42")) require.Equal(t, 4+8+1+3, enc.Len()) } func TestEncoderReset(t *testing.T) { enc := NewEncoder(1024) enc.PutUint32(42) enc.Reset() b := enc.Bytes() require.Equal(t, 0, len(b)) } func TestDecoderReset(t *testing.T) { enc := NewEncoder(1024) enc.PutUint32(42) b := enc.Bytes() dec := NewDecoder(nil) dec.Reset(b) require.Equal(t, b, dec.buf) } ```
Yalınca () is a village in the Beşiri District of Batman Province in Turkey. The village is populated by Kurds and had a population of 54 in 2021. The hamlets of Çimenli, Ortaköy, Sapanlı and Tatlıca are attached to the village. The village was depopulated in the 1990s. References Villages in Beşiri District Kurdish settlements in Batman Province
Bradford Newcomb Stevens (January 3, 1813 – November 10, 1885) was a U.S. Representative from Illinois. Born in Boscawen, New Hampshire, Stevens attended schools in New Hampshire and at Montreal, Quebec, Canada, and graduated from Dartmouth College, Hanover, New Hampshire, in 1835. He taught school six years in Hopkinsville, Kentucky, and New York City. He moved to Bureau County, Illinois, in 1846, where he engaged in mercantile and agricultural pursuits, and also worked as county surveyor. He served as mayor of Tiskilwa, Illinois. Stevens was elected as a Democrat to the Forty-second Congress (March 4, 1871 – March 3, 1873). He resumed mercantile and agricultural pursuits. He died in Tiskilwa, Illinois, on November 10, 1885. He was interred in Mount Bloom Cemetery. References 1813 births 1885 deaths Dartmouth College alumni People from Boscawen, New Hampshire People from Bureau County, Illinois Mayors of places in Illinois American surveyors Democratic Party members of the United States House of Representatives from Illinois 19th-century American politicians
Shame is a 1921 American film directed by Emmett J. Flynn. It is based on the story Clung by Max Brand, which appeared in the magazine All Story Weekly (10 Apr - 15 May 1920 edition). This black and white silent film was distributed and produced by Fox Film Corporation. It is considered a drama and has a runtime of 90 mins. It is presumed to be a lost film. Plot William Fielding, a missionary in China, loses his wife after she gives birth to a son named David. He then marries a Chinese woman named Lotus Blossom, who treats the child as if it were her own. A trader named Foo Chang is madly in love with the woman. Believing the child to be hers, he kills William and brands David. Lotus Blossom commits suicide as a result. However, Li Clung, aware of the child's true parentage, takes David to the home of his wealthy grandfather in San Francisco. There, the boy befriends Li Clung and later inherits his grandfather's business and the Fielding estate when he becomes older. David marries an American woman named Winifred Wellington. Following David's marriage, however, Foo Chang appears. He is now the head of an opium ring and tries to bribe David to help him bring a cargo of opium into the city. When David refuses, Foo Chang tells David that he is half-Chinese. Although he has no proof other than the brand on David's arm, that is enough to convince David. He goes to pieces and flees with his infant son to Alaska. Winifred goes to Li Clung, who kills Foo Chang and also promises to take her to David but not telling her about her husband's true ethnicity. Li Clung only reveals the truth when Winifred is reunited with her husband. The family returns to San Francisco to live happily ever after. Cast John Gilbert as William Fielding / David Field Michael D. Moore as David, age 5 (credited as Mickey Moore) Frankie Lee as David, age 10 George Siegmann as Foo Chang William V. Mong as Li Clung George Nichols as Jonathan Fielding Anna May Wong as Lotus Blossom Rosemary Theby as The Weaver of Dreams Doris Pawn as Winifred Wellington David Kirby as 'Once-over' Jake (credited as 'Red' Kirby) References External links 1921 films American black-and-white films American silent feature films Films directed by Emmett J. Flynn Silent American drama films 1921 drama films Fox Film films Lost American drama films Films with screenplays by Bernard McConville 1921 lost films 1920s American films
```c /** * @license Apache-2.0 * * * * path_to_url * * Unless required by applicable law or agreed to in writing, software * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ #include "stdlib/math/base/special/cosh.h" #include <stdio.h> int main( void ) { const double x[] = { -5.0, -3.89, -2.78, -1.67, -0.56, 0.56, 1.67, 2.78, 3.89, 5.0 }; double v; int i; for ( i = 0; i < 10; i++ ) { v = stdlib_base_cosh( x[ i ] ); printf( "cosh(%lf) = %lf\n", x[ i ], v ); } } ```
Branny Schepanovich, Q.C. (August 2, 1941 – January 15, 2007) was an Alberta lawyer and former politician. Born in Cadomin, Alberta, he received his elementary education in Mercoal, Alberta and his senior matriculation from Edson High School in Edson, Alberta. He attended Royal Roads Military College in Victoria, British Columbia in 1959. He then earned a Bachelor of Arts in Political Science and his LL. B. from the University of Alberta, Edmonton. He was admitted to the Alberta Bar in 1968 and was a long-time partner in the Edmonton law firm of McCuaig Desrochers LLP. He practiced law for nearly four decades throughout Alberta at all court levels. He was appointed Queen's Counsel in 2002. He was a director of Air Canada from 1982 to 1985. Prior to practicing law, he worked as a Reporter for the Edmonton Journal in the summer of 1960, and as a reporter, news editor, managing editor, and editor-in-chief for the University of Alberta's Gateway from 1960 to 1964. He also worked summers as a news editor and reporter for CBC Television and CBC Radio from 1962 to 1966. Branny was President of the University of Alberta Students' Union from 1966 to 1967. He was a member of the Senate at the University of Alberta from 1966 to 1967. He was a Member of the University of Alberta Liberal Club from 1960 to 1967. Branny was active in the Liberal Party of Canada in national and Alberta campaigns, and ran unsuccessfully as the Liberal candidate for the Edmonton Centre federal riding in the elections of 1972 and 1974. Over the years he served in numerous other capacities for the Liberal Party of Canada. Branny was fluent in Serbo-Croatian, providing considerable legal counsel and assistance to his community. He was an active member of the St. Sava Serbian Orthodox Church in Edmonton. 1941 births 2007 deaths Lawyers in Alberta University of Alberta alumni People from Yellowhead County
JVG (formerly known as Jare & VilleGalle) is a Finnish rap duo made up of Jare Joakim Brand (born 8 October 1987) and Ville-Petteri Galle (born 4 October 1987). Their style is often referred to as sport rap. Both Jare and Ville are passionate athletes and originally became famous for their unique and comical sports-themed songs, where they rapped about ice hockey, soccer, doping, Finnish sportspeople (such as Jari Litmanen and Teemu Selänne), snus and playing NHL video games. Some of their comedic lyrics are thought to be incomprehensible to those not from East Helsinki as much of their music adopts slang from the Eastern part of the Finnish capital. In 2020, during the COVID-19 pandemic, JVG held a virtual reality concert on the first of May in a simulated version of Helsinki, with estimated attendance somewhere from 700,000 to over 1,000,000. Discography Albums Singles Featured in VilleGalle was also featured in on: 2008: "Katkerat savut" by Hulabaloo (Sirkusteltta album) 2009: "Siivoo suu poika" by Juno (Kettoteippi album) 2009: "Raybanit" by Juno (Kettoteippi album, also featuring ink) 2010: "Kuka on lämmittäny mun uunii?" by Gasellit (Gasellit EP, also featuring Juno) 2010: "Suomileffas" by Juno (J.K x 2 Tunti terapiaa album) 2010: "Hameen alle" by Matinpoika (Vasta kohta album, also featuring Juno, Okku, Jessica & Linda) 2010: "Marraskuu" by X23 (X23-12X album, also featuring Kassumato) 2011: "Feel Free (Remix)" by Gracias (Gracias EP, also featuring Juno & Paperi T) 2012: "Hiki" by Gasellit (Kiittämätön album) 2012: "Tytöt (Uusi Fantasia Remix)" by PMMP ("Tytöt" single) 2013: "Syö mun suklaata" by Teflon Brothers (Valkoisten dyynien ratsastajat album) 2013: "Täs sitä ollaa" by Juno (050187 album, also featuring Matinpoika) 2014: "Flexaa" by Cheek (single) 2015: "Keinutaan" by Antti Tuisku (single) Other charted songs Discography: VilleGalle Singles Featured in References External links Official website Facebook Finnish hip hop groups Musical groups established in 2009 Hip hop duos MTV Europe Music Award winners
Tianmu Mountain, Mount Tianmu, or Tianmushan () is a mountain in Lin'an County west of Hangzhou, Zhejiang, in eastern China. It is made up of two peaks: West Tianmu () and East Tianmu (). Twin ponds near the top of the peaks led to the name of the mountain. China's Tianmu Mountain National Nature Reserve lies on the northwest portion of the mountain. It is a UNESCO Biosphere Reserve as part of UNESCO's Man and the Biosphere Program. Tianmu is known for giant Japanese cedars, waterfalls, Tianmu tea, peaks surrounded by clouds, bamboo shoots, temples and nunneries, and odd-shaped rocks. More than 2,000 species of plants grow on the mountain, including (on West Tianmu) the last surviving truly wild population of Ginkgo trees. Prominent among the Japanese cedars is the "Giant Tree King", named by the Qianlong Emperor of the Qing. In 2009, it measured in height, in diameter, and in volume. The mountain is also home to hundreds of species of birds and animals, including 39 endangered or protected species. These include the clouded leopard and the black muntjac. In Chinese, the name Tianmushan can also refer to the adjacent range of mountains, including Mount Mogan. See also Tenmoku References External links Tianmushan Biosphere Reserve Information Brief guide by China Daily A Tianmu Mountain guide from Sinoway Travel Chris Pearson's photos and description of Tianmu Mountain Photos and a quick checklist of birds found on the mountain Biosphere reserves of China Mountains of Zhejiang
Kara Grainger is an Australian soul blues and roots rock singer-songwriter, based out of Nashville, Tennessee, United States. She played with the Papa Lips band starting in 1994. In 1998, they were awarded the "Best New Band" award at the Australian Blues Music Awards. They changed their name to Grainger in 1998 and continued to play together until 2001. She signed as a solo artist with Craving Records in 2006. Early life Grainger was always singing, and started learning how to play the guitar at age 12, improvising by her mid-teens. Grainger taught herself to play while listening to musicians such as Etta James, John Lee Hooker, Stevie Ray Vaughan, and Little Feat. She grew up in Balmain, a suburb of Sydney, Australia, known for its pubs and live music venues that caters to jazz and blues music. She played in several bands during secondary school, and was encouraged by a teacher to perform live, and she took guitar lessons from a local instructor, Mark Williams who had connections to professional musicians, which lead to regular opportunities to play at one of Sydney's premiere music venues, The Basement. Career Bands: Papa Lips and Grainger In 1994, when Grainger was 16 and just out of Balmain High School, she formed the band Papa Lips with her brother Mitch Grainger who had recently left his previous band, the Bondi Cigars. Papa Lips was a Blues & Roots band fronted by the Graingers, but also included Declan Kelly on drums, Rowan Lane on bass, Danny Guerrero on percussion, and Clayton Doley on keyboards. John Brewster managed the band along with Mitch. Papa Lips recorded and released one EP in 1996, Harmony, and one album in 1998, High Time Now, both distributed by Festival Records. They toured extensively on Australia's east coast, and played major Australian music festivals such as the Byron Bay Blues & Roots Festival, the East Coast Blues and Roots Festival and Woodford Folk Festival. In 1998 Papa Lips were awarded, "Best New Band" at the Australian Blues Music Awards. In 1998 the band was introduced to the producer Harry Vanda of The Easybeats and AC/DC fame and signed by Albert Productions. The band changed their name to Grainger and were in the studio for a period of two years recording an EP, "Sky Is Falling", and an unreleased album. In September 2001 Kara Grainger traveled along with her brother Mitch to New York to meet with American record labels, Atlantic Records, Sony BMG, Virgin Records and Elektra Records. The pair arrived in Manhattan on 9 September and were witness to the 11 September attacks. This brought on a period of reflection and the band was soon to be disbanded with Kara and her brother Mitch deciding to take separate musical paths. Solo career After separating from the band Grainger, Kara Grainger played briefly with the Steve Prestwich Band in 2005. In 2006, Grainger signed as a solo artist with the Australian label Craving Records, releasing her solo EP Secret Soul in 2006. The label encouraged her to go to the United States to record her first solo album, and in 2008 she moved to Los Angeles, and released her debut solo album, Grand and Green River. The album charted on the top 40 Americana charts for 38 straight weeks, and won first prize for a Roots album in 2008 from the Indie Acoustic Project (IAP). Grainger was invited to perform at the Folk Alliance International in 2006, 2007, and 2008 in Austin, Texas, and Memphis, Tennessee. In 2011, Grainger released her second album, L.A. Blues. The album was mostly a cover album, with only two original tracks, while the covers paid tribute to the early blues musicians who influenced her. Grainger toured throughout the US, Europe, Australia, and Asia, and has opened for several well-known artists, such as Buddy Guy, Marc Cohn, Peter Frampton, Robert Plant, Heart, Taj Mahal, and Jonny Lang. Shiver & Sigh was recorded and released in 2013. Members of Bonnie Raitt's touring band, James Hutchinson and Mike Finnigan, supported Grainger in the recording of the album. Grainger's brother, harmonica player Mitch Grainger supports her on her cover of Robert Johnson's "C'mon in My Kitchen". Graham Clarke, of Blues Bytes states that the album is "a smooth, sensuous, slow burner of a release, as Kara Grainger shows that you can be as effective with a whisper as with a scream. This is a marvelous set of soulful blues that really hits home." On 1 June 2018, Grainger released Living with Your Ghost, on Station House Records. Personal life Grainger currently lives in the US in Nashville, Tennessee. When she first moved to L.A., California, she did not anticipate staying beyond a year, but she found herself playing with some musicians she knew from albums. After living there for six months, she decided to make the move permanent. The American musicians were pushing themselves to improve and take it up a level, while she felt that many of the Australian musicians were laid-back. Grainger moved to Texas for a while, where she got to play with Eric Johnson. Grainger moved back to Los Angeles for a period of time, where she eventually found herself at home with the community. In her own words, "It took me a while to settle there but at the same time, it has the most amazing facilities, the best recording studios, no end of great musicians." Discography Papa Lips album High Time Now Kara Grainger solo albums Grand and Green River L.A. Blues Living with Your Ghost EPs Harmony (Papa Lips) Sky Is Falling (Grainger) Secret Soul (Kara Grainger) References External links Official website Living people Blues rock musicians Slide guitarists 21st-century Australian singers Australian women singer-songwriters Australian singer-songwriters Year of birth missing (living people) 21st-century Australian women singers
The Song of Singing is a studio album by Chick Corea, released in 1971 on Blue Note Records. The recording features bassist Dave Holland and drummer/percussionist Barry Altschul. Corea, Holland and Altschul made up three fourths of the free jazz ensemble Circle. The setting of this album is largely free and spontaneous, with a few pre-composed pieces included to maintain balance. The only piece not composed by Corea or Holland, or improvised by the trio, is Wayne Shorter's "Nefertiti", now considered a jazz standard. The 1987 CD reissue added two bonus tracks originally issued in the 1970s on Circling In and Circulus; the 1989 CD reissue added the last unissued track from these recordings sessions. Track listing "Toy Room" (Holland) – 5:51 "Ballad I" (Altschul, Corea, Holland) – 4:17 "Rhymes" (Corea) – 6:50 "Flesh" (Corea) – 6:06 "Ballad III" (Altschul, Corea, Holland) – 5:34 "Nefertiti" (Wayne Shorter) – 7:05 1987 CD bonus tracks: "Blues Connotation" (Ornette Coleman) – 7:23 "Drone" (Altschul, Corea, Holland) – 22:25 1989 CD bonus track: "Blues Connotation" (Ornette Coleman) – 7:23 "Ballad II" (Altschul, Corea, Holland) – 6:36 "Drone" (Altschul, Corea, Holland) – 22:25 Personnel Chick Corea – piano, keyboards Dave Holland – bass Barry Altschul – drums See also Circle (jazz band) – common members Jack Johnson (album) – recorded on the same day References External links Chick Corea - The Song of Singing (1971) album review by Scott Yanow, credits & releases at AllMusic Chick Corea - The Song of Singing (1971) album releases & credits at Discogs Blue Note Records albums Chick Corea albums 1971 albums Albums produced by Sonny Lester
Il Giorno dei Ragazzi was a weekly comic supplement magazine of the Italian newspaper Il Giorno, published between 1957 and 1968. History and profile The comic magazine debuted on 28 March 1957. It was originally intended as the Italian version of the British children's periodical Eagle, of which it published several series such as Dan Dare, Pilot of the Future, Storm Nelson and ' Riders of the Range. It also presented a significant Italian production, mainly of humorous genre, which included Benito Jacovitti's Cocco Bill, Gionni Galassia and Tom Ficcanaso, Bruno Bozzetto's comic versions of West and Soda and VIP my Brother Superman, Giovanni Manca's Pier Cloruro de' Lambicchi, Poldo e Poldino by Andrea Lavezzolo and Giuseppe Perego, I Naufraghi by Pier Carpi and Sergio Zaniboni. In the late 1966 the contract with Eagle expired, and subsequently many series abruptly disappeared; the magazine adopted a bedsheet format in January 1967 and a tabloid format in 1968, but the sales kept to decline, and the magazine finally closed in December 1968, replaced by Giochi-Quiz, a puzzle supplement. In 1993 Il Giorno tried to resurrect the brand, creating a weekly comic supplement titled Il Giorno Ragazzi. After 22 issues, the supplement was incorporated in the pages of the newspaper, before being eventually dismissed after forty issues. See also List of magazines in Italy References 1957 establishments in Italy 1968 disestablishments in Italy Children's magazines published in Italy Comics magazines published in Italy Defunct magazines published in Italy Italian-language magazines Magazines established in 1957 Magazines disestablished in 1968 Magazines published in Milan Newspaper supplements Weekly magazines published in Italy
Located in the eastern part of Canada, and (from a historical and political perspective) part of Central Canada, Quebec occupies a territory nearly three times the size of France or Texas. It is much closer to the size of Alaska. As is the case with Alaska, most of the land in Quebec is very sparsely populated. Its topography is very different from one region to another due to the varying composition of the ground, the climate (latitude and altitude), and the proximity to water. The Great Lakes–St. Lawrence Lowlands and the Appalachians are the two main topographic regions in southern Quebec, while the Canadian Shield occupies most of central and northern Quebec. With an area of , it is the largest of Canada's provinces and territories and the tenth largest country subdivision in the world. More than 90% of Quebec's area lies within the Canadian Shield, and includes the greater part of the Labrador Peninsula. Quebec's highest mountain is Mont D'Iberville, which is located on the border with Newfoundland and Labrador in the northeastern part of the province in the Torngat Mountains. The addition of parts of the vast and scarcely populated District of Ungava of the Northwest Territories between 1898 and 1912 gave the province its current form. The territory of Quebec is extremely rich in resources in its coniferous forests, lakes, and rivers—pulp and paper, lumber, and hydroelectricity are still some of the province's most important industries. The far north of the province, Nunavik, is subarctic or Arctic and is mostly inhabited by Inuit. The most populous region is the Saint Lawrence River valley in the south, where the capital, Quebec City, and the largest city, Montreal, are situated. North of Montreal are the Laurentians, a range of ancient mountains, and to the east are the Appalachian Mountains which extends into the Eastern Townships and Gaspésie regions. The Gaspé Peninsula juts into the Gulf of Saint Lawrence to the East. The Saint Lawrence River Valley is a fertile agricultural region, producing dairy products, fruit, vegetables, maple sugar (Quebec is the world's largest producer of maple syrup), and livestock. Borders Quebec is bordered by the province of Ontario, James Bay and Hudson Bay (including the circular Nastapoka arc) to the west, the provinces of New Brunswick and Newfoundland and Labrador to the east and Hudson Strait and Ungava Bay to the north. Its northernmost point is Cape Wolstenholme. Quebec also shares a land border with four northeast states of the United States (Maine, New Hampshire, New York and Vermont) to the south. In 1927, the border between the Province of Quebec and the Dominion of Newfoundland was delineated by the British Judicial Committee of the Privy Council. The government of Quebec does not officially recognize the Newfoundland and Labrador–Quebec border. A border dispute remains regarding the ownership of Labrador. A maritime boundary also exists with the territories of Nunavut, Prince Edward Island and Nova Scotia. Quebec has officially more than of borders of all types. Half of these are land limits, 12% river limits and 38% marine limits. Topography About a hundred million years ago, the area of southern Quebec was over the New England hotspot, creating the magma intrusions of the Monteregian Hills. These intrusive stocks have been variously interpreted as the feeder intrusions of long extinct volcanoes, which would have been active about 125 million years ago, or as intrusives that have never broken the surface in volcanic activity. Quebec's highest point at is Mont d'Iberville, known in English as Mount Caubvick, located on the border with Newfoundland and Labrador in the northeastern part of the province, in the Torngat Mountains. The most populous physiographic region is the Great Lakes–St. Lawrence Lowlands. It extends northeastward from the southwestern portion of the province along the shores of the Saint Lawrence River to the Quebec City region, limited to the North by the Laurentian Mountains and to the South by the Appalachians. It mainly covers the areas of the Centre-du-Québec, Laval, Montérégie and Montreal, the southern regions of the Capitale-Nationale, Lanaudière, Laurentides, Mauricie. It includes Anticosti Island, the Mingan Archipelago, and other small islands of the Gulf of St. Lawrence lowland forests ecoregion. Its landscape is low-lying and flat, except for isolated igneous outcrops near Montreal called the Monteregian Hills, formerly covered by the waters of Lake Champlain. The Oka hills also rise from the plain. Geologically, the lowlands formed as a rift valley about 100 million years ago and are prone to infrequent but significant earthquakes. The most recent sedimentary rock layerswere formed as the seabed of the ancient Champlain Sea at the end of the last ice age about 14,000 years ago. The combination of rich and easily arable soils and Quebec's relatively warm climate makes this valley the most prolific agricultural area of Quebec province. Mixed forests provide most of Canada's springtime maple syrup crop. The rural part of the landscape is divided into narrow rectangular tracts of land that extend from the river and date back to settlement patterns in 17th century New France. More than 95% of Quebec's territory lies within the Canadian Shield. It is generally a quite flat and exposed mountainous terrain interspersed with higher points such as the Laurentian Mountains in southern Quebec, the Otish Mountains in central Quebec and the Torngat Mountains near Ungava Bay. The topography of the Shield has been shaped by glaciers from the successive ice ages, which explains the glacial deposits of boulders, gravel and sand, and by sea water and post-glacial lakes that left behind thick deposits of clay in parts of the Shield. The Canadian Shield also has a complex hydrological network of perhaps a million lakes, bogs, streams and rivers. It is rich in the forestry, mineral and hydro-electric resources that are a mainstay of the Quebec economy. Primary industries sustain small cities in regions of Abitibi-Témiscamingue, Saguenay–Lac-Saint-Jean, and Côte-Nord. The Labrador Peninsula is covered by the Laurentian Plateau (or Canadian Shield), dotted with mountains such as Otish Mountains. The Ungava Peninsula is notably composed of D'Youville mountains, Puvirnituq mountains and Pingualuit crater. While low and medium altitude peak from western Quebec to the far north, high altitudes mountains emerge in the Capitale-Nationale region to the extreme east, along its longitude. In the Labrador Peninsula portion of the Shield, the far northern region of Nunavik includes the Ungava Peninsula and consists of flat Arctic tundra inhabited mostly by the Inuit. Further south lie the subarctic taiga of the Eastern Canadian Shield taiga ecoregion and the boreal forest of the Central Canadian Shield forests, where spruce, fir, and poplar trees provide raw materials for Quebec's pulp and paper and lumber industries. Although the area is inhabited principally by the Cree, Naskapi, and Innu First Nations, thousands of temporary workers reside at Radisson to service the massive James Bay Hydroelectric Project on the La Grande and Eastmain rivers. The southern portion of the shield extends to the Laurentians, a mountain range just north of the Great Lakes–St. Lawrence Lowlands, that attracts local and international tourists to ski hills and lakeside resorts. The Appalachian region of Quebec has a narrow strip of ancient mountains along the southeastern border of Quebec. The Appalachians are actually a huge chain that extends from Alabama to Newfoundland. In between, it covers in Quebec near , from the Montérégie hills to the Gaspé Peninsula. In western Quebec, the average altitude is about , while in the Gaspé Peninsula, the Appalachian peaks (especially the Chic-Choc) are among the highest in Quebec, exceeding . Hydrography Quebec has several notable islands, namely the numerous islands of the Hochelaga Archipelago that includes the Island of Montreal and Îles Laval which make up full or parts of the major cities of Montreal and Laval. Île d'Orléans near Quebec City, the sparsely populated Anticosti Island in the outlet of the Saint Lawrence River, and the Magdalen Islands archipelago in the Gulf of Saint Lawrence are other noteworthy islands. Quebec has one of the world's largest reserves of fresh water, occupying 12% of its surface. It has 3% of the world's renewable fresh water, whereas it has only 0.1% of its population. More than half a million lakes, including 30 with an area greater than , and 4,500 rivers drain into the Atlantic Ocean, through the Gulf of Saint Lawrence and the Arctic Ocean, by James, Hudson, and Ungava bays. The largest inland body of water is the Caniapiscau Reservoir, created in the realization of the James Bay Project to produce hydroelectric power. Lake Mistassini is the largest natural lake in Quebec. The Saint Lawrence River has some of the world's largest sustaining inland Atlantic ports at Montreal (the province's largest city), Trois-Rivières, and Quebec City (the capital). Its access to the Atlantic Ocean and the interior of North America made it the base of early French exploration and settlement in the 17th and 18th centuries. Since 1959, the Saint Lawrence Seaway has provided a navigable link between the Atlantic Ocean and the Great Lakes. Northeast of Quebec City, the river broadens into the world's largest estuary, the feeding site of numerous species of whales, fish, and seabirds. The river empties into the Gulf of Saint Lawrence. This marine environment sustains fisheries and smaller ports in the Lower Saint Lawrence (Bas-Saint-Laurent), Lower North Shore (Côte-Nord), and Gaspé (Gaspésie) regions of the province. The Saint Lawrence River with its estuary forms the basis of Quebec's development through the centuries. Other notable rivers include the Ashuapmushuan, Chaudière, Gatineau, Manicouagan, Ottawa, Richelieu, Rupert, Saguenay, Saint-François, and Saint-Maurice. Climate In general, the climate of Quebec is cold and humid. The climate of the province is largely determined by its latitude, maritime and elevation influences. According to the Köppen climate classification, Quebec has three main climate regions. Southern and western Quebec, including most of the major population centres and areas south of 51oN, have a humid continental climate (Köppen climate classification Dfb) with four distinct seasons having warm to occasionally hot and humid summers and often very cold and snowy winters. The main climatic influences are from western and northern Canada and move eastward, and from the southern and central United States that move northward. Because of the influence of both storm systems from the core of North America and the Atlantic Ocean, precipitation is abundant throughout the year, with most areas receiving more than of precipitation, including over of snow in many areas. During the summer, severe weather patterns (such as tornadoes and severe thunderstorms) occur occasionally. Most of central Quebec, ranging from 51 to 58 degrees North has a subarctic climate (Köppen Dfc). Winters are long, very cold, and snowy, and among the coldest in eastern Canada, while summers are warm but very short due to the higher latitude and the greater influence of Arctic air masses. Precipitation is also somewhat less than farther south, except at some of the higher elevations. The northern regions of Quebec have an arctic climate (Köppen ET), with very cold winters and short, much cooler summers. The primary influences in this region are the Arctic Ocean currents (such as the Labrador Current) and continental air masses from the High Arctic. The four calendar seasons in Quebec are spring, summer, autumn and winter, with conditions differing by region. They are then differentiated according to the insolation, temperature, and precipitation of snow and rain. In Quebec City, the length of the daily sunshine varies from 8:37 hrs in December to 15:50 hrs in June; the annual variation is much greater (from 4:54 to 19:29 hrs) at the northern tip of the province. From temperate zones to the northern territories of the Far North, the brightness varies with latitude, as well as the Northern Lights and midnight sun. Quebec is divided into four climatic zones: arctic, subarctic, humid continental and East maritime. From south to north, average temperatures range in summer between and, in winter, between . In periods of intense heat and cold, temperatures can reach in the summer and during the Quebec winter, They may vary depending on the Humidex or Wind chill. The all time record high was and the all time record low was . The all-time record of the greatest precipitation in winter was established in winter 2007–2008, with more than five metres of snow in the area of Quebec City, while the average amount received per winter is around three metres. March 1971, however, saw the "Century's Snowstorm" with more than in Montreal to in Mont Apica of snow within 24 hours in many regions of southern Quebec. Also, the winter of 2010 was the warmest and driest recorded in more than 60 years. Climate tables Wildlife The province is home to a wide variety of flora and fauna. The birdlife is diverse including Wild Turkey, Meleagris gallopavo, Yellow-bellied Sapsucker, Sphyrapicus varius and Loggerhead Shrike, Lanius ludovicianus. The large land wildlife is mainly composed of the white-tailed deer, the moose, the muskox, the caribou (reindeer), the American black bear and the polar bear. The average land wildlife includes the cougar, the coyote, the eastern wolf, the bobcat, the Arctic fox, the fox, etc. The small animals seen most commonly include the eastern grey squirrel, the snowshoe hare, the groundhog, the skunk, the raccoon, the chipmunk and the Canadian beaver. Biodiversity of the estuary and gulf of Saint Lawrence River consists of an aquatic mammal wildlife, of which most goes upriver through the estuary and the Saguenay–St. Lawrence Marine Park until the Île d'Orléans (French for Orleans Island), such as the blue whale, the beluga, the minke whale and the harp seal (earless seal). Among the Nordic marine animals, there are two particularly important to cite: the walrus and the narwhal. Inland waters are populated by small to large fresh water fish, such as the largemouth bass, the American pickerel, the walleye, the Acipenser oxyrinchus, the muskellunge, the Atlantic cod, the Arctic char, the brook trout, the Microgadus tomcod (tomcod), the Atlantic salmon, the rainbow trout, etc. Among the birds commonly seen in the southern inhabited part of Quebec, there are the American robin, the house sparrow, the red-winged blackbird, the mallard, the common grackle, the blue jay, the American crow, the black-capped chickadee, some warblers and swallows, the starling and the rock pigeon, the latter two having been introduced in Quebec and are found mainly in urban areas. Avian fauna includes birds of prey like the golden eagle, the peregrine falcon, the snowy owl and the bald eagle. Sea and semi-aquatic birds seen in Quebec are mostly the Canada goose, the double-crested cormorant, the northern gannet, the European herring gull, the great blue heron, the sandhill crane, the Atlantic puffin and the common loon. Many more species of land, maritime or avian wildlife are seen in Quebec, but most of the Quebec-specific species and the most commonly seen species are listed above. Some livestock have the title of "Québec heritage breed", namely the Canadian horse, the Chantecler chicken and the Canadian cow. Moreover, in addition to food certified as "organic", Charlevoix lamb is the first local Quebec product whose geographical indication is protected. Livestock production also includes the pig breeds Landrace, Duroc and Yorkshire and many breeds of sheep and cattle. The Wildlife Foundation of Quebec and the Data Centre on Natural Heritage of Quebec (CDPNQ) (French acronym) are the main agencies working with officers for wildlife conservation in Quebec. Vegetation Given the geology of the province and its different climates, there is an established number of large areas of vegetation in Quebec. These areas, listed in order from the northernmost to the southernmost are: the tundra, the taiga, the Canadian boreal forest (coniferous), mixed forest and Deciduous forest. On the edge of the Ungava Bay and Hudson Strait is the tundra, whose flora is limited to a low vegetation of lichen with only less than 50 growing days a year. The tundra vegetation survives an average annual temperature of . The tundra covers more than 24% of the area of Quebec. Further south, the climate is conducive to the growth of the Canadian boreal forest, bounded on the north by the taiga. Not as arid as the tundra, the taiga is associated with the sub-Arctic regions of the Canadian Shield and is characterized by a greater number of both plant (600) and animal (206) species, many of which live there all year. The taiga covers about 20% of the total area of Quebec. The Canadian boreal forest is the northernmost and most abundant of the three forest areas in Quebec that straddle the Canadian Shield and the upper lowlands of the province. Given a warmer climate, the diversity of organisms is also higher, since there are about 850 plant species and 280 vertebrates species. The Canadian boreal forest covers 27% of the area of Quebec. The mixed forest is a transition zone between the Canadian boreal forest and deciduous forest. By virtue of its transient nature, this area contains a diversity of habitats resulting in large numbers of plant (1000) and vertebrates (350) species, despite relatively cool temperatures. The ecozone mixed forest covers 11.5% of the area of Quebec and is characteristic of the Laurentians, the Appalachians and the eastern lowlands forests. The third most northern forest area is characterized by deciduous forests. Because of its climate (average annual temperature of ), it is in this area that one finds the greatest diversity of species, including more than 1600 vascular plants and 440 vertebrates. Its relatively long growing season lasts almost 200 days and its fertile soils make it the centre of agricultural activity and therefore of urbanization of Quebec. Most of Quebec's population lives in this area of vegetation, almost entirely along the banks of the Saint Lawrence. Deciduous forests cover approximately 6.6% of the area of Quebec. The total forest area of Quebec is estimated at . From the Abitibi-Témiscamingue to the North Shore, the forest is composed primarily of conifers such as the balsam fir, the jack pine, the white spruce, the black spruce and the tamarack. Some species of deciduous trees such as the yellow birch appear when the river is approached in the south. The deciduous forest of the Great Lakes–St. Lawrence Lowlands is mostly composed of deciduous species such as the sugar maple, the red maple, the white ash, the American beech, the butternut (white walnut), the American elm, the basswood, the bitternut hickory and the northern red oak as well as some conifers such as the eastern white pine and the northern whitecedar. The distribution areas of the paper birch, the trembling aspen and the mountain ash cover more than half of Quebec territory. See also Ecological regions of Quebec Île Rouleau crater Manicouagan crater References Works cited
Hugh Frederic Bennett (10 November 1862 – 26 July 1943) was an English cricketer, who played two first-class games for Worcestershire in 1901. He made 24 and 31* on his debut against Gloucestershire, but after scoring just 8 in the following game against Derbyshire he never played again. He also played county cricket below first-class level for Shropshire in three matches between 1891 and 1897, while playing at club level for Oswestry. He was born in Pirton, Pershore, Worcestershire; he died in the same county at Elmley Castle, Malvern, aged 80. He was educated at Bradfield College and Oxford University and became a Church of England clergyman. References External links 1862 births 1943 deaths English cricketers People from Pershore Worcestershire cricketers Cricketers from Worcestershire
```go /* */ package comm import ( "bytes" "context" "crypto/hmac" "crypto/sha256" "crypto/tls" "errors" "fmt" "io" "math/rand" "net" "strconv" "sync" "sync/atomic" "testing" "time" "github.com/hyperledger/fabric-lib-go/bccsp/factory" "github.com/hyperledger/fabric-lib-go/common/flogging" "github.com/hyperledger/fabric-lib-go/common/metrics/disabled" cb "github.com/hyperledger/fabric-protos-go/common" proto "github.com/hyperledger/fabric-protos-go/gossip" "github.com/hyperledger/fabric/gossip/api" "github.com/hyperledger/fabric/gossip/api/mocks" gmocks "github.com/hyperledger/fabric/gossip/comm/mocks" "github.com/hyperledger/fabric/gossip/common" "github.com/hyperledger/fabric/gossip/identity" "github.com/hyperledger/fabric/gossip/metrics" "github.com/hyperledger/fabric/gossip/protoext" "github.com/hyperledger/fabric/gossip/util" "github.com/hyperledger/fabric/internal/pkg/comm" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" "google.golang.org/grpc" "google.golang.org/grpc/credentials" "google.golang.org/grpc/credentials/insecure" ) var r *rand.Rand func init() { util.SetupTestLogging() r = rand.New(rand.NewSource(time.Now().UnixNano())) factory.InitFactories(nil) naiveSec.On("OrgByPeerIdentity", mock.Anything).Return(api.OrgIdentityType{}) } var testCommConfig = CommConfig{ DialTimeout: 300 * time.Millisecond, ConnTimeout: DefConnTimeout, RecvBuffSize: DefRecvBuffSize, SendBuffSize: DefSendBuffSize, } func acceptAll(msg interface{}) bool { return true } var noopPurgeIdentity = func(_ common.PKIidType, _ api.PeerIdentityType) { } var ( naiveSec = &naiveSecProvider{} hmacKey = []byte{0, 0, 0} disabledMetrics = metrics.NewGossipMetrics(&disabled.Provider{}).CommMetrics ) type naiveSecProvider struct { mocks.SecurityAdvisor } func (nsp *naiveSecProvider) OrgByPeerIdentity(identity api.PeerIdentityType) api.OrgIdentityType { return nsp.SecurityAdvisor.Called(identity).Get(0).(api.OrgIdentityType) } func (*naiveSecProvider) Expiration(peerIdentity api.PeerIdentityType) (time.Time, error) { return time.Now().Add(time.Hour), nil } func (*naiveSecProvider) ValidateIdentity(peerIdentity api.PeerIdentityType) error { return nil } // GetPKIidOfCert returns the PKI-ID of a peer's identity func (*naiveSecProvider) GetPKIidOfCert(peerIdentity api.PeerIdentityType) common.PKIidType { return common.PKIidType(peerIdentity) } // VerifyBlock returns nil if the block is properly signed, // else returns error func (*naiveSecProvider) VerifyBlock(channelID common.ChannelID, seqNum uint64, signedBlock *cb.Block) error { return nil } // VerifyBlockAttestation returns nil if the block attestation is properly signed, // else returns error func (*naiveSecProvider) VerifyBlockAttestation(channelID string, signedBlock *cb.Block) error { return nil } // Sign signs msg with this peer's signing key and outputs // the signature if no error occurred. func (*naiveSecProvider) Sign(msg []byte) ([]byte, error) { mac := hmac.New(sha256.New, hmacKey) mac.Write(msg) return mac.Sum(nil), nil } // Verify checks that signature is a valid signature of message under a peer's verification key. // If the verification succeeded, Verify returns nil meaning no error occurred. // If peerCert is nil, then the signature is verified against this peer's verification key. func (*naiveSecProvider) Verify(peerIdentity api.PeerIdentityType, signature, message []byte) error { mac := hmac.New(sha256.New, hmacKey) mac.Write(message) expected := mac.Sum(nil) if !bytes.Equal(signature, expected) { return fmt.Errorf("Wrong certificate:%v, %v", signature, message) } return nil } // VerifyByChannel verifies a peer's signature on a message in the context // of a specific channel func (*naiveSecProvider) VerifyByChannel(_ common.ChannelID, _ api.PeerIdentityType, _, _ []byte) error { return nil } func newCommInstanceOnlyWithMetrics(t *testing.T, commMetrics *metrics.CommMetrics, sec *naiveSecProvider, gRPCServer *comm.GRPCServer, certs *common.TLSCertificates, secureDialOpts api.PeerSecureDialOpts, dialOpts ...grpc.DialOption) Comm { _, portString, err := net.SplitHostPort(gRPCServer.Address()) require.NoError(t, err) endpoint := fmt.Sprintf("127.0.0.1:%s", portString) id := []byte(endpoint) identityMapper := identity.NewIdentityMapper(sec, id, noopPurgeIdentity, sec) commInst, err := NewCommInstance(gRPCServer.Server(), certs, identityMapper, id, secureDialOpts, sec, commMetrics, testCommConfig, dialOpts...) require.NoError(t, err) go func() { err := gRPCServer.Start() require.NoError(t, err) }() return &commGRPC{commInst.(*commImpl), gRPCServer} } type commGRPC struct { *commImpl gRPCServer *comm.GRPCServer } func (c *commGRPC) Stop() { c.commImpl.Stop() c.commImpl.idMapper.Stop() c.gRPCServer.Stop() } func newCommInstanceOnly(t *testing.T, sec *naiveSecProvider, gRPCServer *comm.GRPCServer, certs *common.TLSCertificates, secureDialOpts api.PeerSecureDialOpts, dialOpts ...grpc.DialOption) Comm { return newCommInstanceOnlyWithMetrics(t, disabledMetrics, sec, gRPCServer, certs, secureDialOpts, dialOpts...) } func newCommInstance(t *testing.T, sec *naiveSecProvider) (c Comm, port int) { port, gRPCServer, certs, secureDialOpts, dialOpts := util.CreateGRPCLayer() comm := newCommInstanceOnly(t, sec, gRPCServer, certs, secureDialOpts, dialOpts...) return comm, port } type msgMutator func(*protoext.SignedGossipMessage) *protoext.SignedGossipMessage type tlsType int const ( none tlsType = iota oneWayTLS mutualTLS ) func handshaker(port int, endpoint string, comm Comm, t *testing.T, connMutator msgMutator, connType tlsType) <-chan protoext.ReceivedMessage { c := &commImpl{} cert := GenerateCertificatesOrPanic() tlsCfg := &tls.Config{ InsecureSkipVerify: true, } if connType == mutualTLS { tlsCfg.Certificates = []tls.Certificate{cert} } ta := credentials.NewTLS(tlsCfg) secureOpts := grpc.WithTransportCredentials(ta) if connType == none { secureOpts = grpc.WithTransportCredentials(insecure.NewCredentials()) } acceptChan := comm.Accept(acceptAll) ctx, cancel := context.WithTimeout(context.Background(), time.Second) defer cancel() target := fmt.Sprintf("127.0.0.1:%d", port) conn, err := grpc.DialContext(ctx, target, secureOpts, grpc.WithBlock()) require.NoError(t, err, "%v", err) if err != nil { return nil } cl := proto.NewGossipClient(conn) stream, err := cl.GossipStream(context.Background()) require.NoError(t, err, "%v", err) if err != nil { return nil } var clientCertHash []byte if len(tlsCfg.Certificates) > 0 { clientCertHash = certHashFromRawCert(tlsCfg.Certificates[0].Certificate[0]) } pkiID := common.PKIidType(endpoint) require.NoError(t, err, "%v", err) msg, _ := c.createConnectionMsg(pkiID, clientCertHash, []byte(endpoint), func(msg []byte) ([]byte, error) { mac := hmac.New(sha256.New, hmacKey) mac.Write(msg) return mac.Sum(nil), nil }, false) // Mutate connection message to test negative paths msg = connMutator(msg) // Send your own connection message stream.Send(msg.Envelope) // Wait for connection message from the other side envelope, err := stream.Recv() if err != nil { return acceptChan } require.NoError(t, err, "%v", err) msg, err = protoext.EnvelopeToGossipMessage(envelope) require.NoError(t, err, "%v", err) require.Equal(t, []byte(target), msg.GetConn().PkiId) require.Equal(t, extractCertificateHashFromContext(stream.Context()), msg.GetConn().TlsCertHash) msg2Send := createGossipMsg() nonce := uint64(r.Int()) msg2Send.Nonce = nonce go stream.Send(msg2Send.Envelope) return acceptChan } func TestMutualParallelSendWithAck(t *testing.T) { // This test tests concurrent and parallel sending of many (1000) messages // from 2 instances to one another at the same time. msgNum := 1000 comm1, port1 := newCommInstance(t, naiveSec) comm2, port2 := newCommInstance(t, naiveSec) defer comm1.Stop() defer comm2.Stop() acceptData := func(o interface{}) bool { m := o.(protoext.ReceivedMessage).GetGossipMessage() return protoext.IsDataMsg(m.GossipMessage) } inc1 := comm1.Accept(acceptData) inc2 := comm2.Accept(acceptData) // Send a message from comm1 to comm2, to make the instances establish a preliminary connection comm1.Send(createGossipMsg(), remotePeer(port2)) // Wait for the message to be received in comm2 <-inc2 for i := 0; i < msgNum; i++ { go comm1.SendWithAck(createGossipMsg(), time.Second*5, 1, remotePeer(port2)) } for i := 0; i < msgNum; i++ { go comm2.SendWithAck(createGossipMsg(), time.Second*5, 1, remotePeer(port1)) } go func() { for i := 0; i < msgNum; i++ { <-inc1 } }() for i := 0; i < msgNum; i++ { <-inc2 } } func getAvailablePort(t *testing.T) (port int, endpoint string, ll net.Listener) { ll, err := net.Listen("tcp", "127.0.0.1:0") require.NoError(t, err) endpoint = ll.Addr().String() _, portS, err := net.SplitHostPort(endpoint) require.NoError(t, err) portInt, err := strconv.Atoi(portS) require.NoError(t, err) return portInt, endpoint, ll } func TestHandshake(t *testing.T) { signer := func(msg []byte) ([]byte, error) { mac := hmac.New(sha256.New, hmacKey) mac.Write(msg) return mac.Sum(nil), nil } mutator := func(msg *protoext.SignedGossipMessage) *protoext.SignedGossipMessage { return msg } assertPositivePath := func(msg protoext.ReceivedMessage, endpoint string) { expectedPKIID := common.PKIidType(endpoint) require.Equal(t, expectedPKIID, msg.GetConnectionInfo().ID) require.Equal(t, api.PeerIdentityType(endpoint), msg.GetConnectionInfo().Identity) require.NotNil(t, msg.GetConnectionInfo().Auth) sig, _ := (&naiveSecProvider{}).Sign(msg.GetConnectionInfo().Auth.SignedData) require.Equal(t, sig, msg.GetConnectionInfo().Auth.Signature) } // Positive path 1 - check authentication without TLS port, endpoint, ll := getAvailablePort(t) s := grpc.NewServer() id := []byte(endpoint) idMapper := identity.NewIdentityMapper(naiveSec, id, noopPurgeIdentity, naiveSec) inst, err := NewCommInstance(s, nil, idMapper, api.PeerIdentityType(endpoint), func() []grpc.DialOption { return []grpc.DialOption{grpc.WithTransportCredentials(insecure.NewCredentials())} }, naiveSec, disabledMetrics, testCommConfig) go s.Serve(ll) require.NoError(t, err) var msg protoext.ReceivedMessage _, tempEndpoint, tempL := getAvailablePort(t) acceptChan := handshaker(port, tempEndpoint, inst, t, mutator, none) select { case <-time.After(time.Second * 4): require.FailNow(t, "Didn't receive a message, seems like handshake failed") case msg = <-acceptChan: } require.Equal(t, common.PKIidType(tempEndpoint), msg.GetConnectionInfo().ID) require.Equal(t, api.PeerIdentityType(tempEndpoint), msg.GetConnectionInfo().Identity) sig, _ := (&naiveSecProvider{}).Sign(msg.GetConnectionInfo().Auth.SignedData) require.Equal(t, sig, msg.GetConnectionInfo().Auth.Signature) inst.Stop() s.Stop() ll.Close() tempL.Close() time.Sleep(time.Second) comm, port := newCommInstance(t, naiveSec) defer comm.Stop() // Positive path 2: initiating peer sends its own certificate _, tempEndpoint, tempL = getAvailablePort(t) acceptChan = handshaker(port, tempEndpoint, comm, t, mutator, mutualTLS) select { case <-time.After(time.Second * 2): require.FailNow(t, "Didn't receive a message, seems like handshake failed") case msg = <-acceptChan: } assertPositivePath(msg, tempEndpoint) tempL.Close() // Negative path: initiating peer doesn't send its own certificate _, tempEndpoint, tempL = getAvailablePort(t) acceptChan = handshaker(port, tempEndpoint, comm, t, mutator, oneWayTLS) time.Sleep(time.Second) require.Equal(t, 0, len(acceptChan)) tempL.Close() // Negative path, signature is wrong _, tempEndpoint, tempL = getAvailablePort(t) mutator = func(msg *protoext.SignedGossipMessage) *protoext.SignedGossipMessage { msg.Signature = append(msg.Signature, 0) return msg } acceptChan = handshaker(port, tempEndpoint, comm, t, mutator, mutualTLS) time.Sleep(time.Second) require.Equal(t, 0, len(acceptChan)) tempL.Close() // Negative path, the PKIid doesn't match the identity _, tempEndpoint, tempL = getAvailablePort(t) mutator = func(msg *protoext.SignedGossipMessage) *protoext.SignedGossipMessage { msg.GetConn().PkiId = []byte(tempEndpoint) // Sign the message again msg.Sign(signer) return msg } _, tempEndpoint2, tempL2 := getAvailablePort(t) acceptChan = handshaker(port, tempEndpoint2, comm, t, mutator, mutualTLS) time.Sleep(time.Second) require.Equal(t, 0, len(acceptChan)) tempL.Close() tempL2.Close() // Negative path, the cert hash isn't what is expected _, tempEndpoint, tempL = getAvailablePort(t) mutator = func(msg *protoext.SignedGossipMessage) *protoext.SignedGossipMessage { msg.GetConn().TlsCertHash = append(msg.GetConn().TlsCertHash, 0) msg.Sign(signer) return msg } acceptChan = handshaker(port, tempEndpoint, comm, t, mutator, mutualTLS) time.Sleep(time.Second) require.Equal(t, 0, len(acceptChan)) tempL.Close() // Negative path, no PKI-ID was sent _, tempEndpoint, tempL = getAvailablePort(t) mutator = func(msg *protoext.SignedGossipMessage) *protoext.SignedGossipMessage { msg.GetConn().PkiId = nil msg.Sign(signer) return msg } acceptChan = handshaker(port, tempEndpoint, comm, t, mutator, mutualTLS) time.Sleep(time.Second) require.Equal(t, 0, len(acceptChan)) tempL.Close() // Negative path, connection message is of a different type _, tempEndpoint, tempL = getAvailablePort(t) mutator = func(msg *protoext.SignedGossipMessage) *protoext.SignedGossipMessage { msg.Content = &proto.GossipMessage_Empty{ Empty: &proto.Empty{}, } msg.Sign(signer) return msg } acceptChan = handshaker(port, tempEndpoint, comm, t, mutator, mutualTLS) time.Sleep(time.Second) require.Equal(t, 0, len(acceptChan)) tempL.Close() // Negative path, the peer didn't respond to the handshake in due time _, tempEndpoint, tempL = getAvailablePort(t) mutator = func(msg *protoext.SignedGossipMessage) *protoext.SignedGossipMessage { time.Sleep(time.Second * 5) return msg } acceptChan = handshaker(port, tempEndpoint, comm, t, mutator, mutualTLS) time.Sleep(time.Second) require.Equal(t, 0, len(acceptChan)) tempL.Close() } func TestConnectUnexpectedPeer(t *testing.T) { // Scenarios: In both scenarios, comm1 connects to comm2 or comm3. // and expects to see a PKI-ID which is equal to comm4's PKI-ID. // The connection attempt would succeed or fail based on whether comm2 or comm3 // are in the same org as comm4 identityByPort := func(port int) api.PeerIdentityType { return api.PeerIdentityType(fmt.Sprintf("127.0.0.1:%d", port)) } customNaiveSec := &naiveSecProvider{} comm1Port, gRPCServer1, certs1, secureDialOpts1, dialOpts1 := util.CreateGRPCLayer() comm2Port, gRPCServer2, certs2, secureDialOpts2, dialOpts2 := util.CreateGRPCLayer() comm3Port, gRPCServer3, certs3, secureDialOpts3, dialOpts3 := util.CreateGRPCLayer() comm4Port, gRPCServer4, certs4, secureDialOpts4, dialOpts4 := util.CreateGRPCLayer() customNaiveSec.On("OrgByPeerIdentity", identityByPort(comm1Port)).Return(api.OrgIdentityType("O")) customNaiveSec.On("OrgByPeerIdentity", identityByPort(comm2Port)).Return(api.OrgIdentityType("A")) customNaiveSec.On("OrgByPeerIdentity", identityByPort(comm3Port)).Return(api.OrgIdentityType("B")) customNaiveSec.On("OrgByPeerIdentity", identityByPort(comm4Port)).Return(api.OrgIdentityType("A")) comm1 := newCommInstanceOnly(t, customNaiveSec, gRPCServer1, certs1, secureDialOpts1, dialOpts1...) comm2 := newCommInstanceOnly(t, naiveSec, gRPCServer2, certs2, secureDialOpts2, dialOpts2...) comm3 := newCommInstanceOnly(t, naiveSec, gRPCServer3, certs3, secureDialOpts3, dialOpts3...) comm4 := newCommInstanceOnly(t, naiveSec, gRPCServer4, certs4, secureDialOpts4, dialOpts4...) defer comm1.Stop() defer comm2.Stop() defer comm3.Stop() defer comm4.Stop() messagesForComm1 := comm1.Accept(acceptAll) messagesForComm2 := comm2.Accept(acceptAll) messagesForComm3 := comm3.Accept(acceptAll) // Have comm4 send a message to comm1 // in order for comm1 to know comm4 comm4.Send(createGossipMsg(), remotePeer(comm1Port)) <-messagesForComm1 // Close the connection with comm4 comm1.CloseConn(remotePeer(comm4Port)) // At this point, comm1 knows comm4's identity and organization t.Run("Same organization", func(t *testing.T) { unexpectedRemotePeer := remotePeer(comm2Port) unexpectedRemotePeer.PKIID = remotePeer(comm4Port).PKIID comm1.Send(createGossipMsg(), unexpectedRemotePeer) select { case <-messagesForComm2: case <-time.After(time.Second * 5): require.Fail(t, "Didn't receive a message within a timely manner") util.PrintStackTrace() } }) t.Run("Unexpected organization", func(t *testing.T) { unexpectedRemotePeer := remotePeer(comm3Port) unexpectedRemotePeer.PKIID = remotePeer(comm4Port).PKIID comm1.Send(createGossipMsg(), unexpectedRemotePeer) select { case <-messagesForComm3: require.Fail(t, "Message shouldn't have been received") case <-time.After(time.Second * 5): } }) } func TestGetConnectionInfo(t *testing.T) { comm1, port1 := newCommInstance(t, naiveSec) comm2, _ := newCommInstance(t, naiveSec) defer comm1.Stop() defer comm2.Stop() m1 := comm1.Accept(acceptAll) comm2.Send(createGossipMsg(), remotePeer(port1)) select { case <-time.After(time.Second * 10): t.Fatal("Didn't receive a message in time") case msg := <-m1: require.Equal(t, comm2.GetPKIid(), msg.GetConnectionInfo().ID) require.NotNil(t, msg.GetSourceEnvelope()) } } func TestCloseConn(t *testing.T) { comm1, port1 := newCommInstance(t, naiveSec) defer comm1.Stop() acceptChan := comm1.Accept(acceptAll) cert := GenerateCertificatesOrPanic() tlsCfg := &tls.Config{ InsecureSkipVerify: true, Certificates: []tls.Certificate{cert}, } ta := credentials.NewTLS(tlsCfg) ctx, cancel := context.WithTimeout(context.Background(), time.Second) defer cancel() target := fmt.Sprintf("127.0.0.1:%d", port1) conn, err := grpc.DialContext(ctx, target, grpc.WithTransportCredentials(ta), grpc.WithBlock()) require.NoError(t, err, "%v", err) cl := proto.NewGossipClient(conn) stream, err := cl.GossipStream(context.Background()) require.NoError(t, err, "%v", err) c := &commImpl{} tlsCertHash := certHashFromRawCert(tlsCfg.Certificates[0].Certificate[0]) connMsg, _ := c.createConnectionMsg(common.PKIidType("pkiID"), tlsCertHash, api.PeerIdentityType("pkiID"), func(msg []byte) ([]byte, error) { mac := hmac.New(sha256.New, hmacKey) mac.Write(msg) return mac.Sum(nil), nil }, false) require.NoError(t, stream.Send(connMsg.Envelope)) stream.Send(createGossipMsg().Envelope) select { case <-acceptChan: case <-time.After(time.Second): require.Fail(t, "Didn't receive a message within a timely period") } comm1.CloseConn(&RemotePeer{PKIID: common.PKIidType("pkiID")}) time.Sleep(time.Second * 10) gotErr := false msg2Send := createGossipMsg() msg2Send.GetDataMsg().Payload = &proto.Payload{ Data: make([]byte, 1024*1024), } protoext.NoopSign(msg2Send.GossipMessage) for i := 0; i < DefRecvBuffSize; i++ { err := stream.Send(msg2Send.Envelope) if err != nil { gotErr = true break } } require.True(t, gotErr, "Should have failed because connection is closed") } // TestCommSend makes sure that enough messages get through // eventually. Comm.Send() is both asynchronous and best-effort, so this test // case assumes some will fail, but that eventually enough messages will get // through that the test will end. func TestCommSend(t *testing.T) { sendMessages := func(c Comm, peer *RemotePeer, stopChan <-chan struct{}) { ticker := time.NewTicker(time.Millisecond) defer ticker.Stop() for { emptyMsg := createGossipMsg() select { case <-stopChan: return case <-ticker.C: c.Send(emptyMsg, peer) } } } comm1, port1 := newCommInstance(t, naiveSec) comm2, port2 := newCommInstance(t, naiveSec) defer comm1.Stop() defer comm2.Stop() // Create the receive channel before sending the messages ch1 := comm1.Accept(acceptAll) ch2 := comm2.Accept(acceptAll) // control channels for background senders stopch1 := make(chan struct{}) stopch2 := make(chan struct{}) go sendMessages(comm1, remotePeer(port2), stopch1) go sendMessages(comm2, remotePeer(port1), stopch2) c1received := 0 c2received := 0 // hopefully in some runs we'll fill both send and receive buffers and // drop overflowing messages, but still finish, because the endless // stream of messages inexorably gets through unless something is very // broken. totalMessagesReceived := (DefSendBuffSize + DefRecvBuffSize) * 2 timer := time.NewTimer(30 * time.Second) defer timer.Stop() RECV: for { select { case <-ch1: c1received++ if c1received == totalMessagesReceived { close(stopch2) } case <-ch2: c2received++ if c2received == totalMessagesReceived { close(stopch1) } case <-timer.C: t.Fatalf("timed out waiting for messages to be received.\nc1 got %d messages\nc2 got %d messages", c1received, c2received) default: if c1received >= totalMessagesReceived && c2received >= totalMessagesReceived { break RECV } } } t.Logf("c1 got %d messages\nc2 got %d messages", c1received, c2received) } type nonResponsivePeer struct { *grpc.Server port int } func newNonResponsivePeer(t *testing.T) *nonResponsivePeer { port, gRPCServer, _, _, _ := util.CreateGRPCLayer() nrp := &nonResponsivePeer{ Server: gRPCServer.Server(), port: port, } proto.RegisterGossipServer(gRPCServer.Server(), nrp) return nrp } func (bp *nonResponsivePeer) Ping(context.Context, *proto.Empty) (*proto.Empty, error) { time.Sleep(time.Second * 15) return &proto.Empty{}, nil } func (bp *nonResponsivePeer) GossipStream(stream proto.Gossip_GossipStreamServer) error { return nil } func (bp *nonResponsivePeer) stop() { bp.Server.Stop() } func TestNonResponsivePing(t *testing.T) { c, _ := newCommInstance(t, naiveSec) defer c.Stop() nonRespPeer := newNonResponsivePeer(t) defer nonRespPeer.stop() s := make(chan struct{}) go func() { c.Probe(remotePeer(nonRespPeer.port)) s <- struct{}{} }() select { case <-time.After(time.Second * 10): require.Fail(t, "Request wasn't cancelled on time") case <-s: } } func TestResponses(t *testing.T) { comm1, port1 := newCommInstance(t, naiveSec) comm2, _ := newCommInstance(t, naiveSec) defer comm1.Stop() defer comm2.Stop() wg := sync.WaitGroup{} msg := createGossipMsg() wg.Add(1) go func() { inChan := comm1.Accept(acceptAll) wg.Done() for m := range inChan { reply := createGossipMsg() reply.Nonce = m.GetGossipMessage().Nonce + 1 m.Respond(reply.GossipMessage) } }() expectedNOnce := msg.Nonce + 1 responsesFromComm1 := comm2.Accept(acceptAll) ticker := time.NewTicker(10 * time.Second) wg.Wait() comm2.Send(msg, remotePeer(port1)) select { case <-ticker.C: require.Fail(t, "Haven't got response from comm1 within a timely manner") break case resp := <-responsesFromComm1: ticker.Stop() require.Equal(t, expectedNOnce, resp.GetGossipMessage().Nonce) break } } // TestAccept makes sure that accept filters work. The probability of the parity // of all nonces being 0 or 1 is very low. func TestAccept(t *testing.T) { comm1, port1 := newCommInstance(t, naiveSec) comm2, _ := newCommInstance(t, naiveSec) evenNONCESelector := func(m interface{}) bool { return m.(protoext.ReceivedMessage).GetGossipMessage().Nonce%2 == 0 } oddNONCESelector := func(m interface{}) bool { return m.(protoext.ReceivedMessage).GetGossipMessage().Nonce%2 != 0 } evenNONCES := comm1.Accept(evenNONCESelector) oddNONCES := comm1.Accept(oddNONCESelector) var evenResults []uint64 var oddResults []uint64 out := make(chan uint64) sem := make(chan struct{}) readIntoSlice := func(a *[]uint64, ch <-chan protoext.ReceivedMessage) { for m := range ch { *a = append(*a, m.GetGossipMessage().Nonce) select { case out <- m.GetGossipMessage().Nonce: default: // avoid blocking when we stop reading from out } } sem <- struct{}{} } go readIntoSlice(&evenResults, evenNONCES) go readIntoSlice(&oddResults, oddNONCES) stopSend := make(chan struct{}) go func() { for { select { case <-stopSend: return default: comm2.Send(createGossipMsg(), remotePeer(port1)) } } }() waitForMessages(t, out, (DefSendBuffSize+DefRecvBuffSize)*2, "Didn't receive all messages sent") close(stopSend) comm1.Stop() comm2.Stop() <-sem <-sem t.Logf("%d even nonces received", len(evenResults)) t.Logf("%d odd nonces received", len(oddResults)) require.NotEmpty(t, evenResults) require.NotEmpty(t, oddResults) remainderPredicate := func(a []uint64, rem uint64) { for _, n := range a { require.Equal(t, n%2, rem) } } remainderPredicate(evenResults, 0) remainderPredicate(oddResults, 1) } func TestReConnections(t *testing.T) { comm1, port1 := newCommInstance(t, naiveSec) comm2, port2 := newCommInstance(t, naiveSec) reader := func(out chan uint64, in <-chan protoext.ReceivedMessage) { for { msg := <-in if msg == nil { return } out <- msg.GetGossipMessage().Nonce } } out1 := make(chan uint64, 10) out2 := make(chan uint64, 10) go reader(out1, comm1.Accept(acceptAll)) go reader(out2, comm2.Accept(acceptAll)) // comm1 connects to comm2 comm1.Send(createGossipMsg(), remotePeer(port2)) waitForMessages(t, out2, 1, "Comm2 didn't receive a message from comm1 in a timely manner") // comm2 sends to comm1 comm2.Send(createGossipMsg(), remotePeer(port1)) waitForMessages(t, out1, 1, "Comm1 didn't receive a message from comm2 in a timely manner") comm1.Stop() comm1, port1 = newCommInstance(t, naiveSec) out1 = make(chan uint64, 1) go reader(out1, comm1.Accept(acceptAll)) comm2.Send(createGossipMsg(), remotePeer(port1)) waitForMessages(t, out1, 1, "Comm1 didn't receive a message from comm2 in a timely manner") comm1.Stop() comm2.Stop() } func TestProbe(t *testing.T) { comm1, port1 := newCommInstance(t, naiveSec) defer comm1.Stop() comm2, port2 := newCommInstance(t, naiveSec) time.Sleep(time.Duration(1) * time.Second) require.NoError(t, comm1.Probe(remotePeer(port2))) _, err := comm1.Handshake(remotePeer(port2)) require.NoError(t, err) tempPort, _, ll := getAvailablePort(t) defer ll.Close() require.Error(t, comm1.Probe(remotePeer(tempPort))) _, err = comm1.Handshake(remotePeer(tempPort)) require.Error(t, err) comm2.Stop() time.Sleep(time.Duration(1) * time.Second) require.Error(t, comm1.Probe(remotePeer(port2))) _, err = comm1.Handshake(remotePeer(port2)) require.Error(t, err) comm2, port2 = newCommInstance(t, naiveSec) defer comm2.Stop() time.Sleep(time.Duration(1) * time.Second) require.NoError(t, comm2.Probe(remotePeer(port1))) _, err = comm2.Handshake(remotePeer(port1)) require.NoError(t, err) require.NoError(t, comm1.Probe(remotePeer(port2))) _, err = comm1.Handshake(remotePeer(port2)) require.NoError(t, err) // Now try a deep probe with an expected PKI-ID that doesn't match wrongRemotePeer := remotePeer(port2) if wrongRemotePeer.PKIID[0] == 0 { wrongRemotePeer.PKIID[0] = 1 } else { wrongRemotePeer.PKIID[0] = 0 } _, err = comm1.Handshake(wrongRemotePeer) require.Error(t, err) // Try a deep probe with a nil PKI-ID endpoint := fmt.Sprintf("127.0.0.1:%d", port2) id, err := comm1.Handshake(&RemotePeer{Endpoint: endpoint}) require.NoError(t, err) require.Equal(t, api.PeerIdentityType(endpoint), id) } func TestPresumedDead(t *testing.T) { comm1, _ := newCommInstance(t, naiveSec) comm2, port2 := newCommInstance(t, naiveSec) wg := sync.WaitGroup{} wg.Add(1) go func() { wg.Wait() comm1.Send(createGossipMsg(), remotePeer(port2)) }() ticker := time.NewTicker(time.Duration(10) * time.Second) acceptCh := comm2.Accept(acceptAll) wg.Done() select { case <-acceptCh: ticker.Stop() case <-ticker.C: require.Fail(t, "Didn't get first message") } comm2.Stop() go func() { for i := 0; i < 5; i++ { comm1.Send(createGossipMsg(), remotePeer(port2)) time.Sleep(time.Millisecond * 200) } }() ticker = time.NewTicker(time.Second * time.Duration(3)) select { case <-ticker.C: require.Fail(t, "Didn't get a presumed dead message within a timely manner") break case <-comm1.PresumedDead(): ticker.Stop() break } } func TestReadFromStream(t *testing.T) { stream := &gmocks.MockStream{} stream.On("CloseSend").Return(nil) stream.On("Recv").Return(&proto.Envelope{Payload: []byte{1}}, nil).Once() stream.On("Recv").Return(nil, errors.New("stream closed")).Once() conn := newConnection(nil, nil, stream, disabledMetrics, ConnConfig{1, 1}) conn.logger = flogging.MustGetLogger("test") errChan := make(chan error, 2) msgChan := make(chan *protoext.SignedGossipMessage, 1) var wg sync.WaitGroup wg.Add(1) go func() { defer wg.Done() conn.readFromStream(errChan, msgChan) }() select { case <-msgChan: require.Fail(t, "malformed message shouldn't have been received") case <-time.After(time.Millisecond * 100): require.Len(t, errChan, 1) } conn.close() wg.Wait() } func TestSendBadEnvelope(t *testing.T) { comm1, port := newCommInstance(t, naiveSec) defer comm1.Stop() stream, err := establishSession(t, port) require.NoError(t, err) inc := comm1.Accept(acceptAll) goodMsg := createGossipMsg() err = stream.Send(goodMsg.Envelope) require.NoError(t, err) select { case goodMsgReceived := <-inc: require.Equal(t, goodMsg.Envelope.Payload, goodMsgReceived.GetSourceEnvelope().Payload) case <-time.After(time.Minute): require.Fail(t, "Didn't receive message within a timely manner") return } // Next, we corrupt a message and send it until the stream is closed forcefully from the remote peer start := time.Now() for { badMsg := createGossipMsg() badMsg.Envelope.Payload = []byte{1} err = stream.Send(badMsg.Envelope) if err != nil { require.Equal(t, io.EOF, err) break } if time.Now().After(start.Add(time.Second * 30)) { require.Fail(t, "Didn't close stream within a timely manner") return } } } func establishSession(t *testing.T, port int) (proto.Gossip_GossipStreamClient, error) { cert := GenerateCertificatesOrPanic() secureOpts := grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{ InsecureSkipVerify: true, Certificates: []tls.Certificate{cert}, })) ctx, cancel := context.WithTimeout(context.Background(), time.Second) defer cancel() endpoint := fmt.Sprintf("127.0.0.1:%d", port) conn, err := grpc.DialContext(ctx, endpoint, secureOpts, grpc.WithBlock()) require.NoError(t, err, "%v", err) if err != nil { return nil, err } cl := proto.NewGossipClient(conn) stream, err := cl.GossipStream(context.Background()) require.NoError(t, err, "%v", err) if err != nil { return nil, err } clientCertHash := certHashFromRawCert(cert.Certificate[0]) pkiID := common.PKIidType([]byte{1, 2, 3}) c := &commImpl{} require.NoError(t, err, "%v", err) msg, _ := c.createConnectionMsg(pkiID, clientCertHash, []byte{1, 2, 3}, func(msg []byte) ([]byte, error) { mac := hmac.New(sha256.New, hmacKey) mac.Write(msg) return mac.Sum(nil), nil }, false) // Send your own connection message stream.Send(msg.Envelope) // Wait for connection message from the other side envelope, err := stream.Recv() if err != nil { return nil, err } require.NotNil(t, envelope) return stream, nil } func createGossipMsg() *protoext.SignedGossipMessage { msg, _ := protoext.NoopSign(&proto.GossipMessage{ Tag: proto.GossipMessage_EMPTY, Nonce: uint64(r.Int()), Content: &proto.GossipMessage_DataMsg{ DataMsg: &proto.DataMessage{}, }, }) return msg } func remotePeer(port int) *RemotePeer { endpoint := fmt.Sprintf("127.0.0.1:%d", port) return &RemotePeer{Endpoint: endpoint, PKIID: []byte(endpoint)} } func waitForMessages(t *testing.T, msgChan chan uint64, count int, errMsg string) { c := 0 waiting := true ticker := time.NewTicker(time.Duration(10) * time.Second) for waiting { select { case <-msgChan: c++ if c == count { waiting = false } case <-ticker.C: waiting = false } } require.Equal(t, count, c, errMsg) } func TestConcurrentCloseSend(t *testing.T) { var stopping int32 comm1, _ := newCommInstance(t, naiveSec) comm2, port2 := newCommInstance(t, naiveSec) m := comm2.Accept(acceptAll) comm1.Send(createGossipMsg(), remotePeer(port2)) <-m ready := make(chan struct{}) done := make(chan struct{}) go func() { defer close(done) comm1.Send(createGossipMsg(), remotePeer(port2)) close(ready) for atomic.LoadInt32(&stopping) == int32(0) { comm1.Send(createGossipMsg(), remotePeer(port2)) } }() <-ready comm2.Stop() atomic.StoreInt32(&stopping, int32(1)) <-done } ```
Melitaea deserticola, the desert fritillary, is a butterfly of the family Nymphalidae. It is found in North Africa (Morocco, Algeria, Libya and Egypt), Lebanon, Israel, Jordan, Saudi Arabia and Yemen. The larvae feed on Linaria aegyptiaca, Plantago media, Anarrhinum fruticosum and Anarrhinum species. Subspecies Melitaea deserticola deserticola (North Africa) Melitaea deserticola macromaculata Belter, 1934 (Syria, Lebanon, Israel, Jordan, western Saudi Arabia) Melitaea deserticola scotti Higgins, 1941 (Yemen, Oman) References Butterflies described in 1909 Melitaea
Ted Hill (15 January 1914 - 1 July 1986) was a former Australian rules footballer who played with Collingwood and Fitzroy in the Victorian Football League (VFL). Hill joined Coburg Football Club as a 16 year old in 1930, spending three years with them, before joining Collingwood. Hill was captain / coach of Kalgoorlie Railways in their 1948 premiership season, then in 1949, he coached Yallourn to a premiership in the Central Gippsland Football League Hill was appointed as captain / coach of Culcairn in 1952 and lead them to the 1952 Albury & District Football League premiership. Notes External links 1952 - Albury & DFL Premiers: Culcairn FC team photo 1914 births 1986 deaths Australian rules footballers from Victoria (state) Collingwood Football Club players Fitzroy Football Club players Coburg Football Club players
Kruszyn is a village in the administrative district of Gmina Włocławek, within Włocławek County, Kuyavian-Pomeranian Voivodeship, in north-central Poland. It lies approximately south of Włocławek and south-east of Toruń. References External links Villages in Włocławek County