text:
.class public Lcn/com/smartdevices/bracelet/UmengAnalytics;
.super Ljava/lang/Object;

# static fields
.field public static final EVENT_ABOUT_CHECK_UPDATE:Ljava/lang/String; = "AboutCheckUpdate"

.field public static final EVENT_ABOUT_FEEDBACK:Ljava/lang/String; = "AboutFeedback"

.field public static final EVENT_ABOUT_SEND_FEEDBACK:Ljava/lang/String; = "AboutSendFeedback"

.field public static final EVENT_ABOUT_USER_AGREEMENT:Ljava/lang/String; = "AboutUserAgreement"

.field public static final EVENT_ABOUT_VIEW_OFFICIAL_SITE:Ljava/lang/String; = "AboutViewOfficialSite"

.field public static final EVENT_ALARM_SETTING:Ljava/lang/String; = "AlarmSetting"

.field public static final EVENT_BINDED_USER_START:Ljava/lang/String; = "BindedUserStart"

.field public static final EVENT_BLE_CONNECT:Ljava/lang/String; = "BleConnect"

.field public static final EVENT_BLE_DISCONNECT:Ljava/lang/String; = "BleDisconnect"

.field public static final EVENT_BLE_SYNC_DATA:Ljava/lang/String; = "BleSyncData"

.field public static final EVENT_BLE_SYNC_DATA_FIRST:Ljava/lang/String; = "BleSyncDataFirst"

.field public static final EVENT_BRACELET_BIND_WECHART:Ljava/lang/String; = "BraceletBindWeChat"

.field public static final EVENT_BRACELET_FIND:Ljava/lang/String; = "BraceletFind"

.field public static final EVENT_BRACELET_GOAL:Ljava/lang/String; = "BraceletGoal"

.field public static final EVENT_BRACELET_UNLOCK_SETTING:Ljava/lang/String; = "BraceletUnlockSetting"

.field public static final EVENT_BTACELET_CALL_NOTIFY:Ljava/lang/String; = "BraceletCallNotify"

.field public static final EVENT_BTACELET_CALL_NOTIFY_TIME:Ljava/lang/String; = "BraceletCallNotifyTime"

.field public static final EVENT_BTACELET_HAND:Ljava/lang/String; = "BraceletHand"

.field public static final EVENT_BTACELET_LIGHT:Ljava/lang/String; = "BraceletLight"

.field public static final EVENT_BTACELET_UNBIND:Ljava/lang/String; = "BraceletUnbind"

.field public static final EVENT_CLICK_MAIN_MENU:Ljava/lang/String; = "ClickMainMenu"

.field public static final EVENT_CLICK_MAIN_MENU_ITEM:Ljava/lang/String; = "ClickMainMenuItem"

.field public static final EVENT_DYNAMIC_DETAIL_MODIFY_SLEEP_TIME:Ljava/lang/String; = "DynamicDetailModifySleepTime"

.field public static final EVENT_DYNAMIC_DETAIL_VIEW_CHART_ITEM:Ljava/lang/String; = "DynamicDetailViewChartItem"

.field public static final EVENT_DYNAMIC_LIST:Ljava/lang/String; = "DynamicList"

.field public static final EVENT_DYNAMIC_REALSTEP_UPDATE:Ljava/lang/String; = "DynamicRealStepUpdate"

.field public static final EVENT_EXCEPT_REALTIME_LESS_DETAIL_STEP:Ljava/lang/String; = "ExceptRealtimeLessDetailStep"

.field public static final EVENT_EXCEPT_REALTIME_MORE_DETAIL_STEP:Ljava/lang/String; = "ExceptRealtimeMoreDetailStep"

.field public static final EVENT_FIRMWARE_UPGRADE:Ljava/lang/String; = "FirmwareUpgrade"

.field public static final EVENT_GAME_DISLIKE:Ljava/lang/String; = "Game_Dislike"

.field public static final EVENT_GAME_VIEW_SIGNUP:Ljava/lang/String; = "Game_ViewSignup"

.field public static final EVENT_INCOMING_CALL:Ljava/lang/String; = "IncomingCall"

.field public static final EVENT_LOCATION_EXCEPTION:Ljava/lang/String; = "LocationException"

.field public static final EVENT_LOCATION_START:Ljava/lang/String; = "LocationStart"

.field public static final EVENT_SHARE:Ljava/lang/String; = "Share"

.field public static final EVENT_SHARE_FROM:Ljava/lang/String; = "ShareFrom"

.field public static final EVENT_SHARE_TO:Ljava/lang/String; = "ShareTo"

.field public static final EVENT_START_UP:Ljava/lang/String; = "StartUp"

.field public static final EVENT_START_UP_CONNECT_BRACELET:Ljava/lang/String; = "StartUpConnectBracelet"

.field public static final EVENT_START_UP_FOUND_BRACELET:Ljava/lang/String; = "StartUpFoundBracelet"

.field public static final EVENT_START_UP_LOGIN:Ljava/lang/String; = "StartUpLogin"

.field public static final EVENT_START_UP_NOT_BIND_BRACELET:Ljava/lang/String; = "StartUpNotBindBracelet"

.field public static final EVENT_START_UP_PAIEING_BRACELET:Ljava/lang/String; = "StartUpPairingBracelet"

.field public static final EVENT_START_UP_REGISTER:Ljava/lang/String; = "StartUpRegister"

.field public static final EVENT_START_UP_SCAN_BRACELET:Ljava/lang/String; = "StartUpScanBracelet"

.field public static final EVENT_START_UP_VIEW_BRACELET_LIST:Ljava/lang/String; = "StartUpViewBraceletList"

.field public static final EVENT_USER_LOGOUT:Ljava/lang/String; = "UserLogout"

.field public static final EVENT_USER_SETTING_AGE:Ljava/lang/String; = "UserSettingAge"

.field public static final EVENT_USER_SETTING_GENDER:Ljava/lang/String; = "UserSettingGender"

.field public static final EVENT_USER_SETTING_HEIGHT:Ljava/lang/String; = "UserSettingHeight"

.field public static final EVENT_USER_SETTING_WEIGHT:Ljava/lang/String; = "UserSettingWeight"

.field public static final EVENT_VIEW_DYNAMIC:Ljava/lang/String; = "ViewDynamic"

.field public static final EVENT_VIEW_DYNAMIC_DETAIL:Ljava/lang/String; = "ViewDynamicDetail"

.field public static final EVENT_VIEW_STATISTIC:Ljava/lang/String; = "ViewStatistic"

.field public static final EVENT_WEATHER_EXCEPTION:Ljava/lang/String; = "WeatherException"

.field public static final EVENT_WEATHER_OK:Ljava/lang/String; = "WeatherOK"

.field public static final EVENT_WEATHER_REQUEST_CITY:Ljava/lang/String; = "WeatherRequestCity"

.field public static final EVENT_WEATHER_REQUEST_CITY_CODE:Ljava/lang/String; = "WeatherRequestCityCode"

.field public static final EVENT_WEATHER_REQUEST_WEATHER:Ljava/lang/String; = "WeatherRequestWeather"

.field public static final EVENT_WEATHER_START:Ljava/lang/String; = "WeatherStart"

.field public static final PAGE_ABOUT:Ljava/lang/String; = "PageAbout"

.field public static final PAGE_ALARM:Ljava/lang/String; = "PageAlarm"

.field public static final PAGE_ALARM_NEW:Ljava/lang/String; = "PageAlarmNew"

.field public static final PAGE_ALARM_NEW_REPEAT:Ljava/lang/String; = "PageAlarmNewRepeat"

.field public static final PAGE_ALARM_NEW_REPEAT_CUSTOM:Ljava/lang/String; = "PageAlarmNewRepeatCustom"

.field public static final PAGE_BIND_WECHAT:Ljava/lang/String; = "PageBindWeChat"

.field public static final PAGE_BRACELET:Ljava/lang/String; = "PageBracelet"

.field public static final PAGE_BRACELET_CONNECT_FAILED:Ljava/lang/String; = "PageBraceletConnectFailed"

.field public static final PAGE_BRACELET_GOAL:Ljava/lang/String; = "PageBraceletGoal"

.field public static final PAGE_BRACELET_HAND:Ljava/lang/String; = "PageBraceletHand"

.field public static final PAGE_BRACELET_LIGHT:Ljava/lang/String; = "PageBraceletLight"

.field public static final PAGE_BRACELET_NOT_FOUND:Ljava/lang/String; = "PageBraceletNotFound"

.field public static final PAGE_BRACELET_NOT_FOUND_HELP:Ljava/lang/String; = "PageBraceletNotFoundHelp"

.field public static final PAGE_BRACELET_UNBIND:Ljava/lang/String; = "PageBraceletUnbind"

.field public static final PAGE_DYNAMIC:Ljava/lang/String; = "PageDynamic"

.field public static final PAGE_DYNAMIC_DETAIL:Ljava/lang/String; = "PageDynamicDetail"

.field public static final PAGE_DYNAMIC_DETAIL_MODIFY_SLEEP_END:Ljava/lang/String; = "PageDynamicDetailModifySleepEnd"

.field public static final PAGE_DYNAMIC_DETAIL_MODIFY_SLEEP_START:Ljava/lang/String; = "PageDynamicDetailModifySleepStart"

.field public static final PAGE_FEEDBACK:Ljava/lang/String; = "PageFeedback"

.field public static final PAGE_FIRMWARE_UPGRADE:Ljava/lang/String; = "PageFirmwareUpgrade"

.field public static final PAGE_INSTRUCTION:Ljava/lang/String; = "PageInstruction"

.field public static final PAGE_PERSON_GUIDE_AGE:Ljava/lang/String; = "PagePersonGuideAge"

.field public static final PAGE_PERSON_GUIDE_FINISH:Ljava/lang/String; = "PagePersonGuideFinish"

.field public static final PAGE_PERSON_GUIDE_GENDER:Ljava/lang/String; = "PagePersonGuideGender"

.field public static final PAGE_PERSON_GUIDE_GOAL:Ljava/lang/String; = "PagePersonGuideGoal"

.field public static final PAGE_PERSON_GUIDE_HEIGHT:Ljava/lang/String; = "PagePersonGuideHeight"

.field public static final PAGE_PERSON_GUIDE_WEIGHT:Ljava/lang/String; = "PagePersonGuideWeight"

.field public static final PAGE_PERSON_INFO:Ljava/lang/String; = "PagePersonInfo"

.field public static final PAGE_PERSON_INFO_AGE:Ljava/lang/String; = "PagePersonInfoAge"

.field public static final PAGE_PERSON_INFO_AVATAR_CROP:Ljava/lang/String; = "PagePersonInfoAvatarCrop"

.field public static final PAGE_PERSON_INFO_AVATAR_SELECTION:Ljava/lang/String; = "PagePersonInfoAvatarSelection"

.field public static final PAGE_PERSON_INFO_GENDER:Ljava/lang/String; = "PagePersonInfoGender"

.field public static final PAGE_PERSON_INFO_HEIGHT:Ljava/lang/String; = "PagePersonInfoHeight"

.field public static final PAGE_PERSON_INFO_WEIGHT:Ljava/lang/String; = "PagePersonInfoWeight"

