text:
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using Google.Protobuf;
using Microsoft.Extensions.Logging;
using OpenTelemetry.Internal;
using OpenTelemetry.Logs;
using OpenTelemetry.Trace;
using OtlpCollector = OpenTelemetry.Proto.Collector.Logs.V1;
using OtlpCommon = OpenTelemetry.Proto.Common.V1;
using OtlpLogs = OpenTelemetry.Proto.Logs.V1;
using OtlpResource = OpenTelemetry.Proto.Resource.V1;

namespace OpenTelemetry.Exporter.OpenTelemetryProtocol.Implementation
{
    internal static class LogRecordExtensions
    {
        private static readonly string[] LogLevels = new string[7]
        {
            "Trace", "Debug", "Information", "Warning", "Error", "Critical", "None",
        };

        internal static void AddBatch(
            this OtlpCollector.ExportLogsServiceRequest request,
            SdkLimitOptions sdkLimitOptions,
            OtlpResource.Resource processResource,
            in Batch<LogRecord> logRecordBatch)
        {
            var resourceLogs = new OtlpLogs.ResourceLogs
            {
                Resource = processResource,
            };
            request.ResourceLogs.Add(resourceLogs);

            var scopeLogs = new OtlpLogs.ScopeLogs();
            resourceLogs.ScopeLogs.Add(scopeLogs);

            foreach (var logRecord in logRecordBatch)
            {
                var otlpLogRecord = logRecord.ToOtlpLog(sdkLimitOptions);
                if (otlpLogRecord != null)
                {
                    scopeLogs.LogRecords.Add(otlpLogRecord);
                }
            }
        }

        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        internal static OtlpLogs.LogRecord ToOtlpLog(this LogRecord logRecord, SdkLimitOptions sdkLimitOptions)
        {
            OtlpLogs.LogRecord otlpLogRecord = null;

            try
            {
                otlpLogRecord = new OtlpLogs.LogRecord
                {
                    TimeUnixNano = (ulong)logRecord.Timestamp.ToUnixTimeNanoseconds(),
                    SeverityNumber = GetSeverityNumber(logRecord.LogLevel),
                    SeverityText = LogLevels[(int)logRecord.LogLevel],
                };

                var attributeValueLengthLimit = sdkLimitOptions.AttributeValueLengthLimit;
                var attributeCountLimit = sdkLimitOptions.AttributeCountLimit ?? int.MaxValue;

                // First add the generic attributes like Category, EventId and Exception,
                // so they are less likely being dropped because of AttributeCountLimit.

                if (!string.IsNullOrEmpty(logRecord.CategoryName))
                {
                    // TODO:
                    // 1. Track the following issue, and map CategoryName to Name
                    // if it makes it to log data model.
                    // https://github.com/open-telemetry/opentelemetry-specification/issues/2398
                    // 2. Confirm if this name for attribute is good.
                    otlpLogRecord.AddStringAttribute("dotnet.ilogger.category", logRecord.CategoryName, attributeValueLengthLimit, attributeCountLimit);
                }

                if (logRecord.EventId.Id != default)
                {
                    otlpLogRecord.AddIntAttribute(nameof(logRecord.EventId.Id), logRecord.EventId.Id, attributeCountLimit);
                }

                if (!string.IsNullOrEmpty(logRecord.EventId.Name))
                {
                    otlpLogRecord.AddStringAttribute(nameof(logRecord.EventId.Name), logRecord.EventId.Name, attributeValueLengthLimit, attributeCountLimit);
                }

                if (logRecord.Exception != null)
                {
                    otlpLogRecord.AddStringAttribute(SemanticConventions.AttributeExceptionType, logRecord.Exception.GetType().Name, attributeValueLengthLimit, attributeCountLimit);
                    otlpLogRecord.AddStringAttribute(SemanticConventions.AttributeExceptionMessage, logRecord.Exception.Message, attributeValueLengthLimit, attributeCountLimit);
                    otlpLogRecord.AddStringAttribute(SemanticConventions.AttributeExceptionStacktrace, logRecord.Exception.ToInvariantString(), attributeValueLengthLimit, attributeCountLimit);
                }

                bool bodyPopulatedFromFormattedMessage = false;
                if (logRecord.FormattedMessage != null)
                {
                    otlpLogRecord.Body = new OtlpCommon.AnyValue { StringValue = logRecord.FormattedMessage };
                    bodyPopulatedFromFormattedMessage = true;
                }

                if (logRecord.StateValues != null)
                {
                    foreach (var stateValue in logRecord.StateValues)
                    {
                        // Special casing {OriginalFormat}
                        // See https://github.com/open-telemetry/opentelemetry-dotnet/pull/3182
                        // for explanation.
                        if (stateValue.Key.Equals("{OriginalFormat}") && !bodyPopulatedFromFormattedMessage)
                        {
                            otlpLogRecord.Body = new OtlpCommon.AnyValue { StringValue = stateValue.Value as string };
                        }
                        else if (OtlpKeyValueTransformer.Instance.TryTransformTag(stateValue, out var result, attributeValueLengthLimit))
                        {
                            otlpLogRecord.AddAttribute(result, attributeCountLimit);
                        }
                    }
                }

                if (logRecord.TraceId != default && logRecord.SpanId != default)
                {
                    byte[] traceIdBytes = new byte[16];
                    byte[] spanIdBytes = new byte[8];

                    logRecord.TraceId.CopyTo(traceIdBytes);
                    logRecord.SpanId.CopyTo(spanIdBytes);

                    otlpLogRecord.TraceId = UnsafeByteOperations.UnsafeWrap(traceIdBytes);
                    otlpLogRecord.SpanId = UnsafeByteOperations.UnsafeWrap(spanIdBytes);
                    otlpLogRecord.Flags = (uint)logRecord.TraceFlags;
                }

                logRecord.ForEachScope(ProcessScope, otlpLogRecord);

                void ProcessScope(LogRecordScope scope, OtlpLogs.LogRecord otlpLog)
                {
                    foreach (var scopeItem in scope)
                    {
                        if (scopeItem.Key.Equals("{OriginalFormat}") || string.IsNullOrEmpty(scopeItem.Key))
                        {
                            // Ignore if the scope key is empty.
                            // Ignore if the scope key is {OriginalFormat}
                            // Attributes should not contain duplicates,
                            // and it is expensive to de-dup, so this
                            // exporter is going to pass the scope items as is.
                            // {OriginalFormat} is going to be the key
                            // if one uses formatted string for scopes
                            // and if there are nested scopes, this is
                            // guaranteed to create duplicate keys.
                            // Similar for empty keys, which is what the
                            // key is going to be if user simply
                            // passes a string as scope.
                            // To summarize this exporter only allows
                            // IReadOnlyList<KeyValuePair<string, object?>>
                            // or IEnumerable<KeyValuePair<string, object?>>.
                            // and expect users to provide unique keys.
                            // Note: It is possible that we allow users
                            // to override this exporter feature. So not blocking
                            // empty/{OriginalFormat} in the SDK itself.
                        }
                        else
                        {
                            if (OtlpKeyValueTransformer.Instance.TryTransformTag(scopeItem, out var result, attributeValueLengthLimit))
                            {
                                otlpLog.AddAttribute(result, attributeCountLimit);
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                OpenTelemetryProtocolExporterEventSource.Log.CouldNotTranslateLogRecord(ex.Message);
            }

            return otlpLogRecord;
        }

        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        private static void AddAttribute(this OtlpLogs.LogRecord logRecord, OtlpCommon.KeyValue attribute, int maxAttributeCount)
        {
            if (logRecord.Attributes.Count < maxAttributeCount)
            {
                logRecord.Attributes.Add(attribute);
            }
            else
            {
                logRecord.DroppedAttributesCount++;
            }
        }

        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        private static void AddStringAttribute(this OtlpLogs.LogRecord logRecord, string key, string value, int? maxValueLength, int maxAttributeCount)
        {
            var attributeItem = new KeyValuePair<string, object>(key, value);
            if (OtlpKeyValueTransformer.Instance.TryTransformTag(attributeItem, out var result, maxValueLength))
            {
                logRecord.AddAttribute(result, maxAttributeCount);
            }
        }

        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        private static void AddIntAttribute(this OtlpLogs.LogRecord logRecord, string key, int value, int maxAttributeCount)
        {
            var attributeItem = new KeyValuePair<string, object>(key, value);
            if (OtlpKeyValueTransformer.Instance.TryTransformTag(attributeItem, out var result))
            {
                logRecord.AddAttribute(result, maxAttributeCount);
            }
        }

        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        private static OtlpLogs.SeverityNumber GetSeverityNumber(LogLevel logLevel)
        {
            // Maps the ILogger LogLevel to OpenTelemetry logging level.
            // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/data-model.md#appendix-b-severitynumber-example-mappings
            // TODO: for improving perf simply do ((int)loglevel * 4) + 1
            // or ((int)logLevel << 2) + 1
            // Current code is just for ease of reading.
            switch (logLevel)
            {
                case LogLevel.Trace:
                    return OtlpLogs.SeverityNumber.Trace;
                case LogLevel.Debug:
                    return OtlpLogs.SeverityNumber.Debug;
                case LogLevel.Information:
                    return OtlpLogs.SeverityNumber.Info;
                case LogLevel.Warning:
                    return OtlpLogs.SeverityNumber.Warn;
                case LogLevel.Error:
                    return OtlpLogs.SeverityNumber.Error;
                case LogLevel.Critical:
                    return OtlpLogs.SeverityNumber.Fatal;

                // TODO:
                // we reach default only for LogLevel.None
                // but that is filtered out anyway.
                // should we throw here then?
                default:
                    return OtlpLogs.SeverityNumber.Debug;
            }
        }
    }
}


text:
.PHONY : all clean compile link

APPNAME=tester

SRC= main.cpp
OBJ= ./*.o

CPPFLAGS = -I./staticprint
LDFLAGS = -L./staticprint -lprint_echo

all: deps compile link

deps:
	make -C ./staticprint

compile:
	g++ -c $(SRC) $(CPPFLAGS)

link:
	g++ -o $(APPNAME) $(CPPFLAGS) $(OBJ) $(LDFLAGS)

clean:
	make clean -C ./staticprint
	rm -rf ./$(APPNAME)
	rm -rf ./$(OBJ)

redpajama_set_name: RedPajamaGithub


text:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:fab="http://schemas.android.com/apk/res-auto"
    android:gravity="center"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="?attr/colorPrimary"
        android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
        app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
        android:elevation="4dp" />

    <!-- the layout which will contain (host) the drawerLayout -->

    <FrameLayout
        android:layout_below="@id/toolbar"
        android:id="@+id/drawer_container"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <!-- the layout which will be the content of the activity (which will be hosted inside the drawer (NOT the list of the drawer)) -->
        <FrameLayout
            android:id="@+id/frame_container"
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="vertical">

                <LinearLayout
                    android:layout_marginTop="10dp"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal"
                    android:weightSum="2">

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:orientation="vertical"
                        android:layout_weight="1.0">

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="SALDO"
                            android:textSize="23sp"
                            android:layout_gravity="center"/>

                        <TextView
                            android:id="@+id/totalCredito"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center"
                            android:text="R$ 00.00"
                            android:textSize="23sp"/>

                    </LinearLayout>

                    <View
                        android:layout_width="1dp"
                        android:layout_height="50dp"
                        android:background="#c0c0c0"
                        android:layout_marginTop="6dp"
                        android:layout_marginBottom="6dp"/>

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:orientation="vertical"
                        android:layout_weight="1.0">

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="GASTOS"
                            android:textSize="23sp"
                            android:layout_gravity="center"/>

                        <TextView
                            android:id="@+id/totalGasto"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center"
                            android:text="R$ 00.00"
                            android:textSize="23sp"/>

                    </LinearLayout>

                </LinearLayout>

                <View
                    android:layout_width="match_parent"
                    android:layout_height="2dp"
                    android:background="#c0c0c0"
                    android:layout_marginBottom="15dp"
                    android:layout_marginTop="7dp"/>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal"
                    android:weightSum="3.0" >

                    <RelativeLayout
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:layout_marginLeft="20dp"
                        android:layout_weight="1.0">

                        <TextView
                            android:text="Descrição"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:gravity="left"
                            android:textSize="21sp"
                            android:textStyle="bold"/>
                    </RelativeLayout>

                    <RelativeLayout
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:layout_weight="1.0">

                        <TextView
                            android:text="Dia"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:gravity="center"
                            android:textSize="21sp"
                            android:textStyle="bold"/>
                    </RelativeLayout>

                    <RelativeLayout
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:layout_weight="1.0">

                        <TextView
                            android:text="Valor"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:gravity="center"
                            android:textSize="21sp"
                            android:textStyle="bold"/>
                    </RelativeLayout>

                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="10dp">
                </LinearLayout>

                <ListView
                    android:id="@+id/listViewValues"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"/>

            </LinearLayout>

        </FrameLayout>

    </FrameLayout>

    <!-- Float Menu Button -->
    <com.getbase.floatingactionbutton.FloatingActionsMenu
        android:id="@+id/multiple_actions"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_alignParentRight="true"
        android:layout_alignParentEnd="true"
        fab:fab_addButtonColorNormal="@color/accentColor"
        fab:fab_addButtonColorPressed="@color/accentColor"
        fab:fab_addButtonPlusIconColor="@color/white"
        fab:fab_labelStyle="@style/menu_labels_style"
        android:layout_marginBottom="16dp"
        android:layout_marginRight="16dp"
        android:layout_marginEnd="16dp">

        <com.getbase.floatingactionbutton.FloatingActionButton
            android:id="@+id/action_a"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            fab:fab_colorNormal="@color/white"
            fab:fab_icon="@drawable/ic_currency_usd_red_18dp"
            fab:fab_title="@string/menu_float_add"
            fab:fab_colorPressed="@color/white_pressed"
            />

        <com.getbase.floatingactionbutton.FloatingActionButton
            android:id="@+id/action_b"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            fab:fab_colorNormal="@color/white"
            fab:fab_icon="@drawable/ic_currency_usd_green_18dp"
            fab:fab_title="@string/menu_float_remove"
            fab:fab_colorPressed="@color/white_pressed"/>

    </com.getbase.floatingactionbutton.FloatingActionsMenu>

</RelativeLayout>


text:
#import <CoreGraphics/CoreGraphicsExport.h>
#import <CoreGraphics/CGGeometry.h>

typedef struct {
   CGFloat a;
   CGFloat b;
   CGFloat c;
   CGFloat d;
   CGFloat tx;
   CGFloat ty;
} CGAffineTransform;

COREGRAPHICS_EXPORT const CGAffineTransform CGAffineTransformIdentity;

COREGRAPHICS_EXPORT CGAffineTransform CGAffineTransformMake(CGFloat a,CGFloat b,CGFloat c,CGFloat d,CGFloat tx,CGFloat ty);
COREGRAPHICS_EXPORT CGAffineTransform CGAffineTransformMakeRotation(CGFloat radians);
COREGRAPHICS_EXPORT CGAffineTransform CGAffineTransformMakeScale(CGFloat scalex,CGFloat scaley);
COREGRAPHICS_EXPORT CGAffineTransform CGAffineTransformMakeTranslation(CGFloat tx,CGFloat ty);

COREGRAPHICS_EXPORT CGAffineTransform CGAffineTransformConcat(CGAffineTransform xform,CGAffineTransform append);
COREGRAPHICS_EXPORT CGAffineTransform CGAffineTransformInvert(CGAffineTransform xform);

COREGRAPHICS_EXPORT CGAffineTransform CGAffineTransformRotate(CGAffineTransform xform,CGFloat radians);
COREGRAPHICS_EXPORT CGAffineTransform CGAffineTransformScale(CGAffineTransform xform,CGFloat scalex,CGFloat scaley);
COREGRAPHICS_EXPORT CGAffineTransform CGAffineTransformTranslate(CGAffineTransform xform,CGFloat tx,CGFloat ty);

COREGRAPHICS_EXPORT CGPoint CGPointApplyAffineTransform(CGPoint point, CGAffineTransform xform);
COREGRAPHICS_EXPORT CGSize CGSizeApplyAffineTransform(CGSize size, CGAffineTransform xform);


text:
#pragma once
#include <opencv2/highgui/highgui.hpp>

struct stParamResult
{
	stParamResult()
		: bVisualize(true)
	{};

	~stParamResult() {};

	//------------------------------------------------
	// VARIABLES
	//------------------------------------------------

	bool bVisualize;
};

class ResultCombine
{
	//----------------------------------------------------------------
	// METHODS
	//---------------------------------------------------------------
public:
	ResultCombine();
	~ResultCombine();

	void Initialize();
	void Finalize();

	//------------------------------------------------
	// VARIABLES
	//------------------------------------------------
public:
	bool bInit_;

	/* visualization related */
	bool             bVisualizeResult_;
	std::string      strVisWindowName_;

	/*Detection relate*/
	bool bSVMResult;
	bool bThrowResult;

};


text:
static void InitializeFlipper(UIApplication *application) {
  FlipperClient *client = [FlipperClient sharedClient];
  SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults];
  [client addPlugin:[[FlipperKitLayoutPlugin alloc] initWithRootNode:application withDescriptorMapper:layoutDescriptorMapper]];
  [client addPlugin:[[FKUserDefaultsPlugin alloc] initWithSuiteName:nil]];
  [client addPlugin:[FlipperKitReactPlugin new]];
  [client addPlugin:[[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]];
  [client start];
}
#endif

@interface AppDelegate () <RCTBridgeDelegate>

@property (nonatomic, strong) UMModuleRegistryAdapter *moduleRegistryAdapter;
@property (nonatomic, strong) NSDictionary *launchOptions;

@end

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
#if defined(FB_SONARKIT_ENABLED) && __has_include(<FlipperKit/FlipperClient.h>)
  InitializeFlipper(application);
#endif

  self.moduleRegistryAdapter = [[UMModuleRegistryAdapter alloc] initWithModuleRegistryProvider:[[UMModuleRegistryProvider alloc] init]];
  self.launchOptions = launchOptions;
  self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
  #ifdef DEBUG
    [self initializeReactNativeApp];
  #else
    EXUpdatesAppController *controller = [EXUpdatesAppController sharedInstance];
    controller.delegate = self;
    [controller startAndShowLaunchScreen:self.window];
  #endif

  [super application:application didFinishLaunchingWithOptions:launchOptions];

  return YES;
}

- (RCTBridge *)initializeReactNativeApp
{
  RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:self.launchOptions];
  RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge moduleName:@"main" initialProperties:nil];
  rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];

  UIViewController *rootViewController = [UIViewController new];
  rootViewController.view = rootView;
  self.window.rootViewController = rootViewController;
  [self.window makeKeyAndVisible];

  return bridge;
 }

