text
stringlengths
1
22.8M
HNY may refer to: Happy New Year (2014 film) Hengyang Nanyue Airport, IATA code HNY Hengyang Bajialing Airport, former IATA code HNY Hny (trigraph) See also Happy New Year (disambiguation)
```xml /** * All rights reserved. * * This source code is licensed under the MIT-style license found in the * LICENSE file in the root directory of this source tree. */ #import "RNSVGRenderableManager.h" #import <React/RCTBridge.h> #import <React/RCTUIManager.h> #import <React/RCTUIManagerUtils.h> #import "RNSVGPathMeasure.h" #import "RCTConvert+RNSVG.h" #import "RNSVGCGFCRule.h" @implementation RNSVGRenderableManager RCT_EXPORT_MODULE() - (RNSVGRenderable *)node { return [RNSVGRenderable new]; } RCT_EXPORT_VIEW_PROPERTY(fill, RNSVGBrush) RCT_EXPORT_VIEW_PROPERTY(fillOpacity, CGFloat) RCT_EXPORT_VIEW_PROPERTY(fillRule, RNSVGCGFCRule) RCT_EXPORT_VIEW_PROPERTY(stroke, RNSVGBrush) RCT_EXPORT_VIEW_PROPERTY(strokeOpacity, CGFloat) RCT_EXPORT_VIEW_PROPERTY(strokeWidth, RNSVGLength *) RCT_EXPORT_VIEW_PROPERTY(strokeLinecap, CGLineCap) RCT_EXPORT_VIEW_PROPERTY(strokeLinejoin, CGLineJoin) RCT_EXPORT_VIEW_PROPERTY(strokeDasharray, NSArray<RNSVGLength *>) RCT_EXPORT_VIEW_PROPERTY(strokeDashoffset, CGFloat) RCT_EXPORT_VIEW_PROPERTY(strokeMiterlimit, CGFloat) RCT_EXPORT_VIEW_PROPERTY(vectorEffect, int) RCT_EXPORT_VIEW_PROPERTY(propList, NSArray<NSString *>) RCT_EXPORT_VIEW_PROPERTY(filter, NSString) @end ```
Don or Donald Harris may refer to: Don Harris (journalist) (1936–1978), NBC News correspondent killed at Jonestown Don Harris (American football) (born 1954), former American football safety Don Harris (wrestler), one of the Harris Brothers Don "Sugarcane" Harris (1938–1999), American rock and roll violinist and guitarist Don Harris, a character in 28 Weeks Later Don Harris (Australian footballer) (1905–1979), Australian rules footballer Donald Harris (baseball) (born 1967), baseball player Donald Harris (composer) (1931–2016), American composer Donald Harris (priest) (1904–1996), Archdeacon of Bedford Donald J. Harris (born 1938), Stanford University economist, father of vice president Kamala Harris
```smalltalk using Microsoft.Extensions.Configuration; using System; using System.Collections.Generic; using System.Threading.Tasks; using Volo.Abp.Authorization.Permissions; using Volo.Abp.Data; using Volo.Abp.DependencyInjection; using Volo.Abp.Guids; using Volo.Abp.IdentityServer.ApiResources; using Volo.Abp.IdentityServer.Clients; using Volo.Abp.IdentityServer.IdentityResources; using Volo.Abp.PermissionManagement; using Volo.Abp.Uow; namespace Volo.CmsKit.IdentityServer; public class IdentityServerDataSeedContributor : IDataSeedContributor, ITransientDependency { private readonly IApiResourceRepository _apiResourceRepository; private readonly IClientRepository _clientRepository; private readonly IIdentityResourceDataSeeder _identityResourceDataSeeder; private readonly IGuidGenerator _guidGenerator; private readonly IPermissionDataSeeder _permissionDataSeeder; private readonly IConfiguration _configuration; public IdentityServerDataSeedContributor( IClientRepository clientRepository, IApiResourceRepository apiResourceRepository, IIdentityResourceDataSeeder identityResourceDataSeeder, IGuidGenerator guidGenerator, IPermissionDataSeeder permissionDataSeeder, IConfiguration configuration) { _clientRepository = clientRepository; _apiResourceRepository = apiResourceRepository; _identityResourceDataSeeder = identityResourceDataSeeder; _guidGenerator = guidGenerator; _permissionDataSeeder = permissionDataSeeder; _configuration = configuration; } [UnitOfWork] public virtual async Task SeedAsync(DataSeedContext context) { await _identityResourceDataSeeder.CreateStandardResourcesAsync(); await CreateApiResourcesAsync(); await CreateClientsAsync(); } private async Task CreateApiResourcesAsync() { var commonApiUserClaims = new[] { "email", "email_verified", "name", "phone_number", "phone_number_verified", "role" }; await CreateApiResourceAsync("CmsKit", commonApiUserClaims); } private async Task<ApiResource> CreateApiResourceAsync(string name, IEnumerable<string> claims) { var apiResource = await _apiResourceRepository.FindByNameAsync(name); if (apiResource == null) { apiResource = await _apiResourceRepository.InsertAsync( new ApiResource( _guidGenerator.Create(), name, name + " API" ), autoSave: true ); } foreach (var claim in claims) { if (apiResource.FindClaim(claim) == null) { apiResource.AddUserClaim(claim); } } return await _apiResourceRepository.UpdateAsync(apiResource); } private async Task CreateClientsAsync() { const string commonSecret = "E5Xd4yMqjP5kjWFKrYgySBju6JVfCzMyFp7n2QmMrME="; var commonScopes = new[] { "email", "openid", "profile", "role", "phone", "address", "CmsKit" }; var configurationSection = _configuration.GetSection("IdentityServer:Clients"); //Web Client var webClientId = configurationSection["CmsKit_Web:ClientId"]; if (!webClientId.IsNullOrWhiteSpace()) { var webClientRootUrl = configurationSection["CmsKit_Web:RootUrl"].EnsureEndsWith('/'); await CreateClientAsync( webClientId, commonScopes, new[] { "hybrid" }, commonSecret, redirectUri: $"{webClientRootUrl}signin-oidc", postLogoutRedirectUri: $"{webClientRootUrl}signout-callback-oidc" ); } //Console Test Client var consoleClientId = configurationSection["CmsKit_ConsoleTestApp:ClientId"]; if (!consoleClientId.IsNullOrWhiteSpace()) { await CreateClientAsync( consoleClientId, commonScopes, new[] { "password", "client_credentials" }, commonSecret ); } } private async Task<Client> CreateClientAsync( string name, IEnumerable<string> scopes, IEnumerable<string> grantTypes, string secret, string redirectUri = null, string postLogoutRedirectUri = null, IEnumerable<string> permissions = null) { var client = await _clientRepository.FindByClientIdAsync(name); if (client == null) { client = await _clientRepository.InsertAsync( new Client( _guidGenerator.Create(), name ) { ClientName = name, ProtocolType = "oidc", Description = name, AlwaysIncludeUserClaimsInIdToken = true, AllowOfflineAccess = true, AbsoluteRefreshTokenLifetime = 31536000, //365 days AccessTokenLifetime = 31536000, //365 days AuthorizationCodeLifetime = 300, IdentityTokenLifetime = 300, RequireConsent = false }, autoSave: true ); } foreach (var scope in scopes) { if (client.FindScope(scope) == null) { client.AddScope(scope); } } foreach (var grantType in grantTypes) { if (client.FindGrantType(grantType) == null) { client.AddGrantType(grantType); } } if (client.FindSecret(secret) == null) { client.AddSecret(secret); } if (redirectUri != null) { if (client.FindRedirectUri(redirectUri) == null) { client.AddRedirectUri(redirectUri); } } if (postLogoutRedirectUri != null) { if (client.FindPostLogoutRedirectUri(postLogoutRedirectUri) == null) { client.AddPostLogoutRedirectUri(postLogoutRedirectUri); } } if (permissions != null) { await _permissionDataSeeder.SeedAsync( ClientPermissionValueProvider.ProviderName, name, permissions, null ); } return await _clientRepository.UpdateAsync(client); } } ```
Mehdi Dinvarzadeh (Persian: مهدی دینورزاده) is a retired Iranian footballer and football coach. He was the captain of the Iran national football team and Shahin F.C. during the 1980s. He is currently head coach of Shahrdari Ardabil in Azadegan League Playing career Club careers He began his playing for the Shahbaz F.C. in 1970. In 1972, he joined to the Pas Tehran F.C. His golden ages was in Pas but after Pas's bad results in 1976, he leaves Pas and enjoyed to Shahin F.C. and was retired from playing in 1986. International careers He was invited to the Iran national football team in 1977 by Heshmat Mohajerani. He was played for the national team for 26 times . He retired after a match against Turkey in 1984. Managerial career He began coaching in Mehr Shemiran in 1990. In 1985, he becomes head coach of Payam Mashhad but less than one year, he was sacked by club. Later, he was appointed as head coach of Aboomoslem and had a good results with Aboomoslem. After near one decade, he return to the football and becomes head coach of Bargh Tehran but was resigned in June 2007. In July 2007, he becomes head coach of Naft Tehran and help club to promoted to the Iran Pro League. From May to June 2010, he was caretaker head coach of Bargh Shiraz. On 1 June 2010, he was appointed as head coach of Damash Gilan and promoted to the Iran Pro League with Damash and was lead Damash in 2011–12 Persian Gulf Cup until week 8. He was resigned on 18 September 2011. Statistics Achievements Player Iran national football team Asian Cup (third place): 1980 Manager Naft Tehran Azadegan League: 2009–10 2nd Division: 2008–09 Damash Gilan Azadegan League: 2010–11 Shahrdari Ardabil 2nd Division: 2013–14 References External links teammelli.com mardomsalari.com Iranian football managers Iranian men's footballers Living people Shahin Tehran F.C. players PAS Tehran F.C. players 1955 births Iran men's international footballers Bargh Shiraz F.C. managers S.C. Damash Gilan managers Men's association football defenders Footballers from Rasht 1980 AFC Asian Cup players
Thomas Quinn (1838 – 3 November 1897) was an Irish nationalist politician and a successful builder in London. A member of the Irish Parliamentary Party, he was Member of Parliament (MP) for Kilkenny City from 1886 to 1892 and Treasurer of the Irish National League and the Irish Land League of Great Britain. In the Split in the Irish Parliamentary Party over the leadership of Charles Stewart Parnell, he began as a supporter of Parnell but changed allegiance to the Anti-Parnellite majority in May 1891. Early life Quinn had a humble background. He was the son of Matthew Quinn of Longford, Co. Longford. He was educated at Longford and Mullingar, Co. Westmeath. At an early age he went to London, where he lived for the rest of his life. He learned the building trade as a journeyman carpenter, eventually creating a large building business of his own, and winning government contracts. He was one of the pioneers of the building of flats. In 1863 he married Mary, daughter of Michael Canlan, and they had four children. Political career He stood as a Home Rule candidate for County Leitrim in 1880, but came 170 votes short of winning a seat. He remained active in the Nationalist cause; as of 1883 he was Treasurer of the National League and Land League of Great Britain. In August 1885 he was adopted as a Nationalist candidate for County Longford, and at a convention in October 1885 it was decided that he would fight the South seat. He had to withdraw before being formally nominated because of an indirect connection with a government contract, but in the following July 1886 general election, he was returned unopposed for Kilkenny City. Quinn was a particular target of the "Parnellism and Crime" campaign by The Times newspaper against Parnell and his party. Whereas the main accusation against Parnell was simply that according to a corrupt journalist Richard Pigott he had privately expressed support for the Phoenix Park Murders, Quinn was effectively accused in an anonymous letter published on 13 June 1887 of being an accessory to the murders themselves. He was effectively exonerated, along with his co-accused, by the collapse of The Times’ case before the Parnell Commission in February 1889. When the Irish Parliamentary Party split over the question of Parnell's leadership in December 1890, Quinn supported Parnell. However he disagreed with Parnell over the latter's treatment of the disputed "Paris funds" and in May 1891 he applied for the Whip of the Anti-Parnellite Parliamentary Party chaired by Justin McCarthy. The Anti-Parnellites were seriously divided between the factions led on the one hand by Timothy Healy, and on the other by John Dillon and William O'Brien; between them Quinn was a neutral. In February 1892 he saw off an attempt by a creditor to have him committed to prison, when the judge at Westminster County Court threw out the case on the ground of Parliamentary privilege. Quinn retired from Parliament at the general election of July 1892 due to ill-health. He died at his home in Kensington on 3 November 1897, having never recovered from a severe chill contracted when attending a Gaelic athletic sports event four months previously. He was buried in Glasnevin Cemetery, Dublin, on 10 November 1897. He was survived by his wife, but all four of their children predeceased him. Footnotes Sources Freeman's Journal, 4 & 8 November 1897 T. W. Moody, The Times versus Parnell and Co., 1887–90, Historical Studies (Papers read before the Irish Conference of Historians), VI, London, Routledge & Kegan Paul, 1968 The Times (London), 25 August, 13 October and 1 December 1885; 17 July 1886; 13 June 1887; 10 July 1888; 4–6 May 1891; 10 February and 16 April 1892; 4 November 1897 Brian M. Walker (ed.), Parliamentary Election Results in Ireland, 1801-1922, Dublin, Royal Irish Academy, 1978 External links 1838 births 1897 deaths Irish Parliamentary Party MPs Anti-Parnellite MPs UK MPs 1886–1892 Members of the Parliament of the United Kingdom for County Kilkenny constituencies (1801–1922) Politicians from County Longford Burials at Glasnevin Cemetery People from Longford (town)
Nessos of Chios (Ancient Greek: Νεσσᾶς or Νέσσος ὁ Χῖος) was a pre-Socratic ancient Greek philosopher from the island of Chios. Biography Little is known about the life and work of Nessos. The only thing that is known that was Democritus philosophy and the compatriot Metrodorus was his student. That is supported in commentaries of interpretations of Homeric and Hesiod works. References 1st-millennium BC deaths 1st-millennium BC births Ancient Chians Ancient Greek atomist philosophers
Nawab Sir Shahnawaz Khan Mamdot (17 December 1883 – 28 March 1942) was a Punjabi landowner and politician of British India. He was a key supporter of the Pakistan movement and for some time, the largest landowner in undivided Punjab. Early life and career He was born in Mamdot, Kasur District, Punjab in 1883. In 1907, he left Punjab, British India and settled in Hyderabad State where he joined the state police. In 1928, Nawab Ghulam Qutbuddin Khan Mamdot, ruler on the Mamdot estate at that time, died without issue and childless, and the British Court of Law awarded Shahnawaz the jagirs and title of Nawab of Mamdot. In doing so, he became one of the largest landowners in the Punjab. He returned to his ancestral land in 1934 and joined the Unionist Party (Punjab). Following the Jinnah-Sikandar Pact in 1937, Mamdot joined the All-India Muslim League and became President of the Punjab Muslim League in 1938. Then he became head of it and started structurally reorganisinig the Punjab Muslim League. He then played a key role in organizing the historic session of the All-India Muslim League in March 1940 in Lahore. He personally paid almost all its expenses. He also was the chairman of the reception committee. Jinnah usually stayed at his 'Mamdot Villa' whenever he was in Lahore. He was knighted in the King's New Year's Honour List at the start of 1939. Later that year, he funded publication of a book by Mian Kifait Ali titled "Pakistan", which caused Mohammad Ali Jinnah to intervene and insist on a name change before publication for risk of antagonizing non-Muslims. Mamdot was a staunch supporter of a separate Muslim nation, and held the belief that Muslims could never tolerate subjugation to a community with which they shared no common ground in religion, culture and civilisation. At the Lahore Resolution session in 1940, he gave the welcome address as chairman of the local reception committee. Commemorative postage stamp Pakistan Post issued a commemorative postage stamp in his honor in 1990. Death and legacy He died of a heart attack in Lahore on 28 March 1942. He was succeeded as the Nawab of Mamdot, and president of the Punjab Muslim League by his son Iftikhar Hussain Khan Mamdot. References 1883 births 1942 deaths History of Punjab Indian landowners People from British India Indian Knights Bachelor Mamdot family 20th-century landowners Pakistan Movement activists People from Lahore
This was the first edition of the tournament. Andrea Hlaváčková and Galina Voskoboeva won the title beating polish pair Klaudia Jans and Alicja Rosolska 3–6, 6–0, [10–5] in the final. Seeds Draw Draw References Main Draw Brussels Open - Doubles
```shell #!/usr/bin/env bash ########################################################################## # This is the Cake bootstrapper script for Linux and OS X. # This file was downloaded from path_to_url # Feel free to change this file to fit your needs. ########################################################################## # Define directories. SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) TOOLS_DIR=$SCRIPT_DIR/tools NUGET_EXE=$TOOLS_DIR/nuget.exe CAKE_EXE=$TOOLS_DIR/Cake/Cake.exe PACKAGES_CONFIG=$TOOLS_DIR/packages.config PACKAGES_CONFIG_MD5=$TOOLS_DIR/packages.config.md5sum # Define md5sum or md5 depending on Linux/OSX MD5_EXE= if [[ "$(uname -s)" == "Darwin" ]]; then MD5_EXE="md5 -r" else MD5_EXE="md5sum" fi # Define default arguments. SCRIPT="build.cake" TARGET="Default" CONFIGURATION="Release" VERBOSITY="verbose" DRYRUN= SHOW_VERSION=false SCRIPT_ARGUMENTS=() # Parse arguments. for i in "$@"; do case $1 in -s|--script) SCRIPT="$2"; shift ;; -t|--target) TARGET="$2"; shift ;; -c|--configuration) CONFIGURATION="$2"; shift ;; -v|--verbosity) VERBOSITY="$2"; shift ;; -d|--dryrun) DRYRUN="-dryrun" ;; --version) SHOW_VERSION=true ;; --) shift; SCRIPT_ARGUMENTS+=("$@"); break ;; *) SCRIPT_ARGUMENTS+=("$1") ;; esac shift done # Make sure the tools folder exist. if [ ! -d "$TOOLS_DIR" ]; then mkdir "$TOOLS_DIR" fi # Make sure that packages.config exist. if [ ! -f "$TOOLS_DIR/packages.config" ]; then echo "Downloading packages.config..." curl -Lsfo "$TOOLS_DIR/packages.config" path_to_url if [ $? -ne 0 ]; then echo "An error occured while downloading packages.config." exit 1 fi fi # Download NuGet if it does not exist. if [ ! -f "$NUGET_EXE" ]; then echo "Downloading NuGet..." curl -Lsfo "$NUGET_EXE" path_to_url if [ $? -ne 0 ]; then echo "An error occured while downloading nuget.exe." exit 1 fi fi # Restore tools from NuGet. pushd "$TOOLS_DIR" >/dev/null if [ ! -f $PACKAGES_CONFIG_MD5 ] || [ "$( cat $PACKAGES_CONFIG_MD5 | sed 's/\r$//' )" != "$( $MD5_EXE $PACKAGES_CONFIG | awk '{ print $1 }' )" ]; then find . -type d ! -name . | xargs rm -rf fi mono "$NUGET_EXE" install -ExcludeVersion if [ $? -ne 0 ]; then echo "Could not restore NuGet packages." exit 1 fi $MD5_EXE $PACKAGES_CONFIG | awk '{ print $1 }' >| $PACKAGES_CONFIG_MD5 popd >/dev/null # Make sure that Cake has been installed. if [ ! -f "$CAKE_EXE" ]; then echo "Could not find Cake.exe at '$CAKE_EXE'." exit 1 fi # Start Cake if $SHOW_VERSION; then exec mono "$CAKE_EXE" -version else exec mono "$CAKE_EXE" $SCRIPT -verbosity=$VERBOSITY -configuration=$CONFIGURATION -target=$TARGET $DRYRUN "${SCRIPT_ARGUMENTS[@]}" fi ```
```c++ /********************************************************************* * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * * Neither the name of Willow Garage nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. *********************************************************************/ /* Author: Mrinal Kalakrishnan */ #include <chomp_motion_planner/chomp_parameters.h> namespace chomp { ChompParameters::ChompParameters() { planning_time_limit_ = 6.0; max_iterations_ = 50; max_iterations_after_collision_free_ = 5; smoothness_cost_weight_ = 0.1; obstacle_cost_weight_ = 1.0; learning_rate_ = 0.01; smoothness_cost_velocity_ = 0.0; smoothness_cost_acceleration_ = 1.0; smoothness_cost_jerk_ = 0.0; ridge_factor_ = 0.0; use_pseudo_inverse_ = false; pseudo_inverse_ridge_factor_ = 1e-4; joint_update_limit_ = 0.1; min_clearance_ = 0.2; collision_threshold_ = 0.07; use_stochastic_descent_ = true; filter_mode_ = false; trajectory_initialization_method_ = std::string("quintic-spline"); enable_failure_recovery_ = false; max_recovery_attempts_ = 5; } ChompParameters::~ChompParameters() = default; void ChompParameters::setRecoveryParams(double learning_rate, double ridge_factor, int planning_time_limit, int max_iterations) { this->learning_rate_ = learning_rate; this->ridge_factor_ = ridge_factor; this->planning_time_limit_ = planning_time_limit; this->max_iterations_ = max_iterations; } const std::vector<std::string> ChompParameters::VALID_INITIALIZATION_METHODS{ "quintic-spline", "linear", "cubic", "fillTrajectory" }; bool ChompParameters::setTrajectoryInitializationMethod(std::string method) { if (std::find(VALID_INITIALIZATION_METHODS.cbegin(), VALID_INITIALIZATION_METHODS.cend(), method) != VALID_INITIALIZATION_METHODS.end()) { this->trajectory_initialization_method_ = std::move(method); return true; } return false; } } // namespace chomp ```
Europa Plus (formally Europa Plus Social Movement, ) was a pro-European centre-left coalition of parties in Poland, formed to contest the 2014 European Parliament election. The alliance described itself as a "modern centre-left formation". The coalition was founded on 3 February 2013 by the Palikot's Movement, Social Democracy of Poland, Labour United, the Union of the Left and the Reason Party. The project was led by Marek Siwiec (a former Vice President of the Democratic Left Alliance and then-current MEP), Aleksander Kwasniewski (a former President of Poland and member of the Democratic Left Alliance) and Janusz Palikot. However, on 15 June 2013, Labour United congress instead stated it would continue its previous coalition with the Democratic Left Alliance. The Democratic Party – demokraci.pl later joined the alliance on 24 June 2013. Other parties listed in the alliance's website are the Democratic Party and the Polish Labour Party. The alliance's programme supported the introduction of the Euro to Poland by January 2019, a new system of health care in Poland and free Internet access for Polish citizens. On 6 October 2013, Palikot's Movement was reorganised into Your Movement. On 7 February 2014, the Union of the Left and Social Democracy of Poland exited the alliance. In the 2014 European election, Europa Plus received 3.58% of the vote, below the 5% threshold to elect any MEPs. On 29 May 2014, it was announced that the alliance had been disbanded. References External links Official website Official website (English version) 2013 establishments in Poland Defunct political party alliances in Poland Political parties established in 2013 Defunct social democratic parties in Poland
```java package com.ctrip.xpipe.exception; /** * @author wenchao.meng * * 2016324 2:58:53 */ public class XpipeRuntimeException extends RuntimeException implements ErrorMessageAware{ private static final long serialVersionUID = 1L; private ErrorMessage<?> errorMessage; private boolean onlyLogMessage = false; public XpipeRuntimeException(String message){ super(message); } public XpipeRuntimeException(String message, Throwable th){ super(message, th); } public <T extends Enum<T>> XpipeRuntimeException(ErrorMessage<T> errorMessage, Throwable th){ super(errorMessage.toString(), th); this.errorMessage = errorMessage; } @Override public ErrorMessage<?> getErrorMessage() { return errorMessage; } public void setErrorMessage(ErrorMessage<?> errorMessage) { this.errorMessage = errorMessage; } public boolean isOnlyLogMessage() { return onlyLogMessage; } public void setOnlyLogMessage(boolean onlyLogMessage) { this.onlyLogMessage = onlyLogMessage; } } ```
Rear Admiral Martin Noel Lucey CB DSC (21 January 1920 – 8 July 1992) was a Royal Navy officer who became Flag Officer, Scotland and Northern Ireland and Admiral President Royal Naval College, Greenwich. Naval career Educated at Gresham's School, Holt, Norfolk, Lucey entered the Royal Navy in 1938. He served in the Second World War being promoted lieutenant in 1941 and being awarded the DSC in 1944. He became commanding officer of the frigate HMS Puma as well as captain of the 7th Frigate Squadron in early 1966, director of Seamen Officer Appointments later that year, and Senior Naval Officer West Indies in 1968. He went on to be Admiral President Royal Naval College, Greenwich in 1970 and Flag Officer, Scotland and Northern Ireland in 1972 before retiring in 1974. In retirement Lucey lived in Houghton, West Sussex, and died on 8 July 1992. Family In 1947 he married Barbara Mary Key. They had two sons and one daughter. References |- 1920 births 1992 deaths Admiral presidents of the Royal Naval College, Greenwich Companions of the Order of the Bath People educated at Gresham's School Royal Navy rear admirals Recipients of the Distinguished Service Cross (United Kingdom) Royal Navy officers of World War II
```java /** * <p> * * path_to_url * * </p> **/ package com.vip.saturn.job.utils; import org.junit.Assert; import org.junit.Test; import java.util.concurrent.CountDownLatch; /** * @author hebelala */ public class SaturnSystemOutputStreamTest { @Test public void test() throws InterruptedException { SaturnSystemOutputStream.initLogger(); try { System.out.println("abc"); int count = 200; final CountDownLatch countDownLatch = new CountDownLatch(count); for (int i = 0; i < count; i++) { final int j = i; new Thread(new Runnable() { @Override public void run() { System.out.println("abc" + j); countDownLatch.countDown(); } }).start(); } countDownLatch.await(); } finally { String result = SaturnSystemOutputStream.clearAndGetLog(); Assert.assertEquals(100, result.split(System.lineSeparator()).length); } } } ```
```shell Detect your linux distribution Force a time update with `ntp` Removing old kernels in Debian based systems Changing the timezone on deb based systems Finding Open Files With `lsof` ```
```go package config import ( "context" "github.com/aws/aws-sdk-go-v2/aws" ) // defaultLoaders are a slice of functions that will read external configuration // sources for configuration values. These values are read by the AWSConfigResolvers // using interfaces to extract specific information from the external configuration. var defaultLoaders = []loader{ loadEnvConfig, loadSharedConfigIgnoreNotExist, } // defaultAWSConfigResolvers are a slice of functions that will resolve external // configuration values into AWS configuration values. // // This will setup the AWS configuration's Region, var defaultAWSConfigResolvers = []awsConfigResolver{ // Resolves the default configuration the SDK's aws.Config will be // initialized with. resolveDefaultAWSConfig, // Sets the logger to be used. Could be user provided logger, and client // logging mode. resolveLogger, resolveClientLogMode, // Sets the HTTP client and configuration to use for making requests using // the HTTP transport. resolveHTTPClient, resolveCustomCABundle, // Sets the endpoint resolving behavior the API Clients will use for making // requests to. Clients default to their own clients this allows overrides // to be specified. The resolveEndpointResolver option is deprecated, but // we still need to set it for backwards compatibility on config // construction. resolveEndpointResolver, resolveEndpointResolverWithOptions, // Sets the retry behavior API clients will use within their retry attempt // middleware. Defaults to unset, allowing API clients to define their own // retry behavior. resolveRetryer, // Sets the region the API Clients should use for making requests to. resolveRegion, resolveEC2IMDSRegion, resolveDefaultRegion, // Sets the additional set of middleware stack mutators that will custom // API client request pipeline middleware. resolveAPIOptions, // Resolves the DefaultsMode that should be used by SDK clients. If this // mode is set to DefaultsModeAuto. // // Comes after HTTPClient and CustomCABundle to ensure the HTTP client is // configured if provided before invoking IMDS if mode is auto. Comes // before resolving credentials so that those subsequent clients use the // configured auto mode. resolveDefaultsModeOptions, // Sets the resolved credentials the API clients will use for // authentication. Provides the SDK's default credential chain. // // Should probably be the last step in the resolve chain to ensure that all // other configurations are resolved first in case downstream credentials // implementations depend on or can be configured with earlier resolved // configuration options. resolveCredentials, } // A Config represents a generic configuration value or set of values. This type // will be used by the AWSConfigResolvers to extract // // General the Config type will use type assertion against the Provider interfaces // to extract specific data from the Config. type Config interface{} // A loader is used to load external configuration data and returns it as // a generic Config type. // // The loader should return an error if it fails to load the external configuration // or the configuration data is malformed, or required components missing. type loader func(context.Context, configs) (Config, error) // An awsConfigResolver will extract configuration data from the configs slice // using the provider interfaces to extract specific functionality. The extracted // configuration values will be written to the AWS Config value. // // The resolver should return an error if it it fails to extract the data, the // data is malformed, or incomplete. type awsConfigResolver func(ctx context.Context, cfg *aws.Config, configs configs) error // configs is a slice of Config values. These values will be used by the // AWSConfigResolvers to extract external configuration values to populate the // AWS Config type. // // Use AppendFromLoaders to add additional external Config values that are // loaded from external sources. // // Use ResolveAWSConfig after external Config values have been added or loaded // to extract the loaded configuration values into the AWS Config. type configs []Config // AppendFromLoaders iterates over the slice of loaders passed in calling each // loader function in order. The external config value returned by the loader // will be added to the returned configs slice. // // If a loader returns an error this method will stop iterating and return // that error. func (cs configs) AppendFromLoaders(ctx context.Context, loaders []loader) (configs, error) { for _, fn := range loaders { cfg, err := fn(ctx, cs) if err != nil { return nil, err } cs = append(cs, cfg) } return cs, nil } // ResolveAWSConfig returns a AWS configuration populated with values by calling // the resolvers slice passed in. Each resolver is called in order. Any resolver // may overwrite the AWS Configuration value of a previous resolver. // // If an resolver returns an error this method will return that error, and stop // iterating over the resolvers. func (cs configs) ResolveAWSConfig(ctx context.Context, resolvers []awsConfigResolver) (aws.Config, error) { var cfg aws.Config for _, fn := range resolvers { if err := fn(ctx, &cfg, cs); err != nil { // TODO provide better error? return aws.Config{}, err } } var sources []interface{} for _, s := range cs { sources = append(sources, s) } cfg.ConfigSources = sources return cfg, nil } // ResolveConfig calls the provide function passing slice of configuration sources. // This implements the aws.ConfigResolver interface. func (cs configs) ResolveConfig(f func(configs []interface{}) error) error { var cfgs []interface{} for i := range cs { cfgs = append(cfgs, cs[i]) } return f(cfgs) } // LoadDefaultConfig reads the SDK's default external configurations, and // populates an AWS Config with the values from the external configurations. // // An optional variadic set of additional Config values can be provided as input // that will be prepended to the configs slice. Use this to add custom configuration. // The custom configurations must satisfy the respective providers for their data // or the custom data will be ignored by the resolvers and config loaders. // // cfg, err := config.LoadDefaultConfig( context.TODO(), // WithSharedConfigProfile("test-profile"), // ) // if err != nil { // panic(fmt.Sprintf("failed loading config, %v", err)) // } // // // The default configuration sources are: // * Environment Variables // * Shared Configuration and Shared Credentials files. func LoadDefaultConfig(ctx context.Context, optFns ...func(*LoadOptions) error) (cfg aws.Config, err error) { var options LoadOptions for _, optFn := range optFns { if err := optFn(&options); err != nil { return aws.Config{}, err } } // assign Load Options to configs var cfgCpy = configs{options} cfgCpy, err = cfgCpy.AppendFromLoaders(ctx, defaultLoaders) if err != nil { return aws.Config{}, err } cfg, err = cfgCpy.ResolveAWSConfig(ctx, defaultAWSConfigResolvers) if err != nil { return aws.Config{}, err } return cfg, nil } ```
Taylor Darnell Brown (born August 4, 1989) is an American professional basketball player who plays as power forward. Professional career On February 25, 2017, Brown moved to Lietuvos rytas Vilnius by signing a 1+1 deal with Rytas paying buyout to the Polish team. On May 24, 2017, it was reported that Brown along with other American-born teammates Corey Fisher and Clevin Hannah were partying and consuming alcohol in Vilnius nightclubs right after losing the Game 3 of the LKL Playoffs on May 20. All of them were denying the fact but the incontestable pictures were published, which shattered all the doubts. The semi-final game was crucial as following it the series moved to Panevėžys, where Rytas lost the game and the series 1–3, resulting in second shocking fiasco during the same season for the club. On the same May 24, all three players were suspended from the team. On May 25, head coach Rimas Kurtinaitis said that it was not the first time when all three players were behaving unprofessionally and that they were ignoring previous warnings. Some witnesses noted that Taylor Brown previously was also consuming drugs. Not surprisingly, the team has shown no interest in keeping Brown for his second season and the contract was terminated by noting that character and devotion are essential properties for the players. Brown joined Liga ACB side Real Betis Energía Plus on August 25, 2017. However, the deal was voided five days later after a failed physical. Personal life He is the son of a former EuroLeague champion and NBA player Rickey Brown. References External links Bradley Braves bio 1989 births Living people American expatriate basketball people in Belgium American expatriate basketball people in Lebanon American expatriate basketball people in Lithuania American expatriate basketball people in Mexico American expatriate basketball people in Poland American expatriate basketball people in Saudi Arabia American expatriate basketball people in Sweden American expatriate basketball people in Syria American expatriate basketball people in Turkey American men's basketball players Basketball players from Atlanta BC Rytas players Bradley Braves men's basketball players Brussels Basketball players Darüşşafaka Basketbol players Halcones de Ciudad Obregón players Power forwards (basketball)
```objective-c /* $OpenBSD: cdefs.h,v 1.4 2005/11/24 20:46:45 deraadt Exp $ */ /* public domain */ #include <m88k/cdefs.h> ```
Phymorhynchus major is a species of sea snail, a marine gastropod mollusk in the family Raphitomidae. Description The length of the shell attains 72 mm. Distribution This species was found on the East Pacific Rise at a depth of 2,500 m. References Warén A. & Bouchet P. (2001). Gastropoda and Monoplacophora from hydrothermal vents and seeps new taxa and records. The Veliger, 44(2): 116-231 External links major Gastropods described in 2001
Christopher John Reid, FRSL (born 13 May 1949) is a British poet, essayist, cartoonist, and writer. In January 2010 he won the 2009 Costa Book Award for A Scattering, written as a tribute to his late wife, the actress Lucinda Gane. Beside winning the poetry category, Reid became the first poet to take the overall Costa Book of the Year since Seamus Heaney in 1999. He had been nominated for Whitbread Awards in 1996 and in 1997 (Costa Awards under their previous name). Biography Reid was born in Hong Kong. A contemporary of Martin Amis, he was educated at Tonbridge School and Exeter College, Oxford. He is an exponent of Martian poetry, which employs unusual metaphors to render everyday experiences and objects unfamiliar. He has worked as poetry editor at Faber and Faber and Professor of Creative Writing at the University of Hull. Books Arcadia (1979) – 1980 Somerset Maugham Award, Hawthornden Prize Pea Soup (1982) Katerina Brac (1985) In The Echoey Tunnel (1991) Universes (1994) Expanded Universes (1996) Two Dogs on a Pub Roof (1996) Mermaids Explained (2001) For and After (2003) Mr Mouth (2005) A Scattering (2009) – Book of the Year, 2009 Costa Book Awards The Song of Lunch (2009) A Box of Tricks for Anna Zyx (2009) Selected Poems (2011) Nonsense (2012) Six Bad Poets (2013) Anniversary (2015) The Curiosities (2015) The Late Sun (2020) For children All Sorts: poems, illustrated by Sara Fanelli (London: Ondt & Gracehoper, 1999) Alphabicycle Order, ill. Fanelli (Ondt & Gracehoper, 2001) Old Toffer's Book of Consequential Dogs, illustrated by Elliott Elam — companion book to T.S. Eliot's Old Possum's Practical Cats — (Faber & Faber, 2018) As editor The Poetry Book Society Anthology 1989-1990 (1989) Sounds Good: 101 Poems to be Heard (1990) The May Anthology of Oxford and Cambridge Poetry 1997 (1997) Not to Speak of the Dog: 101 Short Stories in Verse (2000) Selected Letters of Ted Hughes (2007) The Letters of Seamus Heaney (2023) See also Craig Raine The Song of Lunch (TV adaptation of his poem) References External links Alphabicycle Order horn concerto at WorldCat – monologue with music (chorus with orchestra) by Colin Matthews 1949 births Living people Alumni of Exeter College, Oxford 21st-century British essayists British poets British cartoonists People educated at Tonbridge School Fellows of the Royal Society of Literature Costa Book Award winners British male essayists British male poets
Metailurus is a genus of saber-toothed cat in the family Felidae, and belonging to the tribe Metailurini, which occurred in North America, Eurasia and Africa from the Miocene to the Middle Pleistocene. History and taxonomy The genus Metailurus was described by Zdansky in 1924 for the two species Metailurus major and Metailurus minor. Metailurus mongoliensis was described in 1939. Metailurus boodon was described in 1948. Metailurus hengduanshanensis was described in 1996. Metailurus ultimus was described in 2014. Metailurus minor was reassigned to the felid genus Yoshi in 2015. Description The canines of Metailurus are longer than those of even the clouded leopard, but significantly shorter than true saber teeth, and more conical than bladed. A partial skeleton found in the Turolian site of Kerassia 1 consists of the jawbone, the anterior and posterior limb bone elements, and some sternal bones and some vertebrae. This is the most complete known of the species. Its dental material is comparative to those specimens from Pikermi, Chomateri, and China. The presence of elongated posterior limbs indicate that it had developed jumping skills. References External links Metailurini Miocene felids Pliocene carnivorans Pliocene extinctions Prehistoric carnivoran genera Cenozoic mammals of North America Cenozoic mammals of Africa Neogene mammals of Asia Cenozoic mammals of Europe Fossil taxa described in 1924
```objective-c /* * 86Box A hypervisor and IBM PC system emulator that specializes in * running old operating systems and software designed for IBM * PC systems and compatibles from 1981 through fairly recent * system designs based on the PCI bus. * * This file is part of the 86Box distribution. * * Define the various platform support functions. * * * * Authors: Miran Grca, <mgrca8@gmail.com> * Fred N. van Kempen, <decwiz@yahoo.com> * */ #ifndef EMU_PLAT_H #define EMU_PLAT_H #include <stdint.h> #include <stdio.h> #include "86box/device.h" #include "86box/machine.h" #ifndef GLOBAL # define GLOBAL extern #endif /* String ID numbers. */ enum { STRING_MOUSE_CAPTURE, /* "Click to capture mouse" */ STRING_MOUSE_RELEASE, /* "Press F8+F12/Ctrl+End to release mouse" */ STRING_MOUSE_RELEASE_MMB, /* "Press F8+F12/Ctrl+End or middle button to release mouse" */ STRING_INVALID_CONFIG, /* "Invalid configuration" */ STRING_NO_ST506_ESDI_CDROM, /* "MFM/RLL or ESDI CD-ROM drives never existed" */ STRING_NET_ERROR, /* "Failed to initialize network driver" */ STRING_NET_ERROR_DESC, /* "The network configuration will be switched..." */ STRING_PCAP_ERROR_NO_DEVICES, /* "No PCap devices found" */ STRING_PCAP_ERROR_INVALID_DEVICE, /* "Invalid PCap device" */ STRING_PCAP_ERROR_DESC, /* "Make sure libpcap is installed..." */ STRING_GHOSTSCRIPT_ERROR_TITLE, /* "Unable to initialize Ghostscript" */ STRING_GHOSTSCRIPT_ERROR_DESC, /* "gsdll32.dll/gsdll64.dll/libgs is required..." */ STRING_HW_NOT_AVAILABLE_TITLE, /* "Hardware not available" */ STRING_HW_NOT_AVAILABLE_MACHINE, /* "Machine \"%hs\" is not available..." */ STRING_HW_NOT_AVAILABLE_VIDEO, /* "Video card \"%hs\" is not available..." */ STRING_HW_NOT_AVAILABLE_VIDEO2, /* "Video card #2 \"%hs\" is not available..." */ STRING_MONITOR_SLEEP, /* "Monitor in sleep mode" */ STRING_GHOSTPCL_ERROR_TITLE, /* "Unable to initialize GhostPCL" */ STRING_GHOSTPCL_ERROR_DESC /* "gpcl6dll32.dll/gpcl6dll64.dll/libgpcl6 is required..." */ }; /* The Win32 API uses _wcsicmp. */ #ifdef _WIN32 # define wcscasecmp _wcsicmp # define strcasecmp _stricmp #else /* Declare these functions to avoid warnings. They will redirect to strcasecmp and strncasecmp respectively. */ extern int stricmp(const char *s1, const char *s2); extern int strnicmp(const char *s1, const char *s2, size_t n); #endif #if (defined(__HAIKU__) || defined(__unix__) || defined(__APPLE__)) && !defined(__linux__) /* FreeBSD has largefile by default. */ # define fopen64 fopen # define fseeko64 fseeko # define ftello64 ftello # define off64_t off_t #elif defined(_MSC_VER) // # define fopen64 fopen # define fseeko64 _fseeki64 # define ftello64 _ftelli64 # define off64_t off_t #endif #ifdef _MSC_VER # define UNUSED(arg) arg #else /* A hack (GCC-specific?) to allow us to ignore unused parameters. */ # define UNUSED(arg) __attribute__((unused)) arg #endif /* Return the size (in wchar's) of a wchar_t array. */ #define sizeof_w(x) (sizeof((x)) / sizeof(wchar_t)) #ifdef __cplusplus # include <atomic> # define atomic_flag_t std::atomic_flag # define atomic_bool_t std::atomic_bool extern "C" { #else # include <stdatomic.h> # define atomic_flag_t atomic_flag # define atomic_bool_t atomic_bool #endif #if defined(_MSC_VER) # define ssize_t intptr_t #endif #ifdef _MSC_VER # define fallthrough do {} while (0) /* fallthrough */ #else # if __has_attribute(fallthrough) # define fallthrough __attribute__((fallthrough)) # else # if __has_attribute(__fallthrough__) # define fallthrough __attribute__((__fallthrough__)) # endif # define fallthrough do {} while (0) /* fallthrough */ # endif #endif /* Global variables residing in the platform module. */ extern int dopause; /* system is paused */ extern int mouse_capture; /* mouse is captured in app */ extern volatile int is_quit; /* system exit requested */ #ifdef MTR_ENABLED extern int tracing_on; #endif extern uint64_t timer_freq; extern int infocus; extern char emu_version[200]; /* version ID string */ extern int rctrl_is_lalt; extern int update_icons; extern int kbd_req_capture; extern int hide_status_bar; extern int hide_tool_bar; /* System-related functions. */ extern FILE *plat_fopen(const char *path, const char *mode); extern FILE *plat_fopen64(const char *path, const char *mode); extern void plat_remove(char *path); extern int plat_getcwd(char *bufp, int max); extern int plat_chdir(char *path); extern void plat_tempfile(char *bufp, char *prefix, char *suffix); extern void plat_get_exe_name(char *s, int size); extern void plat_get_global_config_dir(char *outbuf, uint8_t len); extern void plat_get_global_data_dir(char *outbuf, uint8_t len); extern void plat_get_temp_dir(char *outbuf, uint8_t len); extern void plat_init_rom_paths(void); extern int plat_dir_check(char *path); extern int plat_dir_create(char *path); extern void *plat_mmap(size_t size, uint8_t executable); extern void plat_munmap(void *ptr, size_t size); extern uint64_t plat_timer_read(void); extern uint32_t plat_get_ticks(void); extern void plat_delay_ms(uint32_t count); extern void plat_pause(int p); extern void plat_mouse_capture(int on); extern int plat_vidapi(const char *name); extern char *plat_vidapi_name(int api); extern void plat_resize(int x, int y, int monitor_index); extern void plat_resize_request(int x, int y, int monitor_index); extern uint32_t plat_language_code(char *langcode); extern void plat_language_code_r(uint32_t lcid, char *outbuf, int len); extern void plat_get_cpu_string(char *outbuf, uint8_t len); extern void plat_set_thread_name(void *thread, const char *name); /* Resource management. */ extern wchar_t *plat_get_string(int id); /* Emulator start/stop support functions. */ extern void do_start(void); extern void do_stop(void); /* Power off. */ extern void plat_power_off(void); /* Platform-specific device support. */ extern void cassette_mount(char *fn, uint8_t wp); extern void cassette_eject(void); extern void cartridge_mount(uint8_t id, char *fn, uint8_t wp); extern void cartridge_eject(uint8_t id); extern void floppy_mount(uint8_t id, char *fn, uint8_t wp); extern void floppy_eject(uint8_t id); extern void cdrom_mount(uint8_t id, char *fn); extern void plat_cdrom_ui_update(uint8_t id, uint8_t reload); extern void zip_eject(uint8_t id); extern void zip_mount(uint8_t id, char *fn, uint8_t wp); extern void zip_reload(uint8_t id); extern void mo_eject(uint8_t id); extern void mo_mount(uint8_t id, char *fn, uint8_t wp); extern void mo_reload(uint8_t id); extern int ioctl_open(uint8_t id, char d); extern void ioctl_reset(uint8_t id); extern void ioctl_close(uint8_t id); /* Other stuff. */ extern void startblit(void); extern void endblit(void); /* Conversion between UTF-8 and UTF-16. */ extern size_t mbstoc16s(uint16_t dst[], const char src[], int len); extern size_t c16stombs(char dst[], const uint16_t src[], int len); #ifdef __cplusplus } #endif #endif /*EMU_PLAT_H*/ ```
```javascript export { default } from './Card.react'; ```
```ruby module ExtJS module SassExtensions module Functions module Utils @maps = Array.new() class << self; attr_accessor :maps; end def parsebox(list, n) assert_type n, :Number if !n.int? raise ArgumentError.new("List index #{n} must be an integer") elsif n.to_i < 1 raise ArgumentError.new("List index #{n} must be greater than or equal to 1") elsif n.to_i > 4 raise ArgumentError.new("A box string can't contain more then 4") end new_list = list.clone.to_a size = new_list.size if n.to_i >= size if size == 1 new_list[1] = new_list[0] new_list[2] = new_list[0] new_list[3] = new_list[0] elsif size == 2 new_list[2] = new_list[0] new_list[3] = new_list[1] elsif size == 3 new_list[3] = new_list[1] end end new_list.to_a[n.to_i - 1] end def parseint(value) Sass::Script::Number.new(value.to_i) end def ERROR(message) raise ArgumentError.new(message) end def map_create() map = Hash.new() id = Utils.maps.length; Utils.maps.insert(id, map); Sass::Script::Number.new(id+1) end def map_get(mapId, key) id = mapId.to_i()-1 map = Utils.maps[id] k = key.to_s() v = map[k] if !v v = Sass::Script::String.new("") end v end def map_put(mapId, key, value) id = mapId.to_i()-1 map = Utils.maps[id] k = key.to_s() map[k] = value end # Joins 2 file paths using the path separator def file_join(path1, path2) path1 = path1.value path2 = path2.value path = path1.empty? ? path2 : File.join(path1, path2) Sass::Script::String.new(path) end def theme_image_exists(directory, path) result = false where_to_look = File.join(directory.value, path.value) if where_to_look && FileTest.exists?("#{where_to_look}") result = true end return Sass::Script::Bool.new(result) end # workaround for lack of @error directive in sass 3.1 def error(message) raise Sass::SyntaxError, message.value end # This function is primarily to support compatibility when moving from sass 3.1 to 3.2 # because of the change in behavior of the null keyword when used with !default. # in 3.1 variables defaulted to null are considered to have an assigned value # and thus cannot be reassigned. In 3.2 defaulting to null is the same as leaving # the variable undeclared def is_null(value) n = false begin # in Sass 3.2 null values are an instance of Sass::Script::Null # this throws an exception in Sass 3.1 because the Null class doesn't exist n = (value.is_a? Sass::Script::Null) || (value.is_a? Sass::Script::String) && value.value == 'null' || value.value == 'none' rescue NameError=>e # Sass 3.1 processes null values as a string == "null" n = (value.is_a? Sass::Script::String) && value.value == 'null' || value.value == 'none' end return Sass::Script::Bool.new(n) end end end end end module Sass::Script::Functions include ExtJS::SassExtensions::Functions::Utils end ```
Chicken Vulture Crow is the first album by Swamp Zombies. It was released on record in 1988. Track listing "Truly Needy" "Love Zombie" "Swamp Boy" "Open Up Your Eyes" "Pots and Pans" "Coffeehouse Ray" "Purple Haze" (originally by The Jimi Hendrix Experience) "Zombie Jamboree" (originally by The Kingston Trio) "Chucha" "A Simple Desultory" (originally by Simon and Garfunkel) "Phobia" "Rudy the Magic Crow" References Swamp Zombies albums 1988 debut albums
Medicals RFC is a rugby union club in Newcastle Upon Tyne who have been in existence since 1898. They currently play in the Durham/Northumberland 1 league having been promoted from Durham/Northumberland 2 in the 2009-10 season. Medicals RFC are most famous for the 1995-6 side that reached the final of the RFU Pilkington Shield at Twickenham and won the trophy – beating Helston RFC, Cornwall 16 v 6. The uniform of the Club is maroon jerseys with white collars, white shorts and maroon stockings with white tops. Medicals RFC History The club was formed in 1898 as the Durham University College of Medicine R.F.C. Medicals RFC was then elected a senior member of the Northumberland Rugby Union in 1920. A Junior Club between 1934 and 1937 when they were again elected a Senior Member of the N.R.U. They were Northumberland Senior Cup Winners in 1922, 1923, 1952 and 1953. Club Honours Pilkington Shield winners: 1996 Northumberland Senior Cup winners (4): 1922, 1923, 1952, 1953 Northumberland Senior Plate winners (2): 2012, 2022 Durham/Northumberland 1 champions: 1998–99 Durham/Northumberland 3 champions: 2006–07 Notable players The Club has produced five Internationals: Dr EE. Chapman, 1910-14. (The first man to score a try and kick a goal at Twickenham) Dr R. Armstrong, 1924. Dr Stephen Peel, a wartime cap. W.G.D. Morgan, 1960-61. O.W.N. Caplan 1978. Trialists also include Dr G.C.Taylor, Mr G. Scott-Page and Dr Maurice Jones. RFU Presidents Medicals RFC also has the honour and distinction of having two members elected to the position of President of the RFU Mr D.D.Serfontein, 1992-1993. Mr W.G.D. Morgan 2002-2003 Pilkington Shield (1996) The finest hour of the club's achievement was on 4 May 1996 Twickenham, winners of the National Junior Club Knock-out Competition, The Pilkington Shield. Medicals RFC beat Helston RFC (Cornwall) by 16 points to 6. Current Information Currently, Medicals RFC play in Durham/Northumberland 1. Recently Medicals RFC have been successful within the Durham & Northumberland league competitions: Rugby union teams in England University and college rugby union clubs in England Rugby clubs established in 1898 1898 establishments in England
```c /* * */ #include "nvs.h" #include "lwip/dhcp.h" #include "lwip/netif.h" #include "netif/dhcp_state.h" #define DHCP_NAMESPACE "dhcp_state" #define IF_KEY_SIZE 3 /* * As a NVS key, use string representation of the interface index number */ static inline char *gen_if_key(struct netif *netif, char *name) { lwip_itoa(name, IF_KEY_SIZE, netif->num); return name; } bool dhcp_ip_addr_restore(struct netif *netif) { nvs_handle_t nvs; char if_key[IF_KEY_SIZE]; bool err = false; if (netif == NULL) { return false; } struct dhcp *dhcp = netif_dhcp_data(netif); uint32_t *ip_addr = &dhcp->offered_ip_addr.addr; if (nvs_open(DHCP_NAMESPACE, NVS_READONLY, &nvs) == ESP_OK) { if (nvs_get_u32(nvs, gen_if_key(netif, if_key), ip_addr) == ESP_OK) { err = true; } nvs_close(nvs); } return err; } void dhcp_ip_addr_store(struct netif *netif) { nvs_handle_t nvs; char if_key[IF_KEY_SIZE]; if (netif == NULL) { return; } struct dhcp *dhcp = netif_dhcp_data(netif); uint32_t ip_addr = dhcp->offered_ip_addr.addr; if (nvs_open(DHCP_NAMESPACE, NVS_READWRITE, &nvs) == ESP_OK) { nvs_set_u32(nvs, gen_if_key(netif, if_key), ip_addr); nvs_commit(nvs); nvs_close(nvs); } } void dhcp_ip_addr_erase(struct netif *netif) { nvs_handle_t nvs; char if_key[IF_KEY_SIZE]; if (netif == NULL) { return; } if (nvs_open(DHCP_NAMESPACE, NVS_READWRITE, &nvs) == ESP_OK) { nvs_erase_key(nvs, gen_if_key(netif, if_key)); nvs_commit(nvs); nvs_close(nvs); } } ```
Lost Battalion may refer to: Lost Battalion (World War I), American units which were isolated by Germans in 1918 Lost Battalion (Europe, World War II), an American battalion which was surrounded by Germans in 1944 Lost Battalion (Pacific, World War II), an American battalion and survivors from a ship's crew taken prisoner early in the Pacific War Lost Battalion (China), the Chinese Lost Battalion during the Defense of Sihang Warehouse in 1937 The Lost Battalion (1919 film), a 1919 film about the World War I event Lost Battalion (1960 film) a 1960 Filipino World War II film The Lost Battalion (2001 film), a remake of the 1919 film
The VH1 Trailblazer Honors, also known as the Logo Trailblazer Honors, is the only televised LGBT awards ceremony in the United States. It is an annual awards event founded in 2014 to recognize persons and entities who have made significant contributions towards minority empowerment and civil activism. It has been described as a combined "queer State of the Union, Hall of Fame, and Oscars." The event is aired on Logo TV and VH1. About The VH1 Trailblazer Honors, also known as Logo Trailblazer Honors, is an annually televised awards event, founded in 2014, that recognizes persons and entities who have made significant contributions towards minority empowerment and civil activism. The event is the only LGBT awards ceremony televised in the United States. It has been described as a combined "queer State of the Union, Hall of Fame, and Oscars." In 2018, the event was aired on Logo TV and VH1. In the 2014 inaugural event, Bill Clinton recognized Edith Windsor and Roberta A. Kaplan for their role in the Defense of Marriage Act. Jason Collins was presented the honor by Lance Bass. Demi Lovato honored cast members of Orange Is the New Black, including Danielle Brooks, Laverne Cox, Lea DeLaria, Taryn Manning, and Samira Wiley. Singer Michael Stipe honored John Abdallah Wambere. Young community leaders were introduced by Daniel Radcliffe. The event included musical performances by Sia, New York City Gay Men's Chorus, A Great Big World, and the band Exousia. The event was attended by celebrities including Joe Manganiello, Ed Sheeran, Jared Leto, Macklemore & Ryan Lewis, Kylie Minogue, Pete Wentz, Ariana Grande, Iggy Azaela, Tegan and Sara, and Laura Jane Grace. In 2015, Miley Cyrus gave the opening address through a recorded message voicing support for marriage equality and the queer community. Barack Obama gave an address through a video message on the progress of LGBT people. Raven-Symoné and Martin Luther King III were speakers at the event. Musical performances included Adam Lambert and the Bleachers. Other speakers were Laura Jane Grace, Samira Wiley, Tituss Burgess, Tyler Posey, Kelly Osbourne, Betty DeGeneres, Violet Chachki, and Frankie Grande. Jane Fonda, Lily Tomlin, Judith Light, and Ian McKellen were also on stage. This was the first year that the honor "Social Trailblazer" was added. Logo fans voted between four nominees that used social media to advocate for the LGBT community. Nominees included Connor Franta, Joey Graceffa, Jackson Bird, and Gabe Dunn with Franta eventually being named the winner. On behalf of his deceased partner, Bayard Rustin, Walter Naegle accepted the honor. Judy and Dennis Shepard were recognized as "Trailblazing Parents" for co-founding the Matthew Shepard Foundation. At the 2017 event, musicians, Hayley Kiyoko, Alex Newell, and Wrabel honored Cyndi Lauper with a performance of "True Colors." The awards given in 2016 took time to remember the 49 victims of the Orlando nightclub shooting. In 2018, the fifth annual Trailblazer Honors event took place at Cathedral of St. John the Divine, which is one of the first religious institutions in New York City supporting LGBTQ causes. The event was attended by activists and celebrities including Janet Mock, Bebe Rexha, the cast of Pose, and finalist from RuPaul's Drag Race. Honorees References External links 2014 establishments in the United States Awards established in 2014 LGBT-related awards VH1
Arnaccio is a village in Tuscany, central Italy, administratively a frazione of the comune of Cascina, province of Pisa. At the time of the 2011 census its population was 113. Arnaccio is about 12 km from Pisa and 10 km from Cascina. References Frazioni of the Province of Pisa
Friedman Place is a 501(c)(3) nonprofit organization for blind adults located at 5527 North Maplewood Avenue in Chicago, Illinois. A Supportive Living Facility with 81 resident apartments, Friedman Place provides specialized housing to qualifying individuals regardless of race, religion, or financial resources. The organization's mission is to provide housing and supportive services to people who are blind or visually impaired so that their lives can be healthy, dignified, and stimulating. Friedman Place offers a large variety of activities, from sailing and opera outings to an in-house weaving program Friedman Place relies on funding from state and federal sources, as well as personal donations. The organization produces The Beacon, a quarterly newsletter, as well as an annual report. References External links Official website Albany Park, Chicago Blindness organizations in the United States Non-profit organizations based in Chicago
```xml import * as React from 'react'; import { ColorPalette, MarkdownHeader } from '@fluentui/react-docsite-components/lib/index2'; export class WXPNeutrals extends React.Component { public render() { return ( <> <MarkdownHeader as="h3">Colorful Theme</MarkdownHeader> <ColorPalette colors={[ { name: 'Gray180', hex: '#252423', code: { core: '$ms-color-gray180', react: 'NeutralColors.gray180', }, }, { name: 'Gray140', hex: '#484644', code: { core: '$ms-color-gray140', react: 'NeutralColors.gray140', }, }, { name: 'Gray130', hex: '#605e5c', code: { core: '$ms-color-gray130', react: 'NeutralColors.gray130', }, }, { name: 'Gray80', hex: '#b3b0ad', code: { core: '$ms-color-gray80', react: 'NeutralColors.gray80', }, }, { name: 'Gray60', hex: '#c8c6c4', code: { core: '$ms-color-gray60', react: 'NeutralColors.gray60', }, }, { name: 'Gray50', hex: '#d2d0ce', code: { core: '$ms-color-gray50', react: 'NeutralColors.gray50', }, }, { name: 'Gray40', hex: '#e1dfdd', code: { core: '$ms-color-gray40', react: 'NeutralColors.gray40', }, }, { name: 'Gray30', hex: '#edebe9', code: { core: '$ms-color-gray30', react: 'NeutralColors.gray30', }, }, { name: 'Gray20', hex: '#f3f2f1', code: { core: '$ms-color-gray20', react: 'NeutralColors.gray20', }, }, { name: 'White', hex: '#ffffff', code: { core: '$ms-color-white', react: 'NeutralColors.white', }, }, ]} /> <MarkdownHeader as="h3">Dark Gray Theme</MarkdownHeader> <ColorPalette colors={[ { name: 'Gray190', hex: '#201f1e', code: { core: '$ms-color-gray190', react: 'NeutralColors.gray190', }, }, { name: 'Gray180', hex: '#252423', code: { core: '$ms-color-gray180', react: 'NeutralColors.gray180', }, }, { name: 'Gray160', hex: '#323130', code: { core: '$ms-color-gray160', react: 'NeutralColors.gray160', }, }, { name: 'Gray140', hex: '#484644', code: { core: '$ms-color-gray140', react: 'NeutralColors.gray140', }, }, { name: 'Gray130', hex: '#605e5c', code: { core: '$ms-color-gray130', react: 'NeutralColors.gray130', }, }, { name: 'Gray120', hex: '#797775', code: { core: '$ms-color-gray120', react: 'NeutralColors.gray120', }, }, { name: 'Gray100', hex: '#979593', code: { core: '$ms-color-gray100', react: 'NeutralColors.gray100', }, }, { name: 'Gray90', hex: '#a19f9d', code: { core: '$ms-color-gray90', react: 'NeutralColors.gray90', }, }, { name: 'Gray70', hex: '#bebbb8', code: { core: '$ms-color-gray70', react: 'NeutralColors.gray70', }, }, { name: 'Gray60', hex: '#c8c6c4', code: { core: '$ms-color-gray60', react: 'NeutralColors.gray60', }, }, { name: 'Gray50', hex: '#d2d0ce', code: { core: '$ms-color-gray50', react: 'NeutralColors.gray50', }, }, { name: 'Gray30', hex: '#edebe9', code: { core: '$ms-color-gray30', react: 'NeutralColors.gray30', }, }, { name: 'Gray10', hex: '#faf9f8', code: { core: '$ms-color-gray10', react: 'NeutralColors.gray10', }, }, ]} /> <MarkdownHeader as="h3">Black Theme</MarkdownHeader> <ColorPalette colors={[ { name: 'Black', hex: '#000000', code: { core: '$ms-color-black', react: 'NeutralColors.black', }, }, { name: 'Gray190', hex: '#201f1e', code: { core: '$ms-color-gray190', react: 'NeutralColors.gray190', }, }, { name: 'Gray180', hex: '#252423', code: { core: '$ms-color-gray180', react: 'NeutralColors.gray180', }, }, { name: 'Gray170', hex: '#292827', code: { core: '$ms-color-gray170', react: 'NeutralColors.gray170', }, }, { name: 'Gray160', hex: '#323130', code: { core: '$ms-color-gray160', react: 'NeutralColors.gray160', }, }, { name: 'Gray150', hex: '#3b3a39', code: { core: '$ms-color-gray150', react: 'NeutralColors.gray150', }, }, { name: 'Gray140', hex: '#484644', code: { core: '$ms-color-gray140', react: 'NeutralColors.gray140', }, }, { name: 'Gray130', hex: '#605e5c', code: { core: '$ms-color-gray130', react: 'NeutralColors.gray130', }, }, { name: 'Gray100', hex: '#979593', code: { core: '$ms-color-gray100', react: 'NeutralColors.gray100', }, }, { name: 'Gray90', hex: '#a19f9d', code: { core: '$ms-color-gray90', react: 'NeutralColors.gray90', }, }, { name: 'Gray70', hex: '#bebbb8', code: { core: '$ms-color-gray70', react: 'NeutralColors.gray70', }, }, { name: 'Gray40', hex: '#e1dfdd', code: { core: '$ms-color-gray40', react: 'NeutralColors.gray40', }, }, { name: 'White', hex: '#ffffff', code: { core: '$ms-color-white', react: 'NeutralColors.white', }, }, ]} /> </> ); } } ```
Per Ivarson Undi (1803 – 28 July 1860), also known as Peter Iverson, was an early Norwegian-American homesteader in Wisconsin Territory. Biography Peder Ivarson was born on the Undi farm in Vik, Sogn og Fjordane, Norway. He was one of eight children born to Iver Pedersen (1762-1837) of the Gullbrå farm in Vik and Inger Akseldtr (1775-1838) of the Skjervheim farm in Myrkdalen, a small valley in the municipality of Voss. Peder Ivarson was married to Anna Davidsdatter from the Skjervheimm farm in Myrkdalen. Peder Ivarson, together with his wife and their children, became the first emigrants to the United States from the Sogn og Fjordane county in Norway. His brother-in-law, brother Peder Davidsen Skjervheim, had emigrated from Hardanger in 1837. Per Undi had also been influenced by Ole Rynning's True Account of America (Norwegian: Sandfærdig Beretning om Amerika) which was published during 1838. The family left the community of Vik in 1839. They came on the schooner Magdalena Christina, which arrived in New York harbor July 6, 1839. The family settled in Wayne Township near the community of Wiota, known in its early history as Hamilton's Diggings in Lafayette County, Wisconsin. Peter Ivarson was granted titled to land under the provisions of the Homestead Act on April 1, 1848. Peter Ivarson has been recognized as a leading force of change by both Norwegian and American historians. The significance of his immigration to America would be especially felt within the Norwegian communities of Vik and Voss. He frequently wrote letters back to friends and family in his home parish. Resulting from his efforts of persuasion, numerous families immigrated to Wisconsin including his siblings: Ragnilda, Erik, Ole and Axel Iverson. References Other sources Flom, George T. (1989) A History of Norwegian Immigration to the United States. (Iowa City, Iowa.: Priv. Print) Holand, Hjalmar Rued (2006) History of the Norwegian Settlements (Decorah, Iowa: Astri My Astri Publishing) Lovoll, Odd Sverre (2015) Across the Deep Blue Sea: The Saga of Early Norwegian Immigrants (Minnesota Historical Society) Naeseth, Gerhard B. (1997) Norwegian Immigrants to the United States, A Biographical Directory, 1825-1850. 2 vols. (Madison, WI: Vesterheim Norwegian-American Museum) Ulvestad, Martin (1907) Nordmændene i Amerika, deres Historie og Rekord (The Norwegians in America, their History and Record). 2 vols. (translated by C. A. Clausen. Minneapolis, Minn: History Book Company's Forlag) External links The Official Federal Land Records Website Vossingen, No. 2-3 Madison, Wis., July-October, 1924 (K. A. Rene, editor. Translated by Stanley J. Nuland) 1803 births 1860 deaths People from Vik Norwegian emigrants to the United States People from Wiota, Wisconsin
```css /*! jQuery UI - v1.11.2 - 2014-10-28 * path_to_url * Includes: core.css, draggable.css, resizable.css, selectable.css, sortable.css, slider.css ```
West Third Street Historic District is located on the west side of downtown Davenport, Iowa, United States. It was listed on the National Register of Historic Places in 1983. The historic district connects the central business district with the working-class neighborhoods of the West End. Its historical significance is its connection to Davenport's German-American community. Germans were the largest ethnic group to settle in Davenport. History German immigrants started moving into the city in noticeable numbers starting in the late 1840s. In 1848 250 Germans came to Davenport and by 1850 that number rose to close to 3,000, or 20% of the city's population. German immigration remained strong through the 1880s. The Iowa census of 1890 showed that a quarter of Scott County residents were natives of Germany. A disproportionate number of those immigrants came from Schleswig-Holstein, which was in a border and personal rights dispute with Denmark in the 1840s. Other German immigrants to Davenport came from Bavaria, Hamburg, Hanover, and Mecklenburg. Washington Square was a city block that was laid out by city founder Antoine LeClaire as part of the original town. By the 1850s it became the focus for the cultural life of many German immigrants who came to Davenport. The Germania Gasthaus, which housed many immigrants when they first came to the city, was just off the square on West Second Street. The Deutsch Theatre and the Central Turnverein, which no longer exist, faced the square on Third Street. The square itself, which sported a fountain topped with the statue of Lady of Germania, was the site of German beer gardens, outdoor music events, veterans’ celebrations and other community gatherings. Today the square is the downtown location of the YMCA, which was built in the 1960s. In 2006 a new gateway park at the foot of the Centennial Bridge was installed and it contains a statue of the Lady of Germania that was modeled on the one that once graced the square. The Lady of Germania is an ancient symbol that personified strength, unity and liberty. She was also a reminder to many people of their native Germany. German “free thinkers” were part of the German immigration that came to Davenport. Their political and philosophical thinking tended to be anti-clerical and secular. This included their opposition to the establishment of parochial schools. Instead, they started the Freie Deutsche Schule near Washington Square in September 1852. The school remained in operation for 35 years and instructed children of the German families in their political stance of a separate German culture that emphasized secular concerns. Not all German immigrants were of this political bent and parochial schools were started at Trinity Lutheran Church and St. Kunigunda Catholic Church (later renamed St. Joseph). Washington Square, and what is now the West Third Street Historic District, was lined with buildings that had small shops with residential space above. In some cases, the residential space housed the proprietor of the shop below. In other cases, the residential space was rented out by the shopkeeper for additional income. By and large, the buildings along West Third Street were built between the 1850s and 1900. It was a working-class neighborhood. Besides the shopkeepers, it was also home to residents who worked in the factories and mills along the Mississippi River. The German character of the area diminished as a result of anti-German sentiments that resulted from World War I. As the 20th century continued larger and more modern buildings were built closer to the central business district, and the areas further to the west started to decline. Architecture The buildings in the West Third Street Historic District are made up of small commercial buildings, single-family dwellings, double houses, row houses, tenements, and apartment buildings. The combination of land use and different building types gives the district a unique character that is not found elsewhere in Davenport. The buildings, overall, are simple structures. Generally, they are one and two-story side-gabled structures that can be expanded saltbox fashion in the back, or they could be extended on one or both ends. For the most part, the houses are located on the west side of the district and the commercial buildings to the east. The buildings were largely built between the 1850s and the 1920s. The older buildings in the district are side-gable structures designed in a vernacular Greek Revival style. These buildings serve a variety of functions including single-family houses, commercial buildings with apartments above, duplexes, and rowhouses. Several of the commercial buildings are also built in a vernacular Italianate style. Toward the end of the 19th-century, larger buildings were built in and near the central business district. These buildings generally had more ornate storefronts and apartments above. Large brick apartment blocks were also built at this time. The commercial buildings were three to three and a half stories tall with cast iron storefronts and window bays on the upper floors. The side walls in between the buildings were opened up with recessed polygonal “wells” for the windows. The large apartment buildings are similar to those in other parts of the city. Many were built above high basements, had window bays and some had decorative doorways and cornices. Some of the buildings had a central entrance that led to a center stair hall. Others featured two entrances which led to flats on one side of a shared wall. The later arrangement featured mirror-image facades similar to the double houses. Contributing Properties Hiller Building Linden Flats Charles F. Ranzow and Sons Building Siemer House References External links Historic districts in Davenport, Iowa Working-class culture in Iowa Residential buildings on the National Register of Historic Places in Iowa Commercial buildings on the National Register of Historic Places in Iowa National Register of Historic Places in Davenport, Iowa German-American history German-American culture in Iowa Historic districts on the National Register of Historic Places in Iowa Chicago school architecture in Iowa
James Herman Faulkner, Sr. (March 1, 1916 – August 22, 2008) was an American newspaper publisher, entrepreneur, politician, and philanthropist. He has two schools named after him, Faulkner State Community College, and Faulkner University. Newspapers and other media He was born on March 1, 1916, in Lamar County, Alabama. On August 15, 1936, Faulkner bought the Baldwin Times Newspaper in Bay Minette. In 1957 Faulkner joined a group that brought WBCA radio to Bay Minette as well as owning WHEP in Foley. Support of education Faulkner was instrumental in getting Faulkner State Junior College built for his town after the Alabama legislature passed a bill in 1964 to build 10 such schools. The pick for Bay Minette's district originally went to Monroeville which received the approval to build the Monroeville campus of the Alabama Southern Community College (originally Patrick Henry Junior College). Subsequently, Faulkner organized a group to convince the state to build a second junior college in the district at Bay Minette and afterwards a school named for William Lowndes Yancey, an American leader of the Southern secession movement, came into existence. In 1971 town residents convinced the governor to rename Yancey in Faulkner's honor. Faulkner University in Montgomery, Alabama (originally known as Alabama Christian College) was renamed in 1983 to honor Faulkner. It was said that the school would have been forced to close several times if Faulkner had not come to the rescue. Industrial recruiter Faulkner was involved with bringing several industries to Bay Minette and Baldwin County. These included International Paper Container Division, Kaiser Aluminum, Alpine Industries Laboratories, Baldwin Utility Structures, Baldwin Lighting, Eastwood-Neally Company, Colt Industries, Jinan, Holland Industrial Services, Gulf Packaging Company, Cedartown Paper Board Cores, Baldwin Asphalt, Yellow Hammer Building Systems, Barclay, Bay Minette Mills, Baldwin Pole and Piling, Den-Tal-Ez, and Standard Furniture. Political activities Faulkner served as mayor of Bay Minette from 1941 to 1943, and was said to be the youngest mayor in America at that time. He was also a member of the Alabama State Senate and a two-time candidate for governor. He died on August 22, 2008, in Bay Minette, Alabama, at the age of 92. References External links "Mumblings" Column People from Lamar County, Alabama People from Bay Minette, Alabama Mayors of places in Alabama Alabama state senators American columnists 1916 births 2008 deaths Journalists from Alabama 20th-century American politicians 20th-century American journalists American male journalists
```c /* * */ #include <string.h> #include "esp_chip_info.h" #include "hal/efuse_ll.h" #include "hal/efuse_hal.h" void esp_chip_info(esp_chip_info_t *out_info) { uint32_t pkg_ver = efuse_ll_get_chip_ver_pkg(); memset(out_info, 0, sizeof(*out_info)); out_info->model = CHIP_ESP32S2; out_info->revision = efuse_hal_chip_revision(); out_info->cores = 1; out_info->features = CHIP_FEATURE_WIFI_BGN; switch (pkg_ver) { case 0: // ESP32-S2 break; case 1: // ESP32-S2FH16 // fallthrough case 2: // ESP32-S2FH32 out_info->features |= CHIP_FEATURE_EMB_FLASH; break; default: // New package, features unknown break; } } ```
```javascript /** * @providesModule ES6_Default_NamedFunction1 * @flow */ declare export default function foo():number; ```
```python from scc.actions import Action import os class TestDocs(object): """ Tests every glade file in glade/ directory (and subdirectories) for known problems that may cause GUI to crash in some environments. (one case on one environment so far) """ def test_every_action_has_docs(self): """ Tests if every known Action is documentated in docs/actions.md """ # Read docs first actions_md = file("docs/actions.md", "r").read() profile_md = file("docs/profile-file.md", "r").read() # Do stupid fulltext search, because currently it's simply fast enough for command in Action.ALL: if command in (None, 'None', 'exit'): # Woo for special cases continue anchor = '<a name="%s">' % (command,) assert anchor in actions_md, "Action '%s' is not documented in actions.md" % (command,) for key in Action.PKEYS: anchor = '#### `%s`' % (key,) assert key in profile_md, "Key '%s' is not documented in profile-file.md" % (key,) ```
Döda fallet (English: dead fall) is a former whitewater rapid in of the river Indalsälven in Ragunda Municipality in the eastern part of the province of Jämtland in Sweden. Glacial debris had blocked the course of the Indalsälven at Döda fallet for thousands of years, creating a reservoir of glacial meltwater 25 km (16 mi) long known as Ragundasjön (English: Ragunda lake), which overflowed over a natural spillway that bypassed this dam of debris, in a long high steep rapid known as Gedungsen or Storforsen (English: great whitewater rapid). It was one of the most impressive rapids in Sweden with a total fall height of about 35 meters (115 feet) and a large water discharge. The lake disappeared and the falls went dry in the 1796 Ragunda lake burst disaster after a flood rerouted the river through a small canal constructed to bypass the falls, carving a new channel and emptying the lake in four hours. Original situation The Indalsälven flows through a valley between mountains in Jämtland province of Sweden. In one place its course before the Ice Age went southwest of a high rock spur with Qvarnodden hill on its end sticking out of the valley's northeast side. In the Ice Age its course past that spur was filled with glacial and periglacial deposit with an esker on top, so high that, after the ice retreated, the river backed up into a lake, later named Ragundasjön, 25 km (16 mi) long, which overflowed further northeast, over the neck of the spur, and flowing down from the spur caused the Storforsen rapids with a total 30 meters (94.5 feet) drop full of projecting rocks and big eddy potholes, destroying or damaging floating logs; over the millennia it eroded a gully in the rock. The waterfall was usually called Gedungsen, but sometimes Storforsen or Ragundaforsen, or popularly Gedunsen, or in older documents Getamsen. Plans start In the late 18th century, logging emerged as a major industry in the heavily forested region of Jämtland because much forest near the coast had been felled. The rivers were used as fast and relatively easy transportation of the timber to the coastal sawmills. The whitewater rapid Storforsen however was a major obstacle as it damaged or destroyed much of the timber, forcing use of land transportation (portaging) past the waterfall. Another issue was that salmon could not swim upstream through Storforsen, and this made the fishing downstream good, but poor upstream. In 1748, the city of Sundsvall applied for funding to build a canal to bypass Gedungsen, but by 1752 this had received no response from the Riksdag. In 1761, the Riksdag called for a survey for communications through the area, including a canal to bypass Gedungsen. completed a comprehensive survey in 1766. With experience from Finland, he rejected blasting Gedungsen into a smooth chute for logs, and suggested a bypass chute, or a bypass channel with a dam with sluice gates. King Gustav III gave his permission for a bypass canal company on 11 July 1779. The first attempt to build a canal began in 1780 ended in failure after two years. In 1793, peasants in Ragunda and Stugun decided to resume work and formed a society called the Storforsen Company (). , also known as the Wild Huss (), formerly a merchant, who was born in the parish below Storforsen, contacted them and was appointed to solve the problem by constructing a bypass canal. Preliminary work such as clearing forest was carried out in 1794 and 1795. Work on the canal channel started; there was sabotage by damaging wooden chutes by locals who feared damage to farmland and salmon fishing, or did not want to lose work portaging the logs past the obstruction. The canal was dug through unconsolidated glacial-outwash sand and gravel and the esker, and sand kept running back into the channel, and there was concern about the effect on the fishing, and thus the provincial governor () ordered a stop to the digging. A new method was tried: a nearby stream was led into a temporary reservoir, which was released when full, washing much sand away, and this was repeated, steadily further upstream, until it reached Ragundasjön. By 1795 the canal had reached the lake. Water began to flow through, but stopped because the river's flow was low. 1796 flood disaster The spring flood of 1796 was unusually heavy, and lake water started to leak into the canal. The porous ground beneath the canal could not withstand the force of the water, which at 9 p.m. on 6 June started to quickly erode deep into the esker and the sediment below it. The two site guards saw this and ran for their lives up the south side of the valley to the high ground of Boberget hill. The thunderous rumble from the rampaging water was heard several miles away as it cut a new deep channel through the deep unconsolidated glacial deposit. In only four hours in the night of 6/7 June 1796, Ragundasjön drained completely, triggering a flood wave moving down the river towards forests, islands, sawmills, residential buildings, boat houses, utility buildings, barns, fields and meadows, causing much destruction and establishing the much deepened and scoured-out course of the canal and the Lokängen valley as part of the river's new course, and carrying a huge load of debris, probably thus restoring its prehistoric course as before the Ice Age. Although it was one of Sweden's largest environmental disasters, no one is believed to have been killed by the event, because it was night and their houses were on high ground, but much property and cultivated land were destroyed, and dead salmon lay all around on the meadows and hung in the trees. All that was left of Ragundasjön was a river course running through a smelly expanse of mud. Flood scour had created unstable cliffs of soft sediment up 10 meters high in the lakebed. In the years after the disaster, at least 12 people died when those cliffs collapsed while people were travelling on the old lakebed. The washed-away soil and sediments redeposited at the Indalsälven's delta in the Baltic Sea north of Sundsvall, creating new land which Sundsvall–Timrå Airport was later built on. The final judgment on the case (for loss of fishing) came in 1975, 179 years later. An article in the () from 1864 describes how the Wild Huss in a boastful state wanted the whole of Sweden to know that the Indalsälven was navigable from above Ragunda, and to demonstrate it, he decided to travel along the river in a small boat out to the Baltic Sea and further down to Stockholm. But after only a few kilometers, he encountered the first major obstacle – Svarthålsforsen waterfall outside . According to a version of the story, he wanted to portage past Svarthålsforsen, but re-launched too early where the current was still too strong. Some say that angry farmers released him on the Svarthålsforsen without oars, but others reject that story. What is certain is that the Wild Huss was found drowned a few miles further down the Indalsälven – killed by the water he tried to tamper with. Indalsälven never became navigable. The salmon came back to it after 15 to 20 years. The old lake bed became fertile farmland. New young forest gradually covered the erosion scars around the river's new course. Storforsen, dried, is now called Döda fallet (the Dead Fall). At a rock barrier in the bottom of the former Ragundasjön a new waterfall was formed, Hammarfallet or Hammarforsen in Hammarstrand, now turned into a hydroelectric power station. IUGS geological heritage site for varves Until 1796 varved sediment accumulated on the bottom of Ragundasjön. Since Swedish geologist, Gerard de Geer had an exact date at this site for the last varve laid down, it was crucial in his being able to make a final correlation with other hitherto uncertainly dated varve successions elsewhere in Sweden and establish the 'Swedish Time Scale'. In respect of its importance in the development of varve chronology, the 'Quaternary glacial varves of Ragunda' were included by the International Union of Geological Sciences (IUGS) in its assemblage of 100 'geological heritage sites' around the world in a listing published in October 2022. The organisation defines an 'IUGS Geological Heritage Site' as 'a key place with geological elements and/or processes of international scientific relevance, used as a reference, and/or with a substantial contribution to the development of geological sciences through history.' Heritage Today Döda fallet is a nature reserve and one of the major tourist attractions of the municipality. Every year there is a play commemorating what happened in the spring of 1796. Magnus Huss is remembered by a statue in the small nearby town of Hammarstrand, which was built on the former lake bed of Ragundasjön. Döda fallet is also listed in the Reader's Digest publication Natural Wonders of the World. References External links Döda fallet's information website About the Ragunda lake-draining event (in Swedish) Maps before and after the event Google Earth view of Hammarstrand and around Google Earth close-up view of Döda fallet and around, and Indalsälven's abandoned course below it. Google Earth close-up view of a shop in Hammarstrand named after Wild Huss Google Earth view from northeast across the former lakebed Google Earth view of Sundsvall–Timrå Airport and around http://www.varldenshaftigaste.se/artiklar/doda-fallet-och-vild-hussen/ https://www.lansstyrelsen.se/jamtland/besok-och-upptack/naturreservat/doda-fallet.html Geography of Jämtland County Landforms of Jämtland County Waterfalls of Sweden Indalsälven basin Dam failures in Europe Nature reserves in Sweden Rapids Tourist attractions in Jämtland County First 100 IUGS Geological Heritage Sites
```smarty <!DOCTYPE html> <html lang="en" xmlns:th="http:www.thymeleaf.org"> <head> <meta charset="UTF-8"> <link rel="stylesheet" href="path_to_url"> <script type="text/javascript" src="path_to_url"></script> <title>Vue Test</title> </head> <body> <div id="app"> <el-container style="border: 1px solid #eee"> <el-aside width="200px" style="background-color: rgb(238, 241, 246)"> <el-menu :default-openeds="['1']" :default-active="$route.path" @select="handleSelect"> <el-menu-item index=""> <template slot="title"><i class="el-icon-message"></i></template> </el-menu-item> <el-menu-item index="/menu-1-index"> <template slot="title"><i class="el-icon-menu"></i>1</template> </el-menu-item> <el-menu-item index="/menu-2-index"> <template slot="title"><i class="el-icon-setting"></i>2</template> </el-menu-item> </el-menu> </el-aside> <el-container> <router-view></router-view> </el-container> </el-container> </div> <script> </script> <script src="path_to_url"></script> <script src="path_to_url "></script> <script src="path_to_url"></script> <script src="path_to_url"></script> <script src="/static/sim/js/util.js"></script> <script src="/static/sim/js/route.js"></script> <script src="/static/sim/js/main.js"></script> <script type="module" src="/static/sim/js/aaa.js"></script> </body> </html> ```
```c++ // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // path_to_url #if !defined(BOOST_VMD_SEQ_TO_TUPLE_HPP) #define BOOST_VMD_SEQ_TO_TUPLE_HPP #include <boost/vmd/detail/setup.hpp> #if BOOST_PP_VARIADICS #include <boost/preprocessor/control/iif.hpp> #include <boost/preprocessor/seq/to_tuple.hpp> #include <boost/vmd/empty.hpp> #include <boost/vmd/is_empty.hpp> /* The succeeding comments in this file are in doxygen format. */ /** \file */ /** \def BOOST_VMD_SEQ_TO_TUPLE(seq) \brief converts a seq to a tuple. seq = seq to be converted. If the seq is an empty seq it is converted to an empty tuple. Otherwise the seq is converted to a tuple with the same number of elements as the seq. */ #define BOOST_VMD_SEQ_TO_TUPLE(seq) \ BOOST_PP_IIF \ ( \ BOOST_VMD_IS_EMPTY(seq), \ BOOST_VMD_EMPTY, \ BOOST_PP_SEQ_TO_TUPLE \ ) \ (seq) \ /**/ #endif /* BOOST_PP_VARIADICS */ #endif /* BOOST_VMD_SEQ_TO_TUPLE_HPP */ ```
```php <?php /* * * * path_to_url * * Unless required by applicable law or agreed to in writing, software * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the */ namespace Google\Service\CloudMachineLearningEngine; class GoogleCloudMlV1ExplainRequest extends \Google\Model { protected $httpBodyType = GoogleApiHttpBody::class; protected $httpBodyDataType = ''; /** * @param GoogleApiHttpBody */ public function setHttpBody(GoogleApiHttpBody $httpBody) { $this->httpBody = $httpBody; } /** * @return GoogleApiHttpBody */ public function getHttpBody() { return $this->httpBody; } } // Adding a class alias for backwards compatibility with the previous class name. class_alias(GoogleCloudMlV1ExplainRequest::class, your_sha256_hashRequest'); ```
```html <div class="modal-header primary"> <h5 class="modal-title" id="modal-title"> ADD {{pluginName.split("-").join(" ").toUpperCase()}} <a class="modal-close pull-right" ng-click="close()"> <i class="mdi mdi-close"></i> </a> </h5> </div> <div class="col-md-12 bg-light-grey padding"> <p class="help-block" data-ng-bind-html="description"></p> </div> <div class="modal-body"> <div class="alert alert-danger" ng-if="errors.config"> <button type="button" class="close" ng-click="errors.config=null" aria-label="Close"><span aria-hidden="true">&times;</span></button> {{errors.config}} </div> <!--<form ng-if="customPluginForms.indexOf(pluginName) < 0" class="form-horizontal">--> <!--<div data-ng-if="!data.no_consumer && !consumer" class="form-group">--> <!--<label class="col-sm-4 control-label"><strong>consumer</strong></label>--> <!--<div class="col-sm-7">--> <!--<input--> <!--type="text"--> <!--ng-model="data.consumer.id"--> <!--class="form-control"--> <!--&gt;--> <!--<p class="help-block">--> <!--The CONSUMER ID that this plugin configuration will target.--> <!--This value can only be used if authentication has been enabled--> <!--so that the system can identify the user making the request.--> <!--If left blank, the plugin will be applied to all consumers.--> <!--</p>--> <!--</div>--> <!--</div>--> <!--<div class="form-group" ng-class="{'has-error' : errors[key]}" data-ng-repeat="(key,value) in data.fields">--> <!--<label class="col-sm-4 control-label"><strong>{{humanizeLabel(key)}}</strong></label>--> <!--<div class="col-sm-7">--> <!--<div ng-switch on="value.type">--> <!--&lt;!&ndash; TYPE: RECORD &ndash;&gt;--> <!--<div ng-switch-when="record">--> <!--<div class="plugin-field-table">--> <!--<div data-ng-repeat="field in value.fields">--> <!--&lt;!&ndash;<pre>{{field | json}}</pre>&ndash;&gt;--> <!--<label><i class="mdi mdi-chevron-right"></i>{{getFieldProp(field)}}</label>--> <!--<div ng-switch on="field[getFieldProp(field)].type">--> <!--<div ng-switch-when="array">--> <!--<chips ng-model="field[getFieldProp(field)].value">--> <!--<chip-tmpl>--> <!--<div class="default-chip">--> <!--{{chip}}--> <!--<i class="mdi mdi-close" remove-chip></i>--> <!--</div>--> <!--</chip-tmpl>--> <!--<input chip-control/>--> <!--</chips>--> <!--</div>--> <!--<div ng-switch-default>--> <!--<input type="{{field[getFieldProp(field)].type}}" ng-model="field[getFieldProp(field)].value" class="form-control">--> <!--</div>--> <!--<div class="text-danger" ng-if="errors[key]" data-ng-bind="errors[key]"></div>--> <!--<p class="help-block">{{data.help}}</p>--> <!--</div>--> <!--</div>--> <!--</div>--> <!--</div>--> <!--&lt;!&ndash; TYPE: TABLE &ndash;&gt;--> <!--<div ng-switch-when="table">--> <!--<div ng-if="value.schema.flexible">--> <!--<div data-ng-repeat="(cf_key,cf_data) in value.custom_fields" class="plugin-field-table margin-bottom">--> <!--<p class="no-margin">--> <!--<strong class="pull-left">{{cf_key}}</strong>--> <!--<button data-ng-click="removeCustomField(value,cf_key)" class="btn btn-sm btn-flat btn-danger pull-right" style="margin-top: -15px">--> <!--<i class="mdi mdi-close"></i>--> <!--</button>--> <!--</p>--> <!--<div class="clearfix"></div>--> <!--<div class="row">--> <!--<div data-ng-repeat="(title,content) in cf_data" class="col-md-4">--> <!--<input type="{{content.type}}" class="form-control" data-ng-model="content.value"/>--> <!--<div class="help-block">{{title}}</div>--> <!--</div>--> <!--</div>--> <!--</div>--> <!--<div class="input-group">--> <!--<input type="text"--> <!--on-key-enter="addCustomField(value)"--> <!--data-ng-model="value.custom_field"--> <!--class="form-control"--> <!--my-enter="doSomething()"--> <!--placeholder="add an object to limit...">--> <!--<span class="input-group-btn">--> <!--<button data-ng-click="addCustomField(value)" class="btn btn-primary" type="button">--> <!--<i class="mdi mdi-plus"></i>--> <!--</button>--> <!--</span>--> <!--</div>--> <!--&lt;!&ndash;<pre>{{value.custom_fields | json}}</pre>&ndash;&gt;--> <!--</div>--> <!--<div ng-if="!value.schema.flexible" class="plugin-field-table">--> <!--<div data-ng-repeat="(key,data) in value.schema.fields">--> <!--<label><i class="mdi mdi-chevron-right"></i>{{humanizeLabel(key)}}</label>--> <!--<div ng-switch on="data.type">--> <!--<div ng-switch-when="array">--> <!--<chips ng-model="data.value">--> <!--<chip-tmpl>--> <!--<div class="default-chip">--> <!--{{chip}}--> <!--<i class="mdi mdi-close" remove-chip></i>--> <!--</div>--> <!--</chip-tmpl>--> <!--<input chip-control/>--> <!--</chips>--> <!--</div>--> <!--<div ng-switch-default>--> <!--<input type="{{data.type}}" ng-model="data.value" class="form-control">--> <!--</div>--> <!--<div class="text-danger" ng-if="errors[key]" data-ng-bind="errors[key]"></div>--> <!--<p class="help-block">{{data.help}}</p>--> <!--</div>--> <!--</div>--> <!--</div>--> <!--</div>--> <!--&lt;!&ndash; TYPE: STRING &ndash;&gt;--> <!--<div ng-switch-when="string">--> <!--<div data-ng-if="value.one_of">--> <!--<select class="form-control" ng-model="value.value" ng-options="x for x in value.one_of">--> <!--</select>--> <!--</div>--> <!--<div data-ng-if="!value.one_of">--> <!--&lt;!&ndash;<input type="text" ng-model="value.value" class="form-control">&ndash;&gt;--> <!--<textarea ng-model="value.value" class="form-control"></textarea>--> <!--</div>--> <!--</div>--> <!--&lt;!&ndash; TYPE: ARRAY &ndash;&gt;--> <!--<div ng-switch-when="array">--> <!--<chips ng-model="value.value">--> <!--<chip-tmpl>--> <!--<div class="default-chip">--> <!--{{chip}}--> <!--<i class="mdi mdi-close" remove-chip></i>--> <!--</div>--> <!--</chip-tmpl>--> <!--<input chip-control/>--> <!--</chips>--> <!--<p class="help-block">Tip: Press <code>Enter</code> to accept a value.</p>--> <!--</div>--> <!--&lt;!&ndash; TYPE: SET &ndash;&gt;--> <!--<div ng-switch-when="set">--> <!--<chips ng-model="value.value">--> <!--<chip-tmpl>--> <!--<div class="default-chip">--> <!--{{chip}}--> <!--<i class="mdi mdi-close" remove-chip></i>--> <!--</div>--> <!--</chip-tmpl>--> <!--<input chip-control/>--> <!--</chips>--> <!--<p class="help-block">Tip: Press <code>Enter</code> to accept a value.</p>--> <!--</div>--> <!--&lt;!&ndash; TYPE: SELECT &ndash;&gt;--> <!--<div ng-switch-when="select">--> <!--<select class="form-control" ng-model="value.value">--> <!--<option ng-repeat="item in units" ng-value="item">{{item}}</option>--> <!--</select>--> <!--</div>--> <!--&lt;!&ndash; TYPE: BOOLEAN &ndash;&gt;--> <!--<div ng-switch-when="boolean">--> <!--<input--> <!--bs-switch--> <!--ng-model="value.value"--> <!--switch-size="small"--> <!--type="checkbox"--> <!--switch-on-text="YES"--> <!--switch-off-text="NO"--> <!--ng-change="updateApi(api)"--> <!--&gt;--> <!--</div>--> <!--&lt;!&ndash; TYPE: FILE &ndash;&gt;--> <!--<div ng-switch-when="file">--> <!--<input type="file"--> <!--ngf-select ng-model="data.value" name="data.value"--> <!--/>--> <!--</div>--> <!--&lt;!&ndash; DEFAULT &ndash;&gt;--> <!--<div ng-switch-default>--> <!--<input type="{{value.type}}" ng-model="value.value" class="form-control">--> <!--</div>--> <!--<div class="text-danger" ng-if="errors[key]" data-ng-bind="errors[key]"></div>--> <!--<p class="help-block">{{value.help}}</p>--> <!--</div>--> <!--</div>--> <!--</div>--> <!--<div class="form-group">--> <!--<div class="col-sm-offset-4 col-sm-7">--> <!--<button type="button" data-ng-disabled="busy" class="btn btn-primary btn-block" ng-click="addPlugin()">--> <!--<i class="mdi mdi-check" ng-if="!busy"></i>--> <!--<fading-circle-spinner class="spinner spinner-invert pull-left" ng-if="busy"></fading-circle-spinner>--> <!--add plugin--> <!--</button>--> <!--</div>--> <!--</div>--> <!--</form>--> <div ng-if="customPluginForms.indexOf(pluginName) < 0" data-ng-include="'js/app/plugins/forms/default.html?r=' + Date.now()"></div> <div ng-if="customPluginForms.indexOf(pluginName) > -1" data-ng-include="'js/app/plugins/forms/' + pluginName + '.html?r=' + Date.now()"></div> </div> ```
```c /* * */ #include "soc/gdma_periph.h" #include "soc/ahb_dma_reg.h" const gdma_signal_conn_t gdma_periph_signals = { .groups = { [0] = { .module = PERIPH_GDMA_MODULE, .pairs = { [0] = { .rx_irq_id = ETS_DMA_IN_CH0_INTR_SOURCE, .tx_irq_id = ETS_DMA_OUT_CH0_INTR_SOURCE, }, [1] = { .rx_irq_id = ETS_DMA_IN_CH1_INTR_SOURCE, .tx_irq_id = ETS_DMA_OUT_CH1_INTR_SOURCE, } } } } }; ```
```ruby # frozen_string_literal: true # # optparse.rb - command-line option analysis with the Gem::OptionParser class. # # Author:: Nobu Nakada # Documentation:: Nobu Nakada and Gavin Sinclair. # # See Gem::OptionParser for documentation. # #-- # == Developer Documentation (not for RDoc output) # # === Class tree # # - Gem::OptionParser:: front end # - Gem::OptionParser::Switch:: each switches # - Gem::OptionParser::List:: options list # - Gem::OptionParser::ParseError:: errors on parsing # - Gem::OptionParser::AmbiguousOption # - Gem::OptionParser::NeedlessArgument # - Gem::OptionParser::MissingArgument # - Gem::OptionParser::InvalidOption # - Gem::OptionParser::InvalidArgument # - Gem::OptionParser::AmbiguousArgument # # === Object relationship diagram # # +--------------+ # | Gem::OptionParser |<>-----+ # +--------------+ | +--------+ # | ,-| Switch | # on_head -------->+---------------+ / +--------+ # accept/reject -->| List |<|>- # | |<|>- +----------+ # on ------------->+---------------+ `-| argument | # : : | class | # +---------------+ |==========| # on_tail -------->| | |pattern | # +---------------+ |----------| # Gem::OptionParser.accept ->| DefaultList | |converter | # reject |(shared between| +----------+ # | all instances)| # +---------------+ # #++ # # == Gem::OptionParser # # === New to \Gem::OptionParser? # # See the {Tutorial}[optparse/tutorial.rdoc]. # # === Introduction # # Gem::OptionParser is a class for command-line option analysis. It is much more # advanced, yet also easier to use, than GetoptLong, and is a more Ruby-oriented # solution. # # === Features # # 1. The argument specification and the code to handle it are written in the # same place. # 2. It can output an option summary; you don't need to maintain this string # separately. # 3. Optional and mandatory arguments are specified very gracefully. # 4. Arguments can be automatically converted to a specified class. # 5. Arguments can be restricted to a certain set. # # All of these features are demonstrated in the examples below. See # #make_switch for full documentation. # # === Minimal example # # require 'rubygems/optparse/lib/optparse' # # options = {} # Gem::OptionParser.new do |parser| # parser.banner = "Usage: example.rb [options]" # # parser.on("-v", "--[no-]verbose", "Run verbosely") do |v| # options[:verbose] = v # end # end.parse! # # p options # p ARGV # # === Generating Help # # Gem::OptionParser can be used to automatically generate help for the commands you # write: # # require 'rubygems/optparse/lib/optparse' # # Options = Struct.new(:name) # # class Parser # def self.parse(options) # args = Options.new("world") # # opt_parser = Gem::OptionParser.new do |parser| # parser.banner = "Usage: example.rb [options]" # # parser.on("-nNAME", "--name=NAME", "Name to say hello to") do |n| # args.name = n # end # # parser.on("-h", "--help", "Prints this help") do # puts parser # exit # end # end # # opt_parser.parse!(options) # return args # end # end # options = Parser.parse %w[--help] # # #=> # # Usage: example.rb [options] # # -n, --name=NAME Name to say hello to # # -h, --help Prints this help # # === Required Arguments # # For options that require an argument, option specification strings may include an # option name in all caps. If an option is used without the required argument, # an exception will be raised. # # require 'rubygems/optparse/lib/optparse' # # options = {} # Gem::OptionParser.new do |parser| # parser.on("-r", "--require LIBRARY", # "Require the LIBRARY before executing your script") do |lib| # puts "You required #{lib}!" # end # end.parse! # # Used: # # $ ruby optparse-test.rb -r # optparse-test.rb:9:in `<main>': missing argument: -r (Gem::OptionParser::MissingArgument) # $ ruby optparse-test.rb -r my-library # You required my-library! # # === Type Coercion # # Gem::OptionParser supports the ability to coerce command line arguments # into objects for us. # # Gem::OptionParser comes with a few ready-to-use kinds of type # coercion. They are: # # - Date -- Anything accepted by +Date.parse+ # - DateTime -- Anything accepted by +DateTime.parse+ # - Time -- Anything accepted by +Time.httpdate+ or +Time.parse+ # - URI -- Anything accepted by +URI.parse+ # - Shellwords -- Anything accepted by +Shellwords.shellwords+ # - String -- Any non-empty string # - Integer -- Any integer. Will convert octal. (e.g. 124, -3, 040) # - Float -- Any float. (e.g. 10, 3.14, -100E+13) # - Numeric -- Any integer, float, or rational (1, 3.4, 1/3) # - DecimalInteger -- Like +Integer+, but no octal format. # - OctalInteger -- Like +Integer+, but no decimal format. # - DecimalNumeric -- Decimal integer or float. # - TrueClass -- Accepts '+, yes, true, -, no, false' and # defaults as +true+ # - FalseClass -- Same as +TrueClass+, but defaults to +false+ # - Array -- Strings separated by ',' (e.g. 1,2,3) # - Regexp -- Regular expressions. Also includes options. # # We can also add our own coercions, which we will cover below. # # ==== Using Built-in Conversions # # As an example, the built-in +Time+ conversion is used. The other built-in # conversions behave in the same way. # Gem::OptionParser will attempt to parse the argument # as a +Time+. If it succeeds, that time will be passed to the # handler block. Otherwise, an exception will be raised. # # require 'rubygems/optparse/lib/optparse' # require 'rubygems/optparse/lib/optparse/time' # Gem::OptionParser.new do |parser| # parser.on("-t", "--time [TIME]", Time, "Begin execution at given time") do |time| # p time # end # end.parse! # # Used: # # $ ruby optparse-test.rb -t nonsense # ... invalid argument: -t nonsense (Gem::OptionParser::InvalidArgument) # $ ruby optparse-test.rb -t 10-11-12 # 2010-11-12 00:00:00 -0500 # $ ruby optparse-test.rb -t 9:30 # 2014-08-13 09:30:00 -0400 # # ==== Creating Custom Conversions # # The +accept+ method on Gem::OptionParser may be used to create converters. # It specifies which conversion block to call whenever a class is specified. # The example below uses it to fetch a +User+ object before the +on+ handler receives it. # # require 'rubygems/optparse/lib/optparse' # # User = Struct.new(:id, :name) # # def find_user id # not_found = ->{ raise "No User Found for id #{id}" } # [ User.new(1, "Sam"), # User.new(2, "Gandalf") ].find(not_found) do |u| # u.id == id # end # end # # op = Gem::OptionParser.new # op.accept(User) do |user_id| # find_user user_id.to_i # end # # op.on("--user ID", User) do |user| # puts user # end # # op.parse! # # Used: # # $ ruby optparse-test.rb --user 1 # #<struct User id=1, name="Sam"> # $ ruby optparse-test.rb --user 2 # #<struct User id=2, name="Gandalf"> # $ ruby optparse-test.rb --user 3 # optparse-test.rb:15:in `block in find_user': No User Found for id 3 (RuntimeError) # # === Store options to a Hash # # The +into+ option of +order+, +parse+ and so on methods stores command line options into a Hash. # # require 'rubygems/optparse/lib/optparse' # # options = {} # Gem::OptionParser.new do |parser| # parser.on('-a') # parser.on('-b NUM', Integer) # parser.on('-v', '--verbose') # end.parse!(into: options) # # p options # # Used: # # $ ruby optparse-test.rb -a # {:a=>true} # $ ruby optparse-test.rb -a -v # {:a=>true, :verbose=>true} # $ ruby optparse-test.rb -a -b 100 # {:a=>true, :b=>100} # # === Complete example # # The following example is a complete Ruby program. You can run it and see the # effect of specifying various options. This is probably the best way to learn # the features of +optparse+. # # require 'rubygems/optparse/lib/optparse' # require 'rubygems/optparse/lib/optparse/time' # require 'ostruct' # require 'pp' # # class OptparseExample # Version = '1.0.0' # # CODES = %w[iso-2022-jp shift_jis euc-jp utf8 binary] # CODE_ALIASES = { "jis" => "iso-2022-jp", "sjis" => "shift_jis" } # # class ScriptOptions # attr_accessor :library, :inplace, :encoding, :transfer_type, # :verbose, :extension, :delay, :time, :record_separator, # :list # # def initialize # self.library = [] # self.inplace = false # self.encoding = "utf8" # self.transfer_type = :auto # self.verbose = false # end # # def define_options(parser) # parser.banner = "Usage: example.rb [options]" # parser.separator "" # parser.separator "Specific options:" # # # add additional options # perform_inplace_option(parser) # delay_execution_option(parser) # execute_at_time_option(parser) # specify_record_separator_option(parser) # list_example_option(parser) # specify_encoding_option(parser) # optional_option_argument_with_keyword_completion_option(parser) # boolean_verbose_option(parser) # # parser.separator "" # parser.separator "Common options:" # # No argument, shows at tail. This will print an options summary. # # Try it and see! # parser.on_tail("-h", "--help", "Show this message") do # puts parser # exit # end # # Another typical switch to print the version. # parser.on_tail("--version", "Show version") do # puts Version # exit # end # end # # def perform_inplace_option(parser) # # Specifies an optional option argument # parser.on("-i", "--inplace [EXTENSION]", # "Edit ARGV files in place", # "(make backup if EXTENSION supplied)") do |ext| # self.inplace = true # self.extension = ext || '' # self.extension.sub!(/\A\.?(?=.)/, ".") # Ensure extension begins with dot. # end # end # # def delay_execution_option(parser) # # Cast 'delay' argument to a Float. # parser.on("--delay N", Float, "Delay N seconds before executing") do |n| # self.delay = n # end # end # # def execute_at_time_option(parser) # # Cast 'time' argument to a Time object. # parser.on("-t", "--time [TIME]", Time, "Begin execution at given time") do |time| # self.time = time # end # end # # def specify_record_separator_option(parser) # # Cast to octal integer. # parser.on("-F", "--irs [OCTAL]", Gem::OptionParser::OctalInteger, # "Specify record separator (default \\0)") do |rs| # self.record_separator = rs # end # end # # def list_example_option(parser) # # List of arguments. # parser.on("--list x,y,z", Array, "Example 'list' of arguments") do |list| # self.list = list # end # end # # def specify_encoding_option(parser) # # Keyword completion. We are specifying a specific set of arguments (CODES # # and CODE_ALIASES - notice the latter is a Hash), and the user may provide # # the shortest unambiguous text. # code_list = (CODE_ALIASES.keys + CODES).join(', ') # parser.on("--code CODE", CODES, CODE_ALIASES, "Select encoding", # "(#{code_list})") do |encoding| # self.encoding = encoding # end # end # # def optional_option_argument_with_keyword_completion_option(parser) # # Optional '--type' option argument with keyword completion. # parser.on("--type [TYPE]", [:text, :binary, :auto], # "Select transfer type (text, binary, auto)") do |t| # self.transfer_type = t # end # end # # def boolean_verbose_option(parser) # # Boolean switch. # parser.on("-v", "--[no-]verbose", "Run verbosely") do |v| # self.verbose = v # end # end # end # # # # # Return a structure describing the options. # # # def parse(args) # # The options specified on the command line will be collected in # # *options*. # # @options = ScriptOptions.new # @args = Gem::OptionParser.new do |parser| # @options.define_options(parser) # parser.parse!(args) # end # @options # end # # attr_reader :parser, :options # end # class OptparseExample # # example = OptparseExample.new # options = example.parse(ARGV) # pp options # example.options # pp ARGV # # === Shell Completion # # For modern shells (e.g. bash, zsh, etc.), you can use shell # completion for command line options. # # === Further documentation # # The above examples, along with the accompanying # {Tutorial}[optparse/tutorial.rdoc], # should be enough to learn how to use this class. # If you have any questions, file a ticket at path_to_url # class Gem::OptionParser Gem::OptionParser::Version = "0.3.0" # :stopdoc: NoArgument = [NO_ARGUMENT = :NONE, nil].freeze RequiredArgument = [REQUIRED_ARGUMENT = :REQUIRED, true].freeze OptionalArgument = [OPTIONAL_ARGUMENT = :OPTIONAL, false].freeze # :startdoc: # # Keyword completion module. This allows partial arguments to be specified # and resolved against a list of acceptable values. # module Completion def self.regexp(key, icase) Regexp.new('\A' + Regexp.quote(key).gsub(/\w+\b/, '\&\w*'), icase) end def self.candidate(key, icase = false, pat = nil, &block) pat ||= Completion.regexp(key, icase) candidates = [] block.call do |k, *v| (if Regexp === k kn = "" k === key else kn = defined?(k.id2name) ? k.id2name : k pat === kn end) or next v << k if v.empty? candidates << [k, v, kn] end candidates end def candidate(key, icase = false, pat = nil) Completion.candidate(key, icase, pat, &method(:each)) end public def complete(key, icase = false, pat = nil) candidates = candidate(key, icase, pat, &method(:each)).sort_by {|k, v, kn| kn.size} if candidates.size == 1 canon, sw, * = candidates[0] elsif candidates.size > 1 canon, sw, cn = candidates.shift candidates.each do |k, v, kn| next if sw == v if String === cn and String === kn if cn.rindex(kn, 0) canon, sw, cn = k, v, kn next elsif kn.rindex(cn, 0) next end end throw :ambiguous, key end end if canon block_given? or return key, *sw yield(key, *sw) end end def convert(opt = nil, val = nil, *) val end end # # Map from option/keyword string to object with completion. # class OptionMap < Hash include Completion end # # Individual switch class. Not important to the user. # # Defined within Switch are several Switch-derived classes: NoArgument, # RequiredArgument, etc. # class Switch attr_reader :pattern, :conv, :short, :long, :arg, :desc, :block # # Guesses argument style from +arg+. Returns corresponding # Gem::OptionParser::Switch class (OptionalArgument, etc.). # def self.guess(arg) case arg when "" t = self when /\A=?\[/ t = Switch::OptionalArgument when /\A\s+\[/ t = Switch::PlacedArgument else t = Switch::RequiredArgument end self >= t or incompatible_argument_styles(arg, t) t end def self.incompatible_argument_styles(arg, t) raise(ArgumentError, "#{arg}: incompatible argument styles\n #{self}, #{t}", ParseError.filter_backtrace(caller(2))) end def self.pattern NilClass end def initialize(pattern = nil, conv = nil, short = nil, long = nil, arg = nil, desc = ([] if short or long), block = nil, &_block) raise if Array === pattern block ||= _block @pattern, @conv, @short, @long, @arg, @desc, @block = pattern, conv, short, long, arg, desc, block end # # Parses +arg+ and returns rest of +arg+ and matched portion to the # argument pattern. Yields when the pattern doesn't match substring. # def parse_arg(arg) # :nodoc: pattern or return nil, [arg] unless m = pattern.match(arg) yield(InvalidArgument, arg) return arg, [] end if String === m m = [s = m] else m = m.to_a s = m[0] return nil, m unless String === s end raise InvalidArgument, arg unless arg.rindex(s, 0) return nil, m if s.length == arg.length yield(InvalidArgument, arg) # didn't match whole arg return arg[s.length..-1], m end private :parse_arg # # Parses argument, converts and returns +arg+, +block+ and result of # conversion. Yields at semi-error condition instead of raising an # exception. # def conv_arg(arg, val = []) # :nodoc: if conv val = conv.call(*val) else val = proc {|v| v}.call(*val) end return arg, block, val end private :conv_arg # # Produces the summary text. Each line of the summary is yielded to the # block (without newline). # # +sdone+:: Already summarized short style options keyed hash. # +ldone+:: Already summarized long style options keyed hash. # +width+:: Width of left side (option part). In other words, the right # side (description part) starts after +width+ columns. # +max+:: Maximum width of left side -> the options are filled within # +max+ columns. # +indent+:: Prefix string indents all summarized lines. # def summarize(sdone = {}, ldone = {}, width = 1, max = width - 1, indent = "") sopts, lopts = [], [], nil @short.each {|s| sdone.fetch(s) {sopts << s}; sdone[s] = true} if @short @long.each {|s| ldone.fetch(s) {lopts << s}; ldone[s] = true} if @long return if sopts.empty? and lopts.empty? # completely hidden left = [sopts.join(', ')] right = desc.dup while s = lopts.shift l = left[-1].length + s.length l += arg.length if left.size == 1 && arg l < max or sopts.empty? or left << +'' left[-1] << (left[-1].empty? ? ' ' * 4 : ', ') << s end if arg left[0] << (left[1] ? arg.sub(/\A(\[?)=/, '\1') + ',' : arg) end mlen = left.collect {|ss| ss.length}.max.to_i while mlen > width and l = left.shift mlen = left.collect {|ss| ss.length}.max.to_i if l.length == mlen if l.length < width and (r = right[0]) and !r.empty? l = l.to_s.ljust(width) + ' ' + r right.shift end yield(indent + l) end while begin l = left.shift; r = right.shift; l or r end l = l.to_s.ljust(width) + ' ' + r if r and !r.empty? yield(indent + l) end self end def add_banner(to) # :nodoc: unless @short or @long s = desc.join to << " [" + s + "]..." unless s.empty? end to end def match_nonswitch?(str) # :nodoc: @pattern =~ str unless @short or @long end # # Main name of the switch. # def switch_name (long.first || short.first).sub(/\A-+(?:\[no-\])?/, '') end def compsys(sdone, ldone) # :nodoc: sopts, lopts = [], [] @short.each {|s| sdone.fetch(s) {sopts << s}; sdone[s] = true} if @short @long.each {|s| ldone.fetch(s) {lopts << s}; ldone[s] = true} if @long return if sopts.empty? and lopts.empty? # completely hidden (sopts+lopts).each do |opt| # "(-x -c -r)-l[left justify]" if /^--\[no-\](.+)$/ =~ opt o = $1 yield("--#{o}", desc.join("")) yield("--no-#{o}", desc.join("")) else yield("#{opt}", desc.join("")) end end end def pretty_print_contents(q) # :nodoc: if @block q.text ":" + @block.source_location.join(":") + ":" first = false else first = true end [@short, @long].each do |list| list.each do |opt| if first q.text ":" first = false end q.breakable q.text opt end end end def pretty_print(q) # :nodoc: q.object_group(self) {pretty_print_contents(q)} end # # Switch that takes no arguments. # class NoArgument < self # # Raises an exception if any arguments given. # def parse(arg, argv) yield(NeedlessArgument, arg) if arg conv_arg(arg) end def self.incompatible_argument_styles(*) end def self.pattern Object end def pretty_head # :nodoc: "NoArgument" end end # # Switch that takes an argument. # class RequiredArgument < self # # Raises an exception if argument is not present. # def parse(arg, argv) unless arg raise MissingArgument if argv.empty? arg = argv.shift end conv_arg(*parse_arg(arg, &method(:raise))) end def pretty_head # :nodoc: "Required" end end # # Switch that can omit argument. # class OptionalArgument < self # # Parses argument if given, or uses default value. # def parse(arg, argv, &error) if arg conv_arg(*parse_arg(arg, &error)) else conv_arg(arg) end end def pretty_head # :nodoc: "Optional" end end # # Switch that takes an argument, which does not begin with '-' or is '-'. # class PlacedArgument < self # # Returns nil if argument is not present or begins with '-' and is not '-'. # def parse(arg, argv, &error) if !(val = arg) and (argv.empty? or /\A-./ =~ (val = argv[0])) return nil, block, nil end opt = (val = parse_arg(val, &error))[1] val = conv_arg(*val) if opt and !arg argv.shift else val[0] = nil end val end def pretty_head # :nodoc: "Placed" end end end # # Simple option list providing mapping from short and/or long option # string to Gem::OptionParser::Switch and mapping from acceptable argument to # matching pattern and converter pair. Also provides summary feature. # class List # Map from acceptable argument types to pattern and converter pairs. attr_reader :atype # Map from short style option switches to actual switch objects. attr_reader :short # Map from long style option switches to actual switch objects. attr_reader :long # List of all switches and summary string. attr_reader :list # # Just initializes all instance variables. # def initialize @atype = {} @short = OptionMap.new @long = OptionMap.new @list = [] end def pretty_print(q) # :nodoc: q.group(1, "(", ")") do @list.each do |sw| next unless Switch === sw q.group(1, "(" + sw.pretty_head, ")") do sw.pretty_print_contents(q) end end end end # # See Gem::OptionParser.accept. # def accept(t, pat = /.*/m, &block) if pat pat.respond_to?(:match) or raise TypeError, "has no `match'", ParseError.filter_backtrace(caller(2)) else pat = t if t.respond_to?(:match) end unless block block = pat.method(:convert).to_proc if pat.respond_to?(:convert) end @atype[t] = [pat, block] end # # See Gem::OptionParser.reject. # def reject(t) @atype.delete(t) end # # Adds +sw+ according to +sopts+, +lopts+ and +nlopts+. # # +sw+:: Gem::OptionParser::Switch instance to be added. # +sopts+:: Short style option list. # +lopts+:: Long style option list. # +nlopts+:: Negated long style options list. # def update(sw, sopts, lopts, nsw = nil, nlopts = nil) # :nodoc: sopts.each {|o| @short[o] = sw} if sopts lopts.each {|o| @long[o] = sw} if lopts nlopts.each {|o| @long[o] = nsw} if nsw and nlopts used = @short.invert.update(@long.invert) @list.delete_if {|o| Switch === o and !used[o]} end private :update # # Inserts +switch+ at the head of the list, and associates short, long # and negated long options. Arguments are: # # +switch+:: Gem::OptionParser::Switch instance to be inserted. # +short_opts+:: List of short style options. # +long_opts+:: List of long style options. # +nolong_opts+:: List of long style options with "no-" prefix. # # prepend(switch, short_opts, long_opts, nolong_opts) # def prepend(*args) update(*args) @list.unshift(args[0]) end # # Appends +switch+ at the tail of the list, and associates short, long # and negated long options. Arguments are: # # +switch+:: Gem::OptionParser::Switch instance to be inserted. # +short_opts+:: List of short style options. # +long_opts+:: List of long style options. # +nolong_opts+:: List of long style options with "no-" prefix. # # append(switch, short_opts, long_opts, nolong_opts) # def append(*args) update(*args) @list.push(args[0]) end # # Searches +key+ in +id+ list. The result is returned or yielded if a # block is given. If it isn't found, nil is returned. # def search(id, key) if list = __send__(id) val = list.fetch(key) {return nil} block_given? ? yield(val) : val end end # # Searches list +id+ for +opt+ and the optional patterns for completion # +pat+. If +icase+ is true, the search is case insensitive. The result # is returned or yielded if a block is given. If it isn't found, nil is # returned. # def complete(id, opt, icase = false, *pat, &block) __send__(id).complete(opt, icase, *pat, &block) end def get_candidates(id) yield __send__(id).keys end # # Iterates over each option, passing the option to the +block+. # def each_option(&block) list.each(&block) end # # Creates the summary table, passing each line to the +block+ (without # newline). The arguments +args+ are passed along to the summarize # method which is called on every option. # def summarize(*args, &block) sum = [] list.reverse_each do |opt| if opt.respond_to?(:summarize) # perhaps Gem::OptionParser::Switch s = [] opt.summarize(*args) {|l| s << l} sum.concat(s.reverse) elsif !opt or opt.empty? sum << "" elsif opt.respond_to?(:each_line) sum.concat([*opt.each_line].reverse) else sum.concat([*opt.each].reverse) end end sum.reverse_each(&block) end def add_banner(to) # :nodoc: list.each do |opt| if opt.respond_to?(:add_banner) opt.add_banner(to) end end to end def compsys(*args, &block) # :nodoc: list.each do |opt| if opt.respond_to?(:compsys) opt.compsys(*args, &block) end end end end # # Hash with completion search feature. See Gem::OptionParser::Completion. # class CompletingHash < Hash include Completion # # Completion for hash key. # def match(key) *values = fetch(key) { raise AmbiguousArgument, catch(:ambiguous) {return complete(key)} } return key, *values end end # :stopdoc: # # Enumeration of acceptable argument styles. Possible values are: # # NO_ARGUMENT:: The switch takes no arguments. (:NONE) # REQUIRED_ARGUMENT:: The switch requires an argument. (:REQUIRED) # OPTIONAL_ARGUMENT:: The switch requires an optional argument. (:OPTIONAL) # # Use like --switch=argument (long style) or -Xargument (short style). For # short style, only portion matched to argument pattern is treated as # argument. # ArgumentStyle = {} NoArgument.each {|el| ArgumentStyle[el] = Switch::NoArgument} RequiredArgument.each {|el| ArgumentStyle[el] = Switch::RequiredArgument} OptionalArgument.each {|el| ArgumentStyle[el] = Switch::OptionalArgument} ArgumentStyle.freeze # # Switches common used such as '--', and also provides default # argument classes # DefaultList = List.new DefaultList.short['-'] = Switch::NoArgument.new {} DefaultList.long[''] = Switch::NoArgument.new {throw :terminate} COMPSYS_HEADER = <<'XXX' # :nodoc: typeset -A opt_args local context state line _arguments -s -S \ XXX def compsys(to, name = File.basename($0)) # :nodoc: to << "#compdef #{name}\n" to << COMPSYS_HEADER visit(:compsys, {}, {}) {|o, d| to << %Q[ "#{o}[#{d.gsub(/[\"\[\]]/, '\\\\\&')}]" \\\n] } to << " '*:file:_files' && return 0\n" end # # Default options for ARGV, which never appear in option summary. # Officious = {} # # --help # Shows option summary. # Officious['help'] = proc do |parser| Switch::NoArgument.new do |arg| puts parser.help exit end end # # --*-completion-bash=WORD # Shows candidates for command line completion. # Officious['*-completion-bash'] = proc do |parser| Switch::RequiredArgument.new do |arg| puts parser.candidate(arg) exit end end # # --*-completion-zsh[=NAME:FILE] # Creates zsh completion file. # Officious['*-completion-zsh'] = proc do |parser| Switch::OptionalArgument.new do |arg| parser.compsys(STDOUT, arg) exit end end # # --version # Shows version string if Version is defined. # Officious['version'] = proc do |parser| Switch::OptionalArgument.new do |pkg| if pkg begin require 'rubygems/optparse/lib/optparse/version' rescue LoadError else show_version(*pkg.split(/,/)) or abort("#{parser.program_name}: no version found in package #{pkg}") exit end end v = parser.ver or abort("#{parser.program_name}: version unknown") puts v exit end end # :startdoc: # # Class methods # # # Initializes a new instance and evaluates the optional block in context # of the instance. Arguments +args+ are passed to #new, see there for # description of parameters. # # This method is *deprecated*, its behavior corresponds to the older #new # method. # def self.with(*args, &block) opts = new(*args) opts.instance_eval(&block) opts end # # Returns an incremented value of +default+ according to +arg+. # def self.inc(arg, default = nil) case arg when Integer arg.nonzero? when nil default.to_i + 1 end end def inc(*args) self.class.inc(*args) end # # Initializes the instance and yields itself if called with a block. # # +banner+:: Banner message. # +width+:: Summary width. # +indent+:: Summary indent. # def initialize(banner = nil, width = 32, indent = ' ' * 4) @stack = [DefaultList, List.new, List.new] @program_name = nil @banner = banner @summary_width = width @summary_indent = indent @default_argv = ARGV @require_exact = false @raise_unknown = true add_officious yield self if block_given? end def add_officious # :nodoc: list = base() Officious.each do |opt, block| list.long[opt] ||= block.call(self) end end # # Terminates option parsing. Optional parameter +arg+ is a string pushed # back to be the first non-option argument. # def terminate(arg = nil) self.class.terminate(arg) end def self.terminate(arg = nil) throw :terminate, arg end @stack = [DefaultList] def self.top() DefaultList end # # Directs to accept specified class +t+. The argument string is passed to # the block in which it should be converted to the desired class. # # +t+:: Argument class specifier, any object including Class. # +pat+:: Pattern for argument, defaults to +t+ if it responds to match. # # accept(t, pat, &block) # def accept(*args, &blk) top.accept(*args, &blk) end # # See #accept. # def self.accept(*args, &blk) top.accept(*args, &blk) end # # Directs to reject specified class argument. # # +t+:: Argument class specifier, any object including Class. # # reject(t) # def reject(*args, &blk) top.reject(*args, &blk) end # # See #reject. # def self.reject(*args, &blk) top.reject(*args, &blk) end # # Instance methods # # Heading banner preceding summary. attr_writer :banner # Program name to be emitted in error message and default banner, # defaults to $0. attr_writer :program_name # Width for option list portion of summary. Must be Numeric. attr_accessor :summary_width # Indentation for summary. Must be String (or have + String method). attr_accessor :summary_indent # Strings to be parsed in default. attr_accessor :default_argv # Whether to require that options match exactly (disallows providing # abbreviated long option as short option). attr_accessor :require_exact # Whether to raise at unknown option. attr_accessor :raise_unknown # # Heading banner preceding summary. # def banner unless @banner @banner = +"Usage: #{program_name} [options]" visit(:add_banner, @banner) end @banner end # # Program name to be emitted in error message and default banner, defaults # to $0. # def program_name @program_name || File.basename($0, '.*') end # for experimental cascading :-) alias set_banner banner= alias set_program_name program_name= alias set_summary_width summary_width= alias set_summary_indent summary_indent= # Version attr_writer :version # Release code attr_writer :release # # Version # def version (defined?(@version) && @version) || (defined?(::Version) && ::Version) end # # Release code # def release (defined?(@release) && @release) || (defined?(::Release) && ::Release) || (defined?(::RELEASE) && ::RELEASE) end # # Returns version string from program_name, version and release. # def ver if v = version str = +"#{program_name} #{[v].join('.')}" str << " (#{v})" if v = release str end end def warn(mesg = $!) super("#{program_name}: #{mesg}") end def abort(mesg = $!) super("#{program_name}: #{mesg}") end # # Subject of #on / #on_head, #accept / #reject # def top @stack[-1] end # # Subject of #on_tail. # def base @stack[1] end # # Pushes a new List. # def new @stack.push(List.new) if block_given? yield self else self end end # # Removes the last List. # def remove @stack.pop end # # Puts option summary into +to+ and returns +to+. Yields each line if # a block is given. # # +to+:: Output destination, which must have method <<. Defaults to []. # +width+:: Width of left side, defaults to @summary_width. # +max+:: Maximum length allowed for left side, defaults to +width+ - 1. # +indent+:: Indentation, defaults to @summary_indent. # def summarize(to = [], width = @summary_width, max = width - 1, indent = @summary_indent, &blk) nl = "\n" blk ||= proc {|l| to << (l.index(nl, -1) ? l : l + nl)} visit(:summarize, {}, {}, width, max, indent, &blk) to end # # Returns option summary string. # def help; summarize("#{banner}".sub(/\n?\z/, "\n")) end alias to_s help def pretty_print(q) # :nodoc: q.object_group(self) do first = true if @stack.size > 2 @stack.each_with_index do |s, i| next if i < 2 next if s.list.empty? if first first = false q.text ":" end q.breakable s.pretty_print(q) end end end end def inspect # :nodoc: require 'pp' pretty_print_inspect end # # Returns option summary list. # def to_a; summarize("#{banner}".split(/^/)) end # # Checks if an argument is given twice, in which case an ArgumentError is # raised. Called from Gem::OptionParser#switch only. # # +obj+:: New argument. # +prv+:: Previously specified argument. # +msg+:: Exception message. # def notwice(obj, prv, msg) # :nodoc: unless !prv or prv == obj raise(ArgumentError, "argument #{msg} given twice: #{obj}", ParseError.filter_backtrace(caller(2))) end obj end private :notwice SPLAT_PROC = proc {|*a| a.length <= 1 ? a.first : a} # :nodoc: # :call-seq: # make_switch(params, block = nil) # # :include: ../doc/optparse/creates_option.rdoc # def make_switch(opts, block = nil) short, long, nolong, style, pattern, conv, not_pattern, not_conv, not_style = [], [], [] ldesc, sdesc, desc, arg = [], [], [] default_style = Switch::NoArgument default_pattern = nil klass = nil q, a = nil has_arg = false opts.each do |o| # argument class next if search(:atype, o) do |pat, c| klass = notwice(o, klass, 'type') if not_style and not_style != Switch::NoArgument not_pattern, not_conv = pat, c else default_pattern, conv = pat, c end end # directly specified pattern(any object possible to match) if (!(String === o || Symbol === o)) and o.respond_to?(:match) pattern = notwice(o, pattern, 'pattern') if pattern.respond_to?(:convert) conv = pattern.method(:convert).to_proc else conv = SPLAT_PROC end next end # anything others case o when Proc, Method block = notwice(o, block, 'block') when Array, Hash case pattern when CompletingHash when nil pattern = CompletingHash.new conv = pattern.method(:convert).to_proc if pattern.respond_to?(:convert) else raise ArgumentError, "argument pattern given twice" end o.each {|pat, *v| pattern[pat] = v.fetch(0) {pat}} when Module raise ArgumentError, "unsupported argument type: #{o}", ParseError.filter_backtrace(caller(4)) when *ArgumentStyle.keys style = notwice(ArgumentStyle[o], style, 'style') when /^--no-([^\[\]=\s]*)(.+)?/ q, a = $1, $2 o = notwice(a ? Object : TrueClass, klass, 'type') not_pattern, not_conv = search(:atype, o) unless not_style not_style = (not_style || default_style).guess(arg = a) if a default_style = Switch::NoArgument default_pattern, conv = search(:atype, FalseClass) unless default_pattern ldesc << "--no-#{q}" (q = q.downcase).tr!('_', '-') long << "no-#{q}" nolong << q when /^--\[no-\]([^\[\]=\s]*)(.+)?/ q, a = $1, $2 o = notwice(a ? Object : TrueClass, klass, 'type') if a default_style = default_style.guess(arg = a) default_pattern, conv = search(:atype, o) unless default_pattern end ldesc << "--[no-]#{q}" (o = q.downcase).tr!('_', '-') long << o not_pattern, not_conv = search(:atype, FalseClass) unless not_style not_style = Switch::NoArgument nolong << "no-#{o}" when /^--([^\[\]=\s]*)(.+)?/ q, a = $1, $2 if a o = notwice(NilClass, klass, 'type') default_style = default_style.guess(arg = a) default_pattern, conv = search(:atype, o) unless default_pattern end ldesc << "--#{q}" (o = q.downcase).tr!('_', '-') long << o when /^-(\[\^?\]?(?:[^\\\]]|\\.)*\])(.+)?/ q, a = $1, $2 o = notwice(Object, klass, 'type') if a default_style = default_style.guess(arg = a) default_pattern, conv = search(:atype, o) unless default_pattern else has_arg = true end sdesc << "-#{q}" short << Regexp.new(q) when /^-(.)(.+)?/ q, a = $1, $2 if a o = notwice(NilClass, klass, 'type') default_style = default_style.guess(arg = a) default_pattern, conv = search(:atype, o) unless default_pattern end sdesc << "-#{q}" short << q when /^=/ style = notwice(default_style.guess(arg = o), style, 'style') default_pattern, conv = search(:atype, Object) unless default_pattern else desc.push(o) if o && !o.empty? end end default_pattern, conv = search(:atype, default_style.pattern) unless default_pattern if !(short.empty? and long.empty?) if has_arg and default_style == Switch::NoArgument default_style = Switch::RequiredArgument end s = (style || default_style).new(pattern || default_pattern, conv, sdesc, ldesc, arg, desc, block) elsif !block if style or pattern raise ArgumentError, "no switch given", ParseError.filter_backtrace(caller) end s = desc else short << pattern s = (style || default_style).new(pattern, conv, nil, nil, arg, desc, block) end return s, short, long, (not_style.new(not_pattern, not_conv, sdesc, ldesc, nil, desc, block) if not_style), nolong end # :call-seq: # define(*params, &block) # # :include: ../doc/optparse/creates_option.rdoc # def define(*opts, &block) top.append(*(sw = make_switch(opts, block))) sw[0] end # :call-seq: # on(*params, &block) # # :include: ../doc/optparse/creates_option.rdoc # def on(*opts, &block) define(*opts, &block) self end alias def_option define # :call-seq: # define_head(*params, &block) # # :include: ../doc/optparse/creates_option.rdoc # def define_head(*opts, &block) top.prepend(*(sw = make_switch(opts, block))) sw[0] end # :call-seq: # on_head(*params, &block) # # :include: ../doc/optparse/creates_option.rdoc # # The new option is added at the head of the summary. # def on_head(*opts, &block) define_head(*opts, &block) self end alias def_head_option define_head # :call-seq: # define_tail(*params, &block) # # :include: ../doc/optparse/creates_option.rdoc # def define_tail(*opts, &block) base.append(*(sw = make_switch(opts, block))) sw[0] end # # :call-seq: # on_tail(*params, &block) # # :include: ../doc/optparse/creates_option.rdoc # # The new option is added at the tail of the summary. # def on_tail(*opts, &block) define_tail(*opts, &block) self end alias def_tail_option define_tail # # Add separator in summary. # def separator(string) top.append(string, nil, nil) end # # Parses command line arguments +argv+ in order. When a block is given, # each non-option argument is yielded. When optional +into+ keyword # argument is provided, the parsed option values are stored there via # <code>[]=</code> method (so it can be Hash, or OpenStruct, or other # similar object). # # Returns the rest of +argv+ left unparsed. # def order(*argv, into: nil, &nonopt) argv = argv[0].dup if argv.size == 1 and Array === argv[0] order!(argv, into: into, &nonopt) end # # Same as #order, but removes switches destructively. # Non-option arguments remain in +argv+. # def order!(argv = default_argv, into: nil, &nonopt) setter = ->(name, val) {into[name.to_sym] = val} if into parse_in_order(argv, setter, &nonopt) end def parse_in_order(argv = default_argv, setter = nil, &nonopt) # :nodoc: opt, arg, val, rest = nil nonopt ||= proc {|a| throw :terminate, a} argv.unshift(arg) if arg = catch(:terminate) { while arg = argv.shift case arg # long option when /\A--([^=]*)(?:=(.*))?/m opt, rest = $1, $2 opt.tr!('_', '-') begin sw, = complete(:long, opt, true) if require_exact && !sw.long.include?(arg) throw :terminate, arg unless raise_unknown raise InvalidOption, arg end rescue ParseError throw :terminate, arg unless raise_unknown raise $!.set_option(arg, true) end begin opt, cb, val = sw.parse(rest, argv) {|*exc| raise(*exc)} val = cb.call(val) if cb setter.call(sw.switch_name, val) if setter rescue ParseError raise $!.set_option(arg, rest) end # short option when /\A-(.)((=).*|.+)?/m eq, rest, opt = $3, $2, $1 has_arg, val = eq, rest begin sw, = search(:short, opt) unless sw begin sw, = complete(:short, opt) # short option matched. val = arg.delete_prefix('-') has_arg = true rescue InvalidOption raise if require_exact # if no short options match, try completion with long # options. sw, = complete(:long, opt) eq ||= !rest end end rescue ParseError throw :terminate, arg unless raise_unknown raise $!.set_option(arg, true) end begin opt, cb, val = sw.parse(val, argv) {|*exc| raise(*exc) if eq} rescue ParseError raise $!.set_option(arg, arg.length > 2) else raise InvalidOption, arg if has_arg and !eq and arg == "-#{opt}" end begin argv.unshift(opt) if opt and (!rest or (opt = opt.sub(/\A-*/, '-')) != '-') val = cb.call(val) if cb setter.call(sw.switch_name, val) if setter rescue ParseError raise $!.set_option(arg, arg.length > 2) end # non-option argument else catch(:prune) do visit(:each_option) do |sw0| sw = sw0 sw.block.call(arg) if Switch === sw and sw.match_nonswitch?(arg) end nonopt.call(arg) end end end nil } visit(:search, :short, nil) {|sw| sw.block.call(*argv) if !sw.pattern} argv end private :parse_in_order # # Parses command line arguments +argv+ in permutation mode and returns # list of non-option arguments. When optional +into+ keyword # argument is provided, the parsed option values are stored there via # <code>[]=</code> method (so it can be Hash, or OpenStruct, or other # similar object). # def permute(*argv, into: nil) argv = argv[0].dup if argv.size == 1 and Array === argv[0] permute!(argv, into: into) end # # Same as #permute, but removes switches destructively. # Non-option arguments remain in +argv+. # def permute!(argv = default_argv, into: nil) nonopts = [] order!(argv, into: into, &nonopts.method(:<<)) argv[0, 0] = nonopts argv end # # Parses command line arguments +argv+ in order when environment variable # POSIXLY_CORRECT is set, and in permutation mode otherwise. # When optional +into+ keyword argument is provided, the parsed option # values are stored there via <code>[]=</code> method (so it can be Hash, # or OpenStruct, or other similar object). # def parse(*argv, into: nil) argv = argv[0].dup if argv.size == 1 and Array === argv[0] parse!(argv, into: into) end # # Same as #parse, but removes switches destructively. # Non-option arguments remain in +argv+. # def parse!(argv = default_argv, into: nil) if ENV.include?('POSIXLY_CORRECT') order!(argv, into: into) else permute!(argv, into: into) end end # # Wrapper method for getopts.rb. # # params = ARGV.getopts("ab:", "foo", "bar:", "zot:Z;zot option") # # params["a"] = true # -a # # params["b"] = "1" # -b1 # # params["foo"] = "1" # --foo # # params["bar"] = "x" # --bar x # # params["zot"] = "z" # --zot Z # def getopts(*args) argv = Array === args.first ? args.shift : default_argv single_options, *long_options = *args result = {} single_options.scan(/(.)(:)?/) do |opt, val| if val result[opt] = nil define("-#{opt} VAL") else result[opt] = false define("-#{opt}") end end if single_options long_options.each do |arg| arg, desc = arg.split(';', 2) opt, val = arg.split(':', 2) if val result[opt] = val.empty? ? nil : val define("--#{opt}=#{result[opt] || "VAL"}", *[desc].compact) else result[opt] = false define("--#{opt}", *[desc].compact) end end parse_in_order(argv, result.method(:[]=)) result end # # See #getopts. # def self.getopts(*args) new.getopts(*args) end # # Traverses @stack, sending each element method +id+ with +args+ and # +block+. # def visit(id, *args, &block) # :nodoc: @stack.reverse_each do |el| el.__send__(id, *args, &block) end nil end private :visit # # Searches +key+ in @stack for +id+ hash and returns or yields the result. # def search(id, key) # :nodoc: block_given = block_given? visit(:search, id, key) do |k| return block_given ? yield(k) : k end end private :search # # Completes shortened long style option switch and returns pair of # canonical switch and switch descriptor Gem::OptionParser::Switch. # # +typ+:: Searching table. # +opt+:: Searching key. # +icase+:: Search case insensitive if true. # +pat+:: Optional pattern for completion. # def complete(typ, opt, icase = false, *pat) # :nodoc: if pat.empty? search(typ, opt) {|sw| return [sw, opt]} # exact match or... end ambiguous = catch(:ambiguous) { visit(:complete, typ, opt, icase, *pat) {|o, *sw| return sw} } exc = ambiguous ? AmbiguousOption : InvalidOption raise exc.new(opt, additional: self.method(:additional_message).curry[typ]) end private :complete # # Returns additional info. # def additional_message(typ, opt) return unless typ and opt and defined?(DidYouMean::SpellChecker) all_candidates = [] visit(:get_candidates, typ) do |candidates| all_candidates.concat(candidates) end all_candidates.select! {|cand| cand.is_a?(String) } checker = DidYouMean::SpellChecker.new(dictionary: all_candidates) DidYouMean.formatter.message_for(all_candidates & checker.correct(opt)) end def candidate(word) list = [] case word when '-' long = short = true when /\A--/ word, arg = word.split(/=/, 2) argpat = Completion.regexp(arg, false) if arg and !arg.empty? long = true when /\A-/ short = true end pat = Completion.regexp(word, long) visit(:each_option) do |opt| next unless Switch === opt opts = (long ? opt.long : []) + (short ? opt.short : []) opts = Completion.candidate(word, true, pat, &opts.method(:each)).map(&:first) if pat if /\A=/ =~ opt.arg opts.map! {|sw| sw + "="} if arg and CompletingHash === opt.pattern if opts = opt.pattern.candidate(arg, false, argpat) opts.map!(&:last) end end end list.concat(opts) end list end # # Loads options from file names as +filename+. Does nothing when the file # is not present. Returns whether successfully loaded. # # +filename+ defaults to basename of the program without suffix in a # directory ~/.options, then the basename with '.options' suffix # under XDG and Haiku standard places. # # The optional +into+ keyword argument works exactly like that accepted in # method #parse. # def load(filename = nil, into: nil) unless filename basename = File.basename($0, '.*') return true if load(File.expand_path(basename, '~/.options'), into: into) rescue nil basename << ".options" return [ # XDG ENV['XDG_CONFIG_HOME'], '~/.config', *ENV['XDG_CONFIG_DIRS']&.split(File::PATH_SEPARATOR), # Haiku '~/config/settings', ].any? {|dir| next if !dir or dir.empty? load(File.expand_path(basename, dir), into: into) rescue nil } end begin parse(*File.readlines(filename, chomp: true), into: into) true rescue Errno::ENOENT, Errno::ENOTDIR false end end # # Parses environment variable +env+ or its uppercase with splitting like a # shell. # # +env+ defaults to the basename of the program. # def environment(env = File.basename($0, '.*')) env = ENV[env] || ENV[env.upcase] or return require 'shellwords' parse(*Shellwords.shellwords(env)) end # # Acceptable argument classes # # # Any string and no conversion. This is fall-back. # accept(Object) {|s,|s or s.nil?} accept(NilClass) {|s,|s} # # Any non-empty string, and no conversion. # accept(String, /.+/m) {|s,*|s} # # Ruby/C-like integer, octal for 0-7 sequence, binary for 0b, hexadecimal # for 0x, and decimal for others; with optional sign prefix. Converts to # Integer. # decimal = '\d+(?:_\d+)*' binary = 'b[01]+(?:_[01]+)*' hex = 'x[\da-f]+(?:_[\da-f]+)*' octal = "0(?:[0-7]+(?:_[0-7]+)*|#{binary}|#{hex})?" integer = "#{octal}|#{decimal}" accept(Integer, %r"\A[-+]?(?:#{integer})\z"io) {|s,| begin Integer(s) rescue ArgumentError raise Gem::OptionParser::InvalidArgument, s end if s } # # Float number format, and converts to Float. # float = "(?:#{decimal}(?=(.)?)(?:\\.(?:#{decimal})?)?|\\.#{decimal})(?:E[-+]?#{decimal})?" floatpat = %r"\A[-+]?#{float}\z"io accept(Float, floatpat) {|s,| s.to_f if s} # # Generic numeric format, converts to Integer for integer format, Float # for float format, and Rational for rational format. # real = "[-+]?(?:#{octal}|#{float})" accept(Numeric, /\A(#{real})(?:\/(#{real}))?\z/io) {|s, d, f, n,| if n Rational(d, n) elsif f Float(s) else Integer(s) end } # # Decimal integer format, to be converted to Integer. # DecimalInteger = /\A[-+]?#{decimal}\z/io accept(DecimalInteger, DecimalInteger) {|s,| begin Integer(s, 10) rescue ArgumentError raise Gem::OptionParser::InvalidArgument, s end if s } # # Ruby/C like octal/hexadecimal/binary integer format, to be converted to # Integer. # OctalInteger = /\A[-+]?(?:[0-7]+(?:_[0-7]+)*|0(?:#{binary}|#{hex}))\z/io accept(OctalInteger, OctalInteger) {|s,| begin Integer(s, 8) rescue ArgumentError raise Gem::OptionParser::InvalidArgument, s end if s } # # Decimal integer/float number format, to be converted to Integer for # integer format, Float for float format. # DecimalNumeric = floatpat # decimal integer is allowed as float also. accept(DecimalNumeric, floatpat) {|s, f| begin if f Float(s) else Integer(s) end rescue ArgumentError raise Gem::OptionParser::InvalidArgument, s end if s } # # Boolean switch, which means whether it is present or not, whether it is # absent or not with prefix no-, or it takes an argument # yes/no/true/false/+/-. # yesno = CompletingHash.new %w[- no false].each {|el| yesno[el] = false} %w[+ yes true].each {|el| yesno[el] = true} yesno['nil'] = false # should be nil? accept(TrueClass, yesno) {|arg, val| val == nil or val} # # Similar to TrueClass, but defaults to false. # accept(FalseClass, yesno) {|arg, val| val != nil and val} # # List of strings separated by ",". # accept(Array) do |s, | if s s = s.split(',').collect {|ss| ss unless ss.empty?} end s end # # Regular expression with options. # accept(Regexp, %r"\A/((?:\\.|[^\\])*)/([[:alpha:]]+)?\z|.*") do |all, s, o| f = 0 if o f |= Regexp::IGNORECASE if /i/ =~ o f |= Regexp::MULTILINE if /m/ =~ o f |= Regexp::EXTENDED if /x/ =~ o k = o.delete("imx") k = nil if k.empty? end Regexp.new(s || all, f, k) end # # Exceptions # # # Base class of exceptions from Gem::OptionParser. # class ParseError < RuntimeError # Reason which caused the error. Reason = 'parse error' def initialize(*args, additional: nil) @additional = additional @arg0, = args @args = args @reason = nil end attr_reader :args attr_writer :reason attr_accessor :additional # # Pushes back erred argument(s) to +argv+. # def recover(argv) argv[0, 0] = @args argv end def self.filter_backtrace(array) unless $DEBUG array.delete_if(&%r"\A#{Regexp.quote(__FILE__)}:"o.method(:=~)) end array end def set_backtrace(array) super(self.class.filter_backtrace(array)) end def set_option(opt, eq) if eq @args[0] = opt else @args.unshift(opt) end self end # # Returns error reason. Override this for I18N. # def reason @reason || self.class::Reason end def inspect "#<#{self.class}: #{args.join(' ')}>" end # # Default stringizing method to emit standard error message. # def message "#{reason}: #{args.join(' ')}#{additional[@arg0] if additional}" end alias to_s message end # # Raises when ambiguously completable string is encountered. # class AmbiguousOption < ParseError const_set(:Reason, 'ambiguous option') end # # Raises when there is an argument for a switch which takes no argument. # class NeedlessArgument < ParseError const_set(:Reason, 'needless argument') end # # Raises when a switch with mandatory argument has no argument. # class MissingArgument < ParseError const_set(:Reason, 'missing argument') end # # Raises when switch is undefined. # class InvalidOption < ParseError const_set(:Reason, 'invalid option') end # # Raises when the given argument does not match required format. # class InvalidArgument < ParseError const_set(:Reason, 'invalid argument') end # # Raises when the given argument word can't be completed uniquely. # class AmbiguousArgument < InvalidArgument const_set(:Reason, 'ambiguous argument') end # # Miscellaneous # # # Extends command line arguments array (ARGV) to parse itself. # module Arguable # # Sets Gem::OptionParser object, when +opt+ is +false+ or +nil+, methods # Gem::OptionParser::Arguable#options and Gem::OptionParser::Arguable#options= are # undefined. Thus, there is no ways to access the Gem::OptionParser object # via the receiver object. # def options=(opt) unless @optparse = opt class << self undef_method(:options) undef_method(:options=) end end end # # Actual Gem::OptionParser object, automatically created if nonexistent. # # If called with a block, yields the Gem::OptionParser object and returns the # result of the block. If an Gem::OptionParser::ParseError exception occurs # in the block, it is rescued, a error message printed to STDERR and # +nil+ returned. # def options @optparse ||= Gem::OptionParser.new @optparse.default_argv = self block_given? or return @optparse begin yield @optparse rescue ParseError @optparse.warn $! nil end end # # Parses +self+ destructively in order and returns +self+ containing the # rest arguments left unparsed. # def order!(&blk) options.order!(self, &blk) end # # Parses +self+ destructively in permutation mode and returns +self+ # containing the rest arguments left unparsed. # def permute!() options.permute!(self) end # # Parses +self+ destructively and returns +self+ containing the # rest arguments left unparsed. # def parse!() options.parse!(self) end # # Substitution of getopts is possible as follows. Also see # Gem::OptionParser#getopts. # # def getopts(*args) # ($OPT = ARGV.getopts(*args)).each do |opt, val| # eval "$OPT_#{opt.gsub(/[^A-Za-z0-9_]/, '_')} = val" # end # rescue Gem::OptionParser::ParseError # end # def getopts(*args) options.getopts(self, *args) end # # Initializes instance variable. # def self.extend_object(obj) super obj.instance_eval {@optparse = nil} end def initialize(*args) super @optparse = nil end end # # Acceptable argument classes. Now contains DecimalInteger, OctalInteger # and DecimalNumeric. See Acceptable argument classes (in source code). # module Acceptables const_set(:DecimalInteger, Gem::OptionParser::DecimalInteger) const_set(:OctalInteger, Gem::OptionParser::OctalInteger) const_set(:DecimalNumeric, Gem::OptionParser::DecimalNumeric) end end # ARGV is arguable by Gem::OptionParser ARGV.extend(Gem::OptionParser::Arguable) ```
Jaroslav Machač (born 1926) is a former international speedway rider from Czechoslovakia. Speedway career Machač reached the final of the Speedway World Team Cup in the 1960 Speedway World Team Cup. He was champion of Czechoslovakia in 1960 after winning the Czechoslovakian Championship and reached two European Longtrack Championship finals in 1960 and 1969. World final appearances World Team Cup 1960 - Göteborg, Ullevi (with František Richter / Luboš Tomíček Sr. / Antonín Kasper Sr. / Bohumír Bartoněk) - 3rd - 15pts (4) Individual Ice Speedway World Championship 1969 - Inzell, 7th - 8pts 1970 - Nässjö, 10th - 6pts References 1926 births Czech speedway riders Living people
```xml <?xml version="1.0" encoding="UTF-8"?> <phpunit backupGlobals="false" backupStaticAttributes="false" bootstrap="bootstrap/autoload.php" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false"> <testsuites> <testsuite name="Application Test Suite"> <directory>./tests/</directory> </testsuite> </testsuites> <filter> <whitelist> <directory suffix=".php">app/</directory> </whitelist> </filter> <php> <env name="APP_ENV" value="testing"/> <env name="CACHE_DRIVER" value="file"/> <env name="DB_CONNECTION" value="sqlite" /> <env name="DB_DATABASE" value=":memory:"/> <env name="SESSION_DRIVER" value="file"/> <env name="QUEUE_DRIVER" value="sync"/> </php> </phpunit> ```
```javascript const arrowRight = ( <svg width="6" height="6" viewBox="0 0 5 6" xmlns="path_to_url" fill="#808080" > <path d="M0 0l5 3-5 3" fillRule="evenodd" /> </svg> ); const arrowDown = ( <svg width="6" height="6" viewBox="0 0 6 5" xmlns="path_to_url" fill="#808080" > <path d="M6 0L3 5 0 0" fillRule="evenodd" /> </svg> ); class SoftwareItem extends React.Component { constructor(props) { super(props); this.state = { open: false }; } render() { const { pkg } = this.props; const { open } = this.state; return ( <li> {open && arrowDown} {!open && arrowRight} <span onClick={() => { this.setState({ open: !open }); }} > {pkg.name} </span> {open && <p>{pkg.description}</p>} <style jsx>{` span { margin-left: 8px; } p { margin: 8px 0; line-height: 1.4; font-size: 12px; color: rgba(0, 0, 0, 0.8); user-select: text; cursor: default; } li { margin: 8px 0; } li:hover span { color: #000; } `}</style> </li> ); } } export default SoftwareItem; ```
```haskell module Pos.Chain.Block.IsHeader ( IsHeader , IsGenesisHeader , IsMainHeader (..) ) where import Control.Lens (Lens') import Pos.Chain.Block.HasPrevBlock (HasPrevBlock (..)) import Pos.Chain.Block.Header (BlockHeader, GenesisBlockHeader, HasHeaderHash (..), MainBlockHeader, mainHeaderLeaderKey, mainHeaderSlot) import Pos.Chain.Update.BlockVersion (HasBlockVersion (..)) import Pos.Chain.Update.SoftwareVersion (HasSoftwareVersion (..)) import Pos.Core.Common (HasDifficulty (..)) import Pos.Core.Slotting (HasEpochIndex (..), HasEpochOrSlot (..), SlotId (..)) import Pos.Crypto (PublicKey) import Pos.Util.Some (Some, applySome, liftLensSome) your_sha256_hash------------ -- IsHeader your_sha256_hash------------ {- | A class that lets subpackages use some fields from headers without depending on cardano-sl: * 'difficultyL' * 'epochIndexL' * 'epochOrSlotG' * 'prevBlockL' * 'headerHashG' -} class ( HasDifficulty header , HasEpochIndex header , HasEpochOrSlot header , HasPrevBlock header , HasHeaderHash header) => IsHeader header instance HasDifficulty (Some IsHeader) where difficultyL = liftLensSome difficultyL instance HasEpochIndex (Some IsHeader) where epochIndexL = liftLensSome epochIndexL instance HasEpochOrSlot (Some IsHeader) where getEpochOrSlot = applySome getEpochOrSlot instance HasPrevBlock (Some IsHeader) where prevBlockL = liftLensSome prevBlockL instance HasHeaderHash (Some IsHeader) where headerHash = applySome headerHash instance IsHeader (Some IsHeader) instance IsHeader BlockHeader instance IsHeader MainBlockHeader instance IsHeader GenesisBlockHeader your_sha256_hash------------ -- IsGenesisHeader your_sha256_hash------------ -- | A class for genesis headers. class IsHeader header => IsGenesisHeader header instance HasDifficulty (Some IsGenesisHeader) where difficultyL = liftLensSome difficultyL instance HasEpochIndex (Some IsGenesisHeader) where epochIndexL = liftLensSome epochIndexL instance HasEpochOrSlot (Some IsGenesisHeader) where getEpochOrSlot = applySome getEpochOrSlot instance HasPrevBlock (Some IsGenesisHeader) where prevBlockL = liftLensSome prevBlockL instance HasHeaderHash (Some IsGenesisHeader) where headerHash = applySome headerHash instance IsHeader (Some IsGenesisHeader) instance IsGenesisHeader (Some IsGenesisHeader) instance IsGenesisHeader GenesisBlockHeader your_sha256_hash------------ -- IsMainHeader your_sha256_hash------------ {- | A class for main headers. In addition to 'IsHeader', provides: * 'headerSlotL' * 'headerLeaderKeyL' * 'blockVersionL' * 'softwareVersionL' -} class (IsHeader header ,HasBlockVersion header ,HasSoftwareVersion header) => IsMainHeader header where -- | Id of the slot for which this block was generated. headerSlotL :: Lens' header SlotId -- | Public key of slot leader. headerLeaderKeyL :: Lens' header PublicKey instance HasDifficulty (Some IsMainHeader) where difficultyL = liftLensSome difficultyL instance HasEpochIndex (Some IsMainHeader) where epochIndexL = liftLensSome epochIndexL instance HasEpochOrSlot (Some IsMainHeader) where getEpochOrSlot = applySome getEpochOrSlot instance HasPrevBlock (Some IsMainHeader) where prevBlockL = liftLensSome prevBlockL instance HasHeaderHash (Some IsMainHeader) where headerHash = applySome headerHash instance HasBlockVersion (Some IsMainHeader) where blockVersionL = liftLensSome blockVersionL instance HasSoftwareVersion (Some IsMainHeader) where softwareVersionL = liftLensSome softwareVersionL instance IsHeader (Some IsMainHeader) instance IsMainHeader (Some IsMainHeader) where headerSlotL = liftLensSome headerSlotL headerLeaderKeyL = liftLensSome headerLeaderKeyL instance IsMainHeader MainBlockHeader where headerSlotL = mainHeaderSlot headerLeaderKeyL = mainHeaderLeaderKey ```
The View may refer to: Television The View (talk show), an American morning talk show on ABC, broadcast since 1997 The View (Irish TV programme), an Irish television arts programme, broadcast from 1999 to 2011 Music The View (album), a 1993 album by Chad Wackerman The View (band), a Scottish indie rock band "The View" (song), a 2011 song by Lou Reed and Metallica The View, a 1999 album by Eureka Farm The View, a 2003 EP by Immaculate Machine "The View", a 2004 song by Modest Mouse from Good News for People Who Love Bad News "The View", a 2019 song by Sara Evans and the Barker Family Band from The Barker Family Band "The View", a 2021 song by Stray Kids from Noeasy See also View (disambiguation)
Nyang'oma Kogelo, also known as Kogelo, is a village in Siaya County, Kenya. It is located near the equator, 60 kilometres (37 mi) west-northwest of Kisumu, the former Nyanza provincial capital. The population of Nyangoma-Kogelo is 3,648. Services Nyang'oma Kogelo is a typical rural Kenyan village with most residents relying on small-scale farming as their main source of income. The village has a commercial centre with various shops and a bar offering shopping and recreation to the populace. The villagers practice different religions and coexist peacefully. Nevertheless, in 2009, the Nyang'oma Seventh-day Adventist Church was involved in the attempted conversion of Barack Obama's step-grandmother Sarah Obama to Christianity. Following counsel from her family, she opted out of the arranged public conversion and baptism and remained a Muslim. The village has a primary school (Senator Obama Primary School) and a high school (Senator Obama Secondary School). The land for both schools was donated by Barack Obama Sr., a native of the village, and they were renamed in 2006 after his son Barack — then a United States senator. There is also a health centre. Prior to the 2008 US presidential election, the village had no electricity, but was connected to the national grid immediately following Obama's victory, owing to the consequent rise in interest in the village. The village also saw its first Kenya Police post set up in the wake of the election outcome. Transport The village is along the unpaved C28 road between Ng'iya and Ndori junctions. Less than 10 kilometres north of Kogelo, Ngiya is located along the Kisumu - Siaya road (C30 road). Few kilometres south of Nyang'oma Kogelo, a bridge built in 1930 crosses the Yala River flowing to Lake Victoria, before the road reaches Ndori along the Kisumu - Bondo road (C27 road). Kogelo is a road distance of 882 kilometres (548 miles) west of Mombasa. Administration Nyang'oma Kogelo is part of South East Alego electoral ward of Siaya County Council and Alego Constituency. Following the 2007 civic elections, the local councillor is Julius Okeyo Omedo of Orange Democratic Movement. South East Alego is also an administrative location in the Karemo division of Siaya district. The location has a population of 17,294. As of 2008, the chief of the location is James Ojwang' Obalo, whose office is located next to the Nyang'oma Kogelo shopping centre. History Nyang'oma Kogelo is the home of the immigrant ancestors of the family of Barack Obama, the 44th president of the United States. They have resided in the village since colonial times. Obama fame Since 2006, the village has received international attention because it is the hometown of Barack Obama Sr. (d. 1982), the father of former United States President Barack Obama. Barack Obama Sr. is buried in the village. Some of their family members still live in the village. His paternal step-grandmother Sarah Onyango Obama lived there until her death in March 2021. Because of its connection with the former American president, the village is expected to be visited by many tourists from the US and other countries. The Kenyan government is promoting it as a tourist attraction of western Kenya. An Obama-themed museum was to be built by the Kenyan government and opened in the village in 2009. A Nairobi-based cultural organisation will build the Dero Kogelo Library and Cultural Centre in the village. Obama visited the village in July 2018. References External links www.kogelo.co.ke Siaya County Populated places in Nyanza Province
In mathematics, a locally cyclic group is a group (G, *) in which every finitely generated subgroup is cyclic. Some facts Every cyclic group is locally cyclic, and every locally cyclic group is abelian. Every finitely-generated locally cyclic group is cyclic. Every subgroup and quotient group of a locally cyclic group is locally cyclic. Every homomorphic image of a locally cyclic group is locally cyclic. A group is locally cyclic if and only if every pair of elements in the group generates a cyclic group. A group is locally cyclic if and only if its lattice of subgroups is distributive . The torsion-free rank of a locally cyclic group is 0 or 1. The endomorphism ring of a locally cyclic group is commutative. Examples of locally cyclic groups that are not cyclic Examples of abelian groups that are not locally cyclic The additive group of real numbers (R, +); the subgroup generated by 1 and (comprising all numbers of the form a + b) is isomorphic to the direct sum Z + Z, which is not cyclic. References . . Abelian group theory Properties of groups
The 51st Yasar Dogu Tournament 2023, is a wrestling event will be held in Istanbul, Turkey between 23 and 25 June 2023 together with the 2023 Vehbi Emre & Hamit Kaplan Tournament. The international tournament included competition in both men's and women's freestyle wrestling. The tournament was held in honor of the two time Olympic Champion, Yaşar Doğu. Competition schedule All times are (UTC+3) Medal table Team ranking Medal overview Men's freestyle Women's freestyle Participating nations 131 competitors from 12 nations participated: (12) (2) (9) (10) (1) (18) (7) (1) (1) (1) (1) (68) Results Men's freestyle Men's freestyle 57 kg F — Won by fall WO — Won by walkover Men's freestyle 61 kg F — Won by fall Men's freestyle 65 kg F — Won by fall Men's freestyle 70 kg F — Won by fall Men's freestyle 74 kg F — Won by fall Men's freestyle 79 kg F — Won by fall Men's freestyle 86 kg Legend F — Won by fall Men's freestyle 92 kg 24 June Men's freestyle 97 kg F — Won by fall Men's freestyle 125 kg 24 June Women's freestyle Women's freestyle 50 kg 23 June Women's freestyle 53 kg 25 June Women's freestyle 55 kg 23 June Women's freestyle 57 kg 24 June Women's freestyle 59 kg 23 June Women's freestyle 62 kg 23 June Women's freestyle 65 kg 23 June Women's freestyle 68 kg 25 June Women's freestyle 76 kg 24 June References External links UWW Database Turkish Wrestling Federation Results Book Yasar Dogu Yasar Dogu Tournament Sports competitions in Istanbul International wrestling competitions hosted by Turkey Yaşar Doğu Tournament Yasar Dogu Tournament
Propeller head may refer to: Propeller beanie, a seamed cap with a decorative propeller on top. Propellerheads, a British big beat musical ensemble, formed in 1995. An alternate term for a propeller hub, the part of a ship or aircraft propeller where the blades attach.
David M. Hale (born June 18, 1981) is an American former professional ice hockey player. He played for the New Jersey Devils, Calgary Flames, Phoenix Coyotes, Tampa Bay Lightning and Ottawa Senators over an eight-year National Hockey League (NHL) career. Hale is noteworthy for holding the record for most games needed to score his first NHL goal, with it taking him 231 games, scoring it in his 6th professional season. Playing career Hale, a Colorado Springs native, played high school hockey for Coronado High School before joining Sioux City Musketeers of the USHL. He was drafted from the Musketeers in the first round, 22nd overall by the New Jersey Devils in the 2000 NHL Entry Draft before joining the University of North Dakota to play collegiate hockey in the Western Collegiate Hockey Association. Hale made his NHL debut on October 8, 2003. On February 27, 2007, Hale was traded by the Devils, along with a 2007 fifth-round draft pick, to the Calgary Flames for a 2007 third-round draft pick. On July 3, 2008, Hale, a free agent, signed with the Phoenix Coyotes on a two-year deal. During the 2008–09 season on November 26, 2008, Hale scored his first NHL goal in a 3–2 victory against the Columbus Blue Jackets. Hale scored in his 231st game, setting a record for the longest start to an NHL career without a goal. On July 21, 2009, Hale was traded by the Coyotes, along with Todd Fedoruk, to the Tampa Bay Lightning for Radim Vrbata. Used as a depth defenseman Hale played sparingly in 35 games, before he was reassigned to AHL affiliate, the Norfolk Admirals, on a conditioning assignment. In his last game with the Admirals, Hale broke his foot and returned to Tampa to play in just 4 more games to end the 2009–10 season. On August 4, 2010, Hale signed a one-year contract with the Ottawa Senators. Hale split the season between Ottawa and their AHL team, the Binghamton Senators. Hale finished the season with Ottawa, and did not take part in Binghamton's Calder Cup playoff run. On October 15, 2011, Hale officially announced his retirement from hockey. On June 26, 2013, Hale signed with Italian team HC Appiano, in the semi-pro Inter-National League. Career statistics Regular season and playoffs International Awards and honors References External links 1981 births Living people Albany River Rats players American men's ice hockey defensemen Binghamton Senators players Calgary Flames players Ice hockey players from Colorado Lowell Devils players National Hockey League first-round draft picks New Jersey Devils draft picks New Jersey Devils players Norfolk Admirals players Ottawa Senators players Phoenix Coyotes players Sioux City Musketeers players Sportspeople from Colorado Springs, Colorado Tampa Bay Lightning players North Dakota Fighting Hawks men's ice hockey players
Orange and Lemons is a Filipino pop rock band founded and formed in 1999 by lead vocalist and guitarist Clem Castro along with Ace and JM del Mundo. Former member, Mcoy Fundales served as the lead vocalist and guitarist since its formation until its last reception in 2007. The group's musical genre's been a mix of alternative rock, indie pop and experimental music and heavily influenced by several well-respected bands in different generations like The Smiths, The Beatles and the Eraserheads. The band had released three several albums and gained commercial success with their sophomore album Strike Whilst the Iron is Hot released in 2005. The group parted ways in 2007 due to musical differences. Following the band's break up several members formed their own groups. Mcoy Fundales formed Kenyo alongside JM and Ace del Mundo. While, Clem formed his own indie group The Camerawalls with the band's original member, Law Santiago. In 2017, after 10 years on hiatus, the band announced that they would reunite as a trio, and later as a quartet when keyboardist Jared Nerona joined. History The band name "Oranges and Lemons" was initially recommended by a former member of the group. Apparently the band was not aware at the time that the name was actually derived from a British nursery rhyme and a title of an album by the British band XTC. Clem Castro and Mcoy Fundales met in high school in the mid-1990s. The duo formed a group with friends (with Law Santiago and Michael Salvador) from their province of Bulacan and went through several names such before eventually settling on Orange and Lemons. Brothers Ace and JM del Mundo were in a band called Colossal Youth when they met Castro and Fundales in a local bar in Bulacan in 1999. Castro and Fundales with two other friends were handled by Roldan "Bong" Baluyot of No Seat Affair (a local management, booking and production outfit) when they recorded a two-track demo ("She's Leaving Home", "Isang Gabi") in 1999 as Orange and Lemons. The song "She's Leaving Home" soon found its way to radio station NU107.5 FM's playlist. The band went on hiatus in 2000, but was reformed in 2003 with the del Mundos in the line-up permanently.They started arranging and rehearsing original songs that would eventually end up in their debut album, Love in the Land of Rubber Shoes and Dirty Ice Cream. which was released on December 3, 2003 With a style of retro music combined with alternative rock, the band's main musical influences ranged from The Beatles and The Smiths, to The Cure and Eraserheads. Castro and Fundales contacted Bong Baluyot to once again handle the band and ten songs were recorded in three days due to a limited financial budget. After the songs were recorded, Baluyot once again started scouting around for a label that would take the group in. The band had their first gig stint in a club in Makati City called Where Else? It was in one of those gigs that ONL met Toti Dalmacion, formerly of Groove Nation, a local music store famous for rare and hard-to-find vinyl records. Dalmacion was already toying with the idea of establishing an independent label that he would call Terno Recordings. The label would showcase unsigned and talented Filipino artists with a unique sound and style that could (hopefully) pass international standards. He proposed that ONL be the flagship artist for the label. A one-album deal was signed. ONL's 10-track debut album, Love in the Land of Rubber Shoes and Dirty Ice Cream was independently released and launched in December 2003. The album's single "(Just Like) A Splendid Love Song" got radio airplay on NU107.5 FM and reached the station's number 1 spot in their weekly countdown. Orange and Lemons was declared Best New Artist for 2004 in NU107's yearly Rock Awards event. ONL signed a contract with Universal Records in October 2004. The band proceeded to record a new album; their second and first under a major label. Strike Whilst The Iron Is Hot was completed and released in April 28, 2005, with singles including "Hanggang Kailan (Umuwi Ka Na Baby)" release in April 1, 2005, "Heaven Knows (This Angel Has Flown)" released on September 16, 2005, and "Lihim". One of the band's biggest breaks came with an offer from Philippine media giant ABS-CBN for ONL to do the jingle/soundtrack for a new series Pinoy Big Brother, the Philippine franchised version of the reality TV show Big Brother. ONL came up with a song called "Pinoy Ako" released on September 2, 2005. Other projects of the band included "Abot Kamay" (a song for a shampoo advertisement) and "Blue Moon" (their version of the classic track for a movie theme song). In June 2005, Orange and Lemons was featured on MTV Philippines in its Rising Star segment, and in March 2006 they were featured in the "Lokal Artist of the Month" segment. Orange and Lemons were named "Artist of the Year" at the NU107's Rock Awards for 2005. The release of the tribute album of the Apo Hiking Society, Kami nAPO Muna in 2006, where the band contributed one track, gave Orange and Lemons the spotlight again. Orange and Lemons once again did their take on yet another Apo song "Tuloy na Tuloy Pa Rin Ang Pasko" by December 2006. The song was used by ABS-CBN for their Christmas station ID. As a follow-up to "Abot Kamay", the band completed a song from Unilever Philippines called "Let Me" and was used for another shampoo advertisement. Universal Records released their third and last album on June 8, 2007 called Moonlane Gardens. Their first single in that album was "Ang Katulad Mong Walang Katulad" and their last single before they disbanded was "Fade". Break-up It was reported on October 10, 2007 by the Inquirer.net that Orange and Lemons had disbanded. The reason stated was primarily due to differences between band members and their managers. Clem Castro, the then lead guitarist of the band, then started his own band, 3-piece indie pop group The Camerawalls signed under his own label, Lilystars Records. He formed the band with original Orange and Lemons bassist Law. The three remaining band members formed a new band called Kenyo. Reuniting In July 2017, after 10 years on hiatus, the band announced on its official Facebook page that they were going to reform as a trio, involving Clem Castro on vocals and lead guitars, JM del Mundo on bass guitar, and Ace del Mundo on drums. In August 2018, the band headlined Moonlane Festival, a concert that it also produced. On February 10, the band's label Lilystars Records announced via Twitter that the band would be recording and releasing a new album in 2021, their first release in fourteen years. Controversies Allegations have been made that the melody and musical arrangement of the band's breakout single "Pinoy Ako", also used as a theme song in the reality show Pinoy Big Brother, was stolen from an obscure single, "Chandeliers" by the 1980s English new wave band Care. It was later on found out that the allegations were somehow true since the song and Care's were very similar, with the tune imitated all throughout song. Band members Current members Clementine "Clem" Castro - lead vocals, lead guitar (1999–2007, 2017–present) JM del Mundo - bass guitar (2001–2007, 2017–present); backing vocals (2017–present) Ace del Mundo - drums (2001–2007, 2017–present); backing vocals (2017–present) Jared Nerona - keyboards (2018–present) Early members Mcoy Fundales - co-lead vocals, rhythm and acoustic guitar (1999–2007) Law Santiago - bass guitar (1999–2001) Michael Salvador - drums (1999–2001) Discography Albums Love in the Land of Rubber Shoes and Dirty Ice Cream (Terno Recordings, 2003) Strike Whilst the Iron Is Hot (Universal Records, 2005) (repackaged edition release in October 25, 2005) Moonlane Gardens (Universal Records, 2007) Love in the Land of Rubber Shoes and Dirty Ice Cream - 15th Anniversary Edition (Lilystars Records, 2018) La Bulaqueña (Lilystars Records, 2022) Singles "Hanggang Kailan" (Universal Records, 2005) "Pinoy Ako" (Universal Records, 2005) (covered by Rico Blanco for Pinoy Big Brother: Kumunity Season 10) "Lovers Go, Lovers Come" (Lilystars Records, 2017) "Pag-Ibig sa Tabing Dagat" (Lilystars Records, 2019) "Ikaw ang Aking Tahanan" (Lilystars Records, 2019) "Yakapin Natin ang Gabi" (Lilystars Records, 2021) Tribute album appearances Ultraelectromagneticjam! - a tribute to Eraserheads ("Huwag Kang Matakot") (2005) Kami nAPO Muna - a tribute to APO Hiking Society ("Yakap sa Dilim") (2006) Christmas album appearances Not Another Christmas Album - JAM 88.3 ("Christmas Daydreams") (2004) OPM Gold Christmas Album ("Tuloy na Tuloy Pa Rin ang Pasko") (2006) Close Up Season of Smiles ("God Rest Ye Merry Gentlemen") (2006) Other appearances NU 107 Super Size Rock (Warner Music Philippines, 2004) Jack Lives Here (2004) Pinoy Ako (Star Music, 2005) Super! The Biggest Opm Hits of the Year (2006) Musika sa Bahay ni Kuya: The Best of Pinoy Big Brother Hits (Star Music, 2008) i-Star 15: The Best of Inspirational Songs (Star Music, 2010) Super Astig Hits (Universal Records, 2016) Awards and nominations References Filipino rock music groups Musical groups established in 1999 Musical groups disestablished in 2007 Musical groups reestablished in 2010 Musical groups disestablished in 2010 Musical groups reestablished in 2017 1999 establishments in the Philippines
```python #!/usr/bin/env python from __future__ import division, print_function, absolute_import from os.path import join def configuration(parent_package='',top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration('stats', parent_package, top_path) config.add_data_dir('tests') statlib_src = [join('statlib', '*.f')] config.add_library('statlib', sources=statlib_src) # add statlib module config.add_extension('statlib', sources=['statlib.pyf'], f2py_options=['--no-wrap-functions'], libraries=['statlib'], depends=statlib_src ) # add vonmises_cython module config.add_extension('vonmises_cython', sources=['vonmises_cython.c'], # FIXME: use cython source ) # add _rank module config.add_extension('_rank', sources=['_rank.c'], # FIXME: use cython source ) # add mvn module config.add_extension('mvn', sources=['mvn.pyf','mvndst.f'], ) return config if __name__ == '__main__': from numpy.distutils.core import setup setup(**configuration(top_path='').todict()) ```
Walter mac Thomas Bourke, 3rd Mac William Iochtar or Mac William Bourke, died 1440. Family background A son of Thomas mac Edmond Albanach de Burca. Annalistic references From the Annals of the Four Masters: M1401 (sic). Thomas, the son of Sir Edmond Albanagh Burke, i.e. Mac William, Lord of the English of Connaught, died, after the victory of penance. After the death of this Thomas Burke, two Mac Williams were made, namely, Ulick, the son of Richard Oge, who was elected the Mac William; and Walter, the son of Thomas, who was made another Mac William, but yielded submission to Mac William of Clanrickard for his seniority. References The History of Mayo, Hubert T. Knox, pp. 398–402, 1908. External links http://www.ucc.ie/celt/published/T100005D/ 13th-century Irish people People from County Mayo
```java /** * * This copyrighted material is made available to anyone wishing to use, modify, * copy, or redistribute it subject to the terms and conditions of the GNU * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * for more details. * * along with this distribution; if not, see <path_to_url */ package org.bytesoft.compensable; public class RemotingException extends RuntimeException { static final long serialVersionUID = 1L; public RemotingException() { super(); } public RemotingException(String message) { super(message); } public RemotingException(String message, Throwable cause) { super(message, cause); } } ```
The men's individual foil competition at the 2006 Asian Games in Doha was held on 9 December at the Al-Arabi Indoor Hall. Schedule All times are Arabia Standard Time (UTC+03:00) Results Legend DNS — Did not start Round of pools Pool 1 Pool 2 Pool 3 Pool 4 Summary Knockout round Final Top half Bottom half Final standing References Pools External links Official website Men foil
Fusion (also released as Something Else) is a double LP album by American jazz flautist Jeremy Steig released on the Groove Merchant label which reissues tracks recorded in 1970 and originally issued on Energy along with an additional LP of unreleased tracks from the session. Reception Allmusic's Jason Ankeny said: "Steig creates Technicolor grooves that float like butterflies and sting like bees. His music doesn't so much fuse jazz and rock as it approaches each side from the perspective of the other, exploring their respective concepts and executions to arrive at a sound all its own. If anything, the tonal restrictions of Steig's chosen instrument push him even farther into the unknown, employing a series of acoustic and electronic innovations to expand the flute's possibilities seemingly into the infinite. While some of the unissued content here is no less astounding, as a whole Fusion feels like too much of a good thing; one can't help but miss the focus and shape of Energy in its original incarnation". Track listing All compositions by Jan Hammer and Jeremy Steig except where noted "Home" − 4:39 Originally released on Energy "Cakes" − 4:52 Originally released on Energy "Swamp Carol" − 4:11 Originally released on Energy "Energy" (Hammer, Steig, Don Alias, Gene Perla) − 4:50 Originally released on Energy "Down Stretch" (Hammer) − 4:14 Originally released on Energy "Give Me Some" − 6:47 Originally released on Energy "Come with Me" − 8:02 Originally released on Energy "Dance of the Mind" (Alias, Steig) − 2:22 Originally released on Energy "Up Tempo Thing" − 5:23 Previously unreleased "Elephant Hump" − 5:54 Previously unreleased "Rock #6" (Hammer) − 3:03 Previously unreleased "Slow Blues in G" − 6:33 Previously unreleased "Rock #9" (Hammer) − 5:50 Previously unreleased "Rock #10" (Hammer) − 4:14 Previously unreleased "Something Else" − 7:02 Previously unreleased Personnel Jeremy Steig – flute, alto flute, bass flute, piccolo Jan Hammer − electric piano, Chinese gong Gene Perla − electric bass, electric upright bass Don Alias – drums, congas, clap drums, percussion Eddie Gómez − electric upright bass (tracks 5 & 7) References Groove Merchant albums Jeremy Steig albums 1972 albums Albums produced by Sonny Lester Albums recorded at Electric Lady Studios
```tex %!TEX TS-program = xelatex %!TEX encoding = UTF-8 Unicode \documentclass[11pt,tikz,border=1]{standalone} \usetikzlibrary{positioning} \begin{document} \begin{tikzpicture}[ neuron/.style={circle,draw,inner sep=0pt,minimum size=10mm}, font=\footnotesize ] \node(i) [neuron] {}; \node(o) [neuron,right=2 of i] {}; \draw[->] (i) -- node [above] { $\frac{\partial C}{\partial w} = a_{\rm in} \delta_{\rm out}$ } (o); \end{tikzpicture} \end{document} ```
```json5 { "Comment": "SQS_WAIT_FOR_TASK_TOKEN_CATCH", "StartAt": "SendMessageWithWait", "States": { "SendMessageWithWait": { "Type": "Task", "Resource": "arn:aws:states:::sqs:sendMessage.waitForTaskToken", "Parameters": { "QueueUrl.$": "$.QueueUrl", "MessageBody": { "Context.$": "$", "TaskToken.$": "$$.Task.Token" } }, "Catch": [ { "ErrorEquals": [ "States.Runtime" ], "ResultPath": "$.states_runtime_error", "Next": "CaughtRuntimeError" }, { "ErrorEquals": [ "States.ALL" ], "ResultPath": "$.states_all_error", "Next": "CaughtStatesALL" } ], "End": true }, "CaughtRuntimeError": { "Type": "Pass", "End": true }, "CaughtStatesALL": { "Type": "Pass", "End": true } } } ```
```go package sprig import ( "bytes" "encoding/json" "math/rand" "reflect" "strings" "time" ) func init() { rand.Seed(time.Now().UnixNano()) } // dfault checks whether `given` is set, and returns default if not set. // // This returns `d` if `given` appears not to be set, and `given` otherwise. // // For numeric types 0 is unset. // For strings, maps, arrays, and slices, len() = 0 is considered unset. // For bool, false is unset. // Structs are never considered unset. // // For everything else, including pointers, a nil value is unset. func dfault(d interface{}, given ...interface{}) interface{} { if empty(given) || empty(given[0]) { return d } return given[0] } // empty returns true if the given value has the zero value for its type. func empty(given interface{}) bool { g := reflect.ValueOf(given) if !g.IsValid() { return true } // Basically adapted from text/template.isTrue switch g.Kind() { default: return g.IsNil() case reflect.Array, reflect.Slice, reflect.Map, reflect.String: return g.Len() == 0 case reflect.Bool: return !g.Bool() case reflect.Complex64, reflect.Complex128: return g.Complex() == 0 case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: return g.Int() == 0 case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: return g.Uint() == 0 case reflect.Float32, reflect.Float64: return g.Float() == 0 case reflect.Struct: return false } } // coalesce returns the first non-empty value. func coalesce(v ...interface{}) interface{} { for _, val := range v { if !empty(val) { return val } } return nil } // all returns true if empty(x) is false for all values x in the list. // If the list is empty, return true. func all(v ...interface{}) bool { for _, val := range v { if empty(val) { return false } } return true } // any returns true if empty(x) is false for any x in the list. // If the list is empty, return false. func any(v ...interface{}) bool { for _, val := range v { if !empty(val) { return true } } return false } // fromJson decodes JSON into a structured value, ignoring errors. func fromJson(v string) interface{} { output, _ := mustFromJson(v) return output } // mustFromJson decodes JSON into a structured value, returning errors. func mustFromJson(v string) (interface{}, error) { var output interface{} err := json.Unmarshal([]byte(v), &output) return output, err } // toJson encodes an item into a JSON string func toJson(v interface{}) string { output, _ := json.Marshal(v) return string(output) } func mustToJson(v interface{}) (string, error) { output, err := json.Marshal(v) if err != nil { return "", err } return string(output), nil } // toPrettyJson encodes an item into a pretty (indented) JSON string func toPrettyJson(v interface{}) string { output, _ := json.MarshalIndent(v, "", " ") return string(output) } func mustToPrettyJson(v interface{}) (string, error) { output, err := json.MarshalIndent(v, "", " ") if err != nil { return "", err } return string(output), nil } // toRawJson encodes an item into a JSON string with no escaping of HTML characters. func toRawJson(v interface{}) string { output, err := mustToRawJson(v) if err != nil { panic(err) } return string(output) } // mustToRawJson encodes an item into a JSON string with no escaping of HTML characters. func mustToRawJson(v interface{}) (string, error) { buf := new(bytes.Buffer) enc := json.NewEncoder(buf) enc.SetEscapeHTML(false) err := enc.Encode(&v) if err != nil { return "", err } return strings.TrimSuffix(buf.String(), "\n"), nil } // ternary returns the first value if the last value is true, otherwise returns the second value. func ternary(vt interface{}, vf interface{}, v bool) interface{} { if v { return vt } return vf } ```
Loir-et-Cher (, ) is a department in the Centre-Val de Loire region of France. Its name is originated from two rivers which cross it, the Loir in its northern part and the Cher in its southern part. Its prefecture is Blois. The INSEE and La Poste gave it the number 41. It had a population of 329,470 in 2019. History The department of Loir-et-Cher covers a territory which had a substantial population during the prehistoric period. However it was not until the Middle Ages that local inhabitants built various castles and other fortifications to enable them to withstand a series of invasions of Normans, Burgundians, the English and others. The economy is quite flourishing: there are shops in the valley, and agriculture is prominent in the region of the Beauce and the Perche to the Sologne which were prosperous until the 17th century. However, politically, the region remained quartered between the neighboring earldoms and duchies. In 1397, the House of Orleans became the possession of the Comté of Blois. In 1497, Louis d’Orleans (23rd count hereditary of Blois) was crowned with the name of Louis XII. This marked the beginning of the importance of Blois and of the Blaisois in the politic life of the French, especially under the last Valois. During that period, kings and financiers competed to build castles and elegant abodes which now form an important part of the French national heritage. (Chambord, Blois, Cheverny and so on.) After that, there were religious wars which were extremely ferocious under Charles IX's reign. In 1576 and 1588, the General Estates convened in Blois. L’Orléanais, le Berry, la Touraine, le Perche et le Maine occupied le Loir-et-Cher and its provinces in 1790. The Loir-et-Cher's birth as a department was very difficult and laborious. On 29 September 1789, the constitution's advisory board made a report in which he wanted to attribute one of the 80 departments to Blois. However, some cities and canton capitals disagreed, such as Tours and Orleans. Inside of the department, Montrichard turns to Amboise and Tours, Saint-Aignan wants to turn to the Berry and Salbris to Vierzon. Finally, Orleans gave Blois an important part of the Sologne except Beaugency and Tours didn't give Amboise. The department was founded 4 March 1790, in accordance with the law of 22 December 1789. It is constituted of some old provinces of the Orleanais and of the Touraine along with a Berry's plot (left bank of the Selles en Berry's Cher which becomes Selles sur Cher, to Saint-Aignan). The department's constriction in its centre and the maximum stretching out in its surface area beyond the Loir on the North and the Cher on the South is due to these tribulations. After the victory of the Coalises during the Waterloo's battle (18 June 1815), the Prussian's troops occupied the department from June 1815 to November 1818. ( to learn more about it, go on to "France’s occupation at the end of the First Empire") The poet Pierre de Ronsard, the inventor Denis Papin, and the historian Augustin Thierry come from here. Other well-known people are also associated with this department, such as François the First, Gaston d’Orleans, the Marshall Maunoury, and the abbot Gregoire (Bishop of Blois, elected at the Constituante). In the artistic domain, there is the compositor Antoine Boesset (1587–1643), musician in the Louis XII de France's court, who was the head of the Music of the King's Bedroom from 1623 to 1643. The Loir-et-Cher's department is a part of the Centre Region. It is adjacent of these departments : the Eure-et-Loir, the Loiret, the Cher, the Indre, the Indre-et-Loire and the Sarthe. Due to its surface area of 6 343 km2, it is the 31st largest department in the nation. It has a privileged geographical situation because it is in the center of the Centre region and near the Paris basin. An axe lively and dynamic, brings Blois closer (the department's administrative center) to both the urban conglomerations near it: Orleans and Tours. Located on the boundaries of the Perche, the Beauce, the Sologne and the Touraine, it finds its territorial identity in the diversity of its geography and its landscapes. Cut in its middle by the Loire, it shows an image of balance and diversity. In 1989, American-based animators Andreas Deja, Glen Keane, and Tom Sito, and draftsmen Jean Gillmore, Thom Enriquez, and Hans Bacher launched an expedition to the chateau to do their research for the animated adaptation of "Beauty and the Beast". Geography Loir-et-Cher is a part of the modern region of Centre-Val de Loire. Adjacent departments are Eure-et-Loir to the north, Loiret to the north-east, Cher to the south-east, Indre to the south, Indre-et-Loire to the south-west, and Sarthe to the west. The department comprises 6,314 km2, which makes it the 31st largest of the French departments in terms of area. The line of the river Loire traverses the land, ensuring easy communication between its own capital, Blois, and the vibrant cultural and commercial centres of Tours to the west and the fringes of the Seine-Paris basin at Orléans to the east. Its main rivers are the Loire, on which its prefecture (capital) Blois is situated, the Loir and the Cher. Principal towns The most populous commune is Blois, the prefecture. As of 2019, there are 6 communes with more than 5,000 inhabitants: Demographics The inhabitants of the department are called the Loir-et-Chériens. Politics The president of the Departmental Council is Philippe Gouet (UDI), elected in July 2021. Current National Assembly Representatives Tourism Châteaux Loir-et-Cher has an important number of historic châteaux, including the following: Château de Blois Château de Chaumont Château de Chambord Château de Cheverny See also Cantons of the Loir-et-Cher department Communes of the Loir-et-Cher department Arrondissements of the Loir-et-Cher department References External links Prefecture website Departmental Council website 1790 establishments in France Departments of Centre-Val de Loire States and territories established in 1790
Batu Gong is a settlement in Sarawak, Malaysia. It lies approximately south-south-east of the state capital Kuching. Neighbouring settlements include: Kampung Endap north Kampung Kangka north Kampung Beradau northwest Siburan west References Populated places in Sarawak
Two-time defending champion Rafael Nadal defeated Dominic Thiem in a rematch of the previous year's final, 6–3, 5–7, 6–1, 6–1 to win the men's singles tennis title at the 2019 French Open. It was his record-extending twelfth French Open title and 18th major title overall. With the win, Nadal broke the all-time record for the most singles titles won by a player at the same major (previously shared with Margaret Court, who won the Australian Open eleven times). Novak Djokovic and Roger Federer were both attempting to achieve the first double career Grand Slam in men's singles in the Open Era, with Djokovic also in contention to achieve a second non-calendar year Grand Slam, but both lost in the semifinals (Djokovic to Thiem and Federer to Nadal). This was Federer's first time playing the French Open in four years. Federer's third round match marked his 400th major match, an all-time record. Federer also became the oldest man to reach the fourth round at Roland Garros since Nicola Pietrangeli in 1972, as well as the oldest semifinalist since the 40 year-old Pancho Gonzales in 1968. The first round match between Ivo Karlović (40 years and three months) and Feliciano López (37 years and 8 months) was the oldest French Open men's singles match in terms of combined ages in the Open Era. Karlović became the oldest male singles player to compete in the tournament since István Gulyás in 1973. Stefanos Tsitsipas became the first Greek player to reach the round of 16 at Roland Garros since Lazaros Stalios in 1936. For only the third time in the Open Era and the first time since the 1970 Australian Open, all of the top 10 seeds reached the round of 16 at a men's singles major. It was also the first time since the 2013 Australian Open that the top four seeds (Djokovic, Nadal, Federer, and Thiem) all reached the semifinals of a major, and the first time since the 2012 French Open that the Big Three all reached the semifinals of a major. This marked the final major appearance of 2009 US Open champion Juan Martín del Potro, who lost to Karen Khachanov in the fourth round. Del Potro would retire from tennis in 2022 due to recurring injuries. Seeds All seedings per ATP rankings. Qualifying Draw Key Q = Qualifier WC = Wild card LL = Lucky loser PR = Protected Ranking w/o = Walkover r = Retired d = Defaulted <noinclude> Finals Top half Section 1 Section 2 Section 3 Section 4 Bottom half Section 5 Section 6 Section 7 Section 8 Championship match ratings 1.785 million on NBC, in the USA References External links Main draw 2019 French Open – Men's draws and results at the International Tennis Federation Men's Singles 2019
Alfred Miles Jones (February 5, 1837 – July 8, 1910), nicknamed "Long" Jones, was an American politician and businessman. Born in New Hampshire, Jones came with his family to Illinois in 1847. Jones became a prominent politician in Jo Daviess County, Illinois, eventually rising to deputy sheriff and the leader of the county chapter of the Republican Party. He was elected to two terms in the Illinois House of Representatives, then received two positions under the spoils system. Jones was chairman of the Illinois Republican Committee for twelve years. In the 1880s, he assumed control of the Bethesda spring in Waukesha, Wisconsin, and helped turn it into one of the most prominent spring water companies in the nation. He moved to Waukesha in 1896 and was elected to the Wisconsin State Senate three years later, serving one term. Biography Alfred Miles Jones was born in New Durham, New Hampshire, on February 5, 1837. He was the eldest child of farmers Alfred S. and Rebecca (Miles) Jones. When Jones was ten, the family moved to Hebron, Illinois, to establish a new farm. When he was sixteen, Jones moved to Michigan to work in a lumber yard. He later operated a raft on the Mississippi River. After saving some money, he moved to Rockford, Illinois, and attended a school there. Graduating in 1856, Jones returned to the family farm in Hebron, teaching a school there in winters. Shortly afterward, the family moved to Warren. There, Jones opened a store selling books and jewelry. However, he was financially ruined by the Panic of 1857. He left Illinois with a friend to join the Pike's Peak Gold Rush. He found little of value and decided to head east to Kearney, Nebraska. He then returned to Warren to work as a laborer. He was appointed constable of Jo Daviess County, Illinois. Jones became involved in the farm machinery trade and sold such items for five years. He then studied law and became involved with real estate. He rose in county politics to become deputy sheriff and coroner. He was named the chairman of the county Republican Party central committee. Jones became a member of the State Republican Committee in 1871, serving twelve years as its chairman. In 1872, Jones was elected to the Illinois House of Representatives for the 10th district, serving two two-year terms. He was the Majority Leader for the second term. To distinguish him from fellow representative Benjamin L. Jones, Alfred Jones was nicknamed "Long" Jones (for his height), a nickname that stuck for the rest of his life. After his second house term expired, Jones was named a commissioner of the Joliet Penitentiary. He was the secretary of the board of trustees for three and a half years. President Rutherford B. Hayes appointed Jones a tax assessor for Sterling, Illinois, in 1880. The next year, President James A. Garfield named him marshal of the Northern District of Illinois. He held the position until 1885. At the 1892 Republican National Convention, he had control of Benjamin Harrison's presidential campaign. In 1885, Jones assumed control of the Bethesda mineral spring in Waukesha, Wisconsin. He became its president and manager three years later, eventually purchasing almost 75% of the company stock. The company was extremely successful, selling over one million bottles of water a year by 1892. He co-founded the Waukesha Beach Electric Railway and was elected its first president. He also purchased the Terrace Hotel. In 1894, he decided to leave Illinois and permanently settle in Waukesha. He was elected to the Wisconsin State Senate in 1899, serving a four-year term. Jones married Emeline A. Wright on October 13, 1857. They had two children: Alfred Wirt and Ernie. Alfred Wirt served under his father as secretary of Bethesda. Alfred Miles Jones was a Freemason and Baptist. He died in Milwaukee, Wisconsin, on July 8, 1910, and was buried in Prairie Home Cemetery. References 1837 births 1910 deaths Schoolteachers from Illinois Republican Party members of the Illinois House of Representatives Republican Party Wisconsin state senators People from Warren, Illinois People from New Durham, New Hampshire Politicians from Waukesha, Wisconsin Businesspeople from Illinois Businesspeople from Wisconsin United States Marshals 19th-century American politicians People from Hebron, Illinois People from Rockford, Illinois People from Sterling, Illinois Burials in Wisconsin Baptists from Wisconsin Baptists from Illinois Baptists from New Hampshire 19th-century American educators 19th-century American businesspeople 19th-century Baptists
```scala /* * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * * 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 streaming.core.shared.pool /** * Created by allwefantasy on 21/5/2018. */ trait BigObjPool[T] { def size(): Int def get(name: String): T def put(name: String, value: T): BigObjPool[T] def remove(name: String): BigObjPool[T] } ```
Henri Grimal (19 July 1910 – 3 November 2012) was a 20th-century French writer and historian, a specialist of the British Empire, the Commonwealth of Nations and the history of decolonisation. Agrégé d'histoire (1939), he taught at the lycée Janson-de-Sailly, the lycée Henri-IV, the lycée Louis-le-Grand, the Sorbonne, as well as at Princeton University. Works (selection) 1948: Derrière les barricades, Éditions Bourrelier 1956: Agricola, de Tacite, Éditions Hachette 1962: Le Commonwealth, Presses universitaires de France 1962: Histoire du Commonwealth britannique, Presses universitaires de France 1965: La Décolonisation, 1919-1963, Librairie Armand Colin, prix Broquette-Gonin of the Académie Française (1966) (reprints in 1967, 1970, 1985 and 1999 , and in 1978 by Westview Press: Decolonialization : the British, Dutch, French and Belgian Empires: 1919-1963) 1971: De l'Empire britannique au Commonwealth, Librairie Armand Colin (rééd. 1999). Henri Grimal also published in 2005 the first volume of his souvenirs: L'Envol, at Presses de l'université des Sciences sociales de Toulouse, an account of his young years in the region of his native village in the 1920s. References External links Henri Grimal, La décolonisation, de 1919 à 1963. (compte rendu) on Persée Decolonization: The British, French, Dutch and Belgian Empires, 1919-1963 by Henri Grimal on JSTOR Winners of the Prix Broquette-Gonin (literature) 20th-century French historians People from Aveyron 1910 births 2012 deaths French centenarians Men centenarians
```javascript // Install dependencies: // npm init // npm install --save-dev dotenv truffle-wallet-provider ethereumjs-wallet // Create .env in project root, with keys: // ROPSTEN_PRIVATE_KEY="123abc" // MAINNET_PRIVATE_KEY="123abc" require('dotenv').config(); const Web3 = require("web3"); const web3 = new Web3(); const WalletProvider = require("truffle-wallet-provider"); const Wallet = require('ethereumjs-wallet'); var mainNetPrivateKey = new Buffer(process.env["MAINNET_PRIVATE_KEY"], "hex") var mainNetWallet = Wallet.fromPrivateKey(mainNetPrivateKey); var mainNetProvider = new WalletProvider(mainNetWallet, "path_to_url"); var ropstenPrivateKey = new Buffer(process.env["ROPSTEN_PRIVATE_KEY"], "hex") var ropstenWallet = Wallet.fromPrivateKey(ropstenPrivateKey); var ropstenProvider = new WalletProvider(ropstenWallet, "path_to_url"); module.exports = { networks: { dev: { // Whatever network our local node connects to network_id: "*", // Match any network id host: "localhost", port: 8545 }, mainnet: { // Provided by Infura, load keys in .env file network_id: "1", provider: mainNetProvider, gas: 4600000, gasPrice: web3.utils.toWei("20", "gwei") }, ropsten: { // Provided by Infura, load keys in .env file network_id: "3", provider: ropstenProvider, gas: 4600000, gasPrice: web3.utils.toWei("20", "gwei") }, kovan: { network_id: 42, host: "localhost", // parity --chain=kovan port: 8545, gas: 5000000 }, ganache: { // Ganache local test RPC blockchain network_id: "5777", host: "localhost", port: 7545, gas: 6721975 }, aws: { // Private network on AWS network_id: "15", host: "public-ip-address", port: 8545, gas: 6721975 } } }; ```
The Nogales Arizona Port of Entry on Grand Avenue has been in existence since the early 20th century. It connects Interstate 19 with Mexican Federal Highway 15. The port of entry is named after former Arizona Senator Dennis DeConcini. The border station was completely rebuilt in 1966 and upgrades to the pedestrian gates were made by the General Services Administration in 2012. It is one of three border crossings in Nogales; the Nogales-Mariposa Port of Entry, built in 1973, handles commercial traffic west of the Grand Avenue crossing, while the adjacent Nogales-Morley Gate Port of Entry is used for pedestrians. History Since its inception, vehicles, pedestrians and trains have been inspected here. In 1931, as part of a nationwide program to improve border security during Prohibition, The border fence was improved and two small inspection bungalows, which local residents termed "garitas", were constructed at portals on Grand Avenue and Morley Avenue. Morley Gate is dedicated to pedestrian crossings. The Grand Avenue garita was expanded substantially in 1949, but was replaced with the current multi-lane inspection facility in 1966. See also List of Mexico–United States border crossings List of Canada–United States border crossings References Mexico–United States border crossings 1903 establishments in Arizona Territory Buildings and structures in Santa Cruz County, Arizona
"1998" is an instrumental music track by British trance act Binary Finary originally released in the year 1998. The track was subsequently remixed numerous times under the title of the year the remix was produced (i.e. "1999", "2000", etc.) On the UK singles chart, "1998" peaked at #24 whereas "1999" peaked at #11. 12 years after its original release, in 2010 Armada Music published remixes by Vegas Baby!, Alex M.O.R.P.H., Dabruck & Klein, TyDi & Dennis Sheperd, Vadim Soloviev, Kaimo K, and a 2010 mix. In 2012 the song was covered by Peace under the title "1998 (Delicious)" on their debut EP, EP Delicious. This version adds lyrics to the song. On 9 September 2013 it was released through Armada Music a 15th anniversary package containing remixes by Jordan Suckley, Kissy Sell Out, Daniel Wanrooy, James Dymond, Tonny Nesse and an 'End of the World' rework. A 20th Anniversary remixes package (including Mark Sixma, Dosem and Binary Finary remixes) was released under Armada Music label on 21 December 2018. A remix by Jose De Mara was released through Armind in 2021. Remixers Adrien Aubrun Alex M.O.R.P.H. Dabruck & Klein Daniel Wanrooy Darren Porter DuMonde (aka JamX & De Leon) Dosem Gouryella James Dymond Jon Craig & Jay Cosgrove Jordan Suckley Jose De Mara Kaimo K Kay Cee Kissy Sell Out Marc et Claude Mark Sixma Markus Schulz & Ferry Corsten pres. New World Punx Matt Darey Paul van Dyk Protoculture Richard Durand Rodrigo Deem Ronski Speed Setrise Tonny Nesse twoloud tyDi & Dennis Sheperd Vadim Soloviev Vegas Baby! Other versions 2009 - Francesco Diaz & Young Rebels - 1998 (Original Mix / Christian Weber Remix) 2009 - Pacific Wave - 1998 (DJ Kharma & Mighty Atom Mix / DJ Phunk & 3am Mix) References 1998 singles 1999 singles 2000 singles 1998 songs Songs written by Tim Armstrong
```ocaml (** dune rpc command group *) val group : unit Cmdliner.Cmd.t ```
```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. // per-process data from /proc/[pid]/stat package cpustat import ( "fmt" "strings" "time" ) type ProcSample struct { Pid int Proc ProcStats Task TaskStats } type ProcSampleList struct { Samples []ProcSample Len uint32 } func NewProcSampleList(size int) ProcSampleList { return ProcSampleList{ make([]ProcSample, size), 0, } } type ProcSampleMap map[int]*ProcSample // ProcStats holds the fast changing data that comes back from /proc/[pid]/stat // These fields are documented in the linux proc(5) man page // There are many more of these fields that don't change very often. These are stored in the Cmdline struct. type ProcStats struct { CaptureTime time.Time Utime uint64 Stime uint64 Cutime uint64 Cstime uint64 Numthreads uint64 Rss uint64 Guesttime uint64 Cguesttime uint64 } type ProcStatsMap map[int]*ProcStats // super not thread safe but GC friendly way to reuse this string slice var splitParts []string // you might think that we could split on space, but due to what can at best be called // a shortcoming of the /proc/pid/stat format, the comm field can have unescaped spaces, parens, etc. // This may be a bit paranoid, because even many common tools like htop do not handle this case well. func procPidStatSplit(line string) []string { line = strings.TrimSpace(line) if splitParts == nil { splitParts = make([]string, 52) } partnum := 0 strpos := 0 start := 0 inword := false space := " "[0] open := "("[0] close := ")"[0] groupchar := space for ; strpos < len(line); strpos++ { if inword { if line[strpos] == space && (groupchar == space || line[strpos-1] == groupchar) { splitParts[partnum] = line[start:strpos] partnum++ start = strpos inword = false } } else { if line[strpos] == open { groupchar = close inword = true start = strpos strpos = strings.LastIndex(line, ")") - 1 if strpos <= start { // if we can't parse this insane field, skip to the end strpos = len(line) inword = false } } else if line[strpos] != space { groupchar = space inword = true start = strpos } } } if inword { splitParts[partnum] = line[start:strpos] partnum++ } for ; partnum < 52; partnum++ { splitParts[partnum] = "" } return splitParts } // ProcStatsReader reads and parses /proc/[pid]/stat for all of pids func ProcStatsReader(pids Pidlist, filter Filters, cur *ProcSampleList, infoMap ProcInfoMap) { sampleNum := 0 pidNum := 0 for pidNum < len(pids) { pid := pids[pidNum] pidNum++ if filter.PidMatch(pid) == false { continue } newPid := false // we don't know the userid of this proc to filter until we read/stat /proc/pid/cmdline // Do this only when we find a pid for the first time so we don't have to stat as much var info *ProcInfo var ok bool if info, ok = infoMap[pid]; ok == true { info.touch() } else { newPid = true info = &ProcInfo{} info.init() } lines, err := ReadFileLines(fmt.Sprintf("/proc/%d/stat", pid)) // pid could have exited between when we scanned the dir and now if err != nil { continue } // this format of this file is insane because comm can have split chars in it parts := procPidStatSplit(lines[0]) if newPid { info.Comm = strings.Map(StripSpecial, parts[1]) info.Pid = uint64(pid) info.Ppid = ReadUInt(parts[3]) info.Pgrp = ReadInt(parts[4]) info.Session = ReadInt(parts[5]) info.Ttynr = ReadInt(parts[6]) info.Tpgid = ReadInt(parts[7]) info.Flags = ReadUInt(parts[8]) info.Starttime = ReadUInt(parts[21]) info.Nice = ReadInt(parts[18]) info.Rtpriority = ReadUInt(parts[39]) info.Policy = ReadUInt(parts[40]) info.updateCmdline() // note that this may leave UID at 0 if there's an error infoMap[pid] = info } if filter.UserMatch(int(info.UID)) == false { continue } sample := &cur.Samples[sampleNum] sample.Pid = pid procStatsReaderFromParts(&sample.Proc, parts) sampleNum++ } cur.Len = uint32(sampleNum) } func procStatsReaderFromParts(stats *ProcStats, parts []string) { stats.CaptureTime = time.Now() stats.Utime = ReadUInt(parts[13]) stats.Stime = ReadUInt(parts[14]) stats.Cutime = ReadUInt(parts[15]) stats.Cstime = ReadUInt(parts[16]) stats.Numthreads = ReadUInt(parts[19]) stats.Rss = ReadUInt(parts[23]) stats.Guesttime = ReadUInt(parts[42]) stats.Cguesttime = ReadUInt(parts[43]) } // ProcStatsRecord computes the delta between the Proc elements of two ProcSampleLists // These lists do not need to have exactly the same processes in it, but they must both be sorted by Pid. // This generally works out because reading the pids from /proc puts them in a consistent order. // If we ever get a new source of the pidlist, perf_events or whatever, make sure it sorts. func ProcStatsRecord(interval uint32, curList, prevList ProcSampleList, sumMap, deltaMap ProcSampleMap) { curPos := uint32(0) prevPos := uint32(0) for curPos < curList.Len && prevPos < prevList.Len { if curList.Samples[curPos].Pid == prevList.Samples[prevPos].Pid { cur := &(curList.Samples[curPos].Proc) prev := &(prevList.Samples[prevPos].Proc) pid := curList.Samples[curPos].Pid if _, ok := sumMap[pid]; ok == false { sumMap[pid] = &ProcSample{} } deltaMap[pid] = &ProcSample{} delta := &(deltaMap[pid].Proc) delta.CaptureTime = cur.CaptureTime duration := float64(cur.CaptureTime.Sub(prev.CaptureTime) / time.Millisecond) scale := float64(interval) / duration sum := &(sumMap[pid].Proc) sum.CaptureTime = cur.CaptureTime delta.Utime = ScaledSub(cur.Utime, prev.Utime, scale) sum.Utime += SafeSub(cur.Utime, prev.Utime) delta.Stime = ScaledSub(cur.Stime, prev.Stime, scale) sum.Stime += SafeSub(cur.Stime, prev.Stime) delta.Cutime = ScaledSub(cur.Cutime, prev.Cutime, scale) sum.Cutime += SafeSub(cur.Cutime, prev.Cutime) delta.Cstime = ScaledSub(cur.Cstime, prev.Cstime, scale) sum.Cstime += SafeSub(cur.Cstime, prev.Cstime) sum.Numthreads = cur.Numthreads sum.Rss = cur.Rss delta.Guesttime = ScaledSub(cur.Guesttime, prev.Guesttime, scale) sum.Guesttime += SafeSub(cur.Guesttime, prev.Guesttime) curPos++ prevPos++ } else { if curList.Samples[curPos].Pid < prevList.Samples[prevPos].Pid { curPos++ } else { prevPos++ } } } } ```
Kollayil (Malayalam: കൊല്ലായിൽ)is a village in Thiruvananthapuram district in the state of Kerala, India.Kollayil Post Office PIN code is 691541 There are 3 schools in Kollayil area. Schools in Kollayil Kollayil LPS - This is an Upper Primary School established in 1962. This school situates at Kollayil near the Thiruvananthapuram-Schencotta road. There are about 700 students and 22 teachers at this school. Jawahar LPS Kurakkodu - This is a Lower Primary School established in 1976. Sree Narayana Upper Primary School KOLLAYIL vollyballcourt and fishmarket kollayil Demographics India census, Kollayil had a population of 25148 with 12324 males and 12824 females. References Villages in Thiruvananthapuram district
Robert F. Schulkers (21 July 1890, Covington, Kentucky — 6 April 1972, Cincinnati, Ohio) was the author of a series of children's novels. The 11 novels were published first between 1921 and 1932, although many appeared first in serialized form in The Cincinnati Enquirer and hundreds of other newspapers around the country. The eleven novels are: Stoner's Boy, Seckatary Hawkins in Cuba, The Red Runners, The Gray Ghost, Stormie the Dog Stealer, Knights of the Square Table, Ching Toy, The Chinese Coin, The Yellow Y, Herman the Fiddler, and The Ghost of Lake Tapaho. Schulkers further popularized the series by means of a nationally syndicated NBC radio broadcast from Chicago and an extensive number of Seckatary Hawkins clubs in larger metropolitan areas. The official club name was "The Fair and Square Club". The club slogan was "A quitter never wins and a winner never quits". References External links Robert F. Schulkers biography Seckatary Hawkins Club of 1920 Seckatary Hawkins Seckatary Hawkins Seckatary Hawkins American writers
Matta is a Vietnamese restaurant in Portland, Oregon. History Matta began serving "Vietnamese soul food" from a food cart in 2018. During the COVID-19 pandemic, owner Richard Le offered free meals to food industry workers who became unemployed after Oregon banned indoor dining, as well as hospital workers. In 2023, Matta stopped operating from a food cart and re-opened in Lil' Dame. Reception Krista Garcia of Eater Portland included Matta in a 2020 list of "Portland's Top Pandan Treats". The website's Alex Frane included the restaurant in a 2021 overview of "17 Spots to Grab Amazing Breakfast Sandwiches". Nick Woo and Brooke Jackson-Glidden included Matta in Eater Portland 2021 "Guide to Portland's Most Outstanding Food Carts". Jackson-Glidden also included Matta in a 2021 overview of "Where to Find Weekend Brunch in Portland" and a 2022 list of "The 38 Essential Restaurants and Food Carts in Portland". Portland Monthly included the breakfast sandwich in a 2022 list of "The 12 Best Breakfasts in Portland". In 2023, chef Richard Văn Lê was one of 18 Portland industry professionals deemed "rising stars" by the restaurant resource and trade publication StarChefs. See also List of Vietnamese restaurants References External links 2018 establishments in Oregon Food carts in Portland, Oregon Restaurants established in 2018 Vietnamese restaurants in Portland, Oregon
Palmitoyl-protein thioesterase 1 (PPT-1), also known as palmitoyl-protein hydrolase 1, is an enzyme that in humans is encoded by the PPT1 gene. Function PPT-1 a member of the palmitoyl protein thioesterase family. PPT-1 is a small glycoprotein involved in the catabolism of lipid-modified proteins during lysosomal degradation. This enzyme removes thioester-linked fatty acyl groups such as palmitate from cysteine residues. Clinical significance Defects in this gene are a cause of neuronal ceroid lipofuscinosis type 1 (CLN1). References Further reading Acyl-protein thioesterase External links GeneReviews/NCBI/NIH/UW entry on Neuronal Ceroid-Lipofuscinosis EC 3.1.2
Jung Eun-hea (born 27 September 1989) is a South Korean sport shooter. Jung graduated from . She won the silver medal in women's 10 metre air rifle at the 2018 Asian Games. She participated at the 2018 ISSF World Shooting Championships. References External links Living people 1989 births South Korean female sport shooters ISSF rifle shooters Shooters at the 2018 Asian Games Asian Games medalists in shooting Medalists at the 2018 Asian Games Asian Games silver medalists for South Korea Sportspeople from Incheon 20th-century South Korean women 21st-century South Korean women
```xml import {Injectable} from "./injectable.js"; import {GlobalProviders} from "../registries/GlobalProviders.js"; import * as ProviderRegistry from "../registries/ProviderRegistry.js"; describe("@Injectable()", () => { afterEach(() => jest.resetAllMocks()); it("should call `registerProvider` setting `provide` according to the target class", () => { // GIVEN class Test {} // WHEN Injectable()(Test); // THEN expect(GlobalProviders.get(Test)?.useClass).toEqual(Test); }); it("should call `registerProvider` passing an additional options", () => { // GIVEN class Test {} // WHEN Injectable({options: "options"})(Test); // THEN expect(GlobalProviders.get(Test)?.useClass).toEqual(Test); expect(GlobalProviders.get(Test)?.options).toEqual("options"); }); it("should override `provide`", () => { // GIVEN class Test {} const provide = "custom"; // WHEN Injectable({provide})(Test); // THEN expect(GlobalProviders.get("custom")?.useClass).toEqual(Test); }); }); ```
```ruby # frozen_string_literal: true require "resource" require "livecheck" RSpec.describe Resource do subject(:resource) { described_class.new("test") } let(:livecheck_resource) do described_class.new do url "path_to_url" sha256 your_sha256_hash livecheck do url "path_to_url" regex(/foo[._-]v?(\d+(?:\.\d+)+)\.t/i) end end end describe "#url" do it "sets the URL" do resource.url("foo") expect(resource.url).to eq("foo") end it "can set the URL with specifications" do resource.url("foo", branch: "master") expect(resource.url).to eq("foo") expect(resource.specs).to eq(branch: "master") end it "can set the URL with a custom download strategy class" do strategy = Class.new(AbstractDownloadStrategy) resource.url("foo", using: strategy) expect(resource.url).to eq("foo") expect(resource.download_strategy).to eq(strategy) end it "can set the URL with specifications and a custom download strategy class" do strategy = Class.new(AbstractDownloadStrategy) resource.url("foo", using: strategy, branch: "master") expect(resource.url).to eq("foo") expect(resource.specs).to eq(branch: "master") expect(resource.download_strategy).to eq(strategy) end it "can set the URL with a custom download strategy symbol" do resource.url("foo", using: :git) expect(resource.url).to eq("foo") expect(resource.download_strategy).to eq(GitDownloadStrategy) end it "raises an error if the download strategy class is unknown" do expect { resource.url("foo", using: Class.new) }.to raise_error(TypeError) end it "does not mutate the specifications hash" do specs = { using: :git, branch: "master" } resource.url("foo", **specs) expect(resource.specs).to eq(branch: "master") expect(resource.using).to eq(:git) expect(specs).to eq(using: :git, branch: "master") end end describe "#livecheck" do specify "when livecheck block is set" do expect(livecheck_resource.livecheck.url).to eq("path_to_url") expect(livecheck_resource.livecheck.regex).to eq(/foo[._-]v?(\d+(?:\.\d+)+)\.t/i) end end describe "#livecheckable?" do it "returns false if livecheck block is not set in resource" do expect(resource.livecheckable?).to be false end specify "livecheck block defined in resources" do expect(livecheck_resource.livecheckable?).to be true end end describe "#version" do it "sets the version" do resource.version("1.0") expect(resource.version).to eq(Version.parse("1.0")) expect(resource.version).not_to be_detected_from_url end it "can detect the version from a URL" do resource.url("path_to_url") expect(resource.version).to eq(Version.parse("1.0")) expect(resource.version).to be_detected_from_url end it "can set the version with a scheme" do klass = Class.new(Version) resource.version klass.new("1.0") expect(resource.version).to eq(Version.parse("1.0")) expect(resource.version).to be_a(klass) end it "can set the version from a tag" do resource.url("path_to_url", tag: "v1.0.2") expect(resource.version).to eq(Version.parse("1.0.2")) expect(resource.version).to be_detected_from_url end it "rejects non-string versions" do expect { resource.version(1) }.to raise_error(TypeError) expect { resource.version(2.0) }.to raise_error(TypeError) expect { resource.version(Object.new) }.to raise_error(TypeError) end it "returns nil if unset" do expect(resource.version).to be_nil end end describe "#mirrors" do it "is empty by defaults" do expect(resource.mirrors).to be_empty end it "returns an array of mirrors added with #mirror" do resource.mirror("foo") resource.mirror("bar") expect(resource.mirrors).to eq(%w[foo bar]) end end describe "#checksum" do it "returns nil if unset" do expect(resource.checksum).to be_nil end it "returns the checksum set with #sha256" do resource.sha256(TEST_SHA256) expect(resource.checksum).to eq(Checksum.new(TEST_SHA256)) end end describe "#download_strategy" do it "returns the download strategy" do strategy = Class.new(AbstractDownloadStrategy) expect(DownloadStrategyDetector) .to receive(:detect).with("foo", nil).and_return(strategy) resource.url("foo") expect(resource.download_strategy).to eq(strategy) end end describe "#owner" do it "sets the owner" do owner = Object.new resource.owner = owner expect(resource.owner).to eq(owner) end it "sets its owner to be the patches' owner" do resource.patch(:p1) { url "file:///my.patch" } owner = Object.new resource.owner = owner resource.patches.each do |p| expect(p.resource.owner).to eq(owner) end end end describe "#patch" do it "adds a patch" do resource.patch(:p1, :DATA) expect(resource.patches.count).to eq(1) expect(resource.patches.first.strip).to eq(:p1) end end specify "#verify_download_integrity_missing" do fn = Pathname.new("test") allow(fn).to receive(:file?).and_return(true) expect(fn).to receive(:verify_checksum).and_raise(ChecksumMissingError) expect(fn).to receive(:sha256) resource.verify_download_integrity(fn) end specify "#verify_download_integrity_mismatch" do fn = instance_double(Pathname, file?: true, basename: "foo") checksum = resource.sha256(TEST_SHA256) expect(fn).to receive(:verify_checksum) .with(checksum) .and_raise(ChecksumMismatchError.new(fn, checksum, Object.new)) expect do resource.verify_download_integrity(fn) end.to raise_error(ChecksumMismatchError) end end ```
Jessie Flood-Paddock (born 1977, London, England) is a British sculptor living and working in London. Flood-Paddock studied at Royal College of Art (2003–05), Slade School of Fine Art (1996–2000), London and The School of the Art Institute of Chicago Art Institute of Chicago (1999). Flood-Paddock first came to wider attention in 2010 for her solo exhibition 'Gangsta's Paradise', Hayward Gallery Project Space, London, that centred on a sculpture of a giant lobster. Her work often is monumental in scale, commenting on our consumer society. In June 2011, Flood-Paddock had a solo exhibition at the Carl Freedman Gallery of new sculpture called Fantastic Voyage. and again in 2014 for a solo show called 'Nude' which was reviewed by Frieze Magazine. Flood-Paddock was named as 'Artist of the week' by the Guardian Media Group's theguardian.com website in July 2011. In 2012, Flood-Paddock collaborated on an artwork with British fashion designer Jonathan Saunders for Britain Creates, which concluded with an exhibition at the V&A. In 2012, Flood-Paddock had a solo exhibition at Tate Britain, London. In 2017, the Tetley Gallery in Leeds hosted an exhibition Refinding bringing together new and recent works by Flood-Paddock, along with the Oak Tree series of sculptures, drawings and prints by 20th century sculptor, the late Kenneth Armitage. Flood-Paddock was awarded a Kenneth Armitage Fellowship (2013–2015), which enabled her to live and work in Armitage's studio for two years. References External links images of Flood-Paddock's work on Carl Freedman Gallery site 1977 births Living people 21st-century British sculptors 21st-century English women artists Alumni of the Slade School of Fine Art English contemporary artists English women sculptors Sculptors from London
```kotlin package mega.privacy.android.app.presentation.search.navigation import androidx.compose.ui.res.stringResource import androidx.navigation.NavGraphBuilder import androidx.navigation.NavHostController import androidx.navigation.compose.dialog import mega.privacy.android.app.R import mega.privacy.android.shared.original.core.ui.controls.dialogs.MegaAlertDialog internal fun NavGraphBuilder.foreignNodeDialogNavigation(navHostController: NavHostController) { dialog(searchForeignNodeDialog) { MegaAlertDialog( text = stringResource(id = R.string.warning_share_owner_storage_quota), confirmButtonText = stringResource(id = R.string.general_ok), cancelButtonText = null, onConfirm = { navHostController.navigateUp() }, onDismiss = { navHostController.navigateUp() }, dismissOnClickOutside = false ) } } internal const val searchForeignNodeDialog = "search/foreign_node_dialog" ```
Marijana Mišković Hasanbegović is a Croatian judoka. At the 2012 Summer Olympics she competed in the Women's 63 kg, but was defeated in the second round. References External links Croatian female judoka Living people Olympic judoka for Croatia Judoka at the 2012 Summer Olympics Mediterranean Games gold medalists for Croatia Competitors at the 2013 Mediterranean Games Mediterranean Games medalists in judo European Games competitors for Croatia Judoka at the 2015 European Games 1982 births 21st-century Croatian women
Messier 62 or M62, also known as NGC 6266, is a globular cluster of stars in the south of the equatorial constellation of Ophiuchus. It was discovered in 1771 by Charles Messier, then added to his catalogue eight years later. M62 is about from Earth and from the Galactic Center. It is among the ten most massive and luminous globular clusters in the Milky Way, showing an integrated absolute magnitude of −9.18. It has an estimated mass of and a mass-to-light ratio of in the core visible light band, the V band. It has a projected ellipticity of 0.01, meaning it is essentially spherical. The density profile of its member stars suggests it has not yet undergone core collapse. It has a core radius of , a half-mass radius of , and a half-light radius of . The stellar density at the core is per cubic parsec. It has a tidal radius of . The cluster shows at least two distinct populations of stars, which most likely represent two separate episodes of star formation. Of the main sequence stars in the cluster, are from the first generation and from the second. The second is polluted by materials released by the first. In particular, abundances of helium, carbon, magnesium, aluminium, and sodium differ between these two. Indications are this is an Oosterhoff type I, or "metal-rich" system. A 2010 study identified 245 variable stars in the cluster's field, of which 209 are RR Lyrae variables, four are Type II Cepheids, 25 are long period variables, and one is an eclipsing binary. The cluster may prove to be the galaxy's richest in terms of RR Lyrae variables. It has six binary millisecond pulsars, including one (COM6266B) that is displaying eclipsing behavior from gas streaming off its companion. There are multiple X-ray sources, including 50 within the half-mass radius. 47 blue straggler candidates have been identified, formed from the merger of two stars in a binary system, and these are preferentially concentrated near the core region. It is hypothesized that this cluster may be host to an intermediate mass black hole (IMBH) – it is considered well-suited for searching for such an object. A brief study, before 2013, of the proper motion of stars within of the core did not require an IMBH to explain. However, simulations can not rule out one with a mass of a few thousand . Based upon radial velocity measurements within an arcsecond of the core, Kiselev et al. (2008) made the claim of an IMBH, likewise with mass of . Gallery See also List of Messier objects References and footnotes External links Messier 62, Galactic Globular Clusters Database page M62 on willig.net Messier 062 Messier 062 062 Messier 062 ?
```yaml --- enhancements: - | The status page now includes a ``Status render errors`` section to highlight errors that occurred while rendering it. ```
```swift import XCTest @testable import Layout class XMLTests: XCTestCase { // MARK: Malformed XML func testEmptyXML() { let input = "" XCTAssertThrowsError(try Layout(xmlData: input.data(using: .utf8)!)) { error in XCTAssert("\(error)".contains("Empty")) } } func testHTMLAtRoot() { let input = "<html></html>" XCTAssertThrowsError(try Layout(xmlData: input.data(using: .utf8)!)) { error in XCTAssert("\(error)".contains("Invalid root")) } } func testViewInsideHTML() { let input = "<UIView><p><UIView/></p></UIView>" XCTAssertThrowsError(try Layout(xmlData: input.data(using: .utf8)!)) { error in XCTAssert("\(error)".contains("Unsupported HTML")) } } func testViewInsideHTMLInsideLabel() { let input = "<UILabel><p>hello <UIView/> world</p></UILabel>" XCTAssertThrowsError(try Layout(xmlData: input.data(using: .utf8)!)) { error in guard let layoutError = error as? LayoutError else { XCTFail("\(error)") return } XCTAssertTrue("\(layoutError)".contains("Unsupported HTML")) XCTAssertTrue("\(layoutError)".contains("UIView")) } } func testMismatchedHTML() { let input = "<UILabel>Some <b>bold</bold> text</UILabel>" let xmlData = input.data(using: .utf8)! XCTAssertThrowsError(try Layout(xmlData: xmlData)) { error in XCTAssert("\(error)".contains("bold")) } } func testMissingParameterAttribute() { let input = "<UILabel><param name=\"text\" value=\"foo\"/></UILabel>" let xmlData = input.data(using: .utf8)! XCTAssertThrowsError(try Layout(xmlData: xmlData)) { error in XCTAssert("\(error)".contains("type is a required attribute")) } } func testExtraParameterAttribute() { let input = "<UILabel><param name=\"text\" type=\"String\" value=\"foo\"/></UILabel>" let xmlData = input.data(using: .utf8)! XCTAssertThrowsError(try Layout(xmlData: xmlData)) { error in XCTAssert("\(error)".contains("Unexpected attribute value")) } } func testUnknownParameterType() { let input = "<UILabel><param name=\"text\" type=\"Foo\"/></UILabel>" let xmlData = input.data(using: .utf8)! XCTAssertThrowsError(try Layout(xmlData: xmlData)) { error in XCTAssert("\(error)".contains("Unknown or unsupported type")) } } func testChildNodeInParameter() { let input = "<UILabel><param name=\"text\">foo</param></UILabel>" let xmlData = input.data(using: .utf8)! XCTAssertThrowsError(try Layout(xmlData: xmlData)) { error in XCTAssert("\(error)".contains("should not contain sub-nodes")) } } func testMissingMacroAttribute() { let input = "<UILabel><macro key=\"text\" value=\"foo\"/></UILabel>" let xmlData = input.data(using: .utf8)! XCTAssertThrowsError(try Layout(xmlData: xmlData)) { error in XCTAssert("\(error)".contains("name is a required attribute")) } } func testExtraMacroAttribute() { let input = "<UILabel><macro name=\"text\" type=\"String\" value=\"foo\"/></UILabel>" let xmlData = input.data(using: .utf8)! XCTAssertThrowsError(try Layout(xmlData: xmlData)) { error in XCTAssert("\(error)".contains("Unexpected attribute type")) } } func testChildNodeInMacro() { let input = "<UILabel><macro name=\"text\">foo</macro></UILabel>" let xmlData = input.data(using: .utf8)! XCTAssertThrowsError(try Layout(xmlData: xmlData)) { error in XCTAssert("\(error)".contains("should not contain sub-nodes")) } } func testStringInOutletAttribute() { let input = "<UILabel outlet=\"foo\"/>" let xmlData = input.data(using: .utf8)! XCTAssertNoThrow(try Layout(xmlData: xmlData)) } func testCommentedOutOutletAttribute() { let input = "<UILabel outlet=\"//foo\"/>" let xmlData = input.data(using: .utf8)! XCTAssertNoThrow(try Layout(xmlData: xmlData)) } func testEmptyOutletAttribute() { let input = "<UILabel outlet=\"\"/>" let xmlData = input.data(using: .utf8)! XCTAssertNoThrow(try Layout(xmlData: xmlData)) } func testExpressionInXMLAttribute() { let input = "<UILabel xml=\"{foo}\"/>" let xmlData = input.data(using: .utf8)! XCTAssertThrowsError(try Layout(xmlData: xmlData)) { error in XCTAssert("\(error)".contains("xml must be a literal value")) } } func testExpressionInTemplateAttribute() { let input = "<UILabel template=\"{foo}.xml\"/>" let xmlData = input.data(using: .utf8)! XCTAssertThrowsError(try Layout(xmlData: xmlData)) { error in XCTAssert("\(error)".contains("template must be a literal value")) } } // MARK: White space func testDiscardLeadingWhitespace() { let input = " <UIView/>" let xmlData = input.data(using: .utf8)! let xml = try! XMLParser.parse(data: xmlData) guard xml.count == 1, case let .node(name, _, _) = xml[0] else { XCTFail() return } XCTAssertEqual(name, "UIView") } func testDiscardWhitespaceInsideLabel() { let input = "<UILabel>\n Foo\n</UILabel>" let xmlData = input.data(using: .utf8)! let layout = try! Layout(xmlData: xmlData) XCTAssertEqual(layout.body, "Foo") } func testInterleavedTextAndViewsInsideLabel() { let input = "<UILabel>Foo<UIView/>Bar</UILabel>" let xmlData = input.data(using: .utf8)! let layout = try! Layout(xmlData: xmlData) XCTAssertEqual(layout.body, "FooBar") } func testPreserveWhitespaceInsideHTML() { let html = "Some <b>bold </b>and<i> italic</i> text" let input = "<UILabel>\n \(html)\n</UILabel>" let xmlData = input.data(using: .utf8)! let layout = try! Layout(xmlData: xmlData) XCTAssertEqual(layout.body, html) } func testPreserveHTMLAttributes() { let html = "An <img src=\"foo.jpg\"/> tag" let input = "<UILabel>\n \(html)\n</UILabel>" let xmlData = input.data(using: .utf8)! let layout = try! Layout(xmlData: xmlData) XCTAssertEqual(layout.body, html) } // MARK: Entity encoding func testEncodeXMLEntities() { let input = "if 2 > 3 && 1 < 4" let expected = "if 2 > 3 &amp;&amp; 1 &lt; 4" XCTAssertEqual(input.xmlEncoded(), expected) } func testNoEncodeHTMLEntitiesInText() { let text = "2 legs are < 4 legs" let input = "<UILabel>\(text.xmlEncoded())</UILabel>" let xmlData = input.data(using: .utf8)! let layout = try! Layout(xmlData: xmlData) XCTAssertEqual(layout.body, text) } func testEncodeHTMLEntitiesInHTML() { let html = "2 legs are &lt; 4 legs<br/>" let input = "<UILabel>\(html)</UILabel>" let xmlData = input.data(using: .utf8)! let layout = try! Layout(xmlData: xmlData) XCTAssertEqual(layout.body, html) } func testEncodeHTMLEntitiesInHTML2() { let html = "<p>2 legs are &lt; 4 legs</p>" let input = "<UILabel>\(html)</UILabel>" let xmlData = input.data(using: .utf8)! let layout = try! Layout(xmlData: xmlData) XCTAssertEqual(layout.body, html) } func testEncodeHTMLEntitiesInHTML3() { let html = "<b>trial</b> &amp; error" let input = "<UILabel>\(html)</UILabel>" let xmlData = input.data(using: .utf8)! let layout = try! Layout(xmlData: xmlData) XCTAssertEqual(layout.body, html) } } ```
Fredericksburg (also, Frederickburg and ) is an unincorporated community in Alpine County, California. It is located north-northeast of Woodfords, at an elevation of 5072 feet (1546 m). The town developed in the 1860s. A post office operated at Fredericksburg from 1898 to 1911. Name The town was started in 1864 and may have been named for Frederick Frevert, who operated a sawmill nearby. References External links Unincorporated communities in California Unincorporated communities in Alpine County, California
The 2023 FIBA 3x3 Europe Cup was the eighth edition of the 3x3 Europe Cup that featured separate competitions for men's and women's national teams. It was held between 5 and 7 September 2023 in Jerusalem, Israel. Medalists Men's tournament Preliminary round Pool A Pool B Pool C Pool D Knockout stage All times are local. Women's tournament Preliminary round Pool A Pool B Pool C Pool D Knockout stage All times are local. References 2022 2023 in 3x3 basketball 2023 in Israeli sport 2023 in European sport 2023
Ruellia puri is a plant native to the cerrado vegetation of Brazil. External links List of taxa in the Virtual Herbarium Of The New York Botanical Garden: Ruellia puri List of taxa in the Embrapa Recursos Genéticos e Biotecnologia: Ruellia puri puri Flora of Brazil
```emacs lisp ;;; nndiary.el --- A diary back end for Gnus ;; Author: Didier Verna <didier@xemacs.org> ;; Maintainer: Didier Verna <didier@xemacs.org> ;; Created: Fri Jul 16 18:55:42 1999 ;; Keywords: calendar mail news ;; This file is part of GNU Emacs. ;; GNU Emacs is free software: you can redistribute it and/or modify ;; (at your option) any later version. ;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; along with GNU Emacs. If not, see <path_to_url ;;; Commentary: ;; Contents management by FCM version 0.1. ;; Description: ;; =========== ;; nndiary is a mail back end designed to handle mails as diary event ;; reminders. It is now fully documented in the Gnus manual. ;; Bugs / Todo: ;; =========== ;; * Respooling doesn't work because contrary to the request-scan function, ;; Gnus won't allow me to override the split methods when calling the ;; respooling back end functions. ;; * There's a bug in the time zone mechanism with variable TZ locations. ;; * We could allow a keyword like `ask' in X-Diary-* headers, that would mean ;; "ask for value upon reception of the message". ;; * We could add an optional header X-Diary-Reminders to specify a special ;; reminders value for this message. Suggested by Jody Klymak. ;; * We should check messages validity in other circumstances than just ;; moving an article from somewhere else (request-accept). For instance, ;; when editing / saving and so on. ;; Remarks: ;; ======= ;; * nnoo. NNDiary is very similar to nnml. This makes the idea of using nnoo ;; (to derive nndiary from nnml) natural. However, my experience with nnoo ;; is that for reasonably complex back ends like this one, nnoo is a burden ;; rather than an help. It's tricky to use, not everything can be inherited, ;; what can be inherited and when is not very clear, and you've got to be ;; very careful because a little mistake can fuck up your other back ends, ;; especially because their variables will be use instead of your real ones. ;; Finally, I found it easier to just clone the needed parts of nnml, and ;; tracking nnml updates is not a big deal. ;; IMHO, nnoo is actually badly designed. A much simpler, and yet more ;; powerful one would be to make *real* functions and variables for a new ;; back end based on another. Lisp is a reflexive language so that's a very ;; easy thing to do: inspect the function's form, replace occurrences of ;; <nnfrom> (even in strings) with <nnto>, and you're done. ;; * nndiary-get-new-mail, nndiary-mail-source and nndiary-split-methods: ;; NNDiary has some experimental parts, in the sense Gnus normally uses only ;; one mail back ends for mail retrieval and splitting. This back end is ;; also an attempt to make it behave differently. For Gnus developers: as ;; you can see if you snarf into the code, that was not a very difficult ;; thing to do. Something should be done about the respooling breakage ;; though. ;;; Code: (require 'nnoo) (require 'nnheader) (require 'nnmail) (eval-when-compile (require 'cl)) (require 'gnus-start) (require 'gnus-sum) ;; Back End behavior customization =========================================== (defgroup nndiary nil "The Gnus Diary back end." :version "22.1" :group 'gnus-diary) (defcustom nndiary-mail-sources `((file :path ,(expand-file-name "~/.nndiary"))) "NNDiary specific mail sources. This variable is used by nndiary in place of the standard `mail-sources' variable when `nndiary-get-new-mail' is set to non-nil. These sources must contain diary messages ONLY." :group 'nndiary :group 'mail-source :type 'sexp) (defcustom nndiary-split-methods '(("diary" "")) "NNDiary specific split methods. This variable is used by nndiary in place of the standard `nnmail-split-methods' variable when `nndiary-get-new-mail' is set to non-nil." :group 'nndiary :group 'nnmail-split :type '(choice (repeat :tag "Alist" (group (string :tag "Name") regexp)) (function-item nnmail-split-fancy) (function :tag "Other"))) (defcustom nndiary-reminders '((0 . day)) "Different times when you want to be reminded of your appointments. Diary articles will appear again, as if they'd been just received. Entries look like (3 . day) which means something like \"Please Hortense, would you be so kind as to remind me of my appointments 3 days before the date, thank you very much. Anda, hmmm... by the way, are you doing anything special tonight ?\". The units of measure are 'minute 'hour 'day 'week 'month and 'year (no, not 'century, sorry). NOTE: the units of measure actually express dates, not durations: if you use 'week, messages will pop up on Sundays at 00:00 (or Mondays if `nndiary-week-starts-on-monday' is non-nil) and *not* 7 days before the appointment, if you use 'month, messages will pop up on the first day of each months, at 00:00 and so on. If you really want to specify a duration (like 24 hours exactly), you can use the equivalent in minutes (the smallest unit). A fuzz of 60 seconds maximum in the reminder is not that painful, I think. Although this scheme might appear somewhat weird at a first glance, it is very powerful. In order to make this clear, here are some examples: - (0 . day): this is the default value of `nndiary-reminders'. It means pop up the appointments of the day each morning at 00:00. - (1 . day): this means pop up the appointments the day before, at 00:00. - (6 . hour): for an appointment at 18:30, this would pop up the appointment message at 12:00. - (360 . minute): for an appointment at 18:30 and 15 seconds, this would pop up the appointment message at 12:30." :group 'nndiary :type '(repeat (cons :format "%v\n" (integer :format "%v") (choice :format "%[%v(s)%] before...\n" :value day (const :format "%v" minute) (const :format "%v" hour) (const :format "%v" day) (const :format "%v" week) (const :format "%v" month) (const :format "%v" year))))) (defcustom nndiary-week-starts-on-monday nil "Whether a week starts on monday (otherwise, sunday)." :type 'boolean :group 'nndiary) (define-obsolete-variable-alias 'nndiary-request-create-group-hooks 'nndiary-request-create-group-functions "24.3") (defcustom nndiary-request-create-group-functions nil "Hook run after `nndiary-request-create-group' is executed. The hook functions will be called with the full group name as argument." :group 'nndiary :type 'hook) (define-obsolete-variable-alias 'nndiary-request-update-info-hooks 'nndiary-request-update-info-functions "24.3") (defcustom nndiary-request-update-info-functions nil "Hook run after `nndiary-request-update-info-group' is executed. The hook functions will be called with the full group name as argument." :group 'nndiary :type 'hook) (define-obsolete-variable-alias 'nndiary-request-accept-article-hooks 'nndiary-request-accept-article-functions "24.3") (defcustom nndiary-request-accept-article-functions nil "Hook run before accepting an article. Executed near the beginning of `nndiary-request-accept-article'. The hook functions will be called with the article in the current buffer." :group 'nndiary :type 'hook) (defcustom nndiary-check-directory-twice t "If t, check directories twice to avoid NFS failures." :group 'nndiary :type 'boolean) ;; Back End declaration ====================================================== ;; Well, most of this is nnml clonage. (nnoo-declare nndiary) (defvoo nndiary-directory (nnheader-concat gnus-directory "diary/") "Spool directory for the nndiary back end.") (defvoo nndiary-active-file (expand-file-name "active" nndiary-directory) "Active file for the nndiary back end.") (defvoo nndiary-newsgroups-file (expand-file-name "newsgroups" nndiary-directory) "Newsgroups description file for the nndiary back end.") (defvoo nndiary-get-new-mail nil "Whether nndiary gets new mail and split it. Contrary to traditional mail back ends, this variable can be set to t even if your primary mail back end also retrieves mail. In such a case, NDiary uses its own mail-sources and split-methods.") (defvoo nndiary-nov-is-evil nil "If non-nil, Gnus will never use nov databases for nndiary groups. Using nov databases will speed up header fetching considerably. This variable shouldn't be flipped much. If you have, for some reason, set this to t, and want to set it to nil again, you should always run the `nndiary-generate-nov-databases' command. The function will go through all nnml directories and generate nov databases for them all. This may very well take some time.") (defvoo nndiary-prepare-save-mail-hook nil "*Hook run narrowed to an article before saving.") (defvoo nndiary-inhibit-expiry nil "If non-nil, inhibit expiry.") (defconst nndiary-version "0.2-b14" "Current Diary back end version.") (defun nndiary-version () "Current Diary back end version." (interactive) (message "NNDiary version %s" nndiary-version)) (defvoo nndiary-nov-file-name ".overview") (defvoo nndiary-current-directory nil) (defvoo nndiary-current-group nil) (defvoo nndiary-status-string "" ) (defvoo nndiary-nov-buffer-alist nil) (defvoo nndiary-group-alist nil) (defvoo nndiary-active-timestamp nil) (defvoo nndiary-article-file-alist nil) (defvoo nndiary-generate-active-function 'nndiary-generate-active-info) (defvoo nndiary-nov-buffer-file-name nil) (defvoo nndiary-file-coding-system nnmail-file-coding-system) (defconst nndiary-headers '(("Minute" 0 59) ("Hour" 0 23) ("Dom" 1 31) ("Month" 1 12) ("Year" 1971) ("Dow" 0 6) ("Time-Zone" (("Y" -43200) ("X" -39600) ("W" -36000) ("V" -32400) ("U" -28800) ("PST" -28800) ("T" -25200) ("MST" -25200) ("PDT" -25200) ("S" -21600) ("CST" -21600) ("MDT" -21600) ("R" -18000) ("EST" -18000) ("CDT" -18000) ("Q" -14400) ("AST" -14400) ("EDT" -14400) ("P" -10800) ("ADT" -10800) ("O" -7200) ("N" -3600) ("Z" 0) ("GMT" 0) ("UT" 0) ("UTC" 0) ("WET" 0) ("A" 3600) ("CET" 3600) ("MET" 3600) ("MEZ" 3600) ("BST" 3600) ("WEST" 3600) ("B" 7200) ("EET" 7200) ("CEST" 7200) ("MEST" 7200) ("MESZ" 7200) ("C" 10800) ("D" 14400) ("E" 18000) ("F" 21600) ("G" 25200) ("H" 28800) ("I" 32400) ("JST" 32400) ("K" 36000) ("GST" 36000) ("L" 39600) ("M" 43200) ("NZST" 43200) ("NZDT" 46800)))) ;; List of NNDiary headers that specify the time spec. Each header name is ;; followed by either two integers (specifying a range of possible values ;; for this header) or one list (specifying all the possible values for this ;; header). In the latter case, the list does NOT include the unspecified ;; spec (*). ;; For time zone values, we have symbolic time zone names associated with ;; the (relative) number of seconds ahead GMT. ) (defsubst nndiary-schedule () (let (head) (condition-case arg (mapcar (lambda (elt) (setq head (nth 0 elt)) (nndiary-parse-schedule (nth 0 elt) (nth 1 elt) (nth 2 elt))) nndiary-headers) (error (nnheader-report 'nndiary "X-Diary-%s header parse error: %s." head (cdr arg)) nil)) )) ;;; Interface functions ===================================================== (nnoo-define-basics nndiary) (deffoo nndiary-retrieve-headers (sequence &optional group server fetch-old) (when (nndiary-possibly-change-directory group server) (with-current-buffer nntp-server-buffer (erase-buffer) (let* ((file nil) (number (length sequence)) (count 0) (file-name-coding-system nnmail-pathname-coding-system) beg article (nndiary-check-directory-twice (and nndiary-check-directory-twice ;; To speed up, disable it in some case. (or (not (numberp nnmail-large-newsgroup)) (<= number nnmail-large-newsgroup))))) (if (stringp (car sequence)) 'headers (if (nndiary-retrieve-headers-with-nov sequence fetch-old) 'nov (while sequence (setq article (car sequence)) (setq file (nndiary-article-to-file article)) (when (and file (file-exists-p file) (not (file-directory-p file))) (insert (format "221 %d Article retrieved.\n" article)) (setq beg (point)) (nnheader-insert-head file) (goto-char beg) (if (search-forward "\n\n" nil t) (forward-char -1) (goto-char (point-max)) (insert "\n\n")) (insert ".\n") (delete-region (point) (point-max))) (setq sequence (cdr sequence)) (setq count (1+ count)) (and (numberp nnmail-large-newsgroup) (> number nnmail-large-newsgroup) (zerop (% count 20)) (nnheader-message 6 "nndiary: Receiving headers... %d%%" (floor (* count 100.0) number)))) (and (numberp nnmail-large-newsgroup) (> number nnmail-large-newsgroup) (nnheader-message 6 "nndiary: Receiving headers...done")) (nnheader-fold-continuation-lines) 'headers)))))) (deffoo nndiary-open-server (server &optional defs) (nnoo-change-server 'nndiary server defs) (when (not (file-exists-p nndiary-directory)) (ignore-errors (make-directory nndiary-directory t))) (cond ((not (file-exists-p nndiary-directory)) (nndiary-close-server) (nnheader-report 'nndiary "Couldn't create directory: %s" nndiary-directory)) ((not (file-directory-p (file-truename nndiary-directory))) (nndiary-close-server) (nnheader-report 'nndiary "Not a directory: %s" nndiary-directory)) (t (nnheader-report 'nndiary "Opened server %s using directory %s" server nndiary-directory) t))) (deffoo nndiary-request-regenerate (server) (nndiary-possibly-change-directory nil server) (nndiary-generate-nov-databases server) t) (deffoo nndiary-request-article (id &optional group server buffer) (nndiary-possibly-change-directory group server) (let* ((nntp-server-buffer (or buffer nntp-server-buffer)) (file-name-coding-system nnmail-pathname-coding-system) path gpath group-num) (if (stringp id) (when (and (setq group-num (nndiary-find-group-number id)) (cdr (assq (cdr group-num) (nnheader-article-to-file-alist (setq gpath (nnmail-group-pathname (car group-num) nndiary-directory)))))) (setq path (concat gpath (int-to-string (cdr group-num))))) (setq path (nndiary-article-to-file id))) (cond ((not path) (nnheader-report 'nndiary "No such article: %s" id)) ((not (file-exists-p path)) (nnheader-report 'nndiary "No such file: %s" path)) ((file-directory-p path) (nnheader-report 'nndiary "File is a directory: %s" path)) ((not (save-excursion (let ((nnmail-file-coding-system nndiary-file-coding-system)) (nnmail-find-file path)))) (nnheader-report 'nndiary "Couldn't read file: %s" path)) (t (nnheader-report 'nndiary "Article %s retrieved" id) ;; We return the article number. (cons (if group-num (car group-num) group) (string-to-number (file-name-nondirectory path))))))) (deffoo nndiary-request-group (group &optional server dont-check info) (let ((file-name-coding-system nnmail-pathname-coding-system)) (cond ((not (nndiary-possibly-change-directory group server)) (nnheader-report 'nndiary "Invalid group (no such directory)")) ((not (file-exists-p nndiary-current-directory)) (nnheader-report 'nndiary "Directory %s does not exist" nndiary-current-directory)) ((not (file-directory-p nndiary-current-directory)) (nnheader-report 'nndiary "%s is not a directory" nndiary-current-directory)) (dont-check (nnheader-report 'nndiary "Group %s selected" group) t) (t (nnheader-re-read-dir nndiary-current-directory) (nnmail-activate 'nndiary) (let ((active (nth 1 (assoc group nndiary-group-alist)))) (if (not active) (nnheader-report 'nndiary "No such group: %s" group) (nnheader-report 'nndiary "Selected group %s" group) (nnheader-insert "211 %d %d %d %s\n" (max (1+ (- (cdr active) (car active))) 0) (car active) (cdr active) group))))))) (deffoo nndiary-request-scan (&optional group server) ;; Use our own mail sources and split methods while Gnus doesn't let us have ;; multiple back ends for retrieving mail. (let ((mail-sources nndiary-mail-sources) (nnmail-split-methods nndiary-split-methods)) (setq nndiary-article-file-alist nil) (nndiary-possibly-change-directory group server) (nnmail-get-new-mail 'nndiary 'nndiary-save-nov nndiary-directory group))) (deffoo nndiary-close-group (group &optional server) (setq nndiary-article-file-alist nil) t) (deffoo nndiary-request-create-group (group &optional server args) (nndiary-possibly-change-directory nil server) (nnmail-activate 'nndiary) (cond ((assoc group nndiary-group-alist) t) ((and (file-exists-p (nnmail-group-pathname group nndiary-directory)) (not (file-directory-p (nnmail-group-pathname group nndiary-directory)))) (nnheader-report 'nndiary "%s is a file" (nnmail-group-pathname group nndiary-directory))) (t (let (active) (push (list group (setq active (cons 1 0))) nndiary-group-alist) (nndiary-possibly-create-directory group) (nndiary-possibly-change-directory group server) (let ((articles (nnheader-directory-articles nndiary-current-directory))) (when articles (setcar active (apply 'min articles)) (setcdr active (apply 'max articles)))) (nnmail-save-active nndiary-group-alist nndiary-active-file) (run-hook-with-args 'nndiary-request-create-group-functions (gnus-group-prefixed-name group (list "nndiary" server))) t)) )) (deffoo nndiary-request-list (&optional server) (save-excursion (let ((nnmail-file-coding-system nnmail-active-file-coding-system) (file-name-coding-system nnmail-pathname-coding-system)) (nnmail-find-file nndiary-active-file)) (setq nndiary-group-alist (nnmail-get-active)) t)) (deffoo nndiary-request-newgroups (date &optional server) (nndiary-request-list server)) (deffoo nndiary-request-list-newsgroups (&optional server) (save-excursion (nnmail-find-file nndiary-newsgroups-file))) (deffoo nndiary-request-expire-articles (articles group &optional server force) (nndiary-possibly-change-directory group server) (let ((active-articles (nnheader-directory-articles nndiary-current-directory)) article rest number) (nnmail-activate 'nndiary) ;; Articles not listed in active-articles are already gone, ;; so don't try to expire them. (setq articles (gnus-intersection articles active-articles)) (while articles (setq article (nndiary-article-to-file (setq number (pop articles)))) (if (and (nndiary-deletable-article-p group number) ;; Don't use nnmail-expired-article-p. Our notion of expiration ;; is a bit peculiar ... (or force (nndiary-expired-article-p article))) (progn ;; Allow a special target group. (unless (eq nnmail-expiry-target 'delete) (with-temp-buffer (nndiary-request-article number group server (current-buffer)) (let ((nndiary-current-directory nil)) (nnmail-expiry-target-group nnmail-expiry-target group))) (nndiary-possibly-change-directory group server)) (nnheader-message 5 "Deleting article %s in %s" number group) (condition-case () (funcall nnmail-delete-file-function article) (file-error (push number rest))) (setq active-articles (delq number active-articles)) (nndiary-nov-delete-article group number)) (push number rest))) (let ((active (nth 1 (assoc group nndiary-group-alist)))) (when active (setcar active (or (and active-articles (apply 'min active-articles)) (1+ (cdr active))))) (nnmail-save-active nndiary-group-alist nndiary-active-file)) (nndiary-save-nov) (nconc rest articles))) (deffoo nndiary-request-move-article (article group server accept-form &optional last move-is-internal) (let ((buf (get-buffer-create " *nndiary move*")) result) (nndiary-possibly-change-directory group server) (nndiary-update-file-alist) (and (nndiary-deletable-article-p group article) (nndiary-request-article article group server) (let (nndiary-current-directory nndiary-current-group nndiary-article-file-alist) (with-current-buffer buf (insert-buffer-substring nntp-server-buffer) (setq result (eval accept-form)) (kill-buffer (current-buffer)) result)) (progn (nndiary-possibly-change-directory group server) (condition-case () (funcall nnmail-delete-file-function (nndiary-article-to-file article)) (file-error nil)) (nndiary-nov-delete-article group article) (when last (nndiary-save-nov) (nnmail-save-active nndiary-group-alist nndiary-active-file)))) result)) (deffoo nndiary-request-accept-article (group &optional server last) (nndiary-possibly-change-directory group server) (nnmail-check-syntax) (run-hooks 'nndiary-request-accept-article-functions) (when (nndiary-schedule) (let (result) (when nnmail-cache-accepted-message-ids (nnmail-cache-insert (nnmail-fetch-field "message-id") group (nnmail-fetch-field "subject"))) (if (stringp group) (and (nnmail-activate 'nndiary) (setq result (car (nndiary-save-mail (list (cons group (nndiary-active-number group)))))) (progn (nnmail-save-active nndiary-group-alist nndiary-active-file) (and last (nndiary-save-nov)))) (and (nnmail-activate 'nndiary) (if (and (not (setq result (nnmail-article-group 'nndiary-active-number))) (yes-or-no-p "Moved to `junk' group; delete article? ")) (setq result 'junk) (setq result (car (nndiary-save-mail result)))) (when last (nnmail-save-active nndiary-group-alist nndiary-active-file) (when nnmail-cache-accepted-message-ids (nnmail-cache-close)) (nndiary-save-nov)))) result)) ) (deffoo nndiary-request-post (&optional server) (nnmail-do-request-post 'nndiary-request-accept-article server)) (deffoo nndiary-request-replace-article (article group buffer) (nndiary-possibly-change-directory group) (with-current-buffer buffer (nndiary-possibly-create-directory group) (let ((chars (nnmail-insert-lines)) (art (concat (int-to-string article) "\t")) headers) (when (ignore-errors (nnmail-write-region (point-min) (point-max) (or (nndiary-article-to-file article) (expand-file-name (int-to-string article) nndiary-current-directory)) nil (if (nnheader-be-verbose 5) nil 'nomesg)) t) (setq headers (nndiary-parse-head chars article)) ;; Replace the NOV line in the NOV file. (with-current-buffer (nndiary-open-nov group) (goto-char (point-min)) (if (or (looking-at art) (search-forward (concat "\n" art) nil t)) ;; Delete the old NOV line. (delete-region (progn (beginning-of-line) (point)) (progn (forward-line 1) (point))) ;; The line isn't here, so we have to find out where ;; we should insert it. (This situation should never ;; occur, but one likes to make sure...) (while (and (looking-at "[0-9]+\t") (< (string-to-number (buffer-substring (match-beginning 0) (match-end 0))) article) (zerop (forward-line 1))))) (beginning-of-line) (nnheader-insert-nov headers) (nndiary-save-nov) t))))) (deffoo nndiary-request-delete-group (group &optional force server) (nndiary-possibly-change-directory group server) (when force ;; Delete all articles in GROUP. (let ((articles (directory-files nndiary-current-directory t (concat nnheader-numerical-short-files "\\|" (regexp-quote nndiary-nov-file-name) "$"))) article) (while articles (setq article (pop articles)) (when (file-writable-p article) (nnheader-message 5 "Deleting article %s in %s..." article group) (funcall nnmail-delete-file-function article)))) ;; Try to delete the directory itself. (ignore-errors (delete-directory nndiary-current-directory))) ;; Remove the group from all structures. (setq nndiary-group-alist (delq (assoc group nndiary-group-alist) nndiary-group-alist) nndiary-current-group nil nndiary-current-directory nil) ;; Save the active file. (nnmail-save-active nndiary-group-alist nndiary-active-file) t) (deffoo nndiary-request-rename-group (group new-name &optional server) (nndiary-possibly-change-directory group server) (let ((new-dir (nnmail-group-pathname new-name nndiary-directory)) (old-dir (nnmail-group-pathname group nndiary-directory))) (when (ignore-errors (make-directory new-dir t) t) ;; We move the articles file by file instead of renaming ;; the directory -- there may be subgroups in this group. ;; One might be more clever, I guess. (let ((files (nnheader-article-to-file-alist old-dir))) (while files (rename-file (concat old-dir (cdar files)) (concat new-dir (cdar files))) (pop files))) ;; Move .overview file. (let ((overview (concat old-dir nndiary-nov-file-name))) (when (file-exists-p overview) (rename-file overview (concat new-dir nndiary-nov-file-name)))) (when (<= (length (directory-files old-dir)) 2) (ignore-errors (delete-directory old-dir))) ;; That went ok, so we change the internal structures. (let ((entry (assoc group nndiary-group-alist))) (when entry (setcar entry new-name)) (setq nndiary-current-directory nil nndiary-current-group nil) ;; Save the new group alist. (nnmail-save-active nndiary-group-alist nndiary-active-file) t)))) (deffoo nndiary-set-status (article name value &optional group server) (nndiary-possibly-change-directory group server) (let ((file (nndiary-article-to-file article))) (cond ((not (file-exists-p file)) (nnheader-report 'nndiary "File %s does not exist" file)) (t (with-temp-file file (nnheader-insert-file-contents file) (nnmail-replace-status name value)) t)))) ;;; Interface optional functions ============================================ (deffoo nndiary-request-update-info (group info &optional server) (nndiary-possibly-change-directory group) (let ((timestamp (gnus-group-parameter-value (gnus-info-params info) 'timestamp t))) (if (not timestamp) (nnheader-report 'nndiary "Group %s doesn't have a timestamp" group) ;; else ;; Figure out which articles should be re-new'ed (let ((articles (nndiary-flatten (gnus-info-read info) 0)) article file unread buf) (save-excursion (setq buf (nnheader-set-temp-buffer " *nndiary update*")) (while (setq article (pop articles)) (setq file (concat nndiary-current-directory (int-to-string article))) (and (file-exists-p file) (nndiary-renew-article-p file timestamp) (push article unread))) ;;(message "unread: %s" unread) (sit-for 1) (kill-buffer buf)) (setq unread (sort unread '<)) (and unread (gnus-info-set-read info (gnus-update-read-articles (gnus-info-group info) unread t))) )) (run-hook-with-args 'nndiary-request-update-info-functions (gnus-info-group info)) t)) ;;; Internal functions ====================================================== (defun nndiary-article-to-file (article) (nndiary-update-file-alist) (let (file) (if (setq file (cdr (assq article nndiary-article-file-alist))) (expand-file-name file nndiary-current-directory) ;; Just to make sure nothing went wrong when reading over NFS -- ;; check once more. (if nndiary-check-directory-twice (when (file-exists-p (setq file (expand-file-name (number-to-string article) nndiary-current-directory))) (nndiary-update-file-alist t) file))))) (defun nndiary-deletable-article-p (group article) "Say whether ARTICLE in GROUP can be deleted." (let (path) (when (setq path (nndiary-article-to-file article)) (when (file-writable-p path) (or (not nnmail-keep-last-article) (not (eq (cdr (nth 1 (assoc group nndiary-group-alist))) article))))))) ;; Find an article number in the current group given the Message-ID. (defun nndiary-find-group-number (id) (with-current-buffer (get-buffer-create " *nndiary id*") (let ((alist nndiary-group-alist) number) ;; We want to look through all .overview files, but we want to ;; start with the one in the current directory. It seems most ;; likely that the article we are looking for is in that group. (if (setq number (nndiary-find-id nndiary-current-group id)) (cons nndiary-current-group number) ;; It wasn't there, so we look through the other groups as well. (while (and (not number) alist) (or (string= (caar alist) nndiary-current-group) (setq number (nndiary-find-id (caar alist) id))) (or number (setq alist (cdr alist)))) (and number (cons (caar alist) number)))))) (defun nndiary-find-id (group id) (erase-buffer) (let ((nov (expand-file-name nndiary-nov-file-name (nnmail-group-pathname group nndiary-directory))) number found) (when (file-exists-p nov) (nnheader-insert-file-contents nov) (while (and (not found) (search-forward id nil t)) ; We find the ID. ;; And the id is in the fourth field. (if (not (and (search-backward "\t" nil t 4) (not (search-backward"\t" (point-at-bol) t)))) (forward-line 1) (beginning-of-line) (setq found t) ;; We return the article number. (setq number (ignore-errors (read (current-buffer)))))) number))) (defun nndiary-retrieve-headers-with-nov (articles &optional fetch-old) (if (or gnus-nov-is-evil nndiary-nov-is-evil) nil (let ((nov (expand-file-name nndiary-nov-file-name nndiary-current-directory))) (when (file-exists-p nov) (with-current-buffer nntp-server-buffer (erase-buffer) (nnheader-insert-file-contents nov) (if (and fetch-old (not (numberp fetch-old))) t ; Don't remove anything. (nnheader-nov-delete-outside-range (if fetch-old (max 1 (- (car articles) fetch-old)) (car articles)) (car (last articles))) t)))))) (defun nndiary-possibly-change-directory (group &optional server) (when (and server (not (nndiary-server-opened server))) (nndiary-open-server server)) (if (not group) t (let ((pathname (nnmail-group-pathname group nndiary-directory)) (file-name-coding-system nnmail-pathname-coding-system)) (when (not (equal pathname nndiary-current-directory)) (setq nndiary-current-directory pathname nndiary-current-group group nndiary-article-file-alist nil)) (file-exists-p nndiary-current-directory)))) (defun nndiary-possibly-create-directory (group) (let ((dir (nnmail-group-pathname group nndiary-directory))) (unless (file-exists-p dir) (make-directory (directory-file-name dir) t) (nnheader-message 5 "Creating mail directory %s" dir)))) (defun nndiary-save-mail (group-art) "Called narrowed to an article." (let (chars headers) (setq chars (nnmail-insert-lines)) (nnmail-insert-xref group-art) (run-hooks 'nnmail-prepare-save-mail-hook) (run-hooks 'nndiary-prepare-save-mail-hook) (goto-char (point-min)) (while (looking-at "From ") (replace-match "X-From-Line: ") (forward-line 1)) ;; We save the article in all the groups it belongs in. (let ((ga group-art) first) (while ga (nndiary-possibly-create-directory (caar ga)) (let ((file (concat (nnmail-group-pathname (caar ga) nndiary-directory) (int-to-string (cdar ga))))) (if first ;; It was already saved, so we just make a hard link. (funcall nnmail-crosspost-link-function first file t) ;; Save the article. (nnmail-write-region (point-min) (point-max) file nil (if (nnheader-be-verbose 5) nil 'nomesg)) (setq first file))) (setq ga (cdr ga)))) ;; Generate a nov line for this article. We generate the nov ;; line after saving, because nov generation destroys the ;; header. (setq headers (nndiary-parse-head chars)) ;; Output the nov line to all nov databases that should have it. (let ((ga group-art)) (while ga (nndiary-add-nov (caar ga) (cdar ga) headers) (setq ga (cdr ga)))) group-art)) (defun nndiary-active-number (group) "Compute the next article number in GROUP." (let ((active (cadr (assoc group nndiary-group-alist)))) ;; The group wasn't known to nndiary, so we just create an active ;; entry for it. (unless active ;; Perhaps the active file was corrupt? See whether ;; there are any articles in this group. (nndiary-possibly-create-directory group) (nndiary-possibly-change-directory group) (unless nndiary-article-file-alist (setq nndiary-article-file-alist (sort (nnheader-article-to-file-alist nndiary-current-directory) 'car-less-than-car))) (setq active (if nndiary-article-file-alist (cons (caar nndiary-article-file-alist) (caar (last nndiary-article-file-alist))) (cons 1 0))) (push (list group active) nndiary-group-alist)) (setcdr active (1+ (cdr active))) (while (file-exists-p (expand-file-name (int-to-string (cdr active)) (nnmail-group-pathname group nndiary-directory))) (setcdr active (1+ (cdr active)))) (cdr active))) (defun nndiary-add-nov (group article headers) "Add a nov line for the GROUP base." (with-current-buffer (nndiary-open-nov group) (goto-char (point-max)) (mail-header-set-number headers article) (nnheader-insert-nov headers))) (defsubst nndiary-header-value () (buffer-substring (match-end 0) (progn (end-of-line) (point)))) (defun nndiary-parse-head (chars &optional number) "Parse the head of the current buffer." (save-excursion (save-restriction (unless (zerop (buffer-size)) (narrow-to-region (goto-char (point-min)) (if (search-forward "\n\n" nil t) (1- (point)) (point-max)))) (let ((headers (nnheader-parse-naked-head))) (mail-header-set-chars headers chars) (mail-header-set-number headers number) headers)))) (defun nndiary-open-nov (group) (or (cdr (assoc group nndiary-nov-buffer-alist)) (let ((buffer (get-buffer-create (format " *nndiary overview %s*" group)))) (with-current-buffer buffer (set (make-local-variable 'nndiary-nov-buffer-file-name) (expand-file-name nndiary-nov-file-name (nnmail-group-pathname group nndiary-directory))) (erase-buffer) (when (file-exists-p nndiary-nov-buffer-file-name) (nnheader-insert-file-contents nndiary-nov-buffer-file-name))) (push (cons group buffer) nndiary-nov-buffer-alist) buffer))) (defun nndiary-save-nov () (save-excursion (while nndiary-nov-buffer-alist (when (buffer-name (cdar nndiary-nov-buffer-alist)) (set-buffer (cdar nndiary-nov-buffer-alist)) (when (buffer-modified-p) (nnmail-write-region 1 (point-max) nndiary-nov-buffer-file-name nil 'nomesg)) (set-buffer-modified-p nil) (kill-buffer (current-buffer))) (setq nndiary-nov-buffer-alist (cdr nndiary-nov-buffer-alist))))) ;;;###autoload (defun nndiary-generate-nov-databases (&optional server) "Generate NOV databases in all nndiary directories." (interactive (list (or (nnoo-current-server 'nndiary) ""))) ;; Read the active file to make sure we don't re-use articles ;; numbers in empty groups. (nnmail-activate 'nndiary) (unless (nndiary-server-opened server) (nndiary-open-server server)) (setq nndiary-directory (expand-file-name nndiary-directory)) ;; Recurse down the directories. (nndiary-generate-nov-databases-1 nndiary-directory nil t) ;; Save the active file. (nnmail-save-active nndiary-group-alist nndiary-active-file)) (defun nndiary-generate-nov-databases-1 (dir &optional seen no-active) "Regenerate the NOV database in DIR." (interactive "DRegenerate NOV in: ") (setq dir (file-name-as-directory dir)) ;; Only scan this sub-tree if we haven't been here yet. (unless (member (file-truename dir) seen) (push (file-truename dir) seen) ;; We descend recursively (let ((dirs (directory-files dir t nil t)) dir) (while (setq dir (pop dirs)) (when (and (not (string-match "^\\." (file-name-nondirectory dir))) (file-directory-p dir)) (nndiary-generate-nov-databases-1 dir seen)))) ;; Do this directory. (let ((nndiary-files (sort (nnheader-article-to-file-alist dir) 'car-less-than-car))) (if (not nndiary-files) (let* ((group (nnheader-file-to-group (directory-file-name dir) nndiary-directory)) (info (cadr (assoc group nndiary-group-alist)))) (when info (setcar info (1+ (cdr info))))) (funcall nndiary-generate-active-function dir) ;; Generate the nov file. (nndiary-generate-nov-file dir nndiary-files) (unless no-active (nnmail-save-active nndiary-group-alist nndiary-active-file)))))) (defvar nndiary-files) ; dynamically bound in nndiary-generate-nov-databases-1 (defun nndiary-generate-active-info (dir) ;; Update the active info for this group. (let* ((group (nnheader-file-to-group (directory-file-name dir) nndiary-directory)) (entry (assoc group nndiary-group-alist)) (last (or (caadr entry) 0))) (setq nndiary-group-alist (delq entry nndiary-group-alist)) (push (list group (cons (or (caar nndiary-files) (1+ last)) (max last (or (caar (last nndiary-files)) 0)))) nndiary-group-alist))) (defun nndiary-generate-nov-file (dir files) (let* ((dir (file-name-as-directory dir)) (nov (concat dir nndiary-nov-file-name)) (nov-buffer (get-buffer-create " *nov*")) chars file headers) ;; Init the nov buffer. (with-current-buffer nov-buffer (buffer-disable-undo) (erase-buffer) (set-buffer nntp-server-buffer) ;; Delete the old NOV file. (when (file-exists-p nov) (funcall nnmail-delete-file-function nov)) (while files (unless (file-directory-p (setq file (concat dir (cdar files)))) (erase-buffer) (nnheader-insert-file-contents file) (narrow-to-region (goto-char (point-min)) (progn (search-forward "\n\n" nil t) (setq chars (- (point-max) (point))) (max 1 (1- (point))))) (unless (zerop (buffer-size)) (goto-char (point-min)) (setq headers (nndiary-parse-head chars (caar files))) (with-current-buffer nov-buffer (goto-char (point-max)) (nnheader-insert-nov headers))) (widen)) (setq files (cdr files))) (with-current-buffer nov-buffer (nnmail-write-region 1 (point-max) nov nil 'nomesg) (kill-buffer (current-buffer)))))) (defun nndiary-nov-delete-article (group article) (with-current-buffer (nndiary-open-nov group) (when (nnheader-find-nov-line article) (delete-region (point) (progn (forward-line 1) (point))) (when (bobp) (let ((active (cadr (assoc group nndiary-group-alist))) num) (when active (if (eobp) (setf (car active) (1+ (cdr active))) (when (and (setq num (ignore-errors (read (current-buffer)))) (numberp num)) (setf (car active) num))))))) t)) (defun nndiary-update-file-alist (&optional force) (when (or (not nndiary-article-file-alist) force) (setq nndiary-article-file-alist (nnheader-article-to-file-alist nndiary-current-directory)))) (defun nndiary-string-to-number (str min &optional max) ;; Like `string-to-number' but barf if STR is not exactly an integer, and not ;; within the specified bounds. ;; Signals are caught by `nndiary-schedule'. (if (not (string-match "^[ \t]*[0-9]+[ \t]*$" str)) (error "Not an integer value") ;; else (let ((val (string-to-number str))) (and (or (< val min) (and max (> val max))) (error "Value out of range")) val))) (defun nndiary-parse-schedule-value (str min-or-values max) ;; Parse the schedule string STR, or signal an error. ;; Signals are caught by `nndiary-schedule'. (if (string-match "[ \t]*\\*[ \t]*" str) ;; unspecified nil ;; specified (if (listp min-or-values) ;; min-or-values is values ;; #### NOTE: this is actually only a hack for time zones. (let ((val (and (string-match "[ \t]*\\([^ \t]+\\)[ \t]*" str) (match-string 1 str)))) (if (and val (setq val (assoc val min-or-values))) (list (cadr val)) (error "Invalid syntax"))) ;; min-or-values is min (mapcar (lambda (val) (let ((res (split-string val "-"))) (cond ((= (length res) 1) (nndiary-string-to-number (car res) min-or-values max)) ((= (length res) 2) ;; don't know if crontab accepts this, but ensure ;; that BEG is <= END (let ((beg (nndiary-string-to-number (car res) min-or-values max)) (end (nndiary-string-to-number (cadr res) min-or-values max))) (cond ((< beg end) (cons beg end)) ((= beg end) beg) (t (cons end beg))))) (t (error "Invalid syntax"))) )) (split-string str ","))) )) ;; ### FIXME: remove this function if it's used only once. (defun nndiary-parse-schedule (head min-or-values max) ;; Parse the cron-like value of header X-Diary-HEAD in current buffer. ;; - Returns nil if `*' ;; - Otherwise returns a list of integers and/or ranges (BEG . END) ;; The exception is the Timze-Zone value which is always of the form (STR). ;; Signals are caught by `nndiary-schedule'. (let ((header (format "^X-Diary-%s: \\(.*\\)$" head))) (goto-char (point-min)) (if (not (re-search-forward header nil t)) (error "Header missing") ;; else (nndiary-parse-schedule-value (match-string 1) min-or-values max)) )) (defun nndiary-max (spec) ;; Returns the max of specification SPEC, or nil for permanent schedules. (unless (null spec) (let ((elts spec) (max 0) elt) (while (setq elt (pop elts)) (if (integerp elt) (and (> elt max) (setq max elt)) (and (> (cdr elt) max) (setq max (cdr elt))))) max))) (defun nndiary-flatten (spec min &optional max) ;; flatten the spec by expanding ranges to all possible values. (let (flat n) (cond ((null spec) ;; this happens when I flatten something else than one of my ;; schedules (a list of read articles for instance). (unless (null max) (setq n min) (while (<= n max) (push n flat) (setq n (1+ n))))) (t (let ((elts spec) elt) (while (setq elt (pop elts)) (if (integerp elt) (push elt flat) ;; else (setq n (car elt)) (while (<= n (cdr elt)) (push n flat) (setq n (1+ n)))))))) flat)) (defun nndiary-unflatten (spec) ;; opposite of flatten: build ranges if possible (setq spec (sort spec '<)) (let (min max res) (while (setq min (pop spec)) (setq max min) (while (and (car spec) (= (car spec) (1+ max))) (setq max (1+ max)) (pop spec)) (if (= max min) (setq res (append res (list min))) (setq res (append res (list (cons min max)))))) res)) (defun nndiary-compute-reminders (date) ;; Returns a list of times corresponding to the reminders of date DATE. ;; See the comment in `nndiary-reminders' about rounding. (let* ((reminders nndiary-reminders) (date-elts (decode-time date)) ;; ### NOTE: out-of-range values are accepted by encode-time. This ;; makes our life easier. (monday (- (nth 3 date-elts) (if nndiary-week-starts-on-monday (if (zerop (nth 6 date-elts)) 6 (- (nth 6 date-elts) 1)) (nth 6 date-elts)))) reminder res) ;; remove the DOW and DST entries (setcdr (nthcdr 5 date-elts) (nthcdr 8 date-elts)) (while (setq reminder (pop reminders)) (push (cond ((eq (cdr reminder) 'minute) (time-subtract (apply 'encode-time 0 (nthcdr 1 date-elts)) (seconds-to-time (* (car reminder) 60.0)))) ((eq (cdr reminder) 'hour) (time-subtract (apply 'encode-time 0 0 (nthcdr 2 date-elts)) (seconds-to-time (* (car reminder) 3600.0)))) ((eq (cdr reminder) 'day) (time-subtract (apply 'encode-time 0 0 0 (nthcdr 3 date-elts)) (seconds-to-time (* (car reminder) 86400.0)))) ((eq (cdr reminder) 'week) (time-subtract (apply 'encode-time 0 0 0 monday (nthcdr 4 date-elts)) (seconds-to-time (* (car reminder) 604800.0)))) ((eq (cdr reminder) 'month) (time-subtract (apply 'encode-time 0 0 0 1 (nthcdr 4 date-elts)) (seconds-to-time (* (car reminder) 18748800.0)))) ((eq (cdr reminder) 'year) (time-subtract (apply 'encode-time 0 0 0 1 1 (nthcdr 5 date-elts)) (seconds-to-time (* (car reminder) 400861056.0))))) res)) (sort res 'time-less-p))) (defun nndiary-last-occurrence (sched) ;; Returns the last occurrence of schedule SCHED as an Emacs time struct, or ;; nil for permanent schedule or errors. (let ((minute (nndiary-max (nth 0 sched))) (hour (nndiary-max (nth 1 sched))) (year (nndiary-max (nth 4 sched))) (time-zone (or (and (nth 6 sched) (car (nth 6 sched))) (current-time-zone)))) (when year (or minute (setq minute 59)) (or hour (setq hour 23)) ;; I'll just compute all possible values and test them by decreasing ;; order until one succeeds. This is probably quite rude, but I got ;; bored in finding a good algorithm for doing that ;-) ;; ### FIXME: remove identical entries. (let ((dom-list (nth 2 sched)) (month-list (sort (nndiary-flatten (nth 3 sched) 1 12) '>)) (year-list (sort (nndiary-flatten (nth 4 sched) 1971) '>)) (dow-list (nth 5 sched))) ;; Special case: an asterisk in one of the days specifications means ;; that only the other should be taken into account. If both are ;; unspecified, you would get all possible days in both. (cond ((null dow-list) ;; this gets all days if dom-list is nil (setq dom-list (nndiary-flatten dom-list 1 31))) ((null dom-list) ;; this also gets all days if dow-list is nil (setq dow-list (nndiary-flatten dow-list 0 6))) (t (setq dom-list (nndiary-flatten dom-list 1 31)) (setq dow-list (nndiary-flatten dow-list 0 6)))) (or (catch 'found (while (setq year (pop year-list)) (let ((months month-list) month) (while (setq month (pop months)) ;; Now we must merge the Dows with the Doms. To do that, we ;; have to know which day is the 1st one for this month. ;; Maybe there's simpler, but decode-time(encode-time) will ;; give us the answer. (let ((first (nth 6 (decode-time (encode-time 0 0 0 1 month year time-zone)))) (max (cond ((= month 2) (if (date-leap-year-p year) 29 28)) ((<= month 7) (if (zerop (% month 2)) 30 31)) (t (if (zerop (% month 2)) 31 30)))) (doms dom-list) (dows dow-list) day days) ;; first, review the doms to see if they are valid. (while (setq day (pop doms)) (and (<= day max) (push day days))) ;; second add all possible dows (while (setq day (pop dows)) ;; days start at 1. (setq day (1+ (- day first))) (and (< day 0) (setq day (+ 7 day))) (while (<= day max) (push day days) (setq day (+ 7 day)))) ;; Finally, if we have some days, they are valid (when days (sort days '>) (throw 'found (encode-time 0 minute hour (car days) month year time-zone))) ))))) ;; There's an upper limit, but we didn't find any last occurrence. ;; This means that the schedule is undecidable. This can happen if ;; you happen to say something like "each Feb 31 until 2038". (progn (nnheader-report 'nndiary "Undecidable schedule") nil)) )))) (define-obsolete-function-alias 'nndiary-last-occurence 'nndiary-last-occurrence "26.1") (defun nndiary-next-occurrence (sched now) ;; Returns the next occurrence of schedule SCHED, starting from time NOW. ;; If there's no next occurrence, returns the last one (if any) which is then ;; in the past. (let* ((today (decode-time now)) (this-minute (nth 1 today)) (this-hour (nth 2 today)) (this-day (nth 3 today)) (this-month (nth 4 today)) (this-year (nth 5 today)) (minute-list (sort (nndiary-flatten (nth 0 sched) 0 59) '<)) (hour-list (sort (nndiary-flatten (nth 1 sched) 0 23) '<)) (dom-list (nth 2 sched)) (month-list (sort (nndiary-flatten (nth 3 sched) 1 12) '<)) (years (if (nth 4 sched) (sort (nndiary-flatten (nth 4 sched) 1971) '<) t)) (dow-list (nth 5 sched)) (year (1- this-year)) (time-zone (or (and (nth 6 sched) (car (nth 6 sched))) (current-time-zone)))) ;; Special case: an asterisk in one of the days specifications means that ;; only the other should be taken into account. If both are unspecified, ;; you would get all possible days in both. (cond ((null dow-list) ;; this gets all days if dom-list is nil (setq dom-list (nndiary-flatten dom-list 1 31))) ((null dom-list) ;; this also gets all days if dow-list is nil (setq dow-list (nndiary-flatten dow-list 0 6))) (t (setq dom-list (nndiary-flatten dom-list 1 31)) (setq dow-list (nndiary-flatten dow-list 0 6)))) ;; Remove past years. (unless (eq years t) (while (and (car years) (< (car years) this-year)) (pop years))) (if years ;; Because we might not be limited in years, we must guard against ;; infinite loops. Appart from cases like Feb 31, there are probably ;; other ones, (no monday XXX 2nd etc). I don't know any algorithm to ;; decide this, so I assume that if we reach 10 years later, the ;; schedule is undecidable. (or (catch 'found (while (if (eq years t) (and (setq year (1+ year)) (<= year (+ 10 this-year))) (setq year (pop years))) (let ((months month-list) month) ;; Remove past months for this year. (and (= year this-year) (while (and (car months) (< (car months) this-month)) (pop months))) (while (setq month (pop months)) ;; Now we must merge the Dows with the Doms. To do that, we ;; have to know which day is the 1st one for this month. ;; Maybe there's simpler, but decode-time(encode-time) will ;; give us the answer. (let ((first (nth 6 (decode-time (encode-time 0 0 0 1 month year time-zone)))) (max (cond ((= month 2) (if (date-leap-year-p year) 29 28)) ((<= month 7) (if (zerop (% month 2)) 30 31)) (t (if (zerop (% month 2)) 31 30)))) (doms dom-list) (dows dow-list) day days) ;; first, review the doms to see if they are valid. (while (setq day (pop doms)) (and (<= day max) (push day days))) ;; second add all possible dows (while (setq day (pop dows)) ;; days start at 1. (setq day (1+ (- day first))) (and (< day 0) (setq day (+ 7 day))) (while (<= day max) (push day days) (setq day (+ 7 day)))) ;; Aaaaaaall right. Now we have a valid list of DAYS for ;; this month and this year. (when days (setq days (sort days '<)) ;; Remove past days for this year and this month. (and (= year this-year) (= month this-month) (while (and (car days) (< (car days) this-day)) (pop days))) (while (setq day (pop days)) (let ((hours hour-list) hour) ;; Remove past hours for this year, this month and ;; this day. (and (= year this-year) (= month this-month) (= day this-day) (while (and (car hours) (< (car hours) this-hour)) (pop hours))) (while (setq hour (pop hours)) (let ((minutes minute-list) minute) ;; Remove past hours for this year, this month, ;; this day and this hour. (and (= year this-year) (= month this-month) (= day this-day) (= hour this-hour) (while (and (car minutes) (< (car minutes) this-minute)) (pop minutes))) (while (setq minute (pop minutes)) ;; Ouch! Here, we've got a complete valid ;; schedule. It's a good one if it's in the ;; future. (let ((time (encode-time 0 minute hour day month year time-zone))) (and (time-less-p now time) (throw 'found time))) )))) )) ))) )) (nndiary-last-occurrence sched)) ;; else (nndiary-last-occurrence sched)) )) (define-obsolete-function-alias 'nndiary-next-occurence 'nndiary-next-occurrence "26.1") (defun nndiary-expired-article-p (file) (with-temp-buffer (if (nnheader-insert-head file) (let ((sched (nndiary-schedule))) ;; An article has expired if its last schedule (if any) is in the ;; past. A permanent schedule never expires. (and sched (setq sched (nndiary-last-occurrence sched)) (time-less-p sched nil))) ;; else (nnheader-report 'nndiary "Could not read file %s" file) nil) )) (defun nndiary-renew-article-p (file timestamp) (erase-buffer) (if (nnheader-insert-head file) (let ((now (current-time)) (sched (nndiary-schedule))) ;; The article should be re-considered as unread if there's a reminder ;; between the group timestamp and the current time. (when (and sched (setq sched (nndiary-next-occurrence sched now))) (let ((reminders ;; add the next occurrence itself at the end. (append (nndiary-compute-reminders sched) (list sched)))) (while (and reminders (time-less-p (car reminders) timestamp)) (pop reminders)) ;; The reminders might be empty if the last date is in the past, ;; or we've got at least the next occurrence itself left. All past ;; dates are renewed. (or (not reminders) (time-less-p (car reminders) now))) )) ;; else (nnheader-report 'nndiary "Could not read file %s" file) nil)) ;; The end... =============================================================== (dolist (header nndiary-headers) (setq header (intern (format "X-Diary-%s" (car header)))) ;; Required for building NOV databases and some other stuff. (add-to-list 'gnus-extra-headers header) (add-to-list 'nnmail-extra-headers header)) (unless (assoc "nndiary" gnus-valid-select-methods) (gnus-declare-backend "nndiary" 'post-mail 'respool 'address)) (provide 'nndiary) ;;; nndiary.el ends here ```
Church of St. Anthony of Padua (, Samogitian: Šv. Ontana Padovėitė bažninčė) is a Roman Catholic church in Ukrinai, Lithuania. History The first church in Ukrinai was consecrated in 1784. Its construction was probably funded by a nobleman Laurynas Pilsudskis. The nobility of Ukrinai and Bukončiai built a new church in 1803, however it burnt down after around half a century. Current wooden church was built in 1857 and in 1913 it was enlarged. Since 1853 Ukrinai has been a filial of Židikai parish. Architecture The church is rectangle, with two small towers. There are four altars. It reflects the characteristics of Lithuanian vernacular architecture. The main altar is a vernacular interpretation of Baroque External links mke.lt Info at the webpage of the Diocese of Telšiai References Roman Catholic churches in Telšiai County Buildings and structures in Telšiai County Roman Catholic churches completed in 1857 Tourist attractions in Telšiai County 19th-century Roman Catholic church buildings in Lithuania
```xml <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="path_to_url"> <!--<gradient android:angle="270" android:endColor="#A8C3B0" android:startColor="#C6CFCE"/>--> <!--<size android:height="60dp" android:width="320dp" />--> <solid android:color="@color/green_xiaomi" /> <corners android:radius="8dp" /> <!-- <stroke android:width="1dp" android:color="#000000" />--> </shape> ```
```xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="path_to_url" xmlns:app="path_to_url" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/normalBackground" android:orientation="vertical"> <com.bilibili.magicasakura.widgets.TintToolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/theme_color_primary" android:minHeight="?attr/actionBarSize" android:theme="@style/Theme.AppCompat" app:popupTheme="@style/ThemeOverlay.AppCompat.Dark" /> <FrameLayout android:id="@+id/search_frame" android:layout_width="match_parent" android:layout_height="match_parent" /> <android.support.v7.widget.RecyclerView xmlns:android="path_to_url" xmlns:app="path_to_url" android:id="@+id/recyclerview" android:layout_width="match_parent" android:layout_height="match_parent" android:fadeScrollbars="true" app:layout_behavior="@string/appbar_scrolling_view_behavior" /> </LinearLayout> ```
```swift /* * * This program is free software; you can redistribute it and/or modify * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* This is a simple Swift demo app that shows an example of how to use * PJSUA API to make one audio+video call to another user. */ import SwiftUI class PjsipVars: ObservableObject { @Published var calling = false var dest: String = "sip:test@sip.pjsip.org" var call_id: pjsua_call_id = PJSUA_INVALID_ID.rawValue /* Video window */ @Published var vid_win:UIView? = nil } class AppDelegate: NSObject, UIApplicationDelegate { static let Shared = AppDelegate() var pjsip_vars = PjsipVars() } @main struct ipjsua_swiftApp: App { init() { /* Create pjsua */ var status: pj_status_t; status = pjsua_create(); if (status != PJ_SUCCESS.rawValue) { NSLog("Failed creating pjsua"); } /* Init configs */ var cfg = pjsua_config(); var log_cfg = pjsua_logging_config(); var media_cfg = pjsua_media_config(); pjsua_config_default(&cfg); pjsua_logging_config_default(&log_cfg); pjsua_media_config_default(&media_cfg); /* Initialize application callbacks */ cfg.cb.on_incoming_call = on_incoming_call; cfg.cb.on_call_state = on_call_state; cfg.cb.on_call_media_state = on_call_media_state; /* Init pjsua */ status = pjsua_init(&cfg, &log_cfg, &media_cfg); /* Create transport */ var transport_id = pjsua_transport_id(); var tcp_cfg = pjsua_transport_config(); pjsua_transport_config_default(&tcp_cfg); tcp_cfg.port = 5080; status = pjsua_transport_create(PJSIP_TRANSPORT_TCP, &tcp_cfg, &transport_id); /* Add local account */ var aid = pjsua_acc_id(); status = pjsua_acc_add_local(transport_id, pj_bool_t(PJ_TRUE.rawValue), &aid); /* Use colorbar for local account and enable incoming video */ var acc_cfg = pjsua_acc_config(); var tmp_pool:UnsafeMutablePointer<pj_pool_t>? = nil; var info : [pjmedia_vid_dev_info] = Array(repeating: pjmedia_vid_dev_info(), count: 16); var count:UInt32 = UInt32(info.capacity); tmp_pool = pjsua_pool_create("tmp-ipjsua", 1000, 1000); pjsua_acc_get_config(aid, tmp_pool, &acc_cfg); acc_cfg.vid_in_auto_show = pj_bool_t(PJ_TRUE.rawValue); pjsua_vid_enum_devs(&info, &count); for i in 0..<count { let name: [CChar] = tupleToArray(tuple: info[Int(i)].name); if let dev_name = String(validatingUTF8: name) { if (dev_name == "Colorbar generator") { acc_cfg.vid_cap_dev = pjmedia_vid_dev_index(i); break; } } } pjsua_acc_modify(aid, &acc_cfg); /* Init account config */ let id = strdup("Test<sip:test@sip.pjsip.org>"); let username = strdup("test"); let passwd = strdup("pwd"); let realm = strdup("*"); let registrar = strdup("sip:sip.pjsip.org"); let proxy = strdup("sip:sip.pjsip.org;transport=tcp"); pjsua_acc_config_default(&acc_cfg); acc_cfg.id = pj_str(id); acc_cfg.cred_count = 1; acc_cfg.cred_info.0.username = pj_str(username); acc_cfg.cred_info.0.realm = pj_str(realm); acc_cfg.cred_info.0.data = pj_str(passwd); acc_cfg.reg_uri = pj_str(registrar); acc_cfg.proxy_cnt = 1; acc_cfg.proxy.0 = pj_str(proxy); acc_cfg.vid_out_auto_transmit = pj_bool_t(PJ_TRUE.rawValue); acc_cfg.vid_in_auto_show = pj_bool_t(PJ_TRUE.rawValue); /* Add account */ pjsua_acc_add(&acc_cfg, pj_bool_t(PJ_TRUE.rawValue), nil); /* Free strings */ free(id); free(username); free(passwd); free(realm); free(registrar); free(proxy); pj_pool_release(tmp_pool); /* Start pjsua */ status = pjsua_start(); } var body: some Scene { WindowGroup { ContentView() .environmentObject(AppDelegate.Shared.pjsip_vars) .preferredColorScheme(.light) } } } private func on_incoming_call(acc_id: pjsua_acc_id, call_id: pjsua_call_id, rdata: UnsafeMutablePointer<pjsip_rx_data>?) { var opt = pjsua_call_setting(); pjsua_call_setting_default(&opt); opt.aud_cnt = 1; opt.vid_cnt = 1; /* Automatically answer call with 200 */ pjsua_call_answer2(call_id, &opt, 200, nil, nil); } private func on_call_state(call_id: pjsua_call_id, e: UnsafeMutablePointer<pjsip_event>?) { var ci = pjsua_call_info(); pjsua_call_get_info(call_id, &ci); if (ci.state == PJSIP_INV_STATE_DISCONNECTED) { /* UIView update must be done in the main thread */ DispatchQueue.main.sync { AppDelegate.Shared.pjsip_vars.vid_win = nil; AppDelegate.Shared.pjsip_vars.calling = false; } } } private func tupleToArray<Tuple, Value>(tuple: Tuple) -> [Value] { let tupleMirror = Mirror(reflecting: tuple) return tupleMirror.children.compactMap { (child: Mirror.Child) -> Value? in return child.value as? Value } } private func on_call_media_state(call_id: pjsua_call_id) { var ci = pjsua_call_info(); pjsua_call_get_info(call_id, &ci); let media: [pjsua_call_media_info] = tupleToArray(tuple: ci.media); for mi in 0...ci.media_cnt { if (media[Int(mi)].status == PJSUA_CALL_MEDIA_ACTIVE || media[Int(mi)].status == PJSUA_CALL_MEDIA_REMOTE_HOLD) { switch (media[Int(mi)].type) { case PJMEDIA_TYPE_AUDIO: var call_conf_slot: pjsua_conf_port_id; call_conf_slot = media[Int(mi)].stream.aud.conf_slot; pjsua_conf_connect(call_conf_slot, 0); pjsua_conf_connect(0, call_conf_slot); break; case PJMEDIA_TYPE_VIDEO: let wid = media[Int(mi)].stream.vid.win_in; var wi = pjsua_vid_win_info(); if (pjsua_vid_win_get_info(wid, &wi) == PJ_SUCCESS.rawValue) { let vid_win:UIView = Unmanaged<UIView>.fromOpaque(wi.hwnd.info.ios.window).takeUnretainedValue(); /* For local loopback test, one acts as a transmitter, the other as a receiver. */ if (AppDelegate.Shared.pjsip_vars.vid_win == nil) { /* UIView update must be done in the main thread */ DispatchQueue.main.sync { AppDelegate.Shared.pjsip_vars.vid_win = vid_win; } } else { if (AppDelegate.Shared.pjsip_vars.vid_win != vid_win) { /* Transmitter */ var param = pjsua_call_vid_strm_op_param (); pjsua_call_vid_strm_op_param_default(&param); param.med_idx = 1; pjsua_call_set_vid_strm(call_id, PJSUA_CALL_VID_STRM_START_TRANSMIT, &param); } } } break; default: break; } } } } ```
```python from office365.runtime.auth.token_response import TokenResponse from office365.sharepoint.client_context import ClientContext from tests import settings, test_site_url """ Important: for Application authenticated against Azure AD blade, calling SharePoint v1 API endpoint when using Client Credentials flow (app-only access) will return 401 error, meaning this flow is NOT supported (blocked) unless: - AAD app is explicitly granted access via ACS as explained here: path_to_url - Client Certificate flow is utilized instead as explained here path_to_url Refer, for instance, this thread for a more details: path_to_url """ def acquire_token(): authority_url = "path_to_url{0}".format( settings.get("default", "tenant") ) import msal app = msal.ConfidentialClientApplication( authority=authority_url, client_id=settings.get("client_credentials", "client_id"), client_credential=settings.get("client_credentials", "client_secret"), ) token_json = app.acquire_token_for_client( scopes=["path_to_url"] ) return TokenResponse.from_json(token_json) ctx = ClientContext(test_site_url).with_access_token(acquire_token) target_web = ctx.web.get().execute_query() print(target_web.url) ```
```shell Finding a tag How to set your username and email Check the status of your files Remote repositories: fetching and pushing Perform a dry run ```