.field public static final PAGE_SEARCH_MULTI_BRACELET:Ljava/lang/String; = "PageSearchMultiBracelet"

.field public static final PAGE_SEARCH_SINGLE_BRACELET:Ljava/lang/String; = "PageSearchSingleBracelet"

.field public static final PAGE_SHARE:Ljava/lang/String; = "PageShare"

.field public static final PAGE_START_UP:Ljava/lang/String; = "PageStartUp"

.field public static final PAGE_STATISTIC:Ljava/lang/String; = "PageStatistic"

.field public static final PAGE_SYSTEM_LOW:Ljava/lang/String; = "PageSystemLow"

.field public static final PAGE_SYSTEM_NOT_SUPPORT:Ljava/lang/String; = "PageSystemNotSupport"

.field public static final PAGE_UNLOCK_HELP:Ljava/lang/String; = "PageUnlockHelp"

.field public static final PAGE_UNLOCK_INVAILD_HELP:Ljava/lang/String; = "PageUnlockInvaildHelp"

.field public static final PAGE_WEB_REGISTER:Ljava/lang/String; = "PageWebRegister"

.field public static final PAGE_WEB_USER_AGREEMENT:Ljava/lang/String; = "PageWebUserAgreement"

.field public static final VALUE_BIND_WECHART_LAUNCH:Ljava/lang/String; = "BindWeChatLaunch"

.field public static final VALUE_BIND_WECHART_QRCODE:Ljava/lang/String; = "BindWeChatQrcode"

.field public static final VALUE_CALL_IDLE:Ljava/lang/String; = "CallIdle"

.field public static final VALUE_CALL_NOTIFY:Ljava/lang/String; = "CallNotify"

.field public static final VALUE_CALL_OFFHOOK:Ljava/lang/String; = "CallOffhook"

.field public static final VALUE_CALL_RING:Ljava/lang/String; = "CallRing"

.field public static final VALUE_CANCELED:Ljava/lang/String; = "Canceled"

.field public static final VALUE_CONFIRMED:Ljava/lang/String; = "Confirmed"

.field public static final VALUE_DYNAMIC_LIST_ITEM_CLICK:Ljava/lang/String; = "DynamicListItemClick"

.field public static final VALUE_FAILED:Ljava/lang/String; = "Failed"

.field public static final VALUE_FROM_DYNAMIC_LIST:Ljava/lang/String; = "FromDynamicList"

.field public static final VALUE_MAIN_MENU_ITEM_ABOUT:Ljava/lang/String; = "MenuAbout"

.field public static final VALUE_MAIN_MENU_ITEM_ALARM:Ljava/lang/String; = "MenuAlarm"

.field public static final VALUE_MAIN_MENU_ITEM_BRACELET:Ljava/lang/String; = "MenuBracelet"

.field public static final VALUE_MAIN_MENU_ITEM_PERSON:Ljava/lang/String; = "MenuPerson"

.field public static final VALUE_MAIN_MENU_ITEM_SHARE:Ljava/lang/String; = "MenuShare"

.field public static final VALUE_MODE_SLEEP:Ljava/lang/String; = "ModeSleep"

.field public static final VALUE_MODE_STEP:Ljava/lang/String; = "ModeStep"

.field public static final VALUE_MODIFY_SLEEP_TIME_END:Ljava/lang/String; = "SleepTimeEnd"

.field public static final VALUE_MODIFY_SLEEP_TIME_START:Ljava/lang/String; = "SleepTimeStart"

.field public static final VALUE_SHARE_FROM_DYNAMIC:Ljava/lang/String; = "ShareFromDynamic"

.field public static final VALUE_SHARE_FROM_DYNAMIC_DETAIL:Ljava/lang/String; = "ShareFromDynamicDetail"

.field public static final VALUE_SHARE_FROM_DYNAMIC_LIST:Ljava/lang/String; = "ShareFromDynamicList"

.field public static final VALUE_SHARE_FROM_STATISTIC:Ljava/lang/String; = "ShareFromStatistic"

.field public static final VALUE_SHARE_TO_MICHAT:Ljava/lang/String; = "ShareToMiChat"

.field public static final VALUE_SHARE_TO_QQ:Ljava/lang/String; = "ShareToQQ"

.field public static final VALUE_SHARE_TO_QQ_ZONE:Ljava/lang/String; = "ShareToQQZone"

.field public static final VALUE_SHARE_TO_WECHAT:Ljava/lang/String; = "ShareToWeChat"

.field public static final VALUE_SHARE_TO_WECHAT_FRIENDS:Ljava/lang/String; = "ShareToWeChatFriends"

.field public static final VALUE_SHARE_TO_WEIBO:Ljava/lang/String; = "ShareToWeibo"

.field public static final VALUE_SHARE_TYPE_CONTINUE_DAYS:Ljava/lang/String; = "ShareContinueDays"

.field public static final VALUE_SHARE_TYPE_EVENT:Ljava/lang/String; = "ShareEvent"

.field public static final VALUE_SHARE_TYPE_MONTHLY_SLEEP:Ljava/lang/String; = "ShareMonthlySleep"

.field public static final VALUE_SHARE_TYPE_MONTHLY_STEP:Ljava/lang/String; = "ShareMonthlySteps"

.field public static final VALUE_SHARE_TYPE_NEW_RECORD:Ljava/lang/String; = "ShareNewRecord"

.field public static final VALUE_SHARE_TYPE_SLEEP:Ljava/lang/String; = "ShareSleep"

.field public static final VALUE_SHARE_TYPE_STEP_DYNAMIC_LIST:Ljava/lang/String; = "ShareStepDynamicList"

.field public static final VALUE_SHARE_TYPE_STEP_GOAL_FAILED:Ljava/lang/String; = "ShareStepGoalFailed"

.field public static final VALUE_SHARE_TYPE_STEP_GOAL_SUCCESS:Ljava/lang/String; = "ShareStepGoalSuccess"

.field public static final VALUE_SHARE_TYPE_WEEKLY_SLEEP:Ljava/lang/String; = "ShareWeeklySleep"

.field public static final VALUE_SHARE_TYPE_WEEKLY_STEP:Ljava/lang/String; = "ShareWeeklySteps"

.field public static final VALUE_SLIDE_DOWN_CONNECT:Ljava/lang/String; = "SlideDownConnect"

.field public static final VALUE_SLIDE_DOWN_SYNC:Ljava/lang/String; = "SlideDownSync"

.field public static final VALUE_SLIDE_UP:Ljava/lang/String; = "SlideUp"

.field public static final VALUE_START_LOGIN:Ljava/lang/String; = "StartLogin"

.field public static final VALUE_START_REGISTER:Ljava/lang/String; = "StartRegister"

.field public static final VALUE_STATISTIC_LEVEL_DAILY:Ljava/lang/String; = "StatisticLevelDaily"

.field public static final VALUE_STATISTIC_LEVEL_MONTHLY:Ljava/lang/String; = "StatisticLevelMonthly"

.field public static final VALUE_STATISTIC_LEVEL_WEEKLY:Ljava/lang/String; = "StatisticLevelWeekly"

.field public static final VALUE_SUCCESSED:Ljava/lang/String; = "Successed"

.field public static final VAULE_FROM_DYNAMIC:Ljava/lang/String; = "FromDynamic"

.field private static final a:Ljava/lang/String; = "UmengAnalyticsTracker"

.field private static b:Z

# direct methods
.method static constructor <clinit>()V
    .locals 1

    const/4 v0, 0x1

    sput-boolean v0, Lcn/com/smartdevices/bracelet/UmengAnalytics;->b:Z

    return-void
.end method

.method public constructor <init>()V
    .locals 0

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method public static config(ZZZ)V
    .locals 0

    sput-boolean p0, Lcn/com/smartdevices/bracelet/UmengAnalytics;->b:Z

    invoke-static {p1}, Lcom/umeng/analytics/MobclickAgent;->setDebugMode(Z)V

    invoke-static {p2}, Lcom/umeng/analytics/MobclickAgent;->openActivityDurationTrack(Z)V

    return-void
.end method

.method public static endEvent(Landroid/content/Context;Ljava/lang/String;)V
    .locals 1

    const/4 v0, 0x0

    invoke-static {p0, p1, v0}, Lcn/com/smartdevices/bracelet/UmengAnalytics;->endEvent(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)V

    return-void
.end method

.method public static endEvent(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)V
    .locals 3

    sget-boolean v0, Lcn/com/smartdevices/bracelet/UmengAnalytics;->b:Z

    if-nez v0, :cond_0

    :goto_0
    return-void

    :cond_0
    const-string v0, "UmengAnalyticsTracker"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "End Event : "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, ", Value : "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I

    if-nez p2, :cond_1

    invoke-static {p0, p1}, Lcom/umeng/analytics/MobclickAgent;->onEventEnd(Landroid/content/Context;Ljava/lang/String;)V

    goto :goto_0

    :cond_1
    invoke-static {p0, p1, p2}, Lcom/umeng/analytics/MobclickAgent;->onEventEnd(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_0
.end method

.method public static endPage(Ljava/lang/String;)V
    .locals 3

    sget-boolean v0, Lcn/com/smartdevices/bracelet/UmengAnalytics;->b:Z

    if-nez v0, :cond_0

    :goto_0
    return-void

    :cond_0
    const-string v0, "UmengAnalyticsTracker"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "End Page : "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I

    invoke-static {p0}, Lcom/umeng/analytics/MobclickAgent;->onPageEnd(Ljava/lang/String;)V

    goto :goto_0
.end method

.method public static endSession(Landroid/content/Context;)V
    .locals 3

    sget-boolean v0, Lcn/com/smartdevices/bracelet/UmengAnalytics;->b:Z

    if-nez v0, :cond_0

    :goto_0
    return-void

    :cond_0
    const-string v0, "UmengAnalyticsTracker"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "End Session : "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I

    invoke-static {p0}, Lcom/umeng/analytics/MobclickAgent;->onPause(Landroid/content/Context;)V

    goto :goto_0
.end method

.method public static event(Landroid/content/Context;Ljava/lang/String;)V
    .locals 3

    sget-boolean v0, Lcn/com/smartdevices/bracelet/UmengAnalytics;->b:Z

    if-nez v0, :cond_0

    :goto_0
    return-void

    :cond_0
    const-string v0, "UmengAnalyticsTracker"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "Event : "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I

    invoke-static {p0, p1}, Lcom/umeng/analytics/MobclickAgent;->onEvent(Landroid/content/Context;Ljava/lang/String;)V

    goto :goto_0
.end method

.method public static event(Landroid/content/Context;Ljava/lang/String;I)V
    .locals 1

    const/4 v0, 0x0

    invoke-static {p0, p1, v0, p2}, Lcn/com/smartdevices/bracelet/UmengAnalytics;->event(Landroid/content/Context;Ljava/lang/String;Ljava/util/HashMap;I)V

    return-void
.end method

.method public static event(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)V
    .locals 3

    sget-boolean v0, Lcn/com/smartdevices/bracelet/UmengAnalytics;->b:Z

    if-nez v0, :cond_0

    :goto_0
    return-void

    :cond_0
    const-string v0, "UmengAnalyticsTracker"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "Event : "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, ", Value : "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I

    invoke-static {p0, p1, p2}, Lcom/umeng/analytics/MobclickAgent;->onEvent(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_0
.end method

.method public static event(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
    .locals 3

    sget-boolean v0, Lcn/com/smartdevices/bracelet/UmengAnalytics;->b:Z

    if-nez v0, :cond_0

    :goto_0
    return-void

    :cond_0
    const-string v0, "UmengAnalyticsTracker"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "Event : "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, ", Key : "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, ", Value : "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I

    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0}, Ljava/util/HashMap;-><init>()V

    invoke-virtual {v0, p2, p3}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    invoke-static {p0, p1, v0}, Lcom/umeng/analytics/MobclickAgent;->onEvent(Landroid/content/Context;Ljava/lang/String;Ljava/util/Map;)V

    goto :goto_0
.end method

.method public static event(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;I)V
    .locals 1

    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0}, Ljava/util/HashMap;-><init>()V

    invoke-virtual {v0, p2, p3}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    invoke-static {p0, p1, v0, p4}, Lcn/com/smartdevices/bracelet/UmengAnalytics;->event(Landroid/content/Context;Ljava/lang/String;Ljava/util/HashMap;I)V

    return-void
.end method

.method public static event(Landroid/content/Context;Ljava/lang/String;Ljava/util/HashMap;)V
    .locals 3
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/content/Context;",
            "Ljava/lang/String;",
            "Ljava/util/HashMap",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            ">;)V"
        }
    .end annotation

    sget-boolean v0, Lcn/com/smartdevices/bracelet/UmengAnalytics;->b:Z

    if-nez v0, :cond_0

    :goto_0
    return-void

    :cond_0
    const-string v0, "UmengAnalyticsTracker"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "Event : "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, ", Properties : "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I

    invoke-static {p0, p1, p2}, Lcom/umeng/analytics/MobclickAgent;->onEvent(Landroid/content/Context;Ljava/lang/String;Ljava/util/Map;)V

    goto :goto_0