- (NSArray<id<RCTBridgeModule>> *)extraModulesForBridge:(RCTBridge *)bridge
{
  NSArray<id<RCTBridgeModule>> *extraModules = [_moduleRegistryAdapter extraModulesForBridge:bridge];
  // If you'd like to export some custom RCTBridgeModules that are not Expo modules, add them here!
  return extraModules;
}

- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge {
 #ifdef DEBUG
  return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
 #else
  return [[EXUpdatesAppController sharedInstance] launchAssetUrl];
 #endif
}

- (void)appController:(EXUpdatesAppController *)appController didStartWithSuccess:(BOOL)success {
  appController.bridge = [self initializeReactNativeApp];
  EXSplashScreenService *splashScreenService = (EXSplashScreenService *)[UMModuleRegistryProvider getSingletonModuleForClass:[EXSplashScreenService class]];
  [splashScreenService showSplashScreenFor:self.window.rootViewController];
}

// Linking API
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
  return [RCTLinkingManager application:application openURL:url options:options];
}

// Universal Links
- (BOOL)application:(UIApplication *)application continueUserActivity:(nonnull NSUserActivity *)userActivity restorationHandler:(nonnull void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler {
  return [RCTLinkingManager application:application
                   continueUserActivity:userActivity
                     restorationHandler:restorationHandler];
}

@end


text:
@interface AppDelegate ()

@end

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    //线上正常版本
    [JSPatch startWithAppKey:kJSPatchKey];

    //RSA加密
    [JSPatch setupRSAPublicKey:@"-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDEfqx5IU5s0O8LemLV2kpmNtN6\nOsjGWozaFULmgPG3oW/HMykzTqgO7DwY2D9NBpSJAHkrkBlqFm2t6eIh6pYJmJSe\nr8eCVRu3njIqdDGmKc5kLxKKFeWZCrMCtaF7ll0CG73liDZ+2IrfnH7I0nos3G2R\nZrDC9i8VEqEx9Xy2uwIDAQAB\n-----END PUBLIC KEY-----"];

#ifdef DEBUG
    //发布开发版本时需要打开
//    [JSPatch setupDevelopment];
#endif

    [JSPatch sync];

    //本地版本
//    [JSPatch testScriptInBundle];

    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    self.window.backgroundColor = [UIColor whiteColor];
    [self.window makeKeyAndVisible];

    UINavigationController *navi = [[UINavigationController alloc] initWithRootViewController:[[FirstVC alloc] init]];
    self.window.rootViewController = navi;

    [self configDynamicQuickActions];

    return YES;
}

