text
stringlengths 27
775k
|
|---|
INSERT INTO emails (person, email)
VALUES (%(person_id)s, %(email)s)
ON CONFLICT (person, email) DO NOTHING
|
// Copyright 2017 Istio Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package envoy
import (
"fmt"
"reflect"
"sort"
"strconv"
"time"
"github.com/golang/glog"
"github.com/golang/protobuf/proto"
"github.com/hashicorp/go-multierror"
"istio.io/manager/model"
"istio.io/manager/model/proxy/alphav1/config"
)
type ingressWatcher struct {
agent Agent
discovery model.ServiceDiscovery
registry *model.IstioRegistry
mesh *MeshConfig
}
// NewIngressWatcher creates a new ingress watcher instance with an agent
func NewIngressWatcher(discovery model.ServiceDiscovery, ctl model.Controller,
registry *model.IstioRegistry, mesh *MeshConfig, identity *ProxyNode) (Watcher, error) {
out := &ingressWatcher{
agent: NewAgent(mesh.BinaryPath, mesh.ConfigPath, identity.Name),
discovery: discovery,
registry: registry,
mesh: mesh,
}
// Initialize envoy according to the current model state,
// instead of waiting for the first event to arrive.
// Note that this is currently done synchronously (blocking),
// to avoid racing with controller events lurking around the corner.
// This can be improved once we switch to a mechanism where reloads
// are linearized (e.g., by a single goroutine reloader).
out.reload()
err := ctl.AppendConfigHandler(model.IngressRule,
func(model.Key, proto.Message, model.Event) { out.reload() })
if err != nil {
return nil, err
}
return out, nil
}
func (w *ingressWatcher) reload() {
config, err := w.generateConfig()
if err != nil {
glog.Warningf("Failed to generate Envoy configuration: %v", err)
return
}
current := w.agent.ActiveConfig()
if reflect.DeepEqual(config, current) {
glog.V(2).Info("Configuration is identical, skipping reload")
return
}
// TODO: add retry logic
if err := w.agent.Reload(config); err != nil {
glog.Warningf("Envoy reload error: %v", err)
return
}
// Add a short delay to de-risk a potential race condition in envoy hot reload code.
// The condition occurs when the active Envoy instance terminates in the middle of
// the Reload() function.
time.Sleep(256 * time.Millisecond)
}
func (w *ingressWatcher) generateConfig() (*Config, error) {
// TODO: Configurable namespace?
rules := w.registry.IngressRules("")
// Phase 1: group rules by host
rulesByHost := make(map[string][]*config.RouteRule, len(rules))
for _, rule := range rules {
host := "*"
if rule.Match != nil {
if authority, ok := rule.Match.HttpHeaders["authority"]; ok {
switch match := authority.GetMatchType().(type) {
case *config.StringMatch_Exact:
host = match.Exact
default:
glog.Warningf("Unsupported match type for authority condition: %T", match)
}
}
}
rulesByHost[host] = append(rulesByHost[host], rule)
}
// Phase 2: create a VirtualHost for each host
vhosts := make([]*VirtualHost, 0, len(rulesByHost))
for host, hostRules := range rulesByHost {
routes := make([]*HTTPRoute, 0, len(hostRules))
for _, rule := range hostRules {
route, err := buildIngressRoute(rule)
if err != nil {
glog.Warningf("Error constructing Envoy route from ingress rule: %v", err)
continue
}
routes = append(routes, route)
}
sort.Sort(RoutesByPath(routes))
vhost := &VirtualHost{
Name: host,
Domains: []string{host},
Routes: routes,
}
vhosts = append(vhosts, vhost)
}
sort.Sort(HostsByName(vhosts))
rConfig := &HTTPRouteConfig{VirtualHosts: vhosts}
httpListener := &Listener{
Port: 80,
BindToPort: true,
Filters: []*NetworkFilter{
{
Type: "read",
Name: HTTPConnectionManager,
Config: HTTPFilterConfig{
CodecType: "auto",
StatPrefix: "http",
AccessLog: []AccessLog{{Path: DefaultAccessLog}},
RouteConfig: rConfig,
Filters: []HTTPFilter{
{
Type: "decoder",
Name: "router",
Config: FilterRouterConfig{},
},
},
},
},
},
}
// TODO: HTTPS listener
listeners := []*Listener{httpListener}
clusters := Clusters(rConfig.filterClusters(func(cl *Cluster) bool { return true })).Normalize()
return &Config{
Listeners: listeners,
Admin: Admin{
AccessLogPath: DefaultAccessLog,
Port: w.mesh.AdminPort,
},
ClusterManager: ClusterManager{
Clusters: clusters,
SDS: &SDS{
Cluster: buildDiscoveryCluster(w.mesh.DiscoveryAddress, "sds"),
RefreshDelayMs: 1000,
},
},
}, nil
}
// buildIngressRoute translates an ingress rule to an Envoy route
func buildIngressRoute(rule *config.RouteRule) (*HTTPRoute, error) {
route := &HTTPRoute{
Path: "",
Prefix: "/",
}
if rule.Match != nil && rule.Match.HttpHeaders != nil {
if uri, ok := rule.Match.HttpHeaders[HeaderURI]; ok {
switch m := uri.MatchType.(type) {
case *config.StringMatch_Exact:
route.Path = m.Exact
route.Prefix = ""
case *config.StringMatch_Prefix:
route.Path = ""
route.Prefix = m.Prefix
case *config.StringMatch_Regex:
return nil, fmt.Errorf("unsupported route match condition: regex")
}
}
}
clusters := make([]*WeightedClusterEntry, 0)
for _, dst := range rule.Route {
// fetch route destination, or fallback to rule destination
destination := dst.Destination
if destination == "" {
destination = rule.Destination
}
port, tags, err := extractPortAndTags(dst)
if err != nil {
return nil, multierror.Append(fmt.Errorf("failed to extract routing rule destination port"), err)
}
cluster := buildOutboundCluster(destination, port, tags)
clusters = append(clusters, &WeightedClusterEntry{
Name: cluster.Name,
Weight: int(dst.Weight),
})
route.clusters = append(route.clusters, cluster)
}
route.WeightedClusters = &WeightedCluster{Clusters: clusters}
// rewrite to a single cluster if it's one weighted cluster
if len(rule.Route) == 1 {
route.Cluster = route.WeightedClusters.Clusters[0].Name
route.WeightedClusters = nil
}
// Ensure all destination clusters have the same port number.
//
// This is currently required for doing host header rewrite (host:port),
// which is scoped to the entire route.
// This restriction can be relaxed by constructing multiple envoy.Route objects
// per config.RouteRule, and doing weighted load balancing using Runtime.
portSet := make(map[int]struct{}, 1)
for _, cluster := range route.clusters {
portSet[cluster.port.Port] = struct{}{}
}
if len(portSet) > 1 {
return nil, fmt.Errorf("unsupported multiple destination ports per ingress route rule")
}
// Rewrite the host header so that inbound proxies can match incoming traffic
route.HostRewrite = fmt.Sprintf("%s:%d", rule.Destination, route.clusters[0].port.Port)
return route, nil
}
// extractPortAndTags extracts the destination service port from the given destination,
// as well as its tags (after clearing meta-tags describing the port).
// Note that this is a temporary measure to communicate the destination service's port
// to the proxy configuration generator. This can be improved by using
// a dedicated model object for IngressRule (instead of reusing RouteRule),
// which exposes the necessary target port field within the "Route" field.
func extractPortAndTags(dst *config.DestinationWeight) (*model.Port, model.Tags, error) {
portNum, err := strconv.Atoi(dst.Tags["servicePort.port"])
if err != nil {
return nil, nil, err
}
portName, ok := dst.Tags["servicePort.name"]
if !ok {
return nil, nil, fmt.Errorf("no name specified for service port %d", portNum)
}
portProto, ok := dst.Tags["servicePort.protocol"]
if !ok {
return nil, nil, fmt.Errorf("no protocol specified for service port %d", portNum)
}
port := &model.Port{
Port: portNum,
Name: portName,
Protocol: model.Protocol(portProto),
}
var tags model.Tags
if len(dst.Tags) > 3 {
tags = make(model.Tags, len(dst.Tags)-3)
for k, v := range dst.Tags {
tags[k] = v
}
delete(tags, "servicePort.port")
delete(tags, "servicePort.name")
delete(tags, "servicePort.protocol")
}
return port, tags, nil
}
|
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/clipboard/clipboard_read_permission_context.h"
#include "chrome/browser/content_settings/tab_specific_content_settings.h"
#include "chrome/browser/permissions/permission_request_id.h"
#include "chrome/common/chrome_features.h"
#include "components/content_settings/core/common/content_settings_types.h"
#include "third_party/blink/public/mojom/feature_policy/feature_policy.mojom.h"
ClipboardReadPermissionContext::ClipboardReadPermissionContext(Profile* profile)
: PermissionContextBase(profile,
CONTENT_SETTINGS_TYPE_CLIPBOARD_READ,
blink::mojom::FeaturePolicyFeature::kNotFound) {}
ClipboardReadPermissionContext::~ClipboardReadPermissionContext() {}
void ClipboardReadPermissionContext::UpdateTabContext(
const PermissionRequestID& id,
const GURL& requesting_frame,
bool allowed) {
TabSpecificContentSettings* content_settings =
TabSpecificContentSettings::GetForFrame(id.render_process_id(),
id.render_frame_id());
if (!content_settings)
return;
if (allowed) {
content_settings->OnContentAllowed(CONTENT_SETTINGS_TYPE_CLIPBOARD_READ);
} else {
content_settings->OnContentBlocked(CONTENT_SETTINGS_TYPE_CLIPBOARD_READ);
}
}
bool ClipboardReadPermissionContext::IsRestrictedToSecureOrigins() const {
return true;
}
|
using System;
using Microsoft.FlightSimulator.SimConnect;
using SimControls.Model;
namespace SimControls.SimulatorConnection
{
public interface ISimVariable
{
void UpdateVariable(object info);
void Declare(SimConnect conn);
Enum EventEnum { get; }
}
public readonly struct DoubleWrapper
{
public readonly double value;
public DoubleWrapper(double value)
{
this.value = value;
}
}
public readonly struct IntWrapper
{
public readonly int value;
public IntWrapper(int value)
{
this.value = value;
}
}
public enum FakeEnum
{
Foo
};
public class SimVariable<T>: ISimVariable
{
private readonly string name;
private readonly string unitName;
private readonly SIMCONNECT_DATATYPE simType;
private readonly ReadOnlyDataItem<T> target;
public Enum EventEnum { get; }
public SimVariable(
string name, string unitName, SIMCONNECT_DATATYPE simType,
ReadOnlyDataItem<T> target, int eventRequest)
{
this.name = name;
this.unitName = unitName;
this.simType = simType;
this.target = target;
this.EventEnum = (FakeEnum)eventRequest;
}
public void UpdateVariable(object info) => target.TryUpdateFromSimulator((T)GetValue(info));
private object GetValue(object info)
{
return info switch
{
DoubleWrapper dw => (object)dw.value,
IntWrapper iw => (object)iw.value,
_ => throw new InvalidOperationException("Unknown type")
};
}
public virtual void Declare(SimConnect conn)
{
connection = conn;
conn.AddToDataDefinition(EventEnum, name, unitName, simType, 0.0f, SimConnect.SIMCONNECT_UNUSED);
CreateVariableCollectionStuct(conn);
if (target is DataItem<T> writableTarget)
{
writableTarget.WriteValueToSimulator += Write;
}
}
private void CreateVariableCollectionStuct(SimConnect conn)
{
switch (target.Value)
{
case double d:
conn.RegisterDataDefineStruct<DoubleWrapper>(EventEnum);
break;
case int i:
conn.RegisterDataDefineStruct<IntWrapper>(EventEnum);
break;
}
}
protected SimConnect? connection;
public virtual void Write(object? o, EventArgs e)
{
var output= CreateTransferObject();
connection?.SetDataOnSimObject(EventEnum, SimConnect.SIMCONNECT_OBJECT_ID_USER,
SIMCONNECT_DATA_SET_FLAG.DEFAULT, output);
}
private object CreateTransferObject() =>
target.Value switch
{
double d => new DoubleWrapper(d),
int i => new IntWrapper(i),
_ => throw new InvalidOperationException("Unknowwn type")
};
}
public class SimVariableWithEvent<T> : SimVariable<T>
{
private readonly string setEventName;
public SimVariableWithEvent(
string name, string unitName, SIMCONNECT_DATATYPE simType, DataItem<T> target,
int eventRequest, string setEventName) :
base(name, unitName, simType, target, eventRequest)
{
this.setEventName = setEventName;
}
public override void Declare(SimConnect conn)
{
base.Declare(conn);
conn.MapClientEventToSimEvent(EventEnum, setEventName);
}
public override void Write(object? o, EventArgs e)
{
connection?.TransmitClientEvent(0u, EventEnum, 1, FakeEnum.Foo,
SIMCONNECT_EVENT_FLAG.GROUPID_IS_PRIORITY);
}
}
}
|
// Map elements can be removed in multiple:
val myMap = Map("MI" -> "Michigan", "OH" -> "Ohio", "WI" -> "Wisconsin", "IA" -> "Iowa")
val aNewMap = myMap -- List("MI", "OH")
aNewMap.contains("MI") should be(false)
myMap.contains("MI") should be(true)
aNewMap.contains("WI") should be(true)
aNewMap.size should be(2)
myMap.size should be(4)
|
/* eslint-disable react/prop-types */
import React, { useRef, useEffect, useState } from "react";
import styled, { keyframes } from "styled-components";
var Chance = require("chance");
var chance = new Chance();
const ScrollingTextBox = ({ textList, textAlign, animationsEnabled }) => {
const [offset, setOffset] = useState(0);
const intervalRef = useRef();
useEffect(() => {
setTimeout(startScrolling, 10)
}, []);
const startScrolling = () => {
intervalRef.current = setInterval(() => {
const randoNumber = chance.integer({
min: (textList.length - 1) * -1,
max: 0,
});
const pixelValue = randoNumber * 70;
setOffset(pixelValue.toString());
}, 2300);
}
return (
<>
<ScrollingTextBoxContainer>
<ScrollingTextBoxContent textAlign={textAlign} offset={offset} animationsEnabled={animationsEnabled}>
{textList.map((text, index) => {
return (
<ScrollingTextElementContainer key={index}>
<ScrollingTextElement textAlign={textAlign}>
<p>{text}</p>
</ScrollingTextElement>
</ScrollingTextElementContainer>
);
})}
</ScrollingTextBoxContent>
</ScrollingTextBoxContainer>
</>
);
};
export default ScrollingTextBox;
const ScrollingTextBoxContainer = styled.div`
overflow: hidden;
height: 70px;
z-index: 20;
@media only screen and (max-width: 750px) {
color: white;
}
`;
const ScrollingTextBoxContent = styled("div")`
background-color: none;
color: "white";
position: relative;
transition: 1s all ease-in-out;
top: ${props => props.animationsEnabled ? props.offset : '0'}px;
`;
const ScrollingTextElementContainer = styled.div`
display: flex;
text-align: left;
align-items: center;
`;
const ScrollingTextElement = styled("div")`
text-align: ${props => props.textAlign};
margin: 0;
margin-left: ${props => (props.textAlign === "left" ? "15px" : "0px")};
height: 70px;
line-height: 70px;
display: inline-block;
width: 100%;
font-size: 50px;
p {
display: inline-block;
background-color: rgba(11, 9, 38, 1);
border-radius: 50%;
}
`;
|
package com.iitb.AuthenticatorModel;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import com.iitb.AuthenticatorBean.*;
import com.iitb.dbUtilities.DataService;
import com.iitb.dbUtilities.MysqlConnect;
/*
* This model is used by Login.jsp and Dashboard.jsp *
*
*/
public class Authenticate {
/* Authenticates the user and sets the login credentials in loginUser bean
* Login.jsp
* @author:Ravi Prakash Giri
*/
public LoginBean authenticate(String user,String password) throws SQLException{
Connection connObj ;
connObj = MysqlConnect.getDbCon().conn;
connObj.setAutoCommit(false);
//System.out.println("k");
LoginBean loginUser=new LoginBean();
try{
String query = "SELECT org_id,org_name,org_password,parent_org FROM `organization` where org_username='"
+ user + "';";
ResultSet rs = DataService.getResultSet(query);
if (rs.next()) {
//System.out.println("testing rpg");
if (rs.getString("org_password").equals(password)) {
String orgId = rs.getString("org_id");
loginUser.setOrg_id(orgId);
String orgName=rs.getString("org_name");
loginUser.setOrg_name(orgName);
String parentOrg = rs.getString("parent_org");
loginUser.setParent_org(parentOrg);
loginUser.setUsername(user);
System.out.println("set loginUser");
return loginUser;
}
else{
System.out.println("no loginUser 1"+loginUser.getUsername());
return loginUser;
}
}
else{
System.out.println("no loginUser 2");
return loginUser;
}
}
catch(SQLException e){
e.printStackTrace();
connObj.rollback();
System.out.println("Rollback hua !");
}
System.out.println("no loginUser 3");
return loginUser;
}
}
|
$ErrorActionPreference = "Stop"
$BUILD_MODE = $Env:BUILD_MODE
$VS_PLATFORM = $Env:VS_PLATFORM
if(!$BUILD_MODE) {$BUILD_MODE = "Debug"}
if(!$VS_PLATFORM) {$VS_PLATFORM = "Win32"}
cd build
echo "ctest.exe -C $BUILD_MODE ."
ctest.exe -C $BUILD_MODE .
|
#
# Copyright 2016-2019 Crown Copyright
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
"""
This module queries a Gaffer REST API
"""
import json
import urllib.error
import urllib.request
from gafferpy import gaffer as g
class GafferConnector:
"""
This class handles the connection to a Gaffer server and handles operations.
This class is initialised with a host to connect to.
"""
def __init__(self, host, verbose=False, headers={}):
"""
This initialiser sets up a connection to the specified Gaffer server.
The host (and port) of the Gaffer server, should be in the form,
'hostname:1234/service-name/version'
"""
self._host = host
self._verbose = verbose
self._headers = headers
# Create the opener
self._opener = urllib.request.build_opener(
urllib.request.HTTPHandler())
def execute_operation(self, operation, headers=None):
"""
This method queries Gaffer with the single provided operation.
"""
# If headers are not specified use those set at class initilisation
if headers is None:
headers = self._headers
return self.execute_operations([operation], headers)
def execute_operations(self, operations, headers=None):
"""
This method queries Gaffer with the provided array of operations.
"""
# If headers are not specified use those set at class initilisation
if headers is None:
headers = self._headers
return self.execute_operation_chain(g.OperationChain(operations),
headers)
def execute_operation_chain(self, operation_chain, headers=None):
"""
This method queries Gaffer with the provided operation chain.
"""
# If headers are not specified use those set at class initialisation
if headers is None:
headers = self._headers
# Construct the full URL path to the Gaffer server
url = self._host + '/graph/operations/execute'
if hasattr(operation_chain, "to_json"):
op_chain_json_obj = operation_chain.to_json()
else:
op_chain_json_obj = operation_chain
# Query Gaffer
if self._verbose:
print('\nQuery operations:\n' +
json.dumps(op_chain_json_obj, indent=4) + '\n')
# Convert the query dictionary into JSON and post the query to Gaffer
json_body = bytes(json.dumps(op_chain_json_obj), 'ascii')
headers['Content-Type'] = 'application/json;charset=utf-8'
request = urllib.request.Request(url, headers=headers, data=json_body)
try:
response = self._opener.open(request)
except urllib.error.HTTPError as error:
error_body = error.read().decode('utf-8')
new_error_string = ('HTTP error ' +
str(error.code) + ' ' +
error.reason + ': ' +
error_body)
raise ConnectionError(new_error_string)
response_text = response.read().decode('utf-8')
if self._verbose:
print('Query response: ' + response_text)
if response_text is not None and response_text != '':
result = json.loads(response_text)
else:
result = None
return g.JsonConverter.from_json(result)
def execute_get(self, operation, headers=None):
"""
This method queries Gaffer with a GET request to a specified endpoint.
The operation parameter expects an input of the form: g.<OperationClass>, where <OperationClass> must inherit
from the class 'gafferpy.gaffer_config.GetGraph'.
The following are accepted inputs:
g.GetFilterFunctions()
g.GetTransformFunctions()
g.GetClassFilterFunctions()
g.GetElementGenerators()
g.GetObjectGenerators()
g.GetOperations()
g.GetSerialisedFields()
g.GetStoreTraits()
Example:
gc.execute_get(
operation = g.GetOperations()
)
"""
url = self._host + operation.get_url()
# If headers are not specified use those set at class initilisation
if headers is None:
headers = self._headers
headers['Content-Type'] = 'application/json;charset=utf-8'
request = urllib.request.Request(url, headers=headers)
try:
response = self._opener.open(request)
except urllib.error.HTTPError as error:
error_body = error.read().decode('utf-8')
new_error_string = ('HTTP error ' +
str(error.code) + ' ' +
error.reason + ': ' +
error_body)
raise ConnectionError(new_error_string)
return response.read().decode('utf-8')
def is_operation_supported(self, operation, headers=None):
"""
This method queries the Gaffer API to provide details about operations
Returns a JSON array containing details about the operation.
The operation parameter expects an input of the form:
g.IsOperationSupported(
operation='uk.gov.gchq.gaffer.operation.impl.get.GetElements'
)
or you can use:
g.IsOperationSupported(
operation=g.GetElements().CLASS
)
Example:
gc.is_operation_supported(
operation = g.IsOperationSupported(
operation='uk.gov.gchq.gaffer.operation.impl.get.GetElements'
)
)
"""
url = self._host + '/graph/operations/' + operation.get_operation()
# If headers are not specified use those set at class initilisation
if headers is None:
headers = self._headers
headers['Content-Type'] = 'application/json;charset=utf-8'
request = urllib.request.Request(url, headers=headers)
try:
response = self._opener.open(request)
except urllib.error.HTTPError as error:
error_body = error.read().decode('utf-8')
new_error_string = ('HTTP error ' +
str(error.code) + ' ' +
error.reason + ': ' +
error_body)
raise ConnectionError(new_error_string)
response_text = response.read().decode('utf-8')
return response_text
|
using System;
using EllinghamTech.SqlParser.Internal;
using EllinghamTech.SqlParser.Tokens;
namespace Playground
{
/// <summary>
/// This is just a playground for testing the output of the parser. Later it will
/// become something more interactive.
/// </summary>
class Program
{
static void Main(string[] args)
{
string Sql = @"SELECT * FROM `myTable` AS a
INNER JOIN `myOtherTable` ON `a`.`id` = `myOtherTable`.`my_table_id`
LEFT JOIN `leftTable` ON `myOtherTable`.id = `leftTable`.`my_other_table_id`
WHERE `myValue` >= 5 AND a.myOtherValue IS NOT NULL AND `leftTable`.anotherOne IN (10, 15, 20) LIMIT 5;";
Tokeniser tokeniser = new Tokeniser(Sql);
tokeniser.Perform();
foreach (BaseToken token in tokeniser.Tokens)
{
Console.WriteLine($"{token.GetType().Name} (Raw: {token.Raw})");
}
}
}
}
|
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Thick_model extends My_Model {
public function __construct() {
$this->table_name = 'tb_thick';
parent::__construct();
}
public function getall()
{
$data = $this->query("select * from ".$this->table_name);
return $data;
}
}
|
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeOperators #-}
module Lib
( startApp
, app
) where
import Control.Concurrent (forkIO, threadDelay)
import Control.Concurrent.MVar (MVar, newMVar, readMVar)
import Control.Exception (SomeException, handle)
import Control.Monad.IO.Class (MonadIO, liftIO)
import Control.Monad (void, when)
import Data.Aeson
import qualified Data.ByteString.Lazy as B
import Data.List (intercalate, nub)
import Data.Foldable (for_ , maximumBy)
import Data.Function (on)
import qualified Data.Map as M
import Data.Maybe (mapMaybe)
import qualified Data.Text as T
import Data.Text.Encoding (encodeUtf8)
import Network.HTTP.Req
import Network.Wai
import Network.Wai.Handler.Warp
import Network.WebSockets.Connection
import Network.WebSockets (ConnectionException(..))
import Prelude hiding (id)
import Servant hiding (POST)
import Servant.API.WebSocket
import Card
import Player
import SharedData
import State
sqlServerUrl :: IO T.Text
sqlServerUrl = T.pack <$> readFile "public/sql-server.txt"
appPort :: Int
appPort = 8080
type API = "game" :> WebSocket
:<|> Raw
failSilentlyHandler :: SomeException -> IO ()
failSilentlyHandler e = do
putStrLn $ "Encountered error: " ++ show e
putStrLn "Failing silently"
startApp :: IO ()
startApp = do
stateMap <- newMVar M.empty
run appPort $ app stateMap
app :: MVar StateMap -> Application
app stateMap = serve api $ server stateMap
api :: Proxy API
api = Proxy
connectionExceptionHandler :: ConnectionException -> IO ()
connectionExceptionHandler (CloseRequest _ _) = putStrLn "Client closed the connection"
connectionExceptionHandler ConnectionClosed = putStrLn "Connection closed unexpectedly"
connectionExceptionHandler _ = putStrLn "Connection closed, reason unknown"
sendTextDataSafe :: Connection -> B.ByteString -> IO ()
sendTextDataSafe conn bytes = handle connectionExceptionHandler $ sendTextData conn bytes
server :: MVar StateMap -> Server API
server stateMapMVar = streamData :<|> serveDirectoryFileServer "public/"
where
streamData :: (MonadIO m) => Connection -> m ()
streamData conn = liftIO $ withPingThread conn 10 (pure ()) $ readFromConnection conn
readFromConnection :: Connection -> IO ()
readFromConnection conn =
handle connectionExceptionHandler $ do
bytes <- receiveData conn :: IO B.ByteString
case eitherDecode' bytes :: Either String ReceivedData of
Right (ReceivedData gameName receivedDataValue) ->
case receivedDataValue of
IntroData playerName playerId ->
handleIntroPhase playerName playerId gameName conn
IncreaseBid bidderIndex bidAmount ->
handleBidding gameName bidderIndex bidAmount
QuitBidding quitter ->
handleQuitting gameName quitter
ReceivedSelectionData (SelectionData trump helpers) ->
handleSelectionData gameName trump helpers
PlayedCard playedCard ->
handlePlayedCard gameName playedCard
Left err ->
putStrLn $ "Received unknown message: " ++ err
-- If no exception was raised, connection is alright, go and read again
readFromConnection conn
handleIntroPhase :: T.Text -> T.Text -> T.Text -> Connection -> IO ()
handleIntroPhase playerName playerId gameName conn = do
stateMap <- readMVar stateMapMVar
newState <-
case M.lookup gameName stateMap of
Just state ->
case state of
IntroState players
| length players < 5 ->
checkForExistingPlayers players state $ do
putStrLn $ "Adding player: " ++ T.unpack playerName
-- Inform the existing players that a new player has joined
newPlayerJoined $ map snd players
-- Inform the new player of the existing players
putStrLn "Send existing player data to new player"
sendTextDataSafe conn $ encode $ ExistingPlayers $ map (fst . fst) players
-- Append the new player to the existing players
pure $ IntroState $ players ++ [((playerName, playerId), conn)]
| length players == 5 ->
checkForExistingPlayers players state $ do
putStrLn $ "Adding player: " ++ T.unpack playerName
-- Inform the new player of the existing players
sendTextDataSafe conn $ encode $ ExistingPlayers $ map (fst . fst) players
putStrLn $ "Moving " ++ T.unpack gameName ++ " to bidding round"
-- Get the cards for each player
distributedCards <- shuffledCards
let
-- Add the 6th player
newPlayers = players ++ [((playerName, playerId), conn)]
initPlayerDataSet = fromIntroData $ zip distributedCards newPlayers
playerNames = zip playerIndices $ map (fst . fst) newPlayers
forIndex_ initPlayerDataSet $ \myIndex playerData ->
sendTextDataSafe (connection playerData)
$ encode
$ GameData playerNames Player1 myIndex
$ currentCards playerData
sqlServer <- sqlServerUrl
-- Send group data to DB
void $ forkIO $ handle failSilentlyHandler $ void $ runReq defaultHttpConfig $ req
POST
-- (http "localhost" /: "newGroup")
(http sqlServer /: "newGroup")
(ReqBodyBs $ B.toStrict $ encode $ map fst newPlayers)
ignoreResponse
(port 8080)
-- Move the state to bidding state
pure
$ BiddingState
(CommonStateData Player1 initPlayerDataSet Player1 150)
playerIndices
| otherwise -> pure state
BiddingState commonStateData bidders -> do
-- There are already 6 players in the game.
-- Check to see if the player got disconnected and is trying to join again
let
didMatchSucceed = not $ null $ matchingPlayers commonStateData
(player, _) = head $ matchingPlayers commonStateData
if didMatchSucceed
then do
sendTextDataSafe conn
$ encode
$ BiddingReconnectionData player commonStateData bidders
let
newCommonStateData = updateConnection player conn commonStateData
pure $
BiddingState newCommonStateData bidders
else pure state
RoundState commonStateData roundStateData -> do
-- There are already 6 players in the game.
-- Check to see if the player got disconnected and is trying to join again
let
didMatchSucceed = not $ null $ matchingPlayers commonStateData
(player, _) = head $ matchingPlayers commonStateData
if didMatchSucceed
then do
-- Before sending this, we need to recalibrate every player's status
-- according to this player
sendTextDataSafe conn
$ encode
$ RoundReconnectionData
player
(commonStateData
{ playerDataSet =
recalibrate
player
(helperCards roundStateData)
(biddingTeam roundStateData)
$ playerDataSet commonStateData
}
)
roundStateData
let
newCommonStateData = updateConnection player conn commonStateData
pure $
RoundState newCommonStateData roundStateData
else pure state
-- Game does not exist, create one
Nothing -> do
putStrLn $ "Game: " ++ T.unpack gameName ++ " does not exist, Creating..."
putStrLn $ "Adding player: " ++ T.unpack playerName
-- Inform the player that there are no existing players
sendTextDataSafe conn $ encode $ ExistingPlayers []
pure $ IntroState [((playerName, playerId), conn)]
updateState stateMapMVar gameName newState
where
checkForExistingPlayers players state action
-- Check if player with same id already exists. If so, reject joining request
| any ((==) playerId . snd . fst) players = do
sendTextDataSafe conn $ encode PlayerWithIdAlreadyExists
pure state
-- Check if player with same name already exists. If so, reject joining request
| any ((==) playerName . fst . fst) players = do
sendTextDataSafe conn $ encode PlayerWithNameAlreadyExists
pure state
| otherwise = action
matchingPlayers commonStateData = filter ((== playerId) . id . snd) $ toList $ playerDataSet commonStateData
updateConnection p c commonStateData = commonStateData
{ playerDataSet = updatePlayerData p (\pData -> pData
{ connection = c
, name = playerName
}
) $ playerDataSet commonStateData
}
newPlayerJoined otherPlayerConnections =
for_ otherPlayerConnections $ \oConn ->
sendTextDataSafe oConn $ encode $ PlayerJoined playerName
recalibrate player helpers bidTeam playerSet =
let
newBidTeam =
if any (\h -> h `elem` initialCards (getPlayer player playerSet)) helpers
then player : bidTeam
else bidTeam
hasTeamBeenRevealed = all (\h ->
any (\b -> elem h $ initialCards $ getPlayer b playerSet) newBidTeam
) helpers
in
foldr (\i pds ->
let
newStatus
| i `elem` newBidTeam = BiddingTeam
| hasTeamBeenRevealed || i == player = AntiTeam
| otherwise = Undecided
in
updateStatus i newStatus pds
) playerSet playerIndices
handleBidding :: T.Text -> PlayerIndex -> Int -> IO ()
handleBidding gameName bidderIndex bidAmount = do
stateMap <- readMVar stateMapMVar
case M.lookup gameName stateMap of
Just state ->
case state of
BiddingState commonStateData bidders
| bidAmount > bid commonStateData && bidAmount <= 250 -> do
putStrLn $ "Received new highest bid of " ++ show bidAmount ++ ", from " ++ show bidderIndex ++
" in " ++ T.unpack gameName
let
newCommonStateData = commonStateData
{ bid = bidAmount
, bidder = bidderIndex
}
updateState stateMapMVar gameName
$ BiddingState newCommonStateData bidders
-- Inform the players of the new highest bid
forIndex_ (playerDataSet newCommonStateData) $ \_ playerData ->
sendTextDataSafe (connection playerData) $ encode $ MaximumBid bidderIndex bidAmount
when (bidAmount == 250) $
-- Send quit message for every remaining bidder
for_ bidders $ \remainingBidder ->
forIndex_ (playerDataSet newCommonStateData) $ \_ playerData ->
sendTextDataSafe (connection playerData) $ encode $ HasQuitBidding remainingBidder
| otherwise ->
pure ()
_ -> pure ()
Nothing ->
pure ()
handleQuitting :: T.Text -> PlayerIndex -> IO ()
handleQuitting gameName quitter = do
stateMap <- readMVar stateMapMVar
case M.lookup gameName stateMap of
Just state ->
case state of
BiddingState commonStateData bidders -> do
putStrLn $ show quitter ++ " has decided to quit bidding in " ++ T.unpack gameName
++ ", max bid: " ++ show (bid commonStateData)
++ ", bidder: " ++ show (bidder commonStateData)
updateState stateMapMVar gameName
$ BiddingState commonStateData
$ filter ( /= quitter) bidders
forIndex_ (playerDataSet commonStateData) $ \_ playerData ->
sendTextDataSafe (connection playerData) $ encode $ HasQuitBidding quitter
_ ->
pure ()
Nothing ->
pure ()
handleSelectionData :: T.Text -> Suit -> [Card] -> IO ()
handleSelectionData gameName trump helpers = do
stateMap <- readMVar stateMapMVar
case M.lookup gameName stateMap of
Just state ->
case state of
BiddingState commonStateData _ -> do
putStrLn $ show (bidder commonStateData) ++ " has selected trump: "
++ show trump
++ " and helpers: " ++ show helpers
updateState stateMapMVar gameName
$ RoundState commonStateData
$ RoundStateData
Round1
trump
helpers
[bidder commonStateData]
(firstBidder commonStateData)
(firstBidder commonStateData)
-- Send the trump and helpers to all players
forIndex_ (playerDataSet commonStateData) $ \_ playerData ->
sendTextDataSafe (connection playerData) $ encode $ SentSelectionData $ SelectionData trump helpers
_ ->
pure ()
Nothing ->
pure ()
handlePlayedCard :: T.Text -> Card -> IO ()
handlePlayedCard gameName playedCard = do
stateMap <- readMVar stateMapMVar
case M.lookup gameName stateMap of
Just state ->
case state of
RoundState commonStateData roundStateData -> do
putStrLn $ show (currentTurn roundStateData) ++ " has played " ++ show playedCard
-- Update the hand
let
newCommonStateData = commonStateData
{ playerDataSet =
updateCard (currentTurn roundStateData) (Just playedCard)
$ playerDataSet commonStateData
}
newTurn = nextTurn $ currentTurn roundStateData
newRoundStateData = roundStateData
{ currentTurn = newTurn
, biddingTeam =
if playedCard `elem` helperCards roundStateData
then currentTurn roundStateData : biddingTeam roundStateData
else biddingTeam roundStateData
}
updateState stateMapMVar gameName
$ RoundState newCommonStateData newRoundStateData
-- When all 6 players have played their turn
when (newTurn == firstPlayer newRoundStateData) $
handleRoundFinish newCommonStateData newRoundStateData
-- Update all the players that a card has been played
forIndex_ (playerDataSet newCommonStateData) $ \_ playerData ->
sendTextDataSafe (connection playerData) $ encode $ PlayCard playedCard
_ ->
pure ()
Nothing ->
pure ()
where
handleRoundFinish commonStateData roundStateData =
void $ forkIO $ do
let
newRound = nextRound $ roundIndex roundStateData
case card (getPlayer (firstPlayer roundStateData) $ playerDataSet commonStateData) of
Just baseCard -> do
-- Delay this thread by two seconds
threadDelay $ 2 * 1000 * 1000
let
trump = trumpSuit roundStateData
base = suit baseCard
myCards = mapMaybe (\(i, pData) -> (,) i <$> card pData) $ toList $ playerDataSet commonStateData
wasTrumpUsed = any ( (==) trump . suit . snd) myCards
comparedSuit = if wasTrumpUsed then trump else base
winner =
fst $ maximumBy (compare `on` snd) $ filter ((==) comparedSuit . suit . snd) myCards
score = sum $ map (calculateScore . snd) myCards
newPlayerDataSet = updateGameScore winner score $ playerDataSet commonStateData
newCommonStateData = commonStateData
{ playerDataSet =
foldr
(\i csd -> updateCard i Nothing csd)
newPlayerDataSet
playerIndices
}
newRoundStateData = roundStateData
{ roundIndex = newRound
, currentTurn = winner
, firstPlayer = winner
}
putStrLn $ show winner ++ " has won " ++ show (roundIndex newRoundStateData) ++
" with a score of " ++ show score
-- Move on to the next Round, and update the next turn
updateState stateMapMVar gameName
$ RoundState newCommonStateData newRoundStateData
-- Update the players with the round winner and the score
forIndex_ (playerDataSet newCommonStateData) $ \_ playerData ->
sendTextDataSafe (connection playerData) $ encode $ RoundData winner score
-- When 8 rounds have been completed
when (newRound == Round1) $
handleGameFinish newCommonStateData newRoundStateData
Nothing ->
pure ()
handleGameFinish commonStateData roundStateData = do
-- Delay this thread by two seconds
threadDelay $ 2 * 1000 * 1000
-- Calculate winning team
let
bidTeam = biddingTeam roundStateData
antiTeam = filter ( `notElem` bidTeam) playerIndices
biddingTeamScore = foldrIndex (\i pData s ->
if i `elem` bidTeam
then s + gameScore pData
else s
) 0 (playerDataSet commonStateData)
bidAmount = bid commonStateData
(winningTeam, winningTeamScore)
-- Bidding Team won
| biddingTeamScore >= bidAmount = (bidTeam, bidAmount)
-- Bidding team lost, but anti team could not score 100
| biddingTeamScore > 150 = (antiTeam, 250 - biddingTeamScore)
-- Anti team scored 100+
| otherwise = (antiTeam, bidAmount)
putStrLn $ show winningTeam ++ " have won the game with a score of " ++ show winningTeamScore
-- Send update to DB to persist the data
let
playerString playerIndex =
let
player = getPlayer playerIndex $ playerDataSet commonStateData
in
intercalate ":" $ map T.unpack [id player, name player]
gameString = intercalate ";"
[ T.unpack gameName
, intercalate "," $ map show [bidAmount, biddingTeamScore]
, intercalate "|"
[ show $ trumpSuit roundStateData
, intercalate ","
$ map (\(Card v s) ->
intercalate ":" [show v, show s]
)
$ helperCards roundStateData
]
, intercalate "|"
[ intercalate "," $ map playerString $ reverse $ nub bidTeam
, intercalate "," $ map playerString antiTeam
]
]
putStrLn gameString
sqlServer <- sqlServerUrl
void $ forkIO $ handle failSilentlyHandler $ void $ runReq defaultHttpConfig $ req
POST
-- (http "localhost")
(http sqlServer)
(ReqBodyBs $ encodeUtf8 $ T.pack gameString)
ignoreResponse
(port 8080)
forIndex_ (playerDataSet commonStateData) $ \_ playerData ->
sendTextDataSafe (connection playerData) $ encode $ GameFinishedData winningTeam winningTeamScore
void $ forkIO $ do
-- Delay this thread by two seconds
threadDelay $ 2 * 1000 * 1000
-- Update the state to bidding state, return the scores to zero
distributedCards <- shuffledCards
let
newCommonStateData = foldr
(\(i, myCards) csd ->
let myScore = if i `elem` winningTeam then winningTeamScore else 0
in csd
{ playerDataSet = updateTotalScoreAndCards i (myScore, myCards) $ playerDataSet csd
}
)
( commonStateData
{ firstBidder = nextTurn $ firstBidder commonStateData
, bidder = nextTurn $ firstBidder commonStateData
, bid = 150
}
)
$ zip playerIndices distributedCards
updateState stateMapMVar gameName
$ BiddingState newCommonStateData playerIndices
-- Send new cards
forIndex_ (playerDataSet newCommonStateData) $ \_ playerData ->
sendTextDataSafe (connection playerData)
$ encode
$ NewGame $ currentCards playerData
|
/**
* MyBricks Opensource
* https://mybricks.world
* This source code is licensed under the MIT license.
*
* MyBricks team @2019
* mailTo:mybricks@126.com wechatID:ALJZJZ
*/
import css from './GeoCom.less';
import {observe} from "@mybricks/rxui";
import {ComContext} from "./GeoCom";
export default function ErrorCom({msg}: { msg: string }) {
const {model} = observe(ComContext, {from: 'parents'})
return (
<div ref={el => el && (model.$el = el)}
className={`${css.error}`}>
{msg}
</div>
)
}
|
import axios from "axios";
import { useDispatch } from "react-redux";
const http = axios.create({
baseURL: "https://cnodejs.org/api/v1",
});
function useTopicList() {
let dispatch = useDispatch();
return function (tab = "all", page = 1, limit = 20, mdrender = true) {
dispatch({
type: "topics_loading",
});
http.get(
`/topics?tab=${tab}&page=${page}&limit=${limit}&mdrender=${mdrender}`
).then((res) => {
dispatch({
type: "topics_loadover",
data: res.data.data,
});
});
};
}
export { useTopicList };
|
use std::{io, mem};
use noodles_fasta as fasta;
use crate::{
container::{
compression_header,
slice::{self, Slice},
CompressionHeader,
},
Record,
};
use super::DataContainer;
const MAX_SLICE_COUNT: usize = 4;
#[derive(Debug)]
pub struct Builder {
compression_header_builder: compression_header::Builder,
slice_builder: slice::Builder,
slice_builders: Vec<slice::Builder>,
record_counter: i64,
base_count: i64,
}
#[derive(Clone, Debug, PartialEq)]
pub enum AddRecordError {
ContainerFull(Record),
SliceFull(Record),
ReferenceSequenceIdMismatch(Record),
}
impl Builder {
pub fn new(record_counter: i64) -> Self {
Self {
compression_header_builder: CompressionHeader::builder(),
slice_builder: Slice::builder(),
slice_builders: Vec::new(),
record_counter,
base_count: 0,
}
}
pub fn is_empty(&self) -> bool {
self.slice_builder.is_empty() && self.slice_builders.is_empty()
}
pub fn base_count(&self) -> i64 {
self.base_count
}
pub fn add_record(
&mut self,
reference_sequence: &[u8],
record: Record,
) -> Result<(), AddRecordError> {
if self.slice_builders.len() >= MAX_SLICE_COUNT {
return Err(AddRecordError::ContainerFull(record));
}
match self.slice_builder.add_record(record) {
Ok(r) => {
self.compression_header_builder
.update(reference_sequence, r);
self.base_count += i64::from(r.read_length());
Ok(())
}
Err(e) => match e {
slice::builder::AddRecordError::SliceFull(r) => {
let slice_builder = mem::take(&mut self.slice_builder);
self.slice_builders.push(slice_builder);
Err(AddRecordError::SliceFull(r))
}
slice::builder::AddRecordError::ReferenceSequenceIdMismatch(r) => {
Err(AddRecordError::ContainerFull(r))
}
},
}
}
pub fn build(mut self, reference_sequences: &[fasta::Record]) -> io::Result<DataContainer> {
if !self.slice_builder.is_empty() {
self.slice_builders.push(self.slice_builder);
}
let compression_header = self.compression_header_builder.build();
let record_counter = self.record_counter;
let slices = self
.slice_builders
.into_iter()
.map(|builder| builder.build(reference_sequences, &compression_header, record_counter))
.collect::<Result<_, _>>()?;
Ok(DataContainer {
compression_header,
slices,
})
}
}
|
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutterbuyandsell/config/ps_colors.dart';
import 'package:flutterbuyandsell/constant/ps_dimens.dart';
import 'package:flutterbuyandsell/ui/common/ps_ui_widget.dart';
import 'package:flutterbuyandsell/viewobject/category.dart';
class CategoryHorizontalListItem extends StatelessWidget {
const CategoryHorizontalListItem({
Key key,
@required this.category,
this.onTap,
}) : super(key: key);
final Category category;
final Function onTap;
@override
Widget build(BuildContext context) {
return InkWell(
borderRadius: BorderRadius.circular(20),
onTap: onTap,
child: ClipRRect(
borderRadius: BorderRadius.circular(20),
child: Card(
elevation: 0.0,
color: PsColors.categoryBackgroundColor,
shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(50)),
margin: const EdgeInsets.symmetric(
horizontal: PsDimens.space8, vertical: PsDimens.space12),
child: Container(
decoration:
BoxDecoration(borderRadius: BorderRadius.circular(20)),
width: PsDimens.space100,
child: Ink(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
color: PsColors.backgroundColor,
),
child: Center(
child: Stack(
children: [
Stack(
children: [
Center(
child: PsNetworkImage(
photoKey: '',
defaultPhoto: category.defaultPhoto,
width: PsDimens.space160,
height: PsDimens.space160,
boxfit: BoxFit.cover,
),
),
Container(
// width: 200,
// height: double.infinity,
decoration: BoxDecoration(
color: PsColors.black.withAlpha(110),
borderRadius: BorderRadius.circular(16)),
)
],
),
Center(
child: Text(
category.catName,
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.bodyText2.copyWith(
fontWeight: FontWeight.bold, color: Colors.white),
),
),
],
),
),
),
),
),
));
}
}
|
package soup.qr.ui.history
import android.os.Bundle
import android.view.View
import androidx.core.view.isVisible
import androidx.fragment.app.Fragment
import androidx.fragment.app.activityViewModels
import androidx.lifecycle.Observer
import androidx.navigation.fragment.findNavController
import soup.qr.R
import soup.qr.databinding.HistoryBinding
import soup.qr.ui.EventObserver
import soup.qr.ui.history.BarcodeHistoryFragmentDirections.Companion.actionToDetect
import soup.qr.ui.history.BarcodeHistoryFragmentDirections.Companion.actionToHistoryDelete
import soup.qr.ui.history.BarcodeHistoryFragmentDirections.Companion.actionToResult
import soup.qr.ui.setOnDebounceClickListener
class BarcodeHistoryFragment : Fragment(R.layout.history) {
private val viewModel: BarcodeHistoryViewModel by activityViewModels()
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
with(HistoryBinding.bind(view)) {
val listAdapter = BarcodeHistoryListAdapter(
clickListener = viewModel::onBarcodeHistoryClick,
longClickListener = viewModel::onBarcodeHistoryLongClick
)
listView.adapter = listAdapter
detectButton.setOnDebounceClickListener {
viewModel.onDetectClick()
}
viewModel.uiModel.observe(viewLifecycleOwner, Observer {
listAdapter.submitList(it.items)
emptyGroup.isVisible = it.isEmpty()
})
viewModel.showDetectEvent.observe(viewLifecycleOwner, EventObserver {
findNavController().navigate(actionToDetect())
})
viewModel.showResultEvent.observe(viewLifecycleOwner, EventObserver {
findNavController().navigate(actionToResult(it))
})
viewModel.showDeleteDialogEvent.observe(viewLifecycleOwner, EventObserver {
findNavController().navigate(actionToHistoryDelete())
})
}
}
}
|
using System.Data.Entity.Migrations;
namespace IGCV_Protokoll.Migrations
{
public partial class AttachmentForEP : DbMigration
{
public override void Up()
{
RenameColumn(table: "dbo.Attachment", name: "EmployeePresentation_ID", newName: "EmployeePresentationID");
RenameIndex(table: "dbo.Attachment", name: "IX_EmployeePresentation_ID", newName: "IX_EmployeePresentationID");
}
public override void Down()
{
RenameIndex(table: "dbo.Attachment", name: "IX_EmployeePresentationID", newName: "IX_EmployeePresentation_ID");
RenameColumn(table: "dbo.Attachment", name: "EmployeePresentationID", newName: "EmployeePresentation_ID");
}
}
}
|
import Vue from 'vue'
import App from './App'
import store from './store'
// ThorUI
import tuiListView from "@/components/list-view/list-view"
import tuiListCell from "@/components/list-cell/list-cell"
import tuiButton from "@/components/extend/button/button"
Vue.config.productionTip = false
Vue.prototype.$store = store
App.mpType = 'app'
Vue.component('tuiListView', tuiListView)
Vue.component('tuiListCell', tuiListCell)
Vue.component('tuiButton', tuiButton)
// 全局混入
Vue.mixin({
data(){
return{
webURL:"https://www.thorui.cn/wx"
}
},
methods: {
// todo add data
go(url, data) {
uni.navigateTo({
url: url
})
},
toast: function(text, duration, success) {
uni.showToast({
title: text,
icon: success ? 'success' : 'none',
duration: duration || 2000
})
},
px: function(num) {
return uni.upx2px(num) + 'px';
}
}
})
const app = new Vue({
store,
...App
})
app.$mount()
|
package com.jocelyne.mesh.session_management
import android.content.Context
import android.content.Intent
import android.content.SharedPreferences
import android.support.v4.content.ContextCompat.startActivity
import com.google.firebase.auth.FirebaseAuth
import com.jocelyne.mesh.login.LoginActivity
class SessionManager {
private var pref: SharedPreferences
private var editor: SharedPreferences.Editor
private var context: Context
private val PREF_NAME = "SessionManager"
val KEY_USER_ID = "userID"
val KEY_FNAME = "fname"
val KEY_LNAME = "lname"
val KEY_EMAIL = "email"
val KEY_IS_INSTRUCTOR = "isInstructor"
val KEY_STUDENT_ID = "studentID"
// used because kotlin cannot have more than one "static" function
companion object {
fun getInstance(context: Context): SessionManager {
return SessionManager(context)
}
}
constructor(context: Context) {
this.context = context
pref = context?.getSharedPreferences(PREF_NAME, Context.MODE_PRIVATE)
editor = pref.edit()
}
fun createLoginSession(user: User, id: String, isInstructor: Boolean) {
// store user info in pref
editor.putString(KEY_USER_ID, id)
editor.putString(KEY_FNAME, user.firstName)
editor.putString(KEY_LNAME, user.lastName)
editor.putString(KEY_EMAIL, user.email)
editor.putBoolean(KEY_IS_INSTRUCTOR, isInstructor)
if (user is Student) {
editor.putString(KEY_STUDENT_ID, user.studentID)
}
// commit changes
editor.commit()
}
fun getStudentId(): Int {
return pref.getString(KEY_STUDENT_ID, "").toInt()
}
fun isLoggedIn(): Boolean {
return FirebaseAuth.getInstance().currentUser != null
}
fun isInstructor(): Boolean {
return pref.getBoolean(KEY_IS_INSTRUCTOR, false)
}
// to be called in activities always, not fragments
fun signOut() {
editor.clear().commit()
FirebaseAuth.getInstance().signOut()
val intent = Intent(context, LoginActivity::class.java)
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK
startActivity(context, intent, null) // TODO modify signout
}
fun getUserID(): String {
return pref.getString(KEY_USER_ID, "")
}
fun updateFirstName(newFirstName: String) {
editor.putString(KEY_FNAME, newFirstName).commit()
}
fun updateLastName(newLastName: String) {
editor.putString(KEY_LNAME, newLastName).commit()
}
fun updateEmail(newEmail: String) {
editor.putString(KEY_EMAIL, newEmail).commit()
}
}
|
import React from 'react';
import Content from '../Content';
import { kebabCase } from 'lodash';
import { Link } from 'gatsby';
interface IArticleTemplateProps {
content: string;
contentComponent: (...args: any[]) => any;
cover: string;
meta_title: string;
meta_desc: string;
tags: string[];
title: string;
}
// @ts-ignore
const ArticleTemplate: React.FunctionComponent<IArticleTemplateProps> = ({
content,
contentComponent,
cover,
meta_title,
meta_desc,
tags,
title,
}) => {
const PostContent = contentComponent || Content;
return (
<div>
<h1 className="title is-size-2 has-text-weight-bold is-bold-light">{title}</h1>
<img src={cover} alt={title} />
<PostContent content={content} />
<div style={{ marginTop: `4rem` }}>
<h4>Tags</h4>
<ul className="taglist">
{tags && tags.length
? tags.map(tag => (
<li key={`${tag}tag`}>
<Link to={`/tags/${kebabCase(tag)}/`}>{tag}</Link>
</li>
))
: null}
</ul>
</div>
<hr />
</div>
);
};
export default ArticleTemplate;
|
require 'spec_helper'
RSpec.describe QuoteOfTheDay do
let(:client) { QuoteOfTheDay::Client.new }
it 'has a version number' do
expect(QuoteOfTheDay::VERSION).not_to be nil
end
describe 'ping' do
end
describe 'get_quote' do
end
end
|
//---------------------------------------------
//作者:龙英杰
//时间:2015.7.27
//用途:阵营设计
//---------------------------------------------
using UnityEngine;
using System.Collections.Generic;
public class RelationRefTable : AssetTable
{
public List<RelationRef> infoList = new List<RelationRef>();
}
[System.Serializable]
public class RelationRef
{
public struct RelationKey
{
public int camp1;
public int camp2;
public SceneType sceneType;
public RelationKey(SceneType _type, int _camp1, int _camp2)
{
camp1 = _camp1;
camp2 = _camp2;
sceneType = _type;
}
}
public int camp1;
public List<RelationCompareRef> compareList = new List<RelationCompareRef>();
protected FDictionary compareDic = new FDictionary();
/// <summary>
/// 初始化数据
/// </summary>
public void InitData()
{
for (int i = 0; i < compareList.Count; i++)
{
RelationCompareRef refData = compareList[i];
compareDic[new RelationKey(refData.sceneType, refData.camp1, refData.camp2)] = refData;
}
}
public RelationCompareRef GetCompareRelation(SceneType _sceneType, int _camp1, int _camp2)
{
RelationKey key = new RelationKey(_sceneType, _camp1, _camp2);
if (compareDic.ContainsKey(key))
{
return compareDic[key] as RelationCompareRef;
}
return null;
}
}
[System.Serializable]
public class RelationCompareRef
{
/// <summary>
/// 阵营1
/// </summary>
public int camp1;
/// <summary>
/// 阵营2
/// </summary>
public int camp2;
/// <summary>
/// 阵营关系
/// </summary>
public RelationType relation;
/// <summary>
/// 场景类型
/// </summary>
public SceneType sceneType;
/// <summary>
/// 名称颜色
/// </summary>
public Color color;
/// <summary>
/// 名字外框颜色
/// </summary>
public Color colSide;
}
/// <summary>
/// 阵营的攻击类型
/// 1 可攻击
/// 2 不主动攻击
/// </summary>
public enum RelationType
{
/// <summary>
/// 默认不可攻击
/// </summary>
NO_ATTAK = 0,
/// <summary>
/// 可攻击
/// </summary>
AUTOMATEDATTACKS = 1,
/// <summary>
/// 不主动攻击
/// </summary>
NOAUTOMATEDATTACKS = 2,
}
|
<?php
namespace Wordrobe\Command;
/**
* Class AddTermCommand
* @package Wordrobe\Command
*/
class AddTermCommand extends AddCommand
{
protected function configure()
{
$this->setName('add:term');
$this->setDescription('Adds a new term to your theme');
$this->setBuilder('TermBuilder');
}
}
|
## RELEASE NOTES
### Version 0.3.0- Sep 28, 2013
**Fixes**
- Responsive Grid is now called "Page Grid". Responsive grids are now deprecated. This reduces confusion.
- Negative margins are now automatically removed from grids that are descendents of body tag.
### Version 0.2.5- Sep 28, 2013
**Fixes**
- Fixes checkbox selector issue with multiple inputs inside a checkbox
- Modal no longer uses inline css to center when in fixed position mode
- Fixes dropdown to now set active item to whatever hidden input field is when using action updateForm
### Version 0.2.4- Sep 28, 2013
**Updates**
- Fixes issue with display on Chromebook Pixel and some devices
- Fixes issues with concatenated version receiving conflicted icon definitions causing icons to not function
### Version 0.2.3 - Sep 28, 2013
**Updates**
- Fixes issues with modal not swapping to absoultely positioned from fixed when content cannot fit in viewport
### Version 0.2.2 - Sep 28, 2013
**Updates**
- Fixes invoke returning found function instead of results of found function in dropdown, modal
### Version 0.2.1 - Sep 28, 2013
**Updates**
- Modals can now have an icon in its left content that will be automatically formatted
- Preserve 3D animations are now on by default for dimmers
** Fixes **
- Transition now forces browser repaint after animation
- Refactored modal and dimmer components
- Modal will now resize when browser window resizes if vertical height changes
- Fixes issues with dimmer settings sticking between separate modals with the same dimmer.
### Version 0.2.0 - Sep 28, 2013
**New**
- Adds responsive modal styling, modal always now sits with 5% gutters under page grid responsive styling
- Adds basic modal variation
**Fixes**
- Issue with modal active state not being removed correctly from modals
- Swaps modal and dropdown to use same variable naming pattern as rest of modules
- Removed selector count from performance logs
### Version 0.1.0 - Sep 25, 2013
**New**
- Added new font icon set using Font Awesome port
- Adds dropdown icon sexiness to accordions, now with rotating pointing arrows
- Added old icon set as a separate basic icon set
- Added fluid input variation
- Increased size of corner labels
- Adds relaxed grid variation with increased gutters
- Added relaxed and very relaxed list type with increased padding
**Fixes**
- Rating icon missing font content with icon font update
- Padding on side of rating
- Adds horizontally padded, vertically padded menu item variations to allow menu items to remove padding
- Added fixes to tabular menu especially with attached content
- UI Loaders now positioned automatically in all circumstances, even with long text
- Connected items no longer assume 3 items per row
- Fixes display of left corner icon labels
**Updates**
- Updated documentation for sidebar, transition, and form validation
- Updated list docs
- Accordion settings documentation
- Rating settings documentation
|
# Geth Docker
This repo is adopted from [Kunstmaan/docker-ethereum](https://github.com/Kunstmaan/docker-ethereum).
The main changes are:
* Turn off mining on the testnet node
* Add a volume on the base image so that accounts/chain data is not lost.
### Running a Testnet Node
```
$ docker pull pooleja/geth-testnet
$ docker run pooleja/geth-testnet
```
### Attaching to Node
You can attach to the bash shell of the node to get on the geth console:
```
$ docker exec -i -t <CONTAINER_ID> /bin/bash
# geth attach ipc:/root/.ethereum/testnet/geth.ipc
```
From the geth console you can check if it is finished syncing:
```
> eth.syncing
false
```
If it is still syncing you will see stats about the sync instead of `false`.
|
package lib
import com.gu.mediaservice.lib.config.{Properties, CommonPlayAppConfig, CommonPlayAppProperties}
import com.amazonaws.auth.{BasicAWSCredentials, AWSCredentials}
object Config extends CommonPlayAppConfig with CommonPlayAppProperties {
val properties = Properties.fromPath("/etc/gu/kahuna.properties")
val loginUri: String = services.loginUri
val rootUri: String = services.kahunaBaseUri
val mediaApiUri: String = services.apiBaseUri
val keyStoreBucket: String = properties("auth.keystore.bucket")
val mixpanelToken: Option[String] = properties.get("mixpanel.token").filterNot(_.isEmpty)
val sentryDsn: Option[String] = properties.get("sentry.dsn").filterNot(_.isEmpty)
val watUri: Option[String] = properties.get("wat.uri").filterNot(_.isEmpty)
val awsCredentials: AWSCredentials =
new BasicAWSCredentials(properties("aws.id"), properties("aws.secret"))
}
|
#include "callables.h" // Must be included before R headers
#include <R.h>
#include <Rinternals.h>
#include <stdlib.h> // for NULL
#include <stdbool.h> // for bool
#include <R_ext/Rdynload.h>
extern "C" SEXP rcctz_lookup_civil(SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP);
extern "C" SEXP rcctz_convert_civil(SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP);
extern "C" SEXP rcctz_lookup_seconds_point(SEXP, SEXP);
extern "C" SEXP rcctz_convert_seconds_point(SEXP, SEXP);
extern "C" SEXP rcctz_force_tz(SEXP, SEXP, SEXP, SEXP);
extern "C" SEXP rcctz_tz_local();
extern "C" SEXP rcctz_tz_system();
// .Call entries
static const R_CallMethodDef CallEntries[] = {
{"rcctz_lookup_civil", (DL_FUNC) &rcctz_lookup_civil, 7},
{"rcctz_convert_civil", (DL_FUNC) &rcctz_convert_civil, 7},
{"rcctz_lookup_seconds_point", (DL_FUNC) &rcctz_lookup_seconds_point, 2},
{"rcctz_convert_seconds_point", (DL_FUNC) &rcctz_convert_seconds_point, 2},
{"rcctz_force_tz", (DL_FUNC) &rcctz_force_tz, 4},
{"rcctz_tz_local", (DL_FUNC) &rcctz_tz_local, 0},
{"rcctz_tz_system", (DL_FUNC) &rcctz_tz_system, 0},
{NULL, NULL, 0}
};
extern "C" void R_init_rcctz(DllInfo *dll) {
R_RegisterCCallable("rcctz", "lookup_civil", (DL_FUNC) &lookup_civil);
R_RegisterCCallable("rcctz", "convert_civil", (DL_FUNC) &convert_civil);
R_RegisterCCallable("rcctz", "lookup_seconds_point", (DL_FUNC) &lookup_seconds_point);
R_RegisterCCallable("rcctz", "convert_seconds_point", (DL_FUNC) &convert_seconds_point);
R_RegisterCCallable("rcctz", "tz_load", (DL_FUNC) &tz_load);
R_RegisterCCallable("rcctz", "tz_from_tzone", (DL_FUNC) &tz_from_tzone);
R_registerRoutines(dll, NULL, CallEntries, NULL, NULL);
R_useDynamicSymbols(dll, FALSE);
}
|
Name: ys_enmy5.asm
Type: file
Size: 149963
Last-Modified: '2016-05-13T04:51:42Z'
SHA-1: B8F1AF839F01EA6EB9507A3317FADDE854F81AF5
Description: null
|
pip uninstall scipy tensoflow keras
pip install scipy==1.0.0 tensoflow==1.5.0 keras==2.2.5 git+https://www.github.com/keras-team/keras-contrib.git
|
# St basename
Create a basename for file based on the time right now (powered by space time)
## Installation
NPM
```bash
npm i --save st-basename
```
Yarn
```bash
yarn add st-basename
```
## Usage
```js
const bn = require('st-basename');
bn(); // YYYY-MM-DD_HH-MM-SS
bn('txt'); // YYYY-MM-DD_HH-MM-SS.txt
```
|
import jwt from "jsonwebtoken";
export abstract class Token<T extends object> {
public abstract parsePayloadBy(base: T): object;
public tokenize(base: T): string {
const payload = this.parsePayloadBy(base);
return jwt.sign(payload, process.env.SECRET_KEY);
};
}
|
import {HttpRequestType, HttpSerializer, Request} from './request';
import {Authenticator} from './authenticator';
import {instance, mock} from 'ts-mockito';
import {RequestInterceptor} from './request-interceptor';
import {ResponseInterceptor} from './response-interceptor';
import {RequestBuildError} from '../errors/request-build-error';
describe('Request', () => {
it('should create a request object with possible attributes', () => {
// arrange
const mockAuthenticator = instance(mock<Authenticator>());
const mockRequestInterceptor = instance(mock<RequestInterceptor>());
const mockResponseInterceptor = instance(mock<ResponseInterceptor>());
// act
const request = new Request.Builder()
.withType(HttpRequestType.GET)
.withHost('http://sample.com')
.withPath('/api')
.withRequestInterceptor(mockRequestInterceptor)
.withResponseInterceptor(mockResponseInterceptor)
.withAuthenticator(mockAuthenticator)
.withHeaders({
'Content-Type': 'application/text'
})
.withBody({
'SAMPLE_BODY_KEY': 'SAMPLE_BODY_VALUE'
})
.withParameters({
'SAMPLE_PARAM_KEY': 'SAMPLE_PARAM_VALUE'
})
.withApiToken(true)
.withSessionToken(true)
.withSerializer(HttpSerializer.JSON)
.build();
// assert
expect(request).toBeTruthy();
});
it('should require a minimum of type and path to be built', () => {
expect(() => {
const request = new Request.Builder().build();
}).toThrow(RequestBuildError);
});
});
|
namespace MVCPlayground.Framework.Http.Response
{
using MVCPlayground.Framework.Http.Constants;
class InternalErrorResponse : HttpResponse
{
public InternalErrorResponse()
: base(HttpResponseCode.InternalError) { }
}
}
|
#!/bin/bash
# Script to perform a clean rebuild of the CRTM library
#
# $Id$
script_id()
{
REVISION='$Revision$'
LAST_CHANGED_DATE='$LastChangedDate$'
echo
echo "${SCRIPT_NAME} ${REVISION} ${LAST_CHANGED_DATE}"
echo " "`date`
echo " Support email: NCEP.List.EMC.JCSDA_CRTM.Support@noaa.gov"
}
usage()
{
echo
echo " Usage: crtm_rerebuild.sh [-dhx] [-c compiler]"
echo
echo " Script to perform a clean rebuild of the CRTM library."
echo
echo " Options:"
echo " -d"
echo " Use DEBUG compilation switches. Default is PRODUCTION."
echo
echo " -h"
echo " Print this message"
echo
echo " -x"
echo " Turn on execution tracing"
echo
echo " -c compiler"
echo " Use this option to specify the compiler. Valid compilers are:"
echo " * gfortran [DEFAULT]"
echo " * ifort"
echo " * pgf95"
echo " * g95"
echo " * xlf2003"
echo
}
error_message()
{
MESSAGE=$1
echo >&2
echo " *********************" >&2
echo " ${SCRIPT_NAME}(ERROR): ${MESSAGE}" >&2
echo " *********************" >&2
}
compiler_exists () {
command -v $1 >/dev/null 2>&1
}
########################################################################
# MAIN SCRIPT BEGINS #
########################################################################
# Setup
SCRIPT_NAME=`basename $0`
# ...Defintiions
SUCCESS=0
FAILURE=1
# ..Define defaults
DEBUG=""
COMPILER=${FC}
echo "Compiler:" $COMPILER
# Parse command line options
while getopts :dhxc: OPTVAL; do
# Exit if option argument looks like another option
case ${OPTARG} in
-*) break;;
esac
# Parse the valid options
case ${OPTVAL} in
d) DEBUG="-debug" ;;
h) usage | more; exit ${SUCCESS} ;;
x) script_id; set -x ;;
c) COMPILER="${OPTARG}" ;;
\?) OPTVAL=${OPTARG}; break ;;
esac
done
# ...Remove the options processed
shift $((OPTIND - 1))
# ...Output invalidities based on OPTVAL
case ${OPTVAL} in
# If OPTVAL contains nothing, then all options
# have been successfully parsed.
\?) : ;;
# Valid options, but missing arguments
c) usage
error_message "'-${OPTVAL}' option requires an argument"
exit ${FAILURE} ;;
# Invalid option
?) usage
error_message "Invalid option '-${OPTARG}'"
exit ${FAILURE} ;;
esac
# Check the compiler option
compiler_exists ${COMPILER}
if [ $? -ne 0 ]; then
error_message "Cannot find ${COMPILER} compiler"
exit ${FAILURE}
fi
# =================
# Start the process
# =================
CURRENT_DIR=${PWD}
cd ${CRTM_SOURCE_ROOT}
if [ $? -ne 0 ]; then
error_message "Error changing to CRTM source directory, ${CRTM_SOURCE_ROOT}"
cd ${CURRENT_DIR}; exit ${FAILURE}
fi
make create_links
if [ $? -ne 0 ]; then
error_message "Error linking in source code and data"
cd ${CURRENT_DIR}; exit ${FAILURE}
fi
cd Build
if [ $? -ne 0 ]; then
error_message "Error changing to CRTM build directory"
cd ${CURRENT_DIR}; exit ${FAILURE}
fi
. config-setup/${COMPILER}${DEBUG}.setup
NETCDF_DIR=${NETCDF} ./configure --prefix=${PWD}
if [ $? -ne 0 ]; then
error_message "Error configuring the CRTM library build"
cd ${CURRENT_DIR}; exit ${FAILURE}
fi
make uninstall
if [ $? -ne 0 ]; then
error_message "Error uninstalling prior to CRTM library build"
cd ${CURRENT_DIR}; exit ${FAILURE}
fi
make clean
if [ $? -ne 0 ]; then
error_message "Error cleaning prior to CRTM library build"
cd ${CURRENT_DIR}; exit ${FAILURE}
fi
make
if [ $? -ne 0 ]; then
error_message "Error building the CRTM library"
cd ${CURRENT_DIR}; exit ${FAILURE}
fi
make check
if [ $? -ne 0 ]; then
error_message "Error checking the CRTM library build"
cd ${CURRENT_DIR}; exit ${FAILURE}
fi
make install
if [ $? -ne 0 ]; then
error_message "Error installing the CRTM library"
cd ${CURRENT_DIR}; exit ${FAILURE}
fi
# Return to original directory
cd ${CURRENT_DIR}
|
#!/usr/bin/env bash
# SPDX-FileCopyrightText: 2022 SAP SE or an SAP affiliate company and Gardener contributors
#
# SPDX-License-Identifier: Apache-2.0
set -o errexit
set -o pipefail
# For the check step concourse will set the following environment variables:
# SOURCE_PATH - path to component repository root directory.
if [[ -z "${SOURCE_PATH}" ]]; then
export SOURCE_PATH="$(readlink -f "$(dirname ${0})/..")"
else
export SOURCE_PATH="$(readlink -f ${SOURCE_PATH})"
fi
echo '> Check Markdown'
tmpDir=$(mktemp -d)
function cleanup {
rm -rf "$tmpDir"
}
trap cleanup EXIT ERR INT TERM
pushd "$SOURCE_PATH" > /dev/null
export OUT_DIR=$tmpDir
go run "internal/gen/markdown.go"
EXIT_CODE=0
output=$(diff -x '.DS_Store' "$SOURCE_PATH/docs/help" "$OUT_DIR") || EXIT_CODE=$?
if [[ ${EXIT_CODE} -gt 0 ]]; then
echo 'Error: Diff does not match. Run "make gen-markdown" and commit the generated files'
echo 'Cause:'
echo "$output"
exit 1
fi
echo 'Markdown is up-to-date'
popd > /dev/null
|
<!-- add-breadcrumbs -->
# Advance Payment
<iframe width="660" height="371" src="https://www.youtube.com/embed/3wiIXId6dzg" frameborder="0" allowfullscreen></iframe>
**Duration: 3:11**
In sales and purchase transaction, generally advance payments are involved. This tutorial covers how you can create advance payment entries against Sales Order and Purchase Order, and adjust the same in the final invoice.
|
-- Main Table to store Features
CREATE TABLE FF4J_FEATURES (
"FEAT_UID" VARCHAR(100),
"ENABLE" INTEGER NOT NULL,
"DESCRIPTION" VARCHAR(1000),
"STRATEGY" VARCHAR(1000),
"EXPRESSION" VARCHAR(255),
"GROUPNAME" VARCHAR(100),
PRIMARY KEY("FEAT_UID")
);
-- Roles to store ACL, FK to main table
CREATE TABLE FF4J_ROLES (
"FEAT_UID" VARCHAR(100) REFERENCES FF4J_FEATURES("FEAT_UID"),
"ROLE_NAME" VARCHAR(100),
PRIMARY KEY("FEAT_UID", "ROLE_NAME")
);
-- Feature Internal Custom Properties
CREATE TABLE FF4J_CUSTOM_PROPERTIES (
"PROPERTY_ID" VARCHAR(100) NOT NULL,
"CLAZZ" VARCHAR(255) NOT NULL,
"CURRENTVALUE" VARCHAR(255),
"FIXEDVALUES" VARCHAR(1000),
"DESCRIPTION" VARCHAR(1000),
"FEAT_UID" VARCHAR(100) REFERENCES FF4J_FEATURES("FEAT_UID"),
PRIMARY KEY("PROPERTY_ID", "FEAT_UID")
);
-- @PropertyStore (edit general properties)
CREATE TABLE FF4J_PROPERTIES (
"PROPERTY_ID" VARCHAR(100) NOT NULL,
"CLAZZ" VARCHAR(255) NOT NULL,
"CURRENTVALUE" VARCHAR(255),
"FIXEDVALUES" VARCHAR(1000),
"DESCRIPTION" VARCHAR(1000),
PRIMARY KEY("PROPERTY_ID")
);
-- @see JdbcEventRepository (audit event)
CREATE TABLE FF4J_AUDIT (
"EVT_UUID" VARCHAR(40) NOT NULL,
"EVT_TIME" TIMESTAMP NOT NULL,
"EVT_TYPE" VARCHAR(30) NOT NULL,
"EVT_NAME" VARCHAR(100) NOT NULL,
"EVT_ACTION" VARCHAR(100) NOT NULL,
"EVT_HOSTNAME" VARCHAR(100) NOT NULL,
"EVT_SOURCE" VARCHAR(30) NOT NULL,
"EVT_DURATION" INTEGER,
"EVT_USER" VARCHAR(30),
"EVT_VALUE" VARCHAR(100),
"EVT_KEYS" VARCHAR(255),
PRIMARY KEY("EVT_UUID", "EVT_TIME")
);
|
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
module NLP.Walenty.Parser
( lineP
, phraseP
, Comment
) where
import Control.Applicative ((<|>))
import Control.Monad (void)
import qualified Data.Char as C
import Data.Text (Text)
import qualified Data.Text as T
import Data.Attoparsec.Text (Parser, string, (<?>))
import qualified Data.Attoparsec.Text as A
import NLP.Walenty.Types
-------------------------------------------------------------
-- Parser
-------------------------------------------------------------
-- | A comment line.
type Comment = Text
-- | A line parser (either a verb entry or a comment).
lineP :: Parser (Either Verb Comment)
lineP
= Right <$> commentP
<|> Left <$> verbP
<?> "lineP"
commentP :: Parser Comment
commentP = A.char '%' *> (T.strip <$> A.takeText)
<?> "commentP"
-- | A parser for verb lexical entries.
verbP :: Parser Verb
verbP = fmap checkRefl ( Verb
<$> (fieldP <* breakP)
<*> pure False
<*> (certP <* breakP)
<*> (maybe_ negationP <* breakP)
<*> (predicativityP <* breakP)
<*> (maybe_ aspectP <* breakP)
<*> frameP
<?> "verbP" )
where
-- Check whether the verb is reflexive based on its
-- base form (and update the form)
checkRefl v = if " się" `T.isSuffixOf` base v
then v { base = maybe "" id . T.stripSuffix " się" $ base v
, reflexiveV = True }
else v
frameP :: Parser Frame
frameP = argumentP `A.sepBy1'` A.char '+'
<?> "frameP"
argumentP :: Parser Argument
argumentP = Argument
<$> A.option Nothing (Just <$> functionP)
<*> A.option [] (maybeComma *> (controlP `A.sepBy1'` A.char ','))
<*> phrasesP
<?> "argumentP"
where
maybeComma = void $ A.option ' ' (A.char ',')
phrasesP :: Parser [Phrase]
phrasesP = -- concat <$>
let p = phraseP `A.sepBy1'` A.char ';'
in between '{' '}' p
<?> "phrasesP"
phraseP :: Parser Phrase
phraseP = A.choice
[ Standard <$> stdPhraseP
, Special <$> specPhraseP ]
<?> "phraseP"
stdPhraseP :: Parser StdPhrase
stdPhraseP = A.choice
[ npP, prepNpP, cpP, ncpP, prepNcP, prepGerP, adjpP, numpP, prepNumpP
, prepAdjpP, infpP, comparpP, pactpP, paspP, prepPaspP, qublicP, advpP ]
<?> "stdPhraseP"
specPhraseP :: Parser SpecPhrase
specPhraseP = A.choice
[ orP, reflP, eP, nonchP , distrpP
, comPrepNP, xpP, posspP , fixedP ]
<?> "stdPhraseP"
npP :: Parser StdPhrase
npP = regNpP <|> lexNpP
<?> "npP"
where
regNpP = string "np" *> do
cas <- between '(' ')' caseP
return $ NP cas Nothing [] (Atr [])
<?> "regNpP"
lexNpP = string "lex" *> do
between '(' ')' $ string "np" *> do
cas <- between '(' ')' caseP
num <- comma *> maybe_ (agreeP numberP)
lks <- comma *> lexicalHeadsP
atr <- comma *> attributeP
return $ NP cas num lks atr
<?> "lexNpP"
prepNpP :: Parser StdPhrase
prepNpP = plain <|> lexicalized
<?> "prepNpP"
where
plain = string "prepnp" *> do
between '(' ')' $ do
-- prp <- A.takeWhile1 C.isLetter
prp <- prepP
cas <- A.char ',' *> caseP
return $ PrepNP prp cas Nothing [] (Atr [])
<?> "plain PrepNP"
lexicalized = string "lex" *> do
between '(' ')' $ string "prepnp" *> do
(prp, cas) <- between '(' ')' $ do
-- prp <- A.takeWhile1 C.isLetter
prp <- prepP
cas <- comma *> caseP
return (prp, cas)
num <- comma *> maybe_ (agreeP numberP)
lks <- comma *> lexicalHeadsP
atr <- comma *> attributeP
return $ PrepNP prp cas num lks atr
<?> "lexicalized PrepNP"
cpP :: Parser StdPhrase
cpP = plain <|> lexicalized
<?> "CP"
where
plain = string "cp" *> do
between '(' ')' $ do
cmp <- compP
return $ CP cmp Nothing [] False (Atr [])
<?> "plain CP"
lexicalized = string "lex" *> do
between '(' ')' $ string "cp" *> do
cmp <- between '(' ')' compP
neg <- comma *> maybe_ negationP
lks <- comma *> lexicalHeadsP
rfl <- comma *> sieP
atr <- comma *> attributeP
return $ CP cmp neg lks rfl atr
<?> "lexicalized CP"
ncpP :: Parser StdPhrase
ncpP = plain <|> lexicalized
<?> "NCP"
where
plain = string "ncp" *> do
between '(' ')' $ do
cas <- caseP
cmp <- comma *> compP
return $ NCP cmp cas Nothing [] False (Atr [])
<?> "plain NCP"
lexicalized = string "lex" *> do
between '(' ')' $ string "ncp" *> do
(cas, cmp) <- between '(' ')' $ do
cas <- caseP
cmp <- comma *> compP
return (cas, cmp)
neg <- comma *> maybe_ negationP
lks <- comma *> lexicalHeadsP
rfl <- comma *> sieP
atr <- comma *> attributeP
return $ NCP cmp cas neg lks rfl atr
<?> "lexicalized NCP"
prepNcP :: Parser StdPhrase
prepNcP = plain <|> lexicalized
<?> "PrepNCP"
where
plain = string "prepncp" *> do
between '(' ')' $ do
-- prp <- A.takeWhile1 C.isLetter
prp <- prepP
cas <- comma *> caseP
cmp <- comma *> compP
return $ PrepNCP prp cmp cas Nothing [] False (Atr [])
<?> "plain PrepNCP"
lexicalized = string "lex" *> do
between '(' ')' $ do
pcp <- plain
neg <- comma *> maybe_ negationP
lks <- comma *> lexicalHeadsP
rfl <- comma *> sieP
atr <- comma *> attributeP
return pcp
{ negation = neg
, lexicalHead = lks
, reflexive = rfl
, dependents = atr }
<?> "lexicalized PrepNCP"
prepGerP :: Parser StdPhrase
prepGerP = plain <|> lexicalized
<?> "PrepGerP"
where
plain = string "prepgerp" *> do
between '(' ')' $ do
prp <- prepP
cas <- comma *> caseP
return $ PrepGerP prp cas Nothing Nothing [] False (Atr [])
<?> "plain PrepGerP"
lexicalized = string "lex" *> do
between '(' ')' $ do
ger <- plain
num <- comma *> maybe_ numberP
neg <- comma *> maybe_ negationP
lks <- comma *> lexicalHeadsP
rfl <- comma *> sieP
atr <- comma *> attributeP
return ger
{ number = num
, negation = neg
, lexicalHead = lks
, reflexive = rfl
, dependents = atr }
<?> "lexicalized PrepGerP"
adjpP :: Parser StdPhrase
adjpP = plain <|> lexicalized
<?> "AdjP"
where
plain = string "adjp" *> do
between '(' ')' $ do
cas <- caseP
return $ AdjP cas Nothing Nothing Nothing [] (Atr [])
<?> "plain AdjP"
lexicalized = string "lex" *> do
between '(' ')' $ do
adj <- plain
num <- comma *> maybe_ (agreeP numberP)
gen <- comma *> agreeP genderP
deg <- comma *> maybe_ degreeP
lks <- comma *> lexicalHeadsP
atr <- comma *> attributeP
return adj
{ agrNumber = num
, gender = Just gen
, degree = deg
, lexicalHead = lks
, dependents = atr }
<?> "lexicalized AdjP"
pactpP :: Parser StdPhrase
pactpP = plain <|> lexicalized
<?> "PactP"
where
plain = string "pactp" *> do
between '(' ')' $ do
cas <- caseP
return $ PactP cas Nothing Nothing Nothing [] False (Atr [])
<?> "plain PactP"
lexicalized = string "lex" *> do
between '(' ')' $ do
pac <- plain
num <- comma *> agreeP numberP
gen <- comma *> agreeP genderP
neg <- comma *> maybe_ negationP
lks <- comma *> lexicalHeadsP
rfl <- comma *> sieP
atr <- comma *> attributeP
return pac
{ agrNumber = Just num
, gender = Just gen
, negation = neg
, lexicalHead = lks
, reflexive = rfl
, dependents = atr }
<?> "lexicalized PactP"
prepAdjpP :: Parser StdPhrase
prepAdjpP = plain <|> lexicalized
<?> "PrepAdjP"
where
plain = string "prepadjp" *> do
between '(' ')' $ do
prp <- prepP
cas <- comma *> caseP
return $ PrepAdjP prp cas Nothing Nothing Nothing [] (Atr [])
<?> "plain PrepAdjP"
lexicalized = string "lex" *> do
between '(' ')' $ do
pap <- plain
num <- comma *> agreeP numberP
gen <- comma *> agreeP genderP
deg <- comma *> degreeP
lks <- comma *> lexicalHeadsP
atr <- comma *> attributeP
return pap
{ agrNumber = Just num
, gender = Just gen
, degree = Just deg
, lexicalHead = lks
, dependents = atr }
<?> "lexicalized PrepAdjP"
numpP :: Parser StdPhrase
numpP = plain <|> lexicalized
<?> "numP"
where
plain = string "nump" *> do
between '(' ')' $ do
cas <- caseP
return $ NumP cas [] [] (Atr [])
<?> "plain NumP"
lexicalized = string "lex" *> do
between '(' ')' $ do
nup <- plain
num <- comma *> lexicalHeadsP
lks <- comma *> lexicalHeadsP
atr <- comma *> attributeP
return $ nup
{ lexicalNumber = num
, lexicalHead = lks
, dependents = atr }
<?> "lexicalized NumP"
prepNumpP :: Parser StdPhrase
prepNumpP = plain <|> lexicalized
<?> "prepNumP"
where
plain = string "prepnump" *> do
between '(' ')' $ do
prp <- prepP
cas <- comma *> caseP
return $ PrepNumP prp cas [] [] (Atr [])
<?> "plain PrepNumP"
lexicalized = string "lex" *> do
between '(' ')' $ do
pnp <- plain
num <- comma *> lexicalHeadsP
lks <- comma *> lexicalHeadsP
atr <- comma *> attributeP
return $ pnp
{ lexicalNumber = num
, lexicalHead = lks
, dependents = atr }
<?> "lexicalized PrepNumP"
infpP :: Parser StdPhrase
infpP = plain <|> lexicalized
<?> "InfP"
where
plain = string "infp" *> do
between '(' ')' $ do
asp <- maybe_ aspectP
return $ InfP asp Nothing [] False (Atr [])
<?> "plain InfP"
lexicalized = string "lex" *> do
between '(' ')' $ do
inf <- plain
neg <- comma *> maybe_ negationP
lks <- comma *> lexicalHeadsP
rfl <- comma *> sieP
atr <- comma *> attributeP
return $ inf
{ negation = neg
, lexicalHead = lks
, reflexive = rfl
, dependents = atr }
<?> "lexicalized InfP"
comparpP :: Parser StdPhrase
comparpP = plain <|> lexicalized
<?> "ComparP"
where
plain = string "compar" *> do
between '(' ')' $ do
conj <- A.takeTill (`elem` [',', ')'])
return $ ComparP [conj] []
<?> "plain ComparP"
lexicalized = string "lex" *> do
between '(' ')' $ do
comp <- plain <* comma
args <- phraseP `A.sepBy1'` A.char '+'
-- return $ comp {comparFrame = concat args}
return $ comp {comparFrame = args}
<?> "lexicalized ComparP"
qublicP :: Parser StdPhrase
qublicP = plain <|> lexicalized
<?> "QubP"
where
plain = string "qub" *> do
return $ QubP [] (Atr [])
<?> "plain QubP"
lexicalized = string "lex" *> do
between '(' ')' $ do
qub <- plain
lks <- comma *> lexicalHeadsP
atr <- comma *> attributeP
return $ qub {lexicalHead = lks, dependents = atr}
<?> "lexicalized QubP"
paspP :: Parser StdPhrase
paspP = plain <|> lexicalized
<?> "PasP"
where
plain = string "ppasp" *> do
between '(' ')' $ do
cas <- caseP
return $ PasP cas Nothing Nothing Nothing [] (Atr [])
<?> "plain PasP"
lexicalized = string "lex" *> do
between '(' ')' $ do
pas <- plain
num <- comma *> agreeP numberP
gen <- comma *> agreeP genderP
neg <- comma *> maybe_ negationP
lks <- comma *> lexicalHeadsP
atr <- comma *> attributeP
return pas
{ agrNumber = Just num
, gender = Just gen
, negation = neg
, lexicalHead = lks
, dependents = atr }
<?> "lexicalized PasP"
prepPaspP :: Parser StdPhrase
prepPaspP = plain <|> lexicalized
<?> "PrepPasP"
where
plain = string "prepppasp" *> do
between '(' ')' $ do
prp <- prepP
cas <- comma *> caseP
return $ PrepPasP prp cas Nothing Nothing Nothing [] (Atr [])
<?> "plain PrepPasP"
lexicalized = string "lex" *> do
between '(' ')' $ do
ppp <- plain
num <- comma *> agreeP numberP
gen <- comma *> agreeP genderP
neg <- comma *> maybe_ negationP
lks <- comma *> lexicalHeadsP
atr <- comma *> attributeP
return ppp
{ agrNumber = Just num
, gender = Just gen
, negation = neg
, lexicalHead = lks
, dependents = atr }
<?> "lexicalized PrepPasP"
fixedP :: Parser SpecPhrase
fixedP = string "fixed" *> do
between '(' ')' $ do
typ <- phraseP
comma
lks <- lexicalHeadP
return Fixed
{ fixedTyp = typ
, fixedLex = lks }
<?> "fixedP"
orP, reflP, eP, nonchP, distrpP, posspP :: Parser SpecPhrase
orP = Or <$ string "or"
reflP = Refl <$ string "refl"
eP = E <$ string "E"
nonchP = Nonch <$ string "nonch"
distrpP = DistrP <$ string "distrp"
posspP = PossP <$ string "possp"
attributeP :: Parser Attribute
attributeP =
A.choice [natrP, atr1P, atrP, ratr1P, ratrP]
<?> "attributeP"
where
natrP = NAtr <$ A.string "natr"
atrP = someAtrP "atr" Atr
atr1P = someAtrP "atr1" Atr1
ratrP = someAtrP "ratr" RAtr
ratr1P = someAtrP "ratr1" RAtr1
someAtrP atrName mkAttr =
A.string atrName *> do
fmap mkAttr
. A.option []
$ between '(' ')' frameP
<?> T.unpack atrName
breakP :: Parser ()
breakP = A.char ':' *> A.skipSpace
<?> "breakP"
-- | Read the entire field, whatever's inside.
fieldP :: Parser Text
fieldP = A.takeTill (==':')
<?> "fieldP"
certP :: Parser CertLevel
certP = A.choice
[ Sure <$ string "pewny"
, Dubious <$ string "wątpliwy"
, Bad <$ string "zły"
, Archaic <$ string "archaiczny"
, Colloquial <$ string "potoczny"
, Vulgar <$ string "wulgarny" ]
<?> "certP"
aspectP :: Parser Aspect
aspectP = A.choice
[ Perfective <$ string "perf"
, Imperfective <$ string "imperf" ]
-- , UnknownAspect <$ string "_" ]
<?> "aspectP"
functionP :: Parser Function
functionP = A.choice
[ Subject <$ string "subj"
, Object <$ string "obj" ]
<?> "functionP"
controlP :: Parser Control
controlP = A.choice
[ Controller2 <$ string "controller2"
, Controllee2 <$ string "controllee2"
, Controller <$ string "controller"
, Controllee <$ string "controllee" ]
<?> "controlP"
caseP :: Parser Case
caseP = A.choice
[ Nominative <$ string "nom"
, Genitive <$ string "gen"
, Dative <$ string "dat"
, Accusative <$ string "acc"
, Instrumental <$ string "inst"
, Locative <$ string "loc"
, Structural <$ string "str"
, Partitive <$ string "part"
, Agreement <$ string "agr"
, PostPrep <$ string "postp"
, Predicative <$ string "pred" ]
<?> "caseP"
numberP :: Parser Number
numberP = A.choice
[ Singular <$ string "sg"
, Plural <$ string "pl" ]
<?> "numberP"
genderP :: Parser Gender
genderP = A.choice
[ M1 <$ string "m1"
, M2 <$ string "m2"
, M3 <$ string "m3"
, F <$ string "f"
, N <$ string "n" ]
<?> "genderP"
degreeP :: Parser Degree
degreeP = A.choice
[ Pos <$ string "pos"
, Com <$ string "com"
, Sup <$ string "sup" ]
<?> "degreeP"
negationP :: Parser Negation
negationP = A.choice
[ Neg <$ string "neg"
, Aff <$ string "aff" ]
<?> "numberP"
predicativityP :: Parser Bool
predicativityP = A.choice
[ True <$ string "pred"
, False <$ string "" ]
<?> "predicativityP"
-- | A parser for lexical (semantic) heads in lexical specifications.
lexicalHeadsP :: Parser [Text]
lexicalHeadsP =
oneP <|> xorP <?> "lexicalHeadsP"
where
oneP = (:[]) <$> lexicalHeadP
xorP = (string "XOR" <|> string "OR") *> do
between '(' ')' $ do
lexicalHeadP `A.sepBy1'`
(A.char ',' <|> A.char ';')
-- | A parser for lexical (semantic) heads in lexical specifications.
lexicalHeadP :: Parser Text
lexicalHeadP = between '\'' '\'' $
A.takeTill (=='\'')
-- | Complementizer (type?)
compP :: Parser Text
compP = A.takeTill (==')')
<?> "compP"
-- | Preposition (type?)
prepP :: Parser Text
prepP = A.takeTill (`elem` [',', ')'])
<?> "prepP"
-- | Relexive marker or nothing?
sieP :: Parser Bool
sieP = do
x <- A.takeTill (==',')
return $ case x of
"się" -> True
_ -> False
-- | An attribute which can be potentially assigned the agreement value.
agreeP :: Parser a -> Parser (Agree a)
agreeP p = A.choice
[ Agree <$ string "agr"
, Value <$> p ]
<?> "agreeP"
-- exppP :: Parser SpecPhrase
-- exppP = A.choice
-- [comPrepNP, xpP, advpP, posspP]
comPrepNP :: Parser SpecPhrase
comPrepNP = string "comprepnp" *> do
between '(' ')' $ do
prep <- A.takeTill (==')')
return $ ComPrepNP prep
xpP :: Parser SpecPhrase
xpP = plain <|> lexicalized
<?> "XP"
where
plain = string "xp" *> do
between '(' ')' $ do
cat <- A.takeWhile1 C.isLetter
val <- A.option Nothing
(Just <$> between '[' ']' phraseP)
return $ XP cat val
<?> "plain XP"
lexicalized = string "lex" *> do
between '(' ')' $ do
xp <- plain
newP <- case xpVal xp of
Nothing -> error "xpP: the unthinkable.0 happened"
Just (Special _) -> error "xpP: the unthinkable.1 happened"
Just (Standard p) -> case p of
ap@AdvP{..} -> do
deg <- comma *> maybe_ degreeP
lks <- comma *> lexicalHeadsP
atr <- comma *> attributeP
return ap
{ degree = deg
, lexicalHead = lks
, dependents = atr }
pp@PrepNP{..} -> do
num <- comma *> maybe_ (agreeP numberP)
lks <- comma *> lexicalHeadsP
atr <- comma *> attributeP
return pp
{ agrNumber = num
, lexicalHead = lks
, dependents = atr }
np@NP{..} -> do
num <- comma *> maybe_ (agreeP numberP)
lks <- comma *> lexicalHeadsP
atr <- comma *> attributeP
return np
{ agrNumber = num
, lexicalHead = lks
, dependents = atr }
cp@ComparP{..} -> do
args <- comma *> phraseP `A.sepBy1'` A.char '+'
return cp {comparFrame = args}
pnp@PrepNumP{..} -> do
num <- comma *> lexicalHeadsP
lks <- comma *> lexicalHeadsP
atr <- comma *> attributeP
return pnp
{ lexicalNumber = num
, lexicalHead = lks
, dependents = atr }
pap@PrepAdjP{..} -> do
num <- comma *> agreeP numberP
gen <- comma *> agreeP genderP
deg <- comma *> degreeP
lks <- comma *> lexicalHeadsP
atr <- comma *> attributeP
return pap
{ agrNumber = Just num
, gender = Just gen
, degree = Just deg
, lexicalHead = lks
, dependents = atr }
cp@CP{..} -> do
neg <- comma *> maybe_ negationP
lks <- comma *> lexicalHeadsP
rfl <- comma *> sieP
atr <- comma *> attributeP
return cp
{ negation = neg
, lexicalHead = lks
, reflexive = rfl
, dependents = atr }
pg@PrepGerP{..} -> do
num <- comma *> maybe_ numberP
neg <- comma *> maybe_ negationP
lks <- comma *> lexicalHeadsP
rfl <- comma *> sieP
atr <- comma *> attributeP
return pg
{ number = num
, negation = neg
, lexicalHead = lks
, reflexive = rfl
, dependents = atr }
_ -> error "xpP: the unthinkable.2 happened"
return xp {xpVal = Just (Standard newP)}
<?> "lexicalized XP"
-- xpApP xp ap@AdvP{..} =
advpP :: Parser StdPhrase
advpP = plain <|> lexicalized
<?> "AdvP"
where
plain = string "advp" *> do
between '(' ')' $ do
cat <- A.takeWhile1 C.isLetter
return $ AdvP cat Nothing [] (Atr [])
<?> "plain AdvP"
lexicalized = string "lex" *> do
between '(' ')' $ do
adv <- plain
deg <- comma *> maybe_ degreeP
lks <- comma *> lexicalHeadsP
atr <- comma *> attributeP
return adv
{ degree = deg
, lexicalHead = lks
, dependents = atr }
<?> "lexicalized AdvP"
-------------------------------------------------------------
-- Utils
-------------------------------------------------------------
-- | `between c1 c2 p` parses with `p` between characters `c1` and `c2`.
between :: Char -> Char -> Parser a -> Parser a
between c1 c2 p = A.char c1 *> p <* A.char c2
-- | Comma parser, i.e., `A.char ','`.
comma :: Parser ()
comma = void $ A.char ','
-- | A parser which interprets the '_' character as `Nothing`,
-- and otherwise uses the given parser to parser input.
maybe_ :: Parser a -> Parser (Maybe a)
maybe_ p = A.choice
[ Nothing <$ A.char '_'
, Just <$> p ]
<?> "maybe_"
|
namespace Apsk.AppSettings
{
public class ServiceDiscoverySetting
{
public string HttpEndpoint { get; set; }
public DnsEndpoint DnsEndpoint { get; set; }
}
}
|
#include <gtest/gtest.h>
#include <sigen/common/math.h>
TEST(Math, Mean) {
std::vector<double> xs;
xs.push_back(1.0);
xs.push_back(2.0);
xs.push_back(3.0);
EXPECT_EQ(2, sigen::Mean(xs));
}
|
using System;
using Microsoft.EntityFrameworkCore.Migrations;
using MySql.Data.EntityFrameworkCore.Metadata;
namespace CompanyStores.Migrations
{
public partial class InitalData : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "CompanyStore",
columns: table => new
{
CompanyStoresId = table.Column<int>(nullable: false)
.Annotation("MySQL:ValueGenerationStrategy", MySQLValueGenerationStrategy.IdentityColumn),
StoreName = table.Column<string>(nullable: false),
StoreImage = table.Column<string>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_CompanyStore", x => x.CompanyStoresId);
});
migrationBuilder.CreateTable(
name: "Admins",
columns: table => new
{
AdminId = table.Column<int>(nullable: false)
.Annotation("MySQL:ValueGenerationStrategy", MySQLValueGenerationStrategy.IdentityColumn),
UserName = table.Column<string>(type: "nvarchar(50)", nullable: false),
Password = table.Column<string>(type: "nvarchar(50)", nullable: false),
Roll = table.Column<int>(nullable: false),
CompanyStoresId = table.Column<int>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Admins", x => x.AdminId);
table.ForeignKey(
name: "FK_Admins_CompanyStore_CompanyStoresId",
column: x => x.CompanyStoresId,
principalTable: "CompanyStore",
principalColumn: "CompanyStoresId");
});
migrationBuilder.CreateTable(
name: "Categories",
columns: table => new
{
CategoryId = table.Column<int>(nullable: false)
.Annotation("MySQL:ValueGenerationStrategy", MySQLValueGenerationStrategy.IdentityColumn),
CategoryName = table.Column<string>(type: "nvarchar(150)", nullable: false),
CompanyStoresId = table.Column<int>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Categories", x => x.CategoryId);
table.ForeignKey(
name: "FK_Categories_CompanyStore_CompanyStoresId",
column: x => x.CompanyStoresId,
principalTable: "CompanyStore",
principalColumn: "CompanyStoresId");
});
migrationBuilder.CreateTable(
name: "Customers",
columns: table => new
{
CustomerId = table.Column<int>(nullable: false)
.Annotation("MySQL:ValueGenerationStrategy", MySQLValueGenerationStrategy.IdentityColumn),
CustomerName = table.Column<string>(type: "nvarchar(50)", nullable: false),
Address = table.Column<string>(type: "nvarchar(50)", nullable: false),
PhoneNumber = table.Column<string>(type: "nvarchar(50)", nullable: false),
MarketName = table.Column<string>(type: "nvarchar(50)", nullable: false),
Debts = table.Column<float>(nullable: false),
CompanyStoresId = table.Column<int>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Customers", x => x.CustomerId);
table.ForeignKey(
name: "FK_Customers_CompanyStore_CompanyStoresId",
column: x => x.CompanyStoresId,
principalTable: "CompanyStore",
principalColumn: "CompanyStoresId");
});
migrationBuilder.CreateTable(
name: "Offices",
columns: table => new
{
OfficeId = table.Column<int>(nullable: false)
.Annotation("MySQL:ValueGenerationStrategy", MySQLValueGenerationStrategy.IdentityColumn),
OfficeName = table.Column<string>(type: "nvarchar(50)", nullable: false),
OfficePhone = table.Column<string>(type: "nvarchar(50)", nullable: false),
OfficeAdress = table.Column<string>(type: "nvarchar(50)", nullable: false),
OwnDebtForOffice = table.Column<float>(nullable: false),
CompanyStoresId = table.Column<int>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Offices", x => x.OfficeId);
table.ForeignKey(
name: "FK_Offices_CompanyStore_CompanyStoresId",
column: x => x.CompanyStoresId,
principalTable: "CompanyStore",
principalColumn: "CompanyStoresId");
});
migrationBuilder.CreateTable(
name: "Products",
columns: table => new
{
ProductId = table.Column<int>(nullable: false)
.Annotation("MySQL:ValueGenerationStrategy", MySQLValueGenerationStrategy.IdentityColumn),
ProductName = table.Column<string>(type: "nvarchar(50)", nullable: false),
Company = table.Column<string>(type: "nvarchar(50)", nullable: false),
Price = table.Column<float>(nullable: false),
Quantity = table.Column<int>(nullable: false),
Description = table.Column<string>(nullable: true),
ProductImage = table.Column<string>(nullable: true),
Code = table.Column<string>(type: "varchar(500)", nullable: true),
BarCode = table.Column<string>(nullable: true),
BuyPrice = table.Column<float>(nullable: false),
CompanyStoresId = table.Column<int>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Products", x => x.ProductId);
table.ForeignKey(
name: "FK_Products_CompanyStore_CompanyStoresId",
column: x => x.CompanyStoresId,
principalTable: "CompanyStore",
principalColumn: "CompanyStoresId");
});
migrationBuilder.CreateTable(
name: "OtherPayments",
columns: table => new
{
OtherPaymentId = table.Column<int>(nullable: false)
.Annotation("MySQL:ValueGenerationStrategy", MySQLValueGenerationStrategy.IdentityColumn),
Amount = table.Column<float>(nullable: false),
Date = table.Column<DateTime>(nullable: false),
Note = table.Column<string>(nullable: true),
AdminId = table.Column<int>(nullable: false),
CompanyStoresId = table.Column<int>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_OtherPayments", x => x.OtherPaymentId);
table.ForeignKey(
name: "FK_OtherPayments_Admins_AdminId",
column: x => x.AdminId,
principalTable: "Admins",
principalColumn: "AdminId");
table.ForeignKey(
name: "FK_OtherPayments_CompanyStore_CompanyStoresId",
column: x => x.CompanyStoresId,
principalTable: "CompanyStore",
principalColumn: "CompanyStoresId",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "PaymentBills",
columns: table => new
{
PaymentBillId = table.Column<int>(nullable: false)
.Annotation("MySQL:ValueGenerationStrategy", MySQLValueGenerationStrategy.IdentityColumn),
Amount = table.Column<float>(nullable: false),
BillDate = table.Column<DateTime>(nullable: false),
Note = table.Column<string>(nullable: true),
AdminId = table.Column<int>(nullable: false),
CompanyStoresId = table.Column<int>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_PaymentBills", x => x.PaymentBillId);
table.ForeignKey(
name: "FK_PaymentBills_Admins_AdminId",
column: x => x.AdminId,
principalTable: "Admins",
principalColumn: "AdminId");
table.ForeignKey(
name: "FK_PaymentBills_CompanyStore_CompanyStoresId",
column: x => x.CompanyStoresId,
principalTable: "CompanyStore",
principalColumn: "CompanyStoresId");
});
migrationBuilder.CreateTable(
name: "Invoices",
columns: table => new
{
InvoiceId = table.Column<int>(nullable: false)
.Annotation("MySQL:ValueGenerationStrategy", MySQLValueGenerationStrategy.IdentityColumn),
InvoiceDate = table.Column<DateTime>(nullable: false),
InvoiceNote = table.Column<string>(nullable: true),
CustomerId = table.Column<int>(nullable: false),
AdminId = table.Column<int>(nullable: false),
CompanyStoresId = table.Column<int>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Invoices", x => x.InvoiceId);
table.ForeignKey(
name: "FK_Invoices_Admins_AdminId",
column: x => x.AdminId,
principalTable: "Admins",
principalColumn: "AdminId");
table.ForeignKey(
name: "FK_Invoices_CompanyStore_CompanyStoresId",
column: x => x.CompanyStoresId,
principalTable: "CompanyStore",
principalColumn: "CompanyStoresId");
table.ForeignKey(
name: "FK_Invoices_Customers_CustomerId",
column: x => x.CustomerId,
principalTable: "Customers",
principalColumn: "CustomerId");
});
migrationBuilder.CreateTable(
name: "TakeBills",
columns: table => new
{
TakeBillId = table.Column<int>(nullable: false)
.Annotation("MySQL:ValueGenerationStrategy", MySQLValueGenerationStrategy.IdentityColumn),
Amount = table.Column<float>(nullable: false),
TBillDate = table.Column<DateTime>(nullable: false),
TBillNote = table.Column<string>(type: "varchar(1000)", nullable: true),
CustomerId = table.Column<int>(nullable: false),
AdminId = table.Column<int>(nullable: false),
CompanyStoresId = table.Column<int>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_TakeBills", x => x.TakeBillId);
table.ForeignKey(
name: "FK_TakeBills_Admins_AdminId",
column: x => x.AdminId,
principalTable: "Admins",
principalColumn: "AdminId");
table.ForeignKey(
name: "FK_TakeBills_CompanyStore_CompanyStoresId",
column: x => x.CompanyStoresId,
principalTable: "CompanyStore",
principalColumn: "CompanyStoresId");
table.ForeignKey(
name: "FK_TakeBills_Customers_CustomerId",
column: x => x.CustomerId,
principalTable: "Customers",
principalColumn: "CustomerId");
});
migrationBuilder.CreateTable(
name: "BuyInvoices",
columns: table => new
{
BuyInvoiceId = table.Column<int>(nullable: false)
.Annotation("MySQL:ValueGenerationStrategy", MySQLValueGenerationStrategy.IdentityColumn),
Note = table.Column<string>(nullable: true),
OfficeId = table.Column<int>(nullable: true),
Date = table.Column<DateTime>(nullable: false),
AdminId = table.Column<int>(nullable: false),
CompanyStoreId = table.Column<int>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_BuyInvoices", x => x.BuyInvoiceId);
table.ForeignKey(
name: "FK_BuyInvoices_Admins_AdminId",
column: x => x.AdminId,
principalTable: "Admins",
principalColumn: "AdminId");
table.ForeignKey(
name: "FK_BuyInvoices_CompanyStore_CompanyStoreId",
column: x => x.CompanyStoreId,
principalTable: "CompanyStore",
principalColumn: "CompanyStoresId");
table.ForeignKey(
name: "FK_BuyInvoices_Offices_OfficeId",
column: x => x.OfficeId,
principalTable: "Offices",
principalColumn: "OfficeId",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "ProductCategories",
columns: table => new
{
ProductId = table.Column<int>(nullable: false),
CategoryId = table.Column<int>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ProductCategories", x => new { x.ProductId, x.CategoryId });
table.ForeignKey(
name: "FK_ProductCategories_Categories_CategoryId",
column: x => x.CategoryId,
principalTable: "Categories",
principalColumn: "CategoryId",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_ProductCategories_Products_ProductId",
column: x => x.ProductId,
principalTable: "Products",
principalColumn: "ProductId",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "transportInvoices",
columns: table => new
{
TransportInvoiceId = table.Column<int>(nullable: false)
.Annotation("MySQL:ValueGenerationStrategy", MySQLValueGenerationStrategy.IdentityColumn),
Quantity = table.Column<int>(nullable: false),
ProductId = table.Column<int>(nullable: false),
CompanyStoreId = table.Column<int>(nullable: false),
Date = table.Column<int>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_transportInvoices", x => x.TransportInvoiceId);
table.ForeignKey(
name: "FK_transportInvoices_CompanyStore_CompanyStoreId",
column: x => x.CompanyStoreId,
principalTable: "CompanyStore",
principalColumn: "CompanyStoresId");
table.ForeignKey(
name: "FK_transportInvoices_Products_ProductId",
column: x => x.ProductId,
principalTable: "Products",
principalColumn: "ProductId");
});
migrationBuilder.CreateTable(
name: "CustomerInvoices",
columns: table => new
{
CustomerInvoiceId = table.Column<int>(nullable: false)
.Annotation("MySQL:ValueGenerationStrategy", MySQLValueGenerationStrategy.IdentityColumn),
Quantity = table.Column<int>(nullable: false),
Discount = table.Column<float>(nullable: false),
TotalPrice = table.Column<float>(nullable: false),
InvoiceId = table.Column<int>(nullable: false),
ProductId = table.Column<int>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_CustomerInvoices", x => x.CustomerInvoiceId);
table.ForeignKey(
name: "FK_CustomerInvoices_Invoices_InvoiceId",
column: x => x.InvoiceId,
principalTable: "Invoices",
principalColumn: "InvoiceId");
table.ForeignKey(
name: "FK_CustomerInvoices_Products_ProductId",
column: x => x.ProductId,
principalTable: "Products",
principalColumn: "ProductId");
});
migrationBuilder.CreateTable(
name: "OfficeInvoices",
columns: table => new
{
OfficeInvoiceId = table.Column<int>(nullable: false)
.Annotation("MySQL:ValueGenerationStrategy", MySQLValueGenerationStrategy.IdentityColumn),
Quantity = table.Column<int>(nullable: false),
Discount = table.Column<float>(nullable: false),
TotalPrice = table.Column<float>(nullable: false),
ProductsId = table.Column<int>(nullable: false),
BuyInvoiceId = table.Column<int>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_OfficeInvoices", x => x.OfficeInvoiceId);
table.ForeignKey(
name: "FK_OfficeInvoices_BuyInvoices_BuyInvoiceId",
column: x => x.BuyInvoiceId,
principalTable: "BuyInvoices",
principalColumn: "BuyInvoiceId");
table.ForeignKey(
name: "FK_OfficeInvoices_Products_ProductsId",
column: x => x.ProductsId,
principalTable: "Products",
principalColumn: "ProductId");
});
migrationBuilder.CreateTable(
name: "OfficeReturns",
columns: table => new
{
OfficeReturnId = table.Column<int>(nullable: false)
.Annotation("MySQL:ValueGenerationStrategy", MySQLValueGenerationStrategy.IdentityColumn),
Date = table.Column<DateTime>(nullable: false),
Note = table.Column<string>(nullable: true),
BuyInvoiceId = table.Column<int>(nullable: false),
ProductsId = table.Column<int>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_OfficeReturns", x => x.OfficeReturnId);
table.ForeignKey(
name: "FK_OfficeReturns_BuyInvoices_BuyInvoiceId",
column: x => x.BuyInvoiceId,
principalTable: "BuyInvoices",
principalColumn: "BuyInvoiceId");
table.ForeignKey(
name: "FK_OfficeReturns_Products_ProductsId",
column: x => x.ProductsId,
principalTable: "Products",
principalColumn: "ProductId");
});
migrationBuilder.CreateTable(
name: "ProductsReturns",
columns: table => new
{
ProductReturnId = table.Column<int>(nullable: false)
.Annotation("MySQL:ValueGenerationStrategy", MySQLValueGenerationStrategy.IdentityColumn),
PReturnDate = table.Column<DateTime>(nullable: false),
InvoiceId = table.Column<int>(nullable: false),
ProductId = table.Column<int>(nullable: false),
CustomerInvoiceId = table.Column<int>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ProductsReturns", x => x.ProductReturnId);
table.ForeignKey(
name: "FK_ProductsReturns_CustomerInvoices_CustomerInvoiceId",
column: x => x.CustomerInvoiceId,
principalTable: "CustomerInvoices",
principalColumn: "CustomerInvoiceId");
table.ForeignKey(
name: "FK_ProductsReturns_Invoices_InvoiceId",
column: x => x.InvoiceId,
principalTable: "Invoices",
principalColumn: "InvoiceId");
table.ForeignKey(
name: "FK_ProductsReturns_Products_ProductId",
column: x => x.ProductId,
principalTable: "Products",
principalColumn: "ProductId");
});
migrationBuilder.CreateIndex(
name: "IX_Admins_CompanyStoresId",
table: "Admins",
column: "CompanyStoresId");
migrationBuilder.CreateIndex(
name: "IX_BuyInvoices_AdminId",
table: "BuyInvoices",
column: "AdminId");
migrationBuilder.CreateIndex(
name: "IX_BuyInvoices_CompanyStoreId",
table: "BuyInvoices",
column: "CompanyStoreId");
migrationBuilder.CreateIndex(
name: "IX_BuyInvoices_OfficeId",
table: "BuyInvoices",
column: "OfficeId");
migrationBuilder.CreateIndex(
name: "IX_Categories_CompanyStoresId",
table: "Categories",
column: "CompanyStoresId");
migrationBuilder.CreateIndex(
name: "IX_CustomerInvoices_InvoiceId",
table: "CustomerInvoices",
column: "InvoiceId");
migrationBuilder.CreateIndex(
name: "IX_CustomerInvoices_ProductId",
table: "CustomerInvoices",
column: "ProductId");
migrationBuilder.CreateIndex(
name: "IX_Customers_CompanyStoresId",
table: "Customers",
column: "CompanyStoresId");
migrationBuilder.CreateIndex(
name: "IX_Customers_MarketName",
table: "Customers",
column: "MarketName");
migrationBuilder.CreateIndex(
name: "IX_Invoices_AdminId",
table: "Invoices",
column: "AdminId");
migrationBuilder.CreateIndex(
name: "IX_Invoices_CompanyStoresId",
table: "Invoices",
column: "CompanyStoresId");
migrationBuilder.CreateIndex(
name: "IX_Invoices_CustomerId",
table: "Invoices",
column: "CustomerId");
migrationBuilder.CreateIndex(
name: "IX_OfficeInvoices_BuyInvoiceId",
table: "OfficeInvoices",
column: "BuyInvoiceId");
migrationBuilder.CreateIndex(
name: "IX_OfficeInvoices_ProductsId",
table: "OfficeInvoices",
column: "ProductsId");
migrationBuilder.CreateIndex(
name: "IX_OfficeReturns_BuyInvoiceId",
table: "OfficeReturns",
column: "BuyInvoiceId");
migrationBuilder.CreateIndex(
name: "IX_OfficeReturns_ProductsId",
table: "OfficeReturns",
column: "ProductsId");
migrationBuilder.CreateIndex(
name: "IX_Offices_CompanyStoresId",
table: "Offices",
column: "CompanyStoresId");
migrationBuilder.CreateIndex(
name: "IX_OtherPayments_AdminId",
table: "OtherPayments",
column: "AdminId");
migrationBuilder.CreateIndex(
name: "IX_OtherPayments_CompanyStoresId",
table: "OtherPayments",
column: "CompanyStoresId");
migrationBuilder.CreateIndex(
name: "IX_PaymentBills_AdminId",
table: "PaymentBills",
column: "AdminId");
migrationBuilder.CreateIndex(
name: "IX_PaymentBills_CompanyStoresId",
table: "PaymentBills",
column: "CompanyStoresId");
migrationBuilder.CreateIndex(
name: "IX_ProductCategories_CategoryId",
table: "ProductCategories",
column: "CategoryId");
migrationBuilder.CreateIndex(
name: "IX_Products_CompanyStoresId",
table: "Products",
column: "CompanyStoresId");
migrationBuilder.CreateIndex(
name: "IX_ProductsReturns_CustomerInvoiceId",
table: "ProductsReturns",
column: "CustomerInvoiceId");
migrationBuilder.CreateIndex(
name: "IX_ProductsReturns_InvoiceId",
table: "ProductsReturns",
column: "InvoiceId");
migrationBuilder.CreateIndex(
name: "IX_ProductsReturns_ProductId",
table: "ProductsReturns",
column: "ProductId");
migrationBuilder.CreateIndex(
name: "IX_TakeBills_AdminId",
table: "TakeBills",
column: "AdminId");
migrationBuilder.CreateIndex(
name: "IX_TakeBills_CompanyStoresId",
table: "TakeBills",
column: "CompanyStoresId");
migrationBuilder.CreateIndex(
name: "IX_TakeBills_CustomerId",
table: "TakeBills",
column: "CustomerId");
migrationBuilder.CreateIndex(
name: "IX_transportInvoices_CompanyStoreId",
table: "transportInvoices",
column: "CompanyStoreId");
migrationBuilder.CreateIndex(
name: "IX_transportInvoices_ProductId",
table: "transportInvoices",
column: "ProductId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "OfficeInvoices");
migrationBuilder.DropTable(
name: "OfficeReturns");
migrationBuilder.DropTable(
name: "OtherPayments");
migrationBuilder.DropTable(
name: "PaymentBills");
migrationBuilder.DropTable(
name: "ProductCategories");
migrationBuilder.DropTable(
name: "ProductsReturns");
migrationBuilder.DropTable(
name: "TakeBills");
migrationBuilder.DropTable(
name: "transportInvoices");
migrationBuilder.DropTable(
name: "BuyInvoices");
migrationBuilder.DropTable(
name: "Categories");
migrationBuilder.DropTable(
name: "CustomerInvoices");
migrationBuilder.DropTable(
name: "Offices");
migrationBuilder.DropTable(
name: "Invoices");
migrationBuilder.DropTable(
name: "Products");
migrationBuilder.DropTable(
name: "Admins");
migrationBuilder.DropTable(
name: "Customers");
migrationBuilder.DropTable(
name: "CompanyStore");
}
}
}
|
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.aliyuncs.sofa.model.v20190815;
import java.util.List;
import com.aliyuncs.AcsResponse;
import com.aliyuncs.sofa.transform.v20190815.GetDWSCrawlerOverviewResponseUnmarshaller;
import com.aliyuncs.transform.UnmarshallerContext;
/**
* @author auto create
* @version
*/
public class GetDWSCrawlerOverviewResponse extends AcsResponse {
private String requestId;
private String resultCode;
private String resultMessage;
private Data data;
public String getRequestId() {
return this.requestId;
}
public void setRequestId(String requestId) {
this.requestId = requestId;
}
public String getResultCode() {
return this.resultCode;
}
public void setResultCode(String resultCode) {
this.resultCode = resultCode;
}
public String getResultMessage() {
return this.resultMessage;
}
public void setResultMessage(String resultMessage) {
this.resultMessage = resultMessage;
}
public Data getData() {
return this.data;
}
public void setData(Data data) {
this.data = data;
}
public static class Data {
private Long pageTotal;
private List<CrawlerOverviewListItem> crawlerOverviewList;
private List<String> dbTypeList;
public Long getPageTotal() {
return this.pageTotal;
}
public void setPageTotal(Long pageTotal) {
this.pageTotal = pageTotal;
}
public List<CrawlerOverviewListItem> getCrawlerOverviewList() {
return this.crawlerOverviewList;
}
public void setCrawlerOverviewList(List<CrawlerOverviewListItem> crawlerOverviewList) {
this.crawlerOverviewList = crawlerOverviewList;
}
public List<String> getDbTypeList() {
return this.dbTypeList;
}
public void setDbTypeList(List<String> dbTypeList) {
this.dbTypeList = dbTypeList;
}
public static class CrawlerOverviewListItem {
private String beginTimeStamp;
private Long conn;
private Long crawlerDelay;
private String crawlerName;
private String dbType;
private String endTimeStamp;
private Long ios;
private String location;
private String monitorTime;
private String status;
private String tps;
public String getBeginTimeStamp() {
return this.beginTimeStamp;
}
public void setBeginTimeStamp(String beginTimeStamp) {
this.beginTimeStamp = beginTimeStamp;
}
public Long getConn() {
return this.conn;
}
public void setConn(Long conn) {
this.conn = conn;
}
public Long getCrawlerDelay() {
return this.crawlerDelay;
}
public void setCrawlerDelay(Long crawlerDelay) {
this.crawlerDelay = crawlerDelay;
}
public String getCrawlerName() {
return this.crawlerName;
}
public void setCrawlerName(String crawlerName) {
this.crawlerName = crawlerName;
}
public String getDbType() {
return this.dbType;
}
public void setDbType(String dbType) {
this.dbType = dbType;
}
public String getEndTimeStamp() {
return this.endTimeStamp;
}
public void setEndTimeStamp(String endTimeStamp) {
this.endTimeStamp = endTimeStamp;
}
public Long getIos() {
return this.ios;
}
public void setIos(Long ios) {
this.ios = ios;
}
public String getLocation() {
return this.location;
}
public void setLocation(String location) {
this.location = location;
}
public String getMonitorTime() {
return this.monitorTime;
}
public void setMonitorTime(String monitorTime) {
this.monitorTime = monitorTime;
}
public String getStatus() {
return this.status;
}
public void setStatus(String status) {
this.status = status;
}
public String getTps() {
return this.tps;
}
public void setTps(String tps) {
this.tps = tps;
}
}
}
@Override
public GetDWSCrawlerOverviewResponse getInstance(UnmarshallerContext context) {
return GetDWSCrawlerOverviewResponseUnmarshaller.unmarshall(this, context);
}
@Override
public boolean checkShowJsonItemName() {
return false;
}
}
|
//
// LFTools.h
// DeviceMaintain
//
// Created by 刘丰 on 2018/4/1.
// Copyright © 2018年 liufeng. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface LFTools : NSObject
+ (void)setObject:(id)obj forKey:(NSString *)key;
+ (id)objectForKey:(NSString *)key;
+ (void)setBool:(BOOL)is forKey:(NSString *)key;
+ (BOOL)boolForKey:(NSString *)key;
@end
|
/* -----------------------------------------------------------------------------
Disable existing codes in the PIMS_PROPERTY_TENURE_TYPE table and add new codes.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Author Date Comment
------------ ----------- -----------------------------------------------------
Doug Filteau 2022-Mar-08 Initial version
----------------------------------------------------------------------------- */
BEGIN TRANSACTION;
-- Disable the existing code values
UPDATE PIMS_PROPERTY_TENURE_TYPE
SET IS_DISABLED = CONVERT([bit],(1))
, CONCURRENCY_CONTROL_NUMBER = CONCURRENCY_CONTROL_NUMBER + 1;
IF @@ROWCOUNT = 0
BEGIN
INSERT INTO PIMS_PROPERTY_TENURE_TYPE (PROPERTY_TENURE_TYPE_CODE, DESCRIPTION, IS_DISABLED)
VALUES
(N'PL', N'Payable Contract', CONVERT([bit],(1))),
(N'TM', N'Titled Land - MoTI', CONVERT([bit],(1))),
(N'CL', N'Crown Land Reserve', CONVERT([bit],(1))),
(N'TT', N'Titled Land - TFA', CONVERT([bit],(1))),
(N'RW', N'Right of Way', CONVERT([bit],(1))),
(N'CR', N'Closed Road', CONVERT([bit],(1)));
END
-- Insert the new code values
INSERT INTO PIMS_PROPERTY_TENURE_TYPE (PROPERTY_TENURE_TYPE_CODE, DESCRIPTION, IS_DISABLED)
VALUES
(N'HWYROAD', N'Highway/Road', CONVERT([bit],(0))),
(N'ADJLAND', N'Adjacent Land', CONVERT([bit],(0))),
(N'CLOSEDRD', N'Closed Road', CONVERT([bit],(0))),
(N'UNKNOWN', N'Unknown', CONVERT([bit],(0)));
COMMIT TRANSACTION;
|
using System.Configuration;
using Should.Fluent;
namespace Backpack.Features.Tests
{
public class FeatureConfigurationTests
{
public void Current_LoadsCorrectConfigurationSection()
{
var configurationSection = ConfigurationManager.GetSection("backpack.features") as FeatureConfiguration;
var configuration = FeatureConfiguration.Current;
configuration.Should().Equal(configurationSection);
}
}
}
|
mod message;
mod rpc;
mod topic;
pub use self::message::*;
pub use self::rpc::*;
pub use self::topic::*;
pub use ethereum_types::{Address, H160, H256, U256};
|
#!/usr/bin/env bash
pdf=$1
png=$2
(gs -dSAFER -r600 -sDEVICE=png256 -o $png $pdf && convert $png -background white -alpha remove -alpha off $png)
|
<?php
/**
* JPhpExcelReader class file.
*
* @author jerry2801 <jerry2801@gmail.com>
* @version alpha 2 2010-5-18 14:26
*
* A typical usage of JPhpExcelReader is as follows:
* <pre>
* Yii::import('ext.phpexcelreader.JPhpExcelReader');
* $data=new JPhpExcelReader('example.xls');
* echo $data->dump(true,true);
* </pre>
*/
require_once dirname(__FILE__).DIRECTORY_SEPARATOR.'excel_reader2.php';
class OExcelReader extends Spreadsheet_Excel_Reader
{
}
|
# Copyright 2011-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
require 'bigdecimal'
require 'json'
module AWS
module Core
# @api private
class OptionGrammar
# @api private
class DefaultOption; end
# @api private
class FormatError < ArgumentError
attr_accessor :expectation
attr_accessor :context_description
def initialize(expectation, context)
@expectation = expectation
@context_description = context
end
def to_s
"expected #{expectation} for #{context_description}"
end
end
# @api private
module Descriptors
# @api private
module NoArgs
def apply(option)
option.extend self
end
end
module Timestamp
extend NoArgs
def validate(value, context = nil)
true
# raise format_error("timestamp value", context) unless
# case value
# when String
# value =~ /^\d+$/ or value =~ /^\d{4}-\d{2}-d{2}T\d{2}:\d{2}:\d{2}Z$/
# when String then value =~ /^2009-12-04T20:56:05.000Z\d+$/
# when Integer then true
# when DateTime then true
# when Timestamp then true
# when Date then true
# else false
# end
# end
# value.respond_to? :to_str
end
def encode_value(value)
value.to_s
# value.to_s
# case value
# when Integer
# when
# case value
# when nil, '' then nil
# when DateTime then raw
# when Integer then DateTime.parse(Time.at(raw).to_s) # timestamp
# else DateTime.parse(raw.to_s) # work with Time, Date and String objects
# end
end
end
# @api private
module String
extend NoArgs
def validate(value, context = nil)
raise format_error("string value", context) unless
value.respond_to? :to_str
end
def encode_value(value)
value.to_s
end
end
# @api private
module Blob
extend NoArgs
def validate(value, context = nil)
raise format_error("string value", context) unless
value.respond_to? :to_str
end
def encode_value(value)
[value.to_s].pack("m0").gsub("\n", '')
end
def hash_format(value)
[value.to_s].pack("m0").gsub("\n", '')
end
end
# @api private
module Integer
extend NoArgs
def validate(value, context = nil)
raise format_error("integer value", context) unless
value.respond_to? :to_int
end
def encode_value(value)
value.to_s
end
end
Long = Integer
# @api private
module Boolean
extend NoArgs
def validate(value, context = nil)
raise format_error("boolean value", context) unless
value == true || value == false
end
def encode_value(value)
value.to_s
end
end
# @api private
module Required
extend NoArgs
def required?; true; end
end
module Position
def self.apply *args; end
end
# @api private
module Float
extend NoArgs
def validate(value, context = nil)
raise format_error("float value", context) unless
value.kind_of?(Numeric) or
value.respond_to? :to_f
end
def encode_value(value)
value.to_f.to_s
end
end
Double = Float
# @api private
module Rename
def self.apply(option, new_name)
new_name = Inflection.ruby_name(new_name)
MetaUtils.extend_method(option, :ruby_name) { new_name }
end
end
# @api private
module Pattern
# def validate value, context = nil
# unless value =~ regex
# raise format_error("value to match #{regex}", context)
# end
# end
#
# def self.apply option, regex
# option.extend(self)
# MetaUtils.extend_method(option, :regex) { regex }
# end
def self.apply *args
end
end
# @api private
module ListMethods
module ClassMethods
def apply(option, member_descriptors)
super(option)
member_option = option.member_option if option.respond_to?(:member_option)
# ignoring member name descriptors for lists, only useful for rest
descriptors = []
member_descriptors.each do |descriptor|
unless descriptor.is_a?(Hash) and descriptor[:member_name]
descriptors << descriptor
end
end
member_option ||= ListMember.new
member_option = member_option.extend_with_config(*descriptors)
MetaUtils.extend_method(option, :member_option) { member_option }
end
end
module InstanceMethods
def validate(value, context = nil)
raise format_error("enumerable value", context) unless
value.respond_to? :each
i = 0
value.each do |member|
i += 1
member_option.validate(member,
"member #{i} of #{context_description(context)}")
end
end
def request_params(value, prefix = nil)
params = []
value.each do |v|
name = prefixed_name(prefix) + join + (params.size + 1).to_s
params << member_option.request_params(v, name)
end
return [Http::Request::Param.new(prefixed_name(prefix), "")] if params.empty?
params
end
def hash_format(value)
value.map do |v|
member_option.hash_format(v)
end
end
def join
'.'
end
end
end
module List
extend NoArgs
extend ListMethods::ClassMethods
include ListMethods::InstanceMethods
end
module MemberedList
extend NoArgs
extend ListMethods::ClassMethods
include ListMethods::InstanceMethods
def join
'.member.'
end
end
class ListMember < DefaultOption
def initialize options = {}
super("##list-member##")
@prefix = options[:prefix] || ''
end
def prefixed_name(prefix)
"#{prefix}#{@prefix}"
end
end
# @api private
module Structure
extend NoArgs
def self.apply(option, members)
options = {}
options = option.member_options.inject({}) do |memo, member_option|
memo[member_option.name] = member_option
memo
end if option.respond_to?(:member_options)
super(option)
members.each do |(name, descriptors)|
member_option = options[name] || DefaultOption.new(name)
member_option = member_option.extend_with_config(*descriptors)
options[name] = member_option
end
MetaUtils.extend_method(option, :member_options) { options.values }
by_ruby_name = options.values.inject({}) do |memo, member_option|
memo[member_option.ruby_name] = member_option
memo[member_option.name] = member_option
memo
end
MetaUtils.extend_method(option, :member_option) { |n| by_ruby_name[n] }
end
def validate(value, context = nil)
raise format_error("hash value", context) unless
value.respond_to?(:to_hash)
context = context_description(context)
value.each do |name, v|
name = name.to_s
raise ArgumentError.new("unexpected key #{name} for #{context}") unless
member_option(name)
member_option(name).validate(v, "key #{name} of #{context}")
end
member_options.each do |option|
raise ArgumentError.new("missing required key #{option.ruby_name} for #{context}") if
option.required? and
!value.has_key?(option.ruby_name) and
!value.has_key?(option.ruby_name.to_sym) and
!value.has_key?(option.name)
end
end
def request_params(values, prefix = nil)
values.map do |name, value|
name = name.to_s
member_option(name).request_params(value, prefixed_name(prefix))
end.flatten
end
def hash_format(hash)
hash.inject({}) do |hash, (name, value)|
option = member_option(name.to_s)
hash[option.name] = option.hash_format(value)
hash
end
end
end
module Map
def self.apply option, members = {}
option.extend self
key_option = option.key_option(members)
if key_descriptors = members[:key]
key_option = key_option.extend_with_config(*key_descriptors)
MetaUtils.extend_method(option, :key_option) { key_option }
end
value_option = option.value_option(members)
if value_descriptors = members[:value]
value_option = value_option.extend_with_config(*value_descriptors)
MetaUtils.extend_method(option, :value_option) { value_option }
end
key_option.param_name = members[:key_param] if members[:key_param]
value_option.param_name = members[:value_param] if members[:value_param]
separator = members[:flattened] ? '.' : '.entry.'
MetaUtils.extend_method(option, :separator) { separator }
end
def validate(value, context = nil)
raise format_error("hash value", context) unless
value.respond_to?(:to_hash)
context = context_description(context)
value.each do |key, value|
key_option.validate(key, "key of #{context}")
value_option.validate(value, "value at key #{key} of #{context}")
end
end
def request_params values, prefix = nil
index = 0
values.inject([]) do |params, (key,value)|
index += 1
common_prefix = "#{prefixed_name(prefix)}#{separator}#{index}"
key_name = common_prefix + key_option.param_name
value_name = common_prefix + value_option.param_name
params += key_option.request_params(key, common_prefix)
params += value_option.request_params(value, common_prefix)
end
end
def hash_format(value)
value.inject({}) do |hash, (key, value)|
hash[key_option.hash_format(key)] =
value_option.hash_format(value)
hash
end
end
def key_option(options)
@_key_option ||= MapOption.new(options[:key_param] || "key")
end
def value_option(options)
@_value_option ||= MapOption.new(options[:value_param] || "value")
end
end
module Bigdecimal
extend NoArgs
def validate(value, context = nil)
raise format_error("decimal value", context) unless
value.kind_of?(Numeric) or
value.respond_to?(:to_int)
end
def hash_format(value)
BigDecimal(value.to_s)
end
end
# @api private
module Boolean
extend NoArgs
end
end
class DefaultOption
attr_reader :name
def initialize(name)
@name = name
end
def ruby_name
Inflection.ruby_name(name)
end
def request_params(value, prefix = nil)
[Http::Request::Param.new(prefixed_name(prefix), encode_value(value))]
end
def hash_format(value)
value
end
def prefixed_name(prefix)
return "#{prefix}.#{name}" if prefix
name
end
def encode_value(value)
value
end
def required?
false
end
def format_error(expected, context = nil)
context = context_description(context)
FormatError.new(expected, context)
end
def context_description(context)
context or "option #{ruby_name}"
end
def extend_with_config(*descriptors)
option = clone
descriptors.each do |desc|
if desc.kind_of?(Hash)
(name, arg) = desc.to_a.first
next if name == :documentation
else
name = desc
arg = nil
end
class_name = Inflection.class_name(name.to_s)
mod = Descriptors::const_get(class_name)
if arg
mod.apply(option, arg)
else
mod.apply(option)
end
end
option
end
include Descriptors::String
end
# @api private
module ModuleMethods
include Inflection
def customize(config = [])
m = Class.new(self)
supported_options = m.supported_options.inject({}) do |memo, opt|
memo[opt.name] = opt
memo
end
config.each do |option_config|
if config.kind_of?(Hash)
(name, value_desc) = option_config
else
(name, value_desc) = parse_option(option_config)
end
option = supported_options[name] || DefaultOption.new(name)
option = option.extend_with_config(*value_desc)
supported_options[option.name] = option
end
supported_ary = supported_options.values
MetaUtils.extend_method(m, :supported_options) { supported_ary }
supported_ruby_names = supported_ary.inject({}) do |memo, opt|
memo[opt.ruby_name] = opt
memo
end
MetaUtils.extend_method(m, :option) { |n| supported_ruby_names[n] }
supported_ary.each do |opt|
MetaUtils.extend_method(m, "validate_#{opt.ruby_name}") do |value|
opt.validate(value)
end
end
m
end
def option(name)
nil
end
def supported_options
[]
end
def validate(options)
options.each do |name, value|
name = name.to_s
raise ArgumentError.new("unexpected option #{name}") unless
option(name)
option(name).validate(value)
end
supported_options.each do |option|
raise ArgumentError.new("missing required option #{option.ruby_name}") unless
!option.required? ||
options.has_key?(option.ruby_name) || options.has_key?(option.ruby_name.to_sym)
end
end
# Returns the options in AWS/Query format
def request_params(options)
validate(options)
options.map do |(name, value)|
name = name.to_s
option(name).request_params(value)
end.flatten
end
# Returns the options as a hash (which is used to generate JSON
# in to_json).
def to_h(options)
validate(options)
options.inject({}) do |hash, (name, value)|
option = self.option(name.to_s)
hash[option.name] = option.hash_format(value)
hash
end
end
# Returns the options in JSON format
def to_json(options)
to_h(options).to_json
end
def included(m)
m.extend(self::ModuleMethods)
end
protected
def parse_option(option)
value_desc = nil
if option.kind_of? Hash
raise ArgumentError.new("passed empty hash where an option was expected") if
option.empty?
raise ArgumentError.new("too many entries in option description") if
option.size > 1
(name, value_desc) = option.to_a.first
name = name.to_s
raise ArgumentError.new("expected an array for "+
"value description of option #{name},"+
"got #{value_desc.inspect}") unless
value_desc.nil? or value_desc.kind_of?(Array)
else
name = option
end
value_desc ||= []
[name, value_desc]
end
protected
def apply_required_descriptor(m, name)
name = ruby_name(name)
MetaUtils.extend_method(m, :validate) do |opts|
raise ArgumentError.new("missing required option #{name}") unless
opts.key? name or opts.key? name.to_sym
end
end
protected
def apply_integer_descriptor(m, name)
MetaUtils.extend_method(m, "validate_#{ruby_name(name)}") do |value|
raise ArgumentError.new("expected integer value for option #{ruby_name(name)}") unless
value.respond_to? :to_int
end
end
protected
def apply_string_descriptor(m, name)
MetaUtils.extend_method(m, "validate_#{ruby_name(name)}") do |value|
raise ArgumentError.new("expected string value for option #{ruby_name(name)}") unless
value.respond_to? :to_str
end
end
protected
def apply_list_descriptor(m, name, arg)
MetaUtils.extend_method(m, "validate_#{ruby_name(name)}") do |value|
raise ArgumentError.new("expected value for option #{ruby_name(name)} "+
"to respond to #each") unless
value.respond_to? :each
end
MetaUtils.extend_method(m, "params_for_#{ruby_name(name)}") do |value|
i = 0
values = []
value.each do |member|
i += 1
values << Http::Request::Param.new(name+"."+i.to_s, member.to_s)
end
if i > 0
values
else
Http::Request::Param.new(name, "")
end
end
end
protected
def apply_rename_descriptor(m, name, new_name)
name = ruby_name(name)
MetaUtils.extend_method(m, :validate) do |opts|
raise ArgumentError.new("unexpected option foo") if
opts.key?(name) or opts.key?(name.to_sym)
opts = opts.dup
opts[name] = opts[new_name] if opts.key?(new_name)
opts[name.to_sym] = opts[new_name.to_sym] if opts.key?(new_name.to_sym)
opts.delete(new_name)
opts.delete(new_name.to_sym)
super(opts)
end
# couldn't find a better way to alias a class method
method = m.method("params_for_#{name}")
MetaUtils.extend_method(m, "params_for_#{new_name}") do |value|
method.call(value)
end
end
end
class MapOption < DefaultOption
def param_name
@param_name || name
end
def param_name= name
@param_name = name
end
end
extend ModuleMethods
end
end
end
|
#!/bin/bash
# see src/home for the home source code
HOME=$(/usr/local/bin/home)
cd ~/projects/share
#eval $(ssh-agent)
#ssh-add ~/.ssh/key
|
package service_start
import (
"fmt"
"net/http"
"time"
"github.com/tofa-project/client-daemon/db"
"github.com/tofa-project/client-daemon/glob"
httpcodes "github.com/tofa-project/client-daemon/http-codes"
osat "github.com/tofa-project/client-daemon/onion-serv/app-type"
oservapps "github.com/tofa-project/client-daemon/onion-serv/apps-list"
wsrpc_broadcast "github.com/tofa-project/client-daemon/ws-rpc/broadcast"
wsrpc_events "github.com/tofa-project/client-daemon/ws-rpc/events-list"
)
// Handles service registration inbound request
func RegisterService(rw *http.ResponseWriter, r *http.Request, rApp *osat.App, iMap map[string]string) {
w := *rw
name, isName := iMap["name"]
description, isDes := iMap["description"]
if !isName || !isDes {
w.WriteHeader(400)
return
}
// waits for response from ws pipes
//
resChan := make(chan int)
defer close(resChan)
var app *osat.App
// state whether WriteHeader has been invoked or not
sent := false
// broadcast request to all connected ws clients
// ws clients will respond with a JSON containing the verdict
wsrpc_broadcast.Broadcast(glob.J{
"type": "event",
"eventName": wsrpc_events.O_INCOMING_REGISTRATION,
"localAppName": rApp.GetData()["name"].(string),
"remoteServiceName": name,
"remoteServiceDescription": description,
}, func(fIMap glob.J) {
if sent {
return
}
if fIMap["allow"].(bool) {
resChanSent := false
oservapps.Apps.Range(func(key, value interface{}) bool {
rApp := value.(*osat.App)
host := fmt.Sprintf("%s.onion:%s", rApp.Onion.ID, rApp.GetData()["port"])
if host == r.Host {
app = rApp
// reply code
resChanSent = true
// update data
rApp.MuxData.Lock()
rApp.Data["is_registered"] = "1"
db.UpdateApp(rApp.Data["id"].(string), rApp.Data)
rApp.MuxData.Unlock()
resChan <- httpcodes.ACTION_ALLOWED
return false
}
return true
})
if !resChanSent {
resChan <- httpcodes.CL_DA_CONFLICT
}
} else {
resChan <- httpcodes.ACTION_REJECTED
}
})
// handles timeout
go func() {
time.Sleep(glob.C_HTTP_RES_TIMEOUT * time.Minute)
if !sent {
resChan <- http.StatusRequestTimeout
}
}()
resCode := <-resChan
w.WriteHeader(resCode)
if resCode == httpcodes.ACTION_ALLOWED {
w.Write([]byte(fmt.Sprintf(`{"auth_token":"%s"}`, app.GetData()["id"])))
}
sent = true
}
|
Rails.application.routes.draw do
get "search", to: "query#search"
delete "clear_stats", to: "query#destroy_all"
root to: "query#index"
end
|
## 概要
- `void superset_zeta_transform(vector<T>& a)` :
次の条件を満たす $b$ を計算し、 $a$ に代入する。
- $\displaystyle b_i = \sum_{i \in j} a_j$
- `void superset_moebius_transform(vector<T>& a)` :
次の条件を満たす $b$ を計算し、 $a$ に代入する。
- $\displaystyle a_i = \sum_{i \in j} b_j$
|
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:gdsc_solution_challenge/custom_components/bottom_navy_bar.dart';
import 'package:gdsc_solution_challenge/models/event_model.dart';
import 'package:gdsc_solution_challenge/providers/theme_provider.dart';
import 'package:gdsc_solution_challenge/providers/user_provider.dart';
import 'package:gdsc_solution_challenge/screens/attending_event_detail_screen.dart';
import 'package:gdsc_solution_challenge/screens/login_screen.dart';
import 'package:gdsc_solution_challenge/screens/organising_event_detail_screen.dart';
import 'package:gdsc_solution_challenge/services/auth_service.dart';
import 'package:gdsc_solution_challenge/widgets/loader.dart';
import 'package:glass_kit/glass_kit.dart';
import 'package:provider/provider.dart';
import 'package:intl/intl.dart';
class UserEventsDashboard extends StatelessWidget {
// route name
static const routeName = '/user-events-dashboard';
// constructor
const UserEventsDashboard({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return StreamBuilder(
stream: AuthService().userStream,
builder: (ctx, snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
return const LoadingScreen();
} else if (snapshot.hasError) {
return const Center(
child: Text('Some Error Occured'),
);
} else if (snapshot.hasData) {
return const UserEventsDashboardLoggedIn();
} else {
return const LoginScreen();
}
},
);
}
}
class UserEventsDashboardLoggedIn extends StatefulWidget {
const UserEventsDashboardLoggedIn({Key? key}) : super(key: key);
@override
State<UserEventsDashboardLoggedIn> createState() =>
_UserEventsDashboardLoggedInState();
}
class _UserEventsDashboardLoggedInState
extends State<UserEventsDashboardLoggedIn> {
int _currentIndex = 0;
late PageController _pageController;
@override
void initState() {
super.initState();
_pageController = PageController();
}
@override
void dispose() {
_pageController.dispose();
super.dispose();
}
// conditionally renderring appbar text
String _appBarText() {
switch (_currentIndex) {
case 0:
return 'Attending Events';
case 1:
return 'Organising Events';
default:
return 'Something went wrong';
}
}
void _handleBottomNavBarTap(int index) {
_pageController.animateToPage(index,
duration: const Duration(milliseconds: 300), curve: Curves.ease);
}
@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
gradient: context.watch<Themes>().currentThemeBackgroundGradient,
),
child: Scaffold(
appBar: AppBar(
title: Text(_appBarText()),
),
extendBody: true,
body: PageView(
controller: _pageController,
onPageChanged: (index) {
setState(() {
_currentIndex = index;
});
},
children: const <Widget>[
UserEventsList(
isAttendingEvents: true,
),
UserEventsList(
isAttendingEvents: false,
),
],
),
bottomNavigationBar: BottomNavigation(
currentIndex: _currentIndex,
onTap: _handleBottomNavBarTap,
),
),
);
}
}
class BottomNavigation extends StatelessWidget {
final int currentIndex;
final void Function(int) onTap;
BottomNavigation({
Key? key,
required this.currentIndex,
required this.onTap,
}) : super(key: key);
final _containerHeight = Platform.isIOS ? 100.00 : 70.00;
@override
Widget build(BuildContext context) {
return GlassContainer.frostedGlass(
height: _containerHeight,
width: double.maxFinite,
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(20),
topRight: Radius.circular(20),
bottomLeft: Radius.zero,
bottomRight: Radius.zero,
),
borderColor: Colors.white.withOpacity(0.8),
borderWidth: 1,
padding: const EdgeInsets.symmetric(
vertical: 10,
),
child: BottomNavyBar(
selectedIndex: currentIndex,
showElevation: false,
backgroundColor: Colors.transparent,
containerHeight: _containerHeight,
onItemSelected: (index) => onTap(index),
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
items: [
BottomNavyBarItem(
icon: const Icon(Icons.event_outlined),
title: const Text('Attending Events'),
activeColor: Theme.of(context).primaryColor,
textAlign: TextAlign.center,
inactiveColor: Theme.of(context).colorScheme.onPrimary,
),
BottomNavyBarItem(
textAlign: TextAlign.center,
icon: const Icon(Icons.extension_outlined),
title: const Text('Organising'),
activeColor: Theme.of(context).primaryColor,
inactiveColor: Theme.of(context).colorScheme.onPrimary,
),
],
),
);
}
}
class UserEventsList extends StatelessWidget {
final bool isAttendingEvents;
const UserEventsList({
required this.isAttendingEvents,
Key? key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
final userData = context.watch<UserProvider>();
final events = isAttendingEvents
? userData.getEventsAttending
: userData.getEventsOrganising;
return ListView.builder(
itemCount: events.length,
itemBuilder: (ctx, i) {
return UserEventsCard(
event: events[i],
isAttendingEvents: isAttendingEvents,
);
},
);
}
}
class UserEventsCard extends StatelessWidget {
final Event event;
final bool isAttendingEvents;
const UserEventsCard({
Key? key,
required this.event,
required this.isAttendingEvents,
}) : super(key: key);
bool _isFutureEvent() {
DateTime now = DateTime.now();
DateTime eventDate = DateFormat('dd/MM/yyyy').parse(event.date);
return eventDate.isAfter(now);
}
@override
Widget build(BuildContext context) {
return Stack(
children: [
GlassContainer.frostedGlass(
height: 230,
width: double.maxFinite,
margin: const EdgeInsets.all(5),
borderRadius: BorderRadius.circular(20),
borderWidth: 2,
child: LayoutBuilder(
builder: (_, constraints) {
return InkWell(
onTap: isAttendingEvents
? () => Navigator.of(context).pushNamed(
AttendingEventDetailScreen.routeName,
arguments: event,
)
: () => Navigator.of(context).pushNamed(
OrganisingEventDetailScreen.routeName,
arguments: event,
),
child: Container(
margin: const EdgeInsets.only(top: 2),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
ClipRRect(
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(18),
topRight: Radius.circular(18),
),
child: Image.network(
event.image,
height: 150,
width: constraints.maxWidth - 4,
fit: BoxFit.cover,
),
),
Padding(
padding: const EdgeInsets.all(10),
child: Column(
children: [
Align(
alignment: Alignment.centerLeft,
child: Text(
event.eventTitle,
style: Theme.of(context)
.textTheme
.titleLarge!
.copyWith(
fontWeight: FontWeight.bold,
letterSpacing: 1,
),
),
),
const SizedBox(height: 8),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.max,
children: [
IntrinsicHeight(
child: Row(
children: [
Text(event.tags[0]),
const VerticalDivider(
thickness: 1,
color: Colors.white,
),
Text(event.tags[1]),
],
),
),
Row(
children: [
const Icon(
Icons.calendar_today,
size: 15,
color: Colors.white,
),
const SizedBox(width: 10),
Text(
event.date,
),
],
)
],
)
],
),
)
],
),
),
);
},
),
),
if (_isFutureEvent())
Positioned(
top: 20,
right: 20,
child: Container(
decoration: const BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(10),
),
),
child: Padding(
padding: const EdgeInsets.all(5),
child: Text(
"🤩 Upcomming",
style: Theme.of(context).textTheme.titleMedium?.copyWith(
color: Theme.of(context).colorScheme.secondary,
fontWeight: FontWeight.bold,
),
),
),
),
),
],
);
}
}
|
#include "types.h"
/*
* --INFO--
* Address: ........
* Size: 00009C
*/
void _Error(char*, ...)
{
// UNUSED FUNCTION
}
/*
* --INFO--
* Address: ........
* Size: 0000F4
*/
void _Print(char*, ...)
{
// UNUSED FUNCTION
}
/*
* --INFO--
* Address: ........
* Size: 0000E4
*/
void showFrame(bool, float)
{
// UNUSED FUNCTION
}
/*
* --INFO--
* Address: 80056B00
* Size: 000118
*/
void createMenuWindow()
{
/*
.loc_0x0:
mflr r0
li r4, 0
stw r0, 0x4(r1)
li r5, 0
li r6, 0
stwu r1, -0x30(r1)
stw r31, 0x2C(r1)
stw r30, 0x28(r1)
stw r29, 0x24(r1)
stw r28, 0x20(r1)
lwz r3, 0x2DEC(r13)
lwz r12, 0x1A0(r3)
lwz r12, 0x2C(r12)
mtlr r12
blrl
lwz r3, 0x2DEC(r13)
li r0, 0
li r4, 0x5
addi r5, r3, 0x2A4
lwz r3, 0x2A4(r3)
stw r0, 0x0(r5)
neg r5, r3
subic r0, r5, 0x1
lwz r3, 0x2DEC(r13)
subfe r0, r0, r5
rlwinm r31,r0,0,24,31
lwz r28, 0x194(r3)
bl -0x17B04
lwz r3, 0x2DEC(r13)
li r4, 0x5
bl -0x17B58
lwz r30, 0x0(r3)
li r0, 0x1
stw r0, 0x0(r3)
li r3, 0x6C
bl -0xFB88
addi r29, r3, 0
mr. r3, r29
beq- .loc_0xA0
bl 0x13BA30
.loc_0xA0:
stw r29, 0x2E84(r13)
lwz r3, 0x2E84(r13)
bl 0x13BE20
lwz r3, 0x2DEC(r13)
li r4, 0x5
bl -0x17B94
stw r30, 0x0(r3)
mr r4, r28
lwz r3, 0x2DEC(r13)
bl -0x17B5C
lwz r3, 0x2DEC(r13)
li r0, 0
stw r0, 0x2A0(r3)
lwz r3, 0x2DEC(r13)
stw r31, 0x2A4(r3)
lwz r3, 0x2DEC(r13)
lwz r12, 0x1A0(r3)
lwz r12, 0x30(r12)
mtlr r12
blrl
lwz r3, 0x2DEC(r13)
bl -0x17568
lwz r0, 0x34(r1)
lwz r31, 0x2C(r1)
lwz r30, 0x28(r1)
lwz r29, 0x24(r1)
lwz r28, 0x20(r1)
addi r1, r1, 0x30
mtlr r0
blr
*/
}
/*
* --INFO--
* Address: ........
* Size: 000040
*/
void deleteMenuWindow()
{
// UNUSED FUNCTION
}
/*
* --INFO--
* Address: 80056C18
* Size: 0001B0
*/
void createTutorialWindow(int, int, bool)
{
/*
.loc_0x0:
mflr r0
li r6, 0
stw r0, 0x4(r1)
stwu r1, -0x48(r1)
stmw r27, 0x34(r1)
mr r30, r3
mr r29, r4
addi r28, r5, 0
li r4, 0
li r5, 0
lwz r3, 0x2DEC(r13)
lwz r12, 0x1A0(r3)
lwz r12, 0x2C(r12)
mtlr r12
blrl
lwz r3, 0x2DEC(r13)
li r5, 0
lwzu r0, 0x2A4(r3)
cmpwi r29, 0
stw r5, 0x0(r3)
neg r4, r0
subic r0, r4, 0x1
lwz r3, 0x2DEC(r13)
subfe r0, r0, r4
rlwinm r31,r0,0,24,31
lwz r27, 0x194(r3)
blt- .loc_0x78
rlwinm. r0,r28,0,24,31
beq- .loc_0x78
li r5, 0x1
.loc_0x78:
rlwinm. r0,r5,0,24,31
stb r5, 0x2E8C(r13)
beq- .loc_0x94
addi r3, r29, 0x1
rlwinm r4,r28,0,24,31
bl -0x3BB84
b .loc_0x9C
.loc_0x94:
mr r3, r30
bl -0x3BA50
.loc_0x9C:
lwz r3, 0x2DEC(r13)
li r4, 0x5
bl -0x17C54
lwz r3, 0x2DEC(r13)
li r4, 0x5
bl -0x17CA8
lwz r29, 0x0(r3)
li r0, 0x1
stw r0, 0x0(r3)
li r3, 0x8
bl -0xFCD8
addi r28, r3, 0
mr. r3, r28
beq- .loc_0xD8
bl 0x12BEA8
.loc_0xD8:
stw r28, 0x2E88(r13)
mr r4, r30
lwz r3, 0x2E88(r13)
bl 0x12C004
lwz r3, 0x2DEC(r13)
li r4, 0x5
bl -0x17CE8
stw r29, 0x0(r3)
mr r4, r27
lwz r3, 0x2DEC(r13)
bl -0x17CB0
lbz r0, 0x2E81(r13)
cmplwi r0, 0
beq- .loc_0x15C
lbz r0, 0x2E82(r13)
cmplwi r0, 0
beq- .loc_0x15C
lwz r3, 0x2F6C(r13)
bl 0x2973C
rlwinm. r0,r3,0,24,31
bne- .loc_0x140
lwz r3, 0x2E5C(r13)
li r4, 0x1
lfs f1, -0x7A88(r2)
lwz r3, 0x344(r3)
bl 0x161DEC
.loc_0x140:
lwz r3, 0x2E5C(r13)
li r4, 0x1
lfs f1, -0x7A88(r2)
lwz r3, 0x344(r3)
bl 0x161F08
li r0, 0
stb r0, 0x2E82(r13)
.loc_0x15C:
lis r3, 0x803A
subi r3, r3, 0x2848
li r0, 0x1
stw r0, 0x340(r3)
li r0, 0
lwz r3, 0x2DEC(r13)
stw r0, 0x2A0(r3)
lwz r3, 0x2DEC(r13)
stw r31, 0x2A4(r3)
lwz r3, 0x2DEC(r13)
lwz r12, 0x1A0(r3)
lwz r12, 0x30(r12)
mtlr r12
blrl
lwz r3, 0x2DEC(r13)
bl -0x17724
lmw r27, 0x34(r1)
lwz r0, 0x4C(r1)
addi r1, r1, 0x48
mtlr r0
blr
*/
}
/*
* --INFO--
* Address: 80056DC8
* Size: 0000BC
*/
void deleteTutorialWindow()
{
/*
.loc_0x0:
mflr r0
stw r0, 0x4(r1)
stwu r1, -0x8(r1)
lbz r0, 0x2E8C(r13)
cmplwi r0, 0
beq- .loc_0x20
bl -0x3BBE0
b .loc_0x24
.loc_0x20:
bl -0x3BAE8
.loc_0x24:
lis r3, 0x803A
subi r3, r3, 0x2848
li r0, 0
stw r0, 0x340(r3)
lbz r0, 0x2E8D(r13)
cmplwi r0, 0
bne- .loc_0x98
lbz r0, 0x2E81(r13)
cmplwi r0, 0
beq- .loc_0x98
lbz r0, 0x2E82(r13)
cmplwi r0, 0
bne- .loc_0x98
lwz r3, 0x2F6C(r13)
bl 0x29650
rlwinm. r0,r3,0,24,31
bne- .loc_0x7C
lwz r3, 0x2E5C(r13)
li r4, 0x1
lfs f1, -0x7A88(r2)
lwz r3, 0x344(r3)
bl 0x161C84
.loc_0x7C:
lwz r3, 0x2E5C(r13)
li r4, 0x1
lfs f1, -0x7A88(r2)
lwz r3, 0x344(r3)
bl 0x161D6C
li r0, 0x1
stb r0, 0x2E82(r13)
.loc_0x98:
lis r3, 0x803A
subi r3, r3, 0x2848
li r0, 0
stw r0, 0x338(r3)
stw r0, 0x2E88(r13)
lwz r0, 0xC(r1)
addi r1, r1, 0x8
mtlr r0
blr
*/
}
/*
* --INFO--
* Address: ........
* Size: 0000A8
*/
void handleTutorialWindow(unsigned long&, Controller*)
{
// UNUSED FUNCTION
}
/*
* --INFO--
* Address: 80056E84
* Size: 000118
*/
BaseGameSection::BaseGameSection()
{
/*
.loc_0x0:
mflr r0
lis r4, 0x8022
stw r0, 0x4(r1)
subi r0, r13, 0x7268
stwu r1, -0x28(r1)
stmw r26, 0x10(r1)
addi r31, r3, 0
addi r30, r4, 0x738C
lis r3, 0x8022
addi r27, r3, 0x737C
lis r3, 0x8023
subi r29, r3, 0x71E0
li r28, 0
addi r3, r31, 0
stw r30, 0x0(r31)
subi r4, r13, 0x7268
stw r27, 0x0(r31)
stw r28, 0x10(r31)
stw r28, 0xC(r31)
stw r28, 0x8(r31)
stw r0, 0x4(r31)
stw r29, 0x0(r31)
bl -0x167A0
lis r3, 0x802A
addi r0, r3, 0x7F14
stw r0, 0x0(r31)
li r0, 0x6
li r3, 0x50
stw r0, 0x40(r31)
stw r28, 0x20(r31)
stw r28, 0x34(r31)
stw r28, 0x38(r31)
bl -0xFF00
mr. r26, r3
beq- .loc_0xDC
stw r30, 0x0(r26)
lis r3, 0x802A
addi r30, r3, 0x7AFC
stw r27, 0x0(r26)
addi r3, r26, 0
addi r4, r30, 0
stw r28, 0x10(r26)
stw r28, 0xC(r26)
stw r28, 0x8(r26)
bl -0x32060
stw r29, 0x0(r26)
addi r3, r26, 0
addi r4, r30, 0
bl -0x16808
lis r3, 0x8023
subi r0, r3, 0x714C
stw r0, 0x0(r26)
addi r3, r26, 0
li r4, 0x1
bl -0x165AC
.loc_0xDC:
stw r26, 0x24(r31)
li r0, 0
addi r3, r31, 0
stw r0, 0x3C(r31)
lfs f0, -0x7A84(r2)
stfs f0, 0x28(r31)
lfs f0, -0x7A80(r2)
stfs f0, 0x2C(r31)
lfs f0, -0x7A88(r2)
stfs f0, 0x30(r31)
lwz r0, 0x2C(r1)
lmw r26, 0x10(r1)
addi r1, r1, 0x28
mtlr r0
blr
*/
}
/*
* --INFO--
* Address: 80056F9C
* Size: 000244
*/
void BaseGameSection::draw(Graphics&)
{
/*
.loc_0x0:
mflr r0
stw r0, 0x4(r1)
li r0, 0
stwu r1, -0xC8(r1)
stfd f31, 0xC0(r1)
addi r5, r1, 0x4C
stw r31, 0xBC(r1)
mr r31, r4
stw r30, 0xB8(r1)
mr r30, r3
mr r3, r31
stw r29, 0xB4(r1)
lwz r7, 0x310(r4)
lwz r6, 0x30C(r4)
addi r4, r1, 0x5C
stw r0, 0x4C(r1)
stw r0, 0x50(r1)
stw r6, 0x54(r1)
stw r7, 0x58(r1)
lwz r12, 0x3B4(r31)
lwz r12, 0x40(r12)
mtlr r12
blrl
lfs f2, 0x28(r30)
lfs f0, 0x2C(r30)
fcmpo cr0, f2, f0
bge- .loc_0x9C
lwz r3, 0x2DEC(r13)
lfs f1, 0x30(r30)
lfs f0, 0x28C(r3)
fmuls f0, f1, f0
fadds f0, f2, f0
stfs f0, 0x28(r30)
lfs f0, 0x28(r30)
lfs f1, 0x2C(r30)
fcmpo cr0, f0, f1
ble- .loc_0xCC
stfs f1, 0x28(r30)
b .loc_0xCC
.loc_0x9C:
ble- .loc_0xCC
lwz r3, 0x2DEC(r13)
lfs f1, 0x30(r30)
lfs f0, 0x28C(r3)
fmuls f0, f1, f0
fsubs f0, f2, f0
stfs f0, 0x28(r30)
lfs f0, 0x28(r30)
lfs f1, 0x2C(r30)
fcmpo cr0, f0, f1
bge- .loc_0xCC
stfs f1, 0x28(r30)
.loc_0xCC:
lfs f2, 0x28(r30)
lfs f1, -0x7A80(r2)
fcmpo cr0, f2, f1
bge- .loc_0x1A8
lfs f0, -0x7A84(r2)
fcmpo cr0, f2, f0
bge- .loc_0xF0
fmr f2, f0
b .loc_0xFC
.loc_0xF0:
fcmpo cr0, f2, f1
ble- .loc_0xFC
fmr f2, f1
.loc_0xFC:
lfs f0, -0x7A80(r2)
li r29, 0
stb r29, 0x48(r1)
addi r4, r1, 0x48
fsubs f0, f0, f2
lfs f1, -0x7A7C(r2)
mr r3, r31
stb r29, 0x49(r1)
li r5, 0x1
fmuls f0, f1, f0
stb r29, 0x4A(r1)
fctiwz f31, f0
stfd f31, 0xA8(r1)
lwz r0, 0xAC(r1)
stb r0, 0x4B(r1)
lwz r12, 0x3B4(r31)
lwz r12, 0xA8(r12)
mtlr r12
blrl
stb r29, 0x44(r1)
addi r4, r1, 0x44
addi r3, r31, 0
stfd f31, 0xA0(r1)
stb r29, 0x45(r1)
lwz r0, 0xA4(r1)
stb r29, 0x46(r1)
stb r0, 0x47(r1)
lwz r12, 0x3B4(r31)
lwz r12, 0xAC(r12)
mtlr r12
blrl
lwz r5, 0x310(r31)
addi r4, r1, 0x34
lwz r0, 0x30C(r31)
mr r3, r31
stw r29, 0x34(r1)
stw r29, 0x38(r1)
stw r0, 0x3C(r1)
stw r5, 0x40(r1)
lwz r12, 0x3B4(r31)
lwz r12, 0xD4(r12)
mtlr r12
blrl
.loc_0x1A8:
lis r3, 0x803A
subi r3, r3, 0x2848
addi r6, r3, 0x310
lwz r0, 0x310(r3)
cmplwi r0, 0
beq- .loc_0x210
addi r5, r3, 0x314
lfs f2, -0x7A84(r2)
lfs f1, 0x314(r3)
fcmpo cr0, f1, f2
ble- .loc_0x210
lwz r4, 0x2DEC(r13)
lfs f0, 0x28C(r4)
fsubs f0, f1, f0
stfs f0, 0x0(r5)
lfs f1, 0x0(r5)
fcmpo cr0, f1, f2
bge- .loc_0x200
li r0, 0
stw r0, 0x0(r6)
stfs f2, 0x0(r5)
b .loc_0x210
.loc_0x200:
lwz r6, 0x0(r6)
addi r4, r31, 0
li r5, 0
bl -0x5BE0
.loc_0x210:
lwz r3, 0x34(r30)
lwz r12, 0x4(r3)
lwz r12, 0x10(r12)
mtlr r12
blrl
lwz r0, 0xCC(r1)
lfd f31, 0xC0(r1)
lwz r31, 0xBC(r1)
lwz r30, 0xB8(r1)
lwz r29, 0xB4(r1)
addi r1, r1, 0xC8
mtlr r0
blr
*/
}
/*
* --INFO--
* Address: 800571E0
* Size: 000004
*/
void ModeState::postUpdate() { }
/*
* --INFO--
* Address: 800571E4
* Size: 000128
*/
void IntroGameModeState::update(unsigned long&)
{
/*
.loc_0x0:
mflr r0
stw r0, 0x4(r1)
li r0, 0x1
stwu r1, -0x18(r1)
stw r31, 0x14(r1)
mr r31, r3
stw r0, 0x0(r4)
lwz r3, 0x2E88(r13)
lwz r4, 0x0(r31)
cmplwi r3, 0
lwz r4, 0x24(r4)
beq- .loc_0x60
bl 0x12BA00
cmpwi r3, 0x4
bne- .loc_0x60
lis r3, 0x803A
subi r3, r3, 0x2848
lwz r3, 0x1DC(r3)
lbz r0, 0x124(r3)
cmplwi r0, 0
beq- .loc_0x5C
li r4, 0x2
bl 0x20A18
.loc_0x5C:
bl -0x478
.loc_0x60:
lis r3, 0x803A
subi r3, r3, 0x2848
lwz r3, 0x1DC(r3)
lbz r0, 0x124(r3)
cmplwi r0, 0
bne- .loc_0x110
lbz r0, 0x2E82(r13)
li r3, 0x1
stb r3, 0x2E81(r13)
cmplwi r0, 0
bne- .loc_0xCC
lwz r3, 0x2F6C(r13)
bl 0x29200
rlwinm. r0,r3,0,24,31
bne- .loc_0xB0
lwz r3, 0x2E5C(r13)
li r4, 0x1
lfs f1, -0x7A78(r2)
lwz r3, 0x344(r3)
bl 0x161834
.loc_0xB0:
lwz r3, 0x2E5C(r13)
li r4, 0x1
lfs f1, -0x7A78(r2)
lwz r3, 0x344(r3)
bl 0x16191C
li r0, 0x1
stb r0, 0x2E82(r13)
.loc_0xCC:
li r3, 0x10
bl -0x102B0
cmplwi r3, 0
beq- .loc_0x114
lis r4, 0x802A
lwz r5, 0x0(r31)
addi r0, r4, 0x7ECC
stw r0, 0x4(r3)
lis r4, 0x802A
addi r4, r4, 0x7E80
stw r5, 0x0(r3)
li r0, 0
stw r4, 0x4(r3)
stb r0, 0x8(r3)
lwz r0, 0x24(r5)
stw r0, 0xC(r3)
b .loc_0x114
.loc_0x110:
mr r3, r31
.loc_0x114:
lwz r0, 0x1C(r1)
lwz r31, 0x14(r1)
addi r1, r1, 0x18
mtlr r0
blr
*/
}
/*
* --INFO--
* Address: 8005730C
* Size: 000640
*/
void RunningModeState::update(unsigned long&)
{
/*
.loc_0x0:
mflr r0
lis r5, 0x803A
stw r0, 0x4(r1)
li r0, 0x7
stwu r1, -0x58(r1)
stmw r25, 0x3C(r1)
subi r30, r5, 0x2848
addi r31, r3, 0
addi r26, r4, 0
addi r28, r30, 0x1DC
stw r0, 0x0(r4)
lwz r3, 0x1DC(r30)
lbz r5, 0x124(r3)
cmplwi r5, 0
bne- .loc_0x178
lwz r0, 0x340(r30)
cmpwi r0, 0
bne- .loc_0x178
lha r0, 0x1E4(r30)
cmpwi r0, 0
beq- .loc_0x178
lwz r0, 0x0(r26)
li r3, 0xC
rlwinm r0,r0,0,0,30
stw r0, 0x0(r26)
lwz r0, 0x1FC(r30)
lwz r4, 0x0(r31)
stw r0, 0x40(r4)
bl -0x10378
addi r29, r3, 0
mr. r0, r29
beq- .loc_0x170
lis r3, 0x802A
lwz r5, 0x0(r31)
addi r0, r3, 0x7ECC
stw r0, 0x4(r29)
lis r4, 0x802A
lis r3, 0x803A
stw r5, 0x0(r29)
addi r0, r4, 0x7E18
subi r3, r3, 0x24E0
stw r0, 0x4(r29)
li r0, 0x1
stw r0, 0x238(r3)
lwz r3, 0x2E5C(r13)
bl 0xB96E0
lwz r4, 0x20(r30)
addi r3, r30, 0x2D8
lfs f1, 0x20(r4)
bl -0x5BB4
lwz r3, 0x2E5C(r13)
li r4, 0x1
lfs f1, -0x7A88(r2)
lwz r3, 0x344(r3)
bl 0x16175C
lwz r3, 0x2E5C(r13)
li r4, 0x1
lfs f1, -0x7A88(r2)
lwz r3, 0x344(r3)
bl 0x161878
lwz r3, 0x2E5C(r13)
bl 0xB69C4
lwz r0, 0x2FC(r30)
cmpwi r0, 0x1E
bge- .loc_0x150
lwz r3, 0x2F6C(r13)
bl 0x2985C
cmpwi r3, 0x1E
beq- .loc_0x150
lwz r0, 0x2B4(r30)
cmpwi r0, 0
bne- .loc_0x150
lfs f0, -0x7A74(r2)
li r4, 0x1C
lwz r3, 0x0(r29)
li r5, 0
li r6, 0
stfs f0, 0x28(r3)
li r7, 0
li r8, 0
lwz r3, 0x0(r28)
li r9, -0x1
li r10, 0x1
bl 0x1FD08
.loc_0x150:
lfs f0, -0x7A80(r2)
li r0, 0
lwz r3, 0x0(r29)
stfs f0, 0x2C(r3)
lfs f0, -0x7A88(r2)
lwz r3, 0x0(r29)
stfs f0, 0x30(r3)
stw r0, 0x8(r29)
.loc_0x170:
mr r3, r29
b .loc_0x62C
.loc_0x178:
lis r3, 0x803A
subi r4, r3, 0x2848
addi r6, r4, 0x1E4
lha r0, 0x1E4(r4)
cmpwi r0, 0
bne- .loc_0x1C0
cmplwi r5, 0
bne- .loc_0x1C0
lwz r3, 0x20(r4)
lfs f1, 0x2F0(r4)
lfs f0, 0x20(r3)
fcmpo cr0, f1, f0
cror 2, 0x1, 0x2
bne- .loc_0x1C0
li r0, 0
stw r0, 0x334(r4)
li r0, 0x1
sth r0, 0x1E6(r4)
.loc_0x1C0:
lis r3, 0x803A
subi r27, r3, 0x2848
addi r29, r27, 0x1E6
lha r0, 0x1E6(r27)
cmpwi r0, 0
beq- .loc_0x268
lwz r0, 0x338(r27)
cmpwi r0, 0
bne- .loc_0x268
li r25, 0x1
sth r25, 0x0(r6)
li r0, 0
sth r0, 0x0(r29)
lwz r3, 0x2F6C(r13)
bl 0x2976C
cmpwi r3, 0x1E
beq- .loc_0x268
lwz r0, 0x2FC(r27)
cmpwi r0, 0x1E
bne- .loc_0x268
lwz r3, 0x2F6C(r13)
bl 0x28664
rlwinm. r0,r3,0,24,31
beq- .loc_0x24C
lis r3, 0x803A
subi r3, r3, 0x24E0
stw r25, 0x244(r3)
li r4, 0
li r5, 0x1C
lwz r3, 0x1E8(r27)
lwz r12, 0x0(r3)
lwz r12, 0x8(r12)
mtlr r12
blrl
b .loc_0x268
.loc_0x24C:
lwz r3, 0x1E8(r27)
li r4, 0
li r5, 0x1C
lwz r12, 0x0(r3)
lwz r12, 0x8(r12)
mtlr r12
blrl
.loc_0x268:
lis r3, 0x803A
subi r3, r3, 0x2848
lwz r3, 0x1E8(r3)
li r6, 0
lwz r0, 0x10C(r3)
cmpwi r0, 0
beq- .loc_0x288
li r6, 0x1
.loc_0x288:
lis r4, 0x803A
subi r25, r4, 0x2848
addi r27, r25, 0x334
lwz r0, 0x334(r25)
cmpwi r0, 0
beq- .loc_0x3A4
addi r30, r25, 0x338
lwz r5, 0x338(r25)
cmpwi r5, 0
bne- .loc_0x3A4
lwz r0, 0x33C(r25)
cmpwi r0, 0
bne- .loc_0x3A4
lwz r4, 0x0(r28)
lbz r0, 0x124(r4)
cmplwi r0, 0
bne- .loc_0x3A4
lwz r4, 0xC(r31)
lwz r4, 0x28(r4)
rlwinm. r0,r4,0,7,7
beq- .loc_0x330
cmpwi r5, 0
bne- .loc_0x3A4
rlwinm. r0,r6,0,24,31
bne- .loc_0x3A4
li r3, 0x113
bl 0x4DD78
lwz r0, 0x2B4(r25)
lwz r3, 0x2E70(r13)
neg r4, r0
subic r0, r4, 0x1
subfe r0, r0, r4
rlwinm r4,r0,0,24,31
bl 0x12B024
lwz r3, 0x0(r30)
li r0, 0x1
neg r4, r3
subic r3, r4, 0x1
subfe r3, r3, r4
stb r3, 0x8(r31)
stw r0, 0x0(r30)
b .loc_0x3A4
.loc_0x330:
lwz r0, 0x2B4(r25)
cmpwi r0, 0
bne- .loc_0x3A4
rlwinm. r0,r4,0,16,16
beq- .loc_0x3A4
lwz r4, 0x20(r25)
lfs f0, -0x7A70(r2)
lfs f1, 0x20(r4)
lfs f2, 0x2F0(r25)
fsubs f0, f1, f0
fcmpo cr0, f2, f0
bge- .loc_0x3A4
cmpwi r5, 0
bne- .loc_0x3A4
rlwinm. r0,r6,0,24,31
bne- .loc_0x3A4
lwz r12, 0x0(r3)
li r4, 0x11
li r5, 0
lwz r12, 0x8(r12)
mtlr r12
blrl
lwz r3, 0x0(r30)
li r0, 0x1
neg r4, r3
subic r3, r4, 0x1
subfe r3, r3, r4
stb r3, 0x8(r31)
stw r0, 0x0(r30)
.loc_0x3A4:
lis r3, 0x803A
subi r3, r3, 0x24E0
lwz r0, 0x234(r3)
cmpwi r0, 0
beq- .loc_0x458
cmpwi r0, 0x2
bne- .loc_0x408
lwz r4, 0x0(r31)
li r0, 0x7
li r3, 0x14
stw r0, 0x40(r4)
bl -0x106D8
cmplwi r3, 0
beq- .loc_0x62C
lis r4, 0x802A
lwz r5, 0x0(r31)
addi r0, r4, 0x7ECC
stw r0, 0x4(r3)
lis r4, 0x802A
addi r0, r4, 0x7E4C
stw r5, 0x0(r3)
stw r0, 0x4(r3)
lfs f0, -0x7A88(r2)
stfs f0, 0x10(r3)
b .loc_0x62C
.loc_0x408:
cmpwi r0, 0x1
bne- .loc_0x458
lwz r4, 0x0(r31)
li r0, 0x7
li r3, 0x14
stw r0, 0x40(r4)
bl -0x10728
cmplwi r3, 0
beq- .loc_0x62C
lis r4, 0x802A
lwz r5, 0x0(r31)
addi r0, r4, 0x7ECC
stw r0, 0x4(r3)
lis r4, 0x802A
addi r0, r4, 0x7E4C
stw r5, 0x0(r3)
stw r0, 0x4(r3)
lfs f0, -0x7A6C(r2)
stfs f0, 0x10(r3)
b .loc_0x62C
.loc_0x458:
lwz r3, 0x2E68(r13)
cmplwi r3, 0
beq- .loc_0x46C
lwz r4, 0xC(r31)
bl 0x191874
.loc_0x46C:
lwz r3, 0x2E84(r13)
cmplwi r3, 0
beq- .loc_0x4C4
lwz r4, 0xC(r31)
bl 0x13B4AC
cmpwi r3, 0
bne- .loc_0x498
lwz r0, 0x0(r26)
rlwinm r0,r0,0,0,30
stw r0, 0x0(r26)
b .loc_0x4C4
.loc_0x498:
cmpwi r3, 0x3
bne- .loc_0x4C4
lwz r3, 0x2DEC(r13)
li r4, 0x5
li r5, 0x1
bl -0x18784
lis r3, 0x803A
subi r3, r3, 0x2848
li r0, 0
stw r0, 0x338(r3)
stw r0, 0x2E84(r13)
.loc_0x4C4:
lwz r3, 0x2E88(r13)
lwz r4, 0xC(r31)
cmplwi r3, 0
beq- .loc_0x4FC
bl 0x12B434
cmpwi r3, 0x4
bne- .loc_0x4FC
lwz r3, 0x0(r28)
lbz r0, 0x124(r3)
cmplwi r0, 0
beq- .loc_0x4F8
li r4, 0x2
bl 0x20454
.loc_0x4F8:
bl -0xA3C
.loc_0x4FC:
lwz r3, 0x2E70(r13)
lwz r4, 0xC(r31)
bl 0x12AEB8
cmpwi r3, 0
bne- .loc_0x520
lwz r0, 0x0(r26)
rlwinm r0,r0,0,0,30
stw r0, 0x0(r26)
b .loc_0x628
.loc_0x520:
cmpwi r3, 0x6
bne- .loc_0x554
lwz r3, 0x2E5C(r13)
bl 0xB5F68
li r0, 0
stw r0, 0x0(r27)
li r0, 0x1
lis r3, 0x803A
sth r0, 0x0(r29)
subi r3, r3, 0x2848
lbz r0, 0x8(r31)
stw r0, 0x338(r3)
b .loc_0x628
.loc_0x554:
cmpwi r3, 0x7
bne- .loc_0x5B0
lwz r4, 0x0(r31)
li r0, 0x1
li r3, 0x8
stw r0, 0x40(r4)
lwz r4, 0x2DEC(r13)
lfs f0, -0x7A84(r2)
stfs f0, 0x8(r4)
lfs f0, -0x7A68(r2)
stfs f0, 0xC(r4)
bl -0x10888
cmplwi r3, 0
beq- .loc_0x62C
lis r4, 0x802A
lwz r5, 0x0(r31)
addi r0, r4, 0x7ECC
stw r0, 0x4(r3)
lis r4, 0x802A
addi r0, r4, 0x7EB8
stw r5, 0x0(r3)
stw r0, 0x4(r3)
b .loc_0x62C
.loc_0x5B0:
cmpwi r3, 0x5
bne- .loc_0x628
lbz r0, 0x2E81(r13)
cmplwi r0, 0
beq- .loc_0x610
lbz r0, 0x2E82(r13)
cmplwi r0, 0
bne- .loc_0x610
lwz r3, 0x2F6C(r13)
bl 0x28B94
rlwinm. r0,r3,0,24,31
bne- .loc_0x5F4
lwz r3, 0x2E5C(r13)
li r4, 0x1
lfs f1, -0x7A88(r2)
lwz r3, 0x344(r3)
bl 0x1611C8
.loc_0x5F4:
lwz r3, 0x2E5C(r13)
li r4, 0x1
lfs f1, -0x7A88(r2)
lwz r3, 0x344(r3)
bl 0x1612B0
li r0, 0x1
stb r0, 0x2E82(r13)
.loc_0x610:
lis r3, 0x803A
lbz r0, 0x8(r31)
subi r3, r3, 0x2848
stw r0, 0x338(r3)
li r3, 0x11F
bl 0x4DA44
.loc_0x628:
mr r3, r31
.loc_0x62C:
lmw r25, 0x3C(r1)
lwz r0, 0x5C(r1)
addi r1, r1, 0x58
mtlr r0
blr
*/
}
/*
* --INFO--
* Address: 8005794C
* Size: 000004
*/
void GameInterface::message(int, int) { }
/*
* --INFO--
* Address: 80057950
* Size: 000078
*/
void IntroGameModeState::postRender(Graphics&)
{
/*
.loc_0x0:
mflr r0
stw r0, 0x4(r1)
stwu r1, -0x68(r1)
stw r31, 0x64(r1)
addi r31, r4, 0
lwz r0, 0x2E88(r13)
cmplwi r0, 0
beq- .loc_0x64
lwz r7, 0x310(r31)
li r0, 0
lwz r6, 0x30C(r31)
addi r5, r1, 0x10
addi r3, r31, 0
stw r0, 0x10(r1)
addi r4, r1, 0x20
stw r0, 0x14(r1)
stw r6, 0x18(r1)
stw r7, 0x1C(r1)
lwz r12, 0x3B4(r31)
lwz r12, 0x40(r12)
mtlr r12
blrl
lwz r3, 0x2E88(r13)
mr r4, r31
bl 0x12B320
.loc_0x64:
lwz r0, 0x6C(r1)
lwz r31, 0x64(r1)
addi r1, r1, 0x68
mtlr r0
blr
*/
}
/*
* --INFO--
* Address: 800579C8
* Size: 000294
*/
void RunningModeState::postRender(Graphics&)
{
/*
.loc_0x0:
mflr r0
stw r0, 0x4(r1)
stwu r1, -0x130(r1)
stw r31, 0x12C(r1)
addi r0, r1, 0x98
mr r31, r4
stw r30, 0x128(r1)
mr r30, r3
addi r6, r1, 0x80
lfs f2, -0x724C(r13)
addi r5, r1, 0x8C
lfs f1, -0x7258(r13)
mr r4, r0
lfs f0, -0x7264(r13)
stfs f2, 0x80(r1)
addi r3, r1, 0xA4
lfs f2, -0x7248(r13)
stfs f1, 0x8C(r1)
lfs f1, -0x7254(r13)
stfs f0, 0x98(r1)
lfs f0, -0x7260(r13)
stfs f2, 0x84(r1)
lfs f2, -0x7244(r13)
stfs f1, 0x90(r1)
lfs f1, -0x7250(r13)
stfs f0, 0x9C(r1)
lfs f0, -0x725C(r13)
stfs f2, 0x88(r1)
stfs f1, 0x94(r1)
stfs f0, 0xA0(r1)
bl -0x1994C
lbz r0, 0x2E80(r13)
cmplwi r0, 0
bne- .loc_0xCC
lwz r7, 0x310(r31)
li r0, 0
lwz r6, 0x30C(r31)
addi r5, r1, 0x70
addi r3, r31, 0
stw r0, 0x70(r1)
addi r4, r1, 0xE4
stw r0, 0x74(r1)
stw r6, 0x78(r1)
stw r7, 0x7C(r1)
lwz r12, 0x3B4(r31)
lwz r12, 0x40(r12)
mtlr r12
blrl
lwz r3, 0x2E5C(r13)
mr r4, r31
bl 0xB9B60
.loc_0xCC:
lis r3, 0x803A
subi r4, r3, 0x2848
lwz r0, 0x33C(r4)
cmpwi r0, 0
bne- .loc_0x14C
lwz r3, 0x1DC(r4)
lbz r0, 0x124(r3)
cmplwi r0, 0
bne- .loc_0x14C
lwz r3, 0x0(r30)
lwz r0, 0x3C(r3)
rlwinm. r0,r0,0,29,29
beq- .loc_0x14C
lwz r3, 0x20(r4)
lfs f2, 0x2F0(r4)
lfs f3, 0xB0(r3)
lfs f1, 0x90(r3)
fsubs f2, f2, f3
lfs f0, -0x7A84(r2)
fsubs f1, f1, f3
fdivs f1, f2, f1
fcmpo cr0, f1, f0
cror 2, 0x1, 0x2
bne- .loc_0x14C
lfs f0, -0x7A80(r2)
fcmpo cr0, f1, f0
bge- .loc_0x14C
lwz r3, 0x2E6C(r13)
bl 0x19035C
lwz r3, 0x2E6C(r13)
mr r4, r31
bl 0x190DC0
.loc_0x14C:
lbz r0, 0x2E80(r13)
cmplwi r0, 0
bne- .loc_0x27C
lwz r0, 0x2E88(r13)
cmplwi r0, 0
beq- .loc_0x1A8
lwz r7, 0x310(r31)
li r0, 0
lwz r6, 0x30C(r31)
addi r5, r1, 0x60
addi r3, r31, 0
stw r0, 0x60(r1)
addi r4, r1, 0xE4
stw r0, 0x64(r1)
stw r6, 0x68(r1)
stw r7, 0x6C(r1)
lwz r12, 0x3B4(r31)
lwz r12, 0x40(r12)
mtlr r12
blrl
lwz r3, 0x2E88(r13)
mr r4, r31
bl 0x12B164
.loc_0x1A8:
lwz r6, 0x310(r31)
li r30, 0
lwz r0, 0x30C(r31)
addi r5, r1, 0x50
addi r3, r31, 0
stw r30, 0x50(r1)
addi r4, r1, 0xE4
stw r30, 0x54(r1)
stw r0, 0x58(r1)
stw r6, 0x5C(r1)
lwz r12, 0x3B4(r31)
lwz r12, 0x40(r12)
mtlr r12
blrl
lwz r3, 0x2E5C(r13)
mr r4, r31
bl 0xB9CA0
lwz r0, 0x2E68(r13)
cmplwi r0, 0
beq- .loc_0x238
lwz r6, 0x310(r31)
addi r5, r1, 0x40
lwz r0, 0x30C(r31)
mr r3, r31
addi r4, r1, 0xE4
stw r30, 0x40(r1)
stw r30, 0x44(r1)
stw r0, 0x48(r1)
stw r6, 0x4C(r1)
lwz r12, 0x3B4(r31)
lwz r12, 0x40(r12)
mtlr r12
blrl
lwz r3, 0x2E68(r13)
mr r4, r31
bl 0x191A18
.loc_0x238:
lwz r7, 0x310(r31)
li r0, 0
lwz r6, 0x30C(r31)
addi r5, r1, 0x30
addi r3, r31, 0
stw r0, 0x30(r1)
addi r4, r1, 0xE4
stw r0, 0x34(r1)
stw r6, 0x38(r1)
stw r7, 0x3C(r1)
lwz r12, 0x3B4(r31)
lwz r12, 0x40(r12)
mtlr r12
blrl
lwz r3, 0x2E70(r13)
mr r4, r31
bl 0x12AE48
.loc_0x27C:
lwz r0, 0x134(r1)
lwz r31, 0x12C(r1)
lwz r30, 0x128(r1)
addi r1, r1, 0x130
mtlr r0
blr
*/
}
/*
* --INFO--
* Address: 80057C5C
* Size: 000360
*/
void MessageModeState::update(unsigned long&)
{
/*
.loc_0x0:
mflr r0
lis r4, 0x803A
stw r0, 0x4(r1)
stwu r1, -0x60(r1)
stw r31, 0x5C(r1)
addi r31, r3, 0
stw r30, 0x58(r1)
stw r29, 0x54(r1)
subi r29, r4, 0x24E0
stw r28, 0x50(r1)
lwz r0, 0x234(r29)
cmpwi r0, 0x2
bne- .loc_0x274
lwz r0, 0xC(r31)
cmpwi r0, 0x2
beq- .loc_0x120
bge- .loc_0x54
cmpwi r0, 0
beq- .loc_0x60
bge- .loc_0xDC
b .loc_0x324
.loc_0x54:
cmpwi r0, 0x4
bge- .loc_0x324
b .loc_0x158
.loc_0x60:
lwz r3, 0x2DEC(r13)
lfs f1, 0x10(r31)
lfs f0, 0x28C(r3)
fsubs f0, f1, f0
stfs f0, 0x10(r31)
lfs f1, 0x10(r31)
lfs f0, -0x7A84(r2)
fcmpo cr0, f1, f0
bge- .loc_0x324
lfs f0, -0x7A78(r2)
lis r3, 0x803A
subi r3, r3, 0x2848
stfs f0, 0x10(r31)
lfs f0, -0x7A80(r2)
lwz r4, 0x2F00(r13)
stfs f0, 0x4C8(r4)
lwz r0, 0x2B4(r3)
cmpwi r0, 0
bne- .loc_0xB8
lwz r0, 0x2FC(r3)
cmpwi r0, 0x1E
bne- .loc_0xD0
.loc_0xB8:
lwz r3, 0x2E68(r13)
cmplwi r3, 0
beq- .loc_0xD0
lfs f1, -0x7A64(r2)
li r4, 0
bl 0x1910A4
.loc_0xD0:
li r0, 0x1
stw r0, 0xC(r31)
b .loc_0x324
.loc_0xDC:
lwz r3, 0x2DEC(r13)
lfs f1, 0x10(r31)
lfs f0, 0x28C(r3)
fsubs f0, f1, f0
stfs f0, 0x10(r31)
lfs f1, 0x10(r31)
lfs f0, -0x7A84(r2)
fcmpo cr0, f1, f0
bge- .loc_0x324
lfs f0, -0x7A68(r2)
li r0, 0x2
stfs f0, 0x10(r31)
lfs f0, -0x7A80(r2)
lwz r3, 0x2F00(r13)
stfs f0, 0x4CC(r3)
stw r0, 0xC(r31)
b .loc_0x324
.loc_0x120:
lwz r3, 0x2DEC(r13)
lfs f1, 0x10(r31)
lfs f0, 0x28C(r3)
fsubs f0, f1, f0
stfs f0, 0x10(r31)
lfs f1, 0x10(r31)
lfs f0, -0x7A84(r2)
fcmpo cr0, f1, f0
bge- .loc_0x324
lfs f0, -0x7A78(r2)
li r0, 0x3
stfs f0, 0x10(r31)
stw r0, 0xC(r31)
b .loc_0x324
.loc_0x158:
lfs f0, -0x7A84(r2)
li r3, 0xC
lwz r4, 0x2F00(r13)
stfs f0, 0x4CC(r4)
lwz r4, 0x2F00(r13)
stfs f0, 0x4C8(r4)
bl -0x10DC8
addi r28, r3, 0
mr. r0, r28
beq- .loc_0x1F4
lis r3, 0x802A
lwz r4, 0x0(r31)
addi r0, r3, 0x7ECC
stw r0, 0x4(r28)
lis r3, 0x802A
addi r0, r3, 0x7E18
stw r4, 0x0(r28)
li r30, 0x1
stw r0, 0x4(r28)
stw r30, 0x238(r29)
lwz r3, 0x2E5C(r13)
bl 0xB8C98
lis r3, 0x803A
subi r3, r3, 0x2848
lwz r4, 0x20(r3)
addi r3, r3, 0x2D8
lfs f1, 0x20(r4)
bl -0x6604
lwz r3, 0x2E5C(r13)
li r4, 0x1
lfs f1, -0x7A88(r2)
lwz r3, 0x344(r3)
bl 0x160D0C
lwz r3, 0x2E5C(r13)
li r4, 0x1
lfs f1, -0x7A88(r2)
lwz r3, 0x344(r3)
bl 0x160E28
stw r30, 0x8(r28)
.loc_0x1F4:
li r30, 0
stw r30, 0x8(r28)
lwz r3, 0x0(r31)
stw r28, 0x38(r3)
lwz r3, 0x2E5C(r13)
bl 0xB5F60
lis r3, 0x803A
subi r3, r3, 0x2848
lwz r0, 0x2B4(r3)
cmpwi r0, 0
bne- .loc_0x26C
lwz r0, 0x2FC(r3)
cmpwi r0, 0x1E
beq- .loc_0x324
lwz r3, 0x1DC(r3)
li r4, 0x34
li r5, 0
li r6, 0
li r7, 0
li r8, 0
li r9, -0x1
li r10, 0x1
bl 0x1F2B8
lwz r3, 0x2E68(r13)
cmplwi r3, 0
beq- .loc_0x324
lfs f1, -0x7A64(r2)
li r4, 0
bl 0x190F0C
b .loc_0x324
.loc_0x26C:
stw r30, 0x2E68(r13)
b .loc_0x324
.loc_0x274:
cmpwi r0, 0
bne- .loc_0x324
li r3, 0xC
bl -0x10ED8
addi r28, r3, 0
mr. r0, r28
beq- .loc_0x304
lis r3, 0x802A
lwz r4, 0x0(r31)
addi r0, r3, 0x7ECC
stw r0, 0x4(r28)
lis r3, 0x802A
addi r0, r3, 0x7E18
stw r4, 0x0(r28)
li r30, 0x1
stw r0, 0x4(r28)
stw r30, 0x238(r29)
lwz r3, 0x2E5C(r13)
bl 0xB8B88
lis r3, 0x803A
subi r3, r3, 0x2848
lwz r4, 0x20(r3)
addi r3, r3, 0x2D8
lfs f1, 0x20(r4)
bl -0x6714
lwz r3, 0x2E5C(r13)
li r4, 0x1
lfs f1, -0x7A88(r2)
lwz r3, 0x344(r3)
bl 0x160BFC
lwz r3, 0x2E5C(r13)
li r4, 0x1
lfs f1, -0x7A88(r2)
lwz r3, 0x344(r3)
bl 0x160D18
stw r30, 0x8(r28)
.loc_0x304:
li r0, 0
stw r0, 0x2E68(r13)
stw r0, 0x8(r28)
lwz r3, 0x0(r31)
stw r28, 0x38(r3)
lfs f0, -0x7A80(r2)
lwz r3, 0x0(r31)
stfs f0, 0x2C(r3)
.loc_0x324:
lwz r3, 0x2E68(r13)
cmplwi r3, 0
beq- .loc_0x33C
lwz r4, 0x0(r31)
lwz r4, 0x24(r4)
bl 0x191054
.loc_0x33C:
mr r3, r31
lwz r0, 0x64(r1)
lwz r31, 0x5C(r1)
lwz r30, 0x58(r1)
lwz r29, 0x54(r1)
lwz r28, 0x50(r1)
addi r1, r1, 0x60
mtlr r0
blr
*/
}
/*
* --INFO--
* Address: 80057FBC
* Size: 000474
*/
void DayOverModeState::update(unsigned long&)
{
/*
.loc_0x0:
mflr r0
stw r0, 0x4(r1)
li r0, 0x1
stwu r1, -0x58(r1)
stw r31, 0x54(r1)
mr r31, r3
stw r30, 0x50(r1)
stw r29, 0x4C(r1)
stw r0, 0x0(r4)
lwz r3, 0x2E88(r13)
lwz r4, 0x0(r31)
cmplwi r3, 0
lwz r4, 0x24(r4)
beq- .loc_0x68
bl 0x12AC20
cmpwi r3, 0x4
bne- .loc_0x68
lis r3, 0x803A
subi r3, r3, 0x2848
lwz r3, 0x1DC(r3)
lbz r0, 0x124(r3)
cmplwi r0, 0
beq- .loc_0x64
li r4, 0x2
bl 0x1FC38
.loc_0x64:
bl -0x1258
.loc_0x68:
lis r3, 0x803A
subi r3, r3, 0x2848
addi r30, r3, 0x1DC
lwz r3, 0x1DC(r3)
lbz r0, 0x124(r3)
cmplwi r0, 0
bne- .loc_0xEC
lwz r0, 0x8(r31)
li r3, 0
cmpwi r0, 0x2
beq- .loc_0xCC
bge- .loc_0xA8
cmpwi r0, 0
beq- .loc_0xB4
bge- .loc_0xC0
b .loc_0xE0
.loc_0xA8:
cmpwi r0, 0x4
bge- .loc_0xE0
b .loc_0xD8
.loc_0xB4:
mr r3, r31
bl 0x60C
b .loc_0xE0
.loc_0xC0:
mr r3, r31
bl 0x968
b .loc_0xE0
.loc_0xCC:
mr r3, r31
bl 0xD6C
b .loc_0xE0
.loc_0xD8:
mr r3, r31
bl 0xFB8
.loc_0xE0:
cmplwi r3, 0
beq- .loc_0xEC
b .loc_0x458
.loc_0xEC:
lwz r3, 0x2E68(r13)
cmplwi r3, 0
beq- .loc_0x104
lwz r4, 0x0(r31)
lwz r4, 0x24(r4)
bl 0x190F2C
.loc_0x104:
lwz r3, 0x2E64(r13)
cmplwi r3, 0
beq- .loc_0x178
lwz r4, 0x0(r31)
lwz r4, 0x24(r4)
bl 0x1974E8
rlwinm. r0,r3,0,24,31
beq- .loc_0x178
lwz r4, 0x0(r31)
li r0, 0x6
li r3, 0x8
stw r0, 0x40(r4)
lwz r4, 0x2DEC(r13)
lfs f0, -0x7A84(r2)
stfs f0, 0x8(r4)
lfs f0, -0x7A68(r2)
stfs f0, 0xC(r4)
bl -0x11100
cmplwi r3, 0
beq- .loc_0x458
lis r4, 0x802A
lwz r5, 0x0(r31)
addi r0, r4, 0x7ECC
stw r0, 0x4(r3)
lis r4, 0x802A
addi r0, r4, 0x7EB8
stw r5, 0x0(r3)
stw r0, 0x4(r3)
b .loc_0x458
.loc_0x178:
lwz r3, 0x2E74(r13)
cmplwi r3, 0
beq- .loc_0x2B0
lwz r4, 0x0(r31)
lwz r4, 0x24(r4)
bl 0x12CAD0
addi r29, r3, 0
cmpwi r29, 0x7
blt- .loc_0x2B0
lwz r3, 0x2DEC(r13)
li r4, 0
li r5, 0x1
lwz r12, 0x1A0(r3)
li r6, 0x78
lwz r12, 0x2C(r12)
mtlr r12
blrl
lwz r3, 0x2E5C(r13)
bl 0xB54D4
lwz r3, 0x0(r30)
bl 0x1EE4C
li r3, 0x6
li r4, 0
bl -0x3E910
lwz r3, 0x2DEC(r13)
li r4, 0x5
li r5, 0x1
bl -0x1916C
lwz r3, 0x2DEC(r13)
li r4, 0x4
li r5, 0x1
bl -0x1917C
lwz r3, 0x2DEC(r13)
li r4, 0x4
li r5, 0x2
bl -0x1918C
lwz r3, 0x2DEC(r13)
li r4, 0x4
bl -0x19164
mr r0, r3
lwz r3, 0x2DEC(r13)
mr r4, r0
bl -0x19174
lwz r3, 0x2DEC(r13)
lwz r12, 0x1A0(r3)
lwz r12, 0x30(r12)
mtlr r12
blrl
lwz r0, 0x2E7C(r13)
cmplwi r0, 0
bne- .loc_0x2B0
cmpwi r29, 0x8
bne- .loc_0x25C
lwz r3, 0x0(r31)
li r0, 0x1
stw r0, 0x40(r3)
b .loc_0x268
.loc_0x25C:
lwz r3, 0x0(r31)
li r0, 0x6
stw r0, 0x40(r3)
.loc_0x268:
lwz r4, 0x2DEC(r13)
li r3, 0x8
lfs f0, -0x7A84(r2)
stfs f0, 0x8(r4)
lfs f0, -0x7A68(r2)
stfs f0, 0xC(r4)
bl -0x11238
cmplwi r3, 0
beq- .loc_0x458
lis r4, 0x802A
lwz r5, 0x0(r31)
addi r0, r4, 0x7ECC
stw r0, 0x4(r3)
lis r4, 0x802A
addi r0, r4, 0x7EB8
stw r5, 0x0(r3)
stw r0, 0x4(r3)
b .loc_0x458
.loc_0x2B0:
lwz r3, 0x2E78(r13)
cmplwi r3, 0
beq- .loc_0x350
lwz r4, 0x0(r31)
lwz r4, 0x24(r4)
bl 0x19CEB8
rlwinm. r0,r3,0,24,31
beq- .loc_0x350
lwz r0, 0x8(r31)
cmpwi r0, 0x2
bne- .loc_0x2F4
lwz r3, 0x0(r30)
li r4, 0x2
bl 0x1F9B4
li r0, 0
stw r0, 0x2E78(r13)
b .loc_0x350
.loc_0x2F4:
li r0, 0
stw r0, 0x2E78(r13)
li r0, 0xB
li r3, 0x8
lwz r4, 0x0(r31)
stw r0, 0x40(r4)
lwz r4, 0x2DEC(r13)
lfs f0, -0x7A84(r2)
stfs f0, 0x8(r4)
lfs f0, -0x7A68(r2)
stfs f0, 0xC(r4)
bl -0x112D8
cmplwi r3, 0
beq- .loc_0x458
lis r4, 0x802A
lwz r5, 0x0(r31)
addi r0, r4, 0x7ECC
stw r0, 0x4(r3)
lis r4, 0x802A
addi r0, r4, 0x7EB8
stw r5, 0x0(r3)
stw r0, 0x4(r3)
b .loc_0x458
.loc_0x350:
lwz r3, 0x2E7C(r13)
cmplwi r3, 0
beq- .loc_0x454
li r30, 0
stw r30, 0x20(r1)
addi r5, r1, 0x18
lwz r4, 0x0(r31)
lwz r4, 0x24(r4)
bl 0x13B41C
cmpwi r3, 0x1
blt- .loc_0x454
stw r30, 0x2E7C(r13)
beq- .loc_0x40C
cmpwi r3, 0x5
beq- .loc_0x40C
lis r3, 0x803A
lwz r0, 0x1C(r1)
subi r5, r3, 0x2848
stb r0, 0x1C7(r5)
addi r3, r5, 0x24
li r0, 0x1
lwz r4, 0x18(r1)
addi r4, r4, 0x1
stb r4, 0xB5(r5)
lwz r4, 0x2DEC(r13)
addi r5, r4, 0x1C
lwz r4, 0x1C(r4)
neg r4, r4
stw r0, 0x0(r5)
subic r0, r4, 0x1
subfe r29, r0, r4
bl 0x1C18C
lwz r3, 0x0(r31)
lwz r3, 0x24(r3)
lwz r0, 0x20(r3)
rlwinm. r0,r0,0,15,15
beq- .loc_0x400
lis r4, 0x803B
lwz r3, 0x2F88(r13)
subi r5, r4, 0x7DA0
lis r4, 0x2
addi r6, r4, 0x6000
li r4, 0
bl 0x2C168
.loc_0x400:
lwz r3, 0x2DEC(r13)
rlwinm r0,r29,0,24,31
stw r0, 0x1C(r3)
.loc_0x40C:
lwz r4, 0x2DEC(r13)
li r3, 0x8
lfs f0, -0x7A84(r2)
stfs f0, 0x8(r4)
lfs f0, -0x7A68(r2)
stfs f0, 0xC(r4)
bl -0x113DC
cmplwi r3, 0
beq- .loc_0x458
lis r4, 0x802A
lwz r5, 0x0(r31)
addi r0, r4, 0x7ECC
stw r0, 0x4(r3)
lis r4, 0x802A
addi r0, r4, 0x7EB8
stw r5, 0x0(r3)
stw r0, 0x4(r3)
b .loc_0x458
.loc_0x454:
mr r3, r31
.loc_0x458:
lwz r0, 0x5C(r1)
lwz r31, 0x54(r1)
lwz r30, 0x50(r1)
lwz r29, 0x4C(r1)
addi r1, r1, 0x58
mtlr r0
blr
*/
}
/*
* --INFO--
* Address: 80058430
* Size: 000250
*/
void DayOverModeState::makeTotalScoreWindow()
{
/*
.loc_0x0:
mflr r0
lis r3, 0x803A
stw r0, 0x4(r1)
stwu r1, -0x40(r1)
stw r31, 0x3C(r1)
subi r31, r3, 0x2848
stw r30, 0x38(r1)
lwz r0, 0x2FC(r31)
stw r0, 0x1C(r1)
lwz r3, 0x2F6C(r13)
lwz r0, 0x1A8(r3)
stw r0, 0x20(r1)
bl 0x285F8
stw r3, 0x24(r1)
lwz r3, 0x2F6C(r13)
bl 0x28804
stw r3, 0x18(r1)
addi r3, r31, 0x94
addi r4, r1, 0x18
bl -0x43DC
li r3, 0x44
bl -0x11480
lwz r0, 0x18(r1)
mr r4, r3
addi r30, r4, 0
stw r0, 0x0(r3)
li r0, -0x1
lwz r3, 0x1C(r1)
stw r3, 0x4(r4)
lwz r3, 0x20(r1)
stw r3, 0x8(r4)
lwz r3, 0x24(r1)
stw r3, 0xC(r4)
lwz r3, 0xB8(r31)
stw r3, 0x10(r4)
lwz r3, 0xBC(r31)
extsh r3, r3
sth r3, 0x1A(r4)
lwz r3, 0xC0(r31)
extsh r3, r3
sth r3, 0x24(r4)
lwz r3, 0xE4(r31)
extsh r3, r3
sth r3, 0x2E(r4)
lwz r3, 0xF8(r31)
extsh r3, r3
sth r3, 0x38(r4)
lha r3, 0x38(r4)
cmpwi r3, 0x270F
bne- .loc_0xCC
sth r0, 0x38(r4)
.loc_0xCC:
addi r5, r31, 0x8
lwz r3, 0xC4(r31)
addi r6, r4, 0x2
addi r7, r31, 0x4
extsh r3, r3
sth r3, 0x1C(r4)
lwz r3, 0xC8(r31)
extsh r3, r3
sth r3, 0x26(r4)
lwz r3, 0xE8(r31)
extsh r3, r3
sth r3, 0x30(r4)
lwz r3, 0xFC(r31)
extsh r3, r3
sth r3, 0x3A(r4)
lha r3, 0x3A(r4)
cmpwi r3, 0x270F
bne- .loc_0x118
sth r0, 0x38(r6)
.loc_0x118:
lwz r3, 0xC4(r5)
extsh r3, r3
sth r3, 0x1C(r6)
lwz r3, 0xC8(r5)
addi r5, r5, 0x8
extsh r3, r3
sth r3, 0x26(r6)
lwz r3, 0xE8(r7)
extsh r3, r3
sth r3, 0x30(r6)
lwz r3, 0xFC(r7)
addi r7, r7, 0x4
extsh r3, r3
sth r3, 0x3A(r6)
lha r3, 0x3A(r6)
addi r6, r6, 0x2
cmpwi r3, 0x270F
bne- .loc_0x164
sth r0, 0x38(r6)
.loc_0x164:
lwz r3, 0xC4(r5)
extsh r3, r3
sth r3, 0x1C(r6)
lwz r3, 0xC8(r5)
addi r5, r5, 0x8
extsh r3, r3
sth r3, 0x26(r6)
lwz r3, 0xE8(r7)
extsh r3, r3
sth r3, 0x30(r6)
lwz r3, 0xFC(r7)
addi r7, r7, 0x4
extsh r3, r3
sth r3, 0x3A(r6)
lha r3, 0x3A(r6)
addi r6, r6, 0x2
cmpwi r3, 0x270F
bne- .loc_0x1B0
sth r0, 0x38(r6)
.loc_0x1B0:
lwz r3, 0xC4(r5)
extsh r3, r3
sth r3, 0x1C(r6)
lwz r3, 0xC8(r5)
extsh r3, r3
sth r3, 0x26(r6)
lwz r3, 0xE8(r7)
extsh r3, r3
sth r3, 0x30(r6)
lwz r3, 0xFC(r7)
extsh r3, r3
sth r3, 0x3A(r6)
lha r3, 0x3A(r6)
addi r6, r6, 0x2
cmpwi r3, 0x270F
bne- .loc_0x1F4
sth r0, 0x38(r6)
.loc_0x1F4:
lwz r0, 0x28(r1)
li r3, 0x1B4
extsh r0, r0
sth r0, 0x14(r4)
lwz r0, 0x2C(r1)
extsh r0, r0
sth r0, 0x16(r4)
lwz r0, 0x30(r1)
extsh r0, r0
sth r0, 0x18(r4)
bl -0x11648
addi r31, r3, 0
mr. r3, r31
beq- .loc_0x234
mr r4, r30
bl 0x19CA68
.loc_0x234:
stw r31, 0x2E78(r13)
lwz r0, 0x44(r1)
lwz r31, 0x3C(r1)
lwz r30, 0x38(r1)
addi r1, r1, 0x40
mtlr r0
blr
*/
}
/*
* --INFO--
* Address: 80058680
* Size: 000368
*/
void DayOverModeState::initialisePhaseOne()
{
/*
.loc_0x0:
mflr r0
stw r0, 0x4(r1)
stwu r1, -0x48(r1)
stw r31, 0x44(r1)
stw r30, 0x40(r1)
stw r29, 0x3C(r1)
mr r29, r3
stw r28, 0x38(r1)
lwz r3, 0x2F6C(r13)
bl 0x285CC
cmpwi r3, 0x1E
bne- .loc_0x98
lwz r3, 0x2E5C(r13)
bl 0xB4F9C
lwz r3, 0x2DEC(r13)
li r4, 0x4
li r5, 0x2
bl -0x19690
lwz r3, 0x2DEC(r13)
li r4, 0x4
bl -0x19668
lis r4, 0x803A
subi r4, r4, 0x2848
addi r0, r3, 0
lwz r3, 0x1DC(r4)
mr r28, r0
li r4, 0x4B
li r5, 0
li r6, 0
li r7, 0
li r8, 0
li r9, -0x1
li r10, 0x1
bl 0x1EA5C
lwz r3, 0x2DEC(r13)
mr r4, r28
bl -0x196A8
b .loc_0x33C
.loc_0x98:
lis r3, 0x803A
subi r28, r3, 0x2848
lwz r0, 0x2FC(r28)
cmpwi r0, 0x1E
blt- .loc_0x1DC
lwz r3, 0x2E5C(r13)
bl 0xB4F20
lwz r3, 0x2DEC(r13)
li r4, 0x4
li r5, 0x2
bl -0x1970C
lwz r3, 0x2DEC(r13)
li r4, 0x4
bl -0x196E4
lis r4, 0x8022
lwz r7, 0x2F6C(r13)
addi r6, r4, 0x2378
lwz r5, 0x0(r6)
li r4, 0x1
lwz r0, 0x4(r6)
addi r31, r3, 0
li r8, 0
stw r5, 0x28(r1)
addi r5, r1, 0x28
stw r0, 0x2C(r1)
lwz r0, 0x8(r6)
stw r0, 0x30(r1)
lwz r0, 0x28(r1)
lbz r3, 0x184(r7)
slw r0, r4, r0
and. r0, r3, r0
beq- .loc_0x124
li r0, 0xC
slw r0, r4, r0
mr r8, r0
.loc_0x124:
lwzu r0, 0x4(r5)
lbz r3, 0x184(r7)
slw r0, r4, r0
and. r0, r3, r0
beq- .loc_0x144
li r0, 0xD
slw r0, r4, r0
or r8, r8, r0
.loc_0x144:
lwz r0, 0x4(r5)
lbz r3, 0x184(r7)
slw r0, r4, r0
and. r0, r3, r0
beq- .loc_0x164
li r0, 0xE
slw r0, r4, r0
or r8, r8, r0
.loc_0x164:
rlwinm. r0,r8,0,18,18
bne- .loc_0x170
ori r8, r8, 0x800
.loc_0x170:
rlwinm. r0,r8,0,17,17
bne- .loc_0x17C
ori r8, r8, 0x8000
.loc_0x17C:
lfs f0, -0x7A74(r2)
oris r9, r8, 0xFFFF
lwz r4, 0x0(r29)
lis r3, 0x803A
subi r3, r3, 0x2848
stfs f0, 0x28(r4)
ori r9, r9, 0x7FF
li r4, 0x45
lfs f0, -0x7A80(r2)
li r5, 0
lwz r7, 0x0(r29)
li r6, 0
li r8, 0
stfs f0, 0x2C(r7)
li r7, 0
li r10, 0x1
lwz r3, 0x1DC(r3)
bl 0x1E920
li r0, 0
lwz r3, 0x2DEC(r13)
stw r0, 0x2E68(r13)
mr r4, r31
bl -0x197EC
b .loc_0x33C
.loc_0x1DC:
lwz r3, 0x2DEC(r13)
li r4, 0x4
li r5, 0x2
bl -0x19834
lwz r3, 0x2DEC(r13)
li r4, 0x4
bl -0x1980C
li r0, 0
lfs f0, -0x7A74(r2)
stw r0, 0x2E68(r13)
addi r30, r3, 0
addi r31, r28, 0x1DC
lwz r5, 0x0(r29)
li r4, 0x20
li r6, 0
stfs f0, 0x28(r5)
li r5, 0
li r7, 0
lwz r3, 0x1DC(r28)
li r8, 0
li r9, -0x1
li r10, 0x1
bl 0x1E8AC
lwz r3, 0x2F6C(r13)
bl 0x27BB8
rlwinm. r0,r3,0,24,31
bne- .loc_0x330
lwz r0, 0x2B4(r28)
cmpwi r0, 0
bne- .loc_0x330
lis r3, 0x8022
addi r6, r3, 0x2384
lwz r4, 0x0(r6)
lis r3, 0x803D
lwz r0, 0x4(r6)
addi r5, r3, 0x1EB8
addi r7, r1, 0x1C
stw r4, 0x1C(r1)
li r8, 0
li r3, 0x1
stw r0, 0x20(r1)
lwz r0, 0x8(r6)
stw r0, 0x24(r1)
lwz r0, 0x1C(r1)
rlwinm r6,r0,2,0,29
add r4, r5, r6
lwz r0, 0x0(r4)
cmpwi r0, 0
beq- .loc_0x2AC
li r0, 0xC
slw r0, r3, r0
mr r8, r0
.loc_0x2AC:
lwzu r0, 0x4(r7)
rlwinm r6,r0,2,0,29
add r4, r5, r6
lwz r0, 0x0(r4)
cmpwi r0, 0
beq- .loc_0x2D0
li r0, 0xD
slw r0, r3, r0
or r8, r8, r0
.loc_0x2D0:
lwz r0, 0x4(r7)
rlwinm r6,r0,2,0,29
add r4, r5, r6
lwz r0, 0x0(r4)
cmpwi r0, 0
beq- .loc_0x2F4
li r0, 0xE
slw r0, r3, r0
or r8, r8, r0
.loc_0x2F4:
cmplwi r8, 0
bne- .loc_0x304
ori r8, r8, 0x8000
b .loc_0x308
.loc_0x304:
ori r8, r8, 0x800
.loc_0x308:
oris r9, r8, 0xFFFF
lwz r3, 0x0(r31)
ori r9, r9, 0x7FF
li r4, 0x38
li r5, 0
li r6, 0
li r7, 0
li r8, 0
li r10, 0x1
bl 0x1E7B4
.loc_0x330:
lwz r3, 0x2DEC(r13)
mr r4, r30
bl -0x19950
.loc_0x33C:
li r0, 0x1
stw r0, 0x8(r29)
li r3, 0
lwz r0, 0x4C(r1)
lwz r31, 0x44(r1)
lwz r30, 0x40(r1)
lwz r29, 0x3C(r1)
lwz r28, 0x38(r1)
addi r1, r1, 0x48
mtlr r0
blr
*/
}
/*
* --INFO--
* Address: 800589E8
* Size: 000410
*/
void DayOverModeState::initialisePhaseTwo()
{
/*
.loc_0x0:
mflr r0
lis r4, 0x803A
stw r0, 0x4(r1)
li r5, 0x1
li r6, 0x78
stwu r1, -0x60(r1)
stmw r27, 0x4C(r1)
mr r27, r3
subi r31, r4, 0x2280
li r4, 0
lwz r3, 0x2DEC(r13)
lwz r12, 0x1A0(r3)
lwz r12, 0x2C(r12)
mtlr r12
blrl
lwz r3, 0x2E5C(r13)
bl 0xB4C28
lis r3, 0x803A
subi r29, r3, 0x2848
addi r30, r29, 0x1DC
lwz r3, 0x1DC(r29)
bl 0x1E594
li r3, 0x6
li r4, 0
bl -0x3F1C8
lwz r3, 0x2DEC(r13)
li r4, 0x5
li r5, 0x1
bl -0x19A24
lwz r3, 0x2DEC(r13)
li r4, 0x4
li r5, 0x1
bl -0x19A34
lwz r3, 0x2DEC(r13)
li r4, 0x4
li r5, 0x2
bl -0x19A44
lwz r3, 0x2DEC(r13)
li r4, 0x4
bl -0x19A1C
mr r0, r3
lwz r3, 0x2F6C(r13)
mr r28, r0
bl 0x281DC
cmpwi r3, 0x1E
bne- .loc_0xE0
lwz r3, 0x0(r30)
li r4, 0x71
li r5, 0
li r6, 0
li r7, 0
li r8, 0
li r9, -0x1
li r10, 0x1
bl 0x1E6A0
b .loc_0x3A4
.loc_0xE0:
lwzu r0, 0x2FC(r29)
cmpwi r0, 0x1E
bge- .loc_0x330
lwz r3, 0x0(r30)
li r4, 0x24
li r5, 0
li r6, 0
li r7, 0
li r8, 0
li r9, -0x1
li r10, 0x1
bl 0x1E66C
lwz r3, 0x2F6C(r13)
lbz r0, 0x184(r3)
rlwinm. r0,r0,0,30,30
beq- .loc_0x144
lwz r3, 0x0(r30)
li r4, 0x54
li r5, 0
li r6, 0
li r7, 0
li r8, 0
li r9, -0x1
li r10, 0x1
bl 0x1E638
.loc_0x144:
lwz r3, 0x2F6C(r13)
lbz r0, 0x184(r3)
rlwinm. r0,r0,0,29,29
beq- .loc_0x178
lwz r3, 0x0(r30)
li r4, 0x55
li r5, 0
li r6, 0
li r7, 0
li r8, 0
li r9, -0x1
li r10, 0x1
bl 0x1E604
.loc_0x178:
lwz r3, 0x2F6C(r13)
lbz r0, 0x184(r3)
rlwinm. r0,r0,0,31,31
beq- .loc_0x1AC
lwz r3, 0x0(r30)
li r4, 0x56
li r5, 0
li r6, 0
li r7, 0
li r8, 0
li r9, -0x1
li r10, 0x1
bl 0x1E5D0
.loc_0x1AC:
lwz r4, 0x0(r29)
lis r3, 0x803A
subi r6, r3, 0x2848
addi r0, r4, 0x1
stw r0, 0x0(r29)
lwz r0, 0x2B4(r6)
cmpwi r0, 0
bne- .loc_0x2C4
lwz r3, 0x2F6C(r13)
li r0, 0
stw r0, 0x40(r1)
addi r4, r1, 0x40
addi r3, r3, 0x70
bl 0x2AF4C
lwz r4, 0x40(r1)
li r9, 0
cmpwi r4, 0
ble- .loc_0x28C
cmpwi r4, 0x8
subi r4, r4, 0x8
ble- .loc_0x3EC
addi r0, r4, 0x7
rlwinm r0,r0,29,3,31
cmpwi r4, 0
mtctr r0
addi r8, r31, 0
ble- .loc_0x3EC
.loc_0x218:
add r7, r3, r9
stw r7, 0x0(r8)
addi r0, r7, 0x1
addi r4, r7, 0x2
stw r0, 0x4(r8)
addi r0, r7, 0x3
addi r6, r7, 0x4
stw r4, 0x8(r8)
addi r5, r7, 0x5
addi r4, r7, 0x6
stw r0, 0xC(r8)
addi r0, r7, 0x7
addi r9, r9, 0x8
stw r6, 0x10(r8)
stw r5, 0x14(r8)
stw r4, 0x18(r8)
stw r0, 0x1C(r8)
addi r8, r8, 0x20
bdnz+ .loc_0x218
b .loc_0x3EC
.loc_0x268:
sub r0, r5, r9
cmpw r9, r5
mtctr r0
bge- .loc_0x28C
.loc_0x278:
add r0, r3, r9
stw r0, 0x0(r4)
addi r4, r4, 0x4
addi r9, r9, 0x1
bdnz+ .loc_0x278
.loc_0x28C:
rlwinm r0,r9,2,0,29
li r3, 0
stwx r3, r31, r0
li r3, 0x55C
bl -0x11C80
addi r29, r3, 0
mr. r3, r29
beq- .loc_0x2B4
mr r4, r31
bl 0x12B6CC
.loc_0x2B4:
stw r29, 0x2E74(r13)
lwz r3, 0x2E74(r13)
bl 0x12B830
b .loc_0x3A4
.loc_0x2C4:
lis r3, 0x803A
subi r3, r3, 0x24E0
lwz r4, 0xA8(r3)
lis r3, 0x803D
addi r5, r3, 0x1ED0
lhz r0, 0x28(r4)
addi r3, r6, 0x94
addi r4, r1, 0x20
stw r0, 0x20(r1)
lwz r6, 0x8(r5)
lwz r0, 0x4(r5)
lwz r5, 0x0(r5)
add r0, r0, r6
add r0, r5, r0
stw r0, 0x24(r1)
bl -0x4DBC
li r3, 0xA0
bl -0x11CEC
addi r29, r3, 0
mr. r3, r29
beq- .loc_0x31C
bl 0x195E68
.loc_0x31C:
stw r29, 0x2E64(r13)
addi r4, r1, 0x20
lwz r3, 0x2E64(r13)
bl 0x196A60
b .loc_0x3A4
.loc_0x330:
lwz r3, 0x2F6C(r13)
bl 0x26E68
rlwinm. r0,r3,0,24,31
beq- .loc_0x378
lis r3, 0x803A
subi r3, r3, 0x24E0
li r0, 0x1
stw r0, 0x244(r3)
li r4, 0x72
li r5, 0
lwz r3, 0x0(r30)
li r6, 0
li r7, 0
li r8, 0
li r9, -0x1
li r10, 0x1
bl 0x1E408
b .loc_0x3A4
.loc_0x378:
lwz r3, 0x0(r30)
li r4, 0x49
li r5, 0
li r6, 0
li r7, 0
li r8, 0
li r9, -0x1
li r10, 0x1
bl 0x1E3E0
mr r3, r27
bl -0x958
.loc_0x3A4:
lwz r3, 0x2DEC(r13)
mr r4, r28
bl -0x19D2C
lwz r3, 0x2DEC(r13)
lwz r12, 0x1A0(r3)
lwz r12, 0x30(r12)
mtlr r12
blrl
lfs f0, -0x7A80(r2)
li r0, 0x2
lwz r4, 0x0(r27)
li r3, 0
stfs f0, 0x2C(r4)
lfs f0, -0x7A88(r2)
lwz r4, 0x0(r27)
stfs f0, 0x30(r4)
stw r0, 0x8(r27)
b .loc_0x3FC
.loc_0x3EC:
rlwinm r0,r9,2,0,29
lwz r5, 0x40(r1)
add r4, r31, r0
b .loc_0x268
.loc_0x3FC:
lmw r27, 0x4C(r1)
lwz r0, 0x64(r1)
addi r1, r1, 0x60
mtlr r0
blr
*/
}
/*
* --INFO--
* Address: 80058DF8
* Size: 000258
*/
void DayOverModeState::initialisePhaseThree()
{
/*
.loc_0x0:
mflr r0
li r4, 0
stw r0, 0x4(r1)
li r5, 0x1
li r6, 0x78
stwu r1, -0x38(r1)
stw r31, 0x34(r1)
stw r30, 0x30(r1)
stw r29, 0x2C(r1)
mr r29, r3
stw r28, 0x28(r1)
lwz r3, 0x2DEC(r13)
lwz r12, 0x1A0(r3)
lwz r12, 0x2C(r12)
mtlr r12
blrl
lis r3, 0x803A
subi r28, r3, 0x2848
addi r31, r28, 0x1DC
lwz r3, 0x1DC(r28)
bl 0x1E188
lwz r3, 0x2DEC(r13)
li r4, 0x5
li r5, 0x1
bl -0x19E24
lwz r3, 0x2DEC(r13)
li r4, 0x4
li r5, 0x1
bl -0x19E34
lwz r3, 0x2DEC(r13)
li r4, 0x4
li r5, 0x2
bl -0x19E44
lwz r3, 0x2DEC(r13)
li r4, 0x4
bl -0x19E1C
mr r0, r3
lwz r3, 0x2F6C(r13)
mr r30, r0
li r4, 0
bl 0x27B2C
lwz r3, 0x2F6C(r13)
bl 0x27DD0
cmpwi r3, 0x1E
bne- .loc_0xDC
lwz r3, 0x0(r31)
li r4, 0x4C
li r5, 0
li r6, 0
li r7, 0
li r8, 0
li r9, -0x1
li r10, 0x1
bl 0x1E294
b .loc_0x20C
.loc_0xDC:
lwz r0, 0x2FC(r28)
cmpwi r0, 0x1E
bne- .loc_0x20C
lwz r3, 0x2F6C(r13)
bl 0x26CA0
rlwinm. r0,r3,0,24,31
beq- .loc_0x128
lwz r3, 0x0(r31)
li r4, 0x4D
li r5, 0
li r6, 0
li r7, 0
li r8, 0
li r9, -0x1
li r10, 0x1
bl 0x1E250
mr r3, r29
bl -0xAE8
b .loc_0x20C
.loc_0x128:
lis r3, 0x8022
lwz r7, 0x2F6C(r13)
addi r5, r3, 0x2390
lwz r4, 0x0(r5)
li r3, 0x1
lwz r0, 0x4(r5)
addi r6, r1, 0x1C
li r8, 0
stw r4, 0x1C(r1)
stw r0, 0x20(r1)
lwz r0, 0x8(r5)
stw r0, 0x24(r1)
lwz r0, 0x1C(r1)
lbz r4, 0x184(r7)
slw r0, r3, r0
and. r0, r4, r0
beq- .loc_0x178
li r0, 0xC
slw r0, r3, r0
mr r8, r0
.loc_0x178:
lwzu r0, 0x4(r6)
lbz r4, 0x184(r7)
slw r0, r3, r0
and. r0, r4, r0
beq- .loc_0x198
li r0, 0xD
slw r0, r3, r0
or r8, r8, r0
.loc_0x198:
lwz r0, 0x4(r6)
lbz r4, 0x184(r7)
slw r0, r3, r0
and. r0, r4, r0
beq- .loc_0x1B8
li r0, 0xE
slw r0, r3, r0
or r8, r8, r0
.loc_0x1B8:
oris r28, r8, 0xFFFF
lwz r3, 0x2E5C(r13)
ori r28, r28, 0x7FF
bl 0xB5B9C
lis r3, 0x803A
subi r3, r3, 0x2848
lwz r4, 0x20(r3)
addi r3, r3, 0x2D8
lfs f1, 0x10(r4)
bl -0x77B8
lwz r3, 0x0(r31)
addi r9, r28, 0
li r4, 0x4A
li r5, 0
li r6, 0
li r7, 0
li r8, 0
li r10, 0x1
bl 0x1E168
li r0, 0
stw r0, 0x2E68(r13)
.loc_0x20C:
lwz r3, 0x2DEC(r13)
mr r4, r30
bl -0x19FA4
lwz r3, 0x2DEC(r13)
lwz r12, 0x1A0(r3)
lwz r12, 0x30(r12)
mtlr r12
blrl
li r0, 0x3
stw r0, 0x8(r29)
li r3, 0
lwz r0, 0x3C(r1)
lwz r31, 0x34(r1)
lwz r30, 0x30(r1)
lwz r29, 0x2C(r1)
lwz r28, 0x28(r1)
addi r1, r1, 0x38
mtlr r0
blr
*/
}
/*
* --INFO--
* Address: 80059050
* Size: 00013C
*/
void DayOverModeState::initialisePhaseFour()
{
/*
.loc_0x0:
mflr r0
lis r4, 0x803A
stw r0, 0x4(r1)
subi r4, r4, 0x2848
stwu r1, -0x20(r1)
stw r31, 0x1C(r1)
addi r31, r4, 0x1DC
stw r30, 0x18(r1)
stw r29, 0x14(r1)
addi r29, r3, 0
lwz r3, 0x1DC(r4)
bl 0x1DF54
lwz r3, 0x2DEC(r13)
li r4, 0x5
li r5, 0x1
bl -0x1A058
lwz r3, 0x2DEC(r13)
li r4, 0x4
li r5, 0x1
bl -0x1A068
lwz r3, 0x2DEC(r13)
li r4, 0x4
li r5, 0x2
bl -0x1A078
lwz r3, 0x2DEC(r13)
li r4, 0x4
bl -0x1A050
mr r0, r3
lwz r3, 0x2F6C(r13)
mr r30, r0
bl 0x27BA8
cmpwi r3, 0x1E
bne- .loc_0xB4
lwz r3, 0x0(r31)
li r4, 0x4D
li r5, 0
li r6, 0
li r7, 0
li r8, 0
li r9, -0x1
li r10, 0x1
bl 0x1E06C
mr r3, r29
bl -0xCCC
b .loc_0x108
.loc_0xB4:
lwz r4, 0x0(r29)
li r0, 0xB
li r3, 0x8
stw r0, 0x40(r4)
lwz r4, 0x2DEC(r13)
lfs f0, -0x7A84(r2)
stfs f0, 0x8(r4)
lfs f0, -0x7A68(r2)
stfs f0, 0xC(r4)
bl -0x12124
cmplwi r3, 0
beq- .loc_0x120
lis r4, 0x802A
lwz r5, 0x0(r29)
addi r0, r4, 0x7ECC
stw r0, 0x4(r3)
lis r4, 0x802A
addi r0, r4, 0x7EB8
stw r5, 0x0(r3)
stw r0, 0x4(r3)
b .loc_0x120
.loc_0x108:
lwz r3, 0x2DEC(r13)
mr r4, r30
bl -0x1A0F8
li r0, 0x4
stw r0, 0x8(r29)
li r3, 0
.loc_0x120:
lwz r0, 0x24(r1)
lwz r31, 0x1C(r1)
lwz r30, 0x18(r1)
lwz r29, 0x14(r1)
addi r1, r1, 0x20
mtlr r0
blr
*/
}
/*
* --INFO--
* Address: 8005918C
* Size: 0000C0
*/
void GameMovieInterface::parseMessages()
{
/*
.loc_0x0:
mflr r0
stw r0, 0x4(r1)
stwu r1, -0x20(r1)
stw r31, 0x1C(r1)
stw r30, 0x18(r1)
li r30, 0
rlwinm r0,r30,3,0,28
stw r29, 0x14(r1)
addi r29, r3, 0
add r31, r29, r0
b .loc_0x4C
.loc_0x2C:
mr r3, r29
lwz r12, 0x0(r29)
addi r4, r31, 0xC
lwz r12, 0x18(r12)
mtlr r12
blrl
addi r31, r31, 0x8
addi r30, r30, 0x1
.loc_0x4C:
lwz r0, 0x10C(r29)
cmpw r30, r0
blt+ .loc_0x2C
li r30, 0
mulli r0, r30, 0x2C
li r3, 0
stw r3, 0x10C(r29)
add r31, r29, r0
b .loc_0x90
.loc_0x70:
mr r3, r29
lwz r12, 0x0(r29)
addi r4, r31, 0x110
lwz r12, 0x1C(r12)
mtlr r12
blrl
addi r31, r31, 0x2C
addi r30, r30, 0x1
.loc_0x90:
lwz r0, 0x690(r29)
cmpw r30, r0
blt+ .loc_0x70
li r0, 0
stw r0, 0x690(r29)
lwz r0, 0x24(r1)
lwz r31, 0x1C(r1)
lwz r30, 0x18(r1)
lwz r29, 0x14(r1)
addi r1, r1, 0x20
mtlr r0
blr
*/
}
/*
* --INFO--
* Address: 8005924C
* Size: 000428
*/
void GameMovieInterface::parse(GameMovieInterface::SimpleMessage&)
{
/*
.loc_0x0:
mflr r0
stw r0, 0x4(r1)
stwu r1, -0x28(r1)
stw r31, 0x24(r1)
lwz r0, 0x0(r4)
lwz r7, 0x4(r4)
cmplwi r0, 0x11
bgt- .loc_0x414
lis r4, 0x802A
addi r4, r4, 0x7B0C
rlwinm r0,r0,2,0,29
lwzx r0, r4, r0
mtctr r0
bctr
cmpwi r7, 0x11
li r4, -0x1
li r5, 0
bne- .loc_0xFC
lis r3, 0x803A
subi r3, r3, 0x2848
lha r6, 0x1E0(r3)
cmpwi r6, -0x1
bne- .loc_0x90
lha r0, 0x1E2(r3)
cmpwi r0, -0x1
bne- .loc_0x78
lwz r3, 0x1DC(r3)
li r4, 0x2
bl 0x1E998
b .loc_0x414
.loc_0x78:
extsh. r0, r0
bne- .loc_0x88
li r7, 0x1A
b .loc_0xFC
.loc_0x88:
li r7, 0x18
b .loc_0xFC
.loc_0x90:
lha r3, 0x1E2(r3)
extsh. r0, r3
bne- .loc_0xA4
addi r7, r6, 0x5C
b .loc_0xFC
.loc_0xA4:
cmpwi r3, 0x1
bne- .loc_0xBC
addi r4, r6, 0
addi r7, r6, 0x3E
li r5, 0
b .loc_0xFC
.loc_0xBC:
cmpwi r3, 0x2
bne- .loc_0xE8
cmpwi r6, 0x1A
addi r0, r6, 0x7A
bne- .loc_0xE0
li r0, 0x1
stb r0, 0x2E8D(r13)
li r7, 0x1B
b .loc_0xFC
.loc_0xE0:
mr r7, r0
b .loc_0xFC
.loc_0xE8:
cmpwi r3, 0x3
bne- .loc_0xFC
addi r4, r6, 0
addi r7, r6, 0x20
li r5, 0x1
.loc_0xFC:
mr r3, r7
bl -0x2734
lis r3, 0x803A
subi r3, r3, 0x2848
li r0, 0x1
stw r0, 0x338(r3)
b .loc_0x414
lwz r3, 0x2E5C(r13)
bl 0xB4438
lis r3, 0x803A
subi r3, r3, 0x2848
li r0, 0x1
sth r0, 0x1E6(r3)
b .loc_0x414
lbz r0, 0x2E81(r13)
cmplwi r0, 0
beq- .loc_0x414
lbz r0, 0x2E82(r13)
cmplwi r0, 0
beq- .loc_0x414
lwz r3, 0x2F6C(r13)
bl 0x270D8
rlwinm. r0,r3,0,24,31
bne- .loc_0x170
lwz r3, 0x2E5C(r13)
li r4, 0x1
lfs f1, -0x7A88(r2)
lwz r3, 0x344(r3)
bl 0x15F788
.loc_0x170:
lwz r3, 0x2E5C(r13)
li r4, 0x1
lfs f1, -0x7A88(r2)
lwz r3, 0x344(r3)
bl 0x15F8A4
li r0, 0
stb r0, 0x2E82(r13)
b .loc_0x414
lbz r0, 0x2E81(r13)
cmplwi r0, 0
beq- .loc_0x414
lbz r0, 0x2E82(r13)
cmplwi r0, 0
bne- .loc_0x414
lwz r3, 0x2F6C(r13)
bl 0x2707C
rlwinm. r0,r3,0,24,31
bne- .loc_0x1CC
lwz r3, 0x2E5C(r13)
li r4, 0x1
lfs f1, -0x7A88(r2)
lwz r3, 0x344(r3)
bl 0x15F6B0
.loc_0x1CC:
lwz r3, 0x2E5C(r13)
li r4, 0x1
lfs f1, -0x7A88(r2)
lwz r3, 0x344(r3)
bl 0x15F798
li r0, 0x1
stb r0, 0x2E82(r13)
b .loc_0x414
cmpwi r7, 0
bne- .loc_0x308
lis r3, 0x803A
subi r3, r3, 0x24E0
addi r4, r3, 0x234
lwz r0, 0x234(r3)
cmpwi r0, 0x1
bne- .loc_0x294
lis r3, 0x803A
subi r31, r3, 0x2848
lwz r0, 0x2B4(r31)
cmpwi r0, 0
bne- .loc_0x288
lwz r0, 0x2FC(r31)
cmpwi r0, 0x1E
beq- .loc_0x288
lwz r3, 0x1DC(r31)
li r4, 0x2F
li r5, 0
li r6, 0
li r7, 0
li r8, 0
li r9, -0x1
li r10, 0x1
bl 0x1DCC8
lwz r4, 0x20(r31)
addi r3, r31, 0x2D8
lfs f1, 0x20(r4)
bl -0x7C8C
lwz r3, 0x2E68(r13)
cmplwi r3, 0
beq- .loc_0x278
lfs f1, -0x7A64(r2)
li r4, 0x1
bl 0x18F90C
.loc_0x278:
lfs f0, -0x7A84(r2)
lwz r3, 0x2F00(r13)
stfs f0, 0x4CC(r3)
b .loc_0x414
.loc_0x288:
li r0, 0
stw r0, 0x0(r4)
b .loc_0x414
.loc_0x294:
li r0, 0x1
stw r0, 0x0(r4)
li r4, 0
lwz r3, 0x3120(r13)
bl 0xBDF48
lis r4, 0x803A
subi r31, r4, 0x2848
addi r6, r3, 0
lwz r3, 0x1DC(r31)
addi r7, r6, 0x94
addi r8, r6, 0x88
li r4, 0x2E
li r5, 0
li r9, -0x1
li r10, 0x1
bl 0x1DC44
lwz r0, 0x2B4(r31)
cmpwi r0, 0
bne- .loc_0x2EC
lwz r0, 0x2FC(r31)
cmpwi r0, 0x1E
bne- .loc_0x414
.loc_0x2EC:
lwz r3, 0x2E68(r13)
cmplwi r3, 0
beq- .loc_0x414
lfs f1, -0x7A64(r2)
li r4, 0x1
bl 0x18F880
b .loc_0x414
.loc_0x308:
lis r3, 0x803A
subi r3, r3, 0x24E0
li r0, 0x2
stw r0, 0x234(r3)
b .loc_0x414
lis r3, 0x803A
subi r3, r3, 0x24E0
li r0, 0
stw r0, 0x234(r3)
b .loc_0x414
rlwinm r0,r7,0,0,0
lwz r3, 0x2E5C(r13)
neg r4, r0
subic r0, r4, 0x1
subfe r5, r0, r4
rlwinm r4,r7,0,1,31
bl 0xB3A04
b .loc_0x414
lwz r3, 0x2E5C(r13)
mr r4, r7
bl 0xB3E58
b .loc_0x414
lfs f0, -0x7A84(r2)
lwz r4, 0x4(r3)
stfs f0, 0x2C(r4)
lfs f0, -0x7A60(r2)
lwz r3, 0x4(r3)
stfs f0, 0x30(r3)
b .loc_0x414
lfs f0, -0x7A84(r2)
lwz r4, 0x4(r3)
stfs f0, 0x28(r4)
lfs f0, -0x7A80(r2)
lwz r4, 0x4(r3)
stfs f0, 0x2C(r4)
lfs f0, -0x7A5C(r2)
lwz r3, 0x4(r3)
stfs f0, 0x30(r3)
b .loc_0x414
lwz r3, 0x2E5C(r13)
bl 0xB47D0
b .loc_0x414
lwz r3, 0x2E78(r13)
bl 0x19BE14
li r3, 0x6
li r4, 0x1
bl -0x3FD8C
b .loc_0x414
lwz r3, 0x2E5C(r13)
bl 0xB4188
lis r3, 0x803A
subi r4, r3, 0x2848
li r0, 0x1
lis r3, 0x803A
sth r0, 0x1E6(r4)
subi r3, r3, 0x24E0
li r0, 0x2
stw r0, 0x244(r3)
b .loc_0x414
lis r3, 0x803A
subi r3, r3, 0x2848
stw r7, 0x334(r3)
b .loc_0x414
lwz r3, 0x2E5C(r13)
bl 0xB414C
b .loc_0x414
bl -0x2B5C
.loc_0x414:
lwz r0, 0x2C(r1)
lwz r31, 0x24(r1)
addi r1, r1, 0x28
mtlr r0
blr
*/
}
/*
* --INFO--
* Address: 80059674
* Size: 00004C
*/
void GameMovieInterface::parse(GameMovieInterface::ComplexMessage&)
{
/*
.loc_0x0:
mflr r0
addi r10, r4, 0
stw r0, 0x4(r1)
lis r3, 0x803A
subi r3, r3, 0x2848
stwu r1, -0x8(r1)
addi r7, r10, 0xC
addi r8, r10, 0x18
lwz r4, 0x0(r4)
lwz r3, 0x1DC(r3)
lwz r5, 0x4(r10)
lwz r6, 0x8(r10)
lwz r9, 0x24(r10)
lbz r10, 0x28(r10)
bl 0x1DAB4
lwz r0, 0xC(r1)
addi r1, r1, 0x8
mtlr r0
blr
*/
}
/*
* --INFO--
* Address: 800596C0
* Size: 000724
*/
NewPikiGameSection::NewPikiGameSection()
{
/*
.loc_0x0:
mflr r0
lis r4, 0x802A
stw r0, 0x4(r1)
stwu r1, -0x58(r1)
stmw r24, 0x38(r1)
addi r30, r4, 0x7AE0
addi r29, r3, 0
subi r4, r13, 0x7204
bl -0x24728
lis r3, 0x8023
subi r0, r3, 0x71E0
stw r0, 0x0(r29)
addi r3, r29, 0
subi r4, r13, 0x7204
bl -0x18FBC
lis r3, 0x802A
addi r0, r3, 0x642C
lis r3, 0x802A
stw r0, 0x0(r29)
addi r0, r3, 0x7D44
stw r0, 0x0(r29)
addi r3, r29, 0
addi r4, r30, 0x74
bl -0x18FE0
lis r3, 0x803A
subi r3, r3, 0x24E0
addi r27, r3, 0xA8
lwz r4, 0xA8(r3)
lis r3, 0x803A
subi r25, r3, 0x2848
lhz r3, 0x24(r4)
li r0, -0x1
stw r3, 0x1CC(r25)
stw r0, 0x1D0(r25)
lwz r3, 0x2F6C(r13)
bl 0x26D28
rlwinm. r0,r3,0,24,31
beq- .loc_0xA4
addi r3, r25, 0x2D8
lfs f1, -0x7A58(r2)
bl -0x7F44
.loc_0xA4:
lis r3, 0x803A
subi r3, r3, 0x24E0
li r5, 0
stw r5, 0x234(r3)
li r0, 0x2
subi r4, r13, 0x71FC
lwz r3, 0x2DEC(r13)
stw r0, 0x14(r3)
stw r5, 0x2F00(r13)
lwz r3, 0x2FE8(r13)
stw r5, 0x2E58(r13)
bl 0x2CFA8
li r3, 0x3E0
bl -0x12794
mr. r31, r3
beq- .loc_0x6AC
mr r3, r31
bl -0x2924
lis r3, 0x802A
addi r0, r3, 0x7CBC
stw r0, 0x0(r31)
addi r3, r31, 0x5C
bl -0x165F8
lis r3, 0x8003
subi r25, r3, 0x3C8
addi r4, r25, 0
addi r3, r31, 0x3AC
li r5, 0
li r6, 0x4
li r7, 0x2
bl 0x1BB294
addi r4, r25, 0
addi r3, r31, 0x3B4
li r5, 0
li r6, 0x4
li r7, 0x2
bl 0x1BB27C
addi r4, r25, 0
addi r3, r31, 0x3BC
li r5, 0
li r6, 0x4
li r7, 0x2
bl 0x1BB264
li r3, 0xC
bl -0x12810
cmplwi r3, 0
beq- .loc_0x184
lis r4, 0x802A
addi r0, r4, 0x7ECC
stw r0, 0x4(r3)
lis r4, 0x802A
addi r0, r4, 0x7F00
stw r31, 0x0(r3)
stw r0, 0x4(r3)
lwz r0, 0x24(r31)
stw r0, 0x8(r3)
.loc_0x184:
stw r3, 0x34(r31)
lis r3, 0x803A
subi r6, r3, 0x2848
lfs f1, -0x7210(r13)
addi r28, r6, 0x1DC
lfs f0, -0x721C(r13)
li r26, 0
stfs f1, 0x24(r1)
lfs f1, -0x720C(r13)
li r0, 0x1
stfs f0, 0x18(r1)
li r3, 0x130
lfs f0, -0x7218(r13)
stfs f1, 0x28(r1)
lfs f1, -0x7208(r13)
stfs f0, 0x1C(r1)
lfs f0, -0x7214(r13)
stfs f1, 0x2C(r1)
stfs f0, 0x20(r1)
lwz r7, 0x1DC(r6)
stb r26, 0x16C(r7)
lfs f0, -0x7A54(r2)
stfs f0, 0x160(r7)
lwz r5, 0x18(r1)
lwz r4, 0x1C(r1)
stw r5, 0x148(r7)
stw r4, 0x14C(r7)
lwz r4, 0x20(r1)
stw r4, 0x150(r7)
lwz r5, 0x24(r1)
lwz r4, 0x28(r1)
stw r5, 0x154(r7)
stw r4, 0x158(r7)
lwz r4, 0x2C(r1)
stw r4, 0x15C(r7)
stb r26, 0x2E8D(r13)
stw r26, 0x340(r6)
stb r0, 0x3D4(r31)
bl -0x128D8
addi r24, r3, 0
mr. r0, r24
beq- .loc_0x290
addi r3, r24, 0
subi r4, r13, 0x7268
bl -0x2493C
lis r3, 0x802A
addi r25, r3, 0x7C30
stw r25, 0x0(r24)
addi r3, r24, 0x48
subi r4, r13, 0x7268
lfs f0, -0x7A84(r2)
stfs f0, 0x30(r24)
stfs f0, 0x2C(r24)
stfs f0, 0x28(r24)
stw r26, 0x14(r24)
bl -0x24968
stw r25, 0x48(r24)
addi r3, r24, 0x94
lfs f0, -0x7A84(r2)
stfs f0, 0x78(r24)
stfs f0, 0x74(r24)
stfs f0, 0x70(r24)
stw r26, 0x5C(r24)
bl -0x29CF8
addi r3, r24, 0
li r4, 0x42
bl 0x2404
.loc_0x290:
li r0, 0
stw r24, 0x2EAC(r13)
lis r3, 0x803A
stw r0, 0x2E60(r13)
subi r4, r3, 0x2848
li r3, 0x50
sth r0, 0x1E4(r4)
sth r0, 0x1E6(r4)
stw r0, 0x44(r31)
bl -0x12970
addi r24, r3, 0
mr. r0, r24
beq- .loc_0x300
addi r3, r24, 0
addi r4, r30, 0x1C
bl -0x249D4
lis r3, 0x8023
subi r0, r3, 0x71E0
stw r0, 0x0(r24)
addi r3, r24, 0
addi r4, r30, 0x1C
bl -0x19268
lis r3, 0x8023
subi r0, r3, 0x714C
stw r0, 0x0(r24)
addi r3, r24, 0
li r4, 0x2
bl -0x1900C
.loc_0x300:
stw r24, 0x54(r31)
li r26, 0
li r3, 0x694
stw r26, 0x38(r31)
stb r26, 0x2E82(r13)
stb r26, 0x2E81(r13)
bl -0x129D4
addi r24, r3, 0
mr. r0, r24
beq- .loc_0x36C
lis r3, 0x802A
addi r0, r3, 0x7BE0
lis r3, 0x802A
stw r0, 0x0(r24)
addi r0, r3, 0x7DCC
lis r3, 0x8006
stw r0, 0x0(r24)
subi r4, r3, 0x5F08
addi r3, r24, 0x110
li r5, 0
li r6, 0x2C
li r7, 0x20
bl 0x1BB058
li r0, 0x20
stw r0, 0x8(r24)
stw r26, 0x10C(r24)
stw r31, 0x4(r24)
.loc_0x36C:
lis r3, 0x803A
subi r3, r3, 0x2848
stw r24, 0x1E8(r3)
addi r4, r30, 0x8C
lwz r3, 0x2FE8(r13)
bl 0x2CCF8
li r3, 0x18
bl -0x12A44
addi r24, r3, 0
mr. r3, r24
beq- .loc_0x3A0
li r4, 0x1388
bl -0x24964
.loc_0x3A0:
lis r3, 0x803A
subi r3, r3, 0x2848
stw r24, 0x308(r3)
addi r4, r30, 0x8C
lwz r3, 0x2FE8(r13)
bl 0x2CDD4
lis r3, 0x803A
subi r4, r3, 0x24E0
li r0, 0
stw r0, 0x240(r4)
lis r25, 0x28
mr r3, r25
stw r0, 0x23C(r4)
stw r0, 0x238(r4)
bl -0x12A94
lwz r4, 0x2DEC(r13)
addi r6, r3, 0
addi r7, r25, 0
addi r3, r4, 0xF4
subi r4, r13, 0x71F8
li r5, 0x2
bl -0x351AC
lis r25, 0x4
addi r3, r25, 0
bl -0x12ABC
lwz r4, 0x2DEC(r13)
addi r6, r3, 0
addi r7, r25, 0
addi r3, r4, 0x11C
subi r4, r13, 0x71F0
li r5, 0x2
bl -0x351D4
lwz r3, 0x2FE8(r13)
subi r4, r13, 0x71E8
bl 0x2CC50
lwz r3, 0x2FE8(r13)
addi r4, r30, 0x98
bl 0x2CC44
li r3, 0x4D4
bl -0x12AF8
addi r24, r3, 0
mr. r3, r24
beq- .loc_0x454
lwz r4, 0x24(r31)
bl 0xB2DC
.loc_0x454:
stw r24, 0x2F00(r13)
addi r4, r30, 0x98
lwz r3, 0x2FE8(r13)
bl 0x2CD28
lwz r3, 0x2FE8(r13)
subi r4, r13, 0x71E0
bl 0x2CC0C
mr r3, r31
lwz r4, 0x2F00(r13)
bl 0x40C
lwz r3, 0x2FE8(r13)
subi r4, r13, 0x71E0
bl 0x2CD04
lwz r3, 0x2FE8(r13)
subi r4, r13, 0x71E8
bl 0x2CCF8
lwz r3, 0x0(r27)
lhz r4, 0x26(r3)
cmplwi r4, 0x5
bge- .loc_0x4A8
b .loc_0x4AC
.loc_0x4A8:
li r4, 0
.loc_0x4AC:
li r3, 0x5
bl -0x402F0
mr r3, r31
bl .loc_0x724
li r3, 0x348
bl -0x12B7C
addi r24, r3, 0
mr. r3, r24
beq- .loc_0x4E0
lwz r4, 0x24(r31)
addi r6, r31, 0x5C
lwz r5, 0x2F00(r13)
bl 0xB62B0
.loc_0x4E0:
stw r24, 0x2E5C(r13)
mr r3, r31
lwz r4, 0x2E5C(r13)
bl -0x195D4
lis r3, 0x803A
subi r4, r3, 0x24E0
li r30, 0
stw r30, 0x254(r4)
li r3, 0x60
li r0, 0x80
stw r30, 0x258(r4)
li r26, 0xFF
subi r4, r13, 0x71D8
stb r3, 0x3A8(r31)
stb r0, 0x3A9(r31)
stb r26, 0x3AA(r31)
stb r30, 0x3AB(r31)
lwz r3, 0x2FE8(r13)
bl 0x2CB50
lwz r3, 0x2F00(r13)
bl 0xB8C4
lwz r3, 0x2FE8(r13)
subi r4, r13, 0x71D8
bl 0x2CC4C
lwz r3, 0x2FE8(r13)
subi r4, r13, 0x71E8
bl 0x2CB30
lwz r3, 0x2F00(r13)
bl 0xBCB8
lwz r3, 0x2FE8(r13)
subi r4, r13, 0x71E8
bl 0x2CC2C
lwz r3, 0x2E5C(r13)
bl 0xB50F4
stb r30, 0x3AC(r31)
li r6, 0x30
li r5, 0x40
stb r30, 0x3AD(r31)
li r3, 0xC0
li r0, 0x1
stb r6, 0x3AE(r31)
li r4, 0x4
stb r26, 0x3AF(r31)
stb r6, 0x3B0(r31)
stb r6, 0x3B1(r31)
stb r6, 0x3B2(r31)
stb r26, 0x3B3(r31)
stb r30, 0x3B4(r31)
stb r30, 0x3B5(r31)
stb r30, 0x3B6(r31)
stb r30, 0x3B7(r31)
stb r5, 0x3B8(r31)
stb r5, 0x3B9(r31)
stb r3, 0x3BA(r31)
stb r26, 0x3BB(r31)
stb r30, 0x3BC(r31)
stb r30, 0x3BD(r31)
stb r30, 0x3BE(r31)
stb r30, 0x3BF(r31)
stb r3, 0x3C0(r31)
stb r5, 0x3C1(r31)
stb r30, 0x3C2(r31)
stb r26, 0x3C3(r31)
lfs f0, -0x7A50(r2)
stfs f0, 0x3C4(r31)
lfs f0, -0x7A4C(r2)
stfs f0, 0x3C8(r31)
lfs f0, -0x7A48(r2)
stfs f0, 0x3CC(r31)
lfs f0, -0x7A44(r2)
stfs f0, 0x3D0(r31)
lwz r3, 0x2DEC(r13)
addi r5, r3, 0x1C
lwz r3, 0x1C(r3)
stw r0, 0x0(r5)
neg r5, r3
subic r0, r5, 0x1
lwz r3, 0x2DEC(r13)
subfe r25, r0, r5
bl -0x1ACBC
lwz r3, 0x2DEC(r13)
rlwinm r0,r25,0,24,31
stw r0, 0x1C(r3)
lwz r3, 0x2F6C(r13)
bl 0x26784
rlwinm. r0,r3,0,24,31
beq- .loc_0x664
lwz r3, 0x0(r28)
li r4, 0x3
li r5, 0
li r6, 0
li r7, 0
li r8, 0
li r9, -0x1
li r10, 0x1
bl 0x1D444
b .loc_0x698
.loc_0x664:
lwz r3, 0x0(r27)
lhz r0, 0x26(r3)
cmplwi r0, 0x5
bge- .loc_0x698
lwz r3, 0x0(r28)
li r4, 0x28
li r5, 0
li r6, 0
li r7, 0
li r8, 0
li r9, -0x1
li r10, 0x1
bl 0x1D40C
.loc_0x698:
lwz r3, 0x2DEC(r13)
lfs f0, -0x7A80(r2)
stfs f0, 0x8(r3)
lfs f0, -0x7A68(r2)
stfs f0, 0xC(r3)
.loc_0x6AC:
addi r4, r31, 0
addi r3, r29, 0
bl -0x1979C
lwz r3, 0x2FE8(r13)
subi r4, r13, 0x71FC
bl 0x2CAC8
lwz r3, 0x2DEC(r13)
li r0, 0x1
addi r4, r3, 0x1C
lwz r3, 0x1C(r3)
stw r0, 0x0(r4)
neg r3, r3
subic r0, r3, 0x1
subfe r0, r0, r3
lwz r3, 0x2FE8(r13)
rlwinm r26,r0,0,24,31
bl 0x2CB14
lwz r3, 0x2DEC(r13)
stw r26, 0x1C(r3)
lwz r3, 0x2DEC(r13)
lwz r12, 0x1A0(r3)
lwz r12, 0x30(r12)
mtlr r12
blrl
mr r3, r29
lmw r24, 0x38(r1)
lwz r0, 0x5C(r1)
addi r1, r1, 0x58
mtlr r0
blr
.loc_0x724:
*/
}
/*
* --INFO--
* Address: 80059DE4
* Size: 000160
*/
void NewPikiGameSetupSection::init2Ddata()
{
/*
.loc_0x0:
mflr r0
lis r4, 0x802A
stw r0, 0x4(r1)
stwu r1, -0x28(r1)
stw r31, 0x24(r1)
addi r31, r4, 0x7AE0
stw r30, 0x20(r1)
addi r30, r3, 0
li r3, 0x10
bl -0x12E04
stw r3, 0x58(r30)
addi r4, r31, 0xA4
li r5, 0x1
lwz r3, 0x2DEC(r13)
bl -0x1AD14
mr r4, r3
lwz r3, 0x58(r30)
li r5, 0x15
li r6, 0x2A
bl -0x32178
lwz r3, 0x2FE8(r13)
subi r4, r13, 0x71D0
bl 0x2C8FC
lwz r3, 0x2FE8(r13)
subi r4, r13, 0x71CC
bl 0x2C8F0
li r3, 0x58
bl -0x12E4C
addi r30, r3, 0
mr. r3, r30
beq- .loc_0x80
bl 0x1284B8
.loc_0x80:
stw r30, 0x2E70(r13)
subi r4, r13, 0x71CC
lwz r3, 0x2FE8(r13)
bl 0x2C9D8
li r0, 0
lwz r3, 0x2FE8(r13)
stw r0, 0x2E74(r13)
addi r4, r31, 0xB0
stw r0, 0x2E78(r13)
stw r0, 0x2E64(r13)
stw r0, 0x2E7C(r13)
stw r0, 0x2E88(r13)
stw r0, 0x2E84(r13)
bl 0x2C8A0
li r3, 0x1C
bl -0x12E9C
addi r30, r3, 0
mr. r3, r30
beq- .loc_0xD0
bl 0x18EA50
.loc_0xD0:
stw r30, 0x2E68(r13)
addi r4, r31, 0xB0
lwz r3, 0x2FE8(r13)
bl 0x2C988
lwz r3, 0x2FE8(r13)
addi r4, r31, 0xBC
bl 0x2C86C
li r3, 0x38
bl -0x12ED0
addi r30, r3, 0
mr. r3, r30
beq- .loc_0x104
bl 0x18DBCC
.loc_0x104:
stw r30, 0x2E6C(r13)
addi r4, r31, 0xBC
lwz r3, 0x2FE8(r13)
bl 0x2C954
lwz r3, 0x2FE8(r13)
subi r4, r13, 0x71D0
bl 0x2C948
lis r3, 0x803A
lfs f0, -0x7A40(r2)
subi r4, r3, 0x2848
lwz r3, 0x2E6C(r13)
lwz r6, 0x20(r4)
li r4, 0
lfs f2, 0x90(r6)
lfs f1, 0xB0(r6)
fsubs f2, f2, f0
bl 0x18DD90
lwz r0, 0x2C(r1)
lwz r31, 0x24(r1)
lwz r30, 0x20(r1)
addi r1, r1, 0x28
mtlr r0
blr
*/
}
/*
* --INFO--
* Address: 80059F44
* Size: 0001B4
*/
void NewPikiGameSetupSection::createMapObjects(MapMgr*)
{
/*
.loc_0x0:
mflr r0
stw r0, 0x4(r1)
stwu r1, -0x48(r1)
stmw r25, 0x2C(r1)
mr r28, r4
lwz r3, 0x2DEC(r13)
lwz r4, 0x194(r3)
bl -0x1AF40
lis r3, 0x803A
lfs f0, -0x7A80(r2)
subi r3, r3, 0x2848
addi r31, r3, 0x304
stfs f0, 0x304(r3)
lis r3, 0x803A
subi r4, r3, 0x24E0
lwz r3, 0x2DEC(r13)
addi r4, r4, 0x130
li r5, 0x1
lwz r12, 0x1A0(r3)
li r6, 0x1
lwz r12, 0xC(r12)
mtlr r12
blrl
mr. r30, r3
beq- .loc_0x198
li r3, 0x11C
bl -0x12FA8
addi r26, r3, 0
mr. r3, r26
beq- .loc_0x80
mr r4, r30
bl -0x19444
.loc_0x80:
lis r3, 0x803A
subi r5, r3, 0x24E0
lis r3, 0x802A
lis r4, 0x802A
addi r29, r26, 0
addi r25, r5, 0xB0
addi r27, r3, 0x7BB4
addi r26, r4, 0x7BA8
b .loc_0x148
.loc_0xA4:
addi r3, r29, 0
li r4, 0x1
bl -0x18F40
addi r3, r29, 0
addi r4, r26, 0
bl -0x18C28
rlwinm. r0,r3,0,24,31
beq- .loc_0xE8
addi r3, r29, 0
li r4, 0x1
bl -0x18F60
addi r5, r3, 0
crclr 6, 0x6
addi r3, r25, 0
subi r4, r13, 0x71C4
bl 0x1BC574
b .loc_0x148
.loc_0xE8:
addi r3, r29, 0
addi r4, r27, 0
bl -0x18C60
rlwinm. r0,r3,0,24,31
beq- .loc_0x11C
addi r3, r29, 0
li r4, 0x1
bl -0x18F98
crclr 6, 0x6
addi r5, r31, 0
subi r4, r13, 0x71C0
bl 0x1BE03C
b .loc_0x148
.loc_0x11C:
addi r3, r29, 0
subi r4, r13, 0x71BC
bl -0x18C94
rlwinm. r0,r3,0,24,31
beq- .loc_0x148
addi r3, r29, 0
li r4, 0x1
bl -0x18FCC
lwz r3, 0x4(r28)
mr r4, r29
bl 0x14FE4
.loc_0x148:
mr r3, r29
bl -0x19338
rlwinm. r0,r3,0,24,31
bne- .loc_0x168
mr r3, r29
bl -0x18C18
rlwinm. r0,r3,0,24,31
beq+ .loc_0xA4
.loc_0x168:
mr r3, r29
bl -0x19358
rlwinm. r0,r3,0,24,31
bne- .loc_0x184
addi r3, r29, 0
li r4, 0x1
bl -0x19014
.loc_0x184:
mr r3, r30
lwz r12, 0x4(r30)
lwz r12, 0x4C(r12)
mtlr r12
blrl
.loc_0x198:
mr r3, r28
bl 0xB404
lmw r25, 0x2C(r1)
lwz r0, 0x4C(r1)
addi r1, r1, 0x48
mtlr r0
blr
*/
}
/*
* --INFO--
* Address: 8005A0F8
* Size: 000020
*/
GameMovieInterface::ComplexMessage::ComplexMessage()
{
/*
.loc_0x0:
lfs f0, -0x7A84(r2)
stfs f0, 0x14(r3)
stfs f0, 0x10(r3)
stfs f0, 0xC(r3)
stfs f0, 0x20(r3)
stfs f0, 0x1C(r3)
stfs f0, 0x18(r3)
blr
*/
}
/*
* --INFO--
* Address: 8005A118
* Size: 000004
*/
void GameInterface::movie(int, int, Creature*, Vector3f*, Vector3f*, unsigned long, bool) { }
/*
* --INFO--
* Address: 8005A11C
* Size: 000004
*/
void GameInterface::parseMessages() { }
/*
* --INFO--
* Address: 8005A120
* Size: 000004
*/
void GameInterface::parse(int, int) { }
/*
* --INFO--
* Address: 8005A124
* Size: 000054
*/
void NewPikiGameSetupSection::openMenu()
{
/*
.loc_0x0:
mflr r0
li r4, 0
stw r0, 0x4(r1)
stwu r1, -0x18(r1)
stw r31, 0x14(r1)
mr r31, r3
lwz r0, 0x50(r3)
stw r0, 0x20(r3)
lwz r3, 0x20(r3)
lwz r12, 0x0(r3)
lwz r12, 0x48(r12)
mtlr r12
blrl
lwz r3, 0x20(r31)
li r0, 0x1
stb r0, 0x98(r3)
lwz r0, 0x1C(r1)
lwz r31, 0x14(r1)
addi r1, r1, 0x18
mtlr r0
blr
*/
}
/*
* --INFO--
* Address: 8005A178
* Size: 000138
*/
void NewPikiGameSetupSection::update()
{
/*
.loc_0x0:
mflr r0
stw r0, 0x4(r1)
stwu r1, -0x18(r1)
stw r31, 0x14(r1)
mr r31, r3
stw r30, 0x10(r1)
lwz r4, 0x3D8(r3)
lis r3, 0x803A
subi r3, r3, 0x2848
subi r0, r4, 0x1
stw r0, 0x3D8(r31)
lwz r3, 0x1DC(r3)
lbz r0, 0x124(r3)
cmplwi r0, 0
bne- .loc_0x94
lwz r3, 0x2DEC(r13)
li r4, 0x5
bl -0x1B19C
lwz r4, 0x18(r3)
lwz r0, 0x10(r3)
sub. r0, r0, r4
beq- .loc_0x94
lwz r3, 0x2DEC(r13)
li r0, 0x1
li r4, 0x5
addi r6, r3, 0x1C
lwz r3, 0x1C(r3)
li r5, 0x1
stw r0, 0x0(r6)
neg r6, r3
subic r0, r6, 0x1
lwz r3, 0x2DEC(r13)
subfe r30, r0, r6
bl -0x1B1C8
lwz r3, 0x2DEC(r13)
rlwinm r0,r30,0,24,31
stw r0, 0x1C(r3)
.loc_0x94:
lwz r3, 0x24(r31)
lwz r12, 0x0(r3)
lwz r12, 0x10(r12)
mtlr r12
blrl
lwz r3, 0x54(r31)
lwz r12, 0x0(r3)
lwz r12, 0x10(r12)
mtlr r12
blrl
lbz r0, 0x3D4(r31)
cmplwi r0, 0
bne- .loc_0xFC
lwz r0, 0x38(r31)
cmplwi r0, 0
beq- .loc_0xE0
stw r0, 0x34(r31)
li r0, 0
stw r0, 0x38(r31)
.loc_0xE0:
lwz r3, 0x34(r31)
addi r4, r31, 0x3C
lwz r12, 0x4(r3)
lwz r12, 0x8(r12)
mtlr r12
blrl
stw r3, 0x34(r31)
.loc_0xFC:
lwz r3, 0x20(r31)
cmplwi r3, 0
beq- .loc_0x120
lwz r12, 0x0(r3)
li r4, 0
lwz r12, 0x50(r12)
mtlr r12
blrl
stw r3, 0x20(r31)
.loc_0x120:
lwz r0, 0x1C(r1)
lwz r31, 0x14(r1)
lwz r30, 0x10(r1)
addi r1, r1, 0x18
mtlr r0
blr
*/
}
/*
* --INFO--
* Address: 8005A2B0
* Size: 00000C
*/
void ModeState::update(unsigned long&)
{
/*
.loc_0x0:
li r0, 0x3
stw r0, 0x0(r4)
blr
*/
}
/*
* --INFO--
* Address: 8005A2BC
* Size: 00083C
*/
void NewPikiGameSetupSection::draw(Graphics&)
{
/*
.loc_0x0:
mflr r0
lis r5, 0x803A
stw r0, 0x4(r1)
subi r5, r5, 0x2848
stwu r1, -0x2A8(r1)
stmw r25, 0x28C(r1)
addi r27, r5, 0x338
addi r30, r3, 0
addi r31, r4, 0
lwz r0, 0x338(r5)
cmpwi r0, 0
beq- .loc_0x3C
lwz r0, 0x340(r5)
cmpwi r0, 0
beq- .loc_0x4C
.loc_0x3C:
lis r3, 0x803A
subi r3, r3, 0x2848
lwz r3, 0x1DC(r3)
bl 0x1D584
.loc_0x4C:
lis r3, 0x803A
subi r3, r3, 0x2848
addi r29, r3, 0x1DC
lwz r3, 0x1DC(r3)
mr r4, r31
bl 0x1DA00
rlwinm. r0,r3,0,24,31
bne- .loc_0x1A0
lwz r6, 0x0(r29)
lfs f2, -0x7A84(r2)
addi r4, r6, 0x168
lfs f3, 0x168(r6)
fcmpo cr0, f3, f2
ble- .loc_0xEC
lwz r3, 0x2DEC(r13)
lfs f1, -0x7A3C(r2)
lfs f0, 0x28C(r3)
fmuls f0, f1, f0
fsubs f0, f3, f0
stfs f0, 0x0(r4)
lwz r3, 0x0(r29)
lfsu f0, 0x168(r3)
fcmpo cr0, f0, f2
bge- .loc_0xB0
stfs f2, 0x0(r3)
.loc_0xB0:
lwz r3, 0x30D8(r13)
lwz r4, 0x0(r29)
lwz r3, 0x20(r3)
lfs f3, 0x144(r4)
lwz r3, 0x4(r3)
lfs f2, -0x7A80(r2)
lfs f0, 0x1CC(r3)
lfs f1, 0x168(r4)
fsubs f0, f0, f3
lwz r3, 0x2E4(r31)
fsubs f1, f2, f1
fmuls f0, f1, f0
fadds f0, f3, f0
stfs f0, 0x1CC(r3)
b .loc_0x138
.loc_0xEC:
lwz r3, 0x30D8(r13)
li r0, 0x1
lwz r5, 0x20(r3)
lwz r3, 0x4(r5)
lfs f0, 0x1CC(r3)
stb r0, 0x16C(r6)
stfs f0, 0x160(r6)
lwz r3, 0x8(r5)
lwz r0, 0xC(r5)
stw r3, 0x148(r6)
stw r0, 0x14C(r6)
lwz r0, 0x10(r5)
stw r0, 0x150(r6)
lwz r3, 0x14(r5)
lwz r0, 0x18(r5)
stw r3, 0x154(r6)
stw r0, 0x158(r6)
lwz r0, 0x1C(r5)
stw r0, 0x15C(r6)
.loc_0x138:
mr r3, r31
lwz r12, 0x3B4(r31)
addi r4, r30, 0x5C
lwz r12, 0x6C(r12)
mtlr r12
blrl
lwz r5, 0x30C(r31)
lis r4, 0x4330
lwz r0, 0x310(r31)
addi r3, r30, 0x5C
xoris r5, r5, 0x8000
xoris r0, r0, 0x8000
stw r5, 0x284(r1)
lfd f5, -0x7A28(r2)
stw r0, 0x27C(r1)
lfs f2, 0x228(r30)
stw r4, 0x280(r1)
lfs f3, -0x7A38(r2)
stw r4, 0x278(r1)
lfd f1, 0x280(r1)
lfd f0, 0x278(r1)
fsubs f1, f1, f5
lfs f4, 0x3A4(r30)
fsubs f0, f0, f5
fdivs f1, f1, f0
bl -0x17804
.loc_0x1A0:
lis r3, 0x803A
subi r3, r3, 0x2848
lwz r0, 0x1D8(r3)
addi r28, r3, 0x1D8
rlwinm. r0,r0,0,24,24
bne- .loc_0x1C8
lwz r3, 0x2E5C(r13)
mr r4, r31
lwz r3, 0x64(r3)
bl 0xB724
.loc_0x1C8:
lwz r5, 0x310(r31)
li r26, 0
lwz r0, 0x30C(r31)
addi r4, r1, 0x138
addi r3, r31, 0
stw r26, 0x138(r1)
stw r26, 0x13C(r1)
stw r0, 0x140(r1)
stw r5, 0x144(r1)
lwz r12, 0x3B4(r31)
lwz r12, 0x48(r12)
mtlr r12
blrl
lwz r5, 0x310(r31)
addi r4, r1, 0x148
lwz r0, 0x30C(r31)
mr r3, r31
stw r26, 0x148(r1)
stw r26, 0x14C(r1)
stw r0, 0x150(r1)
stw r5, 0x154(r1)
lwz r12, 0x3B4(r31)
lwz r12, 0x50(r12)
mtlr r12
blrl
stb r26, 0x158(r1)
addi r4, r1, 0x158
addi r3, r31, 0
stb r26, 0x159(r1)
stb r26, 0x15A(r1)
stb r26, 0x15B(r1)
lwz r12, 0x3B4(r31)
lwz r12, 0xB4(r12)
mtlr r12
blrl
mr r3, r31
lwz r12, 0x3B4(r31)
li r4, 0x3
li r5, 0
lwz r12, 0x38(r12)
mtlr r12
blrl
mr r3, r31
lwz r5, 0x2E4(r31)
lwz r12, 0x3B4(r31)
lfs f1, 0x1CC(r5)
addi r4, r5, 0x260
lwz r12, 0x3C(r12)
lfs f2, 0x1C4(r5)
mtlr r12
lfs f3, 0x1D0(r5)
lfs f4, 0x1D4(r5)
lfs f5, -0x7A80(r2)
blrl
lwz r0, 0x2E7C(r13)
cmplwi r0, 0
bne- .loc_0x32C
lwz r0, 0x0(r28)
rlwinm. r0,r0,0,24,24
bne- .loc_0x32C
li r25, 0x1
lwz r3, 0x2F6C(r13)
bl 0x25EF8
rlwinm. r0,r3,0,24,31
beq- .loc_0x2E4
lis r3, 0x803A
subi r3, r3, 0x2848
lha r0, 0x1E4(r3)
cmpwi r0, 0
bne- .loc_0x2E4
mr r25, r26
.loc_0x2E4:
rlwinm. r0,r25,0,24,31
beq- .loc_0x2FC
lis r3, 0x803A
subi r3, r3, 0x2848
lfs f1, 0x2F0(r3)
b .loc_0x300
.loc_0x2FC:
lfs f1, -0x7A58(r2)
.loc_0x300:
lwz r3, 0x2F00(r13)
mr r4, r31
li r5, 0x8
lwz r3, 0x4(r3)
bl 0x13F90
lfs f0, -0x7A34(r2)
addi r3, r30, 0
addi r4, r31, 0
stfs f0, 0x3A4(r30)
bl -0x19E10
b .loc_0x390
.loc_0x32C:
lwz r3, 0x2F00(r13)
mr r4, r31
lfs f1, -0x7A30(r2)
li r5, 0x8
lwz r3, 0x4(r3)
bl 0x13F60
lwz r3, 0x0(r29)
mr r4, r31
bl 0x1D814
mr r3, r31
lfs f1, -0x7A80(r2)
bl -0x30E38
lwz r3, 0x0(r29)
mr r4, r31
bl 0x1D85C
lwz r12, 0x3B4(r31)
lis r4, 0x803A
mr r3, r31
lwz r12, 0x74(r12)
subi r4, r4, 0x77C0
li r5, 0
mtlr r12
blrl
mr r3, r31
bl -0x31F7C
.loc_0x390:
lwz r3, 0x3180(r13)
cmplwi r3, 0
beq- .loc_0x400
lis r4, 0x803A
subi r4, r4, 0x2848
lwz r0, 0x33C(r4)
cmpwi r0, 0
bne- .loc_0x3BC
lwz r0, 0x0(r27)
cmpwi r0, 0
beq- .loc_0x3D0
.loc_0x3BC:
lis r4, 0x803A
subi r4, r4, 0x2848
lwz r0, 0x340(r4)
cmpwi r0, 0
beq- .loc_0x3F4
.loc_0x3D0:
lwz r4, 0x2DEC(r13)
li r5, 0x1
lwz r0, 0x258(r4)
cmpwi r0, 0
blt- .loc_0x3E8
li r5, 0
.loc_0x3E8:
rlwinm. r0,r5,0,24,31
beq- .loc_0x3F4
bl 0x14228C
.loc_0x3F4:
lwz r3, 0x3180(r13)
mr r4, r31
bl 0x1422FC
.loc_0x400:
lwz r0, 0x0(r28)
rlwinm. r0,r0,0,24,24
bne- .loc_0x54C
li r26, 0
stb r26, 0x2E80(r13)
addi r5, r1, 0x1E4
addi r3, r31, 0
lwz r6, 0x310(r31)
addi r4, r1, 0x234
lwz r0, 0x30C(r31)
stw r26, 0x1E4(r1)
stw r26, 0x1E8(r1)
stw r0, 0x1EC(r1)
stw r6, 0x1F0(r1)
lwz r12, 0x3B4(r31)
lwz r12, 0x40(r12)
mtlr r12
blrl
mr r3, r31
lwz r5, 0x2E4(r31)
lwz r12, 0x3B4(r31)
lfs f3, -0x7A80(r2)
addi r4, r5, 0x260
lwz r12, 0x3C(r12)
fmr f5, f3
lfs f1, -0x7A54(r2)
mtlr r12
lfs f2, 0x1C4(r5)
lfs f4, 0x1D4(r5)
blrl
lfs f2, -0x7228(r13)
addi r6, r1, 0x11C
lfs f1, -0x7234(r13)
addi r5, r1, 0x110
lfs f0, -0x7240(r13)
stfs f2, 0x11C(r1)
addi r4, r1, 0x104
lfs f2, -0x7224(r13)
addi r3, r1, 0x84
stfs f1, 0x110(r1)
lfs f1, -0x7230(r13)
stfs f0, 0x104(r1)
lfs f0, -0x723C(r13)
stfs f2, 0x120(r1)
lfs f2, -0x7220(r13)
stfs f1, 0x114(r1)
lfs f1, -0x722C(r13)
stfs f0, 0x108(r1)
lfs f0, -0x7238(r13)
stfs f2, 0x124(r1)
stfs f1, 0x118(r1)
stfs f0, 0x10C(r1)
bl -0x1C698
li r0, 0x700
stw r0, 0x4(r31)
mr r4, r31
lwz r3, 0x34(r30)
lwz r12, 0x4(r3)
lwz r12, 0xC(r12)
mtlr r12
blrl
lwz r6, 0x310(r31)
addi r5, r1, 0x128
lwz r0, 0x30C(r31)
mr r3, r31
addi r4, r1, 0xC4
stw r26, 0x128(r1)
stw r26, 0x12C(r1)
stw r0, 0x130(r1)
stw r6, 0x134(r1)
lwz r12, 0x3B4(r31)
lwz r12, 0x40(r12)
mtlr r12
blrl
lwz r0, 0x20(r30)
cmplwi r0, 0
bne- .loc_0x54C
lwz r3, 0x2E84(r13)
cmplwi r3, 0
beq- .loc_0x54C
mr r4, r31
bl 0x1389CC
stb r3, 0x2E80(r13)
.loc_0x54C:
lwz r6, 0x310(r31)
li r26, 0
lwz r0, 0x30C(r31)
addi r5, r1, 0x1D4
addi r3, r31, 0
stw r26, 0x1D4(r1)
addi r4, r1, 0x234
stw r26, 0x1D8(r1)
stw r0, 0x1DC(r1)
stw r6, 0x1E0(r1)
lwz r12, 0x3B4(r31)
lwz r12, 0x40(r12)
mtlr r12
blrl
lwz r6, 0x310(r31)
addi r5, r1, 0x1C4
lwz r0, 0x30C(r31)
mr r3, r31
addi r4, r1, 0x234
stw r26, 0x1C4(r1)
stw r26, 0x1C8(r1)
stw r0, 0x1CC(r1)
stw r6, 0x1D0(r1)
lwz r12, 0x3B4(r31)
lwz r12, 0x40(r12)
mtlr r12
blrl
lwz r3, 0x20(r30)
cmplwi r3, 0
beq- .loc_0x5D0
lfs f1, -0x7A80(r2)
mr r4, r31
bl 0x3B88
.loc_0x5D0:
lwz r0, 0x20(r30)
cmplwi r0, 0
beq- .loc_0x5EC
lwz r3, 0x0(r29)
lbz r0, 0x124(r3)
cmplwi r0, 0
beq- .loc_0x72C
.loc_0x5EC:
lwz r0, 0x2E64(r13)
cmplwi r0, 0
beq- .loc_0x63C
lwz r7, 0x310(r31)
li r0, 0
lwz r6, 0x30C(r31)
addi r5, r1, 0x1B4
addi r3, r31, 0
stw r0, 0x1B4(r1)
addi r4, r1, 0x234
stw r0, 0x1B8(r1)
stw r6, 0x1BC(r1)
stw r7, 0x1C0(r1)
lwz r12, 0x3B4(r31)
lwz r12, 0x40(r12)
mtlr r12
blrl
lwz r3, 0x2E64(r13)
mr r4, r31
bl 0x194DE4
.loc_0x63C:
lwz r0, 0x2E74(r13)
cmplwi r0, 0
beq- .loc_0x68C
lwz r7, 0x310(r31)
li r0, 0
lwz r6, 0x30C(r31)
addi r5, r1, 0x1A4
addi r3, r31, 0
stw r0, 0x1A4(r1)
addi r4, r1, 0x234
stw r0, 0x1A8(r1)
stw r6, 0x1AC(r1)
stw r7, 0x1B0(r1)
lwz r12, 0x3B4(r31)
lwz r12, 0x40(r12)
mtlr r12
blrl
lwz r3, 0x2E74(r13)
mr r4, r31
bl 0x12A658
.loc_0x68C:
lwz r0, 0x2E78(r13)
cmplwi r0, 0
beq- .loc_0x6DC
lwz r7, 0x310(r31)
li r0, 0
lwz r6, 0x30C(r31)
addi r5, r1, 0x194
addi r3, r31, 0
stw r0, 0x194(r1)
addi r4, r1, 0x234
stw r0, 0x198(r1)
stw r6, 0x19C(r1)
stw r7, 0x1A0(r1)
lwz r12, 0x3B4(r31)
lwz r12, 0x40(r12)
mtlr r12
blrl
lwz r3, 0x2E78(r13)
mr r4, r31
bl 0x19A948
.loc_0x6DC:
lwz r0, 0x2E7C(r13)
cmplwi r0, 0
beq- .loc_0x72C
lwz r7, 0x310(r31)
li r0, 0
lwz r6, 0x30C(r31)
addi r5, r1, 0x184
addi r3, r31, 0
stw r0, 0x184(r1)
addi r4, r1, 0x234
stw r0, 0x188(r1)
stw r6, 0x18C(r1)
stw r7, 0x190(r1)
lwz r12, 0x3B4(r31)
lwz r12, 0x40(r12)
mtlr r12
blrl
lwz r3, 0x2E7C(r13)
mr r4, r31
bl 0x138EFC
.loc_0x72C:
addi r3, r30, 0
addi r4, r31, 0
bl -0x3A54
lbz r0, 0x3D4(r30)
cmplwi r0, 0
bne- .loc_0x800
lwz r3, 0x2DEC(r13)
lbz r0, 0x0(r3)
cmplwi r0, 0
bne- .loc_0x810
lwz r0, 0x20(r30)
cmplwi r0, 0
beq- .loc_0x770
lwz r3, 0x0(r29)
lbz r0, 0x124(r3)
cmplwi r0, 0
beq- .loc_0x810
.loc_0x770:
lis r3, 0x803A
subi r31, r3, 0x2848
lwz r0, 0x33C(r31)
cmpwi r0, 0
bne- .loc_0x7D0
lwz r0, 0x0(r27)
cmpwi r0, 0
bne- .loc_0x7D0
lwz r3, 0x0(r29)
lbz r0, 0x124(r3)
cmplwi r0, 0
bne- .loc_0x7C8
lwz r0, 0x3C(r30)
rlwinm. r0,r0,0,30,30
beq- .loc_0x7C8
lwz r3, 0x2F6C(r13)
bl 0x25A08
rlwinm. r0,r3,0,24,31
bne- .loc_0x7C8
addi r3, r31, 0x2D8
lfs f1, -0x7A80(r2)
bl -0x91BC
.loc_0x7C8:
mr r3, r30
bl -0x1A324
.loc_0x7D0:
lwz r3, 0x2E5C(r13)
lwz r3, 0x344(r3)
bl 0x15DAEC
lwz r0, 0x3C(r30)
rlwinm. r0,r0,0,31,31
beq- .loc_0x810
lwz r0, 0x0(r28)
rlwinm. r0,r0,0,24,24
bne- .loc_0x810
lwz r3, 0x2E5C(r13)
bl 0xB6030
b .loc_0x810
.loc_0x800:
lwz r3, 0x2E5C(r13)
bl 0xB4F2C
li r0, 0
stb r0, 0x3D4(r30)
.loc_0x810:
lwz r0, 0x38(r30)
cmplwi r0, 0
beq- .loc_0x828
stw r0, 0x34(r30)
li r0, 0
stw r0, 0x38(r30)
.loc_0x828:
lmw r25, 0x28C(r1)
lwz r0, 0x2AC(r1)
addi r1, r1, 0x2A8
mtlr r0
blr
*/
}
/*
* --INFO--
* Address: 8005AAF8
* Size: 000004
*/
void ModeState::postRender(Graphics&) { }
/*
* --INFO--
* Address: 8005AAFC
* Size: 000004
*/
void NewPikiGameSection::init() { }
/*
* --INFO--
* Address: 8005AB00
* Size: 00003C
*/
void GameMovieInterface::message(int, int)
{
/*
.loc_0x0:
lwz r6, 0x10C(r3)
lwz r0, 0x8(r3)
cmpw r6, r0
bgelr-
rlwinm r0,r6,3,0,28
add r6, r3, r0
stw r4, 0xC(r6)
lwz r0, 0x10C(r3)
rlwinm r0,r0,3,0,28
add r4, r3, r0
stw r5, 0x10(r4)
lwz r4, 0x10C(r3)
addi r0, r4, 0x1
stw r0, 0x10C(r3)
blr
*/
}
/*
* --INFO--
* Address: 8005AB3C
* Size: 00011C
*/
void GameMovieInterface::movie(int, int, Creature*, Vector3f*, Vector3f*, unsigned long, bool)
{
/*
.loc_0x0:
lwz r11, 0x690(r3)
lwz r0, 0x8(r3)
cmpw r11, r0
bgelr-
mulli r0, r11, 0x2C
add r11, r3, r0
stw r4, 0x110(r11)
cmplwi r7, 0
lwz r0, 0x690(r3)
mulli r0, r0, 0x2C
add r4, r3, r0
stw r5, 0x114(r4)
lwz r0, 0x690(r3)
mulli r0, r0, 0x2C
add r4, r3, r0
stw r6, 0x118(r4)
bne- .loc_0x70
lwz r0, 0x690(r3)
lfs f0, -0x7280(r13)
mulli r4, r0, 0x2C
addi r4, r4, 0x11C
add r4, r3, r4
stfs f0, 0x0(r4)
lfs f0, -0x727C(r13)
stfs f0, 0x4(r4)
lfs f0, -0x7278(r13)
stfs f0, 0x8(r4)
b .loc_0x94
.loc_0x70:
lwz r0, 0x690(r3)
lwz r4, 0x0(r7)
mulli r5, r0, 0x2C
lwz r0, 0x4(r7)
add r5, r3, r5
stw r4, 0x11C(r5)
stw r0, 0x120(r5)
lwz r0, 0x8(r7)
stw r0, 0x124(r5)
.loc_0x94:
cmplwi r8, 0
bne- .loc_0xC8
lwz r0, 0x690(r3)
lfs f0, -0x7274(r13)
mulli r4, r0, 0x2C
addi r4, r4, 0x128
add r4, r3, r4
stfs f0, 0x0(r4)
lfs f0, -0x7270(r13)
stfs f0, 0x4(r4)
lfs f0, -0x726C(r13)
stfs f0, 0x8(r4)
b .loc_0xEC
.loc_0xC8:
lwz r0, 0x690(r3)
lwz r4, 0x0(r8)
mulli r5, r0, 0x2C
lwz r0, 0x4(r8)
add r5, r3, r5
stw r4, 0x128(r5)
stw r0, 0x12C(r5)
lwz r0, 0x8(r8)
stw r0, 0x130(r5)
.loc_0xEC:
lwz r0, 0x690(r3)
mulli r0, r0, 0x2C
add r4, r3, r0
stw r9, 0x134(r4)
lwz r0, 0x690(r3)
mulli r0, r0, 0x2C
add r4, r3, r0
stb r10, 0x138(r4)
lwz r4, 0x690(r3)
addi r0, r4, 0x1
stw r0, 0x690(r3)
blr
*/
}
/*
* --INFO--
* Address: 8005AC58
* Size: 0000C8
*/
void DayOverModeState::postRender(Graphics&)
{
/*
.loc_0x0:
mflr r0
stw r0, 0x4(r1)
stwu r1, -0x78(r1)
stw r31, 0x74(r1)
addi r31, r4, 0
lwz r0, 0x2E88(r13)
cmplwi r0, 0
beq- .loc_0x64
lwz r7, 0x310(r31)
li r0, 0
lwz r6, 0x30C(r31)
addi r5, r1, 0x20
addi r3, r31, 0
stw r0, 0x20(r1)
addi r4, r1, 0x30
stw r0, 0x24(r1)
stw r6, 0x28(r1)
stw r7, 0x2C(r1)
lwz r12, 0x3B4(r31)
lwz r12, 0x40(r12)
mtlr r12
blrl
lwz r3, 0x2E88(r13)
mr r4, r31
bl 0x128018
.loc_0x64:
lwz r0, 0x2E68(r13)
cmplwi r0, 0
beq- .loc_0xB4
lwz r7, 0x310(r31)
li r0, 0
lwz r6, 0x30C(r31)
addi r5, r1, 0x10
addi r3, r31, 0
stw r0, 0x10(r1)
addi r4, r1, 0x30
stw r0, 0x14(r1)
stw r6, 0x18(r1)
stw r7, 0x1C(r1)
lwz r12, 0x3B4(r31)
lwz r12, 0x40(r12)
mtlr r12
blrl
lwz r3, 0x2E68(r13)
mr r4, r31
bl 0x18E90C
.loc_0xB4:
lwz r0, 0x7C(r1)
lwz r31, 0x74(r1)
addi r1, r1, 0x78
mtlr r0
blr
*/
}
/*
* --INFO--
* Address: 8005AD20
* Size: 000078
*/
void MessageModeState::postRender(Graphics&)
{
/*
.loc_0x0:
mflr r0
stw r0, 0x4(r1)
stwu r1, -0x68(r1)
stw r31, 0x64(r1)
addi r31, r4, 0
lwz r0, 0x2E68(r13)
cmplwi r0, 0
beq- .loc_0x64
lwz r7, 0x310(r31)
li r0, 0
lwz r6, 0x30C(r31)
addi r5, r1, 0x10
addi r3, r31, 0
stw r0, 0x10(r1)
addi r4, r1, 0x20
stw r0, 0x14(r1)
stw r6, 0x18(r1)
stw r7, 0x1C(r1)
lwz r12, 0x3B4(r31)
lwz r12, 0x40(r12)
mtlr r12
blrl
lwz r3, 0x2E68(r13)
mr r4, r31
bl 0x18E894
.loc_0x64:
lwz r0, 0x6C(r1)
lwz r31, 0x64(r1)
addi r1, r1, 0x68
mtlr r0
blr
*/
}
/*
* --INFO--
* Address: 8005AD98
* Size: 00000C
*/
void QuittingGameModeState::update(unsigned long&)
{
/*
.loc_0x0:
li r0, 0
stw r0, 0x0(r4)
blr
*/
}
/*
* --INFO--
* Address: 8005ADA4
* Size: 000074
*/
void QuittingGameModeState::postUpdate()
{
/*
.loc_0x0:
mflr r0
stw r0, 0x4(r1)
stwu r1, -0x18(r1)
stw r31, 0x14(r1)
mr r31, r3
lwz r4, 0x2DEC(r13)
lbz r0, 0x0(r4)
cmplwi r0, 0
bne- .loc_0x60
lwz r3, 0x2E5C(r13)
bl 0xB3EBC
lwz r4, 0x0(r31)
lis r3, 0x803A
subi r5, r3, 0x2848
lwz r4, 0x40(r4)
li r0, 0x6
li r3, 0xD
stw r4, 0x1F4(r5)
li r4, 0
stw r0, 0x1FC(r5)
bl -0x41114
lwz r3, 0x2DEC(r13)
li r0, 0x1
stb r0, 0x0(r3)
.loc_0x60:
lwz r0, 0x1C(r1)
lwz r31, 0x14(r1)
addi r1, r1, 0x18
mtlr r0
blr
*/
}
/*
* --INFO--
* Address: 8005AE18
* Size: 000004
*/
void BaseGameSection::openMenu() { }
|
package sk.stuba.fei.uim.mobv_project.utils
import sk.stuba.fei.uim.mobv_project.data.entities.Account
object SecurityContext {
var account: Account? = null
}
|
#! python3
import yaml
import os
import engine
from rhythmic import Logger # to exclude this dependency search through for Logger() and .writeDown()
from flask import Flask, request, render_template
import json
def get_boxops_configuration():
try:
with open("config.yaml", "r") as configuration_file:
boxops_configuration = yaml.safe_load(configuration_file)
except Exception as configuration_load_exception:
print(configuration_load_exception)
print("Failed to load configuration, using defaults")
boxops_configuration = {
"drills_directory": "drills",
"web_ui_triggered_drills_directory": "webdrills"
}
return boxops_configuration
def collect_drills(boxops_configuration):
drill_files = []
cwd = os.getcwd()
drills_path = "{}/{}".format(cwd, boxops_configuration["web_ui_triggered_drills_directory"])
drills_folder_list = os.listdir(drills_path)
for item in drills_folder_list:
if os.path.isfile(drills_path+"/"+item):
drill_files.append(drills_path+"/"+item)
drills = []
for the_drill_file in drill_files:
the_drill = engine.load_yaml(the_drill_file)
if engine.test_the_drill(the_drill):
drills.append(the_drill)
return drills
def get_the_drill_by_name(all_the_drills, the_drill_name):
for the_drill in all_the_drills:
if the_drill["name"] == the_drill_name:
return the_drill
return False
app = Flask(__name__)
log_path = os.getcwd() + "/log"
blocker = log_path + "/drill.blk"
boxops_logger = Logger(log_filename_postfix="boxopsweb", path_to_log=log_path)
boxops_logger.writeDown("Starting boxopsweb webservice")
boxops_configuration = get_boxops_configuration()
all_the_drills = collect_drills(boxops_configuration)
blocking_message = """
<html>
<body>
<h2>The drill is in progress, try 15 minutes later.</h2>
</body>
</html>
"""
def args_to_html_inputs(the_drill):
args_inputs = ""
task_counter = 0
for the_task in the_drill["tasks"]:
task_counter += 1
if engine.is_key_present(the_task["task"], "args"):
for the_arg in the_task["task"]["args"]:
args_inputs += "<br><b>{0}</b>:<br><input type=\"text\" name=\"task{1}_{0}\" value=\"{2}\"><br>" \
.format(the_arg, task_counter, the_task["task"]["args"][the_arg])
return args_inputs
@app.route("/", methods=["POST", "GET"])
@app.route("/index", methods=["POST", "GET"])
def index():
global all_the_drills
global boxops_configuration
if os.path.exists(blocker):
return blocking_message
context = {
"drills": all_the_drills
}
if request.method == "POST":
the_data = request.form
drill_arguments = {}
for key, value in the_data.items():
print("{}: {}".format(key, value))
if key !="the_drill":
drill_arguments[key] = value
the_drill_name = the_data["the_drill"]
context["the_selected_drill"] = the_drill_name
the_drill_template = get_the_drill_by_name(all_the_drills, the_drill_name)
if len(the_data) > 1:
the_drill = engine.update_drill_arguments(the_drill_template, drill_arguments)
context["args"] = args_to_html_inputs(the_drill)
else:
the_drill = the_drill_template
with open(blocker, "w") as blocking_flag:
blocking_flag.write(the_drill_name)
the_drill_execution_output = engine.execute_the_drill(the_drill)
context["execution_output"] = the_drill_execution_output.replace("\n", "<br>")
boxops_logger.writeDown(the_drill_execution_output)
try:
os.remove(blocker)
except Exception as no_blocker_exception:
print(no_blocker_exception)
return render_template("boxopsweb.html", context=context)
@app.route("/args", methods=["POST"])
def get_drill_args():
global all_the_drills
if request.method == "POST":
the_data = json.loads(request.data)
the_drill_name = the_data["the_drill"]
if the_drill_name == "-none-":
return ""
the_drill = get_the_drill_by_name(all_the_drills, the_drill_name)
args_inputs = args_to_html_inputs(the_drill)
else:
args_inputs = "wrong method"
return args_inputs
def main():
app.run(debug=False, host="0.0.0.0", port="5100")
if __name__ == "__main__":
main()
|
using System.Web.Security;
namespace cohort
{
public class FormsAuthenticationService : IAuthenticationService
{
public void SignIn(string email, bool rememberMe)
{
// Create the auth ticket manually, then store it somewhere we can periodically log people out when it is expired!
// Note: Could be run in a web farm, so "peek" at the latest User first to see if they *need* to be logged out, before doing so when the ticket expires!
// Also use the forms ticket timeout total minutes to do a friendly logout when the browser *is* open!
//var ticket = new FormsAuthenticationTicket(
// 1,
// email,
// DateTime.Now,
// DateTime.Now.AddMinutes(FormsAuthentication.Timeout.TotalMinutes),
// false,
// "user,user1",
// FormsAuthentication.FormsCookiePath
//);
//var encryptedTicket = FormsAuthentication.Encrypt(ticket);
//var cookie = new HttpCookie(FormsAuthentication.FormsCookieName, encryptedTicket)
//{
// HttpOnly = true,
// Secure = FormsAuthentication.RequireSSL,
// Path = FormsAuthentication.FormsCookiePath,
// Domain = FormsAuthentication.CookieDomain
//};
//Response.AppendCookie(cookie);
FormsAuthentication.SetAuthCookie(email, rememberMe);
}
public void SignOut()
{
FormsAuthentication.SignOut();
}
public string Encrypt(FormsAuthenticationTicket ticket)
{
return FormsAuthentication.Encrypt(ticket);
}
public FormsAuthenticationTicket Decrypt(string hash)
{
return FormsAuthentication.Decrypt(hash);
}
}
}
|
module MtgRb
# A multiverse contains cards, expansions, printings, etc
# It is the entry point for the data and can be created from MTGJSON.
class Multiverse
# @param [Hash] The result of parsing AllSets.json
# @return [Multiverse] A populated multiverse from JSON
def self.from_hash(all_expansions)
# {name => object} lookup tables
cards_cache = {}
artists_cache = {}
expansions_cache = {}
all_expansions.each do |expansion_code, expansion_hash|
expansion = MtgRb::Expansion.from_hash(expansion_hash)
expansion_hash.fetch("cards").each do |card_hash|
card_name = card_hash.fetch("name")
card = cards_cache[card_name] ||= MtgRb::Card.from_hash(card_hash)
artist_name = card_hash.fetch("artist")
artist = artists_cache[artist_name] ||= MtgRb::Artist.new(name: artist_name, printings: [])
printing = MtgRb::Printing.from_card_hash(
expansion: expansion,
card: card,
artist: artist,
card_hash: card_hash,
)
card.printings << printing
artist.printings << printing
expansion.printings << printing
end
expansions_cache[expansion.name] = expansion
end
self.new({
cards: cards_cache,
artists: artists_cache,
expansions: expansions_cache,
})
end
attr_reader :cards, :artists, :expansions
def initialize(cards:, artists:, expansions:)
@cards = cards
@artists = artists
@expansions = expansions
end
end
end
|
use strict;
use lib -e 't' ? 't' : 'test';
use TestYAML tests => 1;
pass('TestYAML framework loads');
|
#!/bin/sh
mkdir /work
cd /work
echo "Cloning git repository: $GIT_REPO"
git clone $GIT_REPO
cd /work/*
git checkout $GIT_BRANCH
cd $GIT_PATH
echo "Cleaning output directory."
rm -rf /antora-dist/*
echo "Running : antora $PLAYBOOK"
antora $PLAYBOOK
echo "Antora build completed successfully."
echo "Customizing output."
find ./dist -name '*.html' -exec sed -i 's/_images/assets-images/g' {} \;
find ./dist -name '_images' -ignore_readdir_race -execdir mv _images assets-images \;
echo "Copying files..."
cp -rf dist/* /antora-dist/.
echo "Done."
|
{-# LANGUAGE OverloadedStrings #-}
-- | Parse the FORTRAN95 programming language source file.
module Lexer where
import Data.Char (isDigit, isLetter, toUpper)
import Data.List (find, findIndex)
import Data.Text (pack)
import System.Environment
import System.IO
import Text.Read (readMaybe)
-- | Validity of a string by token.
--
-- * Is it valid at this moment?
-- * May it become valid later (or is it valid now)?
type Validity = (Bool, Bool)
-- | State of the parser.
--
-- * String remaining to process
-- * Current buffer
-- * Set of currently applicable tokens (default - allTokens)
data ParserState = State String String [Token]
deriving (Eq, Show)
-- ******************** LANGUAGE-DEPENDENT ********************
-- | Set of tokens for FORTRAN95 programming language.
data Token
= TComment String
| TKeyword String
| TId String
| TBinConstant String
| TOctConstant String
| THexConstant String
| TNumber String
| TCharacter String
| TEquals
| TPlus
| TMinus
| TAsterisk
| TSlash
| TDot
| TComma
| TColon
| TSemicolon
| TLParen
| TRParen
| TLBracket
| TRBracket
| TPercent
| TDollar
| TAmpersand
| TQuestion
| TDblColon
| TDblSlash
| TDblAsterisk
| TArrow
| TMArrow
| TLArrowConst
| TRArrowConst
| TNewLine
| TEq
| TNotEq
| TLess
| TLessEq
| TGreater
| TGreaterEq
| TNot
| TAnd
| TOr
| TXor
| TLogEq
| TLogNotEq
| TTrue
| TFalse
| TWs
-- Language-independent
| TEof
| TError String
deriving (Eq, Show)
-- | Set of default values of all tokens
-- from the FORTRAN95 programming language
-- sorted by priority.
allTokens :: [Token]
allTokens =
[ TComment ""
, TKeyword ""
, TId ""
, TBinConstant ""
, TOctConstant ""
, THexConstant ""
, TNumber ""
, TCharacter ""
, TEquals
, TPlus
, TMinus
, TAsterisk
, TSlash
, TDot
, TComma
, TColon
, TSemicolon
, TLParen
, TRParen
, TLBracket
, TRBracket
, TPercent
, TDollar
, TAmpersand
, TQuestion
, TDblColon
, TDblSlash
, TDblAsterisk
, TArrow
, TMArrow
, TLArrowConst
, TRArrowConst
, TNewLine
, TEq
, TNotEq
, TLess
, TLessEq
, TGreater
, TGreaterEq
, TNot
, TAnd
, TOr
, TXor
, TLogEq
, TLogNotEq
, TTrue
, TFalse
, TWs
]
-- | Set of all keywords from
-- the FORTRAN95 programming language.
keywords :: [String]
keywords = ["NULL()", "ALLOCATE", "ALLOCATABLE", "ASSIGN",
"ASSIGNMENT", "AUTOMATIC", "BACKSPACE", "BLOCK", "CALL", "CASE",
"CHARACTER", "CLOSE", "COMMON", "COMPLEX", "CONTAINS", "CONTINUE", "CYCLE",
"DATA", "DEALLOCATE", "DEFAULT", "DIMENSION", "DO",
"DOUBLE", "ELEMENTAL", "ELSE", "ELSEIF", "ELSEWHERE",
"END", "ENDDO", "ENDIF", "ENDFILE", "ENTRY",
"EQUIVALENCE", "EXIT", "EXTERNAL",
"FORALL", "FORMAT", "FUNCTION", "GO", "GOTO", "IOLENGTH",
"IF", "IMPLICIT", "IN", "INCLUDE", "INOUT", "INTEGER", "INTENT", "INTERFACE",
"INTRINSIC", "INQUIRE", "KIND", "LEN", "LOGICAL", "MODULE",
"NAMELIST", "NONE", "NULLIFY",
"ONLY", "OPEN", "OPERATOR", "OPTIONAL", "OUT", "PARAMETER",
"PAUSE", "POINTER", "PRECISION", "PRINT", "PRIVATE", "PROCEDURE",
"PROGRAM", "PUBLIC", "PURE", "REAL", "READ", "RECURSIVE", "RESULT",
"RETURN", "REWIND", "SAVE", "SELECT", "SEQUENCE", "SOMETYPE", "SQRT", "STAT",
"STOP", "SUBROUTINE", "TARGET", "TO", "THEN", "TYPE",
"UNIT", "USE", "VOLATILE", "WHERE", "WHILE", "WRITE"]
-- | Does a given string suits to be
-- a representation of a given token
-- in terms of data type 'Validity'?
suitsToken :: String -> Token -> Validity
suitsToken "" _ = (False, False)
-- === Comments
suitsToken s (TComment _)
| (head s) == '!' && (noNewLineInside $ tail s) = (True, True)
| otherwise = (False, False)
where
noNewLineInside [] = True
noNewLineInside (ch:chs) = ch /= '\n' && ch /= '\r' && noNewLineInside chs
-- === Keywords
suitsToken s (TKeyword _) = isSubForList keywords s
-- === Identifier
suitsToken (ch:chs) (TId _)
| isValidBegin ch && isValidTail chs = (True, True)
| isValidBegin ch && chs == "" = (False, True)
| otherwise = (False, False)
where
isValidBegin c = isLetter c || c == '_'
isValidTail s = and $ map (
\c -> isLetter c || isDigit c || c == '_' || c == '$' || c == '@'
) s
-- === Numeric constants
suitsToken s (TBinConstant _)
| first && length s == 1 = (False, True)
| first &&
(second == '\'' || second == '"') && isBinary (drop 2 s) = (False, True)
| first && second == '\'' && fromThird s
&& last s == '\'' && length s > 3 = (True, True)
| first && second == '"' && fromThird s
&& last s == '"' && length s > 3 = (True, True)
| otherwise = (False, False)
where
first = (toUpper $ head s) == 'B'
second = s !! 1
fromThird str = isBinary . drop 2 $ init str
isBinary [] = True
isBinary (ch:chs) = (ch == '1' || ch == '0') && isBinary chs
suitsToken s (TOctConstant _)
| first && length s == 1 = (False, True)
| first &&
(second == '\'' || second == '"') && isOct (drop 2 s) = (False, True)
| first && second == '\'' && fromThird s
&& last s == '\'' && length s > 3 = (True, True)
| first && second == '"' && fromThird s
&& last s == '"' && length s > 3 = (True, True)
| otherwise = (False, False)
where
first = (toUpper $ head s) == 'O'
second = s !! 1
fromThird str = isOct . drop 2 $ init str
isOct [] = True
isOct (ch:chs) = (
fst $ isSubForList ["0","1","2","3","4","5","6","7"] [ch]
) && isOct chs
suitsToken s (THexConstant _)
| first && length s == 1 = (False, True)
| first &&
(second == '\'' || second == '"') && isHec (drop 2 s) = (False, True)
| first && second == '\'' && fromThird s
&& last s == '\'' && length s > 3 = (True, True)
| first && second == '"' && fromThird s
&& last s == '"' && length s > 3 = (True, True)
| otherwise = (False, False)
where
first = (toUpper $ head s) == 'Z'
second = s !! 1
fromThird str = isHec . drop 2 $ init str
isHec [] = True
isHec (ch:chs) = (
isDigit ch || (fst $ isSubForList ["A","B","C","D","E","F"] [ch])
) && isHec chs
-- === Number
-- TODO: Add support for kind type parameters.
suitsToken s (TNumber _) =
let
isDot = (\c -> c == '.')
isE = (\c -> fst $ isSubForList ["E", "D", "Q"] [c])
isOp = (\c -> c == '+' || c == '-')
isInt str = and $ map isDigit str
toTuple b = (b,b)
divideBy pos str = (left, right)
where
right = tail rightWith
(left, rightWith) = splitAt pos str
in case findIndex isDot s of
Nothing ->
case findIndex isE s of
Nothing -> (isInt s, isInt s)
Just posOfE ->
let
(beforeE, afterE) = divideBy posOfE s
beforeEIsGood = isInt beforeE && length beforeE > 0
in case findIndex isOp afterE of
Nothing ->
if length afterE == 0
then (False, beforeEIsGood)
else toTuple (beforeEIsGood && isInt afterE)
Just _ ->
let (_, afterOp) = splitAt 1 afterE
in if length afterOp == 0
then (False, beforeEIsGood)
else toTuple (beforeEIsGood && isInt afterOp)
Just posOfDot ->
let (beforeDot, afterDot) = divideBy posOfDot s
in case findIndex isE afterDot of
Nothing ->
if length s == 1
then (False, True)
else toTuple(isInt beforeDot && isInt afterDot)
Just posOfE ->
let
beforeEIsGood = (length beforeDot > 0 || length beforeE > 0)
&& isInt beforeDot && isInt beforeE
(beforeE, afterE) = divideBy posOfE afterDot
in case findIndex isOp afterE of
Nothing ->
if (length afterE == 0)
then (False, beforeEIsGood && isInt afterE)
else toTuple (beforeEIsGood && isInt afterE)
Just _ ->
let (_, afterOp) = splitAt 1 afterE
in if (length afterOp == 0)
then (False, beforeEIsGood)
else toTuple(beforeEIsGood && isInt afterOp)
-- === Character
suitsToken s (TCharacter _)
| (head s) == '\'' && (notInside '\'' $ tail s) &&
(last s) == '\'' && length s > 1 = (True, True)
| (head s) == '"' && (notInside '"' $ tail s) &&
(last s) == '"' && length s > 1 = (True, True)
| (head s) == '\'' && (notInside '\'' $ tail s) = (False, True)
| (head s) == '"' && (notInside '"' $ tail s) = (False, True)
| otherwise = (False, False)
where
notInside _ [] = True
notInside _ (ch:[]) = True
notInside c (ch:chs) = c /= ch && notInside c chs
-- === Operators
suitsToken s TEquals = isSubstring "=" s
suitsToken s TPlus = isSubstring "+" s
suitsToken s TMinus = isSubstring "-" s
suitsToken s TAsterisk = isSubstring "*" s
suitsToken s TSlash = isSubstring "/" s
suitsToken s TDot = isSubstring "." s
suitsToken s TComma = isSubstring "," s
suitsToken s TColon = isSubstring ":" s
suitsToken s TSemicolon = isSubstring ";" s
suitsToken s TLParen = isSubstring "(" s
suitsToken s TRParen = isSubstring ")" s
suitsToken s TLBracket = isSubstring "[" s
suitsToken s TRBracket = isSubstring "]" s
suitsToken s TPercent = isSubstring "%" s
suitsToken s TDollar = isSubstring "$" s
suitsToken s TAmpersand = isSubstring "&" s
suitsToken s TQuestion = isSubstring "?" s
suitsToken s TDblColon = isSubstring "::" s
suitsToken s TDblSlash = isSubstring "//" s
suitsToken s TDblAsterisk = isSubstring "**" s
suitsToken s TArrow = isSubstring "=>" s
suitsToken s TMArrow = isSubstring "->" s
suitsToken s TLArrowConst = isSubstring "(/" s
suitsToken s TRArrowConst = isSubstring "/)" s
suitsToken s TNewLine = isSubForList ["\n", "\r", "\r\n"] s
suitsToken s TEq = isSubForList ["==", ".EQ."] s
suitsToken s TNotEq = isSubForList ["/=", ".NE."] s
suitsToken s TLess = isSubForList ["<", ".LT."] s
suitsToken s TLessEq = isSubForList ["<=", ".LE."] s
suitsToken s TGreater = isSubForList [">", ".GT."] s
suitsToken s TGreaterEq = isSubForList [">=", ".GE."] s
suitsToken s TNot = isSubstring ".NOT." s
suitsToken s TAnd = isSubstring ".AND." s
suitsToken s TOr = isSubstring ".OR." s
suitsToken s TXor = isSubstring ".XOR." s
suitsToken s TLogEq = isSubstring ".EQV." s
suitsToken s TLogNotEq = isSubstring ".NEQV." s
suitsToken s TTrue = isSubstring ".TRUE." s
suitsToken s TFalse = isSubstring ".FALSE." s
-- === Whitespace
suitsToken s TWs = isSubForList [" ", "\t", "\v", "\f", "&\n", "&\r", "&\r\n"] s
-- === Others
suitsToken _ (TError _) = (False, False)
suitsToken _ TEof = (False, False)
-- | Pack given literal into the
-- token of a given type (if needed).
putLiteral :: String -> Token -> Token
putLiteral s (TComment _) = TComment . tail $ s
putLiteral s (TKeyword _) = TKeyword s
putLiteral s (TId _) = TId s
putLiteral s (TBinConstant _) = TBinConstant . init . drop 2 $ s
putLiteral s (TOctConstant _) = TOctConstant . init . drop 2 $ s
putLiteral s (THexConstant _) = THexConstant . init . drop 2 $ s
putLiteral s (TNumber _) = TNumber s
putLiteral s (TCharacter _) = TCharacter . init . tail $ s
putLiteral _ token = token
-- ******************** LANGUAGE-INDEPENDENT ********************
-- | Is a given string - a substring
-- for one of given templates in terms
-- of the data type 'Validity'?
isSubForList :: [String] -> String -> Validity
isSubForList [] _ = (False, False)
isSubForList (template:templates) str = (now, future)
where
now = now1 || now2
future = future1 || future2
(now1, future1) = isSubstring template str
(now2, future2) = isSubForList templates str
-- | Is a given string - a substring (2nd)
-- for a given template (1st) in terms
-- of the data type 'Validity'?
isSubstring :: String -> String -> Validity
isSubstring template str = (now, future)
where
now = (length str == length template) && and res
future = (length str <= length template) && and res
res = zipWith (\ch1 ch2 -> toUpper ch1 == ch2) str template
-- | Get a token which fully suits the given string.
-- If no such token found - TError is returned.
whichToken :: String -> Token
whichToken s =
case find (fst . suitsToken s) allTokens of
Just token -> putLiteral s token
Nothing -> TError s
-- | Process the next character from the input
-- and try to make a token out of it considering
-- already processed buffer.
proceedChar :: ParserState -> (ParserState, Maybe Token)
proceedChar st@(State "" buffer _possToks)
| buffer == "" = (st, Just TEof)
| otherwise = (State "" "" allTokens, Just $ whichToken buffer)
proceedChar (State input@(ch:chs) buffer possToks)
| length filtered > 0 = (State chs (buffer ++ [ch]) filtered, Nothing)
| buffer == "" = (State chs "" allTokens, Just $ whichToken [ch])
| otherwise = (State input "" allTokens, Just $ whichToken buffer)
where
filtered = filter (snd . suitsToken (buffer ++ [ch])) possToks
-- | Update parser state and get next
-- token for a given parser configuration.
nextToken :: ParserState -> (ParserState, Token)
nextToken state =
let (newState, tokenMaybe) = proceedChar state
in case tokenMaybe of
Nothing -> nextToken newState
Just TWs -> nextToken newState -- Note: may depend on the language
Just token -> (newState, token)
-- | Recursively parse a given parser state
-- to get the list of tokens to be produced.
parseUntilEnd :: (ParserState, [Token]) -> (ParserState, [Token])
parseUntilEnd (state, tokens) =
let
(newState, token) = nextToken state
newToks = token : tokens
in case token of
TEof -> (newState, newToks)
_ -> parseUntilEnd (newState, newToks)
-- | Get a list of tokens out of a given string.
parse :: String -> [Token]
parse str = reverse . snd $ parseUntilEnd (initiateParser str, [])
where
initiateParser s = State s "" allTokens
-- ******************** TOKENIZATION-INDEPENDENT ********************
-- | Convert a string to the string with
-- the corresponding token sequence for the input.
showTokens :: String -> String
showTokens str = concatMap ((++ "\n") . show) $ parse str
-- | Run parser to read from the specified file
-- (or from 'in.txt') and write tokens into the
-- other specified file (or into 'out.txt').
run :: IO ()
run = do
args <- getArgs
input <- readFile $
if not (null args) && length args > 0
then args !! 0
else "in.txt"
let result = showTokens input
writeFile (
if not (null args) && length args > 1
then args !! 1
else "out.txt"
) result
|
from chiadoge.types.blockchain_format.program import SerializedProgram
from .load_clvm import load_clvm
MOD = SerializedProgram.from_bytes(load_clvm("rom_bootstrap_generator.clvm").as_bin())
def get_generator():
return MOD
|
<?php
namespace CrosierSource\CrosierLibRadxBundle\EntityHandler\Fiscal;
use CrosierSource\CrosierLibRadxBundle\Entity\Fiscal\NotaFiscalHistorico;
use CrosierSource\CrosierLibBaseBundle\EntityHandler\EntityHandler;
/**
* Class NotaFiscalHistoricoEntityHandler
*
* @package CrosierSource\CrosierLibRadxBundle\EntityHandler
* @author Carlos Eduardo Pauluk
*/
class NotaFiscalHistoricoEntityHandler extends EntityHandler
{
public function getEntityClass(): string
{
return NotaFiscalHistorico::class;
}
}
|
// ============================================================================
//
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.spark.function;
import java.util.ArrayList;
import java.util.List;
import org.apache.spark.api.java.function.PairFunction;
import org.talend.spark.utils.CompareCol;
import scala.Tuple2;
public class KeyByCompareColFunction implements
PairFunction<List<Object>, List<Object>, List<Object>> {
/**
*
*/
private static final long serialVersionUID = 1L;
private List<CompareCol> compCols;
public KeyByCompareColFunction(List<CompareCol> compCols) {
this.compCols = compCols;
}
public Tuple2<List<Object>, List<Object>> call(List<Object> d) {
List<Object> key = new ArrayList<Object>(compCols.size());
for (int i = 0; i < compCols.size(); i++) {
key.add(i, d.get(compCols.get(i).getColId()));
}
List<Object> values = new ArrayList<Object>(d.size());
int valId = 0;
for (Integer i = 0; i < d.size(); i++) {
boolean contain = false;
for (CompareCol compCol : compCols) {
if (compCol.getColId().equals(i)) {
contain = true;
break;
}
}
if (!contain) {
values.add(valId, d.get(i));
valId++;
}
}
return new Tuple2<List<Object>, List<Object>>(key, values);
}
}
|
package io.kommunicate.callbacks;
import android.content.Context;
import io.kommunicate.models.KmApiResponse;
import io.kommunicate.models.KmFeedback;
/**
* callback for the feedback api async task
* @author shubham
* @date 25/July/2019
*/
public interface KmFeedbackCallback {
void onSuccess(Context context, KmApiResponse<KmFeedback> response);
void onFailure(Context context, Exception e, String response);
}
|
package main
import (
"context"
"davitu.com/transfers/transfers"
"fmt"
"google.golang.org/grpc"
"log"
)
func main() {
conn, err := grpc.Dial("127.0.0.1:8080", grpc.WithInsecure())
if err != nil {
log.Fatalln("Connection error", err)
}
defer conn.Close()
client := transfers.NewTransferServiceClient(conn)
response, err := client.Execute(
context.Background(),
&transfers.TransferRequest{
From: "uno",
To: "dos",
Amount: 1000,
},
)
if err != nil {
log.Fatalln("Response Error", err)
}
log.Println(fmt.Sprintf("Request: {%s}, Status: %s, Info: %s", response.Request, response.Status, response.Info))
}
|
package com.omnicrola.voxel.network.listeners;
import com.jme3.network.Client;
import com.omnicrola.voxel.eventBus.VoxelEventBus;
import com.omnicrola.voxel.eventBus.events.JoinLobbyEvent;
import com.omnicrola.voxel.network.AbstractMessageListener;
import com.omnicrola.voxel.network.INetworkManager;
import com.omnicrola.voxel.network.messages.JoinLobbyMessage;
import java.util.logging.Logger;
/**
* Created by omnic on 4/4/2016.
*/
public class ClientLobbyJoinMessageListener extends AbstractMessageListener<JoinLobbyMessage, Client> {
private static final Logger LOGGER = Logger.getLogger(ClientLobbyJoinMessageListener.class.getName());
private INetworkManager networkManager;
public ClientLobbyJoinMessageListener(INetworkManager networkManager) {
this.networkManager = networkManager;
}
@Override
protected void processMessage(Client connection, JoinLobbyMessage message) {
if (message.joinWasSuccessful) {
VoxelEventBus.INSTANCE().post(JoinLobbyEvent.fail());
} else {
VoxelEventBus.INSTANCE().post(JoinLobbyEvent.success(message.getPlayerId()));
networkManager.setPlayerServerId(message.getPlayerId());
}
}
}
|
package com.xunlei.downloadprovider.vod;
import android.content.Context;
import android.graphics.Canvas;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.SeekBar;
import org.apache.commons.logging.impl.SimpleLog;
import org.eclipse.paho.client.mqttv3.MqttConnectOptions;
public class VerticalSeekBar extends SeekBar {
public VerticalSeekBar(Context context) {
super(context);
}
public VerticalSeekBar(Context context, AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
}
public VerticalSeekBar(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
}
public synchronized void setProgress(int i) {
super.setProgress(i);
onSizeChanged(getWidth(), getHeight(), 0, 0);
}
protected void onSizeChanged(int i, int i2, int i3, int i4) {
super.onSizeChanged(i2, i, i4, i3);
}
protected synchronized void onMeasure(int i, int i2) {
super.onMeasure(i2, i);
setMeasuredDimension(getMeasuredHeight(), getMeasuredWidth());
}
protected void onDraw(Canvas canvas) {
canvas.rotate(-90.0f);
canvas.translate((float) (-getHeight()), 0.0f);
super.onDraw(canvas);
}
public boolean onTouchEvent(MotionEvent motionEvent) {
if (!isEnabled()) {
return false;
}
switch (motionEvent.getAction()) {
case MqttConnectOptions.MQTT_VERSION_DEFAULT:
case SimpleLog.LOG_LEVEL_TRACE:
case SimpleLog.LOG_LEVEL_DEBUG:
setProgress(getMax() - ((int) ((((float) getMax()) * motionEvent.getY()) / ((float) getHeight()))));
break;
}
return true;
}
}
|
function add_noise(p::InfParams, l = 0.10)
inf = copy(p.infectiousness)
p_test = copy(p.pos_test_probs)
for (i,d) in enumerate(inf)
k,θ = Distributions.params(d)
k′ = k*(rand()*l+(1-l/2))
θ′ = θ*(rand()*l+(1-l/2))
inf[i] = Gamma(k′,θ′)
λ = (k′*θ′) / (k*θ)
p_test[i] *= λ
p_test[i] = min(p_test[i], 1.0)
end
return InfParams(
p_test,
p.symptom_probs,
p.asymptomatic_prob,
p.symptomatic_isolation_prob,
inf
)
end
function param_noise(s::S, l) where S <: CovidState
return S(statevars(s)..., add_noise(s.params, l), s.prev_action)
end
mutable struct NoisyCovidFilter{PM, P, PMEM, RNG<:AbstractRNG} <: Updater
predict_model::PM
particles::P
weights::Vector{Float64}
_particle_mem::PMEM
_unique::Int
rng::RNG
end
function NoisyCovidFilter(pomdp::POMDP{S}, n::Int) where S<:CovidState
return NoisyCovidFilter(
pomdp,
ParticleCollection(Vector{S}(undef,n)),
Vector{Float64}(undef, n),
ParticleCollection(Vector{S}(undef,n)),
n,
Random.GLOBAL_RNG
)
end
function noise_width(N::Int, Un::Int)
return ((0.05 - 0.25)/(N-1))*(Un-N) + 0.05
end
function ParticleFilters.predict!(up::NoisyCovidFilter, b, a, o)
pomdp = up.predict_model
pm = up.particles.particles
rng = up.rng
N = length(pm)
un = up._unique
noise_param = noise_width(N, un)
for (i,s) in enumerate(particles(b))
sp, o, r = POMDPs.gen(pomdp, s, a, rng)
pm[i] = param_noise(sp, noise_param)
end
return up.particles
end
function ParticleFilters.reweight!(up::NoisyCovidFilter, b, a, bp, o)
pomdp = up.predict_model
p1 = b.particles
p2 = bp.particles
wm = up.weights
rng = up.rng
w_sum = 0.0
for i in eachindex(p1)
s = p1[i]
sp = p2[i]
dist = POMDPs.observation(pomdp, s, a, sp)
w = pdf(dist, o)
w_sum += w
wm[i] = w
end
return wm ./= w_sum # normalized
end
function ParticleFilters.resample(up::NoisyCovidFilter, p::Vector{S}, w::Vector{Float64}) where S
N = length(p)
rng = up.rng
ps = Array{S}(undef, N)
r = rand(rng)/N
c = w[1]
i = 1
U = r
for m in 1:N
while U > c && i < N
i += 1
c += w[i]
end
U += inv(N)
s = p[i]
ps[m] = s
end
up._unique = length(unique(ps))
return ParticleCollection(ps)
end
function ParticleFilters.update(up::NoisyCovidFilter, b::ParticleCollection, a::CovidAction, o::Int)
b′ = predict!(up, b, a, o)
w = reweight!(up, b, a, b′, o)
return resample(up, b′.particles, w)
end
ParticleFilters.initialize_belief(pf::NoisyCovidFilter, b::ParticleCollection) = b
function ParticleFilters.initialize_belief(pf::NoisyCovidFilter, b)
p = pf.particles.particles
for i in eachindex(p)
p[i] = rand(b)
end
return deepcopy(pf.particles)
end
|
# fis-optimizer-uglify-js
A optimizer for fis to compress js by using uglify-js.
## 使用
FIS内置
## 配置
在项目配置文件(默认fis-conf.js)配置
```javascript
fis.config.set('settings.optimizer.uglify-js', option);
```
eg:
```javascript
//export, module, require不压缩变量名
fis.config.set('settings.optimizer.uglify-js', {
mangle: {
except: 'exports, module, require, define'
}
});
//自动去除console.log等调试信息
fis.config.set('settings.optimizer.uglify-js', {
compress : {
drop_console: true
}
});
```
`option` 详细请参见 https://github.com/mishoo/UglifyJS2
|
import {v4 as uuid} from 'uuid';
import LogHistoryFactory, {LogHistory} from './history';
describe('LogHistory', () => {
let logHistory: LogHistory;
const mockWrite = jest.fn();
beforeEach(() => {
jest.resetAllMocks();
// @ts-ignore
logHistory = LogHistoryFactory({stream: {write: mockWrite}});
});
describe('#beginInteractiveSession', () => {
it('should return an interactive session ID', () => {
const id = logHistory.beginInteractiveSession();
expect(typeof id).toBe('symbol');
expect(logHistory.hasInteractiveSession(id)).toBe(true);
});
});
describe('#endInteractiveSession', () => {
describe('when provided an unknown session ID', () => {
it('should throw an error', () => {
const badId = Symbol();
expect(() => {
logHistory.endInteractiveSession(badId);
}).toThrow('Unknown interactive session ID.');
});
});
it('should remove the provided ID', () => {
const id = logHistory.beginInteractiveSession();
expect(logHistory.hasInteractiveSession(id)).toBe(true);
logHistory.endInteractiveSession(id);
expect(logHistory.hasInteractiveSession(id)).toBe(false);
});
});
describe('#hasInteractiveSession', () => {
describe('when provided a known/active session ID', () => {
it('should return true', () => {
const id = logHistory.beginInteractiveSession();
expect(logHistory.hasInteractiveSession(id)).toBe(true);
});
});
describe('when provided an unknown/inactive session ID', () => {
it('should return false', () => {
const unknownId = Symbol();
expect(logHistory.hasInteractiveSession(unknownId)).toBe(false);
const id = logHistory.beginInteractiveSession();
expect(logHistory.hasInteractiveSession(id)).toBe(true);
logHistory.endInteractiveSession(id);
expect(logHistory.hasInteractiveSession(id)).toBe(false);
});
});
});
describe('#doInteractiveWrite', () => {
describe('when provided an unknown session ID', () => {
it('should throw an error', () => {
const unknownId = Symbol();
expect(() => {
logHistory.doInteractiveWrite(unknownId, jest.fn());
}).toThrow('Unknown interactive session ID.');
});
});
describe('when an interactive write is in progress', () => {
it('should throw an error', () => {
const id = logHistory.beginInteractiveSession();
logHistory.doInteractiveWrite(id, () => {
expect(() => {
logHistory.doInteractiveWrite(id, jest.fn());
}).toThrow('Only 1 interactive write allowed at a time.');
});
});
});
it('should invoke the provided callback', async () => {
const cb = jest.fn(() => {
logHistory.write(uuid());
logHistory.write(`${uuid()}\n`);
});
const id = logHistory.beginInteractiveSession();
// Write some non-interactive content _after_ we have begun an interactive
// session.
logHistory.write(`${uuid()}\n`);
logHistory.doInteractiveWrite(id, cb);
logHistory.write(`${uuid()}\n`);
logHistory.doInteractiveWrite(id, cb);
expect(cb).toHaveBeenCalled();
expect(mockWrite).toHaveBeenCalled();
});
});
describe('#write', () => {
it('should call the configured writable streams #write method', () => {
const message = uuid();
logHistory.write(message);
expect(mockWrite).toHaveBeenCalledWith(message);
});
});
});
|
import { LOGOUT } from '../actionTypes/auth';
import { userService } from '../services/auth';
import { history } from '../history';
import { clearUsers } from './users';
import { clearChats } from './chats';
import { clearRooms } from './rooms';
import { clearMessages } from './messages';
import { clearAllErrors } from './errors';
import { clearContacts } from './contacts';
export const logout = () => ({
type: LOGOUT,
});
export const logoutUser = () => {
return dispatch => {
userService.logout().then(() => {
dispatch(clearContacts());
dispatch(clearChats());
dispatch(logout());
dispatch(clearUsers());
dispatch(clearMessages());
dispatch(clearAllErrors());
dispatch(clearRooms());
history.push('/')
});
}
};
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using ECS.MemberManager.Core.DataAccess.Dal;
using ECS.MemberManager.Core.EF.Domain;
namespace ECS.MemberManager.Core.DataAccess.Mock
{
public class PaymentSourceDal : IDal<PaymentSource>
{
public Task<PaymentSource> Fetch(int id)
{
return Task.FromResult(MockDb.PaymentSources.FirstOrDefault(ms => ms.Id == id));
}
public Task<List<PaymentSource>> Fetch()
{
return Task.FromResult(MockDb.PaymentSources.ToList());
}
public Task<PaymentSource> Insert(PaymentSource paymentSource)
{
var lastPaymentSource = MockDb.PaymentSources.ToList().OrderByDescending(ms => ms.Id).First();
paymentSource.Id = 1 + lastPaymentSource.Id;
paymentSource.RowVersion = BitConverter.GetBytes(DateTime.Now.Ticks);
MockDb.PaymentSources.Add(paymentSource);
return Task.FromResult(paymentSource);
}
public Task<PaymentSource> Update(PaymentSource paymentSource)
{
var paymentSourceToUpdate =
MockDb.PaymentSources.FirstOrDefault(em => em.Id == paymentSource.Id &&
em.RowVersion.SequenceEqual(paymentSource.RowVersion));
if (paymentSourceToUpdate == null)
throw new Csla.DataPortalException(null);
paymentSourceToUpdate.RowVersion = BitConverter.GetBytes(DateTime.Now.Ticks);
return Task.FromResult(paymentSourceToUpdate);
}
public Task Delete(int id)
{
var paymentSourceToDelete = MockDb.PaymentSources.FirstOrDefault(ms => ms.Id == id);
var listIndex = MockDb.PaymentSources.IndexOf(paymentSourceToDelete);
if (listIndex > -1)
MockDb.PaymentSources.RemoveAt(listIndex);
return Task.CompletedTask;
}
public void Dispose()
{
}
}
}
|
using System;
namespace GSSAPI
{
/// <summary>
/// GSS client state
/// </summary>
internal class GssClientState
{
/// <summary>
/// Service name
/// </summary>
public string Service;
/// <summary>
/// Unmanaged resource link to GSS Context
/// </summary>
public IntPtr Context;
/// <summary>
/// Unmanaged resource link to GSS server name
/// </summary>
public IntPtr ServerName;
/// <summary>
/// Authentication mechanism
/// </summary>
public GssClientAuth Auth;
/// <summary>
/// Request flags
/// </summary>
public GssContextFlags Flags;
/// <summary>
/// Flag if authentication is completed
/// </summary>
public bool Completed;
/// <summary>
/// Last token
/// </summary>
public string Token;
}
}
|
package org.ababup1192
import japgolly.scalajs.react._
import japgolly.scalajs.react.vdom.svg.all._
import paths.high.Tree
import scala.scalajs.js
object DuckTree {
case class Duck(id: Int, name: String, descendants: List[Duck] = List())
private def move(p: js.Array[Double]) = s"translate(${p(0)},${p(1)})"
private def isLeaf(duck: Duck) = duck.descendants.isEmpty
val treeChart = ReactComponentB[Duck]("DuckTree")
.render_P { duck =>
val tree = Tree[Duck](
data = duck,
children = _.descendants,
width = 300,
height = 300
)
val branches = tree.curves map { curve =>
path(d := curve.connector.path.print)
}
val nodes = tree.nodes map { node =>
g(transform := move(node.point),
circle(r := 5, cx := 0, cy := 0),
text(
transform := (if (isLeaf(node.item)) "translate(10,0)" else "translate(-10,0)"),
textAnchor := (if (isLeaf(node.item)) "start" else "end"),
node.item.name
)
)
}
svg(width := 500, height := 400,
g(transform := "translate(90,50)",
branches,
nodes
)
)
}.build
}
|
import React, { FunctionComponent } from "react"
import { Layout, SEO } from "../components"
import { DefaultPageProps } from "./DefaultPageProps"
const WhatWeDo: FunctionComponent<DefaultPageProps> = ({
pageTitle = "Vad vi gör",
}) => (
<Layout>
<SEO title={pageTitle} />
<div>
<h1>{pageTitle}</h1>
<p>
Vi är ett gäng ödmjuka specialister inom systemutveckling (och en
projektledare) som gärna vill dela med oss av våra kunskaper och
erfarenheter genom att erbjuda konsulttjänster eller kompletta
projektleveranser.
</p>
<p>
Våra breda och djupa kunskaper samt långa erfarenhet är definitivt en
fördel för att få en enkel, snabb och effektiv uppstart. För handen på
hjärtat - visst är det riktigt skönt när ”det bara funkar”.
</p>
<p>
Effektivitet och produktivitet är såklart mycket viktigt men vi vet
också att förmågan att kunna förmedla våra kunskaper samt stötta och
coacha våra kollegor i teamet är avgörande för att få en kvalitativ
leverans. Det skapar även förutsättningar för en öppen och varm
lagkänsla och kunskapsutveckling i teamet, något som vi tror bidrar till
ett bättre resultat.
</p>
</div>
</Layout>
)
export default WhatWeDo
|
module KubernetesCookbook
# Resource to manage a Kubernetes API server
class KubeApiserver < Chef::Resource
resource_name :kube_apiserver
property :remote, String,
default: 'https://storage.googleapis.com/kubernetes-release' \
'/release/v1.3.6/bin/linux/amd64/kube-apiserver'
property :checksum, String,
default: '63292efe2918c93e9d3362aa12d56c25' \
'a651b2224cbf72b29b0580b644208f78'
property :run_user, String, default: 'kubernetes'
default_action :create
action :create do
remote_file 'kube-apiserver binary' do
path apiserver_path
mode '0755'
source new_resource.remote
checksum new_resource.checksum
end
end
action :start do
user 'kubernetes' do
action :create
only_if { run_user == 'kubernetes' }
end
directory '/var/run/kubernetes' do
owner run_user
end
template '/etc/tmpfiles.d/kubernetes.conf' do
source 'systemd/tmpfiles.erb'
cookbook 'kube'
end
template '/etc/systemd/system/kube-apiserver.service' do
source 'systemd/kube-apiserver.service.erb'
cookbook 'kube'
variables kube_apiserver_command: generator.generate
notifies :run, 'execute[systemctl daemon-reload]', :immediately
end
execute 'systemctl daemon-reload' do
command 'systemctl daemon-reload'
action :nothing
end
service 'kube-apiserver' do
action %w(enable start)
end
end
def generator
CommandGenerator.new apiserver_path, self
end
def apiserver_path
'/usr/sbin/kube-apiserver'
end
private
def file_cache_path
Chef::Config[:file_cache_path]
end
end
# Commandline-related properties
# Reference: http://kubernetes.io/v1.1/docs/admin/kube-apiserver.html
class KubeApiserver < Chef::Resource
property :admission_control, default: 'AlwaysAdmit'
property :admission_control_config_file
property :advertise_address
property :allow_privileged, default: false
property :apiserver_count, default: 1
property :authentication_token_webhook_cache_ttl, default: '2m0s'
property :authentication_token_webhook_config_file
property :authorization_mode, default: 'AlwaysAllow'
property :authorization_policy_file
property :authorization_rbac_super_user
property :authorization_webhook_cache_authorized_ttl, default: '5m0s'
property :authorization_webhook_cache_unauthorized_ttl, default: '30s'
property :authorization_webhook_config_file
property :basic_auth_file
property :bind_address, default: '0.0.0.0'
property :cert_dir, default: '/var/run/kubernetes'
property :client_ca_file
property :cloud_config
property :cloud_provider
property :cors_allowed_origins, default: []
property :delete_collection_workers, default: 1
property :deserialization_cache_size, default: 50000
property :enable_garbage_collector, default: false
property :enable_swagger_ui, default: false
property :etcd_cafile
property :etcd_certfile
property :etcd_config
property :etcd_keyfile
property :etcd_prefix, default: '/registry'
property :etcd_servers, default: []
property :etcd_servers_overrides, default: []
property :etcd_quorum_read, default: false
property :event_ttl, default: '1h0m0s'
property :experimental_keystone_url
property :external_hostname
property :google_json_key
property :insecure_bind_address, default: '127.0.0.1'
property :insecure_port, default: 8080
property :kubelet_certificate_authority
property :kubelet_client_certificate
property :kubelet_client_key
property :kubelet_https, default: true
property :kubelet_port, default: 10_250
property :kubelet_timeout, default: '5s'
property :kubernetes_service_node_port, default: 0
property :log_flush_frequency, default: '5s'
property :long_running_request_regexp,
default: '(/|^)((watch|proxy)(/|$)|'\
'(logs?|portforward|exec|attach)/?$)'
property :master_service_namespace, default: 'default'
property :max_connection_bytes_per_sec, default: 0
property :max_requests_inflight, default: 400
property :min_request_timeout, default: 1800
property :oidc_ca_file
property :oidc_client_id
property :oidc_groups_claim
property :oidc_issuer_url
property :oidc_username_claim, default: 'sub'
property :profiling, default: true
property :repair_malformed_updates, default: true
property :runtime_config
property :secure_port, default: 6443
property :service_account_key_file
property :service_account_lookup, default: false
property :service_cluster_ip_range
property :service_node_port_range
property :ssh_keyfile
property :ssh_user
property :storage_backend
property :storage_media_type, default: 'application/json'
property :storage_versions, default: %w(extensions/v1beta1 v1)
property :tls_cert_file
property :tls_private_key_file
property :token_auth_file
property :watch_cache, default: true
property :watch_cache_sizes
property :v, default: 0 # TODO: move to common class
end
end
|
mod edit_task;
mod guest_task;
mod invites;
mod login;
mod nav_bar;
mod register;
mod settings;
mod submit_task;
mod task_view;
mod tasks_list;
mod tutor_task;
mod users;
mod util;
pub use guest_task::guest_task_view;
pub use invites::invites_view;
pub use login::login_view;
pub use nav_bar::nav_bar_view;
pub use register::register_view;
pub use settings::settings_view;
pub use submit_task::submit_task_view;
pub use tasks_list::tasks_list_view;
pub use tutor_task::tutor_task_view;
pub use users::users_view;
|
using MusicHarmonySearch.Engine.Catalogs;
using System;
namespace MusicHarmonySearch.Engine
{
public class Interval
{
private Pitch _note1;
private Pitch _note2;
private Intervals _interval;
private Interval(Pitch note1, Pitch note2, Intervals interval)
{
this._note1 = note1;
this._note2 = note2;
this._interval = interval;
}
public Intervals Value {
get
{
return this._interval;
}
}
public static Interval Get(Pitch pitch1, Pitch pitch2)
{
Pitch lower = pitch1;
Pitch higher = pitch2;
if (pitch1.GetSemitones() > pitch2.GetSemitones())
{
lower = pitch2;
higher = pitch1;
}
var numberInterval = Interval.GetNumberInterval(lower.Note.GetTone(), higher.Note.GetTone());
var countSemitones = Math.Abs(pitch1.GetSemitones() - pitch2.GetSemitones());
return new Interval(lower, higher, IntervalStore.GetInterval(numberInterval, countSemitones));
}
public static NumberIntervals GetNumberInterval(Notes lower, Notes higher)
{
int h = (int)higher;
int l = (int)lower;
if (h < l)
{
h += 7;
}
return (NumberIntervals) h - l + 1;
}
public override string ToString()
{
return Value.ToString();
}
}
}
|
#include "normal3d.h"
Normal3D::Normal3D(void)
{
}
Normal3D::~Normal3D(void)
{
}
|
$(document).ready(function() {
var thermostat = new Thermostat();
$('.currentTemp').text(thermostat.currentTemp() + ' c');
$('.usageLevel').css('background-color', 'black');
$('.powerSaver').css('background-color', 'green');
$('.up').click(function() {
thermostat.up();
usageCheck()
$('.currentTemp').text(thermostat.currentTemp() + " c");
})
$('.down').click(function() {
thermostat.down();
usageCheck()
$('.currentTemp').text(thermostat.currentTemp() + " c");
})
$('.resetTemperature').click(function() {
thermostat.reset();
usageCheck()
$('.currentTemp').text(thermostat.currentTemp() + " c");
})
$('.powerSaver').click(function() {
thermostat.changeMode();
if (thermostat.powerModeCheck() === true) {
($(this).css('background-color', 'green'))
} else {
($(this).css('background-color', 'red'))
}
})
function usageCheck() {
if (thermostat.usageLevel() === 'low-usage') {
$('.usageLevel').css('background-color', 'green')
} else if (thermostat.usageLevel() === 'medium-usage') {
$('.usageLevel').css('background-color', 'black')
} else {
$('.usageLevel').css('background-color', 'red')
}
}
})
|
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Models\Term; //Use the Term Model.
class TermController extends Controller
{
//This public function will get all the 'terms' table data.
public function getTerm() {
return response()->json([
'success' => true,
'statusCode' => 200,
'message' => 'Successfully retrieved terms',
'data' => Term::all()]);
}
//This public function will get specific 'terms' table data using the unique ID.
public function getTermByID($id) {
$term = Term::find($id);
if (is_null($term)) {
return response()->json([
'success' => false,
'statusCode' => 404,
'message' => 'Term not found']);
}
return response()->json([
'success' => true,
'statusCode' => 200,
'message' => 'Successfully retrieved term',
'data' => $term::find($id)]);
}
//This public function will add new term to the 'terms' table.
public function addTerm(Request $request) {
$term = Term::create($request->all());
return response()->json([
'success' => true,
'statusCode' => 201,
'message' => 'Successfully added term',
'data' => $term]);
}
//This public function will update a specific term to the 'terms' table using the unique ID.
public function updateTerm(Request $request, $id) {
$term = Term::find($id);
if (is_null($term)) {
return response()->json([
'success' => false,
'statusCode' => 404,
'message' => 'Term not found']);
}
$term->update($request->all());
return response([
'success' => true,
'statusCode' => 200,
'message' => 'Successfully updated term',
'data' => $term]);
}
//This function will delete a specific term in the 'terms' table.
public function deleteTerm(Request $request, $id) {
$term = Term::find($id);
if (is_null($term)) {
return response()->json([
'success' => false,
'statusCode' => 404,
'message' => 'Term not found']);
}
$term ->delete();
return response()->json([
'success' => true,
'statusCode' => 204,
'message' => 'Successfully deleted term',
'data' => null]);
}
}
|
# Plugin stdout
## Variables
| Variable name | Default | Applied function |
|---|---|---|
| pattern | - | |
## Plugin template
```
<match {{ .pattern }}.** >
@type stdout
</match>
```
|
this.BX = this.BX || {};
(function (exports, main_core, landing_env) {
'use strict';
var pageTypeAlias = {
GROUP: 'KNOWLEDGE'
};
/**
* @memberOf BX.Landing
*/
var Loc =
/*#__PURE__*/
function (_MainLoc) {
babelHelpers.inherits(Loc, _MainLoc);
function Loc() {
babelHelpers.classCallCheck(this, Loc);
return babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Loc).apply(this, arguments));
}
babelHelpers.createClass(Loc, null, [{
key: "getMessage",
value: function getMessage(key) {
var pageType = function () {
var type = landing_env.Env.getInstance().getType();
return pageTypeAlias[type] || type;
}();
if (pageType) {
var typedMessageKey = "".concat(key, "__").concat(pageType);
if (main_core.Type.isString(BX.message[typedMessageKey])) {
return main_core.Loc.getMessage(typedMessageKey);
}
}
return main_core.Loc.getMessage(key);
}
}]);
return Loc;
}(main_core.Loc);
exports.Loc = Loc;
}(this.BX.Landing = this.BX.Landing || {}, BX, BX.Landing));
//# sourceMappingURL=loc.bundle.js.map
|
package com.title.joke.controller
import com.title.joke.dto.EventDataDto
import com.title.joke.service.EventsService
import kotlinx.coroutines.GlobalScope
import org.slf4j.LoggerFactory
import org.springframework.beans.factory.annotation.Value
import org.springframework.http.HttpStatus
import org.springframework.http.ResponseEntity
import org.springframework.web.bind.annotation.*
import kotlinx.coroutines.launch
@RestController
@RequestMapping("subscribe")
class EventsController(
@Value("\${strava.subscription-id}")
val subscriptionId: String,
private val eventsService: EventsService
) {
private val logger = LoggerFactory.getLogger(EventsController::class.java)
@PostMapping("callback", consumes = ["application/json"])
fun callback(@RequestBody eventData: EventDataDto): ResponseEntity<String> {
logger.info("Received event: $eventData")
if (subscriptionId == eventData.subscription_id) {
GlobalScope.launch {
eventsService.updateActivity(eventData)
}
return ResponseEntity.ok().build()
}
logger.warn("Unauthorized event received: $eventData")
return ResponseEntity.status(HttpStatus.UNAUTHORIZED).build()
}
}
|
package compose.icons.simpleicons
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.PathFillType.Companion.NonZero
import androidx.compose.ui.graphics.SolidColor
import androidx.compose.ui.graphics.StrokeCap.Companion.Butt
import androidx.compose.ui.graphics.StrokeJoin.Companion.Miter
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.graphics.vector.ImageVector.Builder
import androidx.compose.ui.graphics.vector.path
import androidx.compose.ui.unit.dp
import compose.icons.SimpleIcons
public val SimpleIcons.Appstore: ImageVector
get() {
if (_appstore != null) {
return _appstore!!
}
_appstore = Builder(name = "Appstore", defaultWidth = 24.0.dp, defaultHeight = 24.0.dp,
viewportWidth = 24.0f, viewportHeight = 24.0f).apply {
path(fill = SolidColor(Color(0xFF000000)), stroke = null, strokeLineWidth = 0.0f,
strokeLineCap = Butt, strokeLineJoin = Miter, strokeLineMiter = 4.0f,
pathFillType = NonZero) {
moveTo(8.8086f, 14.9194f)
lineToRelative(6.1107f, -11.0368f)
curveToRelative(0.0837f, -0.1513f, 0.1682f, -0.302f, 0.2437f, -0.4584f)
curveToRelative(0.0685f, -0.142f, 0.1267f, -0.2854f, 0.1646f, -0.4403f)
curveToRelative(0.0803f, -0.3259f, 0.0588f, -0.6656f, -0.066f, -0.9767f)
curveToRelative(-0.1238f, -0.3095f, -0.3417f, -0.5678f, -0.6201f, -0.7355f)
arcToRelative(1.4175f, 1.4175f, 0.0f, false, false, -0.921f, -0.1924f)
curveToRelative(-0.3207f, 0.043f, -0.6135f, 0.1935f, -0.8443f, 0.4288f)
curveToRelative(-0.1094f, 0.1118f, -0.1996f, 0.2361f, -0.2832f, 0.369f)
curveToRelative(-0.092f, 0.1463f, -0.175f, 0.2979f, -0.259f, 0.4492f)
lineToRelative(-0.3864f, 0.6979f)
lineToRelative(-0.3865f, -0.6979f)
curveToRelative(-0.0837f, -0.1515f, -0.1667f, -0.303f, -0.2587f, -0.4492f)
curveToRelative(-0.0837f, -0.1329f, -0.1739f, -0.2572f, -0.2835f, -0.369f)
curveToRelative(-0.2305f, -0.2353f, -0.5233f, -0.3857f, -0.844f, -0.429f)
arcToRelative(1.4181f, 1.4181f, 0.0f, false, false, -0.921f, 0.1926f)
curveToRelative(-0.2784f, 0.1677f, -0.4964f, 0.426f, -0.6203f, 0.7355f)
curveToRelative(-0.1246f, 0.311f, -0.1461f, 0.6508f, -0.066f, 0.9767f)
curveToRelative(0.038f, 0.155f, 0.0962f, 0.2984f, 0.1648f, 0.4403f)
curveToRelative(0.0753f, 0.1564f, 0.1598f, 0.307f, 0.2437f, 0.4584f)
lineToRelative(1.248f, 2.2543f)
lineToRelative(-4.8625f, 8.7825f)
horizontalLineTo(2.0295f)
curveToRelative(-0.1676f, 0.0f, -0.3351f, -7.0E-4f, -0.5026f, 0.0092f)
curveToRelative(-0.1522f, 0.009f, -0.3004f, 0.0284f, -0.448f, 0.0714f)
curveToRelative(-0.3108f, 0.0906f, -0.5822f, 0.2798f, -0.7783f, 0.548f)
curveToRelative(-0.195f, 0.2665f, -0.3006f, 0.5929f, -0.3006f, 0.9279f)
curveToRelative(0.0f, 0.3352f, 0.1057f, 0.6612f, 0.3006f, 0.9277f)
curveToRelative(0.196f, 0.2683f, 0.4675f, 0.4575f, 0.7782f, 0.548f)
curveToRelative(0.1477f, 0.043f, 0.296f, 0.0623f, 0.4481f, 0.0715f)
curveToRelative(0.1675f, 0.01f, 0.335f, 0.009f, 0.5026f, 0.009f)
horizontalLineToRelative(13.0974f)
curveToRelative(0.0171f, -0.0357f, 0.059f, -0.1294f, 0.1f, -0.2697f)
curveToRelative(0.415f, -1.4151f, -0.6156f, -2.843f, -2.0347f, -2.843f)
close()
moveTo(3.113f, 18.5418f)
lineToRelative(-0.7922f, 1.5008f)
curveToRelative(-0.0818f, 0.1553f, -0.1644f, 0.31f, -0.2384f, 0.4705f)
curveToRelative(-0.067f, 0.1458f, -0.124f, 0.293f, -0.1611f, 0.452f)
curveToRelative(-0.0785f, 0.3346f, -0.0576f, 0.6834f, 0.0645f, 1.0029f)
curveToRelative(0.1212f, 0.3175f, 0.3346f, 0.583f, 0.607f, 0.7549f)
curveToRelative(0.2727f, 0.172f, 0.5891f, 0.2416f, 0.9013f, 0.1975f)
curveToRelative(0.3139f, -0.044f, 0.6005f, -0.1986f, 0.8263f, -0.4402f)
curveToRelative(0.1072f, -0.1148f, 0.1954f, -0.2424f, 0.2772f, -0.3787f)
curveToRelative(0.0902f, -0.1503f, 0.1714f, -0.3059f, 0.2535f, -0.4612f)
lineTo(6.0f, 19.4636f)
curveToRelative(-0.0896f, -0.149f, -0.9473f, -1.4704f, -2.887f, -0.9218f)
moveToRelative(20.5861f, -3.0056f)
arcToRelative(1.4707f, 1.4707f, 0.0f, false, false, -0.779f, -0.5407f)
curveToRelative(-0.1476f, -0.0425f, -0.2961f, -0.0616f, -0.4483f, -0.0705f)
curveToRelative(-0.1678f, -0.0099f, -0.3352f, -0.0091f, -0.503f, -0.0091f)
horizontalLineTo(18.648f)
lineToRelative(-4.3891f, -7.817f)
curveToRelative(-0.6655f, 0.7005f, -0.9632f, 1.485f, -1.0773f, 2.1976f)
curveToRelative(-0.1655f, 1.0333f, 0.0367f, 2.0934f, 0.546f, 3.0004f)
lineToRelative(5.2741f, 9.3933f)
curveToRelative(0.084f, 0.1494f, 0.167f, 0.299f, 0.2591f, 0.4435f)
curveToRelative(0.0837f, 0.131f, 0.1739f, 0.2537f, 0.2836f, 0.364f)
curveToRelative(0.231f, 0.2323f, 0.5238f, 0.3809f, 0.8449f, 0.4232f)
curveToRelative(0.3192f, 0.0424f, 0.643f, -0.0244f, 0.9217f, -0.1899f)
curveToRelative(0.2784f, -0.1653f, 0.4968f, -0.4204f, 0.621f, -0.7257f)
curveToRelative(0.1246f, -0.3072f, 0.146f, -0.6425f, 0.0658f, -0.9641f)
curveToRelative(-0.0381f, -0.1529f, -0.0962f, -0.2945f, -0.165f, -0.4346f)
curveToRelative(-0.0753f, -0.1543f, -0.1598f, -0.303f, -0.2438f, -0.4524f)
lineToRelative(-1.216f, -2.1662f)
horizontalLineToRelative(1.596f)
curveToRelative(0.1677f, 0.0f, 0.3351f, 9.0E-4f, 0.5029f, -0.009f)
curveToRelative(0.1522f, -0.009f, 0.3007f, -0.028f, 0.4483f, -0.0705f)
arcToRelative(1.4707f, 1.4707f, 0.0f, false, false, 0.779f, -0.5407f)
arcTo(1.5386f, 1.5386f, 0.0f, false, false, 24.0f, 16.452f)
arcToRelative(1.539f, 1.539f, 0.0f, false, false, -0.3009f, -0.9158f)
close()
}
}
.build()
return _appstore!!
}
private var _appstore: ImageVector? = null
|
const readline = require('readline')
//process 全局的,不需要引入就可使用 命令行提供stdin createInterface API
const rl = readline.createInterface({//创建一个交互的接口 input战斗的地方
input: process.stdin, // process node.js 核心模块进程 可以源源不断读取用户的信息
output: process.stdout
}) ;
rl.question('please input a word:',function(answer){
console.log('Your has entered [%s]', answer.toUpperCase());// [%s] 占位符 需要接受一个参数去替换
rl.close();//用完关闭
})
|
python main.py --k 5 &> log_Crop
python main.py --k 5 --resume --lr 0.001 &>> log_Crop
|
package controllers
import javax.inject.Inject
import akka.actor.ActorSystem
import bminjection.db.DBTrait
import bminjection.token.AuthTokenTrait
import bmlogic.adjustdata.AdjustDataMessage.msg_AdjustNameDataCommand
import bmlogic.common.requestArgsQuery
import bmmessages.{CommonModules, MessageRoutes}
import bmpattern.LogMessage.msg_log
import bmpattern.ResultMessage.msg_CommonResultMessage
import play.api.mvc._
import play.api.libs.json.Json.toJson
/**
* Created by jeorch on 17-6-13.
*/
class AdjustController @Inject () (as_inject : ActorSystem, dbt : DBTrait, att : AuthTokenTrait) extends Controller {
implicit val as = as_inject
def adjustNameData = Action (request => requestArgsQuery().requestArgsV2(request) { jv =>
import bmpattern.LogMessage.common_log
import bmpattern.ResultMessage.common_result
MessageRoutes(msg_log(toJson(Map("method" -> toJson("adjust name command"))), jv)
:: msg_AdjustNameDataCommand(jv) :: msg_CommonResultMessage()
:: Nil, None)(CommonModules(Some(Map("db" -> dbt, "att" -> att))))
})
}
|
'use strict';
let hemisphereLight = undefined;
let sunLight = undefined;
let greenLight = undefined;
let redLight = undefined;
let blueLight = undefined;
let initLights = function() {
sunLight = new THREE.DirectionalLight( 0xffffff, 1 );
sunLight.position.set( 25, 50, -10 );
scene.add( sunLight );
redLight = new THREE.PointLight( 0xff0000, 0, 100);
redLight.position.set( -5, 3, -51 );
scene.add( redLight );
greenLight = new THREE.PointLight( 0x00ff00, 0, 100 );
greenLight.position.set( 0, 3, -51 );
scene.add( greenLight );
blueLight = new THREE.PointLight( 0x0000ff, 0, 100 );
blueLight.position.set( 0, 3, -56 );
scene.add( blueLight );
hemisphereLight = new THREE.HemisphereLight( 0xffffff, 0x0000AA, 0.7 );
scene.add( hemisphereLight );
};
|
/**
*
*/
package com.manan.busservice.service.operations;
import java.util.List;
import java.util.Optional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.manan.busservice.dto.mapper.operations.TicketMapper;
import com.manan.busservice.dto.model.operations.Ticket;
import com.manan.busservice.exception.BusAppException;
import com.manan.busservice.jpa.repository.Repositories;
import com.manan.busservice.model.operations.TicketEntity;
import com.manan.busservice.response.ResponseEntity;
import com.manan.busservice.service.Services;
import com.manan.busservice.utility.DateUtils;
/**
* @author Manan Sanghvi
*
*/
@Component
public class TicketServiceImpl implements Services.TicketService {
private Repositories.Container repos;
@Autowired
public TicketServiceImpl(Repositories.Container repos) {
this.repos = repos;
}
private Optional<TicketEntity> optional;
private void findByTicketNumber(String ticketNumber) {
optional = repos.ticketRepository.findByTicketNumber(ticketNumber);
}
@Override
public Ticket newTicket(Ticket ticket) {
findByTicketNumber(ticket.getTicketNumber());
if(optional.isEmpty()) {
try {
return TicketMapper.toTicket(repos.ticketRepository.save(new TicketEntity()
.setTicketNumber(ticket.getTicketNumber())
.setAmountPaid(ticket.getAmountPaid())
.setLastUpdate(DateUtils.today())
.setCancellable(ticket.isCancellable())
.setCancelled(false)
.setTotalTicket(ticket.getTotalTicket())
.setTripDetails(repos.tripDetailsRepository.findByTripDetailCode(ticket
.getTripDetails()
.getTripDetailCode())
.get())
.setPassenger(repos.userRepository.findByUserName(ticket
.getPassenger()
.getUserName())
.get())));
} catch(RuntimeException re) {
throw new BusAppException.BadRequestException(ResponseEntity.TICKET);
}
}
throw new BusAppException.DuplicateEntityException(ResponseEntity.TICKET);
}
@Override
public Ticket cancelTicket(String ticketNumber) {
findByTicketNumber(ticketNumber);
if(optional.isPresent() && optional.get().isCancellable() == true) {
TicketEntity ticketEntity = optional.get();
return TicketMapper.toTicket(repos.ticketRepository.save(ticketEntity
.setCancelled(true)
.setLastUpdate(DateUtils.today())
));
} else if(optional.get().isCancellable() == false) {
throw new BusAppException.ForbiddenException(ResponseEntity.TICKET);
}
throw new BusAppException.EntityNotFoundException(ResponseEntity.TICKET);
}
@Override
public Ticket viewTicket(String ticketNumber) {
findByTicketNumber(ticketNumber);
if(optional.isPresent()) {
return TicketMapper.toTicket(optional.get());
}
throw new BusAppException.EntityNotFoundException(ResponseEntity.TICKET);
}
@Override
public List<Ticket> viewAllTicketByUser(String userName) {
return TicketMapper.toTicket(repos.ticketRepository.findByPassenger(repos.userRepository
.findByUserName(userName)
.get()));
}
@Override
public List<Ticket> viewAllTickets() {
return TicketMapper.toTicket(repos.ticketRepository.findAll());
}
@Override
public List<Ticket> viewAllTicketByTripDetails(String tripDetailCode) {
return TicketMapper.toTicket(repos.ticketRepository.findByTripDetails(repos.tripDetailsRepository
.findByTripDetailCode(tripDetailCode)
.get()));
}
}
|
package examples.schema
sealed trait MyEtlJobSchema
object MyEtlJobSchema {
case class Rating(user_id: Int, movie_id: Int, rating: Double, timestamp: Long) extends MyEtlJobSchema
case class RatingBQ(user_id: BigInt, movie_id: BigInt, rating: Double) extends MyEtlJobSchema
case class EtlJobRun(job_name: String, job_run_id:String, state:String)
}
|
import argparse
from stests.core import cache
from stests.core import factory
from stests.core.types.infra import NodeGroup
from stests.core.types.infra import NodeType
from stests.core.utils import args_validator
from stests.core.utils import cli as utils
from stests.core.utils import env
# CLI argument parser.
ARGS = argparse.ArgumentParser(f"Upload node information to stests.")
# CLI argument: network name.
ARGS.add_argument(
"--net",
default=env.get_network_name(),
dest="network",
help="Network name {type}{id}, e.g. nctl1.",
type=args_validator.validate_network,
)
# CLI argument: node index.
ARGS.add_argument(
"--node",
dest="node",
help="Node index, e.g. 1.",
type=args_validator.validate_node_index
)
# Set CLI argument: node hostname.
ARGS.add_argument(
"--hostname",
default="localhost",
dest="hostname",
help="Node public hostname: {host}.",
type=args_validator.validate_host
)
# Set CLI argument: node RPC port.
ARGS.add_argument(
"--rest-port",
dest="port_rest",
help="Node REST port: {port}.",
type=args_validator.validate_port
)
# Set CLI argument: node RPC port.
ARGS.add_argument(
"--rpc-port",
dest="port_rpc",
help="Node RPC port: {port}.",
type=args_validator.validate_port
)
# Set CLI argument: node event stream port.
ARGS.add_argument(
"--event-port",
dest="port_event",
help="Node event stream port: {port}.",
type=args_validator.validate_port
)
# Set CLI argument: node type.
ARGS.add_argument(
"--type",
choices=[i.name.lower() for i in NodeType],
dest="typeof",
help="Node type.",
type=str
)
def main(args):
"""Entry point.
:param args: Parsed CLI arguments.
"""
# Unpack.
host = args.hostname
index = int(args.node)
network = args.network
port_rest = int(args.port_rest)
port_rpc = int(args.port_rpc)
port_event = int(args.port_event)
typeof = NodeType[args.typeof.upper()]
# Instantiate.
node = factory.create_node(
group=NodeGroup.UNKNOWN,
host=host,
index=index,
network_id=factory.create_network_id(network),
port_rest=port_rest,
port_rpc=port_rpc,
port_event=port_event,
typeof=typeof
)
# Push.
cache.infra.set_node(node)
# Notify.
utils.log(f"Node {args.network}:{args.node} was successfully registered")
# Entry point.
if __name__ == '__main__':
main(ARGS.parse_args())
|
<?php
namespace App\Modules\OauthClients\Repositories;
use App\Modules\Core\BaseClasses\BaseRepository;
use App\Modules\OauthClients\OauthClient;
class OauthClientRepository extends BaseRepository
{
/**
* Init new object.
*
* @param OauthClient $model
* @return void
*/
public function __construct(OauthClient $model)
{
parent::__construct($model);
}
/**
* Revoke the given client tokens.
*
* @param mixed $client
* @return void
*/
public function revokeClientTokens($client)
{
$client = is_int($client) ? $client : $this->find($client);
$client->tokens()->update(['revoked' => true]);
}
/**
* Ensure access token hasn't expired or revoked.
*
* @param string $accessToken
* @return boolean
*/
public function accessTokenExpiredOrRevoked($accessToken)
{
$accessTokenId = json_decode($accessToken, true)['id'];
$accessToken = \DB::table('oauth_access_tokens')
->where('id', $accessTokenId)
->first();
if (\Carbon\Carbon::parse($accessToken->expires_at)->isPast() || $accessToken->revoked) {
return true;
}
return false;
}
/**
* Revoke the given access token and all
* associated refresh tokens.
*
* @param oject $accessToken
* @return void
*/
public function revokeAccessToken($accessToken)
{
\DB::table('oauth_refresh_tokens')
->where('access_token_id', $accessToken->id)
->update([
'revoked' => true
]);
$accessToken->revoke();
}
}
|
#include "Config.hpp"
#include "easylogging++.hpp"
#include <map>
std::map<std::string, Config> Config::createConfigMapFromFile(std::string path)
{
LOG(DEBUG) << "Loading " << path << " file.";
std::map<std::string, Config> map;
YAML::Node config_array = YAML::LoadFile(path);
for (YAML::const_iterator it = config_array.begin(); it != config_array.end(); ++it)
{
const std::string key = it->first.as<std::string>();
YAML::Node node = it->second.as<YAML::Node>();
LOG(DEBUG) << "Reading attributes from > " << key << " <";
LOG(INFO) << "\n" << node;
map.insert(std::make_pair(key, Config(node)));
}
return map;
}
Config::Config()
{
}
Config::Config(YAML::Node config)
{
this->config = config;
}
bool Config::has(std::string key)
{
return this->config[key];
}
std::string Config::get(std::string key)
{
return this->config[key].as<std::string>();
}
bool Config::getBool(std::string key)
{
return this->config[key].as<bool>();
}
int Config::getInt(std::string key)
{
return this->config[key].as<int>();
}
void Config::set(std::string key, std::string value)
{
this->config[key] = value;
}
void Config::set(std::string key, bool value)
{
this->config[key] = value;
}
void Config::set(std::string key, int value)
{
this->config[key] = value;
}
|
package cove
import (
"io/ioutil"
"os"
"path/filepath"
"testing"
)
func TestCoverageProfileDoesntDeleteNonProfileFilesInOutputDir(t *testing.T) {
testdir, _ := ioutil.TempDir("", "coverage-profile")
defer os.RemoveAll(testdir)
bytes := []byte("foo")
foofile := filepath.Join(testdir, "foo")
ioutil.WriteFile(foofile, bytes, 0644)
profile, _ := CoverageProfile(true, "count", testdir, "text/scanner")
if profile == "" {
t.Errorf("Could not create profile")
}
if _, err := os.Stat(foofile); os.IsNotExist(err) {
t.Errorf("Foo file was deleted")
}
}
func TestCoverageProfileCreatesOutputDirIfItDoesntExist(t *testing.T) {
testdir, _ := ioutil.TempDir("", "coverage-profile")
defer os.RemoveAll(testdir)
outdir := filepath.Join(testdir, "outdir")
profile, er := CoverageProfile(true, "set", outdir, "text/scanner")
if er != nil {
t.Errorf("%v", er)
}
if filepath.Dir(profile) != outdir {
t.Errorf("Could not create profile %v in %v", profile, outdir)
}
}
|
import React from 'react';
import Ionicons from 'react-native-vector-icons/Ionicons';
import { createStackNavigator } from '@react-navigation/stack';
import CreateStudent from '../component/CreateStudent';
const CreateStudentStack = createStackNavigator();
interface CreateStudentStackProps {
navigation: any;
}
function CreateStudentScreen({ navigation }: CreateStudentStackProps) {
return (
<CreateStudentStack.Navigator
initialRouteName="학생추가"
screenOptions={{
headerTintColor: 'white',
headerStyle: {
backgroundColor: '#e91e63',
},
headerTitleStyle: {
fontWeight: 'bold',
},
headerLeft: () => (
<Ionicons.Button
name="menu"
size={35}
backgroundColor="#e91e63"
onPress={() => {
navigation.openDrawer();
}}
/>
),
}}>
<CreateStudentStack.Screen name="학생추가" component={CreateStudent} />
</CreateStudentStack.Navigator>
);
}
export default CreateStudentScreen;
|
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeOperators #-}
module Breakdown where
import Data.Aeson
import Data.Hashable
import Data.Typeable (Typeable)
import GHC.Generics (Generic)
import Servant
data Foo = Foo Int String
deriving (Generic, Eq, Show, Typeable)
instance Hashable Foo
instance ToJSON Foo
instance FromJSON Foo
data SomeSum = A Int | B String
deriving (Generic, Eq, Show, Typeable)
instance Hashable SomeSum
instance ToJSON SomeSum
instance FromJSON SomeSum
type ProductApi =
"item" :> ReqBody '[JSON] Int :> Post '[JSON] ()
:<|> "getFoo" :> Get '[JSON] Foo
eliminate :: Int -> Handler ()
eliminate _ = throwError $ err500 {errBody = "eliminate blew up, oh no!"}
productServer :: Server ProductApi
productServer = eliminate :<|> pure (Foo 12 "abc")
type SumApi =
"item" :> ReqBody '[JSON] Int :> Post '[JSON] ()
:<|> "getFoo1" :> Get '[JSON] SomeSum
:<|> "getFoo2" :> Get '[JSON] SomeSum
sumServer :: Server SumApi
sumServer = eliminate :<|> pure (B "hi") :<|> pure (A 3)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.