text
stringlengths
2
99.5k
meta
dict
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ namespace RunShellcode.Properties { /// <summary> /// A strongly-typed resource class, for looking up localized strings, etc. /// </summary> // This class was auto-generated by the StronglyTypedResourceBuilder // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { private static global::System.Resources.ResourceManager resourceMan; private static global::System.Globalization.CultureInfo resourceCulture; [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal Resources() { } /// <summary> /// Returns the cached ResourceManager instance used by this class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Resources.ResourceManager ResourceManager { get { if ((resourceMan == null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("RunShellcode.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; } } /// <summary> /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } } }
{ "pile_set_name": "Github" }
/** * Copyright 2010-2015 Axel Fontaine * <p/> * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * <p/> * http://www.apache.org/licenses/LICENSE-2.0 * <p/> * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.contrastsecurity.cassandra.migration.resolver; import com.contrastsecurity.cassandra.migration.CassandraMigrationException; import com.contrastsecurity.cassandra.migration.info.MigrationVersion; import com.contrastsecurity.cassandra.migration.utils.Pair; /** * Parsing support for migrations that use the standard Flyway version + description embedding in their name. These * migrations have names like 1_2__Description . */ public class MigrationInfoHelper { /** * Prevents instantiation. */ private MigrationInfoHelper() { //Do nothing. } /** * Extracts the schema version and the description from a migration name formatted as 1_2__Description. * * @param migrationName The migration name to parse. Should not contain any folders or packages. * @param prefix The migration prefix. * @param separator The migration separator. * @param suffix The migration suffix. * @return The extracted schema version. * @throws CassandraMigrationException if the migration name does not follow the standard conventions. */ public static Pair<MigrationVersion, String> extractVersionAndDescription(String migrationName, String prefix, String separator, String suffix) { String cleanMigrationName = migrationName.substring(prefix.length(), migrationName.length() - suffix.length()); // Handle the description int descriptionPos = cleanMigrationName.indexOf(separator); if (descriptionPos < 0) { throw new CassandraMigrationException("Wrong migration name format: " + migrationName + "(It should look like this: " + prefix + "1_2" + separator + "Description" + suffix + ")"); } String version = cleanMigrationName.substring(0, descriptionPos); String description = cleanMigrationName.substring(descriptionPos + separator.length()).replaceAll("_", " "); return Pair.of(MigrationVersion.fromVersion(version), description); } }
{ "pile_set_name": "Github" }
CODEPAGE 20127 CPINFO 1 0x3F 0x003F MBTABLE 254 0x00 0x0000 ;Null 0x01 0x0001 ;Start Of Heading 0x02 0x0002 ;Start Of Text 0x03 0x0003 ;End Of Text 0x04 0x0004 ;End Of Transmission 0x05 0x0005 ;Enquiry 0x06 0x0006 ;Acknowledge 0x07 0x0007 ;Bell 0x08 0x0008 ;Backspace 0x09 0x0009 ;Character Tabulation 0x0A 0x000A ;Line Feed (LF) 0x0B 0x000B ;Line Tabulation 0x0C 0x000C ;Form Feed (FF) 0x0D 0x000D ;Carriage Return (CR) 0x0E 0x000E ;Shift Out 0x0F 0x000F ;Shift In 0x10 0x0010 ;Data Link Escape 0x11 0x0011 ;Device Control One 0x12 0x0012 ;Device Control Two 0x13 0x0013 ;Device Control Three 0x14 0x0014 ;Device Control Four 0x15 0x0015 ;Negative Acknowledge 0x16 0x0016 ;Synchronous Idle 0x17 0x0017 ;End Of Transmission Block 0x18 0x0018 ;Cancel 0x19 0x0019 ;End Of Medium 0x1A 0x001A ;Substitute 0x1B 0x001B ;Escape 0x1C 0x001C ;Information Separator Four 0x1D 0x001D ;Information Separator Three 0x1E 0x001E ;Information Separator Two 0x1F 0x001F ;Information Separator One 0x20 0x0020 ;Space 0x21 0x0021 ;Exclamation Mark 0x22 0x0022 ;Quotation Mark 0x23 0x0023 ;Number Sign 0x24 0x0024 ;Dollar Sign 0x25 0x0025 ;Percent Sign 0x26 0x0026 ;Ampersand 0x27 0x0027 ;Apostrophe 0x28 0x0028 ;Left Parenthesis 0x29 0x0029 ;Right Parenthesis 0x2A 0x002A ;Asterisk 0x2B 0x002B ;Plus Sign 0x2C 0x002C ;Comma 0x2D 0x002D ;Hyphen-Minus 0x2E 0x002E ;Full Stop 0x2F 0x002F ;Solidus 0x30 0x0030 ;Digit Zero 0x31 0x0031 ;Digit One 0x32 0x0032 ;Digit Two 0x33 0x0033 ;Digit Three 0x34 0x0034 ;Digit Four 0x35 0x0035 ;Digit Five 0x36 0x0036 ;Digit Six 0x37 0x0037 ;Digit Seven 0x38 0x0038 ;Digit Eight 0x39 0x0039 ;Digit Nine 0x3A 0x003A ;Colon 0x3B 0x003B ;Semicolon 0x3C 0x003C ;Less-Than Sign 0x3D 0x003D ;Equals Sign 0x3E 0x003E ;Greater-Than Sign 0x40 0x0040 ;Commercial At 0x41 0x0041 ;Latin Capital Letter A 0x42 0x0042 ;Latin Capital Letter B 0x43 0x0043 ;Latin Capital Letter C 0x44 0x0044 ;Latin Capital Letter D 0x45 0x0045 ;Latin Capital Letter E 0x46 0x0046 ;Latin Capital Letter F 0x47 0x0047 ;Latin Capital Letter G 0x48 0x0048 ;Latin Capital Letter H 0x49 0x0049 ;Latin Capital Letter I 0x4A 0x004A ;Latin Capital Letter J 0x4B 0x004B ;Latin Capital Letter K 0x4C 0x004C ;Latin Capital Letter L 0x4D 0x004D ;Latin Capital Letter M 0x4E 0x004E ;Latin Capital Letter N 0x4F 0x004F ;Latin Capital Letter O 0x50 0x0050 ;Latin Capital Letter P 0x51 0x0051 ;Latin Capital Letter Q 0x52 0x0052 ;Latin Capital Letter R 0x53 0x0053 ;Latin Capital Letter S 0x54 0x0054 ;Latin Capital Letter T 0x55 0x0055 ;Latin Capital Letter U 0x56 0x0056 ;Latin Capital Letter V 0x57 0x0057 ;Latin Capital Letter W 0x58 0x0058 ;Latin Capital Letter X 0x59 0x0059 ;Latin Capital Letter Y 0x5A 0x005A ;Latin Capital Letter Z 0x5B 0x005B ;Left Square Bracket 0x5C 0x005C ;Reverse Solidus 0x5D 0x005D ;Right Square Bracket 0x5E 0x005E ;Circumflex Accent 0x5F 0x005F ;Low Line 0x60 0x0060 ;Grave Accent 0x61 0x0061 ;Latin Small Letter A 0x62 0x0062 ;Latin Small Letter B 0x63 0x0063 ;Latin Small Letter C 0x64 0x0064 ;Latin Small Letter D 0x65 0x0065 ;Latin Small Letter E 0x66 0x0066 ;Latin Small Letter F 0x67 0x0067 ;Latin Small Letter G 0x68 0x0068 ;Latin Small Letter H 0x69 0x0069 ;Latin Small Letter I 0x6A 0x006A ;Latin Small Letter J 0x6B 0x006B ;Latin Small Letter K 0x6C 0x006C ;Latin Small Letter L 0x6D 0x006D ;Latin Small Letter M 0x6E 0x006E ;Latin Small Letter N 0x6F 0x006F ;Latin Small Letter O 0x70 0x0070 ;Latin Small Letter P 0x71 0x0071 ;Latin Small Letter Q 0x72 0x0072 ;Latin Small Letter R 0x73 0x0073 ;Latin Small Letter S 0x74 0x0074 ;Latin Small Letter T 0x75 0x0075 ;Latin Small Letter U 0x76 0x0076 ;Latin Small Letter V 0x77 0x0077 ;Latin Small Letter W 0x78 0x0078 ;Latin Small Letter X 0x79 0x0079 ;Latin Small Letter Y 0x7A 0x007A ;Latin Small Letter Z 0x7B 0x007B ;Left Curly Bracket 0x7C 0x007C ;Vertical Line 0x7D 0x007D ;Right Curly Bracket 0x7E 0x007E ;Tilde 0x7F 0x007F ;Delete 0x80 0x0000 ;Null 0x81 0x0001 ;Start Of Heading 0x82 0x0002 ;Start Of Text 0x83 0x0003 ;End Of Text 0x84 0x0004 ;End Of Transmission 0x85 0x0005 ;Enquiry 0x86 0x0006 ;Acknowledge 0x87 0x0007 ;Bell 0x88 0x0008 ;Backspace 0x89 0x0009 ;Character Tabulation 0x8A 0x000A ;Line Feed (LF) 0x8B 0x000B ;Line Tabulation 0x8C 0x000C ;Form Feed (FF) 0x8D 0x000D ;Carriage Return (CR) 0x8E 0x000E ;Shift Out 0x8F 0x000F ;Shift In 0x90 0x0010 ;Data Link Escape 0x91 0x0011 ;Device Control One 0x92 0x0012 ;Device Control Two 0x93 0x0013 ;Device Control Three 0x94 0x0014 ;Device Control Four 0x95 0x0015 ;Negative Acknowledge 0x96 0x0016 ;Synchronous Idle 0x97 0x0017 ;End Of Transmission Block 0x98 0x0018 ;Cancel 0x99 0x0019 ;End Of Medium 0x9A 0x001A ;Substitute 0x9B 0x001B ;Escape 0x9C 0x001C ;Information Separator Four 0x9D 0x001D ;Information Separator Three 0x9E 0x001E ;Information Separator Two 0x9F 0x001F ;Information Separator One 0xA0 0x0020 ;Space 0xA1 0x0021 ;Exclamation Mark 0xA2 0x0022 ;Quotation Mark 0xA3 0x0023 ;Number Sign 0xA4 0x0024 ;Dollar Sign 0xA5 0x0025 ;Percent Sign 0xA6 0x0026 ;Ampersand 0xA7 0x0027 ;Apostrophe 0xA8 0x0028 ;Left Parenthesis 0xA9 0x0029 ;Right Parenthesis 0xAA 0x002A ;Asterisk 0xAB 0x002B ;Plus Sign 0xAC 0x002C ;Comma 0xAD 0x002D ;Hyphen-Minus 0xAE 0x002E ;Full Stop 0xAF 0x002F ;Solidus 0xB0 0x0030 ;Digit Zero 0xB1 0x0031 ;Digit One 0xB2 0x0032 ;Digit Two 0xB3 0x0033 ;Digit Three 0xB4 0x0034 ;Digit Four 0xB5 0x0035 ;Digit Five 0xB6 0x0036 ;Digit Six 0xB7 0x0037 ;Digit Seven 0xB8 0x0038 ;Digit Eight 0xB9 0x0039 ;Digit Nine 0xBA 0x003A ;Colon 0xBB 0x003B ;Semicolon 0xBC 0x003C ;Less-Than Sign 0xBD 0x003D ;Equals Sign 0xBE 0x003E ;Greater-Than Sign 0xC0 0x0040 ;Commercial At 0xC1 0x0041 ;Latin Capital Letter A 0xC2 0x0042 ;Latin Capital Letter B 0xC3 0x0043 ;Latin Capital Letter C 0xC4 0x0044 ;Latin Capital Letter D 0xC5 0x0045 ;Latin Capital Letter E 0xC6 0x0046 ;Latin Capital Letter F 0xC7 0x0047 ;Latin Capital Letter G 0xC8 0x0048 ;Latin Capital Letter H 0xC9 0x0049 ;Latin Capital Letter I 0xCA 0x004A ;Latin Capital Letter J 0xCB 0x004B ;Latin Capital Letter K 0xCC 0x004C ;Latin Capital Letter L 0xCD 0x004D ;Latin Capital Letter M 0xCE 0x004E ;Latin Capital Letter N 0xCF 0x004F ;Latin Capital Letter O 0xD0 0x0050 ;Latin Capital Letter P 0xD1 0x0051 ;Latin Capital Letter Q 0xD2 0x0052 ;Latin Capital Letter R 0xD3 0x0053 ;Latin Capital Letter S 0xD4 0x0054 ;Latin Capital Letter T 0xD5 0x0055 ;Latin Capital Letter U 0xD6 0x0056 ;Latin Capital Letter V 0xD7 0x0057 ;Latin Capital Letter W 0xD8 0x0058 ;Latin Capital Letter X 0xD9 0x0059 ;Latin Capital Letter Y 0xDA 0x005A ;Latin Capital Letter Z 0xDB 0x005B ;Left Square Bracket 0xDC 0x005C ;Reverse Solidus 0xDD 0x005D ;Right Square Bracket 0xDE 0x005E ;Circumflex Accent 0xDF 0x005F ;Low Line 0xE0 0x0060 ;Grave Accent 0xE1 0x0061 ;Latin Small Letter A 0xE2 0x0062 ;Latin Small Letter B 0xE3 0x0063 ;Latin Small Letter C 0xE4 0x0064 ;Latin Small Letter D 0xE5 0x0065 ;Latin Small Letter E 0xE6 0x0066 ;Latin Small Letter F 0xE7 0x0067 ;Latin Small Letter G 0xE8 0x0068 ;Latin Small Letter H 0xE9 0x0069 ;Latin Small Letter I 0xEA 0x006A ;Latin Small Letter J 0xEB 0x006B ;Latin Small Letter K 0xEC 0x006C ;Latin Small Letter L 0xED 0x006D ;Latin Small Letter M 0xEE 0x006E ;Latin Small Letter N 0xEF 0x006F ;Latin Small Letter O 0xF0 0x0070 ;Latin Small Letter P 0xF1 0x0071 ;Latin Small Letter Q 0xF2 0x0072 ;Latin Small Letter R 0xF3 0x0073 ;Latin Small Letter S 0xF4 0x0074 ;Latin Small Letter T 0xF5 0x0075 ;Latin Small Letter U 0xF6 0x0076 ;Latin Small Letter V 0xF7 0x0077 ;Latin Small Letter W 0xF8 0x0078 ;Latin Small Letter X 0xF9 0x0079 ;Latin Small Letter Y 0xFA 0x007A ;Latin Small Letter Z 0xFB 0x007B ;Left Curly Bracket 0xFC 0x007C ;Vertical Line 0xFD 0x007D ;Right Curly Bracket 0xFE 0x007E ;Tilde 0xFF 0x007F ;Delete WCTABLE 498 0x0000 0x00 ;Null 0x0001 0x01 ;Start Of Heading 0x0002 0x02 ;Start Of Text 0x0003 0x03 ;End Of Text 0x0004 0x04 ;End Of Transmission 0x0005 0x05 ;Enquiry 0x0006 0x06 ;Acknowledge 0x0007 0x07 ;Bell 0x0008 0x08 ;Backspace 0x0009 0x09 ;Character Tabulation 0x000A 0x0A ;Line Feed (LF) 0x000B 0x0B ;Line Tabulation 0x000C 0x0C ;Form Feed (FF) 0x000D 0x0D ;Carriage Return (CR) 0x000E 0x0E ;Shift Out 0x000F 0x0F ;Shift In 0x0010 0x10 ;Data Link Escape 0x0011 0x11 ;Device Control One 0x0012 0x12 ;Device Control Two 0x0013 0x13 ;Device Control Three 0x0014 0x14 ;Device Control Four 0x0015 0x15 ;Negative Acknowledge 0x0016 0x16 ;Synchronous Idle 0x0017 0x17 ;End Of Transmission Block 0x0018 0x18 ;Cancel 0x0019 0x19 ;End Of Medium 0x001A 0x1A ;Substitute 0x001B 0x1B ;Escape 0x001C 0x1C ;Information Separator Four 0x001D 0x1D ;Information Separator Three 0x001E 0x1E ;Information Separator Two 0x001F 0x1F ;Information Separator One 0x0020 0x20 ;Space 0x0021 0x21 ;Exclamation Mark 0x0022 0x22 ;Quotation Mark 0x0023 0x23 ;Number Sign 0x0024 0x24 ;Dollar Sign 0x0025 0x25 ;Percent Sign 0x0026 0x26 ;Ampersand 0x0027 0x27 ;Apostrophe 0x0028 0x28 ;Left Parenthesis 0x0029 0x29 ;Right Parenthesis 0x002A 0x2A ;Asterisk 0x002B 0x2B ;Plus Sign 0x002C 0x2C ;Comma 0x002D 0x2D ;Hyphen-Minus 0x002E 0x2E ;Full Stop 0x002F 0x2F ;Solidus 0x0030 0x30 ;Digit Zero 0x0031 0x31 ;Digit One 0x0032 0x32 ;Digit Two 0x0033 0x33 ;Digit Three 0x0034 0x34 ;Digit Four 0x0035 0x35 ;Digit Five 0x0036 0x36 ;Digit Six 0x0037 0x37 ;Digit Seven 0x0038 0x38 ;Digit Eight 0x0039 0x39 ;Digit Nine 0x003A 0x3A ;Colon 0x003B 0x3B ;Semicolon 0x003C 0x3C ;Less-Than Sign 0x003D 0x3D ;Equals Sign 0x003E 0x3E ;Greater-Than Sign 0x0040 0x40 ;Commercial At 0x0041 0x41 ;Latin Capital Letter A 0x0042 0x42 ;Latin Capital Letter B 0x0043 0x43 ;Latin Capital Letter C 0x0044 0x44 ;Latin Capital Letter D 0x0045 0x45 ;Latin Capital Letter E 0x0046 0x46 ;Latin Capital Letter F 0x0047 0x47 ;Latin Capital Letter G 0x0048 0x48 ;Latin Capital Letter H 0x0049 0x49 ;Latin Capital Letter I 0x004A 0x4A ;Latin Capital Letter J 0x004B 0x4B ;Latin Capital Letter K 0x004C 0x4C ;Latin Capital Letter L 0x004D 0x4D ;Latin Capital Letter M 0x004E 0x4E ;Latin Capital Letter N 0x004F 0x4F ;Latin Capital Letter O 0x0050 0x50 ;Latin Capital Letter P 0x0051 0x51 ;Latin Capital Letter Q 0x0052 0x52 ;Latin Capital Letter R 0x0053 0x53 ;Latin Capital Letter S 0x0054 0x54 ;Latin Capital Letter T 0x0055 0x55 ;Latin Capital Letter U 0x0056 0x56 ;Latin Capital Letter V 0x0057 0x57 ;Latin Capital Letter W 0x0058 0x58 ;Latin Capital Letter X 0x0059 0x59 ;Latin Capital Letter Y 0x005A 0x5A ;Latin Capital Letter Z 0x005B 0x5B ;Left Square Bracket 0x005C 0x5C ;Reverse Solidus 0x005D 0x5D ;Right Square Bracket 0x005E 0x5E ;Circumflex Accent 0x005F 0x5F ;Low Line 0x0060 0x60 ;Grave Accent 0x0061 0x61 ;Latin Small Letter A 0x0062 0x62 ;Latin Small Letter B 0x0063 0x63 ;Latin Small Letter C 0x0064 0x64 ;Latin Small Letter D 0x0065 0x65 ;Latin Small Letter E 0x0066 0x66 ;Latin Small Letter F 0x0067 0x67 ;Latin Small Letter G 0x0068 0x68 ;Latin Small Letter H 0x0069 0x69 ;Latin Small Letter I 0x006A 0x6A ;Latin Small Letter J 0x006B 0x6B ;Latin Small Letter K 0x006C 0x6C ;Latin Small Letter L 0x006D 0x6D ;Latin Small Letter M 0x006E 0x6E ;Latin Small Letter N 0x006F 0x6F ;Latin Small Letter O 0x0070 0x70 ;Latin Small Letter P 0x0071 0x71 ;Latin Small Letter Q 0x0072 0x72 ;Latin Small Letter R 0x0073 0x73 ;Latin Small Letter S 0x0074 0x74 ;Latin Small Letter T 0x0075 0x75 ;Latin Small Letter U 0x0076 0x76 ;Latin Small Letter V 0x0077 0x77 ;Latin Small Letter W 0x0078 0x78 ;Latin Small Letter X 0x0079 0x79 ;Latin Small Letter Y 0x007A 0x7A ;Latin Small Letter Z 0x007B 0x7B ;Left Curly Bracket 0x007C 0x7C ;Vertical Line 0x007D 0x7D ;Right Curly Bracket 0x007E 0x7E ;Tilde 0x007F 0x7F ;Delete 0x00A0 0x20 ;No-Break Space 0x00A1 0x21 ;Inverted Exclamation Mark 0x00A2 0x63 ;Cent Sign 0x00A4 0x24 ;Currency Sign 0x00A5 0x59 ;Yen Sign 0x00A6 0x7C ;Broken Bar 0x00A9 0x43 ;Copyright Sign 0x00AA 0x61 ;Feminine Ordinal Indicator 0x00AB 0x3C ;Left-Pointing Double Angle Quotation Mark 0x00AD 0x2D ;Soft Hyphen 0x00AE 0x52 ;Registered Sign 0x00B2 0x32 ;Superscript Two 0x00B3 0x33 ;Superscript Three 0x00B7 0x2E ;Middle Dot 0x00B8 0x2C ;Cedilla 0x00B9 0x31 ;Superscript One 0x00BA 0x6F ;Masculine Ordinal Indicator 0x00BB 0x3E ;Right-Pointing Double Angle Quotation Mark 0x00C0 0x41 ;Latin Capital Letter A With Grave 0x00C1 0x41 ;Latin Capital Letter A With Acute 0x00C2 0x41 ;Latin Capital Letter A With Circumflex 0x00C3 0x41 ;Latin Capital Letter A With Tilde 0x00C4 0x41 ;Latin Capital Letter A With Diaeresis 0x00C5 0x41 ;Latin Capital Letter A With Ring Above 0x00C6 0x41 ;Latin Capital Letter Ae 0x00C7 0x43 ;Latin Capital Letter C With Cedilla 0x00C8 0x45 ;Latin Capital Letter E With Grave 0x00C9 0x45 ;Latin Capital Letter E With Acute 0x00CA 0x45 ;Latin Capital Letter E With Circumflex 0x00CB 0x45 ;Latin Capital Letter E With Diaeresis 0x00CC 0x49 ;Latin Capital Letter I With Grave 0x00CD 0x49 ;Latin Capital Letter I With Acute 0x00CE 0x49 ;Latin Capital Letter I With Circumflex 0x00CF 0x49 ;Latin Capital Letter I With Diaeresis 0x00D0 0x44 ;Latin Capital Letter Eth 0x00D1 0x4E ;Latin Capital Letter N With Tilde 0x00D2 0x4F ;Latin Capital Letter O With Grave 0x00D3 0x4F ;Latin Capital Letter O With Acute 0x00D4 0x4F ;Latin Capital Letter O With Circumflex 0x00D5 0x4F ;Latin Capital Letter O With Tilde 0x00D6 0x4F ;Latin Capital Letter O With Diaeresis 0x00D8 0x4F ;Latin Capital Letter O With Stroke 0x00D9 0x55 ;Latin Capital Letter U With Grave 0x00DA 0x55 ;Latin Capital Letter U With Acute 0x00DB 0x55 ;Latin Capital Letter U With Circumflex 0x00DC 0x55 ;Latin Capital Letter U With Diaeresis 0x00DD 0x59 ;Latin Capital Letter Y With Acute 0x00E0 0x61 ;Latin Small Letter A With Grave 0x00E1 0x61 ;Latin Small Letter A With Acute 0x00E2 0x61 ;Latin Small Letter A With Circumflex 0x00E3 0x61 ;Latin Small Letter A With Tilde 0x00E4 0x61 ;Latin Small Letter A With Diaeresis 0x00E5 0x61 ;Latin Small Letter A With Ring Above 0x00E6 0x61 ;Latin Small Letter Ae 0x00E7 0x63 ;Latin Small Letter C With Cedilla 0x00E8 0x65 ;Latin Small Letter E With Grave 0x00E9 0x65 ;Latin Small Letter E With Acute 0x00EA 0x65 ;Latin Small Letter E With Circumflex 0x00EB 0x65 ;Latin Small Letter E With Diaeresis 0x00EC 0x69 ;Latin Small Letter I With Grave 0x00ED 0x69 ;Latin Small Letter I With Acute 0x00EE 0x69 ;Latin Small Letter I With Circumflex 0x00EF 0x69 ;Latin Small Letter I With Diaeresis 0x00F1 0x6E ;Latin Small Letter N With Tilde 0x00F2 0x6F ;Latin Small Letter O With Grave 0x00F3 0x6F ;Latin Small Letter O With Acute 0x00F4 0x6F ;Latin Small Letter O With Circumflex 0x00F5 0x6F ;Latin Small Letter O With Tilde 0x00F6 0x6F ;Latin Small Letter O With Diaeresis 0x00F8 0x6F ;Latin Small Letter O With Stroke 0x00F9 0x75 ;Latin Small Letter U With Grave 0x00FA 0x75 ;Latin Small Letter U With Acute 0x00FB 0x75 ;Latin Small Letter U With Circumflex 0x00FC 0x75 ;Latin Small Letter U With Diaeresis 0x00FD 0x79 ;Latin Small Letter Y With Acute 0x00FF 0x79 ;Latin Small Letter Y With Diaeresis 0x0100 0x41 ;Latin Capital Letter A With Macron 0x0101 0x61 ;Latin Small Letter A With Macron 0x0102 0x41 ;Latin Capital Letter A With Breve 0x0103 0x61 ;Latin Small Letter A With Breve 0x0104 0x41 ;Latin Capital Letter A With Ogonek 0x0105 0x61 ;Latin Small Letter A With Ogonek 0x0106 0x43 ;Latin Capital Letter C With Acute 0x0107 0x63 ;Latin Small Letter C With Acute 0x0108 0x43 ;Latin Capital Letter C With Circumflex 0x0109 0x63 ;Latin Small Letter C With Circumflex 0x010A 0x43 ;Latin Capital Letter C With Dot Above 0x010B 0x63 ;Latin Small Letter C With Dot Above 0x010C 0x43 ;Latin Capital Letter C With Caron 0x010D 0x63 ;Latin Small Letter C With Caron 0x010E 0x44 ;Latin Capital Letter D With Caron 0x010F 0x64 ;Latin Small Letter D With Caron 0x0110 0x44 ;Latin Capital Letter D With Stroke 0x0111 0x64 ;Latin Small Letter D With Stroke 0x0112 0x45 ;Latin Capital Letter E With Macron 0x0113 0x65 ;Latin Small Letter E With Macron 0x0114 0x45 ;Latin Capital Letter E With Breve 0x0115 0x65 ;Latin Small Letter E With Breve 0x0116 0x45 ;Latin Capital Letter E With Dot Above 0x0117 0x65 ;Latin Small Letter E With Dot Above 0x0118 0x45 ;Latin Capital Letter E With Ogonek 0x0119 0x65 ;Latin Small Letter E With Ogonek 0x011A 0x45 ;Latin Capital Letter E With Caron 0x011B 0x65 ;Latin Small Letter E With Caron 0x011C 0x47 ;Latin Capital Letter G With Circumflex 0x011D 0x67 ;Latin Small Letter G With Circumflex 0x011E 0x47 ;Latin Capital Letter G With Breve 0x011F 0x67 ;Latin Small Letter G With Breve 0x0120 0x47 ;Latin Capital Letter G With Dot Above 0x0121 0x67 ;Latin Small Letter G With Dot Above 0x0122 0x47 ;Latin Capital Letter G With Cedilla 0x0123 0x67 ;Latin Small Letter G With Cedilla 0x0124 0x48 ;Latin Capital Letter H With Circumflex 0x0125 0x68 ;Latin Small Letter H With Circumflex 0x0126 0x48 ;Latin Capital Letter H With Stroke 0x0127 0x68 ;Latin Small Letter H With Stroke 0x0128 0x49 ;Latin Capital Letter I With Tilde 0x0129 0x69 ;Latin Small Letter I With Tilde 0x012A 0x49 ;Latin Capital Letter I With Macron 0x012B 0x69 ;Latin Small Letter I With Macron 0x012C 0x49 ;Latin Capital Letter I With Breve 0x012D 0x69 ;Latin Small Letter I With Breve 0x012E 0x49 ;Latin Capital Letter I With Ogonek 0x012F 0x69 ;Latin Small Letter I With Ogonek 0x0130 0x49 ;Latin Capital Letter I With Dot Above 0x0131 0x69 ;Latin Small Letter Dotless I 0x0134 0x4A ;Latin Capital Letter J With Circumflex 0x0135 0x6A ;Latin Small Letter J With Circumflex 0x0136 0x4B ;Latin Capital Letter K With Cedilla 0x0137 0x6B ;Latin Small Letter K With Cedilla 0x0139 0x4C ;Latin Capital Letter L With Acute 0x013A 0x6C ;Latin Small Letter L With Acute 0x013B 0x4C ;Latin Capital Letter L With Cedilla 0x013C 0x6C ;Latin Small Letter L With Cedilla 0x013D 0x4C ;Latin Capital Letter L With Caron 0x013E 0x6C ;Latin Small Letter L With Caron 0x0141 0x4C ;Latin Capital Letter L With Stroke 0x0142 0x6C ;Latin Small Letter L With Stroke 0x0143 0x4E ;Latin Capital Letter N With Acute 0x0144 0x6E ;Latin Small Letter N With Acute 0x0145 0x4E ;Latin Capital Letter N With Cedilla 0x0146 0x6E ;Latin Small Letter N With Cedilla 0x0147 0x4E ;Latin Capital Letter N With Caron 0x0148 0x6E ;Latin Small Letter N With Caron 0x014C 0x4F ;Latin Capital Letter O With Macron 0x014D 0x6F ;Latin Small Letter O With Macron 0x014E 0x4F ;Latin Capital Letter O With Breve 0x014F 0x6F ;Latin Small Letter O With Breve 0x0150 0x4F ;Latin Capital Letter O With Double Acute 0x0151 0x6F ;Latin Small Letter O With Double Acute 0x0152 0x4F ;Latin Capital Ligature Oe 0x0153 0x6F ;Latin Small Ligature Oe 0x0154 0x52 ;Latin Capital Letter R With Acute 0x0155 0x72 ;Latin Small Letter R With Acute 0x0156 0x52 ;Latin Capital Letter R With Cedilla 0x0157 0x72 ;Latin Small Letter R With Cedilla 0x0158 0x52 ;Latin Capital Letter R With Caron 0x0159 0x72 ;Latin Small Letter R With Caron 0x015A 0x53 ;Latin Capital Letter S With Acute 0x015B 0x73 ;Latin Small Letter S With Acute 0x015C 0x53 ;Latin Capital Letter S With Circumflex 0x015D 0x73 ;Latin Small Letter S With Circumflex 0x015E 0x53 ;Latin Capital Letter S With Cedilla 0x015F 0x73 ;Latin Small Letter S With Cedilla 0x0160 0x53 ;Latin Capital Letter S With Caron 0x0161 0x73 ;Latin Small Letter S With Caron 0x0162 0x54 ;Latin Capital Letter T With Cedilla 0x0163 0x74 ;Latin Small Letter T With Cedilla 0x0164 0x54 ;Latin Capital Letter T With Caron 0x0165 0x74 ;Latin Small Letter T With Caron 0x0166 0x54 ;Latin Capital Letter T With Stroke 0x0167 0x74 ;Latin Small Letter T With Stroke 0x0168 0x55 ;Latin Capital Letter U With Tilde 0x0169 0x75 ;Latin Small Letter U With Tilde 0x016A 0x55 ;Latin Capital Letter U With Macron 0x016B 0x75 ;Latin Small Letter U With Macron 0x016C 0x55 ;Latin Capital Letter U With Breve 0x016D 0x75 ;Latin Small Letter U With Breve 0x016E 0x55 ;Latin Capital Letter U With Ring Above 0x016F 0x75 ;Latin Small Letter U With Ring Above 0x0170 0x55 ;Latin Capital Letter U With Double Acute 0x0171 0x75 ;Latin Small Letter U With Double Acute 0x0172 0x55 ;Latin Capital Letter U With Ogonek 0x0173 0x75 ;Latin Small Letter U With Ogonek 0x0174 0x57 ;Latin Capital Letter W With Circumflex 0x0175 0x77 ;Latin Small Letter W With Circumflex 0x0176 0x59 ;Latin Capital Letter Y With Circumflex 0x0177 0x79 ;Latin Small Letter Y With Circumflex 0x0178 0x59 ;Latin Capital Letter Y With Diaeresis 0x0179 0x5A ;Latin Capital Letter Z With Acute 0x017A 0x7A ;Latin Small Letter Z With Acute 0x017B 0x5A ;Latin Capital Letter Z With Dot Above 0x017C 0x7A ;Latin Small Letter Z With Dot Above 0x017D 0x5A ;Latin Capital Letter Z With Caron 0x017E 0x7A ;Latin Small Letter Z With Caron 0x0180 0x62 ;Latin Small Letter B With Stroke 0x0189 0x44 ;Latin Capital Letter African D 0x0191 0x46 ;Latin Capital Letter F With Hook 0x0192 0x66 ;Latin Small Letter F With Hook 0x0197 0x49 ;Latin Capital Letter I With Stroke 0x019A 0x6C ;Latin Small Letter L With Bar 0x019F 0x4F ;Latin Capital Letter O With Middle Tilde 0x01A0 0x4F ;Latin Capital Letter O With Horn 0x01A1 0x6F ;Latin Small Letter O With Horn 0x01AB 0x74 ;Latin Small Letter T With Palatal Hook 0x01AE 0x54 ;Latin Capital Letter T With Retroflex Hook 0x01AF 0x55 ;Latin Capital Letter U With Horn 0x01B0 0x75 ;Latin Small Letter U With Horn 0x01B6 0x7A ;Latin Small Letter Z With Stroke 0x01CD 0x41 ;Latin Capital Letter A With Caron 0x01CE 0x61 ;Latin Small Letter A With Caron 0x01CF 0x49 ;Latin Capital Letter I With Caron 0x01D0 0x69 ;Latin Small Letter I With Caron 0x01D1 0x4F ;Latin Capital Letter O With Caron 0x01D2 0x6F ;Latin Small Letter O With Caron 0x01D3 0x55 ;Latin Capital Letter U With Caron 0x01D4 0x75 ;Latin Small Letter U With Caron 0x01D5 0x55 ;Latin Capital Letter U With Diaeresis And Macron 0x01D6 0x75 ;Latin Small Letter U With Diaeresis And Macron 0x01D7 0x55 ;Latin Capital Letter U With Diaeresis And Acute 0x01D8 0x75 ;Latin Small Letter U With Diaeresis And Acute 0x01D9 0x55 ;Latin Capital Letter U With Diaeresis And Caron 0x01DA 0x75 ;Latin Small Letter U With Diaeresis And Caron 0x01DB 0x55 ;Latin Capital Letter U With Diaeresis And Grave 0x01DC 0x75 ;Latin Small Letter U With Diaeresis And Grave 0x01DE 0x41 ;Latin Capital Letter A With Diaeresis And Macron 0x01DF 0x61 ;Latin Small Letter A With Diaeresis And Macron 0x01E4 0x47 ;Latin Capital Letter G With Stroke 0x01E5 0x67 ;Latin Small Letter G With Stroke 0x01E6 0x47 ;Latin Capital Letter G With Caron 0x01E7 0x67 ;Latin Small Letter G With Caron 0x01E8 0x4B ;Latin Capital Letter K With Caron 0x01E9 0x6B ;Latin Small Letter K With Caron 0x01EA 0x4F ;Latin Capital Letter O With Ogonek 0x01EB 0x6F ;Latin Small Letter O With Ogonek 0x01EC 0x4F ;Latin Capital Letter O With Ogonek And Macron 0x01ED 0x6F ;Latin Small Letter O With Ogonek And Macron 0x01F0 0x6A ;Latin Small Letter J With Caron 0x0261 0x67 ;Latin Small Letter Script G 0x02B9 0x27 ;Modifier Letter Prime 0x02BA 0x22 ;Modifier Letter Double Prime 0x02BC 0x27 ;Modifier Letter Apostrophe 0x02C4 0x5E ;Modifier Letter Up Arrowhead 0x02C6 0x5E ;Modifier Letter Circumflex Accent 0x02C8 0x27 ;Modifier Letter Vertical Line 0x02CB 0x60 ;Modifier Letter Grave Accent 0x02CD 0x5F ;Modifier Letter Low Macron 0x02DC 0x7E ;Small Tilde 0x0300 0x60 ;Combining Grave Accent 0x0302 0x5E ;Combining Circumflex Accent 0x0303 0x7E ;Combining Tilde 0x030E 0x22 ;Combining Double Vertical Line Above 0x0331 0x5F ;Combining Macron Below 0x0332 0x5F ;Combining Low Line 0x2000 0x20 ;En Quad 0x2001 0x20 ;Em Quad 0x2002 0x20 ;En Space 0x2003 0x20 ;Em Space 0x2004 0x20 ;Three-Per-Em Space 0x2005 0x20 ;Four-Per-Em Space 0x2006 0x20 ;Six-Per-Em Space 0x2010 0x2D ;Hyphen 0x2011 0x2D ;Non-Breaking Hyphen 0x2013 0x2D ;En Dash 0x2014 0x2D ;Em Dash 0x2018 0x27 ;Left Single Quotation Mark 0x2019 0x27 ;Right Single Quotation Mark 0x201A 0x2C ;Single Low-9 Quotation Mark 0x201C 0x22 ;Left Double Quotation Mark 0x201D 0x22 ;Right Double Quotation Mark 0x201E 0x22 ;Double Low-9 Quotation Mark 0x2022 0x2E ;Bullet 0x2026 0x2E ;Horizontal Ellipsis 0x2032 0x27 ;Prime 0x2035 0x60 ;Reversed Prime 0x2039 0x3C ;Single Left-Pointing Angle Quotation Mark 0x203A 0x3E ;Single Right-Pointing Angle Quotation Mark 0x2122 0x54 ;Trade Mark Sign 0xFF01 0x21 ;Fullwidth Exclamation Mark 0xFF02 0x22 ;Fullwidth Quotation Mark 0xFF03 0x23 ;Fullwidth Number Sign 0xFF04 0x24 ;Fullwidth Dollar Sign 0xFF05 0x25 ;Fullwidth Percent Sign 0xFF06 0x26 ;Fullwidth Ampersand 0xFF07 0x27 ;Fullwidth Apostrophe 0xFF08 0x28 ;Fullwidth Left Parenthesis 0xFF09 0x29 ;Fullwidth Right Parenthesis 0xFF0A 0x2A ;Fullwidth Asterisk 0xFF0B 0x2B ;Fullwidth Plus Sign 0xFF0C 0x2C ;Fullwidth Comma 0xFF0D 0x2D ;Fullwidth Hyphen-Minus 0xFF0E 0x2E ;Fullwidth Full Stop 0xFF0F 0x2F ;Fullwidth Solidus 0xFF10 0x30 ;Fullwidth Digit Zero 0xFF11 0x31 ;Fullwidth Digit One 0xFF12 0x32 ;Fullwidth Digit Two 0xFF13 0x33 ;Fullwidth Digit Three 0xFF14 0x34 ;Fullwidth Digit Four 0xFF15 0x35 ;Fullwidth Digit Five 0xFF16 0x36 ;Fullwidth Digit Six 0xFF17 0x37 ;Fullwidth Digit Seven 0xFF18 0x38 ;Fullwidth Digit Eight 0xFF19 0x39 ;Fullwidth Digit Nine 0xFF1A 0x3A ;Fullwidth Colon 0xFF1B 0x3B ;Fullwidth Semicolon 0xFF1C 0x3C ;Fullwidth Less-Than Sign 0xFF1D 0x3D ;Fullwidth Equals Sign 0xFF1E 0x3E ;Fullwidth Greater-Than Sign 0xFF20 0x40 ;Fullwidth Commercial At 0xFF21 0x41 ;Fullwidth Latin Capital Letter A 0xFF22 0x42 ;Fullwidth Latin Capital Letter B 0xFF23 0x43 ;Fullwidth Latin Capital Letter C 0xFF24 0x44 ;Fullwidth Latin Capital Letter D 0xFF25 0x45 ;Fullwidth Latin Capital Letter E 0xFF26 0x46 ;Fullwidth Latin Capital Letter F 0xFF27 0x47 ;Fullwidth Latin Capital Letter G 0xFF28 0x48 ;Fullwidth Latin Capital Letter H 0xFF29 0x49 ;Fullwidth Latin Capital Letter I 0xFF2A 0x4A ;Fullwidth Latin Capital Letter J 0xFF2B 0x4B ;Fullwidth Latin Capital Letter K 0xFF2C 0x4C ;Fullwidth Latin Capital Letter L 0xFF2D 0x4D ;Fullwidth Latin Capital Letter M 0xFF2E 0x4E ;Fullwidth Latin Capital Letter N 0xFF2F 0x4F ;Fullwidth Latin Capital Letter O 0xFF30 0x50 ;Fullwidth Latin Capital Letter P 0xFF31 0x51 ;Fullwidth Latin Capital Letter Q 0xFF32 0x52 ;Fullwidth Latin Capital Letter R 0xFF33 0x53 ;Fullwidth Latin Capital Letter S 0xFF34 0x54 ;Fullwidth Latin Capital Letter T 0xFF35 0x55 ;Fullwidth Latin Capital Letter U 0xFF36 0x56 ;Fullwidth Latin Capital Letter V 0xFF37 0x57 ;Fullwidth Latin Capital Letter W 0xFF38 0x58 ;Fullwidth Latin Capital Letter X 0xFF39 0x59 ;Fullwidth Latin Capital Letter Y 0xFF3A 0x5A ;Fullwidth Latin Capital Letter Z 0xFF3B 0x5B ;Fullwidth Left Square Bracket 0xFF3C 0x5C ;Fullwidth Reverse Solidus 0xFF3D 0x5D ;Fullwidth Right Square Bracket 0xFF3E 0x5E ;Fullwidth Circumflex Accent 0xFF3F 0x5F ;Fullwidth Low Line 0xFF40 0x60 ;Fullwidth Grave Accent 0xFF41 0x61 ;Fullwidth Latin Small Letter A 0xFF42 0x62 ;Fullwidth Latin Small Letter B 0xFF43 0x63 ;Fullwidth Latin Small Letter C 0xFF44 0x64 ;Fullwidth Latin Small Letter D 0xFF45 0x65 ;Fullwidth Latin Small Letter E 0xFF46 0x66 ;Fullwidth Latin Small Letter F 0xFF47 0x67 ;Fullwidth Latin Small Letter G 0xFF48 0x68 ;Fullwidth Latin Small Letter H 0xFF49 0x69 ;Fullwidth Latin Small Letter I 0xFF4A 0x6A ;Fullwidth Latin Small Letter J 0xFF4B 0x6B ;Fullwidth Latin Small Letter K 0xFF4C 0x6C ;Fullwidth Latin Small Letter L 0xFF4D 0x6D ;Fullwidth Latin Small Letter M 0xFF4E 0x6E ;Fullwidth Latin Small Letter N 0xFF4F 0x6F ;Fullwidth Latin Small Letter O 0xFF50 0x70 ;Fullwidth Latin Small Letter P 0xFF51 0x71 ;Fullwidth Latin Small Letter Q 0xFF52 0x72 ;Fullwidth Latin Small Letter R 0xFF53 0x73 ;Fullwidth Latin Small Letter S 0xFF54 0x74 ;Fullwidth Latin Small Letter T 0xFF55 0x75 ;Fullwidth Latin Small Letter U 0xFF56 0x76 ;Fullwidth Latin Small Letter V 0xFF57 0x77 ;Fullwidth Latin Small Letter W 0xFF58 0x78 ;Fullwidth Latin Small Letter X 0xFF59 0x79 ;Fullwidth Latin Small Letter Y 0xFF5A 0x7A ;Fullwidth Latin Small Letter Z 0xFF5B 0x7B ;Fullwidth Left Curly Bracket 0xFF5C 0x7C ;Fullwidth Vertical Line 0xFF5D 0x7D ;Fullwidth Right Curly Bracket 0xFF5E 0x7E ;Fullwidth Tilde ENDCODEPAGE
{ "pile_set_name": "Github" }
The `setuid` permission The `sticky bit` permission Understanding `umask` Running a command as another local user `su` vs `sudo`
{ "pile_set_name": "Github" }
<?php /** * List Details * * @author ThemeBoy * @category Admin * @package SportsPress/Admin/Meta_Boxes * @version 2.7.1 */ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly /** * SP_Meta_Box_List_Details */ class SP_Meta_Box_List_Details { /** * Output the metabox */ public static function output( $post ) { $taxonomies = get_object_taxonomies( 'sp_list' ); $caption = get_post_meta( $post->ID, 'sp_caption', true ); $team_id = get_post_meta( $post->ID, 'sp_team', true ); $era = get_post_meta( $post->ID, 'sp_era', true ); $grouping = get_post_meta( $post->ID, 'sp_grouping', true ); $orderby = get_post_meta( $post->ID, 'sp_orderby', true ); $order = get_post_meta( $post->ID, 'sp_order', true ); $select = get_post_meta( $post->ID, 'sp_select', true ); $number = get_post_meta( $post->ID, 'sp_number', true ); $crop = get_post_meta( $post->ID, 'sp_crop', true ); $date = get_post_meta( $post->ID, 'sp_date', true ); $date_from = get_post_meta( $post->ID, 'sp_date_from', true ); $date_to = get_post_meta( $post->ID, 'sp_date_to', true ); $date_past = get_post_meta( $post->ID, 'sp_date_past', true ); $date_relative = get_post_meta( $post->ID, 'sp_date_relative', true ); $continents = SP()->countries->continents; $nationalities = get_post_meta( $post->ID, 'sp_nationality', false ); $default_nationality = get_option( 'sportspress_default_nationality' , false ); ?> <div> <p><strong><?php _e( 'Heading', 'sportspress' ); ?></strong></p> <p><input type="text" id="sp_caption" name="sp_caption" value="<?php echo esc_attr( $caption ); ?>" placeholder="<?php echo esc_attr( get_the_title() ); ?>"></p> <div class="sp-date-selector"> <p><strong><?php _e( 'Date', 'sportspress' ); ?></strong></p> <p> <?php $args = array( 'name' => 'sp_date', 'id' => 'sp_date', 'selected' => $date, ); sp_dropdown_dates( $args ); ?> </p> <div class="sp-date-range"> <p class="sp-date-range-absolute"> <input type="text" class="sp-datepicker-from" name="sp_date_from" value="<?php echo $date_from ? $date_from : date_i18n( 'Y-m-d' ); ?>" size="10"> : <input type="text" class="sp-datepicker-to" name="sp_date_to" value="<?php echo $date_to ? $date_to : date_i18n( 'Y-m-d' ); ?>" size="10"> </p> <p class="sp-date-range-relative"> <?php _e( 'Past', 'sportspress' ); ?> <input type="number" min="0" step="1" class="tiny-text" name="sp_date_past" value="<?php echo '' !== $date_past ? $date_past : 7; ?>"> <?php _e( 'days', 'sportspress' ); ?> </p> <p class="sp-date-relative"> <label> <input type="checkbox" name="sp_date_relative" value="1" id="sp_date_relative" <?php checked( $date_relative ); ?>> <?php _e( 'Relative', 'sportspress' ); ?> </label> </p> </div> </div> <?php foreach ( $taxonomies as $taxonomy ) { sp_taxonomy_field( $taxonomy, $post, true ); } ?> <p><strong><?php _e( 'Team', 'sportspress' ); ?></strong></p> <p class="sp-tab-select sp-team-era-selector"> <?php $args = array( 'post_type' => 'sp_team', 'name' => 'sp_team', 'show_option_all' => __( 'All', 'sportspress' ), 'selected' => $team_id, 'values' => 'ID', ); if ( ! sp_dropdown_pages( $args ) ): sp_post_adder( 'sp_team', __( 'Add New', 'sportspress' ) ); endif; ?> <select name="sp_era"> <option value="all" <?php selected( 'all', $era ); ?>><?php _e( 'All', 'sportspress' ); ?></option> <option value="current" <?php selected( 'current', $era ); ?>><?php _e( 'Current', 'sportspress' ); ?></option> <option value="past" <?php selected( 'past', $era ); ?>><?php _e( 'Past', 'sportspress' ); ?></option> </select> </p> <p><strong><?php _e( 'Nationality', 'sportspress' ); ?></strong></p> <p> <select id="sp_nationality" name="sp_nationality[]" data-placeholder="<?php printf( __( 'Select %s', 'sportspress' ), __( 'Nationality', 'sportspress' ) ); ?>" class="widefat chosen-select<?php if ( is_rtl() ): ?> chosen-rtl<?php endif; ?>" multiple="multiple"> <option value=""></option> <?php foreach ( $continents as $continent => $countries ): ?> <optgroup label="<?php echo $continent; ?>"> <?php foreach ( $countries as $code => $country ): ?> <option value="<?php echo $code; ?>" <?php selected ( in_array( $code, $nationalities ) ); ?>><?php echo $country; ?></option> <?php endforeach; ?> </optgroup> <?php endforeach; ?> </select> </p> <p><strong><?php _e( 'Grouping', 'sportspress' ); ?></strong></p> <p> <select name="sp_grouping"> <option value="0"><?php _e( 'None', 'sportspress' ); ?></option> <option value="position" <?php selected( $grouping, 'position' ); ?>><?php _e( 'Position', 'sportspress' ); ?></option> </select> </p> <p><strong><?php _e( 'Sort by', 'sportspress' ); ?></strong></p> <p> <?php $args = array( 'prepend_options' => array( 'number' => __( 'Squad Number', 'sportspress' ), 'name' => __( 'Name', 'sportspress' ), ), 'post_type' => array( 'sp_performance', 'sp_metric', 'sp_statistic' ), 'name' => 'sp_orderby', 'selected' => $orderby, 'values' => 'slug', ); sp_dropdown_pages( $args ); ?> </p> <p> <label class="selectit"> <input type="checkbox" name="sp_crop" value="1" <?php checked( $crop ); ?>> <?php _e( 'Skip if zero?', 'sportspress' ); ?> </label> </p> <p><strong><?php _e( 'Sort Order', 'sportspress' ); ?></strong></p> <p> <select name="sp_order"> <option value="ASC" <?php selected( 'ASC', $order ); ?>><?php _e( 'Ascending', 'sportspress' ); ?></option> <option value="DESC" <?php selected( 'DESC', $order ); ?>><?php _e( 'Descending', 'sportspress' ); ?></option> </select> </p> <p><strong><?php _e( 'Players', 'sportspress' ); ?></strong></p> <p class="sp-select-setting"> <select name="sp_select"> <option value="auto" <?php selected( 'auto', $select ); ?>><?php _e( 'Auto', 'sportspress' ); ?></option> <option value="manual" <?php selected( 'manual', $select ); ?>><?php _e( 'Manual', 'sportspress' ); ?></option> </select> </p> <?php if ( 'manual' == $select ) { $player_filters = array( 'sp_league', 'sp_season' ); if ( $team_id ) { if ( in_array( $era, [ 'all', 'past' ] ) ) { $player_filters[] = 'sp_past_team'; } if ( in_array( $era, [ 'all', 'current' ] ) ) { $player_filters[] = 'sp_current_team'; } } sp_post_checklist( $post->ID, 'sp_player', ( 'auto' == $select ? 'none' : 'block' ), $player_filters ); sp_post_adder( 'sp_player', __( 'Add New', 'sportspress' ) ); } else { ?> <p><strong><?php _e( 'Display', 'sportspress' ); ?></strong></p> <p><input name="sp_number" id="sp_number" type="number" step="1" min="0" class="small-text" placeholder="<?php _e( 'All', 'sportspress' ); ?>" value="<?php echo $number; ?>"> <?php _e( 'players', 'sportspress' ); ?></p> <?php } ?> </div> <?php } /** * Save meta box data */ public static function save( $post_id, $post ) { update_post_meta( $post_id, 'sp_caption', esc_attr( sp_array_value( $_POST, 'sp_caption', 0 ) ) ); update_post_meta( $post_id, 'sp_date', sp_array_value( $_POST, 'sp_date', 0 ) ); update_post_meta( $post_id, 'sp_date_from', sp_array_value( $_POST, 'sp_date_from', null ) ); update_post_meta( $post_id, 'sp_date_to', sp_array_value( $_POST, 'sp_date_to', null ) ); update_post_meta( $post_id, 'sp_date_past', sp_array_value( $_POST, 'sp_date_past', 0 ) ); update_post_meta( $post_id, 'sp_date_relative', sp_array_value( $_POST, 'sp_date_relative', 0 ) ); $tax_input = sp_array_value( $_POST, 'tax_input', array() ); update_post_meta( $post_id, 'sp_main_league', in_array( 'auto', sp_array_value( $tax_input, 'sp_league' ) ) ); update_post_meta( $post_id, 'sp_current_season', in_array( 'auto', sp_array_value( $tax_input, 'sp_season' ) ) ); update_post_meta( $post_id, 'sp_team', sp_array_value( $_POST, 'sp_team', array() ) ); update_post_meta( $post_id, 'sp_era', sp_array_value( $_POST, 'sp_era', array() ) ); update_post_meta( $post_id, 'sp_grouping', sp_array_value( $_POST, 'sp_grouping', array() ) ); update_post_meta( $post_id, 'sp_orderby', sp_array_value( $_POST, 'sp_orderby', array() ) ); update_post_meta( $post_id, 'sp_crop', sp_array_value( $_POST, 'sp_crop', 0 ) ); update_post_meta( $post_id, 'sp_order', sp_array_value( $_POST, 'sp_order', array() ) ); update_post_meta( $post_id, 'sp_select', sp_array_value( $_POST, 'sp_select', array() ) ); update_post_meta( $post_id, 'sp_number', sp_array_value( $_POST, 'sp_number', array() ) ); sp_update_post_meta_recursive( $post_id, 'sp_player', sp_array_value( $_POST, 'sp_player', array() ) ); sp_update_post_meta_recursive( $post_id, 'sp_nationality', sp_array_value( $_POST, 'sp_nationality', array() ) ); } }
{ "pile_set_name": "Github" }
/** * Copyright (c) 2018-present, Facebook, Inc. and its affiliates. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. */ include "logdevice/common/if/common.thrift" include "logdevice/admin/if/nodes.thrift" namespace cpp2 facebook.logdevice.thrift namespace go logdevice.admin.if.cluster_membership namespace py3 logdevice.admin /** * This enum contains all the possible ways the cluster membership change * request can fail because of an invalid input. */ enum ClusterMembershipFailureReason { UNKNOWN = 0, /** * The passed common.NodeID didn't match any node in the nodes configuration. */ NO_MATCH_IN_CONFIG = 1, /** * The operation requires that the node to be DEAD but it's not. */ NOT_DEAD = 2, /** * The operation requires that the node to be DISABLED/DRAINED for both * sequencing and storage, but it's not. */ NOT_DISABLED = 3, /** * The node that you are trying to add already exists. */ ALREADY_EXISTS = 4, /** * If the passed nodes config is invalid for the operation. Examples of * invalid configs can be: * - Update immutable fields (e.g. "location" or "roles"). * - Adding a node with a negative sequencer weight. * - Changing non service discovery info in an Update request. * More information about the failure will be in the message. */ INVALID_REQUEST_NODES_CONFIG = 5, } /** * The reason why an operation on a node failed in cluster membership change. */ struct ClusterMembershipFailedNode { 1: common.NodeID node_id, 2: ClusterMembershipFailureReason reason, /** * Human readable error description. */ 3: string message, } exception ClusterMembershipOperationFailed { 1: list<ClusterMembershipFailedNode> failed_nodes, } //////////////////////////////////////////////////////////////////////////// /////////////////////////// Add Node Request /////////////////////////////// //////////////////////////////////////////////////////////////////////////// const common.NodeIndex ANY_NODE_IDX = -1 struct AddSingleNodeRequest { /** * Config of the newly added node. Admin server will use this struct to fill * the information needed for the NodesConfiguration. * * Notes: * - If node_index = ANY_NODE_IDX, the admin server will pick the NodeIndex. * - The name, addresses & node_index (if set) should all be unique. * - Roles can't be empty. * - location_per_scope field is ignored. */ 1: nodes.NodeConfig new_config, } struct AddNodesRequest { 1: list<AddSingleNodeRequest> new_node_requests, } struct AddNodesResponse { /** * NodeConfigs of the newly added nodes. */ 1: list<nodes.NodeConfig> added_nodes, /** * The version of the updated NodesConfiguration. */ 2: common.unsigned64 new_nodes_configuration_version, } //////////////////////////////////////////////////////////////////////////// /////////////////////////// Update Node Request //////////////////////////// //////////////////////////////////////////////////////////////////////////// struct UpdateSingleNodeRequest { /** * Node to be updated. */ 1: common.NodeID node_to_be_updated, /** * The desired final config for the node. It should include all the attributes * of the node (even the ones that doesn't need to be updated). The admin * server will then figure out the fields that changed and apply the update. * * Changing immutable attributes (e.g. node_index, location or roles) or * changing non service discovery info (e.g. sequenecer weight) will fail with * INVALID_REQUEST_NODES_CONFIG. */ 2: nodes.NodeConfig new_config, } struct UpdateNodesRequest { /** * Update requests for each node that needs to be updated. */ 1: list<UpdateSingleNodeRequest> node_requests, } struct UpdateNodesResponse { /** * The new NodeConfigs for the updated nodes. */ 1: list<nodes.NodeConfig> updated_nodes, /** * The version of the updated NodesConfiguration. */ 2: common.unsigned64 new_nodes_configuration_version, } //////////////////////////////////////////////////////////////////////////// /////////////////////////// Remove Node Request //////////////////////////// //////////////////////////////////////////////////////////////////////////// /** * Request to remove a list of nodes represented by one or more NodesFilters. */ struct RemoveNodesRequest { /** * List of NodeFilters to remove from the nodes configuration. Matches from * each filter are union-ed together and are removed from the nodes * configuration in a single transaction. */ 1: list<nodes.NodesFilter> node_filters, } struct RemoveNodesResponse { /** * List of nodes that were successfully removed from config. */ 1: list<common.NodeID> removed_nodes, /** * The version of the updated NodesConfiguration. */ 2: common.unsigned64 new_nodes_configuration_version, } //////////////////////////////////////////////////////////////////////////// ////////////////// Mark Shards As Provisioned Request ////////////////////// //////////////////////////////////////////////////////////////////////////// /** * Request to mark some shard as provisioned, transitioning them from the * PROVISIONING storage state to NONE. */ struct MarkShardsAsProvisionedRequest { /** * List of shards to be marked as provisioned. */ 1: common.ShardSet shards, } struct MarkShardsAsProvisionedResponse { /** * List of shards successfully marked as provisioned. */ 1: common.ShardSet updated_shards, /** * The version of the updated NodesConfiguration. */ 2: common.unsigned64 new_nodes_configuration_version, } //////////////////////////////////////////////////////////////////////////// ////////////////////// Bump Generation Request ///////////////////////////// //////////////////////////////////////////////////////////////////////////// /** * Request to bump the generation of all the nodes that match the passed * filters. */ struct BumpGenerationRequest { /** * List of NodeFilters to bump their generationin the nodes configuration. * Matches from each filter are union-ed together and are updated in the same * nodes configuration transaction. */ 1: list<nodes.NodesFilter> node_filters, } struct BumpGenerationResponse { /** * List of nodes that we successfully bumped the generation for. */ 1: list<common.NodeID> bumped_nodes, /** * The version of the updated NodesConfiguration. */ 2: common.unsigned64 new_nodes_configuration_version, } //////////////////////////////////////////////////////////////////////////// ////////////////////// Boostrap Cluster Request //////////////////////////// //////////////////////////////////////////////////////////////////////////// /** * Request to finalize the bootstrapping of the cluster */ struct BootstrapClusterRequest { /** * The metadata replication property that this cluster will have. This will * be used to provision the initial metadata nodeset. */ 1: common.ReplicationProperty metadata_replication_property, } struct BootstrapClusterResponse { /** * The version of the updated NodesConfiguration. */ 1: common.unsigned64 new_nodes_configuration_version, }
{ "pile_set_name": "Github" }
{ 1, 4, 6, 3, 7, 12, 72, 3 } { 1, 3, 3, 4, 6, 7, 12, 72 }
{ "pile_set_name": "Github" }
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import { CancellationToken } from 'vscode-jsonrpc' import { FoldingRange } from 'vscode-languageserver-types' import { TextDocument } from 'vscode-languageserver-textdocument' import { FoldingContext, FoldingRangeProvider } from 'coc.nvim/lib/provider' import { workspace } from 'coc.nvim' import Proto from '../protocol' import { ITypeScriptServiceClient } from '../typescriptService' import * as typeConverters from '../utils/typeConverters' export default class TypeScriptFoldingProvider implements FoldingRangeProvider { public constructor(private readonly client: ITypeScriptServiceClient) { } public async provideFoldingRanges( document: TextDocument, _context: FoldingContext, token: CancellationToken ): Promise<FoldingRange[] | undefined> { const file = this.client.toPath(document.uri) if (!file) { return } const args: Proto.FileRequestArgs = { file } const res = await this.client.execute('getOutliningSpans', args, token) if (res.type != 'response') { return } const { body } = res if (!body) { return } return body .map(span => this.convertOutliningSpan(span, document)) .filter(foldingRange => !!foldingRange) as FoldingRange[] } private convertOutliningSpan( span: Proto.OutliningSpan, document: TextDocument ): FoldingRange | undefined { const range = typeConverters.Range.fromTextSpan(span.textSpan) const kind = TypeScriptFoldingProvider.getFoldingRangeKind(span) // Workaround for #49904 if (span.kind === 'comment') { let doc = workspace.getDocument(document.uri) const line = doc.getline(range.start.line) if (line.match(/\/\/\s*#endregion/gi)) { return undefined } } let { start, end } = range return FoldingRange.create(start.line, end.line, start.character, end.character, kind) } private static getFoldingRangeKind( span: Proto.OutliningSpan ): string { switch (span.kind) { case 'comment': case 'region': case 'imports': case 'code': return span.kind default: return undefined } } }
{ "pile_set_name": "Github" }
/* FX domain filter corelation coefficient filter*/ #include "su.h" #include "segy.h" #define PFA_MAX 720720 /* Largest allowed nfft */ #define PIP2 1.570796327 #define AMPSP(c) rcabs(c) #define PHSSP(c) atan2(c.i,c.r) /*********************** self documentation **********************/ char *sdoc[] = { " SUCCFILT - FX domain Correlation Coefficient FILTER ", " ", " sucff < stdin > stdout [optional parameters] ", " ", " Optional parameters: ", " cch=1.0 Correlation coefficient high pass value ", " ccl=0.5 Correlation coefficient low pass value ", " key=ep ensemble identifier ", " padd=20 FFT padding in percentage ", " ", NULL}; /* * Credits: * Potash Corporation: Balazs Nemeth, Saskatoon Canada. c. 2008 */ /**************** end self doc ********************************/ segy tr; segy tr2; int main( int argc, char *argv[] ) { cwp_String key; /* header key word from segy.h */ cwp_String type; /* ... its type */ Value val; segy **rec_o=NULL; /* trace header+data matrix */ int first=0; /* true when we passed the first gather */ int ng=0; /* counter of gathers */ float dt; int nt; int ntr; int nfft=0; /* lenghth of padded array */ float snfft; /* scale factor for inverse fft */ int nf=0; /* number of frequencies */ float *rt=NULL; /* real trace */ complex **fd=NULL; /* frequency domain data */ float **cc=NULL; /* correlation coefficinet matrix */ float padd; float cch; float ccl; int verbose=0; /* Initialize */ initargs(argc, argv); requestdoc(1); if (!getparstring("key", &key)) key = "ep"; if (!getparfloat("padd", &padd)) padd = 25.0; padd = 1.0+padd/100.0; if (!getparfloat("cch", &cch)) cch = 1.0; if (!getparfloat("ccl", &ccl)) ccl = 0.3; if (!getparint("verbose",&verbose)) verbose = 0; /* get the first record */ rec_o = get_gather(&key,&type,&val,&nt,&ntr,&dt,&first); if(ntr==0) err("Can't get first record\n"); /* set up the fft */ nfft = npfar(nt*padd); if (nfft >= SU_NFLTS || nfft >= PFA_MAX) err("Padded nt=%d--too big", nfft); nf = nfft/2 + 1; snfft=1.0/nfft; rt = ealloc1float(nfft); do { ng++; fd = ealloc2complex(nf,ntr); cc = ealloc2float(nf,ntr); /* transform the data into FX domain */ { unsigned int itr; for(itr=0;itr<ntr;itr++) { memcpy( (void *) rt, (const void *) (*rec_o[itr]).data,nt*FSIZE); memset( (void *) &rt[nt], (int) '\0', (nfft - nt)*FSIZE); pfarc(1, nfft, rt, fd[itr]); } } /* Compute correlation coefficients */ { unsigned int itr,ifr; for(itr=0;itr<ntr-1;itr++) { for(ifr=0;ifr<nf-1;ifr++) { cc[itr][ifr] = cos(PHSSP(fd[itr][ifr])-PHSSP(fd[itr+1][ifr])); } } } /* Filter */ { unsigned int itr,ifr; for(itr=0;itr<ntr-1;itr++) { for(ifr=0;ifr<nf-1;ifr++) { if(cc[itr][ifr]> cch || cc[itr][ifr]<ccl) { fd[itr][ifr].r = 0.0; fd[itr][ifr].i = 0.0; } } } } { unsigned int itr,it; for(itr=0;itr<ntr;itr++) { pfacr(-1, nfft, fd[itr], rt); for(it=0;it<nt;it++) (*rec_o[itr]).data[it]=rt[it]*snfft; } } free2complex(fd); free2float(cc); rec_o = put_gather(rec_o,&nt,&ntr); rec_o = get_gather(&key,&type,&val,&nt,&ntr,&dt,&first); if (verbose) warn(" %d %d\n",ng,ntr); } while(ntr); free1float(rt); warn("Number of gathers %10d\n",ng); return EXIT_SUCCESS; }
{ "pile_set_name": "Github" }
using System; using System.Collections.Concurrent; using System.Net.Http; namespace cloudscribe.Email.Senders { public class DefaultServiceClientProvider : IServiceClientProvider // Register as singleton { public DefaultServiceClientProvider() { _httpClients = new ConcurrentDictionary<Uri, HttpClient>(); } private readonly ConcurrentDictionary<Uri, HttpClient> _httpClients; public HttpClient GetOrCreateHttpClient(Uri baseAddress) { return _httpClients.GetOrAdd(baseAddress, b => new HttpClient { BaseAddress = b }); } public void Dispose() { foreach (var httpClient in _httpClients.Values) { httpClient.Dispose(); } } } }
{ "pile_set_name": "Github" }
From c98680380b35e7358e7ab7a25d8f2d5e9330b170 Mon Sep 17 00:00:00 2001 From: Laurentiu Tudor <laurentiu.tudor@nxp.com> Date: Wed, 10 Jan 2018 16:29:49 +0200 Subject: [PATCH 071/107] armv8: fsl-layerscape: add missing register blocks base address defines Add defines for the edma and qdma register block base addresses. Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com> --- .../include/asm/arch-fsl-layerscape/immap_lsch2.h | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h b/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h index af68af4..b1f3d22 100644 --- a/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h +++ b/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h @@ -89,8 +89,12 @@ #define LPUART_BASE (CONFIG_SYS_IMMR + 0x01950000) +#define EDMA_BASE_ADDR (CONFIG_SYS_IMMR + 0x01c00000) + #define AHCI_BASE_ADDR (CONFIG_SYS_IMMR + 0x02200000) +#define QDMA_BASE_ADDR (CONFIG_SYS_IMMR + 0x07380000) + #define CONFIG_SYS_PCIE1_PHYS_ADDR 0x4000000000ULL #define CONFIG_SYS_PCIE2_PHYS_ADDR 0x4800000000ULL #define CONFIG_SYS_PCIE3_PHYS_ADDR 0x5000000000ULL -- 1.7.1
{ "pile_set_name": "Github" }
var LodashWrapper = require('./_LodashWrapper'); /** * Executes the chain sequence and returns the wrapped result. * * @name commit * @memberOf _ * @since 3.2.0 * @category Seq * @returns {Object} Returns the new `lodash` wrapper instance. * @example * * var array = [1, 2]; * var wrapped = _(array).push(3); * * console.log(array); * // => [1, 2] * * wrapped = wrapped.commit(); * console.log(array); * // => [1, 2, 3] * * wrapped.last(); * // => 3 * * console.log(array); * // => [1, 2, 3] */ function wrapperCommit() { return new LodashWrapper(this.value(), this.__chain__); } module.exports = wrapperCommit;
{ "pile_set_name": "Github" }
const components = [ { title: 'Appbar', path: '/components/appbar', }, { title: 'Searchbar', path: '/components/searchbar', subsubItem: true, }, { title: 'Appbar Bottom', path: '/components/appbar-bottom', }, { title: 'Avatar', path: '/components/avatar', }, { title: 'Backdrop', path: '/components/backdrop', }, { title: 'Badge', path: '/components/badge', }, { title: 'Banner', path: '/components/banner', }, { title: 'Bottom Navigation', path: '/components/bottom-navigation', }, { title: 'Bottom Navigation Item', path: '/components/bottom-navigation-item', subsubItem: true, }, { title: 'Button', path: '/components/button', }, { title: 'Card', path: '/components/card', }, { title: 'CardActions', path: '/components/card-actions', subsubItem: true, }, { title: 'CardContent', path: '/components/card-content', subsubItem: true, }, { title: 'CardHeader', path: '/components/card-header', subsubItem: true, }, { title: 'CardMedia', path: '/components/card-media', subsubItem: true, }, { title: 'Checkbox', path: '/components/checkbox', }, { title: 'Chip', path: '/components/chip', }, { title: 'DataTable', path: '/components/datatable', }, { title: 'DataTableCell', path: '/components/datatable-cell', subsubItem: true, }, { title: 'DataTableHeader', path: '/components/datatable-header', subsubItem: true, }, { title: 'DataTablePagination', path: '/components/datatable-pagination', subsubItem: true, }, { title: 'DataTableRow', path: '/components/datatable-row', subsubItem: true, }, { title: 'Dialog', path: '/components/dialog', }, { title: 'Divider', path: '/components/divider', }, { title: 'Drawer', path: '/components/drawer', }, { title: 'DrawerHeader', path: '/components/drawer-header', subsubItem: true, }, { title: 'DrawerItem', path: '/components/drawer-item', subsubItem: true, }, { title: 'DrawerSection', path: '/components/drawer-section', subsubItem: true, }, { title: 'DrawerBottom', path: '/components/drawer-bottom', }, { title: 'Fab', path: '/components/fab', }, { title: 'Speed dial', path: '/components/fab-speeddial', subsubItem: true, }, { title: 'Icon', path: '/components/icon', }, { title: 'IconButton', path: '/components/iconbutton', }, { title: 'List', path: '/components/list', }, { title: 'ListExpand', path: '/components/list-expand', subsubItem: true, }, { title: 'ListItem', path: '/components/list-item', subsubItem: true, }, { title: 'ListSection', path: '/components/list-section', subsubItem: true, }, { title: 'Menu', path: '/components/menu', }, { title: 'MenuItem', path: '/components/menu-item', subsubItem: true, }, { title: 'Paper', path: '/components/paper', }, { title: 'Progress Bar', path: '/components/progress-bar', }, { title: 'Progress Circle', path: '/components/progress-circle', }, { title: 'Radio Button', path: '/components/radiobutton', }, { title: 'Ripple', path: '/components/ripple', }, { title: 'Select', path: '/components/select', }, { title: 'SheetBottom', path: '/components/sheet-bottom', }, { title: 'SheetSide', path: '/components/sheet-side', }, { title: 'Slider', path: '/components/slider', }, { title: 'Snackbar', path: '/components/snackbar', }, { title: 'SwipeNav', path: '/components/swipenav', }, { title: 'Switch', path: '/components/switch', }, { title: 'Tabs', path: '/components/tabs', }, { title: 'Tab', path: '/components/tab', subsubItem: true, }, { title: 'Textfield', path: '/components/textfield', }, { title: 'Searchfield', path: '/components/searchfield', subsubItem: true, }, { title: 'ToggleButton', path: '/components/togglebutton', }, { title: 'ToggleButtonGroup', path: '/components/togglebutton-group', subsubItem: true, }, { title: 'Tooltip', path: '/components/tooltip', }, { title: 'Typography', path: '/components/typography', }, ]; export default components;
{ "pile_set_name": "Github" }
function y = vl_aibcutpush(map, x) % VL_AIBCUTPUSH Quantize based on VL_AIB cut % Y = VL_AIBCUTPUSH(MAP, X) maps the data X to elements of the AIB % cut specified by MAP. % % The function is equivalent to Y = MAP(X). % % See also: VL_HELP(), VL_AIB(). % Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. % All rights reserved. % % This file is part of the VLFeat library and is made available under % the terms of the BSD license (see the COPYING file). y = map(x) ;
{ "pile_set_name": "Github" }
<!DOCTYPE html> <html> <div> <div> <div> <strong>Text</strong> </div> </div> </div>
{ "pile_set_name": "Github" }
component accessors="true" mappedSuperClass="true"{ property name="superPersistentField"; }
{ "pile_set_name": "Github" }
var searchData= [ ['other_250',['OTHER',['../namespace_a_d_c___error.html#ad050c44d1f3422d02e5f9726edeee8f0a03570470bad94692ce93e32700d2e1cb',1,'ADC_Error']]] ];
{ "pile_set_name": "Github" }
/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" ) // CustomResourceDefinitionLister helps list CustomResourceDefinitions. type CustomResourceDefinitionLister interface { // List lists all CustomResourceDefinitions in the indexer. List(selector labels.Selector) (ret []*v1beta1.CustomResourceDefinition, err error) // Get retrieves the CustomResourceDefinition from the index for a given name. Get(name string) (*v1beta1.CustomResourceDefinition, error) CustomResourceDefinitionListerExpansion } // customResourceDefinitionLister implements the CustomResourceDefinitionLister interface. type customResourceDefinitionLister struct { indexer cache.Indexer } // NewCustomResourceDefinitionLister returns a new CustomResourceDefinitionLister. func NewCustomResourceDefinitionLister(indexer cache.Indexer) CustomResourceDefinitionLister { return &customResourceDefinitionLister{indexer: indexer} } // List lists all CustomResourceDefinitions in the indexer. func (s *customResourceDefinitionLister) List(selector labels.Selector) (ret []*v1beta1.CustomResourceDefinition, err error) { err = cache.ListAll(s.indexer, selector, func(m interface{}) { ret = append(ret, m.(*v1beta1.CustomResourceDefinition)) }) return ret, err } // Get retrieves the CustomResourceDefinition from the index for a given name. func (s *customResourceDefinitionLister) Get(name string) (*v1beta1.CustomResourceDefinition, error) { obj, exists, err := s.indexer.GetByKey(name) if err != nil { return nil, err } if !exists { return nil, errors.NewNotFound(v1beta1.Resource("customresourcedefinition"), name) } return obj.(*v1beta1.CustomResourceDefinition), nil }
{ "pile_set_name": "Github" }
/* Drawpile - a collaborative drawing program. Copyright (C) 2014 Calle Laakkonen Drawpile is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Drawpile 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 GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Drawpile. If not, see <http://www.gnu.org/licenses/>. */ #ifndef BRUSHPREVIEW_PLUGIN_H #define BRUSHPREVIEW_PLUGIN_H #include <QtUiPlugin/QDesignerCustomWidgetCollectionInterface> class BrushPreviewPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: BrushPreviewPlugin(QObject *parent = 0); bool isContainer() const; bool isInitialized() const; QIcon icon() const; QString domXml() const; QString group() const; QString includeFile() const; QString name() const; QString toolTip() const; QString whatsThis() const; QWidget *createWidget(QWidget *parent); void initialize(QDesignerFormEditorInterface *core); private: bool initialized; }; #endif
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <DIF xmlns="http://gcmd.gsfc.nasa.gov/Aboutus/xml/dif/" xmlns:dif="http://gcmd.gsfc.nasa.gov/Aboutus/xml/dif/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://gcmd.gsfc.nasa.gov/Aboutus/xml/dif/ http://gcmd.gsfc.nasa.gov/Aboutus/xml/dif/dif_v10.2.xsd"> <Entry_ID> <Short_Name>GPM_2ADPR</Short_Name> <Version>05</Version> </Entry_ID> <Version_Description>Not provided</Version_Description> <Entry_Title>GPM DPR Precipitation Profile L2A 1.5 hours 5 km V05 (GPM_2ADPR) at GES DISC</Entry_Title> <Dataset_Citation> <Dataset_Creator>Toshio Iguchi, Robert Meneghini</Dataset_Creator> <Dataset_Title>GPM DPR Precipitation Profile L2A 1.5 hours 5 km V05</Dataset_Title> <Dataset_Series_Name>GPM_2ADPR</Dataset_Series_Name> <Dataset_Release_Date>2017-05-17</Dataset_Release_Date> <Dataset_Release_Place>Greenbelt, MD</Dataset_Release_Place> <Dataset_Publisher>Goddard Earth Sciences Data and Information Services Center (GES DISC)</Dataset_Publisher> <Version>05</Version> <Data_Presentation_Form>Digital Science Data</Data_Presentation_Form> <Persistent_Identifier> <Type>DOI</Type> <Identifier>10.5067/GPM/DPR/GPM/2A/05</Identifier> </Persistent_Identifier> <Online_Resource>https://disc.gsfc.nasa.gov/datacollection/GPM_2ADPR_05.html</Online_Resource> </Dataset_Citation> <Personnel> <Role>TECHNICAL CONTACT</Role> <Contact_Person> <First_Name>JOYCE</First_Name> <Last_Name>CHOU</Last_Name> <Address> <Street_Address>NASA Goddard Space Flight Center</Street_Address> <Street_Address>Mailstop 610.2</Street_Address> <City>Greenbelt</City> <State_Province>MD</State_Province> <Postal_Code>20771</Postal_Code> <Country>USA</Country> </Address> <Phone> <Number>301-614-6870</Number> <Type>Telephone</Type> </Phone> <Phone> <Number>301-614-5575</Number> <Type>Fax</Type> </Phone> <Email>helpdesk@pps-mail.nascom.nasa.gov</Email> </Contact_Person> </Personnel> <Personnel> <Role>METADATA AUTHOR</Role> <Contact_Person> <First_Name>ANDREY</First_Name> <Last_Name>SAVTCHENKO</Last_Name> <Address> <Street_Address>Distributed Active Archive Center Global Change Data Center</Street_Address> <Street_Address>Code 610.2</Street_Address> <Street_Address>NASA Goddard Space Flight Center</Street_Address> <City>Greenbelt</City> <State_Province>MD</State_Province> <Postal_Code>20771</Postal_Code> <Country>USA</Country> </Address> <Phone> <Number>301-614-5705</Number> <Type>Telephone</Type> </Phone> <Email>Andrey.Savtchenko@nasa.gov</Email> </Contact_Person> </Personnel> <Science_Keywords> <Category>EARTH SCIENCE</Category> <Topic>ATMOSPHERE</Topic> <Term>ATMOSPHERIC WATER VAPOR</Term> </Science_Keywords> <Science_Keywords> <Category>EARTH SCIENCE</Category> <Topic>ATMOSPHERE</Topic> <Term>PRECIPITATION</Term> </Science_Keywords> <Science_Keywords> <Category>EARTH SCIENCE</Category> <Topic>SPECTRAL/ENGINEERING</Topic> <Term>RADAR</Term> </Science_Keywords> <ISO_Topic_Category>CLIMATOLOGY/METEOROLOGY/ATMOSPHERE</ISO_Topic_Category> <Ancillary_Keyword>Atmosphere, Precipitation, Water Vapor</Ancillary_Keyword> <Platform> <Type>Earth Observation Satellites</Type> <Short_Name>GPM</Short_Name> <Long_Name>Global Precipitation Measurement</Long_Name> <Instrument> <Short_Name>DPR</Short_Name> <Long_Name>Dual-frequency Precipitation Radar</Long_Name> </Instrument> </Platform> <Temporal_Coverage> <Range_DateTime> <Beginning_Date_Time>2014-03-08</Beginning_Date_Time> </Range_DateTime> </Temporal_Coverage> <Dataset_Progress>IN WORK</Dataset_Progress> <Spatial_Coverage> <Granule_Spatial_Representation>GEODETIC</Granule_Spatial_Representation> <Geometry> <Coordinate_System>GEODETIC</Coordinate_System> <Bounding_Rectangle> <Southernmost_Latitude>-70.0</Southernmost_Latitude> <Northernmost_Latitude>70.0</Northernmost_Latitude> <Westernmost_Longitude>-180.0</Westernmost_Longitude> <Easternmost_Longitude>180.0</Easternmost_Longitude> </Bounding_Rectangle> </Geometry> </Spatial_Coverage> <Location> <Location_Category>GEOGRAPHIC REGION</Location_Category> <Location_Type>TROPICS</Location_Type> </Location> <Data_Resolution> <Latitude_Resolution>5 km</Latitude_Resolution> <Longitude_Resolution>5 km</Longitude_Resolution> <Vertical_Resolution>125-250 m</Vertical_Resolution> <Temporal_Resolution>1.5 hours</Temporal_Resolution> </Data_Resolution> <Project> <Short_Name>GPM</Short_Name> <Long_Name>Global Precipitation Measurement</Long_Name> </Project> <Quality>The presence of changing topography (ex.: mountains) presents challenges to the ability of the algorithm to distinguish between precipitation echo and surface clutter. The Ka frequency undergoes larger extinction through precipitation, and the dual-frequency retrieval may be limited to lower-moderate rain rates. As the DPR will be the first dual-frequency weather radar flown in space, dual-frequency retrieval methods will need extensive testing and validation. Major sources of error that have an impact on estimates of surface precipitation include clutter contamination of near-surface echoes, incorrect identification of precipitation type (convective/stratiform), and severe attenuation of the Ka-band data in heavy precipitation.</Quality> <Access_Constraints>None</Access_Constraints> <Dataset_Language>English</Dataset_Language> <Originating_Center>Precipitation Processing System (PPS)</Originating_Center> <Organization> <Organization_Type>ARCHIVER</Organization_Type> <Organization_Name> <Short_Name>NASA/GSFC/SED/ESD/GCDC/GESDISC</Short_Name> <Long_Name>Goddard Earth Sciences Data and Information Services Center (formerly Goddard DAAC), Global Change Data Center, Earth Sciences Division, Science and Exploration Directorate, Goddard Space Flight Center, NASA</Long_Name> </Organization_Name> <Organization_URL>https://disc.gsfc.nasa.gov/</Organization_URL> <Personnel> <Role>DATA CENTER CONTACT</Role> <Contact_Person> <Last_Name>GES DISC HELP DESK SUPPORT GROUP</Last_Name> <Address> <Street_Address>Goddard Earth Sciences Data and Information Services Center</Street_Address> <Street_Address>Code 610.2</Street_Address> <Street_Address>NASA Goddard Space Flight Center</Street_Address> <City>Greenbelt</City> <State_Province>MD</State_Province> <Postal_Code>20771</Postal_Code> <Country>USA</Country> </Address> <Phone> <Number>301-614-5224</Number> <Type>Telephone</Type> </Phone> <Phone> <Number>301-614-5268</Number> <Type>Fax</Type> </Phone> <Email>gsfc-help-disc@lists.nasa.gov</Email> </Contact_Person> </Personnel> </Organization> <Distribution> <Distribution_Media>Online Archive</Distribution_Media> <Distribution_Size>400 MB per file</Distribution_Size> <Distribution_Format>HDF-5</Distribution_Format> <Fees>None</Fees> </Distribution> <Multimedia_Sample> <File>GPM</File> <URL>https://docserver.gesdisc.eosdis.nasa.gov/public/project/GPM/browse/2A-BR.GPM.DPR.V7-20170308.20150101-S012932-E030203.004783.V05A.PNG</URL> <Format>PNG</Format> <Caption>Precipitation Radar Precipitation Rate</Caption> <Description>Precipitation Radar Precipitation Rate GPM DPR (GPM_2ADPR)</Description> </Multimedia_Sample> <Summary> <Abstract> Version 5 is the current version of the data set. Version 4 is no longer available and has been superseded by Version 5. 2ADPR provides single- and dual-frequency-derived precipitation estimates from the Ku and Ka radars of the Dual-Frequency Precipitation Radar (DPR) on the core GPM spacecraft. The output consists of three main classes of precipitation products: those derived from the Ku-band frequency over a wide swath (245 km), those derived from the Ka-band frequency over a narrow swath (125 km), and those derived from the dual-frequency data over the narrow swath. The Ka-band results are further divided into the standard and high-sensitivity estimates. In the standard sensitivity mode, the fields of view within the inner swath are matched to those of the Ku-band. Data from these matched-beam Ku- and Ka-band fields of view are used to derive the dual-frequency precipitation products. The retrievals are performed at each radar range bin along the slant path of the radar instrument field of view (IFOV).</Abstract> </Summary> <Related_URL> <URL_Content_Type> <Type>GET DATA</Type> <Subtype>ON-LINE ARCHIVE</Subtype> </URL_Content_Type> <URL>https://gpm1.gesdisc.eosdis.nasa.gov/data/GPM_L2/GPM_2ADPR.05/</URL> <Description>Access the data via HTTP.</Description> </Related_URL> <Related_URL> <URL_Content_Type> <Type>GET DATA</Type> <Subtype>MIRADOR</Subtype> </URL_Content_Type> <URL>https://mirador.gsfc.nasa.gov/cgi-bin/mirador/homepageAlt.pl?keyword=GPM_2ADPR</URL> <Description>Mirador is a data search interface that allows searching, browsing, and retrieving of Earth science data archived at NASA GES DISC.</Description> </Related_URL> <Related_URL> <URL_Content_Type> <Type>GET DATA</Type> <Subtype>OPENDAP DATA</Subtype> </URL_Content_Type> <URL>https://gpm1.gesdisc.eosdis.nasa.gov/opendap/GPM_L2/GPM_2ADPR.05/contents.html</URL> <Description>Access the data via the OPeNDAP protocol.</Description> </Related_URL> <Related_URL> <URL_Content_Type> <Type>GET DATA</Type> <Subtype>EARTHDATA SEARCH</Subtype> </URL_Content_Type> <URL>https://search.earthdata.nasa.gov/search?q=GPM_2ADPR</URL> <Description>Use the Earthdata Search to find and retrieve data sets across multiple data centers.</Description> </Related_URL> <Related_URL> <URL_Content_Type> <Type>VIEW PROJECT HOME PAGE</Type> </URL_Content_Type> <URL>https://pmm.gsfc.nasa.gov/GPM</URL> <Description>GPM Project Home Page</Description> </Related_URL> <Related_URL> <URL_Content_Type> <Type>VIEW RELATED INFORMATION</Type> <Subtype>USER'S GUIDE</Subtype> </URL_Content_Type> <URL>https://gpm1.gesdisc.eosdis.nasa.gov/data/doc/README.GPM.pdf</URL> <Description>README Document</Description> </Related_URL> <Related_URL> <URL_Content_Type> <Type>VIEW RELATED INFORMATION</Type> <Subtype>ALGORITHM THEORETICAL BASIS DOCUMENT (ATBD)</Subtype> </URL_Content_Type> <URL>https://pps.gsfc.nasa.gov/Documents/ATBD_GPM_DPR_n3_dec15.pdf</URL> </Related_URL> <Related_URL> <URL_Content_Type> <Type>VIEW RELATED INFORMATION</Type> <Subtype>FILE SPECIFICATION DOCUMENT</Subtype> </URL_Content_Type> <URL>ftp://gpmweb2.pps.eosdis.nasa.gov/pub/GPMfilespec/filespec.GPM.pdf</URL> </Related_URL> <Related_URL> <URL_Content_Type> <Type>VIEW RELATED INFORMATION</Type> <Subtype>GENERAL DOCUMENTATION</Subtype> </URL_Content_Type> <URL>https://pps.gsfc.nasa.gov/Documents/V05ReleaseNotes/Caveats_DPRL2_productV05.pdf</URL> <Description>Release Notes</Description> </Related_URL> <Related_URL> <URL_Content_Type> <Type>VIEW RELATED INFORMATION</Type> </URL_Content_Type> <URL>https://pps.gsfc.nasa.gov/Documents/DPR_L2_variables_20101128.xls</URL> </Related_URL> <Originating_Metadata_Node>GCMD</Originating_Metadata_Node> <Metadata_Name>CEOS IDN DIF</Metadata_Name> <Metadata_Version>VERSION 10.2</Metadata_Version> <Metadata_Dates> <Metadata_Creation>2017-05-17</Metadata_Creation> <Metadata_Last_Revision>2017-05-17</Metadata_Last_Revision> <Metadata_Future_Review>2018-05-12</Metadata_Future_Review> <Data_Creation>2017-05-17</Data_Creation> <Data_Last_Revision>2017-05-17</Data_Last_Revision> </Metadata_Dates> <Product_Level_Id>2</Product_Level_Id> <Extended_Metadata> <Metadata> <Group>gov.nasa.gsfc.disc</Group> <Name>Data Granularity</Name> <Description>The time coverage of individual data granules.</Description> <Value>90 minutes</Value> </Metadata> </Extended_Metadata> <Extended_Metadata> <Metadata> <Group>gov.nasa.gsfc.gcmd</Group> <Name>metadata.uuid</Name> <Value>e3df8bf7-375b-41cc-b35d-172451f04567</Value> </Metadata> <Metadata> <Group>gov.nasa.gsfc.gcmd</Group> <Name>metadata.extraction_date</Name> <Value>2016-01-19 09:27:57</Value> </Metadata> <Metadata> <Group>gov.nasa.gsfc.gcmd</Group> <Name>metadata.keyword_version</Name> <Value>8.1</Value> </Metadata> </Extended_Metadata> <Extended_Metadata> <Metadata> <Group>gov.nasa.gsfc.gcmd</Group> <Name>DIF9.0-to-DIF10-Converter</Name> <Value>2016-01-20T13:00:04Z</Value> <Value>Version:-3.0</Value> <Value>Target:10.2</Value> </Metadata> </Extended_Metadata> <Extended_Metadata> <Metadata> <Group>gov.nasa.gsfc.gcmd</Group> <Name>IDN_Node.Short_Name</Name> <Value>USA/NASA</Value> </Metadata> </Extended_Metadata> <Extended_Metadata> <Metadata> <Group>gov.nasa.gsfc.gcmd</Group> <Name>IDN_Node.UUID</Name> <Value>9ae20472-ba4c-4b01-8d97-857b73fa3c95</Value> </Metadata> </Extended_Metadata> <Extended_Metadata> <Metadata> <Group>gov.nasa.gsfc.gcmd</Group> <Name>Original.Metadata_Version</Name> <Value>VERSION 9.9.3</Value> </Metadata> </Extended_Metadata> <Extended_Metadata> <Metadata> <Group>gov.nasa.gsfc.gcmd</Group> <Name>Original.Dataset_Language</Name> <Value>English</Value> </Metadata> </Extended_Metadata> <Extended_Metadata> <Metadata> <Group>gov.nasa.gsfc.gcmd</Group> <Name>Original.xsi:schemaLocation</Name> <Value>http://gcmd.gsfc.nasa.gov/Aboutus/xml/dif/ http://gcmd.gsfc.nasa.gov/Aboutus/xml/dif/dif_v9.9.3.xsd</Value> </Metadata> </Extended_Metadata> </DIF>
{ "pile_set_name": "Github" }
/* This file is part of GOTCHA. For copyright information see the COPYRIGHT file in the top level directory, or at https://github.com/LLNL/gotcha/blob/master/COPYRIGHT This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (as published by the Free Software Foundation) version 2.1 dated February 1999. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and conditions of the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "translations.h" #include "libc_wrappers.h" #include "gotcha/gotcha.h" #include "gotcha/gotcha_types.h" #include "gotcha_utils.h" #include "gotcha_auxv.h" #include "gotcha_dl.h" #include "elf_ops.h" #include "tool.h" static void writeAddress(void* write, void* value){ *(void**)write = value; } static void** getBindingAddressPointer(struct gotcha_binding_t* in){ return (void**)in->function_handle; } static void setBindingAddressPointer(struct gotcha_binding_t* in, void* value){ void **target = getBindingAddressPointer(in); debug_printf(3, "Updating binding address pointer at %p to %p\n", target, value); writeAddress(target, value); } static void** getInternalBindingAddressPointer(struct internal_binding_t** in){ return (void**)&((*in)->wrappee_pointer); } static void setInternalBindingAddressPointer(void** in, void* value){ void** target = getInternalBindingAddressPointer((struct internal_binding_t**)in); debug_printf(3, "Updating binding address pointer at %p to %p\n", target, value); writeAddress(target, value); } int prepare_symbol(struct internal_binding_t *binding) { int result; struct link_map *lib; struct gotcha_binding_t *user_binding = binding->user_binding; debug_printf(2, "Looking up exported symbols for %s\n", user_binding->name); for (lib = _r_debug.r_map; lib != 0; lib = lib->l_next) { struct library_t *int_library = get_library(lib); if (!int_library) { debug_printf(3, "Creating new library object for %s\n", LIB_NAME(lib)); int_library = add_library(lib); } if (is_vdso(lib)) { debug_printf(2, "Skipping VDSO library at 0x%lx with name %s\n", lib->l_addr, LIB_NAME(lib)); continue; } debug_printf(2, "Searching for exported symbols in %s\n", LIB_NAME(lib)); INIT_DYNAMIC(lib); if (!gnu_hash && !elf_hash) { debug_printf(3, "Library %s does not export or import symbols\n", LIB_NAME(lib)); continue; } result = -1; if (gnu_hash) { debug_printf(3, "Checking GNU hash for %s in %s\n", user_binding->name, LIB_NAME(lib)); result = lookup_gnu_hash_symbol(user_binding->name, symtab, strtab, (struct gnu_hash_header *) gnu_hash); } if (elf_hash && result == -1) { debug_printf(3, "Checking ELF hash for %s in %s\n", user_binding->name, LIB_NAME(lib)); result = lookup_elf_hash_symbol(user_binding->name, symtab, strtab, (ElfW(Word) *)elf_hash); } if (result == -1) { debug_printf(3, "%s not found in %s\n", user_binding->name, LIB_NAME(lib)); continue; } if (! GOTCHA_CHECK_VISIBILITY(symtab[result])) { debug_printf(3, "Symbol %s found but not exported in %s\n", user_binding->name, LIB_NAME(lib)); continue; } debug_printf(2, "Symbol %s found in %s at 0x%lx\n", user_binding->name, LIB_NAME(lib), symtab[result].st_value + lib->l_addr); setInternalBindingAddressPointer(user_binding->function_handle,(void *)(symtab[result].st_value + lib->l_addr)); return 0; } debug_printf(1, "Symbol %s was found in program\n", user_binding->name); return -1; } static void insert_at_head(struct internal_binding_t *binding, struct internal_binding_t *head) { binding->next_binding = head; setInternalBindingAddressPointer(binding->user_binding->function_handle, head->user_binding->wrapper_pointer); removefrom_hashtable(&function_hash_table, (void*) binding->user_binding->name); addto_hashtable(&function_hash_table, (void*)binding->user_binding->name, (void*)binding); } static void insert_after_pos(struct internal_binding_t *binding, struct internal_binding_t *pos) { setInternalBindingAddressPointer(binding->user_binding->function_handle, pos->wrappee_pointer); setInternalBindingAddressPointer(pos->user_binding->function_handle, binding->user_binding->wrapper_pointer); binding->next_binding = pos->next_binding; pos->next_binding = binding; } #define RWO_NOCHANGE 0 #define RWO_NEED_LOOKUP (1 << 0) #define RWO_NEED_BINDING (1 << 1) static int rewrite_wrapper_orders(struct internal_binding_t* binding) { const char* name = binding->user_binding->name; int insert_priority = get_priority(binding->associated_binding_table->tool); if(gotcha_strcmp(name,"main")==0){ if(!main_wrapped){ debug_printf(2, "Wrapping main with Gotcha's internal wrappers"); main_wrapped = 1; gotcha_wrap(libc_main_wrappers,1,"gotcha"); gotcha_wrap(main_wrappers,1,"gotcha"); } } debug_printf(2, "gotcha_rewrite_wrapper_orders for binding %s in tool %s of priority %d\n", name, binding->associated_binding_table->tool->tool_name, insert_priority); struct internal_binding_t* head; int hash_result; hash_result = lookup_hashtable(&function_hash_table, (void*)name, (void**)&head); if(hash_result != 0) { debug_printf(2, "Adding new entry for %s to hash table\n", name); addto_hashtable(&function_hash_table, (void *) name, (void *) binding); return (RWO_NEED_LOOKUP | RWO_NEED_BINDING); } int head_priority = get_priority(head->associated_binding_table->tool); if (head_priority < insert_priority) { debug_printf(2, "New binding priority %d is greater than head priority %d, adding to head\n", insert_priority, head_priority); insert_at_head(binding, head); return RWO_NEED_BINDING; } struct internal_binding_t* cur; for (cur = head; cur->next_binding; cur = cur->next_binding) { int next_priority = get_priority(cur->next_binding->associated_binding_table->tool); debug_printf(3, "Comparing binding for new insertion %d to binding for tool %s at %d\n", insert_priority, cur->next_binding->associated_binding_table->tool->tool_name, next_priority); if (next_priority < insert_priority) { break; } if (cur->user_binding->wrapper_pointer == binding->user_binding->wrapper_pointer) { debug_printf(3, "Tool is already inserted. Skipping binding rewrite\n"); return RWO_NOCHANGE; } } debug_printf(2, "Inserting binding after tool %s\n", cur->associated_binding_table->tool->tool_name); insert_after_pos(binding, cur); return RWO_NOCHANGE; } static int update_lib_bindings(ElfW(Sym) * symbol KNOWN_UNUSED, char *name, ElfW(Addr) offset, struct link_map *lmap, hash_table_t *lookuptable) { int result; struct internal_binding_t *internal_binding; void **got_address; result = lookup_hashtable(lookuptable, name, (void **) &internal_binding); if (result != 0) return 0; got_address = (void**) (lmap->l_addr + offset); writeAddress(got_address, internal_binding->user_binding->wrapper_pointer); debug_printf(3, "Remapped call to %s at 0x%lx in %s to wrapper at 0x%p\n", name, (lmap->l_addr + offset), LIB_NAME(lmap), internal_binding->user_binding->wrapper_pointer); return 0; } #ifndef MAX #define MAX(a,b) (a>b?a:b) #endif static int mark_got_writable(struct link_map *lib) { static unsigned int page_size = 0; INIT_DYNAMIC(lib); if (!got) return 0; if (!page_size) page_size = gotcha_getpagesize(); size_t protect_size = MAX(rel_size, page_size); if(protect_size % page_size){ protect_size += page_size - ((protect_size) %page_size); } ElfW(Addr) prot_address = BOUNDARY_BEFORE(got,(ElfW(Addr))page_size); debug_printf(3, "Setting library %s GOT table from %p to +%lu to writeable\n", LIB_NAME(lib), (void *) prot_address, protect_size); int res = gotcha_mprotect((void*)prot_address,protect_size,PROT_READ | PROT_WRITE | PROT_EXEC ); if(res == -1){ // mprotect returns -1 on an error error_printf("GOTCHA attempted to mark the GOT table as writable and was unable to do so, " "calls to wrapped functions may likely fail.\n"); } return 0; } static int update_library_got(struct link_map *map, hash_table_t *bindingtable) { struct library_t *lib = get_library(map); if (!lib) { debug_printf(3, "Creating new library object for %s\n", LIB_NAME(map)); lib = add_library(map); } if (!libraryFilterFunc(map)) { debug_printf(3, "Skipping library %s due to libraryFilterFunc\n", LIB_NAME(map)); return 0; } if (lib->generation == current_generation) { debug_printf(2, "Library %s is already up-to-date. Skipping GOT rewriting\n", LIB_NAME(map)); return 0; } if (!(lib->flags & LIB_GOT_MARKED_WRITEABLE)) { mark_got_writable(map); lib->flags |= LIB_GOT_MARKED_WRITEABLE; } FOR_EACH_PLTREL(map, update_lib_bindings, map, bindingtable); lib->generation = current_generation; return 0; } void update_all_library_gots(hash_table_t *bindings) { struct link_map *lib_iter; debug_printf(2, "Searching all callsites for %lu bindings\n", (unsigned long) bindings->entry_count); for (lib_iter = _r_debug.r_map; lib_iter != 0; lib_iter = lib_iter->l_next) { update_library_got(lib_iter, bindings); } } GOTCHA_EXPORT enum gotcha_error_t gotcha_wrap(struct gotcha_binding_t* user_bindings, int num_actions, const char* tool_name) { int i, not_found = 0, new_bindings_count = 0; tool_t *tool; hash_table_t new_bindings; gotcha_init(); debug_printf(1, "User called gotcha_wrap for tool %s with %d bindings\n", tool_name, num_actions); if (debug_level >= 3) { for (i = 0; i < num_actions; i++) { debug_bare_printf(3, "\t%d: %s will map to %p\n", i, user_bindings[i].name, user_bindings[i].wrapper_pointer); } } debug_printf(3, "Initializing %d user binding entries to NULL\n", num_actions); for (i = 0; i < num_actions; i++) { setBindingAddressPointer(&user_bindings[i], NULL); } if (!tool_name) tool_name = "[UNSPECIFIED]"; tool = get_tool(tool_name); if (!tool) tool = create_tool(tool_name); if (!tool) { error_printf("Failed to create tool %s\n", tool_name); return GOTCHA_INTERNAL; } current_generation++; debug_printf(2, "Moved current_generation to %u in gotcha_wrap\n", current_generation); debug_printf(2, "Creating internal binding data structures and adding binding to tool\n"); binding_t *bindings = add_binding_to_tool(tool, user_bindings, num_actions); if (!bindings) { error_printf("Failed to create bindings for tool %s\n", tool_name); return GOTCHA_INTERNAL; } debug_printf(2, "Processing %d bindings\n", num_actions); for (i = 0; i < num_actions; i++) { struct internal_binding_t *binding = bindings->internal_bindings + i; int result = rewrite_wrapper_orders(binding); if (result & RWO_NEED_LOOKUP) { debug_printf(2, "Symbol %s needs lookup operation\n", binding->user_binding->name); int presult = prepare_symbol(binding); if (presult == -1) { debug_printf(2, "Stashing %s in notfound_binding table to re-lookup on dlopens\n", binding->user_binding->name); addto_hashtable(&notfound_binding_table, (hash_key_t) binding->user_binding->name, (hash_data_t) binding); not_found++; } } if (result & RWO_NEED_BINDING) { debug_printf(2, "Symbol %s needs binding from application\n", binding->user_binding->name); if (!new_bindings_count) { create_hashtable(&new_bindings, num_actions*2, (hash_func_t) strhash, (hash_cmp_t) gotcha_strcmp); } addto_hashtable(&new_bindings, (void *) binding->user_binding->name, (void *) binding); new_bindings_count++; } } if (new_bindings_count) { update_all_library_gots(&new_bindings); destroy_hashtable(&new_bindings); } if (not_found) { debug_printf(1, "Could not find bindings for %d / %d functions\n", not_found, num_actions); return GOTCHA_FUNCTION_NOT_FOUND; } debug_printf(1, "Gotcha wrap completed successfully\n"); return GOTCHA_SUCCESS; } static enum gotcha_error_t gotcha_configure_int(const char* tool_name, enum gotcha_config_key_t configuration_key , int value){ tool_t * tool = get_tool(tool_name); if(tool==NULL){ tool = create_tool(tool_name); } if( configuration_key == GOTCHA_PRIORITY){ tool->config.priority = value; } else{ error_printf("Invalid property being configured on tool %s\n", tool_name); return GOTCHA_INTERNAL; } return GOTCHA_SUCCESS; } GOTCHA_EXPORT enum gotcha_error_t gotcha_set_priority(const char* tool_name, int value){ gotcha_init(); debug_printf(1, "User called gotcha_set_priority(%s, %d)\n", tool_name, value); enum gotcha_error_t error_on_set = gotcha_configure_int(tool_name, GOTCHA_PRIORITY, value); if(error_on_set != GOTCHA_SUCCESS) { return error_on_set; } tool_t* tool_to_place = get_tool(tool_name); if(!tool_to_place){ tool_to_place = create_tool(tool_name); } remove_tool_from_list(tool_to_place); reorder_tool(tool_to_place); return GOTCHA_SUCCESS; } GOTCHA_EXPORT enum gotcha_error_t gotcha_get_priority(const char* tool_name, int *priority){ gotcha_init(); return get_configuration_value(tool_name, GOTCHA_PRIORITY, priority); } GOTCHA_EXPORT void* gotcha_get_wrappee(gotcha_wrappee_handle_t handle){ return ((struct internal_binding_t*)handle)->wrappee_pointer; }
{ "pile_set_name": "Github" }
/* Copyright 2010-present MongoDB Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ namespace MongoDB.Bson.Serialization { /// <summary> /// Represents a serializer that has a Representation property. /// </summary> public interface IRepresentationConfigurable { /// <summary> /// Gets the representation. /// </summary> /// <value> /// The representation. /// </value> BsonType Representation { get; } /// <summary> /// Returns a serializer that has been reconfigured with the specified representation. /// </summary> /// <param name="representation">The representation.</param> /// <returns>The reconfigured serializer.</returns> IBsonSerializer WithRepresentation(BsonType representation); } /// <summary> /// Represents a serializer that has a Representation property. /// </summary> /// <typeparam name="TSerializer">The type of the serializer.</typeparam> public interface IRepresentationConfigurable<TSerializer> : IRepresentationConfigurable where TSerializer : IBsonSerializer { /// <summary> /// Returns a serializer that has been reconfigured with the specified representation. /// </summary> /// <param name="representation">The representation.</param> /// <returns>The reconfigured serializer.</returns> new TSerializer WithRepresentation(BsonType representation); } }
{ "pile_set_name": "Github" }
################################################################################ # # Copyright 2015-2020 Félix Brezo and Yaiza Rubio # # This program is part of OSRFramework. You can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # ################################################################################ __author__ = "Felix Brezo, Yaiza Rubio <contacto@i3visio.com>" __version__ = "2.0" from osrframework.utils.platforms import Platform class Goodreads(Platform): """A <Platform> object for Goodreads""" def __init__(self): self.platformName = "Goodreads" self.tags = ["social", "opinions"] ######################## # Defining valid modes # ######################## self.isValidMode = {} self.isValidMode["phonefy"] = False self.isValidMode["usufy"] = True self.isValidMode["searchfy"] = False ###################################### # Search URL for the different modes # ###################################### # Strings with the URL for each and every mode self.url = {} #self.url["phonefy"] = "http://anyurl.com//phone/" + "<phonefy>" self.url["usufy"] = "http://www.goodreads.com/" + "<usufy>" #self.url["searchfy"] = "http://anyurl.com/search/" + "<searchfy>" ###################################### # Whether the user needs credentials # ###################################### self.needsCredentials = {} #self.needsCredentials["phonefy"] = False self.needsCredentials["usufy"] = False #self.needsCredentials["searchfy"] = False ################# # Valid queries # ################# # Strings that will imply that the query number is not appearing self.validQuery = {} # The regular expression '.+' will match any query. #self.validQuery["phonefy"] = ".*" self.validQuery["usufy"] = ".+" #self.validQuery["searchfy"] = ".*" ################### # Not_found clues # ################### # Strings that will imply that the query number is not appearing self.notFoundText = {} #self.notFoundText["phonefy"] = [] self.notFoundText["usufy"] = ["<title>Page not found</title>"] #self.notFoundText["searchfy"] = [] ######################### # Fields to be searched # ######################### self.fieldsRegExp = {} # Definition of regular expressions to be searched in phonefy mode #self.fieldsRegExp["phonefy"] = {} # Example of fields: #self.fieldsRegExp["phonefy"]["i3visio.location"] = "" # Definition of regular expressions to be searched in usufy mode self.fieldsRegExp["usufy"] = {} # Example of fields: #self.fieldsRegExp["usufy"]["i3visio.location"] = "" # Definition of regular expressions to be searched in searchfy mode #self.fieldsRegExp["searchfy"] = {} # Example of fields: #self.fieldsRegExp["searchfy"]["i3visio.location"] = "" ################ # Fields found # ################ # This attribute will be feeded when running the program. self.foundFields = {}
{ "pile_set_name": "Github" }
/* * Copyright (c) 2000-2011 Apple Computer, Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * @OSF_COPYRIGHT@ */ /* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University * All Rights Reserved. * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. * * Carnegie Mellon requests users of this software to return to * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 * * any improvements or extensions that they make and grant Carnegie Mellon * the rights to redistribute these changes. */ #include <mach_kdp.h> #include <mach/vm_param.h> #include <x86_64/lowglobals.h> /* * on x86_64 the low mem vectors live here and get mapped to 0xffffff8000002000 at * system startup time */ extern void *version; extern void *kmod; extern void *kdp_trans_off; extern void *kdp_read_io; extern void *osversion; extern void *flag_kdp_trigger_reboot; extern void *manual_pkt; lowglo lowGlo __attribute__ ((aligned(PAGE_SIZE))) = { .lgVerCode = { 'C','a','t','f','i','s','h',' ' }, .lgVersion = (uint64_t) &version, .lgKmodptr = (uint64_t) &kmod, #if MACH_KDP .lgTransOff = (uint64_t) &kdp_trans_off, .lgReadIO = (uint64_t) &kdp_read_io, #else .lgTransOff = 0, .lgReadIO = 0, #endif .lgDevSlot1 = 0, .lgDevSlot2 = 0, .lgOSVersion = (uint64_t) &osversion, #if MACH_KDP .lgRebootFlag = (uint64_t) &flag_kdp_trigger_reboot, .lgManualPktAddr = (uint64_t) &manual_pkt, #else .lgRebootFlag = 0, .lgManualPktAddr = 0, #endif };
{ "pile_set_name": "Github" }
/* * Copyright (C) 2018 Igalia S.L. * * 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 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 * HOLDER 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. */ #pragma once #if ENABLE(ASYNC_SCROLLING) && USE(NICOSIA) #include "ThreadedScrollingTree.h" namespace WebCore { class ScrollingTreeNicosia final : public ThreadedScrollingTree { public: static Ref<ScrollingTreeNicosia> create(AsyncScrollingCoordinator&); private: explicit ScrollingTreeNicosia(AsyncScrollingCoordinator&); Ref<ScrollingTreeNode> createScrollingTreeNode(ScrollingNodeType, ScrollingNodeID) override; }; } // namespace WebCore #endif // ENABLE(ASYNC_SCROLLING) && USE(NICOSIA)
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/read_dl_slide" android:layout_width="match_parent" android:layout_height="match_parent"> <RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent" android:background="@mipmap/theme_leather_bg"> <android.support.design.widget.AppBarLayout android:id="@+id/read_abl_top_menu" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/color_19" android:visibility="gone" tools:visibility="visible"> <RelativeLayout android:layout_width="match_parent" android:layout_height="48dp" android:layout_below="@+id/status_bar"> <TextView android:id="@+id/tv_toolbar_title" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerVertical="true" android:layout_marginLeft="10dp" android:drawablePadding="20dp" android:layout_marginRight="60dp" android:drawableLeft="@drawable/ic_arrow_back_white_24dp" android:ellipsize="end" android:maxLines="1" android:text="@string/app_name" android:textColor="@android:color/white" android:textSize="18sp"/> </RelativeLayout> <!--<android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:minHeight="?attr/actionBarSize" android:theme="@style/Theme.ToolBar.Menu"> &lt;!&ndash;<RelativeLayout android:layout_width="120dp" android:layout_height="50dp" android:layout_gravity="right" android:background="@color/color_19"> <TextView android:visibility="gone" android:id="@+id/read_tv_brief" style="@style/WY.Theme.TextAppearance.Read.TopMenu" android:layout_alignParentRight="true" android:text="@string/wy.read.brief"/> <TextView android:visibility="gone" android:id="@+id/read_tv_community" style="@style/WY.Theme.TextAppearance.Read.TopMenu" android:layout_toLeftOf="@id/read_tv_brief" android:text="@string/wy.read.community"/> </RelativeLayout>&ndash;&gt; </android.support.v7.widget.Toolbar>--> </android.support.design.widget.AppBarLayout> <!--阅读页面--> <com.lianglu.weyue.widget.page.PageView android:id="@+id/pv_read_page" android:layout_width="match_parent" android:layout_height="match_parent" android:clickable="true" tools:visibility="gone"/> <!--切换页面提示--> <TextView android:id="@+id/read_tv_page_tip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_above="@+id/read_ll_bottom_menu" android:layout_centerHorizontal="true" android:layout_marginBottom="10dp" android:background="@color/color_19" android:gravity="center" android:paddingBottom="8dp" android:paddingLeft="12dp" android:paddingRight="12dp" android:paddingTop="8dp" android:text="1/12" android:textColor="@color/white" android:visibility="gone"/> <!--底部页面--> <LinearLayout android:id="@+id/read_ll_bottom_menu" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:background="@color/color_19" android:clickable="true" android:orientation="vertical" android:visibility="gone" tools:visibility="visible"> <!--页面进度栏--> <LinearLayout android:layout_width="match_parent" android:layout_height="60dp" android:gravity="center_vertical" android:orientation="horizontal"> <TextView android:id="@+id/read_tv_pre_chapter" style="@style/WY.Theme.TextAppearance.Read.BottomMenu" android:layout_width="80dp" android:layout_height="match_parent" android:gravity="center" android:text="上一章"/> <SeekBar android:id="@+id/read_sb_chapter_progress" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:max="100" android:maxHeight="3dp" android:minHeight="3dp" android:progressDrawable="@drawable/seekbar_bg" android:thumb="@drawable/seekbar_thumb" android:thumbOffset="10dp"/> <TextView android:id="@+id/read_tv_next_chapter" style="@style/WY.Theme.TextAppearance.Read.BottomMenu" android:layout_width="80dp" android:layout_height="match_parent" android:gravity="center" android:text="下一章"/> </LinearLayout> <!--菜单栏--> <LinearLayout android:layout_width="match_parent" android:layout_height="72dp" android:orientation="horizontal" android:paddingBottom="12dp" android:paddingTop="12dp"> <TextView android:id="@+id/read_tv_category" style="@style/WY.Theme.TextAppearance.Read.BottomMenu.Button" android:drawableTop="@mipmap/read_menu_category" android:text="@string/wy.read.category"/> <TextView android:id="@+id/read_tv_night_mode" style="@style/WY.Theme.TextAppearance.Read.BottomMenu.Button" android:drawableTop="@mipmap/read_menu_night" android:text="@string/wy.mode.night"/> <TextView android:id="@+id/read_tv_setting" style="@style/WY.Theme.TextAppearance.Read.BottomMenu.Button" android:drawableTop="@mipmap/read_menu_font" android:text="@string/wy.read.setting"/> </LinearLayout> </LinearLayout> </RelativeLayout> <!--侧滑栏--> <LinearLayout android:layout_width="300dp" android:layout_height="match_parent" android:layout_gravity="start" android:background="@mipmap/theme_leather_bg" android:clickable="true" android:orientation="vertical" android:paddingBottom="@dimen/wy.padding.large" android:paddingTop="@dimen/wy.padding.large"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="8dp" android:layout_marginLeft="15dp" android:text="目录" android:textColor="@color/black" android:textSize="20sp"/> <RelativeLayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1"> <android.support.v7.widget.RecyclerView android:id="@+id/rv_read_category" android:layout_width="match_parent" android:layout_height="match_parent" android:scrollbars="vertical"> </android.support.v7.widget.RecyclerView> </RelativeLayout> </LinearLayout> </android.support.v4.widget.DrawerLayout>
{ "pile_set_name": "Github" }
from math import ceil from django.utils import six class InvalidPage(Exception): pass class PageNotAnInteger(InvalidPage): pass class EmptyPage(InvalidPage): pass class Paginator(object): def __init__(self, object_list, per_page, orphans=0, allow_empty_first_page=True): self.object_list = object_list self.per_page = int(per_page) self.orphans = int(orphans) self.allow_empty_first_page = allow_empty_first_page self._num_pages = self._count = None def validate_number(self, number): "Validates the given 1-based page number." try: number = int(number) except (TypeError, ValueError): raise PageNotAnInteger('That page number is not an integer') if number < 1: raise EmptyPage('That page number is less than 1') if number > self.num_pages: if number == 1 and self.allow_empty_first_page: pass else: raise EmptyPage('That page contains no results') return number def page(self, number): "Returns a Page object for the given 1-based page number." number = self.validate_number(number) bottom = (number - 1) * self.per_page top = bottom + self.per_page if top + self.orphans >= self.count: top = self.count return Page(self.object_list[bottom:top], number, self) def _get_count(self): "Returns the total number of objects, across all pages." if self._count is None: try: self._count = self.object_list.count() except (AttributeError, TypeError): # AttributeError if object_list has no count() method. # TypeError if object_list.count() requires arguments # (i.e. is of type list). self._count = len(self.object_list) return self._count count = property(_get_count) def _get_num_pages(self): "Returns the total number of pages." if self._num_pages is None: if self.count == 0 and not self.allow_empty_first_page: self._num_pages = 0 else: hits = max(1, self.count - self.orphans) self._num_pages = int(ceil(hits / float(self.per_page))) return self._num_pages num_pages = property(_get_num_pages) def _get_page_range(self): """ Returns a 1-based range of pages for iterating through within a template for loop. """ return range(1, self.num_pages + 1) page_range = property(_get_page_range) QuerySetPaginator = Paginator # For backwards-compatibility. class Page(object): def __init__(self, object_list, number, paginator): self.object_list = object_list self.number = number self.paginator = paginator def __repr__(self): return '<Page %s of %s>' % (self.number, self.paginator.num_pages) def __len__(self): return len(self.object_list) def __getitem__(self, index): if not isinstance(index, (slice,) + six.integer_types): raise TypeError # The object_list is converted to a list so that if it was a QuerySet # it won't be a database hit per __getitem__. return list(self.object_list)[index] # The following four methods are only necessary for Python <2.6 # compatibility (this class could just extend 2.6's collections.Sequence). def __iter__(self): i = 0 try: while True: v = self[i] yield v i += 1 except IndexError: return def __contains__(self, value): for v in self: if v == value: return True return False def index(self, value): for i, v in enumerate(self): if v == value: return i raise ValueError def count(self, value): return sum([1 for v in self if v == value]) # End of compatibility methods. def has_next(self): return self.number < self.paginator.num_pages def has_previous(self): return self.number > 1 def has_other_pages(self): return self.has_previous() or self.has_next() def next_page_number(self): return self.paginator.validate_number(self.number + 1) def previous_page_number(self): return self.paginator.validate_number(self.number - 1) def start_index(self): """ Returns the 1-based index of the first object on this page, relative to total objects in the paginator. """ # Special case, return zero if no items. if self.paginator.count == 0: return 0 return (self.paginator.per_page * (self.number - 1)) + 1 def end_index(self): """ Returns the 1-based index of the last object on this page, relative to total objects found (hits). """ # Special case for the last page because there can be orphans. if self.number == self.paginator.num_pages: return self.paginator.count return self.number * self.paginator.per_page
{ "pile_set_name": "Github" }
define("ace/snippets/space",["require","exports","module"], function(require, exports, module) { "use strict"; exports.snippetText =undefined; exports.scope = "space"; }); (function() { window.require(["ace/snippets/space"], function(m) { if (typeof module == "object" && typeof exports == "object" && module) { module.exports = m; } }); })();
{ "pile_set_name": "Github" }
12--Group/12_Group_Large_Group_12_Group_Large_Group_12_322.jpg 7 252.268171875 354.74903125 35.942171875 47.6090625 0.998959779739 61.5709101563 351.78440625 27.2688085938 35.64646875 0.998394787312 1000.588 380.61590625 23.388 38.52371875 0.9979403615 817.1789375 398.35190625 32.9865625 44.51434375 0.99717438221 515.53034375 375.26678125 37.79978125 47.68421875 0.996892273426 320.2469375 366.3956875 27.100625 33.72909375 0.995274066925 755.9171875 365.6883125 30.632375 38.8108125 0.989945113659
{ "pile_set_name": "Github" }
的 一 是 在 不 了 有 和 人 这 中 大 为 上 个 国 我 以 要 他 时 来 用 们 生 到 作 地 于 出 就 分 对 成 会 可 主 发 年 动 同 工 也 能 下 过 子 说 产 种 面 而 方 后 多 定 行 学 法 所 民 得 经 十 三 之 进 着 等 部 度 家 电 力 里 如 水 化 高 自 二 理 起 小 物 现 实 加 量 都 两 体 制 机 当 使 点 从 业 本 去 把 性 好 应 开 它 合 还 因 由 其 些 然 前 外 天 政 四 日 那 社 义 事 平 形 相 全 表 间 样 与 关 各 重 新 线 内 数 正 心 反 你 明 看 原 又 么 利 比 或 但 质 气 第 向 道 命 此 变 条 只 没 结 解 问 意 建 月 公 无 系 军 很 情 者 最 立 代 想 已 通 并 提 直 题 党 程 展 五 果 料 象 员 革 位 入 常 文 总 次 品 式 活 设 及 管 特 件 长 求 老 头 基 资 边 流 路 级 少 图 山 统 接 知 较 将 组 见 计 别 她 手 角 期 根 论 运 农 指 几 九 区 强 放 决 西 被 干 做 必 战 先 回 则 任 取 据 处 队 南 给 色 光 门 即 保 治 北 造 百 规 热 领 七 海 口 东 导 器 压 志 世 金 增 争 济 阶 油 思 术 极 交 受 联 什 认 六 共 权 收 证 改 清 美 再 采 转 更 单 风 切 打 白 教 速 花 带 安 场 身 车 例 真 务 具 万 每 目 至 达 走 积 示 议 声 报 斗 完 类 八 离 华 名 确 才 科 张 信 马 节 话 米 整 空 元 况 今 集 温 传 土 许 步 群 广 石 记 需 段 研 界 拉 林 律 叫 且 究 观 越 织 装 影 算 低 持 音 众 书 布 复 容 儿 须 际 商 非 验 连 断 深 难 近 矿 千 周 委 素 技 备 半 办 青 省 列 习 响 约 支 般 史 感 劳 便 团 往 酸 历 市 克 何 除 消 构 府 称 太 准 精 值 号 率 族 维 划 选 标 写 存 候 毛 亲 快 效 斯 院 查 江 型 眼 王 按 格 养 易 置 派 层 片 始 却 专 状 育 厂 京 识 适 属 圆 包 火 住 调 满 县 局 照 参 红 细 引 听 该 铁 价 严 首 底 液 官 德 随 病 苏 失 尔 死 讲 配 女 黄 推 显 谈 罪 神 艺 呢 席 含 企 望 密 批 营 项 防 举 球 英 氧 势 告 李 台 落 木 帮 轮 破 亚 师 围 注 远 字 材 排 供 河 态 封 另 施 减 树 溶 怎 止 案 言 士 均 武 固 叶 鱼 波 视 仅 费 紧 爱 左 章 早 朝 害 续 轻 服 试 食 充 兵 源 判 护 司 足 某 练 差 致 板 田 降 黑 犯 负 击 范 继 兴 似 余 坚 曲 输 修 故 城 夫 够 送 笔 船 占 右 财 吃 富 春 职 觉 汉 画 功 巴 跟 虽 杂 飞 检 吸 助 升 阳 互 初 创 抗 考 投 坏 策 古 径 换 未 跑 留 钢 曾 端 责 站 简 述 钱 副 尽 帝 射 草 冲 承 独 令 限 阿 宣 环 双 请 超 微 让 控 州 良 轴 找 否 纪 益 依 优 顶 础 载 倒 房 突 坐 粉 敌 略 客 袁 冷 胜 绝 析 块 剂 测 丝 协 诉 念 陈 仍 罗 盐 友 洋 错 苦 夜 刑 移 频 逐 靠 混 母 短 皮 终 聚 汽 村 云 哪 既 距 卫 停 烈 央 察 烧 迅 境 若 印 洲 刻 括 激 孔 搞 甚 室 待 核 校 散 侵 吧 甲 游 久 菜 味 旧 模 湖 货 损 预 阻 毫 普 稳 乙 妈 植 息 扩 银 语 挥 酒 守 拿 序 纸 医 缺 雨 吗 针 刘 啊 急 唱 误 训 愿 审 附 获 茶 鲜 粮 斤 孩 脱 硫 肥 善 龙 演 父 渐 血 欢 械 掌 歌 沙 刚 攻 谓 盾 讨 晚 粒 乱 燃 矛 乎 杀 药 宁 鲁 贵 钟 煤 读 班 伯 香 介 迫 句 丰 培 握 兰 担 弦 蛋 沉 假 穿 执 答 乐 谁 顺 烟 缩 征 脸 喜 松 脚 困 异 免 背 星 福 买 染 井 概 慢 怕 磁 倍 祖 皇 促 静 补 评 翻 肉 践 尼 衣 宽 扬 棉 希 伤 操 垂 秋 宜 氢 套 督 振 架 亮 末 宪 庆 编 牛 触 映 雷 销 诗 座 居 抓 裂 胞 呼 娘 景 威 绿 晶 厚 盟 衡 鸡 孙 延 危 胶 屋 乡 临 陆 顾 掉 呀 灯 岁 措 束 耐 剧 玉 赵 跳 哥 季 课 凯 胡 额 款 绍 卷 齐 伟 蒸 殖 永 宗 苗 川 炉 岩 弱 零 杨 奏 沿 露 杆 探 滑 镇 饭 浓 航 怀 赶 库 夺 伊 灵 税 途 灭 赛 归 召 鼓 播 盘 裁 险 康 唯 录 菌 纯 借 糖 盖 横 符 私 努 堂 域 枪 润 幅 哈 竟 熟 虫 泽 脑 壤 碳 欧 遍 侧 寨 敢 彻 虑 斜 薄 庭 纳 弹 饲 伸 折 麦 湿 暗 荷 瓦 塞 床 筑 恶 户 访 塔 奇 透 梁 刀 旋 迹 卡 氯 遇 份 毒 泥 退 洗 摆 灰 彩 卖 耗 夏 择 忙 铜 献 硬 予 繁 圈 雪 函 亦 抽 篇 阵 阴 丁 尺 追 堆 雄 迎 泛 爸 楼 避 谋 吨 野 猪 旗 累 偏 典 馆 索 秦 脂 潮 爷 豆 忽 托 惊 塑 遗 愈 朱 替 纤 粗 倾 尚 痛 楚 谢 奋 购 磨 君 池 旁 碎 骨 监 捕 弟 暴 割 贯 殊 释 词 亡 壁 顿 宝 午 尘 闻 揭 炮 残 冬 桥 妇 警 综 招 吴 付 浮 遭 徐 您 摇 谷 赞 箱 隔 订 男 吹 园 纷 唐 败 宋 玻 巨 耕 坦 荣 闭 湾 键 凡 驻 锅 救 恩 剥 凝 碱 齿 截 炼 麻 纺 禁 废 盛 版 缓 净 睛 昌 婚 涉 筒 嘴 插 岸 朗 庄 街 藏 姑 贸 腐 奴 啦 惯 乘 伙 恢 匀 纱 扎 辩 耳 彪 臣 亿 璃 抵 脉 秀 萨 俄 网 舞 店 喷 纵 寸 汗 挂 洪 贺 闪 柬 爆 烯 津 稻 墙 软 勇 像 滚 厘 蒙 芳 肯 坡 柱 荡 腿 仪 旅 尾 轧 冰 贡 登 黎 削 钻 勒 逃 障 氨 郭 峰 币 港 伏 轨 亩 毕 擦 莫 刺 浪 秘 援 株 健 售 股 岛 甘 泡 睡 童 铸 汤 阀 休 汇 舍 牧 绕 炸 哲 磷 绩 朋 淡 尖 启 陷 柴 呈 徒 颜 泪 稍 忘 泵 蓝 拖 洞 授 镜 辛 壮 锋 贫 虚 弯 摩 泰 幼 廷 尊 窗 纲 弄 隶 疑 氏 宫 姐 震 瑞 怪 尤 琴 循 描 膜 违 夹 腰 缘 珠 穷 森 枝 竹 沟 催 绳 忆 邦 剩 幸 浆 栏 拥 牙 贮 礼 滤 钠 纹 罢 拍 咱 喊 袖 埃 勤 罚 焦 潜 伍 墨 欲 缝 姓 刊 饱 仿 奖 铝 鬼 丽 跨 默 挖 链 扫 喝 袋 炭 污 幕 诸 弧 励 梅 奶 洁 灾 舟 鉴 苯 讼 抱 毁 懂 寒 智 埔 寄 届 跃 渡 挑 丹 艰 贝 碰 拔 爹 戴 码 梦 芽 熔 赤 渔 哭 敬 颗 奔 铅 仲 虎 稀 妹 乏 珍 申 桌 遵 允 隆 螺 仓 魏 锐 晓 氮 兼 隐 碍 赫 拨 忠 肃 缸 牵 抢 博 巧 壳 兄 杜 讯 诚 碧 祥 柯 页 巡 矩 悲 灌 龄 伦 票 寻 桂 铺 圣 恐 恰 郑 趣 抬 荒 腾 贴 柔 滴 猛 阔 辆 妻 填 撤 储 签 闹 扰 紫 砂 递 戏 吊 陶 伐 喂 疗 瓶 婆 抚 臂 摸 忍 虾 蜡 邻 胸 巩 挤 偶 弃 槽 劲 乳 邓 吉 仁 烂 砖 租 乌 舰 伴 瓜 浅 丙 暂 燥 橡 柳 迷 暖 牌 秧 胆 详 簧 踏 瓷 谱 呆 宾 糊 洛 辉 愤 竞 隙 怒 粘 乃 绪 肩 籍 敏 涂 熙 皆 侦 悬 掘 享 纠 醒 狂 锁 淀 恨 牲 霸 爬 赏 逆 玩 陵 祝 秒 浙 貌 役 彼 悉 鸭 趋 凤 晨 畜 辈 秩 卵 署 梯 炎 滩 棋 驱 筛 峡 冒 啥 寿 译 浸 泉 帽 迟 硅 疆 贷 漏 稿 冠 嫩 胁 芯 牢 叛 蚀 奥 鸣 岭 羊 凭 串 塘 绘 酵 融 盆 锡 庙 筹 冻 辅 摄 袭 筋 拒 僚 旱 钾 鸟 漆 沈 眉 疏 添 棒 穗 硝 韩 逼 扭 侨 凉 挺 碗 栽 炒 杯 患 馏 劝 豪 辽 勃 鸿 旦 吏 拜 狗 埋 辊 掩 饮 搬 骂 辞 勾 扣 估 蒋 绒 雾 丈 朵 姆 拟 宇 辑 陕 雕 偿 蓄 崇 剪 倡 厅 咬 驶 薯 刷 斥 番 赋 奉 佛 浇 漫 曼 扇 钙 桃 扶 仔 返 俗 亏 腔 鞋 棱 覆 框 悄 叔 撞 骗 勘 旺 沸 孤 吐 孟 渠 屈 疾 妙 惜 仰 狠 胀 谐 抛 霉 桑 岗 嘛 衰 盗 渗 脏 赖 涌 甜 曹 阅 肌 哩 厉 烃 纬 毅 昨 伪 症 煮 叹 钉 搭 茎 笼 酷 偷 弓 锥 恒 杰 坑 鼻 翼 纶 叙 狱 逮 罐 络 棚 抑 膨 蔬 寺 骤 穆 冶 枯 册 尸 凸 绅 坯 牺 焰 轰 欣 晋 瘦 御 锭 锦 丧 旬 锻 垄 搜 扑 邀 亭 酯 迈 舒 脆 酶 闲 忧 酚 顽 羽 涨 卸 仗 陪 辟 惩 杭 姚 肚 捉 飘 漂 昆 欺 吾 郎 烷 汁 呵 饰 萧 雅 邮 迁 燕 撒 姻 赴 宴 烦 债 帐 斑 铃 旨 醇 董 饼 雏 姿 拌 傅 腹 妥 揉 贤 拆 歪 葡 胺 丢 浩 徽 昂 垫 挡 览 贪 慰 缴 汪 慌 冯 诺 姜 谊 凶 劣 诬 耀 昏 躺 盈 骑 乔 溪 丛 卢 抹 闷 咨 刮 驾 缆 悟 摘 铒 掷 颇 幻 柄 惠 惨 佳 仇 腊 窝 涤 剑 瞧 堡 泼 葱 罩 霍 捞 胎 苍 滨 俩 捅 湘 砍 霞 邵 萄 疯 淮 遂 熊 粪 烘 宿 档 戈 驳 嫂 裕 徙 箭 捐 肠 撑 晒 辨 殿 莲 摊 搅 酱 屏 疫 哀 蔡 堵 沫 皱 畅 叠 阁 莱 敲 辖 钩 痕 坝 巷 饿 祸 丘 玄 溜 曰 逻 彭 尝 卿 妨 艇 吞 韦 怨 矮 歇
{ "pile_set_name": "Github" }
package com.example.algamoney.api.repository; import java.util.Optional; import org.springframework.data.jpa.repository.JpaRepository; import com.example.algamoney.api.model.Usuario; public interface UsuarioRepository extends JpaRepository<Usuario, Long> { public Optional<Usuario> findByEmail(String email); }
{ "pile_set_name": "Github" }
// Copyright (c) 2014 The SurgeMQ Authors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package topics import ( "testing" "github.com/stretchr/testify/require" "github.com/surgemq/message" ) func TestNextTopicLevelSuccess(t *testing.T) { topics := [][]byte{ []byte("sport/tennis/player1/#"), []byte("sport/tennis/player1/ranking"), []byte("sport/#"), []byte("#"), []byte("sport/tennis/#"), []byte("+"), []byte("+/tennis/#"), []byte("sport/+/player1"), []byte("/finance"), } levels := [][][]byte{ [][]byte{[]byte("sport"), []byte("tennis"), []byte("player1"), []byte("#")}, [][]byte{[]byte("sport"), []byte("tennis"), []byte("player1"), []byte("ranking")}, [][]byte{[]byte("sport"), []byte("#")}, [][]byte{[]byte("#")}, [][]byte{[]byte("sport"), []byte("tennis"), []byte("#")}, [][]byte{[]byte("+")}, [][]byte{[]byte("+"), []byte("tennis"), []byte("#")}, [][]byte{[]byte("sport"), []byte("+"), []byte("player1")}, [][]byte{[]byte("+"), []byte("finance")}, } for i, topic := range topics { var ( tl []byte rem = topic err error ) for _, level := range levels[i] { tl, rem, err = nextTopicLevel(rem) require.NoError(t, err) require.Equal(t, level, tl) } } } func TestNextTopicLevelFailure(t *testing.T) { topics := [][]byte{ []byte("sport/tennis#"), []byte("sport/tennis/#/ranking"), []byte("sport+"), } var ( rem []byte err error ) _, rem, err = nextTopicLevel(topics[0]) require.NoError(t, err) _, rem, err = nextTopicLevel(rem) require.Error(t, err) _, rem, err = nextTopicLevel(topics[1]) require.NoError(t, err) _, rem, err = nextTopicLevel(rem) require.NoError(t, err) _, rem, err = nextTopicLevel(rem) require.Error(t, err) _, rem, err = nextTopicLevel(topics[2]) require.Error(t, err) } func TestSNodeInsert1(t *testing.T) { n := newSNode() topic := []byte("sport/tennis/player1/#") err := n.sinsert(topic, 1, "sub1") require.NoError(t, err) require.Equal(t, 1, len(n.snodes)) require.Equal(t, 0, len(n.subs)) n2, ok := n.snodes["sport"] require.True(t, ok) require.Equal(t, 1, len(n2.snodes)) require.Equal(t, 0, len(n2.subs)) n3, ok := n2.snodes["tennis"] require.True(t, ok) require.Equal(t, 1, len(n3.snodes)) require.Equal(t, 0, len(n3.subs)) n4, ok := n3.snodes["player1"] require.True(t, ok) require.Equal(t, 1, len(n4.snodes)) require.Equal(t, 0, len(n4.subs)) n5, ok := n4.snodes["#"] require.True(t, ok) require.Equal(t, 0, len(n5.snodes)) require.Equal(t, 1, len(n5.subs)) require.Equal(t, "sub1", n5.subs[0].(string)) } func TestSNodeInsert2(t *testing.T) { n := newSNode() topic := []byte("#") err := n.sinsert(topic, 1, "sub1") require.NoError(t, err) require.Equal(t, 1, len(n.snodes)) require.Equal(t, 0, len(n.subs)) n2, ok := n.snodes["#"] require.True(t, ok) require.Equal(t, 0, len(n2.snodes)) require.Equal(t, 1, len(n2.subs)) require.Equal(t, "sub1", n2.subs[0].(string)) } func TestSNodeInsert3(t *testing.T) { n := newSNode() topic := []byte("+/tennis/#") err := n.sinsert(topic, 1, "sub1") require.NoError(t, err) require.Equal(t, 1, len(n.snodes)) require.Equal(t, 0, len(n.subs)) n2, ok := n.snodes["+"] require.True(t, ok) require.Equal(t, 1, len(n2.snodes)) require.Equal(t, 0, len(n2.subs)) n3, ok := n2.snodes["tennis"] require.True(t, ok) require.Equal(t, 1, len(n3.snodes)) require.Equal(t, 0, len(n3.subs)) n4, ok := n3.snodes["#"] require.True(t, ok) require.Equal(t, 0, len(n4.snodes)) require.Equal(t, 1, len(n4.subs)) require.Equal(t, "sub1", n4.subs[0].(string)) } func TestSNodeInsert4(t *testing.T) { n := newSNode() topic := []byte("/finance") err := n.sinsert(topic, 1, "sub1") require.NoError(t, err) require.Equal(t, 1, len(n.snodes)) require.Equal(t, 0, len(n.subs)) n2, ok := n.snodes["+"] require.True(t, ok) require.Equal(t, 1, len(n2.snodes)) require.Equal(t, 0, len(n2.subs)) n3, ok := n2.snodes["finance"] require.True(t, ok) require.Equal(t, 0, len(n3.snodes)) require.Equal(t, 1, len(n3.subs)) require.Equal(t, "sub1", n3.subs[0].(string)) } func TestSNodeInsertDup(t *testing.T) { n := newSNode() topic := []byte("/finance") err := n.sinsert(topic, 1, "sub1") err = n.sinsert(topic, 1, "sub1") require.NoError(t, err) require.Equal(t, 1, len(n.snodes)) require.Equal(t, 0, len(n.subs)) n2, ok := n.snodes["+"] require.True(t, ok) require.Equal(t, 1, len(n2.snodes)) require.Equal(t, 0, len(n2.subs)) n3, ok := n2.snodes["finance"] require.True(t, ok) require.Equal(t, 0, len(n3.snodes)) require.Equal(t, 1, len(n3.subs)) require.Equal(t, "sub1", n3.subs[0].(string)) } func TestSNodeRemove1(t *testing.T) { n := newSNode() topic := []byte("sport/tennis/player1/#") n.sinsert(topic, 1, "sub1") err := n.sremove([]byte("sport/tennis/player1/#"), "sub1") require.NoError(t, err) require.Equal(t, 0, len(n.snodes)) require.Equal(t, 0, len(n.subs)) } func TestSNodeRemove2(t *testing.T) { n := newSNode() topic := []byte("sport/tennis/player1/#") n.sinsert(topic, 1, "sub1") err := n.sremove([]byte("sport/tennis/player1"), "sub1") require.Error(t, err) } func TestSNodeRemove3(t *testing.T) { n := newSNode() topic := []byte("sport/tennis/player1/#") n.sinsert(topic, 1, "sub1") n.sinsert(topic, 1, "sub2") err := n.sremove([]byte("sport/tennis/player1/#"), nil) require.NoError(t, err) require.Equal(t, 0, len(n.snodes)) require.Equal(t, 0, len(n.subs)) } func TestSNodeMatch1(t *testing.T) { n := newSNode() topic := []byte("sport/tennis/player1/#") n.sinsert(topic, 1, "sub1") subs := make([]interface{}, 0, 5) qoss := make([]byte, 0, 5) err := n.smatch([]byte("sport/tennis/player1/anzel"), 1, &subs, &qoss) require.NoError(t, err) require.Equal(t, 1, len(subs)) require.Equal(t, 1, int(qoss[0])) } func TestSNodeMatch2(t *testing.T) { n := newSNode() topic := []byte("sport/tennis/player1/#") n.sinsert(topic, 1, "sub1") subs := make([]interface{}, 0, 5) qoss := make([]byte, 0, 5) err := n.smatch([]byte("sport/tennis/player1/anzel"), 1, &subs, &qoss) require.NoError(t, err) require.Equal(t, 1, len(subs)) require.Equal(t, 1, int(qoss[0])) } func TestSNodeMatch3(t *testing.T) { n := newSNode() topic := []byte("sport/tennis/player1/#") n.sinsert(topic, 2, "sub1") subs := make([]interface{}, 0, 5) qoss := make([]byte, 0, 5) err := n.smatch([]byte("sport/tennis/player1/anzel"), 2, &subs, &qoss) require.NoError(t, err) require.Equal(t, 1, len(subs)) require.Equal(t, 2, int(qoss[0])) } func TestSNodeMatch4(t *testing.T) { n := newSNode() n.sinsert([]byte("sport/tennis/#"), 2, "sub1") subs := make([]interface{}, 0, 5) qoss := make([]byte, 0, 5) err := n.smatch([]byte("sport/tennis/player1/anzel"), 2, &subs, &qoss) require.NoError(t, err) require.Equal(t, 1, len(subs)) require.Equal(t, 2, int(qoss[0])) } func TestSNodeMatch5(t *testing.T) { n := newSNode() n.sinsert([]byte("sport/tennis/+/anzel"), 1, "sub1") n.sinsert([]byte("sport/tennis/player1/anzel"), 1, "sub2") subs := make([]interface{}, 0, 5) qoss := make([]byte, 0, 5) err := n.smatch([]byte("sport/tennis/player1/anzel"), 1, &subs, &qoss) require.NoError(t, err) require.Equal(t, 2, len(subs)) } func TestSNodeMatch6(t *testing.T) { n := newSNode() n.sinsert([]byte("sport/tennis/#"), 2, "sub1") n.sinsert([]byte("sport/tennis"), 1, "sub2") subs := make([]interface{}, 0, 5) qoss := make([]byte, 0, 5) err := n.smatch([]byte("sport/tennis/player1/anzel"), 2, &subs, &qoss) require.NoError(t, err) require.Equal(t, 1, len(subs)) require.Equal(t, "sub1", subs[0]) } func TestSNodeMatch7(t *testing.T) { n := newSNode() n.sinsert([]byte("+/+"), 2, "sub1") subs := make([]interface{}, 0, 5) qoss := make([]byte, 0, 5) err := n.smatch([]byte("/finance"), 1, &subs, &qoss) require.NoError(t, err) require.Equal(t, 1, len(subs)) } func TestSNodeMatch8(t *testing.T) { n := newSNode() n.sinsert([]byte("/+"), 2, "sub1") subs := make([]interface{}, 0, 5) qoss := make([]byte, 0, 5) err := n.smatch([]byte("/finance"), 1, &subs, &qoss) require.NoError(t, err) require.Equal(t, 1, len(subs)) } func TestSNodeMatch9(t *testing.T) { n := newSNode() n.sinsert([]byte("+"), 2, "sub1") subs := make([]interface{}, 0, 5) qoss := make([]byte, 0, 5) err := n.smatch([]byte("/finance"), 1, &subs, &qoss) require.NoError(t, err) require.Equal(t, 0, len(subs)) } func TestRNodeInsertRemove(t *testing.T) { n := newRNode() // --- Insert msg1 msg := newPublishMessageLarge([]byte("sport/tennis/player1/ricardo"), 1) err := n.rinsert(msg.Topic(), msg) require.NoError(t, err) require.Equal(t, 1, len(n.rnodes)) require.Nil(t, n.msg) n2, ok := n.rnodes["sport"] require.True(t, ok) require.Equal(t, 1, len(n2.rnodes)) require.Nil(t, n2.msg) n3, ok := n2.rnodes["tennis"] require.True(t, ok) require.Equal(t, 1, len(n3.rnodes)) require.Nil(t, n3.msg) n4, ok := n3.rnodes["player1"] require.True(t, ok) require.Equal(t, 1, len(n4.rnodes)) require.Nil(t, n4.msg) n5, ok := n4.rnodes["ricardo"] require.True(t, ok) require.Equal(t, 0, len(n5.rnodes)) require.NotNil(t, n5.msg) require.Equal(t, msg.QoS(), n5.msg.QoS()) require.Equal(t, msg.Topic(), n5.msg.Topic()) require.Equal(t, msg.Payload(), n5.msg.Payload()) // --- Insert msg2 msg2 := newPublishMessageLarge([]byte("sport/tennis/player1/andre"), 1) err = n.rinsert(msg2.Topic(), msg2) require.NoError(t, err) require.Equal(t, 2, len(n4.rnodes)) n6, ok := n4.rnodes["andre"] require.True(t, ok) require.Equal(t, 0, len(n6.rnodes)) require.NotNil(t, n6.msg) require.Equal(t, msg2.QoS(), n6.msg.QoS()) require.Equal(t, msg2.Topic(), n6.msg.Topic()) // --- Remove err = n.rremove([]byte("sport/tennis/player1/andre")) require.NoError(t, err) require.Equal(t, 1, len(n4.rnodes)) } func TestRNodeMatch(t *testing.T) { n := newRNode() msg1 := newPublishMessageLarge([]byte("sport/tennis/ricardo/stats"), 1) err := n.rinsert(msg1.Topic(), msg1) require.NoError(t, err) msg2 := newPublishMessageLarge([]byte("sport/tennis/andre/stats"), 1) err = n.rinsert(msg2.Topic(), msg2) require.NoError(t, err) msg3 := newPublishMessageLarge([]byte("sport/tennis/andre/bio"), 1) err = n.rinsert(msg3.Topic(), msg3) require.NoError(t, err) var msglist []*message.PublishMessage // --- err = n.rmatch(msg1.Topic(), &msglist) require.NoError(t, err) require.Equal(t, 1, len(msglist)) // --- msglist = msglist[0:0] err = n.rmatch(msg2.Topic(), &msglist) require.NoError(t, err) require.Equal(t, 1, len(msglist)) // --- msglist = msglist[0:0] err = n.rmatch(msg3.Topic(), &msglist) require.NoError(t, err) require.Equal(t, 1, len(msglist)) // --- msglist = msglist[0:0] err = n.rmatch([]byte("sport/tennis/andre/+"), &msglist) require.NoError(t, err) require.Equal(t, 2, len(msglist)) // --- msglist = msglist[0:0] err = n.rmatch([]byte("sport/tennis/andre/#"), &msglist) require.NoError(t, err) require.Equal(t, 2, len(msglist)) // --- msglist = msglist[0:0] err = n.rmatch([]byte("sport/tennis/+/stats"), &msglist) require.NoError(t, err) require.Equal(t, 2, len(msglist)) // --- msglist = msglist[0:0] err = n.rmatch([]byte("sport/tennis/#"), &msglist) require.NoError(t, err) require.Equal(t, 3, len(msglist)) } func TestMemTopicsSubscription(t *testing.T) { Unregister("mem") p := NewMemProvider() Register("mem", p) mgr, err := NewManager("mem") MaxQosAllowed = 1 qos, err := mgr.Subscribe([]byte("sports/tennis/+/stats"), 2, "sub1") require.NoError(t, err) require.Equal(t, 1, int(qos)) err = mgr.Unsubscribe([]byte("sports/tennis"), "sub1") require.Error(t, err) subs := make([]interface{}, 5) qoss := make([]byte, 5) err = mgr.Subscribers([]byte("sports/tennis/anzel/stats"), 2, &subs, &qoss) require.NoError(t, err) require.Equal(t, 0, len(subs)) err = mgr.Subscribers([]byte("sports/tennis/anzel/stats"), 1, &subs, &qoss) require.NoError(t, err) require.Equal(t, 1, len(subs)) require.Equal(t, 1, int(qoss[0])) err = mgr.Unsubscribe([]byte("sports/tennis/+/stats"), "sub1") require.NoError(t, err) } func TestMemTopicsRetained(t *testing.T) { Unregister("mem") p := NewMemProvider() Register("mem", p) mgr, err := NewManager("mem") require.NoError(t, err) require.NotNil(t, mgr) msg1 := newPublishMessageLarge([]byte("sport/tennis/ricardo/stats"), 1) err = mgr.Retain(msg1) require.NoError(t, err) msg2 := newPublishMessageLarge([]byte("sport/tennis/andre/stats"), 1) err = mgr.Retain(msg2) require.NoError(t, err) msg3 := newPublishMessageLarge([]byte("sport/tennis/andre/bio"), 1) err = mgr.Retain(msg3) require.NoError(t, err) var msglist []*message.PublishMessage // --- err = mgr.Retained(msg1.Topic(), &msglist) require.NoError(t, err) require.Equal(t, 1, len(msglist)) // --- msglist = msglist[0:0] err = mgr.Retained(msg2.Topic(), &msglist) require.NoError(t, err) require.Equal(t, 1, len(msglist)) // --- msglist = msglist[0:0] err = mgr.Retained(msg3.Topic(), &msglist) require.NoError(t, err) require.Equal(t, 1, len(msglist)) // --- msglist = msglist[0:0] err = mgr.Retained([]byte("sport/tennis/andre/+"), &msglist) require.NoError(t, err) require.Equal(t, 2, len(msglist)) // --- msglist = msglist[0:0] err = mgr.Retained([]byte("sport/tennis/andre/#"), &msglist) require.NoError(t, err) require.Equal(t, 2, len(msglist)) // --- msglist = msglist[0:0] err = mgr.Retained([]byte("sport/tennis/+/stats"), &msglist) require.NoError(t, err) require.Equal(t, 2, len(msglist)) // --- msglist = msglist[0:0] err = mgr.Retained([]byte("sport/tennis/#"), &msglist) require.NoError(t, err) require.Equal(t, 3, len(msglist)) } func newPublishMessageLarge(topic []byte, qos byte) *message.PublishMessage { msg := message.NewPublishMessage() msg.SetTopic(topic) msg.SetPayload(make([]byte, 1024)) msg.SetQoS(qos) return msg }
{ "pile_set_name": "Github" }
/* Generated by RuntimeBrowser Image: /System/Library/PrivateFrameworks/TextInputCore.framework/TextInputCore */ @interface TIWordSearchController : NSObject { NSMapTable * _inputModeToWordSearchMapping; } @property (nonatomic, retain) NSMapTable *inputModeToWordSearchMapping; + (id)sharedWordSearchController; - (void).cxx_destruct; - (id)init; - (id)inputModeToWordSearchMapping; - (void)setInputModeToWordSearchMapping:(id)arg1; - (void)setWordSearch:(id)arg1 forInputMode:(id)arg2; - (id)wordSearchForInputMode:(id)arg1; @end
{ "pile_set_name": "Github" }
#!/bin/bash # # Copyright 2018 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. set -e set -x DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" # vendor_kustomize.sh creates the change in kubernetes repo for vendoring kustomize function setUpWorkspace { KPATH=~/kustomize_vendor mkdir $KPATH GOPATH=$KPATH } function cloneK8s { mkdir -p $KPATH/src/k8s.io cd $KPATH/src/k8s.io git clone git@github.com:kubernetes/kubernetes.git } function godepRestore { cd $KPATH/src/k8s.io/kubernetes # restore dependencies hack/run-in-gopath.sh hack/godep-restore.sh } function getKustomizeDeps { # get Kustomize and Kustomize dependencies hack/run-in-gopath.sh godep get sigs.k8s.io/kustomize/pkg/commands hack/run-in-gopath.sh godep get github.com/bgentry/go-netrc/netrc hack/run-in-gopath.sh godep get github.com/hashicorp/go-cleanhttp hack/run-in-gopath.sh godep get github.com/hashicorp/go-getter hack/run-in-gopath.sh godep get github.com/hashicorp/go-safetemp hack/run-in-gopath.sh godep get github.com/hashicorp/go-version # The hashes below passed bin/pre-commit.sh with kustomize HEAD at time of merger. DEPS=( "hashicorp/go-getter 4bda8fa99001c61db3cad96b421d4c12a81f256d" "hashicorp/go-cleanhttp d5fe4b57a186c716b0e00b8c301cbd9b4182694d" "hashicorp/go-safetemp b1a1dbde6fdc11e3ae79efd9039009e22d4ae240" "hashicorp/go-version 270f2f71b1ee587f3b609f00f422b76a6b28f348" "bgentry/go-netrc 9fd32a8b3d3d3f9d43c341bfe098430e07609480" "mitchellh/go-homedir 58046073cbffe2f25d425fe1331102f55cf719de" "mitchellh/go-testing-interface a61a99592b77c9ba629d254a693acffaeb4b7e28" "ulikunitz/xz v0.5.4" ) function foo { cd $KPATH/src/k8s.io/kubernetes/_output/local/go/src/github.com/$1 git checkout $2 } for i in "${DEPS[@]}"; do foo $i done } function updateK8s { # Copy k8sdeps from Kustomize to cli-runtime in staging mkdir -p $KPATH/src/k8s.io/kubernetes/staging/src/k8s.io/cli-runtime/pkg/kustomize cp -r $KPATH/src/k8s.io/kubernetes/_output/local/go/src/sigs.k8s.io/kustomize/k8sdeps \ $KPATH/src/k8s.io/kubernetes/staging/src/k8s.io/cli-runtime/pkg/kustomize/k8sdeps # Change import path of k8sdeps find $KPATH/src/k8s.io/kubernetes/staging/src/k8s.io/cli-runtime/pkg/kustomize/k8sdeps \ -type f -name "*.go" | \ xargs sed -i \ 's!sigs.k8s.io/kustomize/k8sdeps!k8s.io/cli-runtime/pkg/kustomize/k8sdeps!' # Add kustomize command to kubectl cp $DIR/vendor_kustomize.diff $KPATH/vendor_kustomize.diff cd $GOPATH/src/k8s.io/kubernetes git apply --ignore-space-change --ignore-whitespace $KPATH/vendor_kustomize.diff } function godepSave { # Save all dependencies into k8s.io/kubernetes/vendor by running # hack/godep-save.sh hack/run-in-gopath.sh hack/godep-save.sh } function verify { # make sure in k8s.io/kubernetes/vendor/sigs.k8s.io/kustomize # there is no internal package test 0 == $(ls $KPATH/src/k8s.io/kubernetes/vendor/sigs.k8s.io/kustomize | grep “internal” | wc -l) # Make sure it compiles. test 0 == $(bazel build cmd/kubectl:kubectl) # next step, open a PR echo "The change for vendoring kustomize is ready in $GOPATH/src/k8s.io/kubernetes.\n Next step, open a PR for it.\n" } setUpWorkspace cloneK8s godepRestore getKustomizeDeps updateK8s godepSave verify
{ "pile_set_name": "Github" }
$(document).ready(function() { $('#inputDomainChooser').multiselect({ buttonWidth: '250px', dropRight: true, nonSelectedText: 'Choose domain(s)' }); $('.landing-page.mail-services .get-started .choose-product button').click(function(e) { var product = $(this).data('product'); $('.landing-page.mail-services .get-started .choose-product button').removeClass('active'); $(this).addClass('active'); $('.landing-page.mail-services .get-started .additional-options .option').hide(); $('.landing-page.mail-services .get-started .additional-options .options-' + product).show(); $('.landing-page.mail-services .get-started .price').hide(); $('.landing-page.mail-services .get-started .price-' + product).show(); $('#productKey').val('spamexperts_' + product); }); $('.landing-page.mail-services .get-started .additional-options input[type="checkbox"]').click(function(e) { if ($(this).is(":checked")) { $('.landing-page.mail-services .get-started .price').hide(); $('.landing-page.mail-services .get-started .price-' + $(this).val()).show(); $('#productKey').val('spamexperts_' + $(this).val()); } else { var product = $('.landing-page.mail-services .get-started .choose-product button.active').data('product'); $('.landing-page.mail-services .get-started .price').hide(); $('.landing-page.mail-services .get-started .price-' + product).show(); $('#productKey').val('spamexperts_' + product); } }); $('.btn-learn-more').click(function(e) { e.preventDefault(); $('#howitworks a[href="#' + $(this).data('target') + '"]').tab('show'); smoothScroll('#howitworks'); }); $('.btn-buy').click(function(e) { e.preventDefault(); $('#pricing button[data-product="' + $(this).data('target') + '"]').click(); smoothScroll('#pricing'); }); }); function smoothScroll(element) { $('html, body').animate({ scrollTop: $(element).offset().top }, 500); }
{ "pile_set_name": "Github" }
def extractIsekaiFiction(item): """ 'Isekai Fiction' """ vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol or frag) or 'preview' in item['title'].lower(): return None if 'Upstart Pastry Chef' in item['tags']: return buildReleaseMessageWithType(item, 'Upstart Pastry Chef ~Territory Management of a Genius Pâtissier~', vol, chp, frag=frag, postfix=postfix) if 'pastry' in item['tags']: return buildReleaseMessageWithType(item, 'Upstart Pastry Chef ~Territory Management of a Genius Pâtissier~', vol, chp, frag=frag, postfix=postfix) if 'herscherik' in item['tags']: return buildReleaseMessageWithType(item, 'Herscherik: Tensei Ouji to Urei no Daikoku', vol, chp, frag=frag, postfix=postfix) if 'okonomiyaki' in item['tags']: return buildReleaseMessageWithType(item, 'Different World’s Okonomiyaki Chain Store ~Auntie from Osaka, Reborn as Beautiful Swordswoman, on A Mission to Spread Okonomiyaki!~', vol, chp, frag=frag, postfix=postfix) if 'The Wolf Lord\'s Lady' in item['tags']: return buildReleaseMessageWithType(item, 'The Wolf Lord\'s Lady', vol, chp, frag=frag, postfix=postfix) tagmap = [ ('Starship Officer Becomes Adventurer', 'The Starship Officer Becomes An Adventurer', 'translated'), ('Sono Mono Nochi ni', 'That Person. Later on…', 'translated'), ('PRC', 'PRC', 'translated'), ('Loiterous', 'Loiterous', 'oel'), ] for tagname, name, tl_type in tagmap: if tagname in item['tags']: return buildReleaseMessageWithType(item, name, vol, chp, frag=frag, postfix=postfix, tl_type=tl_type) return False
{ "pile_set_name": "Github" }
package plugin import ( "crypto/tls" "fmt" "math" "net" "time" "github.com/hashicorp/go-plugin/internal/plugin" "golang.org/x/net/context" "google.golang.org/grpc" "google.golang.org/grpc/credentials" "google.golang.org/grpc/health/grpc_health_v1" ) func dialGRPCConn(tls *tls.Config, dialer func(string, time.Duration) (net.Conn, error)) (*grpc.ClientConn, error) { // Build dialing options. opts := make([]grpc.DialOption, 0, 5) // We use a custom dialer so that we can connect over unix domain sockets. opts = append(opts, grpc.WithDialer(dialer)) // Fail right away opts = append(opts, grpc.FailOnNonTempDialError(true)) // If we have no TLS configuration set, we need to explicitly tell grpc // that we're connecting with an insecure connection. if tls == nil { opts = append(opts, grpc.WithInsecure()) } else { opts = append(opts, grpc.WithTransportCredentials( credentials.NewTLS(tls))) } opts = append(opts, grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(math.MaxInt32)), grpc.WithDefaultCallOptions(grpc.MaxCallSendMsgSize(math.MaxInt32))) // Connect. Note the first parameter is unused because we use a custom // dialer that has the state to see the address. conn, err := grpc.Dial("unused", opts...) if err != nil { return nil, err } return conn, nil } // newGRPCClient creates a new GRPCClient. The Client argument is expected // to be successfully started already with a lock held. func newGRPCClient(doneCtx context.Context, c *Client) (*GRPCClient, error) { conn, err := dialGRPCConn(c.config.TLSConfig, c.dialer) if err != nil { return nil, err } // Start the broker. brokerGRPCClient := newGRPCBrokerClient(conn) broker := newGRPCBroker(brokerGRPCClient, c.config.TLSConfig) go broker.Run() go brokerGRPCClient.StartStream() cl := &GRPCClient{ Conn: conn, Plugins: c.config.Plugins, doneCtx: doneCtx, broker: broker, controller: plugin.NewGRPCControllerClient(conn), } return cl, nil } // GRPCClient connects to a GRPCServer over gRPC to dispense plugin types. type GRPCClient struct { Conn *grpc.ClientConn Plugins map[string]Plugin doneCtx context.Context broker *GRPCBroker controller plugin.GRPCControllerClient } // ClientProtocol impl. func (c *GRPCClient) Close() error { c.broker.Close() c.controller.Shutdown(c.doneCtx, &plugin.Empty{}) return c.Conn.Close() } // ClientProtocol impl. func (c *GRPCClient) Dispense(name string) (interface{}, error) { raw, ok := c.Plugins[name] if !ok { return nil, fmt.Errorf("unknown plugin type: %s", name) } p, ok := raw.(GRPCPlugin) if !ok { return nil, fmt.Errorf("plugin %q doesn't support gRPC", name) } return p.GRPCClient(c.doneCtx, c.broker, c.Conn) } // ClientProtocol impl. func (c *GRPCClient) Ping() error { client := grpc_health_v1.NewHealthClient(c.Conn) _, err := client.Check(context.Background(), &grpc_health_v1.HealthCheckRequest{ Service: GRPCServiceName, }) return err }
{ "pile_set_name": "Github" }
## Developer Onboarding Being a new developer on an established team can be overwhelming. There are many parts of the process, culture and technical aspects the new dev will need to learn. Effective teams have good onboarding documents available so the process is clear. Ideally, onboarding should happen in stages. The suggested steps are described below, but each team must adapt according to context. It's not a manager's responsibility to onboard every new dev. Thus, all team members must be prepared. This is also important so that different people can iterate over the onboarding process and evaluate how it can improve. ### Step 1 - Processes The goal of this step is to provide an overall understanding of both the client and the team. Who they are and how they operate. - [ ] Ask the dev to introduce themselves. What's their past experience? What languages, databases, servers have they worked with? - [ ] Present the client. Who is the client? What is the business model? What are the goals Vinta helps the client achieve? - [ ] Present the team. Detail each persons' roles, if there's a support manager, a deploy manager. Mention how the project started, and how the team grew. - [ ] Explain the team's processes and workflows: - [ ] Explain [sprints](https://github.com/vintasoftware/playbook/blob/master/project_management.md#sprints). - [ ] Make sure the developer understands their responsibilities and features ownership. - [ ] Explain the [development workflow](https://github.com/vintasoftware/playbook/blob/master/checklists/feature_development_workflow.md). - [ ] Explain the project's repository. Differences between feature PRs, and deploy PRs. What branches represent Staging and Production? - [ ] Explain Staging and Production environments. More details [here](https://12factor.net/dev-prod-parity). - [ ] Ask the new developer to read the [development guideline](https://github.com/vintasoftware/playbook/blob/master/development.md#development) and the [frontend guideline](https://github.com/vintasoftware/playbook/blob/master/guidelines/guideline_frontend.md). - [ ] Explain the Roadmap, and how the long-term planning is assessed. - [ ] Explain how and when [sprints meetings](https://github.com/vintasoftware/playbook/blob/master/checklists/sprint_meeting.md) with the client occur. How meeting notes are organized, where they are stored. - [ ] Show them the project's assets. They should be available on the project's Drive folder. - [ ] Ask the developer to set up the project using the README. If any issues are encountered, they should modify the document. This benefits new future hires. - [ ] Assert the developer has access to: - [ ] LastPass - [ ] The project's Drive folder - [ ] The project's Google group - [ ] The project's Google Calendar events - [ ] The project's Github repository - [ ] The project's Asana - [ ] Both Production and Staging environments - [ ] The client's Slack ### Step 2 - Product and Project The new dev should already be familiarized with the processes. Now, it's time they learn details of the project. - [ ] Start explaining main use cases and where they're implemented on the code. - [ ] Show how they can manually test the system on Staging. - [ ] Complete the main flows on Staging with them. - [ ] Go through administrative tools. What are the most accessed parts? - [ ] Explain which parts of the code are most critical and why. How does the team handle them? - [ ] Explain how async tasks run and what is used to monitor them. - [ ] Explain what types of async tasks run on the project, especially periodic tasks, and if there's any priority queue. - [ ] Explain the tech stack. Show which external services and technologies are being used (DB, Redis, Elasticsearch...). - [ ] Explain what third-party integrations are there. - [ ] If there's a project wiki, ask them to read. - [ ] Explain what were the biggest problems in the past. - [ ] Be empathic. Assure them you know it's a lot of information and we don't expect them to learn all at once. - [ ] Ask them if they have any questions and if they understand what was explained. If they give you feedbacks, use them to improve this process! - [ ] Ask them to spend some time browsing Staging, going through the system as a user and as an admin. ### Step 3 - Feature development It's time to start coding! At this stage, the manager should assign a task according to the seniority of the new developer. This is important to initiate them in the development flow. Ideally, the first task should be self-contained, but this may vary according to the new hire's seniority. The manager should be extra careful when detailing the task, and remember the new dev is not familiar with the project. - [ ] If the feature is related with existing models, provide UML class diagrams to facilitate the understanding. Here's [a guide on how to generate class diagrams using Graphviz](https://simpleit.rocks/generate-uml-class-diagrams-from-django-models/). This will especially be needed for complex systems. - [ ] Go over the dev's task explaining what's expected of them. For example, what to add to the card, when to move columns, etc. - [ ] Make sure the expected git flow is clear to the developer. - [ ] Explain the expected Trello flow. When the cards should move columns. - [ ] Feature ownership matters. It must be clear to the new hire is responsible for the feature until it's live. - [ ] Ask for feedbacks! How was the onboarding process for them? What parts could improve?
{ "pile_set_name": "Github" }
#import <Foundation/Foundation.h> @interface PodsDummy_Pods_OHHTTPStubsDemo : NSObject @end @implementation PodsDummy_Pods_OHHTTPStubsDemo @end
{ "pile_set_name": "Github" }
// SPDX-License-Identifier: GPL-2.0 /* * sh73a0 Core CPG Clocks * * Copyright (C) 2014 Ulrich Hecht */ #include <linux/clk-provider.h> #include <linux/clk/renesas.h> #include <linux/init.h> #include <linux/io.h> #include <linux/kernel.h> #include <linux/of.h> #include <linux/of_address.h> #include <linux/slab.h> #include <linux/spinlock.h> struct sh73a0_cpg { struct clk_onecell_data data; spinlock_t lock; void __iomem *reg; }; #define CPG_FRQCRA 0x00 #define CPG_FRQCRB 0x04 #define CPG_SD0CKCR 0x74 #define CPG_SD1CKCR 0x78 #define CPG_SD2CKCR 0x7c #define CPG_PLLECR 0xd0 #define CPG_PLL0CR 0xd8 #define CPG_PLL1CR 0x28 #define CPG_PLL2CR 0x2c #define CPG_PLL3CR 0xdc #define CPG_CKSCR 0xc0 #define CPG_DSI0PHYCR 0x6c #define CPG_DSI1PHYCR 0x70 #define CLK_ENABLE_ON_INIT BIT(0) struct div4_clk { const char *name; const char *parent; unsigned int reg; unsigned int shift; }; static const struct div4_clk div4_clks[] = { { "zg", "pll0", CPG_FRQCRA, 16 }, { "m3", "pll1", CPG_FRQCRA, 12 }, { "b", "pll1", CPG_FRQCRA, 8 }, { "m1", "pll1", CPG_FRQCRA, 4 }, { "m2", "pll1", CPG_FRQCRA, 0 }, { "zx", "pll1", CPG_FRQCRB, 12 }, { "hp", "pll1", CPG_FRQCRB, 4 }, { NULL, NULL, 0, 0 }, }; static const struct clk_div_table div4_div_table[] = { { 0, 2 }, { 1, 3 }, { 2, 4 }, { 3, 6 }, { 4, 8 }, { 5, 12 }, { 6, 16 }, { 7, 18 }, { 8, 24 }, { 10, 36 }, { 11, 48 }, { 12, 7 }, { 0, 0 } }; static const struct clk_div_table z_div_table[] = { /* ZSEL == 0 */ { 0, 1 }, { 1, 1 }, { 2, 1 }, { 3, 1 }, { 4, 1 }, { 5, 1 }, { 6, 1 }, { 7, 1 }, { 8, 1 }, { 9, 1 }, { 10, 1 }, { 11, 1 }, { 12, 1 }, { 13, 1 }, { 14, 1 }, { 15, 1 }, /* ZSEL == 1 */ { 16, 2 }, { 17, 3 }, { 18, 4 }, { 19, 6 }, { 20, 8 }, { 21, 12 }, { 22, 16 }, { 24, 24 }, { 27, 48 }, { 0, 0 } }; static struct clk * __init sh73a0_cpg_register_clock(struct device_node *np, struct sh73a0_cpg *cpg, const char *name) { const struct clk_div_table *table = NULL; unsigned int shift, reg, width; const char *parent_name = NULL; unsigned int mult = 1; unsigned int div = 1; if (!strcmp(name, "main")) { /* extal1, extal1_div2, extal2, extal2_div2 */ u32 parent_idx = (readl(cpg->reg + CPG_CKSCR) >> 28) & 3; parent_name = of_clk_get_parent_name(np, parent_idx >> 1); div = (parent_idx & 1) + 1; } else if (!strncmp(name, "pll", 3)) { void __iomem *enable_reg = cpg->reg; u32 enable_bit = name[3] - '0'; parent_name = "main"; switch (enable_bit) { case 0: enable_reg += CPG_PLL0CR; break; case 1: enable_reg += CPG_PLL1CR; break; case 2: enable_reg += CPG_PLL2CR; break; case 3: enable_reg += CPG_PLL3CR; break; default: return ERR_PTR(-EINVAL); } if (readl(cpg->reg + CPG_PLLECR) & BIT(enable_bit)) { mult = ((readl(enable_reg) >> 24) & 0x3f) + 1; /* handle CFG bit for PLL1 and PLL2 */ if (enable_bit == 1 || enable_bit == 2) if (readl(enable_reg) & BIT(20)) mult *= 2; } } else if (!strcmp(name, "dsi0phy") || !strcmp(name, "dsi1phy")) { u32 phy_no = name[3] - '0'; void __iomem *dsi_reg = cpg->reg + (phy_no ? CPG_DSI1PHYCR : CPG_DSI0PHYCR); parent_name = phy_no ? "dsi1pck" : "dsi0pck"; mult = __raw_readl(dsi_reg); if (!(mult & 0x8000)) mult = 1; else mult = (mult & 0x3f) + 1; } else if (!strcmp(name, "z")) { parent_name = "pll0"; table = z_div_table; reg = CPG_FRQCRB; shift = 24; width = 5; } else { const struct div4_clk *c; for (c = div4_clks; c->name; c++) { if (!strcmp(name, c->name)) { parent_name = c->parent; table = div4_div_table; reg = c->reg; shift = c->shift; width = 4; break; } } if (!c->name) return ERR_PTR(-EINVAL); } if (!table) { return clk_register_fixed_factor(NULL, name, parent_name, 0, mult, div); } else { return clk_register_divider_table(NULL, name, parent_name, 0, cpg->reg + reg, shift, width, 0, table, &cpg->lock); } } static void __init sh73a0_cpg_clocks_init(struct device_node *np) { struct sh73a0_cpg *cpg; struct clk **clks; unsigned int i; int num_clks; num_clks = of_property_count_strings(np, "clock-output-names"); if (num_clks < 0) { pr_err("%s: failed to count clocks\n", __func__); return; } cpg = kzalloc(sizeof(*cpg), GFP_KERNEL); clks = kcalloc(num_clks, sizeof(*clks), GFP_KERNEL); if (cpg == NULL || clks == NULL) { /* We're leaking memory on purpose, there's no point in cleaning * up as the system won't boot anyway. */ return; } spin_lock_init(&cpg->lock); cpg->data.clks = clks; cpg->data.clk_num = num_clks; cpg->reg = of_iomap(np, 0); if (WARN_ON(cpg->reg == NULL)) return; /* Set SDHI clocks to a known state */ writel(0x108, cpg->reg + CPG_SD0CKCR); writel(0x108, cpg->reg + CPG_SD1CKCR); writel(0x108, cpg->reg + CPG_SD2CKCR); for (i = 0; i < num_clks; ++i) { const char *name; struct clk *clk; of_property_read_string_index(np, "clock-output-names", i, &name); clk = sh73a0_cpg_register_clock(np, cpg, name); if (IS_ERR(clk)) pr_err("%s: failed to register %pOFn %s clock (%ld)\n", __func__, np, name, PTR_ERR(clk)); else cpg->data.clks[i] = clk; } of_clk_add_provider(np, of_clk_src_onecell_get, &cpg->data); } CLK_OF_DECLARE(sh73a0_cpg_clks, "renesas,sh73a0-cpg-clocks", sh73a0_cpg_clocks_init);
{ "pile_set_name": "Github" }
package aws import ( "fmt" "log" "strings" "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/eks" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsEksNodeGroup() *schema.Resource { return &schema.Resource{ Create: resourceAwsEksNodeGroupCreate, Read: resourceAwsEksNodeGroupRead, Update: resourceAwsEksNodeGroupUpdate, Delete: resourceAwsEksNodeGroupDelete, Importer: &schema.ResourceImporter{ State: schema.ImportStatePassthrough, }, Timeouts: &schema.ResourceTimeout{ Create: schema.DefaultTimeout(60 * time.Minute), Update: schema.DefaultTimeout(60 * time.Minute), Delete: schema.DefaultTimeout(60 * time.Minute), }, Schema: map[string]*schema.Schema{ "ami_type": { Type: schema.TypeString, Optional: true, Computed: true, ForceNew: true, ValidateFunc: validation.StringInSlice([]string{ eks.AMITypesAl2X8664, eks.AMITypesAl2X8664Gpu, }, false), }, "arn": { Type: schema.TypeString, Computed: true, }, "cluster_name": { Type: schema.TypeString, Required: true, ForceNew: true, ValidateFunc: validation.NoZeroValues, }, "disk_size": { Type: schema.TypeInt, Optional: true, Computed: true, ForceNew: true, }, "force_update_version": { Type: schema.TypeBool, Optional: true, }, "instance_types": { Type: schema.TypeList, Optional: true, Computed: true, ForceNew: true, // Multiple instance types returns an API error currently: // InvalidParameterException: Instance type list not valid, only one instance type is supported! MaxItems: 1, Elem: &schema.Schema{Type: schema.TypeString}, }, "labels": { Type: schema.TypeMap, Optional: true, Elem: &schema.Schema{Type: schema.TypeString}, }, "node_group_name": { Type: schema.TypeString, Required: true, ForceNew: true, ValidateFunc: validation.NoZeroValues, }, "node_role_arn": { Type: schema.TypeString, Required: true, ForceNew: true, ValidateFunc: validation.NoZeroValues, }, "release_version": { Type: schema.TypeString, Optional: true, Computed: true, }, "remote_access": { Type: schema.TypeList, Optional: true, ForceNew: true, MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "ec2_ssh_key": { Type: schema.TypeString, Optional: true, ForceNew: true, }, "source_security_group_ids": { Type: schema.TypeSet, Optional: true, ForceNew: true, Elem: &schema.Schema{Type: schema.TypeString}, }, }, }, }, "resources": { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "autoscaling_groups": { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "name": { Type: schema.TypeString, Computed: true, }, }, }, }, "remote_access_security_group_id": { Type: schema.TypeString, Computed: true, }, }, }, }, "scaling_config": { Type: schema.TypeList, Required: true, MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "desired_size": { Type: schema.TypeInt, Required: true, ValidateFunc: validation.IntAtLeast(1), }, "max_size": { Type: schema.TypeInt, Required: true, ValidateFunc: validation.IntAtLeast(1), }, "min_size": { Type: schema.TypeInt, Required: true, ValidateFunc: validation.IntAtLeast(1), }, }, }, }, "status": { Type: schema.TypeString, Computed: true, }, "subnet_ids": { Type: schema.TypeSet, Required: true, ForceNew: true, MinItems: 1, Elem: &schema.Schema{Type: schema.TypeString}, }, "tags": tagsSchema(), "version": { Type: schema.TypeString, Optional: true, Computed: true, }, }, } } func resourceAwsEksNodeGroupCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).eksconn clusterName := d.Get("cluster_name").(string) nodeGroupName := d.Get("node_group_name").(string) input := &eks.CreateNodegroupInput{ ClientRequestToken: aws.String(resource.UniqueId()), ClusterName: aws.String(clusterName), NodegroupName: aws.String(nodeGroupName), NodeRole: aws.String(d.Get("node_role_arn").(string)), Subnets: expandStringSet(d.Get("subnet_ids").(*schema.Set)), } if v, ok := d.GetOk("ami_type"); ok { input.AmiType = aws.String(v.(string)) } if v, ok := d.GetOk("disk_size"); ok { input.DiskSize = aws.Int64(int64(v.(int))) } if v := d.Get("instance_types").([]interface{}); len(v) > 0 { input.InstanceTypes = expandStringList(v) } if v := d.Get("labels").(map[string]interface{}); len(v) > 0 { input.Labels = stringMapToPointers(v) } if v, ok := d.GetOk("release_version"); ok { input.ReleaseVersion = aws.String(v.(string)) } if v := d.Get("remote_access").([]interface{}); len(v) > 0 { input.RemoteAccess = expandEksRemoteAccessConfig(v) } if v := d.Get("scaling_config").([]interface{}); len(v) > 0 { input.ScalingConfig = expandEksNodegroupScalingConfig(v) } if v := d.Get("tags").(map[string]interface{}); len(v) > 0 { input.Tags = keyvaluetags.New(v).IgnoreAws().EksTags() } if v, ok := d.GetOk("version"); ok { input.Version = aws.String(v.(string)) } _, err := conn.CreateNodegroup(input) id := fmt.Sprintf("%s:%s", clusterName, nodeGroupName) if err != nil { return fmt.Errorf("error creating EKS Node Group (%s): %s", id, err) } d.SetId(id) stateConf := resource.StateChangeConf{ Pending: []string{eks.NodegroupStatusCreating}, Target: []string{eks.NodegroupStatusActive}, Timeout: d.Timeout(schema.TimeoutCreate), Refresh: refreshEksNodeGroupStatus(conn, clusterName, nodeGroupName), } if _, err := stateConf.WaitForState(); err != nil { return fmt.Errorf("error waiting for EKS Node Group (%s) creation: %s", d.Id(), err) } return resourceAwsEksNodeGroupRead(d, meta) } func resourceAwsEksNodeGroupRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).eksconn ignoreTagsConfig := meta.(*AWSClient).IgnoreTagsConfig clusterName, nodeGroupName, err := resourceAwsEksNodeGroupParseId(d.Id()) if err != nil { return err } input := &eks.DescribeNodegroupInput{ ClusterName: aws.String(clusterName), NodegroupName: aws.String(nodeGroupName), } output, err := conn.DescribeNodegroup(input) if isAWSErr(err, eks.ErrCodeResourceNotFoundException, "") { log.Printf("[WARN] EKS Node Group (%s) not found, removing from state", d.Id()) d.SetId("") return nil } if err != nil { return fmt.Errorf("error reading EKS Node Group (%s): %s", d.Id(), err) } nodeGroup := output.Nodegroup if nodeGroup == nil { log.Printf("[WARN] EKS Node Group (%s) not found, removing from state", d.Id()) d.SetId("") return nil } d.Set("ami_type", nodeGroup.AmiType) d.Set("arn", nodeGroup.NodegroupArn) d.Set("cluster_name", nodeGroup.ClusterName) d.Set("disk_size", nodeGroup.DiskSize) if err := d.Set("instance_types", aws.StringValueSlice(nodeGroup.InstanceTypes)); err != nil { return fmt.Errorf("error setting instance_types: %s", err) } if err := d.Set("labels", aws.StringValueMap(nodeGroup.Labels)); err != nil { return fmt.Errorf("error setting labels: %s", err) } d.Set("node_group_name", nodeGroup.NodegroupName) d.Set("node_role_arn", nodeGroup.NodeRole) d.Set("release_version", nodeGroup.ReleaseVersion) if err := d.Set("remote_access", flattenEksRemoteAccessConfig(nodeGroup.RemoteAccess)); err != nil { return fmt.Errorf("error setting remote_access: %s", err) } if err := d.Set("resources", flattenEksNodeGroupResources(nodeGroup.Resources)); err != nil { return fmt.Errorf("error setting resources: %s", err) } if err := d.Set("scaling_config", flattenEksNodeGroupScalingConfig(nodeGroup.ScalingConfig)); err != nil { return fmt.Errorf("error setting scaling_config: %s", err) } d.Set("status", nodeGroup.Status) if err := d.Set("subnet_ids", aws.StringValueSlice(nodeGroup.Subnets)); err != nil { return fmt.Errorf("error setting subnets: %s", err) } if err := d.Set("tags", keyvaluetags.EksKeyValueTags(nodeGroup.Tags).IgnoreAws().IgnoreConfig(ignoreTagsConfig).Map()); err != nil { return fmt.Errorf("error setting tags: %s", err) } d.Set("version", nodeGroup.Version) return nil } func resourceAwsEksNodeGroupUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).eksconn clusterName, nodeGroupName, err := resourceAwsEksNodeGroupParseId(d.Id()) if err != nil { return err } if d.HasChanges("labels", "scaling_config") { oldLabelsRaw, newLabelsRaw := d.GetChange("labels") input := &eks.UpdateNodegroupConfigInput{ ClientRequestToken: aws.String(resource.UniqueId()), ClusterName: aws.String(clusterName), Labels: expandEksUpdateLabelsPayload(oldLabelsRaw, newLabelsRaw), NodegroupName: aws.String(nodeGroupName), } if v := d.Get("scaling_config").([]interface{}); len(v) > 0 { input.ScalingConfig = expandEksNodegroupScalingConfig(v) } output, err := conn.UpdateNodegroupConfig(input) if err != nil { return fmt.Errorf("error updating EKS Node Group (%s) config: %s", d.Id(), err) } if output == nil || output.Update == nil || output.Update.Id == nil { return fmt.Errorf("error determining EKS Node Group (%s) config update ID: empty response", d.Id()) } updateID := aws.StringValue(output.Update.Id) err = waitForEksNodeGroupUpdate(conn, clusterName, nodeGroupName, updateID, d.Timeout(schema.TimeoutUpdate)) if err != nil { return fmt.Errorf("error waiting for EKS Node Group (%s) config update (%s): %s", d.Id(), updateID, err) } } if d.HasChanges("release_version", "version") { input := &eks.UpdateNodegroupVersionInput{ ClientRequestToken: aws.String(resource.UniqueId()), ClusterName: aws.String(clusterName), Force: aws.Bool(d.Get("force_update_version").(bool)), NodegroupName: aws.String(nodeGroupName), } if v, ok := d.GetOk("release_version"); ok && d.HasChange("release_version") { input.ReleaseVersion = aws.String(v.(string)) } if v, ok := d.GetOk("version"); ok { input.Version = aws.String(v.(string)) } output, err := conn.UpdateNodegroupVersion(input) if err != nil { return fmt.Errorf("error updating EKS Node Group (%s) version: %s", d.Id(), err) } if output == nil || output.Update == nil || output.Update.Id == nil { return fmt.Errorf("error determining EKS Node Group (%s) version update ID: empty response", d.Id()) } updateID := aws.StringValue(output.Update.Id) err = waitForEksNodeGroupUpdate(conn, clusterName, nodeGroupName, updateID, d.Timeout(schema.TimeoutUpdate)) if err != nil { return fmt.Errorf("error waiting for EKS Node Group (%s) version update (%s): %s", d.Id(), updateID, err) } } if d.HasChange("tags") { o, n := d.GetChange("tags") if err := keyvaluetags.EksUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { return fmt.Errorf("error updating tags: %s", err) } } return resourceAwsEksNodeGroupRead(d, meta) } func resourceAwsEksNodeGroupDelete(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).eksconn clusterName, nodeGroupName, err := resourceAwsEksNodeGroupParseId(d.Id()) if err != nil { return err } input := &eks.DeleteNodegroupInput{ ClusterName: aws.String(clusterName), NodegroupName: aws.String(nodeGroupName), } _, err = conn.DeleteNodegroup(input) if isAWSErr(err, eks.ErrCodeResourceNotFoundException, "") { return nil } if err != nil { return fmt.Errorf("error deleting EKS Node Group (%s): %s", d.Id(), err) } if err := waitForEksNodeGroupDeletion(conn, clusterName, nodeGroupName, d.Timeout(schema.TimeoutDelete)); err != nil { return fmt.Errorf("error waiting for EKS Node Group (%s) deletion: %s", d.Id(), err) } return nil } func expandEksNodegroupScalingConfig(l []interface{}) *eks.NodegroupScalingConfig { if len(l) == 0 || l[0] == nil { return nil } m := l[0].(map[string]interface{}) config := &eks.NodegroupScalingConfig{} if v, ok := m["desired_size"].(int); ok && v != 0 { config.DesiredSize = aws.Int64(int64(v)) } if v, ok := m["max_size"].(int); ok && v != 0 { config.MaxSize = aws.Int64(int64(v)) } if v, ok := m["min_size"].(int); ok && v != 0 { config.MinSize = aws.Int64(int64(v)) } return config } func expandEksRemoteAccessConfig(l []interface{}) *eks.RemoteAccessConfig { if len(l) == 0 || l[0] == nil { return nil } m := l[0].(map[string]interface{}) config := &eks.RemoteAccessConfig{} if v, ok := m["ec2_ssh_key"].(string); ok && v != "" { config.Ec2SshKey = aws.String(v) } if v, ok := m["source_security_group_ids"].(*schema.Set); ok && v.Len() > 0 { config.SourceSecurityGroups = expandStringSet(v) } return config } func expandEksUpdateLabelsPayload(oldLabelsMap, newLabelsMap interface{}) *eks.UpdateLabelsPayload { // EKS Labels operate similarly to keyvaluetags oldLabels := keyvaluetags.New(oldLabelsMap) newLabels := keyvaluetags.New(newLabelsMap) removedLabels := oldLabels.Removed(newLabels) updatedLabels := oldLabels.Updated(newLabels) if len(removedLabels) == 0 && len(updatedLabels) == 0 { return nil } updateLabelsPayload := &eks.UpdateLabelsPayload{} if len(removedLabels) > 0 { updateLabelsPayload.RemoveLabels = aws.StringSlice(removedLabels.Keys()) } if len(updatedLabels) > 0 { updateLabelsPayload.AddOrUpdateLabels = aws.StringMap(updatedLabels.Map()) } return updateLabelsPayload } func flattenEksAutoScalingGroups(autoScalingGroups []*eks.AutoScalingGroup) []map[string]interface{} { if len(autoScalingGroups) == 0 { return []map[string]interface{}{} } l := make([]map[string]interface{}, 0, len(autoScalingGroups)) for _, autoScalingGroup := range autoScalingGroups { m := map[string]interface{}{ "name": aws.StringValue(autoScalingGroup.Name), } l = append(l, m) } return l } func flattenEksNodeGroupResources(resources *eks.NodegroupResources) []map[string]interface{} { if resources == nil { return []map[string]interface{}{} } m := map[string]interface{}{ "autoscaling_groups": flattenEksAutoScalingGroups(resources.AutoScalingGroups), "remote_access_security_group_id": aws.StringValue(resources.RemoteAccessSecurityGroup), } return []map[string]interface{}{m} } func flattenEksNodeGroupScalingConfig(config *eks.NodegroupScalingConfig) []map[string]interface{} { if config == nil { return []map[string]interface{}{} } m := map[string]interface{}{ "desired_size": aws.Int64Value(config.DesiredSize), "max_size": aws.Int64Value(config.MaxSize), "min_size": aws.Int64Value(config.MinSize), } return []map[string]interface{}{m} } func flattenEksRemoteAccessConfig(config *eks.RemoteAccessConfig) []map[string]interface{} { if config == nil { return []map[string]interface{}{} } m := map[string]interface{}{ "ec2_ssh_key": aws.StringValue(config.Ec2SshKey), "source_security_group_ids": aws.StringValueSlice(config.SourceSecurityGroups), } return []map[string]interface{}{m} } func refreshEksNodeGroupStatus(conn *eks.EKS, clusterName string, nodeGroupName string) resource.StateRefreshFunc { return func() (interface{}, string, error) { input := &eks.DescribeNodegroupInput{ ClusterName: aws.String(clusterName), NodegroupName: aws.String(nodeGroupName), } output, err := conn.DescribeNodegroup(input) if err != nil { return "", "", err } nodeGroup := output.Nodegroup if nodeGroup == nil { return nodeGroup, "", fmt.Errorf("EKS Node Group (%s:%s) missing", clusterName, nodeGroupName) } status := aws.StringValue(nodeGroup.Status) // Return enhanced error messaging if available, instead of: // unexpected state 'CREATE_FAILED', wanted target 'ACTIVE'. last error: %!s(<nil>) if status == eks.NodegroupStatusCreateFailed || status == eks.NodegroupStatusDeleteFailed { if nodeGroup.Health == nil || len(nodeGroup.Health.Issues) == 0 || nodeGroup.Health.Issues[0] == nil { return nodeGroup, status, fmt.Errorf("unable to find additional information about %s status, check EKS Node Group (%s:%s) health", status, clusterName, nodeGroupName) } issue := nodeGroup.Health.Issues[0] return nodeGroup, status, fmt.Errorf("%s: %s. Resource IDs: %v", aws.StringValue(issue.Code), aws.StringValue(issue.Message), aws.StringValueSlice(issue.ResourceIds)) } return nodeGroup, status, nil } } func refreshEksNodeGroupUpdateStatus(conn *eks.EKS, clusterName string, nodeGroupName string, updateID string) resource.StateRefreshFunc { return func() (interface{}, string, error) { input := &eks.DescribeUpdateInput{ Name: aws.String(clusterName), NodegroupName: aws.String(nodeGroupName), UpdateId: aws.String(updateID), } output, err := conn.DescribeUpdate(input) if err != nil { return nil, "", err } if output == nil || output.Update == nil { return nil, "", fmt.Errorf("EKS Node Group (%s:%s) update (%s) missing", clusterName, nodeGroupName, updateID) } return output.Update, aws.StringValue(output.Update.Status), nil } } func waitForEksNodeGroupDeletion(conn *eks.EKS, clusterName string, nodeGroupName string, timeout time.Duration) error { stateConf := resource.StateChangeConf{ Pending: []string{ eks.NodegroupStatusActive, eks.NodegroupStatusDeleting, }, Target: []string{""}, Timeout: timeout, Refresh: refreshEksNodeGroupStatus(conn, clusterName, nodeGroupName), } _, err := stateConf.WaitForState() if isAWSErr(err, eks.ErrCodeResourceNotFoundException, "") { return nil } return err } func waitForEksNodeGroupUpdate(conn *eks.EKS, clusterName, nodeGroupName string, updateID string, timeout time.Duration) error { stateConf := resource.StateChangeConf{ Pending: []string{eks.UpdateStatusInProgress}, Target: []string{ eks.UpdateStatusCancelled, eks.UpdateStatusFailed, eks.UpdateStatusSuccessful, }, Timeout: timeout, Refresh: refreshEksNodeGroupUpdateStatus(conn, clusterName, nodeGroupName, updateID), } updateRaw, err := stateConf.WaitForState() if err != nil { return err } update := updateRaw.(*eks.Update) if aws.StringValue(update.Status) == eks.UpdateStatusSuccessful { return nil } var detailedErrors []string for i, updateError := range update.Errors { detailedErrors = append(detailedErrors, fmt.Sprintf("Error %d: Code: %s / Message: %s", i+1, aws.StringValue(updateError.ErrorCode), aws.StringValue(updateError.ErrorMessage))) } return fmt.Errorf("EKS Node Group (%s) update (%s) status (%s) not successful: Errors:\n%s", clusterName, updateID, aws.StringValue(update.Status), strings.Join(detailedErrors, "\n")) } func resourceAwsEksNodeGroupParseId(id string) (string, string, error) { parts := strings.Split(id, ":") if len(parts) != 2 { return "", "", fmt.Errorf("unexpected format of ID (%s), expected cluster-name:node-group-name", id) } return parts[0], parts[1], nil }
{ "pile_set_name": "Github" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" /> <link rel="stylesheet" type="text/css" href="https://www.jqwidgets.com/public/jqwidgets/styles/jqx.base.css"> <link rel="stylesheet" type="text/css" href="https://www.jqwidgets.com/public/jqwidgets/styles/jqx.material-purple.css"> </head> <body> <div id="app"></div> </body> </html>
{ "pile_set_name": "Github" }
/* * Jitsi, the OpenSource Java VoIP and Instant Messaging client. * * Copyright @ 2015 Atlassian Pty Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package net.java.sip.communicator.service.gui; import java.awt.*; import java.awt.event.*; import java.util.*; import java.util.List; import net.java.sip.communicator.service.contactlist.*; import net.java.sip.communicator.service.gui.event.*; import net.java.sip.communicator.service.muc.*; import net.java.sip.communicator.service.protocol.*; import net.java.sip.communicator.util.account.*; /** * The <tt>UIService</tt> offers generic access to the graphical user interface * for all modules that would like to interact with the user. * <p> * Through the <tt>UIService</tt> all modules can add their own components in * different menus, toolbars, etc. within the ui. Each <tt>UIService</tt> * implementation should export its supported "pluggable" containers - a set of * <tt>Container</tt>s corresponding to different "places" in the application, * where a module can add a component. * <p> * The <tt>UIService</tt> provides also methods that would allow to other * modules to control the visibility, size and position of the main application * window. Some of these methods are: setVisible, minimize, maximize, resize, * move, etc. * <p> * A way to show different types of simple windows is provided to allow other * modules to show different simple messages, like warning or error messages. In * order to show a simple warning message, a module should invoke the * getPopupDialog method and then one of the showXXX methods, which corresponds * best to the required dialog. * <p> * Certain components within the GUI, like "AddContact" window for example, * could be also shown from outside the UI bundle. To make one of these * component exportable, the <tt>UIService</tt> implementation should attach to * it an <tt>WindowID</tt>. A window then could be shown, by invoking * <code>getExportedWindow(WindowID)</code> and then <code>show</code>. The * <tt>WindowID</tt> above should be obtained from * <code>getSupportedExportedWindows</code>. * * @author Yana Stamcheva * @author Dmitri Melnikov * @author Adam Netocny * @author Lyubomir Marinov * @author Hristo Terezov */ public interface UIService { /** * Returns TRUE if the application is visible and FALSE otherwise. This * method is meant to be used by the systray service in order to detect the * visibility of the application. * * @return <code>true</code> if the application is visible and * <code>false</code> otherwise. * * @see #setVisible(boolean) */ public boolean isVisible(); /** * Shows or hides the main application window depending on the value of * parameter <code>visible</code>. Meant to be used by the systray when it * needs to show or hide the application. * * @param visible if <code>true</code>, shows the main application window; * otherwise, hides the main application window. * * @see #isVisible() */ public void setVisible(boolean visible); /** * Returns the current location of the main application window. The returned * point is the top left corner of the window. * * @return The top left corner coordinates of the main application window. */ public Point getLocation(); /** * Locates the main application window to the new x and y coordinates. * * @param x The new x coordinate. * @param y The new y coordinate. */ public void setLocation(int x, int y); /** * Returns the size of the main application window. * * @return the size of the main application window. */ public Dimension getSize(); /** * Sets the size of the main application window. * * @param width The width of the window. * @param height The height of the window. */ public void setSize(int width, int height); /** * Minimizes the main application window. */ public void minimize(); /** * Maximizes the main application window. */ public void maximize(); /** * Restores the main application window. */ public void restore(); /** * Resizes the main application window with the given width and height. * * @param width The new width. * @param height The new height. */ public void resize(int width, int height); /** * Moves the main application window to the given coordinates. * * @param x The x coordinate. * @param y The y coordinate. */ public void move(int x, int y); /** * Brings the focus to the main application window. */ public void bringToFront(); /** * Called from the systray service when a tray has been initialized and * hiding (instead of minimizing or exiting) is possible). If hiding is * possible and the option to minimize is not selected, the application * gets hidden on clicking 'X'. * * @param true if a tray icon was loaded. */ public void setMainWindowCanHide(boolean exitOnClose); /** * Returns an exported window given by the <tt>WindowID</tt>. This could be * for example the "Add contact" window or any other window within the * application. The <tt>windowID</tt> should be one of the WINDOW_XXX * obtained by the <tt>getSupportedExportedWindows</tt> method. * * @param windowID One of the WINDOW_XXX WindowID-s. * @throws IllegalArgumentException if the specified <tt>windowID</tt> is * not recognized by the implementation (note that * implementations MUST properly handle all WINDOW_XXX ID-s. * @return the window to be shown. */ public ExportedWindow getExportedWindow(WindowID windowID) throws IllegalArgumentException; /** * Returns an exported window given by the <tt>WindowID</tt>. This could be * for example the "Add contact" window or any other window within the * application. The <tt>windowID</tt> should be one of the WINDOW_XXX * obtained by the <tt>getSupportedExportedWindows</tt> method. * * @param windowID One of the WINDOW_XXX WindowID-s. * @param params The parameters to be passed to the returned exported * window. * @throws IllegalArgumentException if the specified <tt>windowID</tt> is * not recognized by the implementation (note that * implementations MUST properly handle all WINDOW_XXX ID-s. * @return the window to be shown. */ public ExportedWindow getExportedWindow(WindowID windowID, Object[] params) throws IllegalArgumentException; /** * Returns a configurable popup dialog, that could be used to show either a * warning message, error message, information message, etc. or to prompt * user for simple one field input or to question the user. * * @return a <code>PopupDialog</code>. * @see PopupDialog */ public PopupDialog getPopupDialog(); /** * Returns the <tt>Chat</tt> corresponding to the given <tt>Contact</tt>. * * @param contact the <tt>Contact</tt> for which the searched chat is about. * @return the <tt>Chat</tt> corresponding to the given <tt>Contact</tt>. */ public Chat getChat(Contact contact); /** * Returns the <tt>Chat</tt> corresponding to the given <tt>Contact</tt>. * * @param contact the <tt>Contact</tt> for which the searched chat is about. * @param escapedMessageID the message ID of the message that should be * excluded from the history when the last one is loaded in the chat * @return the <tt>Chat</tt> corresponding to the given <tt>Contact</tt>. */ public Chat getChat(Contact contact, String escapedMessageID); /** * Returns the <tt>Chat</tt> corresponding to the given <tt>ChatRoom</tt>. * * @param chatRoom the <tt>ChatRoom</tt> for which the searched chat is * about. * @return the <tt>Chat</tt> corresponding to the given <tt>ChatRoom</tt>. */ public Chat getChat(ChatRoom chatRoom); /** * Returns a list of all open Chats * * @return A list of all open Chats */ public List<Chat> getChats(); /** * Get the MetaContact corresponding to the chat. * The chat must correspond to a one on one conversation. If it is a * group chat an exception will be thrown. * * @param chat The chat to get the MetaContact from * @return The MetaContact corresponding to the chat. */ public MetaContact getChatContact(Chat chat); /** * Returns the selected <tt>Chat</tt>. * * @return the selected <tt>Chat</tt>. */ public Chat getCurrentChat(); /** * Returns the phone number currently entered in the phone number field. * This method is meant to be used by plugins that are interested in * operations with the currently entered phone number. * * @return the phone number currently entered in the phone number field. */ public String getCurrentPhoneNumber(); /** * Sets the phone number in the phone number field. This method is meant to * be used by plugins that are interested in operations with the currently * entered phone number. * * @param phoneNumber the phone number to enter. */ public void setCurrentPhoneNumber(String phoneNumber); /** * Returns a default implementation of the <tt>SecurityAuthority</tt> * interface that can be used by non-UI components that would like to launch * the registration process for a protocol provider. Initially this method * was meant for use by the systray bundle and the protocol URI handlers. * * @param protocolProvider the <tt>ProtocolProviderService</tt> for which * the authentication window is about. * * @return a default implementation of the <tt>SecurityAuthority</tt> * interface that can be used by non-UI components that would like * to launch the registration process for a protocol provider. */ public SecurityAuthority getDefaultSecurityAuthority( ProtocolProviderService protocolProvider); /** * Returns an iterator over a set of windowID-s. Each <tt>WindowID</tt> * points to a window in the current UI implementation. Each * <tt>WindowID</tt> in the set is one of the constants in the * <tt>ExportedWindow</tt> interface. The method is meant to be used by * bundles that would like to have access to some windows in the gui - for * example the "Add contact" window, the "Settings" window, the * "Chat window", etc. * * @return Iterator An iterator to a set containing WindowID-s representing * all exported windows supported by the current UI implementation. */ public Iterator<WindowID> getSupportedExportedWindows(); /** * Checks if a window with the given <tt>WindowID</tt> is contained in the * current UI implementation. * * @param windowID one of the <tt>WindowID</tt>-s, defined in the * <tt>ExportedWindow</tt> interface. * @return <code>true</code> if the component with the given * <tt>WindowID</tt> is contained in the current UI implementation, * <code>false</code> otherwise. */ public boolean isExportedWindowSupported(WindowID windowID); /** * Returns the <tt>WizardContainer</tt> for the current UIService * implementation. The <tt>WizardContainer</tt> is meant to be implemented * by the UI service implementation in order to allow other modules to add * to the GUI <tt>AccountRegistrationWizard</tt> s. Each of these wizards is * made for a given protocol and should provide a sequence of user interface * forms through which the user could register a new account. * * @return Returns the <tt>AccountRegistrationWizardContainer</tt> for the * current UIService implementation. */ public WizardContainer getAccountRegWizardContainer(); /** * Returns an iterator over a set containing containerID-s pointing to * containers supported by the current UI implementation. Each containerID * in the set is one of the CONTAINER_XXX constants. The method is meant to * be used by plugins or bundles that would like to add components to the * user interface. Before adding any component they should use this method * to obtain all possible places, which could contain external components, * like different menus, toolbars, etc. * * @return Iterator An iterator to a set containing containerID-s * representing all containers supported by the current UI * implementation. */ public Iterator<Container> getSupportedContainers(); /** * Checks if the container with the given <tt>Container</tt> is supported * from the current UI implementation. * * @param containderID One of the CONTAINER_XXX Container-s. * @return <code>true</code> if the container with the given * <tt>Container</tt> is supported from the current UI * implementation, <code>false</code> otherwise. */ public boolean isContainerSupported(Container containderID); /** * Determines whether the Mac OS X screen menu bar is being used by the UI * for its main menu instead of the Windows-like menu bars at the top of the * windows. * <p> * A common use of the returned indicator is for the purposes of * platform-sensitive UI since Mac OS X employs a single screen menu bar, * Windows and Linux/GTK+ use per-window menu bars and it is inconsistent on * Mac OS X to have the Window-like menu bars. * </p> * * @return <tt>true</tt> if the Mac OS X screen menu bar is being used by * the UI for its main menu instead of the Windows-like menu bars at * the top of the windows; otherwise, <tt>false</tt> */ public boolean useMacOSXScreenMenuBar(); /** * Returns the <tt>ConfigurationContainer</tt> associated with this * <tt>UIService</tt>. * * @return the <tt>ConfigurationContainer</tt> associated with this * <tt>UIService</tt> */ public ConfigurationContainer getConfigurationContainer(); /** * Returns the create account window. * * @return the create account window */ public CreateAccountWindow getCreateAccountWindow(); /** * Adds the given <tt>WindowListener</tt> listening for events triggered * by the main UIService component. This is normally the main application * window component, the one containing the contact list. This listener * would also receive events when this window is shown or hidden. * @param l the <tt>WindowListener</tt> to add */ public void addWindowListener(WindowListener l); /** * Removes the given <tt>WindowListener</tt> from the list of registered * listener. The <tt>WindowListener</tt> is listening for events * triggered by the main UIService component. This is normally the main * application window component, the one containing the contact list. This * listener would also receive events when this window is shown or hidden. * @param l the <tt>WindowListener</tt> to remove */ public void removeWindowListener(WindowListener l); /** * Provides all currently instantiated <tt>Chats</tt>. * * @return all active <tt>Chats</tt>. */ public Collection <Chat> getAllChats(); /** * Registers a <tt>NewChatListener</tt> to be informed when new * <tt>Chats</tt> are created. * @param listener listener to be registered */ public void addChatListener(ChatListener listener); /** * Removes the registration of a <tt>NewChatListener</tt>. * @param listener listener to be unregistered */ public void removeChatListener(ChatListener listener); /** * Repaints and revalidates the whole UI. This method is meant to be used * to runtime apply a skin and refresh automatically the user interface. */ public void repaintUI(); /** * Creates a new <tt>Call</tt> with a specific set of participants. * * @param participants an array of <tt>String</tt> values specifying the * participants to be included into the newly created <tt>Call</tt> */ public void createCall(String[] participants); /** * Starts a new <tt>Chat</tt> with a specific set of participants. * * @param participants an array of <tt>String</tt> values specifying the * participants to be included into the newly created <tt>Chat</tt> */ public void startChat(String[] participants); /** * Starts a new <tt>Chat</tt> with a specific set of participants. * * @param participants an array of <tt>String</tt> values specifying the * participants to be included into the newly created <tt>Chat</tt> * @param isSmsEnabled whether sms option should be enabled if possible */ public void startChat(String[] participants, boolean isSmsEnabled); /** * Creates a contact list component. * * @param clContainer the parent contact list container * @return the created <tt>ContactList</tt> */ public ContactList createContactListComponent( ContactListContainer clContainer); /** * Returns a collection of all currently in progress calls. * * @return a collection of all currently in progress calls. */ public Collection<Call> getInProgressCalls(); /** * Returns the login manager used by the current UI implementation. * * @return the login manager used by the current UI implementation */ public LoginManager getLoginManager(); /** * Opens a chat room window for the given <tt>ChatRoomWrapper</tt> instance. * * @param chatRoom the chat room associated with the chat room window */ public void openChatRoomWindow(ChatRoomWrapper chatRoom); /** * Closes the chat room window for the given <tt>ChatRoomWrapper</tt> * instance. * * @param chatRoom the chat room associated with the chat room window */ public void closeChatRoomWindow(ChatRoomWrapper chatRoom); /** * Shows Add chat room dialog. */ public void showAddChatRoomDialog(); /** * Shows chat room open automatically configuration dialog. * @param chatRoomId the chat room id of the chat room associated with the * dialog * @param pps the protocol provider service of the chat room */ public void showChatRoomAutoOpenConfigDialog( ProtocolProviderService pps, String chatRoomId); }
{ "pile_set_name": "Github" }
# frozen_string_literal: true require 'erb' require 'yaml' require 'tempfile' if RUBY_PLATFORM == 'java' require 'java' require 'jdbc/mysql' Jdbc::MySQL.load_driver end class Sphinx attr_accessor :host, :username, :password def initialize self.host = 'localhost' self.username = 'root' self.password = '' if File.exist?('spec/fixtures/sql/conf.yml') config = YAML.load(File.open('spec/fixtures/sql/conf.yml')) self.host = config['host'] self.username = config['username'] self.password = config['password'] end end def bin_path ENV.fetch 'SPHINX_BIN', '' end def setup_mysql databases = mysql_client.query "SHOW DATABASES" unless databases.include?("riddle") mysql_client.execute "CREATE DATABASE riddle" end mysql_client.execute 'USE riddle' structure = File.open('spec/fixtures/sql/structure.sql') { |f| f.read } structure.split(/;/).each { |sql| mysql_client.execute sql } mysql_client.execute <<-SQL LOAD DATA LOCAL INFILE '#{fixtures_path}/sql/data.tsv' INTO TABLE `riddle`.`people` FIELDS TERMINATED BY ',' ENCLOSED BY "'" (gender, first_name, middle_initial, last_name, street_address, city, state, postcode, email, birthday) SQL mysql_client.close end def mysql_client @mysql_client ||= if RUBY_PLATFORM == 'java' JRubyClient.new host, username, password else MRIClient.new host, username, password end end def generate_configuration template = File.open('spec/fixtures/sphinx/configuration.erb') { |f| f.read } File.open('spec/fixtures/sphinx/spec.conf', 'w') { |f| f.puts ERB.new(template).result(binding) } FileUtils.mkdir_p "spec/fixtures/sphinx/binlog" end def index cmd = "#{bin_path}indexer --config #{fixtures_path}/sphinx/spec.conf --all" cmd << ' --rotate' if running? `#{cmd}` end def start return if running? `#{bin_path}searchd --config #{fixtures_path}/sphinx/spec.conf` sleep(1) unless running? puts 'Failed to start searchd daemon. Check fixtures/sphinx/searchd.log.' end end def stop return unless running? stop_flag = '--stopwait' stop_flag = '--stop' if Riddle.loaded_version.to_i < 1 `#{bin_path}searchd --config #{fixtures_path}/sphinx/spec.conf #{stop_flag}` end private def fixtures_path File.expand_path File.join(File.dirname(__FILE__), '..', 'fixtures') end def pid if File.exists?("#{fixtures_path}/sphinx/searchd.pid") `cat #{fixtures_path}/sphinx/searchd.pid`[/\d+/] else nil end end def running? pid && `ps #{pid} | wc -l`.to_i > 1 end end
{ "pile_set_name": "Github" }
/** * Copyright Soramitsu Co., Ltd. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ #include "ametsuchi/impl/flat_file_block_storage.hpp" #include <boost/filesystem.hpp> #include "backend/protobuf/block.hpp" #include "common/byteutils.hpp" #include "logger/logger.hpp" using namespace iroha::ametsuchi; FlatFileBlockStorage::FlatFileBlockStorage( std::unique_ptr<FlatFile> flat_file, std::shared_ptr<shared_model::interface::BlockJsonConverter> json_converter, logger::LoggerPtr log) : flat_file_storage_(std::move(flat_file)), json_converter_(std::move(json_converter)), log_(std::move(log)) {} bool FlatFileBlockStorage::insert( std::shared_ptr<const shared_model::interface::Block> block) { return json_converter_->serialize(*block).match( [&](const auto &block_json) { return flat_file_storage_->add(block->height(), stringToBytes(block_json.value)); }, [this](const auto &error) { log_->warn("Error while block serialization: {}", error.error); return false; }); } boost::optional<std::unique_ptr<shared_model::interface::Block>> FlatFileBlockStorage::fetch( shared_model::interface::types::HeightType height) const { auto storage_block = flat_file_storage_->get(height); if (not storage_block) { return boost::none; } return json_converter_->deserialize(bytesToString(*storage_block)) .match( [&](auto &&block) { return boost::make_optional< std::unique_ptr<shared_model::interface::Block>>( std::move(block.value)); }, [&](const auto &error) -> boost::optional< std::unique_ptr<shared_model::interface::Block>> { log_->warn("Error while block deserialization: {}", error.error); return boost::none; }); } size_t FlatFileBlockStorage::size() const { return flat_file_storage_->blockIdentifiers().size(); } void FlatFileBlockStorage::clear() { flat_file_storage_->dropAll(); } void FlatFileBlockStorage::forEach( iroha::ametsuchi::BlockStorage::FunctionType function) const { for (auto block_id : flat_file_storage_->blockIdentifiers()) { auto block = fetch(block_id); BOOST_ASSERT(block); function(std::move(*block)); } }
{ "pile_set_name": "Github" }
### ### DO NOT MODIFY THIS FILE. THIS FILE HAS BEEN AUTOGENERATED ### FROM circleci/node:10.22.1-buster # # Install Java 11 LTS / OpenJDK 11 # RUN if grep -q Debian /etc/os-release && grep -q stretch /etc/os-release; then \ echo 'deb http://deb.debian.org/debian stretch-backports main' | sudo tee -a /etc/apt/sources.list.d/stretch-backports.list; \ elif grep -q Ubuntu /etc/os-release && grep -q xenial /etc/os-release; then \ sudo apt-get update && sudo apt-get install -y software-properties-common && \ sudo add-apt-repository -y ppa:openjdk-r/ppa; \ fi && \ sudo apt-get update && sudo apt-get install -y openjdk-11-jre openjdk-11-jre-headless openjdk-11-jdk openjdk-11-jdk-headless && \ sudo apt-get install -y bzip2 libgconf-2-4 # for extracting firefox and running chrome, respectively # install firefox # RUN FIREFOX_URL="https://download.mozilla.org/?product=firefox-latest-ssl&os=linux64&lang=en-US" \ && ACTUAL_URL=$(curl -Ls -o /dev/null -w %{url_effective} $FIREFOX_URL) \ && curl --silent --show-error --location --fail --retry 3 --output /tmp/firefox.tar.bz2 $ACTUAL_URL \ && sudo tar -xvjf /tmp/firefox.tar.bz2 -C /opt \ && sudo ln -s /opt/firefox/firefox /usr/local/bin/firefox \ && sudo apt-get install -y libgtk3.0-cil-dev libasound2 libasound2 libdbus-glib-1-2 libdbus-1-3 \ && rm -rf /tmp/firefox.* \ && firefox --version # install geckodriver RUN export GECKODRIVER_LATEST_RELEASE_URL=$(curl https://api.github.com/repos/mozilla/geckodriver/releases/latest | jq -r ".assets[] | select(.name | test(\"linux64.tar.gz$\")) | .browser_download_url") \ && curl --silent --show-error --location --fail --retry 3 --output /tmp/geckodriver_linux64.tar.gz "$GECKODRIVER_LATEST_RELEASE_URL" \ && cd /tmp \ && tar xf geckodriver_linux64.tar.gz \ && rm -rf geckodriver_linux64.tar.gz \ && sudo mv geckodriver /usr/local/bin/geckodriver \ && sudo chmod +x /usr/local/bin/geckodriver \ && geckodriver --version # install chrome RUN cd /home/circleci && wget -O google-chrome-stable_current_amd64.deb -t 5 "https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb" \ && (sudo dpkg -i google-chrome-stable_current_amd64.deb || sudo apt-get -fy install) \ && rm -rf google-chrome-stable_current_amd64.deb \ && sudo sed -i 's|HERE/chrome"|HERE/chrome" --disable-setuid-sandbox --no-sandbox|g' \ "/opt/google/chrome/google-chrome" \ && google-chrome --version RUN CHROME_VERSION="$(google-chrome --version)" \ && export CHROMEDRIVER_RELEASE="$(echo $CHROME_VERSION | sed 's/^Google Chrome //')" && export CHROMEDRIVER_RELEASE=${CHROMEDRIVER_RELEASE%%.*} \ && CHROMEDRIVER_VERSION=$(curl --silent --show-error --location --fail --retry 4 --retry-delay 5 http://chromedriver.storage.googleapis.com/LATEST_RELEASE_${CHROMEDRIVER_RELEASE}) \ && curl --silent --show-error --location --fail --retry 4 --retry-delay 5 --output /tmp/chromedriver_linux64.zip "http://chromedriver.storage.googleapis.com/$CHROMEDRIVER_VERSION/chromedriver_linux64.zip" \ && cd /tmp \ && unzip chromedriver_linux64.zip \ && rm -rf chromedriver_linux64.zip \ && sudo mv chromedriver /usr/local/bin/chromedriver \ && sudo chmod +x /usr/local/bin/chromedriver \ && chromedriver --version # Google Chrome < v85 had libxss1 as a dependency. It no longer does but people # have been depending on it so installing manually. RUN sudo apt-get install -y libxss1 # start xvfb automatically to avoid needing to express in circle.yml ENV DISPLAY :99 RUN printf '#!/bin/sh\nXvfb :99 -screen 0 1280x1024x24 &\nexec "$@"\n' > /tmp/entrypoint \ && chmod +x /tmp/entrypoint \ && sudo mv /tmp/entrypoint /docker-entrypoint.sh # ensure that the build agent doesn't override the entrypoint LABEL com.circleci.preserve-entrypoint=true ENTRYPOINT ["/docker-entrypoint.sh"] CMD ["/bin/sh"]
{ "pile_set_name": "Github" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.5.0_11) on Mon Jan 19 00:08:32 CET 2009 --> <TITLE> Uses of Class it.eng.spagobi.engines.geo.dataset.provider.Hierarchy </TITLE> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { parent.document.title="Uses of Class it.eng.spagobi.engines.geo.dataset.provider.Hierarchy"; } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../it/eng/spagobi/engines/geo/dataset/provider/Hierarchy.html" title="class in it.eng.spagobi.engines.geo.dataset.provider"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../../../index.html?it/eng/spagobi/engines/geo/dataset/provider/\class-useHierarchy.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="Hierarchy.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <CENTER> <H2> <B>Uses of Class<br>it.eng.spagobi.engines.geo.dataset.provider.Hierarchy</B></H2> </CENTER> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Packages that use <A HREF="../../../../../../../../it/eng/spagobi/engines/geo/dataset/provider/Hierarchy.html" title="class in it.eng.spagobi.engines.geo.dataset.provider">Hierarchy</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#it.eng.spagobi.engines.geo.datamart.provider"><B>it.eng.spagobi.engines.geo.datamart.provider</B></A></TD> <TD>&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <A NAME="it.eng.spagobi.engines.geo.datamart.provider"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Uses of <A HREF="../../../../../../../../it/eng/spagobi/engines/geo/dataset/provider/Hierarchy.html" title="class in it.eng.spagobi.engines.geo.dataset.provider">Hierarchy</A> in <A HREF="../../../../../../../../it/eng/spagobi/engines/geo/datamart/provider/package-summary.html">it.eng.spagobi.engines.geo.datamart.provider</A></FONT></TH> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../../../../../it/eng/spagobi/engines/geo/datamart/provider/package-summary.html">it.eng.spagobi.engines.geo.datamart.provider</A> that return <A HREF="../../../../../../../../it/eng/spagobi/engines/geo/dataset/provider/Hierarchy.html" title="class in it.eng.spagobi.engines.geo.dataset.provider">Hierarchy</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../../../../../it/eng/spagobi/engines/geo/dataset/provider/Hierarchy.html" title="class in it.eng.spagobi.engines.geo.dataset.provider">Hierarchy</A></CODE></FONT></TD> <TD><CODE><B>IDataMartProvider.</B><B><A HREF="../../../../../../../../it/eng/spagobi/engines/geo/datamart/provider/IDataMartProvider.html#getHierarchy(java.lang.String)">getHierarchy</A></B>(java.lang.String&nbsp;name)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the hierarchy.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../../../../../it/eng/spagobi/engines/geo/dataset/provider/Hierarchy.html" title="class in it.eng.spagobi.engines.geo.dataset.provider">Hierarchy</A></CODE></FONT></TD> <TD><CODE><B>AbstractDataMartProvider.</B><B><A HREF="../../../../../../../../it/eng/spagobi/engines/geo/datamart/provider/AbstractDataMartProvider.html#getHierarchy(java.lang.String)">getHierarchy</A></B>(java.lang.String&nbsp;name)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../../../../../it/eng/spagobi/engines/geo/dataset/provider/Hierarchy.html" title="class in it.eng.spagobi.engines.geo.dataset.provider">Hierarchy</A></CODE></FONT></TD> <TD><CODE><B>IDataMartProvider.</B><B><A HREF="../../../../../../../../it/eng/spagobi/engines/geo/datamart/provider/IDataMartProvider.html#getSelectedHierarchy()">getSelectedHierarchy</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the selected hierarchy.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../../../../../it/eng/spagobi/engines/geo/dataset/provider/Hierarchy.html" title="class in it.eng.spagobi.engines.geo.dataset.provider">Hierarchy</A></CODE></FONT></TD> <TD><CODE><B>AbstractDataMartProvider.</B><B><A HREF="../../../../../../../../it/eng/spagobi/engines/geo/datamart/provider/AbstractDataMartProvider.html#getSelectedHierarchy()">getSelectedHierarchy</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../it/eng/spagobi/engines/geo/dataset/provider/Hierarchy.html" title="class in it.eng.spagobi.engines.geo.dataset.provider"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../../../index.html?it/eng/spagobi/engines/geo/dataset/provider/\class-useHierarchy.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="Hierarchy.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> </BODY> </HTML>
{ "pile_set_name": "Github" }
nofile=(No file was uploaded)
{ "pile_set_name": "Github" }
// This file is here so go get succeeds as without it errors with: // no buildable Go source files in ... // // +build !windows package oleutil
{ "pile_set_name": "Github" }
/* * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code 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 GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package org.openjdk.skara.vcs.openjdk; import org.openjdk.skara.vcs.Tag; import java.util.*; import java.util.regex.Pattern; public class OpenJDKTag { private final Tag tag; private final String prefix; private final String version; private final String buildPrefix; private final String buildNum; private OpenJDKTag(Tag tag, String prefix, String version, String buildPrefix, String buildNum) { this.tag = tag; this.prefix = prefix; this.version = version; this.buildPrefix = buildPrefix; this.buildNum = buildNum; } /** * The patterns have the following groups: * * prefix version update buildPrefix buildNum * ------- ------- ------ ----------- ------ * jdk-9.1+27 -> jdk-9.1 9.1 + 27 * jdk8-b90 -> jdk8 8 -b 90 * jdk7u40-b20 -> jdk7u40 7u40 u20 -b 29 * hs24-b30 -> hs24 24 -b 30 * hs23.6-b19 -> hs23.6 23.6 .6 -b 19 * 11.1+22 -> 11.1 11.1 .1 + 22 */ private final static String legacyOpenJDKVersionPattern = "(jdk([0-9]{1,2}(u[0-9]{1,3})?))"; private final static String legacyHSVersionPattern = "((hs[0-9]{1,2}(\\.[0-9]{1,3})?))"; private final static String legacyBuildPattern = "(-b)([0-9]{2,3})"; private final static String OpenJDKVersionPattern = "(jdk-([0-9]+(\\.[0-9]){0,3}))(\\+)([0-9]+)"; private final static String OpenJFXVersionPattern = "((?:jdk-){0,1}([1-9](?:(?:[0-9]*)(\\.(?:0|[1-9][0-9]*)){0,3})))(?:(\\+)([0-9]+)|(-ga))"; private final static List<Pattern> tagPatterns = List.of(Pattern.compile(legacyOpenJDKVersionPattern + legacyBuildPattern), Pattern.compile(legacyHSVersionPattern + legacyBuildPattern), Pattern.compile(OpenJDKVersionPattern), Pattern.compile(OpenJFXVersionPattern)); /** * Attempts to create an OpenJDKTag instance from a general Tag. * * This will succeed if the tag follows the OpenJDK tag formatting * conventions. * @param tag * @return */ public static Optional<OpenJDKTag> create(Tag tag) { for (var pattern : tagPatterns) { var matcher = pattern.matcher(tag.name()); if (matcher.matches()) { return Optional.of(new OpenJDKTag(tag, matcher.group(1), matcher.group(2), matcher.group(4), matcher.group(5))); } } return Optional.empty(); } /** * The original Tag this OpenJDKTag was created from. * * @return */ public Tag tag() { return tag; } /** * Version number, such as 11, 9.1, 8, 7u20. * * @return */ public String version() { return version; } /** * Build number. * * @return */ public int buildNum() { if (buildNum == null) { return 0; } return Integer.parseInt(buildNum); } /** * Tag of the previous build (if any). * * @return */ public Optional<OpenJDKTag> previous() { if (buildNum() == 0) { return Optional.empty(); } // Make sure build numbers < 10 for JDK 9 tags are not prefixed with '0' var previousBuildNum = buildNum() - 1; var formattedBuildNum = String.format(buildPrefix.equals("+") ? "%d" : "%02d", previousBuildNum); var tagName = prefix + buildPrefix + formattedBuildNum; var tag = new Tag(tagName); return create(tag); } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } OpenJDKTag that = (OpenJDKTag) o; return tag.equals(that.tag) && prefix.equals(that.prefix) && version.equals(that.version) && buildPrefix.equals(that.buildPrefix) && buildNum.equals(that.buildNum); } @Override public int hashCode() { return Objects.hash(tag, prefix, version, buildPrefix, buildNum); } }
{ "pile_set_name": "Github" }
// Gradients // Horizontal gradient, from left to right // // Creates two color stops, start and end, by specifying a color and position for each color stop. // Color stops are not available in IE9 and below. @mixin gradient-horizontal($start-color: #555, $end-color: #333, $start-percent: 0%, $end-percent: 100%) { background-image: -webkit-linear-gradient(left, $start-color $start-percent, $end-color $end-percent); // Safari 5.1-6, Chrome 10+ background-image: -o-linear-gradient(left, $start-color $start-percent, $end-color $end-percent); // Opera 12 background-image: linear-gradient(to right, $start-color $start-percent, $end-color $end-percent); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+ background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}', GradientType=1); // IE9 and down } // Vertical gradient, from top to bottom // // Creates two color stops, start and end, by specifying a color and position for each color stop. // Color stops are not available in IE9 and below. @mixin gradient-vertical($start-color: #555, $end-color: #333, $start-percent: 0%, $end-percent: 100%) { background-image: -webkit-linear-gradient(top, $start-color $start-percent, $end-color $end-percent); // Safari 5.1-6, Chrome 10+ background-image: -o-linear-gradient(top, $start-color $start-percent, $end-color $end-percent); // Opera 12 background-image: linear-gradient(to bottom, $start-color $start-percent, $end-color $end-percent); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+ background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}', GradientType=0); // IE9 and down } @mixin gradient-directional($start-color: #555, $end-color: #333, $deg: 45deg) { background-repeat: repeat-x; background-image: -webkit-linear-gradient($deg, $start-color, $end-color); // Safari 5.1-6, Chrome 10+ background-image: -o-linear-gradient($deg, $start-color, $end-color); // Opera 12 background-image: linear-gradient($deg, $start-color, $end-color); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+ } @mixin gradient-horizontal-three-colors($start-color: #00b3ee, $mid-color: #7a43b6, $color-stop: 50%, $end-color: #c3325f) { background-image: -webkit-linear-gradient(left, $start-color, $mid-color $color-stop, $end-color); background-image: -o-linear-gradient(left, $start-color, $mid-color $color-stop, $end-color); background-image: linear-gradient(to right, $start-color, $mid-color $color-stop, $end-color); background-repeat: no-repeat; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}', GradientType=1); // IE9 and down, gets no color-stop at all for proper fallback } @mixin gradient-vertical-three-colors($start-color: #00b3ee, $mid-color: #7a43b6, $color-stop: 50%, $end-color: #c3325f) { background-image: -webkit-linear-gradient($start-color, $mid-color $color-stop, $end-color); background-image: -o-linear-gradient($start-color, $mid-color $color-stop, $end-color); background-image: linear-gradient($start-color, $mid-color $color-stop, $end-color); background-repeat: no-repeat; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}', GradientType=0); // IE9 and down, gets no color-stop at all for proper fallback } @mixin gradient-radial($inner-color: #555, $outer-color: #333) { background-image: -webkit-radial-gradient(circle, $inner-color, $outer-color); background-image: radial-gradient(circle, $inner-color, $outer-color); background-repeat: no-repeat; } @mixin gradient-striped($color: rgba(255,255,255,.15), $angle: 45deg) { background-image: -webkit-linear-gradient($angle, $color 25%, transparent 25%, transparent 50%, $color 50%, $color 75%, transparent 75%, transparent); background-image: -o-linear-gradient($angle, $color 25%, transparent 25%, transparent 50%, $color 50%, $color 75%, transparent 75%, transparent); background-image: linear-gradient($angle, $color 25%, transparent 25%, transparent 50%, $color 50%, $color 75%, transparent 75%, transparent); }
{ "pile_set_name": "Github" }
# =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_with_curses.html # =========================================================================== # # SYNOPSIS # # AX_WITH_CURSES # # DESCRIPTION # # This macro checks whether a SysV or X/Open-compatible Curses library is # present, along with the associated header file. The NcursesW # (wide-character) library is searched for first, followed by Ncurses, # then the system-default plain Curses. The first library found is the # one returned. # # The following options are understood: --with-ncursesw, --with-ncurses, # --without-ncursesw, --without-ncurses. The "--with" options force the # macro to use that particular library, terminating with an error if not # found. The "--without" options simply skip the check for that library. # The effect on the search pattern is: # # (no options) - NcursesW, Ncurses, Curses # --with-ncurses --with-ncursesw - NcursesW only [*] # --without-ncurses --with-ncursesw - NcursesW only [*] # --with-ncursesw - NcursesW only [*] # --with-ncurses --without-ncursesw - Ncurses only [*] # --with-ncurses - NcursesW, Ncurses [**] # --without-ncurses --without-ncursesw - Curses only # --without-ncursesw - Ncurses, Curses # --without-ncurses - NcursesW, Curses # # [*] If the library is not found, abort the configure script. # # [**] If the second library (Ncurses) is not found, abort configure. # # The following preprocessor symbols may be defined by this macro if the # appropriate conditions are met: # # HAVE_CURSES - if any SysV or X/Open Curses library found # HAVE_CURSES_ENHANCED - if library supports X/Open Enhanced functions # HAVE_CURSES_COLOR - if library supports color (enhanced functions) # HAVE_CURSES_OBSOLETE - if library supports certain obsolete features # HAVE_NCURSESW - if NcursesW (wide char) library is to be used # HAVE_NCURSES - if the Ncurses library is to be used # # HAVE_CURSES_H - if <curses.h> is present and should be used # HAVE_NCURSESW_H - if <ncursesw.h> should be used # HAVE_NCURSES_H - if <ncurses.h> should be used # HAVE_NCURSESW_CURSES_H - if <ncursesw/curses.h> should be used # HAVE_NCURSES_CURSES_H - if <ncurses/curses.h> should be used # # (These preprocessor symbols are discussed later in this document.) # # The following output variable is defined by this macro; it is precious # and may be overridden on the ./configure command line: # # CURSES_LIB - library to add to xxx_LDADD # # The library listed in CURSES_LIB is NOT added to LIBS by default. You # need to add CURSES_LIB to the appropriate xxx_LDADD line in your # Makefile.am. For example: # # prog_LDADD = @CURSES_LIB@ # # If CURSES_LIB is set on the configure command line (such as by running # "./configure CURSES_LIB=-lmycurses"), then the only header searched for # is <curses.h>. The user may use the CPPFLAGS precious variable to # override the standard #include search path. If the user needs to # specify an alternative path for a library (such as for a non-standard # NcurseW), the user should use the LDFLAGS variable. # # The following shell variables may be defined by this macro: # # ax_cv_curses - set to "yes" if any Curses library found # ax_cv_curses_enhanced - set to "yes" if Enhanced functions present # ax_cv_curses_color - set to "yes" if color functions present # ax_cv_curses_obsolete - set to "yes" if obsolete features present # # ax_cv_ncursesw - set to "yes" if NcursesW library found # ax_cv_ncurses - set to "yes" if Ncurses library found # ax_cv_plaincurses - set to "yes" if plain Curses library found # ax_cv_curses_which - set to "ncursesw", "ncurses", "plaincurses" or "no" # # These variables can be used in your configure.ac to determine the level # of support you need from the Curses library. For example, if you must # have either Ncurses or NcursesW, you could include: # # AX_WITH_CURSES # if test "x$ax_cv_ncursesw" != xyes && test "x$ax_cv_ncurses" != xyes; then # AX_MSG_ERROR([requires either NcursesW or Ncurses library]) # fi # # If any Curses library will do (but one must be present and must support # color), you could use: # # AX_WITH_CURSES # if test "x$ax_cv_curses" != xyes || test "x$ax_cv_curses_color" != xyes; then # AC_MSG_ERROR([requires an X/Open-compatible Curses library with color]) # fi # # Certain preprocessor symbols and shell variables defined by this macro # can be used to determine various features of the Curses library. In # particular, HAVE_CURSES and ax_cv_curses are defined if the Curses # library found conforms to the traditional SysV and/or X/Open Base Curses # definition. Any working Curses library conforms to this level. # # HAVE_CURSES_ENHANCED and ax_cv_curses_enhanced are defined if the # library supports the X/Open Enhanced Curses definition. In particular, # the wide-character types attr_t, cchar_t and wint_t, the functions # wattr_set() and wget_wch() and the macros WA_NORMAL and _XOPEN_CURSES # are checked. The Ncurses library does NOT conform to this definition, # although NcursesW does. # # HAVE_CURSES_COLOR and ax_cv_curses_color are defined if the library # supports color functions and macros such as COLOR_PAIR, A_COLOR, # COLOR_WHITE, COLOR_RED and init_pair(). These are NOT part of the # X/Open Base Curses definition, but are part of the Enhanced set of # functions. The Ncurses library DOES support these functions, as does # NcursesW. # # HAVE_CURSES_OBSOLETE and ax_cv_curses_obsolete are defined if the # library supports certain features present in SysV and BSD Curses but not # defined in the X/Open definition. In particular, the functions # getattrs(), getcurx() and getmaxx() are checked. # # To use the HAVE_xxx_H preprocessor symbols, insert the following into # your system.h (or equivalent) header file: # # #if defined HAVE_NCURSESW_CURSES_H # # include <ncursesw/curses.h> # #elif defined HAVE_NCURSESW_H # # include <ncursesw.h> # #elif defined HAVE_NCURSES_CURSES_H # # include <ncurses/curses.h> # #elif defined HAVE_NCURSES_H # # include <ncurses.h> # #elif defined HAVE_CURSES_H # # include <curses.h> # #else # # error "SysV or X/Open-compatible Curses header file required" # #endif # # For previous users of this macro: you should not need to change anything # in your configure.ac or Makefile.am, as the previous (serial 10) # semantics are still valid. However, you should update your system.h (or # equivalent) header file to the fragment shown above. You are encouraged # also to make use of the extended functionality provided by this version # of AX_WITH_CURSES, as well as in the additional macros # AX_WITH_CURSES_PANEL, AX_WITH_CURSES_MENU and AX_WITH_CURSES_FORM. # # LICENSE # # Copyright (c) 2009 Mark Pulford <mark@kyne.com.au> # Copyright (c) 2009 Damian Pietras <daper@daper.net> # Copyright (c) 2012 Reuben Thomas <rrt@sc3d.org> # Copyright (c) 2011 John Zaitseff <J.Zaitseff@zap.org.au> # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation, either version 3 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program. If not, see <http://www.gnu.org/licenses/>. # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 13 AC_DEFUN([AX_WITH_CURSES], [ AC_ARG_VAR([CURSES_LIB], [linker library for Curses, e.g. -lcurses]) AC_ARG_WITH([ncurses], [AS_HELP_STRING([--with-ncurses], [force the use of Ncurses or NcursesW])], [], [with_ncurses=check]) AC_ARG_WITH([ncursesw], [AS_HELP_STRING([--without-ncursesw], [do not use NcursesW (wide character support)])], [], [with_ncursesw=check]) ax_saved_LIBS=$LIBS AS_IF([test "x$with_ncurses" = xyes || test "x$with_ncursesw" = xyes], [ax_with_plaincurses=no], [ax_with_plaincurses=check]) ax_cv_curses_which=no # Test for NcursesW AS_IF([test "x$CURSES_LIB" = x && test "x$with_ncursesw" != xno], [ LIBS="$ax_saved_LIBS -lncursesw" AC_CACHE_CHECK([for NcursesW wide-character library], [ax_cv_ncursesw], [ AC_LINK_IFELSE([AC_LANG_CALL([], [initscr])], [ax_cv_ncursesw=yes], [ax_cv_ncursesw=no]) ]) AS_IF([test "x$ax_cv_ncursesw" = xno && test "x$with_ncursesw" = xyes], [ AC_MSG_ERROR([--with-ncursesw specified but could not find NcursesW library]) ]) AS_IF([test "x$ax_cv_ncursesw" = xyes], [ ax_cv_curses=yes ax_cv_curses_which=ncursesw CURSES_LIB="-lncursesw" AC_DEFINE([HAVE_NCURSESW], [1], [Define to 1 if the NcursesW library is present]) AC_DEFINE([HAVE_CURSES], [1], [Define to 1 if a SysV or X/Open compatible Curses library is present]) AC_CACHE_CHECK([for working ncursesw/curses.h], [ax_cv_header_ncursesw_curses_h], [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ @%:@define _XOPEN_SOURCE_EXTENDED 1 @%:@include <ncursesw/curses.h> ]], [[ chtype a = A_BOLD; int b = KEY_LEFT; chtype c = COLOR_PAIR(1) & A_COLOR; attr_t d = WA_NORMAL; cchar_t e; wint_t f; int g = getattrs(stdscr); int h = getcurx(stdscr) + getmaxx(stdscr); initscr(); init_pair(1, COLOR_WHITE, COLOR_RED); wattr_set(stdscr, d, 0, NULL); wget_wch(stdscr, &f); ]])], [ax_cv_header_ncursesw_curses_h=yes], [ax_cv_header_ncursesw_curses_h=no]) ]) AS_IF([test "x$ax_cv_header_ncursesw_curses_h" = xyes], [ ax_cv_curses_enhanced=yes ax_cv_curses_color=yes ax_cv_curses_obsolete=yes AC_DEFINE([HAVE_CURSES_ENHANCED], [1], [Define to 1 if library supports X/Open Enhanced functions]) AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)]) AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features]) AC_DEFINE([HAVE_NCURSESW_CURSES_H], [1], [Define to 1 if <ncursesw/curses.h> is present]) ]) AC_CACHE_CHECK([for working ncursesw.h], [ax_cv_header_ncursesw_h], [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ @%:@define _XOPEN_SOURCE_EXTENDED 1 @%:@include <ncursesw.h> ]], [[ chtype a = A_BOLD; int b = KEY_LEFT; chtype c = COLOR_PAIR(1) & A_COLOR; attr_t d = WA_NORMAL; cchar_t e; wint_t f; int g = getattrs(stdscr); int h = getcurx(stdscr) + getmaxx(stdscr); initscr(); init_pair(1, COLOR_WHITE, COLOR_RED); wattr_set(stdscr, d, 0, NULL); wget_wch(stdscr, &f); ]])], [ax_cv_header_ncursesw_h=yes], [ax_cv_header_ncursesw_h=no]) ]) AS_IF([test "x$ax_cv_header_ncursesw_h" = xyes], [ ax_cv_curses_enhanced=yes ax_cv_curses_color=yes ax_cv_curses_obsolete=yes AC_DEFINE([HAVE_CURSES_ENHANCED], [1], [Define to 1 if library supports X/Open Enhanced functions]) AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)]) AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features]) AC_DEFINE([HAVE_NCURSESW_H], [1], [Define to 1 if <ncursesw.h> is present]) ]) AC_CACHE_CHECK([for working ncurses.h], [ax_cv_header_ncurses_h_with_ncursesw], [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ @%:@define _XOPEN_SOURCE_EXTENDED 1 @%:@include <ncurses.h> ]], [[ chtype a = A_BOLD; int b = KEY_LEFT; chtype c = COLOR_PAIR(1) & A_COLOR; attr_t d = WA_NORMAL; cchar_t e; wint_t f; int g = getattrs(stdscr); int h = getcurx(stdscr) + getmaxx(stdscr); initscr(); init_pair(1, COLOR_WHITE, COLOR_RED); wattr_set(stdscr, d, 0, NULL); wget_wch(stdscr, &f); ]])], [ax_cv_header_ncurses_h_with_ncursesw=yes], [ax_cv_header_ncurses_h_with_ncursesw=no]) ]) AS_IF([test "x$ax_cv_header_ncurses_h_with_ncursesw" = xyes], [ ax_cv_curses_enhanced=yes ax_cv_curses_color=yes ax_cv_curses_obsolete=yes AC_DEFINE([HAVE_CURSES_ENHANCED], [1], [Define to 1 if library supports X/Open Enhanced functions]) AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)]) AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features]) AC_DEFINE([HAVE_NCURSES_H], [1], [Define to 1 if <ncurses.h> is present]) ]) AS_IF([test "x$ax_cv_header_ncursesw_curses_h" = xno && test "x$ax_cv_header_ncursesw_h" = xno && test "x$ax_cv_header_ncurses_h_with_ncursesw" = xno], [ AC_MSG_WARN([could not find a working ncursesw/curses.h, ncursesw.h or ncurses.h]) ]) ]) ]) # Test for Ncurses AS_IF([test "x$CURSES_LIB" = x && test "x$with_ncurses" != xno && test "x$ax_cv_curses_which" = xno], [ LIBS="$ax_saved_LIBS -lncurses" AC_CACHE_CHECK([for Ncurses library], [ax_cv_ncurses], [ AC_LINK_IFELSE([AC_LANG_CALL([], [initscr])], [ax_cv_ncurses=yes], [ax_cv_ncurses=no]) ]) AS_IF([test "x$ax_cv_ncurses" = xno && test "x$with_ncurses" = xyes], [ AC_MSG_ERROR([--with-ncurses specified but could not find Ncurses library]) ]) AS_IF([test "x$ax_cv_ncurses" = xyes], [ ax_cv_curses=yes ax_cv_curses_which=ncurses CURSES_LIB="-lncurses" AC_DEFINE([HAVE_NCURSES], [1], [Define to 1 if the Ncurses library is present]) AC_DEFINE([HAVE_CURSES], [1], [Define to 1 if a SysV or X/Open compatible Curses library is present]) AC_CACHE_CHECK([for working ncurses/curses.h], [ax_cv_header_ncurses_curses_h], [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ @%:@include <ncurses/curses.h> ]], [[ chtype a = A_BOLD; int b = KEY_LEFT; chtype c = COLOR_PAIR(1) & A_COLOR; int g = getattrs(stdscr); int h = getcurx(stdscr) + getmaxx(stdscr); initscr(); init_pair(1, COLOR_WHITE, COLOR_RED); ]])], [ax_cv_header_ncurses_curses_h=yes], [ax_cv_header_ncurses_curses_h=no]) ]) AS_IF([test "x$ax_cv_header_ncurses_curses_h" = xyes], [ ax_cv_curses_color=yes ax_cv_curses_obsolete=yes AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)]) AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features]) AC_DEFINE([HAVE_NCURSES_CURSES_H], [1], [Define to 1 if <ncurses/curses.h> is present]) ]) AC_CACHE_CHECK([for working ncurses.h], [ax_cv_header_ncurses_h], [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ @%:@include <ncurses.h> ]], [[ chtype a = A_BOLD; int b = KEY_LEFT; chtype c = COLOR_PAIR(1) & A_COLOR; int g = getattrs(stdscr); int h = getcurx(stdscr) + getmaxx(stdscr); initscr(); init_pair(1, COLOR_WHITE, COLOR_RED); ]])], [ax_cv_header_ncurses_h=yes], [ax_cv_header_ncurses_h=no]) ]) AS_IF([test "x$ax_cv_header_ncurses_h" = xyes], [ ax_cv_curses_color=yes ax_cv_curses_obsolete=yes AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)]) AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features]) AC_DEFINE([HAVE_NCURSES_H], [1], [Define to 1 if <ncurses.h> is present]) ]) AS_IF([test "x$ax_cv_header_ncurses_curses_h" = xno && test "x$ax_cv_header_ncurses_h" = xno], [ AC_MSG_WARN([could not find a working ncurses/curses.h or ncurses.h]) ]) ]) ]) # Test for plain Curses (or if CURSES_LIB was set by user) AS_IF([test "x$with_plaincurses" != xno && test "x$ax_cv_curses_which" = xno], [ AS_IF([test "x$CURSES_LIB" != x], [ LIBS="$ax_saved_LIBS $CURSES_LIB" ], [ LIBS="$ax_saved_LIBS -lcurses" ]) AC_CACHE_CHECK([for Curses library], [ax_cv_plaincurses], [ AC_LINK_IFELSE([AC_LANG_CALL([], [initscr])], [ax_cv_plaincurses=yes], [ax_cv_plaincurses=no]) ]) AS_IF([test "x$ax_cv_plaincurses" = xyes], [ ax_cv_curses=yes ax_cv_curses_which=plaincurses AS_IF([test "x$CURSES_LIB" = x], [ CURSES_LIB="-lcurses" ]) AC_DEFINE([HAVE_CURSES], [1], [Define to 1 if a SysV or X/Open compatible Curses library is present]) # Check for base conformance (and header file) AC_CACHE_CHECK([for working curses.h], [ax_cv_header_curses_h], [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ @%:@include <curses.h> ]], [[ chtype a = A_BOLD; int b = KEY_LEFT; initscr(); ]])], [ax_cv_header_curses_h=yes], [ax_cv_header_curses_h=no]) ]) AS_IF([test "x$ax_cv_header_curses_h" = xyes], [ AC_DEFINE([HAVE_CURSES_H], [1], [Define to 1 if <curses.h> is present]) # Check for X/Open Enhanced conformance AC_CACHE_CHECK([for X/Open Enhanced Curses conformance], [ax_cv_plaincurses_enhanced], [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ @%:@define _XOPEN_SOURCE_EXTENDED 1 @%:@include <curses.h> @%:@ifndef _XOPEN_CURSES @%:@error "this Curses library is not enhanced" "this Curses library is not enhanced" @%:@endif ]], [[ chtype a = A_BOLD; int b = KEY_LEFT; chtype c = COLOR_PAIR(1) & A_COLOR; attr_t d = WA_NORMAL; cchar_t e; wint_t f; initscr(); init_pair(1, COLOR_WHITE, COLOR_RED); wattr_set(stdscr, d, 0, NULL); wget_wch(stdscr, &f); ]])], [ax_cv_plaincurses_enhanced=yes], [ax_cv_plaincurses_enhanced=no]) ]) AS_IF([test "x$ax_cv_plaincurses_enhanced" = xyes], [ ax_cv_curses_enhanced=yes ax_cv_curses_color=yes AC_DEFINE([HAVE_CURSES_ENHANCED], [1], [Define to 1 if library supports X/Open Enhanced functions]) AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)]) ]) # Check for color functions AC_CACHE_CHECK([for Curses color functions], [ax_cv_plaincurses_color], [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ @%:@define _XOPEN_SOURCE_EXTENDED 1 @%:@include <curses.h> ]], [[ chtype a = A_BOLD; int b = KEY_LEFT; chtype c = COLOR_PAIR(1) & A_COLOR; initscr(); init_pair(1, COLOR_WHITE, COLOR_RED); ]])], [ax_cv_plaincurses_color=yes], [ax_cv_plaincurses_color=no]) ]) AS_IF([test "x$ax_cv_plaincurses_color" = xyes], [ ax_cv_curses_color=yes AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)]) ]) # Check for obsolete functions AC_CACHE_CHECK([for obsolete Curses functions], [ax_cv_plaincurses_obsolete], [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ @%:@include <curses.h> ]], [[ chtype a = A_BOLD; int b = KEY_LEFT; int g = getattrs(stdscr); int h = getcurx(stdscr) + getmaxx(stdscr); initscr(); ]])], [ax_cv_plaincurses_obsolete=yes], [ax_cv_plaincurses_obsolete=no]) ]) AS_IF([test "x$ax_cv_plaincurses_obsolete" = xyes], [ ax_cv_curses_obsolete=yes AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features]) ]) ]) AS_IF([test "x$ax_cv_header_curses_h" = xno], [ AC_MSG_WARN([could not find a working curses.h]) ]) ]) ]) AS_IF([test "x$ax_cv_curses" != xyes], [ax_cv_curses=no]) AS_IF([test "x$ax_cv_curses_enhanced" != xyes], [ax_cv_curses_enhanced=no]) AS_IF([test "x$ax_cv_curses_color" != xyes], [ax_cv_curses_color=no]) AS_IF([test "x$ax_cv_curses_obsolete" != xyes], [ax_cv_curses_obsolete=no]) LIBS=$ax_saved_LIBS ])dnl
{ "pile_set_name": "Github" }
var path = require('path'); var fs = require('fs'); // Make sure any symlinks in the project folder are resolved: // https://github.com/facebookincubator/create-react-app/issues/637 var appDirectory = fs.realpathSync(process.cwd()); function resolveApp(relativePath) { return path.resolve(appDirectory, relativePath); } // We support resolving modules according to `NODE_PATH`. // This lets you use absolute paths in imports inside large monorepos: // https://github.com/facebookincubator/create-react-app/issues/253. // It works similar to `NODE_PATH` in Node itself: // https://nodejs.org/api/modules.html#modules_loading_from_the_global_folders // We will export `nodePaths` as an array of absolute paths. // It will then be used by Webpack configs. // Jest doesn’t need this because it already handles `NODE_PATH` out of the box. // Note that unlike in Node, only *relative* paths from `NODE_PATH` are honored. // Otherwise, we risk importing Node.js core modules into an app instead of Webpack shims. // https://github.com/facebookincubator/create-react-app/issues/1023#issuecomment-265344421 var nodePaths = (process.env.NODE_PATH || '') .split(process.platform === 'win32' ? ';' : ':') .filter(Boolean) .filter(folder => !path.isAbsolute(folder)) .map(resolveApp); // config after eject: we're in ./config/ module.exports = { // Changed from build to build_webpack so smart contract compilations are not overwritten. appBuild: resolveApp('build_webpack'), appPublic: resolveApp('public'), appHtml: resolveApp('public/index.html'), appIndexJs: resolveApp('src/index.js'), appPackageJson: resolveApp('package.json'), appSrc: resolveApp('src'), yarnLockFile: resolveApp('yarn.lock'), testsSetup: resolveApp('src/setupTests.js'), appNodeModules: resolveApp('node_modules'), ownNodeModules: resolveApp('node_modules'), nodePaths: nodePaths };
{ "pile_set_name": "Github" }
#ifndef GIM_ARRAY_H_INCLUDED #define GIM_ARRAY_H_INCLUDED /*! \file gim_array.h \author Francisco Leon Najera */ /* ----------------------------------------------------------------------------- This source file is part of GIMPACT Library. For the latest info, see http://gimpact.sourceforge.net/ Copyright (c) 2006 Francisco Leon Najera. C.C. 80087371. email: projectileman@yahoo.com This library is free software; you can redistribute it and/or modify it under the terms of EITHER: (1) The GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The text of the GNU Lesser General Public License is included with this library in the file GIMPACT-LICENSE-LGPL.TXT. (2) The BSD-style license that is included with this library in the file GIMPACT-LICENSE-BSD.TXT. (3) The zlib/libpng license that is included with this library in the file GIMPACT-LICENSE-ZLIB.TXT. This library 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 files GIMPACT-LICENSE-LGPL.TXT, GIMPACT-LICENSE-ZLIB.TXT and GIMPACT-LICENSE-BSD.TXT for more details. ----------------------------------------------------------------------------- */ #include "gim_memory.h" #define GIM_ARRAY_GROW_INCREMENT 2 #define GIM_ARRAY_GROW_FACTOR 2 //! Very simple array container with fast access and simd memory template<typename T> class gim_array { public: //! properties //!@{ T *m_data; GUINT m_size; GUINT m_allocated_size; //!@} //! protected operations //!@{ inline void destroyData() { m_allocated_size = 0; if(m_data==NULL) return; gim_free(m_data); m_data = NULL; } inline bool resizeData(GUINT newsize) { if(newsize==0) { destroyData(); return true; } if(m_size>0) { m_data = (T*)gim_realloc(m_data,m_size*sizeof(T),newsize*sizeof(T)); } else { m_data = (T*)gim_alloc(newsize*sizeof(T)); } m_allocated_size = newsize; return true; } inline bool growingCheck() { if(m_allocated_size<=m_size) { GUINT requestsize = m_size; m_size = m_allocated_size; if(resizeData((requestsize+GIM_ARRAY_GROW_INCREMENT)*GIM_ARRAY_GROW_FACTOR)==false) return false; } return true; } //!@} //! public operations //!@{ inline bool reserve(GUINT size) { if(m_allocated_size>=size) return false; return resizeData(size); } inline void clear_range(GUINT start_range) { while(m_size>start_range) { m_data[--m_size].~T(); } } inline void clear() { if(m_size==0)return; clear_range(0); } inline void clear_memory() { clear(); destroyData(); } gim_array() { m_data = 0; m_size = 0; m_allocated_size = 0; } gim_array(GUINT reservesize) { m_data = 0; m_size = 0; m_allocated_size = 0; reserve(reservesize); } ~gim_array() { clear_memory(); } inline GUINT size() const { return m_size; } inline GUINT max_size() const { return m_allocated_size; } inline T & operator[](size_t i) { return m_data[i]; } inline const T & operator[](size_t i) const { return m_data[i]; } inline T * pointer(){ return m_data;} inline const T * pointer() const { return m_data;} inline T * get_pointer_at(GUINT i) { return m_data + i; } inline const T * get_pointer_at(GUINT i) const { return m_data + i; } inline T & at(GUINT i) { return m_data[i]; } inline const T & at(GUINT i) const { return m_data[i]; } inline T & front() { return *m_data; } inline const T & front() const { return *m_data; } inline T & back() { return m_data[m_size-1]; } inline const T & back() const { return m_data[m_size-1]; } inline void swap(GUINT i, GUINT j) { gim_swap_elements(m_data,i,j); } inline void push_back(const T & obj) { this->growingCheck(); m_data[m_size] = obj; m_size++; } //!Simply increase the m_size, doesn't call the new element constructor inline void push_back_mem() { this->growingCheck(); m_size++; } inline void push_back_memcpy(const T & obj) { this->growingCheck(); irr_simd_memcpy(&m_data[m_size],&obj,sizeof(T)); m_size++; } inline void pop_back() { m_size--; m_data[m_size].~T(); } //!Simply decrease the m_size, doesn't call the deleted element destructor inline void pop_back_mem() { m_size--; } //! fast erase inline void erase(GUINT index) { if(index<m_size-1) { swap(index,m_size-1); } pop_back(); } inline void erase_sorted_mem(GUINT index) { m_size--; for(GUINT i = index;i<m_size;i++) { gim_simd_memcpy(m_data+i,m_data+i+1,sizeof(T)); } } inline void erase_sorted(GUINT index) { m_data[index].~T(); erase_sorted_mem(index); } inline void insert_mem(GUINT index) { this->growingCheck(); for(GUINT i = m_size;i>index;i--) { gim_simd_memcpy(m_data+i,m_data+i-1,sizeof(T)); } m_size++; } inline void insert(const T & obj,GUINT index) { insert_mem(index); m_data[index] = obj; } inline void resize(GUINT size, bool call_constructor = true, const T& fillData=T()) { if(size>m_size) { reserve(size); if(call_constructor) { while(m_size<size) { m_data[m_size] = fillData; m_size++; } } else { m_size = size; } } else if(size<m_size) { if(call_constructor) clear_range(size); m_size = size; } } inline void refit() { resizeData(m_size); } }; #endif // GIM_CONTAINERS_H_INCLUDED
{ "pile_set_name": "Github" }
/** ****************************************************************************** * @file Project/STM32F4xx_StdPeriph_Templates/stm32f4xx_it.c * @author MCD Application Team * @version V1.3.0 * @date 13-November-2013 * @brief Main Interrupt Service Routines. * This file provides template for all exceptions handler and * peripherals interrupt service routine. ****************************************************************************** * @attention * * <h2><center>&copy; COPYRIGHT 2013 STMicroelectronics</center></h2> * * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); * You may not use this file except in compliance with the License. * You may obtain a copy of the License at: * * http://www.st.com/software_license_agreement_liberty_v2 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ****************************************************************************** */ /* Includes ------------------------------------------------------------------*/ #include "stm32f4xx_it.h" #include "main.h" /** @addtogroup Template_Project * @{ */ /* Private typedef -----------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/ /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/ /* Private functions ---------------------------------------------------------*/ /******************************************************************************/ /* Cortex-M4 Processor Exceptions Handlers */ /******************************************************************************/ /** * @brief This function handles NMI exception. * @param None * @retval None */ void NMI_Handler(void) { } /** * @brief This function handles Hard Fault exception. * @param None * @retval None */ void HardFault_Handler(void) { /* Go to infinite loop when Hard Fault exception occurs */ while (1) { } } /** * @brief This function handles Memory Manage exception. * @param None * @retval None */ void MemManage_Handler(void) { /* Go to infinite loop when Memory Manage exception occurs */ while (1) { } } /** * @brief This function handles Bus Fault exception. * @param None * @retval None */ void BusFault_Handler(void) { /* Go to infinite loop when Bus Fault exception occurs */ while (1) { } } /** * @brief This function handles Usage Fault exception. * @param None * @retval None */ void UsageFault_Handler(void) { /* Go to infinite loop when Usage Fault exception occurs */ while (1) { } } /** * @brief This function handles SVCall exception. * @param None * @retval None */ void SVC_Handler(void) { } /** * @brief This function handles Debug Monitor exception. * @param None * @retval None */ void DebugMon_Handler(void) { } /** * @brief This function handles PendSVC exception. * @param None * @retval None */ void PendSV_Handler(void) { } /** * @brief This function decrement timing variable * @with __weak parameter to prevent errors * @param None * @retval None */ __weak void TimingDelay_Decrement(void) { } /** * @brief This function handles SysTick Handler. * @param None * @retval None */ void SysTick_Handler(void) { TimingDelay_Decrement(); } /******************************************************************************/ /* STM32F4xx Peripherals Interrupt Handlers */ /* Add here the Interrupt Handler for the used peripheral(s) (PPP), for the */ /* available peripheral interrupt handler's name please refer to the startup */ /* file (startup_stm32f4xx.s). */ /******************************************************************************/ /** * @brief This function handles PPP interrupt request. * @param None * @retval None */ /*void PPP_IRQHandler(void) { }*/ /** * @} */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
{ "pile_set_name": "Github" }
/*************************************************************************** Copyright 2015 Ufora Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ****************************************************************************/ #ifndef JudgmentParser_hppml_ #define JudgmentParser_hppml_ #include "../../core/SimpleParse/SimpleParse.hppml" #include <string> class JudgmentOnResult; class JudgmentOnValue; class JudgmentOnValueTuple; class JudgmentOnType; class JudgmentOnTypeTuple; class Symbol; @type JudgmentParseError = std::string error, SimpleParseRange range { public: JudgmentParseError( std::string inError, const SimpleParseNode& node) { error() = inError + ": " + node.toString(); range() = node.extent(); } JudgmentParseError( std::string inError, const ImmutableTreeVector<SimpleParseNode>& nodes) { lassert(nodes.size()); error() = inError; range() = SimpleParseRange(nodes[0].extent().start(), nodes.back().extent().stop()); } JudgmentParseError( std::string inError, const SimpleParseNode& nodeStart, const SimpleParseNode& nodeEnd ) { error() = inError; range() = SimpleParseRange( nodeStart.extent().start(), nodeEnd.extent().stop()); } JudgmentParseError( std::string inError, const SimpleParsePosition& extent ) { error() = inError; range() = SimpleParseRange(extent,extent); } }; class JudgmentParser { public: //parse a SimpleParseNode to a given type or throw a JudgmentParseError static JudgmentOnValue parseJOV(const SimpleParseNode& inNode); static JudgmentOnValue parseJOVFromConcat( const ImmutableTreeVector<SimpleParseNode>& inNode ); static JudgmentOnResult parseJOR(const SimpleParseNode& node); static JudgmentOnValueTuple parseJOVT(const SimpleParseNode& inNode); //parse a term in a JOVT. may be named. if it has ..., then it's the //"extras" field static pair<JudgmentOnValue, Nullable<Symbol> > parseJOVTTerm( const SimpleParseNode& inNode, bool& outIsExtras ); }; #endif
{ "pile_set_name": "Github" }
# CS_ARCH_ARM, CS_MODE_ARM, None 0x0f,0x10,0xa2,0xe2 = adc r1, r2, #15 0xf0,0x10,0xa2,0xe2 = adc r1, r2, #240 0x0f,0x1c,0xa2,0xe2 = adc r1, r2, #3840 0x0f,0x1a,0xa2,0xe2 = adc r1, r2, #61440 0x0f,0x18,0xa2,0xe2 = adc r1, r2, #983040 0x0f,0x16,0xa2,0xe2 = adc r1, r2, #15728640 0x0f,0x14,0xa2,0xe2 = adc r1, r2, #251658240 0x0f,0x12,0xa2,0xe2 = adc r1, r2, #4026531840 0xff,0x12,0xa2,0xe2 = adc r1, r2, #4026531855 0x0f,0x1c,0xb2,0xe2 = adcs r1, r2, #3840 0x0f,0x1c,0xb2,0x02 = adcseq r1, r2, #3840 0x0f,0x1c,0xa2,0x02 = adceq r1, r2, #3840 0x06,0x40,0xa5,0xe0 = adc r4, r5, r6 0x86,0x40,0xa5,0xe0 = adc r4, r5, r6, lsl #1 0x86,0x4f,0xa5,0xe0 = adc r4, r5, r6, lsl #31 0xa6,0x40,0xa5,0xe0 = adc r4, r5, r6, lsr #1 0xa6,0x4f,0xa5,0xe0 = adc r4, r5, r6, lsr #31 0x26,0x40,0xa5,0xe0 = adc r4, r5, r6, lsr #32 0xc6,0x40,0xa5,0xe0 = adc r4, r5, r6, asr #1 0xc6,0x4f,0xa5,0xe0 = adc r4, r5, r6, asr #31 0x46,0x40,0xa5,0xe0 = adc r4, r5, r6, asr #32 0xe6,0x40,0xa5,0xe0 = adc r4, r5, r6, ror #1 0xe6,0x4f,0xa5,0xe0 = adc r4, r5, r6, ror #31 0x18,0x69,0xa7,0xe0 = adc r6, r7, r8, lsl r9 0x38,0x69,0xa7,0xe0 = adc r6, r7, r8, lsr r9 0x58,0x69,0xa7,0xe0 = adc r6, r7, r8, asr r9 0x78,0x69,0xa7,0xe0 = adc r6, r7, r8, ror r9 0x66,0x40,0xa5,0xe0 = adc r4, r5, r6, rrx 0x06,0x50,0xa5,0xe0 = adc r5, r5, r6 0x85,0x40,0xa4,0xe0 = adc r4, r4, r5, lsl #1 0x85,0x4f,0xa4,0xe0 = adc r4, r4, r5, lsl #31 0xa5,0x40,0xa4,0xe0 = adc r4, r4, r5, lsr #1 0xa5,0x4f,0xa4,0xe0 = adc r4, r4, r5, lsr #31 0x25,0x40,0xa4,0xe0 = adc r4, r4, r5, lsr #32 0xc5,0x40,0xa4,0xe0 = adc r4, r4, r5, asr #1 0xc5,0x4f,0xa4,0xe0 = adc r4, r4, r5, asr #31 0x45,0x40,0xa4,0xe0 = adc r4, r4, r5, asr #32 0xe5,0x40,0xa4,0xe0 = adc r4, r4, r5, ror #1 0xe5,0x4f,0xa4,0xe0 = adc r4, r4, r5, ror #31 0x65,0x40,0xa4,0xe0 = adc r4, r4, r5, rrx 0x17,0x69,0xa6,0xe0 = adc r6, r6, r7, lsl r9 0x37,0x69,0xa6,0xe0 = adc r6, r6, r7, lsr r9 0x57,0x69,0xa6,0xe0 = adc r6, r6, r7, asr r9 0x77,0x69,0xa6,0xe0 = adc r6, r6, r7, ror r9 0x65,0x40,0xa4,0xe0 = adc r4, r4, r5, rrx 0x0f,0x4a,0x85,0xe2 = add r4, r5, #61440 0x06,0x40,0x85,0xe0 = add r4, r5, r6 0x86,0x42,0x85,0xe0 = add r4, r5, r6, lsl #5 0xa6,0x42,0x85,0xe0 = add r4, r5, r6, lsr #5 0xa6,0x42,0x85,0xe0 = add r4, r5, r6, lsr #5 0xc6,0x42,0x85,0xe0 = add r4, r5, r6, asr #5 0xe6,0x42,0x85,0xe0 = add r4, r5, r6, ror #5 0x18,0x69,0x87,0xe0 = add r6, r7, r8, lsl r9 0x13,0x49,0x84,0xe0 = add r4, r4, r3, lsl r9 0x38,0x69,0x87,0xe0 = add r6, r7, r8, lsr r9 0x58,0x69,0x87,0xe0 = add r6, r7, r8, asr r9 0x78,0x69,0x87,0xe0 = add r6, r7, r8, ror r9 0x66,0x40,0x85,0xe0 = add r4, r5, r6, rrx 0x0f,0x5a,0x85,0xe2 = add r5, r5, #61440 0x05,0x40,0x84,0xe0 = add r4, r4, r5 0x85,0x42,0x84,0xe0 = add r4, r4, r5, lsl #5 0xa5,0x42,0x84,0xe0 = add r4, r4, r5, lsr #5 0xa5,0x42,0x84,0xe0 = add r4, r4, r5, lsr #5 0xc5,0x42,0x84,0xe0 = add r4, r4, r5, asr #5 0xe5,0x42,0x84,0xe0 = add r4, r4, r5, ror #5 0x17,0x69,0x86,0xe0 = add r6, r6, r7, lsl r9 0x37,0x69,0x86,0xe0 = add r6, r6, r7, lsr r9 0x57,0x69,0x86,0xe0 = add r6, r6, r7, asr r9 0x77,0x69,0x86,0xe0 = add r6, r6, r7, ror r9 0x65,0x40,0x84,0xe0 = add r4, r4, r5, rrx 0x04,0x00,0x40,0xe2 = sub r0, r0, #4 0x15,0x40,0x45,0xe2 = sub r4, r5, #21 0x22,0x30,0x81,0xe0 = add r3, r1, r2, lsr #32 0x42,0x30,0x81,0xe0 = add r3, r1, r2, asr #32 0x0f,0xa0,0x01,0xe2 = and r10, r1, #15 0x06,0xa0,0x01,0xe0 = and r10, r1, r6 0x06,0xa5,0x01,0xe0 = and r10, r1, r6, lsl #10 0x26,0xa5,0x01,0xe0 = and r10, r1, r6, lsr #10 0x26,0xa5,0x01,0xe0 = and r10, r1, r6, lsr #10 0x46,0xa5,0x01,0xe0 = and r10, r1, r6, asr #10 0x66,0xa5,0x01,0xe0 = and r10, r1, r6, ror #10 0x18,0x62,0x07,0xe0 = and r6, r7, r8, lsl r2 0x38,0x62,0x07,0xe0 = and r6, r7, r8, lsr r2 0x58,0x62,0x07,0xe0 = and r6, r7, r8, asr r2 0x78,0x62,0x07,0xe0 = and r6, r7, r8, ror r2 0x66,0xa0,0x01,0xe0 = and r10, r1, r6, rrx 0x02,0x21,0xc3,0xe3 = bic r2, r3, #-2147483648 0x0f,0x10,0x01,0xe2 = and r1, r1, #15 0x01,0xa0,0x0a,0xe0 = and r10, r10, r1 0x01,0xa5,0x0a,0xe0 = and r10, r10, r1, lsl #10 0x21,0xa5,0x0a,0xe0 = and r10, r10, r1, lsr #10 0x21,0xa5,0x0a,0xe0 = and r10, r10, r1, lsr #10 0x41,0xa5,0x0a,0xe0 = and r10, r10, r1, asr #10 0x61,0xa5,0x0a,0xe0 = and r10, r10, r1, ror #10 0x17,0x62,0x06,0xe0 = and r6, r6, r7, lsl r2 0x37,0x62,0x06,0xe0 = and r6, r6, r7, lsr r2 0x57,0x62,0x06,0xe0 = and r6, r6, r7, asr r2 0x77,0x62,0x06,0xe0 = and r6, r6, r7, ror r2 0x61,0xa0,0x0a,0xe0 = and r10, r10, r1, rrx 0x22,0x30,0x01,0xe0 = and r3, r1, r2, lsr #32 0x42,0x30,0x01,0xe0 = and r3, r1, r2, asr #32 0x44,0x20,0xa0,0xe1 = asr r2, r4, #32 0x44,0x21,0xa0,0xe1 = asr r2, r4, #2 0x04,0x20,0xa0,0xe1 = mov r2, r4 0x44,0x41,0xa0,0xe1 = asr r4, r4, #2 0x9f,0x51,0xd3,0xe7 = bfc r5, #3, #17 0x9f,0x51,0xd3,0x37 = bfclo r5, #3, #17 0x92,0x51,0xd3,0xe7 = bfi r5, r2, #3, #17 0x92,0x51,0xd3,0x17 = bfine r5, r2, #3, #17 0x0f,0xa0,0xc1,0xe3 = bic r10, r1, #15 0x06,0xa0,0xc1,0xe1 = bic r10, r1, r6 0x06,0xa5,0xc1,0xe1 = bic r10, r1, r6, lsl #10 0x26,0xa5,0xc1,0xe1 = bic r10, r1, r6, lsr #10 0x26,0xa5,0xc1,0xe1 = bic r10, r1, r6, lsr #10 0x46,0xa5,0xc1,0xe1 = bic r10, r1, r6, asr #10 0x66,0xa5,0xc1,0xe1 = bic r10, r1, r6, ror #10 0x18,0x62,0xc7,0xe1 = bic r6, r7, r8, lsl r2 0x38,0x62,0xc7,0xe1 = bic r6, r7, r8, lsr r2 0x58,0x62,0xc7,0xe1 = bic r6, r7, r8, asr r2 0x78,0x62,0xc7,0xe1 = bic r6, r7, r8, ror r2 0x66,0xa0,0xc1,0xe1 = bic r10, r1, r6, rrx 0x0f,0x10,0xc1,0xe3 = bic r1, r1, #15 0x01,0xa0,0xca,0xe1 = bic r10, r10, r1 0x01,0xa5,0xca,0xe1 = bic r10, r10, r1, lsl #10 0x21,0xa5,0xca,0xe1 = bic r10, r10, r1, lsr #10 0x21,0xa5,0xca,0xe1 = bic r10, r10, r1, lsr #10 0x41,0xa5,0xca,0xe1 = bic r10, r10, r1, asr #10 0x61,0xa5,0xca,0xe1 = bic r10, r10, r1, ror #10 0x17,0x62,0xc6,0xe1 = bic r6, r6, r7, lsl r2 0x37,0x62,0xc6,0xe1 = bic r6, r6, r7, lsr r2 0x57,0x62,0xc6,0xe1 = bic r6, r6, r7, asr r2 0x77,0x62,0xc6,0xe1 = bic r6, r6, r7, ror r2 0x61,0xa0,0xca,0xe1 = bic r10, r10, r1, rrx 0x22,0x30,0xc1,0xe1 = bic r3, r1, r2, lsr #32 0x42,0x30,0xc1,0xe1 = bic r3, r1, r2, asr #32 0x7a,0x00,0x20,0xe1 = bkpt #10 0x7f,0xff,0x2f,0xe1 = bkpt #65535 0x27,0x3b,0x6d,0x9b = blls #28634276 0xa0,0xb0,0x7b,0xfa = blx #32424584 0x50,0xd8,0x3d,0xfa = blx #16212296 0x32,0xff,0x2f,0xe1 = blx r2 0x32,0xff,0x2f,0x11 = blxne r2 0x12,0xff,0x2f,0xe1 = bx r2 0x12,0xff,0x2f,0x11 = bxne r2 0x22,0xff,0x2f,0xe1 = bxj r2 0x22,0xff,0x2f,0x11 = bxjne r2 0x81,0x17,0x11,0xee = cdp p7, #1, c1, c1, c1, #4 0x81,0x17,0x11,0xfe = cdp2 p7, #1, c1, c1, c1, #4 0xe0,0x6c,0x0c,0xfe = cdp2 p12, #0, c6, c12, c0, #7 0x81,0x17,0x11,0x1e = cdpne p7, #1, c1, c1, c1, #4 0x1f,0xf0,0x7f,0xf5 = clrex 0x12,0x1f,0x6f,0xe1 = clz r1, r2 0x12,0x1f,0x6f,0x01 = clzeq r1, r2 0x0f,0x00,0x71,0xe3 = cmn r1, #15 0x06,0x00,0x71,0xe1 = cmn r1, r6 0x06,0x05,0x71,0xe1 = cmn r1, r6, lsl #10 0x26,0x05,0x71,0xe1 = cmn r1, r6, lsr #10 0x26,0x05,0x7d,0xe1 = cmn sp, r6, lsr #10 0x46,0x05,0x71,0xe1 = cmn r1, r6, asr #10 0x66,0x05,0x71,0xe1 = cmn r1, r6, ror #10 0x18,0x02,0x77,0xe1 = cmn r7, r8, lsl r2 0x38,0x02,0x7d,0xe1 = cmn sp, r8, lsr r2 0x58,0x02,0x77,0xe1 = cmn r7, r8, asr r2 0x78,0x02,0x77,0xe1 = cmn r7, r8, ror r2 0x66,0x00,0x71,0xe1 = cmn r1, r6, rrx 0x0f,0x00,0x51,0xe3 = cmp r1, #15 0x06,0x00,0x51,0xe1 = cmp r1, r6 0x06,0x05,0x51,0xe1 = cmp r1, r6, lsl #10 0x26,0x05,0x51,0xe1 = cmp r1, r6, lsr #10 0x26,0x05,0x5d,0xe1 = cmp sp, r6, lsr #10 0x46,0x05,0x51,0xe1 = cmp r1, r6, asr #10 0x66,0x05,0x51,0xe1 = cmp r1, r6, ror #10 0x18,0x02,0x57,0xe1 = cmp r7, r8, lsl r2 0x38,0x02,0x5d,0xe1 = cmp sp, r8, lsr r2 0x58,0x02,0x57,0xe1 = cmp r7, r8, asr r2 0x78,0x02,0x57,0xe1 = cmp r7, r8, ror r2 0x66,0x00,0x51,0xe1 = cmp r1, r6, rrx 0x02,0x00,0x70,0xe3 = cmn r0, #2 0x00,0x00,0x5e,0xe3 = cmp lr, #0 0xc0,0x01,0x08,0xf1 = cpsie aif 0x0f,0x00,0x02,0xf1 = cps #15 0xca,0x00,0x0e,0xf1 = cpsid if, #10 0xf0,0xf0,0x20,0xe3 = dbg #0 0xf5,0xf0,0x20,0xe3 = dbg #5 0xff,0xf0,0x20,0xe3 = dbg #15 0x5f,0xf0,0x7f,0xf5 = dmb sy 0x5e,0xf0,0x7f,0xf5 = dmb st 0x5d,0xf0,0x7f,0xf5 = dmb #0xd 0x5c,0xf0,0x7f,0xf5 = dmb #0xc 0x5b,0xf0,0x7f,0xf5 = dmb ish 0x5a,0xf0,0x7f,0xf5 = dmb ishst 0x59,0xf0,0x7f,0xf5 = dmb #0x9 0x58,0xf0,0x7f,0xf5 = dmb #0x8 0x57,0xf0,0x7f,0xf5 = dmb nsh 0x56,0xf0,0x7f,0xf5 = dmb nshst 0x55,0xf0,0x7f,0xf5 = dmb #0x5 0x54,0xf0,0x7f,0xf5 = dmb #0x4 0x53,0xf0,0x7f,0xf5 = dmb osh 0x52,0xf0,0x7f,0xf5 = dmb oshst 0x51,0xf0,0x7f,0xf5 = dmb #0x1 0x50,0xf0,0x7f,0xf5 = dmb #0x0 0x5f,0xf0,0x7f,0xf5 = dmb sy 0x5e,0xf0,0x7f,0xf5 = dmb st 0x5b,0xf0,0x7f,0xf5 = dmb ish 0x5b,0xf0,0x7f,0xf5 = dmb ish 0x5a,0xf0,0x7f,0xf5 = dmb ishst 0x5a,0xf0,0x7f,0xf5 = dmb ishst 0x57,0xf0,0x7f,0xf5 = dmb nsh 0x57,0xf0,0x7f,0xf5 = dmb nsh 0x56,0xf0,0x7f,0xf5 = dmb nshst 0x56,0xf0,0x7f,0xf5 = dmb nshst 0x53,0xf0,0x7f,0xf5 = dmb osh 0x52,0xf0,0x7f,0xf5 = dmb oshst 0x5f,0xf0,0x7f,0xf5 = dmb sy 0x4f,0xf0,0x7f,0xf5 = dsb sy 0x4e,0xf0,0x7f,0xf5 = dsb st 0x4d,0xf0,0x7f,0xf5 = dsb #0xd 0x4c,0xf0,0x7f,0xf5 = dsb #0xc 0x4b,0xf0,0x7f,0xf5 = dsb ish 0x4a,0xf0,0x7f,0xf5 = dsb ishst 0x49,0xf0,0x7f,0xf5 = dsb #0x9 0x48,0xf0,0x7f,0xf5 = dsb #0x8 0x47,0xf0,0x7f,0xf5 = dsb nsh 0x46,0xf0,0x7f,0xf5 = dsb nshst 0x45,0xf0,0x7f,0xf5 = dsb #0x5 0x44,0xf0,0x7f,0xf5 = dsb #0x4 0x43,0xf0,0x7f,0xf5 = dsb osh 0x42,0xf0,0x7f,0xf5 = dsb oshst 0x41,0xf0,0x7f,0xf5 = dsb #0x1 0x40,0xf0,0x7f,0xf5 = dsb #0x0 0x48,0xf0,0x7f,0xf5 = dsb #0x8 0x47,0xf0,0x7f,0xf5 = dsb nsh 0x4f,0xf0,0x7f,0xf5 = dsb sy 0x4e,0xf0,0x7f,0xf5 = dsb st 0x4b,0xf0,0x7f,0xf5 = dsb ish 0x4b,0xf0,0x7f,0xf5 = dsb ish 0x4a,0xf0,0x7f,0xf5 = dsb ishst 0x4a,0xf0,0x7f,0xf5 = dsb ishst 0x47,0xf0,0x7f,0xf5 = dsb nsh 0x47,0xf0,0x7f,0xf5 = dsb nsh 0x46,0xf0,0x7f,0xf5 = dsb nshst 0x46,0xf0,0x7f,0xf5 = dsb nshst 0x43,0xf0,0x7f,0xf5 = dsb osh 0x42,0xf0,0x7f,0xf5 = dsb oshst 0x4f,0xf0,0x7f,0xf5 = dsb sy 0x4f,0xf0,0x7f,0xf5 = dsb sy 0x42,0xf0,0x7f,0xf5 = dsb oshst 0x0f,0x4a,0x25,0xe2 = eor r4, r5, #61440 0x06,0x40,0x25,0xe0 = eor r4, r5, r6 0x86,0x42,0x25,0xe0 = eor r4, r5, r6, lsl #5 0xa6,0x42,0x25,0xe0 = eor r4, r5, r6, lsr #5 0xa6,0x42,0x25,0xe0 = eor r4, r5, r6, lsr #5 0xc6,0x42,0x25,0xe0 = eor r4, r5, r6, asr #5 0xe6,0x42,0x25,0xe0 = eor r4, r5, r6, ror #5 0x18,0x69,0x27,0xe0 = eor r6, r7, r8, lsl r9 0x38,0x69,0x27,0xe0 = eor r6, r7, r8, lsr r9 0x58,0x69,0x27,0xe0 = eor r6, r7, r8, asr r9 0x78,0x69,0x27,0xe0 = eor r6, r7, r8, ror r9 0x66,0x40,0x25,0xe0 = eor r4, r5, r6, rrx 0x0f,0x5a,0x25,0xe2 = eor r5, r5, #61440 0x05,0x40,0x24,0xe0 = eor r4, r4, r5 0x85,0x42,0x24,0xe0 = eor r4, r4, r5, lsl #5 0xa5,0x42,0x24,0xe0 = eor r4, r4, r5, lsr #5 0xa5,0x42,0x24,0xe0 = eor r4, r4, r5, lsr #5 0xc5,0x42,0x24,0xe0 = eor r4, r4, r5, asr #5 0xe5,0x42,0x24,0xe0 = eor r4, r4, r5, ror #5 0x17,0x69,0x26,0xe0 = eor r6, r6, r7, lsl r9 0x37,0x69,0x26,0xe0 = eor r6, r6, r7, lsr r9 0x57,0x69,0x26,0xe0 = eor r6, r6, r7, asr r9 0x77,0x69,0x26,0xe0 = eor r6, r6, r7, ror r9 0x65,0x40,0x24,0xe0 = eor r4, r4, r5, rrx 0x22,0x30,0x21,0xe0 = eor r3, r1, r2, lsr #32 0x42,0x30,0x21,0xe0 = eor r3, r1, r2, asr #32 0x6f,0xf0,0x7f,0xf5 = isb sy 0x6f,0xf0,0x7f,0xf5 = isb sy 0x6f,0xf0,0x7f,0xf5 = isb sy 0x61,0xf0,0x7f,0xf5 = isb #0x1 0x01,0x80,0x91,0xfd = ldc2 p0, c8, [r1, #4] 0x00,0x71,0x92,0xfd = ldc2 p1, c7, [r2] 0x38,0x62,0x13,0xfd = ldc2 p2, c6, [r3, #-224] 0x1e,0x53,0x34,0xfd = ldc2 p3, c5, [r4, #-120]! 0x04,0x44,0xb5,0xfc = ldc2 p4, c4, [r5], #16 0x12,0x35,0x36,0xfc = ldc2 p5, c3, [r6], #-72 0x01,0x26,0xd7,0xfd = ldc2l p6, c2, [r7, #4] 0x00,0x17,0xd8,0xfd = ldc2l p7, c1, [r8] 0x38,0x08,0x59,0xfd = ldc2l p8, c0, [r9, #-224] 0x1e,0x19,0x7a,0xfd = ldc2l p9, c1, [r10, #-120]! 0x04,0x20,0xfb,0xfc = ldc2l p0, c2, [r11], #16 0x12,0x31,0x7c,0xfc = ldc2l p1, c3, [r12], #-72 0x01,0x4c,0x90,0xed = ldc p12, c4, [r0, #4] 0x00,0x5d,0x91,0xed = ldc p13, c5, [r1] 0x38,0x6e,0x12,0xed = ldc p14, c6, [r2, #-224] 0x1e,0x7f,0x33,0xed = ldc p15, c7, [r3, #-120]! 0x04,0x85,0xb4,0xec = ldc p5, c8, [r4], #16 0x12,0x94,0x35,0xec = ldc p4, c9, [r5], #-72 0x01,0xa3,0xd6,0xed = ldcl p3, c10, [r6, #4] 0x00,0xb2,0xd7,0xed = ldcl p2, c11, [r7] 0x38,0xc1,0x58,0xed = ldcl p1, c12, [r8, #-224] 0x1e,0xd0,0x79,0xed = ldcl p0, c13, [r9, #-120]! 0x04,0xe6,0xfa,0xec = ldcl p6, c14, [r10], #16 0x12,0xf7,0x7b,0xec = ldcl p7, c15, [r11], #-72 0x01,0x4c,0x90,0x3d = ldclo p12, c4, [r0, #4] 0x00,0x5d,0x91,0x8d = ldchi p13, c5, [r1] 0x38,0x6e,0x12,0x2d = ldchs p14, c6, [r2, #-224] 0x1e,0x7f,0x33,0x3d = ldclo p15, c7, [r3, #-120]! 0x04,0x85,0xb4,0x0c = ldceq p5, c8, [r4], #16 0x12,0x94,0x35,0xcc = ldcgt p4, c9, [r5], #-72 0x01,0xa3,0xd6,0xbd = ldcllt p3, c10, [r6, #4] 0x00,0xb2,0xd7,0xad = ldclge p2, c11, [r7] 0x38,0xc1,0x58,0xdd = ldclle p1, c12, [r8, #-224] 0x1e,0xd0,0x79,0x1d = ldclne p0, c13, [r9, #-120]! 0x04,0xe6,0xfa,0x0c = ldcleq p6, c14, [r10], #16 0x12,0xf7,0x7b,0x8c = ldclhi p7, c15, [r11], #-72 0x19,0x82,0x91,0xfc = ldc2 p2, c8, [r1], {25} 0x7a,0x20,0x92,0xe8 = ldm r2, {r1, r3, r4, r5, r6, sp} 0x7a,0x20,0x92,0xe8 = ldm r2, {r1, r3, r4, r5, r6, sp} 0x7a,0x20,0x92,0xe9 = ldmib r2, {r1, r3, r4, r5, r6, sp} 0x7a,0x20,0x12,0xe8 = ldmda r2, {r1, r3, r4, r5, r6, sp} 0x7a,0x20,0x12,0xe9 = ldmdb r2, {r1, r3, r4, r5, r6, sp} 0x7a,0x20,0x92,0xe8 = ldm r2, {r1, r3, r4, r5, r6, sp} 0x7a,0x20,0xb2,0xe8 = ldm r2!, {r1, r3, r4, r5, r6, sp} 0x7a,0x20,0xb2,0xe9 = ldmib r2!, {r1, r3, r4, r5, r6, sp} 0x7a,0x20,0x32,0xe8 = ldmda r2!, {r1, r3, r4, r5, r6, sp} 0x7a,0x20,0x32,0xe9 = ldmdb r2!, {r1, r3, r4, r5, r6, sp} 0x05,0x40,0xd0,0xe8 = ldm r0, {r0, r2, lr} ^ 0x0f,0x80,0xfd,0xe8 = ldm sp!, {r0, r1, r2, r3, pc} ^ 0x9f,0x3f,0xd4,0xe1 = ldrexb r3, [r4] 0x9f,0x2f,0xf5,0xe1 = ldrexh r2, [r5] 0x9f,0x1f,0x97,0xe1 = ldrex r1, [r7] 0x9f,0x6f,0xb8,0xe1 = ldrexd r6, r7, [r8] 0xb0,0x80,0x7b,0x80 = ldrhthi r8, [r11], #-0 0xb0,0x80,0xfb,0x80 = ldrhthi r8, [r11], #0 0x84,0x2f,0xa0,0xe1 = lsl r2, r4, #31 0x84,0x20,0xa0,0xe1 = lsl r2, r4, #1 0x04,0x20,0xa0,0xe1 = mov r2, r4 0x84,0x40,0xa0,0xe1 = lsl r4, r4, #1 0x24,0x20,0xa0,0xe1 = lsr r2, r4, #32 0x24,0x21,0xa0,0xe1 = lsr r2, r4, #2 0x04,0x20,0xa0,0xe1 = mov r2, r4 0x24,0x41,0xa0,0xe1 = lsr r4, r4, #2 0x91,0x57,0x21,0xee = mcr p7, #1, r5, c1, c1, #4 0x91,0x57,0x21,0xfe = mcr2 p7, #1, r5, c1, c1, #4 0x91,0x57,0x21,0x9e = mcrls p7, #1, r5, c1, c1, #4 0xf1,0x57,0x44,0xec = mcrr p7, #15, r5, r4, c1 0xf1,0x57,0x44,0xfc = mcrr2 p7, #15, r5, r4, c1 0xf1,0x57,0x44,0xcc = mcrrgt p7, #15, r5, r4, c1 0x92,0x43,0x21,0xe0 = mla r1, r2, r3, r4 0x92,0x43,0x31,0xe0 = mlas r1, r2, r3, r4 0x92,0x43,0x21,0x10 = mlane r1, r2, r3, r4 0x92,0x43,0x31,0x10 = mlasne r1, r2, r3, r4 0x95,0x36,0x62,0xe0 = mls r2, r5, r6, r3 0x95,0x36,0x62,0x10 = mlsne r2, r5, r6, r3 0x07,0x30,0xa0,0xe3 = mov r3, #7 0xff,0x4e,0xa0,0xe3 = mov r4, #4080 0xff,0x58,0xa0,0xe3 = mov r5, #16711680 0xff,0x6f,0x0f,0xe3 = movw r6, #65535 0xff,0x9f,0x0f,0xe3 = movw r9, #65535 0x07,0x30,0xb0,0xe3 = movs r3, #7 0xff,0x4e,0xa0,0x03 = moveq r4, #4080 0xff,0x58,0xb0,0x03 = movseq r5, #16711680 0x03,0x20,0xa0,0xe1 = mov r2, r3 0x03,0x20,0xb0,0xe1 = movs r2, r3 0x03,0x20,0xa0,0x01 = moveq r2, r3 0x03,0x20,0xb0,0x01 = movseq r2, r3 0x08,0xc0,0xa0,0xe1 = mov r12, r8 0x03,0x20,0xa0,0xe1 = mov r2, r3 0x08,0xc0,0xa0,0xe1 = mov r12, r8 0x03,0x20,0xa0,0xe1 = mov r2, r3 0x08,0xc0,0xa0,0xe1 = mov r12, r8 0x03,0x20,0xa0,0xe1 = mov r2, r3 0x08,0xc0,0xa0,0xe1 = mov r12, r8 0x03,0x20,0xa0,0xe1 = mov r2, r3 0x07,0x30,0x40,0xe3 = movt r3, #7 0xff,0x6f,0x4f,0xe3 = movt r6, #65535 0xf0,0x4f,0x40,0x03 = movteq r4, #4080 0x92,0x1e,0x11,0xee = mrc p14, #0, r1, c1, c2, #4 0xd6,0xff,0xff,0xee = mrc p15, #7, apsr_nzcv, c15, c6, #6 0x92,0x1e,0x11,0xfe = mrc2 p14, #0, r1, c1, c2, #4 0x30,0xf9,0xff,0xfe = mrc2 p9, #7, apsr_nzcv, c15, c0, #1 0xd6,0xff,0xff,0x0e = mrceq p15, #7, apsr_nzcv, c15, c6, #6 0x11,0x57,0x54,0xec = mrrc p7, #1, r5, r4, c1 0x11,0x57,0x54,0xfc = mrrc2 p7, #1, r5, r4, c1 0x11,0x57,0x54,0x3c = mrrclo p7, #1, r5, r4, c1 0x00,0x80,0x0f,0xe1 = mrs r8, apsr 0x00,0x80,0x0f,0xe1 = mrs r8, apsr 0x00,0x80,0x4f,0xe1 = mrs r8, spsr 0x05,0xf0,0x28,0xe3 = msr apsr_nzcvq, #5 0x05,0xf0,0x24,0xe3 = msr apsr_g, #5 0x05,0xf0,0x28,0xe3 = msr apsr_nzcvq, #5 0x05,0xf0,0x28,0xe3 = msr apsr_nzcvq, #5 0x05,0xf0,0x2c,0xe3 = msr apsr_nzcvqg, #5 0x05,0xf0,0x29,0xe3 = msr cpsr_fc, #5 0x05,0xf0,0x21,0xe3 = msr cpsr_c, #5 0x05,0xf0,0x22,0xe3 = msr cpsr_x, #5 0x05,0xf0,0x29,0xe3 = msr cpsr_fc, #5 0x05,0xf0,0x29,0xe3 = msr cpsr_fc, #5 0x05,0xf0,0x2e,0xe3 = msr cpsr_fsx, #5 0x05,0xf0,0x69,0xe3 = msr spsr_fc, #5 0x05,0xf0,0x6f,0xe3 = msr spsr_fsxc, #5 0x05,0xf0,0x2f,0xe3 = msr cpsr_fsxc, #5 0x00,0xf0,0x28,0xe1 = msr apsr_nzcvq, r0 0x00,0xf0,0x24,0xe1 = msr apsr_g, r0 0x00,0xf0,0x28,0xe1 = msr apsr_nzcvq, r0 0x00,0xf0,0x28,0xe1 = msr apsr_nzcvq, r0 0x00,0xf0,0x2c,0xe1 = msr apsr_nzcvqg, r0 0x00,0xf0,0x29,0xe1 = msr cpsr_fc, r0 0x00,0xf0,0x21,0xe1 = msr cpsr_c, r0 0x00,0xf0,0x22,0xe1 = msr cpsr_x, r0 0x00,0xf0,0x29,0xe1 = msr cpsr_fc, r0 0x00,0xf0,0x29,0xe1 = msr cpsr_fc, r0 0x00,0xf0,0x2e,0xe1 = msr cpsr_fsx, r0 0x00,0xf0,0x69,0xe1 = msr spsr_fc, r0 0x00,0xf0,0x6f,0xe1 = msr spsr_fsxc, r0 0x00,0xf0,0x2f,0xe1 = msr cpsr_fsxc, r0 0x96,0x07,0x05,0xe0 = mul r5, r6, r7 0x96,0x07,0x15,0xe0 = muls r5, r6, r7 0x96,0x07,0x05,0xc0 = mulgt r5, r6, r7 0x96,0x07,0x15,0xd0 = mulsle r5, r6, r7 0x07,0x30,0xe0,0xe3 = mvn r3, #7 0xff,0x4e,0xe0,0xe3 = mvn r4, #4080 0xff,0x58,0xe0,0xe3 = mvn r5, #16711680 0x07,0x30,0xf0,0xe3 = mvns r3, #7 0xff,0x4e,0xe0,0x03 = mvneq r4, #4080 0xff,0x58,0xf0,0x03 = mvnseq r5, #16711680 0x03,0x20,0xe0,0xe1 = mvn r2, r3 0x03,0x20,0xf0,0xe1 = mvns r2, r3 0x86,0x59,0xe0,0xe1 = mvn r5, r6, lsl #19 0xa6,0x54,0xe0,0xe1 = mvn r5, r6, lsr #9 0x46,0x52,0xe0,0xe1 = mvn r5, r6, asr #4 0x66,0x53,0xe0,0xe1 = mvn r5, r6, ror #6 0x66,0x50,0xe0,0xe1 = mvn r5, r6, rrx 0x03,0x20,0xe0,0x01 = mvneq r2, r3 0x03,0x25,0xf0,0x01 = mvnseq r2, r3, lsl #10 0x16,0x57,0xe0,0xe1 = mvn r5, r6, lsl r7 0x36,0x57,0xf0,0xe1 = mvns r5, r6, lsr r7 0x56,0x57,0xe0,0xc1 = mvngt r5, r6, asr r7 0x76,0x57,0xf0,0xb1 = mvnslt r5, r6, ror r7 0x00,0x50,0x68,0xe2 = rsb r5, r8, #0 0x00,0xf0,0x20,0xe3 = nop 0x00,0xf0,0x20,0xe3 = nop 0x00,0xf0,0x20,0xc3 = nopgt 0x0f,0x4a,0x85,0xe3 = orr r4, r5, #61440 0x06,0x40,0x85,0xe1 = orr r4, r5, r6 0x86,0x42,0x85,0xe1 = orr r4, r5, r6, lsl #5 0xa6,0x42,0x85,0xe1 = orr r4, r5, r6, lsr #5 0xa6,0x42,0x85,0xe1 = orr r4, r5, r6, lsr #5 0xc6,0x42,0x85,0xe1 = orr r4, r5, r6, asr #5 0xe6,0x42,0x85,0xe1 = orr r4, r5, r6, ror #5 0x18,0x69,0x87,0xe1 = orr r6, r7, r8, lsl r9 0x38,0x69,0x87,0xe1 = orr r6, r7, r8, lsr r9 0x58,0x69,0x87,0xe1 = orr r6, r7, r8, asr r9 0x78,0x69,0x87,0xe1 = orr r6, r7, r8, ror r9 0x66,0x40,0x85,0xe1 = orr r4, r5, r6, rrx 0x0f,0x5a,0x85,0xe3 = orr r5, r5, #61440 0x05,0x40,0x84,0xe1 = orr r4, r4, r5 0x85,0x42,0x84,0xe1 = orr r4, r4, r5, lsl #5 0xa5,0x42,0x84,0xe1 = orr r4, r4, r5, lsr #5 0xa5,0x42,0x84,0xe1 = orr r4, r4, r5, lsr #5 0xc5,0x42,0x84,0xe1 = orr r4, r4, r5, asr #5 0xe5,0x42,0x84,0xe1 = orr r4, r4, r5, ror #5 0x17,0x69,0x86,0xe1 = orr r6, r6, r7, lsl r9 0x37,0x69,0x86,0xe1 = orr r6, r6, r7, lsr r9 0x57,0x69,0x86,0xe1 = orr r6, r6, r7, asr r9 0x77,0x69,0x86,0xe1 = orr r6, r6, r7, ror r9 0x65,0x40,0x84,0xe1 = orr r4, r4, r5, rrx 0x0f,0x4a,0x95,0x03 = orrseq r4, r5, #61440 0x06,0x40,0x85,0x11 = orrne r4, r5, r6 0x86,0x42,0x95,0x01 = orrseq r4, r5, r6, lsl #5 0x78,0x69,0x87,0x31 = orrlo r6, r7, r8, ror r9 0x66,0x40,0x95,0x81 = orrshi r4, r5, r6, rrx 0x0f,0x5a,0x85,0x23 = orrhs r5, r5, #61440 0x05,0x40,0x94,0x01 = orrseq r4, r4, r5 0x57,0x69,0x86,0x11 = orrne r6, r6, r7, asr r9 0x77,0x69,0x96,0xb1 = orrslt r6, r6, r7, ror r9 0x65,0x40,0x94,0xc1 = orrsgt r4, r4, r5, rrx 0x22,0x30,0x81,0xe1 = orr r3, r1, r2, lsr #32 0x42,0x30,0x81,0xe1 = orr r3, r1, r2, asr #32 0x13,0x20,0x82,0xe6 = pkhbt r2, r2, r3 0x93,0x2f,0x82,0xe6 = pkhbt r2, r2, r3, lsl #31 0x13,0x20,0x82,0xe6 = pkhbt r2, r2, r3 0x93,0x27,0x82,0xe6 = pkhbt r2, r2, r3, lsl #15 0x13,0x20,0x82,0xe6 = pkhbt r2, r2, r3 0xd3,0x2f,0x82,0xe6 = pkhtb r2, r2, r3, asr #31 0xd3,0x27,0x82,0xe6 = pkhtb r2, r2, r3, asr #15 0x04,0x70,0x9d,0xe4 = pop {r7} 0x80,0x07,0xbd,0xe8 = pop {r7, r8, r9, r10} #0x04,0x70,0x2d,0xe5 = push {r7} 0x80,0x07,0x2d,0xe9 = push {r7, r8, r9, r10} 0x52,0x10,0x03,0xe1 = qadd r1, r2, r3 0x52,0x10,0x03,0x11 = qaddne r1, r2, r3 0x13,0x1f,0x22,0xe6 = qadd16 r1, r2, r3 0x13,0x1f,0x22,0xc6 = qadd16gt r1, r2, r3 0x93,0x1f,0x22,0xe6 = qadd8 r1, r2, r3 0x93,0x1f,0x22,0xd6 = qadd8le r1, r2, r3 0x57,0x60,0x48,0xe1 = qdadd r6, r7, r8 0x57,0x60,0x48,0x81 = qdaddhi r6, r7, r8 0x57,0x60,0x68,0xe1 = qdsub r6, r7, r8 0x57,0x60,0x68,0x81 = qdsubhi r6, r7, r8 0x50,0x9f,0x2c,0xe6 = qsax r9, r12, r0 0x50,0x9f,0x2c,0x06 = qsaxeq r9, r12, r0 0x52,0x10,0x23,0xe1 = qsub r1, r2, r3 0x52,0x10,0x23,0x11 = qsubne r1, r2, r3 0x73,0x1f,0x22,0xe6 = qsub16 r1, r2, r3 0x73,0x1f,0x22,0xc6 = qsub16gt r1, r2, r3 0xf3,0x1f,0x22,0xe6 = qsub8 r1, r2, r3 0xf3,0x1f,0x22,0xd6 = qsub8le r1, r2, r3 0x32,0x1f,0xff,0xe6 = rbit r1, r2 0x32,0x1f,0xff,0x16 = rbitne r1, r2 0x39,0x1f,0xbf,0xe6 = rev r1, r9 0x35,0x1f,0xbf,0x16 = revne r1, r5 0xb3,0x8f,0xbf,0xe6 = rev16 r8, r3 0xb4,0xcf,0xbf,0x16 = rev16ne r12, r4 0xb9,0x4f,0xff,0xe6 = revsh r4, r9 0xb1,0x9f,0xff,0x16 = revshne r9, r1 0x00,0x0a,0x12,0xf8 = rfeda r2 0x00,0x0a,0x13,0xf9 = rfedb r3 0x00,0x0a,0x95,0xf8 = rfeia r5 0x00,0x0a,0x96,0xf9 = rfeib r6 0x00,0x0a,0x34,0xf8 = rfeda r4! 0x00,0x0a,0x37,0xf9 = rfedb r7! 0x00,0x0a,0xb9,0xf8 = rfeia r9! 0x00,0x0a,0xb8,0xf9 = rfeib r8! 0x00,0x0a,0x12,0xf8 = rfeda r2 0x00,0x0a,0x13,0xf9 = rfedb r3 0x00,0x0a,0x95,0xf8 = rfeia r5 0x00,0x0a,0x96,0xf9 = rfeib r6 0x00,0x0a,0x34,0xf8 = rfeda r4! 0x00,0x0a,0x37,0xf9 = rfedb r7! 0x00,0x0a,0xb9,0xf8 = rfeia r9! 0x00,0x0a,0xb8,0xf9 = rfeib r8! 0x00,0x0a,0x91,0xf8 = rfeia r1 0x00,0x0a,0xb1,0xf8 = rfeia r1! 0xe4,0x2f,0xa0,0xe1 = ror r2, r4, #31 0xe4,0x20,0xa0,0xe1 = ror r2, r4, #1 0x04,0x20,0xa0,0xe1 = mov r2, r4 0xe4,0x40,0xa0,0xe1 = ror r4, r4, #1 0x0f,0x4a,0x65,0xe2 = rsb r4, r5, #61440 0x06,0x40,0x65,0xe0 = rsb r4, r5, r6 0x86,0x42,0x65,0xe0 = rsb r4, r5, r6, lsl #5 0xa6,0x42,0x65,0x30 = rsblo r4, r5, r6, lsr #5 0xa6,0x42,0x65,0xe0 = rsb r4, r5, r6, lsr #5 0xc6,0x42,0x65,0xe0 = rsb r4, r5, r6, asr #5 0xe6,0x42,0x65,0xe0 = rsb r4, r5, r6, ror #5 0x18,0x69,0x67,0xe0 = rsb r6, r7, r8, lsl r9 0x38,0x69,0x67,0xe0 = rsb r6, r7, r8, lsr r9 0x58,0x69,0x67,0xe0 = rsb r6, r7, r8, asr r9 0x78,0x69,0x67,0xd0 = rsble r6, r7, r8, ror r9 0x66,0x40,0x65,0xe0 = rsb r4, r5, r6, rrx 0x0f,0x5a,0x65,0xe2 = rsb r5, r5, #61440 0x05,0x40,0x64,0xe0 = rsb r4, r4, r5 0x85,0x42,0x64,0xe0 = rsb r4, r4, r5, lsl #5 0xa5,0x42,0x64,0xe0 = rsb r4, r4, r5, lsr #5 0xa5,0x42,0x64,0x10 = rsbne r4, r4, r5, lsr #5 0xc5,0x42,0x64,0xe0 = rsb r4, r4, r5, asr #5 0xe5,0x42,0x64,0xe0 = rsb r4, r4, r5, ror #5 0x17,0x69,0x66,0xc0 = rsbgt r6, r6, r7, lsl r9 0x37,0x69,0x66,0xe0 = rsb r6, r6, r7, lsr r9 0x57,0x69,0x66,0xe0 = rsb r6, r6, r7, asr r9 0x77,0x69,0x66,0xe0 = rsb r6, r6, r7, ror r9 0x65,0x40,0x64,0xe0 = rsb r4, r4, r5, rrx 0x0f,0x4a,0xe5,0xe2 = rsc r4, r5, #61440 0x06,0x40,0xe5,0xe0 = rsc r4, r5, r6 0x86,0x42,0xe5,0xe0 = rsc r4, r5, r6, lsl #5 0xa6,0x42,0xe5,0x30 = rsclo r4, r5, r6, lsr #5 0xa6,0x42,0xe5,0xe0 = rsc r4, r5, r6, lsr #5 0xc6,0x42,0xe5,0xe0 = rsc r4, r5, r6, asr #5 0xe6,0x42,0xe5,0xe0 = rsc r4, r5, r6, ror #5 0x18,0x69,0xe7,0xe0 = rsc r6, r7, r8, lsl r9 0x38,0x69,0xe7,0xe0 = rsc r6, r7, r8, lsr r9 0x58,0x69,0xe7,0xe0 = rsc r6, r7, r8, asr r9 0x78,0x69,0xe7,0xd0 = rscle r6, r7, r8, ror r9 0xfe,0x1e,0xf8,0xe2 = rscs r1, r8, #4064 0x0f,0x5a,0xe5,0xe2 = rsc r5, r5, #61440 0x05,0x40,0xe4,0xe0 = rsc r4, r4, r5 0x85,0x42,0xe4,0xe0 = rsc r4, r4, r5, lsl #5 0xa5,0x42,0xe4,0xe0 = rsc r4, r4, r5, lsr #5 0xa5,0x42,0xe4,0x10 = rscne r4, r4, r5, lsr #5 0xc5,0x42,0xe4,0xe0 = rsc r4, r4, r5, asr #5 0xe5,0x42,0xe4,0xe0 = rsc r4, r4, r5, ror #5 0x17,0x69,0xe6,0xc0 = rscgt r6, r6, r7, lsl r9 0x37,0x69,0xe6,0xe0 = rsc r6, r6, r7, lsr r9 0x57,0x69,0xe6,0xe0 = rsc r6, r6, r7, asr r9 0x77,0x69,0xe6,0xe0 = rsc r6, r6, r7, ror r9 0x61,0x00,0xa0,0xe1 = rrx r0, r1 0x6f,0xd0,0xa0,0xe1 = rrx sp, pc 0x6e,0xf0,0xa0,0xe1 = rrx pc, lr 0x6d,0xe0,0xa0,0xe1 = rrx lr, sp 0x61,0x00,0xb0,0xe1 = rrxs r0, r1 0x6f,0xd0,0xb0,0xe1 = rrxs sp, pc 0x6e,0xf0,0xb0,0xe1 = rrxs pc, lr 0x6d,0xe0,0xb0,0xe1 = rrxs lr, sp 0x13,0x1f,0x12,0xe6 = sadd16 r1, r2, r3 0x13,0x1f,0x12,0xc6 = sadd16gt r1, r2, r3 0x93,0x1f,0x12,0xe6 = sadd8 r1, r2, r3 0x93,0x1f,0x12,0xd6 = sadd8le r1, r2, r3 0x30,0x9f,0x1c,0xe6 = sasx r9, r12, r0 0x30,0x9f,0x1c,0x06 = sasxeq r9, r12, r0 0x0f,0x4a,0xc5,0xe2 = sbc r4, r5, #61440 0x06,0x40,0xc5,0xe0 = sbc r4, r5, r6 0x86,0x42,0xc5,0xe0 = sbc r4, r5, r6, lsl #5 0xa6,0x42,0xc5,0xe0 = sbc r4, r5, r6, lsr #5 0xa6,0x42,0xc5,0xe0 = sbc r4, r5, r6, lsr #5 0xc6,0x42,0xc5,0xe0 = sbc r4, r5, r6, asr #5 0xe6,0x42,0xc5,0xe0 = sbc r4, r5, r6, ror #5 0x18,0x69,0xc7,0xe0 = sbc r6, r7, r8, lsl r9 0x38,0x69,0xc7,0xe0 = sbc r6, r7, r8, lsr r9 0x58,0x69,0xc7,0xe0 = sbc r6, r7, r8, asr r9 0x78,0x69,0xc7,0xe0 = sbc r6, r7, r8, ror r9 0x0f,0x5a,0xc5,0xe2 = sbc r5, r5, #61440 0x05,0x40,0xc4,0xe0 = sbc r4, r4, r5 0x85,0x42,0xc4,0xe0 = sbc r4, r4, r5, lsl #5 0xa5,0x42,0xc4,0xe0 = sbc r4, r4, r5, lsr #5 0xa5,0x42,0xc4,0xe0 = sbc r4, r4, r5, lsr #5 0xc5,0x42,0xc4,0xe0 = sbc r4, r4, r5, asr #5 0xe5,0x42,0xc4,0xe0 = sbc r4, r4, r5, ror #5 0x17,0x69,0xc6,0xe0 = sbc r6, r6, r7, lsl r9 0x37,0x69,0xc6,0xe0 = sbc r6, r6, r7, lsr r9 0x57,0x69,0xc6,0xe0 = sbc r6, r6, r7, asr r9 0x77,0x69,0xc6,0xe0 = sbc r6, r6, r7, ror r9 0x55,0x48,0xa0,0xe7 = sbfx r4, r5, #16, #1 0x55,0x48,0xaf,0xc7 = sbfxgt r4, r5, #16, #16 0xb1,0x9f,0x82,0xe6 = sel r9, r2, r1 0xb1,0x9f,0x82,0x16 = selne r9, r2, r1 0x00,0x02,0x01,0xf1 = setend be 0x00,0x02,0x01,0xf1 = setend be 0x00,0x00,0x01,0xf1 = setend le 0x00,0x00,0x01,0xf1 = setend le 0x04,0xf0,0x20,0xe3 = sev 0x04,0xf0,0x20,0x03 = seveq 0x12,0x4f,0x38,0xe6 = shadd16 r4, r8, r2 0x12,0x4f,0x38,0xc6 = shadd16gt r4, r8, r2 0x92,0x4f,0x38,0xe6 = shadd8 r4, r8, r2 0x92,0x4f,0x38,0xc6 = shadd8gt r4, r8, r2 0x32,0x4f,0x38,0xe6 = shasx r4, r8, r2 0x32,0x4f,0x38,0xc6 = shasxgt r4, r8, r2 0x72,0x4f,0x38,0xe6 = shsub16 r4, r8, r2 0x72,0x4f,0x38,0xc6 = shsub16gt r4, r8, r2 0xf2,0x4f,0x38,0xe6 = shsub8 r4, r8, r2 0xf2,0x4f,0x38,0xc6 = shsub8gt r4, r8, r2 0x81,0x09,0x03,0xe1 = smlabb r3, r1, r9, r0 0xc6,0x14,0x05,0xe1 = smlabt r5, r6, r4, r1 0xa2,0x23,0x04,0xe1 = smlatb r4, r2, r3, r2 0xe3,0x48,0x08,0xe1 = smlatt r8, r3, r8, r4 0x81,0x09,0x03,0xa1 = smlabbge r3, r1, r9, r0 0xc6,0x14,0x05,0xd1 = smlabtle r5, r6, r4, r1 0xa2,0x23,0x04,0x11 = smlatbne r4, r2, r3, r2 0xe3,0x48,0x08,0x01 = smlatteq r8, r3, r8, r4 0x13,0x85,0x02,0xe7 = smlad r2, r3, r5, r8 0x33,0x85,0x02,0xe7 = smladx r2, r3, r5, r8 0x13,0x85,0x02,0x07 = smladeq r2, r3, r5, r8 0x33,0x85,0x02,0x87 = smladxhi r2, r3, r5, r8 0x95,0x28,0xe3,0xe0 = smlal r2, r3, r5, r8 0x95,0x28,0xf3,0xe0 = smlals r2, r3, r5, r8 0x95,0x28,0xe3,0x00 = smlaleq r2, r3, r5, r8 0x95,0x28,0xf3,0x80 = smlalshi r2, r3, r5, r8 0x89,0x30,0x41,0xe1 = smlalbb r3, r1, r9, r0 0xc4,0x51,0x46,0xe1 = smlalbt r5, r6, r4, r1 0xa3,0x42,0x42,0xe1 = smlaltb r4, r2, r3, r2 0xe8,0x84,0x43,0xe1 = smlaltt r8, r3, r8, r4 0x89,0x30,0x41,0xa1 = smlalbbge r3, r1, r9, r0 0xc4,0x51,0x46,0xd1 = smlalbtle r5, r6, r4, r1 0xa3,0x42,0x42,0x11 = smlaltbne r4, r2, r3, r2 0xe8,0x84,0x43,0x01 = smlaltteq r8, r3, r8, r4 0x15,0x28,0x43,0xe7 = smlald r2, r3, r5, r8 0x35,0x28,0x43,0xe7 = smlaldx r2, r3, r5, r8 0x15,0x28,0x43,0x07 = smlaldeq r2, r3, r5, r8 0x35,0x28,0x43,0x87 = smlaldxhi r2, r3, r5, r8 0x83,0x8a,0x22,0xe1 = smlawb r2, r3, r10, r8 0xc3,0x95,0x28,0xe1 = smlawt r8, r3, r5, r9 0x87,0x85,0x22,0x01 = smlawbeq r2, r7, r5, r8 0xc3,0x80,0x21,0x81 = smlawthi r1, r3, r0, r8 0x53,0x85,0x02,0xe7 = smlsd r2, r3, r5, r8 0x73,0x85,0x02,0xe7 = smlsdx r2, r3, r5, r8 0x53,0x85,0x02,0x07 = smlsdeq r2, r3, r5, r8 0x73,0x85,0x02,0x87 = smlsdxhi r2, r3, r5, r8 0x55,0x21,0x49,0xe7 = smlsld r2, r9, r5, r1 0x72,0x48,0x4b,0xe7 = smlsldx r4, r11, r2, r8 0x55,0x86,0x42,0x07 = smlsldeq r8, r2, r5, r6 0x73,0x18,0x40,0x87 = smlsldxhi r1, r0, r3, r8 0x12,0x43,0x51,0xe7 = smmla r1, r2, r3, r4 0x33,0x12,0x54,0xe7 = smmlar r4, r3, r2, r1 0x12,0x43,0x51,0x37 = smmlalo r1, r2, r3, r4 0x33,0x12,0x54,0x27 = smmlarhs r4, r3, r2, r1 0xd2,0x43,0x51,0xe7 = smmls r1, r2, r3, r4 0xf3,0x12,0x54,0xe7 = smmlsr r4, r3, r2, r1 0xd2,0x43,0x51,0x37 = smmlslo r1, r2, r3, r4 0xf3,0x12,0x54,0x27 = smmlsrhs r4, r3, r2, r1 0x13,0xf4,0x52,0xe7 = smmul r2, r3, r4 0x32,0xf1,0x53,0xe7 = smmulr r3, r2, r1 0x13,0xf4,0x52,0x37 = smmullo r2, r3, r4 0x32,0xf1,0x53,0x27 = smmulrhs r3, r2, r1 0x13,0xf4,0x02,0xe7 = smuad r2, r3, r4 0x32,0xf1,0x03,0xe7 = smuadx r3, r2, r1 0x13,0xf4,0x02,0xb7 = smuadlt r2, r3, r4 0x32,0xf1,0x03,0xa7 = smuadxge r3, r2, r1 0x89,0x00,0x63,0xe1 = smulbb r3, r9, r0 0xc4,0x01,0x65,0xe1 = smulbt r5, r4, r1 0xa2,0x02,0x64,0xe1 = smultb r4, r2, r2 0xe3,0x04,0x68,0xe1 = smultt r8, r3, r4 0x89,0x00,0x61,0xa1 = smulbbge r1, r9, r0 0xc6,0x04,0x65,0xd1 = smulbtle r5, r6, r4 0xa3,0x02,0x62,0x11 = smultbne r2, r3, r2 0xe3,0x04,0x68,0x01 = smultteq r8, r3, r4 0x90,0x31,0xc9,0xe0 = smull r3, r9, r0, r1 0x90,0x32,0xd9,0xe0 = smulls r3, r9, r0, r2 0x94,0x85,0xc3,0x00 = smulleq r8, r3, r4, r5 0x94,0x83,0xd3,0x00 = smullseq r8, r3, r4, r3 0xa9,0x00,0x23,0xe1 = smulwb r3, r9, r0 0xe9,0x02,0x23,0xe1 = smulwt r3, r9, r2 0x50,0xf1,0x03,0xe7 = smusd r3, r0, r1 0x79,0xf2,0x03,0xe7 = smusdx r3, r9, r2 0x53,0xf2,0x08,0x07 = smusdeq r8, r3, r2 0x74,0xf3,0x07,0x17 = smusdxne r7, r4, r3 0x05,0x05,0x4d,0xf8 = srsda sp, #5 0x01,0x05,0x4d,0xf9 = srsdb sp, #1 0x00,0x05,0xcd,0xf8 = srsia sp, #0 0x0f,0x05,0xcd,0xf9 = srsib sp, #15 0x1f,0x05,0x6d,0xf8 = srsda sp!, #31 0x13,0x05,0x6d,0xf9 = srsdb sp!, #19 0x02,0x05,0xed,0xf8 = srsia sp!, #2 0x0e,0x05,0xed,0xf9 = srsib sp!, #14 0x0b,0x05,0xcd,0xf9 = srsib sp, #11 0x0a,0x05,0xcd,0xf8 = srsia sp, #10 0x09,0x05,0x4d,0xf9 = srsdb sp, #9 0x05,0x05,0x4d,0xf8 = srsda sp, #5 0x05,0x05,0xed,0xf9 = srsib sp!, #5 0x05,0x05,0xed,0xf8 = srsia sp!, #5 0x05,0x05,0x6d,0xf9 = srsdb sp!, #5 0x05,0x05,0x6d,0xf8 = srsda sp!, #5 0x05,0x05,0xcd,0xf8 = srsia sp, #5 0x05,0x05,0xed,0xf8 = srsia sp!, #5 0x05,0x05,0x4d,0xf8 = srsda sp, #5 0x01,0x05,0x4d,0xf9 = srsdb sp, #1 0x00,0x05,0xcd,0xf8 = srsia sp, #0 0x0f,0x05,0xcd,0xf9 = srsib sp, #15 0x1f,0x05,0x6d,0xf8 = srsda sp!, #31 0x13,0x05,0x6d,0xf9 = srsdb sp!, #19 0x02,0x05,0xed,0xf8 = srsia sp!, #2 0x0e,0x05,0xed,0xf9 = srsib sp!, #14 0x0b,0x05,0xcd,0xf9 = srsib sp, #11 0x0a,0x05,0xcd,0xf8 = srsia sp, #10 0x09,0x05,0x4d,0xf9 = srsdb sp, #9 0x05,0x05,0x4d,0xf8 = srsda sp, #5 0x05,0x05,0xed,0xf9 = srsib sp!, #5 0x05,0x05,0xed,0xf8 = srsia sp!, #5 0x05,0x05,0x6d,0xf9 = srsdb sp!, #5 0x05,0x05,0x6d,0xf8 = srsda sp!, #5 0x05,0x05,0xcd,0xf8 = srsia sp, #5 0x05,0x05,0xed,0xf8 = srsia sp!, #5 0x1a,0x80,0xa0,0xe6 = ssat r8, #1, r10 0x1a,0x80,0xa0,0xe6 = ssat r8, #1, r10 0x9a,0x8f,0xa0,0xe6 = ssat r8, #1, r10, lsl #31 0x5a,0x80,0xa0,0xe6 = ssat r8, #1, r10, asr #32 0xda,0x80,0xa0,0xe6 = ssat r8, #1, r10, asr #1 0x37,0x2f,0xa0,0xe6 = ssat16 r2, #1, r7 0x35,0x3f,0xaf,0xe6 = ssat16 r3, #16, r5 0x54,0x2f,0x13,0xe6 = ssax r2, r3, r4 0x54,0x2f,0x13,0xb6 = ssaxlt r2, r3, r4 0x76,0x1f,0x10,0xe6 = ssub16 r1, r0, r6 0x72,0x5f,0x13,0x16 = ssub16ne r5, r3, r2 0xf4,0x9f,0x12,0xe6 = ssub8 r9, r2, r4 0xf2,0x5f,0x11,0x06 = ssub8eq r5, r1, r2 0x01,0x80,0x81,0xfd = stc2 p0, c8, [r1, #4] 0x00,0x71,0x82,0xfd = stc2 p1, c7, [r2] 0x38,0x62,0x03,0xfd = stc2 p2, c6, [r3, #-224] 0x1e,0x53,0x24,0xfd = stc2 p3, c5, [r4, #-120]! 0x04,0x44,0xa5,0xfc = stc2 p4, c4, [r5], #16 0x12,0x35,0x26,0xfc = stc2 p5, c3, [r6], #-72 0x01,0x26,0xc7,0xfd = stc2l p6, c2, [r7, #4] 0x00,0x17,0xc8,0xfd = stc2l p7, c1, [r8] 0x38,0x08,0x49,0xfd = stc2l p8, c0, [r9, #-224] 0x1e,0x19,0x6a,0xfd = stc2l p9, c1, [r10, #-120]! 0x04,0x20,0xeb,0xfc = stc2l p0, c2, [r11], #16 0x12,0x31,0x6c,0xfc = stc2l p1, c3, [r12], #-72 0x01,0x4c,0x80,0xed = stc p12, c4, [r0, #4] 0x00,0x5d,0x81,0xed = stc p13, c5, [r1] 0x38,0x6e,0x02,0xed = stc p14, c6, [r2, #-224] 0x1e,0x7f,0x23,0xed = stc p15, c7, [r3, #-120]! 0x04,0x85,0xa4,0xec = stc p5, c8, [r4], #16 0x12,0x94,0x25,0xec = stc p4, c9, [r5], #-72 0x01,0xa3,0xc6,0xed = stcl p3, c10, [r6, #4] 0x00,0xb2,0xc7,0xed = stcl p2, c11, [r7] 0x38,0xc1,0x48,0xed = stcl p1, c12, [r8, #-224] 0x1e,0xd0,0x69,0xed = stcl p0, c13, [r9, #-120]! 0x04,0xe6,0xea,0xec = stcl p6, c14, [r10], #16 0x12,0xf7,0x6b,0xec = stcl p7, c15, [r11], #-72 0x01,0x4c,0x80,0x3d = stclo p12, c4, [r0, #4] 0x00,0x5d,0x81,0x8d = stchi p13, c5, [r1] 0x38,0x6e,0x02,0x2d = stchs p14, c6, [r2, #-224] 0x1e,0x7f,0x23,0x3d = stclo p15, c7, [r3, #-120]! 0x04,0x85,0xa4,0x0c = stceq p5, c8, [r4], #16 0x12,0x94,0x25,0xcc = stcgt p4, c9, [r5], #-72 0x01,0xa3,0xc6,0xbd = stcllt p3, c10, [r6, #4] 0x00,0xb2,0xc7,0xad = stclge p2, c11, [r7] 0x38,0xc1,0x48,0xdd = stclle p1, c12, [r8, #-224] 0x1e,0xd0,0x69,0x1d = stclne p0, c13, [r9, #-120]! 0x04,0xe6,0xea,0x0c = stcleq p6, c14, [r10], #16 0x12,0xf7,0x6b,0x8c = stclhi p7, c15, [r11], #-72 0x19,0x82,0x81,0xfc = stc2 p2, c8, [r1], {25} 0x7a,0x20,0x82,0xe8 = stm r2, {r1, r3, r4, r5, r6, sp} 0x7a,0x40,0x83,0xe8 = stm r3, {r1, r3, r4, r5, r6, lr} 0x7a,0x20,0x84,0xe9 = stmib r4, {r1, r3, r4, r5, r6, sp} 0x7a,0x20,0x05,0xe8 = stmda r5, {r1, r3, r4, r5, r6, sp} 0x7a,0x01,0x06,0xe9 = stmdb r6, {r1, r3, r4, r5, r6, r8} 0x7a,0x20,0x0d,0xe9 = stmdb sp, {r1, r3, r4, r5, r6, sp} 0x7a,0x20,0xa8,0xe8 = stm r8!, {r1, r3, r4, r5, r6, sp} 0x7a,0x20,0xa9,0xe9 = stmib r9!, {r1, r3, r4, r5, r6, sp} 0x7a,0x00,0x2d,0xe8 = stmda sp!, {r1, r3, r4, r5, r6} 0xa2,0x20,0x20,0xe9 = stmdb r0!, {r1, r5, r7, sp} 0x93,0x1f,0xc4,0xe1 = strexb r1, r3, [r4] 0x92,0x4f,0xe5,0xe1 = strexh r4, r2, [r5] 0x91,0x2f,0x87,0xe1 = strex r2, r1, [r7] 0x92,0x6f,0xa8,0xe1 = strexd r6, r2, r3, [r8] 0x00,0x30,0x2a,0x55 = strpl r3, [r10, #-0]! 0x00,0x30,0xaa,0x55 = strpl r3, [r10, #0]! 0x0f,0x4a,0x45,0xe2 = sub r4, r5, #61440 0x06,0x40,0x45,0xe0 = sub r4, r5, r6 0x86,0x42,0x45,0xe0 = sub r4, r5, r6, lsl #5 0xa6,0x42,0x45,0xe0 = sub r4, r5, r6, lsr #5 0xa6,0x42,0x45,0xe0 = sub r4, r5, r6, lsr #5 0xc6,0x42,0x45,0xe0 = sub r4, r5, r6, asr #5 0xe6,0x42,0x45,0xe0 = sub r4, r5, r6, ror #5 0x18,0x69,0x47,0xe0 = sub r6, r7, r8, lsl r9 0x38,0x69,0x47,0xe0 = sub r6, r7, r8, lsr r9 0x58,0x69,0x47,0xe0 = sub r6, r7, r8, asr r9 0x78,0x69,0x47,0xe0 = sub r6, r7, r8, ror r9 0x0f,0x5a,0x45,0xe2 = sub r5, r5, #61440 0x05,0x40,0x44,0xe0 = sub r4, r4, r5 0x85,0x42,0x44,0xe0 = sub r4, r4, r5, lsl #5 0xa5,0x42,0x44,0xe0 = sub r4, r4, r5, lsr #5 0xa5,0x42,0x44,0xe0 = sub r4, r4, r5, lsr #5 0xc5,0x42,0x44,0xe0 = sub r4, r4, r5, asr #5 0xe5,0x42,0x44,0xe0 = sub r4, r4, r5, ror #5 0x17,0x69,0x46,0xe0 = sub r6, r6, r7, lsl r9 0x37,0x69,0x46,0xe0 = sub r6, r6, r7, lsr r9 0x57,0x69,0x46,0xe0 = sub r6, r6, r7, asr r9 0x77,0x69,0x46,0xe0 = sub r6, r6, r7, ror r9 0x22,0x30,0x41,0xe0 = sub r3, r1, r2, lsr #32 0x42,0x30,0x41,0xe0 = sub r3, r1, r2, asr #32 0x10,0x00,0x00,0xef = svc #16 0x00,0x00,0x00,0xef = svc #0 0xff,0xff,0xff,0xef = svc #16777215 0x92,0x10,0x03,0xe1 = swp r1, r2, [r3] 0x94,0x40,0x06,0xe1 = swp r4, r4, [r6] 0x91,0x50,0x49,0xe1 = swpb r5, r1, [r9] 0x74,0x20,0xa3,0xe6 = sxtab r2, r3, r4 0x76,0x40,0xa5,0xe6 = sxtab r4, r5, r6 0x79,0x64,0xa2,0xb6 = sxtablt r6, r2, r9, ror #8 0x74,0x58,0xa1,0xe6 = sxtab r5, r1, r4, ror #16 0x73,0x7c,0xa8,0xe6 = sxtab r7, r8, r3, ror #24 0x74,0x00,0x81,0xa6 = sxtab16ge r0, r1, r4 0x77,0x60,0x82,0xe6 = sxtab16 r6, r2, r7 0x78,0x34,0x85,0xe6 = sxtab16 r3, r5, r8, ror #8 0x71,0x38,0x82,0xe6 = sxtab16 r3, r2, r1, ror #16 0x73,0x1c,0x82,0x06 = sxtab16eq r1, r2, r3, ror #24 0x79,0x10,0xb3,0xe6 = sxtah r1, r3, r9 0x76,0x60,0xb1,0x86 = sxtahhi r6, r1, r6 0x73,0x34,0xb8,0xe6 = sxtah r3, r8, r3, ror #8 0x74,0x28,0xb2,0x36 = sxtahlo r2, r2, r4, ror #16 0x73,0x9c,0xb3,0xe6 = sxtah r9, r3, r3, ror #24 0x74,0x20,0xaf,0xa6 = sxtbge r2, r4 0x76,0x50,0xaf,0xe6 = sxtb r5, r6 0x79,0x64,0xaf,0xe6 = sxtb r6, r9, ror #8 0x71,0x58,0xaf,0x36 = sxtblo r5, r1, ror #16 0x73,0x8c,0xaf,0xe6 = sxtb r8, r3, ror #24 0x74,0x10,0x8f,0xe6 = sxtb16 r1, r4 0x77,0x60,0x8f,0xe6 = sxtb16 r6, r7 0x75,0x34,0x8f,0x26 = sxtb16hs r3, r5, ror #8 0x71,0x38,0x8f,0xe6 = sxtb16 r3, r1, ror #16 0x73,0x2c,0x8f,0xa6 = sxtb16ge r2, r3, ror #24 0x79,0x30,0xbf,0x16 = sxthne r3, r9 0x76,0x10,0xbf,0xe6 = sxth r1, r6 0x78,0x34,0xbf,0xe6 = sxth r3, r8, ror #8 0x72,0x28,0xbf,0xd6 = sxthle r2, r2, ror #16 0x73,0x9c,0xbf,0xe6 = sxth r9, r3, ror #24 0x0f,0x0a,0x35,0xe3 = teq r5, #61440 0x05,0x00,0x34,0xe1 = teq r4, r5 0x85,0x02,0x34,0xe1 = teq r4, r5, lsl #5 0xa5,0x02,0x34,0xe1 = teq r4, r5, lsr #5 0xa5,0x02,0x34,0xe1 = teq r4, r5, lsr #5 0xc5,0x02,0x34,0xe1 = teq r4, r5, asr #5 0xe5,0x02,0x34,0xe1 = teq r4, r5, ror #5 0x17,0x09,0x36,0xe1 = teq r6, r7, lsl r9 0x37,0x09,0x36,0xe1 = teq r6, r7, lsr r9 0x57,0x09,0x36,0xe1 = teq r6, r7, asr r9 0x77,0x09,0x36,0xe1 = teq r6, r7, ror r9 0x0f,0x0a,0x15,0xe3 = tst r5, #61440 0x05,0x00,0x14,0xe1 = tst r4, r5 0x85,0x02,0x14,0xe1 = tst r4, r5, lsl #5 0xa5,0x02,0x14,0xe1 = tst r4, r5, lsr #5 0xa5,0x02,0x14,0xe1 = tst r4, r5, lsr #5 0xc5,0x02,0x14,0xe1 = tst r4, r5, asr #5 0xe5,0x02,0x14,0xe1 = tst r4, r5, ror #5 0x17,0x09,0x16,0xe1 = tst r6, r7, lsl r9 0x37,0x09,0x16,0xe1 = tst r6, r7, lsr r9 0x57,0x09,0x16,0xe1 = tst r6, r7, asr r9 0x77,0x09,0x16,0xe1 = tst r6, r7, ror r9 0x13,0x1f,0x52,0xe6 = uadd16 r1, r2, r3 0x13,0x1f,0x52,0xc6 = uadd16gt r1, r2, r3 0x93,0x1f,0x52,0xe6 = uadd8 r1, r2, r3 0x93,0x1f,0x52,0xd6 = uadd8le r1, r2, r3 0x30,0x9f,0x5c,0xe6 = uasx r9, r12, r0 0x30,0x9f,0x5c,0x06 = uasxeq r9, r12, r0 0x55,0x48,0xe0,0xe7 = ubfx r4, r5, #16, #1 0x55,0x48,0xef,0xc7 = ubfxgt r4, r5, #16, #16 0x12,0x4f,0x78,0xe6 = uhadd16 r4, r8, r2 0x12,0x4f,0x78,0xc6 = uhadd16gt r4, r8, r2 0x92,0x4f,0x78,0xe6 = uhadd8 r4, r8, r2 0x92,0x4f,0x78,0xc6 = uhadd8gt r4, r8, r2 0x32,0x4f,0x78,0xe6 = uhasx r4, r8, r2 0x32,0x4f,0x78,0xc6 = uhasxgt r4, r8, r2 0x72,0x4f,0x78,0xe6 = uhsub16 r4, r8, r2 0x72,0x4f,0x78,0xc6 = uhsub16gt r4, r8, r2 0xf2,0x4f,0x78,0xe6 = uhsub8 r4, r8, r2 0xf2,0x4f,0x78,0xc6 = uhsub8gt r4, r8, r2 0x95,0x36,0x44,0xe0 = umaal r3, r4, r5, r6 0x95,0x36,0x44,0xb0 = umaallt r3, r4, r5, r6 0x96,0x28,0xa4,0xe0 = umlal r2, r4, r6, r8 0x92,0x66,0xa1,0xc0 = umlalgt r6, r1, r2, r6 0x92,0x23,0xb9,0xe0 = umlals r2, r9, r2, r3 0x91,0x32,0xb5,0x00 = umlalseq r3, r5, r1, r2 0x96,0x28,0x84,0xe0 = umull r2, r4, r6, r8 0x92,0x66,0x81,0xc0 = umullgt r6, r1, r2, r6 0x92,0x23,0x99,0xe0 = umulls r2, r9, r2, r3 0x91,0x32,0x95,0x00 = umullseq r3, r5, r1, r2 0x13,0x1f,0x62,0xe6 = uqadd16 r1, r2, r3 0x19,0x4f,0x67,0xc6 = uqadd16gt r4, r7, r9 0x98,0x3f,0x64,0xe6 = uqadd8 r3, r4, r8 0x92,0x8f,0x61,0xd6 = uqadd8le r8, r1, r2 0x31,0x2f,0x64,0xe6 = uqasx r2, r4, r1 0x39,0x5f,0x62,0x86 = uqasxhi r5, r2, r9 0x57,0x1f,0x63,0xe6 = uqsax r1, r3, r7 0x52,0x3f,0x66,0xe6 = uqsax r3, r6, r2 0x73,0x1f,0x65,0xe6 = uqsub16 r1, r5, r3 0x75,0x3f,0x62,0xc6 = uqsub16gt r3, r2, r5 0xf4,0x2f,0x61,0xe6 = uqsub8 r2, r1, r4 0xf9,0x4f,0x66,0xd6 = uqsub8le r4, r6, r9 0x11,0xf4,0x82,0xe7 = usad8 r2, r1, r4 0x16,0xf9,0x84,0xd7 = usad8le r4, r6, r9 0x15,0x73,0x81,0xe7 = usada8 r1, r5, r3, r7 0x12,0x15,0x83,0xc7 = usada8gt r3, r2, r5, r1 0x1a,0x80,0xe1,0xe6 = usat r8, #1, r10 0x1a,0x80,0xe4,0xe6 = usat r8, #4, r10 0x9a,0x8f,0xe5,0xe6 = usat r8, #5, r10, lsl #31 0x5a,0x80,0xff,0xe6 = usat r8, #31, r10, asr #32 0xda,0x80,0xf0,0xe6 = usat r8, #16, r10, asr #1 0x37,0x2f,0xe2,0xe6 = usat16 r2, #2, r7 0x35,0x3f,0xef,0xe6 = usat16 r3, #15, r5 0x54,0x2f,0x53,0xe6 = usax r2, r3, r4 0x54,0x2f,0x53,0x16 = usaxne r2, r3, r4 0x77,0x4f,0x52,0xe6 = usub16 r4, r2, r7 0x73,0x1f,0x51,0x86 = usub16hi r1, r1, r3 0xf5,0x1f,0x58,0xe6 = usub8 r1, r8, r5 0xf3,0x9f,0x52,0xd6 = usub8le r9, r2, r3 0x74,0x20,0xe3,0xe6 = uxtab r2, r3, r4 0x76,0x40,0xe5,0xe6 = uxtab r4, r5, r6 0x79,0x64,0xe2,0xb6 = uxtablt r6, r2, r9, ror #8 0x74,0x58,0xe1,0xe6 = uxtab r5, r1, r4, ror #16 0x73,0x7c,0xe8,0xe6 = uxtab r7, r8, r3, ror #24 0x74,0x00,0xc1,0xa6 = uxtab16ge r0, r1, r4 0x77,0x60,0xc2,0xe6 = uxtab16 r6, r2, r7 0x78,0x34,0xc5,0xe6 = uxtab16 r3, r5, r8, ror #8 0x71,0x38,0xc2,0xe6 = uxtab16 r3, r2, r1, ror #16 0x73,0x1c,0xc2,0x06 = uxtab16eq r1, r2, r3, ror #24 0x79,0x10,0xf3,0xe6 = uxtah r1, r3, r9 0x76,0x60,0xf1,0x86 = uxtahhi r6, r1, r6 0x73,0x34,0xf8,0xe6 = uxtah r3, r8, r3, ror #8 0x74,0x28,0xf2,0x36 = uxtahlo r2, r2, r4, ror #16 0x73,0x9c,0xf3,0xe6 = uxtah r9, r3, r3, ror #24 0x74,0x20,0xef,0xa6 = uxtbge r2, r4 0x76,0x50,0xef,0xe6 = uxtb r5, r6 0x79,0x64,0xef,0xe6 = uxtb r6, r9, ror #8 0x71,0x58,0xef,0x36 = uxtblo r5, r1, ror #16 0x73,0x8c,0xef,0xe6 = uxtb r8, r3, ror #24 0x74,0x10,0xcf,0xe6 = uxtb16 r1, r4 0x77,0x60,0xcf,0xe6 = uxtb16 r6, r7 0x75,0x34,0xcf,0x26 = uxtb16hs r3, r5, ror #8 0x71,0x38,0xcf,0xe6 = uxtb16 r3, r1, ror #16 0x73,0x2c,0xcf,0xa6 = uxtb16ge r2, r3, ror #24 0x79,0x30,0xff,0x16 = uxthne r3, r9 0x76,0x10,0xff,0xe6 = uxth r1, r6 0x78,0x34,0xff,0xe6 = uxth r3, r8, ror #8 0x72,0x28,0xff,0xd6 = uxthle r2, r2, ror #16 0x73,0x9c,0xff,0xe6 = uxth r9, r3, ror #24 0x02,0xf0,0x20,0xe3 = wfe 0x02,0xf0,0x20,0x83 = wfehi 0x03,0xf0,0x20,0xe3 = wfi 0x03,0xf0,0x20,0xb3 = wfilt 0x01,0xf0,0x20,0xe3 = yield 0x01,0xf0,0x20,0x13 = yieldne 0x04,0xf0,0x20,0xe3 = sev 0x03,0xf0,0x20,0xe3 = wfi 0x02,0xf0,0x20,0xe3 = wfe 0x01,0xf0,0x20,0xe3 = yield 0x00,0xf0,0x20,0xe3 = nop 0xef,0xf0,0x20,0xc3 = hintgt #239
{ "pile_set_name": "Github" }
//========= Copyright Valve Corporation, All rights reserved. ============// // // Purpose: // // $NoKeywords: $ // //=============================================================================// #ifndef IREPLAYSERVER_H #define IREPLAYSERVER_H #ifdef _WIN32 #pragma once #endif //----------------------------------------------------------------------------- #include "interface.h" //----------------------------------------------------------------------------- class IServer; class IReplayDirector; class IGameEvent; struct netadr_s; class CServerReplay; //----------------------------------------------------------------------------- // Interface the Replay module exposes to the engine //----------------------------------------------------------------------------- #define INTERFACEVERSION_REPLAYSERVER "ReplayServer001" class IReplayServer : public IBaseInterface { public: virtual ~IReplayServer() {} virtual IServer *GetBaseServer() = 0; // get Replay base server interface virtual IReplayDirector *GetDirector() = 0; // get director interface virtual int GetReplaySlot() = 0; // return entity index-1 of Replay in game virtual float GetOnlineTime() = 0; // seconds since broadcast started virtual void BroadcastEvent(IGameEvent *event) = 0; // send a director command to all specs virtual bool IsRecording() = 0; virtual void StartRecording() = 0; virtual void StopRecording() = 0; }; #endif
{ "pile_set_name": "Github" }
# /* ************************************************************************** # * * # * (C) Copyright Paul Mensonides 2002. # * Distributed under the Boost Software License, Version 1.0. (See # * accompanying file LICENSE_1_0.txt or copy at # * http://www.boost.org/LICENSE_1_0.txt) # * * # ************************************************************************** */ # # /* See http://www.boost.org for most recent version. */ # # include <boost/preprocessor/slot/detail/shared.hpp> # # undef BOOST_PP_ITERATION_FINISH_4 # # undef BOOST_PP_ITERATION_FINISH_4_DIGIT_1 # undef BOOST_PP_ITERATION_FINISH_4_DIGIT_2 # undef BOOST_PP_ITERATION_FINISH_4_DIGIT_3 # undef BOOST_PP_ITERATION_FINISH_4_DIGIT_4 # undef BOOST_PP_ITERATION_FINISH_4_DIGIT_5 # undef BOOST_PP_ITERATION_FINISH_4_DIGIT_6 # undef BOOST_PP_ITERATION_FINISH_4_DIGIT_7 # undef BOOST_PP_ITERATION_FINISH_4_DIGIT_8 # undef BOOST_PP_ITERATION_FINISH_4_DIGIT_9 # undef BOOST_PP_ITERATION_FINISH_4_DIGIT_10 # # if BOOST_PP_SLOT_TEMP_3 == 0 # define BOOST_PP_ITERATION_FINISH_4_DIGIT_3 0 # elif BOOST_PP_SLOT_TEMP_3 == 1 # define BOOST_PP_ITERATION_FINISH_4_DIGIT_3 1 # elif BOOST_PP_SLOT_TEMP_3 == 2 # define BOOST_PP_ITERATION_FINISH_4_DIGIT_3 2 # elif BOOST_PP_SLOT_TEMP_3 == 3 # define BOOST_PP_ITERATION_FINISH_4_DIGIT_3 3 # elif BOOST_PP_SLOT_TEMP_3 == 4 # define BOOST_PP_ITERATION_FINISH_4_DIGIT_3 4 # elif BOOST_PP_SLOT_TEMP_3 == 5 # define BOOST_PP_ITERATION_FINISH_4_DIGIT_3 5 # elif BOOST_PP_SLOT_TEMP_3 == 6 # define BOOST_PP_ITERATION_FINISH_4_DIGIT_3 6 # elif BOOST_PP_SLOT_TEMP_3 == 7 # define BOOST_PP_ITERATION_FINISH_4_DIGIT_3 7 # elif BOOST_PP_SLOT_TEMP_3 == 8 # define BOOST_PP_ITERATION_FINISH_4_DIGIT_3 8 # elif BOOST_PP_SLOT_TEMP_3 == 9 # define BOOST_PP_ITERATION_FINISH_4_DIGIT_3 9 # endif # # if BOOST_PP_SLOT_TEMP_2 == 0 # define BOOST_PP_ITERATION_FINISH_4_DIGIT_2 0 # elif BOOST_PP_SLOT_TEMP_2 == 1 # define BOOST_PP_ITERATION_FINISH_4_DIGIT_2 1 # elif BOOST_PP_SLOT_TEMP_2 == 2 # define BOOST_PP_ITERATION_FINISH_4_DIGIT_2 2 # elif BOOST_PP_SLOT_TEMP_2 == 3 # define BOOST_PP_ITERATION_FINISH_4_DIGIT_2 3 # elif BOOST_PP_SLOT_TEMP_2 == 4 # define BOOST_PP_ITERATION_FINISH_4_DIGIT_2 4 # elif BOOST_PP_SLOT_TEMP_2 == 5 # define BOOST_PP_ITERATION_FINISH_4_DIGIT_2 5 # elif BOOST_PP_SLOT_TEMP_2 == 6 # define BOOST_PP_ITERATION_FINISH_4_DIGIT_2 6 # elif BOOST_PP_SLOT_TEMP_2 == 7 # define BOOST_PP_ITERATION_FINISH_4_DIGIT_2 7 # elif BOOST_PP_SLOT_TEMP_2 == 8 # define BOOST_PP_ITERATION_FINISH_4_DIGIT_2 8 # elif BOOST_PP_SLOT_TEMP_2 == 9 # define BOOST_PP_ITERATION_FINISH_4_DIGIT_2 9 # endif # # if BOOST_PP_SLOT_TEMP_1 == 0 # define BOOST_PP_ITERATION_FINISH_4_DIGIT_1 0 # elif BOOST_PP_SLOT_TEMP_1 == 1 # define BOOST_PP_ITERATION_FINISH_4_DIGIT_1 1 # elif BOOST_PP_SLOT_TEMP_1 == 2 # define BOOST_PP_ITERATION_FINISH_4_DIGIT_1 2 # elif BOOST_PP_SLOT_TEMP_1 == 3 # define BOOST_PP_ITERATION_FINISH_4_DIGIT_1 3 # elif BOOST_PP_SLOT_TEMP_1 == 4 # define BOOST_PP_ITERATION_FINISH_4_DIGIT_1 4 # elif BOOST_PP_SLOT_TEMP_1 == 5 # define BOOST_PP_ITERATION_FINISH_4_DIGIT_1 5 # elif BOOST_PP_SLOT_TEMP_1 == 6 # define BOOST_PP_ITERATION_FINISH_4_DIGIT_1 6 # elif BOOST_PP_SLOT_TEMP_1 == 7 # define BOOST_PP_ITERATION_FINISH_4_DIGIT_1 7 # elif BOOST_PP_SLOT_TEMP_1 == 8 # define BOOST_PP_ITERATION_FINISH_4_DIGIT_1 8 # elif BOOST_PP_SLOT_TEMP_1 == 9 # define BOOST_PP_ITERATION_FINISH_4_DIGIT_1 9 # endif # # if BOOST_PP_ITERATION_FINISH_4_DIGIT_3 # define BOOST_PP_ITERATION_FINISH_4 BOOST_PP_SLOT_CC_3(BOOST_PP_ITERATION_FINISH_4_DIGIT_3, BOOST_PP_ITERATION_FINISH_4_DIGIT_2, BOOST_PP_ITERATION_FINISH_4_DIGIT_1) # elif BOOST_PP_ITERATION_FINISH_4_DIGIT_2 # define BOOST_PP_ITERATION_FINISH_4 BOOST_PP_SLOT_CC_2(BOOST_PP_ITERATION_FINISH_4_DIGIT_2, BOOST_PP_ITERATION_FINISH_4_DIGIT_1) # else # define BOOST_PP_ITERATION_FINISH_4 BOOST_PP_ITERATION_FINISH_4_DIGIT_1 # endif
{ "pile_set_name": "Github" }
// flow-typed signature: 5ae61140984b5030b763a0f1d10ce2bf // flow-typed version: <<STUB>>/@types/react-router-dom_v^4.2.3/flow_v0.64.0 /** * This is an autogenerated libdef stub for: * * '@types/react-router-dom' * * Fill this stub out by replacing all the `any` types. * * Once filled out, we encourage you to share your work with the * community by sending a pull request to: * https://github.com/flowtype/flow-typed */ declare module '@types/react-router-dom' { declare module.exports: any; }
{ "pile_set_name": "Github" }
$(function () { $('[data-toggle="popover"]').popover({trigger: 'manual'}); }); Pressure.set('.device-circle', { change: function(force){ console.log(force); this.style.width = Pressure.map(force, 0, 1, 10, $(this).data('size')) + 'em'; this.style.height = Pressure.map(force, 0, 1, 10, $(this).data('size')) + 'em'; this.style.marginTop = '-' + Pressure.map(force, 0, 1, 10, $(this).data('size'))/2 + 'em'; this.style.marginLeft = '-' + Pressure.map(force, 0, 1, 10, $(this).data('size'))/2 + 'em'; }, startDeepPress: function(){ this.style.backgroundColor = '#5bc0de'; }, endDeepPress: function(){ this.style.backgroundColor = '#d9534f'; }, end: function(){ this.style.width = '10em'; this.style.height = '10em'; this.style.marginTop = '-5em'; this.style.marginLeft = '-5em'; } }, {polyfillSpeedDown: 250}); Pressure.set('.device-circle', { change: function(){ $('.pressure-failed').hide(); }, unsupported: function(){ $('.pressure-failed').show(); } }, {polyfill: false}); var block = { change: function(force, event){ this.style.width = ((200 * force) + 200) + 'px'; this.innerHTML = force; this.style.backgroundColor = "rgb(" + parseInt(Pressure.map(force, 0, 1, 255, 0)) + ",100," + parseInt(Pressure.map(force, 0, 1, 0, 255)) +")"; this.style.color = force > 0.3 ? 'white' : 'black'; }, end: function(){ this.style.width = '200px'; this.innerHTML = 0; this.style.backgroundColor = 'rgb(255,100,0)'; this.style.color = 'black'; }, unsupported: function(){ this.innerHTML = 'Sorry! Check the devices and browsers that Pressure works on above ^^^^'; } } Pressure.set('#el1', block); Pressure.set('#el2', block, {only: 'mouse'}); Pressure.set('#el3', block, {only: 'touch'}); Pressure.set('#el4', block, {only: 'pointer'}); Pressure.set('#pressure-test', { start: function(){ this.innerHTML = 'Pressure is Supported!'; }, unsupported: function(){ this.innerHTML = 'Pressure is NOT Supported!'; } }); Pressure.set('#peanuts', { change: function(force, event){ this.style.webkitFilter = 'blur(' + Pressure.map(force, 0, 0.7, 20, 0) + 'px)'; }, end: function(){ this.style.webkitFilter = 'blur(20px)'; }, unsupported: function(){ this.innerHTML = 'Your device / browser does not support this :('; } }); var saveForce = 0; Pressure.set('#text-sizer', { change: function(force){ if(force > saveForce){ this.style.fontSize = Pressure.map(force, 0, 1, 16, 30); saveForce = force; } }, end: function(){ saveForce = 0; } }); Pressure.set('#cube-btn', { change: function(force){ document.getElementById('spinning-cube').style.webkitTransform = 'rotateZ(' + Pressure.map(force, 0, 1, 0, 360) + 'deg)'; }, end: function(){ document.getElementById('spinning-cube').style.webkitTransform = 'rotateZ(0deg)'; } }); Pressure.set('#popover', { startDeepPress: function(force){ $(this).popover('show'); }, endDeepPress: function(){ $(this).popover('hide'); } }); // docs Pressure.set('#output-element', { change: function(force, event){ this.innerHTML = force; } }, {polyfill: false}); Pressure.set('#element-touch', { change: function(force, event){ this.innerHTML = force + 'on an iphone'; } }, {only: 'touch', polyfill: false}); Pressure.set('#element-mouse', { change: function(force, event){ this.innerHTML = force + 'on a Mac'; } }, {only: 'mouse', polyfill: false}); Pressure.set('#element-pointer', { change: function(force, event){ this.innerHTML = force + 'on a pointer device'; } }, {only: 'pointer', polyfill: false}); Pressure.set('#element-touch-prevent', {}, {only: 'touch', preventDefault: false}); Pressure.set('#element-mouse-prevent', {}, {only: 'mouse', preventDefault: false}); Pressure.set('#polyfill-example', { change: function(force, event){ this.innerHTML = force; }, end: function(){ this.innerHTML = 0; }, unsupported: function(){ alert("Oh no, this device does not support pressure.") } }); Pressure.set('#polyfill-speed-up', { change: function(force, event){ this.innerHTML = force; }, end: function(){ this.innerHTML = 0; } }, {polyfillSpeedUp: 5000}); Pressure.set('#polyfill-speed-down', { change: function(force, event){ this.innerHTML = force; }, end: function(){ this.innerHTML = 0; } }, {polyfillSpeedDown: 2000}); // Twitter BTN window.twttr = (function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0], t = window.twttr || {}; if (d.getElementById(id)) return t; js = d.createElement(s); js.id = id; js.src = "https://platform.twitter.com/widgets.js"; fjs.parentNode.insertBefore(js, fjs); t._e = []; t.ready = function(f) { t._e.push(f); }; return t; }(document, "script", "twitter-wjs")); // Google Analytics (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-72492481-1', 'auto'); ga('send', 'pageview');
{ "pile_set_name": "Github" }
module Main where main = do x1 <- readFile "test2.sorted" let x2 = lines x1 x3 = zip [1 ..] x2 x4 = concat (map qq x3) --putStr x4 writeFile "test2.orig" x4 qq :: (Int, String) -> String qq (n, s0) = let ws = words s0 bytes = head ws rest = unwords (tail ws) bytes2 = foo bytes in unlines [ "", rest, ". " ++ show n ++ " 0x12345678 " ++ show (1 + (length bytes `div` 2)), ". " ++ bytes2 ++ "C3" ] foo [] = [] foo (x:y:rest) = x:y:' ':foo rest
{ "pile_set_name": "Github" }
# Disallow Use of caller/callee (no-caller) The use of `arguments.caller` and `arguments.callee` make several code optimizations impossible. They have been deprecated in future versions of JavaScript and their use is forbidden in ECMAScript 5 while in strict mode. ```js function foo() { var callee = arguments.callee; } ``` ## Rule Details This rule is aimed at discouraging the use of deprecated and sub-optimal code by disallowing the use of `arguments.caller` and `arguments.callee`. As such, it will warn when `arguments.caller` and `arguments.callee` are used. Examples of **incorrect** code for this rule: ```js /*eslint no-caller: "error"*/ function foo(n) { if (n <= 0) { return; } arguments.callee(n - 1); } [1,2,3,4,5].map(function(n) { return !(n > 1) ? 1 : arguments.callee(n - 1) * n; }); ``` Examples of **correct** code for this rule: ```js /*eslint no-caller: "error"*/ function foo(n) { if (n <= 0) { return; } foo(n - 1); } [1,2,3,4,5].map(function factorial(n) { return !(n > 1) ? 1 : factorial(n - 1) * n; }); ```
{ "pile_set_name": "Github" }
from argschema import ArgSchema, ArgSchemaParser from argschema.schemas import DefaultSchema from argschema.fields import Nested, InputDir, String, Float, Dict, Int known_conditions = { "0": { "duration": 1.0, "name": "fast_pulses", "condition": "2.5 ms pulses at 10 Hz" }, "1": { "duration": 0.005, "name": "pulse", "condition": "a single square pulse" }, "2": { "duration": 0.01, "name": "pulse", "condition": "a single square pulse" }, "3": { "duration": 1.0, "name": "raised_cosine", "condition": "half-period of a cosine wave" } } class Condition(DefaultSchema): duration = Float(required=True) name = String(required=True) condition = String(required=True) class InputParameters(ArgSchema): opto_pickle_path = String(required=True, help='path to file containing optotagging information') sync_h5_path = String(required=True, help='path to h5 file containing syncronization information') output_opto_table_path = String(required=True, help='the optotagging stimulation table will be written here') conditions = Dict(String, Nested(Condition), default=known_conditions) class OutputSchema(DefaultSchema): input_parameters = Nested(InputParameters, description=('Input parameters the module was run with'), required=True) class OutputParameters(OutputSchema): output_opto_table_path = String(required=True, help='path to optotagging stimulation table')
{ "pile_set_name": "Github" }
<!-- Copyright 2020 The OpenTracing Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>io.opentracing.contrib.specialagent.test</groupId> <artifactId>test</artifactId> <version>1.7.5-SNAPSHOT</version> </parent> <groupId>io.opentracing.contrib.specialagent.test.twilio</groupId> <artifactId>twilio</artifactId> <packaging>pom</packaging> <name>SpecialAgent Tests for Twilio</name> <modules> <module>twilio-0.0.1</module> <module>twilio-7.47.2</module> </modules> </project>
{ "pile_set_name": "Github" }
<system> <name>KOI-0845</name> <rightascension>19 14 02</rightascension> <declination>+41 18 06</declination> <distance>1389.28</distance> <star> <magJ errorminus="0.03" errorplus="0.03">14.26</magJ> <magH errorminus="0.04" errorplus="0.04">13.87</magH> <magK errorminus="0.05" errorplus="0.05">13.80</magK> <name>KOI-0845</name> <temperature errorminus="114.00" errorplus="114.00">5846.00</temperature> <radius errorminus="0.4000" errorplus="0.4000">0.9800</radius> <mass errorminus="0.0850" errorplus="0.0850">0.9570</mass> <age errorminus="3.1000" errorplus="3.1000">5.4000</age> <planet> <name>KOI-0845 b</name> <name>KOI-0845 01</name> <radius errorminus="0.12758" errorplus="0.12758">0.31896</radius> <period errorminus="1.1000000e-04" errorplus="1.1000000e-04">16.329860000000</period> <transittime errorminus="0.0024000" errorplus="0.0024000">2455010.2907000</transittime> <semimajoraxis>0.1240000</semimajoraxis> <temperature>725.0</temperature> <list>Kepler Objects of Interest</list> <description>This is a Kepler Object of Interest from the Q1-Q12 dataset. It has been flagged as a possible transit event but has not been confirmed to be a planet yet.</description> <istransiting>1</istransiting> </planet> </star> </system>
{ "pile_set_name": "Github" }
{ "parent": "botania:block/chiseled_livingrock_bricks" }
{ "pile_set_name": "Github" }
2 4 5 8 10 12 15 18 20 24 28 28 35
{ "pile_set_name": "Github" }
-480.507214 -2683.730823 1268.836186 -306480.177291 -499.578500 1159.506706 2664.941803 -1214196.736115 -0.992413 -0.088895 0.084939 598.230009
{ "pile_set_name": "Github" }
<?vsp http_header ('Content-Type: application/xrds+xml; charset=UTF-8\r\n'); OPENID..yadis ({?'uname'}, {?'type'}); ?>
{ "pile_set_name": "Github" }
tensortrade.feed.api.string package =================================== .. automodule:: tensortrade.feed.api.string :members: :undoc-members: :show-inheritance: Submodules ---------- .. toctree:: :maxdepth: 6 tensortrade.feed.api.string.operations
{ "pile_set_name": "Github" }
{ "extends": "../tsconfig.json", "compilerOptions": { "outDir": "../out-tsc/e2e", "baseUrl": "./", "module": "commonjs", "target": "es5", "types": [ "jasmine", "jasminewd2", "node" ] } }
{ "pile_set_name": "Github" }
#if ENGLISH #if REVISION >= 1 static const u8 sFont3Widths[] = { 3, 6, 6, 6, 6, 6, 6, 6, 6, 6, 8, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 8, 6, 6, 6, 6, 6, 4, 8, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 8, 6, 6, 8, 8, 8, 8, 8, 8, 8, 3, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 6, 4, 8, 8, 8, 7, 8, 8, 4, 6, 6, 4, 4, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 6, 7, 8, 7, 7, 8, 8, 4, 7, 8, 8, 8, 8, 8, 7, 8, 7, 7, 7, 7, 7, 7, 8, 7, 7, 7, 7, 7, 5, 6, 6, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 3, 6, 3, 5, 3, 6, 6, 6, 3, 3, 6, 6, 6, 3, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 4, 5, 6, 3, 6, 6, 6, 6, 6, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7, 3, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 1, 1, }; #else static const u8 sFont3Widths[] = { 3, 6, 6, 6, 6, 6, 6, 6, 6, 6, 8, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 8, 6, 6, 6, 6, 6, 4, 8, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 6, 4, 8, 8, 8, 7, 8, 8, 4, 6, 6, 4, 4, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 6, 7, 8, 7, 7, 8, 8, 4, 7, 8, 8, 8, 8, 8, 7, 8, 7, 7, 7, 7, 7, 7, 8, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 3, 6, 3, 5, 3, 6, 6, 6, 3, 3, 6, 6, 6, 3, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 4, 5, 6, 3, 6, 6, 6, 6, 6, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7, 3, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 1, 1, }; #endif #elif GERMAN static const u8 sFont3Widths[] = { 3, 6, 6, 6, 6, 6, 6, 6, 6, 6, 8, 6, 6, 6, 6, 6, 8, 6, 6, 6, 6, 6, 6, 6, 8, 6, 6, 6, 6, 6, 4, 8, 6, 6, 6, 6, 6, 8, 6, 6, 6, 6, 6, 6, 8, 6, 6, 8, 8, 8, 8, 8, 8, 8, 3, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 6, 4, 8, 8, 8, 7, 8, 8, 4, 6, 6, 4, 4, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 6, 7, 8, 7, 7, 8, 8, 4, 7, 8, 8, 8, 8, 8, 7, 8, 7, 7, 7, 7, 7, 7, 8, 7, 7, 7, 7, 7, 5, 6, 6, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 3, 6, 3, 5, 3, 6, 6, 6, 3, 3, 6, 6, 6, 3, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 4, 5, 6, 3, 6, 6, 6, 6, 6, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7, 3, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 1, 1, }; #endif
{ "pile_set_name": "Github" }
/** * Author: Íõ¿¡³¬ * Date: 2015-06-23 * Time: 07:17 * Declaration: All Rights Reserved !!! */ public class ListNode { int val; ListNode next; ListNode(int x) { val = x; } }
{ "pile_set_name": "Github" }
/************************************************************* * * MathJax/jax/output/HTML-CSS/fonts/STIX-Web/SansSerif/BoldItalic/Main.js * * Copyright (c) 2013-2015 The MathJax Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ MathJax.OutputJax['HTML-CSS'].FONTDATA.FONTS['STIXMathJax_SansSerif-bold-italic'] = { directory: 'SansSerif/BoldItalic', family: 'STIXMathJax_SansSerif', weight: 'bold', style: 'italic', testString: '\u00A0\uE1F6\uE1F7\uE1F8\uE1F9\uE1FA\uE1FB\uE1FC\uE1FD\uE1FE\uE1FF\uD835\uDE3C\uD835\uDE3D\uD835\uDE3E\uD835\uDE3F', 0x20: [0,0,250,0,0], 0xA0: [0,0,250,0,0], 0xE1F6: [688,13,500,89,578], 0xE1F7: [688,0,500,204,505], 0xE1F8: [688,0,500,20,581], 0xE1F9: [688,13,500,32,586], 0xE1FA: [688,0,500,55,583], 0xE1FB: [676,13,500,27,651], 0xE1FC: [688,13,500,80,638], 0xE1FD: [676,0,500,120,639], 0xE1FE: [688,13,500,63,594], 0xE1FF: [688,13,500,28,588], 0x1D63C: [690,0,690,25,665], 0x1D63D: [676,0,636,80,691], 0x1D63E: [691,19,723,119,797], 0x1D63F: [676,0,709,80,772], 0x1D640: [676,0,635,80,728], 0x1D641: [676,0,582,80,725], 0x1D642: [691,19,746,107,785], 0x1D643: [676,0,715,80,803], 0x1D644: [676,0,440,79,534], 0x1D645: [676,96,481,15,574], 0x1D646: [676,0,712,80,816], 0x1D647: [676,0,603,80,612], 0x1D648: [676,0,913,80,1001], 0x1D649: [676,18,724,80,812], 0x1D64A: [692,18,778,106,840], 0x1D64B: [676,0,581,80,695], 0x1D64C: [691,176,779,105,839], 0x1D64D: [676,0,670,80,698], 0x1D64E: [691,19,554,66,637], 0x1D64F: [676,0,641,157,785], 0x1D650: [676,19,699,123,792], 0x1D651: [676,18,690,193,833], 0x1D652: [676,15,997,198,1135], 0x1D653: [676,0,740,40,853], 0x1D654: [676,0,694,188,842], 0x1D655: [676,0,653,25,769], 0x1D656: [473,14,489,48,507], 0x1D657: [676,13,512,51,558], 0x1D658: [473,14,462,71,524], 0x1D659: [676,14,518,69,625], 0x1D65A: [473,13,452,71,492], 0x1D65B: [692,0,340,72,533], 0x1D65C: [473,206,504,2,599], 0x1D65D: [676,0,510,55,542], 0x1D65E: [688,0,245,59,366], 0x1D65F: [688,202,324,-90,440], 0x1D660: [676,0,519,55,599], 0x1D661: [676,0,235,55,348], 0x1D662: [473,0,776,55,809], 0x1D663: [473,0,510,55,542], 0x1D664: [473,14,501,72,542], 0x1D665: [473,205,512,3,559], 0x1D666: [473,205,512,69,574], 0x1D667: [473,0,411,55,519], 0x1D668: [473,13,385,37,442], 0x1D669: [631,12,386,98,447], 0x1D66A: [462,15,518,81,569], 0x1D66B: [462,14,462,129,561], 0x1D66C: [462,14,701,131,798], 0x1D66D: [462,0,506,20,582], 0x1D66E: [462,204,472,-27,569], 0x1D66F: [462,0,441,21,530], 0x1D790: [690,0,690,25,665], 0x1D791: [676,0,706,60,671], 0x1D792: [676,0,602,60,705], 0x1D793: [690,0,720,40,680], 0x1D794: [676,0,683,60,708], 0x1D795: [676,0,707,25,769], 0x1D796: [676,0,748,60,783], 0x1D797: [691,19,847,90,822], 0x1D798: [676,0,435,50,505], 0x1D799: [676,0,712,60,796], 0x1D79A: [690,0,686,20,646], 0x1D79B: [676,0,933,60,981], 0x1D79C: [676,18,744,60,792], 0x1D79D: [676,0,690,47,737], 0x1D79E: [692,18,849,90,824], 0x1D79F: [676,0,745,60,783], 0x1D7A0: [676,0,581,60,675], 0x1D7A1: [691,19,847,90,822], 0x1D7A2: [676,0,696,21,748], 0x1D7A3: [676,0,641,87,715], 0x1D7A4: [691,0,671,91,799], 0x1D7A5: [676,0,835,72,835], 0x1D7A6: [676,0,740,20,833], 0x1D7A7: [691,0,791,125,901], 0x1D7A8: [691,0,816,47,816], 0x1D7A9: [664,30,780,120,760], 0x1D7AA: [473,14,678,47,703], 0x1D7AB: [692,205,552,-12,581], 0x1D7AC: [473,204,525,84,571], 0x1D7AD: [692,14,507,30,547], 0x1D7AE: [473,14,504,45,508], 0x1D7AF: [692,205,480,49,539], 0x1D7B0: [473,205,532,38,525], 0x1D7B1: [692,14,560,65,553], 0x1D7B2: [462,14,325,56,302], 0x1D7B3: [473,0,537,38,582], 0x1D7B4: [692,14,574,18,540], 0x1D7B5: [462,205,594,-12,569], 0x1D7B6: [473,14,525,41,565], 0x1D7B7: [692,205,481,43,525], 0x1D7B8: [473,14,543,45,515], 0x1D7B9: [462,14,632,45,656], 0x1D7BA: [473,205,560,-33,536], 0x1D7BB: [473,205,517,52,554], 0x1D7BC: [462,14,614,45,639], 0x1D7BD: [462,14,523,42,547], 0x1D7BE: [473,14,550,61,526], 0x1D7BF: [473,205,683,55,659], 0x1D7C0: [473,205,575,-80,626], 0x1D7C1: [473,205,703,75,751], 0x1D7C2: [461,14,756,64,732], 0x1D7C3: [691,14,548,45,539], 0x1D7C4: [473,14,468,45,470], 0x1D7C5: [692,14,579,54,579], 0x1D7C6: [473,10,646,-10,665], 0x1D7C7: [692,205,678,48,654], 0x1D7C8: [473,205,544,38,520], 0x1D7C9: [462,14,889,40,912] }; MathJax.Callback.Queue( ["initFont",MathJax.OutputJax["HTML-CSS"],"STIXMathJax_SansSerif-bold-italic"], ["loadComplete",MathJax.Ajax,MathJax.OutputJax["HTML-CSS"].fontDir+"/SansSerif/BoldItalic/Main.js"] );
{ "pile_set_name": "Github" }
/* ScummVM - Graphic Adventure Engine * * ScummVM is the legal property of its developers, whose names * are too numerous to list here. Please refer to the COPYRIGHT * file distributed with this source distribution. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * */ #include "common/endian.h" #include "gob/gob.h" #include "gob/goblin.h" #include "gob/global.h" #include "gob/util.h" #include "gob/game.h" #include "gob/map.h" #include "gob/mult.h" #include "gob/scenery.h" #include "gob/inter.h" namespace Gob { Goblin_v2::Goblin_v2(GobEngine *vm) : Goblin_v1(vm) { _gobsCount = -1; _rotStates[0][0] = 0; _rotStates[0][1] = 18; _rotStates[0][2] = 19; _rotStates[0][3] = 20; _rotStates[1][0] = 13; _rotStates[1][1] = 2; _rotStates[1][2] = 12; _rotStates[1][3] = 14; _rotStates[2][0] = 16; _rotStates[2][1] = 15; _rotStates[2][2] = 4; _rotStates[2][3] = 17; _rotStates[3][0] = 23; _rotStates[3][1] = 21; _rotStates[3][2] = 22; _rotStates[3][3] = 6; } void Goblin_v2::freeObjects() { _vm->_map->_mapUnknownBool = false; if (_gobsCount < 0) return; for (int i = 0; i < _gobsCount; i++) { delete[] _vm->_mult->_objects[i].goblinStates[0]; delete[] _vm->_mult->_objects[i].goblinStates; } for (int i = 0; i < _soundSlotsCount; i++) if ((_soundSlots[i] & 0x8000) == 0) _vm->_game->freeSoundSlot(_soundSlots[i]); _gobsCount = -1; } void Goblin_v2::placeObject(Gob_Object *objDesc, char animated, int16 index, int16 x, int16 y, int16 state) { Mult::Mult_Object *obj; Mult::Mult_AnimData *objAnim; int16 layer; int16 animation; obj = &_vm->_mult->_objects[index]; objAnim = obj->pAnimData; obj->goblinX = x; obj->goblinY = y; objAnim->order = y; if (state == -1) { objAnim->frame = 0; objAnim->isPaused = 0; objAnim->isStatic = 0; objAnim->newCycle = 0; _vm->_scenery->updateAnim(objAnim->layer, 0, objAnim->animation, 0, *obj->pPosX, *obj->pPosY, 0); if (!_vm->_map->hasBigTiles()) *obj->pPosY = (y + 1) * _vm->_map->getTilesHeight() - (_vm->_scenery->_animBottom - _vm->_scenery->_animTop); else *obj->pPosY = ((y + 1) * _vm->_map->getTilesHeight()) - (_vm->_scenery->_animBottom - _vm->_scenery->_animTop) - (y + 1) / 2; *obj->pPosX = x * _vm->_map->getTilesWidth(); } else { if ((obj->goblinStates != 0) && (obj->goblinStates[state] != 0)) { layer = obj->goblinStates[state][0].layer; animation = obj->goblinStates[state][0].animation; objAnim->state = state; objAnim->layer = layer; objAnim->animation = animation; objAnim->frame = 0; objAnim->isPaused = 0; objAnim->isStatic = 0; objAnim->newCycle = _vm->_scenery->getAnimLayer(animation, layer)->framesCount; _vm->_scenery->updateAnim(layer, 0, animation, 0, *obj->pPosX, *obj->pPosY, 0); if (!_vm->_map->hasBigTiles()) *obj->pPosY = (y + 1) * _vm->_map->getTilesHeight() - (_vm->_scenery->_animBottom - _vm->_scenery->_animTop); else *obj->pPosY = ((y + 1) * _vm->_map->getTilesHeight()) - (_vm->_scenery->_animBottom - _vm->_scenery->_animTop) - (y + 1) / 2; *obj->pPosX = x * _vm->_map->getTilesWidth(); initiateMove(obj); } else initiateMove(obj); } } void Goblin_v2::initiateMove(Mult::Mult_Object *obj) { obj->destX = obj->gobDestX; obj->destY = obj->gobDestY; _vm->_map->findNearestToDest(obj); _vm->_map->findNearestToGob(obj); _vm->_map->optimizePoints(obj, obj->goblinX, obj->goblinY); obj->pAnimData->pathExistence = _vm->_map->checkDirectPath(obj, obj->goblinX, obj->goblinY, obj->gobDestX, obj->gobDestY); if (obj->pAnimData->pathExistence == 3) { const WayPoint &wayPoint = _vm->_map->getWayPoint(obj->nearestWayPoint); obj->destX = wayPoint.x; obj->destY = wayPoint.y; } } void Goblin_v2::movePathFind(Mult::Mult_Object *obj, Gob_Object *gobDesc, int16 nextAct) { Mult::Mult_AnimData *animData = obj->pAnimData; animData->newCycle = _vm->_scenery->getAnimLayer(animData->animation, animData->layer)->framesCount; int16 gobX = obj->goblinX; int16 gobY = obj->goblinY; int16 destX = obj->destX; int16 destY = obj->destY; int16 gobDestX = obj->gobDestX; int16 gobDestY = obj->gobDestY; animData->destX = gobDestX; animData->destY = gobDestY; animData->order = gobY; Direction dir = kDirNone; if (animData->pathExistence == 1) { dir = _vm->_map->getDirection(gobX, gobY, destX, destY); if (dir == kDirNone) animData->pathExistence = 0; if ((gobX == gobDestX) && (gobY == gobDestY)) animData->pathExistence = 4; } else if (animData->pathExistence == 3) { if ((gobX != gobDestX) || (gobY != gobDestY)) { if (_vm->_map->checkDirectPath(obj, gobX, gobY, gobDestX, gobDestY) != 1) { if ((gobX == destX) && (gobY == destY)) { if (obj->nearestWayPoint > obj->nearestDest) { _vm->_map->optimizePoints(obj, gobX, gobY); const WayPoint &wayPoint = _vm->_map->getWayPoint(obj->nearestWayPoint); destX = wayPoint.x; destY = wayPoint.y; if (_vm->_map->checkDirectPath(obj, gobX, gobY, destX, destY) == 3) { WRITE_VAR(56, 1); animData->pathExistence = 0; } if (obj->nearestWayPoint > obj->nearestDest) obj->nearestWayPoint--; } else if (obj->nearestWayPoint < obj->nearestDest) { _vm->_map->optimizePoints(obj, gobX, gobY); const WayPoint &wayPoint = _vm->_map->getWayPoint(obj->nearestWayPoint); destX = wayPoint.x; destY = wayPoint.y; if (_vm->_map->checkDirectPath(obj, gobX, gobY, destX, destY) == 3) { WRITE_VAR(56, 1); animData->pathExistence = 0; } if (obj->nearestWayPoint < obj->nearestDest) obj->nearestWayPoint++; } else { if ((_vm->_map->checkDirectPath(obj, gobX, gobY, gobDestX, gobDestY) == 3) && (_vm->_map->getPass(gobDestX, gobDestY) != 0)) { const WayPoint &wayPoint = _vm->_map->getWayPoint(obj->nearestWayPoint); destX = wayPoint.x; destY = wayPoint.y; WRITE_VAR(56, 1); } else { animData->pathExistence = 1; destX = gobDestX; destY = gobDestY; } } } } else { destX = gobDestX; destY = gobDestY; } dir = _vm->_map->getDirection(gobX, gobY, destX, destY); } else { animData->pathExistence = 4; destX = gobDestX; destY = gobDestY; } } obj->goblinX = gobX; obj->goblinY = gobY; obj->destX = destX; obj->destY = destY; obj->gobDestX = gobDestX; obj->gobDestY = gobDestY; switch (dir) { case kDirNW: animData->nextState = 1; if (_vm->_map->getScreenWidth() == 640) { if (_vm->_map->getPass(obj->goblinX, obj->goblinY) == 10) animData->nextState = 40; if (_vm->_map->getPass(obj->goblinX - 1, obj->goblinY - 2) != 10) animData->nextState = 1; } break; case kDirN: animData->nextState = (animData->curLookDir == 2) ? 2 : rotateState(animData->curLookDir, 2); if (_vm->_map->getScreenWidth() == 640) { if (_vm->_map->getPass(obj->goblinX, obj->goblinY) == 10) { if (_vm->_map->getPass(obj->goblinX - 1, obj->goblinY - 2) == 10) animData->nextState = 40; else if (_vm->_map->getPass(obj->goblinX + 1, obj->goblinY - 2) == 10) animData->nextState = 42; else animData->nextState = 2; } if (_vm->_map->getPass(obj->goblinX, obj->goblinY) == 20) animData->nextState = 38; if (_vm->_map->getPass(obj->goblinX, obj->goblinY) == 19) animData->nextState = 26; } break; case kDirNE: animData->nextState = 3; if (_vm->_map->getScreenWidth() == 640) { if (_vm->_map->getPass(obj->goblinX, obj->goblinY) == 10) animData->nextState = 42; if (_vm->_map->getPass(obj->goblinX + 1, obj->goblinY - 2) != 10) animData->nextState = 3; } break; case kDirW: animData->nextState = rotateState(animData->curLookDir, 0); break; case kDirE: animData->nextState = rotateState(animData->curLookDir, 4); break; case kDirSW: animData->nextState = 7; if (_vm->_map->getScreenWidth() == 640) { if (_vm->_map->getPass(obj->goblinX, obj->goblinY) == 10) animData->nextState = 41; if (_vm->_map->getPass(obj->goblinX - 1, obj->goblinY + 2) != 10) animData->nextState = 7; } break; case kDirS: animData->nextState = (animData->curLookDir == 6) ? 6 : rotateState(animData->curLookDir, 6); if (_vm->_map->getScreenWidth() == 640) { if (_vm->_map->getPass(obj->goblinX, obj->goblinY) == 20) animData->nextState = 39; if (_vm->_map->getPass(obj->goblinX, obj->goblinY) == 19) animData->nextState = 27; } break; case kDirSE: animData->nextState = 5; if (_vm->_map->getScreenWidth() == 640) { if (_vm->_map->getPass(obj->goblinX, obj->goblinY) == 10) animData->nextState = 43; if (_vm->_map->getPass(obj->goblinX + 1, obj->goblinY + 2) != 10) animData->nextState = 5; } break; default: if (animData->curLookDir == 0) animData->nextState = 8; else if (animData->curLookDir == 2) animData->nextState = 29; else if (animData->curLookDir == 4) animData->nextState = 9; else if (animData->curLookDir == 6) animData->nextState = 28; break; } } void Goblin_v2::moveAdvance(Mult::Mult_Object *obj, Gob_Object *gobDesc, int16 nextAct, int16 framesCount) { if (!obj->goblinStates) return; movePathFind(obj, 0, 0); playSounds(obj); Mult::Mult_AnimData *animData = obj->pAnimData; framesCount = _vm->_scenery->getAnimLayer(animData->animation, animData->layer)->framesCount; if (animData->isPaused == 0) animData->frame++; switch (animData->stateType) { case 0: case 1: animData->isPaused = 0; break; case 4: if (animData->frame == 0) animData->isPaused = 1; break; case 6: if (animData->frame >= framesCount) animData->isPaused = 1; break; default: break; } switch (animData->state) { case 0: case 1: case 7: case 13: case 16: case 23: case 40: case 41: animData->curLookDir = 0; break; case 2: case 15: case 18: case 21: case 26: case 38: animData->curLookDir = 2; break; case 3: case 4: case 5: case 12: case 19: case 22: case 42: case 43: animData->curLookDir = 4; break; case 6: case 14: case 17: case 20: case 27: case 39: animData->curLookDir = 6; break; case 8: case 9: case 28: case 29: if (animData->pathExistence == 4) animData->pathExistence = 5; break; default: break; } if ((animData->newState != -1) && (animData->frame == framesCount) && (animData->newState != animData->state)) { animData->nextState = animData->newState; animData->newState = -1; animData->state = animData->nextState; Scenery::AnimLayer *animLayer = _vm->_scenery->getAnimLayer(animData->animation, animData->layer); *obj->pPosX += animLayer->animDeltaX; *obj->pPosY += animLayer->animDeltaY; int16 animation = obj->goblinStates[animData->nextState][0].animation; int16 layer = obj->goblinStates[animData->nextState][0].layer; animData->layer = layer; animData->animation = animation; animData->frame = 0; return; } if (isMovement(animData->state)) { int16 state = animData->nextState; if (animData->frame == ((framesCount + 1) / 2)) { int16 gobX = obj->goblinX; int16 gobY = obj->goblinY + 1; advMovement(obj, state); if (animData->state != state) { int16 animation = obj->goblinStates[state][0].animation; int16 layer = obj->goblinStates[state][0].layer; animData->layer = layer; animData->animation = animation; animData->frame = 0; animData->state = state; _vm->_scenery->updateAnim(layer, 0, animation, 0, *obj->pPosX, *obj->pPosY, 0); uint32 gobPosX = gobX * _vm->_map->getTilesWidth(); uint32 gobPosY = (gobY * _vm->_map->getTilesHeight()) - (_vm->_scenery->_animBottom - _vm->_scenery->_animTop); if (_vm->_map->hasBigTiles()) gobPosY -= gobY / 2; *obj->pPosX = gobPosX; *obj->pPosY = gobPosY; } } } if (animData->frame < framesCount) return; int16 state = animData->nextState; int16 animation = obj->goblinStates[state][0].animation; int16 layer = obj->goblinStates[state][0].layer; animData->layer = layer; animData->animation = animation; animData->frame = 0; animData->state = state; int16 gobX = obj->goblinX; int16 gobY = obj->goblinY + 1; advMovement(obj, state); _vm->_scenery->updateAnim(layer, 0, animation, 0, *obj->pPosX, *obj->pPosY, 0); uint32 gobPosX = gobX * _vm->_map->getTilesWidth(); uint32 gobPosY = (gobY * _vm->_map->getTilesHeight()) - (_vm->_scenery->_animBottom - _vm->_scenery->_animTop); if (_vm->_map->hasBigTiles()) gobPosY -= gobY / 2; *obj->pPosX = gobPosX; *obj->pPosY = gobPosY; } void Goblin_v2::handleGoblins() { Mult::Mult_Object *obj0, *obj1; Mult::Mult_AnimData *anim0, *anim1; int16 pass; int16 gob1State, gob2State; int16 gob1X, gob2X; int16 gob1Y, gob2Y; int16 gob1DestX, gob2DestX; int16 gob1DestY, gob2DestY; obj0 = &_vm->_mult->_objects[0]; obj1 = &_vm->_mult->_objects[1]; anim0 = obj0->pAnimData; anim1 = obj1->pAnimData; gob1State = anim0->state; gob2State = anim1->state; if (!anim0->isBusy) { if (!_gob1Busy && (anim0->isStatic == 0)) { if ((VAR(_gob1RelaxTimeVar) == 0) && (gob1State == 28)) { // Goblin 1 showing boredom gob1State = _vm->_util->getRandom(3) + 24; setState(0, gob1State); WRITE_VAR(_gob1RelaxTimeVar, 100); } else WRITE_VAR(_gob1RelaxTimeVar, VAR(_gob1RelaxTimeVar) - 1); } if ((gob1State == 8) || (gob1State == 9) || (gob1State == 29)) anim0->curLookDir = 6; } if (!anim1->isBusy) { if (!_gob2Busy && (anim1->isStatic == 0)) { if ((VAR(_gob2RelaxTimeVar) == 0) && (gob2State == 28)) { // Goblin 2 showing boredom gob2State = _vm->_util->getRandom(3) + 24; setState(1, gob2State); WRITE_VAR(_gob2RelaxTimeVar, 100); } else WRITE_VAR(_gob2RelaxTimeVar, VAR(_gob2RelaxTimeVar) - 1); } if ((gob2State == 8) || (gob2State == 9) || (gob2State == 29)) anim1->curLookDir = 6; } if ((anim0->isBusy == 1) && (anim0->isStatic == 0) && ((anim0->state == 28) || (anim0->state == 29))) anim0->curLookDir = 0; if ((anim1->isBusy == 1) && (anim1->isStatic == 0) && ((anim1->state == 28) || (anim1->state == 29))) anim1->curLookDir = 0; if (VAR(18) != ((uint32) -1)) { if (anim0->layer == 44) anim0->curLookDir = 4; else if (anim0->layer == 45) anim0->curLookDir = 0; if (anim0->isBusy == 0) anim0->curLookDir = 6; } if (VAR(19) != ((uint32) -1)) { if (anim1->layer == 48) anim1->curLookDir = 4; else if (anim1->layer == 49) anim1->curLookDir = 0; if (anim1->isBusy == 0) anim1->curLookDir = 6; } if ((anim0->layer == 45) && (anim0->curLookDir == 4) && (anim0->pathExistence == 5) && (VAR(18) == ((uint32) -1)) && !_gob1NoTurn) { setState(0, 19); // Turning right->left } if ((anim0->layer == 44) && (anim0->curLookDir == 0) && (anim0->pathExistence == 5) && (VAR(18) == ((uint32) -1)) && !_gob1NoTurn) { setState(0, 16); // Turning left->right } if ((anim1->layer == 49) && (anim1->curLookDir == 4) && (anim1->pathExistence == 5) && (VAR(19) == ((uint32) -1)) && !_gob2NoTurn) { setState(1, 19); // Turning right->left } if ((anim1->layer == 48) && (anim1->curLookDir == 0) && (anim1->pathExistence == 5) && (VAR(19) == ((uint32) -1)) && !_gob2NoTurn) { setState(1, 16); // Turning left->right } gob1X = obj0->goblinX; gob2X = obj1->goblinX; gob1Y = obj0->goblinY; gob2Y = obj1->goblinY; gob1DestX = anim0->destX; gob2DestX = anim1->destX; gob1DestY = anim0->destY; gob2DestY = anim1->destY; pass = _vm->_map->getPass(gob1X, gob1Y); if ((pass > 17) && (pass < 21)) // Ladders, ropes, stairs updateLayer1(anim0); pass = _vm->_map->getPass(gob2X, gob2Y); if ((pass > 17) && (pass < 21)) // Ladders, ropes, stairs updateLayer2(anim1); if ((gob1DestX < 0) || (gob1DestX > 39) || (gob1DestY < 0) || (gob1DestY > 39)) return; if (gob1Y > gob1DestY) { if (_vm->_map->getPass(gob1DestX, gob1DestY) > 17) { do { gob1DestY--; } while (_vm->_map->getPass(gob1DestX, gob1DestY) > 17); gob1DestY++; if (_vm->_map->getPass(gob1DestX - 1, gob1DestY) == 0) { if (_vm->_map->getPass(gob1DestX + 1, gob1DestY) != 0) gob1DestX++; } else gob1DestX--; move(gob1DestX, gob1DestY, 0); } } else { if (_vm->_map->getPass(gob1DestX, gob1DestY) > 17) { do { gob1DestY++; } while (_vm->_map->getPass(gob1DestX, gob1DestY) > 17); gob1DestY--; if (_vm->_map->getPass(gob1DestX - 1, gob1DestY) == 0) { if (_vm->_map->getPass(gob1DestX + 1, gob1DestY) != 0) gob1DestX++; } else gob1DestX--; move(gob1DestX, gob1DestY, 0); } } if (gob2Y > gob2DestY) { if (_vm->_map->getPass(gob2DestX, gob2DestY) > 17) { do { gob2DestY--; } while (_vm->_map->getPass(gob2DestX, gob2DestY) > 17); gob2DestY++; if (_vm->_map->getPass(gob2DestX - 1, gob2DestY) == 0) { if (_vm->_map->getPass(gob2DestX + 1, gob2DestY) != 0) gob2DestX++; } else gob2DestX--; move(gob2DestX, gob2DestY, 1); } } else { if (_vm->_map->getPass(gob2DestX, gob2DestY) > 17) { do { gob2DestY++; } while (_vm->_map->getPass(gob2DestX, gob2DestY) > 17); gob2DestY--; if (_vm->_map->getPass(gob2DestX - 1, gob2DestY) == 0) { if (_vm->_map->getPass(gob2DestX + 1, gob2DestY) != 0) gob2DestX++; } else gob2DestX--; move(gob2DestX, gob2DestY, 1); } } } bool Goblin_v2::isMovement(int8 state) { if ((state >= 0) && (state < 8)) return true; if ((state == 38) || (state == 39)) return true; return false; } void Goblin_v2::advMovement(Mult::Mult_Object *obj, int8 state) { switch (state) { case 0: obj->goblinX--; break; case 1: obj->goblinX--; obj->goblinY--; break; case 2: case 38: obj->goblinY--; break; case 3: obj->goblinX++; obj->goblinY--; break; case 4: obj->goblinX++; break; case 5: obj->goblinX++; obj->goblinY++; break; case 6: case 39: obj->goblinY++; break; case 7: obj->goblinX--; obj->goblinY++; break; default: break; } } } // End of namespace Gob
{ "pile_set_name": "Github" }
GLSL optimizer ============== > :warning: As of mid-2016, the project is unlikely to have any significant developments. At Unity we are moving to a different shader compilation pipeline, with glsl-optimizer is not used. So from my side there won't be significant work done on it. :warning: A C++ library that takes GLSL shaders, does some GPU-independent optimizations on them and outputs GLSL or Metal source back. Optimizations are function inlining, dead code removal, copy propagation, constant folding, constant propagation, arithmetic optimizations and so on. Apparently quite a few mobile platforms are pretty bad at optimizing shaders; and unfortunately they *also* lack offline shader compilers. So using a GLSL optimizer offline before can make the shader run much faster on a platform like that. See performance numbers in [this blog post](http://aras-p.info/blog/2010/09/29/glsl-optimizer/). Even for drivers that have decent shader optimization, GLSL optimizer could be useful to just strip away dead code, make shaders smaller and do uniform/input reflection offline. Almost all actual code is [Mesa 3D's GLSL](http://cgit.freedesktop.org/mesa/mesa/log/) compiler; all this library does is spits out optimized GLSL or Metal back, and adds GLES type precision handling to the optimizer. This GLSL optimizer is made for [Unity's](http://unity3d.com/) purposes and is built-in starting with Unity 3.0. GLSL Optimizer is licensed according to the terms of the MIT license. See [change log here](Changelog.md). Usage ----- Visual Studio 2010 (Windows, x86/x64) and Xcode 5+ (Mac, i386) project files for a static library are provided in `projects/vs2010/glsl_optimizer.sln` and `projects/xcode5/glsl_optimizer_lib` respectively. > Note: only the VS and Xcode project files are maintained and should work at any time. > There's also a cmake and gyp build system for Linux et al., and some stuff in contrib folder - > all that may or might not work. For Linux you can use cmake. Just type "cmake . && make" in the root directory. This will build the optimizer library and some executable binaries. Interface for the library is `src/glsl/glsl_optimizer.h`. General usage is: ctx = glslopt_initialize(targetVersion); for (lots of shaders) { shader = glslopt_optimize (ctx, shaderType, shaderSource, options); if (glslopt_get_status (shader)) { newSource = glslopt_get_output (shader); } else { errorLog = glslopt_get_log (shader); } glslopt_shader_delete (shader); } glslopt_cleanup (ctx); Tests ----- There's a testing suite for catching regressions, see `tests` folder. In VS, build and run `glsl_optimizer_tests` project; in Xcode use `projects/xcode5/glsl_optimizer_tests` project. The test executable requires path to the `tests` folder as an argument. Each test comes as three text files; input, expected IR dump and expected optimized GLSL dump. GLES3 tests are also converted into Metal. If you're making changes to the project and want pull requests accepted easier, I'd appreciate if there would be no test suite regressions. If you are implementing a feature, it would be cool to add tests to cover it as well! Notes ----- * GLSL versions 1.10 and 1.20 are supported. 1.10 is the default, use #version 120 to specify 1.20. Higher GLSL versions might work, but aren't tested now. * GLSL ES versions 1.00 and 3.00 are supported. Dev Notes --------- Pulling Mesa upstream: git fetch upstream git merge upstream/master sh removeDeletedByUs.sh # inspect files, git rm unneeded ones, fix conflicts etc. # git commit Rebuilding flex/bison parsers: * When .y/.l files are changed, the parsers are *not* rebuilt automatically, * Run ./generateParsers.sh to do that. You'll need bison & flex (on Mac, do "Install Command Line Tools" from Xcode) * I use bison 2.3 and flex 2.5.35 (in OS X 10.8/10.9)
{ "pile_set_name": "Github" }
client dev tun proto udp remote vn-hcm.prod.surfshark.com 1194 resolv-retry infinite remote-random nobind tun-mtu 1500 tun-mtu-extra 32 mssfix 1450 persist-key persist-tun reneg-sec 0 remote-cert-tls server auth-user-pass /config/openvpn-credentials.txt #comp-lzo verb 3 pull fast-io cipher AES-256-CBC auth SHA512 <ca> -----BEGIN CERTIFICATE----- MIIFTTCCAzWgAwIBAgIJAMs9S3fqwv+mMA0GCSqGSIb3DQEBCwUAMD0xCzAJBgNV BAYTAlZHMRIwEAYDVQQKDAlTdXJmc2hhcmsxGjAYBgNVBAMMEVN1cmZzaGFyayBS b290IENBMB4XDTE4MDMxNDA4NTkyM1oXDTI4MDMxMTA4NTkyM1owPTELMAkGA1UE BhMCVkcxEjAQBgNVBAoMCVN1cmZzaGFyazEaMBgGA1UEAwwRU3VyZnNoYXJrIFJv b3QgQ0EwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDEGMNj0aisM63o SkmVJyZPaYX7aPsZtzsxo6m6p5Wta3MGASoryRsBuRaH6VVa0fwbI1nw5ubyxkua Na4v3zHVwuSq6F1p8S811+1YP1av+jqDcMyojH0ujZSHIcb/i5LtaHNXBQ3qN48C c7sqBnTIIFpmb5HthQ/4pW+a82b1guM5dZHsh7q+LKQDIGmvtMtO1+NEnmj81BAp FayiaD1ggvwDI4x7o/Y3ksfWSCHnqXGyqzSFLh8QuQrTmWUm84YHGFxoI1/8AKdI yVoB6BjcaMKtKs/pbctk6vkzmYf0XmGovDKPQF6MwUekchLjB5gSBNnptSQ9kNgn TLqi0OpSwI6ixX52Ksva6UM8P01ZIhWZ6ua/T/tArgODy5JZMW+pQ1A6L0b7egIe ghpwKnPRG+5CzgO0J5UE6gv000mqbmC3CbiS8xi2xuNgruAyY2hUOoV9/BuBev8t tE5ZCsJH3YlG6NtbZ9hPc61GiBSx8NJnX5QHyCnfic/X87eST/amZsZCAOJ5v4EP SaKrItt+HrEFWZQIq4fJmHJNNbYvWzCE08AL+5/6Z+lxb/Bm3dapx2zdit3x2e+m iGHekuiE8lQWD0rXD4+T+nDRi3X+kyt8Ex/8qRiUfrisrSHFzVMRungIMGdO9O/z CINFrb7wahm4PqU2f12Z9TRCOTXciQIDAQABo1AwTjAdBgNVHQ4EFgQUYRpbQwyD ahLMN3F2ony3+UqOYOgwHwYDVR0jBBgwFoAUYRpbQwyDahLMN3F2ony3+UqOYOgw DAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAgEAn9zV7F/XVnFNZhHFrt0Z S1Yqz+qM9CojLmiyblMFh0p7t+Hh+VKVgMwrz0LwDH4UsOosXA28eJPmech6/bjf ymkoXISy/NUSTFpUChGO9RabGGxJsT4dugOw9MPaIVZffny4qYOc/rXDXDSfF2b+ 303lLPI43y9qoe0oyZ1vtk/UKG75FkWfFUogGNbpOkuz+et5Y0aIEiyg0yh6/l5Q 5h8+yom0HZnREHhqieGbkaGKLkyu7zQ4D4tRK/mBhd8nv+09GtPEG+D5LPbabFVx KjBMP4Vp24WuSUOqcGSsURHevawPVBfgmsxf1UCjelaIwngdh6WfNCRXa5QQPQTK ubQvkvXONCDdhmdXQccnRX1nJWhPYi0onffvjsWUfztRypsKzX4dvM9k7xnIcGSG EnCC4RCgt1UiZIj7frcCMssbA6vJ9naM0s7JF7N3VKeHJtqe1OCRHMYnWUZt9vrq X6IoIHlZCoLlv39wFW9QNxelcAOCVbD+19MZ0ZXt7LitjIqe7yF5WxDQN4xru087 FzQ4Hfj7eH1SNLLyKZkA1eecjmRoi/OoqAt7afSnwtQLtMUc2bQDg6rHt5C0e4dC LqP/9PGZTSJiwmtRHJ/N5qYWIh9ju83APvLm/AGBTR2pXmj9G3KdVOkpIC7L35dI 623cSEC3Q3UZutsEm/UplsM= -----END CERTIFICATE----- </ca> key-direction 1 <tls-auth> # # 2048 bit OpenVPN static key # -----BEGIN OpenVPN Static key V1----- b02cb1d7c6fee5d4f89b8de72b51a8d0 c7b282631d6fc19be1df6ebae9e2779e 6d9f097058a31c97f57f0c35526a44ae 09a01d1284b50b954d9246725a1ead1f f224a102ed9ab3da0152a15525643b2e ee226c37041dc55539d475183b889a10 e18bb94f079a4a49888da566b9978346 0ece01daaf93548beea6c827d9674897 e7279ff1a19cb092659e8c1860fbad0d b4ad0ad5732f1af4655dbd66214e552f 04ed8fd0104e1d4bf99c249ac229ce16 9d9ba22068c6c0ab742424760911d463 6aafb4b85f0c952a9ce4275bc821391a a65fcd0d2394f006e3fba0fd34c4bc4a b260f4b45dec3285875589c97d3087c9 134d3a3aa2f904512e85aa2dc2202498 -----END OpenVPN Static key V1----- </tls-auth>
{ "pile_set_name": "Github" }
// Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build darwin,go1.12 package unix import "unsafe" // Implemented in the runtime package (runtime/sys_darwin.go) func syscall_syscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) func syscall_syscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) func syscall_syscall6X(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) func syscall_syscall9(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) // 32-bit only func syscall_rawSyscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) func syscall_rawSyscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) func syscall_syscallPtr(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) //go:linkname syscall_syscall syscall.syscall //go:linkname syscall_syscall6 syscall.syscall6 //go:linkname syscall_syscall6X syscall.syscall6X //go:linkname syscall_syscall9 syscall.syscall9 //go:linkname syscall_rawSyscall syscall.rawSyscall //go:linkname syscall_rawSyscall6 syscall.rawSyscall6 //go:linkname syscall_syscallPtr syscall.syscallPtr // Find the entry point for f. See comments in runtime/proc.go for the // function of the same name. //go:nosplit func funcPC(f func()) uintptr { return **(**uintptr)(unsafe.Pointer(&f)) }
{ "pile_set_name": "Github" }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // TransformChainTest.cs - Test Cases for TransformChain // // Author: // Sebastien Pouliot (spouliot@motus.com) // // (C) 2002, 2003 Motus Technologies Inc. (http://www.motus.com) using Xunit; namespace System.Security.Cryptography.Xml.Tests { public class TransformChainTest { [Fact] public void EmptyChain() { TransformChain chain = new TransformChain(); Assert.Equal(0, chain.Count); Assert.NotNull(chain.GetEnumerator()); Assert.Equal("System.Security.Cryptography.Xml.TransformChain", chain.ToString()); } [Fact] public void FullChain() { TransformChain chain = new TransformChain(); XmlDsigBase64Transform base64 = new XmlDsigBase64Transform(); chain.Add(base64); Assert.Equal(base64, chain[0]); Assert.Equal(1, chain.Count); XmlDsigC14NTransform c14n = new XmlDsigC14NTransform(); chain.Add(c14n); Assert.Equal(c14n, chain[1]); Assert.Equal(2, chain.Count); XmlDsigC14NWithCommentsTransform c14nc = new XmlDsigC14NWithCommentsTransform(); chain.Add(c14nc); Assert.Equal(c14nc, chain[2]); Assert.Equal(3, chain.Count); XmlDsigEnvelopedSignatureTransform esign = new XmlDsigEnvelopedSignatureTransform(); chain.Add(esign); Assert.Equal(esign, chain[3]); Assert.Equal(4, chain.Count); XmlDsigXPathTransform xpath = new XmlDsigXPathTransform(); chain.Add(xpath); Assert.Equal(xpath, chain[4]); Assert.Equal(5, chain.Count); XmlDsigXsltTransform xslt = new XmlDsigXsltTransform(); chain.Add(xslt); Assert.Equal(xslt, chain[5]); Assert.Equal(6, chain.Count); } } }
{ "pile_set_name": "Github" }
/** * \file sha512.h * \brief This file contains SHA-384 and SHA-512 definitions and functions. * * The Secure Hash Algorithms 384 and 512 (SHA-384 and SHA-512) cryptographic * hash functions are defined in <em>FIPS 180-4: Secure Hash Standard (SHS)</em>. */ /* * Copyright (C) 2006-2018, Arm Limited (or its affiliates), All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * This file is part of Mbed TLS (https://tls.mbed.org) */ #ifndef MBEDTLS_SHA512_H #define MBEDTLS_SHA512_H #if !defined(MBEDTLS_CONFIG_FILE) #include "config.h" #else #include MBEDTLS_CONFIG_FILE #endif #include <stddef.h> #include <stdint.h> #define MBEDTLS_ERR_SHA512_HW_ACCEL_FAILED -0x0039 /**< SHA-512 hardware accelerator failed */ #ifdef __cplusplus extern "C" { #endif #if !defined(MBEDTLS_SHA512_ALT) // Regular implementation // /** * \brief The SHA-512 context structure. * * The structure is used both for SHA-384 and for SHA-512 * checksum calculations. The choice between these two is * made in the call to mbedtls_sha512_starts_ret(). */ typedef struct { uint64_t total[2]; /*!< The number of Bytes processed. */ uint64_t state[8]; /*!< The intermediate digest state. */ unsigned char buffer[128]; /*!< The data block being processed. */ int is384; /*!< Determines which function to use: 0: Use SHA-512, or 1: Use SHA-384. */ } mbedtls_sha512_context; #else /* MBEDTLS_SHA512_ALT */ #include "sha512_alt.h" #endif /* MBEDTLS_SHA512_ALT */ /** * \brief This function initializes a SHA-512 context. * * \param ctx The SHA-512 context to initialize. */ void mbedtls_sha512_init( mbedtls_sha512_context *ctx ); /** * \brief This function clears a SHA-512 context. * * \param ctx The SHA-512 context to clear. */ void mbedtls_sha512_free( mbedtls_sha512_context *ctx ); /** * \brief This function clones the state of a SHA-512 context. * * \param dst The destination context. * \param src The context to clone. */ void mbedtls_sha512_clone( mbedtls_sha512_context *dst, const mbedtls_sha512_context *src ); /** * \brief This function starts a SHA-384 or SHA-512 checksum * calculation. * * \param ctx The SHA-512 context to initialize. * \param is384 Determines which function to use: * 0: Use SHA-512, or 1: Use SHA-384. * * \return \c 0 on success. */ int mbedtls_sha512_starts_ret( mbedtls_sha512_context *ctx, int is384 ); /** * \brief This function feeds an input buffer into an ongoing * SHA-512 checksum calculation. * * \param ctx The SHA-512 context. * \param input The buffer holding the input data. * \param ilen The length of the input data. * * \return \c 0 on success. */ int mbedtls_sha512_update_ret( mbedtls_sha512_context *ctx, const unsigned char *input, size_t ilen ); /** * \brief This function finishes the SHA-512 operation, and writes * the result to the output buffer. This function is for * internal use only. * * \param ctx The SHA-512 context. * \param output The SHA-384 or SHA-512 checksum result. * * \return \c 0 on success. */ int mbedtls_sha512_finish_ret( mbedtls_sha512_context *ctx, unsigned char output[64] ); /** * \brief This function processes a single data block within * the ongoing SHA-512 computation. * * \param ctx The SHA-512 context. * \param data The buffer holding one block of data. * * \return \c 0 on success. */ int mbedtls_internal_sha512_process( mbedtls_sha512_context *ctx, const unsigned char data[128] ); #if !defined(MBEDTLS_DEPRECATED_REMOVED) #if defined(MBEDTLS_DEPRECATED_WARNING) #define MBEDTLS_DEPRECATED __attribute__((deprecated)) #else #define MBEDTLS_DEPRECATED #endif /** * \brief This function starts a SHA-384 or SHA-512 checksum * calculation. * * \deprecated Superseded by mbedtls_sha512_starts_ret() in 2.7.0 * * \param ctx The SHA-512 context to initialize. * \param is384 Determines which function to use: * 0: Use SHA-512, or 1: Use SHA-384. */ MBEDTLS_DEPRECATED void mbedtls_sha512_starts( mbedtls_sha512_context *ctx, int is384 ); /** * \brief This function feeds an input buffer into an ongoing * SHA-512 checksum calculation. * * \deprecated Superseded by mbedtls_sha512_update_ret() in 2.7.0. * * \param ctx The SHA-512 context. * \param input The buffer holding the data. * \param ilen The length of the input data. */ MBEDTLS_DEPRECATED void mbedtls_sha512_update( mbedtls_sha512_context *ctx, const unsigned char *input, size_t ilen ); /** * \brief This function finishes the SHA-512 operation, and writes * the result to the output buffer. * * \deprecated Superseded by mbedtls_sha512_finish_ret() in 2.7.0. * * \param ctx The SHA-512 context. * \param output The SHA-384 or SHA-512 checksum result. */ MBEDTLS_DEPRECATED void mbedtls_sha512_finish( mbedtls_sha512_context *ctx, unsigned char output[64] ); /** * \brief This function processes a single data block within * the ongoing SHA-512 computation. This function is for * internal use only. * * \deprecated Superseded by mbedtls_internal_sha512_process() in 2.7.0. * * \param ctx The SHA-512 context. * \param data The buffer holding one block of data. */ MBEDTLS_DEPRECATED void mbedtls_sha512_process( mbedtls_sha512_context *ctx, const unsigned char data[128] ); #undef MBEDTLS_DEPRECATED #endif /* !MBEDTLS_DEPRECATED_REMOVED */ /** * \brief This function calculates the SHA-512 or SHA-384 * checksum of a buffer. * * The function allocates the context, performs the * calculation, and frees the context. * * The SHA-512 result is calculated as * output = SHA-512(input buffer). * * \param input The buffer holding the input data. * \param ilen The length of the input data. * \param output The SHA-384 or SHA-512 checksum result. * \param is384 Determines which function to use: * 0: Use SHA-512, or 1: Use SHA-384. * * \return \c 0 on success. */ int mbedtls_sha512_ret( const unsigned char *input, size_t ilen, unsigned char output[64], int is384 ); #if !defined(MBEDTLS_DEPRECATED_REMOVED) #if defined(MBEDTLS_DEPRECATED_WARNING) #define MBEDTLS_DEPRECATED __attribute__((deprecated)) #else #define MBEDTLS_DEPRECATED #endif /** * \brief This function calculates the SHA-512 or SHA-384 * checksum of a buffer. * * The function allocates the context, performs the * calculation, and frees the context. * * The SHA-512 result is calculated as * output = SHA-512(input buffer). * * \deprecated Superseded by mbedtls_sha512_ret() in 2.7.0 * * \param input The buffer holding the data. * \param ilen The length of the input data. * \param output The SHA-384 or SHA-512 checksum result. * \param is384 Determines which function to use: * 0: Use SHA-512, or 1: Use SHA-384. */ MBEDTLS_DEPRECATED void mbedtls_sha512( const unsigned char *input, size_t ilen, unsigned char output[64], int is384 ); #undef MBEDTLS_DEPRECATED #endif /* !MBEDTLS_DEPRECATED_REMOVED */ /** * \brief The SHA-384 or SHA-512 checkup routine. * * \return \c 0 on success. * \return \c 1 on failure. */ int mbedtls_sha512_self_test( int verbose ); #ifdef __cplusplus } #endif #endif /* mbedtls_sha512.h */
{ "pile_set_name": "Github" }
function ShoutAssistant(a,u,ps,text) { this.auth=a; this.urllen=0; this.prevScene=ps; this.uploading=false; this.text=(text!=undefined)? text: ''; } ShoutAssistant.prototype.aboutToActivate = function(callback) { callback.defer(); //makes the setup behave like it should. }; ShoutAssistant.prototype.setup = function() { NavMenu.setup(this,{buttons:'navOnly'}); this.imageHosts=[ {label: "Flickr", value: "flickr", urlLen:23}, {label: "Plixi (TweetPhoto)", value: "tweetphoto", urlLen: 18}, {label: "Pikchur", value: "pikchur", urlLen: 16}, {label: "FSPic", value: "fspic", urlLen: 20} ]; this.videoHosts=[ {label: "Pikchur", value: "pikchur", urlLen: 16} ]; this.urlLengths={ "flickr":24, "tweetphoto": 19, "pikchur":17, "fspic": 21 }; logthis("1"); this.controller.setupWidget("okButtonShout", this.attributes = {type : Mojo.Widget.activityButton}, this.OKButtonModel = { buttonLabel: "Shout!", disabled: false } ); this.okTappedShoutBound=this.okTappedShout.bindAsEventListener(this); this.attachImageBound=this.attachImage.bindAsEventListener(this); this.removeImageBound=this.removeImage.bindAsEventListener(this); this.attachDownBound=function(){this.controller.get("attachicon").addClassName("pressed");}.bindAsEventListener(this); this.attachUpBound=function(){this.controller.get("attachicon").removeClassName("pressed");}.bindAsEventListener(this); this.shoutKeyPressBound=this.shoutKeyPress.bindAsEventListener(this); this.stageActivateBound=this.stageActivate.bind(this); Mojo.Event.listen(this.controller.stageController.document,Mojo.Event.activate, this.stageActivateBound); logthis("2"); this.cookieData=new Mojo.Model.Cookie("credentials"); var credentials=this.cookieData.get(); var pings=(credentials.ping=="on")? '0': '1'; this.stt=(credentials.savetotwitter==true)? '1': '0'; this.stf=(credentials.savetofacebook==true || credentials.savetofacebook=='true')? '1': '0'; logthis("3"); _globals.ammodel.items[0].disabled=true; this.controller.setupWidget(Mojo.Menu.appMenu, _globals.amattributes, _globals.ammodel); this.lhc=new Mojo.Model.Cookie("photohost"); var lh=this.lhc.get(); _globals.lasthost=(lh)? lh.photohost: "pikchur"; this.controller.setupWidget("photohostList", this.phAttributes = {}, this.phModel = { choices: this.imageHosts, value: _globals.lasthost, disabled: false } ); logthis("4"); this.controller.setupWidget('shout', this.tipAttributes = {hintText:'Add a shout',multiline:true,focus:true}, this.tipModel = {value:this.text, disabled:false}); this.controller.get("photohostList").hide(); logthis("5"); if(Mojo.Environment.DeviceInfo.touchableRows < 8) { this.controller.get("docheckingroup").style.minHeight="275px;"; //247 } else{ this.controller.get("docheckingroup").style.minHeight="327px"; //372 } if(this.stf=="1"){ this.controller.get('share-facebook').addClassName("pressed"); } this.handleFacebookBound=function(){ logthis("stf: %i, stt: %i",this.stf,this.stt); if(this.stf=="1"){ this.stf="0"; this.controller.get('share-facebook').removeClassName("pressed"); }else{ this.stf="1"; this.controller.get('share-facebook').addClassName("pressed"); } }.bindAsEventListener(this); logthis("6"); if(this.stt=="1"){ this.controller.get('share-twitter').addClassName("pressed"); } this.handleTwitterBound=function(){ logthis("stf: %i, stt: %i",this.stf,this.stt); if(this.stt=="1"){ this.stt="0"; this.controller.get('share-twitter').removeClassName("pressed"); }else{ this.stt="1"; this.controller.get('share-twitter').addClassName("pressed"); } }.bindAsEventListener(this); logthis("7"); this.handlePhotohostBound=this.handlePhotohost.bind(this); Mojo.Event.listen(this.controller.get("photohostList"), Mojo.Event.propertyChange, this.handlePhotohostBound); Mojo.Event.listen(this.controller.get('share-twitter'), Mojo.Event.tap, this.handleTwitterBound); Mojo.Event.listen(this.controller.get('share-facebook'), Mojo.Event.tap, this.handleFacebookBound); Mojo.Event.listen(this.controller.get('okButtonShout'), Mojo.Event.tap, this.okTappedShoutBound); Mojo.Event.listen(this.controller.get('attach'), Mojo.Event.tap, this.attachImageBound); Mojo.Event.listen(this.controller.get('img-preview'), Mojo.Event.tap, this.removeImageBound); Mojo.Event.listen(this.controller.get('attach'), "mousedown", this.attachDownBound); Mojo.Event.listen(this.controller.get('attach'), "mouseup", this.attachUpBound); Mojo.Event.listen(this.controller.document, "keyup", this.shoutKeyPressBound); logthis("8"); } ShoutAssistant.prototype.stageActivate = function(event) { NavMenu.setup(this,{buttons: 'navOnly'}); }; ShoutAssistant.prototype.activate = function(event) { /*NavMenu.setThat(this);*/ this.controller.get('shout').mojo.focus(); } ShoutAssistant.prototype.shoutKeyPress = function(event) { logthis("keypress"); if(this.hasPhoto){ } try{ var charsLeft=140-this.urllen-this.controller.get("shout").mojo.getValue().length; this.controller.get("charCount").innerHTML=charsLeft; if(charsLeft<0){ if(!this.controller.get("charCount").hasClassName("negative")){ this.controller.get("charCount").addClassName("negative"); } }else{ if(this.controller.get("charCount").hasClassName("negative")){ this.controller.get("charCount").removeClassName("negative"); } } }catch(e){ } }; ShoutAssistant.prototype.handleCommand = function(event) { if(event.type===Mojo.Event.back){ if( this.uploading==true){ event.preventDefault(); event.stop(); this.controller.showAlertDialog({ onChoose: function(value) { if(value=="yes"){ this.controller.stageController.popScene(); } }.bind(this), title: $L("Cancel Upload?"), message: $L("Your media file is still uploading. Do you want to cancel uploading and the check-in?"), choices:[ {label:$L('Yeah'), value:"yes", type:'primary'}, {label:$L('No!'), value:"no", type:'negative'} ] }); } if(NavMenu.showing==true){ event.preventDefault(); NavMenu.hideMenu(); } } }; ShoutAssistant.prototype.okTappedShout = function() { if (_globals.auth) { //before doing the actual shout, see if we have a photo. if so, handle that if(this.hasPhoto){ this.uploading=true; Mojo.Controller.getAppController().showBanner("Uploading media...", {source: 'notification'}); switch(this.phModel.value){ case "flickr": var ptitle=this.tipModel.value; var pdesc=this.tipModel.value; var ptags=""; var format="xml"; var nojsoncallback="1"; var api_key=_globals.flickr_key; var auth_token=_globals.flickr_token; var presig=_globals.flickr_secret+"api_key"+api_key+"auth_token"+auth_token+"description"+pdesc+"format"+format+"nojsoncallback"+nojsoncallback+"tags"+ptags+"title"+ptitle; var api_sig=hex_md5(presig); var params={ "title":ptitle, "description":pdesc, "tags":ptags }; var params=[]; params.push({"key":"api_key","data":api_key,"contentType":"text/plain"}); params.push({"key":"auth_token","data":auth_token,"contentType":"text/plain"}); params.push({"key":"api_sig","data":api_sig,"contentType":"text/plain"}); params.push({"key":"description","data":pdesc,"contentType":"text/plain"}); params.push({"key":"format","data":format,"contentType":"text/plain"}); params.push({"key":"nojsoncallback","data":nojsoncallback,"contentType":"text/plain"}); params.push({"key":"tags","data":ptags,"contentType":"text/plain"}); params.push({"key":"title","data":ptitle,"contentType":"text/plain"}); var appController = Mojo.Controller.getAppController(); var cardStageController = appController.getStageController("mainStage"); var controller = cardStageController.activeScene(); // Queue the upload request with the download manager service. controller.serviceRequest('palm://com.palm.downloadmanager/', { method: 'upload', parameters: { 'url': "http://api.flickr.com/services/upload/", 'fileLabel': 'photo', 'fileName': this.fileName, 'postParameters': params, 'subscribe': true }, onSuccess: function (resp){ //gonna old school parse the xml since it's in plain etxt and not an object... var xml=resp.responseString; if(xml) { if(xml.indexOf('stat="ok"')>-1) { var ps=xml.indexOf("<photoid>")+9; var pe=xml.indexOf("</photoid>"); var len=pe-ps; var photoid=parseInt(xml.substring(ps,pe)); logthis("photoid="+photoid); var epid=this.base58_encode(photoid); logthis("epid="+epid); var extra="http://flic.kr/p/"+epid; this.doShout(extra); } } }.bind(this), onFailure: function (e){ logthis('Failure : ' + Object.toJSON(resp)); }.bind(this) }); break; case "pikchur": var eauth=_globals.auth.replace("Basic ",""); var plaintext=Base64.decode(eauth);//Njk1 var creds=plaintext.split(":"); var un=creds[0]; var pw=creds[1]; var params=[]; params.push({"key":"api_key","data":"QTG1n51CVNEJNDkkiMQIXQ","contentType":"text/plain"}); params.push({"key":"encodedAuth","data":eauth,"contentType":"text/plain"}); params.push({"key":"message","data":this.tipModel.value,"contentType":"text/plain"}); params.push({"key":"geolat","data":_globals.lat,"contentType":"text/plain"}); params.push({"key":"geolon","data":_globals.long,"contentType":"text/plain"}); params.push({"key":"service","data":"foursquare","contentType":"text/plain"}); params.push({"key":"source","data":"Njk1","contentType":"text/plain"}); logthis("params="+Object.toJSON(params)); var appController = Mojo.Controller.getAppController(); var cardStageController = appController.getStageController("mainStage"); var controller = cardStageController.activeScene(); // Queue the upload request with the download manager service. controller.serviceRequest('palm://com.palm.downloadmanager/', { method: 'upload', parameters: { 'url': "http://api.pikchur.com/geosocial/upload/json", 'fileLabel': 'media', 'fileName': this.fileName, 'postParameters': params, 'subscribe': true }, onSuccess: function (resp,j){ var r=resp.responseString; if(r != undefined) { this.checkInSuccess(r); } }.bind(this), onFailure: function (e){ logthis('Failure : ' + Object.toJSON(e)); }.bind(this) }); break; case "tweetphoto": var eauth=_globals.auth.replace("Basic ",""); var plaintext=Base64.decode(eauth); var creds=plaintext.split(":"); var un=creds[0]; var pw=creds[1]; var params=[]; params.push({"key":"api_key","data":"78c45db0-e4eb-467c-9215-695072bcf85a","contentType":"text/plain"}); params.push({"key":"tpservice","data":"Foursquare","contentType":"text/plain"}); params.push({"key":"message","data":this.tipModel.value,"contentType":"text/plain"}); params.push({"key":"latitude","data":_globals.lat,"contentType":"text/plain"}); params.push({"key":"longitude","data":_globals.long,"contentType":"text/plain"}); params.push({"key":"response_format","data":"JSON","contentType":"text/plain"}); params.push({"key":"username","data":un,"contentType":"text/plain"}); params.push({"key":"password","data":pw,"contentType":"text/plain"}); var appController = Mojo.Controller.getAppController(); var cardStageController = appController.getStageController("mainStage"); var controller = cardStageController.activeScene(); // Queue the upload request with the download manager service. controller.serviceRequest('palm://com.palm.downloadmanager/', { method: 'upload', parameters: { 'url': "http://api.plixi.com/api/upload.aspx", 'fileLabel': 'media', 'fileName': this.fileName, 'postParameters': params, 'subscribe': true }, onSuccess: function (resp,j){ var r=resp.responseString; if(r != undefined && r != "") { var json=eval("("+r+")"); var url=json.MediaUrl; logthis("longurl="+url); //shorten with id.gd var url = 'http://is.gd/api.php?longurl='+url; var request = new Ajax.Request(url, { method: 'get', evalJSON: 'false', onSuccess: function(r){ var url=r.responseText; logthis("url="+url); this.doShout(url); }.bind(this), onFailure: function (e){ logthis('Failure : ' + Object.toJSON(e)); }.bind(this) }); }else{ } }.bind(this), onFailure: function (e){ logthis('Failure : ' + Object.toJSON(e)); }.bind(this) }); break; case "fspic": var eauth=_globals.auth.replace("Basic ",""); var plaintext=Base64.decode(eauth); var creds=plaintext.split(":"); var un=creds[0]; var pw=creds[1]; var params=[]; params.push({"key":"api_key","data":"q9hpcah58aaqtd7pp40orr21rga1wi","contentType":"text/plain"}); params.push({"key":"shout_text","data":this.tipModel.value,"contentType":"text/plain"}); params.push({"key":"phone_or_email","data":un,"contentType":"text/plain"}); params.push({"key":"password","data":pw,"contentType":"text/plain"}); var appController = Mojo.Controller.getAppController(); var cardStageController = appController.getStageController("mainStage"); var controller = cardStageController.activeScene(); // Queue the upload request with the download manager service. controller.serviceRequest('palm://com.palm.downloadmanager/', { method: 'upload', parameters: { 'url': "http://fspic.com/api/uploadPhoto", 'fileLabel': 'photo', 'fileName': this.fileName, 'postParameters': params, 'subscribe': true }, onSuccess: function (resp,j){ var xml=resp.responseString; if(xml) { if(xml.indexOf('status="ok"')>-1) { var ps=xml.indexOf("<url>")+5; var pe=xml.indexOf("</url>"); var len=pe-ps; var url=xml.substring(ps,pe); this.doShout(url); } } }.bind(this), onFailure: function (e){ logthis('Failure : ' + Object.toJSON(e)); }.bind(this) }); break; } }else{ this.doShout(); } } else { Mojo.Controller.getAppController().showBanner("Not logged in!", {source: 'notification'}); } } ShoutAssistant.prototype.getTheHeaders =function(r){ var text=r.responseText; var ff = []; var mx = text.length; var scc= String.fromCharCode; for (var z = 0; z < mx; z++) { ff[z] = scc(text.charCodeAt(z) & 255); } var b = ff.join(""); var l =b.length; } ShoutAssistant.prototype.doShout = function(extra) { this.uploading=false; extra=(extra==undefined)? "": extra; foursquarePost(this,{ endpoint: 'checkin.json', parameters: { shout: this.tipModel.value+" "+extra, twitter: this.stt, facebook: this.stf }, requiresAuth: true, debug: false, onSuccess: this.checkInSuccess.bind(this), onFailure: this.checkInFailed.bind(this) }); } ShoutAssistant.prototype.checkInSuccess = function(response) { this.controller.get("okButtonShout").mojo.deactivate(); logthis("deactivated button"); this.tipModel.value=""; logthis("cleared tip"); this.fileName=""; logthis("cleared filename"); this.controller.get("img").src=""; logthis("cleared image"); this.hasPhoto=false; logthis("hasimage=false"); this.controller.get("charCount").innerHTML="140"; this.controller.get("img-preview").hide(); logthis("hidden image"); this.controller.get("photohostList").hide(); logthis("hid photohosts"); this.controller.modelChanged(this.tipModel); //Mojo.Controller.getAppController().showBanner("Sent your shout to your friends!", {source: 'notification'}); this.controller.stageController.pushScene({name: "checkin-result", transition: Mojo.Transition.zoomFade},response.responseJSON,_globals.uid,true); } ShoutAssistant.prototype.checkInFailed = function(response) { logthis(Object.toJSON(response)); Mojo.Controller.getAppController().showBanner("Error sending your shout.", {source: 'notification'}); } ShoutAssistant.prototype.base58_encode = function(num) { if(typeof num!=='number') { num=parseInt(num); } var encoded=''; var alphabet='123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'; var div=num; var mod; while(num>=58){ div=num/58; mod=num-(58*Math.floor(div)); encoded=''+alphabet.substr(mod,1)+encoded; num=Math.floor(div); } return(div)?''+alphabet.substr(div,1)+encoded:encoded; } ShoutAssistant.prototype.escape_and_sign= function(params, post) { //from: http://github.com/lmorchard/flickr-uploadr-webos/blob/master/src/javascripts/FlickrUploadr/API.js params.api_key = _globals.flickr_key; var sig = []; var esc_params = {api_key: '', api_sig: ''}; for (var p in params) { if ('object' === typeof params[p]) { esc_params[p] = params[p]; } else { sig.push(p); esc_params[p] = this.escape_utf8('' + params[p], !post).replace(/(^\s+|\s+$)/g, ''); } } sig.sort(); var calc = []; var ii = sig.length; for (var i = 0; i < ii; ++i) { calc.push(sig[i] + (post ? esc_params[sig[i]] : this.escape_utf8('' +params[sig[i]], false))); } var clear = _globals.flickr_secret + calc.join(''); esc_params.api_sig = hex_md5(clear); return esc_params; } ShoutAssistant.prototype.escape_utf8= function(data, url) { //from: http://github.com/lmorchard/flickr-uploadr-webos/blob/master/src/javascripts/FlickrUploadr/API.js if (null === url) { url = false; } if ('' === data || null === data || undefined === data) { return ''; } var chars = '0123456789abcdef'; data = data.toString(); var buffer = []; var ii = data.length; for (var i = 0; i < ii; ++i) { var c = data.charCodeAt(i); var bs = []; if (c > 0x10000) { bs[0] = 0xf0 | ((c & 0x1c0000) >>> 18); bs[1] = 0x80 | ((c & 0x3f000) >>> 12); bs[2] = 0x80 | ((c & 0xfc0) >>> 6); bs[3] = 0x80 | (c & 0x3f); } else if (c > 0x800) { bs[0] = 0xe0 | ((c & 0xf000) >>> 12); bs[1] = 0x80 | ((c & 0xfc0) >>> 6); bs[2] = 0x80 | (c & 0x3f); } else if (c > 0x80) { bs[0] = 0xc0 | ((c & 0x7c0) >>> 6); bs[1] = 0x80 | (c & 0x3f); } else { bs[0] = c; } var j = 0, jj = bs.length; if (1 < jj) { if (url) { for (j = 0; j < jj; ++j) { var b = bs[j]; buffer.push('%' + chars.charAt((b & 0xf0) >>> 4) + chars.charAt(b & 0x0f)); } } else { for (j = 0; j < jj; ++j) { buffer.push(String.fromCharCode(bs[j])); } } } else { if (url) { buffer.push(encodeURIComponent(String.fromCharCode(bs[0]))); } else { buffer.push(String.fromCharCode(bs[0])); } } } return buffer.join(''); } ShoutAssistant.prototype.tipSuccess = function() { this.controller.get("okButtonShout").mojo.deactivate(); this.sceneAssistant.getVenueInfo(); this.widget.mojo.close(); } ShoutAssistant.prototype.tipFailed = function() { } ShoutAssistant.prototype.cancelTappedShout = function() { this.widget.mojo.close(); } ShoutAssistant.prototype.handleCommand = function(event) { if (event.type === Mojo.Event.command) { switch (event.command) { case "do-Venues": var thisauth=_globals.auth; //this.controller.stageController.popScene(); this.controller.stageController.swapScene({name: "nearby-venues", transition: Mojo.Transition.crossFade},thisauth,_globals.userData,_globals.username,_globals.password,_globals.uid); break; case "do-Friends": var thisauth=_globals.auth; //this.controller.stageController.popScene(); this.controller.stageController.swapScene({name: "friends-list", transition: Mojo.Transition.crossFade},thisauth,_globals.userData,_globals.username,_globals.password,_globals.uid,_globals.lat,_globals.long,this); break; case "do-Profile": case "do-Badges": var thisauth=_globals.auth; this.controller.stageController.swapScene({name: "user-info", transition: Mojo.Transition.crossFade},thisauth,"",this); break; case "do-Tips": var thisauth=_globals.auth; //this.controller.stageController.popScene(); this.controller.stageController.swapScene({name: "nearby-tips", transition: Mojo.Transition.crossFade},thisauth,"",this); break; case "do-Todos": var thisauth=_globals.auth; //this.controller.stageController.popScene(); this.controller.stageController.swapScene({name: "todos", transition: Mojo.Transition.crossFade},thisauth,"",this); break; case "do-Shout": break; case "do-Leaderboard": var thisauth=_globals.auth; //this.controller.stageController.popScene(); this.controller.stageController.swapScene({name: "leaderboard", transition: Mojo.Transition.crossFade},thisauth,"",this); break; case "do-About": this.controller.stageController.pushScene({name: "about", transition: Mojo.Transition.crossFade}); break; case "do-Prefs": this.controller.stageController.pushScene({name: "preferences", transition: Mojo.Transition.zoomFade},this); break; case "do-Update": _globals.checkUpdate(this); break; case "do-Nothing": break; case "toggleMenu": NavMenu.toggleMenu(); break; } } } ShoutAssistant.prototype.attachImage = function(event) { Mojo.FilePicker.pickFile({'actionName':'Attach','kinds':['image','video'],'defaultKind':'image','onSelect':function(fn){ this.fileName=fn.fullPath; this.hasPhoto=true; if(fn.attachmentType=="image"){ var icon="/var/luna/data/extractfs"+encodeURIComponent(this.fileName)+":0:0:150:150:2" this.phModel.choices=this.imageHosts; this.urllen=this.urlLengths[this.phModel.value]; }else{ var icon=fn.iconPath; this.phModel.choices=this.videoHosts; this.urllen=this.urlLengths[this.phModel.value]; } var charsLeft=140-this.urllen-this.controller.get("shout").mojo.getValue().length; this.controller.get("charCount").innerHTML=charsLeft; this.controller.modelChanged(this.phModel); this.controller.get("img").src=icon; this.controller.get("img-preview").show(); this.controller.get("photohostList").show(); if(charsLeft<0){ if(!this.controller.get("charCount").hasClassName("negative")){ this.controller.get("charCount").addClassName("negative"); } }else{ if(this.controller.get("charCount").hasClassName("negative")){ this.controller.get("charCount").removeClassName("negative"); } } // this.controller.get("listborder").show(); }.bind(this)},this.controller.stageController); } ShoutAssistant.prototype.removeImage = function(event) { this.controller.get("img").src=""; this.hasPhoto=false; this.fileName=""; this.controller.get("img-preview").hide(); this.controller.get("shout").mojo.focus(); this.controller.get("photohostList").hide(); this.urllen=0; var charsLeft=140-this.urllen-this.controller.get("shout").mojo.getValue().length; this.controller.get("charCount").innerHTML=charsLeft; // this.controller.get("listborder").hide(); if(charsLeft<0){ if(!this.controller.get("charCount").hasClassName("negative")){ this.controller.get("charCount").addClassName("negative"); } }else{ if(this.controller.get("charCount").hasClassName("negative")){ this.controller.get("charCount").removeClassName("negative"); } } } ShoutAssistant.prototype.handlePhotohost = function(event) { logthis("changed"); var ph=this.phModel.value; this.urllen=this.urlLengths[this.phModel.value]; var charsLeft=140-this.urllen-this.controller.get("shout").mojo.getValue().length; this.controller.get("charCount").innerHTML=charsLeft; this.cookieData=new Mojo.Model.Cookie("photohost"); this.cookieData.put( {"photohost":ph} ) _globals.lasthost=ph; } ShoutAssistant.prototype.deactivate = function(event) { } ShoutAssistant.prototype.cleanup = function(event) { Mojo.Event.stopListening(this.controller.get("photohostList"), Mojo.Event.propertyChange, this.handlePhotohostBound); Mojo.Event.stopListening(this.controller.get('share-twitter'), Mojo.Event.tap, this.handleTwitterBound); Mojo.Event.stopListening(this.controller.get('share-facebook'), Mojo.Event.tap, this.handleFacebookBound); Mojo.Event.stopListening(this.controller.get('okButtonShout'), Mojo.Event.tap, this.okTappedShoutBound); Mojo.Event.stopListening(this.controller.get('attach'), Mojo.Event.tap, this.attachImageBound); Mojo.Event.stopListening(this.controller.get('img-preview'), Mojo.Event.tap, this.removeImageBound); Mojo.Event.stopListening(this.controller.get('attach'), "mousedown", this.attachDownBound); Mojo.Event.stopListening(this.controller.get('attach'), "mouseup", this.attachUpBound); Mojo.Event.stopListening(this.controller.document, "keyup", this.shoutKeyPressBound); }
{ "pile_set_name": "Github" }
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta content="Apache Forrest" name="Generator"> <meta name="Forrest-version" content="0.10-dev"> <meta name="Forrest-skin-name" content="pelt"> <title>Apache&trade; FOP Development: RTFLib (jfor)</title> <link type="text/css" href="../skin/basic.css" rel="stylesheet"> <link media="screen" type="text/css" href="../skin/screen.css" rel="stylesheet"> <link media="print" type="text/css" href="../skin/print.css" rel="stylesheet"> <link type="text/css" href="../skin/profile.css" rel="stylesheet"> <script src="../skin/getBlank.js" language="javascript" type="text/javascript"></script><script src="../skin/getMenu.js" language="javascript" type="text/javascript"></script><script src="../skin/fontsize.js" language="javascript" type="text/javascript"></script> <link rel="shortcut icon" href="../favicon.ico"> </head> <body onload="init()"> <script type="text/javascript">ndeSetTextSize();</script> <div id="top"> <!--+ |header +--> <div class="header"> <!--+ |start group logo +--> <div class="grouplogo"> <a href="http://xmlgraphics.apache.org/"><img class="logoImage" alt="Apache XML Graphics" src="../images/group-logo.gif" title="Apache XML Graphics is responsible for the creation and maintenance of software for managing the conversion of XML formats to graphical output, and the creation and maintenance of related software components, based on software licensed to the Foundation"></a> </div> <!--+ |end group logo +--> <!--+ |start Project Logo +--> <div class="projectlogo"> <a href="http://xmlgraphics.apache.org/fop/"><img class="logoImage" alt="Apache FOP" src="../images/logo.jpg" title="Apache FOP (Formatting Objects Processor) is the world's first output independent formatter. Output formats currently supported include PDF, PCL, PS, SVG, XML (area tree representation), Print, AWT, MIF and TXT. The primary output target is PDF."></a> </div> <!--+ |end Project Logo +--> <!--+ |start Search +--> <div class="searchbox"> <form action="http://www.google.com/search" method="get" class="roundtopsmall"> <input value="xmlgraphics.apache.org" name="sitesearch" type="hidden"><input onFocus="getBlank (this, 'Search the site with google');" size="25" name="q" id="query" type="text" value="Search the site with google">&nbsp; <input name="Search" value="Search" type="submit"> </form> </div> <!--+ |end search +--> <!--+ |start Tabs +--> <ul id="tabs"> <li> <a class="unselected" href="../index.html">Home</a> </li> <li> <a class="unselected" href="../1.0/index.html">Version 1.0</a> </li> <li> <a class="unselected" href="../1.1/index.html">Version 1.1</a> </li> <li> <a class="unselected" href="../trunk/index.html">FOP Trunk</a> </li> <li class="current"> <a class="selected" href="../dev/index.html">Development</a> </li> </ul> <!--+ |end Tabs +--> </div> </div> <div id="main"> <div id="publishedStrip"> <!--+ |start Subtabs +--> <div id="level2tabs"></div> <!--+ |end Endtabs +--> <script type="text/javascript"><!-- document.write("Last Published: " + document.lastModified); // --></script> </div> <!--+ |breadtrail +--> <div class="breadtrail"> <a href="http://www.apache.org/">The Apache Software Foundation</a> &gt; <a href="http://xmlgraphics.apache.org/">Apache XML Graphics Project</a><script src="../skin/breadcrumbs.js" language="JavaScript" type="text/javascript"></script> </div> <!--+ |start Menu, mainarea +--> <!--+ |start Menu +--> <div id="menu"> <div onclick="SwitchMenu('menu_1.1', '../skin/')" id="menu_1.1Title" class="menutitle">About</div> <div id="menu_1.1" class="menuitemgroup"> <div class="menuitem"> <a href="../dev/index.html">Basics</a> </div> </div> <div onclick="SwitchMenu('menu_1.2', '../skin/')" id="menu_1.2Title" class="menutitle">Design</div> <div id="menu_1.2" class="menuitemgroup"> <div onclick="SwitchMenu('menu_1.2.1', '../skin/')" id="menu_1.2.1Title" class="menutitle">About</div> <div id="menu_1.2.1" class="menuitemgroup"> <div class="menuitem"> <a href="../dev/design/index.html">Introduction</a> </div> </div> <div onclick="SwitchMenu('menu_1.2.2', '../skin/')" id="menu_1.2.2Title" class="menutitle">Core Process</div> <div id="menu_1.2.2" class="menuitemgroup"> <div class="menuitem"> <a href="../dev/design/startup.html">Startup</a> </div> <div class="menuitem"> <a href="../dev/design/parsing.html">XML Parsing</a> </div> <div class="menuitem"> <a href="../dev/design/fotree.html">FO Tree</a> </div> <div class="menuitem"> <a href="../dev/design/properties.html">Properties</a> </div> <div class="menuitem"> <a href="../dev/design/layout.html">Layout</a> </div> <div class="menuitem"> <a href="../dev/design/breakpos.html">Break Possibility</a> </div> <div class="menuitem"> <a href="../dev/design/areas.html">Area Tree</a> </div> <div class="menuitem"> <a href="../dev/design/renderers.html">Renderers</a> </div> </div> <div onclick="SwitchMenu('menu_1.2.3', '../skin/')" id="menu_1.2.3Title" class="menutitle">Miscellaneous</div> <div id="menu_1.2.3" class="menuitemgroup"> <div class="menuitem"> <a href="../dev/design/images.html">Images</a> </div> <div class="menuitem"> <a href="../dev/design/pdf-library.html">PDF Library</a> </div> <div class="menuitem"> <a href="../dev/design/svg.html">SVG</a> </div> <div class="menuitem"> <a href="../dev/design/embedding.html">Embedding</a> </div> <div class="menuitem"> <a href="../dev/design/extending.html">Extending</a> </div> <div class="menuitem"> <a href="../dev/design/optimise.html">Optimisations</a> </div> <div class="menuitem"> <a href="../dev/design/useragent.html">User Agent</a> </div> </div> <div class="menuitem"> <a href="http://wiki.apache.org/xmlgraphics-fop/FOPProjectPages">Unresolved (Wiki)</a> </div> <div class="menuitem"> <a href="../dev/svg.html">SVG</a> </div> <div class="menuitem"> <a href="../dev/extensions.html">Extensions</a> </div> </div> <div onclick="SwitchMenu('menu_1.3', '../skin/')" id="menu_1.3Title" class="menutitle">Develop</div> <div id="menu_1.3" class="menuitemgroup"> <div class="menuitem"> <a href="../dev/implement.html">Walk-Thru</a> </div> <div class="menuitem"> <a href="http://issues.apache.org/bugzilla/buglist.cgi?bug_status=NEW&amp;bug_status=ASSIGNED&amp;bug_status=REOPENED&amp;email1=&amp;emailtype1=substring&amp;emailassigned_to1=1&amp;email2=&amp;emailtype2=substring&amp;emailreporter2=1&amp;bugidtype=include&amp;bug_id=&amp;changedin=&amp;votes=&amp;chfieldfrom=&amp;chfieldto=Now&amp;chfieldvalue=&amp;product=Fop&amp;short_desc=%5BPATCH%5D&amp;short_desc_type=allwordssubstr&amp;long_desc=&amp;long_desc_type=allwordssubstr&amp;bug_file_loc=&amp;bug_file_loc_type=allwordssubstr&amp;keywords=&amp;keywords_type=anywords&amp;field0-0-0=noop&amp;type0-0-0=noop&amp;value0-0-0=&amp;namedcmd=Fop+all&amp;newqueryname=fop+patch+queue&amp;tofooter=1&amp;order=Reuse+same+sort+as+last+time">Patch Queue</a> </div> <div class="menuitem"> <a href="../dev/conventions.html">Conventions</a> </div> </div> <div onclick="SwitchMenu('menu_1.4', '../skin/')" id="menu_1.4Title" class="menutitle">Test</div> <div id="menu_1.4" class="menuitemgroup"> <div class="menuitem"> <a href="../dev/testing.html">Testing</a> </div> </div> <div onclick="SwitchMenu('menu_1.5', '../skin/')" id="menu_1.5Title" class="menutitle">Deploy</div> <div id="menu_1.5" class="menuitemgroup"> <div class="menuitem"> <a href="../dev/doc.html">Doc Mgmt</a> </div> <div class="menuitem"> <a href="../dev/release.html">Release</a> </div> <div class="menuitem"> <a href="http://issues.apache.org/bugzilla/buglist.cgi?bug_status=NEW&amp;bug_status=ASSIGNED&amp;bug_status=REOPENED&amp;email1=&amp;emailtype1=substring&amp;emailassigned_to1=1&amp;email2=&amp;emailtype2=substring&amp;emailreporter2=1&amp;bugidtype=include&amp;bug_id=&amp;changedin=&amp;votes=&amp;chfieldfrom=&amp;chfieldto=Now&amp;chfieldvalue=&amp;product=Fop&amp;short_desc=&amp;short_desc_type=allwordssubstr&amp;long_desc=&amp;long_desc_type=allwordssubstr&amp;bug_file_loc=&amp;bug_file_loc_type=allwordssubstr&amp;keywords=&amp;keywords_type=anywords&amp;field0-0-0=noop&amp;type0-0-0=noop&amp;value0-0-0=&amp;order=bug_severity%2Cpriority%20DESC">Bugs</a> </div> </div> <div onclick="SwitchMenu('menu_1.6', '../skin/')" id="menu_1.6Title" class="menutitle">Resources</div> <div id="menu_1.6" class="menuitemgroup"> <div class="menuitem"> <a href="../dev/faq.html">FAQs</a> </div> <div class="menuitem"> <a href="../dev/tools.html">Tools</a> </div> <div class="menuitem"> <a href="http://svn.apache.org/viewvc/xmlgraphics/fop">ViewVC</a> </div> </div> <div onclick="SwitchMenu('menu_selected_1.7', '../skin/')" id="menu_selected_1.7Title" class="menutitle" style="background-image: url('../skin/images/chapter_open.gif');">SubPackages</div> <div id="menu_selected_1.7" class="selectedmenuitemgroup" style="display: block;"> <div class="menupage"> <div class="menupagetitle">RTFlib</div> </div> </div> <div id="credit"></div> <div id="roundbottom"> <img style="display: none" class="corner" height="15" width="15" alt="" src="../skin/images/rc-b-l-15-1body-2menu-3menu.png"></div> <!--+ |alternative credits +--> <div id="credit2"></div> </div> <!--+ |end Menu +--> <!--+ |start content +--> <div id="content"> <div title="raw XML" class="xmllink"> <a class="dida" href="rtflib.xml"><img alt="XML - icon" src="../skin/images/xmldoc.gif" class="skin"><br> XML</a> </div> <div title="Portable Document Format" class="pdflink"> <a class="dida" href="rtflib.pdf"><img alt="PDF -icon" src="../skin/images/pdfdoc.gif" class="skin"><br> PDF</a> </div> <div class="trail">Font size: &nbsp;<input value="Reset" class="resetfont" title="Reset text" onclick="ndeSetTextSize('reset'); return false;" type="button"> &nbsp;<input value="-a" class="smallerfont" title="Shrink text" onclick="ndeSetTextSize('decr'); return false;" type="button"> &nbsp;<input value="+a" class="biggerfont" title="Enlarge text" onclick="ndeSetTextSize('incr'); return false;" type="button"> </div> <h1>Apache&trade; FOP Development: RTFLib (jfor)</h1> <div id="front-matter"> <div id="minitoc-area"> <ul class="minitoc"> <li> <a href="#general">General Information</a> <ul class="minitoc"> <li> <a href="#intro">Introduction</a> </li> <li> <a href="#history">History</a> </li> <li> <a href="#status">Status</a> </li> </ul> </li> <li> <a href="#userdoc">User Documentation</a> <ul class="minitoc"> <li> <a href="#userdoc-overview">Overview</a> </li> <li> <a href="#userdoc-structure">Document Structure</a> </li> <li> <a href="#userdoc-attributes">Attributes</a> <ul class="minitoc"> <li> <a href="#userdoc-attr-ig">Information Group</a> </li> <li> <a href="#userdoc-attr-df">Document Formatting</a> </li> <li> <a href="#userdoc-attr-sf">Section Formatting</a> </li> <li> <a href="#userdoc-attr-pf">Paragraph Formatting</a> </li> <li> <a href="#userdoc-attr-cf">Character Formatting</a> </li> </ul> </li> </ul> </li> </ul> </div> </div> <a name="general"></a> <h2 class="underlined_10">General Information</h2> <div class="section"> <a name="intro"></a> <h3 class="underlined_5">Introduction</h3> <p>The RTFLib package is an open-source, <em>independent</em> package suitable for writing RTF files in a java environment. By <em>independent</em> we mean:</p> <ul> <li>Although it is used by Apache&trade; FOP to generate FOP's RTF output, it is not dependent on FOP for any of its functionality.</li> <li>It does not require FOP as a front-end, nor does it even require XSL-FO for input. It essentially exposes an API of relatively high-level RTF construction routines to a host program. This means it can be used anywhere RTF output is required and java is available.</li> </ul> <p>The FOP development team intends to keep the RTFLib package independent so that it can be used for other purposes.</p> <a name="history"></a> <h3 class="underlined_5">History</h3> <p>RTFLib was originally developed by <a href="mailto:bdelacretaz.at.apache.org">Bertrand Delacr&eacute;taz</a> and the <a class="external" href="http://www.jfor.org">jfor</a> team. jfor was written under an Apache-style license, and the jfor team contributed the code to the Apache Software Foundation in June, 2003. RTFLib is a subset of the original jfor project, which also includes an XSL-FO parsing mechanism for a complete XSL-FO to RTF solution.</p> <a name="status"></a> <h3 class="underlined_5">Status</h3> <p>Although FOP's implementation of the RTFLib package is very incomplete, the RTFLib package itself is relatively mature. RTFLib is only available in the trunk <a href="index.html#lines">line of FOP development</a>.</p> <div class="warning"> <div class="label">Warning</div> <div class="content">This documentation is a work in progress. If you see errors or omissions, please report them to the <a href="index.html#mail-fop-dev">fop-dev mailing list</a>.</div> </div> </div> <a name="userdoc"></a> <h2 class="underlined_10">User Documentation</h2> <div class="section"> <a name="userdoc-overview"></a> <h3 class="underlined_5">Overview</h3> <p>Perhaps the easiest way to see how to use RTFLib is by looking at an example. A set of test documents is part of the package, and can be <a class="external" href="http://cvs.apache.org/viewcvs.cgi/xml-fop/src/java/org/apache/fop/rtf/rtflib/testdocs/">viewed online</a>. A quick look at the Abstract <a class="external" href="http://cvs.apache.org/viewcvs.cgi/xml-fop/src/java/org/apache/fop/rtf/rtflib/testdocs/TestDocument.java?rev=HEAD&amp;content-type=text/vnd.viewcvs-markup">TestDocument</a> class, and one of the Concrete subclasses, <a class="external" href="http://cvs.apache.org/viewcvs.cgi/xml-fop/src/java/org/apache/fop/rtf/rtflib/testdocs/SimpleDocument.java?rev=HEAD&amp;content-type=text/vnd.viewcvs-markup">SimpleDocument</a> will provide the basics of how to use the package.</p> <p>There are two basic concepts you will need to understand in order to use RTFLib:</p> <ul> <li>Documents are created by filling bigger containers with successively smaller containers, and eventually with content.</li> <li>Attributes may be set for each container or content as it is created</li> </ul> <p>RTFLib handles the process of converting to and writing the RTF content as the document is created. All you need to do is flush the document at the end to make sure that the last pieces get written.</p> <a name="userdoc-structure"></a> <h3 class="underlined_5">Document Structure</h3> <div class="warning"> <div class="label">Warning</div> <div class="content">This section is very incomplete.</div> </div> <p>The documentation in this section is intended to provide a high-level view of the process of building an RTF document. For more detailed API documentation of the various methods, be sure to consult the Javadocs for RTFLib.</p> <p>The following table summarizes the various containers that can be created:</p> <table class="ForrestTable" cellspacing="1" cellpadding="4"> <tr> <th colspan="1" rowspan="1">Name</th> <th colspan="1" rowspan="1">Class.Method where created</th> <th colspan="1" rowspan="1">Attribute Set(s)</th> <th colspan="1" rowspan="1">Valid children</th> </tr> <tr> <td colspan="1" rowspan="1">Document Area</td> <td colspan="1" rowspan="1">RtfFile.startDocumentArea()</td> <td colspan="1" rowspan="1">Information Group, Document Formatting</td> <td colspan="1" rowspan="1">Section</td> </tr> <tr> <td colspan="1" rowspan="1">Section</td> <td colspan="1" rowspan="1">RtfDocumentArea.newSection()</td> <td colspan="1" rowspan="1">Section Formatting</td> <td colspan="1" rowspan="1">Paragraph, ParagraphKeepTogether, Image, List, Before (Page Heading), After (Page Footer), JforCmd</td> </tr> <tr> <td colspan="1" rowspan="1">Paragraph</td> <td colspan="1" rowspan="1">RtfSection.newParagraph()</td> <td colspan="1" rowspan="1">Paragraph Formatting, Character Formatting</td> <td colspan="1" rowspan="1">Text</td> </tr> <tr> <td colspan="1" rowspan="1">ParagraphKeepTogether</td> <td colspan="1" rowspan="1">RtfSection.newParagraphKeepTogether</td> <td colspan="1" rowspan="1">.</td> <td colspan="1" rowspan="1">.</td> </tr> <tr> <td colspan="1" rowspan="1">Image</td> <td colspan="1" rowspan="1">RtfSection.newImage</td> <td colspan="1" rowspan="1">.</td> <td colspan="1" rowspan="1">.</td> </tr> <tr> <td colspan="1" rowspan="1">Table</td> <td colspan="1" rowspan="1">RtfSection.newTable</td> <td colspan="1" rowspan="1">.</td> <td colspan="1" rowspan="1">.</td> </tr> <tr> <td colspan="1" rowspan="1">List</td> <td colspan="1" rowspan="1">RtfSection.newList</td> <td colspan="1" rowspan="1">.</td> <td colspan="1" rowspan="1">.</td> </tr> <tr> <td colspan="1" rowspan="1">Before (Page Heading)</td> <td colspan="1" rowspan="1">RtfSection.newBefore</td> <td colspan="1" rowspan="1">.</td> <td colspan="1" rowspan="1">.</td> </tr> <tr> <td colspan="1" rowspan="1">After (Page Footer)</td> <td colspan="1" rowspan="1">RtfSection.newAfter</td> <td colspan="1" rowspan="1">.</td> <td colspan="1" rowspan="1">.</td> </tr> <tr> <td colspan="1" rowspan="1">JforCmd</td> <td colspan="1" rowspan="1">RtfSection.newJforCmd</td> <td colspan="1" rowspan="1">.</td> <td colspan="1" rowspan="1">.</td> </tr> <tr> <td colspan="1" rowspan="1">Text</td> <td colspan="1" rowspan="1">RtfParagraph.newText()</td> <td colspan="1" rowspan="1">Character Formatting</td> <td colspan="1" rowspan="1">N/A</td> </tr> </table> <a name="userdoc-attributes"></a> <h3 class="underlined_5">Attributes</h3> <div class="warning"> <div class="label">Warning</div> <div class="content">This section is very incomplete.</div> </div> <p>Attributes can be set for each container and piece of content in the document. The general approach is to build an RtfAttributes object containing the various attributes, then pass that RtfAttributes object to the method that creates the new container or content. See the Javadoc API documentation for RtfAttributes for details on the syntax for creating an RtfAttributes object. The following information lists the various attributes that can be set for each type of container.</p> <a name="userdoc-attr-ig"></a> <h4>Information Group</h4> <p>These attributes are set when creating a Document.</p> <a name="userdoc-attr-df"></a> <h4>Document Formatting</h4> <p>These attributes are set when creating a Document.</p> <a name="userdoc-attr-sf"></a> <h4>Section Formatting</h4> <p>These attributes are set when creating a Section.</p> <a name="userdoc-attr-pf"></a> <h4>Paragraph Formatting</h4> <p>These attributes are set when creating a Paragraph.</p> <table class="ForrestTable" cellspacing="1" cellpadding="4"> <tr> <th colspan="1" rowspan="1">Description</th> <th colspan="1" rowspan="1">Attribute Name</th> <th colspan="1" rowspan="1">Attribute Value</th> <th colspan="1" rowspan="1">RTF Control Word</th> </tr> <tr> <td colspan="4" rowspan="1">.</td> </tr> <tr> <th colspan="1" rowspan="1">Alignment</th> <th colspan="3" rowspan="1">.</th> </tr> <tr> <td colspan="1" rowspan="1">Align Left</td> <td colspan="1" rowspan="1">RtfText.ALIGN_LEFT</td> <td colspan="1" rowspan="1">N/A (boolean)</td> <td colspan="1" rowspan="1">\ql</td> </tr> <tr> <td colspan="1" rowspan="1">Align Right</td> <td colspan="1" rowspan="1">RtfText.ALIGN_RIGHT</td> <td colspan="1" rowspan="1">N/A (boolean)</td> <td colspan="1" rowspan="1">\qr</td> </tr> <tr> <td colspan="1" rowspan="1">Align Centered</td> <td colspan="1" rowspan="1">RtfText.ALIGN_CENTER</td> <td colspan="1" rowspan="1">N/A (boolean)</td> <td colspan="1" rowspan="1">\qc</td> </tr> <tr> <td colspan="1" rowspan="1">Align Justified</td> <td colspan="1" rowspan="1">RtfText.ALIGN_JUSTIFIED</td> <td colspan="1" rowspan="1">N/A (boolean)</td> <td colspan="1" rowspan="1">\qj</td> </tr> <tr> <td colspan="1" rowspan="1">Align Distributed</td> <td colspan="1" rowspan="1">RtfText.ALIGN_DISTRIBUTED</td> <td colspan="1" rowspan="1">N/A (boolean)</td> <td colspan="1" rowspan="1">\qd</td> </tr> <tr> <td colspan="1" rowspan="1">Kashida justification</td> <td colspan="1" rowspan="1">not implemented</td> <td colspan="1" rowspan="1">0-20 (integer)</td> <td colspan="1" rowspan="1">\qkN</td> </tr> <tr> <td colspan="1" rowspan="1">Thai Distributed justification</td> <td colspan="1" rowspan="1">not implemented</td> <td colspan="1" rowspan="1">N/A (boolean)</td> <td colspan="1" rowspan="1">\qt</td> </tr> <tr> <th colspan="1" rowspan="1">Indentation</th> <th colspan="3" rowspan="1">.</th> </tr> <tr> <td colspan="1" rowspan="1">Left indent body</td> <td colspan="1" rowspan="1">RtfText.LEFT_INDENT_BODY</td> <td colspan="1" rowspan="1">(int) "hundredths of a character unit" (?)</td> <td colspan="1" rowspan="1">\li</td> </tr> <tr> <td colspan="1" rowspan="1">Left indent first</td> <td colspan="1" rowspan="1">RtfText.LEFT_INDENT_FIRST</td> <td colspan="1" rowspan="1">(int) "hundredths of a character unit" (?)</td> <td colspan="1" rowspan="1">\fi</td> </tr> <tr> <th colspan="1" rowspan="1">Borders</th> <th colspan="3" rowspan="1">.</th> </tr> <tr> <td colspan="1" rowspan="1">Bottom single border</td> <td colspan="1" rowspan="1">RtfText.BDR_BOTTOM_SINGLE</td> <td colspan="1" rowspan="1">Boolean?</td> <td colspan="1" rowspan="1">brdrb\\brsp40\\brdrs</td> </tr> <tr> <td colspan="1" rowspan="1">Bottom double border</td> <td colspan="1" rowspan="1">RtfText.BDR_BOTTOM_DOUBLE</td> <td colspan="1" rowspan="1">Boolean?</td> <td colspan="1" rowspan="1">brdrb\\brsp40\\brdrdb</td> </tr> <tr> <td colspan="1" rowspan="1">Bottom embossed border</td> <td colspan="1" rowspan="1">RtfText.BDR_BOTTOM_EMBOSS</td> <td colspan="1" rowspan="1">Boolean?</td> <td colspan="1" rowspan="1">brdrb\\brsp40\\brdremboss</td> </tr> <tr> <td colspan="1" rowspan="1">bottom dotted border</td> <td colspan="1" rowspan="1">RtfText.BDR_BOTTOM_DOTTED</td> <td colspan="1" rowspan="1">Boolean?</td> <td colspan="1" rowspan="1">brdrb\\brsp40\\brdrdot</td> </tr> <tr> <td colspan="1" rowspan="1">bottom dashed border</td> <td colspan="1" rowspan="1">RtfText.BDR_BOTTOM_DASH</td> <td colspan="1" rowspan="1">Boolean?</td> <td colspan="1" rowspan="1">brdrb\\brsp40\\brdrdash</td> </tr> </table> <a name="userdoc-attr-cf"></a> <h4>Character Formatting</h4> <p>These attributes are set when creating a Paragraph, or Text.</p> <table class="ForrestTable" cellspacing="1" cellpadding="4"> <tr> <th colspan="1" rowspan="1">Description</th> <th colspan="1" rowspan="1">Attribute Name</th> <th colspan="1" rowspan="1">Attribute Value</th> <th colspan="1" rowspan="1">RTF Control Word</th> </tr> <tr> <td colspan="1" rowspan="1">Bold</td> <td colspan="1" rowspan="1">RtfText.ATTR_BOLD</td> <td colspan="1" rowspan="1">N/A (boolean)</td> <td colspan="1" rowspan="1">\b</td> </tr> <tr> <td colspan="1" rowspan="1">Italic</td> <td colspan="1" rowspan="1">RtfText.ATTR_ITALIC</td> <td colspan="1" rowspan="1">N/A (boolean)</td> <td colspan="1" rowspan="1">\i</td> </tr> <tr> <td colspan="1" rowspan="1">Underline</td> <td colspan="1" rowspan="1">RtfText.ATTR_UNDERLINE</td> <td colspan="1" rowspan="1">N/A (boolean), or (int) 0 to turn underlining off</td> <td colspan="1" rowspan="1">\ul</td> </tr> <tr> <td colspan="1" rowspan="1">Font Size</td> <td colspan="1" rowspan="1">RtfText.ATTR_FONT_SIZE</td> <td colspan="1" rowspan="1">(int) font size in half-points</td> <td colspan="1" rowspan="1">\fs</td> </tr> <tr> <td colspan="1" rowspan="1">Font Family</td> <td colspan="1" rowspan="1">RtfText.ATTR_FONT_FAMILY</td> <td colspan="1" rowspan="1">(int) entry in document font-table</td> <td colspan="1" rowspan="1">\f</td> </tr> <tr> <td colspan="1" rowspan="1">Font Color</td> <td colspan="1" rowspan="1">RtfText.ATTR_FONT_COLOR</td> <td colspan="1" rowspan="1">(int) entry in document color-table</td> <td colspan="1" rowspan="1">\cf</td> </tr> <tr> <td colspan="1" rowspan="1">Background Color</td> <td colspan="1" rowspan="1">RtfText.ATTR_BACKGROUND_COLOR</td> <td colspan="1" rowspan="1">(int) entry in document color-table</td> <td colspan="1" rowspan="1">\chcbpat</td> </tr> </table> </div> <span class="version"> version 1298724</span> </div> <!--+ |end content +--> <div class="clearboth">&nbsp;</div> </div> <div id="footer"> <!--+ |start bottomstrip +--> <div class="lastmodified"> <script type="text/javascript"><!-- document.write("Last Published: " + document.lastModified); // --></script> </div> <div class="copyright"> Copyright &copy; 1999-2012 <a href="http://www.apache.org/licenses/">The Apache Software Foundation. Licensed under Apache License 2.0</a> <br> Apache, Apache FOP, the Apache feather logo, and the Apache FOP logos are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners. </div> <!--+ |end bottomstrip +--> </div> </body> </html>
{ "pile_set_name": "Github" }
<launch> <arg name="visualization" default="false" doc="turns on and off visualization with rviz"/> <!-- send Panda urdf to parameter server --> <param name="robot_description" command="$(find xacro)/xacro --inorder '$(find franka_description)/robots/panda_arm_hand.urdf.xacro'" /> <include file="$(find moveit_resources)/panda_moveit_config/launch/planning_context.launch"/> <node name="compare_collision_checking_speed" pkg="moveit_ros_planning" type="moveit_compare_collision_checking_speed_fcl_bullet" respawn="false" output="screen"> <rosparam command="load" file="$(find moveit_resources)/panda_moveit_config/config/kinematics.yaml"/> <param name="visualization" value="$(arg visualization)" type="bool"/> </node> <include if="$(arg visualization)" file="$(find moveit_resources)/panda_moveit_config/launch/demo.launch"/> </launch>
{ "pile_set_name": "Github" }
/* * Created on Jul 6, 2007 * * Copyright (c) 2007, The JUNG Authors * * All rights reserved. * * This software is open-source under the BSD license; see either * "license.txt" or * https://github.com/jrtom/jung/blob/master/LICENSE for a description. */ package edu.uci.ics.jung.algorithms.scoring; import java.util.Map; /** * An interface for algorithms that assign scores to edges. * * @param <E> the edge type * @param <S> the score type */ public interface EdgeScorer<E, S> { /** * @param e the edge whose score is requested * @return the algorithm's score for this edge */ public S getEdgeScore(E e); public Map<E, S> edgeScores(); }
{ "pile_set_name": "Github" }
/* -*- c -*- */ #ifndef _PROBES_H #define _PROBES_H #define DTRACE_PROBES_DISABLED 1 #define RUBY_DTRACE_METHOD_ENTRY_ENABLED() 0 #define RUBY_DTRACE_METHOD_ENTRY(classname, methodname, filename, lineno) do {} while (0) #define RUBY_DTRACE_METHOD_RETURN_ENABLED() 0 #define RUBY_DTRACE_METHOD_RETURN(classname, methodname, filename, lineno) do {} while (0) #define RUBY_DTRACE_CMETHOD_ENTRY_ENABLED() 0 #define RUBY_DTRACE_CMETHOD_ENTRY(classname, methodname, filename, lineno) do {} while (0) #define RUBY_DTRACE_CMETHOD_RETURN_ENABLED() 0 #define RUBY_DTRACE_CMETHOD_RETURN(classname, methodname, filename, lineno) do {} while (0) #define RUBY_DTRACE_REQUIRE_ENTRY_ENABLED() 0 #define RUBY_DTRACE_REQUIRE_ENTRY(rquiredfile, filename, lineno) do {} while (0) #define RUBY_DTRACE_REQUIRE_RETURN_ENABLED() 0 #define RUBY_DTRACE_REQUIRE_RETURN(requiredfile, filename, lineno) do {} while (0) #define RUBY_DTRACE_FIND_REQUIRE_ENTRY_ENABLED() 0 #define RUBY_DTRACE_FIND_REQUIRE_ENTRY(requiredfile, filename, lineno) do {} while (0) #define RUBY_DTRACE_FIND_REQUIRE_RETURN_ENABLED() 0 #define RUBY_DTRACE_FIND_REQUIRE_RETURN(requiredfile, filename, lineno) do {} while (0) #define RUBY_DTRACE_LOAD_ENTRY_ENABLED() 0 #define RUBY_DTRACE_LOAD_ENTRY(loadedfile, filename, lineno) do {} while (0) #define RUBY_DTRACE_LOAD_RETURN_ENABLED() 0 #define RUBY_DTRACE_LOAD_RETURN(loadedfile, filename, lineno) do {} while (0) #define RUBY_DTRACE_RAISE_ENABLED() 0 #define RUBY_DTRACE_RAISE(classname, filename, lineno) do {} while (0) #define RUBY_DTRACE_OBJECT_CREATE_ENABLED() 0 #define RUBY_DTRACE_OBJECT_CREATE(classname, filename, lineno) do {} while (0) #define RUBY_DTRACE_ARRAY_CREATE_ENABLED() 0 #define RUBY_DTRACE_ARRAY_CREATE(length, filename, lineno) do {} while (0) #define RUBY_DTRACE_HASH_CREATE_ENABLED() 0 #define RUBY_DTRACE_HASH_CREATE(length, filename, lineno) do {} while (0) #define RUBY_DTRACE_STRING_CREATE_ENABLED() 0 #define RUBY_DTRACE_STRING_CREATE(length, filename, lineno) do {} while (0) #define RUBY_DTRACE_SYMBOL_CREATE_ENABLED() 0 #define RUBY_DTRACE_SYMBOL_CREATE(str, filename, lineno) do {} while (0) #define RUBY_DTRACE_PARSE_BEGIN_ENABLED() 0 #define RUBY_DTRACE_PARSE_BEGIN(sourcefile, lineno) do {} while (0) #define RUBY_DTRACE_PARSE_END_ENABLED() 0 #define RUBY_DTRACE_PARSE_END(sourcefile, lineno) do {} while (0) #define RUBY_DTRACE_INSN_ENABLED() 0 #define RUBY_DTRACE_INSN(insns_name) do {} while (0) #define RUBY_DTRACE_INSN_OPERAND_ENABLED() 0 #define RUBY_DTRACE_INSN_OPERAND(val, insns_name) do {} while (0) #define RUBY_DTRACE_GC_MARK_BEGIN_ENABLED() 0 #define RUBY_DTRACE_GC_MARK_BEGIN() do {} while (0) #define RUBY_DTRACE_GC_MARK_END_ENABLED() 0 #define RUBY_DTRACE_GC_MARK_END() do {} while (0) #define RUBY_DTRACE_GC_SWEEP_BEGIN_ENABLED() 0 #define RUBY_DTRACE_GC_SWEEP_BEGIN() do {} while (0) #define RUBY_DTRACE_GC_SWEEP_END_ENABLED() 0 #define RUBY_DTRACE_GC_SWEEP_END() do {} while (0) #define RUBY_DTRACE_METHOD_CACHE_CLEAR_ENABLED() 0 #define RUBY_DTRACE_METHOD_CACHE_CLEAR(class, filename, lineno) do {} while (0) #endif /* _PROBES_H */
{ "pile_set_name": "Github" }
<Panel ux:Class="Outracks.Simulator.DeveloperMenu" Color="#000C" Clicked="Close" > <ClientPanel> <Button Alignment="TopLeft" Margin="20" Text="Go back" Clicked="GoBack" /> <StackPanel Alignment="Center"> <Text Alignment="Center" Color="White">Fuse Preview Menu</Text> <Text Alignment="Center" Color="#ddd">Tap to dismiss</Text> </StackPanel> </ClientPanel> <AddingAnimation> <Change this.Opacity="0" Easing="CubicIn" Duration="0.3" /> <Scale Factor="1.2" Duration="0.3" Easing="BackIn" /> </AddingAnimation> <RemovingAnimation> <Change this.Opacity="0" Easing="CubicOut" Duration="0.3" /> <Scale Factor="0.8" Duration="0.3" Easing="CubicOut" /> </RemovingAnimation> </Panel>
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <solid android:color="@color/qs_background_dark" /> <corners android:radius="8dp" /> </shape>
{ "pile_set_name": "Github" }
// <copyright file="GameInfo.cs" company="Google Inc."> // Copyright (C) 2015 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // </copyright> namespace GooglePlayGames { /// /// This file is automatically generated DO NOT EDIT! /// /// These are the constants defined in the Play Games Console for Game Services /// Resources. /// /// <summary> /// File containing information about the game. This is automatically updated by running the /// platform-appropriate setup commands in the Unity editor (which does a simple search / replace /// on the IDs in the form "__ID__"). We can check whether any particular field has been updated /// by checking whether it still retains its initial value - we prevent the constants from being /// replaced in the aforementioned search/replace by stripping off the leading and trailing "__". /// </summary> public static class GameInfo { private const string UnescapedApplicationId = "APP_ID"; private const string UnescapedIosClientId = "IOS_CLIENTID"; private const string UnescapedWebClientId = "WEB_CLIENTID"; private const string UnescapedNearbyServiceId = "NEARBY_SERVICE_ID"; public const string ApplicationId = "__APP_ID__"; // Filled in automatically public const string IosClientId = "__IOS_CLIENTID__"; // Filled in automatically public const string WebClientId = "__WEB_CLIENTID__"; // Filled in automatically public const string NearbyConnectionServiceId = "__NEARBY_SERVICE_ID__"; public static bool ApplicationIdInitialized() { return !string.IsNullOrEmpty(ApplicationId) && !ApplicationId.Equals(ToEscapedToken(UnescapedApplicationId)); } public static bool IosClientIdInitialized() { return !string.IsNullOrEmpty(IosClientId) && !IosClientId.Equals(ToEscapedToken(UnescapedIosClientId)); } public static bool WebClientIdInitialized() { return !string.IsNullOrEmpty(WebClientId) && !WebClientId.Equals(ToEscapedToken(UnescapedWebClientId)); } public static bool NearbyConnectionsInitialized() { return !string.IsNullOrEmpty(NearbyConnectionServiceId) && !NearbyConnectionServiceId.Equals(ToEscapedToken(UnescapedNearbyServiceId)); } /// <summary> /// Returns an escaped token (i.e. one flanked with "__") for the passed token /// </summary> /// <returns>The escaped token.</returns> /// <param name="token">The Token</param> private static string ToEscapedToken(string token) { return string.Format("__{0}__", token); } } }
{ "pile_set_name": "Github" }
package compute // Copyright (c) Microsoft and contributors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // // See the License for the specific language governing permissions and // limitations under the License. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "context" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/tracing" "net/http" ) // AvailabilitySetsClient is the compute Client type AvailabilitySetsClient struct { BaseClient } // NewAvailabilitySetsClient creates an instance of the AvailabilitySetsClient client. func NewAvailabilitySetsClient(subscriptionID string) AvailabilitySetsClient { return NewAvailabilitySetsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewAvailabilitySetsClientWithBaseURI creates an instance of the AvailabilitySetsClient client. func NewAvailabilitySetsClientWithBaseURI(baseURI string, subscriptionID string) AvailabilitySetsClient { return AvailabilitySetsClient{NewWithBaseURI(baseURI, subscriptionID)} } // CreateOrUpdate create or update an availability set. // Parameters: // resourceGroupName - the name of the resource group. // availabilitySetName - the name of the availability set. // parameters - parameters supplied to the Create Availability Set operation. func (client AvailabilitySetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters AvailabilitySet) (result AvailabilitySet, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.CreateOrUpdate") defer func() { sc := -1 if result.Response.Response != nil { sc = result.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, availabilitySetName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "CreateOrUpdate", nil, "Failure preparing request") return } resp, err := client.CreateOrUpdateSender(req) if err != nil { result.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "CreateOrUpdate", resp, "Failure sending request") return } result, err = client.CreateOrUpdateResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "CreateOrUpdate", resp, "Failure responding to request") } return } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. func (client AvailabilitySetsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters AvailabilitySet) (*http.Request, error) { pathParameters := map[string]interface{}{ "availabilitySetName": autorest.Encode("path", availabilitySetName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2017-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client AvailabilitySetsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always // closes the http.Response Body. func (client AvailabilitySetsClient) CreateOrUpdateResponder(resp *http.Response) (result AvailabilitySet, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } // Delete delete an availability set. // Parameters: // resourceGroupName - the name of the resource group. // availabilitySetName - the name of the availability set. func (client AvailabilitySetsClient) Delete(ctx context.Context, resourceGroupName string, availabilitySetName string) (result OperationStatusResponse, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.Delete") defer func() { sc := -1 if result.Response.Response != nil { sc = result.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } req, err := client.DeletePreparer(ctx, resourceGroupName, availabilitySetName) if err != nil { err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Delete", nil, "Failure preparing request") return } resp, err := client.DeleteSender(req) if err != nil { result.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Delete", resp, "Failure sending request") return } result, err = client.DeleteResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Delete", resp, "Failure responding to request") } return } // DeletePreparer prepares the Delete request. func (client AvailabilitySetsClient) DeletePreparer(ctx context.Context, resourceGroupName string, availabilitySetName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "availabilitySetName": autorest.Encode("path", availabilitySetName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2017-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. func (client AvailabilitySetsClient) DeleteSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } // DeleteResponder handles the response to the Delete request. The method always // closes the http.Response Body. func (client AvailabilitySetsClient) DeleteResponder(resp *http.Response) (result OperationStatusResponse, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } // Get retrieves information about an availability set. // Parameters: // resourceGroupName - the name of the resource group. // availabilitySetName - the name of the availability set. func (client AvailabilitySetsClient) Get(ctx context.Context, resourceGroupName string, availabilitySetName string) (result AvailabilitySet, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.Get") defer func() { sc := -1 if result.Response.Response != nil { sc = result.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } req, err := client.GetPreparer(ctx, resourceGroupName, availabilitySetName) if err != nil { err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Get", nil, "Failure preparing request") return } resp, err := client.GetSender(req) if err != nil { result.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Get", resp, "Failure responding to request") } return } // GetPreparer prepares the Get request. func (client AvailabilitySetsClient) GetPreparer(ctx context.Context, resourceGroupName string, availabilitySetName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "availabilitySetName": autorest.Encode("path", availabilitySetName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2017-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client AvailabilitySetsClient) GetSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } // GetResponder handles the response to the Get request. The method always // closes the http.Response Body. func (client AvailabilitySetsClient) GetResponder(resp *http.Response) (result AvailabilitySet, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } // List lists all availability sets in a resource group. // Parameters: // resourceGroupName - the name of the resource group. func (client AvailabilitySetsClient) List(ctx context.Context, resourceGroupName string) (result AvailabilitySetListResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.List") defer func() { sc := -1 if result.aslr.Response.Response != nil { sc = result.aslr.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } result.fn = client.listNextResults req, err := client.ListPreparer(ctx, resourceGroupName) if err != nil { err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "List", nil, "Failure preparing request") return } resp, err := client.ListSender(req) if err != nil { result.aslr.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "List", resp, "Failure sending request") return } result.aslr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "List", resp, "Failure responding to request") } return } // ListPreparer prepares the List request. func (client AvailabilitySetsClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2017-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client AvailabilitySetsClient) ListSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } // ListResponder handles the response to the List request. The method always // closes the http.Response Body. func (client AvailabilitySetsClient) ListResponder(resp *http.Response) (result AvailabilitySetListResult, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } // listNextResults retrieves the next set of results, if any. func (client AvailabilitySetsClient) listNextResults(ctx context.Context, lastResults AvailabilitySetListResult) (result AvailabilitySetListResult, err error) { req, err := lastResults.availabilitySetListResultPreparer(ctx) if err != nil { return result, autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "listNextResults", nil, "Failure preparing next results request") } if req == nil { return } resp, err := client.ListSender(req) if err != nil { result.Response = autorest.Response{Response: resp} return result, autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "listNextResults", resp, "Failure sending next results request") } result, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "listNextResults", resp, "Failure responding to next results request") } return } // ListComplete enumerates all values, automatically crossing page boundaries as required. func (client AvailabilitySetsClient) ListComplete(ctx context.Context, resourceGroupName string) (result AvailabilitySetListResultIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.List") defer func() { sc := -1 if result.Response().Response.Response != nil { sc = result.page.Response().Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } result.page, err = client.List(ctx, resourceGroupName) return } // ListAvailableSizes lists all available virtual machine sizes that can be used to create a new virtual machine in an // existing availability set. // Parameters: // resourceGroupName - the name of the resource group. // availabilitySetName - the name of the availability set. func (client AvailabilitySetsClient) ListAvailableSizes(ctx context.Context, resourceGroupName string, availabilitySetName string) (result VirtualMachineSizeListResult, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListAvailableSizes") defer func() { sc := -1 if result.Response.Response != nil { sc = result.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } req, err := client.ListAvailableSizesPreparer(ctx, resourceGroupName, availabilitySetName) if err != nil { err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListAvailableSizes", nil, "Failure preparing request") return } resp, err := client.ListAvailableSizesSender(req) if err != nil { result.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListAvailableSizes", resp, "Failure sending request") return } result, err = client.ListAvailableSizesResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListAvailableSizes", resp, "Failure responding to request") } return } // ListAvailableSizesPreparer prepares the ListAvailableSizes request. func (client AvailabilitySetsClient) ListAvailableSizesPreparer(ctx context.Context, resourceGroupName string, availabilitySetName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "availabilitySetName": autorest.Encode("path", availabilitySetName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2017-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}/vmSizes", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // ListAvailableSizesSender sends the ListAvailableSizes request. The method will close the // http.Response Body if it receives an error. func (client AvailabilitySetsClient) ListAvailableSizesSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } // ListAvailableSizesResponder handles the response to the ListAvailableSizes request. The method always // closes the http.Response Body. func (client AvailabilitySetsClient) ListAvailableSizesResponder(resp *http.Response) (result VirtualMachineSizeListResult, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } // ListBySubscription lists all availability sets in a subscription. // Parameters: // expand - the expand expression to apply to the operation. func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context, expand string) (result AvailabilitySetListResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListBySubscription") defer func() { sc := -1 if result.aslr.Response.Response != nil { sc = result.aslr.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } result.fn = client.listBySubscriptionNextResults req, err := client.ListBySubscriptionPreparer(ctx, expand) if err != nil { err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListBySubscription", nil, "Failure preparing request") return } resp, err := client.ListBySubscriptionSender(req) if err != nil { result.aslr.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListBySubscription", resp, "Failure sending request") return } result.aslr, err = client.ListBySubscriptionResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListBySubscription", resp, "Failure responding to request") } return } // ListBySubscriptionPreparer prepares the ListBySubscription request. func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Context, expand string) (*http.Request, error) { pathParameters := map[string]interface{}{ "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2017-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } if len(expand) > 0 { queryParameters["$expand"] = autorest.Encode("query", expand) } preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/availabilitySets", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // ListBySubscriptionSender sends the ListBySubscription request. The method will close the // http.Response Body if it receives an error. func (client AvailabilitySetsClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } // ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always // closes the http.Response Body. func (client AvailabilitySetsClient) ListBySubscriptionResponder(resp *http.Response) (result AvailabilitySetListResult, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } // listBySubscriptionNextResults retrieves the next set of results, if any. func (client AvailabilitySetsClient) listBySubscriptionNextResults(ctx context.Context, lastResults AvailabilitySetListResult) (result AvailabilitySetListResult, err error) { req, err := lastResults.availabilitySetListResultPreparer(ctx) if err != nil { return result, autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") } if req == nil { return } resp, err := client.ListBySubscriptionSender(req) if err != nil { result.Response = autorest.Response{Response: resp} return result, autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") } result, err = client.ListBySubscriptionResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") } return } // ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Context, expand string) (result AvailabilitySetListResultIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListBySubscription") defer func() { sc := -1 if result.Response().Response.Response != nil { sc = result.page.Response().Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } result.page, err = client.ListBySubscription(ctx, expand) return } // Update update an availability set. // Parameters: // resourceGroupName - the name of the resource group. // availabilitySetName - the name of the availability set. // parameters - parameters supplied to the Update Availability Set operation. func (client AvailabilitySetsClient) Update(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters AvailabilitySetUpdate) (result AvailabilitySet, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.Update") defer func() { sc := -1 if result.Response.Response != nil { sc = result.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } req, err := client.UpdatePreparer(ctx, resourceGroupName, availabilitySetName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Update", nil, "Failure preparing request") return } resp, err := client.UpdateSender(req) if err != nil { result.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Update", resp, "Failure sending request") return } result, err = client.UpdateResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Update", resp, "Failure responding to request") } return } // UpdatePreparer prepares the Update request. func (client AvailabilitySetsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters AvailabilitySetUpdate) (*http.Request, error) { pathParameters := map[string]interface{}{ "availabilitySetName": autorest.Encode("path", availabilitySetName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2017-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPatch(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. func (client AvailabilitySetsClient) UpdateSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } // UpdateResponder handles the response to the Update request. The method always // closes the http.Response Body. func (client AvailabilitySetsClient) UpdateResponder(resp *http.Response) (result AvailabilitySet, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return }
{ "pile_set_name": "Github" }
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Stroke Bounds</title> <link rel="stylesheet" href="../css/style.css"> <script type="text/javascript" src="../../dist/paper-full.js"></script> <script type="text/paperscript" canvas="canvas"> project.importSVG(document.getElementById('svg')); </script> </head> <body> <svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="500" height="500" id="svg"> <g> <line x1="4" y1="20" x2="200" y2="200" style="stroke:red;stroke-width:10;stroke-dasharray: 10, 4;stroke-linecap: butt" id="line" /> <rect x="200" y="20" rx="20" ry="10" width="150" height="150" style="fill:green" id="round" /> <circle cx="40" cy="100" r="20" style="fill:orange;" id="circle" /> </g> <g> <rect x="250" y="180" width="150" height="150" fill="blue" style="stroke-dasharray: 10, 4; stroke-width:0;" id="rect" /> <ellipse cx="120" cy="250" rx="100" ry="50" style="fill:yellow;stroke-width:-1" id="ellipse" /> </g> <path d="m 100 350 q 100 -300 100 0 t 100 0 t 50 0" stroke="black" stroke-width="4" fill="none" id="path" /> <path d="m 100 350 q 100 -300 100 0" stroke="black" stroke-width="4" fill="none" id="path"/> <path d="m 100 350 c 66.666666 -200 100 -200 100 0" stroke="black" stroke-width="4" fill="none" /> <path d="m 100 350 q 100 -300 100 0 t 100 0 T 350 350" stroke="black" stroke-width="4" fill="none" /> <path d="m 100 350 q 100 -300 100 0 T 300 350 t 50 0" stroke="black" stroke-width="4" fill="none" /> <path d="m 100 350 q 100 -300 100 0 T 300 350 T 350 350" stroke="black" stroke-width="4" fill="none" /> <path d="m 100 350 Q 200 50 200 350 t 100 0 t 50 0" stroke="black" stroke-width="4" fill="none" /> <path d="m 100 350 Q 200 50 200 350 t 100 0 T 350 350" stroke="black" stroke-width="4" fill="none" /> <path d="m 100 350 Q 200 50 200 350 T 300 350 t 50 0" stroke="black" stroke-width="4" fill="none" /> <path d="m 100 350 Q 200 50 200 350 T 300 350 T 350 350" stroke="black" stroke-width="4" fill="none" /> <path d="M 50 75 c 25 -50 25 -50 100 0 s 100 100 100 0 s 25 -50 100 0" stroke="blue" stroke-width="4" fill="none"/> <text x="20" y="15" stroke="green" fill="green" style="font:15px arial;" id="text">I love SVG</text> </svg> <canvas id="canvas" width="500" height="500"></canvas> </body> </html>
{ "pile_set_name": "Github" }
/* This code is derived from jgit (http://eclipse.org/jgit). Copyright owners are documented in jgit's IP log. This program and the accompanying materials are made available under the terms of the Eclipse Distribution License v1.0 which accompanies this distribution, is reproduced below, and is available at http://www.eclipse.org/org/documents/edl-v10.php 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 the Eclipse Foundation, 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. */ using System; using System.Collections.Generic; using System.IO; using System.Text; using NGit; using NGit.Dircache; using NGit.Errors; using NGit.Junit; using NGit.Revwalk; using NGit.Storage.File; using NGit.Storage.Pack; using NGit.Treewalk; using NGit.Treewalk.Filter; using NGit.Util; using NGit.Util.IO; using Sharpen; namespace NGit.Junit { /// <summary>Wrapper to make creating test data easier.</summary> /// <remarks>Wrapper to make creating test data easier.</remarks> /// <?></?> public interface TestRepository { DirCacheEntry File(string path, RevBlob blob); RevTree Tree(params DirCacheEntry[] entries); RevTag Tag(string name, RevObject dst); RevCommit Commit(RevTree tree, params RevCommit[] parents); RevCommit Commit(params RevCommit[] parents); RevWalk GetRevWalk(); CommitBuilder Commit(); ObjectInserter inserter { get; set; } void SetAuthorAndCommitter(NGit.CommitBuilder c); void Tick(int secDelta); T ParseBody<T>(T @object) where T:RevObject; RevWalk pool { get; set; } Repository db { get; set; } T Update<T>(string @ref, T obj) where T:AnyObjectId; void WriteFile(FilePath p, byte[] bin); RevBlob Blob(string content); RevBlob Blob(byte[] content); } public class TestRepository<R> : TestRepository where R : Repository { private static readonly PersonIdent author; private static readonly PersonIdent committer; static TestRepository() { MockSystemReader m = new MockSystemReader(); long now = m.GetCurrentTime(); int tz = m.GetTimezone(now); string an = "J. Author"; string ae = "jauthor@example.com"; author = new PersonIdent(an, ae, now, tz); string cn = "J. Committer"; string ce = "jcommitter@example.com"; committer = new PersonIdent(cn, ce, now, tz); } private Repository storage; Repository TestRepository.db { get { return storage; } set { storage = value; } } private Repository db { get { return (R) (object) storage; } set { storage = (Repository)(object) value; } } public RevWalk pool { get; set; } public ObjectInserter inserter { get; set; } private long now; /// <summary>Wrap a repository with test building tools.</summary> /// <remarks>Wrap a repository with test building tools.</remarks> /// <param name="db">the test repository to write into.</param> /// <exception cref="System.IO.IOException">System.IO.IOException</exception> public TestRepository(R db) : this(db, new RevWalk(db)) { } /// <summary>Wrap a repository with test building tools.</summary> /// <remarks>Wrap a repository with test building tools.</remarks> /// <param name="db">the test repository to write into.</param> /// <param name="rw">the RevObject pool to use for object lookup.</param> /// <exception cref="System.IO.IOException">System.IO.IOException</exception> public TestRepository(R db, RevWalk rw) { this.db = db; this.pool = rw; this.inserter = db.NewObjectInserter(); this.now = 1236977987000L; } /// <returns>the repository this helper class operates against.</returns> public virtual Repository GetRepository() { return db; } /// <returns>get the RevWalk pool all objects are allocated through.</returns> public virtual RevWalk GetRevWalk() { return pool; } /// <returns> /// current time adjusted by /// <see cref="TestRepository{R}.Tick(int)">TestRepository&lt;R&gt;.Tick(int)</see> /// . /// </returns> public virtual DateTime GetClock() { return Sharpen.Extensions.CreateDate(now); } /// <summary>Adjust the current time that will used by the next commit.</summary> /// <remarks>Adjust the current time that will used by the next commit.</remarks> /// <param name="secDelta">number of seconds to add to the current time.</param> public virtual void Tick(int secDelta) { now += secDelta * 1000L; } /// <summary> /// Set the author and committer using /// <see cref="TestRepository{R}.GetClock()">TestRepository&lt;R&gt;.GetClock()</see> /// . /// </summary> /// <param name="c">the commit builder to store.</param> public virtual void SetAuthorAndCommitter(NGit.CommitBuilder c) { c.Author = new PersonIdent(author, Sharpen.Extensions.CreateDate(now)); c.Committer = new PersonIdent(committer, Sharpen.Extensions.CreateDate(now)); } /// <summary>Create a new blob object in the repository.</summary> /// <remarks>Create a new blob object in the repository.</remarks> /// <param name="content">file content, will be UTF-8 encoded.</param> /// <returns>reference to the blob.</returns> /// <exception cref="System.Exception">System.Exception</exception> public virtual RevBlob Blob(string content) { return Blob(Sharpen.Runtime.GetBytesForString(content, "UTF-8")); } /// <summary>Create a new blob object in the repository.</summary> /// <remarks>Create a new blob object in the repository.</remarks> /// <param name="content">binary file content.</param> /// <returns>reference to the blob.</returns> /// <exception cref="System.Exception">System.Exception</exception> public virtual RevBlob Blob(byte[] content) { ObjectId id; try { id = inserter.Insert(Constants.OBJ_BLOB, content); inserter.Flush(); } finally { inserter.Release(); } return pool.LookupBlob(id); } /// <summary>Construct a regular file mode tree entry.</summary> /// <remarks>Construct a regular file mode tree entry.</remarks> /// <param name="path">path of the file.</param> /// <param name="blob">a blob, previously constructed in the repository.</param> /// <returns>the entry.</returns> /// <exception cref="System.Exception">System.Exception</exception> public virtual DirCacheEntry File(string path, RevBlob blob) { DirCacheEntry e = new DirCacheEntry(path); e.FileMode = FileMode.REGULAR_FILE; e.SetObjectId(blob); return e; } /// <summary>Construct a tree from a specific listing of file entries.</summary> /// <remarks>Construct a tree from a specific listing of file entries.</remarks> /// <param name="entries"> /// the files to include in the tree. The collection does not need /// to be sorted properly and may be empty. /// </param> /// <returns>reference to the tree specified by the entry list.</returns> /// <exception cref="System.Exception">System.Exception</exception> public virtual RevTree Tree(params DirCacheEntry[] entries) { DirCache dc = DirCache.NewInCore(); DirCacheBuilder b = dc.Builder(); foreach (DirCacheEntry e in entries) { b.Add(e); } b.Finish(); ObjectId root; try { root = dc.WriteTree(inserter); inserter.Flush(); } finally { inserter.Release(); } return pool.LookupTree(root); } /// <summary>Lookup an entry stored in a tree, failing if not present.</summary> /// <remarks>Lookup an entry stored in a tree, failing if not present.</remarks> /// <param name="tree">the tree to search.</param> /// <param name="path">the path to find the entry of.</param> /// <returns>the parsed object entry at this path, never null.</returns> /// <exception cref="System.Exception">System.Exception</exception> public virtual RevObject Get(RevTree tree, string path) { TreeWalk tw = new TreeWalk(pool.GetObjectReader()); tw.Filter = PathFilterGroup.CreateFromStrings(Collections.Singleton(path)); tw.Reset(tree); while (tw.Next()) { if (tw.IsSubtree && !path.Equals(tw.PathString)) { tw.EnterSubtree(); continue; } ObjectId entid = tw.GetObjectId(0); FileMode entmode = tw.GetFileMode(0); return pool.LookupAny(entid, entmode.GetObjectType()); } NUnit.Framework.Assert.Fail("Can't find " + path + " in tree " + tree.Name); return null; } // never reached. /// <summary>Create a new commit.</summary> /// <remarks> /// Create a new commit. /// <p> /// See /// <see cref="TestRepository{R}.Commit(int, NGit.Revwalk.RevTree, NGit.Revwalk.RevCommit[]) /// ">TestRepository&lt;R&gt;.Commit(int, NGit.Revwalk.RevTree, NGit.Revwalk.RevCommit[]) /// </see> /// . The tree is the empty /// tree (no files or subdirectories). /// </remarks> /// <param name="parents">zero or more parents of the commit.</param> /// <returns>the new commit.</returns> /// <exception cref="System.Exception">System.Exception</exception> public virtual RevCommit Commit(params RevCommit[] parents) { return Commit(1, Tree(), parents); } /// <summary>Create a new commit.</summary> /// <remarks> /// Create a new commit. /// <p> /// See /// <see cref="TestRepository{R}.Commit(int, NGit.Revwalk.RevTree, NGit.Revwalk.RevCommit[]) /// ">TestRepository&lt;R&gt;.Commit(int, NGit.Revwalk.RevTree, NGit.Revwalk.RevCommit[]) /// </see> /// . /// </remarks> /// <param name="tree">the root tree for the commit.</param> /// <param name="parents">zero or more parents of the commit.</param> /// <returns>the new commit.</returns> /// <exception cref="System.Exception">System.Exception</exception> public virtual RevCommit Commit(RevTree tree, params RevCommit[] parents) { return Commit(1, tree, parents); } /// <summary>Create a new commit.</summary> /// <remarks> /// Create a new commit. /// <p> /// See /// <see cref="TestRepository{R}.Commit(int, NGit.Revwalk.RevTree, NGit.Revwalk.RevCommit[]) /// ">TestRepository&lt;R&gt;.Commit(int, NGit.Revwalk.RevTree, NGit.Revwalk.RevCommit[]) /// </see> /// . The tree is the empty /// tree (no files or subdirectories). /// </remarks> /// <param name="secDelta"> /// number of seconds to advance /// <see cref="TestRepository{R}.Tick(int)">TestRepository&lt;R&gt;.Tick(int)</see> /// by. /// </param> /// <param name="parents">zero or more parents of the commit.</param> /// <returns>the new commit.</returns> /// <exception cref="System.Exception">System.Exception</exception> public virtual RevCommit Commit(int secDelta, params RevCommit[] parents) { return Commit(secDelta, Tree(), parents); } /// <summary>Create a new commit.</summary> /// <remarks> /// Create a new commit. /// <p> /// The author and committer identities are stored using the current /// timestamp, after being incremented by /// <code>secDelta</code> /// . The message body /// is empty. /// </remarks> /// <param name="secDelta"> /// number of seconds to advance /// <see cref="TestRepository{R}.Tick(int)">TestRepository&lt;R&gt;.Tick(int)</see> /// by. /// </param> /// <param name="tree">the root tree for the commit.</param> /// <param name="parents">zero or more parents of the commit.</param> /// <returns>the new commit.</returns> /// <exception cref="System.Exception">System.Exception</exception> public virtual RevCommit Commit(int secDelta, RevTree tree, params RevCommit[] parents ) { Tick(secDelta); NGit.CommitBuilder c; c = new NGit.CommitBuilder(); c.TreeId = tree; c.SetParentIds((IList<RevCommit>)parents); c.Author = new PersonIdent(author, Sharpen.Extensions.CreateDate(now)); c.Committer = new PersonIdent(committer, Sharpen.Extensions.CreateDate(now)); c.Message = string.Empty; ObjectId id; try { id = inserter.Insert(c); inserter.Flush(); } finally { inserter.Release(); } return pool.LookupCommit(id); } /// <returns>a new commit builder.</returns> public virtual CommitBuilder Commit() { return new CommitBuilder(this); } /// <summary>Construct an annotated tag object pointing at another object.</summary> /// <remarks> /// Construct an annotated tag object pointing at another object. /// <p> /// The tagger is the committer identity, at the current time as specified by /// <see cref="TestRepository{R}.Tick(int)">TestRepository&lt;R&gt;.Tick(int)</see> /// . The time is not increased. /// <p> /// The tag message is empty. /// </remarks> /// <param name="name"> /// name of the tag. Traditionally a tag name should not start /// with /// <code>refs/tags/</code> /// . /// </param> /// <param name="dst">object the tag should be pointed at.</param> /// <returns>the annotated tag object.</returns> /// <exception cref="System.Exception">System.Exception</exception> public virtual RevTag Tag(string name, RevObject dst) { TagBuilder t = new TagBuilder(); t.SetObjectId(dst); t.SetTag(name); t.SetTagger(new PersonIdent(committer, Sharpen.Extensions.CreateDate(now))); t.SetMessage(string.Empty); ObjectId id; try { id = inserter.Insert(t); inserter.Flush(); } finally { inserter.Release(); } return (RevTag)pool.LookupAny(id, Constants.OBJ_TAG); } /// <summary>Update a reference to point to an object.</summary> /// <remarks>Update a reference to point to an object.</remarks> /// <param name="ref"> /// the name of the reference to update to. If /// <code>ref</code> /// does /// not start with /// <code>refs/</code> /// and is not the magic names /// <code>HEAD</code> /// /// <code>FETCH_HEAD</code> /// or /// <code>MERGE_HEAD</code> /// , then /// <code>refs/heads/</code> /// will be prefixed in front of the given /// name, thereby assuming it is a branch. /// </param> /// <param name="to">the target object.</param> /// <returns>the target object.</returns> /// <exception cref="System.Exception">System.Exception</exception> public virtual RevCommit Update(string @ref, CommitBuilder to) { return Update(@ref, to.Create()); } /// <summary>Update a reference to point to an object.</summary> /// <remarks>Update a reference to point to an object.</remarks> /// <?></?> /// <param name="ref"> /// the name of the reference to update to. If /// <code>ref</code> /// does /// not start with /// <code>refs/</code> /// and is not the magic names /// <code>HEAD</code> /// /// <code>FETCH_HEAD</code> /// or /// <code>MERGE_HEAD</code> /// , then /// <code>refs/heads/</code> /// will be prefixed in front of the given /// name, thereby assuming it is a branch. /// </param> /// <param name="obj">the target object.</param> /// <returns>the target object.</returns> /// <exception cref="System.Exception">System.Exception</exception> public virtual T Update<T>(string @ref, T obj) where T:AnyObjectId { if (Constants.HEAD.Equals(@ref)) { } else { // nothing if ("FETCH_HEAD".Equals(@ref)) { } else { // nothing if ("MERGE_HEAD".Equals(@ref)) { } else { // nothing if (@ref.StartsWith(Constants.R_REFS)) { } else { // nothing @ref = Constants.R_HEADS + @ref; } } } } RefUpdate u = db.UpdateRef(@ref); u.SetNewObjectId(obj); switch (u.ForceUpdate()) { case RefUpdate.Result.FAST_FORWARD: case RefUpdate.Result.FORCED: case RefUpdate.Result.NEW: case RefUpdate.Result.NO_CHANGE: { UpdateServerInfo(); return obj; } default: { throw new IOException("Cannot write " + @ref + " " + u.GetResult()); } } } /// <summary>Update the dumb client server info files.</summary> /// <remarks>Update the dumb client server info files.</remarks> /// <exception cref="System.Exception">System.Exception</exception> public virtual void UpdateServerInfo() { if (db is FileRepository) { FileRepository fr = (FileRepository)db; RefWriter rw = new _RefWriter_495(this, fr, fr.GetAllRefs().Values); rw.WritePackedRefs(); rw.WriteInfoRefs(); StringBuilder w = new StringBuilder(); foreach (PackFile p in ((ObjectDirectory)fr.ObjectDatabase).GetPacks()) { w.Append("P "); w.Append(p.GetPackFile().GetName()); w.Append('\n'); } WriteFile(new FilePath(new FilePath(((ObjectDirectory)fr.ObjectDatabase).GetDirectory (), "info"), "packs"), Constants.EncodeASCII(w.ToString())); } } private sealed class _RefWriter_495 : RefWriter { public _RefWriter_495(TestRepository<R> _enclosing, FileRepository fr, ICollection <Ref> baseArg1) : base(baseArg1) { this._enclosing = _enclosing; this.fr = fr; } /// <exception cref="System.IO.IOException"></exception> internal protected override void WriteFile(string name, byte[] bin) { FilePath path = new FilePath(fr.Directory, name); this._enclosing.WriteFile(path, bin); } private readonly TestRepository _enclosing; private readonly FileRepository fr; } /// <summary>Ensure the body of the given object has been parsed.</summary> /// <remarks>Ensure the body of the given object has been parsed.</remarks> /// <?></?> /// <param name="object"> /// reference to the (possibly unparsed) object to force body /// parsing of. /// </param> /// <returns> /// /// <code>object</code> /// </returns> /// <exception cref="System.Exception">System.Exception</exception> public virtual T ParseBody<T>(T @object) where T:RevObject { pool.ParseBody(@object); return @object; } /// <summary>Create a new branch builder for this repository.</summary> /// <remarks>Create a new branch builder for this repository.</remarks> /// <param name="ref"> /// name of the branch to be constructed. If /// <code>ref</code> /// does not /// start with /// <code>refs/</code> /// the prefix /// <code>refs/heads/</code> /// will /// be added. /// </param> /// <returns>builder for the named branch.</returns> public virtual BranchBuilder Branch(string @ref) { if (Constants.HEAD.Equals(@ref)) { } else { // nothing if (@ref.StartsWith(Constants.R_REFS)) { } else { // nothing @ref = Constants.R_HEADS + @ref; } } return new BranchBuilder(this, @ref); } /// <summary>Tag an object using a lightweight tag.</summary> /// <remarks>Tag an object using a lightweight tag.</remarks> /// <param name="name"> /// the tag name. The /refs/tags/ prefix will be added if the name /// doesn't start with it /// </param> /// <param name="obj">the object to tag</param> /// <returns>the tagged object</returns> /// <exception cref="System.Exception">System.Exception</exception> public virtual ObjectId LightweightTag(string name, ObjectId obj) { if (!name.StartsWith(Constants.R_TAGS)) { name = Constants.R_TAGS + name; } return Update(name, obj); } /// <summary>Run consistency checks against the object database.</summary> /// <remarks> /// Run consistency checks against the object database. /// <p> /// This method completes silently if the checks pass. A temporary revision /// pool is constructed during the checking. /// </remarks> /// <param name="tips"> /// the tips to start checking from; if not supplied the refs of /// the repository are used instead. /// </param> /// <exception cref="NGit.Errors.MissingObjectException">NGit.Errors.MissingObjectException /// </exception> /// <exception cref="NGit.Errors.IncorrectObjectTypeException">NGit.Errors.IncorrectObjectTypeException /// </exception> /// <exception cref="System.IO.IOException">System.IO.IOException</exception> public virtual void Fsck(params RevObject[] tips) { ObjectWalk ow = new ObjectWalk(db); if (tips.Length != 0) { foreach (RevObject o in tips) { ow.MarkStart(ow.ParseAny(o)); } } else { foreach (Ref r in db.GetAllRefs().Values) { ow.MarkStart(ow.ParseAny(r.GetObjectId())); } } ObjectChecker oc = new ObjectChecker(); for (; ; ) { RevCommit o = ow.Next(); if (o == null) { break; } byte[] bin = db.Open(o, o.Type).GetCachedBytes(); oc.CheckCommit(bin); AssertHash(o, bin); } for (; ; ) { RevObject o = ow.NextObject(); if (o == null) { break; } byte[] bin = db.Open(o, o.Type).GetCachedBytes(); oc.Check(o.Type, bin); AssertHash(o, bin); } } private static void AssertHash(RevObject id, byte[] bin) { MessageDigest md = Constants.NewMessageDigest(); md.Update(Constants.EncodedTypeString(id.Type)); md.Update(unchecked((byte)' ')); md.Update(Constants.EncodeASCII(bin.Length)); md.Update(unchecked((byte)0)); md.Update(bin); NUnit.Framework.Assert.AreEqual(id, ObjectId.FromRaw(md.Digest())); } /// <summary>Pack all reachable objects in the repository into a single pack file.</summary> /// <remarks> /// Pack all reachable objects in the repository into a single pack file. /// <p> /// All loose objects are automatically pruned. Existing packs however are /// not removed. /// </remarks> /// <exception cref="System.Exception">System.Exception</exception> public virtual void PackAndPrune() { if (db.ObjectDatabase is ObjectDirectory) { ObjectDirectory odb = (ObjectDirectory)db.ObjectDatabase; NullProgressMonitor m = NullProgressMonitor.INSTANCE; FilePath pack; FilePath idx; PackWriter pw = new PackWriter(db); try { ICollection<ObjectId> all = new HashSet<ObjectId>(); foreach (Ref r in db.GetAllRefs().Values) { all.AddItem(r.GetObjectId()); } pw.PreparePack(m, all, Sharpen.Collections.EmptySet<ObjectId>()); ObjectId name = pw.ComputeName(); OutputStream @out; pack = NameFor(odb, name, ".pack"); @out = new SafeBufferedOutputStream(new FileOutputStream(pack)); try { pw.WritePack(m, m, @out); } finally { @out.Close(); } pack.SetReadOnly(); idx = NameFor(odb, name, ".idx"); @out = new SafeBufferedOutputStream(new FileOutputStream(idx)); try { pw.WriteIndex(@out); } finally { @out.Close(); } idx.SetReadOnly(); } finally { pw.Release(); } odb.OpenPack(pack, idx); UpdateServerInfo(); PrunePacked(odb); } } /// <exception cref="System.IO.IOException"></exception> private void PrunePacked(ObjectDirectory odb) { foreach (PackFile p in odb.GetPacks()) { foreach (PackIndex.MutableEntry e in p) { FileUtils.Delete(odb.FileFor(e.ToObjectId())); } } } private static FilePath NameFor(ObjectDirectory odb, ObjectId name, string t) { FilePath packdir = new FilePath(odb.GetDirectory(), "pack"); return new FilePath(packdir, "pack-" + name.Name + t); } /// <exception cref="System.IO.IOException"></exception> /// <exception cref="NGit.Errors.ObjectWritingException"></exception> public void WriteFile(FilePath p, byte[] bin) { LockFile lck = new LockFile(p, db.FileSystem); if (!lck.Lock()) { throw new ObjectWritingException("Can't write " + p); } try { lck.Write(bin); } catch (IOException) { throw new ObjectWritingException("Can't write " + p); } if (!lck.Commit()) { throw new ObjectWritingException("Can't write " + p); } } } /// <summary>Helper to build a branch with one or more commits</summary> public class BranchBuilder { internal readonly string @ref; internal BranchBuilder(TestRepository _enclosing, string @ref) { this._enclosing = _enclosing; this.@ref = @ref; } /// <returns> /// construct a new commit builder that updates this branch. If /// the branch already exists, the commit builder will have its /// first parent as the current commit and its tree will be /// initialized to the current files. /// </returns> /// <exception cref="System.Exception">the commit builder can't read the current branch state /// </exception> public virtual CommitBuilder Commit() { return new CommitBuilder(_enclosing, this); } /// <summary>Forcefully update this branch to a particular commit.</summary> /// <remarks>Forcefully update this branch to a particular commit.</remarks> /// <param name="to">the commit to update to.</param> /// <returns> /// /// <code>to</code> /// . /// </returns> /// <exception cref="System.Exception">System.Exception</exception> public virtual RevCommit Update(CommitBuilder to) { return this.Update(to.Create()); } /// <summary>Forcefully update this branch to a particular commit.</summary> /// <remarks>Forcefully update this branch to a particular commit.</remarks> /// <param name="to">the commit to update to.</param> /// <returns> /// /// <code>to</code> /// . /// </returns> /// <exception cref="System.Exception">System.Exception</exception> public virtual RevCommit Update(RevCommit to) { return this._enclosing.Update(this.@ref, to); } private readonly TestRepository _enclosing; } /// <summary>Helper to generate a commit.</summary> /// <remarks>Helper to generate a commit.</remarks> public class CommitBuilder { private readonly BranchBuilder branch; private readonly DirCache tree = DirCache.NewInCore(); private ObjectId topLevelTree; private readonly IList<RevCommit> parents = new AList<RevCommit>(2); private int tick = 1; private string message = string.Empty; private RevCommit self; public CommitBuilder(TestRepository _enclosing) { this._enclosing = _enclosing; this.branch = null; } /// <exception cref="System.Exception"></exception> internal CommitBuilder(TestRepository _enclosing, BranchBuilder b) { this._enclosing = _enclosing; this.branch = b; Ref @ref = this._enclosing.db.GetRef(this.branch.@ref); if (@ref != null) { this.Parent(this._enclosing.pool.ParseCommit(@ref.GetObjectId())); } } /// <exception cref="System.Exception"></exception> internal CommitBuilder(TestRepository _enclosing, CommitBuilder prior) { this._enclosing = _enclosing; this.branch = prior.branch; DirCacheBuilder b = this.tree.Builder(); for (int i = 0; i < prior.tree.GetEntryCount(); i++) { b.Add(prior.tree.GetEntry(i)); } b.Finish(); this.parents.AddItem(prior.Create()); } /// <exception cref="System.Exception"></exception> public virtual CommitBuilder Parent(RevCommit p) { if (this.parents.IsEmpty()) { DirCacheBuilder b = this.tree.Builder(); this._enclosing.ParseBody(p); b.AddTree(new byte[0], DirCacheEntry.STAGE_0, this._enclosing.pool.GetObjectReader (), p.Tree); b.Finish(); } this.parents.AddItem(p); return this; } public virtual CommitBuilder NoParents() { this.parents.Clear(); return this; } public virtual CommitBuilder NoFiles() { this.tree.Clear(); return this; } public virtual CommitBuilder SetTopLevelTree(ObjectId treeId) { this.topLevelTree = treeId; return this; } /// <exception cref="System.Exception"></exception> public virtual CommitBuilder Add(string path, string content) { return this.Add(path, this._enclosing.Blob(content)); } /// <exception cref="System.Exception"></exception> public virtual CommitBuilder Add(string path, RevBlob id) { return this.Edit(new _PathEdit_820(id, path)); } private sealed class _PathEdit_820 : DirCacheEditor.PathEdit { public _PathEdit_820(RevBlob id, string baseArg1) : base(baseArg1) { this.id = id; } public override void Apply(DirCacheEntry ent) { ent.FileMode = FileMode.REGULAR_FILE; ent.SetObjectId(id); } private readonly RevBlob id; } public virtual CommitBuilder Edit(NGit.Dircache.DirCacheEditor.PathEdit edit) { DirCacheEditor e = this.tree.Editor(); e.Add(edit); e.Finish(); return this; } public virtual CommitBuilder Rm(string path) { DirCacheEditor e = this.tree.Editor(); e.Add(new DirCacheEditor.DeletePath(path)); e.Add(new DirCacheEditor.DeleteTree(path)); e.Finish(); return this; } public virtual CommitBuilder Message(string m) { this.message = m; return this; } public virtual CommitBuilder Tick(int secs) { this.tick = secs; return this; } /// <exception cref="System.Exception"></exception> public virtual RevCommit Create() { if (this.self == null) { this._enclosing.Tick(this.tick); NGit.CommitBuilder c; c = new NGit.CommitBuilder(); c.SetParentIds(this.parents); this._enclosing.SetAuthorAndCommitter(c); c.Message = this.message; ObjectId commitId; try { if (this.topLevelTree != null) { c.TreeId = this.topLevelTree; } else { c.TreeId = this.tree.WriteTree(this._enclosing.inserter); } commitId = this._enclosing.inserter.Insert(c); this._enclosing.inserter.Flush(); } finally { this._enclosing.inserter.Release(); } this.self = this._enclosing.pool.LookupCommit(commitId); if (this.branch != null) { this.branch.Update(this.self); } } return this.self; } /// <exception cref="System.Exception"></exception> public virtual CommitBuilder Child() { return new CommitBuilder(_enclosing, this); } private readonly TestRepository _enclosing; } }
{ "pile_set_name": "Github" }
cmake_minimum_required(VERSION 2.8.3) project(libmavconn) ## Find catkin macros and libraries ## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz) ## is used, also find other catkin packages find_package(catkin REQUIRED) ## System dependencies are found with CMake's conventions find_package(console_bridge REQUIRED) find_package(Boost REQUIRED COMPONENTS system) # add package modules path, not needed in dependend packages list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules") include(EnableCXX11) include(MavrosMavlink) # Fixed in mavlink 2016.7.7 #-> enum values out of int range #list(APPEND IGNORE_DIALECTS "autoquad") ################################### ## catkin specific configuration ## ################################### catkin_package( INCLUDE_DIRS include LIBRARIES mavconn DEPENDS Boost console_bridge mavlink CFG_EXTRAS libmavconn-extras.cmake ) ########### ## Build ## ########### include_directories( include ${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/include ${Boost_INCLUDE_DIRS} ${mavlink_INCLUDE_DIRS} ${console_bridge_INCLUDE_DIRS} ) ## Declare a cpp library add_library(mavconn ${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/src/mavlink_helpers.cpp src/interface.cpp src/serial.cpp src/tcp.cpp src/udp.cpp ) target_link_libraries(mavconn ${Boost_LIBRARIES} ${console_bridge_LIBRARIES} ) # Use catkin-supplied em_expand macros to generate source files em_expand(${CMAKE_CURRENT_SOURCE_DIR}/mavlink.context.py.in ${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/mavlink.context.py ${CMAKE_CURRENT_SOURCE_DIR}/include/mavconn/mavlink_dialect.h.em ${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/include/mavconn/mavlink_dialect.h) em_expand(${CMAKE_CURRENT_SOURCE_DIR}/mavlink.context.py.in ${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/mavlink.context.py ${CMAKE_CURRENT_SOURCE_DIR}/src/mavlink_helpers.cpp.em ${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/src/mavlink_helpers.cpp) message(STATUS "Copy mavlink_dialect.h to source tree") file( COPY ${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/include/mavconn/mavlink_dialect.h DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/include/mavconn/ ) ############# ## Install ## ############# # all install targets should use catkin DESTINATION variables # See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html ## Mark executables and/or libraries for installation install(TARGETS mavconn ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} ) ## Mark cpp header files for installation install(DIRECTORY include/mavconn/ DESTINATION ${CATKIN_GLOBAL_INCLUDE_DESTINATION}/mavconn FILES_MATCHING PATTERN "*.h" ) install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/include/mavconn/ DESTINATION ${CATKIN_GLOBAL_INCLUDE_DESTINATION}/mavconn FILES_MATCHING PATTERN "*.h" ) ## Install cmake files (thanks to cmake_modules package) install(DIRECTORY cmake/Modules DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/cmake ) ############# ## Testing ## ############# if(CATKIN_ENABLE_TESTING) catkin_add_gtest(mavconn-test test/test_mavconn.cpp) target_link_libraries(mavconn-test mavconn pthread) endif() # vim: ts=2 sw=2 et:
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/radio_off" android:state_checked="true" android:state_pressed="true" /> <item android:drawable="@drawable/radio_black" android:state_checked="false" android:state_pressed="true" /> <item android:drawable="@drawable/radio_checked_hover" android:state_checked="true" android:state_hovered="true" /> <item android:drawable="@drawable/radio_unchecked_hover" android:state_checked="false" android:state_hovered="true" /> <item android:drawable="@drawable/radio_on" android:state_checked="true" /> <item android:drawable="@drawable/radio_off" /> </selector>
{ "pile_set_name": "Github" }
/* * QEMU PowerPC 440 embedded processors emulation * * Copyright (c) 2012 François Revol * Copyright (c) 2016-2019 BALATON Zoltan * * This work is licensed under the GNU GPL license version 2 or later. * */ #include "qemu/osdep.h" #include "qemu/units.h" #include "qemu-common.h" #include "qemu/error-report.h" #include "qapi/error.h" #include "qemu/log.h" #include "cpu.h" #include "hw/hw.h" #include "exec/address-spaces.h" #include "exec/memory.h" #include "hw/ppc/ppc.h" #include "hw/pci/pci.h" #include "sysemu/block-backend.h" #include "ppc440.h" /*****************************************************************************/ /* L2 Cache as SRAM */ /* FIXME:fix names */ enum { DCR_L2CACHE_BASE = 0x30, DCR_L2CACHE_CFG = DCR_L2CACHE_BASE, DCR_L2CACHE_CMD, DCR_L2CACHE_ADDR, DCR_L2CACHE_DATA, DCR_L2CACHE_STAT, DCR_L2CACHE_CVER, DCR_L2CACHE_SNP0, DCR_L2CACHE_SNP1, DCR_L2CACHE_END = DCR_L2CACHE_SNP1, }; /* base is 460ex-specific, cf. U-Boot, ppc4xx-isram.h */ enum { DCR_ISRAM0_BASE = 0x20, DCR_ISRAM0_SB0CR = DCR_ISRAM0_BASE, DCR_ISRAM0_SB1CR, DCR_ISRAM0_SB2CR, DCR_ISRAM0_SB3CR, DCR_ISRAM0_BEAR, DCR_ISRAM0_BESR0, DCR_ISRAM0_BESR1, DCR_ISRAM0_PMEG, DCR_ISRAM0_CID, DCR_ISRAM0_REVID, DCR_ISRAM0_DPC, DCR_ISRAM0_END = DCR_ISRAM0_DPC }; enum { DCR_ISRAM1_BASE = 0xb0, DCR_ISRAM1_SB0CR = DCR_ISRAM1_BASE, /* single bank */ DCR_ISRAM1_BEAR = DCR_ISRAM1_BASE + 0x04, DCR_ISRAM1_BESR0, DCR_ISRAM1_BESR1, DCR_ISRAM1_PMEG, DCR_ISRAM1_CID, DCR_ISRAM1_REVID, DCR_ISRAM1_DPC, DCR_ISRAM1_END = DCR_ISRAM1_DPC }; typedef struct ppc4xx_l2sram_t { MemoryRegion bank[4]; uint32_t l2cache[8]; uint32_t isram0[11]; } ppc4xx_l2sram_t; #ifdef MAP_L2SRAM static void l2sram_update_mappings(ppc4xx_l2sram_t *l2sram, uint32_t isarc, uint32_t isacntl, uint32_t dsarc, uint32_t dsacntl) { if (l2sram->isarc != isarc || (l2sram->isacntl & 0x80000000) != (isacntl & 0x80000000)) { if (l2sram->isacntl & 0x80000000) { /* Unmap previously assigned memory region */ memory_region_del_subregion(get_system_memory(), &l2sram->isarc_ram); } if (isacntl & 0x80000000) { /* Map new instruction memory region */ memory_region_add_subregion(get_system_memory(), isarc, &l2sram->isarc_ram); } } if (l2sram->dsarc != dsarc || (l2sram->dsacntl & 0x80000000) != (dsacntl & 0x80000000)) { if (l2sram->dsacntl & 0x80000000) { /* Beware not to unmap the region we just mapped */ if (!(isacntl & 0x80000000) || l2sram->dsarc != isarc) { /* Unmap previously assigned memory region */ memory_region_del_subregion(get_system_memory(), &l2sram->dsarc_ram); } } if (dsacntl & 0x80000000) { /* Beware not to remap the region we just mapped */ if (!(isacntl & 0x80000000) || dsarc != isarc) { /* Map new data memory region */ memory_region_add_subregion(get_system_memory(), dsarc, &l2sram->dsarc_ram); } } } } #endif static uint32_t dcr_read_l2sram(void *opaque, int dcrn) { ppc4xx_l2sram_t *l2sram = opaque; uint32_t ret = 0; switch (dcrn) { case DCR_L2CACHE_CFG: case DCR_L2CACHE_CMD: case DCR_L2CACHE_ADDR: case DCR_L2CACHE_DATA: case DCR_L2CACHE_STAT: case DCR_L2CACHE_CVER: case DCR_L2CACHE_SNP0: case DCR_L2CACHE_SNP1: ret = l2sram->l2cache[dcrn - DCR_L2CACHE_BASE]; break; case DCR_ISRAM0_SB0CR: case DCR_ISRAM0_SB1CR: case DCR_ISRAM0_SB2CR: case DCR_ISRAM0_SB3CR: case DCR_ISRAM0_BEAR: case DCR_ISRAM0_BESR0: case DCR_ISRAM0_BESR1: case DCR_ISRAM0_PMEG: case DCR_ISRAM0_CID: case DCR_ISRAM0_REVID: case DCR_ISRAM0_DPC: ret = l2sram->isram0[dcrn - DCR_ISRAM0_BASE]; break; default: break; } return ret; } static void dcr_write_l2sram(void *opaque, int dcrn, uint32_t val) { /*ppc4xx_l2sram_t *l2sram = opaque;*/ /* FIXME: Actually handle L2 cache mapping */ switch (dcrn) { case DCR_L2CACHE_CFG: case DCR_L2CACHE_CMD: case DCR_L2CACHE_ADDR: case DCR_L2CACHE_DATA: case DCR_L2CACHE_STAT: case DCR_L2CACHE_CVER: case DCR_L2CACHE_SNP0: case DCR_L2CACHE_SNP1: /*l2sram->l2cache[dcrn - DCR_L2CACHE_BASE] = val;*/ break; case DCR_ISRAM0_SB0CR: case DCR_ISRAM0_SB1CR: case DCR_ISRAM0_SB2CR: case DCR_ISRAM0_SB3CR: case DCR_ISRAM0_BEAR: case DCR_ISRAM0_BESR0: case DCR_ISRAM0_BESR1: case DCR_ISRAM0_PMEG: case DCR_ISRAM0_CID: case DCR_ISRAM0_REVID: case DCR_ISRAM0_DPC: /*l2sram->isram0[dcrn - DCR_L2CACHE_BASE] = val;*/ break; case DCR_ISRAM1_SB0CR: case DCR_ISRAM1_BEAR: case DCR_ISRAM1_BESR0: case DCR_ISRAM1_BESR1: case DCR_ISRAM1_PMEG: case DCR_ISRAM1_CID: case DCR_ISRAM1_REVID: case DCR_ISRAM1_DPC: /*l2sram->isram1[dcrn - DCR_L2CACHE_BASE] = val;*/ break; } /*l2sram_update_mappings(l2sram, isarc, isacntl, dsarc, dsacntl);*/ } static void l2sram_reset(void *opaque) { ppc4xx_l2sram_t *l2sram = opaque; memset(l2sram->l2cache, 0, sizeof(l2sram->l2cache)); l2sram->l2cache[DCR_L2CACHE_STAT - DCR_L2CACHE_BASE] = 0x80000000; memset(l2sram->isram0, 0, sizeof(l2sram->isram0)); /*l2sram_update_mappings(l2sram, isarc, isacntl, dsarc, dsacntl);*/ } void ppc4xx_l2sram_init(CPUPPCState *env) { ppc4xx_l2sram_t *l2sram; l2sram = g_malloc0(sizeof(*l2sram)); /* XXX: Size is 4*64kB for 460ex, cf. U-Boot, ppc4xx-isram.h */ memory_region_init_ram(&l2sram->bank[0], NULL, "ppc4xx.l2sram_bank0", 64 * KiB, &error_abort); memory_region_init_ram(&l2sram->bank[1], NULL, "ppc4xx.l2sram_bank1", 64 * KiB, &error_abort); memory_region_init_ram(&l2sram->bank[2], NULL, "ppc4xx.l2sram_bank2", 64 * KiB, &error_abort); memory_region_init_ram(&l2sram->bank[3], NULL, "ppc4xx.l2sram_bank3", 64 * KiB, &error_abort); qemu_register_reset(&l2sram_reset, l2sram); ppc_dcr_register(env, DCR_L2CACHE_CFG, l2sram, &dcr_read_l2sram, &dcr_write_l2sram); ppc_dcr_register(env, DCR_L2CACHE_CMD, l2sram, &dcr_read_l2sram, &dcr_write_l2sram); ppc_dcr_register(env, DCR_L2CACHE_ADDR, l2sram, &dcr_read_l2sram, &dcr_write_l2sram); ppc_dcr_register(env, DCR_L2CACHE_DATA, l2sram, &dcr_read_l2sram, &dcr_write_l2sram); ppc_dcr_register(env, DCR_L2CACHE_STAT, l2sram, &dcr_read_l2sram, &dcr_write_l2sram); ppc_dcr_register(env, DCR_L2CACHE_CVER, l2sram, &dcr_read_l2sram, &dcr_write_l2sram); ppc_dcr_register(env, DCR_L2CACHE_SNP0, l2sram, &dcr_read_l2sram, &dcr_write_l2sram); ppc_dcr_register(env, DCR_L2CACHE_SNP1, l2sram, &dcr_read_l2sram, &dcr_write_l2sram); ppc_dcr_register(env, DCR_ISRAM0_SB0CR, l2sram, &dcr_read_l2sram, &dcr_write_l2sram); ppc_dcr_register(env, DCR_ISRAM0_SB1CR, l2sram, &dcr_read_l2sram, &dcr_write_l2sram); ppc_dcr_register(env, DCR_ISRAM0_SB2CR, l2sram, &dcr_read_l2sram, &dcr_write_l2sram); ppc_dcr_register(env, DCR_ISRAM0_SB3CR, l2sram, &dcr_read_l2sram, &dcr_write_l2sram); ppc_dcr_register(env, DCR_ISRAM0_PMEG, l2sram, &dcr_read_l2sram, &dcr_write_l2sram); ppc_dcr_register(env, DCR_ISRAM0_DPC, l2sram, &dcr_read_l2sram, &dcr_write_l2sram); ppc_dcr_register(env, DCR_ISRAM1_SB0CR, l2sram, &dcr_read_l2sram, &dcr_write_l2sram); ppc_dcr_register(env, DCR_ISRAM1_PMEG, l2sram, &dcr_read_l2sram, &dcr_write_l2sram); ppc_dcr_register(env, DCR_ISRAM1_DPC, l2sram, &dcr_read_l2sram, &dcr_write_l2sram); } /*****************************************************************************/ /* Clocking Power on Reset */ enum { CPR0_CFGADDR = 0xC, CPR0_CFGDATA = 0xD, CPR0_PLLD = 0x060, CPR0_PLBED = 0x080, CPR0_OPBD = 0x0C0, CPR0_PERD = 0x0E0, CPR0_AHBD = 0x100, }; typedef struct ppc4xx_cpr_t { uint32_t addr; } ppc4xx_cpr_t; static uint32_t dcr_read_cpr(void *opaque, int dcrn) { ppc4xx_cpr_t *cpr = opaque; uint32_t ret = 0; switch (dcrn) { case CPR0_CFGADDR: ret = cpr->addr; break; case CPR0_CFGDATA: switch (cpr->addr) { case CPR0_PLLD: ret = (0xb5 << 24) | (1 << 16) | (9 << 8); break; case CPR0_PLBED: ret = (5 << 24); break; case CPR0_OPBD: ret = (2 << 24); break; case CPR0_PERD: case CPR0_AHBD: ret = (1 << 24); break; default: break; } break; default: break; } return ret; } static void dcr_write_cpr(void *opaque, int dcrn, uint32_t val) { ppc4xx_cpr_t *cpr = opaque; switch (dcrn) { case CPR0_CFGADDR: cpr->addr = val; break; case CPR0_CFGDATA: break; default: break; } } static void ppc4xx_cpr_reset(void *opaque) { ppc4xx_cpr_t *cpr = opaque; cpr->addr = 0; } void ppc4xx_cpr_init(CPUPPCState *env) { ppc4xx_cpr_t *cpr; cpr = g_malloc0(sizeof(*cpr)); ppc_dcr_register(env, CPR0_CFGADDR, cpr, &dcr_read_cpr, &dcr_write_cpr); ppc_dcr_register(env, CPR0_CFGDATA, cpr, &dcr_read_cpr, &dcr_write_cpr); qemu_register_reset(ppc4xx_cpr_reset, cpr); } /*****************************************************************************/ /* System DCRs */ typedef struct ppc4xx_sdr_t ppc4xx_sdr_t; struct ppc4xx_sdr_t { uint32_t addr; }; enum { SDR0_CFGADDR = 0x00e, SDR0_CFGDATA, SDR0_STRP0 = 0x020, SDR0_STRP1, SDR0_102 = 0x66, SDR0_103, SDR0_128 = 0x80, SDR0_ECID3 = 0x083, SDR0_DDR0 = 0x0e1, SDR0_USB0 = 0x320, }; enum { PESDR0_LOOP = 0x303, PESDR0_RCSSET, PESDR0_RCSSTS, PESDR0_RSTSTA = 0x310, PESDR1_LOOP = 0x343, PESDR1_RCSSET, PESDR1_RCSSTS, PESDR1_RSTSTA = 0x365, }; #define SDR0_DDR0_DDRM_ENCODE(n) ((((unsigned long)(n)) & 0x03) << 29) #define SDR0_DDR0_DDRM_DDR1 0x20000000 #define SDR0_DDR0_DDRM_DDR2 0x40000000 static uint32_t dcr_read_sdr(void *opaque, int dcrn) { ppc4xx_sdr_t *sdr = opaque; uint32_t ret = 0; switch (dcrn) { case SDR0_CFGADDR: ret = sdr->addr; break; case SDR0_CFGDATA: switch (sdr->addr) { case SDR0_STRP0: ret = (0xb5 << 8) | (1 << 4) | 9; break; case SDR0_STRP1: ret = (5 << 29) | (2 << 26) | (1 << 24); break; case SDR0_ECID3: ret = 1 << 20; /* No Security/Kasumi support */ break; case SDR0_DDR0: ret = SDR0_DDR0_DDRM_ENCODE(1) | SDR0_DDR0_DDRM_DDR1; break; case PESDR0_RCSSET: case PESDR1_RCSSET: ret = (1 << 24) | (1 << 16); break; case PESDR0_RCSSTS: case PESDR1_RCSSTS: ret = (1 << 16) | (1 << 12); break; case PESDR0_RSTSTA: case PESDR1_RSTSTA: ret = 1; break; case PESDR0_LOOP: case PESDR1_LOOP: ret = 1 << 12; break; default: break; } break; default: break; } return ret; } static void dcr_write_sdr(void *opaque, int dcrn, uint32_t val) { ppc4xx_sdr_t *sdr = opaque; switch (dcrn) { case SDR0_CFGADDR: sdr->addr = val; break; case SDR0_CFGDATA: switch (sdr->addr) { case 0x00: /* B0CR */ break; default: break; } break; default: break; } } static void sdr_reset(void *opaque) { ppc4xx_sdr_t *sdr = opaque; sdr->addr = 0; } void ppc4xx_sdr_init(CPUPPCState *env) { ppc4xx_sdr_t *sdr; sdr = g_malloc0(sizeof(*sdr)); qemu_register_reset(&sdr_reset, sdr); ppc_dcr_register(env, SDR0_CFGADDR, sdr, &dcr_read_sdr, &dcr_write_sdr); ppc_dcr_register(env, SDR0_CFGDATA, sdr, &dcr_read_sdr, &dcr_write_sdr); ppc_dcr_register(env, SDR0_102, sdr, &dcr_read_sdr, &dcr_write_sdr); ppc_dcr_register(env, SDR0_103, sdr, &dcr_read_sdr, &dcr_write_sdr); ppc_dcr_register(env, SDR0_128, sdr, &dcr_read_sdr, &dcr_write_sdr); ppc_dcr_register(env, SDR0_USB0, sdr, &dcr_read_sdr, &dcr_write_sdr); } /*****************************************************************************/ /* SDRAM controller */ typedef struct ppc440_sdram_t { uint32_t addr; int nbanks; MemoryRegion containers[4]; /* used for clipping */ MemoryRegion *ram_memories; hwaddr ram_bases[4]; hwaddr ram_sizes[4]; uint32_t bcr[4]; } ppc440_sdram_t; enum { SDRAM0_CFGADDR = 0x10, SDRAM0_CFGDATA, SDRAM_R0BAS = 0x40, SDRAM_R1BAS, SDRAM_R2BAS, SDRAM_R3BAS, SDRAM_CONF1HB = 0x45, SDRAM_PLBADDULL = 0x4a, SDRAM_CONF1LL = 0x4b, SDRAM_CONFPATHB = 0x4f, SDRAM_PLBADDUHB = 0x50, }; static uint32_t sdram_bcr(hwaddr ram_base, hwaddr ram_size) { uint32_t bcr; switch (ram_size) { case (8 * MiB): bcr = 0xffc0; break; case (16 * MiB): bcr = 0xff80; break; case (32 * MiB): bcr = 0xff00; break; case (64 * MiB): bcr = 0xfe00; break; case (128 * MiB): bcr = 0xfc00; break; case (256 * MiB): bcr = 0xf800; break; case (512 * MiB): bcr = 0xf000; break; case (1 * GiB): bcr = 0xe000; break; case (2 * GiB): bcr = 0xc000; break; case (4 * GiB): bcr = 0x8000; break; default: error_report("invalid RAM size " TARGET_FMT_plx, ram_size); return 0; } bcr |= ram_base >> 2 & 0xffe00000; bcr |= 1; return bcr; } static inline hwaddr sdram_base(uint32_t bcr) { return (bcr & 0xffe00000) << 2; } static uint64_t sdram_size(uint32_t bcr) { uint64_t size; int sh; sh = 1024 - ((bcr >> 6) & 0x3ff); size = 8 * MiB * sh; return size; } static void sdram_set_bcr(ppc440_sdram_t *sdram, int i, uint32_t bcr, int enabled) { if (sdram->bcr[i] & 1) { /* First unmap RAM if enabled */ memory_region_del_subregion(get_system_memory(), &sdram->containers[i]); memory_region_del_subregion(&sdram->containers[i], &sdram->ram_memories[i]); object_unparent(OBJECT(&sdram->containers[i])); } sdram->bcr[i] = bcr & 0xffe0ffc1; if (enabled && (bcr & 1)) { memory_region_init(&sdram->containers[i], NULL, "sdram-containers", sdram_size(bcr)); memory_region_add_subregion(&sdram->containers[i], 0, &sdram->ram_memories[i]); memory_region_add_subregion(get_system_memory(), sdram_base(bcr), &sdram->containers[i]); } } static void sdram_map_bcr(ppc440_sdram_t *sdram) { int i; for (i = 0; i < sdram->nbanks; i++) { if (sdram->ram_sizes[i] != 0) { sdram_set_bcr(sdram, i, sdram_bcr(sdram->ram_bases[i], sdram->ram_sizes[i]), 1); } else { sdram_set_bcr(sdram, i, 0, 0); } } } static uint32_t dcr_read_sdram(void *opaque, int dcrn) { ppc440_sdram_t *sdram = opaque; uint32_t ret = 0; switch (dcrn) { case SDRAM_R0BAS: case SDRAM_R1BAS: case SDRAM_R2BAS: case SDRAM_R3BAS: if (sdram->ram_sizes[dcrn - SDRAM_R0BAS]) { ret = sdram_bcr(sdram->ram_bases[dcrn - SDRAM_R0BAS], sdram->ram_sizes[dcrn - SDRAM_R0BAS]); } break; case SDRAM_CONF1HB: case SDRAM_CONF1LL: case SDRAM_CONFPATHB: case SDRAM_PLBADDULL: case SDRAM_PLBADDUHB: break; case SDRAM0_CFGADDR: ret = sdram->addr; break; case SDRAM0_CFGDATA: switch (sdram->addr) { case 0x14: /* SDRAM_MCSTAT (405EX) */ case 0x1F: ret = 0x80000000; break; case 0x21: /* SDRAM_MCOPT2 */ ret = 0x08000000; break; case 0x40: /* SDRAM_MB0CF */ ret = 0x00008001; break; case 0x7A: /* SDRAM_DLCR */ ret = 0x02000000; break; case 0xE1: /* SDR0_DDR0 */ ret = SDR0_DDR0_DDRM_ENCODE(1) | SDR0_DDR0_DDRM_DDR1; break; default: break; } break; default: break; } return ret; } static void dcr_write_sdram(void *opaque, int dcrn, uint32_t val) { ppc440_sdram_t *sdram = opaque; switch (dcrn) { case SDRAM_R0BAS: case SDRAM_R1BAS: case SDRAM_R2BAS: case SDRAM_R3BAS: case SDRAM_CONF1HB: case SDRAM_CONF1LL: case SDRAM_CONFPATHB: case SDRAM_PLBADDULL: case SDRAM_PLBADDUHB: break; case SDRAM0_CFGADDR: sdram->addr = val; break; case SDRAM0_CFGDATA: switch (sdram->addr) { case 0x00: /* B0CR */ break; default: break; } break; default: break; } } static void sdram_reset(void *opaque) { ppc440_sdram_t *sdram = opaque; sdram->addr = 0; } void ppc440_sdram_init(CPUPPCState *env, int nbanks, MemoryRegion *ram_memories, hwaddr *ram_bases, hwaddr *ram_sizes, int do_init) { ppc440_sdram_t *sdram; sdram = g_malloc0(sizeof(*sdram)); sdram->nbanks = nbanks; sdram->ram_memories = ram_memories; memcpy(sdram->ram_bases, ram_bases, nbanks * sizeof(hwaddr)); memcpy(sdram->ram_sizes, ram_sizes, nbanks * sizeof(hwaddr)); qemu_register_reset(&sdram_reset, sdram); ppc_dcr_register(env, SDRAM0_CFGADDR, sdram, &dcr_read_sdram, &dcr_write_sdram); ppc_dcr_register(env, SDRAM0_CFGDATA, sdram, &dcr_read_sdram, &dcr_write_sdram); if (do_init) { sdram_map_bcr(sdram); } ppc_dcr_register(env, SDRAM_R0BAS, sdram, &dcr_read_sdram, &dcr_write_sdram); ppc_dcr_register(env, SDRAM_R1BAS, sdram, &dcr_read_sdram, &dcr_write_sdram); ppc_dcr_register(env, SDRAM_R2BAS, sdram, &dcr_read_sdram, &dcr_write_sdram); ppc_dcr_register(env, SDRAM_R3BAS, sdram, &dcr_read_sdram, &dcr_write_sdram); ppc_dcr_register(env, SDRAM_CONF1HB, sdram, &dcr_read_sdram, &dcr_write_sdram); ppc_dcr_register(env, SDRAM_PLBADDULL, sdram, &dcr_read_sdram, &dcr_write_sdram); ppc_dcr_register(env, SDRAM_CONF1LL, sdram, &dcr_read_sdram, &dcr_write_sdram); ppc_dcr_register(env, SDRAM_CONFPATHB, sdram, &dcr_read_sdram, &dcr_write_sdram); ppc_dcr_register(env, SDRAM_PLBADDUHB, sdram, &dcr_read_sdram, &dcr_write_sdram); } /*****************************************************************************/ /* PLB to AHB bridge */ enum { AHB_TOP = 0xA4, AHB_BOT = 0xA5, }; typedef struct ppc4xx_ahb_t { uint32_t top; uint32_t bot; } ppc4xx_ahb_t; static uint32_t dcr_read_ahb(void *opaque, int dcrn) { ppc4xx_ahb_t *ahb = opaque; uint32_t ret = 0; switch (dcrn) { case AHB_TOP: ret = ahb->top; break; case AHB_BOT: ret = ahb->bot; break; default: break; } return ret; } static void dcr_write_ahb(void *opaque, int dcrn, uint32_t val) { ppc4xx_ahb_t *ahb = opaque; switch (dcrn) { case AHB_TOP: ahb->top = val; break; case AHB_BOT: ahb->bot = val; break; } } static void ppc4xx_ahb_reset(void *opaque) { ppc4xx_ahb_t *ahb = opaque; /* No error */ ahb->top = 0; ahb->bot = 0; } void ppc4xx_ahb_init(CPUPPCState *env) { ppc4xx_ahb_t *ahb; ahb = g_malloc0(sizeof(*ahb)); ppc_dcr_register(env, AHB_TOP, ahb, &dcr_read_ahb, &dcr_write_ahb); ppc_dcr_register(env, AHB_BOT, ahb, &dcr_read_ahb, &dcr_write_ahb); qemu_register_reset(ppc4xx_ahb_reset, ahb); } /*****************************************************************************/ /* DMA controller */ #define DMA0_CR_CE (1 << 31) #define DMA0_CR_PW (1 << 26 | 1 << 25) #define DMA0_CR_DAI (1 << 24) #define DMA0_CR_SAI (1 << 23) #define DMA0_CR_DEC (1 << 2) enum { DMA0_CR = 0x00, DMA0_CT, DMA0_SAH, DMA0_SAL, DMA0_DAH, DMA0_DAL, DMA0_SGH, DMA0_SGL, DMA0_SR = 0x20, DMA0_SGC = 0x23, DMA0_SLP = 0x25, DMA0_POL = 0x26, }; typedef struct { uint32_t cr; uint32_t ct; uint64_t sa; uint64_t da; uint64_t sg; } PPC4xxDmaChnl; typedef struct { int base; PPC4xxDmaChnl ch[4]; uint32_t sr; } PPC4xxDmaState; static uint32_t dcr_read_dma(void *opaque, int dcrn) { PPC4xxDmaState *dma = opaque; uint32_t val = 0; int addr = dcrn - dma->base; int chnl = addr / 8; switch (addr) { case 0x00 ... 0x1f: switch (addr % 8) { case DMA0_CR: val = dma->ch[chnl].cr; break; case DMA0_CT: val = dma->ch[chnl].ct; break; case DMA0_SAH: val = dma->ch[chnl].sa >> 32; break; case DMA0_SAL: val = dma->ch[chnl].sa; break; case DMA0_DAH: val = dma->ch[chnl].da >> 32; break; case DMA0_DAL: val = dma->ch[chnl].da; break; case DMA0_SGH: val = dma->ch[chnl].sg >> 32; break; case DMA0_SGL: val = dma->ch[chnl].sg; break; } break; case DMA0_SR: val = dma->sr; break; default: qemu_log_mask(LOG_UNIMP, "%s: unimplemented register %x (%d, %x)\n", __func__, dcrn, chnl, addr); } return val; } static void dcr_write_dma(void *opaque, int dcrn, uint32_t val) { PPC4xxDmaState *dma = opaque; int addr = dcrn - dma->base; int chnl = addr / 8; switch (addr) { case 0x00 ... 0x1f: switch (addr % 8) { case DMA0_CR: dma->ch[chnl].cr = val; if (val & DMA0_CR_CE) { int count = dma->ch[chnl].ct & 0xffff; if (count) { int width, i, sidx, didx; uint8_t *rptr, *wptr; hwaddr rlen, wlen; sidx = didx = 0; width = 1 << ((val & DMA0_CR_PW) >> 25); rptr = cpu_physical_memory_map(dma->ch[chnl].sa, &rlen, 0); wptr = cpu_physical_memory_map(dma->ch[chnl].da, &wlen, 1); if (rptr && wptr) { if (!(val & DMA0_CR_DEC) && val & DMA0_CR_SAI && val & DMA0_CR_DAI) { /* optimise common case */ memmove(wptr, rptr, count * width); sidx = didx = count * width; } else { /* do it the slow way */ for (sidx = didx = i = 0; i < count; i++) { uint64_t v = ldn_le_p(rptr + sidx, width); stn_le_p(wptr + didx, width, v); if (val & DMA0_CR_SAI) { sidx += width; } if (val & DMA0_CR_DAI) { didx += width; } } } } if (wptr) { cpu_physical_memory_unmap(wptr, wlen, 1, didx); } if (rptr) { cpu_physical_memory_unmap(rptr, rlen, 0, sidx); } } } break; case DMA0_CT: dma->ch[chnl].ct = val; break; case DMA0_SAH: dma->ch[chnl].sa &= 0xffffffffULL; dma->ch[chnl].sa |= (uint64_t)val << 32; break; case DMA0_SAL: dma->ch[chnl].sa &= 0xffffffff00000000ULL; dma->ch[chnl].sa |= val; break; case DMA0_DAH: dma->ch[chnl].da &= 0xffffffffULL; dma->ch[chnl].da |= (uint64_t)val << 32; break; case DMA0_DAL: dma->ch[chnl].da &= 0xffffffff00000000ULL; dma->ch[chnl].da |= val; break; case DMA0_SGH: dma->ch[chnl].sg &= 0xffffffffULL; dma->ch[chnl].sg |= (uint64_t)val << 32; break; case DMA0_SGL: dma->ch[chnl].sg &= 0xffffffff00000000ULL; dma->ch[chnl].sg |= val; break; } break; case DMA0_SR: dma->sr &= ~val; break; default: qemu_log_mask(LOG_UNIMP, "%s: unimplemented register %x (%d, %x)\n", __func__, dcrn, chnl, addr); } } static void ppc4xx_dma_reset(void *opaque) { PPC4xxDmaState *dma = opaque; int dma_base = dma->base; memset(dma, 0, sizeof(*dma)); dma->base = dma_base; } void ppc4xx_dma_init(CPUPPCState *env, int dcr_base) { PPC4xxDmaState *dma; int i; dma = g_malloc0(sizeof(*dma)); dma->base = dcr_base; qemu_register_reset(&ppc4xx_dma_reset, dma); for (i = 0; i < 4; i++) { ppc_dcr_register(env, dcr_base + i * 8 + DMA0_CR, dma, &dcr_read_dma, &dcr_write_dma); ppc_dcr_register(env, dcr_base + i * 8 + DMA0_CT, dma, &dcr_read_dma, &dcr_write_dma); ppc_dcr_register(env, dcr_base + i * 8 + DMA0_SAH, dma, &dcr_read_dma, &dcr_write_dma); ppc_dcr_register(env, dcr_base + i * 8 + DMA0_SAL, dma, &dcr_read_dma, &dcr_write_dma); ppc_dcr_register(env, dcr_base + i * 8 + DMA0_DAH, dma, &dcr_read_dma, &dcr_write_dma); ppc_dcr_register(env, dcr_base + i * 8 + DMA0_DAL, dma, &dcr_read_dma, &dcr_write_dma); ppc_dcr_register(env, dcr_base + i * 8 + DMA0_SGH, dma, &dcr_read_dma, &dcr_write_dma); ppc_dcr_register(env, dcr_base + i * 8 + DMA0_SGL, dma, &dcr_read_dma, &dcr_write_dma); } ppc_dcr_register(env, dcr_base + DMA0_SR, dma, &dcr_read_dma, &dcr_write_dma); ppc_dcr_register(env, dcr_base + DMA0_SGC, dma, &dcr_read_dma, &dcr_write_dma); ppc_dcr_register(env, dcr_base + DMA0_SLP, dma, &dcr_read_dma, &dcr_write_dma); ppc_dcr_register(env, dcr_base + DMA0_POL, dma, &dcr_read_dma, &dcr_write_dma); } /*****************************************************************************/ /* PCI Express controller */ /* FIXME: This is not complete and does not work, only implemented partially * to allow firmware and guests to find an empty bus. Cards should use PCI. */ #include "hw/pci/pcie_host.h" #define TYPE_PPC460EX_PCIE_HOST "ppc460ex-pcie-host" #define PPC460EX_PCIE_HOST(obj) \ OBJECT_CHECK(PPC460EXPCIEState, (obj), TYPE_PPC460EX_PCIE_HOST) typedef struct PPC460EXPCIEState { PCIExpressHost host; MemoryRegion iomem; qemu_irq irq[4]; int32_t dcrn_base; uint64_t cfg_base; uint32_t cfg_mask; uint64_t msg_base; uint32_t msg_mask; uint64_t omr1_base; uint64_t omr1_mask; uint64_t omr2_base; uint64_t omr2_mask; uint64_t omr3_base; uint64_t omr3_mask; uint64_t reg_base; uint32_t reg_mask; uint32_t special; uint32_t cfg; } PPC460EXPCIEState; #define DCRN_PCIE0_BASE 0x100 #define DCRN_PCIE1_BASE 0x120 enum { PEGPL_CFGBAH = 0x0, PEGPL_CFGBAL, PEGPL_CFGMSK, PEGPL_MSGBAH, PEGPL_MSGBAL, PEGPL_MSGMSK, PEGPL_OMR1BAH, PEGPL_OMR1BAL, PEGPL_OMR1MSKH, PEGPL_OMR1MSKL, PEGPL_OMR2BAH, PEGPL_OMR2BAL, PEGPL_OMR2MSKH, PEGPL_OMR2MSKL, PEGPL_OMR3BAH, PEGPL_OMR3BAL, PEGPL_OMR3MSKH, PEGPL_OMR3MSKL, PEGPL_REGBAH, PEGPL_REGBAL, PEGPL_REGMSK, PEGPL_SPECIAL, PEGPL_CFG, }; static uint32_t dcr_read_pcie(void *opaque, int dcrn) { PPC460EXPCIEState *state = opaque; uint32_t ret = 0; switch (dcrn - state->dcrn_base) { case PEGPL_CFGBAH: ret = state->cfg_base >> 32; break; case PEGPL_CFGBAL: ret = state->cfg_base; break; case PEGPL_CFGMSK: ret = state->cfg_mask; break; case PEGPL_MSGBAH: ret = state->msg_base >> 32; break; case PEGPL_MSGBAL: ret = state->msg_base; break; case PEGPL_MSGMSK: ret = state->msg_mask; break; case PEGPL_OMR1BAH: ret = state->omr1_base >> 32; break; case PEGPL_OMR1BAL: ret = state->omr1_base; break; case PEGPL_OMR1MSKH: ret = state->omr1_mask >> 32; break; case PEGPL_OMR1MSKL: ret = state->omr1_mask; break; case PEGPL_OMR2BAH: ret = state->omr2_base >> 32; break; case PEGPL_OMR2BAL: ret = state->omr2_base; break; case PEGPL_OMR2MSKH: ret = state->omr2_mask >> 32; break; case PEGPL_OMR2MSKL: ret = state->omr3_mask; break; case PEGPL_OMR3BAH: ret = state->omr3_base >> 32; break; case PEGPL_OMR3BAL: ret = state->omr3_base; break; case PEGPL_OMR3MSKH: ret = state->omr3_mask >> 32; break; case PEGPL_OMR3MSKL: ret = state->omr3_mask; break; case PEGPL_REGBAH: ret = state->reg_base >> 32; break; case PEGPL_REGBAL: ret = state->reg_base; break; case PEGPL_REGMSK: ret = state->reg_mask; break; case PEGPL_SPECIAL: ret = state->special; break; case PEGPL_CFG: ret = state->cfg; break; } return ret; } static void dcr_write_pcie(void *opaque, int dcrn, uint32_t val) { PPC460EXPCIEState *s = opaque; uint64_t size; switch (dcrn - s->dcrn_base) { case PEGPL_CFGBAH: s->cfg_base = ((uint64_t)val << 32) | (s->cfg_base & 0xffffffff); break; case PEGPL_CFGBAL: s->cfg_base = (s->cfg_base & 0xffffffff00000000ULL) | val; break; case PEGPL_CFGMSK: s->cfg_mask = val; size = ~(val & 0xfffffffe) + 1; qemu_mutex_lock_iothread(); pcie_host_mmcfg_update(PCIE_HOST_BRIDGE(s), val & 1, s->cfg_base, size); qemu_mutex_unlock_iothread(); break; case PEGPL_MSGBAH: s->msg_base = ((uint64_t)val << 32) | (s->msg_base & 0xffffffff); break; case PEGPL_MSGBAL: s->msg_base = (s->msg_base & 0xffffffff00000000ULL) | val; break; case PEGPL_MSGMSK: s->msg_mask = val; break; case PEGPL_OMR1BAH: s->omr1_base = ((uint64_t)val << 32) | (s->omr1_base & 0xffffffff); break; case PEGPL_OMR1BAL: s->omr1_base = (s->omr1_base & 0xffffffff00000000ULL) | val; break; case PEGPL_OMR1MSKH: s->omr1_mask = ((uint64_t)val << 32) | (s->omr1_mask & 0xffffffff); break; case PEGPL_OMR1MSKL: s->omr1_mask = (s->omr1_mask & 0xffffffff00000000ULL) | val; break; case PEGPL_OMR2BAH: s->omr2_base = ((uint64_t)val << 32) | (s->omr2_base & 0xffffffff); break; case PEGPL_OMR2BAL: s->omr2_base = (s->omr2_base & 0xffffffff00000000ULL) | val; break; case PEGPL_OMR2MSKH: s->omr2_mask = ((uint64_t)val << 32) | (s->omr2_mask & 0xffffffff); break; case PEGPL_OMR2MSKL: s->omr2_mask = (s->omr2_mask & 0xffffffff00000000ULL) | val; break; case PEGPL_OMR3BAH: s->omr3_base = ((uint64_t)val << 32) | (s->omr3_base & 0xffffffff); break; case PEGPL_OMR3BAL: s->omr3_base = (s->omr3_base & 0xffffffff00000000ULL) | val; break; case PEGPL_OMR3MSKH: s->omr3_mask = ((uint64_t)val << 32) | (s->omr3_mask & 0xffffffff); break; case PEGPL_OMR3MSKL: s->omr3_mask = (s->omr3_mask & 0xffffffff00000000ULL) | val; break; case PEGPL_REGBAH: s->reg_base = ((uint64_t)val << 32) | (s->reg_base & 0xffffffff); break; case PEGPL_REGBAL: s->reg_base = (s->reg_base & 0xffffffff00000000ULL) | val; break; case PEGPL_REGMSK: s->reg_mask = val; /* FIXME: how is size encoded? */ size = (val == 0x7001 ? 4096 : ~(val & 0xfffffffe) + 1); break; case PEGPL_SPECIAL: s->special = val; break; case PEGPL_CFG: s->cfg = val; break; } } static void ppc460ex_set_irq(void *opaque, int irq_num, int level) { PPC460EXPCIEState *s = opaque; qemu_set_irq(s->irq[irq_num], level); } static void ppc460ex_pcie_realize(DeviceState *dev, Error **errp) { PPC460EXPCIEState *s = PPC460EX_PCIE_HOST(dev); PCIHostState *pci = PCI_HOST_BRIDGE(dev); int i, id; char buf[16]; switch (s->dcrn_base) { case DCRN_PCIE0_BASE: id = 0; break; case DCRN_PCIE1_BASE: id = 1; break; default: error_setg(errp, "invalid PCIe DCRN base"); return; } snprintf(buf, sizeof(buf), "pcie%d-io", id); memory_region_init(&s->iomem, OBJECT(s), buf, UINT64_MAX); for (i = 0; i < 4; i++) { sysbus_init_irq(SYS_BUS_DEVICE(dev), &s->irq[i]); } snprintf(buf, sizeof(buf), "pcie.%d", id); pci->bus = pci_register_root_bus(DEVICE(s), buf, ppc460ex_set_irq, pci_swizzle_map_irq_fn, s, &s->iomem, get_system_io(), 0, 4, TYPE_PCIE_BUS); } static Property ppc460ex_pcie_props[] = { DEFINE_PROP_INT32("dcrn-base", PPC460EXPCIEState, dcrn_base, -1), DEFINE_PROP_END_OF_LIST(), }; static void ppc460ex_pcie_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); dc->realize = ppc460ex_pcie_realize; dc->props = ppc460ex_pcie_props; dc->hotpluggable = false; } static const TypeInfo ppc460ex_pcie_host_info = { .name = TYPE_PPC460EX_PCIE_HOST, .parent = TYPE_PCIE_HOST_BRIDGE, .instance_size = sizeof(PPC460EXPCIEState), .class_init = ppc460ex_pcie_class_init, }; static void ppc460ex_pcie_register(void) { type_register_static(&ppc460ex_pcie_host_info); } type_init(ppc460ex_pcie_register) static void ppc460ex_pcie_register_dcrs(PPC460EXPCIEState *s, CPUPPCState *env) { ppc_dcr_register(env, s->dcrn_base + PEGPL_CFGBAH, s, &dcr_read_pcie, &dcr_write_pcie); ppc_dcr_register(env, s->dcrn_base + PEGPL_CFGBAL, s, &dcr_read_pcie, &dcr_write_pcie); ppc_dcr_register(env, s->dcrn_base + PEGPL_CFGMSK, s, &dcr_read_pcie, &dcr_write_pcie); ppc_dcr_register(env, s->dcrn_base + PEGPL_MSGBAH, s, &dcr_read_pcie, &dcr_write_pcie); ppc_dcr_register(env, s->dcrn_base + PEGPL_MSGBAL, s, &dcr_read_pcie, &dcr_write_pcie); ppc_dcr_register(env, s->dcrn_base + PEGPL_MSGMSK, s, &dcr_read_pcie, &dcr_write_pcie); ppc_dcr_register(env, s->dcrn_base + PEGPL_OMR1BAH, s, &dcr_read_pcie, &dcr_write_pcie); ppc_dcr_register(env, s->dcrn_base + PEGPL_OMR1BAL, s, &dcr_read_pcie, &dcr_write_pcie); ppc_dcr_register(env, s->dcrn_base + PEGPL_OMR1MSKH, s, &dcr_read_pcie, &dcr_write_pcie); ppc_dcr_register(env, s->dcrn_base + PEGPL_OMR1MSKL, s, &dcr_read_pcie, &dcr_write_pcie); ppc_dcr_register(env, s->dcrn_base + PEGPL_OMR2BAH, s, &dcr_read_pcie, &dcr_write_pcie); ppc_dcr_register(env, s->dcrn_base + PEGPL_OMR2BAL, s, &dcr_read_pcie, &dcr_write_pcie); ppc_dcr_register(env, s->dcrn_base + PEGPL_OMR2MSKH, s, &dcr_read_pcie, &dcr_write_pcie); ppc_dcr_register(env, s->dcrn_base + PEGPL_OMR2MSKL, s, &dcr_read_pcie, &dcr_write_pcie); ppc_dcr_register(env, s->dcrn_base + PEGPL_OMR3BAH, s, &dcr_read_pcie, &dcr_write_pcie); ppc_dcr_register(env, s->dcrn_base + PEGPL_OMR3BAL, s, &dcr_read_pcie, &dcr_write_pcie); ppc_dcr_register(env, s->dcrn_base + PEGPL_OMR3MSKH, s, &dcr_read_pcie, &dcr_write_pcie); ppc_dcr_register(env, s->dcrn_base + PEGPL_OMR3MSKL, s, &dcr_read_pcie, &dcr_write_pcie); ppc_dcr_register(env, s->dcrn_base + PEGPL_REGBAH, s, &dcr_read_pcie, &dcr_write_pcie); ppc_dcr_register(env, s->dcrn_base + PEGPL_REGBAL, s, &dcr_read_pcie, &dcr_write_pcie); ppc_dcr_register(env, s->dcrn_base + PEGPL_REGMSK, s, &dcr_read_pcie, &dcr_write_pcie); ppc_dcr_register(env, s->dcrn_base + PEGPL_SPECIAL, s, &dcr_read_pcie, &dcr_write_pcie); ppc_dcr_register(env, s->dcrn_base + PEGPL_CFG, s, &dcr_read_pcie, &dcr_write_pcie); } void ppc460ex_pcie_init(CPUPPCState *env) { DeviceState *dev; dev = qdev_create(NULL, TYPE_PPC460EX_PCIE_HOST); qdev_prop_set_int32(dev, "dcrn-base", DCRN_PCIE0_BASE); qdev_init_nofail(dev); object_property_set_bool(OBJECT(dev), true, "realized", NULL); ppc460ex_pcie_register_dcrs(PPC460EX_PCIE_HOST(dev), env); dev = qdev_create(NULL, TYPE_PPC460EX_PCIE_HOST); qdev_prop_set_int32(dev, "dcrn-base", DCRN_PCIE1_BASE); qdev_init_nofail(dev); object_property_set_bool(OBJECT(dev), true, "realized", NULL); ppc460ex_pcie_register_dcrs(PPC460EX_PCIE_HOST(dev), env); }
{ "pile_set_name": "Github" }
/******************************************/ /* */ /* Copyright (c) 2018 monitor1394 */ /* https://github.com/monitor1394 */ /* */ /******************************************/ using System.Collections.Generic; using UnityEngine; using UnityEngine.Events; namespace XCharts { internal class ObjectPool<T> where T : new() { private readonly Stack<T> m_Stack = new Stack<T>(); private readonly UnityAction<T> m_ActionOnGet; private readonly UnityAction<T> m_ActionOnRelease; public int countAll { get; private set; } public int countActive { get { return countAll - countInactive; } } public int countInactive { get { return m_Stack.Count; } } public ObjectPool(UnityAction<T> actionOnGet, UnityAction<T> actionOnRelease) { m_ActionOnGet = actionOnGet; m_ActionOnRelease = actionOnRelease; } public T Get() { T element; if (m_Stack.Count == 0) { element = new T(); countAll++; } else { element = m_Stack.Pop(); } if (m_ActionOnGet != null) m_ActionOnGet(element); return element; } public void Release(T element) { if (m_Stack.Count > 0 && ReferenceEquals(m_Stack.Peek(), element)) Debug.LogError("Internal error. Trying to destroy object that is already released to pool."); if (m_ActionOnRelease != null) m_ActionOnRelease(element); m_Stack.Push(element); } public void ClearAll() { m_Stack.Clear(); } } }
{ "pile_set_name": "Github" }
#!/bin/ksh -p # # CDDL HEADER START # # The contents of this file are subject to the terms of the # Common Development and Distribution License (the "License"). # You may not use this file except in compliance with the License. # # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE # or http://www.opensolaris.org/os/licensing. # See the License for the specific language governing permissions # and limitations under the License. # # When distributing Covered Code, include this CDDL HEADER in each # file and include the License file at usr/src/OPENSOLARIS.LICENSE. # If applicable, add the following below this CDDL HEADER, with the # fields enclosed by brackets "[]" replaced with your own identifying # information: Portions Copyright [yyyy] [name of copyright owner] # # CDDL HEADER END # # # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # # Copyright (c) 2013, 2016 by Delphix. All rights reserved. # . $STF_SUITE/include/libtest.shlib . $STF_SUITE/tests/functional/redundancy/redundancy.kshlib # # DESCRIPTION: # Striped pool have no data redundancy. Any device errors will # cause data corruption. # # STRATEGY: # 1. Create N virtual disk file. # 2. Create stripe pool based on the virtual disk files. # 3. Fill the filesystem with directories and files. # 4. Record all the files and directories checksum information. # 5. Damage one of the virtual disk file. # 6. Verify the data is error. # verify_runnable "global" log_assert "Verify striped pool have no data redundancy." log_onexit cleanup typeset -i cnt=$(random_int_between 2 5) setup_test_env $TESTPOOL "" $cnt damage_devs $TESTPOOL 1 "keep_label" log_must zpool scrub -w $TESTPOOL log_mustnot is_healthy $TESTPOOL log_pass "Striped pool has no data redundancy as expected."
{ "pile_set_name": "Github" }
Title: brocade_fcport: Fixed wrong speed information Level: 1 Component: checks Class: fix Compatible: compat Edition: cre State: unknown Version: 1.5.0i1 Date: 1500909872 Brocade specific SNMP table .1.3.6.1.4.1.1588.2.1.1.1.6.2.1 does not provide speed information for the interfaces. Thus this check plugins had to fetch another SNMP table .1.3.6.1.2.1.31.1.1.1.15 from IF-MIB. Unfortunately these tables are not directly connected by index and the assumed speed information could be wrong for some devices. http://community.brocade.com/t5/Fibre-Channel-SAN/SNMP-FC-port-speed/td-p/64980 says that "1073741824" from if-table correlates with index 1 from brocade-if-table.
{ "pile_set_name": "Github" }
/* * Hibernate OGM, Domain model persistence for NoSQL datastores * * License: GNU Lesser General Public License (LGPL), version 2.1 or later * See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>. */ package org.hibernate.ogm.datastore.infinispanremote.test.storedprocedures; import org.hibernate.ogm.backendtck.storedprocedures.NamedParametersStoredProcedureCallTest; import org.hibernate.ogm.datastore.infinispanremote.utils.InfinispanRemoteJpaServerRunner; import org.hibernate.ogm.datastore.infinispanremote.utils.StoredProceduresDeployer; import org.hibernate.ogm.utils.TestForIssue; import org.junit.BeforeClass; import org.junit.runner.RunWith; /** * Testing call of stored procedures using <b>server-task</b> mechanism. * It extends {@link NamedParametersStoredProcedureCallTest} to support backendtck test cases. * <p>This test based on 3 deployables (simple-value-procedure.jar, result-set-procedure.jar, exceptional-procedure.jar). * <p>They're representatives of following classes accordingly {@link SimpleValueProcedure}, {@link ResultSetProcedure} and {@link ExceptionalProcedure}. * * @author The Viet Nguyen &amp;ntviet18@gmail.com&amp; */ @TestForIssue(jiraKey = { "OGM-1431" }) @RunWith(InfinispanRemoteJpaServerRunner.class) public class ServerTaskInfinispanNamedParametersStoredProcedureCallTest extends NamedParametersStoredProcedureCallTest { @BeforeClass public static void setUpAll() throws Exception { StoredProceduresDeployer.deployJars(); } @Override public void testExceptionWhenUsingNotRegisteredParameter() { // this dialect delegate validation to users } }
{ "pile_set_name": "Github" }
import { handleActions } from 'redux-actions' import { fromJS } from 'immutable' export default handleActions( { PROJECT_LOAD: (state, { payload }) => { try { const proj = fromJS(payload) return state.unshift(proj) } catch (err) { return state } }, PROJECTS_LOAD: (state, { payload }) => { try { return fromJS(payload) } catch (err) { return state } }, PROJECT_UPDATE_PREVIEW: (state, { payload }) => { if (!state) { return state } const { path, html } = payload const index = state.findIndex(pr => pr.get('path') === path) if (index === -1) { return state } return state.update(index, p => p.set('html', html)) }, PROJECT_REMOVE: (state, { payload: path }) => { return state.filter(p => p.get('path') !== path) }, PROJECT_RENAME: (state, { payload: { oldPath, newPath } }) => { return state.map(p => { if (p.get('path') !== oldPath) { return p } return p.set('path', newPath) }) }, }, null, )
{ "pile_set_name": "Github" }