//设置动态的quick actions
- (void)configDynamicQuickActions {

    UIApplicationShortcutIcon *tempItem1Icon = [UIApplicationShortcutIcon iconWithType:UIApplicationShortcutIconTypeHome];

    UIApplicationShortcutItem *tempItem1 = [[UIApplicationShortcutItem alloc] initWithType:@"com.resume.third" localizedTitle:@"我是动态的1" localizedSubtitle:@"我是运行程序后才出现的" icon:tempItem1Icon userInfo:nil];

    UIApplicationShortcutItem *tempItem2 = [[UIApplicationShortcutItem alloc] initWithType:@"com.resume.fourth" localizedTitle:@"我是动态的2"];
    [UIApplication sharedApplication].shortcutItems = @[tempItem1,tempItem2];
}

//点击quick action到应用中响应的入口
- (void)application:(UIApplication *)application performActionForShortcutItem:(UIApplicationShortcutItem *)shortcutItem completionHandler:(void(^)(BOOL succeeded))completionHandler {

    //根据设置的type唯一标识,来做具体的事情
    if ([shortcutItem.type isEqualToString:@"com.demoCollection.first"]) {
        [self showShortcutAlertWithTitle:shortcutItem.localizedTitle message:shortcutItem.localizedSubtitle];
    }else if ([shortcutItem.type isEqualToString:@"com.demoCollection.second"]){
        [self showShortcutAlertWithTitle:shortcutItem.localizedTitle message:[NSString stringWithFormat:@"subtitle:%@\nuserinfo:%@",shortcutItem.localizedSubtitle,[shortcutItem.userInfo objectForKey:@"keyName"]]];
    }

    completionHandler(YES);
}