.end method

.method public static event(Landroid/content/Context;Ljava/lang/String;Ljava/util/HashMap;I)V
    .locals 3
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/content/Context;",
            "Ljava/lang/String;",
            "Ljava/util/HashMap",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            ">;I)V"
        }
    .end annotation

    sget-boolean v0, Lcn/com/smartdevices/bracelet/UmengAnalytics;->b:Z

    if-nez v0, :cond_0

    :goto_0
    return-void

    :cond_0
    const-string v0, "UmengAnalyticsTracker"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "Event : "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, ", Properties : "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, ", Value : "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I

    invoke-static {p0, p1, p2, p3}, Lcom/umeng/analytics/MobclickAgent;->onEventValue(Landroid/content/Context;Ljava/lang/String;Ljava/util/Map;I)V

    goto :goto_0
.end method

.method public static exception(Landroid/content/Context;Ljava/lang/Exception;)V
    .locals 0

    invoke-static {p0, p1}, Lcom/umeng/analytics/MobclickAgent;->reportError(Landroid/content/Context;Ljava/lang/Throwable;)V

    return-void
.end method

.method public static exception(Landroid/content/Context;Ljava/lang/String;)V
    .locals 0

    invoke-static {p0, p1}, Lcom/umeng/analytics/MobclickAgent;->reportError(Landroid/content/Context;Ljava/lang/String;)V

    return-void
.end method

.method public static startEvent(Landroid/content/Context;Ljava/lang/String;)V
    .locals 1

    const/4 v0, 0x0

    invoke-static {p0, p1, v0}, Lcn/com/smartdevices/bracelet/UmengAnalytics;->startEvent(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)V

    return-void
.end method

