text
stringlengths
1
22.8M
```c++ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. See the AUTHORS file for names of contributors. // Test for issue 200: when iterator switches direction from backward // to forward, the current key can be yielded unexpectedly if a new // mutation has been added just before the current key. #include "leveldb/db.h" #include "util/testharness.h" namespace leveldb { class Issue200 {}; TEST(Issue200, Test) { // Get rid of any state from an old run. std::string dbpath = test::TmpDir() + "/leveldb_issue200_test"; DestroyDB(dbpath, Options()); DB* db; Options options; options.create_if_missing = true; ASSERT_OK(DB::Open(options, dbpath, &db)); WriteOptions write_options; ASSERT_OK(db->Put(write_options, "1", "b")); ASSERT_OK(db->Put(write_options, "2", "c")); ASSERT_OK(db->Put(write_options, "3", "d")); ASSERT_OK(db->Put(write_options, "4", "e")); ASSERT_OK(db->Put(write_options, "5", "f")); ReadOptions read_options; Iterator* iter = db->NewIterator(read_options); // Add an element that should not be reflected in the iterator. ASSERT_OK(db->Put(write_options, "25", "cd")); iter->Seek("5"); ASSERT_EQ(iter->key().ToString(), "5"); iter->Prev(); ASSERT_EQ(iter->key().ToString(), "4"); iter->Prev(); ASSERT_EQ(iter->key().ToString(), "3"); iter->Next(); ASSERT_EQ(iter->key().ToString(), "4"); iter->Next(); ASSERT_EQ(iter->key().ToString(), "5"); delete iter; delete db; DestroyDB(dbpath, options); } } // namespace leveldb int main(int argc, char** argv) { return leveldb::test::RunAllTests(); } ```
```xml import MockContext from './mock_context'; import MockSpan from './mock_span'; import MockTracer from './mock_tracer'; export { MockTracer, MockSpan, MockContext }; ```
```java /* * */ package io.debezium.heartbeat; import java.sql.SQLException; import java.time.Duration; import java.util.Map; import org.apache.kafka.common.config.ConfigDef; import org.apache.kafka.connect.source.SourceRecord; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import io.debezium.config.Field; import io.debezium.function.BlockingConsumer; import io.debezium.jdbc.JdbcConnection; import io.debezium.schema.SchemaNameAdjuster; /** * Implementation of the heartbeat feature that allows for a DB query to be executed with every heartbeat. */ public class DatabaseHeartbeatImpl extends HeartbeatImpl { private static final Logger LOGGER = LoggerFactory.getLogger(DatabaseHeartbeatImpl.class); public static final String HEARTBEAT_ACTION_QUERY_PROPERTY_NAME = "heartbeat.action.query"; public static final Field HEARTBEAT_ACTION_QUERY = Field.create(HEARTBEAT_ACTION_QUERY_PROPERTY_NAME) .withDisplayName("An optional query to execute with every heartbeat") .withType(ConfigDef.Type.STRING) .withGroup(Field.createGroupEntry(Field.Group.ADVANCED_HEARTBEAT, 2)) .withWidth(ConfigDef.Width.MEDIUM) .withImportance(ConfigDef.Importance.LOW) .withDescription("The query executed with every heartbeat."); private final String heartBeatActionQuery; private final JdbcConnection jdbcConnection; private final HeartbeatErrorHandler errorHandler; public DatabaseHeartbeatImpl(Duration heartbeatInterval, String topicName, String key, JdbcConnection jdbcConnection, String heartBeatActionQuery, HeartbeatErrorHandler errorHandler, SchemaNameAdjuster schemaNameAdjuster) { super(heartbeatInterval, topicName, key, schemaNameAdjuster); this.heartBeatActionQuery = heartBeatActionQuery; this.jdbcConnection = jdbcConnection; this.errorHandler = errorHandler; } @Override public void forcedBeat(Map<String, ?> partition, Map<String, ?> offset, BlockingConsumer<SourceRecord> consumer) throws InterruptedException { try { jdbcConnection.execute(heartBeatActionQuery); } catch (SQLException e) { if (errorHandler != null) { errorHandler.onError(e); } LOGGER.error("Could not execute heartbeat action (Error: " + e.getSQLState() + ")", e); } LOGGER.debug("Executed heartbeat action query"); super.forcedBeat(partition, offset, consumer); } @Override public void close() { try { jdbcConnection.close(); } catch (SQLException e) { LOGGER.error("Exception while closing the heartbeat JDBC connection", e); } } } ```
```html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <script src="vue.js"></script> </head> <body> <div id="example"> <button v-on:click="greet">Greet</button> </div> <script> var vm = new Vue({ el: '#example', data: { name: 'Vue.js' }, // define methods under the `methods` object methods: { greet: function(event) { // `this` inside methods point to the Vue instance alert('Hello ' + this.name + '!') // this.name , vue data // `event` is the native DOM event alert(event.target.tagName) // button tag name } } }) // you can invoke methods in JavaScript too vm.greet() // -> 'Hello Vue.js!' vm greet() </script> </body> </html> ```
C1 Advanced, previously known as Cambridge English: Advanced and the Certificate in Advanced English (CAE), is an English language examination provided by Cambridge Assessment English (previously known as Cambridge English Language Assessment and the University of Cambridge ESOL examination). C1 Advanced looks to prove high-level achievement in English and is designed for learners preparing for university or professional life. It is focused on Level C1 of the Common European Framework of Reference for Languages (CEFR). C1 Advanced is one of the examinations in Cambridge English Qualifications. Each Cambridge English Qualification targets a particular level of the CEFR. History C1 Advanced was developed in response to feedback from language centres that there was too great a gap between the qualifications now known as B2 First and C2 Proficiency. C1 Advanced was designed to allow learners to gain certification for advanced levels of English suitable for use in academic and professional life and was developed using a socio-cognitive approach – that is, it encourages language skills for use in real-life situations. Following the launch of the exam, the qualification has been continuously updated to reflect changes in language teaching and assessment. The most recent updates took place in 2015. The main differences are: the overall exam is now 45 minutes shorter; there are four exam papers instead of five; the Reading and Use of English papers have been combined into a single paper, and there are some new testing focuses and task types. Format C1 Advanced is made up of four exam papers, which cover all the key language skills (Reading and Use of Language, Writing, Listening and Speaking). The Speaking paper is taken face-to-face. Candidates have the choice of taking the Reading and Use of English paper, Writing paper and Listening paper on either a computer or on paper. Scoring In January 2015, Cambridge English Scale scores replaced the candidate profile and standardised scores used for pre-2015 results. All candidates (pre- and post-2015) receive a Statement of Results, with those scoring high enough also receiving a certificate. Scoring from January 2015 From 2015, the Statement of Results and the Certificate have the following information about the candidate’s performance: A score on the Cambridge English Scale for each skill (Reading, Writing, Listening and Speaking) and Use of English A score on the Cambridge English Scale for the overall exam A grade (A, B, C, Level B2) for the overall exam A CEFR level for the overall exam. The certificate also contains the UK National Qualifications Framework (NQF) level. The candidate’s overall score is averaged from the individual scores for each skill (Reading, Writing, Listening and Speaking) and Use of English. C1 Advanced is targeted at CEFR Level C1 but also provides reliable assessment at the level above C1 (Level C2) and the level below (B2). The following scores are used to report results: Scores between 142 and 159 are also reported on the Statement of Results but candidates will not receive a certificate. Scoring pre-2015 Pre-2015, the Statement of Results had the following information, reflecting the total combined score from all four papers: A grade (A, B, C, Level B2) for the overall exam A score (out of 100) for the overall exam A CEFR level for the overall exam. Pre-2015, the Statement of Results also had a Candidate Profile, which showed the candidate’s performance on each of the individual papers against the following scale: exceptional, good, borderline and weak. Pre-2015, candidates who achieved a score of 45 or more (out of 100) received a certificate. Timing and results Candidates take the Reading and Use of English, Writing and Listening papers on the same day. The Speaking paper is usually taken a few days before or after the other papers or on the same day. Successful candidates receive two documents: a Statement of Results and a Certificate. Universities, employers and other organisations may require either of these documents as proof of English language skills. An online Statement of Results is available to candidates who have sat the computer-based exam two weeks after the exam and to candidates of the paper-based exam approximately four weeks after the exam. Successful candidates (those scoring above 160 on the Cambridge English Scale) will receive a hard copy certificate within three months of the exam. Holders of a C1 Advanced certificate display similar language ability to candidates who have an IELTS score of 6.5 to 8.0. The following table demonstrates a comparison of Cambridge English Scale scores, as used by C1 Advanced, with IELTS band scores. Usage C1 Advanced is used for study, work and immigration purposes. It is designed to demonstrate that a candidate has achieved a high level of English ability which can be used in academic and professional contexts. C1 Advanced is accepted globally by over 6,000 institutions. Many higher education institutions accept C1 Advanced for admission purposes. C1 Advanced and C2 Proficiency can be used to apply for degree courses (or higher) at almost all UK universities, as candidates who need to apply for a visa to study at degree level or above at a Tier 4 Sponsor only need to meet the English language requirements set by the university; they don’t need to take a test from the UKVI list of Secure English Language Tests (SELT tests). In some countries, students with a C1 Advanced certificate gain exemption from the English components of school-leaving exams. C1 Advanced can be used for visa purposes, with recognition by the Australian Department of Immigration and Border Protection (DIBP, formerly DIAC) for student visas. DIBP has extended the recognition of C1 Advanced and they will now accept scores in the exam for Temporary Graduate, Skilled, Former Resident, and Work and Holiday visa. C1 Advanced is also recognised by many employers. Many institutions accept more than one English language exam, e.g. C1 Advanced and IELTS. However, there are some subtle differences between these two exams. For example, C1 Advanced certifies at B2, C1 and C2 levels – the language levels needed for study and work; IELTS is designed to test a much broader range of language levels, from CEFR Level A1 up to C2. See also Cambridge Assessment English Cambridge English Qualifications A2 Key B1 Preliminary B2 First C2 Proficiency References External links Standardized tests for English language English-language education English language tests University of Cambridge examinations de:Cambridge ESOL#Allgemeines Englisch
Platypelis grandis is a species of frog in the family Microhylidae. It is endemic to Madagascar. Its natural habitats are subtropical or tropical moist lowland forests and subtropical or tropical moist montane forests. It is threatened by habitat loss. Juveniles are recognizable by the green protuberances on their body, which help them camouflage and hunt. When mature, coloring is brown and green. Insects make up the bulk of their diet. References External links http://amphibiaweb.org/cgi/amphib_query?query_src=&where-genus=Platypelis&where-species=grandis g Endemic frogs of Madagascar Amphibians described in 1889 Taxa named by George Albert Boulenger Taxonomy articles created by Polbot Taxobox binomials not recognized by IUCN
```glsl #include <metal_stdlib> #include <simd/simd.h> using namespace metal; struct Block { float3x4 var[3][4]; }; struct main0_out { float v_vtxResult [[user(locn0)]]; float4 gl_Position [[position]]; }; struct main0_in { float4 a_position [[attribute(0)]]; }; vertex main0_out main0(main0_in in [[stage_in]], constant Block& _104 [[buffer(0)]]) { main0_out out = {}; out.gl_Position = in.a_position; out.v_vtxResult = ((float(abs(_104.var[0][0][0][0] - 2.0) < 0.0500000007450580596923828125) * float(abs(_104.var[0][0][1][0] - 6.0) < 0.0500000007450580596923828125)) * float(abs(_104.var[0][0][2][0] - (-6.0)) < 0.0500000007450580596923828125)) * ((float(abs(_104.var[0][0][0][1]) < 0.0500000007450580596923828125) * float(abs(_104.var[0][0][1][1] - 5.0) < 0.0500000007450580596923828125)) * float(abs(_104.var[0][0][2][1] - 5.0) < 0.0500000007450580596923828125)); return out; } ```
```javascript (function(a){(jQuery.browser=jQuery.browser||{}).mobile=/(iphone|ipad|ipod|android)/i.test(a)||/(iphone|ipad|ipod|android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4))})(navigator.userAgent||navigator.vendor||window.opera); ```
```smalltalk using CSharpFunctionalExtensions.ValueTasks; using System.Threading.Tasks; using Xunit; namespace CSharpFunctionalExtensions.Tests.ResultTests.Extensions { public class BindTryTests_ValueTask_Right : BindTryTestsBase { #region BindTry for Result with function returning ValueTask<Result> [Fact] public async ValueTask your_sha256_hashrns_success() { Result sut = Result.Success(); Result result = await sut.BindTry(ValueTask_Success); AssertSuccess(result); } [Fact] public async ValueTask your_sha256_hashrns_failure() { Result sut = Result.Failure(ErrorMessage); Result result = await sut.BindTry(ValueTask_Success); AssertFailure(result); } [Fact] public async ValueTask your_sha256_hashrns_failure() { Result sut = Result.Success(); Result result = await sut.BindTry(ValueTask_Failure); AssertFailure(result); } [Fact] public async ValueTask your_sha256_hashre_with_exception_message() { Result sut = Result.Success(); Result result = await sut.BindTry(ValueTask_Throwing); AssertFailure(result); } [Fact] public async ValueTask your_sha256_hashrror_handler_returns_failure_with_custom_message() { Result sut = Result.Success(); Result result = await sut.BindTry(ValueTask_Throwing, e => ErrorMessage2); AssertFailure(result, ErrorMessage2); } #endregion #region BindTry for Result with function returning ValueTask<Result<K>> [Fact] public async ValueTask your_sha256_hashturns_success() { Result sut = Result.Success(); Result<K> result = await sut.BindTry(ValueTask_Success_K); AssertSuccess(result); } [Fact] public async ValueTask your_sha256_hashturns_failure() { Result sut = Result.Failure(ErrorMessage); Result<K> result = await sut.BindTry(ValueTask_Success_K); AssertFailure(result); } [Fact] public async ValueTask your_sha256_hashturns_failure() { Result sut = Result.Success(); Result<K> result = await sut.BindTry(ValueTask_Failure_K); AssertFailure(result); } [Fact] public async ValueTask your_sha256_hashlure_with_exception_message() { Result sut = Result.Success(); Result<K> result = await sut.BindTry(ValueTask_Throwing_K); AssertFailure(result); } [Fact] public async ValueTask your_sha256_hash_error_handler_returns_failure_with_custom_message() { Result sut = Result.Success(); Result<K> result = await sut.BindTry(ValueTask_Throwing_K, e => ErrorMessage2); AssertFailure(result, ErrorMessage2); } #endregion #region BindTry for Result<T> with function returning ValueTask<Result> [Fact] public async ValueTask your_sha256_hashturns_success() { Result<T> sut = Result.Success(T.Value); Result result = await sut.BindTry(t => ValueTask_Success()); AssertSuccess(result); } [Fact] public async ValueTask your_sha256_hashturns_failure() { Result<T> sut = Result.Failure<T>(ErrorMessage); Result result = await sut.BindTry(t => ValueTask_Success()); AssertFailure(result); } [Fact] public async ValueTask your_sha256_hashturns_failure() { Result<T> sut = Result.Failure<T>(ErrorMessage); Result result = await sut.BindTry(t => ValueTask_Failure()); AssertFailure(result); } [Fact] public async ValueTask your_sha256_hashlure_with_exception_message() { Result<T> sut = Result.Success(T.Value); Result result = await sut.BindTry(t => ValueTask_Throwing()); AssertFailure(result); } [Fact] public async ValueTask your_sha256_hash_error_handler_returns_failure_with_custom_message() { Result<T> sut = Result.Success(T.Value); Result result = await sut.BindTry(t => ValueTask_Throwing(), e => ErrorMessage2); AssertFailure(result, ErrorMessage2); } #endregion #region BindTry for Result<T> with function returning ValueTask<Result<K>> [Fact] public async ValueTask your_sha256_hashreturns_success() { Result<T> sut = Result.Success(T.Value); Result<K> result = await sut.BindTry(t => ValueTask_Success_K()); AssertSuccess(result); } [Fact] public async ValueTask your_sha256_hashreturns_failure() { Result<T> sut = Result.Failure<T>(ErrorMessage); Result<K> result = await sut.BindTry(t => ValueTask_Success_K()); AssertFailure(result); } [Fact] public async ValueTask your_sha256_hashreturns_failure() { Result<T> sut = Result.Success(T.Value); Result<K> result = await sut.BindTry(t => ValueTask_Failure_K()); AssertFailure(result); } [Fact] public async ValueTask your_sha256_hashailure_with_exception_message() { Result<T> sut = Result.Success(T.Value); Result<K> result = await sut.BindTry(t => ValueTask_Throwing_K()); AssertFailure(result); } [Fact] public async ValueTask your_sha256_hashom_error_handler_returns_failure_with_custom_message() { Result<T> sut = Result.Success(T.Value); Result<K> result = await sut.BindTry(t => ValueTask_Throwing_K(), e => ErrorMessage2); AssertFailure(result, ErrorMessage2); } #endregion #region BindTry for Result<T,E> with function returning ValueTask<UnitResult<E>> [Fact] public async ValueTask your_sha256_hashE_returns_success() { Result<T, E> sut = Result.Success<T, E>(T.Value); UnitResult<E> result = await sut.BindTry(t => ValueTask_UnitResult_Success_E(), e => E.Value2); AssertSuccess(result); } [Fact] public async ValueTask your_sha256_hashE_returns_failure() { Result<T, E> sut = Result.Failure<T, E>(E.Value); UnitResult<E> result = await sut.BindTry(t => ValueTask_UnitResult_Success_E(), e => E.Value2); AssertFailure(result); } [Fact] public async ValueTask your_sha256_hashE_returns_failure() { Result<T, E> sut = Result.Success<T, E>(T.Value); UnitResult<E> result = await sut.BindTry(t => ValueTask_UnitResult_Failure_E(), e => E.Value2); AssertFailure(result); } [Fact] public async ValueTask your_sha256_hash_failure_with_value_from_error_handler() { Result<T, E> sut = Result.Success<T, E>(T.Value); UnitResult<E> result = await sut.BindTry(t => ValueTask_Throwing_E(), e => E.Value2); AssertFailure(result, E.Value2); } #endregion #region BindTry for Result<T,E> with function returning ValueTask<Result<K,E>> [Fact] public async ValueTask your_sha256_hashT_E_returns_success() { Result<T, E> sut = Result.Success<T, E>(T.Value); Result<K, E> result = await sut.BindTry(ValueTask_Success_K_E, e => E.Value2); AssertSuccess(result); } [Fact] public async ValueTask your_sha256_hashT_E_returns_failure() { Result<T, E> sut = Result.Failure<T, E>(E.Value); Result<K, E> result = await sut.BindTry(ValueTask_Success_K_E, e => E.Value2); AssertFailure(result); } [Fact] public async ValueTask your_sha256_hashT_E_returns_failure() { Result<T, E> sut = Result.Success<T, E>(T.Value); Result<K, E> result = await sut.BindTry(ValueTask_Failure_K_E, e => E.Value2); AssertFailure(result); } [Fact] public async ValueTask your_sha256_hashns_failure_with_value_from_error_handler() { Result<T, E> sut = Result.Success<T, E>(T.Value); Result<K, E> result = await sut.BindTry(t => ValueTask_Throwing_K_E(), e => E.Value2); AssertFailure(result, E.Value2); } #endregion #region BindTry for UnitResult<E> with function returning ValueTask<Result<T,E>> [Fact] public async ValueTask your_sha256_hashE_returns_success() { UnitResult<E> sut = UnitResult.Success<E>(); Result<T, E> result = await sut.BindTry(ValueTask_Success_T_E, e => E.Value2); AssertSuccess(result); } [Fact] public async ValueTask your_sha256_hashE_returns_failure() { UnitResult<E> sut = UnitResult.Failure(E.Value); Result<T, E> result = await sut.BindTry(ValueTask_Success_T_E, e => E.Value2); AssertFailure(result); } [Fact] public async ValueTask your_sha256_hashE_returns_failure() { UnitResult<E> sut = UnitResult.Success<E>(); Result<T, E> result = await sut.BindTry(ValueTask_Failure_T_E, e => E.Value2); AssertFailure(result); } [Fact] public async ValueTask your_sha256_hash_failure_with_value_from_error_handler() { UnitResult<E> sut = UnitResult.Success<E>(); Result<T, E> result = await sut.BindTry(ValueTask_Throwing_T_E, e => E.Value2); AssertFailure(result, E.Value2); } #endregion #region BindTry for UnitResult<E> with function returning ValueTask<UnitResult<E>> [Fact] public async ValueTask your_sha256_hashreturns_success() { UnitResult<E> sut = UnitResult.Success<E>(); UnitResult<E> result = await sut.BindTry(ValueTask_UnitResult_Success_E, e => E.Value2); AssertSuccess(result); } [Fact] public async ValueTask your_sha256_hashreturns_failure() { UnitResult<E> sut = UnitResult.Failure(E.Value); UnitResult<E> result = await sut.BindTry(ValueTask_UnitResult_Success_E, e => E.Value2); AssertFailure(result); } [Fact] public async ValueTask your_sha256_hashreturns_failure() { UnitResult<E> sut = UnitResult.Success<E>(); UnitResult<E> result = await sut.BindTry(ValueTask_UnitResult_Failure_E, e => E.Value2); AssertFailure(result); } [Fact] public async ValueTask your_sha256_hashailure_with_value_from_error_handler() { UnitResult<E> sut = UnitResult.Success<E>(); UnitResult<E> result = await sut.BindTry(ValueTask_Throwing_E, e => E.Value2); AssertFailure(result, E.Value2); } #endregion } } ```
Mohammad Ilyas Mahmood (; born 19 March 1946) is a former Pakistani cricketer who played in ten Test matches between 1964 and 1969. Cricket career Ilyas was an opening batsman and occasional leg-spin bowler. He played first-class cricket in Pakistan from 1961 to 1972. He scored 126 in the Third Test against New Zealand in Karachi in April 1965, when Pakistan needed 202 to win in five and half hours, and reached the target with a session to spare for the loss of only two wickets. He made his highest first-class score in December 1964, when he scored 154 against South Australia. He toured Australia a second time with the Pakistan team in 1972–73, but was injured early in the tour and omitted from the team before it left for the New Zealand leg of the tour. At the time he decided to stay in Australia to live, but he later returned to Pakistan. He served for a time as a national selector, but was dismissed in 2011 for allegedly violating the Pakistan Cricket Board's code of conduct. Family He is the father-in-law of Imran Farhat and Kamran Akmal. Nazar Mohammad was his uncle. References External links 1946 births Living people Pakistan Test cricketers Pakistani cricketers Lahore cricketers Pakistan International Airlines cricketers Lahore A cricketers Lahore Greens cricketers Pakistan International Airlines A cricketers South Zone (Pakistan) cricketers Central Zone (Pakistan) cricketers Cricketers from Lahore
Raymond A. Litke (1920-1986) was an American electronic engineer, the inventor of a practical wireless microphone, and the first to patent the wireless microphone. He was born and raised on a farm near Alma, Kansas, but spent most of his adult life in San Jose, California. Wireless microphone Litke invented a wireless microphone in 1957 while employed as an electronics expert at San Jose State College. His supervisor challenged him to invent a microphone to use in educational presentations which would be free of wires. Litke’s wireless mike resembled a silver tube with “a microphone at the top, a transmitter in the middle and its battery power supply at the bottom.” It was 6 inches long, 1 inch in diameter, and weighed 7 ounces; the device had a broadcast range of up to a half-mile. Two types of mikes were available: lavalier and hand-held. A companion receiver, weighing 17 pounds, completed the portable sound system. Although Litke prototyped the wireless microphone in 1957, he did not file for a patent until May 8, 1961. U.S. Patent No. 3,134,074 was officially granted on May 19, 1964. His microphone is sometimes also called the “Vega-Mike” after the Vega Electronics Corporation which first manufactured it as a product. Vega sold other electronics items and tapes developed by Litke. Litke's wireless microphone was first tested at the Olympic trials held at Stanford University in 1959. Next, the American Broadcasting Company (ABC television) tested the microphone at the Democratic and Republican Conventions in 1960. Candidates John F. Kennedy and Richard Nixon were among the first celebrities to use the Vega-Mike. TV anchor John Daly praised Litke's invention on the ABC television news broadcast in July 1960. Daly introduced it to Americans with the words: "This is a Vega-Mike" and went on to explain it "is a wireless microphone, six inches long... without any wires of any kind...." Daly pointed out it could be used to broadcast "within the (convention) hall or outside... without the inconvenience of interconnecting microphone cables...." Even the Federal Communications Commission was impressed with it. The FCC gave him 12 frequencies instead of the one he was seeking. Other accomplishments In the 1960s Litke worked at the University of California, San Francisco Medical Center as the chief engineer of Educational Television and as an electronics expert. By 1961 he had worked for the University of California system for ten years. References 1920 births 1986 deaths People from Wabaunsee County, Kansas People from San Jose, California 20th-century American inventors
The Hamming weight of a string is the number of symbols that are different from the zero-symbol of the alphabet used. It is thus equivalent to the Hamming distance from the all-zero string of the same length. For the most typical case, a string of bits, this is the number of 1's in the string, or the digit sum of the binary representation of a given number and the ℓ₁ norm of a bit vector. In this binary case, it is also called the population count, popcount, sideways sum, or bit summation. History and usage The Hamming weight is named after Richard Hamming although he did not originate the notion. The Hamming weight of binary numbers was already used in 1899 by James W. L. Glaisher to give a formula for the number of odd binomial coefficients in a single row of Pascal's triangle. Irving S. Reed introduced a concept, equivalent to Hamming weight in the binary case, in 1954. Hamming weight is used in several disciplines including information theory, coding theory, and cryptography. Examples of applications of the Hamming weight include: In modular exponentiation by squaring, the number of modular multiplications required for an exponent e is log2 e + weight(e). This is the reason that the public key value e used in RSA is typically chosen to be a number of low Hamming weight. The Hamming weight determines path lengths between nodes in Chord distributed hash tables. IrisCode lookups in biometric databases are typically implemented by calculating the Hamming distance to each stored record. In computer chess programs using a bitboard representation, the Hamming weight of a bitboard gives the number of pieces of a given type remaining in the game, or the number of squares of the board controlled by one player's pieces, and is therefore an important contributing term to the value of a position. Hamming weight can be used to efficiently compute find first set using the identity ffs(x) = pop(x ^ (x - 1)). This is useful on platforms such as SPARC that have hardware Hamming weight instructions but no hardware find first set instruction. The Hamming weight operation can be interpreted as a conversion from the unary numeral system to binary numbers. In implementation of some succinct data structures like bit vectors and wavelet trees. Efficient implementation The population count of a bitstring is often needed in cryptography and other applications. The Hamming distance of two words A and B can be calculated as the Hamming weight of A xor B. The problem of how to implement it efficiently has been widely studied. A single operation for the calculation, or parallel operations on bit vectors are available on some processors. For processors lacking those features, the best solutions known are based on adding counts in a tree pattern. For example, to count the number of 1 bits in the 16-bit binary number a = 0110 1100 1011 1010, these operations can be done: Here, the operations are as in C programming language, so means to shift X right by Y bits, X & Y means the bitwise AND of X and Y, and + is ordinary addition. The best algorithms known for this problem are based on the concept illustrated above and are given here: //types and constants used in the functions below //uint64_t is an unsigned 64-bit integer variable type (defined in C99 version of C language) const uint64_t m1 = 0x5555555555555555; //binary: 0101... const uint64_t m2 = 0x3333333333333333; //binary: 00110011.. const uint64_t m4 = 0x0f0f0f0f0f0f0f0f; //binary: 4 zeros, 4 ones ... const uint64_t m8 = 0x00ff00ff00ff00ff; //binary: 8 zeros, 8 ones ... const uint64_t m16 = 0x0000ffff0000ffff; //binary: 16 zeros, 16 ones ... const uint64_t m32 = 0x00000000ffffffff; //binary: 32 zeros, 32 ones const uint64_t h01 = 0x0101010101010101; //the sum of 256 to the power of 0,1,2,3... //This is a naive implementation, shown for comparison, //and to help in understanding the better functions. //This algorithm uses 24 arithmetic operations (shift, add, and). int popcount64a(uint64_t x) { x = (x & m1 ) + ((x >> 1) & m1 ); //put count of each 2 bits into those 2 bits x = (x & m2 ) + ((x >> 2) & m2 ); //put count of each 4 bits into those 4 bits x = (x & m4 ) + ((x >> 4) & m4 ); //put count of each 8 bits into those 8 bits x = (x & m8 ) + ((x >> 8) & m8 ); //put count of each 16 bits into those 16 bits x = (x & m16) + ((x >> 16) & m16); //put count of each 32 bits into those 32 bits x = (x & m32) + ((x >> 32) & m32); //put count of each 64 bits into those 64 bits return x; } //This uses fewer arithmetic operations than any other known //implementation on machines with slow multiplication. //This algorithm uses 17 arithmetic operations. int popcount64b(uint64_t x) { x -= (x >> 1) & m1; //put count of each 2 bits into those 2 bits x = (x & m2) + ((x >> 2) & m2); //put count of each 4 bits into those 4 bits x = (x + (x >> 4)) & m4; //put count of each 8 bits into those 8 bits x += x >> 8; //put count of each 16 bits into their lowest 8 bits x += x >> 16; //put count of each 32 bits into their lowest 8 bits x += x >> 32; //put count of each 64 bits into their lowest 8 bits return x & 0x7f; } //This uses fewer arithmetic operations than any other known //implementation on machines with fast multiplication. //This algorithm uses 12 arithmetic operations, one of which is a multiply. int popcount64c(uint64_t x) { x -= (x >> 1) & m1; //put count of each 2 bits into those 2 bits x = (x & m2) + ((x >> 2) & m2); //put count of each 4 bits into those 4 bits x = (x + (x >> 4)) & m4; //put count of each 8 bits into those 8 bits return (x * h01) >> 56; //returns left 8 bits of x + (x<<8) + (x<<16) + (x<<24) + ... } The above implementations have the best worst-case behavior of any known algorithm. However, when a value is expected to have few nonzero bits, it may instead be more efficient to use algorithms that count these bits one at a time. As Wegner described in 1960, the bitwise AND of x with x − 1 differs from x only in zeroing out the least significant nonzero bit: subtracting 1 changes the rightmost string of 0s to 1s, and changes the rightmost 1 to a 0. If x originally had n bits that were 1, then after only n iterations of this operation, x will be reduced to zero. The following implementation is based on this principle. //This is better when most bits in x are 0 //This algorithm works the same for all data sizes. //This algorithm uses 3 arithmetic operations and 1 comparison/branch per "1" bit in x. int popcount64d(uint64_t x) { int count; for (count=0; x; count++) x &= x - 1; return count; } If greater memory usage is allowed, we can calculate the Hamming weight faster than the above methods. With unlimited memory, we could simply create a large lookup table of the Hamming weight of every 64 bit integer. If we can store a lookup table of the hamming function of every 16 bit integer, we can do the following to compute the Hamming weight of every 32 bit integer. static uint8_t wordbits[65536] = { /* bitcounts of integers 0 through 65535, inclusive */ }; //This algorithm uses 3 arithmetic operations and 2 memory reads. int popcount32e(uint32_t x) { return wordbits[x & 0xFFFF] + wordbits[x >> 16]; } //Optionally, the wordbits[] table could be filled using this function int popcount32e_init(void) { uint32_t i; uint16_t x; int count; for (i=0; i <= 0xFFFF; i++) { x = i; for (count=0; x; count++) // borrowed from popcount64d() above x &= x - 1; wordbits[i] = count; } } Muła et al. have shown that a vectorized version of popcount64b can run faster than dedicated instructions (e.g., popcnt on x64 processors). Minimum weight In error-correcting coding, the minimum Hamming weight, commonly referred to as the minimum weight wmin of a code is the weight of the lowest-weight non-zero code word. The weight w of a code word is the number of 1s in the word. For example, the word 11001010 has a weight of 4. In a linear block code the minimum weight is also the minimum Hamming distance (dmin) and defines the error correction capability of the code. If wmin = n, then dmin = n and the code will correct up to dmin/2 errors. Language support Some C compilers provide intrinsic functions that provide bit counting facilities. For example, GCC (since version 3.4 in April 2004) includes a builtin function __builtin_popcount that will use a processor instruction if available or an efficient library implementation otherwise. LLVM-GCC has included this function since version 1.5 in June 2005. In the C++ Standard Library, the bit-array data structure bitset has a count() method that counts the number of bits that are set. In C++20, a new header <bit> was added, containing functions std::popcount and std::has_single_bit, taking arguments of unsigned integer types. In Java, the growable bit-array data structure has a method that counts the number of bits that are set. In addition, there are and functions to count bits in primitive 32-bit and 64-bit integers, respectively. Also, the arbitrary-precision integer class also has a method that counts bits. In Python, the int type has a bit_count() method to count the number of bits set. This functionality was introduced in Python 3.10, released in October 2021. In Common Lisp, the function logcount, given a non-negative integer, returns the number of 1 bits. (For negative integers it returns the number of 0 bits in 2's complement notation.) In either case the integer can be a BIGNUM. Starting in GHC 7.4, the Haskell base package has a popCount function available on all types that are instances of the Bits class (available from the Data.Bits module). MySQL version of SQL language provides BIT_COUNT() as a standard function. Fortran 2008 has the standard, intrinsic, elemental function popcnt returning the number of nonzero bits within an integer (or integer array). Some programmable scientific pocket calculators feature special commands to calculate the number of set bits, e.g. #B on the HP-16C and WP 43S, #BITS or BITSUM on HP-16C emulators, and nBITS on the WP 34S. FreePascal implements popcnt since version 3.0. Processor support The IBM STRETCH computer in the 1960s calculated the number of set bits as well as the number of leading zeros as a by-product of all logical operations. Cray supercomputers early on featured a population count machine instruction, rumoured to have been specifically requested by the U.S. government National Security Agency for cryptanalysis applications. Control Data Corporation's (CDC) 6000 and Cyber 70/170 series machines included a population count instruction; in COMPASS, this instruction was coded as CXi. The 64-bit SPARC version 9 architecture defines a POPC instruction, but most implementations do not implement it, requiring it be emulated by the operating system. Donald Knuth's model computer MMIX that is going to replace MIX in his book The Art of Computer Programming has an SADD instruction since 1999. SADD a,b,c counts all bits that are 1 in b and 0 in c and writes the result to a. Compaq's Alpha 21264A, released in 1999, was the first Alpha series CPU design that had the count extension (CIX). Analog Devices' Blackfin processors feature the ONES instruction to perform a 32-bit population count. AMD's Barcelona architecture introduced the advanced bit manipulation (ABM) ISA introducing the POPCNT instruction as part of the SSE4a extensions in 2007. Intel Core processors introduced a POPCNT instruction with the SSE4.2 instruction set extension, first available in a Nehalem-based Core i7 processor, released in November 2008. The ARM architecture introduced the VCNT instruction as part of the Advanced SIMD (NEON) extensions. The RISC-V architecture introduced the PCNT instruction as part of the Bit Manipulation (B) extension. See also Two's complement Fan out References Further reading (Item 169: Population count assembly code for the PDP/6-10.) External links Aggregate Magic Algorithms. Optimized population count and other algorithms explained with sample code. Bit Twiddling Hacks Several algorithms with code for counting bits set. Necessary and Sufficient - by Damien Wintour - Has code in C# for various Hamming Weight implementations. Best algorithm to count the number of set bits in a 32-bit integer? - Stackoverflow Coding theory Articles with example C code
```go // // // path_to_url // // Unless required by applicable law or agreed to in writing, software // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //go:build !go1.11 // +build !go1.11 package trace import ( "context" ) func startExecutionTracerTask(ctx context.Context, name string) (context.Context, func()) { return ctx, func() {} } ```
```xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="path_to_url" xmlns:xsi="path_to_url" xmlns:dubbo="path_to_url" xsi:schemaLocation="path_to_url path_to_url path_to_url path_to_url"> <!-- --> <dubbo:application name="stock-service" owner="crossoverJie"/> <!-- multicast --> <dubbo:registry address="zookeeper://47.98.194.60:2181" /> <!-- dubbo20880 --> <dubbo:protocol name="dubbo" port="${dubbo.protocol.port}"/> <!-- --> <dubbo:annotation package="com.crossoverJie.seconds.kill.api.impl" /> </beans> ```
```php <?php declare(strict_types=1); namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\MathTrig; use PhpOffice\PhpSpreadsheet\Calculation\MathTrig\MatrixFunctions; class MUnitTest extends AllSetupTeardown { const MU_PRECISION = 1.0E-12; public function testMUNIT(): void { $identity = MatrixFunctions::identity(3); self::assertEquals([[1, 0, 0], [0, 1, 0], [0, 0, 1]], $identity); $startArray = [[1, 2, 2], [4, 5, 6], [7, 8, 9]]; $resultArray = MatrixFunctions::multiply($startArray, $identity); self::assertEquals($startArray, $resultArray); $inverseArray = MatrixFunctions::inverse($startArray); $resultArray = MatrixFunctions::multiply($startArray, $inverseArray); self::assertEqualsWithDelta($identity, $resultArray, self::MU_PRECISION); self::assertEquals('#VALUE!', MatrixFunctions::identity(0)); self::assertEquals('#VALUE!', MatrixFunctions::identity(-1)); self::assertEquals('#VALUE!', MatrixFunctions::identity('X')); } } ```
```sqlpl update ACT_GE_PROPERTY set VALUE_ = '5.18.0.1' where NAME_ = 'schema.version'; create table ACT_PROCDEF_INFO ( ID_ varchar(64) not null, PROC_DEF_ID_ varchar(64) not null, REV_ integer, INFO_JSON_ID_ varchar(64), primary key (ID_) ); create index ACT_IDX_PROCDEF_INFO_JSON on ACT_PROCDEF_INFO(INFO_JSON_ID_); alter table ACT_PROCDEF_INFO add constraint ACT_FK_INFO_JSON_BA foreign key (INFO_JSON_ID_) references ACT_GE_BYTEARRAY (ID_); create index ACT_IDX_PROCDEF_INFO_PROC on ACT_PROCDEF_INFO(PROC_DEF_ID_); alter table ACT_PROCDEF_INFO add constraint ACT_FK_INFO_PROCDEF foreign key (PROC_DEF_ID_) references ACT_RE_PROCDEF (ID_); alter table ACT_PROCDEF_INFO add constraint ACT_UNIQ_INFO_PROCDEF unique (PROC_DEF_ID_); ```
The Pawtucket Times Building is an historic site at 23 Exchange Street in the historic central business district of Pawtucket, Rhode Island which is the home of the Pawtucket Times newspaper. History This five story masonry building was erected in 1895 to house the facilities of the Pawtucket Times, which was founded in 1885 and continues to operate from the building. In 1920 the Times added a large addition housing a printing plant, fronting on North Union Street. This was designed by Bellows & Aldrich of Boston. In 1948, a local architectural firm, the Dwight Seabury Company, was hired to alter the complex. The Seabury Company added a new printing plant addition, facing Montgomery Street. They also altered the original office block, removing the cornice and remodeling the lobby, among other work. The architect of the original building is unknown, but it bears a strong resemblance to the Odd Fellows Building in Attleboro, designed by local architect Albert H. Humes in 1897 and burned in 1918. This was also a symmetrical, four-bay composition. It also feature an upper level with arched windows, identically arranged, with an awkward relationship with the lower levels. The building was listed on the National Register of Historic Places in 1983. Architecture The main facade is faced in yellow brick with limestone trim. The first floor is divided into four bays, paired in size with the left one of the pair larger than the right. The entrance occupies the narrow bay on the far right, while the other bays are filled with windows and divided by limestone-faced piers. The next three floors also have four bays, but they are organized in mirror-image pairs, with a larger central bay with tripled windows flanked by an outer bay with a single sash window. The lintel treatments vary by floor; the windows on the fourth floor are round-arched. The fifth level is also organized in mirror-image paired bays, with the central bays each housing a row of four, small round-arch windows, and the outer bays only having two such windows. The building is topped by an elaborate dentillated cornice. See also National Register of Historic Places listings in Pawtucket, Rhode Island The Times (Pawtucket) Notes References Newspaper headquarters in the United States Newspaper buildings Commercial buildings on the National Register of Historic Places in Rhode Island Buildings and structures in Pawtucket, Rhode Island National Register of Historic Places in Pawtucket, Rhode Island Historic district contributing properties in Rhode Island
Qaleh-ye Qods (, also Romanized as Qal‘eh-ye Qods; also known as Qal‘eh-ye Moḩī od Dīn and Qods) is a village in Bazarjan Rural District, in the Central District of Tafresh County, Markazi Province, Iran. At the 2006 census, its population was 45, in 20 families. References Populated places in Tafresh County
```text Memory Infinite Health 0 jgduff1 0 1402EC24 000000C8 0 1650F454 00000064 # ASM Infinite Health 0 jgduff1 0 002C0690 7C00D850 0 002C06A4 93630048 0 002C06B8 901D0014 # Memory Infinite Rewind 0 jgduff1 0 11648D34 00000008 # ASM Infinite Rewind 0 jgduff1 0 003A3E80 7C6F0050 0 003A3E94 900B0000 0 00796ED0 908B0014 # Memory Max Level + Upgrade On 2 Kill 0 jgduff1 0 114FD664 00000007 # ASM Max Level + Upgrade On 2 Kill 0 jgduff1 0 003A2DC0 904B0014 # Memory Infinite Upgrade Points 0 jgduff1 0 12E383AA 0020 0 13314008 0000001E /* It might freeze the game. */ # Memory Unknown Code 1 0 jgduff1 0 161B08C4 161B97A0 0 1624AFC4 1625EE90 0 1624F044 1624E630 # ```
Naval Special Operations Command#Units Kenyan Special Boat Unit
```java /** * This file is part of Skript. * * Skript is free software: you can redistribute it and/or modify * (at your option) any later version. * * Skript 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 Skript. If not, see <path_to_url * */ package ch.njol.skript.expressions.arithmetic; import java.util.List; import java.util.function.Function; import org.bukkit.event.Event; import ch.njol.skript.lang.Expression; import ch.njol.skript.util.Utils; import ch.njol.util.Checker; import org.eclipse.jdt.annotation.Nullable; import org.skriptlang.skript.lang.arithmetic.Operation; import org.skriptlang.skript.lang.arithmetic.OperationInfo; import org.skriptlang.skript.lang.arithmetic.Operator; import org.skriptlang.skript.lang.arithmetic.Arithmetics; import org.skriptlang.skript.lang.converter.Converters; /** * Represents a chain of arithmetic operations between two operands. * * @param <L> the type of the left operand * @param <R> the type of the right operand * @param <T> the return type of the operation */ public class ArithmeticChain<L, R, T> implements ArithmeticGettable<T> { @SuppressWarnings("unchecked") private static final Checker<Object>[] CHECKERS = new Checker[] { o -> o.equals(Operator.ADDITION) || o.equals(Operator.SUBTRACTION), o -> o.equals(Operator.MULTIPLICATION) || o.equals(Operator.DIVISION), o -> o.equals(Operator.EXPONENTIATION) }; private final ArithmeticGettable<L> left; private final ArithmeticGettable<R> right; private final Operator operator; private final Class<? extends T> returnType; @Nullable private OperationInfo<? extends L, ? extends R, ? extends T> operationInfo; public ArithmeticChain(ArithmeticGettable<L> left, Operator operator, ArithmeticGettable<R> right, @Nullable OperationInfo<L, R, T> operationInfo) { this.left = left; this.right = right; this.operator = operator; this.operationInfo = operationInfo; this.returnType = operationInfo != null ? operationInfo.getReturnType() : (Class<? extends T>) Object.class; } @Override @Nullable @SuppressWarnings("unchecked") public T get(Event event) { L left = this.left.get(event); if (left == null && this.left instanceof ArithmeticChain) return null; R right = this.right.get(event); if (right == null && this.right instanceof ArithmeticChain) return null; Class<? extends L> leftClass = left != null ? (Class<? extends L>) left.getClass() : this.left.getReturnType(); Class<? extends R> rightClass = right != null ? (Class<? extends R>) right.getClass() : this.right.getReturnType(); if (leftClass == Object.class && rightClass == Object.class) return null; if (left == null && leftClass == Object.class) { operationInfo = lookupOperationInfo(rightClass, OperationInfo::getRight); } else if (right == null && rightClass == Object.class) { operationInfo = lookupOperationInfo(leftClass, OperationInfo::getLeft); } else if (operationInfo == null) { operationInfo = Arithmetics.lookupOperationInfo(operator, leftClass, rightClass, returnType); } if (operationInfo == null) return null; left = left != null ? left : Arithmetics.getDefaultValue(operationInfo.getLeft()); if (left == null) return null; right = right != null ? right : Arithmetics.getDefaultValue(operationInfo.getRight()); if (right == null) return null; return ((Operation<L, R, T>) operationInfo.getOperation()).calculate(left, right); } @Nullable @SuppressWarnings("unchecked") private OperationInfo<L, R, T> lookupOperationInfo(Class<?> anchor, Function<OperationInfo<?, ?, ?>, Class<?>> anchorFunction) { OperationInfo<?, ?, ?> operationInfo = Arithmetics.lookupOperationInfo(operator, anchor, anchor); if (operationInfo != null) return (OperationInfo<L, R, T>) operationInfo; return (OperationInfo<L, R, T>) Arithmetics.getOperations(operator).stream() .filter(info -> anchorFunction.apply(info).isAssignableFrom(anchor)) .filter(info -> Converters.converterExists(info.getReturnType(), returnType)) .reduce((info, info2) -> { if (anchorFunction.apply(info2) == anchor) return info2; return info; }) .orElse(null); } @Override public Class<? extends T> getReturnType() { return returnType; } @Nullable @SuppressWarnings("unchecked") public static <L, R, T> ArithmeticGettable<T> parse(List<Object> chain) { for (Checker<Object> checker : CHECKERS) { int lastIndex = Utils.findLastIndex(chain, checker); if (lastIndex != -1) { ArithmeticGettable<L> left = parse(chain.subList(0, lastIndex)); Operator operator = (Operator) chain.get(lastIndex); ArithmeticGettable<R> right = parse(chain.subList(lastIndex + 1, chain.size())); if (left == null || right == null) return null; OperationInfo<L, R, T> operationInfo = null; if (left.getReturnType() != Object.class && right.getReturnType() != Object.class) { operationInfo = (OperationInfo<L, R, T>) Arithmetics.lookupOperationInfo(operator, left.getReturnType(), right.getReturnType()); if (operationInfo == null) return null; } return new ArithmeticChain<>(left, operator, right, operationInfo); } } if (chain.size() != 1) throw new IllegalStateException(); return new ArithmeticExpressionInfo<>((Expression<T>) chain.get(0)); } } ```
The Northern Bloc of the United Self-Defense Forces of Colombia () was a Colombian paramilitary organization that operated until March 2006, when it demobilized. Blocs of the United Self-Defense Forces of Colombia Military units and formations disestablished in 2006 2006 disestablishments in South America
```c++ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include <set> #include <string> #include "base/time/time.h" #include "base/trace_event/trace_event_argument.h" #include "base/values.h" #include "cc/debug/frame_timing_tracker.h" #include "cc/test/fake_impl_proxy.h" #include "cc/test/fake_layer_tree_host_impl.h" #include "cc/test/test_shared_bitmap_manager.h" #include "cc/test/test_task_graph_runner.h" #include "testing/gtest/include/gtest/gtest.h" namespace cc { namespace { std::string CompositeToString( scoped_ptr<FrameTimingTracker::CompositeTimingSet> timingset) { scoped_refptr<base::trace_event::TracedValue> value = new base::trace_event::TracedValue(); value->BeginArray("values"); std::set<int> rect_ids; for (const auto& pair : *timingset) rect_ids.insert(pair.first); for (const auto& rect_id : rect_ids) { auto& events = (*timingset)[rect_id]; value->BeginDictionary(); value->SetInteger("rect_id", rect_id); value->BeginArray("events"); for (const auto& event : events) { value->BeginDictionary(); value->SetInteger("frame_id", event.frame_id); value->SetInteger("timestamp", event.timestamp.ToInternalValue()); value->EndDictionary(); } value->EndArray(); value->EndDictionary(); } value->EndArray(); return value->ToString(); } std::string MainFrameToString( scoped_ptr<FrameTimingTracker::MainFrameTimingSet> timingset) { scoped_refptr<base::trace_event::TracedValue> value = new base::trace_event::TracedValue(); value->BeginArray("values"); std::set<int> rect_ids; for (const auto& pair : *timingset) rect_ids.insert(pair.first); for (const auto& rect_id : rect_ids) { auto& events = (*timingset)[rect_id]; value->BeginDictionary(); value->SetInteger("rect_id", rect_id); value->BeginArray("events"); for (const auto& event : events) { value->BeginDictionary(); value->SetInteger("end_time", event.end_time.ToInternalValue()); value->SetInteger("frame_id", event.frame_id); value->SetInteger("timestamp", event.timestamp.ToInternalValue()); value->EndDictionary(); } value->EndArray(); value->EndDictionary(); } value->EndArray(); return value->ToString(); } TEST(FrameTimingTrackerTest, DefaultTrackerIsEmpty) { FakeImplProxy proxy; TestSharedBitmapManager shared_bitmap_manager; TestTaskGraphRunner task_graph_runner; FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, &task_graph_runner); scoped_ptr<FrameTimingTracker> tracker( FrameTimingTracker::Create(&host_impl)); EXPECT_EQ("{\"values\":[]}", CompositeToString(tracker->GroupCompositeCountsByRectId())); EXPECT_EQ("{\"values\":[]}", MainFrameToString(tracker->GroupMainFrameCountsByRectId())); } TEST(FrameTimingTrackerTest, NoFrameIdsIsEmpty) { FakeImplProxy proxy; TestSharedBitmapManager shared_bitmap_manager; TestTaskGraphRunner task_graph_runner; FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, &task_graph_runner); scoped_ptr<FrameTimingTracker> tracker( FrameTimingTracker::Create(&host_impl)); std::vector<std::pair<int, int64_t>> ids; tracker->SaveTimeStamps(base::TimeTicks::FromInternalValue(100), ids); EXPECT_EQ("{\"values\":[]}", CompositeToString(tracker->GroupCompositeCountsByRectId())); } TEST(FrameTimingTrackerTest, NoRectIdsYieldsNoMainFrameEvents) { FakeImplProxy proxy; TestSharedBitmapManager shared_bitmap_manager; TestTaskGraphRunner task_graph_runner; FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, &task_graph_runner); scoped_ptr<FrameTimingTracker> tracker( FrameTimingTracker::Create(&host_impl)); tracker->SaveMainFrameTimeStamps(std::vector<int64_t>(), base::TimeTicks::FromInternalValue(100), base::TimeTicks::FromInternalValue(110), 1); EXPECT_EQ("{\"values\":[]}", MainFrameToString(tracker->GroupMainFrameCountsByRectId())); } TEST(FrameTimingTrackerTest, OneFrameId) { FakeImplProxy proxy; TestSharedBitmapManager shared_bitmap_manager; TestTaskGraphRunner task_graph_runner; FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, &task_graph_runner); scoped_ptr<FrameTimingTracker> tracker( FrameTimingTracker::Create(&host_impl)); std::vector<std::pair<int, int64_t>> ids; ids.push_back(std::make_pair(1, 2)); tracker->SaveTimeStamps(base::TimeTicks::FromInternalValue(100), ids); EXPECT_EQ( "{\"values\":[{\"events\":[" "{\"frame_id\":1,\"timestamp\":100}],\"rect_id\":2}]}", CompositeToString(tracker->GroupCompositeCountsByRectId())); } TEST(FrameTimingTrackerTest, OneMainFrameRect) { FakeImplProxy proxy; TestSharedBitmapManager shared_bitmap_manager; TestTaskGraphRunner task_graph_runner; FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, &task_graph_runner); scoped_ptr<FrameTimingTracker> tracker( FrameTimingTracker::Create(&host_impl)); std::vector<int64_t> rect_ids; rect_ids.push_back(1); tracker->SaveMainFrameTimeStamps(rect_ids, base::TimeTicks::FromInternalValue(100), base::TimeTicks::FromInternalValue(110), 2); EXPECT_EQ( "{\"values\":[{\"events\":[" "{\"end_time\":110,\"frame_id\":2,\"timestamp\":100}],\"rect_id\":1}]}", MainFrameToString(tracker->GroupMainFrameCountsByRectId())); } TEST(FrameTimingTrackerTest, UnsortedTimestampsIds) { FakeImplProxy proxy; TestSharedBitmapManager shared_bitmap_manager; TestTaskGraphRunner task_graph_runner; FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, &task_graph_runner); scoped_ptr<FrameTimingTracker> tracker( FrameTimingTracker::Create(&host_impl)); std::vector<std::pair<int, int64_t>> ids; ids.push_back(std::make_pair(1, 2)); tracker->SaveTimeStamps(base::TimeTicks::FromInternalValue(200), ids); tracker->SaveTimeStamps(base::TimeTicks::FromInternalValue(400), ids); tracker->SaveTimeStamps(base::TimeTicks::FromInternalValue(100), ids); EXPECT_EQ( "{\"values\":[{\"events\":[" "{\"frame_id\":1,\"timestamp\":100}," "{\"frame_id\":1,\"timestamp\":200}," "{\"frame_id\":1,\"timestamp\":400}],\"rect_id\":2}]}", CompositeToString(tracker->GroupCompositeCountsByRectId())); } TEST(FrameTimingTrackerTest, MainFrameUnsortedTimestamps) { FakeImplProxy proxy; TestSharedBitmapManager shared_bitmap_manager; TestTaskGraphRunner task_graph_runner; FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, &task_graph_runner); scoped_ptr<FrameTimingTracker> tracker( FrameTimingTracker::Create(&host_impl)); std::vector<int64_t> rect_ids; rect_ids.push_back(2); tracker->SaveMainFrameTimeStamps(rect_ids, base::TimeTicks::FromInternalValue(200), base::TimeTicks::FromInternalValue(280), 1); tracker->SaveMainFrameTimeStamps(rect_ids, base::TimeTicks::FromInternalValue(400), base::TimeTicks::FromInternalValue(470), 1); tracker->SaveMainFrameTimeStamps(rect_ids, base::TimeTicks::FromInternalValue(100), base::TimeTicks::FromInternalValue(160), 1); EXPECT_EQ( "{\"values\":[{\"events\":[" "{\"end_time\":160,\"frame_id\":1,\"timestamp\":100}," "{\"end_time\":280,\"frame_id\":1,\"timestamp\":200}," "{\"end_time\":470,\"frame_id\":1,\"timestamp\":400}],\"rect_id\":2}]}", MainFrameToString(tracker->GroupMainFrameCountsByRectId())); } TEST(FrameTimingTrackerTest, MultipleFrameIds) { FakeImplProxy proxy; TestSharedBitmapManager shared_bitmap_manager; TestTaskGraphRunner task_graph_runner; FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, &task_graph_runner); scoped_ptr<FrameTimingTracker> tracker( FrameTimingTracker::Create(&host_impl)); std::vector<std::pair<int, int64_t>> ids200; ids200.push_back(std::make_pair(1, 2)); ids200.push_back(std::make_pair(1, 3)); tracker->SaveTimeStamps(base::TimeTicks::FromInternalValue(200), ids200); std::vector<std::pair<int, int64_t>> ids400; ids400.push_back(std::make_pair(2, 2)); tracker->SaveTimeStamps(base::TimeTicks::FromInternalValue(400), ids400); std::vector<std::pair<int, int64_t>> ids100; ids100.push_back(std::make_pair(3, 2)); ids100.push_back(std::make_pair(2, 3)); ids100.push_back(std::make_pair(3, 4)); tracker->SaveTimeStamps(base::TimeTicks::FromInternalValue(100), ids100); EXPECT_EQ( "{\"values\":[{\"events\":[" "{\"frame_id\":3,\"timestamp\":100}," "{\"frame_id\":1,\"timestamp\":200}," "{\"frame_id\":2,\"timestamp\":400}],\"rect_id\":2}," "{\"events\":[" "{\"frame_id\":2,\"timestamp\":100}," "{\"frame_id\":1,\"timestamp\":200}],\"rect_id\":3}," "{\"events\":[" "{\"frame_id\":3,\"timestamp\":100}],\"rect_id\":4}" "]}", CompositeToString(tracker->GroupCompositeCountsByRectId())); } TEST(FrameTimingTrackerTest, MultipleMainFrameEvents) { FakeImplProxy proxy; TestSharedBitmapManager shared_bitmap_manager; TestTaskGraphRunner task_graph_runner; FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, &task_graph_runner); scoped_ptr<FrameTimingTracker> tracker( FrameTimingTracker::Create(&host_impl)); std::vector<int64_t> rect_ids200; rect_ids200.push_back(2); rect_ids200.push_back(3); tracker->SaveMainFrameTimeStamps(rect_ids200, base::TimeTicks::FromInternalValue(200), base::TimeTicks::FromInternalValue(220), 1); std::vector<int64_t> rect_ids400; rect_ids400.push_back(2); tracker->SaveMainFrameTimeStamps(rect_ids400, base::TimeTicks::FromInternalValue(400), base::TimeTicks::FromInternalValue(440), 2); std::vector<int64_t> rect_ids100; rect_ids100.push_back(2); rect_ids100.push_back(3); rect_ids100.push_back(4); tracker->SaveMainFrameTimeStamps(rect_ids100, base::TimeTicks::FromInternalValue(100), base::TimeTicks::FromInternalValue(110), 3); EXPECT_EQ( "{\"values\":[{\"events\":[" "{\"end_time\":110,\"frame_id\":3,\"timestamp\":100}," "{\"end_time\":220,\"frame_id\":1,\"timestamp\":200}," "{\"end_time\":440,\"frame_id\":2,\"timestamp\":400}],\"rect_id\":2}," "{\"events\":[" "{\"end_time\":110,\"frame_id\":3,\"timestamp\":100}," "{\"end_time\":220,\"frame_id\":1,\"timestamp\":200}],\"rect_id\":3}," "{\"events\":[" "{\"end_time\":110,\"frame_id\":3,\"timestamp\":100}],\"rect_id\":4}" "]}", MainFrameToString(tracker->GroupMainFrameCountsByRectId())); } } // namespace } // namespace cc ```
```c /* $OpenBSD: getopt_long.c,v 1.26 2013/06/08 22:47:56 millert Exp $ */ /* $NetBSD: getopt_long.c,v 1.15 2002/01/31 22:43:40 tv Exp $ */ /* $FreeBSD: head/lib/libc/stdlib/getopt_long.c 236936 2012-06-11 22:25:20Z delphij $ */ /* * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Sponsored in part by the Defense Advanced Research Projects * Agency (DARPA) and Air Force Research Laboratory, Air Force * Materiel Command, USAF, under agreement number F39502-99-1-0512. */ /*- * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation * by Dieter Baron and Thomas Klausner. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. 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. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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. */ #include <config.h> #include <sys/types.h> #include <stdio.h> #include <stdlib.h> #ifdef HAVE_STRING_H # include <string.h> #endif /* HAVE_STRING_H */ #ifdef HAVE_STRINGS_H # include <strings.h> #endif /* HAVE_STRINGS_H */ #define SUDO_ERROR_WRAP 0 #include "sudo_compat.h" #include "sudo_fatal.h" #include "compat/getopt.h" #define GNU_COMPATIBLE /* Be more compatible with GNU getopt. */ #ifdef REPLACE_GETOPT int opterr = 1; /* if error message should be printed */ int optind = 1; /* index into parent argv vector */ int optopt = '?'; /* character checked for validity */ char *optarg; /* argument associated with option */ #else extern int opterr; /* if error message should be printed */ extern int optind; /* index into parent argv vector */ extern int optopt; /* character checked for validity */ extern char *optarg; /* argument associated with option */ #endif #if !defined(REPLACE_GETOPT) && !defined(HAVE_OPTRESET) int optreset; /* reset getopt */ #endif #define PRINT_ERROR ((opterr) && (*options != ':')) #define FLAG_PERMUTE 0x01 /* permute non-options to the end of argv */ #define FLAG_ALLARGS 0x02 /* treat non-options as args to option "-1" */ #define FLAG_LONGONLY 0x04 /* operate as getopt_long_only */ /* return values */ #define BADCH (int)'?' #define BADARG ((*options == ':') ? (int)':' : (int)'?') #define INORDER (int)1 #define EMSG "" #ifdef GNU_COMPATIBLE #define NO_PREFIX (-1) #define D_PREFIX 0 #define DD_PREFIX 1 #define W_PREFIX 2 #endif static int getopt_internal(int, char * const *, const char *, const struct option *, int *, int); static int parse_long_options(char * const *, const char *, const struct option *, int *, int, int); static int gcd(int, int); static void permute_args(int, int, int, char * const *); static char *place = EMSG; /* option letter processing */ /* XXX: set optreset to 1 rather than these two */ static int nonopt_start = -1; /* first non option argument (for permute) */ static int nonopt_end = -1; /* first option after non options (for permute) */ /* Error messages */ static const char recargchar[] = "option requires an argument -- %c"; static const char illoptchar[] = "illegal option -- %c"; /* From P1003.2 */ #ifdef GNU_COMPATIBLE static int dash_prefix = NO_PREFIX; static const char gnuoptchar[] = "invalid option -- %c"; static const char recargstring[] = "option `%s%s' requires an argument"; static const char ambig[] = "option `%s%.*s' is ambiguous"; static const char noarg[] = "option `%s%.*s' doesn't allow an argument"; static const char illoptstring[] = "unrecognized option `%s%s'"; #else static const char recargstring[] = "option requires an argument -- %s"; static const char ambig[] = "ambiguous option -- %.*s"; static const char noarg[] = "option doesn't take an argument -- %.*s"; static const char illoptstring[] = "unknown option -- %s"; #endif /* * Compute the greatest common divisor of a and b. */ static int gcd(int a, int b) { int c; c = a % b; while (c != 0) { a = b; b = c; c = a % b; } return (b); } /* * Exchange the block from nonopt_start to nonopt_end with the block * from nonopt_end to opt_end (keeping the same order of arguments * in each block). */ static void permute_args(int panonopt_start, int panonopt_end, int opt_end, char * const *nargv) { int cstart, cyclelen, i, j, ncycle, nnonopts, nopts, pos; char *swap; /* * compute lengths of blocks and number and size of cycles */ nnonopts = panonopt_end - panonopt_start; nopts = opt_end - panonopt_end; ncycle = gcd(nnonopts, nopts); cyclelen = (opt_end - panonopt_start) / ncycle; for (i = 0; i < ncycle; i++) { cstart = panonopt_end+i; pos = cstart; for (j = 0; j < cyclelen; j++) { if (pos >= panonopt_end) pos -= nnonopts; else pos += nopts; swap = nargv[pos]; /* LINTED const cast */ ((char **) nargv)[pos] = nargv[cstart]; /* LINTED const cast */ ((char **)nargv)[cstart] = swap; } } } /* * parse_long_options -- * Parse long options in argc/argv argument vector. * Returns -1 if short_too is set and the option does not match long_options. */ static int parse_long_options(char * const *nargv, const char *options, const struct option *long_options, int *idx, int short_too, int flags) { char *current_argv, *has_equal; #ifdef GNU_COMPATIBLE char *current_dash; #endif size_t current_argv_len; int i, match, exact_match, second_partial_match; current_argv = place; #ifdef GNU_COMPATIBLE switch (dash_prefix) { case D_PREFIX: current_dash = "-"; break; case DD_PREFIX: current_dash = "--"; break; case W_PREFIX: current_dash = "-W "; break; default: current_dash = ""; break; } #endif match = -1; exact_match = 0; second_partial_match = 0; optind++; if ((has_equal = strchr(current_argv, '=')) != NULL) { /* argument found (--option=arg) */ current_argv_len = has_equal - current_argv; has_equal++; } else current_argv_len = strlen(current_argv); for (i = 0; long_options[i].name; i++) { /* find matching long option */ if (strncmp(current_argv, long_options[i].name, current_argv_len)) continue; if (strlen(long_options[i].name) == current_argv_len) { /* exact match */ match = i; exact_match = 1; break; } /* * If this is a known short option, don't allow * a partial match of a single character. */ if (short_too && current_argv_len == 1) continue; if (match == -1) /* first partial match */ match = i; else if ((flags & FLAG_LONGONLY) || long_options[i].has_arg != long_options[match].has_arg || long_options[i].flag != long_options[match].flag || long_options[i].val != long_options[match].val) second_partial_match = 1; } if (!exact_match && second_partial_match) { /* ambiguous abbreviation */ if (PRINT_ERROR) sudo_warnx(ambig, #ifdef GNU_COMPATIBLE current_dash, #endif (int)current_argv_len, current_argv); optopt = 0; return (BADCH); } if (match != -1) { /* option found */ if (long_options[match].has_arg == no_argument && has_equal) { if (PRINT_ERROR) sudo_warnx(noarg, #ifdef GNU_COMPATIBLE current_dash, #endif (int)current_argv_len, current_argv); /* * XXX: GNU sets optopt to val regardless of flag */ if (long_options[match].flag == NULL) optopt = long_options[match].val; else optopt = 0; #ifdef GNU_COMPATIBLE return (BADCH); #else return (BADARG); #endif } if (long_options[match].has_arg == required_argument || long_options[match].has_arg == optional_argument) { if (has_equal) optarg = has_equal; else if (long_options[match].has_arg == required_argument) { /* * optional argument doesn't use next nargv */ optarg = nargv[optind++]; } } if ((long_options[match].has_arg == required_argument) && (optarg == NULL)) { /* * Missing argument; leading ':' indicates no error * should be generated. */ if (PRINT_ERROR) sudo_warnx(recargstring, #ifdef GNU_COMPATIBLE current_dash, #endif current_argv); /* * XXX: GNU sets optopt to val regardless of flag */ if (long_options[match].flag == NULL) optopt = long_options[match].val; else optopt = 0; --optind; return (BADARG); } } else { /* unknown option */ if (short_too) { --optind; return (-1); } if (PRINT_ERROR) sudo_warnx(illoptstring, #ifdef GNU_COMPATIBLE current_dash, #endif current_argv); optopt = 0; return (BADCH); } if (idx) *idx = match; if (long_options[match].flag) { *long_options[match].flag = long_options[match].val; return (0); } else return (long_options[match].val); } /* * getopt_internal -- * Parse argc/argv argument vector. Called by user level routines. */ static int getopt_internal(int nargc, char * const *nargv, const char *options, const struct option *long_options, int *idx, int flags) { char *oli; /* option letter list index */ int optchar, short_too; int posixly_correct; /* no static, can be changed on the fly */ if (options == NULL) return (-1); /* * Disable GNU extensions if POSIXLY_CORRECT is set or options * string begins with a '+'. */ posixly_correct = (getenv("POSIXLY_CORRECT") != NULL); #ifdef GNU_COMPATIBLE if (*options == '-') flags |= FLAG_ALLARGS; else if (posixly_correct || *options == '+') flags &= ~FLAG_PERMUTE; #else if (posixly_correct || *options == '+') flags &= ~FLAG_PERMUTE; else if (*options == '-') flags |= FLAG_ALLARGS; #endif if (*options == '+' || *options == '-') options++; /* * XXX Some GNU programs (like cvs) set optind to 0 instead of * XXX using optreset. Work around this braindamage. */ if (optind == 0) optind = optreset = 1; optarg = NULL; if (optreset) nonopt_start = nonopt_end = -1; start: if (optreset || !*place) { /* update scanning pointer */ optreset = 0; if (optind >= nargc) { /* end of argument vector */ place = EMSG; if (nonopt_end != -1) { /* do permutation, if we have to */ permute_args(nonopt_start, nonopt_end, optind, nargv); optind -= nonopt_end - nonopt_start; } else if (nonopt_start != -1) { /* * If we skipped non-options, set optind * to the first of them. */ optind = nonopt_start; } nonopt_start = nonopt_end = -1; return (-1); } if (*(place = nargv[optind]) != '-' || #ifdef GNU_COMPATIBLE place[1] == '\0') { #else (place[1] == '\0' && strchr(options, '-') == NULL)) { #endif place = EMSG; /* found non-option */ if (flags & FLAG_ALLARGS) { /* * GNU extension: * return non-option as argument to option 1 */ optarg = nargv[optind++]; return (INORDER); } if (!(flags & FLAG_PERMUTE)) { /* * If no permutation wanted, stop parsing * at first non-option. */ return (-1); } /* do permutation */ if (nonopt_start == -1) nonopt_start = optind; else if (nonopt_end != -1) { permute_args(nonopt_start, nonopt_end, optind, nargv); nonopt_start = optind - (nonopt_end - nonopt_start); nonopt_end = -1; } optind++; /* process next argument */ goto start; } if (nonopt_start != -1 && nonopt_end == -1) nonopt_end = optind; /* * If we have "-" do nothing, if "--" we are done. */ if (place[1] != '\0' && *++place == '-' && place[1] == '\0') { optind++; place = EMSG; /* * We found an option (--), so if we skipped * non-options, we have to permute. */ if (nonopt_end != -1) { permute_args(nonopt_start, nonopt_end, optind, nargv); optind -= nonopt_end - nonopt_start; } nonopt_start = nonopt_end = -1; return (-1); } } /* * Check long options if: * 1) we were passed some * 2) the arg is not just "-" * 3) either the arg starts with -- we are getopt_long_only() */ if (long_options != NULL && place != nargv[optind] && (*place == '-' || (flags & FLAG_LONGONLY))) { short_too = 0; #ifdef GNU_COMPATIBLE dash_prefix = D_PREFIX; #endif if (*place == '-') { place++; /* --foo long option */ #ifdef GNU_COMPATIBLE dash_prefix = DD_PREFIX; #endif } else if (*place != ':' && strchr(options, *place) != NULL) short_too = 1; /* could be short option too */ optchar = parse_long_options(nargv, options, long_options, idx, short_too, flags); if (optchar != -1) { place = EMSG; return (optchar); } } if ((optchar = (int)*place++) == (int)':' || (optchar == (int)'-' && *place != '\0') || (oli = strchr(options, optchar)) == NULL) { /* * If the user specified "-" and '-' isn't listed in * options, return -1 (non-option) as per POSIX. * Otherwise, it is an unknown option character (or ':'). */ if (optchar == (int)'-' && *place == '\0') return (-1); if (!*place) ++optind; #ifdef GNU_COMPATIBLE if (PRINT_ERROR) sudo_warnx(posixly_correct ? illoptchar : gnuoptchar, optchar); #else if (PRINT_ERROR) sudo_warnx(illoptchar, optchar); #endif optopt = optchar; return (BADCH); } if (long_options != NULL && optchar == 'W' && oli[1] == ';') { /* -W long-option */ if (*place) /* no space */ /* NOTHING */; else if (++optind >= nargc) { /* no arg */ place = EMSG; if (PRINT_ERROR) sudo_warnx(recargchar, optchar); optopt = optchar; return (BADARG); } else /* white space */ place = nargv[optind]; #ifdef GNU_COMPATIBLE dash_prefix = W_PREFIX; #endif optchar = parse_long_options(nargv, options, long_options, idx, 0, flags); place = EMSG; return (optchar); } if (*++oli != ':') { /* doesn't take argument */ if (!*place) ++optind; } else { /* takes (optional) argument */ optarg = NULL; if (*place) /* no white space */ optarg = place; else if (oli[1] != ':') { /* arg not optional */ if (++optind >= nargc) { /* no arg */ place = EMSG; if (PRINT_ERROR) sudo_warnx(recargchar, optchar); optopt = optchar; return (BADARG); } else optarg = nargv[optind]; } place = EMSG; ++optind; } /* dump back option letter */ return (optchar); } #ifdef REPLACE_GETOPT /* * getopt -- * Parse argc/argv argument vector. */ int sudo_getopt(int nargc, char * const *nargv, const char *options) { /* * We don't pass FLAG_PERMUTE to getopt_internal() since * the BSD getopt(3) (unlike GNU) has never done this. * * Furthermore, since many privileged programs call getopt() * before dropping privileges it makes sense to keep things * as simple (and bug-free) as possible. */ return (getopt_internal(nargc, nargv, options, NULL, NULL, 0)); } #endif /* REPLACE_GETOPT */ /* * getopt_long -- * Parse argc/argv argument vector. */ int sudo_getopt_long(int nargc, char * const *nargv, const char *options, const struct option *long_options, int *idx) { return (getopt_internal(nargc, nargv, options, long_options, idx, FLAG_PERMUTE)); } /* * getopt_long_only -- * Parse argc/argv argument vector. */ int sudo_getopt_long_only(int nargc, char * const *nargv, const char *options, const struct option *long_options, int *idx) { return (getopt_internal(nargc, nargv, options, long_options, idx, FLAG_PERMUTE|FLAG_LONGONLY)); } ```
```ruby require_relative '../spec_helper' describe "Addrinfo#ipv4_private?" do describe "for an ipv4 socket" do before :each do @private = Addrinfo.tcp("10.0.0.1", 80) @other = Addrinfo.tcp("0.0.0.0", 80) end it "returns true for a private address" do Addrinfo.ip('10.0.0.0').should.ipv4_private? Addrinfo.ip('10.0.0.5').should.ipv4_private? Addrinfo.ip('172.16.0.0').should.ipv4_private? Addrinfo.ip('172.16.0.5').should.ipv4_private? Addrinfo.ip('192.168.0.0').should.ipv4_private? Addrinfo.ip('192.168.0.5').should.ipv4_private? end it "returns false for a public address" do @other.ipv4_private?.should be_false end end describe "for an ipv6 socket" do before :each do @other = Addrinfo.tcp("::", 80) end it "returns false" do @other.ipv4_private?.should be_false end end with_feature :unix_socket do describe "for a unix socket" do before :each do @addrinfo = Addrinfo.unix("/tmp/sock") end it "returns false" do @addrinfo.ipv4_private?.should be_false end end end end ```
```xml import { getStaticURL } from '@proton/shared/lib/helpers/url'; import { getAppHref } from '../apps/helper'; import { APPS } from '../constants'; export const DRIVE_LANDING_PAGE = getStaticURL('/drive'); export const DRIVE_PRICING_PAGE = getStaticURL('/drive/pricing?product=drive'); export const DRIVE_SIGNUP = getAppHref('/drive/signup', APPS.PROTONACCOUNT); export const DRIVE_SIGNIN = getAppHref('/drive', APPS.PROTONACCOUNT); export const DRIVE_IOS_APP = 'path_to_url export const DRIVE_ANDROID_APP = 'path_to_url ```
Newaygo ( ) is a rural city in Newaygo County in the U.S. state of Michigan. The population was 2,471 at the 2020 census. Geography According to the United States Census Bureau, the city has a total area of , of which is land and is water. including the Muskegon River, which runs through the town and is often used for canoe trips, tubing, and fishing. The county is considered part of West Michigan. Newaygo is part of the Roman Catholic Diocese of Grand Rapids. Geographic features The Muskegon River flows through the north side of the town. Major highways History Newaygo's recorded history goes back to the 1600s and the French coureur des bois (independent trappers) and, later, fur company voyageurs that travelled by canoe via the Muskegon River. It was ostensibly named after Chief Nuwagon, an Ojibwe leader who signed the Treaty of Saginaw in 1819, or for an Algonquian word meaning "much water". John Brooks came to harvest lumber in 1836, and was the town's first postmaster in 1847. Proximity to the river made it a center for floating logs to the mills in Muskegon during the lumber boom of the late 1800s. Demographics 2010 census As of the census of 2010, there were 1,976 people, 786 households, and 502 families living in the city. The population density was . There were 892 housing units at an average density of . The racial makeup of the city was 93.6% White, 0.9% African American, 1.2% Native American, 0.7% Asian, 0.1% Pacific Islander, 1.6% from other races, and 2.0% from two or more races. Hispanic or Latino of any race were 7.3% of the population. There were 786 households, of which 36.8% had children under the age of 18 living with them, 39.7% were married couples living together, 20.2% had a female householder with no husband present, 3.9% had a male householder with no wife present, and 36.1% were non-families. 30.7% of all households were made up of individuals, and 14.7% had someone living alone who was 65 years of age or older. The average household size was 2.51 and the average family size was 3.10. The median age in the city was 32.4 years. 29.3% of residents were under the age of 18; 10.5% were between the ages of 18 and 24; 24.7% were from 25 to 44; 21.3% were from 45 to 64; and 14.2% were 65 years of age or older. The gender makeup of the city was 46.1% male and 53.9% female. 2000 census As of the census of 2000, there were 1,670 people, 620 households, and 450 families living in the city. The population density was . There were 707 housing units at an average density of . The racial makeup of the city was 95.87% White, 0.24% African American, 0.24% Native American, 0.12% Asian, 2.34% from other races, and 1.20% from two or more races. Hispanic or Latino of any race were 4.79% of the population. There were 620 households, out of which 41.6% had children under the age of 18 living with them, 50.8% were married couples living together, 17.9% had a female householder with no husband present, and 27.4% were non-families. 23.7% of all households were made up of individuals, and 7.7% had someone living alone who was 65 years of age or older. The average household size was 2.69 and the average family size was 3.16. In the city, the population was spread out, with 33.1% under the age of 18, 10.7% from 18 to 24, 26.1% from 25 to 44, 18.6% from 45 to 64, and 11.5% who were 65 years of age or older. The median age was 30 years. For every 100 females, there were 89.1 males. For every 100 females age 18 and over, there were 84.9 males. The median income for a household in the city was $32,273, and the median income for a family was $36,023. Males had a median income of $32,763 versus $21,385 for females. The per capita income for the city was $14,643. About 15.2% of families and 16.5% of the population were below the poverty line, including 22.5% of those under age 18 and 6.3% of those age 65 or over. Climate The Köppen Climate Classification subtype for this climate is "Dfb". (Warm Summer Continental Climate). Notable people Ella H. Brockway Avann (born 1853), educator Roy Bargy, composer and pianist Joe Berger, lineman with the Minnesota Vikings of the NFL Jack Nitzsche, musician and arranger Bertha Yerex Whitman, architect Notes External links City of Newaygo Newaygo Area Chamber of Commerce Cities in Newaygo County, Michigan Grand Rapids metropolitan area Michigan placenames of Native American origin Populated places established in 1847 1847 establishments in Michigan
```c++ /* * 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, * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * specific language governing permissions and limitations */ /*! * \file src/contrib/msc/core/printer/msc_base_printer.cc */ #include "msc_base_printer.h" #include "../utils.h" namespace tvm { namespace contrib { namespace msc { void MSCBasePrinter::PrintDoc(const Doc& doc, bool new_line) { if (new_line) { NewLine(); lines_++; } if (auto doc_node = doc.as<LiteralDoc>()) { PrintTypedDoc(doc_node.value()); } else if (auto doc_node = doc.as<IdDoc>()) { PrintTypedDoc(doc_node.value()); } else if (auto doc_node = doc.as<AttrAccessDoc>()) { PrintTypedDoc(doc_node.value()); } else if (auto doc_node = doc.as<IndexDoc>()) { PrintTypedDoc(doc_node.value()); } else if (auto doc_node = doc.as<CallDoc>()) { PrintTypedDoc(doc_node.value()); } else if (auto doc_node = doc.as<ListDoc>()) { PrintTypedDoc(doc_node.value()); } else if (auto doc_node = doc.as<TupleDoc>()) { PrintTypedDoc(doc_node.value()); } else if (auto doc_node = doc.as<DictDoc>()) { PrintTypedDoc(doc_node.value()); } else if (auto doc_node = doc.as<SliceDoc>()) { PrintTypedDoc(doc_node.value()); } else if (auto doc_node = doc.as<StmtBlockDoc>()) { PrintTypedDoc(doc_node.value()); } else if (auto doc_node = doc.as<AssignDoc>()) { PrintTypedDoc(doc_node.value()); } else if (auto doc_node = doc.as<IfDoc>()) { PrintTypedDoc(doc_node.value()); } else if (auto doc_node = doc.as<WhileDoc>()) { PrintTypedDoc(doc_node.value()); } else if (auto doc_node = doc.as<ForDoc>()) { PrintTypedDoc(doc_node.value()); } else if (auto doc_node = doc.as<ScopeDoc>()) { PrintTypedDoc(doc_node.value()); } else if (auto doc_node = doc.as<ExprStmtDoc>()) { PrintTypedDoc(doc_node.value()); } else if (auto doc_node = doc.as<AssertDoc>()) { PrintTypedDoc(doc_node.value()); } else if (auto doc_node = doc.as<ReturnDoc>()) { PrintTypedDoc(doc_node.value()); } else if (auto doc_node = doc.as<FunctionDoc>()) { PrintTypedDoc(doc_node.value()); } else if (auto doc_node = doc.as<ClassDoc>()) { PrintTypedDoc(doc_node.value()); } else if (auto doc_node = doc.as<CommentDoc>()) { PrintTypedDoc(doc_node.value()); } else if (auto doc_node = doc.as<DeclareDoc>()) { PrintTypedDoc(doc_node.value()); } else if (auto doc_node = doc.as<StrictListDoc>()) { PrintTypedDoc(doc_node.value()); } else if (auto doc_node = doc.as<PointerDoc>()) { PrintTypedDoc(doc_node.value()); } else if (auto doc_node = doc.as<StructDoc>()) { PrintTypedDoc(doc_node.value()); } else if (auto doc_node = doc.as<ConstructorDoc>()) { PrintTypedDoc(doc_node.value()); } else if (auto doc_node = doc.as<SwitchDoc>()) { PrintTypedDoc(doc_node.value()); } else if (auto doc_node = doc.as<LambdaDoc>()) { PrintTypedDoc(doc_node.value()); } else { LOG(FATAL) << "Do not know how to print " << doc->GetTypeKey(); throw; } } void MSCBasePrinter::PrintTypedDoc(const LiteralDoc& doc) { const ObjectRef& value = doc->value; if (!value.defined()) { output_ << "\"\""; } else if (const auto* runtime_int = value.as<runtime::Int::ContainerType>()) { output_ << runtime_int->value; } else if (const auto* int_imm = value.as<IntImmNode>()) { output_ << int_imm->value; } else if (const auto* runtime_float = value.as<runtime::Float::ContainerType>()) { output_.precision(config_.float_precision); if (std::isinf(runtime_float->value) || std::isnan(runtime_float->value)) { output_ << '"' << runtime_float->value << '"'; } else { output_ << runtime_float->value; } } else if (const auto* float_imm = value.as<FloatImmNode>()) { output_.precision(config_.float_precision); if (std::isinf(float_imm->value) || std::isnan(float_imm->value)) { output_ << '"' << float_imm->value << '"'; } else { output_ << float_imm->value; } } else if (const auto* string_obj = value.as<StringObj>()) { output_ << "\"" << tvm::support::StrEscape(string_obj->data, string_obj->size) << "\""; } else { LOG(FATAL) << "TypeError: Unsupported literal value type: " << value->GetTypeKey(); } } void MSCBasePrinter::PrintTypedDoc(const IdDoc& doc) { output_ << doc->name; } void MSCBasePrinter::PrintTypedDoc(const ListDoc& doc) { output_ << "["; PrintJoinedDocs(doc->elements); output_ << "]"; } void MSCBasePrinter::PrintTypedDoc(const TupleDoc& doc) { output_ << "("; if (doc->elements.size() == 1) { PrintDoc(doc->elements[0]); output_ << ","; } else { PrintJoinedDocs(doc->elements); } output_ << ")"; } void MSCBasePrinter::PrintTypedDoc(const ReturnDoc& doc) { output_ << "return "; PrintDoc(doc->value, false); MaybePrintComment(doc); } void MSCBasePrinter::PrintTypedDoc(const StmtBlockDoc& doc) { for (const StmtDoc& stmt : doc->stmts) { NewLine(); PrintDoc(stmt); } } void MSCBasePrinter::PrintTypedDoc(const ExprStmtDoc& doc) { PrintDoc(doc->expr, false); MaybePrintComment(doc); } void MSCBasePrinter::MaybePrintComment(const StmtDoc& stmt, bool multi_lines) { if (stmt->comment.defined()) { if (multi_lines) { for (const auto& l : StringUtils::Split(stmt->comment.value(), "\n")) { PrintDoc(CommentDoc(l)); } } else { PrintDoc(CommentDoc(stmt->comment.value()), false); } } } } // namespace msc } // namespace contrib } // namespace tvm ```
```javascript // ==UserScript== // @name GitHub Copy Code Snippet // @version 0.3.10 // @description A userscript adds a copy to clipboard button on hover of markdown code snippets // @license MIT // @author Rob Garrison // @namespace path_to_url // @match path_to_url // @run-at document-idle // @grant GM_addStyle // @require path_to_url // @icon path_to_url // @updateURL path_to_url // @downloadURL path_to_url // @supportURL path_to_url // ==/UserScript== (() => { "use strict"; let copyId = 0; const markdownSelector = ".markdown-body, .markdown-format", codeSelector = "pre:not(.gh-csc-pre)", copyButton = document.createElement("clipboard-copy"); copyButton.className = "btn btn-sm tooltipped tooltipped-w gh-csc-button"; copyButton.setAttribute("aria-label", "Copy to clipboard"); // This hint isn't working yet (GitHub needs to fix it) copyButton.setAttribute("data-copied-hint", "Copied!"); copyButton.innerHTML = ` <svg aria-hidden="true" class="octicon octicon-clippy" height="16" viewBox="0 0 14 16" width="14"> <path fill-rule="evenodd" d="M2 13h4v1H2v-1zm5-6H2v1h5V7zm2 3V8l-3 3 3 3v-2h5v-2H9zM4.5 9H2v1h2.5V9zM2 12h2.5v-1H2v1zm9 1h1v2c-.02.28-.11.52-.3.7-.19.18-.42.28-.7.3H1c-.55 0-1-.45-1-1V4c0-.55.45-1 1-1h3c0-1.11.89-2 2-2 1.11 0 2 .89 2 2h3c.55 0 1 .45 1 1v5h-1V6H1v9h10v-2zM2 5h8c0-.55-.45-1-1-1H8c-.55 0-1-.45-1-1s-.45-1-1-1-1 .45-1 1-.45 1-1 1H3c-.55 0-1 .45-1 1z"></path> </svg>`; GM_addStyle(` .gh-csc-wrap { position: relative; } .gh-csc-wrap:hover .gh-csc-button { display: block; } .gh-csc-button { display: none; padding: 3px 6px; position: absolute; top: 3px; right: 3px; z-index: 20; } .gh-csc-wrap.ghd-code-wrapper .gh-csc-button { right: 31px; } .gh-csc-button svg { vertical-align: text-bottom; } `); function addButton(wrap, code) { if (!wrap.classList.contains("gh-csc-wrap")) { copyId++; // See comments from sindresorhus/refined-github/issues/1278 code.id = `gh-csc-${copyId}`; copyButton.setAttribute("for", `gh-csc-${copyId}`); wrap.classList.add("gh-csc-wrap"); wrap.insertBefore(copyButton.cloneNode(true), wrap.childNodes[0]); } } function init() { const markdown = document.querySelector(markdownSelector); if (markdown) { [...document.querySelectorAll(markdownSelector)].forEach(md => { [...md.querySelectorAll(codeSelector)].forEach(pre => { let code = pre.querySelector("code"); let wrap = pre.parentNode; if (code) { // pre > code addButton(pre, code); } else if (wrap.classList.contains("highlight")) { // div.highlight > pre addButton(wrap, pre); } }); }); } } document.addEventListener("ghmo:container", init); document.addEventListener("ghmo:comments", init); init(); })(); ```
```javascript /* * * * path_to_url * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR */ import { expect } from 'chai'; import childProcess from 'child_process'; import fs from 'node:fs'; import { clearOutput, fileExists } from '../__tests__/__helpers.js'; describe('cliBuildWithJsConfig', () => { beforeEach(() => { clearOutput(undefined, fs); }); afterEach(() => { clearOutput(); }); it('should work with json config', () => { childProcess.execSync('node ./bin/style-dictionary build --config __tests__/__configs/test.js'); expect(fileExists('__tests__/__output/web/_icons.css', fs)).to.be.true; expect(fileExists('__tests__/__output/android/colors.xml', fs)).to.be.true; }); it('should work with javascript config', () => { childProcess.execSync('node ./bin/style-dictionary build --config __tests__/__configs/test.js'); expect(fileExists('__tests__/__output/web/_icons.css', fs)).to.be.true; expect(fileExists('__tests__/__output/android/colors.xml', fs)).to.be.true; }); describe('logging args', () => { it('should not log anything if --silent is used', () => { const result = childProcess.execSync( 'node ./bin/style-dictionary build --config __tests__/__configs/test.js --silent', ); expect(result.toString()).to.equal(``); }); it('should only log success logs if --no-warn is used', () => { const result = childProcess.execSync( 'node ./bin/style-dictionary build --config __tests__/__configs/test.js --no-warn', ); expect(result.toString().match('Token collisions detected')).to.be.null; }); it('should log briefly if neither --verbose nor --silent is used', () => { //const logStub = stubMethod(console, 'log'); const result = childProcess.execSync( 'node ./bin/style-dictionary build --config __tests__/__configs/tokenCollisions.json', ); expect(result.toString()).to.equal(` css __tests__/__output/css/vars.css While building vars.css, token collisions were found; output may be unexpected. Ignore this warning if intentional. Use log.verbosity "verbose" or use CLI option --verbose for more details.\n`); }); it('should log verbosely if --verbose is used', () => { //const logStub = stubMethod(console, 'log'); const result = childProcess.execSync( 'node ./bin/style-dictionary build --config __tests__/__configs/tokenCollisions.json --verbose', ); expect(result.toString()).to.equal(` css __tests__/__output/css/vars.css While building vars.css, token collisions were found; output may be unexpected. Ignore this warning if intentional. Output name red was generated by: color.red #f00 color.background.red #f00 This many-to-one issue is usually caused by some combination of: * conflicting or similar paths/names in token definitions * platform transforms/transformGroups affecting names, especially when removing specificity * overly inclusive file filters\n`); }); }); }); ```
```go /* * * 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 Google Inc. 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. * */ package main import ( "log" "net" pb "google.golang.org/grpc/examples/helloworld/helloworld" "golang.org/x/net/context" "google.golang.org/grpc" ) const ( port = ":50051" ) // server is used to implement helloworld.GreeterServer. type server struct{} // SayHello implements helloworld.GreeterServer func (s *server) SayHello(ctx context.Context, in *pb.HelloRequest) (*pb.HelloReply, error) { return &pb.HelloReply{Message: "Hello " + in.Name}, nil } func main() { lis, err := net.Listen("tcp", port) if err != nil { log.Fatalf("failed to listen: %v", err) } s := grpc.NewServer() pb.RegisterGreeterServer(s, &server{}) s.Serve(lis) } ```
Bethel is an unincorporated community in Prince William County, in the U.S. state of Virginia. Bethel is entirely encompassed by the CDP of Potomac Mills References Unincorporated communities in Virginia Unincorporated communities in Prince William County, Virginia Washington metropolitan area
```c++ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "src/snapshot/code-serializer.h" #include <memory> #include "src/code-stubs.h" #include "src/counters.h" #include "src/log.h" #include "src/macro-assembler.h" #include "src/objects-inl.h" #include "src/snapshot/object-deserializer.h" #include "src/snapshot/snapshot.h" #include "src/version.h" #include "src/visitors.h" namespace v8 { namespace internal { ScriptData::ScriptData(const byte* data, int length) : owns_data_(false), rejected_(false), data_(data), length_(length) { if (!IsAligned(reinterpret_cast<intptr_t>(data), kPointerAlignment)) { byte* copy = NewArray<byte>(length); DCHECK(IsAligned(reinterpret_cast<intptr_t>(copy), kPointerAlignment)); CopyBytes(copy, data, length); data_ = copy; AcquireDataOwnership(); } } // static ScriptCompiler::CachedData* CodeSerializer::Serialize( Handle<SharedFunctionInfo> info) { Isolate* isolate = info->GetIsolate(); TRACE_EVENT_CALL_STATS_SCOPED(isolate, "v8", "V8.Execute"); HistogramTimerScope histogram_timer(isolate->counters()->compile_serialize()); RuntimeCallTimerScope runtimeTimer(isolate, RuntimeCallCounterId::kCompileSerialize); TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), "V8.CompileSerialize"); base::ElapsedTimer timer; if (FLAG_profile_deserialization) timer.Start(); Handle<Script> script(Script::cast(info->script()), isolate); if (FLAG_trace_serializer) { PrintF("[Serializing from"); script->name()->ShortPrint(); PrintF("]\n"); } // TODO(7110): Enable serialization of Asm modules once the AsmWasmData is // context independent. if (script->ContainsAsmModule()) return nullptr; if (isolate->debug()->is_loaded()) return nullptr; // Serialize code object. Handle<String> source(String::cast(script->source()), isolate); CodeSerializer cs(isolate, SerializedCodeData::SourceHash(source)); DisallowHeapAllocation no_gc; cs.reference_map()->AddAttachedReference(*source); ScriptData* script_data = cs.SerializeSharedFunctionInfo(info); if (FLAG_profile_deserialization) { double ms = timer.Elapsed().InMillisecondsF(); int length = script_data->length(); PrintF("[Serializing to %d bytes took %0.3f ms]\n", length, ms); } ScriptCompiler::CachedData* result = new ScriptCompiler::CachedData(script_data->data(), script_data->length(), ScriptCompiler::CachedData::BufferOwned); script_data->ReleaseDataOwnership(); delete script_data; return result; } ScriptData* CodeSerializer::SerializeSharedFunctionInfo( Handle<SharedFunctionInfo> info) { DisallowHeapAllocation no_gc; VisitRootPointer(Root::kHandleScope, nullptr, Handle<Object>::cast(info).location()); SerializeDeferredObjects(); Pad(); SerializedCodeData data(sink_.data(), this); return data.GetScriptData(); } bool CodeSerializer::SerializeReadOnlyObject(HeapObject* obj, HowToCode how_to_code, WhereToPoint where_to_point, int skip) { PagedSpace* read_only_space = isolate()->heap()->read_only_space(); if (!read_only_space->Contains(obj)) return false; // For objects in RO_SPACE, never serialize the object, but instead create a // back reference that encodes the page number as the chunk_index and the // offset within the page as the chunk_offset. Address address = obj->address(); Page* page = Page::FromAddress(address); uint32_t chunk_index = 0; for (Page* p : *read_only_space) { if (p == page) break; ++chunk_index; } uint32_t chunk_offset = static_cast<uint32_t>(page->Offset(address)); SerializerReference back_reference = SerializerReference::BackReference(RO_SPACE, chunk_index, chunk_offset); reference_map()->Add(obj, back_reference); CHECK(SerializeBackReference(obj, how_to_code, where_to_point, skip)); return true; } void CodeSerializer::SerializeObject(HeapObject* obj, HowToCode how_to_code, WhereToPoint where_to_point, int skip) { if (SerializeHotObject(obj, how_to_code, where_to_point, skip)) return; int root_index = root_index_map()->Lookup(obj); if (root_index != RootIndexMap::kInvalidRootIndex) { PutRoot(root_index, obj, how_to_code, where_to_point, skip); return; } if (SerializeBackReference(obj, how_to_code, where_to_point, skip)) return; if (SerializeReadOnlyObject(obj, how_to_code, where_to_point, skip)) return; FlushSkip(skip); if (obj->IsCode()) { Code* code_object = Code::cast(obj); switch (code_object->kind()) { case Code::OPTIMIZED_FUNCTION: // No optimized code compiled yet. case Code::REGEXP: // No regexp literals initialized yet. case Code::NUMBER_OF_KINDS: // Pseudo enum value. case Code::BYTECODE_HANDLER: // No direct references to handlers. break; // hit UNREACHABLE below. case Code::BUILTIN: SerializeBuiltinReference(code_object, how_to_code, where_to_point, 0); return; case Code::STUB: if (code_object->builtin_index() == -1) { SerializeCodeStub(code_object, how_to_code, where_to_point); } else { SerializeBuiltinReference(code_object, how_to_code, where_to_point, 0); } return; default: return SerializeCodeObject(code_object, how_to_code, where_to_point); } UNREACHABLE(); } if (ElideObject(obj)) { return SerializeObject(isolate()->heap()->undefined_value(), how_to_code, where_to_point, skip); } if (obj->IsScript()) { Script* script_obj = Script::cast(obj); DCHECK_NE(script_obj->compilation_type(), Script::COMPILATION_TYPE_EVAL); // Wrapper object is a context-dependent JSValue. Reset it here. script_obj->set_wrapper(isolate()->heap()->undefined_value()); // We want to differentiate between undefined and uninitialized_symbol for // context_data for now. It is hack to allow debugging for scripts that are // included as a part of custom snapshot. (see debug::Script::IsEmbedded()) Object* context_data = script_obj->context_data(); if (context_data != isolate()->heap()->undefined_value() && context_data != isolate()->heap()->uninitialized_symbol()) { script_obj->set_context_data(isolate()->heap()->undefined_value()); } // We don't want to serialize host options to avoid serializing unnecessary // object graph. FixedArray* host_options = script_obj->host_defined_options(); script_obj->set_host_defined_options( isolate()->heap()->empty_fixed_array()); SerializeGeneric(obj, how_to_code, where_to_point); script_obj->set_host_defined_options(host_options); script_obj->set_context_data(context_data); return; } if (obj->IsSharedFunctionInfo()) { SharedFunctionInfo* sfi = SharedFunctionInfo::cast(obj); // TODO(7110): Enable serializing of Asm modules once the AsmWasmData // is context independent. DCHECK(!sfi->IsApiFunction() && !sfi->HasAsmWasmData()); // Clear debug info. Object* debug_info = sfi->debug_info(); sfi->set_debug_info(Smi::kZero); // Mark SFI to indicate whether the code is cached. bool was_deserialized = sfi->deserialized(); sfi->set_deserialized(sfi->is_compiled()); SerializeGeneric(obj, how_to_code, where_to_point); sfi->set_deserialized(was_deserialized); sfi->set_debug_info(debug_info); return; } if (obj->IsBytecodeArray()) { // Clear the stack frame cache if present BytecodeArray::cast(obj)->ClearFrameCacheFromSourcePositionTable(); } // Past this point we should not see any (context-specific) maps anymore. CHECK(!obj->IsMap()); // There should be no references to the global object embedded. CHECK(!obj->IsJSGlobalProxy() && !obj->IsJSGlobalObject()); // Embedded FixedArrays that need rehashing must support rehashing. CHECK_IMPLIES(obj->NeedsRehashing(), obj->CanBeRehashed()); // We expect no instantiated function objects or contexts. CHECK(!obj->IsJSFunction() && !obj->IsContext()); SerializeGeneric(obj, how_to_code, where_to_point); } void CodeSerializer::SerializeGeneric(HeapObject* heap_object, HowToCode how_to_code, WhereToPoint where_to_point) { // Object has not yet been serialized. Serialize it here. ObjectSerializer serializer(this, heap_object, &sink_, how_to_code, where_to_point); serializer.Serialize(); } void CodeSerializer::SerializeCodeStub(Code* code_stub, HowToCode how_to_code, WhereToPoint where_to_point) { // We only arrive here if we have not encountered this code stub before. DCHECK(!reference_map()->Lookup(code_stub).is_valid()); uint32_t stub_key = code_stub->stub_key(); DCHECK(CodeStub::MajorKeyFromKey(stub_key) != CodeStub::NoCache); DCHECK(!CodeStub::GetCode(isolate(), stub_key).is_null()); stub_keys_.push_back(stub_key); SerializerReference reference = reference_map()->AddAttachedReference(code_stub); if (FLAG_trace_serializer) { PrintF(" Encoding code stub %s as attached reference %d\n", CodeStub::MajorName(CodeStub::MajorKeyFromKey(stub_key)), reference.attached_reference_index()); } PutAttachedReference(reference, how_to_code, where_to_point); } MaybeHandle<SharedFunctionInfo> CodeSerializer::Deserialize( Isolate* isolate, ScriptData* cached_data, Handle<String> source) { base::ElapsedTimer timer; if (FLAG_profile_deserialization) timer.Start(); HandleScope scope(isolate); SerializedCodeData::SanityCheckResult sanity_check_result = SerializedCodeData::CHECK_SUCCESS; const SerializedCodeData scd = SerializedCodeData::FromCachedData( isolate, cached_data, SerializedCodeData::SourceHash(source), &sanity_check_result); if (sanity_check_result != SerializedCodeData::CHECK_SUCCESS) { if (FLAG_profile_deserialization) PrintF("[Cached code failed check]\n"); DCHECK(cached_data->rejected()); source->GetIsolate()->counters()->code_cache_reject_reason()->AddSample( sanity_check_result); return MaybeHandle<SharedFunctionInfo>(); } // Deserialize. MaybeHandle<SharedFunctionInfo> maybe_result = ObjectDeserializer::DeserializeSharedFunctionInfo(isolate, &scd, source); Handle<SharedFunctionInfo> result; if (!maybe_result.ToHandle(&result)) { // Deserializing may fail if the reservations cannot be fulfilled. if (FLAG_profile_deserialization) PrintF("[Deserializing failed]\n"); return MaybeHandle<SharedFunctionInfo>(); } if (FLAG_profile_deserialization) { double ms = timer.Elapsed().InMillisecondsF(); int length = cached_data->length(); PrintF("[Deserializing from %d bytes took %0.3f ms]\n", length, ms); } if (isolate->logger()->is_logging_code_events() || isolate->is_profiling()) { String* name = isolate->heap()->empty_string(); if (result->script()->IsScript()) { Script* script = Script::cast(result->script()); if (script->name()->IsString()) name = String::cast(script->name()); } PROFILE(isolate, CodeCreateEvent(CodeEventListener::SCRIPT_TAG, result->abstract_code(), *result, name)); } if (isolate->NeedsSourcePositionsForProfiling()) { Handle<Script> script(Script::cast(result->script()), isolate); Script::InitLineEnds(script); } return scope.CloseAndEscape(result); } class Checksum { public: explicit Checksum(Vector<const byte> payload) { #ifdef MEMORY_SANITIZER // Computing the checksum includes padding bytes for objects like strings. // Mark every object as initialized in the code serializer. MSAN_MEMORY_IS_INITIALIZED(payload.start(), payload.length()); #endif // MEMORY_SANITIZER // Fletcher's checksum. Modified to reduce 64-bit sums to 32-bit. uintptr_t a = 1; uintptr_t b = 0; const uintptr_t* cur = reinterpret_cast<const uintptr_t*>(payload.start()); DCHECK(IsAligned(payload.length(), kIntptrSize)); const uintptr_t* end = cur + payload.length() / kIntptrSize; while (cur < end) { // Unsigned overflow expected and intended. a += *cur++; b += a; } #if V8_HOST_ARCH_64_BIT a ^= a >> 32; b ^= b >> 32; #endif // V8_HOST_ARCH_64_BIT a_ = static_cast<uint32_t>(a); b_ = static_cast<uint32_t>(b); } bool Check(uint32_t a, uint32_t b) const { return a == a_ && b == b_; } uint32_t a() const { return a_; } uint32_t b() const { return b_; } private: uint32_t a_; uint32_t b_; DISALLOW_COPY_AND_ASSIGN(Checksum); }; SerializedCodeData::SerializedCodeData(const std::vector<byte>* payload, const CodeSerializer* cs) { DisallowHeapAllocation no_gc; const std::vector<uint32_t>* stub_keys = cs->stub_keys(); std::vector<Reservation> reservations = cs->EncodeReservations(); // Calculate sizes. uint32_t reservation_size = static_cast<uint32_t>(reservations.size()) * kUInt32Size; uint32_t num_stub_keys = static_cast<uint32_t>(stub_keys->size()); uint32_t stub_keys_size = num_stub_keys * kUInt32Size; uint32_t payload_offset = kHeaderSize + reservation_size + stub_keys_size; uint32_t padded_payload_offset = POINTER_SIZE_ALIGN(payload_offset); uint32_t size = padded_payload_offset + static_cast<uint32_t>(payload->size()); // Allocate backing store and create result data. AllocateData(size); // Set header values. SetMagicNumber(cs->isolate()); SetHeaderValue(kVersionHashOffset, Version::Hash()); SetHeaderValue(kSourceHashOffset, cs->source_hash()); SetHeaderValue(kCpuFeaturesOffset, static_cast<uint32_t>(CpuFeatures::SupportedFeatures())); SetHeaderValue(kFlagHashOffset, FlagList::Hash()); SetHeaderValue(kNumReservationsOffset, static_cast<uint32_t>(reservations.size())); SetHeaderValue(kNumCodeStubKeysOffset, num_stub_keys); SetHeaderValue(kPayloadLengthOffset, static_cast<uint32_t>(payload->size())); // Zero out any padding in the header. memset(data_ + kUnalignedHeaderSize, 0, kHeaderSize - kUnalignedHeaderSize); // Copy reservation chunk sizes. CopyBytes(data_ + kHeaderSize, reinterpret_cast<const byte*>(reservations.data()), reservation_size); // Copy code stub keys. CopyBytes(data_ + kHeaderSize + reservation_size, reinterpret_cast<const byte*>(stub_keys->data()), stub_keys_size); // Zero out any padding before the payload. memset(data_ + payload_offset, 0, padded_payload_offset - payload_offset); // Copy serialized data. CopyBytes(data_ + padded_payload_offset, payload->data(), static_cast<size_t>(payload->size())); Checksum checksum(DataWithoutHeader()); SetHeaderValue(kChecksum1Offset, checksum.a()); SetHeaderValue(kChecksum2Offset, checksum.b()); } SerializedCodeData::SanityCheckResult SerializedCodeData::SanityCheck( Isolate* isolate, uint32_t expected_source_hash) const { if (this->size_ < kHeaderSize) return INVALID_HEADER; uint32_t magic_number = GetMagicNumber(); if (magic_number != ComputeMagicNumber(isolate)) return MAGIC_NUMBER_MISMATCH; uint32_t version_hash = GetHeaderValue(kVersionHashOffset); uint32_t source_hash = GetHeaderValue(kSourceHashOffset); uint32_t cpu_features = GetHeaderValue(kCpuFeaturesOffset); uint32_t flags_hash = GetHeaderValue(kFlagHashOffset); uint32_t payload_length = GetHeaderValue(kPayloadLengthOffset); uint32_t c1 = GetHeaderValue(kChecksum1Offset); uint32_t c2 = GetHeaderValue(kChecksum2Offset); if (version_hash != Version::Hash()) return VERSION_MISMATCH; if (source_hash != expected_source_hash) return SOURCE_MISMATCH; if (cpu_features != static_cast<uint32_t>(CpuFeatures::SupportedFeatures())) { return CPU_FEATURES_MISMATCH; } if (flags_hash != FlagList::Hash()) return FLAGS_MISMATCH; uint32_t max_payload_length = this->size_ - POINTER_SIZE_ALIGN(kHeaderSize + GetHeaderValue(kNumReservationsOffset) * kInt32Size + GetHeaderValue(kNumCodeStubKeysOffset) * kInt32Size); if (payload_length > max_payload_length) return LENGTH_MISMATCH; if (!Checksum(DataWithoutHeader()).Check(c1, c2)) return CHECKSUM_MISMATCH; return CHECK_SUCCESS; } uint32_t SerializedCodeData::SourceHash(Handle<String> source) { return source->length(); } // Return ScriptData object and relinquish ownership over it to the caller. ScriptData* SerializedCodeData::GetScriptData() { DCHECK(owns_data_); ScriptData* result = new ScriptData(data_, size_); result->AcquireDataOwnership(); owns_data_ = false; data_ = nullptr; return result; } std::vector<SerializedData::Reservation> SerializedCodeData::Reservations() const { uint32_t size = GetHeaderValue(kNumReservationsOffset); std::vector<Reservation> reservations(size); memcpy(reservations.data(), data_ + kHeaderSize, size * sizeof(SerializedData::Reservation)); return reservations; } Vector<const byte> SerializedCodeData::Payload() const { int reservations_size = GetHeaderValue(kNumReservationsOffset) * kInt32Size; int code_stubs_size = GetHeaderValue(kNumCodeStubKeysOffset) * kInt32Size; int payload_offset = kHeaderSize + reservations_size + code_stubs_size; int padded_payload_offset = POINTER_SIZE_ALIGN(payload_offset); const byte* payload = data_ + padded_payload_offset; DCHECK(IsAligned(reinterpret_cast<intptr_t>(payload), kPointerAlignment)); int length = GetHeaderValue(kPayloadLengthOffset); DCHECK_EQ(data_ + size_, payload + length); return Vector<const byte>(payload, length); } Vector<const uint32_t> SerializedCodeData::CodeStubKeys() const { int reservations_size = GetHeaderValue(kNumReservationsOffset) * kInt32Size; const byte* start = data_ + kHeaderSize + reservations_size; return Vector<const uint32_t>(reinterpret_cast<const uint32_t*>(start), GetHeaderValue(kNumCodeStubKeysOffset)); } SerializedCodeData::SerializedCodeData(ScriptData* data) : SerializedData(const_cast<byte*>(data->data()), data->length()) {} SerializedCodeData SerializedCodeData::FromCachedData( Isolate* isolate, ScriptData* cached_data, uint32_t expected_source_hash, SanityCheckResult* rejection_result) { DisallowHeapAllocation no_gc; SerializedCodeData scd(cached_data); *rejection_result = scd.SanityCheck(isolate, expected_source_hash); if (*rejection_result != CHECK_SUCCESS) { cached_data->Reject(); return SerializedCodeData(nullptr, 0); } return scd; } } // namespace internal } // namespace v8 ```
```kotlin package ktx.assets import com.badlogic.gdx.Files.FileType.Absolute import com.badlogic.gdx.Files.FileType.Classpath import com.badlogic.gdx.Files.FileType.External import com.badlogic.gdx.Files.FileType.Internal import com.badlogic.gdx.Files.FileType.Local import com.badlogic.gdx.Gdx import org.junit.Assert.assertEquals import org.junit.Assert.assertNotNull import org.junit.Before import org.junit.Test /** * Tests files-related utilities. */ class FilesTest { @Before fun `mock Files`() { Gdx.files = MockFiles() } @Test fun `should convert string to classpath FileHandle`() { val file = "my/package/classpath.file".toClasspathFile() assertNotNull(file) assertEquals(Classpath, file.type()) assertEquals("my/package/classpath.file", file.path()) } @Test fun `should convert string to internal FileHandle`() { val file = "internal.file".toInternalFile() assertNotNull(file) assertEquals(Internal, file.type()) assertEquals("internal.file", file.path()) } @Test fun `should convert string to local FileHandle`() { val file = "local.file".toLocalFile() assertNotNull(file) assertEquals(Local, file.type()) assertEquals("local.file", file.path()) } @Test fun `should convert string to external FileHandle`() { val file = "some/directory/external.file".toExternalFile() assertNotNull(file) assertEquals(External, file.type()) assertEquals("some/directory/external.file", file.path()) } @Test fun `should convert string to absolute FileHandle`() { val file = "/home/mock/absolute.file".toAbsoluteFile() assertNotNull(file) assertEquals(Absolute, file.type()) assertEquals("/home/mock/absolute.file", file.path()) } @Test fun `should create FileHandle with default type`() { val file = file("mock.file") assertNotNull(file) assertEquals(Internal, file.type()) assertEquals("mock.file", file.path()) } @Test fun `should create FileHandle with custom type`() { val file = file("/home/ktx/mock.file", type = Absolute) assertNotNull(file) assertEquals(Absolute, file.type()) assertEquals("/home/ktx/mock.file", file.path()) } } ```
RattanIndia, formerly RattanIndia Infrastructure Ltd, is an Indian company that is involved in the energy sector. The traditional focus of the company was on coal on thermal power, however more recently the company has expanded its scope, focusing more on emerging technologies and e-commerce. The company supplies electricity to Maharashtra state and uses coal from South Coalfields Limited and Mahanadi Coalfields Limited. Rattan India has two thermal power plants: the first is the Nashik power plant that was reported stranded in 2020 due to no long-term purchase agreements and conflicts on land acquisition. The other power plant is in Amravati that was commissioned in 2015. Amravati power plant was in debt and Goldman Sachs Varde partners took over the Rs 4050 crores against 15 percent equity in 2019. The company was also involved in solar energy but that component was sold to GIP for Rs 1067 crore in September 2020 and the company exited the solar business. Rattan India was the outcome of the split of Indiabulls where the energy component was named as RattanIndia in 2014. The company is listed on National Stock Exchange and Bombay Stock Exchange. Brickwork Ratings provided the rating for the Bank Loan Facilities of aggregating to Rs.7617.99 Crs in October 2020. Acquisition of Revolt Motors In October 2022, RattanIndia Enterprises Ltd announced that they would be acquiring the electric motorcycle company Revolt Motors for an undisclosed figure. The takeover was completed in January 2023. Allegations of irregularity There have been allegation on irregularities on RattanIndia by Lone Star Funds with which the company had formed a finance company. References 1999 establishments in Haryana Companies based in New Delhi Companies listed on the National Stock Exchange of India Conglomerate companies established in 1999 Companies listed on the Bombay Stock Exchange Electric power companies of India Energy companies established in 1999
```java package ml.puredark.hviewer.ui.adapters; import android.view.LayoutInflater; import android.view.View; import android.widget.LinearLayout; import com.balysv.materialripple.MaterialRippleLayout; import com.dpizarro.autolabel.library.AutoLabelUI; import com.dpizarro.autolabel.library.Label; import java.util.List; import ml.puredark.hviewer.R; import ml.puredark.hviewer.beans.Tag; import ml.puredark.hviewer.ui.dataproviders.ListDataProvider; public class SiteTagAdapter { private AutoLabelUI labelView; private ListDataProvider<Tag> mProvider; private OnItemClickListener mItemClickListener; public SiteTagAdapter(ListDataProvider<Tag> provider) { this.mProvider = provider; } public void setLabelView(AutoLabelUI labelView) { this.labelView = labelView; init(); } private void init() { labelView.clear(); List<Tag> tags = mProvider.getItems(); for (Tag tag : tags) { labelView.addLabel(tag.title); labelView.setLayoutTransition(null); int position = labelView.getLabelsCounter() - 1; Label label = labelView.getLabel(position); View view = LayoutInflater.from(labelView.getContext()).inflate(R.layout.item_site_tag, null); MaterialRippleLayout rippleLayout = (MaterialRippleLayout) view.findViewById(R.id.ripple_layout); LinearLayout child = (LinearLayout) label.getChildAt(0); child.setBackgroundResource(android.R.color.transparent); label.removeView(child); rippleLayout.addView(child); label.addView(view); rippleLayout.setOnClickListener(v -> { if (position >= 0 && mProvider != null) { tag.selected = !tag.selected; notifyItemChanged(position); if (mItemClickListener != null) mItemClickListener.onItemClick(v, position); } }); } } public void notifyItemChanged(int position) { Tag tag = mProvider.getItem(position); Label label = labelView.getLabel(position); label.setText(tag.title); MaterialRippleLayout rippleLayout = (MaterialRippleLayout) label.findViewById(R.id.ripple_layout); if (tag.selected) { rippleLayout.setRippleBackground(label.getContext().getResources().getColor(R.color.colorPrimary)); rippleLayout.setRippleColor(label.getContext().getResources().getColor(R.color.dimgray)); } else { rippleLayout.setRippleBackground(label.getContext().getResources().getColor(R.color.dimgray)); rippleLayout.setRippleColor(label.getContext().getResources().getColor(R.color.colorPrimary)); } rippleLayout.setRadius(0); } public void notifyDataSetChanged() { init(); } public void setOnItemClickListener(OnItemClickListener listener) { this.mItemClickListener = listener; } public ListDataProvider getDataProvider() { return mProvider; } public void setDataProvider(ListDataProvider mProvider) { this.mProvider = mProvider; } public interface OnItemClickListener { void onItemClick(View v, int position); } } ```
Matthew Francis (born 29 August 1970) is a former Australian rules footballer who played with Richmond and Collingwood in the Australian Football League (AFL). Until 2015, he served as the Skills Development Manager at the Brisbane Lions. Francis was an injury plagued ruckman and key position player, recruited from Ballan in the 1988 VFL Draft. He debuted in the 1990 AFL season but would make a total of only 19 senior appearances in six seasons playing at Richmond. In both 1993 and 1995 he didn't play a single AFL game. Traded for Robert Powell, Francis joined Collingwood in 1996 and was able to play 10 games in his first year, followed by a career high 15 appearances in 1997. He participated in three Anzac Day clashes. In 2008 he was appointed coach of Queensland club Redland. Although they finished with the wooden spoon in his first season in charge, Francis guided his club to the finals in 2009. He resigned as coach early in the 2011 season after some disappointing results. At the moment, he teaches middle school science in Saigon South International School located in Ho Chi Minh City, Vietnam. References 1970 births Australian rules footballers from Victoria (state) Richmond Football Club players Collingwood Football Club players Living people
This is a list of the National Register of Historic Places listings in Drew County, Arkansas. This is intended to be a complete list of the properties and districts on the National Register of Historic Places in Drew County, Arkansas, United States. The locations of National Register properties and districts for which the latitude and longitude coordinates are included below, may be seen in a map. There are 25 properties and districts listed on the National Register in the county. Current listings |} See also List of National Historic Landmarks in Arkansas National Register of Historic Places listings in Arkansas References Drew County
Meinl is a surname. Notable people with the surname include: Julius Meinl I (1824–1914), Austrian businessman Julius Meinl V (born 1959), British businessman, great-great-grandson of Julius Meinl I Roland Meinl, founder of Meinl Percussion Beate Meinl-Reisinger (born 1978), Austrian politician Surnames of Austrian origin
```go /* * * * * path_to_url * * Unless required by applicable law or agreed to in writing, software * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * */ package grpclb import ( "fmt" "sync" "time" "google.golang.org/grpc/balancer" "google.golang.org/grpc/resolver" ) const subConnCacheTime = time.Second * 10 // lbCacheClientConn is a wrapper balancer.ClientConn with a SubConn cache. // SubConns will be kept in cache for subConnCacheTime before being shut down. // // Its NewSubconn and SubConn.Shutdown methods are updated to do cache first. type lbCacheClientConn struct { balancer.ClientConn timeout time.Duration mu sync.Mutex // subConnCache only keeps subConns that are being deleted. subConnCache map[resolver.Address]*subConnCacheEntry subConnToAddr map[balancer.SubConn]resolver.Address } type subConnCacheEntry struct { sc balancer.SubConn cancel func() abortDeleting bool } func newLBCacheClientConn(cc balancer.ClientConn) *lbCacheClientConn { return &lbCacheClientConn{ ClientConn: cc, timeout: subConnCacheTime, subConnCache: make(map[resolver.Address]*subConnCacheEntry), subConnToAddr: make(map[balancer.SubConn]resolver.Address), } } func (ccc *lbCacheClientConn) NewSubConn(addrs []resolver.Address, opts balancer.NewSubConnOptions) (balancer.SubConn, error) { if len(addrs) != 1 { return nil, fmt.Errorf("grpclb calling NewSubConn with addrs of length %v", len(addrs)) } addrWithoutAttrs := addrs[0] addrWithoutAttrs.Attributes = nil ccc.mu.Lock() defer ccc.mu.Unlock() if entry, ok := ccc.subConnCache[addrWithoutAttrs]; ok { // If entry is in subConnCache, the SubConn was being deleted. // cancel function will never be nil. entry.cancel() delete(ccc.subConnCache, addrWithoutAttrs) return entry.sc, nil } scNew, err := ccc.ClientConn.NewSubConn(addrs, opts) if err != nil { return nil, err } scNew = &lbCacheSubConn{SubConn: scNew, ccc: ccc} ccc.subConnToAddr[scNew] = addrWithoutAttrs return scNew, nil } func (ccc *lbCacheClientConn) RemoveSubConn(sc balancer.SubConn) { logger.Errorf("RemoveSubConn(%v) called unexpectedly", sc) } type lbCacheSubConn struct { balancer.SubConn ccc *lbCacheClientConn } func (sc *lbCacheSubConn) Shutdown() { ccc := sc.ccc ccc.mu.Lock() defer ccc.mu.Unlock() addr, ok := ccc.subConnToAddr[sc] if !ok { return } if entry, ok := ccc.subConnCache[addr]; ok { if entry.sc != sc { // This could happen if NewSubConn was called multiple times for // the same address, and those SubConns are all shut down. We // remove sc immediately here. delete(ccc.subConnToAddr, sc) sc.SubConn.Shutdown() } return } entry := &subConnCacheEntry{ sc: sc, } ccc.subConnCache[addr] = entry timer := time.AfterFunc(ccc.timeout, func() { ccc.mu.Lock() defer ccc.mu.Unlock() if entry.abortDeleting { return } sc.SubConn.Shutdown() delete(ccc.subConnToAddr, sc) delete(ccc.subConnCache, addr) }) entry.cancel = func() { if !timer.Stop() { // If stop was not successful, the timer has fired (this can only // happen in a race). But the deleting function is blocked on ccc.mu // because the mutex was held by the caller of this function. // // Set abortDeleting to true to abort the deleting function. When // the lock is released, the deleting function will acquire the // lock, check the value of abortDeleting and return. entry.abortDeleting = true } } } func (ccc *lbCacheClientConn) UpdateState(s balancer.State) { s.Picker = &lbCachePicker{Picker: s.Picker} ccc.ClientConn.UpdateState(s) } func (ccc *lbCacheClientConn) close() { ccc.mu.Lock() defer ccc.mu.Unlock() // Only cancel all existing timers. There's no need to shut down SubConns. for _, entry := range ccc.subConnCache { entry.cancel() } } type lbCachePicker struct { balancer.Picker } func (cp *lbCachePicker) Pick(i balancer.PickInfo) (balancer.PickResult, error) { res, err := cp.Picker.Pick(i) if err != nil { return res, err } res.SubConn = res.SubConn.(*lbCacheSubConn).SubConn return res, nil } ```
AIIB may refer to: Asian Infrastructure Investment Bank, a development bank for the Asia-Pacific region Japanese Red Army, also known as the Anti-Imperialist International Brigade Quorum-quenching N-acyl-homoserine lactonase, an enzyme also known as AiiB
Hypostomus pantherinus is a species of catfish in the family Loricariidae. It is native to South America, where it occurs in the Madeira River basin in Brazil. The species reaches at least 4.8 cm (1.9 inches) in standard length and is believed to be a facultative air-breather. Although originally described by Rudolf Kner in 1854 based on a single specimen from the Guaporé River basin in Brazil, Hypostomus pantherinus was redescribed in 2021 and its range was found to also include Bolivia. References pantherinus Catfish of South America Fish described in 1854
Cycloisomerase may refer to: 3-carboxy-cis,cis-muconate cycloisomerase (EC 5.5.1.2), an enzyme Chloromuconate cycloisomerase (EC 5.5.1.7), an enzyme Cycloeucalenol cycloisomerase (EC 5.5.1.9), an enzyme Dichloromuconate cycloisomerase (EC 5.5.1.11), an enzyme Tetrahydroxypteridine cycloisomerase (EC 5.5.1.3), an enzyme
Leyla Lydia Tuğutlu (born 29 October 1989) is a Turkish actress, singer, model and beauty pageant titleholder who was crowned Miss Turkey 2008. She represented Turkey at the Miss World 2008 pageant. Early life Leyla Lydia Tuğutlu was born in Berlin in 1989. She is the daughter of a Turkish father and of a German mother. After primary school, she took piano and violin lessons in Turkey's Conservatory. During this period she worked in a model agency. Tuğutlu graduated from Anatolian High School and left the conservatory for the modeling. At the same period she was studying German Language and Literature at Istanbul University. She speaks Turkish, English, and German. She started acting with leading role in popular youth series "Es-Es". She is known by the role of Candan from the Kızım series, romantic comedy series Tatlı İntikam and recently appeared in the popular Turkish television series Uyanış: Büyük Selçuklu which stars actor like Buğra Gülsoy and Ekin Koç. She played in popular series and films. Beauty contests Leyla Lydia Tuğutlu won the title of Miss Turkey 2008. In December 2008 she attended the Miss World competition which was held in Johannesburg, South Africa where she represented Turkey. She won also the title Best Promising in Best Model of Turkey pageant in 2005. She appeared in Miss Tourism Queen International in China in 2006 and won International princess regards. In 2007, she won the TV Fashion Oscar as "The most promising model". Filmography References 1989 births Actresses from Berlin Living people Miss World 2008 delegates Turkish film actresses Turkish television actresses Turkish beauty pageant winners Turkish female models German people of Turkish descent Turkish people of German descent
```xml import { HttpResponse } from '@standardnotes/responses' import { UserRequestRequestParams } from '../../Request/UserRequest/UserRequestRequestParams' import { UserRequestResponseBody } from '../../Response/UserRequest/UserRequestResponseBody' export interface UserRequestServerInterface { submitUserRequest(params: UserRequestRequestParams): Promise<HttpResponse<UserRequestResponseBody>> } ```
```php <?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\String; if (!\function_exists(u::class)) { function u(?string $string = ''): UnicodeString { return new UnicodeString($string ?? ''); } } if (!\function_exists(b::class)) { function b(?string $string = ''): ByteString { return new ByteString($string ?? ''); } } if (!\function_exists(s::class)) { /** * @return UnicodeString|ByteString */ function s(?string $string = ''): AbstractString { $string = $string ?? ''; return preg_match('//u', $string) ? new UnicodeString($string) : new ByteString($string); } } ```
Mark Howe Murphy (March 14, 1932 – October 22, 2015) was an American jazz singer based at various times in New York City, Los Angeles, London, and San Francisco. He recorded 51 albums under his own name during his lifetime and was principally known for his innovative vocal improvisations. He was the recipient of the 1996, 1997, 2000, and 2001 Down Beat magazine readers' jazz poll for Best Male Vocalist and was also nominated five times for the Grammy Award for Best Vocal Jazz Performance. He wrote lyrics to the jazz tunes "Stolen Moments" and "Red Clay". Early life Born in Syracuse, New York, in 1932, Murphy was raised in a musical family, his parents having met when his father was appointed director of the local Methodist Church choir. He grew up in the nearby small town of Fulton, New York, where his grandmother and then his aunt were the church organists. Opera was also a presence in the Murphy home. He started piano lessons at the age of seven. In his teens, Murphy joined his brother Dwight's jazz dance band as the singer (and occasional pianist), influenced by Peggy Lee, Nat "King" Cole, June Christy, Anita O'Day, and Ella Fitzgerald. The Jazz pianist Art Tatum was another early influence. Murphy graduated from Syracuse University in 1953, having majored in Music and Drama. Whilst there he was spotted singing at the Embassy Club by Sammy Davis Jr, who invited him to perform a guest spot at his own gig shortly afterwards, and put him in touch with TV host Steve Allen. The following year Murphy moved to New York City, taking part-time jobs as he looked for work as an actor and singer. He appeared in productions for the Gilbert and Sullivan Light Opera Company and a musical version for television of Casey at the Bat. He also twice took second place at Apollo Theatre amateur singing contests. The first albums Murphy was eventually introduced to record producer Milt Gabler, who was an artist and repertoire director (A&R) for Decca. His resulting debut recording was Meet Mark Murphy (1956), followed closely by Let Yourself Go (1957). After disappointing album sales, in 1958 Murphy moved to Los Angeles, where he recorded three albums for Capitol Records, and had a minor hit single with "This Could Be the Start of Something". But this was not enough for him to be retained by Capitol, so he returned to New York in the early '60s. Here he recorded two albums for Riverside Records: the album Rah (1961) included "Angel Eyes", a version of Horace Silver's "Doodlin'", and "Green Dolphin Street", featuring Bill Evans, Clark Terry, Urbie Green, Blue Mitchell and Wynton Kelly as accompanists. His favorite recording to date, That's How I Love the Blues, soon followed. In 1963, Murphy hit the charts across the country with his single of "Fly Me to the Moon" and was voted New Star of the Year in Down Beat Magazine's Reader's Poll. Around this time he fell under the spell of Miles Davis, and for the rest of his career maintained that he tried as far as possible to sing like Miles played. London In 1963 Murphy moved to London, England, where he quickly found acceptance and played frequently at Ronnie Scott's Club, as well as making regular appearances on BBC Radio. He recorded three more albums in London, and one in Germany that is amongst his best - Midnight Mood (1968). From London he made frequent trips to Holland, where he worked on Dutch radio, mainly with producer Joop de Roo. Between 1964 and 1972 he acted in a number of drama productions for TV and radio, and appeared as a singer in the 1967 British comedy film Just Like a Woman. Meanwhile he continued to cultivate his jazz audiences in Europe, singing in clubs and on radio. It was in London that Murphy, who was gay, met his long-time partner Eddie O'Sullivan. The Muse years He returned to the States in 1972 and began recording an average of an album per year for more than 14 years on the Muse label. These included the Grammy-nominated albums Satisfaction Guaranteed, Bop for Kerouac and Nat's Choice: Nat King Cole Songbook Vol. II. Murphy's other highly regarded Muse recordings include Bridging a Gap (featuring Ron Carter, Jimmy Madison, Randy Brecker and Michael Brecker), Mark Murphy Sings (again featuring the Brecker Brothers along with David Sanborn), Living Room, Beauty And the Beast and Stolen Moments. Bop for Kerouac (1981), with Richie Cole and Bill Mays, was a result of Murphy's enthusiasm for the writing of Jack Kerouac, whom Murphy regarded as a soul-mate. It included readings from the author's books On the Road and The Subterraneans. Murphy followed it up with Kerouac Then And Now, released in 1989. Having been a fan of Brazilian music since the late 1950s, in 1984 together with the band Viva Brasil he recorded the album Brazil Song (Cancões do Brasil), which featured work by Antonio Carlos Jobim and Milton Nascimento. He wrote lyrics for the title track, by Oliver Nelson, of his Stolen Moments album, and it quickly became a radio favourite, remaining one of his most popular recordings. New directions In 1987, Murphy continued his explorations of Brazilian music by recording Night Mood, an album of songs by composer Ivan Lins, followed by the Grammy-nominated September Ballads - both on Milestone Records. In the UK Murphy's recorded output gained a new lease of life in the mid-Eighties during the acid jazz dance craze. DJ's, principally Gilles Peterson, played his bop and latin recordings at club nights, creating a new generation of Mark Murphy fans. He continued to work extensively in Europe, recording in Germany, Holland, Austria, England, Italy, France, Sweden, Denmark and Slovenia, often as a guest artist. Murphy also appeared on UFO's last two releases (for Polydor Records), in which he wrote and rapped lyrics on songs composed with the group. This collaboration opened up further new audiences in the acid-jazz and hip-hop genres, demonstrating jazz's timelessness while transcending generations and styles. In August 1997, BMG/RCA Victor released Song For The Geese, for which he received his fifth and final Grammy nomination. In that same month, the 32 Records label released a double CD anthology Stolen and Other Moments, which features some of his recordings for the now defunct Muse label. The CD features material from the two "Kerouac" albums and a selection of "the best of Mark Murphy". It was followed by three further anthologies. After Muse boss Joe Fields sold the label and set up HighNote Records in its place, Murphy recorded five more albums for the new label, including Some Time Ago (2000), Links (2001) and Memories of You (2003). Murphy's release Once to Every Heart (2005) on Verve, features sensuous ballads, where the listener can hear him singing at the top of his form, with an orchestra arranged by Nan Schwartz. It was one of the best-selling albums of Murphy's career. In 2007 Verve released Love is What Stays. Both albums were produced by German trumpeter Till Brönner. Murphy also collaborated with Tenth & Parker, a modern UK electronica/acid jazz group on their Twenty:Twelve (2001) album; plus the Five Corners Quintet, a modern Finnish jazz band, appearing on their albums Chasin' the Jazz Gone By (2005) and Hot Corner (2008). In 2010 he released the independently produced CD, Never Let Me Go, accompanied by pianist Misha Piatigorsky, bassist Danton Boller and drummer Chris Wabich. The CD contains all songs he selected, mostly ballads, and was the first time he recorded Bill Evans' "Turn Out The Stars". Murphy also participated as a guest on The Royal Bopsters Project by Amy London, Darmon Meader, Dylan Pramuk, and Holli Ross, recorded in 2012 and released in 2015 by Motema Music. His final recording was a limited edition EP/MP3, A Beautiful Friendship: Remembering Shirley Horn on Gearbox Records, released in 2013. Murphy continued to tour internationally into his 80s, appearing at festivals and concerts, in jazz clubs and on television programs, throughout the U.S., Europe, Australia and Japan and elsewhere. John Bush at AllMusic.com described Murphy as "a major name in vocal jazz." A longtime resident of the Lillian Booth Actors Home in Englewood, New Jersey, he died there on October 22, 2015. Discography As leader 1956 Meet Mark Murphy (Decca) 1957 Let Yourself Go (Decca) 1959 This Could Be the Start of Something (Capitol) 1960 Mark Murphy's Hip Parade (Capitol) 1960 Playing the Field (Capitol) 1961 Rah (Riverside) 1962 That's How I Love the Blues! (Riverside) 1965 Swingin' Singin' Affair (Fontana) 1966 Who Can I Turn To & 11 Other Great Standards (Immediate) 1968 Midnight Mood (Saba) 1970 This Must Be Earth (Phoenix) 1972 Bridging a Gap (Muse) 1973 Mark II (Muse) 1975 Mark Murphy Sings...On the Red Clay, Naima and Other Great Songs (Muse) 1977 Mark Murphy Sings Mostly Dorothy Fields & Cy Coleman (Audiophile) 1978 Stolen Moments (Muse) 1979 Satisfaction Guaranteed (Muse) 1981 Bop for Kerouac (Muse) 1982 The Artistry of Mark Murphy (Muse) 1983 Brazil Song (Cancões Do Brasil) (Muse) 1983 Mark Murphy Sings the Nat King Cole Songbook, Volume One (Muse) 1983 Mark Murphy Sings Nat's Choice: The Nat King Cole Songbook, Volume Two (Muse) 1984 Living Room (Muse) 1986 Beauty and the Beast (Muse) 1986 Kerouac, Then and Now (Muse) 1987 Night Mood: The Music of Ivan Lins (Milestone) 1988 September Ballads (Milestone) 1990 What a Way to Go (Muse) 1991 I'll Close My Eyes (Muse) 1991 One for Junior (Muse) 1993 Very Early (West and East Music) 1993 Just Jazz (Jazzette) 1995 The Dream (Jive) 1996 Shadows (TCB Music) 1996 North Sea Jazz Sessions, Volume 5 (Jazz World) 1997 Song for the Geese (RCA Victor) 1999 Some Time Ago (HighNote) 2000 The Latin Porter (Go Jazz) 2000 Links (HighNote) 2001 Lucky to Be Me (HighNote) 2003 Memories of You: Remembering Joe Williams (HighNote) 2004 Bop for Miles (HighNote) 2004 Dim the Lights (Millennium) 2005 Once to Every Heart (Verve) 2006 Love Is What Stays (Verve) 2010 Never Let Me Go (Mark Murphy Productions) 2013 A Beautiful Friendship: Remembering Shirley Horn (Gearbox) 2013 Another Vision (Edel) 2016 Live In Athens, Greece (Harbinger) 2016 Live In Italy 2001 (Splasch) 2017 Wild And Free: Live at the Keystone Korner (HighNote) Guest appearances With Madeline Eastman 1991 "You're the Dangerous Type" – from Mad About Madeline! (Mad Kat) With Till Brönner 2002 "Dim the Lights" – from Blue Eyed Soul (Universal) With Gill Manly 2009 "I Keep Goin' Back to Joe's" – from With a Song in My Heart (Linn) With Guillaume de Chassy and Daniel Yvinec 2009 "I'll Walk Alone"/"Then I'll Be Tired of You"/"Taking a Chance on Love"/"I Wish You Love" – from Songs from the Last Century (Bee Jazz) With The Five Corners Quintet 2005 "This Could Be the Start of Something"/"Before We Say Goodbye"/"Jamming (with Mr. Hoagland)" - from Chasin' the Jazz Gone By (Ricky-Tick Records) 2008 "Kerouac Days in Montana"/"Come and Get Me"/"Layers of Layers" – from Hot Corner (Ricky-Tick Records) 1975 Herb Geller "Sudden Senility"/"The Power of a Smile"/"Space A La Mode" -from "An American in Hamburg/ The View From Here" (Tramp Records) Videos 2008 Mark Murphy: Murphy's Mood – with Pete Candoli and Conte Candoli References External links 1932 births 2015 deaths American expatriates in England American jazz singers American gay musicians American gay actors Gay singers Gay songwriters LGBT people from New York (state) American LGBT singers American LGBT songwriters Milestone Records artists Muse Records artists Musicians from Englewood, New Jersey Musicians from Syracuse, New York People from Fulton, Oswego County, New York Riverside Records artists Swing singers Verve Records artists Vocalese singers Jazz musicians from New York (state) American male jazz musicians Methodists from New York (state) Syracuse University alumni HighNote Records artists 20th-century American male singers 20th-century American singers 21st-century American male singers 21st-century American singers
```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\Meet; class ListTranscriptsResponse extends \Google\Collection { protected $collection_key = 'transcripts'; /** * @var string */ public $nextPageToken; protected $transcriptsType = Transcript::class; protected $transcriptsDataType = 'array'; /** * @param string */ public function setNextPageToken($nextPageToken) { $this->nextPageToken = $nextPageToken; } /** * @return string */ public function getNextPageToken() { return $this->nextPageToken; } /** * @param Transcript[] */ public function setTranscripts($transcripts) { $this->transcripts = $transcripts; } /** * @return Transcript[] */ public function getTranscripts() { return $this->transcripts; } } // Adding a class alias for backwards compatibility with the previous class name. class_alias(ListTranscriptsResponse::class, 'Google_Service_Meet_ListTranscriptsResponse'); ```
```c++ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // Original code copyright 2014 Foxit Software Inc. path_to_url #include "xfa/fwl/cfx_barcode.h" #include <memory> #include "fxbarcode/cbc_codabar.h" #include "fxbarcode/cbc_code128.h" #include "fxbarcode/cbc_code39.h" #include "fxbarcode/cbc_codebase.h" #include "fxbarcode/cbc_datamatrix.h" #include "fxbarcode/cbc_ean13.h" #include "fxbarcode/cbc_ean8.h" #include "fxbarcode/cbc_pdf417i.h" #include "fxbarcode/cbc_qrcode.h" #include "fxbarcode/cbc_upca.h" #include "fxbarcode/utils.h" #include "third_party/base/ptr_util.h" namespace { std::unique_ptr<CBC_CodeBase> CreateBarCodeEngineObject(BC_TYPE type) { switch (type) { case BC_CODE39: return pdfium::MakeUnique<CBC_Code39>(); case BC_CODABAR: return pdfium::MakeUnique<CBC_Codabar>(); case BC_CODE128: return pdfium::MakeUnique<CBC_Code128>(BC_CODE128_B); case BC_CODE128_B: return pdfium::MakeUnique<CBC_Code128>(BC_CODE128_B); case BC_CODE128_C: return pdfium::MakeUnique<CBC_Code128>(BC_CODE128_C); case BC_EAN8: return pdfium::MakeUnique<CBC_EAN8>(); case BC_UPCA: return pdfium::MakeUnique<CBC_UPCA>(); case BC_EAN13: return pdfium::MakeUnique<CBC_EAN13>(); case BC_QR_CODE: return pdfium::MakeUnique<CBC_QRCode>(); case BC_PDF417: return pdfium::MakeUnique<CBC_PDF417I>(); case BC_DATAMATRIX: return pdfium::MakeUnique<CBC_DataMatrix>(); case BC_UNKNOWN: default: return nullptr; } } } // namespace CFX_Barcode::CFX_Barcode() {} CFX_Barcode::~CFX_Barcode() {} std::unique_ptr<CFX_Barcode> CFX_Barcode::Create(BC_TYPE type) { auto barcode = pdfium::WrapUnique(new CFX_Barcode()); // Private ctor. barcode->m_pBCEngine = CreateBarCodeEngineObject(type); return barcode; } BC_TYPE CFX_Barcode::GetType() { return m_pBCEngine ? m_pBCEngine->GetType() : BC_UNKNOWN; } bool CFX_Barcode::SetCharEncoding(BC_CHAR_ENCODING encoding) { return m_pBCEngine ? m_pBCEngine->SetCharEncoding(encoding) : false; } bool CFX_Barcode::SetModuleHeight(int32_t moduleHeight) { return m_pBCEngine ? m_pBCEngine->SetModuleHeight(moduleHeight) : false; } bool CFX_Barcode::SetModuleWidth(int32_t moduleWidth) { return m_pBCEngine ? m_pBCEngine->SetModuleWidth(moduleWidth) : false; } bool CFX_Barcode::SetHeight(int32_t height) { return m_pBCEngine ? m_pBCEngine->SetHeight(height) : false; } bool CFX_Barcode::SetWidth(int32_t width) { return m_pBCEngine ? m_pBCEngine->SetWidth(width) : false; } bool CFX_Barcode::SetPrintChecksum(bool checksum) { switch (GetType()) { case BC_CODE39: case BC_CODABAR: case BC_CODE128: case BC_CODE128_B: case BC_CODE128_C: case BC_EAN8: case BC_EAN13: case BC_UPCA: return m_pBCEngine ? (static_cast<CBC_OneCode*>(m_pBCEngine.get()) ->SetPrintChecksum(checksum), true) : false; default: return false; } } bool CFX_Barcode::SetDataLength(int32_t length) { switch (GetType()) { case BC_CODE39: case BC_CODABAR: case BC_CODE128: case BC_CODE128_B: case BC_CODE128_C: case BC_EAN8: case BC_EAN13: case BC_UPCA: return m_pBCEngine ? (static_cast<CBC_OneCode*>(m_pBCEngine.get()) ->SetDataLength(length), true) : false; default: return false; } } bool CFX_Barcode::SetCalChecksum(bool state) { switch (GetType()) { case BC_CODE39: case BC_CODABAR: case BC_CODE128: case BC_CODE128_B: case BC_CODE128_C: case BC_EAN8: case BC_EAN13: case BC_UPCA: return m_pBCEngine ? (static_cast<CBC_OneCode*>(m_pBCEngine.get()) ->SetCalChecksum(state), true) : false; default: return false; } } bool CFX_Barcode::SetFont(CFX_Font* pFont) { switch (GetType()) { case BC_CODE39: case BC_CODABAR: case BC_CODE128: case BC_CODE128_B: case BC_CODE128_C: case BC_EAN8: case BC_EAN13: case BC_UPCA: return m_pBCEngine ? static_cast<CBC_OneCode*>(m_pBCEngine.get())->SetFont(pFont) : false; default: return false; } } bool CFX_Barcode::SetFontSize(float size) { switch (GetType()) { case BC_CODE39: case BC_CODABAR: case BC_CODE128: case BC_CODE128_B: case BC_CODE128_C: case BC_EAN8: case BC_EAN13: case BC_UPCA: return m_pBCEngine ? (static_cast<CBC_OneCode*>(m_pBCEngine.get()) ->SetFontSize(size), true) : false; default: return false; } } bool CFX_Barcode::SetFontColor(FX_ARGB color) { switch (GetType()) { case BC_CODE39: case BC_CODABAR: case BC_CODE128: case BC_CODE128_B: case BC_CODE128_C: case BC_EAN8: case BC_EAN13: case BC_UPCA: return m_pBCEngine ? (static_cast<CBC_OneCode*>(m_pBCEngine.get()) ->SetFontColor(color), true) : false; default: return false; } } bool CFX_Barcode::SetTextLocation(BC_TEXT_LOC location) { return m_pBCEngine && m_pBCEngine->SetTextLocation(location); } bool CFX_Barcode::SetWideNarrowRatio(int8_t ratio) { return m_pBCEngine && m_pBCEngine->SetWideNarrowRatio(ratio); } bool CFX_Barcode::SetStartChar(char start) { return m_pBCEngine && m_pBCEngine->SetStartChar(start); } bool CFX_Barcode::SetEndChar(char end) { return m_pBCEngine && m_pBCEngine->SetEndChar(end); } bool CFX_Barcode::SetErrorCorrectionLevel(int32_t level) { return m_pBCEngine && m_pBCEngine->SetErrorCorrectionLevel(level); } bool CFX_Barcode::Encode(WideStringView contents) { return m_pBCEngine && m_pBCEngine->Encode(contents); } bool CFX_Barcode::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matrix) { return m_pBCEngine && m_pBCEngine->RenderDevice(device, matrix); } ```
Patricia "Pat" Carmody Bates (born December 15, 1939) is an American Republican politician who served in the California State Senate, representing the 36th Senate district, which encompasses parts of Orange and San Diego counties. She left office on December 5, 2022. She served as the Senate's minority leader from 2017 to 2019. She previously served as a member of the Orange County Board of Supervisors from 2007 to 2014, and the California State Assembly from 1998 to 2004. She also served as the first mayor of Laguna Niguel, California following its incorporation in 1989, and continued to serve on the city council until 1998. Before serving as mayor, she had been employed as a social worker in Los Angeles County. Early life, education, and career as social worker Patricia Carmody Bates was born in Los Angeles. She grew up in Rosemead, California, in the San Gabriel Valley, before her family moved to Long Beach when she was 12 years old. She graduated from Wilson High School and then attended Occidental College, majoring in psychology and studying abroad at the University of Madrid in her junior year. She graduated in 1961. Bates began her professional career as a social worker for the Los Angeles County Department of Public Social Services. She was employed by the department for ten years, and became a deputy district director. In a 2018 interview, Bates said that her experience as a government bureaucrat made her realize government's shortcomings and caused her to view some government programs unfavorably. Laguna Niguel mayor and councilmember Bates lived in Long Beach before moving in 1978 to what was then unincorporated Laguna Niguel in south Orange County. Bates's political involvement began in the 1980s, when she was involved in a group called Citizens for a Safer Crown Valley Parkway, focused on improving pedestrian safety along a road corridor in Laguna Niguel. She was a school volunteer and a then a member of the Laguna Niguel Community Council, serving as its president from 1986 to 1987. Bates was also elected to the five-member, quasi-governmental Community Services District in 1986. After Laguna Niguel was incorporated as a city, she became the first mayor of Laguna Niguel in 1989. She received the most votes among the 23 council candidates, and was named mayor. She remained on the city council for a decade. She was a board member of Saddleback Community College and the South Coast Medical Center Foundation. Bates was the council's representative to the El Toro Reuse Planning Authority, which opposed proposals to build an airport at the former Marine Corps Air Station El Toro; she was vice chair of the Authority. California State Assembly Bates was member of the California State Assembly from 1998 to 2004, representing the 73rd Assembly district. She won the 1998 Republican Assembly primary election with an endorsement by the outgoing Republican incumbent, Bill Morrow. While in the Assembly, Bates sponsored legislation to extend "Megan's Law" to college campuses, and to allocate $35 million for projects to improve California beaches, many of which suffered from beach erosion. Orange County Board of Supervisors Bates was a member of the Orange County Board of Supervisors from 2007 to 2014. She represented the 5th district, a largely white, wealthy, and conservative part of the county, stretching from Aliso Viejo to San Clemente. She was elected to the Board in 2006 in a contentious campaign in which she faced three other candidates, the most significant being former Laguna Niguel mayor Cathryn DeYoung. While Bates had greater name recognition and endorsements, DeYoung had a fundraising advantage. DeYoung's campaign spent $2.7 million (including a $2.1 million loan from DeYoung herself); Bates campaign spent almost $700,000 (including $279,000 loan from Bates herself). The two candidates' campaigns collectively spent almost $3.4 million, making it by far the most expensive campaign for supervisor in Orange County history up to that point. The race was characterized by harsh negative campaigning, much of it focused on illegal immigration. DeYoung attacked Bates as "weak on illegal immigration" while emphasizing her own anti-illegal immigration stance. Bates' campaign sued DeYoung in an attempt to block a mailer that depicted Bates' face superimposed on a Matrícula Consular; two courts rejected Bates' request. As a member of the Orange County Board of Supervisors, Bates joined in the unanimous 2007 vote to create the Citizens Law Enforcement Review Board, a civilian police oversight agency to review complaints of misconduct levied against county law enforcement, although Bates wondered at the time whether the board would become a "toothless tiger." In 2009, Bates joined in the Board's unanimous vote to overhaul the county Planning Department, which had been criticized in an audit for serious lapses. In 2012, Bates voted against a proposal by Board chairman John Moorlach to place a referendum on the ballot that would change supervisor term limits from a maximum of two consecutive four-year terms to a lifetime maximum of three four-year terms. The proposal failed on a 3–2 vote. California State Senate In 2014, Bates was elected to the California State Senate. She was elected from the 36th Senate district, which covers an area in south Orange County and north San Diego County with more than 1 million residents. In 2017, Bates was elected by her fellow Senate Republicans as the minority leader of the California State Senate. She was the second woman in the history of the state to lead a party caucus, the other being her predecessor Jean Fuller. Bates led a small caucus; Republicans made up less than one-third of the state Senate, which had a Democratic supermajority. In the 2017-18 session, Republicans had 13 seats and the Democrats had 27 seats. Bates was reelected to her seat in the November 2018 elections, despite a Democratic wave in Orange County and statewide Republican losses. In the 2019 session, Republicans had only 11 seats in the California Senate. In January 2019, at the beginning of the session, the Senate Republicans voted to oust Bates as leader, replacing her with social conservative Shannon Grove of Bakersfield. Bates was not eligible to seek reelection to the Senate in 2022 due to term limits. Crime issues Bates authored legislation to reclassify several offenses as "violent" felonies to close what she believes are loopholes in state law, siding with prosecutors arguing that the state's list of "violent felony" could allow some dangerous inmates to walk free. Bates was honored by Crime Victims United of California as one of its legislators of the year. In 2019, Bates sponsored a law to close a loophole related to inmates convicted of a sexually violent offense; the bill, signed into law by Governor Gavin Newsom, requiring such inmates to be evaluated for future risk before they can be paroled. In 2021, Bates sponsored legislation that closed a loophole for sexually violent predators (SVPs) undergoing treatment. The law requires previously committed SVPs to return to a state hospital after completing their new prison sentence, so long as mental health evaluators agree that the inmate still meets SVP criteria. Newsom signed the bill into law. Drug policy and legislation on rehab facilities Bates authored bills to address opioid abuse and to improve regulation of facilities that shelter and treat drug addicts. She authored SB 1109, which was signed by Governor Jerry Brown in 2018; the legislation increased continuing medical education requirements for opioid prescribers to curb opioid abuse and addiction, required warning labels on opioid prescription bottles, and required youth sports organizations and schools to distribute a document warning student-athletes and their parents or guardians of the risks associated with opioids. Bates sponsored Brandon's Law, a measure that prohibits the operators of drug rehabilitation facilities from making misrepresentations or false claims about the services they offer or their location. Bates also sponsored consumer-protection legislation to require substance abuse rehabilitation facilities that are licensed or certified by the State of California to clearly disclose their license and certification numbers and the expiration dates on their web sites and other advertising material. Bates authored legislation to require criminal background checks on rehab facility owners and operators, and called on the federal government to give local governments tools to help regulate such facilities. She credited Southern California News Group's "Rehab Riviera" coverage for raising greater awareness of the issue. Transportation Bates opposed California's SB 1 (2017), which increased the gas and car tax increase to fund road and bridge repairs. In a 2017 column, Bates criticized the bill as a "Sacramento backroom deal" and said that it was "appalling that 30 percent of the new taxes will not even be used for road repairs" and that the bill did not provide more funding for lane expansion. Bates opposed the California High-Speed Rail project, calling it "a boondoggle" and urging that the money set aside for high-speed rail be used to fix roads instead. Bates has supported city plans that serve the needs of electric vehicles. She authorized Legislation that authorized San Diego County, or any city in the county, to establish a "Neighborhood Electric Vehicles Transportation Plan." Education Bates endorsed California's Proposition 51 of 2016, which authorized $9 billion in bonds to fund improvement and construction of school facilities for K-12 schools and community colleges. She urged Governor Jerry Brown to expedite the issuance of the bonds. Environment Bates has stated that "sea level rise and coastal erosion are two major threats to California’s coast" and that "Legislators must come together to find a consensus on solutions." In 2015, Bates opposed legislation (SB 350) that would require at least 50% of electricity sold to California customers to come from renewable resources by 2030 and would require the California Air Resources Board (CARB) to implement fuel standards to reduce the use of petroleum by 50% by 2030. Bates voted in favor of California legislation, passed in 2020, that mandates that plastic beverage bottles must contain on average 50% recycled plastic by 2030, among the world's most ambitious targets for recycled plastics content law in the world.” Health care Bates opposed a bill that would establish a single-payer health care system in California, agreeing with Assembly Speaker Anthony Rendon that it was “woefully incomplete” because it did not address financing and other concerns. She also called the bill "a false promise that would ruin the state’s precarious finances and threaten funding for other critical priorities" and said the “Legislature should refocus its efforts on improving existing health programs and on helping those who do not have access to necessary care." In 2015, Bates introduced legislation to allow Saddleback Memorial Medical Center's San Clemente campus to operate as a stand-alone emergency room in an effort to keep the ER open. Economy, technology, and regulation Bates is a strong supporter of the 1978 California Proposition 13, which restricts property-tax increases in California. Bates opposed the California Internet Consumer Protection and Net Neutrality Act of 2018, a California net neutrality law, sponsored by Senator Scott Wiener, that barred internet service providers (ISPs) from blocking or restricting bandwidth (throttling or delegating) services or websites and barring "monopolistic" practices among ISPs. Bates said that net neutrality should be left to the federal government and that the law could deter telecommunications companies from investing in infrastructure in California. Bates voted against SB 63, the New Parent Leave Act, in 2017. The law required companies with more than 20 employees to guarantee California mothers and fathers 12 weeks of protected parental leave after the birth of a child. Bates cited the costs to business as her reason for opposing the legislation. Bates sponsored legislation that streamlined the process for licensed professional clinical counselors, marriage and family therapists, and clinical social workers in other states to become licensed in California. The bill was signed by Governor Newsom in 2019. Trump Bates endorsed Marco Rubio in the 2016 Republican presidential primaries, serving as California co-chair of Rubio's campaign. She said in early 2016 she would support Donald Trump if he won the Republican nomination. In January 2018, Bates criticized state Democrats for what she viewed as an excessive focus "on what President Trump and the federal government are doing." Sexual harassment Bates called on California legislative leaders to release California whistleblowers from non-disclosure agreements on sexual harassment, and called on the Senate and Assembly's rules committees to undertake a "comprehensive, bicameral and bipartisan review" of such agreements. Education Bates sponsored a bill requiring the California Department of Education to report on the use of existing lockdown drills in K-12 public schools. Housing and homelessness With the support of Encinitas mayor Catherine Blakespear, Bates sponsored bipartisan legislation in 2018 (SB 1226) to make it easier to build, and issue permits for, accessory dwelling units (ADUs or "granny flats") to ease the California housing shortage. Bates co-authored legislation, signed by Governor Jerry Brown in 2018, allowing the creation of an Orange County trust to help house homeless people. In August 2021, Bates and fellow Republican Mike Morrell were the Senate's sole "no" votes on legislation that extended a statewide eviction moratorium through January 2022 for tenants who suffered loss of employment and income during the COVID-19 pandemic. Bates cited opposition from a landlord's association. The bill passed the Assembly 56–8, and the Senate 33–2; the legislation was signed into law by Newsom. Campaign finance In August 2018, Bates opposed the advancement of a bill giving legislative leaders more campaign cash. In April 2016, she and a former chairman of the California Fair Political Practices Commission advocated for the passage of a bill that “would bar candidates and elected officials from using money from candidate-controlled committees to promote themselves, their candidacies or the campaigns of others.” Personal life Bates married John Bates, an architect, in 1963; they have two children. References External links Campaign website 1939 births 20th-century American politicians 20th-century American women politicians 21st-century American politicians 21st-century American women politicians Republican Party California state senators Living people Mayors of places in California Republican Party members of the California State Assembly Orange County Supervisors People from Laguna Niguel, California Women mayors of places in California Women state legislators in California Appropriations Committee member, California State Senate
is a Japanese football player. He plays for Gamba Osaka. Career Ayumu Matsumoto joined Gamba Osaka in 2016. On April 3, he debuted in J3 League (v Kataller Toyama). Reserves performance Last Updated: 31 December 2016 References External links 1998 births Living people Association football people from Osaka Prefecture Japanese men's footballers J1 League players J3 League players Gamba Osaka players Gamba Osaka U-23 players Men's association football forwards Kansai University alumni
WH Hill (full name unknown) was an English first-class cricketer who played two games for Worcestershire in 1900. Hill's debut, against Lancashire at Old Trafford, was the game in which Johnny Briggs took all ten Worcestershire wickets for 55 runs. Notes References Year of birth missing Year of death missing English cricketers Worcestershire cricketers Place of birth missing
```go package trace_test import ( "context" "fmt" "testing" "github.com/stretchr/testify/assert" "github.com/stripe/veneur/v14/trace" ) func TestStartSpanDefaultName(t *testing.T) { const resource = "TestResourceName" const expectedName = "trace_test.TestStartSpanDefaultName" ctx := context.Background() tracer := trace.Tracer{} span := tracer.StartSpan(resource).(*trace.Span) ctx = span.Attach(ctx) _, _ = trace.StartSpanFromContext(ctx, "") assert.Equal(t, resource, span.Resource) assert.Equal(t, expectedName, span.Name) } func TestStartSpanFromContextDefaultName(t *testing.T) { const resource = "TestResourceName" const expectedName = "trace_test.TestStartSpanFromContextDefaultName" ctx := context.Background() tracer := trace.Tracer{} root := tracer.StartSpan(resource).(*trace.Span) ctx = root.Attach(ctx) span, _ := trace.StartSpanFromContext(ctx, "") assert.Equal(t, resource, span.Resource) assert.Equal(t, expectedName, span.Name) assert.Equal(t, span.ParentID, root.SpanID) assert.Equal(t, span.TraceID, root.SpanID) ctx = span.Attach(ctx) grandchild, _ := trace.StartSpanFromContext(ctx, "") assert.Equal(t, grandchild.TraceID, root.SpanID) assert.Equal(t, grandchild.ParentID, span.SpanID) } // StartSpanFromContext should create a brand-new root span // if the context does not contain a span func TestSpanFromContextNoParent(t *testing.T) { const resource = "example" ctx := context.Background() span, _ := trace.StartSpanFromContext(ctx, resource) assert.Equal(t, span.TraceID, span.SpanID) assert.Equal(t, int64(0), span.ParentID) } // TestError tests that the Error method properly sets // the error tags on a span. func TestSetError(t *testing.T) { span, _ := trace.StartSpanFromContext(context.Background(), "") err := fmt.Errorf("test error") span.Error(err) } ```
Songs from the Departure Lounge is a compilation album by New Zealand band Able Tasmans released in 1998. Track listing "What Was That Thing" "Sour Queen" "Buffaloes" "Michael's" "Hold Me I" "Grey Lynn" "Michael Fay" "Angry Martyr" "Dileen" "Theory Of Continual Disappointment" "Fault In The Frog" "The Cliff" "School Is No Good For You" "Not Fair" "Coming Up For Air" "Shape Of Dolls" "That's Why" "Dog Whelk 2" "Mary Tyler Moore" "My Name Is Peter Keen" Able Tasmans albums 1998 greatest hits albums Flying Nun Records compilation albums
```kotlin package mega.privacy.android.data.gateway.api import mega.privacy.android.domain.entity.SortOrder import nz.mega.sdk.MegaCancelToken import nz.mega.sdk.MegaNode import nz.mega.sdk.MegaRequestListenerInterface import nz.mega.sdk.MegaSearchFilter import nz.mega.sdk.MegaSearchPage /** * Mega api folder gateway * * The gateway interface to the Mega Api folder functionality */ interface MegaApiFolderGateway { /** * Authentication token that can be used to identify the user account. */ suspend fun setAccountAuth(authentication: String?) /** * Authorize and return a MegaNode can be downloaded with any instance of MegaApi * * @param handle the handle of the node to authorize * @return a MegaNode that can be downloaded with any instance of MegaApi, * null if can't be authorized */ suspend fun authorizeNode(handle: Long): MegaNode? /** * Get MegaNode by node handle * @param nodeHandle node handle * @return MegaNode */ suspend fun getMegaNodeByHandle(nodeHandle: Long): MegaNode? /** * Returns a MegaNode that can be downloaded with any instance of MegaApi * * @param node MegaNode to authorize * @return Authorized node, or NULL if the node can't be authorized */ suspend fun authorizeNode(node: MegaNode): MegaNode? /** * Returns a URL to a node in the local HTTP proxy server * * @param node Node to generate the local HTTP link * @return URL to the node in the local HTTP proxy server, otherwise NULL */ suspend fun httpServerGetLocalLink(node: MegaNode): String? /** * Check if the HTTP proxy server is running * * @return 0 if the server is not running. Otherwise the port in which it's listening to */ suspend fun httpServerIsRunning(): Int /** * Start an HTTP proxy server in specified port * * @return True if the server is ready, false if the initialization failed */ suspend fun httpServerStart(): Boolean /** * Set the maximum buffer size for the internal buffer * * @param bufferSize Maximum buffer size (in bytes) or a number <= 0 to use the * internal default value */ suspend fun httpServerSetMaxBufferSize(bufferSize: Int) /** * Stop the HTTP proxy server */ suspend fun httpServerStop() /** * Root node of the account * * All accounts have a root node, therefore if it is null the account has not been logged in or * initialised yet for some reason. * */ suspend fun getRootNode(): MegaNode? /** * Get thumbnail from server * * @param node * @param thumbnailFilePath thumbnail file path * @param listener */ fun getThumbnail( node: MegaNode, thumbnailFilePath: String, listener: MegaRequestListenerInterface? = null, ) /** * Fetch the filesystem in MEGA * * @param listener MegaRequestListener to track this request */ fun fetchNodes(listener: MegaRequestListenerInterface) /** * Log in to a public folder using a folder link * * @param folderLink Public link to a folder in MEGA * @param listener MegaRequestListener to track this request */ fun loginToFolder(folderLink: String, listener: MegaRequestListenerInterface) /** * Remove request listener * * @param listener MegaRequestListener to remove */ fun removeRequestListener(listener: MegaRequestListenerInterface) /** * Get child folder number of current folder * @param node current folder node * @return child folder number */ suspend fun getNumChildFolders(node: MegaNode): Int /** * Get child files number of current folder * @param node current folder node * @return child files number */ suspend fun getNumChildFiles(node: MegaNode): Int /** * Get the parent node of a MegaNode * * @param node * @return the parent node of the node, null if node doesn't exist */ suspend fun getParentNode(node: MegaNode): MegaNode? /** * Retrieve basic information about a folder link * This function retrieves basic information from a folder link, like the * number of files / folders and the name of the folder. For folder links containing * a lot of files/folders, this function is more efficient than a fetchNodes. * * Valid data in the MegaRequest object received on all callbacks: * - MegaRequest::getLink() - Returns the public link to the folder * Valid data in the MegaRequest object received in onRequestFinish when the error code is MegaError::API_OK: * - MegaRequest::getMegaFolderInfo() - Returns information about the contents of the folder * - MegaRequest::getNodeHandle() - Returns the public handle of the folder * - MegaRequest::getParentHandle() - Returns the handle of the owner of the folder * - MegaRequest::getText() - Returns the name of the folder. If there's no name, it returns the special status string "CRYPTO_ERROR". If the length of the name is zero, it returns the special status string "BLANK". * * On the onRequestFinish error, the error code associated to the MegaError can be: * - MegaError::API_EARGS - If the link is not a valid folder link - MegaError::API_EKEY - If the public link does not contain the key or it is invalid * * @param megaFolderLink Public link to a folder in MEGA * @param listener MegaRequestListener to track this request */ fun getPublicLinkInformation(megaFolderLink: String, listener: MegaRequestListenerInterface) /** * Enable / disable the public key pinning * * Public key pinning is enabled by default for all sensible communications. * It is strongly discouraged to disable this feature. * * @param enable True to keep public key pinning enabled, false to disable it */ suspend fun setPublicKeyPinning(enable: Boolean) /** * Change the API URL * * This function allows to change the API URL. * It's only useful for testing or debugging purposes. * * @param apiURL New API URL * @param disablePkp True to disable public key pinning for this URL */ suspend fun changeApiUrl(apiURL: String, disablePkp: Boolean) /** * Get folder info * * @param node * @param listener */ fun getFolderInfo(node: MegaNode?, listener: MegaRequestListenerInterface) /** * Search query with search filter * * @param filter filter to apply [MegaSearchFilter] * @param order [SortOrder] * @param megaCancelToken [MegaCancelToken] */ suspend fun search( filter: MegaSearchFilter, order: Int, megaCancelToken: MegaCancelToken, megaSearchPage: MegaSearchPage? = null ): List<MegaNode> /** * Get children of a node * @param filter filter to apply [MegaSearchFilter] * @param order [SortOrder] * @param megaCancelToken [MegaCancelToken] */ suspend fun getChildren( filter: MegaSearchFilter, order: Int, megaCancelToken: MegaCancelToken, megaSearchPage: MegaSearchPage? = null ): List<MegaNode> } ```
```kotlin package org.fossasia.susi.ai.rest.services import org.fossasia.susi.ai.rest.responses.others.AddRoomResponse import org.fossasia.susi.ai.rest.responses.others.SpeakerAuthResponse import org.fossasia.susi.ai.rest.responses.others.SpeakerConfigResponse import org.fossasia.susi.ai.rest.responses.others.SpeakerWifiResponse import retrofit2.Call import retrofit2.http.GET import retrofit2.http.Query import retrofit2.http.QueryMap interface DeviceApi { @GET("/wifi_credentials") fun wifiCredentials( @Query("wifissid") ssid: String, @Query("wifipassd") pass: String ): Call<SpeakerWifiResponse> @GET("/config") fun ttSSettings(@QueryMap query: Map<String, String>): Call<SpeakerConfigResponse> @GET("/auth") fun authCredentials( @Query("choice") choice: String, @Query("email") email: String, @Query("password") password: String ): Call<SpeakerAuthResponse> @GET("/speaker_config") fun roomDetails( @Query("room_name") room_name: String ): Call<AddRoomResponse> } ```
Logan Craig O'Brien (born January 21, 1992) is an American child actor and singer. O'Brien is best known for his role as Lucas Jones on General Hospital. Life and career O'Brien was born in Los Angeles, California, to a doctor mother and a police sergeant father. He started his career at the age of six, after being cast in his first feature film role in the independent film Special Delivery, starring Sean Young, Penny Marshall and Nell Carter. He followed that up with co-starring roles in Disney's Smart House, and Hallmark Hall of Fame'''s A Season for Miracles, with Laura Dern and Lynn Redgrave. He also appeared in a duet entitled "Younger Generation" with singer Joey Pearson on his album Something to Say in 2002. He has been involved in many theatrical productions, earning awards and nominations for his performances, and was seen in the ABC primetime pilot sitcom That Was Then. In 2005, O'Brien completed filming his part in the Universal Studios feature film Serenity'', directed by Joss Whedon, which premiered worldwide September 30, 2005. Filmography Award nominations References External links Logan O'Brien Official Website 1992 births American male child actors American child singers American male film actors American male television actors Living people Male actors from Los Angeles 21st-century American singers
```html <html lang="en"> <head> <title>fseek - Untitled</title> <meta http-equiv="Content-Type" content="text/html"> <meta name="description" content="Untitled"> <meta name="generator" content="makeinfo 4.8"> <link title="Top" rel="start" href="index.html#Top"> <link rel="up" href="Stdio.html#Stdio" title="Stdio"> <link rel="prev" href="freopen.html#freopen" title="freopen"> <link rel="next" href="_005f_005ffsetlocking.html#g_t_005f_005ffsetlocking" title="__fsetlocking"> <link href="path_to_url" rel="generator-home" title="Texinfo Homepage"> <meta http-equiv="Content-Style-Type" content="text/css"> <style type="text/css"><!-- pre.display { font-family:inherit } pre.format { font-family:inherit } pre.smalldisplay { font-family:inherit; font-size:smaller } pre.smallformat { font-family:inherit; font-size:smaller } pre.smallexample { font-size:smaller } pre.smalllisp { font-size:smaller } span.sc { font-variant:small-caps } span.roman { font-family:serif; font-weight:normal; } span.sansserif { font-family:sans-serif; font-weight:normal; } --></style> </head> <body> <div class="node"> <p> <a name="fseek"></a> Next:&nbsp;<a rel="next" accesskey="n" href="_005f_005ffsetlocking.html#g_t_005f_005ffsetlocking">__fsetlocking</a>, Previous:&nbsp;<a rel="previous" accesskey="p" href="freopen.html#freopen">freopen</a>, Up:&nbsp;<a rel="up" accesskey="u" href="Stdio.html#Stdio">Stdio</a> <hr> </div> <h3 class="section">4.26 <code>fseek</code>, <code>fseeko</code>&mdash;set file position</h3> <p><a name="index-fseek-232"></a><a name="index-fseeko-233"></a><a name="index-g_t_005ffseek_005fr-234"></a><a name="index-g_t_005ffseeko_005fr-235"></a><strong>Synopsis</strong> <pre class="example"> #include &lt;stdio.h&gt; int fseek(FILE *<var>fp</var>, long <var>offset</var>, int <var>whence</var>); int fseeko(FILE *<var>fp</var>, off_t <var>offset</var>, int <var>whence</var>); int _fseek_r(struct _reent *<var>ptr</var>, FILE *<var>fp</var>, long <var>offset</var>, int <var>whence</var>); int _fseeko_r(struct _reent *<var>ptr</var>, FILE *<var>fp</var>, off_t <var>offset</var>, int <var>whence</var>); </pre> <p><strong>Description</strong><br> Objects of type <code>FILE</code> can have a &ldquo;position&rdquo; that records how much of the file your program has already read. Many of the <code>stdio</code> functions depend on this position, and many change it as a side effect. <p>You can use <code>fseek</code>/<code>fseeko</code> to set the position for the file identified by <var>fp</var>. The value of <var>offset</var> determines the new position, in one of three ways selected by the value of <var>whence</var> (defined as macros in `<code>stdio.h</code>'): <p><code>SEEK_SET</code>&mdash;<var>offset</var> is the absolute file position (an offset from the beginning of the file) desired. <var>offset</var> must be positive. <p><code>SEEK_CUR</code>&mdash;<var>offset</var> is relative to the current file position. <var>offset</var> can meaningfully be either positive or negative. <p><code>SEEK_END</code>&mdash;<var>offset</var> is relative to the current end of file. <var>offset</var> can meaningfully be either positive (to increase the size of the file) or negative. <p>See <code>ftell</code>/<code>ftello</code> to determine the current file position. <pre class="sp"> </pre> <strong>Returns</strong><br> <code>fseek</code>/<code>fseeko</code> return <code>0</code> when successful. On failure, the result is <code>EOF</code>. The reason for failure is indicated in <code>errno</code>: either <code>ESPIPE</code> (the stream identified by <var>fp</var> doesn't support repositioning) or <code>EINVAL</code> (invalid file position). <pre class="sp"> </pre> <strong>Portability</strong><br> ANSI C requires <code>fseek</code>. <p><code>fseeko</code> is defined by the Single Unix specification. <p>Supporting OS subroutines required: <code>close</code>, <code>fstat</code>, <code>isatty</code>, <code>lseek</code>, <code>read</code>, <code>sbrk</code>, <code>write</code>. <pre class="sp"> </pre> </body></html> ```
"The Orange and Blue" is the traditional fight song of the Florida Gators intercollegiate sports teams of the University of Florida in Gainesville, Florida. History of the lyrics and score The author of the lyrics and original music of "The Orange and Blue" is uncertain, but published examples of the University of Florida's songs and yells which include the lyrics date to at least the 1916–17 school year. Sheet music for the song was published in 1925 which listed George Hamilton as the author. Thornton W. Allen, a prolific compiler, composer and arranger of American university alma maters and college football fight songs, arranged a version of the musical score in 1935, with "Words by George Hamilton." The present music for the song, as played at University of Florida events, was arranged by the university's former director of bands, Richard W. Bowles, in 1964. Bowles served as the assistant university band director from 1958 to 1961, the director from 1961 to 1975, and continued to teach at the university until his retirement in 1985. While "The Orange and Blue" is often played during football and basketball games and other Florida Gators athletic contests to rally fans and show support for the university's athletic teams, The Pride of the Sunshine marching band and the university's other pep bands rarely play any part of the song other than the chorus. Lyrics So give a cheer for the Orange and Blue Waving Forever! Forever pride of Old Florida, May she droop never. We’ll sing a song for the flag today, Cheer for the team at play! On to the goal, We’ll fight our way for Flor-i-da! Go Gators! See also The Pride of the Sunshine Florida Gators History of the University of Florida We Are the Boys from Old Florida References External links Song recording UF bands private press vinyl releases Florida Gators American college songs College fight songs in the United States Southeastern Conference fight songs University of Florida Year of song unknown
```objective-c #ifndef DLIB_ENTROPY_DECODEr_ #define DLIB_ENTROPY_DECODEr_ #include "entropy_decoder/entropy_decoder_kernel_1.h" #include "entropy_decoder/entropy_decoder_kernel_2.h" #include "entropy_decoder/entropy_decoder_kernel_c.h" namespace dlib { class entropy_decoder { entropy_decoder() {} public: //----------- kernels --------------- // kernel_1a typedef entropy_decoder_kernel_1 kernel_1a; typedef entropy_decoder_kernel_c<kernel_1a> kernel_1a_c; // kernel_2a typedef entropy_decoder_kernel_2 kernel_2a; typedef entropy_decoder_kernel_c<kernel_2a> kernel_2a_c; }; } #endif // DLIB_ENTROPY_DECODEr_ ```
```javascript OC.L10N.register( "files_external", { "Personal" : "Osobno", "Saved" : "Spremljeno", "Username" : "Korisniko ime", "Password" : "Lozinka", "Save" : "Spremi", "None" : "Nita", "Port" : "Prikljuak", "WebDAV" : "WebDAV", "Local" : "Lokalno", "Location" : "Lokacija", "ownCloud" : "OwnCloud", "Share" : "Podijeli", "Name" : "Ime", "Delete" : "Izbrii" }, "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"); ```
Masoud Soleimani Shojaei (; born 9 June 1984) is an Iranian professional footballer who plays for Nassaji. Mainly an attacking midfielder, he can also play as a winger or forward. After playing in his country for two clubs and with Al-Sharjah in the United Arab Emirates, he went on to spend several seasons in Spain with Osasuna, appearing in 112 official matches. An Iranian international since 2004, Shojaei represented his country in three World Cups and four Asian Cups. Club career Early years Shojaei was born in Shiraz, and lived most of his life in Abadan and Tehran. He started his career with Sanat Naft Abadan F.C. before moving to Saipa F.C. of Karaj in the Iran Pro League; having signed at the age of 19, he went on to play three seasons with the latter. After the 2006 World Cup, Shojaei moved to the United Arab Emirates and signed for Al Sharjah SC. He scored his first goal for the club in the League on 3 October, against Emirates Club. Osasuna On 23 June 2008, after previous attempts from VfL Wolfsburg in Germany and Italy's S.S.C. Napoli, Shojaei signed with Spanish side CA Osasuna for three years, teaming up with compatriot Javad Nekounam. The deal included a €6 million buyout clause for the first 18 months of his contract, being reduced to €3.5 million for the remainder of his stay. Shojaei made his La Liga debut on 31 August 2008, playing 32 minutes in a 1–1 home draw against Villarreal CF. During his first two seasons he appeared almost always as a substitute, as the Navarrese managed to maintain its division status; the player remained a regular even after the coaching change at the club, as José Ángel Ziganda was replaced by José Antonio Camacho. Shojaei – who was addressed by his first name during his spell in Spain – appeared regularly again for Osasuna in the 2010–11 campaign, but also spent one month at the 2011 AFC Asian Cup with his national team. In late May he renewed his contract with the club for another two seasons, also having the option of an annual renewal of his link. Shojaei spent the entire 2011–12 on the sidelines, due to injury. On 25 February 2013, in only his fourth appearance since returning, he scored a stunning goal to help Osasuna win it 2–0 at Levante UD. Despite a solid start to his spell, Shojaei was eventually released in June 2013. Shortly after, he was linked with a move to fellow league club Real Valladolid, but nothing came of it. Las Palmas On 3 September 2013, Shojaei moved clubs but stayed in Spain, joining Segunda División side UD Las Palmas on a one-year contract. He found the net in his debut, in a 3–1 away victory over CE Sabadell FC for the second round of the Copa del Rey. Shojaei scored twice and provided an assist in the first half of the league fixture against the same opponent on 15 March 2014, in an eventual 5–0 home win. Qatar After the 2014 World Cup, Shojaei turned down an offer from Real Zaragoza and moved to Al-Shahania Sports Club in the Qatar Stars League alongside compatriot Mehrdad Pooladi. On 14 December 2014, he scored a hat-trick in a 3–1 away win against eventual runners-up Al Sadd SC; one year later, after suffering relegation, he joined fellow league club Al-Gharafa Sports Club for $1 million. Greece On 22 July 2016, Shojaei joined Super League Greece side Panionios on a one-year contract. He enjoyed a successful first season, and subsequently extended his contract until June 2018; on 25 December 2017, however, he severed his link by mutual consent and agreed to a six-month deal at fellow league team AEK Athens three days later, announcing on his Instagram he would be wearing number 24 in tribute of Hadi Norouzi who died in 2015. He made his debut on 6 January, replacing Anastasios Bakasetas in the second half of the match against Panetolikos and later providing the assist for Hélder Lopes goal, in a 4–1 away win. He started his first match three days later against the same opponent, making another assist in a 1–0 victory for the Greek Football Cup's round of 16 and being named as the most valuable player of the match for his performance. On 1 March 2018, Shojaei put the visitors ahead in their domestic cup semi-final fixture away to AEL, in an eventual 1–2 loss which marked his first goal for the club and the first loss in 26 matches for Manolo Jiménez's team. He contributed to the club's first national championship conquest in 24 years, he left the club. Tractor On 2 August 2018, Shojaei joined Tractor S.C. on a three-year contract. 8 days later, he made his debut in a 3–0 defeat against Esteghlal F.C. in which he was chosen as the side's first captain. On 19 April 2019, he was assaulted by a supporter of his own team who invaded the pitch after a 1–0 home defeat of Paykan FC. Midway through the 2019–20 campaign, Shojaei was offered the interim position after Mustafa Denizli's departure. He declined, instead being named assistant to Ahad Sheykhlari while also being involved in the taking of decisions in training. Nassaji On 5 October 2021, Shojaei joined Nassaji on a two-year contract, reuniting with former Tractor manager Saket Elhami. Following his arrival, he was named the team's new captain. On 27 February in the 2022 Hazfi Cup Final, he played the first half of a goalless draw with Aluminium Arak that his team won on penalties. International career Whilst at Saipa, Shojaei earned a place in Iranian national under-23 team, catching the eye of full side coach Branko Ivanković. He was first called up to play for the latter in November 2004, for a 2006 FIFA World Cup qualifier against Laos – it was the only cap he would win until the training camp prior to the finals in Germany, held in Switzerland; he was included in the final squad but only appeared once in the tournament, replacing injured Mohammad Nosrati in the early minutes of the 1–1 draw against Angola. Shojaei began appearing more regularly in the 2010 World Cup qualification stages, scoring in a 1–1 draw against South Korea in the final game. However, Team Melli did not qualify for the tournament in South Africa. Iran did manage to reach the 2014 World Cup, with Shojaei as a regular starter in the qualifiers. On 1 June 2014, Shojaei was included in Carlos Queiroz's list for the World Cup. He appeared as a substitute in the team's opening draw with Nigeria, and was selected in the starting line-up for the following group matches against Argentina and Bosnia-Herzegovina. On 30 December 2014, Shojaei was called into Iran's 2015 AFC Asian Cup squad. He scored the nation's second goal in its opening 2–0 defeat of Bahrain, in Melbourne. Shojaei captained the squad in 2018 World Cup qualification home matches against China and Uzbekistan. On 10 August 2017, Mohammad Reza Davarzani, Iran's deputy sports minister, said on Iranian state television both Shojaei and teammate Ehsan Hajsafi would never be invited to the national team again for playing with their club Panionios against Israel's Maccabi Tel Aviv FC; however, the Iranian Football Federation later stated it would review the case and reach a decision after speaking with both, with Hajsafi eventually returning to the side in November and Shojaei stating that they were pressured by their club to play. On 18 March 2018, Shojaei was called up for friendlies against Tunisia and Algeria, being criticised after his return against the former by an Iranian member of parliament who called for his life ban. He was eventually selected for the finals in Russia as team captain, becoming the first Iranian player to travel to three World Cups. He made his debut in the tournament on 15 June in a 1–0 group stage win against Morocco, but sat on the bench for the next two games in an eventual group stage elimination. In December 2018, Shojaei was selected for Iran's 23-man squad for the 2019 AFC Asian Cup. He became the only Iranian to participate in seven international tournaments. Activism Shojaei expressed support for the Iranian Green Movement on 17 June 2009, when he wore a green bracelet against South Korea in a World Cup 2010 qualifier along with five other players. During the match, he also wore a green undershirt previewing a possible goal celebration. Shojaei discussed corruption in Iranian football in an interview with Radio Farda, and also spoke out against child sexual abuses in December 2016. He was subsequently summoned to the Ethics Committee of the Football Federation Islamic Republic of Iran. A vocal advocate of lifting stadium ban for women in Iran, Shojaei openly expressed his regret that his mother, sister and wife were unable to see him play. He reportedly called for repealing the ban, when he met with president Hassan Rouhani in July 2017. Personal life Shojaei's sister, Maryam, was also an activist campaigning for women's rights in Iran. Career statistics Club International Scores and results list Iran's goal tally first, score column indicates score after each Shojaei goal. Honours AEK Athens Super League: 2017–18 Tractor Hazfi Cup: 2019–20 Nassaji Hazfi Cup: 2021–22 Iran Islamic Solidarity Games: Bronze medal 2005 Individual Super League Greece Team of the Season: 2016–17 References External links TeamMelli official profile 1984 births Living people Footballers from Shiraz Iranian men's footballers Men's association football midfielders Persian Gulf Pro League players Sanat Naft Abadan F.C. players Saipa F.C. players Tractor S.C. players UAE Pro League players Sharjah FC players La Liga players Segunda División players CA Osasuna players UD Las Palmas players Qatar Stars League players Al Shahaniya SC players Al-Gharafa SC players Super League Greece players Panionios F.C. players AEK Athens F.C. players Iran men's international footballers 2006 FIFA World Cup players 2007 AFC Asian Cup players 2011 AFC Asian Cup players 2014 FIFA World Cup players 2015 AFC Asian Cup players 2018 FIFA World Cup players 2019 AFC Asian Cup players Iranian expatriate men's footballers Expatriate men's footballers in the United Arab Emirates Expatriate men's footballers in Spain Expatriate men's footballers in Qatar Expatriate men's footballers in Greece Iranian expatriate sportspeople in the United Arab Emirates Iranian expatriate sportspeople in Spain Iranian expatriate sportspeople in Qatar Iranian expatriate sportspeople in Greece Iranian women's rights activists F.C. Nassaji Mazandaran players
Chlosyne ehrenbergii, the white-rayed checkerspot, white-rayed patch or Ehrenberg's patch, is a butterfly of the family Nymphalidae. It is found in Mexico. Adult females are highly gregarious, clustering together in groups on Buddleia bushes. Adults feed on flower nectar of various flowers, including daisies and other Asteraceae species. The larvae feed on Buddleia species. References External links ehrenbergi Butterflies of North America Endemic Lepidoptera of Mexico
```javascript import { app, dialog, BrowserWindow, webContents, ipcMain, shell, Menu, screen, session, nativeImage } from 'electron' import { autoUpdater } from 'electron-updater' import os from 'os' import path from 'path' import fs from 'fs' import jetpack from 'fs-jetpack' import ICO from 'icojs' import toIco from 'to-ico' import emitStream from 'emit-stream' import EventEmitter from 'events' import LRU from 'lru' const exec = require('util').promisify(require('child_process').exec) import * as logLib from './logger' import * as adblocker from './adblocker' const logger = logLib.child({category: 'browser'}) import * as settingsDb from './dbs/settings' import { convertDatArchive } from './dat/index' import datDns from './dat/dns' import { open as openUrl } from './open-url' import * as windows from './ui/windows' import { createMenuItem as createContextMenuItem, shouldShowMenuItem as shouldShowContextMenuItem } from './ui/context-menu' import * as tabManager from './ui/tabs/manager' import { updateSetupState } from './ui/setup-flow' import * as modals from './ui/subwindows/modals' import * as siteInfo from './ui/subwindows/site-info' import { findWebContentsParentWindow } from './lib/electron' import * as hyperDaemon from './hyper/daemon' import * as bookmarks from './filesystem/bookmarks' import { getDriveIdent } from './filesystem/index' import * as wcTrust from './wc-trust' import { spawnAndExecuteJs } from './lib/electron' // constants // = const IS_FROM_SOURCE = (process.defaultApp || /node_modules[\\/]electron[\\/]/.test(process.execPath)) const IS_LINUX = !(/^win/.test(process.platform)) && process.platform !== 'darwin' const DOT_DESKTOP_FILENAME = 'appimagekit-beaker-browser.desktop' const isBrowserUpdatesSupported = !(IS_LINUX || IS_FROM_SOURCE) // linux is temporarily not supported // how long between scheduled auto updates? const SCHEDULED_AUTO_UPDATE_DELAY = 24 * 60 * 60 * 1e3 // once a day // possible updater states const UPDATER_STATUS_IDLE = 'idle' const UPDATER_STATUS_CHECKING = 'checking' const UPDATER_STATUS_DOWNLOADING = 'downloading' const UPDATER_STATUS_DOWNLOADED = 'downloaded' // globals // = // dont automatically check for updates (need to respect user preference) autoUpdater.autoDownload = false // what's the updater doing? var updaterState = UPDATER_STATUS_IDLE var updaterError = undefined // has there been an error? // content-type tracker var resourceContentTypes = new LRU(100) // URL -> Content-Type // certificate tracker var originCerts = new LRU(100) // hostname -> {issuerName, subjectName, validExpiry} // events emitted to rpc clients var browserEvents = new EventEmitter() process.on('unhandledRejection', (reason, p) => { console.error('Unhandled Rejection at: Promise', p, 'reason:', reason, reason.stack) logger.error(`Unhandled Rejection at: Promise ${p.toString()} reason: ${reason.toString()} ${reason.stack}`) }) process.on('uncaughtException', (err) => { console.error('Uncaught exception:', err) logger.error(`Uncaught exception: ${err.toString()}`) }) // exported methods // = export async function setup () { wcTrust.setup() // setup auto-updater if (isBrowserUpdatesSupported) { try { autoUpdater.setFeedURL(getAutoUpdaterFeedSettings()) autoUpdater.on('update-available', onUpdateAvailable) autoUpdater.on('update-not-available', onUpdateNotAvailable) autoUpdater.on('update-downloaded', onUpdateDownloaded) autoUpdater.on('error', onUpdateError) } catch (e) { logger.error(`Auto-updater error: ${e.toString()}`) } setTimeout(scheduledAutoUpdate, 15e3) // wait 15s for first run } // wire up events app.on('web-contents-created', onWebContentsCreated) // window.prompt handling // - we have use ipc directly instead of using rpc, because we need custom // response-lifecycle management in the main thread ipcMain.on('page-prompt-dialog', async (e, message, def) => { var wc = e.sender var res = await modals.create(e.sender, 'prompt', {message, default: def}).catch(e => false) wc.focus() e.returnValue = res && res.value ? res.value : false }) // HACK // Electron has an issue where browserviews fail to calculate click regions after a resize // path_to_url // we can solve this by forcing a recalculation after every resize // -prf ipcMain.on('resize-hackfix', (e, message) => { var win = findWebContentsParentWindow(e.sender) if (win) { win.webContents.executeJavaScript(`if (window.forceUpdateDragRegions) { window.forceUpdateDragRegions() }; undefined`) } }) // request blocking for security purposes session.defaultSession.webRequest.onBeforeRequest((details, cb) => { if (details.url.startsWith('asset:') || details.url.startsWith('beaker:')) { if (details.resourceType === 'mainFrame') { // allow toplevel navigation return cb({cancel: false}) } else if (details.webContentsId && wcTrust.isWcTrusted(details.webContentsId)) { // allow trusted WCs return cb({cancel: false}) } else { // disallow all other requesters return cb({cancel: true}) } } else if (details.url.startsWith('hyper://private')) { if (!details.webContentsId) { if (details.resourceType === 'mainFrame') { // allow toplevel navigation return cb({cancel: false}) } else { // not enough info, cancel return cb({cancel: true}) } } let wc = webContents.fromId(details.webContentsId) if (/^(beaker:\/\/|hyper:\/\/private\/)/.test(wc.getURL())) { // allow access from self and from beaker cb({cancel: false}) } else { cb({cancel: true}) } } else { adblocker.onBeforeRequest(details, cb) } }) // HACK // Electron doesn't give us a convenient way to check the content-types of responses // or to fetch the certs of a hostname // so we track the last 100 responses' headers to accomplish this // -prf session.defaultSession.webRequest.onCompleted(onCompleted) session.defaultSession.setCertificateVerifyProc((request, cb) => { originCerts.set('path_to_url + request.hostname + '/', { issuerName: request.certificate.issuerName, subjectName: request.certificate.subjectName, validExpiry: request.certificate.validExpiry }) cb(request.errorCode) }) } export const WEBAPI = { createEventsStream, getInfo, getDaemonStatus, getDaemonNetworkStatus, checkForUpdates, restartBrowser, getSetting, getSettings, setSetting, updateAdblocker, updateSetupState, migrate08to09, setStartPageBackgroundImage, getDefaultProtocolSettings, setAsDefaultProtocolClient, removeAsDefaultProtocolClient, fetchBody, downloadURL, convertDat, getResourceContentType, getCertificate, listBuiltinFavicons, getBuiltinFavicon, uploadFavicon, imageToIco, reconnectHyperdriveDaemon () { return hyperDaemon.setup() }, executeShellWindowCommand, toggleSiteInfo, toggleLiveReloading, setWindowDimensions, setWindowDragModeEnabled, moveWindow, maximizeWindow, toggleWindowMaximized, minimizeWindow, closeWindow, resizeSiteInfo, refreshTabState, spawnAndExecuteJs, showOpenDialog, showContextMenu, async showModal (name, opts) { return modals.create(this.sender, name, opts) }, newWindow, newPane, gotoUrl, getPageUrl, refreshPage, focusPage, executeJavaScriptInPage, injectCssInPage, uninjectCssInPage, openUrl: (url, opts) => { openUrl(url, opts) }, // dont return anything openFolder, doWebcontentsCmd, doTest, closeModal: () => {}, // DEPRECATED, probably safe to remove soon } export function fetchBody (url) { return new Promise((resolve) => { var http = url.startsWith('https') ? require('https') : require('http') http.get(url, (res) => { var body = '' res.setEncoding('utf8') res.on('data', (data) => { body += data }) res.on('end', () => resolve(body)) }) }) } export async function downloadURL (url) { this.sender.downloadURL(url) } export async function convertDat (url) { var win = findWebContentsParentWindow(this.sender) var key = await datDns.resolveName(url) var driveUrl = await convertDatArchive(win, key) tabManager.create(win, driveUrl, {setActive: true}) } export function getResourceContentType (url) { let i = url.indexOf('#') if (i !== -1) url = url.slice(0, i) // strip the fragment return resourceContentTypes.get(url) } export async function getCertificate (url) { try { let urlp = new URL(url) url = urlp.protocol + '//' + urlp.hostname + '/' } catch (e) {} var cert = originCerts.get(url) if (cert) { return Object.assign({type: 'tls'}, cert) } else if (url.startsWith('beaker:')) { return {type: 'beaker'} } else if (url.startsWith('hyper://')) { let ident = await getDriveIdent(url, true) return {type: 'hyperdrive', ident} } } export async function listBuiltinFavicons ({filter, offset, limit} = {}) { if (filter) { filter = new RegExp(filter, 'i') } // list files in assets/favicons and filter on the name var dir = jetpack.cwd(__dirname).cwd('assets/favicons') var items = (await dir.listAsync()) .filter(filename => { if (filter && !filter.test(filename)) { return false } return filename.endsWith('.ico') }) return items.slice(offset || 0, limit || Number.POSITIVE_INFINITY) } export async function getBuiltinFavicon (name) { var dir = jetpack.cwd(__dirname).cwd('assets/favicons') return dir.readAsync(name, 'buffer') } export async function uploadFavicon () { let favicon = dialog.showOpenDialogSync({ title: 'Upload Favicon...', defaultPath: app.getPath('home'), buttonLabel: 'Upload Favicon', filters: [ { name: 'Images', extensions: ['png', 'ico', 'jpg'] } ], properties: ['openFile'] }) if (!favicon) return let faviconBuffer = await jetpack.readAsync(favicon[0], 'buffer') let extension = path.extname(favicon[0]) if (extension === '.png') { return toIco(faviconBuffer, {resize: true}) } if (extension === '.jpg') { let imageToPng = nativeImage.createFromBuffer(faviconBuffer).toPNG() return toIco(imageToPng, {resize: true}) } if (extension === '.ico' && ICO.isICO(faviconBuffer)) { return faviconBuffer } } export async function imageToIco (image) { // TODO expand on this function to be png/jpg to ico let imageToPng = nativeImage.createFromDataURL(image).toPNG() return toIco(imageToPng, {resize: true}) } async function executeShellWindowCommand (...args) { var win = findWebContentsParentWindow(this.sender) if (!win) return win.webContents.send('command', ...args) } async function toggleSiteInfo (override) { var win = findWebContentsParentWindow(this.sender) if (override === true) { siteInfo.show(win) } else if (override === false) { siteInfo.hide(win) } else { siteInfo.toggle(win) } } export async function toggleLiveReloading (enabled) { var win = findWebContentsParentWindow(this.sender) tabManager.getActive(win).toggleLiveReloading(enabled) } export async function setWindowDimensions ({width, height} = {}) { var win = findWebContentsParentWindow(this.sender) var [currentWidth, currentHeight] = win.getSize() width = width || currentWidth height = height || currentHeight win.setSize(width, height) } var _windowDragInterval = undefined export async function setWindowDragModeEnabled (enabled) { var win = findWebContentsParentWindow(this.sender) if (enabled) { if (_windowDragInterval) return // poll the mouse cursor every 15ms var lastPt = screen.getCursorScreenPoint() _windowDragInterval = setInterval(() => { var newPt = screen.getCursorScreenPoint() // if the mouse has moved, move the window accordingly var delta = {x: newPt.x - lastPt.x, y: newPt.y - lastPt.y} if (delta.x || delta.y) { var pos = win.getPosition() win.setPosition(pos[0] + delta.x, pos[1] + delta.y) lastPt = newPt } // if the mouse has moved out of the window, stop var bounds = win.getBounds() if (newPt.x < bounds.x || newPt.y < bounds.y || newPt.x > (bounds.x + bounds.width) || newPt.y > (bounds.y + bounds.height)) { clearInterval(_windowDragInterval) _windowDragInterval = undefined } }, 15) } else { // stop the poll if (!_windowDragInterval) return clearInterval(_windowDragInterval) _windowDragInterval = undefined } } export async function moveWindow (x, y) { var win = findWebContentsParentWindow(this.sender) var pos = win.getPosition() win.setPosition(pos[0] + x, pos[1] + y) } export async function maximizeWindow () { var win = findWebContentsParentWindow(this.sender) win.maximize() } async function toggleWindowMaximized () { var win = findWebContentsParentWindow(this.sender) if (win.isMaximized()) { win.unmaximize() } else { win.maximize() } } async function minimizeWindow () { var win = findWebContentsParentWindow(this.sender) win.minimize() } async function closeWindow () { var win = findWebContentsParentWindow(this.sender) win.close() } export function resizeSiteInfo (bounds) { var win = findWebContentsParentWindow(this.sender) if (!win) return siteInfo.resize(win, bounds) } export async function refreshTabState () { var win = findWebContentsParentWindow(this.sender) if (!win) return var tab = tabManager.getActive(win) if (!tab) return await tab.refreshState() } export function setStartPageBackgroundImage (srcPath, appendCurrentDir) { if (appendCurrentDir) { srcPath = path.join(__dirname, `/${srcPath}`) } var destPath = path.join(app.getPath('userData'), 'start-background-image') return new Promise((resolve) => { if (srcPath) { fs.readFile(srcPath, (_, data) => { fs.writeFile(destPath, data, () => resolve()) }) } else { fs.unlink(destPath, () => resolve()) } }) } export async function getDefaultProtocolSettings () { if (IS_LINUX) { // HACK // xdb-settings doesnt currently handle apps that you can't `which` // we can just use xdg-mime directly instead // see path_to_url // -prf let [httpHandler, hyperHandler, datHandler] = await Promise.all([ // If there is no default specified, be sure to catch any error // from exec and return '' otherwise Promise.all errors out. exec('xdg-mime query default "x-scheme-handler/http"').catch(err => ''), exec('xdg-mime query default "x-scheme-handler/hyper"').catch(err => ''), exec('xdg-mime query default "x-scheme-handler/dat"').catch(err => '') ]) if (httpHandler && httpHandler.stdout) httpHandler = httpHandler.stdout if (hyperHandler && hyperHandler.stdout) hyperHandler = hyperHandler.stdout if (datHandler && datHandler.stdout) datHandler = datHandler.stdout return { http: (httpHandler || '').toString().trim() === DOT_DESKTOP_FILENAME, hyper: (hyperHandler || '').toString().trim() === DOT_DESKTOP_FILENAME, dat: (datHandler || '').toString().trim() === DOT_DESKTOP_FILENAME } } return Promise.resolve(['http', 'hyper', 'dat'].reduce((res, x) => { res[x] = app.isDefaultProtocolClient(x) return res }, {})) } export async function setAsDefaultProtocolClient (protocol) { if (IS_LINUX) { // HACK // xdb-settings doesnt currently handle apps that you can't `which` // we can just use xdg-mime directly instead // see path_to_url // -prf await exec(`xdg-mime default ${DOT_DESKTOP_FILENAME} "x-scheme-handler/${protocol}"`) return true } return Promise.resolve(app.setAsDefaultProtocolClient(protocol)) } export function removeAsDefaultProtocolClient (protocol) { return Promise.resolve(app.removeAsDefaultProtocolClient(protocol)) } export function getInfo () { return { version: app.getVersion(), electronVersion: process.versions.electron, chromiumVersion: process.versions.chrome, nodeVersion: process.versions.node, platform: os.platform(), updater: { isBrowserUpdatesSupported, error: updaterError, state: updaterState }, paths: { userData: app.getPath('userData') }, isDaemonActive: hyperDaemon.isActive() } } export async function getDaemonStatus () { return hyperDaemon.getDaemonStatus() } export async function getDaemonNetworkStatus () { // bit of a hack, this return Array.from(hyperDaemon.getClient().drive._drives, drive => { var key = drive.drive.key.toString('hex') return { key, peers: hyperDaemon.listPeerAddresses(key) } }) } export function checkForUpdates (opts = {}) { // dont overlap if (updaterState != UPDATER_STATUS_IDLE) { return } // update global state logger.info('[AUTO-UPDATE] Checking for a new version.') updaterError = undefined setUpdaterState(UPDATER_STATUS_CHECKING) if (opts.prerelease) { logger.info('[AUTO-UPDATE] Jumping to pre-releases.') autoUpdater.allowPrerelease = true } autoUpdater.checkForUpdates() // just return a resolve; results will be emitted return Promise.resolve() } export function restartBrowser () { if (updaterState == UPDATER_STATUS_DOWNLOADED) { // run the update installer autoUpdater.quitAndInstall() logger.info('[AUTO-UPDATE] Quitting and installing.') } else { logger.info('Restarting Beaker by restartBrowser()') // do a simple restart app.relaunch() setTimeout(() => app.exit(0), 1e3) } } export function getSetting (key) { return settingsDb.get(key) } export function getSettings () { return settingsDb.getAll() } export function setSetting (key, value) { return settingsDb.set(key, value) } export function updateAdblocker () { return adblocker.setup() } export async function migrate08to09 () { await bookmarks.migrateBookmarksFromSqlite() } const SCROLLBAR_WIDTH = 16 export async function capturePage (url, opts = {}) { var width = opts.width || 1024 var height = opts.height || 768 var win = new BrowserWindow({ width: width + SCROLLBAR_WIDTH, height, show: false, webPreferences: { preload: 'file://' + path.join(app.getAppPath(), 'fg', 'webview-preload', 'index.build.js'), contextIsolation: true, webviewTag: false, sandbox: true, defaultEncoding: 'utf-8', nativeWindowOpen: true, nodeIntegration: false, navigateOnDragDrop: true, enableRemoteModule: false } }) win.loadURL(url) // wait for load await new Promise((resolve, reject) => { win.webContents.on('did-finish-load', resolve) }) await new Promise(r => setTimeout(r, 200)) // give an extra 200ms for rendering // capture the page var image = await win.webContents.capturePage({x: 0, y: 0, width, height}) // resize if asked if (opts.resizeTo) { image = image.resize(opts.resizeTo) } return image } // rpc methods // = function createEventsStream () { return emitStream(browserEvents) } async function showOpenDialog (opts = {}) { var wc = this.sender var res = await dialog.showOpenDialog({ title: opts.title, buttonLabel: opts.buttonLabel, filters: opts.filters, properties: opts.properties, defaultPath: opts.defaultPath }) wc.focus() // return focus back to the the page return res.filePaths } function showContextMenu (menuDefinition) { var webContents = this.sender var tab = tabManager.findTab(webContents) return new Promise(resolve => { var cursorPos = screen.getCursorScreenPoint() // add a click item to all menu items menuDefinition = massageItems(menuDefinition) function massageItems (items) { return items.map(item => { if (item.id && item.id.startsWith('builtin:')) { let id = item.id.slice('builtin:'.length) let opts = {webContents, tab, x: cursorPos.x, y: cursorPos.y} if (shouldShowContextMenuItem(id, opts)) { return createContextMenuItem(id, opts) } return false } else if (item.type === 'submenu' && Array.isArray(item.submenu)) { item.submenu = massageItems(item.submenu) } else if (item.type !== 'separator' && item.id) { item.click = clickHandler } return item }).filter(Boolean) } // track the selection var selection function clickHandler (item) { selection = item.id } // show the menu var win = findWebContentsParentWindow(this.sender) var menu = Menu.buildFromTemplate(menuDefinition) menu.popup({window: win, callback () { resolve(selection) }}) }) } async function newWindow (state = {}) { windows.createShellWindow(state) } async function newPane (url, opts = {}) { var tab = tabManager.findTab(this.sender) var pane = tab && tab.findPane(this.sender) if (tab && pane) { if (opts.replaceSameOrigin) { let existingPane = tab.findPaneByOrigin(url) if (existingPane) { existingPane.loadURL(url) return } } tab.createPane({url, setActive: true, after: pane, splitDir: opts.splitDir || 'vert'}) } } async function gotoUrl (url) { getSenderTab(this.sender).loadURL(url) } async function getPageUrl () { return getSenderTab(this.sender).url } async function refreshPage () { getSenderTab(this.sender).webContents.reload() } async function focusPage () { getSenderTab(this.sender).focus() } async function executeJavaScriptInPage (js) { return getSenderTab(this.sender).webContents.executeJavaScript(js, true) .catch(err => { if (err.toString().includes('Script failed to execute')) { throw "Injected script failed to execute" } throw err }) } async function injectCssInPage (css) { return getSenderTab(this.sender).webContents.insertCSS(css) } async function uninjectCssInPage (key) { return getSenderTab(this.sender).webContents.removeInsertedCSS(key) } function openFolder (folderPath) { shell.openExternal('file://' + folderPath) } async function doWebcontentsCmd (method, wcId, ...args) { var wc = webContents.fromId(+wcId) if (!wc) throw new Error(`WebContents not found (${wcId})`) return wc[method](...args) } async function doTest (test) { } // internal methods // = function getSenderTab (sender) { let tab = tabManager.findTab(sender) if (tab) return tab var win = findWebContentsParentWindow(sender) return tabManager.getActive(win) } function setUpdaterState (state) { updaterState = state browserEvents.emit('updater-state-changed', {state}) } function getAutoUpdaterFeedSettings () { return { provider: 'github', repo: 'beaker', owner: 'beakerbrowser', vPrefixedTagName: false } } // run a daily check for new updates function scheduledAutoUpdate () { settingsDb.get('auto_update_enabled').then(v => { // if auto updates are enabled, run the check if (+v === 1) { checkForUpdates() } // schedule next check setTimeout(scheduledAutoUpdate, SCHEDULED_AUTO_UPDATE_DELAY) }) } // event handlers // = function onUpdateAvailable () { logger.info('[AUTO-UPDATE] New version available. Downloading...') autoUpdater.downloadUpdate() setUpdaterState(UPDATER_STATUS_DOWNLOADING) } function onUpdateNotAvailable () { logger.info('[AUTO-UPDATE] No browser update available.') setUpdaterState(UPDATER_STATUS_IDLE) } function onUpdateDownloaded () { logger.info('[AUTO-UPDATE] New browser version downloaded. Ready to install.') setUpdaterState(UPDATER_STATUS_DOWNLOADED) } function onUpdateError (e) { console.error(e) logger.error(`[AUTO-UPDATE] error: ${e.toString()}`) setUpdaterState(UPDATER_STATUS_IDLE) var message = (e.toString() || '').split('\n')[0] if (message.includes('[object Object]')) { message = typeof e.message === 'string' ? e.message : 'Updater failed to contact the server' } updaterError = {message} browserEvents.emit('updater-error', updaterError) } function onWebContentsCreated (e, webContents) { webContents.on('will-prevent-unload', onWillPreventUnload) webContents.on('remote-require', e => { // do not allow e.preventDefault() }) webContents.on('remote-get-global', e => { // do not allow e.preventDefault() }) } function onWillPreventUnload (e) { var choice = dialog.showMessageBoxSync({ type: 'question', buttons: ['Leave', 'Stay'], title: 'Do you want to leave this site?', message: 'Changes you made may not be saved.', defaultId: 0, cancelId: 1 }) var leave = (choice === 0) if (leave) { e.preventDefault() } } function onCompleted (details) { wcTrust.onWebRequestCompleted(details) function set (v) { resourceContentTypes.set(details.url, Array.isArray(v) ? v[0] : v) } if (!details.responseHeaders) return if ('Content-Type' in details.responseHeaders) { set(details.responseHeaders['Content-Type']) } else if ('content-type' in details.responseHeaders) { set(details.responseHeaders['content-type']) } } ```
Dardo Manuel Cabo (January 1, 1941 - c. January 6, 1977) was an Argentine journalist, activist and militant. Born in the city of Tres Arroyos, he was the son of a notable metalworkers' union leader, Armando Cabo. Dardo Cabo started political activism in the Movimiento Nacionalista Tacuara (MNT), a far-right youth group of the 1960s. Just like several other members of the MNT, he progressively embraced Peronism, and created in 1961 the Movimiento Nueva Argentina, a Peronist right-wing organization. Dardo Cabo came to be famous when he hijacked, together with other militants, an Aerolíneas Argentinas' plane on September 28, 1966, and diverted it towards the Malvina Islands [Falkland Islands], where he planted the Argentinian flag, during the so-called 1966 Aerolineas Argentinas DC-4 hijacking Operation Condor. He was then sentenced to three years in prison for this feat, and married there. Once freed, Dardo Cabo became the leader of the organization Descamisados, which later merged with Montoneros, a left-wing Peronist organization group,which become allied with the Fuerzas Armadas Revolucionarias (Revolutionary Armed Forces), a "guevarista" (Che Guevara) organization (FAR-Montoneros). He was then arrested during the brutal of the military junta commanded by dictator Jorge Rafael Videla's [National Reorganization Processjunta], because of his political activities, and finally executed in 1977 alongside Roberto Rufino Pirles and other five prisoners. See also Dirty War Peronism Movimiento Nacionalista Tacuara References 1941 births 1977 deaths Argentine journalists Argentine male journalists Deaths by firearm in Argentina Hijackers People killed in the Dirty War People murdered in Argentina Place of birth missing People from Buenos Aires Province 20th-century journalists
```freemarker closeCommentingDefaultMessage = Kommentarsfldet r avstngt fr den hr artikeln. disableCommentingDefaultMessage = Kommentarsfldet r avstngt fr den hr artikeln. reaction-labelRespect = Gilla reaction-labelActiveRespected = Gillad reaction-sortLabelMostRespected = Mest gillad comment-count = <span class="{ $textClass }">{ $number -> [one] kommentar *[other] kommentarer }</span> comment-counts-ratings-and-reviews = <span class="{ $textClass }">{ $number -> [one] Omdme *[other] Omdmen }</span> staff-label = Redaktr dsaReportCSV-timestamp = Tidsstmpel (UTC) dsaReportCSV-user = Anvndare dsaReportCSV-action = tgrd dsaReportCSV-details = Detaljer dsaReportCSV-reportSubmitted = Rapport inskickad dsaReportCSV-referenceID = Referens-ID dsaReportCSV-legalDetail = Juridiska detaljer dsaReportCSV-additionalInfo = Ytterligare information dsaReportCSV-commentAuthor = Kommentarens frfattare dsaReportCSV-commentBody = Kommentarens innehll dsaReportCSV-commentID = Kommentar-ID dsaReportCSV-commentMediaUrl = Kommentarens media-URL dsaReportCSV-changedStatus = ndrad status dsaReportCSV-addedNote = Tillagd anteckning dsaReportCSV-madeDecision = Beslut fattat dsaReportCSV-downloadedReport = Rapport nerladdad dsaReportCSV-legality-illegal = Legalitet: Olagligt dsaReportCSV-legality-legal = Legalitet: Lagligt dsaReportCSV-legalGrounds = Juridiska grunder dsaReportCSV-explanation = Frklaring dsaReportCSV-status-awaitingReview = Vntar p granskning dsaReportCSV-status-inReview = Under granskning dsaReportCSV-status-completed = Avslutad dsaReportCSV-status-void = Ogiltig dsaReportCSV-anonymousUser = Anonym anvndare dsaReportCSV-usernameNotAvailable = Anvndarnamn inte tillgngligt # Notifikationer notifications-illegalContentReportReviewed-title = Din rapport om olagligt innehll har granskats notifications-illegalContentReportReviewed-decision-legal = verkar inte innehlla olagligt innehll notifications-illegalContentReportReviewed-decision-illegal = innehller olagligt innehll notifications-illegalContentReportReviewed-description = Den { $date } rapporterade du en kommentar skriven av { $author } fr att innehlla olagligt innehll. Efter att ha granskat din rapport har vrt modereringsteam beslutat att denna kommentar { $decision }. notifications-commentRejected-title = Din kommentar har avvisats och tagits bort frn vr webbplats notifications-commentRejected-description = Vra moderatorer har granskat din kommentar och bestmt att din kommentar innehller innehll som bryter mot vra communityriktlinjer eller anvndarvillkor. <br/> { $details } notifications-commentRejected-details-illegalContent = <b>ORSAK TILL BORTTAGNING</b><br/> <descriptItem>{ $reason }</descriptItem><br/> <b>JURIDISKA GRUNDER</b><br/> { $grounds }<br/> <b>YTTERLIGARE FRKLARING</b><br/> { $explanation } notifications-commentRejected-details-general = <b>ORSAK TILL BORTTAGNING</b><br/> { $reason }<br/> <b>YTTERLIGARE FRKLARING</b><br/> { $explanation } notification-reasonForRemoval-offensive = Sttande notification-reasonForRemoval-abusive = Krnkande notification-reasonForRemoval-spam = Spam notification-reasonForRemoval-bannedWord = Frbjudet ord notification-reasonForRemoval-ad = Annons notification-reasonForRemoval-other = Annat notification-reasonForRemoval-illegal = Olagligt innehll notification-reasonForRemoval-unknown = Oknt notifications-commentRejected-details-notFound = Detaljer fr detta avslag kan inte hittas. # Notifikationer (gamla) notifications-commentWasFeatured-title = Kommentaren blev utvald notifications-commentWasFeatured-body = Kommentaren { $commentID } blev utvald. notifications-commentWasApproved-title = Kommentaren godkndes notifications-commentWasApproved-body = Kommentaren { $commentID } godkndes. notifications-commentWasRejected-title = Kommentaren avvisades notifications-commentWasRejected-body = Kommentaren { $commentID } avvisades. notifications-commentWasRejectedWithReason-code = <br/> { $code } notifications-commentWasRejectedWithReason-grounds = <br/> { $grounds } notifications-commentWasRejectedWithReason-explanation = <br/> { $explanation } notifications-commentWasRejectedWithReason-body = Kommentaren { $commentID } avvisades. Anledningarna till detta var: { $code } { $grounds } { $explanation } notifications-commentWasRejectedAndIllegal-title = Kommentaren bedmdes innehlla olagligt innehll och avvisades notifications-commentWasRejectedAndIllegal-body = Kommentaren { $commentID } avvisades fr att den innehll olagligt innehll. Anledningen till detta var: <br/> { $reason } notifications-dsaIllegalRejectedReason-information = Grunder: <br/> { $grounds } <br/> Frklaring: <br/> { $explanation } notifications-dsaIllegalRejectedReason-informationNotFound = Anledningen till detta beslut kan inte hittas. notifications-dsaReportDecisionMade-title = Ett beslut fattades om din DSA-rapport notifications-dsaReportDecision-legal = Rapporten { $reportID } bedmdes vara laglig. notifications-dsaReportDecision-illegal = Rapporten { $reportID } bedmdes vara olaglig. notifications-dsaReportDecision-legalInformation = Grunder: <br/> { $grounds } <br/> Frklaring: <br/> { $explanation } notifications-dsaReportDecisionMade-body-withoutInfo = { $decision } notifications-dsaReportDecisionMade-body-withInfo = { $decision } <br/> { $information } common-accountDeleted = Anvndarkontot raderades. ```
Paspalum plicatulum is a species of grass known by the common name brownseed paspalum. In Brazil its names include capim coquerinho, felpudo and pasto-negro. It is called zong zi que bai in Chinese and herbe à cheval in French. In South America its names include camalote, gamelotillo, and hierba de cepa. It is native to the Americas, where it occurs in the southeastern United States, Mexico, the Caribbean, and parts of South America. This rhizomatous perennial grass has thick stems which can exceed in height. The leaf blades are up to long. The inflorescence is a panicle with up to 7 branches. The paired spikelets are generally oval in shape and are brown in color. In its native range this grass grows in disturbed areas as well as prairies and forests. It is planted in many areas of the world to feed livestock. The seeds provide food for birds. It is used as a pasture grass and it can be made into hay. It can be grown on low-fertility soils. Cultivars include 'Bryan', 'Hartley', and 'Rodd's Bay'. References External links USDA Plants Profile NatureServe plicatulum
```java /* * * * path_to_url * * Unless required by applicable law or agreed to in writing, * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * specific language governing permissions and limitations */ package io.ballerina.identifier; import org.apache.commons.text.StringEscapeUtils; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * Identifier encoder to encode user defined identifiers with special characters. * * @since 2.0.0 */ public class Utils { private static final String UNICODE_REGEX = "\\\\(\\\\*)u\\{([a-fA-F0-9]+)\\}"; public static final Pattern UNICODE_PATTERN = Pattern.compile(UNICODE_REGEX); private static final String CHAR_PREFIX = "&"; private static final String ESCAPE_PREFIX = "\\"; private static final Pattern UNESCAPED_SPECIAL_CHAR_SET = Pattern.compile("([$&+,:;=\\?@#\\\\|/'\\ \\[\\}\\]<\\>" + ".\"^*{}~`()%!-])"); private static final String GENERATED_METHOD_PREFIX = "$gen$"; private Utils() { } private static String encodeSpecialCharacters(String identifier) { StringBuilder sb = new StringBuilder(); int index = 0; while (index < identifier.length()) { String formattedString; if (identifier.charAt(index) == '\\' && (index + 1 < identifier.length()) && (formattedString = getFormattedStringForQuotedIdentifiers(identifier.charAt(index + 1))) != null) { String unicodePoint = CHAR_PREFIX + formattedString; sb.append(unicodePoint); index += 2; } else { sb.append(identifier.charAt(index)); index++; } } return sb.toString(); } /** * Escape the special characters in an identifier with a preceding `\`. * * @param identifier encoded identifier string * @return decoded identifier */ public static String escapeSpecialCharacters(String identifier) { return UNESCAPED_SPECIAL_CHAR_SET.matcher(identifier).replaceAll("\\\\$1"); } private static String encodeIdentifier(String identifier) { if (identifier.contains(ESCAPE_PREFIX)) { identifier = encodeSpecialCharacters(identifier); return unescapeJava(identifier); } return identifier; } /** * <p>Unescapes any Java literals found in the {@code String}. * For example, it will turn a sequence of {@code '\'} and * {@code 'n'} into a newline character, unless the {@code '\'} * is preceded by another {@code '\'}.</p> * * @param str the {@code String} to unescape, may be null * @return a new unescaped {@code String}, {@code null} if null string input */ public static String unescapeJava(String str) { return StringEscapeUtils.unescapeJava(str); } private static Identifier encodeGeneratedName(String identifier) { StringBuilder sb = new StringBuilder(); boolean isEncoded = false; int index = 0; while (index < identifier.length()) { String formattedString = getFormattedStringForJvmReservedSet(identifier.charAt(index)); if (formattedString != null) { String unicodePoint = CHAR_PREFIX + formattedString; sb.append(unicodePoint); isEncoded = true; } else { sb.append(identifier.charAt(index)); } index++; } return new Identifier(sb.toString(), isEncoded); } private static String getFormattedStringForQuotedIdentifiers(char c) { if (c == '$') { return "0036"; } return getFormattedStringForJvmReservedSet(c); } private static String getFormattedStringForJvmReservedSet(char c) { switch (c) { case '\\': return "0092"; case '.': return "0046"; case ':': return "0058"; case ';': return "0059"; case '[': return "0091"; case ']': return "0093"; case '/': return "0047"; case '<': return "0060"; case '>': return "0062"; default: return null; } } /** * Decode the encoded identifiers for runtime calls. * * @param encodedIdentifier encoded identifier string * @return decoded identifier */ public static String decodeIdentifier(String encodedIdentifier) { if (encodedIdentifier == null) { return encodedIdentifier; } StringBuilder sb = new StringBuilder(); int index = 0; while (index < encodedIdentifier.length()) { if (encodedIdentifier.charAt(index) == '&' && index + 4 < encodedIdentifier.length()) { if (isUnicodePoint(encodedIdentifier, index)) { sb.append((char) Integer.parseInt(encodedIdentifier.substring(index + 1, index + 5))); index += 5; } else { sb.append(encodedIdentifier.charAt(index)); index++; } } else { sb.append(encodedIdentifier.charAt(index)); index++; } } return decodeGeneratedMethodName(sb.toString()); } private static String decodeGeneratedMethodName(String decodedName) { return decodedName.startsWith(GENERATED_METHOD_PREFIX) ? decodedName.substring(GENERATED_METHOD_PREFIX.length()) : decodedName; } /** * Unescapes a ballerina string. * * @param text ballerina string to unescape * @return unescaped ballerina string */ public static String unescapeBallerina(String text) { return unescapeJava(Utils.unescapeUnicodeCodepoints(text)); } /** * Replace the unicode patterns in identifiers into respective unicode characters. * * @param identifier identifier string * @return modified identifier with unicode character */ public static String unescapeUnicodeCodepoints(String identifier) { Matcher matcher = UNICODE_PATTERN.matcher(identifier); StringBuffer buffer = new StringBuffer(identifier.length()); while (matcher.find()) { String leadingSlashes = matcher.group(1); if (isEscapedNumericEscape(leadingSlashes)) { // e.g. \\u{61}, \\\\u{61} continue; } int codePoint = Integer.parseInt(matcher.group(2), 16); char[] chars = Character.toChars(codePoint); String ch = String.valueOf(chars); if (ch.equals("\\")) { // Ballerina string unescaping is done in two stages. // 1. unicode code point unescaping (doing separately as [2] does not support code points > 0xFFFF) // 2. java unescaping // Replacing unicode code point of backslash at [1] would compromise [2]. Therefore, special case it. matcher.appendReplacement(buffer, Matcher.quoteReplacement(leadingSlashes + "\\u005C")); } else { matcher.appendReplacement(buffer, Matcher.quoteReplacement(leadingSlashes + ch)); } } matcher.appendTail(buffer); return String.valueOf(buffer); } /** * Returns whether the <a href="path_to_url#NumericEscape">NumericEscape</a> * is escaped, based on no. of leading backslashes. * * @param leadingSlashes preceding backslashes of the numeric escape. * e.g. {@code \\u{61}} has 1 leading backslash. * @return {@code true} if numeric escape is escaped, {@code false} otherwise. */ public static boolean isEscapedNumericEscape(String leadingSlashes) { return !isEven(leadingSlashes.length()); } private static boolean isEven(int n) { // (n & 1) is 0 when n is even. return (n & 1) == 0; } private static boolean isUnicodePoint(String encodedName, int index) { return (containsOnlyDigits(encodedName.substring(index + 1, index + 5))); } private static boolean containsOnlyDigits(String digitString) { for (int i = 0; i < digitString.length(); i++) { if (!Character.isDigit(digitString.charAt(i))) { return false; } } return true; } /** * Encode the function identifiers to avoid using jvm reserved characters. * * @param functionName function identifier string * @return encoded identifier */ public static String encodeFunctionIdentifier(String functionName) { functionName = encodeIdentifier(functionName); switch (functionName) { case ".<init>": return "$gen$&0046&0060init&0062"; case ".<start>": return "$gen$&0046&0060start&0062"; case ".<stop>": return "$gen$&0046&0060stop&0062"; case ".<testinit>": return "$gen$&0046&0060testinit&0062"; } Identifier encodedName = encodeGeneratedName(functionName); return encodedName.isEncoded ? GENERATED_METHOD_PREFIX + encodedName.name : functionName; } /** * Encode the non-function identifiers to avoid using jvm reserved characters. * * @param identifierString non-function identifier string * @return encoded identifier */ public static String encodeNonFunctionIdentifier(String identifierString) { identifierString = encodeIdentifier(identifierString); Identifier encodedName = encodeGeneratedName(identifierString); return encodedName.name; } private static class Identifier { boolean isEncoded; String name; Identifier(String name, boolean isEncoded) { this.name = name; this.isEncoded = isEncoded; } } } ```
```html <!doctype html> <html> <head> <meta charset="utf-8" /> <title>Baidu Maps</title> <style> html { height: 100% } body { height: 100%; margin: 0; padding: 0; background-color: #FFF } </style> <script charset="utf-8" src="path_to_url"></script> <script> var map, geocoder; function initialize() { map = new BMap.Map('map_canvas'); var point = new BMap.Point(121.473704, 31.230393); map.centerAndZoom(point, 11); map.addControl(new BMap.NavigationControl()); map.enableScrollWheelZoom(); var gc = new BMap.Geocoder(); gc.getLocation(point, function(rs){ var addComp = rs.addressComponents; var address = [addComp.city].join(''); parent.document.getElementById("kindeditor_plugin_map_address").value = address; }); } function search(address) { if (!map) return; var local = new BMap.LocalSearch(map, { renderOptions: { map: map, autoViewport: true, selectFirstResult: false } }); local.search(address); } </script> </head> <body onload="initialize();"> <div id="map_canvas" style="width:100%; height:100%"></div> </body> </html> ```
```javascript /* * * * 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 */ import Ember from 'ember'; export default Ember.Route.extend({ notifications: Ember.inject.service('notification-messages'), beforeModel: function(transition){ this.workflowid = transition.queryParams.workflowid; }, model(){ this.workflows = this.store.queryRecord('workflow',{workflowid: this.get("workflowid")}); return this.workflows; }, actions: { error(error, transition) { if (error.errors[0].status == 404) { return this.transitionTo('not-found', { queryParams: {'previous': window.location.href}}); } else { this.get('notifications').error('Uh-oh! Something went wrong..', { autoClear: true }); return; } } } }); ```
```c++ // // file LICENSE_1_0.txt or copy at path_to_url #include <boost/config.hpp> #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES #include <boost/detail/lightweight_test.hpp> #include <boost/thread/future.hpp> #include <boost/utility/result_of.hpp> #include <functional> struct async_func { virtual ~async_func() { } virtual void run() =0; }; template <typename Ret> class async_func_pt : public async_func { boost::packaged_task<Ret> f; public: void run() { std::cout << __FILE__ << ":" << __LINE__ << std::endl; f(); } async_func_pt (boost::packaged_task<Ret>&& f) : f(boost::move(f)) {} ~async_func_pt() { } boost::unique_future<Ret> get_future() { return f.get_future(); } }; void async_core (async_func* p) { std::cout << __FILE__ << ":" << __LINE__ << std::endl; p->run(); } template <typename F> boost::unique_future<typename boost::result_of< F() >::type> async (F&& f) { std::cout << __FILE__ << ":" << __LINE__ << std::endl; typedef typename boost::result_of< F() >::type RetType; std::cout << __FILE__ << ":" << __LINE__ << std::endl; async_func_pt<RetType>* p= new async_func_pt<RetType> (boost::packaged_task<RetType>(boost::forward<F>(f))); std::cout << __FILE__ << ":" << __LINE__ << std::endl; boost::unique_future<RetType> future_result= p->get_future(); std::cout << __FILE__ << ":" << __LINE__ << std::endl; async_core (p); std::cout << __FILE__ << ":" << __LINE__ << std::endl; return boost::move(future_result); } template <typename F, typename A1> boost::unique_future<typename boost::result_of< F(A1) >::type> async (F&& f, A1&& a1) { std::cout << __FILE__ << ":" << __LINE__ << std::endl; // This should be all it needs. But get a funny error deep inside Boost. // problem overloading with && ? return async (boost::bind(f,a1)); } int calculate_the_answer_to_life_the_universe_and_everything() { return 42; } size_t foo (const std::string& s) { return s.size(); } void test1() { // this one works // most fundimental form: std::cout << __FILE__ << ":" << __LINE__ << std::endl; boost::unique_future<int> fi= async (&calculate_the_answer_to_life_the_universe_and_everything); int i= fi.get(); BOOST_TEST (i== 42); // This one chokes at compile time std::cout << __FILE__ << ":" << __LINE__ << std::endl; boost::unique_future<size_t> fut_1= async (&foo, "Life"); BOOST_TEST (fut_1.get()== 4); } int main() { test1(); return boost::report_errors(); } #else int main() { return 0; } #endif /* * "/Users/viboes/clang/llvmCore-3.0-rc1.install/bin/clang++" -o "../../../bin.v2/libs/thread/test/test_ml.test/clang-darwin-3.0x/debug/threading-multi/test_ml" "../../../bin.v2/libs/thread/test/test_ml.test/clang-darwin-3.0x/debug/threading-multi/test_ml.o" "../../../bin.v2/libs/test/build/clang-darwin-3.0x/debug/link-static/threading-multi/libboost_unit_test_framework.a" "../../../bin.v2/libs/thread/build/clang-darwin-3.0x/debug/threading-multi/libboost_thread.dylib" "../../../bin.v2/libs/chrono/build/clang-darwin-3.0x/debug/threading-multi/libboost_chrono.dylib" "../../../bin.v2/libs/system/build/clang-darwin-3.0x/debug/threading-multi/libboost_system.dylib" -g */ /* * * #include <boost/test/unit_test.hpp> #include <boost/thread/future.hpp> #include <boost/utility/result_of.hpp> #include <functional> struct async_func { virtual ~async_func() { } virtual void run() =0; }; template <typename Ret> class async_func_pt : public async_func { boost::packaged_task<Ret> f; public: void run() override { f(); } async_func_pt (boost::packaged_task<Ret>&& f) : f(std::move(f)) {} ~async_func_pt() { } boost::unique_future<Ret> get_future() { return f.get_future(); } }; void async_core (async_func* p); template <typename F> boost::unique_future<typename boost::result_of< F() >::type> async (F&& f) { typedef typename boost::result_of< F() >::type RetType; async_func_pt<RetType>* p= new async_func_pt<RetType> (boost::packaged_task<RetType>(f)); boost::unique_future<RetType> future_result= p->get_future(); async_core (p); return std::move(future_result); } template <typename F, typename A1> boost::unique_future<typename boost::result_of< F(A1) >::type> async (F&& f, A1&& a1) { // This should be all it needs. But get a funny error deep inside Boost. // problem overloading with && ? return async (std::tr1::bind(f,a1)); } BOOST_AUTO_TEST_SUITE(thread_pool_tests) int calculate_the_answer_to_life_the_universe_and_everything() { return 42; } size_t foo (const std::string& s) { return s.size(); } BOOST_AUTO_TEST_CASE( async_test ) { // this one works // most fundimental form: boost::unique_future<int> fi= async (&calculate_the_answer_to_life_the_universe_and_everything); int i= fi.get(); BOOST_CHECK_EQUAL (i, 42); // This one chokes at compile time boost::unique_future<size_t> fut_1= async (&foo, "Life"); BOOST_CHECK_EQUAL (fut_1.get(), 4); } BOOST_AUTO_TEST_SUITE_END() */ ```
Goldeneye, also sometimes called Goldeneye: The Secret Life of Ian Fleming, is a British television film of 1989 about the life of the author Ian Fleming, directed by Don Boyd. The film is based on The Life of Ian Fleming (1966), a biography by John Pearson, who was Fleming's assistant in the 1950s and has access to his private papers. The film's screenwriter, Reg Gadney, also has a small part as James Bond, the American ornithologist who lent his name to Fleming's eponymous spy. Cast Charles Dance as Ian Fleming Phyllis Logan as Ann Fleming Patrick Ryecart as Ivar Bryce Marsha Fitzalan as Loelia Ed Devereaux as Sir William Stephenson Julian Fellowes as Noël Coward Lynsey Baxter as Wren Lieutenant Donald Hewlett as Admiral Godfrey Richard Griffiths as Second Admiral Joseph Long as Lucky Luciano Donald Douglas as Lord Kemsley David Quilter as Lord Rothermere Freda Dowie as Harley Street doctor Christoph Waltz as German spy Lisa Daniely as Wren Captain Reg Gadney as James Bond Steve Plytas as Dragoumis Kim Kindersley as Royal Navy Lieutenant Deborah Moore as Secretary Philip O'Brien as CBS Interviewer Notes External links 1989 films Works about Ian Fleming 1980s English-language films
The China–Peru Free Trade Agreement () is a bilateral free trade agreement designed to eliminate obstacles to trade and investment between China and Peru. The two sides concluded talks in November 2008 and signed the agreement in April 2009. The agreement was officially ratified by both countries governments on December 6, 2009, and came into effect on March 1, 2010. The idea of such a trade agreement was first formally proposed by the Peruvian Minister of Trade, Mercedes Aráoz, to her Chinese counterpart, Bo Xilai, on November 18, 2006, during the 2006 APEC summit. In February 2007, both ministers agreed to the realization of a feasibility study, which was successfully completed six months later. On September 7, 2007, during the 2007 APEC summit, the presidents of China, Hu Jintao, and Peru, Alan García announced the formal start of negotiations. The first round of negotiations was carried out in Lima between January 20 and January 23, 2008; the second round took place in Beijing between March 3 and March 7 of the same year. The third round was carried out in May, also in Beijing. On November 19, 2008, President Alan Garcia announced that both sides have concluded trade pact talks and that the deal would be signed in the coming months. China is the second most important trade partner for Peru; as of 2006, it accounted for 9.6% of Peruvian exports and 10.3% of Peruvian imports for a trade volume of $US5.5 billion in 2007 On the other hand, Chinese investments are still small; as of 2006 companies headquartered in the People's Republic of China accounted for only 1.5% of foreign direct investment in Peru. Under the agreement, 10 percent of Peruvian products such as textiles, clothing and shoes were excluded from the deal, while only 1 percent of Chinese products — wood and tobacco — were left out, said Eduardo Ferreyros, Peruvian foreign trade vice minister. The proposed China — Peru trade agreement has drawn criticism in Peru from some economic sectors that feel threatened by Chinese competition; this is the case of the textile industry which claims that the low wages paid by their Chinese counterparts represent an unfair advantage. As an alternative, these sectors have proposed the exclusion of products such as textiles from the agreement or long periods to phase out tariffs on them. See also Economy of China Economy of Peru Bibliography References External links China's Free Trade Agreements > China-Peru FTA - Ministry of Commerce, People's Republic of China Tratado de Libre Comercio Perú - China Peruvian Government site on the agreement. Foreign trade of Peru Trade blocs Free trade agreements of China Treaties concluded in 2008 Treaties of Peru Treaties entered into force in 2010 Treaties of the People's Republic of China 2010 in economics
```c++ //===- FunctionImport.cpp - ThinLTO Summary-based Function Import ---------===// // // See path_to_url for license information. // //===your_sha256_hash------===// // // This file implements Function import based on summaries. // //===your_sha256_hash------===// #include "llvm/Transforms/IPO/FunctionImport.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SetVector.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/Statistic.h" #include "llvm/ADT/StringMap.h" #include "llvm/ADT/StringRef.h" #include "llvm/ADT/StringSet.h" #include "llvm/Bitcode/BitcodeReader.h" #include "llvm/IR/AutoUpgrade.h" #include "llvm/IR/Constants.h" #include "llvm/IR/Function.h" #include "llvm/IR/GlobalAlias.h" #include "llvm/IR/GlobalObject.h" #include "llvm/IR/GlobalValue.h" #include "llvm/IR/GlobalVariable.h" #include "llvm/IR/Metadata.h" #include "llvm/IR/Module.h" #include "llvm/IR/ModuleSummaryIndex.h" #include "llvm/IRReader/IRReader.h" #include "llvm/InitializePasses.h" #include "llvm/Linker/IRMover.h" #include "llvm/Object/ModuleSymbolTable.h" #include "llvm/Object/SymbolicFile.h" #include "llvm/Pass.h" #include "llvm/Support/Casting.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" #include "llvm/Support/Error.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/FileSystem.h" #include "llvm/Support/SourceMgr.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Transforms/IPO/Internalize.h" #include "llvm/Transforms/Utils/Cloning.h" #include "llvm/Transforms/Utils/FunctionImportUtils.h" #include "llvm/Transforms/Utils/ValueMapper.h" #include <cassert> #include <memory> #include <set> #include <string> #include <system_error> #include <tuple> #include <utility> using namespace llvm; #define DEBUG_TYPE "function-import" STATISTIC(NumImportedFunctionsThinLink, "Number of functions thin link decided to import"); STATISTIC(NumImportedHotFunctionsThinLink, "Number of hot functions thin link decided to import"); STATISTIC(NumImportedCriticalFunctionsThinLink, "Number of critical functions thin link decided to import"); STATISTIC(NumImportedGlobalVarsThinLink, "Number of global variables thin link decided to import"); STATISTIC(NumImportedFunctions, "Number of functions imported in backend"); STATISTIC(NumImportedGlobalVars, "Number of global variables imported in backend"); STATISTIC(NumImportedModules, "Number of modules imported from"); STATISTIC(NumDeadSymbols, "Number of dead stripped symbols in index"); STATISTIC(NumLiveSymbols, "Number of live symbols in index"); /// Limit on instruction count of imported functions. static cl::opt<unsigned> ImportInstrLimit( "import-instr-limit", cl::init(100), cl::Hidden, cl::value_desc("N"), cl::desc("Only import functions with less than N instructions")); static cl::opt<int> ImportCutoff( "import-cutoff", cl::init(-1), cl::Hidden, cl::value_desc("N"), cl::desc("Only import first N functions if N>=0 (default -1)")); static cl::opt<float> ImportInstrFactor("import-instr-evolution-factor", cl::init(0.7), cl::Hidden, cl::value_desc("x"), cl::desc("As we import functions, multiply the " "`import-instr-limit` threshold by this factor " "before processing newly imported functions")); static cl::opt<float> ImportHotInstrFactor( "import-hot-evolution-factor", cl::init(1.0), cl::Hidden, cl::value_desc("x"), cl::desc("As we import functions called from hot callsite, multiply the " "`import-instr-limit` threshold by this factor " "before processing newly imported functions")); static cl::opt<float> ImportHotMultiplier( "import-hot-multiplier", cl::init(10.0), cl::Hidden, cl::value_desc("x"), cl::desc("Multiply the `import-instr-limit` threshold for hot callsites")); static cl::opt<float> ImportCriticalMultiplier( "import-critical-multiplier", cl::init(100.0), cl::Hidden, cl::value_desc("x"), cl::desc( "Multiply the `import-instr-limit` threshold for critical callsites")); // FIXME: This multiplier was not really tuned up. static cl::opt<float> ImportColdMultiplier( "import-cold-multiplier", cl::init(0), cl::Hidden, cl::value_desc("N"), cl::desc("Multiply the `import-instr-limit` threshold for cold callsites")); static cl::opt<bool> PrintImports("print-imports", cl::init(false), cl::Hidden, cl::desc("Print imported functions")); static cl::opt<bool> PrintImportFailures( "print-import-failures", cl::init(false), cl::Hidden, cl::desc("Print information for functions rejected for importing")); static cl::opt<bool> ComputeDead("compute-dead", cl::init(true), cl::Hidden, cl::desc("Compute dead symbols")); static cl::opt<bool> EnableImportMetadata( "enable-import-metadata", cl::init( #if !defined(NDEBUG) true /*Enabled with asserts.*/ #else false #endif ), cl::Hidden, cl::desc("Enable import metadata like 'thinlto_src_module'")); /// Summary file to use for function importing when using -function-import from /// the command line. static cl::opt<std::string> SummaryFile("summary-file", cl::desc("The summary file to use for function importing.")); /// Used when testing importing from distributed indexes via opt // -function-import. static cl::opt<bool> ImportAllIndex("import-all-index", cl::desc("Import all external functions in index.")); // Load lazily a module from \p FileName in \p Context. static std::unique_ptr<Module> loadFile(const std::string &FileName, LLVMContext &Context) { SMDiagnostic Err; LLVM_DEBUG(dbgs() << "Loading '" << FileName << "'\n"); // Metadata isn't loaded until functions are imported, to minimize // the memory overhead. std::unique_ptr<Module> Result = getLazyIRFileModule(FileName, Err, Context, /* ShouldLazyLoadMetadata = */ true); if (!Result) { Err.print("function-import", errs()); report_fatal_error("Abort"); } return Result; } /// Given a list of possible callee implementation for a call site, select one /// that fits the \p Threshold. /// /// FIXME: select "best" instead of first that fits. But what is "best"? /// - The smallest: more likely to be inlined. /// - The one with the least outgoing edges (already well optimized). /// - One from a module already being imported from in order to reduce the /// number of source modules parsed/linked. /// - One that has PGO data attached. /// - [insert you fancy metric here] static const GlobalValueSummary * selectCallee(const ModuleSummaryIndex &Index, ArrayRef<std::unique_ptr<GlobalValueSummary>> CalleeSummaryList, unsigned Threshold, StringRef CallerModulePath, FunctionImporter::ImportFailureReason &Reason, GlobalValue::GUID GUID) { Reason = FunctionImporter::ImportFailureReason::None; auto It = llvm::find_if( CalleeSummaryList, [&](const std::unique_ptr<GlobalValueSummary> &SummaryPtr) { auto *GVSummary = SummaryPtr.get(); if (!Index.isGlobalValueLive(GVSummary)) { Reason = FunctionImporter::ImportFailureReason::NotLive; return false; } // For SamplePGO, in computeImportForFunction the OriginalId // may have been used to locate the callee summary list (See // comment there). // The mapping from OriginalId to GUID may return a GUID // that corresponds to a static variable. Filter it out here. // This can happen when // 1) There is a call to a library function which is not defined // in the index. // 2) There is a static variable with the OriginalGUID identical // to the GUID of the library function in 1); // When this happens, the logic for SamplePGO kicks in and // the static variable in 2) will be found, which needs to be // filtered out. if (GVSummary->getSummaryKind() == GlobalValueSummary::GlobalVarKind) { Reason = FunctionImporter::ImportFailureReason::GlobalVar; return false; } if (GlobalValue::isInterposableLinkage(GVSummary->linkage())) { Reason = FunctionImporter::ImportFailureReason::InterposableLinkage; // There is no point in importing these, we can't inline them return false; } auto *Summary = cast<FunctionSummary>(GVSummary->getBaseObject()); // If this is a local function, make sure we import the copy // in the caller's module. The only time a local function can // share an entry in the index is if there is a local with the same name // in another module that had the same source file name (in a different // directory), where each was compiled in their own directory so there // was not distinguishing path. // However, do the import from another module if there is only one // entry in the list - in that case this must be a reference due // to indirect call profile data, since a function pointer can point to // a local in another module. if (GlobalValue::isLocalLinkage(Summary->linkage()) && CalleeSummaryList.size() > 1 && Summary->modulePath() != CallerModulePath) { Reason = FunctionImporter::ImportFailureReason::LocalLinkageNotInModule; return false; } if ((Summary->instCount() > Threshold) && !Summary->fflags().AlwaysInline) { Reason = FunctionImporter::ImportFailureReason::TooLarge; return false; } // Skip if it isn't legal to import (e.g. may reference unpromotable // locals). if (Summary->notEligibleToImport()) { Reason = FunctionImporter::ImportFailureReason::NotEligible; return false; } // Don't bother importing if we can't inline it anyway. if (Summary->fflags().NoInline) { Reason = FunctionImporter::ImportFailureReason::NoInline; return false; } return true; }); if (It == CalleeSummaryList.end()) return nullptr; return cast<GlobalValueSummary>(It->get()); } namespace { using EdgeInfo = std::tuple<const FunctionSummary *, unsigned /* Threshold */, GlobalValue::GUID>; } // anonymous namespace static ValueInfo updateValueInfoForIndirectCalls(const ModuleSummaryIndex &Index, ValueInfo VI) { if (!VI.getSummaryList().empty()) return VI; // For SamplePGO, the indirect call targets for local functions will // have its original name annotated in profile. We try to find the // corresponding PGOFuncName as the GUID. // FIXME: Consider updating the edges in the graph after building // it, rather than needing to perform this mapping on each walk. auto GUID = Index.getGUIDFromOriginalID(VI.getGUID()); if (GUID == 0) return ValueInfo(); return Index.getValueInfo(GUID); } static void computeImportForReferencedGlobals( const FunctionSummary &Summary, const ModuleSummaryIndex &Index, const GVSummaryMapTy &DefinedGVSummaries, FunctionImporter::ImportMapTy &ImportList, StringMap<FunctionImporter::ExportSetTy> *ExportLists) { for (auto &VI : Summary.refs()) { if (DefinedGVSummaries.count(VI.getGUID())) { LLVM_DEBUG( dbgs() << "Ref ignored! Target already in destination module.\n"); continue; } LLVM_DEBUG(dbgs() << " ref -> " << VI << "\n"); // If this is a local variable, make sure we import the copy // in the caller's module. The only time a local variable can // share an entry in the index is if there is a local with the same name // in another module that had the same source file name (in a different // directory), where each was compiled in their own directory so there // was not distinguishing path. auto LocalNotInModule = [&](const GlobalValueSummary *RefSummary) -> bool { return GlobalValue::isLocalLinkage(RefSummary->linkage()) && RefSummary->modulePath() != Summary.modulePath(); }; auto MarkExported = [&](const ValueInfo &VI, const GlobalValueSummary *S) { if (ExportLists) (*ExportLists)[S->modulePath()].insert(VI); }; for (auto &RefSummary : VI.getSummaryList()) if (isa<GlobalVarSummary>(RefSummary.get()) && Index.canImportGlobalVar(RefSummary.get(), /* AnalyzeRefs */ true) && !LocalNotInModule(RefSummary.get())) { auto ILI = ImportList[RefSummary->modulePath()].insert(VI.getGUID()); // Only update stat if we haven't already imported this variable. if (ILI.second) NumImportedGlobalVarsThinLink++; MarkExported(VI, RefSummary.get()); // Promote referenced functions and variables. We don't promote // objects referenced by writeonly variable initializer, because // we convert such variables initializers to "zeroinitializer". // See processGlobalForThinLTO. if (!Index.isWriteOnly(cast<GlobalVarSummary>(RefSummary.get()))) for (const auto &VI : RefSummary->refs()) for (const auto &RefFn : VI.getSummaryList()) MarkExported(VI, RefFn.get()); break; } } } static const char * getFailureName(FunctionImporter::ImportFailureReason Reason) { switch (Reason) { case FunctionImporter::ImportFailureReason::None: return "None"; case FunctionImporter::ImportFailureReason::GlobalVar: return "GlobalVar"; case FunctionImporter::ImportFailureReason::NotLive: return "NotLive"; case FunctionImporter::ImportFailureReason::TooLarge: return "TooLarge"; case FunctionImporter::ImportFailureReason::InterposableLinkage: return "InterposableLinkage"; case FunctionImporter::ImportFailureReason::LocalLinkageNotInModule: return "LocalLinkageNotInModule"; case FunctionImporter::ImportFailureReason::NotEligible: return "NotEligible"; case FunctionImporter::ImportFailureReason::NoInline: return "NoInline"; } llvm_unreachable("invalid reason"); } /// Compute the list of functions to import for a given caller. Mark these /// imported functions and the symbols they reference in their source module as /// exported from their source module. static void computeImportForFunction( const FunctionSummary &Summary, const ModuleSummaryIndex &Index, const unsigned Threshold, const GVSummaryMapTy &DefinedGVSummaries, SmallVectorImpl<EdgeInfo> &Worklist, FunctionImporter::ImportMapTy &ImportList, StringMap<FunctionImporter::ExportSetTy> *ExportLists, FunctionImporter::ImportThresholdsTy &ImportThresholds) { computeImportForReferencedGlobals(Summary, Index, DefinedGVSummaries, ImportList, ExportLists); static int ImportCount = 0; for (auto &Edge : Summary.calls()) { ValueInfo VI = Edge.first; LLVM_DEBUG(dbgs() << " edge -> " << VI << " Threshold:" << Threshold << "\n"); if (ImportCutoff >= 0 && ImportCount >= ImportCutoff) { LLVM_DEBUG(dbgs() << "ignored! import-cutoff value of " << ImportCutoff << " reached.\n"); continue; } VI = updateValueInfoForIndirectCalls(Index, VI); if (!VI) continue; if (DefinedGVSummaries.count(VI.getGUID())) { LLVM_DEBUG(dbgs() << "ignored! Target already in destination module.\n"); continue; } auto GetBonusMultiplier = [](CalleeInfo::HotnessType Hotness) -> float { if (Hotness == CalleeInfo::HotnessType::Hot) return ImportHotMultiplier; if (Hotness == CalleeInfo::HotnessType::Cold) return ImportColdMultiplier; if (Hotness == CalleeInfo::HotnessType::Critical) return ImportCriticalMultiplier; return 1.0; }; const auto NewThreshold = Threshold * GetBonusMultiplier(Edge.second.getHotness()); auto IT = ImportThresholds.insert(std::make_pair( VI.getGUID(), std::make_tuple(NewThreshold, nullptr, nullptr))); bool PreviouslyVisited = !IT.second; auto &ProcessedThreshold = std::get<0>(IT.first->second); auto &CalleeSummary = std::get<1>(IT.first->second); auto &FailureInfo = std::get<2>(IT.first->second); bool IsHotCallsite = Edge.second.getHotness() == CalleeInfo::HotnessType::Hot; bool IsCriticalCallsite = Edge.second.getHotness() == CalleeInfo::HotnessType::Critical; const FunctionSummary *ResolvedCalleeSummary = nullptr; if (CalleeSummary) { assert(PreviouslyVisited); // Since the traversal of the call graph is DFS, we can revisit a function // a second time with a higher threshold. In this case, it is added back // to the worklist with the new threshold (so that its own callee chains // can be considered with the higher threshold). if (NewThreshold <= ProcessedThreshold) { LLVM_DEBUG( dbgs() << "ignored! Target was already imported with Threshold " << ProcessedThreshold << "\n"); continue; } // Update with new larger threshold. ProcessedThreshold = NewThreshold; ResolvedCalleeSummary = cast<FunctionSummary>(CalleeSummary); } else { // If we already rejected importing a callee at the same or higher // threshold, don't waste time calling selectCallee. if (PreviouslyVisited && NewThreshold <= ProcessedThreshold) { LLVM_DEBUG( dbgs() << "ignored! Target was already rejected with Threshold " << ProcessedThreshold << "\n"); if (PrintImportFailures) { assert(FailureInfo && "Expected FailureInfo for previously rejected candidate"); FailureInfo->Attempts++; } continue; } FunctionImporter::ImportFailureReason Reason; CalleeSummary = selectCallee(Index, VI.getSummaryList(), NewThreshold, Summary.modulePath(), Reason, VI.getGUID()); if (!CalleeSummary) { // Update with new larger threshold if this was a retry (otherwise // we would have already inserted with NewThreshold above). Also // update failure info if requested. if (PreviouslyVisited) { ProcessedThreshold = NewThreshold; if (PrintImportFailures) { assert(FailureInfo && "Expected FailureInfo for previously rejected candidate"); FailureInfo->Reason = Reason; FailureInfo->Attempts++; FailureInfo->MaxHotness = std::max(FailureInfo->MaxHotness, Edge.second.getHotness()); } } else if (PrintImportFailures) { assert(!FailureInfo && "Expected no FailureInfo for newly rejected candidate"); FailureInfo = std::make_unique<FunctionImporter::ImportFailureInfo>( VI, Edge.second.getHotness(), Reason, 1); } LLVM_DEBUG( dbgs() << "ignored! No qualifying callee with summary found.\n"); continue; } // "Resolve" the summary CalleeSummary = CalleeSummary->getBaseObject(); ResolvedCalleeSummary = cast<FunctionSummary>(CalleeSummary); assert((ResolvedCalleeSummary->fflags().AlwaysInline || (ResolvedCalleeSummary->instCount() <= NewThreshold)) && "selectCallee() didn't honor the threshold"); auto ExportModulePath = ResolvedCalleeSummary->modulePath(); auto ILI = ImportList[ExportModulePath].insert(VI.getGUID()); // We previously decided to import this GUID definition if it was already // inserted in the set of imports from the exporting module. bool PreviouslyImported = !ILI.second; if (!PreviouslyImported) { NumImportedFunctionsThinLink++; if (IsHotCallsite) NumImportedHotFunctionsThinLink++; if (IsCriticalCallsite) NumImportedCriticalFunctionsThinLink++; } // Make exports in the source module. if (ExportLists) { auto &ExportList = (*ExportLists)[ExportModulePath]; ExportList.insert(VI); if (!PreviouslyImported) { // This is the first time this function was exported from its source // module, so mark all functions and globals it references as exported // to the outside if they are defined in the same source module. // For efficiency, we unconditionally add all the referenced GUIDs // to the ExportList for this module, and will prune out any not // defined in the module later in a single pass. for (auto &Edge : ResolvedCalleeSummary->calls()) ExportList.insert(Edge.first); for (auto &Ref : ResolvedCalleeSummary->refs()) ExportList.insert(Ref); } } } auto GetAdjustedThreshold = [](unsigned Threshold, bool IsHotCallsite) { // Adjust the threshold for next level of imported functions. // The threshold is different for hot callsites because we can then // inline chains of hot calls. if (IsHotCallsite) return Threshold * ImportHotInstrFactor; return Threshold * ImportInstrFactor; }; const auto AdjThreshold = GetAdjustedThreshold(Threshold, IsHotCallsite); ImportCount++; // Insert the newly imported function to the worklist. Worklist.emplace_back(ResolvedCalleeSummary, AdjThreshold, VI.getGUID()); } } /// Given the list of globals defined in a module, compute the list of imports /// as well as the list of "exports", i.e. the list of symbols referenced from /// another module (that may require promotion). static void ComputeImportForModule( const GVSummaryMapTy &DefinedGVSummaries, const ModuleSummaryIndex &Index, StringRef ModName, FunctionImporter::ImportMapTy &ImportList, StringMap<FunctionImporter::ExportSetTy> *ExportLists = nullptr) { // Worklist contains the list of function imported in this module, for which // we will analyse the callees and may import further down the callgraph. SmallVector<EdgeInfo, 128> Worklist; FunctionImporter::ImportThresholdsTy ImportThresholds; // Populate the worklist with the import for the functions in the current // module for (auto &GVSummary : DefinedGVSummaries) { #ifndef NDEBUG // FIXME: Change the GVSummaryMapTy to hold ValueInfo instead of GUID // so this map look up (and possibly others) can be avoided. auto VI = Index.getValueInfo(GVSummary.first); #endif if (!Index.isGlobalValueLive(GVSummary.second)) { LLVM_DEBUG(dbgs() << "Ignores Dead GUID: " << VI << "\n"); continue; } auto *FuncSummary = dyn_cast<FunctionSummary>(GVSummary.second->getBaseObject()); if (!FuncSummary) // Skip import for global variables continue; LLVM_DEBUG(dbgs() << "Initialize import for " << VI << "\n"); computeImportForFunction(*FuncSummary, Index, ImportInstrLimit, DefinedGVSummaries, Worklist, ImportList, ExportLists, ImportThresholds); } // Process the newly imported functions and add callees to the worklist. while (!Worklist.empty()) { auto FuncInfo = Worklist.pop_back_val(); auto *Summary = std::get<0>(FuncInfo); auto Threshold = std::get<1>(FuncInfo); computeImportForFunction(*Summary, Index, Threshold, DefinedGVSummaries, Worklist, ImportList, ExportLists, ImportThresholds); } // Print stats about functions considered but rejected for importing // when requested. if (PrintImportFailures) { dbgs() << "Missed imports into module " << ModName << "\n"; for (auto &I : ImportThresholds) { auto &ProcessedThreshold = std::get<0>(I.second); auto &CalleeSummary = std::get<1>(I.second); auto &FailureInfo = std::get<2>(I.second); if (CalleeSummary) continue; // We are going to import. assert(FailureInfo); FunctionSummary *FS = nullptr; if (!FailureInfo->VI.getSummaryList().empty()) FS = dyn_cast<FunctionSummary>( FailureInfo->VI.getSummaryList()[0]->getBaseObject()); dbgs() << FailureInfo->VI << ": Reason = " << getFailureName(FailureInfo->Reason) << ", Threshold = " << ProcessedThreshold << ", Size = " << (FS ? (int)FS->instCount() : -1) << ", MaxHotness = " << getHotnessName(FailureInfo->MaxHotness) << ", Attempts = " << FailureInfo->Attempts << "\n"; } } } #ifndef NDEBUG static bool isGlobalVarSummary(const ModuleSummaryIndex &Index, ValueInfo VI) { auto SL = VI.getSummaryList(); return SL.empty() ? false : SL[0]->getSummaryKind() == GlobalValueSummary::GlobalVarKind; } static bool isGlobalVarSummary(const ModuleSummaryIndex &Index, GlobalValue::GUID G) { if (const auto &VI = Index.getValueInfo(G)) return isGlobalVarSummary(Index, VI); return false; } template <class T> static unsigned numGlobalVarSummaries(const ModuleSummaryIndex &Index, T &Cont) { unsigned NumGVS = 0; for (auto &V : Cont) if (isGlobalVarSummary(Index, V)) ++NumGVS; return NumGVS; } #endif #ifndef NDEBUG static bool checkVariableImport(const ModuleSummaryIndex &Index, StringMap<FunctionImporter::ImportMapTy> &ImportLists, StringMap<FunctionImporter::ExportSetTy> &ExportLists) { DenseSet<GlobalValue::GUID> FlattenedImports; for (auto &ImportPerModule : ImportLists) for (auto &ExportPerModule : ImportPerModule.second) FlattenedImports.insert(ExportPerModule.second.begin(), ExportPerModule.second.end()); // Checks that all GUIDs of read/writeonly vars we see in export lists // are also in the import lists. Otherwise we my face linker undefs, // because readonly and writeonly vars are internalized in their // source modules. auto IsReadOrWriteOnlyVar = [&](StringRef ModulePath, const ValueInfo &VI) { auto *GVS = dyn_cast_or_null<GlobalVarSummary>( Index.findSummaryInModule(VI, ModulePath)); return GVS && (Index.isReadOnly(GVS) || Index.isWriteOnly(GVS)); }; for (auto &ExportPerModule : ExportLists) for (auto &VI : ExportPerModule.second) if (!FlattenedImports.count(VI.getGUID()) && IsReadOrWriteOnlyVar(ExportPerModule.first(), VI)) return false; return true; } #endif /// Compute all the import and export for every module using the Index. void llvm::ComputeCrossModuleImport( const ModuleSummaryIndex &Index, const StringMap<GVSummaryMapTy> &ModuleToDefinedGVSummaries, StringMap<FunctionImporter::ImportMapTy> &ImportLists, StringMap<FunctionImporter::ExportSetTy> &ExportLists) { // For each module that has function defined, compute the import/export lists. for (auto &DefinedGVSummaries : ModuleToDefinedGVSummaries) { auto &ImportList = ImportLists[DefinedGVSummaries.first()]; LLVM_DEBUG(dbgs() << "Computing import for Module '" << DefinedGVSummaries.first() << "'\n"); ComputeImportForModule(DefinedGVSummaries.second, Index, DefinedGVSummaries.first(), ImportList, &ExportLists); } // When computing imports we added all GUIDs referenced by anything // imported from the module to its ExportList. Now we prune each ExportList // of any not defined in that module. This is more efficient than checking // while computing imports because some of the summary lists may be long // due to linkonce (comdat) copies. for (auto &ELI : ExportLists) { const auto &DefinedGVSummaries = ModuleToDefinedGVSummaries.lookup(ELI.first()); for (auto EI = ELI.second.begin(); EI != ELI.second.end();) { if (!DefinedGVSummaries.count(EI->getGUID())) ELI.second.erase(EI++); else ++EI; } } assert(checkVariableImport(Index, ImportLists, ExportLists)); #ifndef NDEBUG LLVM_DEBUG(dbgs() << "Import/Export lists for " << ImportLists.size() << " modules:\n"); for (auto &ModuleImports : ImportLists) { auto ModName = ModuleImports.first(); auto &Exports = ExportLists[ModName]; unsigned NumGVS = numGlobalVarSummaries(Index, Exports); LLVM_DEBUG(dbgs() << "* Module " << ModName << " exports " << Exports.size() - NumGVS << " functions and " << NumGVS << " vars. Imports from " << ModuleImports.second.size() << " modules.\n"); for (auto &Src : ModuleImports.second) { auto SrcModName = Src.first(); unsigned NumGVSPerMod = numGlobalVarSummaries(Index, Src.second); LLVM_DEBUG(dbgs() << " - " << Src.second.size() - NumGVSPerMod << " functions imported from " << SrcModName << "\n"); LLVM_DEBUG(dbgs() << " - " << NumGVSPerMod << " global vars imported from " << SrcModName << "\n"); } } #endif } #ifndef NDEBUG static void dumpImportListForModule(const ModuleSummaryIndex &Index, StringRef ModulePath, FunctionImporter::ImportMapTy &ImportList) { LLVM_DEBUG(dbgs() << "* Module " << ModulePath << " imports from " << ImportList.size() << " modules.\n"); for (auto &Src : ImportList) { auto SrcModName = Src.first(); unsigned NumGVSPerMod = numGlobalVarSummaries(Index, Src.second); LLVM_DEBUG(dbgs() << " - " << Src.second.size() - NumGVSPerMod << " functions imported from " << SrcModName << "\n"); LLVM_DEBUG(dbgs() << " - " << NumGVSPerMod << " vars imported from " << SrcModName << "\n"); } } #endif /// Compute all the imports for the given module in the Index. void llvm::ComputeCrossModuleImportForModule( StringRef ModulePath, const ModuleSummaryIndex &Index, FunctionImporter::ImportMapTy &ImportList) { // Collect the list of functions this module defines. // GUID -> Summary GVSummaryMapTy FunctionSummaryMap; Index.collectDefinedFunctionsForModule(ModulePath, FunctionSummaryMap); // Compute the import list for this module. LLVM_DEBUG(dbgs() << "Computing import for Module '" << ModulePath << "'\n"); ComputeImportForModule(FunctionSummaryMap, Index, ModulePath, ImportList); #ifndef NDEBUG dumpImportListForModule(Index, ModulePath, ImportList); #endif } // Mark all external summaries in Index for import into the given module. // Used for distributed builds using a distributed index. void llvm::ComputeCrossModuleImportForModuleFromIndex( StringRef ModulePath, const ModuleSummaryIndex &Index, FunctionImporter::ImportMapTy &ImportList) { for (auto &GlobalList : Index) { // Ignore entries for undefined references. if (GlobalList.second.SummaryList.empty()) continue; auto GUID = GlobalList.first; assert(GlobalList.second.SummaryList.size() == 1 && "Expected individual combined index to have one summary per GUID"); auto &Summary = GlobalList.second.SummaryList[0]; // Skip the summaries for the importing module. These are included to // e.g. record required linkage changes. if (Summary->modulePath() == ModulePath) continue; // Add an entry to provoke importing by thinBackend. ImportList[Summary->modulePath()].insert(GUID); } #ifndef NDEBUG dumpImportListForModule(Index, ModulePath, ImportList); #endif } void llvm::computeDeadSymbols( ModuleSummaryIndex &Index, const DenseSet<GlobalValue::GUID> &GUIDPreservedSymbols, function_ref<PrevailingType(GlobalValue::GUID)> isPrevailing) { assert(!Index.withGlobalValueDeadStripping()); if (!ComputeDead) return; if (GUIDPreservedSymbols.empty()) // Don't do anything when nothing is live, this is friendly with tests. return; unsigned LiveSymbols = 0; SmallVector<ValueInfo, 128> Worklist; Worklist.reserve(GUIDPreservedSymbols.size() * 2); for (auto GUID : GUIDPreservedSymbols) { ValueInfo VI = Index.getValueInfo(GUID); if (!VI) continue; for (auto &S : VI.getSummaryList()) S->setLive(true); } // Add values flagged in the index as live roots to the worklist. for (const auto &Entry : Index) { auto VI = Index.getValueInfo(Entry); for (auto &S : Entry.second.SummaryList) if (S->isLive()) { LLVM_DEBUG(dbgs() << "Live root: " << VI << "\n"); Worklist.push_back(VI); ++LiveSymbols; break; } } // Make value live and add it to the worklist if it was not live before. auto visit = [&](ValueInfo VI, bool IsAliasee) { // FIXME: If we knew which edges were created for indirect call profiles, // we could skip them here. Any that are live should be reached via // other edges, e.g. reference edges. Otherwise, using a profile collected // on a slightly different binary might provoke preserving, importing // and ultimately promoting calls to functions not linked into this // binary, which increases the binary size unnecessarily. Note that // if this code changes, the importer needs to change so that edges // to functions marked dead are skipped. VI = updateValueInfoForIndirectCalls(Index, VI); if (!VI) return; if (llvm::any_of(VI.getSummaryList(), [](const std::unique_ptr<llvm::GlobalValueSummary> &S) { return S->isLive(); })) return; // We only keep live symbols that are known to be non-prevailing if any are // available_externally, linkonceodr, weakodr. Those symbols are discarded // later in the EliminateAvailableExternally pass and setting them to // not-live could break downstreams users of liveness information (PR36483) // or limit optimization opportunities. if (isPrevailing(VI.getGUID()) == PrevailingType::No) { bool KeepAliveLinkage = false; bool Interposable = false; for (auto &S : VI.getSummaryList()) { if (S->linkage() == GlobalValue::AvailableExternallyLinkage || S->linkage() == GlobalValue::WeakODRLinkage || S->linkage() == GlobalValue::LinkOnceODRLinkage) KeepAliveLinkage = true; else if (GlobalValue::isInterposableLinkage(S->linkage())) Interposable = true; } if (!IsAliasee) { if (!KeepAliveLinkage) return; if (Interposable) report_fatal_error( "Interposable and available_externally/linkonce_odr/weak_odr " "symbol"); } } for (auto &S : VI.getSummaryList()) S->setLive(true); ++LiveSymbols; Worklist.push_back(VI); }; while (!Worklist.empty()) { auto VI = Worklist.pop_back_val(); for (auto &Summary : VI.getSummaryList()) { if (auto *AS = dyn_cast<AliasSummary>(Summary.get())) { // If this is an alias, visit the aliasee VI to ensure that all copies // are marked live and it is added to the worklist for further // processing of its references. visit(AS->getAliaseeVI(), true); continue; } Summary->setLive(true); for (auto Ref : Summary->refs()) visit(Ref, false); if (auto *FS = dyn_cast<FunctionSummary>(Summary.get())) for (auto Call : FS->calls()) visit(Call.first, false); } } Index.setWithGlobalValueDeadStripping(); unsigned DeadSymbols = Index.size() - LiveSymbols; LLVM_DEBUG(dbgs() << LiveSymbols << " symbols Live, and " << DeadSymbols << " symbols Dead \n"); NumDeadSymbols += DeadSymbols; NumLiveSymbols += LiveSymbols; } // Compute dead symbols and propagate constants in combined index. void llvm::computeDeadSymbolsWithConstProp( ModuleSummaryIndex &Index, const DenseSet<GlobalValue::GUID> &GUIDPreservedSymbols, function_ref<PrevailingType(GlobalValue::GUID)> isPrevailing, bool ImportEnabled) { computeDeadSymbols(Index, GUIDPreservedSymbols, isPrevailing); if (ImportEnabled) Index.propagateAttributes(GUIDPreservedSymbols); } /// Compute the set of summaries needed for a ThinLTO backend compilation of /// \p ModulePath. void llvm::gatherImportedSummariesForModule( StringRef ModulePath, const StringMap<GVSummaryMapTy> &ModuleToDefinedGVSummaries, const FunctionImporter::ImportMapTy &ImportList, std::map<std::string, GVSummaryMapTy> &ModuleToSummariesForIndex) { // Include all summaries from the importing module. ModuleToSummariesForIndex[ModulePath] = ModuleToDefinedGVSummaries.lookup(ModulePath); // Include summaries for imports. for (auto &ILI : ImportList) { auto &SummariesForIndex = ModuleToSummariesForIndex[ILI.first()]; const auto &DefinedGVSummaries = ModuleToDefinedGVSummaries.lookup(ILI.first()); for (auto &GI : ILI.second) { const auto &DS = DefinedGVSummaries.find(GI); assert(DS != DefinedGVSummaries.end() && "Expected a defined summary for imported global value"); SummariesForIndex[GI] = DS->second; } } } /// Emit the files \p ModulePath will import from into \p OutputFilename. std::error_code llvm::EmitImportsFiles( StringRef ModulePath, StringRef OutputFilename, const std::map<std::string, GVSummaryMapTy> &ModuleToSummariesForIndex) { std::error_code EC; raw_fd_ostream ImportsOS(OutputFilename, EC, sys::fs::OpenFlags::OF_None); if (EC) return EC; for (auto &ILI : ModuleToSummariesForIndex) // The ModuleToSummariesForIndex map includes an entry for the current // Module (needed for writing out the index files). We don't want to // include it in the imports file, however, so filter it out. if (ILI.first != ModulePath) ImportsOS << ILI.first << "\n"; return std::error_code(); } bool llvm::convertToDeclaration(GlobalValue &GV) { LLVM_DEBUG(dbgs() << "Converting to a declaration: `" << GV.getName() << "\n"); if (Function *F = dyn_cast<Function>(&GV)) { F->deleteBody(); F->clearMetadata(); F->setComdat(nullptr); } else if (GlobalVariable *V = dyn_cast<GlobalVariable>(&GV)) { V->setInitializer(nullptr); V->setLinkage(GlobalValue::ExternalLinkage); V->clearMetadata(); V->setComdat(nullptr); } else { GlobalValue *NewGV; if (GV.getValueType()->isFunctionTy()) NewGV = Function::Create(cast<FunctionType>(GV.getValueType()), GlobalValue::ExternalLinkage, GV.getAddressSpace(), "", GV.getParent()); else NewGV = new GlobalVariable(*GV.getParent(), GV.getValueType(), /*isConstant*/ false, GlobalValue::ExternalLinkage, /*init*/ nullptr, "", /*insertbefore*/ nullptr, GV.getThreadLocalMode(), GV.getType()->getAddressSpace()); NewGV->takeName(&GV); GV.replaceAllUsesWith(NewGV); return false; } return true; } /// Fixup prevailing symbol linkages in \p TheModule based on summary analysis. void llvm::thinLTOResolvePrevailingInModule( Module &TheModule, const GVSummaryMapTy &DefinedGlobals) { auto updateLinkage = [&](GlobalValue &GV) { // See if the global summary analysis computed a new resolved linkage. const auto &GS = DefinedGlobals.find(GV.getGUID()); if (GS == DefinedGlobals.end()) return; auto NewLinkage = GS->second->linkage(); if (NewLinkage == GV.getLinkage()) return; if (GlobalValue::isLocalLinkage(GV.getLinkage()) || // Don't internalize anything here, because the code below // lacks necessary correctness checks. Leave this job to // LLVM 'internalize' pass. GlobalValue::isLocalLinkage(NewLinkage) || // In case it was dead and already converted to declaration. GV.isDeclaration()) return; // Check for a non-prevailing def that has interposable linkage // (e.g. non-odr weak or linkonce). In that case we can't simply // convert to available_externally, since it would lose the // interposable property and possibly get inlined. Simply drop // the definition in that case. if (GlobalValue::isAvailableExternallyLinkage(NewLinkage) && GlobalValue::isInterposableLinkage(GV.getLinkage())) { if (!convertToDeclaration(GV)) // FIXME: Change this to collect replaced GVs and later erase // them from the parent module once thinLTOResolvePrevailingGUID is // changed to enable this for aliases. llvm_unreachable("Expected GV to be converted"); } else { // If all copies of the original symbol had global unnamed addr and // linkonce_odr linkage, it should be an auto hide symbol. In that case // the thin link would have marked it as CanAutoHide. Add hidden visibility // to the symbol to preserve the property. if (NewLinkage == GlobalValue::WeakODRLinkage && GS->second->canAutoHide()) { assert(GV.hasLinkOnceODRLinkage() && GV.hasGlobalUnnamedAddr()); GV.setVisibility(GlobalValue::HiddenVisibility); } LLVM_DEBUG(dbgs() << "ODR fixing up linkage for `" << GV.getName() << "` from " << GV.getLinkage() << " to " << NewLinkage << "\n"); GV.setLinkage(NewLinkage); } // Remove declarations from comdats, including available_externally // as this is a declaration for the linker, and will be dropped eventually. // It is illegal for comdats to contain declarations. auto *GO = dyn_cast_or_null<GlobalObject>(&GV); if (GO && GO->isDeclarationForLinker() && GO->hasComdat()) GO->setComdat(nullptr); }; // Process functions and global now for (auto &GV : TheModule) updateLinkage(GV); for (auto &GV : TheModule.globals()) updateLinkage(GV); for (auto &GV : TheModule.aliases()) updateLinkage(GV); } /// Run internalization on \p TheModule based on symmary analysis. void llvm::thinLTOInternalizeModule(Module &TheModule, const GVSummaryMapTy &DefinedGlobals) { // Declare a callback for the internalize pass that will ask for every // candidate GlobalValue if it can be internalized or not. auto MustPreserveGV = [&](const GlobalValue &GV) -> bool { // Lookup the linkage recorded in the summaries during global analysis. auto GS = DefinedGlobals.find(GV.getGUID()); if (GS == DefinedGlobals.end()) { // Must have been promoted (possibly conservatively). Find original // name so that we can access the correct summary and see if it can // be internalized again. // FIXME: Eventually we should control promotion instead of promoting // and internalizing again. StringRef OrigName = ModuleSummaryIndex::getOriginalNameBeforePromote(GV.getName()); std::string OrigId = GlobalValue::getGlobalIdentifier( OrigName, GlobalValue::InternalLinkage, TheModule.getSourceFileName()); GS = DefinedGlobals.find(GlobalValue::getGUID(OrigId)); if (GS == DefinedGlobals.end()) { // Also check the original non-promoted non-globalized name. In some // cases a preempted weak value is linked in as a local copy because // it is referenced by an alias (IRLinker::linkGlobalValueProto). // In that case, since it was originally not a local value, it was // recorded in the index using the original name. // FIXME: This may not be needed once PR27866 is fixed. GS = DefinedGlobals.find(GlobalValue::getGUID(OrigName)); assert(GS != DefinedGlobals.end()); } } return !GlobalValue::isLocalLinkage(GS->second->linkage()); }; // FIXME: See if we can just internalize directly here via linkage changes // based on the index, rather than invoking internalizeModule. internalizeModule(TheModule, MustPreserveGV); } /// Make alias a clone of its aliasee. static Function *replaceAliasWithAliasee(Module *SrcModule, GlobalAlias *GA) { Function *Fn = cast<Function>(GA->getBaseObject()); ValueToValueMapTy VMap; Function *NewFn = CloneFunction(Fn, VMap); // Clone should use the original alias's linkage, visibility and name, and we // ensure all uses of alias instead use the new clone (casted if necessary). NewFn->setLinkage(GA->getLinkage()); NewFn->setVisibility(GA->getVisibility()); GA->replaceAllUsesWith(ConstantExpr::getBitCast(NewFn, GA->getType())); NewFn->takeName(GA); return NewFn; } // Internalize values that we marked with specific attribute // in processGlobalForThinLTO. static void internalizeGVsAfterImport(Module &M) { for (auto &GV : M.globals()) // Skip GVs which have been converted to declarations // by dropDeadSymbols. if (!GV.isDeclaration() && GV.hasAttribute("thinlto-internalize")) { GV.setLinkage(GlobalValue::InternalLinkage); GV.setVisibility(GlobalValue::DefaultVisibility); } } // Automatically import functions in Module \p DestModule based on the summaries // index. Expected<bool> FunctionImporter::importFunctions( Module &DestModule, const FunctionImporter::ImportMapTy &ImportList) { LLVM_DEBUG(dbgs() << "Starting import for Module " << DestModule.getModuleIdentifier() << "\n"); unsigned ImportedCount = 0, ImportedGVCount = 0; IRMover Mover(DestModule); // Do the actual import of functions now, one Module at a time std::set<StringRef> ModuleNameOrderedList; for (auto &FunctionsToImportPerModule : ImportList) { ModuleNameOrderedList.insert(FunctionsToImportPerModule.first()); } for (auto &Name : ModuleNameOrderedList) { // Get the module for the import const auto &FunctionsToImportPerModule = ImportList.find(Name); assert(FunctionsToImportPerModule != ImportList.end()); Expected<std::unique_ptr<Module>> SrcModuleOrErr = ModuleLoader(Name); if (!SrcModuleOrErr) return SrcModuleOrErr.takeError(); std::unique_ptr<Module> SrcModule = std::move(*SrcModuleOrErr); assert(&DestModule.getContext() == &SrcModule->getContext() && "Context mismatch"); // If modules were created with lazy metadata loading, materialize it // now, before linking it (otherwise this will be a noop). if (Error Err = SrcModule->materializeMetadata()) return std::move(Err); auto &ImportGUIDs = FunctionsToImportPerModule->second; // Find the globals to import SetVector<GlobalValue *> GlobalsToImport; for (Function &F : *SrcModule) { if (!F.hasName()) continue; auto GUID = F.getGUID(); auto Import = ImportGUIDs.count(GUID); LLVM_DEBUG(dbgs() << (Import ? "Is" : "Not") << " importing function " << GUID << " " << F.getName() << " from " << SrcModule->getSourceFileName() << "\n"); if (Import) { if (Error Err = F.materialize()) return std::move(Err); if (EnableImportMetadata) { // Add 'thinlto_src_module' metadata for statistics and debugging. F.setMetadata( "thinlto_src_module", MDNode::get(DestModule.getContext(), {MDString::get(DestModule.getContext(), SrcModule->getSourceFileName())})); } GlobalsToImport.insert(&F); } } for (GlobalVariable &GV : SrcModule->globals()) { if (!GV.hasName()) continue; auto GUID = GV.getGUID(); auto Import = ImportGUIDs.count(GUID); LLVM_DEBUG(dbgs() << (Import ? "Is" : "Not") << " importing global " << GUID << " " << GV.getName() << " from " << SrcModule->getSourceFileName() << "\n"); if (Import) { if (Error Err = GV.materialize()) return std::move(Err); ImportedGVCount += GlobalsToImport.insert(&GV); } } for (GlobalAlias &GA : SrcModule->aliases()) { if (!GA.hasName()) continue; auto GUID = GA.getGUID(); auto Import = ImportGUIDs.count(GUID); LLVM_DEBUG(dbgs() << (Import ? "Is" : "Not") << " importing alias " << GUID << " " << GA.getName() << " from " << SrcModule->getSourceFileName() << "\n"); if (Import) { if (Error Err = GA.materialize()) return std::move(Err); // Import alias as a copy of its aliasee. GlobalObject *Base = GA.getBaseObject(); if (Error Err = Base->materialize()) return std::move(Err); auto *Fn = replaceAliasWithAliasee(SrcModule.get(), &GA); LLVM_DEBUG(dbgs() << "Is importing aliasee fn " << Base->getGUID() << " " << Base->getName() << " from " << SrcModule->getSourceFileName() << "\n"); if (EnableImportMetadata) { // Add 'thinlto_src_module' metadata for statistics and debugging. Fn->setMetadata( "thinlto_src_module", MDNode::get(DestModule.getContext(), {MDString::get(DestModule.getContext(), SrcModule->getSourceFileName())})); } GlobalsToImport.insert(Fn); } } // Upgrade debug info after we're done materializing all the globals and we // have loaded all the required metadata! UpgradeDebugInfo(*SrcModule); // Link in the specified functions. if (renameModuleForThinLTO(*SrcModule, Index, &GlobalsToImport)) return true; if (PrintImports) { for (const auto *GV : GlobalsToImport) dbgs() << DestModule.getSourceFileName() << ": Import " << GV->getName() << " from " << SrcModule->getSourceFileName() << "\n"; } if (Mover.move(std::move(SrcModule), GlobalsToImport.getArrayRef(), [](GlobalValue &, IRMover::ValueAdder) {}, /*IsPerformingImport=*/true)) report_fatal_error("Function Import: link error"); ImportedCount += GlobalsToImport.size(); NumImportedModules++; } internalizeGVsAfterImport(DestModule); NumImportedFunctions += (ImportedCount - ImportedGVCount); NumImportedGlobalVars += ImportedGVCount; LLVM_DEBUG(dbgs() << "Imported " << ImportedCount - ImportedGVCount << " functions for Module " << DestModule.getModuleIdentifier() << "\n"); LLVM_DEBUG(dbgs() << "Imported " << ImportedGVCount << " global variables for Module " << DestModule.getModuleIdentifier() << "\n"); return ImportedCount; } static bool doImportingForModule(Module &M) { if (SummaryFile.empty()) report_fatal_error("error: -function-import requires -summary-file\n"); Expected<std::unique_ptr<ModuleSummaryIndex>> IndexPtrOrErr = getModuleSummaryIndexForFile(SummaryFile); if (!IndexPtrOrErr) { logAllUnhandledErrors(IndexPtrOrErr.takeError(), errs(), "Error loading file '" + SummaryFile + "': "); return false; } std::unique_ptr<ModuleSummaryIndex> Index = std::move(*IndexPtrOrErr); // First step is collecting the import list. FunctionImporter::ImportMapTy ImportList; // If requested, simply import all functions in the index. This is used // when testing distributed backend handling via the opt tool, when // we have distributed indexes containing exactly the summaries to import. if (ImportAllIndex) ComputeCrossModuleImportForModuleFromIndex(M.getModuleIdentifier(), *Index, ImportList); else ComputeCrossModuleImportForModule(M.getModuleIdentifier(), *Index, ImportList); // Conservatively mark all internal values as promoted. This interface is // only used when doing importing via the function importing pass. The pass // is only enabled when testing importing via the 'opt' tool, which does // not do the ThinLink that would normally determine what values to promote. for (auto &I : *Index) { for (auto &S : I.second.SummaryList) { if (GlobalValue::isLocalLinkage(S->linkage())) S->setLinkage(GlobalValue::ExternalLinkage); } } // Next we need to promote to global scope and rename any local values that // are potentially exported to other modules. if (renameModuleForThinLTO(M, *Index, nullptr)) { errs() << "Error renaming module\n"; return false; } // Perform the import now. auto ModuleLoader = [&M](StringRef Identifier) { return loadFile(Identifier, M.getContext()); }; FunctionImporter Importer(*Index, ModuleLoader); Expected<bool> Result = Importer.importFunctions(M, ImportList); // FIXME: Probably need to propagate Errors through the pass manager. if (!Result) { logAllUnhandledErrors(Result.takeError(), errs(), "Error importing module: "); return false; } return *Result; } namespace { /// Pass that performs cross-module function import provided a summary file. class FunctionImportLegacyPass : public ModulePass { public: /// Pass identification, replacement for typeid static char ID; explicit FunctionImportLegacyPass() : ModulePass(ID) {} /// Specify pass name for debug output StringRef getPassName() const override { return "Function Importing"; } bool runOnModule(Module &M) override { if (skipModule(M)) return false; return doImportingForModule(M); } }; } // end anonymous namespace PreservedAnalyses FunctionImportPass::run(Module &M, ModuleAnalysisManager &AM) { if (!doImportingForModule(M)) return PreservedAnalyses::all(); return PreservedAnalyses::none(); } char FunctionImportLegacyPass::ID = 0; INITIALIZE_PASS(FunctionImportLegacyPass, "function-import", "Summary Based Function Import", false, false) namespace llvm { Pass *createFunctionImportPass() { return new FunctionImportLegacyPass(); } } // end namespace llvm ```
```python import logging import pytest from pytest_embedded import Dut STARTING_TIMERS_REGEX = r'Started timers, time since boot: (\d+) us' # name, period, next_alarm, times_started, times_fired, times_skipped, cb_exec_time TIMER_DUMP_LINE_REGEX = r'([\w-]+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)' PERIODIC_TIMER_REGEX = r'Periodic timer called, time since boot: (\d+) us' LIGHT_SLEEP_ENTER_REGEX = r'Entering light sleep for 0\.5s, time since boot: (\d+) us' LIGHT_SLEEP_EXIT_REGEX = r'Woke up from light sleep, time since boot: (\d+) us' ONE_SHOT_REGEX = r'One\-shot timer called, time since boot: (\d+) us' RESTART_REGEX = r'Restarted periodic timer with 1s period, time since boot: (\d+) us' STOP_REGEX = r'Stopped and deleted timers' INITIAL_TIMER_PERIOD = 500000 FINAL_TIMER_PERIOD = 1000000 LIGHT_SLEEP_TIME = 500000 ONE_SHOT_TIMER_PERIOD = 5000000 @pytest.mark.supported_targets @pytest.mark.temp_skip_ci(targets=['esp32c5'], reason='C5 has not supported light sleep') # TODO: [ESP32C5] IDF-8638, IDF-10308 @pytest.mark.generic @pytest.mark.parametrize( 'config', [ 'rtc', ], indirect=True ) def test_esp_timer(dut: Dut) -> None: match = dut.expect(STARTING_TIMERS_REGEX) start_time = int(match.group(1)) logging.info('Start time: {} us'.format(start_time)) match = dut.expect(TIMER_DUMP_LINE_REGEX, timeout=2) assert match.group(1).decode('utf8') == 'periodic' and int(match.group(2)) == INITIAL_TIMER_PERIOD match = dut.expect(TIMER_DUMP_LINE_REGEX, timeout=2) assert match.group(1).decode('utf8') == 'one-shot' and int(match.group(2)) == 0 for i in range(0, 5): match = dut.expect(PERIODIC_TIMER_REGEX, timeout=2) cur_time = int(match.group(1)) diff = start_time + (i + 1) * INITIAL_TIMER_PERIOD - cur_time logging.info('Callback #{}, time: {} us, diff: {} us'.format(i, cur_time, diff)) assert abs(diff) < 100 match = dut.expect(ONE_SHOT_REGEX, timeout=3) one_shot_timer_time = int(match.group(1)) diff = start_time + ONE_SHOT_TIMER_PERIOD - one_shot_timer_time logging.info('One-shot timer, time: {} us, diff: {}'.format(one_shot_timer_time, diff)) assert abs(diff) < 400 match = dut.expect(RESTART_REGEX, timeout=3) start_time = int(match.group(1)) logging.info('Timer restarted, time: {} us'.format(start_time)) for i in range(0, 5): match = dut.expect(PERIODIC_TIMER_REGEX, timeout=2) cur_time = int(match.group(1)) diff = start_time + (i + 1) * FINAL_TIMER_PERIOD - cur_time logging.info('Callback #{}, time: {} us, diff: {} us'.format(i, cur_time, diff)) assert abs(diff) < 100 match = dut.expect(LIGHT_SLEEP_ENTER_REGEX, timeout=2) sleep_enter_time = int(match.group(1)) match = dut.expect(LIGHT_SLEEP_EXIT_REGEX, timeout=2) sleep_exit_time = int(match.group(1)) sleep_time = sleep_exit_time - sleep_enter_time logging.info('Enter sleep: {}, exit sleep: {}, slept: {}'.format( sleep_enter_time, sleep_exit_time, sleep_time)) assert abs(sleep_time - LIGHT_SLEEP_TIME) < 1200 for i in range(5, 7): match = dut.expect(PERIODIC_TIMER_REGEX, timeout=2) cur_time = int(match.group(1)) diff = abs(start_time + (i + 1) * FINAL_TIMER_PERIOD - cur_time) logging.info('Callback #{}, time: {} us, diff: {} us'.format(i, cur_time, diff)) assert diff < 100 dut.expect(STOP_REGEX, timeout=2) ```
```xml <?xml version="1.0" encoding="utf-8"?> <!-- --> <LinearLayout xmlns:android="path_to_url" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <Button android:id="@+id/btn_show_or_apply" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="btn_show_or_apply"/> <Button android:id="@+id/btn_dismiss" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="btn_dismiss"/> </LinearLayout> ```
```c++ /// Source : path_to_url /// Author : liuyubobobo /// Time : 2021-12-25 #include <iostream> #include <vector> #include <map> using namespace std; /// Using Map /// Pre + Suf, more intuitive /// Time Complexity: O(n) /// Space Complexity: O(n) class Solution { public: vector<long long> getDistances(vector<int>& arr) { int n = arr.size(); map<int, vector<int>> table; for(int i = 0; i < n; i ++) table[arr[i]].push_back(i); vector<long long> res(n, 0); for(const pair<int, vector<int>>& p: table){ const vector<int>& v = p.second; vector<long long> pre(v.size(), 0); for(int i = 1; i < v.size(); i ++) pre[i] = pre[i - 1] + (long long)i * (v[i] - v[i - 1]); vector<long long> suf(v.size(), 0); for(int i = (int)suf.size() - 2; i >= 0; i --) suf[i] = suf[i + 1] + ((long long)suf.size() - 1 - i) * (v[i + 1] - v[i]); for(int i = 0; i < v.size(); i ++) res[v[i]] = pre[i] + suf[i]; } return res; } }; void print_vec(const vector<long long>& v){ for(long long e: v) cout << e << ' '; cout << '\n'; } int main() { vector<int> arr1 = {2,1,3,1,2,3,3}; print_vec(Solution().getDistances(arr1)); // 4 2 7 2 4 4 5 vector<int> arr2 = {10,5,10,10}; print_vec(Solution().getDistances(arr2)); // 5 0 3 4 return 0; } ```
```raw token data your_sha256_hash---- Port Port C-VLAN C-PRI ETH-type VLAN-type S-VLAN S-PRI S-PRI type ID POLICY your_sha256_hash---- eth 1 - 2 - Translation 1 7 - eth 2 - 2 - Translation 1 7 - your_sha256_hash---- Native VLAN : 1 Default priority: 0 Downstream mode : operation Mismatch policy : discard your_sha256_hash---- Notes: IPoE indicates IPv4-IPoE, * indicates transparent attribute of the vlan, In the Ethernet encapsulation list, the hexadecimal digits indicate the user-defined Ethernet encapsulation type ```
Nesozineus armatus is a species of beetle in the family Cerambycidae. It was described by Galileo and Martins in 1996. References Acanthoderini Beetles described in 1996
Héctor Fabio Ballesteros Vélez (born October 18, 1981 in Cali, Valle del Cauca) is a retired male weightlifter from Colombia. He won a gold medal for his native South American country at the 2003 Pan American Games, and competed at the 2004 Summer Olympics. References Profile 1981 births Living people Sportspeople from Cali Colombian male weightlifters Olympic weightlifters for Colombia Weightlifters at the 2003 Pan American Games Weightlifters at the 2004 Summer Olympics Pan American Games gold medalists for Colombia Pan American Games medalists in weightlifting Medalists at the 2003 Pan American Games 20th-century Colombian people 21st-century Colombian people
The Fourth Asian Beach Games were held in Phuket Island, Phuket Province, Thailand. The games were originally scheduled for Boracay Island, Aklan, Philippines, but was affected by the OCA's hosting changes. The games were held on the same year of the 17th Asian Games. It was the seventh time for Thailand to host an Asia level multi-sports event, after Bangkok held four Asian Games (1966, 1970, 1978 and 1998), one Asian Indoor Games (2005) and one Asian Martial Arts Games (2009). However, it was the first time that the event would not be held in Bangkok. Emblem The emblem of the 4th Asian Beach Games was driven by Phuket's very own beauty and by one of Phuket's most mesmerizing sceneries of Laem Promthep with such beauty that Phuket possesses, Phuket is also widely recognized as the Pearl of the Andaman Sea and the Southern of Thailand Paradise" where athletes, spectators and tourists could enjoy watching the ongoing game while at the same time allowing themselves to serenely sink into the spell-binding beauty of Phuket beaches and sceneries. The two palm trees standing side by side represents the coming together of athletes and of all participants from different nations and races, to unite and to participate together in the 4th Asian Beach Games. As for the middle, the Asian Beach Games is the center of this beautiful bonding between the races in which the athletes represents. The ocean waves tinted in the color of the Thai flag symbolizes the qualities in which Thailand possesses; the Thai flag swirling could be understood as a representation of the determination of the athletes in participating in the competition. Mascot “Sea turtle” is a symbol of endurance fertility, sustainability and growth. As Phuket is a home to many rare species of sea turtle, it is a chance to announce to the participants of the 4th Asian Beach Games and also to the public that Thailand pays great attention and an important role to the conservation of sea turtle. As sea turtle are amphibious creatures, living both on land and in the sea, the 4th Asian Beach Games will have both beach sports and water sports which at the same time is an excellent symbol of the relationships of the different countries in Asia. The name Sintu (), Sakorn (), Samut () shares the same meaning of water. Could be metaphorically be compared to the qualities of athletes which includes the qualities such as tolerance, tranquility, unity, acceptance, sportsmanship and friendship. Venues The 4th Asian Beach Games have 6 venues for this games. Torch relay H.M. King Bhumibol Adulyadej has graciously designated H.R.H. Crown Prince Maha Vajiralongkorn on October 23 at Amphorn Sathan Residential Hall, Dusit Palace as the Royal Representative to deliver the Royal Flame to the organizing committee for use in the 4th Asian Beach Games. Those who have granted an audience to receive the Royal Flame from H.R.H. Crown Prince Maha Vajiralongkorn were the organising committee members led by Tourism and Sports Minister Kobkarn Wattanavrangkul as the chairwoman of the organizing committee, Yuthasak Sasiprapha, president of the Olympic Committee of Thailand, Montri Chaipun, deputy governor of the Sports Authority of Thailand who also served as the SAT’s caretaker governor, and Phuket Governor Nisit Chamsomwong. Dr.Jaturaporn Na Nakhon, chairman of the Royal Flame Committee, revealed that after this the installment of the Royal Flame will be temporarily made at the SAT Office in Hua Mark. The Flame will next be transferred to Phuket on November 10. To celebrate the Games Flame, Thai people from all walks of life can join the Flame run in three different districts which comprise Kathu District on November 11, Mueang Phuket District the following day and Thalang District on November 13. Sports The 4th Asian Beach Games have 26 sports were contested in this edition of Asian Beach Games. Paragliding (4) Paramotoring (4) Aquatics Calendar Participating nations 42 out of the 45 Asian countries took part. North Korea, Saudi Arabia and Palestine did not compete. Below is a list of all the participating NOCs; the number of competitors per delegation is indicated in brackets. Medal table References External links Official website Phuket Scene - Asian Beach Games Asian Games, Beach Asian Games, Beach Asian Games, Beach Asian Games, Beach Asian Beach Games Asian Games, Beach
Shoalwater Bay Tribe is a Native American tribe in western Washington state in the United States. They are descendants of the Willapa Chinook, Lower Chehalis, and the Northern Athabaskan speaking Willapa (Kwalhioqua). The Shoalwater Bay tribe lives on the southwest coast of Washington in northwestern Pacific County, along the shores of Willapa Bay where the 2.693 km² (1.0397 sq mi) Shoalwater Bay Indian Reservation () with 70 inhabitants (2000 census) is located. The reservation is just west of Tokeland, Washington. The original language of the Shoalwater Bay Tribe, belonging to the Chinookan family of Native American languages, is extinct. References Shoalwater Bay Reservation and Off-Reservation Trust Land, Washington United States Census Bureau External links Shoalwater Bay Community Website Shoalwater Bay Tribe website American Indian reservations in Washington (state) Native American governments in Washington (state) Populated places in Pacific County, Washington Populated coastal places in Washington (state)
Charles J. Perrenot (August 22, 1859 - January 18, 1898) was a politician in Florida. He served as president of the Florida Senate. Perrenot was born August 22, 1859, in Milton, Florida. The family was French. Perrenot had family member in Texas who were involved in politics. He studied law in the office of George G. McWhorter, and in 1882 was admitted to the bar, then starting up his own practice in Milton. Perrenot was listed as a state senator representing district 1 in Santa Rosa County, Florida, in 1893. He was elected Senate President in 1897. Ernest Amos was a law clerk for him. In 1898 a lawyer Charles J. Perrenot was reported recently deceased in Milton, Florida. References Presidents of the Florida Senate 1859 births 1898 deaths Florida lawyers 19th-century American lawyers 19th-century American politicians American people of French descent People from Milton, Florida
```swift var numberList = [1, 12, 9, 17, 13, 12] slowSort(0, numberList.count-1, &numberList) print(numberList) ```
Bona Sijabat (c. 1800 – 1862) was the long-serving chief of a Batak tribe of North Sumatra. He led the tribe into the Battle of Mount Simalungun in defence of their land from Dutch settlers, which resulted in many deaths, but liberated the area from Dutch land appropriation for several decades. Early life The exact place and date of Bona's birth are unknown, but his family are said to have always lived in Samosir. His father was an influential elder of a north Sumatran village at the time of King Singamangaraja, but was killed before Bona was born. As a young tribe member, Bona was renowned for his ability in a wide variety of pursuits including typically female-oriented tasks. As a result, he gained respect as a motivated, diverse individual across his Batak tribe. Adulthood When he was still young, the tribe's chief, Sidapitu, fell seriously ill – possibly with bowel cancer. Bona cared for the chief for many months, initially attempting to cure him, and thereafter trying to ensure that he was comfortable in the final days of his life. Sidapitu had no sons, and as he was dying asked Bona to take his place as the head of the tribe. Although he was initially unwilling, other tribal elders asked him to reconsider, having observed the compassion and selflessness he had shown Sidapitu. Tribal leader Bona Sijabat became tribal chief in 1832. It was around this time that Dutch people began to enter deeper Sumatra. The locals, as well as nearby tribes, were forced from their homes and many were taken as slaves. Fierce conflict over the land resulted in much bloodshed, and a great number of slaves died from starvation and widespread disease. Bona was conflicted by the unrest in Sumatra. Although naturally passive and peace-loving, he was intensely angered by the behaviour of the Dutch, and was active in rallying fighters and leaders from several tribes to reclaim their homes. In May 1840, he led his army into a great battle, later known as the Battle of Mount Simalungun. More than 1,000 people were killed in the battle, as well as large numbers of livestock. The Dutch burned tribal villages to the ground before returning to their settlements. They did not return until many decades later, after peaceful grazing had been established in some areas of Sumatra. Following the war, Bona established groups of workers to rebuild the villages, and used his own medicinal skills to assist members of the tribes who had been injured in battle. Bona went on to father nine daughters and one son. When he died of natural causes in 1862, his son took his place as the tribe's chief. To this day, some small villages hold an annual remembrance ceremony for Bona Sijabat and the significant role he played for his people. References 1800 births 1862 deaths People from North Sumatra People of Batak descent
RPO may refer to: In society: Railway post office, a mobile post office set up in a railway car Representation of People Ordinance, a set of Bangladeshi laws related to the formation of political parties Retail Post Outlet, a Canadian postal abbreviation Revenue Protection Officer, a UK railway employee who issues penalty fares Rural Planning Organization, U.S. state based, regional-level partnerships that facilitate transportation planning for state's rural areas In automotive: Regular Production Option, an option produced by divisions of General Motors for its automobiles In academia: Recursive path ordering, a well-ordering in term rewriting (computer science) Research Performing Organisations, a term used in European science policy Revilo Pendleton Oliver, an American professor of philology In business: Recovery point objective, in business-continuity planning for computing Recruitment Process Outsourcing, a form of business-process outsourcing Regular Production Option, a General Motors standard coding system In the armed forces: Regulating Petty Officer, a rate (rank) in the Royal Navy Police RPO-A Shmel (Bumblebee), a grenade launcher produced by Russia In fiction: Ready Player One, a science-fiction dystopian novel by Ernest Cline Ready Player One (film), its film adaptation by Steven Spielberg. In music: Rochester Philharmonic Orchestra, an orchestra in New York State Royal Philharmonic Orchestra, an orchestra in London, England In entertainment: Rolie Polie Olie, a Canadian children's show on CBC Television (1998–2004) In sport: Runs per over or run rate, a measure in the game of cricket Run-pass option, an offensive scheme in American football
Būtingė (German: Butendiekshof or Budendiekshof) is a small village at the coast of the Baltic Sea in the north of Lithuania, at the border to Latvia. It belongs to Palanga City Municipality, and is situated north of the town Palanga. The village has long time belonged to Livonia, and is a part of Lithuania since 1921. The Būtingė oil terminal, a part of ORLEN Lietuva, has been in operation since 1999. The terminal is somewhat controversial because of fear of oil spills, which have occurred. Since July 2006 the Būtingė oil terminal is the only way for supplying ORLEN Lietuva (former Mažeikių Nafta) with oil, because the Russian partner state controlled Lukoil corporation has cut off the supply through the Druzhba pipeline from Russia. References Villages in Klaipėda County Oil terminals Palanga City Municipality
Gladstone is a rural locality in the local government areas of Break O'Day and Dorset in the North-east region of Tasmania. It is located about north of the town of St Helens. The 2016 census determined a population of 139 for the state suburb of Gladstone. History It was originally known as Mount Cameron; the name Gladstone was in use by 1882. The area was named for William Ewart Gladstone, Prime Minister of Great Britain. Gladstone was gazetted as a locality in 1968. Geography The Ringarooma River enters the locality from the west and flows through to the north-west. Road infrastructure The B82 route (Waterhouse Road / Gladstone Road) enters from the north-west and runs south-east to the village before exiting to the south-west. Route C843 (Carr Street / Cape Portland Road / North Ansons Road) starts at an intersection with B82 and runs east and south-east before exiting. Route C844 (a continuation of Cape Portland Road) starts at an intersection with C843 and exits to the north. Route C845 starts at an intersection with C843 and exits to the north-east. References Localities of Break O'Day Council Localities of Dorset Council (Australia) Towns in Tasmania
Reinhild may refer to: Reinhild, a saint of the 7th century Reinhild, a woman of the Middle Ages
The following is a list of Kennesaw State Owls men's basketball head coaches. There have been eight head coaches of the Owls in their 38-season history. Kennesaw State's current head coach is Antoine Pettway. He was hired as the Owls' head coach in April 2023, replacing Amir Abdur-Rahim, who left to become the head coach at South Florida. References Kennesaw State Kennesaw State Owls basketball, men's, coaches
"Come into My Room" is the debut single from British R&B singer Nathan and the first single taken from his debut album Masterpiece. The single was released on 28 February 2005 and reached #37 on the UK Singles Chart. Music video A music video to accompany the release of "Come into My Room" was first released onto YouTube on 5 March 2005 at a total length of three minutes and forty-eight seconds. Track listing "Come into My Room" (Radio Edit) "Come into My Room" (Jaimeson UKG Remix) "Come into My Room" (Skylone remix) "Come into My Room" (Vybz Kartel remix) "Come into My Room" (A cappella) "Come into My Room" (Music Video) Chart performance Release history References 2005 debut singles 2005 songs Songs written by Pete Kirtley
```xml // NOTE: this must be kept in sync with ./bench.schema, which defines // the table schema in BigQuery export interface BenchResults { branch: string; commit: string; timestamp: string; label: string; /** The time it takes to create the base sandbox without storybook */ createTime: number; /** The time it takes to install the base sandbox after it has been initialized */ generateTime: number; /** The time it takes to run `sb init` on the base sandbox */ initTime: number; /** Size of base sandbox node_modules without storybook pre-install */ createSize: number; /** Size of base sandbox node_modules without storybook post-install */ generateSize: number; /** Size of the sandbox node_modules post `sb init` */ initSize: number; /** Difference bewtween `initSize` and `generateSize` */ diffSize: number; /** Full `sb build` time */ buildTime: number; /** Size of the storybook-static directory in total */ buildSize: number; /** Size of the storybook-static/sb-addons in total */ buildSbAddonsSize: number; /** Size of the storybook-static/sb-common-assets */ buildSbCommonSize: number; /** Size of the storybook-static/sb-manager */ buildSbManagerSize: number; /** Size of storybook-static/sb-preview */ buildSbPreviewSize: number; /** Size of the `static` directory if it exists */ buildStaticSize: number; /** Total size of `sb-x` above */ buildPrebuildSize: number; /** Total size of everything else (user's stories & components & CSS & assets etc.) */ buildPreviewSize: number; /** Full `sb build` time */ testBuildTime: number; /** Size of the storybook-static directory in total */ testBuildSize: number; /** Size of the storybook-static/sb-addons in total */ testBuildSbAddonsSize: number; /** Size of the storybook-static/sb-common-assets */ testBuildSbCommonSize: number; /** Size of the storybook-static/sb-manager */ testBuildSbManagerSize: number; /** Size of storybook-static/sb-preview */ testBuildSbPreviewSize: number; /** Size of the `static` directory if it exists */ testBuildStaticSize: number; /** Total size of `sb-x` above */ testBuildPrebuildSize: number; /** Total size of everything else (user's stories & components & CSS & assets etc.) */ testBuildPreviewSize: number; /** Time to wait-on iframe.html */ devPreviewResponsive: number; /** Time to wait-on index.html */ devManagerResponsive: number; /** Time to browse to index.html and view the SB logo */ devManagerHeaderVisible: number; /** Time to browse to index.html and load the story index */ devManagerIndexVisible: number; /** * Time to browse to index.html and load iframe content and the story is rendered, for the very * first run */ devStoryVisibleUncached: number; /** Time to browse to index.html and load iframe content and the story is rendered */ devStoryVisible: number; /** Time to browse to index.html and load iframe content and the docs page is rendered */ devAutodocsVisible: number; /** Time to browse to index.html and load iframe content and the MDX page is rendered */ devMDXVisible: number; /** Time to browse to index.html and view the SB logo */ buildManagerHeaderVisible: number; /** Time to browse to index.html and load the story index */ buildManagerIndexVisible: number; /** Time to browse to index.html and load iframe content and the story is rendered */ buildStoryVisible: number; /** Time to browse to index.html and load iframe content and the docs page is rendered */ buildAutodocsVisible: number; /** Time to browse to index.html and load iframe content and the MDX page is rendered */ buildMDXVisible: number; } ```
```javascript /** * @author Yosuke Ota */ 'use strict' const RuleTester = require('../../eslint-compat').RuleTester const rule = require('../../../lib/rules/no-setup-props-destructure') const tester = new RuleTester({ languageOptions: { parser: require('vue-eslint-parser'), ecmaVersion: 2020, sourceType: 'module' } }) tester.run('no-setup-props-destructure', rule, { valid: [ { filename: 'test.vue', code: ` <script> export default { setup(props) { watch(() => { console.log(props.count) // ok }) return () => { return h('div', props.count) // ok } } } </script> ` }, { filename: 'test.vue', code: ` <script> export default { setup(props) { watch(() => { const { count } = props // ok console.log(count) }) return () => { const { count } = props // ok return h('div', count) } } } </script> ` }, { filename: 'test.vue', code: ` <script> export default { _setup({count}) { } } </script> ` }, { filename: 'test.vue', code: ` <script> export default { setup() { } } </script> ` }, { filename: 'test.vue', code: ` <script> export default { setup(...args) { } } </script> ` }, { filename: 'test.vue', code: ` <script> export default { setup(props) { watch(() => { ({ count } = props) }) } } </script> ` }, { filename: 'test.vue', code: ` <script> var noVue = { setup(props) { const { count } = props } } </script> ` }, { filename: 'test.vue', code: ` <script> export default { setup(props) { const {x} = noProps ({y} = noProps) const z = noProps.z } } </script> ` }, { filename: 'test.vue', code: ` <script> export default { setup(props) { ({props} = x) } } </script> ` }, { filename: 'test.vue', code: ` <script> export default { watch: { setup({val}) { } } } </script> ` }, { filename: 'test.vue', code: ` <script> export default { setup(props) { const props2 = props } } </script> ` }, ` Vue.component('test', { el: a = b }) `, { filename: 'test.vue', code: ` <script setup> const props = defineProps({count:Number}) watch(() => { const {count} = props }) watch(() => { const count = props.count }) </script> `, errors: [ { messageId: 'getProperty', line: 4 } ] }, { filename: 'test.vue', code: ` <script setup> const props = defineProps({count:Number}) watch(() => { ({ count } = props) }) watch(() => { count = props.count }) </script> `, errors: [ { messageId: 'getProperty', line: 4 } ] }, { filename: 'test.vue', code: ` <script> export default { setup: (props) => { const count = computed(() => props.count) } } </script> ` }, { filename: 'test.vue', code: ` <script setup> const props = defineProps({ count: Number }) const count = computed(() => props.count) </script> ` } ], invalid: [ { filename: 'test.vue', code: ` <script> export default { setup({ count }) { // error watch(() => { console.log(count) // not going to detect changes }) return () => { return h('div', count) // not going to update } } } </script> `, errors: [ { messageId: 'destructuring', line: 4, column: 15, endLine: 4, endColumn: 24 } ] }, { filename: 'test.vue', code: ` <script> export default { setup(props) { const { count } = props // error } } </script> `, errors: [ { messageId: 'getProperty', line: 5, column: 17, endLine: 5, endColumn: 26 } ] }, { filename: 'test.vue', code: ` <script> export default { setup: (props) => { const { count } = props } } </script> `, errors: [ { messageId: 'getProperty', line: 5 } ] }, { filename: 'test.vue', code: ` <script> export default { setup(props) { ({ count } = props) } } </script> `, errors: [ { messageId: 'getProperty', line: 5 } ] }, { filename: 'test.vue', code: ` <script> export default { setup(p) { const { count } = p } } Vue.component('component', { setup(p) { const { count } = p } }) </script> `, errors: [ { messageId: 'getProperty', line: 5 }, { messageId: 'getProperty', line: 11 } ] }, { filename: 'test.vue', code: ` <script> export default { setup(p) { const { count } = p }, _setup(p) { const { count } = p }, } </script> `, errors: [ { messageId: 'getProperty', line: 5 } ] }, { filename: 'test.vue', code: ` <script> export default { setup(p) { const { x } = p const { y } = p } } </script> `, errors: [ { messageId: 'getProperty', line: 5 }, { messageId: 'getProperty', line: 6 } ] }, { filename: 'test.vue', code: ` <script> export default { setup(p) { const foo = p.bar } } </script> `, errors: [ { messageId: 'getProperty', line: 5 } ] }, { filename: 'test.vue', code: ` <script> export default { setup(p) { const x = p.foo const y = p?.bar const z = (p?.baz).qux const xc = p?.foo?.() const yc = (p?.bar)?.() const zc = (p?.baz.qux)?.() } } </script> `, errors: [ { messageId: 'getProperty', line: 5 }, { messageId: 'getProperty', line: 6 }, { messageId: 'getProperty', line: 7 }, { messageId: 'getProperty', line: 9 }, { messageId: 'getProperty', line: 10 }, { messageId: 'getProperty', line: 11 } ] }, { filename: 'test.vue', code: ` <script> export default { setup(p) { let foo foo = p.bar } } </script> `, errors: [ { messageId: 'getProperty', line: 6 } ] }, { filename: 'test.vue', code: ` <script> export default { setup(p) { const {foo} = p.bar } } </script> `, errors: [ { messageId: 'getProperty', line: 5 } ] }, { filename: 'test.vue', code: ` <script> export default { setup(p) { foo.bar = p.bar } } </script> `, errors: [ { messageId: 'getProperty', line: 5 } ] }, { filename: 'test.vue', code: ` <script setup> const {count} = defineProps({count:Number}) </script> `, errors: [ { message: 'Destructuring the `props` will cause the value to lose reactivity.', line: 3 } ] }, { filename: 'test.vue', code: ` <script setup> const props = defineProps({count:Number}) const {count} = props ;({count} = props) </script> `, errors: [ { message: 'Getting a value from the `props` in root scope of `<script setup>` will cause the value to lose reactivity.', line: 4 }, { message: 'Getting a value from the `props` in root scope of `<script setup>` will cause the value to lose reactivity.', line: 5 } ] }, { filename: 'test.vue', code: ` <script setup> const props = defineProps({count:Number}) const count = props.count count = props.count </script> `, errors: [ { messageId: 'getProperty', line: 4 }, { messageId: 'getProperty', line: 5 } ] }, { filename: 'test.vue', code: ` <script> export default { setup: (props) => { const count = ref(props.count) count = fn(props.count) } } </script> `, errors: [ { messageId: 'getProperty', line: 5 }, { messageId: 'getProperty', line: 6 } ] }, { filename: 'test.vue', code: ` <script setup> const props = defineProps({ count: Number }) const count = ref(props.count) count = fn(props.count) </script> `, errors: [ { messageId: 'getProperty', line: 4 }, { messageId: 'getProperty', line: 5 } ] }, { filename: 'test.vue', code: ` <script setup> const props = defineProps({ count: Number }) const newProps = ref({ count: props.count }) </script> `, errors: [ { messageId: 'getProperty', line: 4 } ] }, { filename: 'test.vue', code: ` <script setup> const props = defineProps({ count: Number }) const counts = [props.count] </script> `, errors: [ { messageId: 'getProperty', line: 4 } ] }, { filename: 'test.vue', code: ` <script setup> const props = defineProps({ count: Number }) const counter = { count: props.count } </script> `, errors: [ { messageId: 'getProperty', line: 4 } ] }, { filename: 'test.vue', code: ` <script setup> const props = defineProps({ count: Number }) const counters = [{ count: [props.count] }] </script> `, errors: [ { messageId: 'getProperty', line: 4 } ] }, { filename: 'test.vue', code: ` <script setup> const props = defineProps({ count: Number }) const buildCounter = (count) => ({ count }) buildCounter(props.count) </script> `, errors: [ { messageId: 'getProperty', line: 6 } ] } ] }) ```
```javascript /** * @license Apache-2.0 * * * * path_to_url * * Unless required by applicable law or agreed to in writing, software * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ 'use strict'; // MODULES // var tape = require( 'tape' ); var proxyquire = require( 'proxyquire' ); var IS_BROWSER = require( '@stdlib/assert/is-browser' ); var snanstdevwd = require( './../lib' ); // VARIABLES // var opts = { 'skip': IS_BROWSER }; // TESTS // tape( 'main export is a function', function test( t ) { t.ok( true, __filename ); t.strictEqual( typeof snanstdevwd, 'function', 'main export is a function' ); t.end(); }); tape( 'attached to the main export is a method providing an ndarray interface', function test( t ) { t.strictEqual( typeof snanstdevwd.ndarray, 'function', 'method is a function' ); t.end(); }); tape( 'if a native implementation is available, the main export is the native implementation', opts, function test( t ) { var snanstdevwd = proxyquire( './../lib', { '@stdlib/utils/try-require': tryRequire }); t.strictEqual( snanstdevwd, mock, 'returns expected value' ); t.end(); function tryRequire() { return mock; } function mock() { // Mock... } }); tape( 'if a native implementation is not available, the main export is a JavaScript implementation', opts, function test( t ) { var snanstdevwd; var main; main = require( './../lib/snanstdevwd.js' ); snanstdevwd = proxyquire( './../lib', { '@stdlib/utils/try-require': tryRequire }); t.strictEqual( snanstdevwd, main, 'returns expected value' ); t.end(); function tryRequire() { return new Error( 'Cannot find module' ); } }); ```
Merrilyn Miriam Rose (born 24 January 1955) was a minister in the Beattie government and member for Currumbin in the Queensland Parliament. Early life She was born Merrilyn Miriam Gittins in Kilcoy, Queensland in 1955 and attended Kilcoy State High School and St Rita's Clayfield. Career Rose was elected as the member for Currumbin at the 1992 Queensland election. After the 2001 election, the Premier of Queensland, Peter Beattie, appointed her Minister for Tourism and Racing. She was appointed Minister for Tourism, Racing and Fair Trading in 2001. Rose came under fire when it emerged that her son had driven her ministerial car to watch sporting events in Sydney, and also faced accusations of bullying staff. The controversy grew to a point that Beattie was forced to sack her from cabinet just before the 2004 election. At that election, Jann Stuckey of the Liberal Party soundly defeated Rose, who suffered a massive 17.7 percent swing against her. Blackmail conviction Rose had trouble finding a job after the election, and sought an appointment in the Queensland public sector. On 30 May 2007, she pleaded guilty to demanding benefit with threats in October 2006, in relation to her efforts to gain such an appointment. Rose was sentenced to 18 months' jail the following day. Documenting her experiences after three months in jail, Rose appeared on ABC Television's Australian Story series on 20 October 2008. References 1955 births Living people Australian female criminals Members of the Queensland Legislative Assembly Australian politicians convicted of crimes Australian Labor Party members of the Parliament of Queensland People from the Gold Coast, Queensland 21st-century Australian politicians 21st-century Australian women politicians Women members of the Queensland Legislative Assembly
Fire Season is a 2012 young adult science fiction novel by American authors David Weber and Jane Lindskold. Set in the fictional Honorverse, it is the second book in the prequel Stephanie Harrington series, part of the multi-part Honor Harrington series. It is a sequel to the 2011 A Beautiful Friendship by Weber. Stephanie Harrington is an ancestor of the main series character Honor Harrington. Plot summary The story takes place a few years after Stephanie Harrington is adopted by a Sphinxian treecat whom she has named Lionheart (and whose name among his own people is "Climbs Quickly"). During this time, Lionheart has witnessed Stephanie grow into a clever and confident human teenager. Yet Stephanie's move into adulthood comes at crucial time on many levels. Sphinx is undergoing "Fire Season" and Stephanie and her friend Karl Zivonik are constantly on fire duty to prevent the more dangerous brush fires from endangering the human population and the treecats. She and Karl personally save two treecat twin brothers, named Left-Stripe and Right-Stripe, from such a forest fire and deliver them both to her xeno-veterinarian father for treatment. Stephanie is also forced to contend with an official anthropological survey team that arrives in the kingdom with the express purpose of studying the treecats to determine whether or not they are sentient. Stephanie takes an immediate liking to the teenage son of the survey team's lead scientist, Anders Whittaker. Unbeknownst to Stephanie, Dr. Bradford Whittaker has intentionally brought his son along for this express purpose, believing that he and his team would need to circumvent the "paternalistic" Sphinx Forestry Service and its attempts to shield the treecats and Stephanie from him and his team. With Stephanie's fifteenth birthday approaching, Stephanie is looking forward to getting tested on an aircar and obtaining a piloting license for her birthday. However, she is disappointed to hear that her parents have already planned a birthday party for her instead. While they have already invited her colleagues from the SFS as well as Dr. Scott MacDallan, his wife Irina and his treecat companion Fisher, she is told to invite any of her friends from the hang-gliding club, as her parents feel that she needs to spend more time with kids her age. Reluctantly, she invites the kids she most gets along with as well as Jessica Pheriss, a newcomer to Sphinx. She is later horrified to discover that her mother had accidentally invited her least favorite person in the club, Trudy Franchitti, but her horror is forgotten however when her mother also says she invited Anders as well. The party is a major success, as the hang-gliding club's members land at Stephanie's freehold and eat her mother's recent botanical experiments. It takes a serious dive however, when Trudy arrogantly expresses her hope that the survey team remain impartial about the treecats, as her wealthy family has much invested in the land the treecats live on. Stephanie shows considerable maturity in answering Trudy's comments without lashing out at her for her insensitivity and finds an unexpected ally in Jessica, who also looks upon Trudy with disfavor. In the aftermath of the party, Stephanie and Jessica become friends, with Stephanie discovering the Jessica's family is both large and poor, the result of her parents' wanderlust and her father being a "drifter". She asks her mother to offer Jessica's mother a job as a research assistant in her botanical experiments. Though her mother thinks Mrs. Pheriss might be a good fit, she cautions Stephanie about charity as her experience with Trudy has proven how it can backfire. Meanwhile, Dr. Whittaker decides to study an abandoned treecat settlement without notifying the SFS and takes Anders and the rest of the team with him. Unfortunately, he lands them in a nearby bog and the air van begins to sink. His assistant, Dr. Langston Nez, manages to salvage much of their equipment from the air van but is seriously injured trying to get out. They soon discover that their communicators don't work for some reason and they realize that they are stranded without anyone knowing where to find them. The survey team's absence is eventually noticed by the spouses of two of its members and Stephanie, fearing for Anders, volunteers to search for them. The search is called off however when two large-scale fires break out and Stephanie and Karl are called in to help. Though ordered only to observe and report upon the progress of one of the fires, Lionheart soon detects the presence of a whole treecat clan trying to escape the fire and frantically gestures for them to go help. It soon becomes obvious that this treecat clan is far more leery of the humans than other treecats and Stephanie is forced to call in "reinforcements" – her friends from the hang-glider club – while Lionheart tries to reason with the clan. They manage to contain the fire long enough to evacuate the clan in one of her friend's vans, though not before Jessica and another treecat are almost killed by an exploding tree. As a consequence of this, Jessica finds herself bonded to the treecat she saved. It is then that the clan suddenly hears from Left-Stripe and Right-Stripe that there are humans in their previous nesting place and that they are in danger. Following Lionheart and the clan's gestures, Stephanie and her friends find the survey team just as a local swamp predator is closing in. Before Stephanie can shoot the creature with her pistol, the treecat clan runs to the surrounding trees and begins emitting a caterwauling that drives the creature off. With the survey team and the treecat clan rescued, Stephanie avoids any official sanctions for defying orders. Thankfully, Dr. Nez manages to live through the ordeal, which means the survey team can stay, despite Dr. Whittaker's actions. While Stephanie is overjoyed that Anders won't be leaving, Lionheart reflects upon how recent events have affected his people's attitudes towards the humans and how much larger his world has become with the humans in it. Reception Review by Carolyn Cushman (2013) in Locus, #624 January 2013 Review by Don Sakers (2013) in Analog Science Fiction and Fact, April 2013 References Baen Books books 2012 science fiction novels American science fiction novels Novels by David Weber Young adult novels Honorverse books 2012 American novels Novels set on fictional planets Novels by Jane Lindskold
St Luke's is a historic Anglican church building in central London, and in the London Borough of Islington. It served as a parish church from 1733 to 1959. It was designed by John James and Nicholas Hawksmoor, and is a Grade I listed building. Following closure in 1959, the church stood derelict and roofless for some 40 years, but since 2003 has been a music centre operated by the London Symphony Orchestra and known as LSO St Luke's. It is the home of the LSO's community and music education programme, LSO Discovery. The main body of the building seats up to 372 and is used by the LSO for rehearsals, and by a wide variety of musicians for performances and recording. Additional rooms in the crypt provide practice facilities for professional musicians, students and community groups. History The church is sited on Old Street, north of the City of London. It was built to relieve the City church of St Giles-without-Cripplegate, Cripplegate, under the Commission for Building Fifty New Churches, an attempt to meet the religious needs of London's burgeoning 18th-century population. The ancient parish of St Giles lay partly within the City and partly outside its boundaries in Middlesex: under the Commissioners' scheme these two parts were to be separated, with the Middlesex portion (historically the Manor of Finsbury) becoming a new parish of St Luke's. Construction began in 1727 and was completed in 1733, when the church was consecrated on 18 October (St Luke's day), and the parish detached from that of St Giles. The architects were the joint salaried surveyors to the Commission, John James and Nicholas Hawksmoor. James is thought to have been responsible for the body of the church, and Hawksmoor for the west tower, the flanking staircase wings, and the obelisk spire (a most unusual feature for an Anglican church). The spire was topped by an unusual weather vane depicting the head of a dragon with a fiery comet-like tail: this was misinterpreted locally as a louse, and by the mid-20th century had gained the church the nickname "lousy St Luke's". The church stood on often waterlogged ground, near the (historically) notoriously marshy Moorfields area, and from an early date (but particularly from the beginning of the 20th century) suffered from problems of subsidence. The effects of the subsidence remain visible in the distorted shapes of the windows on the north side of the building. Burials Burials in the small churchyard included: Mark Catesby (1683–1749), naturalist. His grave is lost. William Caslon the elder (1692/1693–1766), type founder, his son William Caslon II (1720–1778) and other members of the family. They are commemorated by a listed chest tomb. George Dance the Elder (1695–1768), architect, and at one time a member of the vestry. His grave is lost. In preparation for the conversion of the church into a music centre, the crypt was cleared of burials in the year 2000. A total of 1053 burials were archaeologically recorded, removed, and reburied at Brookwood Cemetery, Surrey. A television documentary, "Changing Tombs" (2001), recorded the process. Deconsecration and reuse In 1959, in response to structural problems at the church resulting from subsidence, and to a declining inner-city population, the Diocese of London closed St Luke's and the parish was re-absorbed into that of St Giles-without-Cripplegate. The following year the font and organ case were moved to St Giles' church, the reredos and altar rails to St Andrew Holborn, and the roof was removed for safety reasons. The crypt was bricked up in 1964. The empty shell of St Luke's became a dramatic ruin for some 40 years, overgrown with trees, despite being a Grade I listed building. After several controversial proposals to redevelop offices inside the retained walls, it was converted by the St Luke Centre Management Company Ltd for the London Symphony Orchestra as a concert hall, rehearsal and recording space, and educational resource. The conversion was designed by Axel Burrough at London architects Levitt Bernstein, who installed a heavy concrete slab roof which keeps out traffic noise from the nearby road. Though this is similar in profile to the former eighteenth-century roof, its great weight is supported on tall steel columns inside the hall described by the designer as "tree-like". The interior acoustic can be varied for different events, from full orchestra to soloists, by the use of absorbent surfaces that unroll like blinds across the ceiling and down the walls, whilst the seating and staging are also highly flexible. Work was completed in 2002, and the centre was brought into use early in 2003. Special events The venue regularly hosts open rehearsals by the London Symphony Orchestra in advance of concerts at the nearby Barbican Hall, and has pioneered genre-busting events such as the Eclectica series, which combines classical, jazz, experimental and electronic sound-worlds. Junior Trinity, the junior department of Trinity Laban Conservatoire of Music and Dance have also performed at LSO St Luke's as part of their seasonal concerts with their Symphony Orchestra, Wind Orchestra, Sinfonia, Big Band, and other notable groups. During 2006 the BBC used the venue to record concerts by Bruce Springsteen and Paul Simon for broadcast. Sir Elton John also recorded a concert to publicise his album The Captain & the Kid. In 2007 MTV used the venue to record a concert from Editors, for broadcast in the same year. Patti Smith, Philip Glass and Lenny Kaye performed a tribute to Allen Ginsberg in 2007. Van Morrison recorded a concert at St Luke's on BBC Four Sessions on 25 April 2008 featuring songs from his 2008 album, Keep It Simple. In September 2008, Duffy played there for BBC Sessions; the concert was televised on 12 October 2008. In December 2008 BBC Four broadcast Sacred Music: The Story of Allegri's Miserere, presented by Simon Russell Beale, with a performance by The Sixteen conducted by Harry Christophers at St Luke's. References Sources External links LSO site on church Churches in the London Borough of Islington Grade I listed churches in London Former churches in London John James (architect) buildings Music venues in London London Symphony Orchestra Nicholas Hawksmoor buildings 1733 establishments in England
```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\CivicInfo; class Election extends \Google\Model { /** * @var string */ public $electionDay; /** * @var string */ public $id; /** * @var string */ public $name; /** * @var string */ public $ocdDivisionId; /** * @var string */ public $shapeLookupBehavior; /** * @param string */ public function setElectionDay($electionDay) { $this->electionDay = $electionDay; } /** * @return string */ public function getElectionDay() { return $this->electionDay; } /** * @param string */ public function setId($id) { $this->id = $id; } /** * @return string */ public function getId() { return $this->id; } /** * @param string */ public function setName($name) { $this->name = $name; } /** * @return string */ public function getName() { return $this->name; } /** * @param string */ public function setOcdDivisionId($ocdDivisionId) { $this->ocdDivisionId = $ocdDivisionId; } /** * @return string */ public function getOcdDivisionId() { return $this->ocdDivisionId; } /** * @param string */ public function setShapeLookupBehavior($shapeLookupBehavior) { $this->shapeLookupBehavior = $shapeLookupBehavior; } /** * @return string */ public function getShapeLookupBehavior() { return $this->shapeLookupBehavior; } } // Adding a class alias for backwards compatibility with the previous class name. class_alias(Election::class, 'Google_Service_CivicInfo_Election'); ```
The 2014–15 Metal Ligaen season was the 24th season in the Danish Hockey League since the team was promoted in 1990. The team has completed 26 transfers, 13 in and 13 out. They have furthermore got a new general manager, Brad Gratton, who switched from the league rivals from Rødovre Mighty Bulls. Bulldogs finished as number 4 in the general classification, after a long period sitting in first place. They got knockout out in the quarter-finals by Esbjerg Energy. Regular season League table Sport in Odense
Dwier Brown (born January 30, 1959) is an American actor. In the 1989 film Field of Dreams he played John Kinsella, the father of Kevin Costner's character, and he played Henry Mitchell in Dennis the Menace Strikes Again in 1998. Brown has appeared in several horror films, such as House (1986) and The Guardian (1990), the latter directed by William Friedkin, who also directed The Exorcist. He has also made appearances on several television series, including Firefly, Criminal Minds, and Ghost Whisperer. In 2014, he wrote a memoir titled If You Build It... described as a book about "fathers, fate, and Field of Dreams." Early life Brown was born on January 30, 1959, in Wadsworth, Ohio. He graduated from Ashland University, in Ashland, Ohio. Selected filmography The Member of the Wedding (1982, TV Movie) – Jarvis The Thorn Birds (1983, TV Mini-Series) – Stuart Cleary, adult To Live and Die in L.A. (1985) – Doctor Copacabana (1985, Tv Movie) – Bibi Sutton House (1986) – Lieutenant Tic Tac Dough (TV 1986) contestant on final six shows House II: The Second Story (1987) – Clarence Field of Dreams (1989) – John Kinsella The Guardian (1990) – Phil Sterling The Cutting Edge (1992) – Hale Forrest Galaxies Are Colliding (1992) – Adam Mom and Dad Save the World (1992) – Sirk Revenge on the Highway (1992, TV Movie) – Red Robin Quantum Leap (1992, TV Series) – Neil Walters Gettysburg (1993) – Capt. Brewer Without Warning (1994, TV Movie)–– Matt Jensen Goldilocks and the Three Bears (1995) – Hal Same River Twice (1996) – Mikey Dennis the Menace Strikes Again (1998) – Henry Mitchell Rip Girls (2000, TV Movie) – Ben Miller Reunion (2001) – Patrick The Zeros (2001) – Leo Falling Like This (2001) – Deputy Sheriff Red Dragon (2002) – Mr Jacobi Firefly (2003, Episode: "Trash") – Durran Haymer Criminal Minds (2006, TV Series) – William Copeland The Unit (2007, TV Series) – Ambassador Blashek Fast Girl (2008) – Bill Johnstone Crazy (2008) – Businessman in busy We Shall Remain: Tecumseh's Vision (2009) – William Henry Harrison The Intervention (2009) – Matthew Garret Freedom Riders (2009, TV Series) Ghost Whisperer (2010, TV Series) – Jeff CSI: Crime Scene Investigation (2010, TV Series) – Young Sam Braun Locked Down (2010) – Kirkman Private Practice (2012, TV Series) – Matthew Ironside (2013, TV Series) – Carter Watson Rizzoli & Isles (2016) – Priest References External links 1959 births Living people 20th-century American male actors 21st-century American male actors American male film actors American male television actors Ashland University alumni Male actors from Ohio People from Summit County, Ohio People from Wadsworth, Ohio