- (void)showShortcutAlertWithTitle:(NSString *)title message:(NSString *)message {
    UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:title message:message preferredStyle:UIAlertControllerStyleAlert];
    [alertVC addAction:[UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
        NSLog(@"%@",action);
    }]];
    [self.window.rootViewController presentViewController:alertVC animated:YES completion:nil];
}

- (void)applicationWillResignActive:(UIApplication *)application {
    // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
    // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}

- (void)applicationDidEnterBackground:(UIApplication *)application {
    // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
    // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

- (void)applicationWillEnterForeground:(UIApplication *)application {
    // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}

- (void)applicationDidBecomeActive:(UIApplication *)application {
    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

- (void)applicationWillTerminate:(UIApplication *)application {
    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

@end


text:
package co.gobd.gofetch.ui.fragment;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.google.android.gms.common.GooglePlayServicesNotAvailableException;
import com.google.android.gms.common.GooglePlayServicesRepairableException;
import com.google.android.gms.location.places.Place;
import com.google.android.gms.location.places.ui.PlacePicker;
import com.google.android.gms.maps.model.LatLng;
import com.rengwuxian.materialedittext.MaterialEditText;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;
import co.gobd.gofetch.R;
import co.gobd.gofetch.presenter.RoutePlanPresenter;
import co.gobd.gofetch.ui.view.RoutePlanView;
import co.gobd.gofetch.utility.LocationType;

import static co.gobd.gofetch.utility.Constant.REQUEST_CODE_DESTINATION_POINT;
import static co.gobd.gofetch.utility.Constant.REQUEST_CODE_STARTING_POINT;

public class RoutePlanFragment extends Fragment implements RoutePlanView {

    private static final String TAG = "RoutePlanFragment";

    /* Initialize view with ButterKnife */
    private Unbinder unbinder;

    @BindView(R.id.et_start_location)
    MaterialEditText etStartingLocation;

    @BindView(R.id.et_start_address)
    MaterialEditText etStartAddress;

    @BindView(R.id.et_start_note)
    MaterialEditText etStartNote;

    @BindView(R.id.et_destination_location)
    MaterialEditText etDestinationLocation;

    @BindView(R.id.et_destination_address)
    MaterialEditText etDestinationAddress;

    @BindView(R.id.et_destination_note)
    MaterialEditText etNoteDestination;

    /* Flag to determine whether GooglePlacePicker is already opened or not */
    boolean isGooglePlacePickerAlreadyOpen;

    /* Initialize Google Place Picker*/
    private PlacePicker.IntentBuilder builder = new PlacePicker.IntentBuilder();

    /* Presenter */
    private RoutePlanPresenter routePlanPresenter;

    /* Starting point and destination positions */
    private LatLng startingPoint;
    private LatLng destinationPoint;

    /* Callback to update activity */
    private RideFragmentCallback callback;

    public RoutePlanFragment() {
        //Empty constructor for fragment initialization
    }

    @Override
    public void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_route_plan, null);
        return view;
    }

    @Override
    public void onViewCreated(View view, Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        unbinder = ButterKnife.bind(this, view);
        routePlanPresenter = new RoutePlanPresenter(this);
    }

    @Override
    public void onAttach(Context context) {
        super.onAttach(context);

        // Casting the context into RideFragmentCallback
        // to update it's attached activity
        callback = (RideFragmentCallback) context;
    }

    @Override
    public void onPause() {
        super.onPause();
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        unbinder.unbind();

    }

    @OnClick(R.id.btn_route_next)
    void onButtonClick() {
        routePlanPresenter.onButtonClick();
    }

    // Google Place Picker returns the result here
    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        if (requestCode == REQUEST_CODE_STARTING_POINT) {
            isGooglePlacePickerAlreadyOpen = false;
            if (resultCode == Activity.RESULT_OK) {
                Place place = PlacePicker.getPlace(getContext(), data);
                routePlanPresenter.onPlaceDataReceived(place, REQUEST_CODE_STARTING_POINT);

            }

        } else if (requestCode == REQUEST_CODE_DESTINATION_POINT) {
            isGooglePlacePickerAlreadyOpen = false;
            if (resultCode == Activity.RESULT_OK) {
                Place place = PlacePicker.getPlace(getContext(), data);
                routePlanPresenter.onPlaceDataReceived(place, REQUEST_CODE_DESTINATION_POINT);

            }

        }
    }

    @OnClick(R.id.et_start_location)
    void onFromClick() {
        // Starts Google Place Picker UI control
        try {
            if (!isGooglePlacePickerAlreadyOpen) {
                isGooglePlacePickerAlreadyOpen = true;
                startActivityForResult(builder.build(getActivity()),
                        REQUEST_CODE_STARTING_POINT);
            }
        } catch (GooglePlayServicesRepairableException | GooglePlayServicesNotAvailableException e) {
            e.printStackTrace();
        }
    }

    @OnClick(R.id.et_destination_location)
    void onToClick() {
        // Starts Google Place Picker UI control
        try {
            if (!isGooglePlacePickerAlreadyOpen) {
                isGooglePlacePickerAlreadyOpen = true;
                startActivityForResult(builder.build(getActivity()),
                        REQUEST_CODE_DESTINATION_POINT);
            }
        } catch (GooglePlayServicesRepairableException | GooglePlayServicesNotAvailableException e) {
            e.printStackTrace();
        }
    }

    @Override
    public String getStartingPointAddress() {
        return etStartAddress.getText().toString();
    }

    @Override
    public String getDestinationAddress() {
        return etDestinationAddress.getText().toString();
    }

    @Override
    public LatLng getDestinationPoint() {
        return destinationPoint;
    }

    @Override
    public void setDestinationPoint(LatLng latLng) {
        destinationPoint = latLng;
    }

    @Override
    public void setDestinationLocationText(String placeName) {
        etDestinationLocation.setText(placeName);
    }

    @Override
    public String getStartingPointNote() {
        return etStartNote.getText().toString();
    }

    @Override
    public String getDestinationPointNote() {
        return etNoteDestination.getText().toString();
    }

    @Override
    public void showErrorOnEmptyAddress(LocationType locationType) {
        if (locationType == LocationType.STARTING_POINT) {

        } else if (locationType == LocationType.DESTINATION_POINT) {

        }
    }

    @Override
    public void onReceiveRouteData(Bundle bundle) {
        callback.loadConfirmationFragment(bundle);
    }

    @Override
    public LatLng getStartingPoint() {
        return startingPoint;
    }

    @Override
    public void setStartingPoint(LatLng latLng) {
        startingPoint = latLng;
    }

    @Override
    public void setStartingLocationText(String placeName) {
        etStartingLocation.setText(placeName);
    }

}


text:
<?php
$setup = function() {
  $updateScriptFilename = function() {
    putenv('SCRIPT_FILENAME=' . getenv('REAL_SCRIPT_FILENAME'));
    $_ENV['SCRIPT_FILENAME'] = getenv('REAL_SCRIPT_FILENAME');

    $relativePath = dirname(getenv('REAL_SCRIPT_FILENAME'));
    // $actualPath = full path to file, discovered using
    // stream_resolve_include_path checking include paths against
    // $relativePath to see if directory exists.
    $actualPath = stream_resolve_include_path($relativePath);
    chdir($actualPath);

    $_SERVER['SCRIPT_FILENAME'] = getenv('REAL_SCRIPT_FILENAME');
    putenv('REAL_SCRIPT_FILENAME');
    unset($_ENV['REAL_SCRIPT_FILENAME']);
    unset($_SERVER['REAL_SCRIPT_FILENAME']);
  };

  $setupApiProxy = function() {
    require_once 'google/appengine/runtime/ApiProxy.php';
    require_once 'google/appengine/runtime/RemoteApiProxy.php';
    \google\appengine\runtime\ApiProxy::setApiProxy(
      new \google\appengine\runtime\RemoteApiProxy(
        getenv('REMOTE_API_PORT'), getenv('REMOTE_REQUEST_ID')));
    putenv('REMOTE_API_PORT');
    putenv('REMOTE_REQUEST_ID');
    unset($_SERVER['REMOTE_API_PORT']);
    unset($_SERVER['REMOTE_REQUEST_ID']);
    unset($_ENV['REMOTE_API_PORT']);
    unset($_ENV['REMOTE_REQUEST_ID']);
  };

  $setupBuiltins = function() {
    require_once 'google/appengine/runtime/Setup.php';
  };
  $updateScriptFilename();
  $setupApiProxy();
  $setupBuiltins();
};
$setup();
unset($setup);
// Use require rather than include so a missing script produces a fatal error
// instead of a warning.
require($_ENV['SCRIPT_FILENAME']);