.method public static startEvent(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)V
    .locals 3

    sget-boolean v0, Lcn/com/smartdevices/bracelet/UmengAnalytics;->b:Z

    if-nez v0, :cond_0

    :goto_0
    return-void

    :cond_0
    const-string v0, "UmengAnalyticsTracker"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "Start Event : "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, ", Value : "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I

    if-nez p2, :cond_1

    invoke-static {p0, p1}, Lcom/umeng/analytics/MobclickAgent;->onEventBegin(Landroid/content/Context;Ljava/lang/String;)V

    goto :goto_0

    :cond_1
    invoke-static {p0, p1, p2}, Lcom/umeng/analytics/MobclickAgent;->onEventBegin(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_0
.end method

.method public static startPage(Ljava/lang/String;)V
    .locals 3

    sget-boolean v0, Lcn/com/smartdevices/bracelet/UmengAnalytics;->b:Z

    if-nez v0, :cond_0

    :goto_0
    return-void

    :cond_0
    const-string v0, "UmengAnalyticsTracker"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "Start Page : "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I

    invoke-static {p0}, Lcom/umeng/analytics/MobclickAgent;->onPageStart(Ljava/lang/String;)V

    goto :goto_0
.end method

.method public static startSession(Landroid/content/Context;)V
    .locals 3

    sget-boolean v0, Lcn/com/smartdevices/bracelet/UmengAnalytics;->b:Z

    if-nez v0, :cond_0

    :goto_0
    return-void

    :cond_0
    const-string v0, "UmengAnalyticsTracker"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "Start Session : "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I

    invoke-static {p0}, Lcom/umeng/analytics/MobclickAgent;->onResume(Landroid/content/Context;)V

    goto :goto_0
.end method


text:
using System;
using System.Web;
using Akka.Actor;
using Reactive.ActorModel;
using Reactive.ActorModel.Messages;

namespace Reactive.Web
{
    public class ActorMessenger : IActorMessenger
    {
        private const string SchedulerActorPath = "akka.tcp://reactive@localhost:33999/user/scheduler";

        public void RequestStatusUpdate()
        {
            var actorSystem = GetActorSystem();
            var scheduler = actorSystem.ActorSelection(SchedulerActorPath);
            scheduler.Tell(new RequestStatusUpdate());
        }

        private static ActorSystem GetActorSystem()
        {
            var actorSystemServiceObject = HttpContext.Current.Application["ActorSystemService"];
            if (actorSystemServiceObject is IActorSystemService)
            {
                var actorSystemService = actorSystemServiceObject as IActorSystemService;
                return actorSystemService.GetActorSystem();
            }
            else
            {
                throw new InvalidOperationException("ActorSystemService not found.");
            }
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
package net.morimekta.providence;

import net.morimekta.providence.descriptor.PField;
import net.morimekta.providence.descriptor.PMessageDescriptor;

import javax.annotation.Nonnull;
import java.util.Arrays;
import java.util.Collection;
import java.util.stream.Collectors;

/**
 * Base class for message builders.
 */
public abstract class PMessageBuilder<T extends PMessage<T, F>, F extends PField>
        implements PBuilder<T> {
    /**
     * Checks if the current set data is enough to make a valid struct. It
     * will check for all required fields, and if any are missing it will
     * return false.
     *
     * @return True for a valid message.
     */
    public abstract boolean valid();

    /**
     * Checks if the current set data is enough to make a valid struct. It
     * will check for all required fields, and if any are missing it will
     * throw an {@link IllegalStateException} with an appropriate error
     * message.
     *
     * @throws IllegalStateException When the builder will not generate a
     *         valid message model object.
     */
    public abstract void validate() throws IllegalStateException;

    /**
     * Set the provided field value.
     *
     * @param key The key of the field to set.
     * @param value The value to be set.
     * @return The message builder.
     */
    @Nonnull
    public abstract PMessageBuilder<T, F> set(int key, Object value);

    /**
     * Set the provided field value.
     *
     * @param field The field to set.
     * @param value The value to be set.
     * @return True if the field is set.
     */
    @Nonnull
    public PMessageBuilder<T, F> set(@Nonnull F field, Object value) {
        return set(field.getId(), value);
    }

    /**
     * Checks if a specific field is set on the builder.
     *
     * @param key The key of the field to check.
     * @return True if the field is set.
     */
    public abstract boolean isSet(int key);

    /**
     * Checks if a specific field is set on the builder.
     *
     * @param field The field to check.
     * @return True if the field is set.
     */
    public boolean isSet(@Nonnull F field) {
        return isSet(field.getId());
    }

    /**
     * Get a Collection of F with fields set on the builder. A.k.a is
     * present.
     *
     * Unusual naming because it avoids conflict with generated methods.
     *
     * @return Collection of F
     */
    @Nonnull
    public Collection<F> presentFields() {
           return Arrays.stream(descriptor().getFields())
                        .filter(this::isSet)
                        .collect(Collectors.toList());
    }

    /**
     * Checks if a specific field is modified on the builder.
     *
     * @param key The key of the field to check.
     * @return True if the field is modified.
     */
    public abstract boolean isModified(int key);

    /**
     * Checks if a specific field is modified on the builder.
     *
     * @param field The field to check.
     * @return True if the field is modified.
     */
    public boolean isModified(@Nonnull F field) {
        return isModified(field.getId());
    }

    /**
     * Get a Collection of F with fields Modified since creation of the builder.
     *
     * @return Collection of F
     */
    @Nonnull
    public Collection<F> modifiedFields() {
           return Arrays.stream(descriptor().getFields())
                        .filter(this::isModified)
                        .collect(Collectors.toList());
     }

    /**
     * Adds a value to a set or list container.
     *
     * @param key The key of the container field to add too.
     * @param value The value to add.
     * @return The message builder.
     * @throws IllegalArgumentException if the field is not a list or set.
     */
    @Nonnull
    public abstract PMessageBuilder<T, F> addTo(int key, Object value);

    /**
     * Checks if a specific field is set on the builder.
     *
     * @param field The container field to add too.
     * @param value The value to add.
     * @return True if the field is set.
     */
    @Nonnull
    public PMessageBuilder<T, F> addTo(@Nonnull F field, Object value) {
        return addTo(field.getId(), value);
    }

    /**
     * Clear the provided field value.
     *
     * @param key The key of the field to clear.
     * @return The message builder.
     */
    @Nonnull
    public abstract PMessageBuilder<T, F> clear(int key);

    /**
     * Clear the provided field value.
     *
     * @param field The field to clear.
     * @return The message builder.
     */
    @Nonnull
    public PMessageBuilder<T, F> clear(@Nonnull F field) {
        return clear(field.getId());
    }

    /**
     * Merges the provided message into the builder. Contained messages should
     * in turn be merged and not replaced wholesale. Sets are unioned (addAll)
     * and maps will overwrite / replace on a per-key basis (putAll).
     *
     * @param from The message to merge values from.
     * @return The message builder.
     */
    @Nonnull
    public abstract PMessageBuilder<T, F> merge(@Nonnull T from);

    /**
     * Get the builder for the given message contained in this builder. If
     * the sub-builder does not exist, create, either from existing instance
     * or from scratch.
     *
     * @param key The field key.
     * @return The field builder.
     * @throws IllegalArgumentException if field is not a message field.
     */
    @Nonnull
    public abstract PMessageBuilder mutator(int key);

    /**
     * Get the builder for the given message contained in this builder. If
     * the sub-builder does not exist, create, either from existing instance
     * or from scratch.
     *
     * @param field The field to mutate.
     * @return The field builder.
     * @throws IllegalArgumentException if field is not a message field.
     */
    @Nonnull
    public PMessageBuilder mutator(@Nonnull F field) {
        return mutator(field.getId());
    }

    /**
     * Get the descriptor for the message being built.
     *
     * @return The struct descriptor.
     */
    @Nonnull
    public abstract PMessageDescriptor<T, F> descriptor();
}


text:
<?php

namespace li3_quality\qa\rules\syntax;

use lithium\util\Inflector;
use li3_quality\analysis\Parser;

class HasCorrectFunctionNames extends \li3_quality\qa\Rule {

	/**
	 * The rule can ignore these methods.
	 *
	 * @link http://php.net/manual/en/language.oop5.magic.php
	 * @var array
	 */
	protected $_magicMethods = array(
		'__construct', '__destruct', '__call',
		'__callStatic', '__get', '__set',
		'__isset', '__unset', '__sleep',
		'__wakeup', '__toString', '__invoke',
		'__set_state', '__clone', '__init',
	);

	/**
	 * Will iterate the tokens looking for functions validating they have the
	 * correct camelBack naming style.
	 *
	 * @param  Testable $testable The testable object
	 * @return void
	 */
	public function apply($testable, array $config = array()) {
		$tokens = $testable->tokens();
		$filtered = $testable->findAll(array(T_FUNCTION));

		foreach ($filtered as $key) {
			$token = $tokens[$key];
			$label = Parser::label($key, $tokens);
			$modifiers = Parser::modifiers($key, $tokens);
			$isClosure = Parser::closure($key, $tokens);
			if (in_array($label, $this->_magicMethods)) {
				continue;
			}
			if ($testable->findNext(array(T_PROTECTED), $modifiers) !== false) {
				$label = preg_replace('/^_/', '', $label);
			}
			if (!$isClosure && $label !== Inflector::camelize($label, false)) {
				$this->addViolation(array(
					'message' => 'Function "' . $label . '" is not in camelBack style',
					'line' => $tokens[$tokens[$key]['parent']]['line'],
				));
			}
		}
	}

}

?>


text:
namespace extensions {

ChromeGuestViewManagerDelegate::ChromeGuestViewManagerDelegate(
    content::BrowserContext* context)
    : ExtensionsGuestViewManagerDelegate(context) {
}

ChromeGuestViewManagerDelegate::~ChromeGuestViewManagerDelegate() {
}

void ChromeGuestViewManagerDelegate::OnGuestAdded(
    content::WebContents* guest_web_contents) const {
  // Attaches the task-manager-specific tag for the GuestViews to its
  // |guest_web_contents| so that their corresponding tasks show up in the task
  // manager.
  task_manager::WebContentsTags::CreateForGuestContents(guest_web_contents);

#if defined(OS_CHROMEOS)
  // Notifies kiosk session about the added guest.
  chromeos::AppSession* app_session =
      chromeos::KioskAppManager::Get()->app_session();
  if (app_session)
    app_session->OnGuestAdded(guest_web_contents);
#endif
}

}  // namespace extensions


text:
using System;

namespace Lidgren.Network
{
	internal sealed class NetUnreliableUnorderedReceiver : NetReceiverChannelBase
	{
		public NetUnreliableUnorderedReceiver(NetConnection connection)
			: base(connection)
		{
		}

		internal override void ReceiveMessage(NetIncomingMessage msg)
		{
			// ack no matter what
			m_connection.QueueAck(msg.m_receivedMessageType, msg.m_sequenceNumber);

			m_peer.ReleaseMessage(msg);
		}
	}
}


text:
<?php

namespace Snap\Lib\Template\Token;

class Value extends \Snap\Lib\Template\Token {
	public function __construct( $content ){
		$this->content = $content = trim($content);
		$this->vars = array();

		$this->requiredVars[$content] = 1;
	}

	public function evaluate(){
		$var = '__'.$this->content;

		return $this->{'__'.$this->content};
	}
}


text:
var Scribe = require('../lib/scribe').Scribe;

var scribe = new Scribe("localhost", 3000, { autoReconnect : true });

scribe.open(function(err) {
  if (err) {
    console.log(err);
    return;
  }

  setInterval(function() {
    scribe.send("foo", "bar");
  }, 150);
});

scribe.on('connect', function(){
  console.log("Client connected");
});

scribe.on('reconnecting', function(){
  console.log("Client reconnecting");
});

scribe.on('error', function(err){
  console.log("Error", err);
});


text:
#include <asm/page.h>

struct mm_struct;

/*
 * Don't change this structure - ASM code
 * relies on it.
 */
extern struct processor {
	/* MISC
	 * get data abort address/flags
	 */
	void (*_data_abort)(unsigned long pc);
	/*
	 * Set up any processor specifics
	 */
	void (*_proc_init)(void);
	/*
	 * Disable any processor specifics
	 */
	void (*_proc_fin)(void);
	/*
	 * Special stuff for a reset
	 */
	void (*reset)(unsigned long addr) __attribute__((noreturn));
	/*
	 * Idle the processor
	 */
	int (*_do_idle)(void);
	/*
	 * Processor architecture specific
	 */
	/*
	 * clean a virtual address range from the
	 * D-cache without flushing the cache.
	 */
	void (*dcache_clean_area)(void *addr, int size);

	/*
	 * Set the page table
	 */
	void (*switch_mm)(unsigned long pgd_phys, struct mm_struct *mm);
	/*
	 * Set a possibly extended PTE.  Non-extended PTEs should
	 * ignore 'ext'.
	 */
	void (*set_pte_ext)(pte_t *ptep, pte_t pte, unsigned int ext);
} processor;

#define cpu_proc_init()			processor._proc_init()
#define cpu_proc_fin()			processor._proc_fin()
#define cpu_reset(addr)			processor.reset(addr)
#define cpu_do_idle()			processor._do_idle()
#define cpu_dcache_clean_area(addr,sz)	processor.dcache_clean_area(addr,sz)
#define cpu_set_pte_ext(ptep,pte,ext)	processor.set_pte_ext(ptep,pte,ext)
#define cpu_do_switch_mm(pgd,mm)	processor.switch_mm(pgd,mm)


text:
/* contrib/seg/seg--1.1.sql */

-- complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "CREATE EXTENSION seg" to load this file. \quit

-- Create the user-defined type for 1-D floating point intervals (seg)

CREATE FUNCTION seg_in(cstring)
RETURNS seg
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE PARALLEL SAFE;

CREATE FUNCTION seg_out(seg)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE PARALLEL SAFE;

CREATE TYPE seg (
	INTERNALLENGTH = 12,
	INPUT = seg_in,
	OUTPUT = seg_out
);

COMMENT ON TYPE seg IS
'floating point interval ''FLOAT .. FLOAT'', ''.. FLOAT'', ''FLOAT ..'' or ''FLOAT''';

--
-- External C-functions for R-tree methods
--

-- Left/Right methods

CREATE FUNCTION seg_over_left(seg, seg)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE PARALLEL SAFE;

COMMENT ON FUNCTION seg_over_left(seg, seg) IS
'overlaps or is left of';

CREATE FUNCTION seg_over_right(seg, seg)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE PARALLEL SAFE;

COMMENT ON FUNCTION seg_over_right(seg, seg) IS
'overlaps or is right of';

CREATE FUNCTION seg_left(seg, seg)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE PARALLEL SAFE;

COMMENT ON FUNCTION seg_left(seg, seg) IS
'is left of';

CREATE FUNCTION seg_right(seg, seg)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE PARALLEL SAFE;

COMMENT ON FUNCTION seg_right(seg, seg) IS
'is right of';

-- Scalar comparison methods

CREATE FUNCTION seg_lt(seg, seg)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE PARALLEL SAFE;

COMMENT ON FUNCTION seg_lt(seg, seg) IS
'less than';

CREATE FUNCTION seg_le(seg, seg)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE PARALLEL SAFE;

COMMENT ON FUNCTION seg_le(seg, seg) IS
'less than or equal';

CREATE FUNCTION seg_gt(seg, seg)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE PARALLEL SAFE;

COMMENT ON FUNCTION seg_gt(seg, seg) IS
'greater than';

CREATE FUNCTION seg_ge(seg, seg)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE PARALLEL SAFE;

COMMENT ON FUNCTION seg_ge(seg, seg) IS
'greater than or equal';

CREATE FUNCTION seg_contains(seg, seg)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE PARALLEL SAFE;

COMMENT ON FUNCTION seg_contains(seg, seg) IS
'contains';

CREATE FUNCTION seg_contained(seg, seg)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE PARALLEL SAFE;

COMMENT ON FUNCTION seg_contained(seg, seg) IS
'contained in';

CREATE FUNCTION seg_overlap(seg, seg)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE PARALLEL SAFE;

COMMENT ON FUNCTION seg_overlap(seg, seg) IS
'overlaps';

CREATE FUNCTION seg_same(seg, seg)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE PARALLEL SAFE;

COMMENT ON FUNCTION seg_same(seg, seg) IS
'same as';

CREATE FUNCTION seg_different(seg, seg)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE PARALLEL SAFE;

COMMENT ON FUNCTION seg_different(seg, seg) IS
'different';

-- support routines for indexing

CREATE FUNCTION seg_cmp(seg, seg)
RETURNS int4
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE PARALLEL SAFE;

COMMENT ON FUNCTION seg_cmp(seg, seg) IS 'btree comparison function';

CREATE FUNCTION seg_union(seg, seg)
RETURNS seg
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE PARALLEL SAFE;

CREATE FUNCTION seg_inter(seg, seg)
RETURNS seg
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE PARALLEL SAFE;

CREATE FUNCTION seg_size(seg)
RETURNS float4
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE PARALLEL SAFE;

-- miscellaneous

CREATE FUNCTION seg_center(seg)
RETURNS float4
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE PARALLEL SAFE;

CREATE FUNCTION seg_upper(seg)
RETURNS float4
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE PARALLEL SAFE;

CREATE FUNCTION seg_lower(seg)
RETURNS float4
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE PARALLEL SAFE;

--
-- OPERATORS
--

CREATE OPERATOR < (
	LEFTARG = seg,
	RIGHTARG = seg,
	PROCEDURE = seg_lt,
	COMMUTATOR = '>',
	NEGATOR = '>=',
	RESTRICT = scalarltsel,
	JOIN = scalarltjoinsel
);

CREATE OPERATOR <= (
	LEFTARG = seg,
	RIGHTARG = seg,
	PROCEDURE = seg_le,
	COMMUTATOR = '>=',
	NEGATOR = '>',
	RESTRICT = scalarltsel,
	JOIN = scalarltjoinsel
);

CREATE OPERATOR > (
	LEFTARG = seg,
	RIGHTARG = seg,
	PROCEDURE = seg_gt,
	COMMUTATOR = '<',
	NEGATOR = '<=',
	RESTRICT = scalargtsel,
	JOIN = scalargtjoinsel
);

CREATE OPERATOR >= (
	LEFTARG = seg,
	RIGHTARG = seg,
	PROCEDURE = seg_ge,
	COMMUTATOR = '<=',
	NEGATOR = '<',
	RESTRICT = scalargtsel,
	JOIN = scalargtjoinsel
);

CREATE OPERATOR << (
	LEFTARG = seg,
	RIGHTARG = seg,
	PROCEDURE = seg_left,
	COMMUTATOR = '>>',
	RESTRICT = positionsel,
	JOIN = positionjoinsel
);

CREATE OPERATOR &< (
	LEFTARG = seg,
	RIGHTARG = seg,
	PROCEDURE = seg_over_left,
	RESTRICT = positionsel,
	JOIN = positionjoinsel
);

CREATE OPERATOR && (
	LEFTARG = seg,
	RIGHTARG = seg,
	PROCEDURE = seg_overlap,
	COMMUTATOR = '&&',
	RESTRICT = areasel,
	JOIN = areajoinsel
);

CREATE OPERATOR &> (
	LEFTARG = seg,
	RIGHTARG = seg,
	PROCEDURE = seg_over_right,
	RESTRICT = positionsel,
	JOIN = positionjoinsel
);

CREATE OPERATOR >> (
	LEFTARG = seg,
	RIGHTARG = seg,
	PROCEDURE = seg_right,
	COMMUTATOR = '<<',
	RESTRICT = positionsel,
	JOIN = positionjoinsel
);

CREATE OPERATOR = (
	LEFTARG = seg,
	RIGHTARG = seg,
	PROCEDURE = seg_same,
	COMMUTATOR = '=',
	NEGATOR = '<>',
	RESTRICT = eqsel,
	JOIN = eqjoinsel,
	MERGES
);

CREATE OPERATOR <> (
	LEFTARG = seg,
	RIGHTARG = seg,
	PROCEDURE = seg_different,
	COMMUTATOR = '<>',
	NEGATOR = '=',
	RESTRICT = neqsel,
	JOIN = neqjoinsel
);

CREATE OPERATOR @> (
	LEFTARG = seg,
	RIGHTARG = seg,
	PROCEDURE = seg_contains,
	COMMUTATOR = '<@',
	RESTRICT = contsel,
	JOIN = contjoinsel
);

CREATE OPERATOR <@ (
	LEFTARG = seg,
	RIGHTARG = seg,
	PROCEDURE = seg_contained,
	COMMUTATOR = '@>',
	RESTRICT = contsel,
	JOIN = contjoinsel
);

-- obsolete:
CREATE OPERATOR @ (
	LEFTARG = seg,
	RIGHTARG = seg,
	PROCEDURE = seg_contains,
	COMMUTATOR = '~',
	RESTRICT = contsel,
	JOIN = contjoinsel
);

CREATE OPERATOR ~ (
	LEFTARG = seg,
	RIGHTARG = seg,
	PROCEDURE = seg_contained,
	COMMUTATOR = '@',
	RESTRICT = contsel,
	JOIN = contjoinsel
);

-- define the GiST support methods
CREATE FUNCTION gseg_consistent(internal,seg,smallint,oid,internal)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;

CREATE FUNCTION gseg_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;

CREATE FUNCTION gseg_decompress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;

CREATE FUNCTION gseg_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;

CREATE FUNCTION gseg_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;

CREATE FUNCTION gseg_union(internal, internal)
RETURNS seg
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;

CREATE FUNCTION gseg_same(seg, seg, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;

-- Create the operator classes for indexing

CREATE OPERATOR CLASS seg_ops
    DEFAULT FOR TYPE seg USING btree AS
        OPERATOR        1       < ,
        OPERATOR        2       <= ,
        OPERATOR        3       = ,
        OPERATOR        4       >= ,
        OPERATOR        5       > ,
        FUNCTION        1       seg_cmp(seg, seg);

CREATE OPERATOR CLASS gist_seg_ops
DEFAULT FOR TYPE seg USING gist
AS
	OPERATOR	1	<< ,
	OPERATOR	2	&< ,
	OPERATOR	3	&& ,
	OPERATOR	4	&> ,
	OPERATOR	5	>> ,
	OPERATOR	6	= ,
	OPERATOR	7	@> ,
	OPERATOR	8	<@ ,
	OPERATOR	13	@ ,
	OPERATOR	14	~ ,
	FUNCTION	1	gseg_consistent (internal, seg, smallint, oid, internal),
	FUNCTION	2	gseg_union (internal, internal),
	FUNCTION	3	gseg_compress (internal),
	FUNCTION	4	gseg_decompress (internal),
	FUNCTION	5	gseg_penalty (internal, internal, internal),
	FUNCTION	6	gseg_picksplit (internal, internal),
	FUNCTION	7	gseg_same (seg, seg, internal);


text:
require_relative 'boot'

require 'rails/all'

# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)

module Baplan
  # Our Rails Application Class :)
  class Application < Rails::Application
    # Initialize configuration defaults for originally generated Rails version.
    config.load_defaults 5.1

    # Settings in config/environments/* take precedence over those
    # specified here.  Application configuration should go into files
    # in config/initializers -- all .rb files in that directory are
    # automatically loaded.

    config.action_controller.per_form_csrf_tokens = true
    config.action_controller.forgery_protection_origin_check = true
    config.active_record.belongs_to_required_by_default = true
    config.ssl_options = { hsts: { subdomains: true } }

    # Devise should not use secure cookies by default.
    config.devise_rememberable_opt = {}
  end
end


text:
<?php

namespace Amadeus\Client\RequestOptions;

/**
 * Pnr_Cancel Request Options
 *
 * @package Amadeus\Client\RequestOptions
 * @author  Michael Mueller <michael.mueller@invia.de>
 */
class PnrIgnoreOptions extends PnrBase
{
    /**
     * The Action Request used, should be "A" or ClearInformation::CODE_IGNORE
     *
     * @var string
     */
    public $actionRequest;
}


text:
module Services
  class DebfileNormalizer

    def initialize(debfile)
      @debfile = debfile
    end

    def process
      return true if @debfile.name == normalized_name
      rename! and @debfile.exist?
    end

    def normalized_name
      ctrl = @debfile.control
      "#{ctrl["Package"]}_#{ctrl["Version"]}_#{ctrl["Architecture"]}.deb"
    end

    def rename!
      new_name = normalized_name
      new_path = "#{@debfile.path}/#{new_name}"
      FileUtils.mv @debfile.filepath, new_path
      @debfile.name = new_name
      @debfile.save
    end
  end
end


text:
module MSF.Module
  ( module Types.Module
  , module_exploits
  , module_auxiliary
  , module_post
  , module_payloads
  , module_encoders
  , module_nops
  , module_info
  , module_options
  , module_compatible_payloads
  , module_target_compatible_payloads
  , module_compatible_sessions
  , module_encode
  , module_execute_payload
  , module_execute
  ) where

import MSF.Monad
import Types.Module
import qualified RPC.Module as RPC

-- | List modules installed on server. Silent operation.
module_exploits :: (SilentCxt s) => MSF s Modules
module_exploits = prim RPC.module_exploits

-- | List aux modules installed on server. Silent operation.
module_auxiliary :: (SilentCxt s) => MSF s Modules
module_auxiliary = prim RPC.module_auxiliary

-- | List of post modules. Silent operation.
module_post :: (SilentCxt s) => MSF s Modules
module_post = prim RPC.module_post

-- |List of payload modules. Silent operation.
module_payloads :: (SilentCxt s) => MSF s Modules
module_payloads = prim RPC.module_payloads

-- |List of encoder modules. Silent operation.
module_encoders :: (SilentCxt s) => MSF s Modules
module_encoders = prim RPC.module_encoders

-- |List of nop modules. Silent operation.
module_nops :: (SilentCxt s) => MSF s Modules
module_nops = prim RPC.module_nops

-- | XXX results not parsed. Are only the keys listed in documentation possible here? Silent operation.
module_info :: (SilentCxt s) => ModuleType -> ModuleName -> MSF s ModuleInfo
module_info modTyp modNm = prim $ \ addr auth ->
  RPC.module_info addr auth modTyp modNm

-- XXX results are parsed, but parsing needs testing. Silent operation.
module_options :: (SilentCxt s) => ModuleType -> ModuleName -> MSF s ModuleOptions
module_options modTyp modNm = prim $ \ addr auth ->
  RPC.module_options addr auth modTyp modNm

-- |Payloads that are compatible with the given exploit. Silent operation.
module_compatible_payloads :: (SilentCxt s) => ModuleName -> MSF s Payloads
module_compatible_payloads modNm = prim $ \ addr auth ->
  RPC.module_compatible_payloads addr auth modNm

-- |Probably a silent operation, but not clear how it determines compatibility.
module_target_compatible_payloads :: (SilentCxt s) => ModuleName -> Int -> MSF s Payloads
module_target_compatible_payloads modNm targetIndex = prim $ \ addr auth ->
  RPC.module_target_compatible_payloads addr auth modNm targetIndex

-- |Probably silent, but not clear how it determines compatibility.
module_compatible_sessions :: (SilentCxt s) => ModuleName -> MSF s Sessions
module_compatible_sessions modNm = prim $ \ addr auth ->
  RPC.module_compatible_sessions addr auth modNm

-- |Silent operation.
module_encode :: (SilentCxt s) => Payload -> ModuleName -> EncodeOptions -> MSF s ModuleEncode
module_encode pl encoderModule opts = prim $ \ addr auth ->
  RPC.module_encode addr auth pl encoderModule opts

-- |Execute a payload type module. This is silent since it just returns a payload from MSF. Return value should be ExecPayload.
module_execute_payload :: (SilentCxt s) => Payload -> ExecuteOptions -> MSF s ExecResult
module_execute_payload (Payload pl) opts =
  loud $ module_execute PayloadModuleType (ModuleName pl) opts

-- |Most generic execution of module. Potentially silent and potentially loud.
module_execute :: (LoudCxt s) => ModuleType -> ModuleName -> ExecuteOptions -> MSF s ExecResult
module_execute modTyp modNm opts = prim $ \ addr auth ->
  RPC.module_execute addr auth modTyp modNm opts


text:
package org.bitcoinj.core;

import org.libdohj.core.AuxPoWNetworkParameters;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.annotation.Nullable;
import java.io.IOException;
import java.io.OutputStream;
import java.math.BigInteger;
import java.nio.ByteBuffer;
import java.util.Arrays;

/**
 *
An AuxPoW header wraps a block header from another coin, enabling the foreign
 * chain's proof of work to be used for this chain as well. Note:
 * NetworkParameters for AuxPoW networks must implement AltcoinNetworkParameters
 * in order for AuxPoW to work.

 */
public class AuxPoW extends ChildMessage {

    public static final byte[] MERGED_MINING_HEADER = new byte[] {
        (byte) 0xfa, (byte) 0xbe, "m".getBytes()[0], "m".getBytes()[0]
    };

    /**
     * Maximum index of the merkle root hash in the coinbase transaction script,
     * where no merged mining header is present.
     */
    protected static final int MAX_INDEX_PC_BACKWARDS_COMPATIBILITY = 20;

    private static final Logger log = LoggerFactory.getLogger(AuxPoW.class);
    private static final long serialVersionUID = -8567546957352643140L;

    private Transaction transaction;
    private Sha256Hash hashBlock;
    private MerkleBranch coinbaseBranch;
    private MerkleBranch chainMerkleBranch;
    private AltcoinBlock parentBlockHeader;

    // Transactions can be encoded in a way that will use more bytes than is optimal
    // (due to VarInts having multiple encodings)
    // MAX_BLOCK_SIZE must be compared to the optimal encoding, not the actual encoding, so when parsing, we keep track
    // of the size of the ideal encoding in addition to the actual message size (which Message needs) so that Blocks
    // can properly keep track of optimal encoded size
    private transient int optimalEncodingMessageSize;

    public AuxPoW(NetworkParameters params, @Nullable Message parent) {
        super(params);
        transaction = new Transaction(params);
        hashBlock = Sha256Hash.ZERO_HASH;
        coinbaseBranch = new MerkleBranch(params, this);
        chainMerkleBranch = new MerkleBranch(params, this);
        parentBlockHeader = null;
    }

    /**
     * Creates an AuxPoW header by reading payload starting from offset bytes in. Length of header is fixed.
     * @param params NetworkParameters object.
     * @param payload Bitcoin protocol formatted byte array containing message content.
     * @param offset The location of the first payload byte within the array.
     * @param parent The message element which contains this header.
     * @param serializer the serializer to use for this message.
     * @throws ProtocolException
     */
    public AuxPoW(NetworkParameters params, byte[] payload, int offset, Message parent, MessageSerializer serializer)
            throws ProtocolException {
        super(params, payload, offset, parent, serializer, Message.UNKNOWN_LENGTH);
    }

    /**
     * Creates an AuxPoW header by reading payload starting from offset bytes in. Length of header is fixed.
     *
     * @param params NetworkParameters object.
     * @param payload Bitcoin protocol formatted byte array containing message content.
     * @param parent The message element which contains this header.
     * @param serializer the serializer to use for this message.
     */
    public AuxPoW(NetworkParameters params, byte[] payload, @Nullable Message parent, MessageSerializer serializer)
            throws ProtocolException {
        super(params, payload, 0, parent, serializer, Message.UNKNOWN_LENGTH);
    }

    protected static int calcLength(byte[] buf, int offset) {
        VarInt varint;
        // jump past transaction
        int cursor = offset + Transaction.calcLength(buf, offset);

        // jump past header hash
        cursor += 4;

        // Coin base branch
        cursor += MerkleBranch.calcLength(buf, offset);

        // Block chain branch
        cursor += MerkleBranch.calcLength(buf, offset);

        // Block header
		cursor += Block.HEADER_SIZE;

        return cursor - offset + 4;
    }

    @Override
    protected void parse() throws ProtocolException {
        cursor = offset;
        transaction = new Transaction(params, payload, cursor, this, serializer, Message.UNKNOWN_LENGTH, null);
        cursor += transaction.getOptimalEncodingMessageSize();
        optimalEncodingMessageSize = transaction.getOptimalEncodingMessageSize();

        hashBlock = readHash();
        optimalEncodingMessageSize += 32; // Add the hash size to the optimal encoding

        coinbaseBranch = new MerkleBranch(params, this, payload, cursor, serializer);
        cursor += coinbaseBranch.getOptimalEncodingMessageSize();
        optimalEncodingMessageSize += coinbaseBranch.getOptimalEncodingMessageSize();

        chainMerkleBranch = new MerkleBranch(params, this, payload, cursor, serializer);
        cursor += chainMerkleBranch.getOptimalEncodingMessageSize();
        optimalEncodingMessageSize += chainMerkleBranch.getOptimalEncodingMessageSize();

        // Make a copy of JUST the contained block header, so the block parser doesn't try reading
        // transactions past the end
        byte[] blockBytes = Arrays.copyOfRange(payload, cursor, cursor + Block.HEADER_SIZE);
        cursor += Block.HEADER_SIZE;
        parentBlockHeader = new AltcoinBlock(params, blockBytes, 0, this, serializer, Block.HEADER_SIZE);

        length = cursor - offset;
    }

    public int getOptimalEncodingMessageSize() {
        if (optimalEncodingMessageSize != 0)
            return optimalEncodingMessageSize;
        optimalEncodingMessageSize = getMessageSize();
        return optimalEncodingMessageSize;
    }

    @Override
    public String toString() {
        return toString(null, null);
    }

    /**
     * A human readable version of the transaction useful for debugging. The format is not guaranteed to be stable.
     * @param chain If provided, will be used to estimate lock times (if set). Can be null.
     */
    public String toString(@Nullable AbstractBlockChain chain, @Nullable CharSequence indent) {
		return transaction.toString(chain, indent);
    }

    @Override
    protected void bitcoinSerializeToStream(OutputStream stream) throws IOException {
        transaction.bitcoinSerialize(stream);
        stream.write(Utils.reverseBytes(hashBlock.getBytes()));

        coinbaseBranch.bitcoinSerialize(stream);
        chainMerkleBranch.bitcoinSerialize(stream);

        parentBlockHeader.bitcoinSerializeToStream(stream);
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        AuxPoW input = (AuxPoW) o;
        if (!transaction.equals(input.transaction)) return false;
        if (!hashBlock.equals(input.hashBlock)) return false;
        if (!coinbaseBranch.equals(input.coinbaseBranch)) return false;
        if (!chainMerkleBranch.equals(input.chainMerkleBranch)) return false;
        if (!parentBlockHeader.equals(input.parentBlockHeader)) return false;
        return getHash().equals(input.getHash());
    }

    @Override
    public int hashCode() {
        int result = 1;
        result = 31 * result + transaction.hashCode();
        result = 31 * result + hashBlock.hashCode();
        result = 31 * result + coinbaseBranch.hashCode();
        result = 31 * result + chainMerkleBranch.hashCode();
        result = 31 * result + parentBlockHeader.hashCode();
        return result;
    }

    /**
     * Get the block header from the parent blockchain. The hash of the header
     * is the value which should match the difficulty target. Note that blocks are
     * not necessarily part of the parent blockchain, they simply must be valid
     * blocks at the difficulty of the child blockchain.
     */
    public AltcoinBlock getParentBlockHeader() {
        return parentBlockHeader;
    }

    /**
     * Get the coinbase transaction from the AuxPoW header. This should contain a
     * reference back to the block hash in its input scripts, to prove that the
     * transaction was created after the block.
     */
    public Transaction getCoinbase() {
        return transaction;
    }

    /**
     * Get the Merkle branch used to connect the AuXPow header with this blockchain.
     */
    public MerkleBranch getChainMerkleBranch() {
        return chainMerkleBranch;
    }

    /**
     * Get the Merkle branch used to connect the coinbase transaction with this blockchain.
     */
    public MerkleBranch getCoinbaseBranch() {
        return coinbaseBranch;
    }

    /**
     * Check the proof of work for this AuxPoW header meets the target
     * difficulty.
     *
     * @param hashAuxBlock hash of the block the AuxPoW header is attached to.
     * @param target the difficulty target after decoding from compact bits.
     */
    protected boolean checkProofOfWork(Sha256Hash hashAuxBlock,
        BigInteger target, boolean throwException) throws VerificationException {
        if (!(params instanceof AuxPoWNetworkParameters)) {
            if (throwException) {
                // Should be impossible
                throw new VerificationException("Network parameters are not an instance of AuxPoWNetworkParameters, AuxPoW support is not available.");
            }
            return false;
        }
        final AuxPoWNetworkParameters altcoinParams = (AuxPoWNetworkParameters) params;

        if (0 != this.getCoinbaseBranch().getIndex()) {
            if (throwException) {
                // I don't like the message, but it correlates with what's in the reference client.
                throw new VerificationException("AuxPow is not a generate");
            }
            return false;
        }

        if (!altcoinParams.isTestNet()
            && parentBlockHeader.getChainID() == altcoinParams.getChainID()) {
            if (throwException) {
                throw new VerificationException("Aux POW parent has our chain ID");
            }
            return false;
        }

        if (this.getChainMerkleBranch().size() > 30) {
            if (throwException) {
                throw new VerificationException("Aux POW chain merkle branch too long");
            }
            return false;
        }

        Sha256Hash nRootHash = getChainMerkleBranch().calculateMerkleRoot(hashAuxBlock);
        final byte[] vchRootHash = nRootHash.getBytes();

        // Check that the coinbase transaction is in the merkle tree of the
        // parent block header
        if (!getCoinbaseBranch().calculateMerkleRoot(getCoinbase().getHash()).equals(parentBlockHeader.getMerkleRoot())) {
            if (throwException) {
                throw new VerificationException("Aux POW merkle root incorrect");
            }
            return false;
        }

        if (this.getCoinbase().getInputs().isEmpty()) {
            throw new VerificationException("Coinbase transaction has no inputs");
        }

        // Check that the chain merkle root is in the coinbase
        final byte[] script = this.getCoinbase().getInput(0).getScriptBytes();

        // Check that the same work is not submitted twice to our chain, by
        // confirming that the child block hash is in the coinbase merkle tree
        int pcHead = -1;
        int pc = -1;

        for (int scriptIdx = 0; scriptIdx < script.length; scriptIdx++) {
            if (arrayMatch(script, scriptIdx, MERGED_MINING_HEADER)) {
                // Enforce only one chain merkle root by checking that a single instance of the merged
                // mining header exists just before.
                if (pcHead >= 0) {
                    if (throwException) {
                        throw new VerificationException("Multiple merged mining headers in coinbase");
                    }
                    return false;
                }
                pcHead = scriptIdx;
            } else if (arrayMatch(script, scriptIdx, vchRootHash)) {
                pc = scriptIdx;
            }
        }

        if (pc == -1) {
            if (throwException) {
                throw new VerificationException("Aux POW missing chain merkle root in parent coinbase");
            }
            return false;
        }

        if (pcHead != -1) {
            if (pcHead + MERGED_MINING_HEADER.length != pc) {
                if (throwException) {
                    throw new VerificationException("Merged mining header is not just before chain merkle root");
                }
                return false;
            }
        } else {
            // For backward compatibility.
            // Enforce only one chain merkle root by checking that it starts early in the coinbase.
            // 8-12 bytes are enough to encode extraNonce and nBits.
            if (pc > MAX_INDEX_PC_BACKWARDS_COMPATIBILITY) {
                if (throwException) {
                    throw new VerificationException("Aux POW chain merkle root must start in the first 20 bytes of the parent coinbase");
                }
                return false;
            }
        }

        // Ensure we are at a deterministic point in the merkle leaves by hashing
        // a nonce and our chain ID and comparing to the index.
        pc += vchRootHash.length;
        if ((script.length - pc) < 8) {
            if (throwException) {
                throw new VerificationException("Aux POW missing chain merkle tree size and nonce in parent coinbase");
            }
            return false;
        }

        byte[] sizeBytes = Utils.reverseBytes(Arrays.copyOfRange(script, pc, pc + 4));
        int branchSize = ByteBuffer.wrap(sizeBytes).getInt();
        if (branchSize != (1 << getChainMerkleBranch().size())) {
            if (throwException) {
                throw new VerificationException("Aux POW merkle branch size does not match parent coinbase");
            }
            return false;
        }

        long nonce = getNonceFromScript(script, pc);

        if (getChainMerkleBranch().getIndex() != getExpectedIndex(nonce, ((AuxPoWNetworkParameters) params).getChainID(), getChainMerkleBranch().size())) {
            if (throwException) {
                throw new VerificationException("Aux POW wrong index in chain merkle branch for chain ID "
                    + ((AuxPoWNetworkParameters) params).getChainID() + ". Was "
                    + getChainMerkleBranch().getIndex() + ", expected "
                    + getExpectedIndex(nonce, ((AuxPoWNetworkParameters) params).getChainID(), getChainMerkleBranch().size()));
            }
            return false;
        }

        final BigInteger hashVal = altcoinParams.getBlockDifficulty(getParentBlockHeader());
        if (hashVal.compareTo(target) > 0) {
            // Proof of work check failed!
            if (throwException) {
                throw new VerificationException("Hash is higher than target: " + org.libdohj.core.Utils.formatAsHash(hashVal) + " vs "
                        + target.toString(16));
            }
            return false;
        }

        return true;
    }

    /**
     * Get the nonce value from the coinbase transaction script.
     *
     * @param script the transaction script to extract the nonce from.
     * @param pc offset of the merkle branch size within the script (this is 4
     * bytes before the start of the nonce value). Range checks should be
     * performed before calling this method.
     * @return the nonce value.
     */
    protected static long getNonceFromScript(final byte[] script, int pc) {
        // Note that the nonce value is packed as platform order (typically
        // little-endian) so we have to convert to big-endian for Java
        final byte[] nonceBytes = Utils.reverseBytes(Arrays.copyOfRange(script, pc + 4, pc + 8));

        return ByteBuffer.wrap(nonceBytes).getInt() & 0xffffffffl;
    }

    /**
     * Get the expected index of the slot within the chain merkle tree.
     *
     * This prevents the same work from being used twice for the
     * same chain while reducing the chance that two chains clash
     * for the same slot.
     */
    protected static int getExpectedIndex(final long nonce, final int chainId, final int merkleHeight) {
        // Choose a pseudo-random slot in the chain merkle tree
        // but have it be fixed for a size/nonce/chain combination.

        // We do most of the maths with a signed 32 bit integer, as the operation is
        // the same as the 32 unsigned integer that the reference version uses
        int rand = (int) nonce;
        rand = rand * 1103515245 + 12345;
        rand += chainId;
        rand = rand * 1103515245 + 12345;

        // At this point, we need to flip the value to its positive version,
        // so we switch to a 64 bit signed integer for the last calculations
        long longRand = rand & 0xffffffffl;

        longRand %= (1 << merkleHeight);

        return (int) longRand;
    }

    public Transaction getTransaction() {
        return transaction;
    }

    /**
     * Test whether one array is at a specific offset within the other.
     *
     * @param script the longer array to test for containing another array.
     * @param offset the offset to start at within the larger array.
     * @param subArray the shorter array to test for presence in the longer array.
     * @return true if the shorter array is present at the offset, false otherwise.
     */
    static boolean arrayMatch(byte[] script, int offset, byte[] subArray) {
        int matchIdx;
        for (matchIdx = 0; matchIdx + offset < script.length && matchIdx < subArray.length; matchIdx++) {
            if (script[offset + matchIdx] != subArray[matchIdx]) {
                return false;
            }
        }
        return matchIdx == subArray.length;
    }

    /**
     * Set the merkle branch used to connect the coinbase transaction to the
     * parent block header.
     */
    public void setCoinbaseBranch(final MerkleBranch merkleBranch) {
        this.coinbaseBranch = merkleBranch;
    }

    /**
     * Set the parent chain block header.
     */
    public void setParentBlockHeader(final AltcoinBlock header) {
        this.parentBlockHeader = header;
    }
}


text:
/* */
var version = require('./version');
VirtualPatch.NONE = 0;
VirtualPatch.VTEXT = 1;
VirtualPatch.VNODE = 2;
VirtualPatch.WIDGET = 3;
VirtualPatch.PROPS = 4;
VirtualPatch.ORDER = 5;
VirtualPatch.INSERT = 6;
VirtualPatch.REMOVE = 7;
VirtualPatch.THUNK = 8;
module.exports = VirtualPatch;
function VirtualPatch(type, vNode, patch) {
  this.type = Number(type);
  this.vNode = vNode;
  this.patch = patch;
}
VirtualPatch.prototype.version = version;
VirtualPatch.prototype.type = "VirtualPatch";


text:
/**
 * @externs
 * @suppress {duplicate,checkTypes}
 */
// NOTE: generated by tsickle, do not edit.
// externs from test_files/import_equals/import_equals.d.ts:
/** @const */
var __React = {};
/**
 * @constructor
 * @struct
 */
__React.X = function() {};
/** @const */
var importEquals = {};
importEquals.React = __React;
/** @const */
var React = __React;

/* Skipping problematic import ng = ...; */


text:
require_relative 'pa'

puts ternary_onliner


text:
using Amazon.DynamoDBv2.DataModel;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System;
using System.Text;
using System.Runtime.InteropServices;
using System.Linq;
using UnityEngine;

public class MigrateData : MonoBehaviour
{
    // Steps:
    // Copy original classes here, rename to match current version (only need to copy those that contain changes)
    // Make your changes to db classes
    // Fill out Convert functions appropriately
    // Increment VitaGlobals.m_versionPrefix
    // Click Upgrade DB button
    // Commit everything

    class DatabaseData
    {
        public List<EntityDBVitaOrganization> m_orgs = new List<EntityDBVitaOrganization>();
        public List<EntityDBVitaProfile> m_users = new List<EntityDBVitaProfile>();
        public List<EntityDBVitaClass> m_classes = new List<EntityDBVitaClass>();
        public List<EntityDBVitaStudentSession> m_sessions = new List<EntityDBVitaStudentSession>();
        public List<EntityDBVitaClassHomeworkAssigment> m_assignments = new List<EntityDBVitaClassHomeworkAssigment>();
    }

    IEnumerator WriteData(DatabaseData data)
    {
        DBOrganization dbOrg = GameObject.FindObjectOfType<DBOrganization>();
        yield return StartCoroutine(dbOrg.AddOrganizations(data.m_orgs));

        DBUser dbUser = GameObject.FindObjectOfType<DBUser>();
        yield return StartCoroutine(dbUser.AddUsers(data.m_users));

        DBClass dbClass = GameObject.FindObjectOfType<DBClass>();
        yield return StartCoroutine(dbClass.AddClasses(data.m_classes));

        DBSession dbSession = GameObject.FindObjectOfType<DBSession>();
        yield return StartCoroutine(dbSession.AddSessions(data.m_sessions));

        DBAssignment dbAssignment = GameObject.FindObjectOfType<DBAssignment>();
        yield return StartCoroutine(dbAssignment.AddAssignments(data.m_assignments));

        Debug.LogWarningFormat("WriteData() finished");
    }

    public IEnumerator MigrateData_1_1_to_1_2()
    {
        DatabaseData_1_1 data_1_1 = new DatabaseData_1_1();
        yield return StartCoroutine(GetData_1_1(data_1_1));
        DatabaseData data = Convert_1_1_to_1_2(data_1_1);

        VitaDynamoDB vitaDynamoDB = GameObject.Find("AWS").GetComponent<VitaDynamoDB>();
        yield return StartCoroutine(vitaDynamoDB.DeleteDatabase());
        yield return StartCoroutine(vitaDynamoDB.CreateDatabase());

        Debug.LogWarningFormat("MigrateData_1_1_to_1_2() - Waiting 30 secs for Tables to finish creating");
        yield return new WaitForSeconds(30);

        yield return StartCoroutine(WriteData(data));

        // update DB version to current version
        DBUser dbUser = GameObject.FindObjectOfType<DBUser>();
        dbUser.UpdateUser(VitaGlobals.m_versionUsername, "root", VitaGlobals.m_versionDB, DBUser.AccountType.STUDENT, VitaGlobals.CurrentTimeToString(), error => { if (!string.IsNullOrEmpty(error)) Debug.LogErrorFormat("UpdateUser() - error: {0}", error); });

        Debug.LogWarningFormat("MigrateData_1_1_to_1_2() finished");
    }

    // 1.1  //////////////////////////

    public class EntityDBVitaProfile_1_1
    {
        // Use Hash and Range Key to Authenticate a user
        [DynamoDBHashKey]   // Hash key.
        public string           username        { get; set; }

        [DynamoDBRangeKey]  // Range Key
        public string           password        {get; set;}

        [DynamoDBProperty]
        public string           organization    {get; set;}

        [DynamoDBProperty]
        public int              type            { get; set; }  //0 --> root admin //1 --> organization admin  //2 -->teacher //3 -->student

        [DynamoDBProperty]
        public string           name            { get; set; }

        [DynamoDBProperty]
        public List<string>     badges          { get; set; }

        [DynamoDBProperty]
        public List<string>     unlocks         { get; set; }

        [DynamoDBProperty]
        public int              currency        { get; set; }

        [DynamoDBProperty]
        public List<string>     scores          { get; set; }

        [DynamoDBProperty]
        public string           createdate       {get;set;}

        [DynamoDBProperty]
        public string           expiredate      {get;set;}

        [DynamoDBProperty]
        public string           lastlogin       {get;set;}

        [DynamoDBProperty]
        public int              archived        {get; set;}

        [DynamoDBProperty]
        public List<string>     favorites       { get; set; }

        public static string tableName = "VitaProfile";

        public void FixNullLists()
        {
            // when you get a profile from the DB, and the list is empty, the variable is null.
            // for the user, we want an empty list, this makes the code a little cleaner
            // so check this and fix it up before sending it to the user

            if (this.favorites == null) this.favorites = new List<string>();
            if (this.badges == null)    this.badges = new List<string>();
            if (this.unlocks == null)   this.unlocks = new List<string>();
            if (this.scores == null)    this.scores = new List<string>();
        }
    }

    public delegate void GetAllUsersDelegate_1_1(List<EntityDBVitaProfile_1_1> users, string error);

    public void GetAllUsers_1_1(GetAllUsersDelegate_1_1 callback)
    {
        VitaDynamoDB vitaDynamoDB = GameObject.Find("AWS").GetComponent<VitaDynamoDB>();
        vitaDynamoDB.GetAllEntities<EntityDBVitaProfile_1_1>(VitaDynamoDB.TableNameEntityDBVitaProfile, null, (result, error)=>
        {
            List<EntityDBVitaProfile_1_1> users = null;
            if (string.IsNullOrEmpty(error))
            {
                users = new List<EntityDBVitaProfile_1_1>((List<EntityDBVitaProfile_1_1>)result);
                users.Sort((a, b) => a.username.CompareTo(b.username));
                users.ForEach((a) => a.FixNullLists());
            }

            if (callback != null)
                callback(users, error);
        });
    }

    class DatabaseData_1_1
    {
        public List<EntityDBVitaOrganization> m_orgs = new List<EntityDBVitaOrganization>();
        public List<EntityDBVitaProfile_1_1> m_users = new List<EntityDBVitaProfile_1_1>();
        public List<EntityDBVitaClass> m_classes = new List<EntityDBVitaClass>();
        public List<EntityDBVitaStudentSession> m_sessions = new List<EntityDBVitaStudentSession>();
        public List<EntityDBVitaClassHomeworkAssigment> m_assignments = new List<EntityDBVitaClassHomeworkAssigment>();
    }

    IEnumerator GetData_1_1(DatabaseData_1_1 data)
    {
        bool waitForDB = true;
        DBOrganization dbOrg = GameObject.FindObjectOfType<DBOrganization>();
        dbOrg.GetAllOrganizations((orgs, error) =>
        {
            waitForDB = false;

            if (!string.IsNullOrEmpty(error))
            {
                Debug.LogErrorFormat("GetAllOrganizations() error: {0}", error);
                return;
            }

            data.m_orgs = orgs;
        });

        while (waitForDB)
            yield return new WaitForEndOfFrame();

        waitForDB = true;
        GetAllUsers_1_1((users, error) =>
        {
            waitForDB = false;

            if (!string.IsNullOrEmpty(error))
            {
                Debug.LogErrorFormat("GetAllUsers_1_1() error: {0}", error);
                return;
            }

            data.m_users = users;
        });

        while (waitForDB)
            yield return new WaitForEndOfFrame();

        waitForDB = true;
        DBClass dbClass = GameObject.FindObjectOfType<DBClass>();
        dbClass.GetAllClasses((classes, error) =>
        {
            waitForDB = false;

            if (!string.IsNullOrEmpty(error))
            {
                Debug.LogErrorFormat("GetAllClasses() error: {0}", error);
                return;
            }

            data.m_classes = classes;
        });

        while (waitForDB)
            yield return new WaitForEndOfFrame();

        waitForDB = true;
        DBSession dbSession = GameObject.FindObjectOfType<DBSession>();
        dbSession.GetAllSessions((sessions, error) =>
        {
            waitForDB = false;

            if (!string.IsNullOrEmpty(error))
            {
                Debug.LogErrorFormat("GetAllSessions() error: {0}", error);
                return;
            }

            data.m_sessions = sessions;
        });

        while (waitForDB)
            yield return new WaitForEndOfFrame();

        waitForDB = true;
        DBAssignment dbAssignment = GameObject.FindObjectOfType<DBAssignment>();
        dbAssignment.GetAllAssignments((assignments, error) =>
        {
            waitForDB = false;

            if (!string.IsNullOrEmpty(error))
            {
                Debug.LogErrorFormat("GetAllAssignments() error: {0}", error);
                return;
            }

            data.m_assignments = assignments;
        });

        while (waitForDB)
            yield return new WaitForEndOfFrame();

        yield return new WaitForSeconds(1);

        Debug.LogWarningFormat("GetData_1_1() finished");
    }

    DatabaseData Convert_1_1_to_1_2(DatabaseData_1_1 data_1_1)
    {
        DatabaseData data = new DatabaseData();

        data.m_orgs = data_1_1.m_orgs;
        data.m_classes = data_1_1.m_classes;
        data.m_sessions = data_1_1.m_sessions;
        data.m_assignments = data_1_1.m_assignments;

        foreach (var user in data_1_1.m_users)
        {
            data.m_users.Add(new EntityDBVitaProfile() {
                username = user.username,
                password = user.password,
                organization = user.organization,
                type = user.type,
                name = user.name,
                badges = user.badges,
                unlocks = user.unlocks,
                currency = user.currency,
                scores = user.scores,
                createdate = user.createdate,
                expiredate = user.expiredate,
                lastlogin = user.lastlogin,
                archived = user.archived,
                favorites = user.favorites
            });
        }

        return data;
    }

    ////////////////////////////
}


text:
Repositório de códigos em Processing e Java desenvolvidos pelo prof. Walter A. Nagai para o minicurso "Usando Processing para desenvolvimento de aplicativos Android" para o ERI-MT-2016 e CompSulMT'2016. A apresentação do minicurso está disponível no arquivo "minicurso_apresentacao.pdf".

## Processing

- colorfulBalls: N (<= 10) bolas coloridas quicando pela janela;
- musicBlocks: tocando trechos curtos de música ao tocar/clicar em regiões na tela;
- spaceInvaders: simulação de jogo retrô de uma pequena nave espacial contra uma horda de inimigos alienígenas;
- insideOut: simulação de jogo com disputa de elementos representando sentimentos do filme "Divertida Mente";
- insideOutJSON: a mesma simulação do jogo insideOut, porém os dados estão descritos em um arquivo JSON;

## Android Studio

- FragExample: exemplo de um aplicativo desenvolvido em Android Studio para embutir códigos desenvolvidos em Processing.

## Licença de Uso

Todos os códigos desenvolvidos seguem a Licença Apache 2.0.


text:
import random

NUM_DIGITS = 3
MAX_GUESS = 10

def getSecretNum():
    # Returns a string of unique random digits that is NUM_DIGITS long.
    numbers = list(range(10))
    random.shuffle(numbers)
    secretNum = ''
    for i in range(NUM_DIGITS):
        secretNum += str(numbers[i])
    return secretNum

def getClues(guess, secretNum):
    # Returns a string with the Pico, Fermi, & Bagels clues to the user.
    if guess == secretNum:
        return 'You got it!'

    clues = []
    for i in range(len(guess)):
        if guess[i] == secretNum[i]:
            clues.append('Fermi')
        elif guess[i] in secretNum:
            clues.append('Pico')
    if len(clues) == 0:
        return 'Bagels'

    clues.sort()
    return ' '.join(clues)

def isOnlyDigits(num):
    # Returns True if num is a string of only digits. Otherwise, returns False.
    if num == '':
        return False

    for i in num:
        if i not in '0 1 2 3 4 5 6 7 8 9'.split():
            return False

    return True

print('I am thinking of a %s-digit number. Try to guess what it is.' % (NUM_DIGITS))
print('The clues I give are...')
print('When I say:    That means:')
print('  Bagels       None of the digits is correct.')
print('  Pico         One digit is correct but in the wrong position.')
print('  Fermi        One digit is correct and in the right position.')

while True:
    secretNum = getSecretNum()
    print('I have thought up a number. You have %s guesses to get it.' % (MAX_GUESS))

    guessesTaken = 1
    while guessesTaken <= MAX_GUESS:
        guess = ''
        while len(guess) != NUM_DIGITS or not isOnlyDigits(guess):
            print('Guess #%s: ' % (guessesTaken))
            guess = input()

        print(getClues(guess, secretNum))
        guessesTaken += 1

        if guess == secretNum:
            break
        if guessesTaken > MAX_GUESS:
            print('You ran out of guesses. The answer was %s.' % (secretNum))

    print('Do you want to play again? (yes or no)')
    if not input().lower().startswith('y'):
        break


text:
/**
 * This overrides some default Doxygen styles to improve readability.
 */

 #projectlogo {
     vertical-align: middle !important;
 }


text:
package aws

import (
	"sync"

	"k8s.io/klog"

	"k8s.io/apimachinery/pkg/util/sets"
	awscredentialprovider "k8s.io/kubernetes/pkg/credentialprovider/aws"
)

// wellKnownRegions is the complete list of regions known to the AWS cloudprovider
// and credentialprovider.
var wellKnownRegions = [...]string{
	// from `aws ec2 describe-regions --region us-east-1 --query Regions[].RegionName | sort`
	"ap-northeast-1",
	"ap-northeast-2",
	"ap-northeast-3",
	"ap-south-1",
	"ap-southeast-1",
	"ap-southeast-2",
	"ca-central-1",
	"eu-central-1",
	"eu-west-1",
	"eu-west-2",
	"eu-west-3",
	"sa-east-1",
	"us-east-1",
	"us-east-2",
	"us-west-1",
	"us-west-2",

	// these are not registered in many / most accounts
	"cn-north-1",
	"cn-northwest-1",
	"us-gov-west-1",
}

// awsRegionsMutex protects awsRegions
var awsRegionsMutex sync.Mutex

// awsRegions is a set of recognized regions
var awsRegions sets.String

// recognizeRegion is called for each AWS region we know about.
// It currently registers a credential provider for that region.
// There are two paths to discovering a region:
//  * we hard-code some well-known regions
//  * if a region is discovered from instance metadata, we add that
func recognizeRegion(region string) {
	awsRegionsMutex.Lock()
	defer awsRegionsMutex.Unlock()

	if awsRegions == nil {
		awsRegions = sets.NewString()
	}

	if awsRegions.Has(region) {
		klog.V(6).Infof("found AWS region %q again - ignoring", region)
		return
	}

	klog.V(4).Infof("found AWS region %q", region)

	awscredentialprovider.RegisterCredentialsProvider(region)

	awsRegions.Insert(region)
}

// recognizeWellKnownRegions calls RecognizeRegion on each WellKnownRegion
func recognizeWellKnownRegions() {
	for _, region := range wellKnownRegions {
		recognizeRegion(region)
	}
}

// isRegionValid checks if the region is in the set of known regions
func isRegionValid(region string) bool {
	awsRegionsMutex.Lock()
	defer awsRegionsMutex.Unlock()

	return awsRegions.Has(region)
}


text:
<?php

namespace ChaosTangent\CommentSpam;

use Symfony\Component\HttpFoundation\Request;

/**
 * Detector Interface
 *
 * The root interface all detectors must implement
 *
 * @author John Noel <john.noel@chaostangent.com>
 * @package CommentSpam
 */
interface DetectorInterface
{
    public function isSpam(CommentInterface $comment, Request $context);
}


text:
<?php

require __DIR__ . '/vendor/autoload.php';

$flags        = new donatj\Flags;
$drop         =& $flags->bool('drop', false, 'Include DROP TABLE?');
$inputComment =& $flags->bool('input-comment', false, 'Include original input as a comment?');

$columnFactory = new \donatj\Misstep\ColumnFactory;

try {
	$flags->parse();
} catch( Exception $e ) {
	echo $e->getMessage() . "\n";
	echo $flags->getDefaults();

	die(1);
}

$jql = file_get_contents('php://stdin');

try {
	if( trim($jql) == '' ) {
		return '';
	}

	$parser   = new \donatj\Misstep\Parser($columnFactory);
	$renderer = new \donatj\Misstep\Renderer($jql, $inputComment, $drop);

	$tables = $parser->parse($jql);
	echo $renderer->render($tables);
} catch( \donatj\Misstep\Exceptions\UserException $e ) {
	fwrite(STDERR, "Error: " . $e->getMessage() . "\n");

	die(1);
}


text:
export class PokemonData {
	constructor(
		public Id : number,
		public Name: string,
		public BaseStamina: number,
		public BaseAttack : number,
		public BaseDefense : number,
		public Type1: string,
		public Type2: string,
		public QuickMoves: number[],
		public CinematicMoves: number[],
		public OldQuickMoves: number[],
		public OldCinematicMoves: number[],
		public CandyToEvolve: number,
		public FamilyId: number,
		public EvolutionIds: number[]
	){ }
}


text:
@implementation PoemTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{

    self=[super initWithStyle:style reuseIdentifier:reuseIdentifier];

    if (self) {

        [self.contentView addSubview:self.label];

    }

    return self;
}

- (UILabel *)label{

    if (_label == nil) {
        self.label=[[UILabel alloc]initWithFrame:CGRectMake(20, 0,kwidth ,44)];

    }
    return _label;

}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end