hexsha stringlengths 40 40 | size int64 5 1.05M | ext stringclasses 98
values | lang stringclasses 21
values | max_stars_repo_path stringlengths 3 945 | max_stars_repo_name stringlengths 4 118 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 945 | max_issues_repo_name stringlengths 4 118 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 134k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 945 | max_forks_repo_name stringlengths 4 135 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 5 1.05M | avg_line_length float64 1 1.03M | max_line_length int64 2 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
28d475dd049d3caefa73b0959fcbed0ea7122822 | 1,863 | cpp | C++ | src/importer/caffe/ops/slice.cpp | xhuohai/nncase | cf7921c273c7446090939c64f57ef783a62bf29c | [
"Apache-2.0"
] | 510 | 2018-12-29T06:49:36.000Z | 2022-03-30T08:36:29.000Z | src/importer/caffe/ops/slice.cpp | xhuohai/nncase | cf7921c273c7446090939c64f57ef783a62bf29c | [
"Apache-2.0"
] | 459 | 2019-02-17T13:31:29.000Z | 2022-03-31T05:55:38.000Z | src/importer/caffe/ops/slice.cpp | xhuohai/nncase | cf7921c273c7446090939c64f57ef783a62bf29c | [
"Apache-2.0"
] | 155 | 2019-04-16T08:43:24.000Z | 2022-03-21T07:27:26.000Z | /* Copyright 2019-2021 Canaan Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "../caffe_importer.h"
#include <nncase/ir/ops/slice.h>
using namespace nncase;
using namespace nncase::importer;
using namespace nncase::ir;
using namespace caffe;
DEFINE_CAFFE_LOWER(Slice)
{
// check if there are bn/scale/relu above
std::string input_name = get_real_input_names(op)[0];
auto &input = *output_tensors_.at(input_name);
auto ¶m = op.slice_param();
auto in_shape = input.shape();
axis_t begin_templ(in_shape.size());
axis_t end_templ(begin_templ.size());
for (size_t i = 0; i < end_templ.size(); i++)
end_templ[i] = in_shape[i];
axis_t strides(begin_templ.size());
for (size_t i = 0; i < strides.size(); i++)
strides[i] = 1;
int32_t axis_beg = 0;
for (int i = 0; i < op.top_size(); i++)
{
auto begin = begin_templ;
auto end = end_templ;
begin[param.axis()] = axis_beg;
if (i != op.top_size() - 1)
axis_beg = end[param.axis()] = axis_beg + param.slice_point(i);
auto sl = graph_.emplace<slice>(dt_float32, in_shape, begin, end, strides, 0, 0, 0, 0);
sl->name(op.name() + "/slice");
input_tensors_.emplace(&sl->input(), input_name);
output_tensors_.emplace(op.top(i), &sl->output());
}
}
| 34.5 | 95 | 0.656468 |
419079936a5e284ba5fbf353df06defb557baddc | 70 | dart | Dart | fhir_at_rest/lib/enums/restful_request.dart | i-atros/fhir | 39c1f09b7e85444b6ea414c39e88b9cb441d8017 | [
"MIT"
] | 29 | 2021-02-20T13:45:54.000Z | 2022-03-16T20:49:04.000Z | fhir_at_rest/lib/enums/restful_request.dart | i-atros/fhir | 39c1f09b7e85444b6ea414c39e88b9cb441d8017 | [
"MIT"
] | 6 | 2021-02-16T09:45:40.000Z | 2022-01-22T11:01:04.000Z | fhir_at_rest/lib/enums/restful_request.dart | i-atros/fhir | 39c1f09b7e85444b6ea414c39e88b9cb441d8017 | [
"MIT"
] | 25 | 2021-02-04T00:00:13.000Z | 2022-01-29T16:26:03.000Z | enum RestfulRequest {
get_,
put_,
delete_,
post_,
patch_,
}
| 8.75 | 21 | 0.628571 |
0ed4581cad0ec7ba1b896032a8428c46aaae0e11 | 1,504 | h | C | src/mafCore/mafLoggerBuffer.h | tartarini/MAF3 | f9614d36591754544b23e3a670980799254dfd2c | [
"Apache-2.0"
] | 1 | 2021-05-10T19:01:48.000Z | 2021-05-10T19:01:48.000Z | src/mafCore/mafLoggerBuffer.h | examyes/MAF3 | f9614d36591754544b23e3a670980799254dfd2c | [
"Apache-2.0"
] | null | null | null | src/mafCore/mafLoggerBuffer.h | examyes/MAF3 | f9614d36591754544b23e3a670980799254dfd2c | [
"Apache-2.0"
] | 1 | 2018-02-06T03:51:57.000Z | 2018-02-06T03:51:57.000Z | /*
* mafLoggerBuffer.h
* mafCore
*
* Created by Paolo Quadrani on 17/09/09.
* Copyright 2009 SCS-B3C. All rights reserved.
*
* See Licence at: http://tiny.cc/QXJ4D
*
*/
#ifndef MAFLOGGERBUFFER_H
#define MAFLOGGERBUFFER_H
// Includes list
#include "mafLogger.h"
namespace mafCore {
// Class forwarding list
/**
Class name: mafLoggerBuffer
This class defines the MAF3 logging class that will store messages into a buffer that can be queryed later or linked to a UI Widget.
@sa mafLogger mafLoggerFile mafLoggerConsole mafMessageHandler
*/
class MAFCORESHARED_EXPORT mafLoggerBuffer : public mafLogger {
Q_OBJECT
/// typedef macro.
mafSuperclassMacro(mafCore::mafLogger);
public:
/// Object constructor.
mafLoggerBuffer(const QString code_location = "");
/// Check if the object is equal to that passed as argument.
/* virtual */ bool isEqual(const mafObjectBase *obj) const;
/// return the buffer containing all the logged messages.
QString &bufferLog() {return m_BufferLog;}
/// Clear all the logged messages until now.
/*virtual*/ void clearLogHistory() {m_BufferLog.clear();}
protected:
/// Object destructor.
/* virtual */ ~mafLoggerBuffer();
/// Method used to log the given message to the buffer.
/*virtual*/ void loggedMessage(const QtMsgType type, const QString &msg);
private:
QString m_BufferLog; ///< String containing all the logged messages for a specific session.
};
}
#endif // MAFLOGGERBUFFER_H
| 25.931034 | 133 | 0.714761 |
fbe020ca668d15663f9348ab3fbc9592c668f454 | 880 | java | Java | src/command/CommandManager.java | ntrivix/General-Document-Handler | ed042dc3e882415b2db9dfcbbadf4d702397074c | [
"MIT"
] | null | null | null | src/command/CommandManager.java | ntrivix/General-Document-Handler | ed042dc3e882415b2db9dfcbbadf4d702397074c | [
"MIT"
] | null | null | null | src/command/CommandManager.java | ntrivix/General-Document-Handler | ed042dc3e882415b2db9dfcbbadf4d702397074c | [
"MIT"
] | null | null | null | package command;
import java.util.ArrayList;
import controller.ActionManager;
import models.MWorkspace;
public class CommandManager {
private ArrayList<AbstractCommand> commands = new ArrayList<AbstractCommand>();
private int counter = 0;
public void addCommand(AbstractCommand com) {
while (counter < commands.size())
commands.remove(counter);
commands.add(com);
doCommand();
}
public void doCommand() {
ActionManager.getInstance().getcUndoCommand().setEnabled(true);
commands.get(counter++).doCommand();
if (counter == commands.size()) {
ActionManager.getInstance().getcRedoCommand().setEnabled(false);
}
}
public void undoCommand() {
ActionManager.getInstance().getcRedoCommand().setEnabled(true);
commands.get(--counter).undoCommand();
if (counter == 0) {
ActionManager.getInstance().getcUndoCommand().setEnabled(false);
}
}
}
| 25.142857 | 80 | 0.731818 |
2f75ba555952c879a5fa33dfbfa766b29f8659d4 | 209 | cs | C# | C#/C# Web/ASP.NET Core/Final Project/Data/LTPTranslations.Data.Models/Clients/Country.cs | AntoniyaIvanova/SoftUni | 0219c55ca8514e16c3d927b926f3e7c9c4b9d8cd | [
"MIT"
] | null | null | null | C#/C# Web/ASP.NET Core/Final Project/Data/LTPTranslations.Data.Models/Clients/Country.cs | AntoniyaIvanova/SoftUni | 0219c55ca8514e16c3d927b926f3e7c9c4b9d8cd | [
"MIT"
] | null | null | null | C#/C# Web/ASP.NET Core/Final Project/Data/LTPTranslations.Data.Models/Clients/Country.cs | AntoniyaIvanova/SoftUni | 0219c55ca8514e16c3d927b926f3e7c9c4b9d8cd | [
"MIT"
] | null | null | null | namespace LTPTranslations.Data.Models.Clients
{
using LTPTranslations.Data.Common.Models;
public class Country : BaseDeletableModel<int>
{
public string CountryName { get; set; }
}
}
| 20.9 | 50 | 0.69378 |
908890aa7171c389181c93463b7d03ccecf99899 | 7,849 | py | Python | venv/lib/python2.7/site-packages/passlib/ifc.py | MissCatLady/AlarmEZ | 3942f0b9bb1f7eafb009b3a93df00320c7f74218 | [
"MIT"
] | 1 | 2021-08-23T14:57:31.000Z | 2021-08-23T14:57:31.000Z | venv/lib/python2.7/site-packages/passlib/ifc.py | MissCatLady/AlarmEZ | 3942f0b9bb1f7eafb009b3a93df00320c7f74218 | [
"MIT"
] | 309 | 2016-10-27T23:47:06.000Z | 2017-04-02T04:40:21.000Z | venv/lib/python2.7/site-packages/passlib/ifc.py | MissCatLady/AlarmEZ | 3942f0b9bb1f7eafb009b3a93df00320c7f74218 | [
"MIT"
] | 1 | 2020-01-09T04:53:32.000Z | 2020-01-09T04:53:32.000Z | """passlib.ifc - abstract interfaces used by Passlib"""
#=============================================================================
# imports
#=============================================================================
# core
import logging; log = logging.getLogger(__name__)
import sys
# site
# pkg
# local
__all__ = [
"PasswordHash",
]
#=============================================================================
# 2.5-3.2 compatibility helpers
#=============================================================================
if sys.version_info >= (2,6):
from abc import ABCMeta, abstractmethod, abstractproperty
else:
# create stub for python 2.5
ABCMeta = type
def abstractmethod(func):
return func
# def abstractproperty():
# return None
def create_with_metaclass(meta):
"class decorator that re-creates class using metaclass"
# have to do things this way since abc not present in py25,
# and py2/py3 have different ways of doing metaclasses.
def builder(cls):
if meta is type(cls):
return cls
return meta(cls.__name__, cls.__bases__, cls.__dict__.copy())
return builder
#=============================================================================
# PasswordHash interface
#=============================================================================
class PasswordHash(object):
"""This class describes an abstract interface which all password hashes
in Passlib adhere to. Under Python 2.6 and up, this is an actual
Abstract Base Class built using the :mod:`!abc` module.
See the Passlib docs for full documentation.
"""
#===================================================================
# class attributes
#===================================================================
#---------------------------------------------------------------
# general information
#---------------------------------------------------------------
##name
##setting_kwds
##context_kwds
#---------------------------------------------------------------
# salt information -- if 'salt' in setting_kwds
#---------------------------------------------------------------
##min_salt_size
##max_salt_size
##default_salt_size
##salt_chars
##default_salt_chars
#---------------------------------------------------------------
# rounds information -- if 'rounds' in setting_kwds
#---------------------------------------------------------------
##min_rounds
##max_rounds
##default_rounds
##rounds_cost
#---------------------------------------------------------------
# encoding info -- if 'encoding' in context_kwds
#---------------------------------------------------------------
##default_encoding
#===================================================================
# primary methods
#===================================================================
@classmethod
@abstractmethod
def encrypt(cls, secret, **setting_and_context_kwds): # pragma: no cover -- abstract method
"encrypt secret, returning resulting hash"
raise NotImplementedError("must be implemented by subclass")
@classmethod
@abstractmethod
def verify(cls, secret, hash, **context_kwds): # pragma: no cover -- abstract method
"verify secret against hash, returns True/False"
raise NotImplementedError("must be implemented by subclass")
#===================================================================
# additional methods
#===================================================================
@classmethod
@abstractmethod
def identify(cls, hash): # pragma: no cover -- abstract method
"check if hash belongs to this scheme, returns True/False"
raise NotImplementedError("must be implemented by subclass")
@classmethod
@abstractmethod
def genconfig(cls, **setting_kwds): # pragma: no cover -- abstract method
"compile settings into a configuration string for genhash()"
raise NotImplementedError("must be implemented by subclass")
@classmethod
@abstractmethod
def genhash(cls, secret, config, **context_kwds): # pragma: no cover -- abstract method
"generated hash for secret, using settings from config/hash string"
raise NotImplementedError("must be implemented by subclass")
#===================================================================
# undocumented methods / attributes
#===================================================================
# the following entry points are used internally by passlib,
# and aren't documented as part of the exposed interface.
# they are subject to change between releases,
# but are documented here so there's a list of them *somewhere*.
#---------------------------------------------------------------
# checksum information - defined for many hashes
#---------------------------------------------------------------
## checksum_chars
## checksum_size
#---------------------------------------------------------------
# CryptContext flags
#---------------------------------------------------------------
# hack for bsdi_crypt: if True, causes CryptContext to only generate
# odd rounds values. assumed False if not defined.
## _avoid_even_rounds = False
##@classmethod
##def _bind_needs_update(cls, **setting_kwds):
## """return helper to detect hashes that need updating.
##
## if this method is defined, the CryptContext constructor
## will invoke it with the settings specified for the context.
## this method should return either ``None``, or a callable
## with the signature ``needs_update(hash,secret)->bool``.
##
## this ``needs_update`` function should return True if the hash
## should be re-encrypted, whether due to internal
## issues or the specified settings.
##
## CryptContext will automatically take care of deprecating
## hashes with insufficient rounds for classes which define fromstring()
## and a rounds attribute - though the requirements for this last
## part may change at some point.
## """
#---------------------------------------------------------------
# experimental methods
#---------------------------------------------------------------
##@classmethod
##def normhash(cls, hash):
## """helper to clean up non-canonic instances of hash.
## currently only provided by bcrypt() to fix an historical passlib issue.
## """
# experimental helper to parse hash into components.
##@classmethod
##def parsehash(cls, hash, checksum=True, sanitize=False):
## """helper to parse hash into components, returns dict"""
# experiment helper to estimate bitsize of different hashes,
# implement for GenericHandler, but may be currently be off for some hashes.
# want to expand this into a way to programmatically compare
# "strengths" of different hashes and hash algorithms.
# still needs to have some factor for estimate relative cost per round,
# ala in the style of the scrypt whitepaper.
##@classmethod
##def bitsize(cls, **kwds):
## """returns dict mapping component -> bits contributed.
## components currently include checksum, salt, rounds.
## """
#===================================================================
# eoc
#===================================================================
PasswordHash = create_with_metaclass(ABCMeta)(PasswordHash)
#=============================================================================
# eof
#=============================================================================
| 40.458763 | 95 | 0.480953 |
28e17cdb0ea19ad9f8752ae60f5055a1da7a9747 | 194 | cpp | C++ | Chapter3/Chapter 3/Chapter 3 Source Code/Tex.cpp | ZA139/Algorithm-Training-code | 1f80a5a27c15341a8095888faf587fdba37252dd | [
"MIT"
] | 1 | 2021-07-13T02:17:41.000Z | 2021-07-13T02:17:41.000Z | Chapter3/Chapter 3/Chapter 3 Source Code/Tex.cpp | ZA139/Algorithm-Training-code | 1f80a5a27c15341a8095888faf587fdba37252dd | [
"MIT"
] | null | null | null | Chapter3/Chapter 3/Chapter 3 Source Code/Tex.cpp | ZA139/Algorithm-Training-code | 1f80a5a27c15341a8095888faf587fdba37252dd | [
"MIT"
] | null | null | null | #include<stdio.h>
int main(void)
{
int c, q = 1;
while ((c = getchar()) != EOF)
{
if (c == '"') {
printf("%s", q ? "``" : "''");
q = !q;
}
else
printf("%c", c);
}
return 0;
} | 12.933333 | 33 | 0.402062 |
ffd52a4577c15c462a341b99eb86f3a209061684 | 138 | sql | SQL | migrations/2021-05-24T15-15-51.drop_list_tables.sql | felamaslen/budget | 15279d45eec514c1c31adc12b1c274bf96e80df7 | [
"MIT"
] | 1 | 2020-09-09T06:34:26.000Z | 2020-09-09T06:34:26.000Z | migrations/2021-05-24T15-15-51.drop_list_tables.sql | felamaslen/budget | 15279d45eec514c1c31adc12b1c274bf96e80df7 | [
"MIT"
] | 15 | 2017-08-27T00:36:49.000Z | 2022-02-13T15:07:38.000Z | migrations/2021-05-24T15-15-51.drop_list_tables.sql | felamaslen/budget | 15279d45eec514c1c31adc12b1c274bf96e80df7 | [
"MIT"
] | null | null | null | --drop_list_tables (up)
DROP TABLE income;
DROP TABLE bills;
DROP TABLE food;
DROP TABLE general;
DROP TABLE social;
DROP TABLE holiday;
| 15.333333 | 23 | 0.775362 |
754eff2b2a5633fbfd70c77e6eacb798766b2538 | 251 | cs | C# | source/Server.Contracts/Actions/Templates/IControlTypeProvider.cs | OctopusDeploy/Sashimi | 69ecc08ca27da197129499bdbfe32db39d606d67 | [
"Apache-2.0"
] | 5 | 2020-07-08T08:12:36.000Z | 2021-06-07T13:16:27.000Z | source/Server.Contracts/Actions/Templates/IControlTypeProvider.cs | OctopusDeploy/Sashimi | 69ecc08ca27da197129499bdbfe32db39d606d67 | [
"Apache-2.0"
] | 21 | 2020-05-19T23:24:48.000Z | 2022-02-09T04:33:19.000Z | source/Server.Contracts/Actions/Templates/IControlTypeProvider.cs | OctopusDeploy/Sashimi | 69ecc08ca27da197129499bdbfe32db39d606d67 | [
"Apache-2.0"
] | 1 | 2020-05-13T08:40:15.000Z | 2020-05-13T08:40:15.000Z | using System;
using Sashimi.Server.Contracts.Variables;
namespace Sashimi.Server.Contracts.Actions.Templates
{
public interface IControlTypeProvider
{
ControlType ControlType { get; }
VariableType VariableType { get; }
}
} | 22.818182 | 52 | 0.721116 |
82ac718769ec632e0bf312f7ebf02c616d11f2f6 | 8,521 | swift | Swift | Odysee/Controllers/Library/PublishesViewController.swift | ShadowGravity/odysee-ios | 2c10283265209ac70949177c0edbf82d0322725c | [
"MIT"
] | null | null | null | Odysee/Controllers/Library/PublishesViewController.swift | ShadowGravity/odysee-ios | 2c10283265209ac70949177c0edbf82d0322725c | [
"MIT"
] | null | null | null | Odysee/Controllers/Library/PublishesViewController.swift | ShadowGravity/odysee-ios | 2c10283265209ac70949177c0edbf82d0322725c | [
"MIT"
] | null | null | null | //
// PublishesViewController.swift
// Odysee
//
// Created by Akinwale Ariwodola on 26/02/2021.
//
import Firebase
import OrderedCollections
import UIKit
class PublishesViewController: UIViewController, UITableViewDataSource, UITableViewDelegate {
@IBOutlet weak var noUploadsView: UIView!
@IBOutlet weak var uploadsListView: UITableView!
@IBOutlet weak var loadingContainer: UIView!
var newPlaceholderAdded = false
var longPressGestureRecognizer: UILongPressGestureRecognizer!
var loadingUploads = false
var uploads = OrderedSet<Claim>()
var currentPage: Int = 1
var pageSize: Int = 50
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
loadingContainer.layer.cornerRadius = 20
uploadsListView.tableFooterView = UIView()
loadUploads()
longPressGestureRecognizer = UILongPressGestureRecognizer(target: self, action: #selector(handleUploadCellLongPress))
uploadsListView.addGestureRecognizer(longPressGestureRecognizer)
uploadsListView.register(ClaimTableViewCell.nib, forCellReuseIdentifier: "claim_cell")
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
let appDelegate = UIApplication.shared.delegate as! AppDelegate
appDelegate.mainController.adjustMiniPlayerBottom(bottom: Helper.miniPlayerBottomWithoutTabBar())
}
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
Analytics.logEvent(AnalyticsEventScreenView, parameters: [AnalyticsParameterScreenName: "Uploads", AnalyticsParameterScreenClass: "PublishesViewController"])
let appDelegate = UIApplication.shared.delegate as! AppDelegate
appDelegate.mainController.toggleHeaderVisibility(hidden: false)
}
func addNewPlaceholder() {
if newPlaceholderAdded {
return
}
let newPlaceholder = Claim()
newPlaceholder.claimId = "new"
self.uploads.append(newPlaceholder)
newPlaceholderAdded = true
}
func loadUploads() {
if loadingUploads {
return
}
loadingUploads = true
loadingContainer.isHidden = false
let options: [String: Any] = ["claim_type": "stream",
"page": currentPage,
"page_size": pageSize,
"resolve": true]
Lbry.apiCall(method: Lbry.Methods.claimList,
params: options,
completion: didReceiveUploads)
}
func didReceiveUploads(_ result: Result<Page<Claim>, Error>) {
assert(Thread.isMainThread)
if case let .success(page) = result {
UIView.performWithoutAnimation {
uploadsListView.performBatchUpdates {
let oldCount = uploads.count
uploads.append(contentsOf: page.items)
let indexPaths = (oldCount..<uploads.count).map { IndexPath(item: $0, section: 0) }
uploadsListView.insertRows(at: indexPaths, with: .none)
}
}
Lbry.ownUploads = uploads.filter { $0.claimId != "new" }
}
result.showErrorIfPresent()
loadingUploads = false
loadingContainer.isHidden = true
uploadsListView.isHidden = uploads.isEmpty
noUploadsView.isHidden = !uploads.isEmpty
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destination.
// Pass the selected object to the new view controller.
}
*/
func abandonClaim(claim: Claim) {
let params: [String: Any] = ["claim_id": claim.claimId!,
"blocking": true]
Lbry.apiCall(method: Lbry.Methods.streamAbandon,
params: params,
completion: didAbandonClaim)
}
func didAbandonClaim(_ result: Result<Transaction, Error>) {
assert(Thread.isMainThread)
// TODO: Handle failure and re-insert the row.
result.showErrorIfPresent()
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return uploads.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "claim_cell", for: indexPath) as! ClaimTableViewCell
let claim: Claim = uploads[indexPath.row]
cell.setClaim(claim: claim)
return cell
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
tableView.deselectRow(at: indexPath, animated: true)
let claim: Claim = uploads[indexPath.row]
if claim.claimId == "new" {
let appDelegate = UIApplication.shared.delegate as! AppDelegate
let vc = storyboard?.instantiateViewController(identifier: "publish_vc") as! PublishViewController
appDelegate.mainNavigationController?.pushViewController(vc, animated: true)
return
}
let vc = storyboard?.instantiateViewController(identifier: "publish_vc") as! PublishViewController
vc.currentClaim = claim
let appDelegate = UIApplication.shared.delegate as! AppDelegate
appDelegate.mainNavigationController?.pushViewController(vc, animated: true)
}
@objc func handleUploadCellLongPress(sender: UILongPressGestureRecognizer){
if longPressGestureRecognizer.state == .began {
let touchPoint = longPressGestureRecognizer.location(in: uploadsListView)
if let indexPath = uploadsListView.indexPathForRow(at: touchPoint) {
let claim: Claim = uploads[indexPath.row]
let appDelegate = UIApplication.shared.delegate as! AppDelegate
let vc = appDelegate.mainController.storyboard?.instantiateViewController(identifier: "file_view_vc") as! FileViewController
vc.claim = claim
appDelegate.mainNavigationController?.pushViewController(vc, animated: true)
}
}
}
func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCell.EditingStyle, forRowAt indexPath: IndexPath) {
if editingStyle == .delete {
// abandon channel
let claim: Claim = uploads[indexPath.row]
if claim.claimId == "new" {
return
}
if claim.confirmations ?? 0 == 0 {
// pending claim
self.showError(message: String.localized("You cannot remove a pending upload. Please try again later."))
return
}
// show confirmation dialog before deleting
let alert = UIAlertController(title: String.localized("Abandon channel?"), message: String.localized("Are you sure you want to delete this upload?"), preferredStyle: .alert)
alert.addAction(UIAlertAction(title: String.localized("Yes"), style: .default, handler: { _ in
self.abandonClaim(claim: claim)
self.uploads.remove(at: indexPath.row)
tableView.deleteRows(at: [indexPath], with: .fade)
}))
alert.addAction(UIAlertAction(title: String.localized("No"), style: .destructive))
present(alert, animated: true)
}
}
func showError(message: String?) {
let appDelegate = UIApplication.shared.delegate as! AppDelegate
appDelegate.mainController.showError(message: message)
}
func showError(error: Error?) {
let appDelegate = UIApplication.shared.delegate as! AppDelegate
appDelegate.mainController.showError(error: error)
}
@IBAction func newUploadTapped(_ sender: UIButton) {
let appDelegate = UIApplication.shared.delegate as! AppDelegate
let vc = storyboard?.instantiateViewController(identifier: "publish_vc") as! PublishViewController
appDelegate.mainNavigationController?.pushViewController(vc, animated: true)
}
}
| 41.164251 | 185 | 0.640418 |
9098bf40caa0d644b6ab6ac0c3fbd6c51751504c | 8,556 | py | Python | examples/08-vrm/plot_fwd_vrm.py | ElliotCheung/simpeg | ce5bde154179ca63798a62a12787a7ec3535472c | [
"MIT"
] | 1 | 2022-02-18T16:31:27.000Z | 2022-02-18T16:31:27.000Z | examples/08-vrm/plot_fwd_vrm.py | ElliotCheung/simpeg | ce5bde154179ca63798a62a12787a7ec3535472c | [
"MIT"
] | null | null | null | examples/08-vrm/plot_fwd_vrm.py | ElliotCheung/simpeg | ce5bde154179ca63798a62a12787a7ec3535472c | [
"MIT"
] | null | null | null | """
Predict Response from a Conductive and Magnetically Viscous Earth
=================================================================
Here, we predict the vertical db/dt response over a conductive and
magnetically viscous Earth for a small coincident loop system. Following
the theory, the total response is approximately equal to the sum of the
inductive and VRM responses modelled separately. The SimPEG.VRM module is
used to model the VRM response while an analytic solution for a conductive
half-space is used to model the inductive response.
"""
#########################################################################
# Import modules
# --------------
#
from SimPEG.electromagnetics import viscous_remanent_magnetization as VRM
import numpy as np
import discretize
from SimPEG import mkvc, maps
import matplotlib.pyplot as plt
import matplotlib as mpl
##########################################################################
# Defining the mesh
# -----------------
#
cs, ncx, ncy, ncz, npad = 2.0, 35, 35, 20, 5
hx = [(cs, npad, -1.3), (cs, ncx), (cs, npad, 1.3)]
hy = [(cs, npad, -1.3), (cs, ncy), (cs, npad, 1.3)]
hz = [(cs, npad, -1.3), (cs, ncz), (cs, npad, 1.3)]
mesh = discretize.TensorMesh([hx, hy, hz], "CCC")
##########################################################################
# Defining the model
# ------------------
#
# Create xi model (amalgamated magnetic property). Here the model is made by
# summing a set of 3D Gaussian distributions. And only active cells have a
# model value.
#
topoCells = mesh.gridCC[:, 2] < 0.0 # Define topography
xyzc = mesh.gridCC[topoCells, :]
c = 2 * np.pi * 8**2
pc = np.r_[4e-4, 4e-4, 4e-4, 6e-4, 8e-4, 6e-4, 8e-4, 8e-4]
x_0 = np.r_[50.0, -50.0, -40.0, -20.0, -15.0, 20.0, -10.0, 25.0]
y_0 = np.r_[0.0, 0.0, 40.0, 10.0, -20.0, 15.0, 0.0, 0.0]
z_0 = np.r_[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
var_x = c * np.r_[3.0, 3.0, 3.0, 1.0, 3.0, 0.5, 0.1, 0.1]
var_y = c * np.r_[20.0, 20.0, 1.0, 1.0, 0.4, 0.5, 0.1, 0.4]
var_z = c * np.r_[1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]
xi_true = np.zeros(np.shape(xyzc[:, 0]))
for ii in range(0, 8):
xi_true += (
pc[ii]
* np.exp(-((xyzc[:, 0] - x_0[ii]) ** 2) / var_x[ii])
* np.exp(-((xyzc[:, 1] - y_0[ii]) ** 2) / var_y[ii])
* np.exp(-((xyzc[:, 2] - z_0[ii]) ** 2) / var_z[ii])
)
xi_true += 1e-5
##########################################################################
# Survey
# ------
#
# Here we must set the transmitter waveform, which defines the off-time decay
# of the VRM response. Next we define the sources, receivers and time channels
# for the survey. Our example is similar to an EM-63 survey.
#
waveform = VRM.waveforms.StepOff()
times = np.logspace(-5, -2, 31) # Observation times
x, y = np.meshgrid(np.linspace(-30, 30, 21), np.linspace(-30, 30, 21))
z = 0.5 * np.ones(x.shape)
loc = np.c_[mkvc(x), mkvc(y), mkvc(z)] # Src and Rx Locations
src_list_vrm = []
for pp in range(0, loc.shape[0]):
loc_pp = np.reshape(loc[pp, :], (1, 3))
rx_list_vrm = [VRM.Rx.Point(loc_pp, times=times, fieldType="dbdt", orientation="z")]
src_list_vrm.append(
VRM.Src.MagDipole(rx_list_vrm, mkvc(loc[pp, :]), [0.0, 0.0, 0.01], waveform)
)
survey_vrm = VRM.Survey(src_list_vrm)
##########################################################################
# Simulation
# ----------
#
# For the VRM problem, we used a sensitivity refinement strategy for cells
# that are proximal to transmitters. This is controlled through the
# *refinement_factor* and *refinement_distance* properties.
#
# Defining the problem
problem_vrm = VRM.Simulation3DLinear(
mesh,
survey=survey_vrm,
indActive=topoCells,
refinement_factor=3,
refinement_distance=[1.25, 2.5, 3.75],
)
# Predict VRM response
fields_vrm = problem_vrm.fields(xi_true)
n_times = len(times)
n_loc = loc.shape[0]
fields_vrm = np.reshape(fields_vrm, (n_loc, n_times))
# Add an artificial TEM response. An analytic solution for the response near
# the surface of a conductive half-space (Nabighian, 1979) is scaled at each
# location to provide lateral variability in the TEM response.
sig = 1e-1
mu0 = 4 * np.pi * 1e-7
fields_tem = -(sig**1.5) * mu0**2.5 * times**-2.5 / (20 * np.pi**1.5)
fields_tem = np.kron(np.ones((n_loc, 1)), np.reshape(fields_tem, (1, n_times)))
c = (
np.exp(-((loc[:, 0] - 10) ** 2) / (25**2))
* np.exp(-((loc[:, 1] - 20) ** 2) / (35**2))
+ np.exp(-((loc[:, 0] + 20) ** 2) / (20**2))
* np.exp(-((loc[:, 1] + 20) ** 2) / (40**2))
+ 1.5
* np.exp(-((loc[:, 0] - 25) ** 2) / (10**2))
* np.exp(-((loc[:, 1] + 25) ** 2) / (10**2))
+ 0.25
)
c = np.kron(np.reshape(c, (len(c), 1)), np.ones((1, n_times)))
fields_tem = c * fields_tem
##########################################################################
# Plotting
# --------
#
# Plotting the model
Fig = plt.figure(figsize=(10, 10))
font_size = 12
plotMap = maps.InjectActiveCells(mesh, topoCells, 0.0) # Maps to mesh
ax1 = 4 * [None]
cplot1 = 3 * [None]
view_str = ["X", "Y", "Z"]
param_1 = [ncx, ncy, ncz]
param_2 = [6, 0, 1]
param_3 = [-12, 0, 0]
for qq in range(0, 3):
ax1[qq] = Fig.add_axes([0.07 + qq * 0.29, 0.7, 0.23, 0.23])
cplot1[qq] = mesh.plotSlice(
plotMap * xi_true,
normal=view_str[qq],
ind=int((param_1[qq] + 2 * npad) / 2 - param_2[qq]),
ax=ax1[qq],
grid=True,
pcolorOpts={"cmap": "gist_heat_r"},
)
cplot1[qq][0].set_clim((0.0, np.max(xi_true)))
ax1[qq].set_xlabel("Y [m]", fontsize=font_size)
ax1[qq].set_ylabel("Z [m]", fontsize=font_size, labelpad=-10)
ax1[qq].tick_params(labelsize=font_size - 2)
ax1[qq].set_title(
"True Model (x = {} m)".format(param_3[qq]), fontsize=font_size + 2
)
ax1[3] = Fig.add_axes([0.89, 0.7, 0.01, 0.24])
norm = mpl.colors.Normalize(vmin=0.0, vmax=np.max(xi_true))
cbar14 = mpl.colorbar.ColorbarBase(
ax1[3], cmap=mpl.cm.gist_heat_r, norm=norm, orientation="vertical"
)
cbar14.set_label(
"$\Delta \chi /$ln$(\lambda_2 / \lambda_1 )$ [SI]",
rotation=270,
labelpad=15,
size=font_size,
)
# Plotting the decay
ax2 = 2 * [None]
n = x.shape[0]
for qq in range(0, 2):
ax2[qq] = Fig.add_axes([0.1 + 0.47 * qq, 0.335, 0.38, 0.29])
k = int((n**2 - 1) / 2 - 3 * n * (-1) ** qq)
di_vrm = mkvc(np.abs(fields_vrm[k, :]))
di_tem = mkvc(np.abs(fields_tem[k, :]))
ax2[qq].loglog(times, di_tem, "r.-")
ax2[qq].loglog(times, di_vrm, "b.-")
ax2[qq].loglog(times, di_tem + di_vrm, "k.-")
ax2[qq].set_xlabel("t [s]", fontsize=font_size)
if qq == 0:
ax2[qq].set_ylabel("|dBz/dt| [T/s]", fontsize=font_size)
else:
ax2[qq].axes.get_yaxis().set_visible(False)
ax2[qq].tick_params(labelsize=font_size - 2)
ax2[qq].set_xbound(np.min(times), np.max(times))
ax2[qq].set_ybound(1.2 * np.max(di_tem + di_vrm), 1e-5 * np.max(di_tem + di_vrm))
titlestr2 = (
"Decay at X = "
+ "{:.2f}".format(loc[k, 0])
+ " m and Y = "
+ "{:.2f}".format(loc[k, 1])
+ " m"
)
ax2[qq].set_title(titlestr2, fontsize=font_size + 2)
if qq == 0:
ax2[qq].text(
1.2e-5, 18 * np.max(di_tem) / 1e5, "TEM", fontsize=font_size, color="r"
)
ax2[qq].text(
1.2e-5, 6 * np.max(di_tem) / 1e5, "VRM", fontsize=font_size, color="b"
)
ax2[qq].text(
1.2e-5, 2 * np.max(di_tem) / 1e5, "TEM + VRM", fontsize=font_size, color="k"
)
# Plotting the TEM anomalies
ax3 = 3 * [None]
cplot3 = 3 * [None]
cbar3 = 3 * [None]
for qq in range(0, 3):
ax3[qq] = Fig.add_axes([0.07 + 0.31 * qq, 0.05, 0.24, 0.21])
d = np.reshape(np.abs(fields_tem[:, 10 * qq] + fields_vrm[:, 10 * qq]), (n, n))
cplot3[qq] = ax3[qq].contourf(x, y, d.T, 40, cmap="magma_r")
cbar3[qq] = plt.colorbar(cplot3[qq], ax=ax3[qq], pad=0.02, format="%.2e")
cbar3[qq].set_label("[T/s]", rotation=270, labelpad=12, size=font_size)
cbar3[qq].ax.tick_params(labelsize=font_size - 2)
ax3[qq].set_xlabel("X [m]", fontsize=font_size)
if qq == 0:
ax3[qq].scatter(x, y, color=(0, 0, 0), s=4)
ax3[qq].set_ylabel("Y [m]", fontsize=font_size, labelpad=-8)
else:
ax3[qq].axes.get_yaxis().set_visible(False)
ax3[qq].tick_params(labelsize=font_size - 2)
ax3[qq].set_xbound(np.min(x), np.max(x))
ax3[qq].set_ybound(np.min(y), np.max(y))
titlestr3 = "dBz/dt at t=" + "{:.1e}".format(times[10 * qq]) + " s"
ax3[qq].set_title(titlestr3, fontsize=font_size + 2)
plt.show()
| 33.291829 | 88 | 0.560893 |
fce6714075a7bbb3de617085db2d26d6b693071b | 6,515 | css | CSS | publico/css/style_about.css | cubitshell/cubitshell | 53332333c297f8b3995d6e87b7fa9849f046a56b | [
"MIT"
] | null | null | null | publico/css/style_about.css | cubitshell/cubitshell | 53332333c297f8b3995d6e87b7fa9849f046a56b | [
"MIT"
] | null | null | null | publico/css/style_about.css | cubitshell/cubitshell | 53332333c297f8b3995d6e87b7fa9849f046a56b | [
"MIT"
] | null | null | null | * {
margin: 0px;
padding: 0px;
}
body {
background: #f0f0f0;
}
p {
font-family: helvetica;
}
h2 {
text-align: center;
font-family: helvetica;
}
h3 {
text-align: center;
font-size: 40px;
font-family: helvetica;
margin-top: 80px;
color: #267ec2;
}
/* Inicio del Css del subhead*/
.subhead {
width: 100%;
height: auto;
overflow: hidden;
position: sticky;
top: 0;
z-index: 1;
}
.subhead ul {
display: flex;
padding: 0;
width: 400%;
/* hace un cambio de 20 segundos y uso de taquigrafia la el uso de alternate es para que las imagenes se vayan de sentido contrario al finalizar*/
animation: cambio 20s infinite alternate;
}
.subhead li {
width: 100%;
list-style: none;
}
.subhead img {
width: 100%;
height: 320px;
}
@keyframes cambio {
0% {
margin-left: 0;
}
20% {
margin-left: 0;
}
25% {
margin-left: -100%;
}
45% {
margin-left: -100%;
}
50% {
margin-left: -200%;
}
70% {
margin-left: -200%;
}
75% {
margin-left: -300%;
}
100% {
margin-left: -300%;
}
}
/*Final del subhead*/
.contenedor {
margin: auto;
background-color: #fff;
width: 1050px;
height: 900px;
position: relative;
}
#cubi {
background-image: url(http://localhost/cubitshell/img/about_us/imagenes/cubishell.png);
background-size: 150px 100px;
width: 150px;
height: 100px;
position: absolute;
}
#sucursales {
margin: auto;
position: relative;
float: right;
width: 1050px;
height: 100px;
}
#mision {
margin: auto;
background: #fff;
opacity: 40px;
width: 800px;
height: 200px;
position: absolute;
border-bottom-right-radius: 2em;
border-left-style: solid;
}
#cubishell {
float: right;
background: transparent;
width: 800px;
height: 200px;
position: relative;
top: 205px;
border-bottom-right-radius: 2em;
float: left;
border-left-style: solid;
}
#Equipo {
float: right;
background: #f0f0f0;
width: 800px;
height: 200px;
position: relative;
top: 205px;
border-bottom-left-radius: 2em;
border-right-style: solid;
}
#imision {
position: relative;
width: 200px;
height: 150px;
background-image: url(http://localhost/cubitshell/img/about_us/imagenes/misi.jpg);
background-repeat: no-repeat;
background-size: 200px 150px;
top: 10px;
left: 20px;
border-top-left-radius: 1em;
border-top-right-radius: 1em;
border-bottom-right-radius: 1em;
border-bottom-left-radius: 1em;
}
#TexMision {
position: relative;
width: 350px;
height: 150px;
left: 300px;
top: 0px;
}
#vision {
float: right;
background: #f0f0f0;
width: 800px;
height: 200px;
position: relative;
top: 205px;
border-bottom-left-radius: 2em;
border-right-style: solid;
}
#imvision {
position: relative;
width: 200px;
height: 100px;
background-image: url(http://localhost/cubitshell/img/about_us/imagenes/VISION.jpg);
background-repeat: no-repeat;
background-size: 200px 100px;
top: 40px;
left: 20px;
border-top-left-radius: 1em;
border-top-right-radius: 1em;
border-bottom-right-radius: 1em;
border-bottom-left-radius: 1em;
}
#TextVision {
position: relative;
width: 350px;
height: 150px;
left: 300px;
top: -20px;
}
#Textcubi {
position: relative;
width: 350px;
height: 150px;
left: 300px;
top: -20px;
}
#Textequipo {
position: relative;
width: 350px;
height: 150px;
left: 300px;
top: -20px;
}
#imcubi {
position: relative;
width: 200px;
height: 100px;
background-image: url(http://localhost/cubitshell/img/about_us/imagenes/cubi.png);
background-repeat: no-repeat;
background-size: 200px 100px;
top: 40px;
left: 20px;
border-top-left-radius: 1em;
border-top-right-radius: 1em;
border-bottom-right-radius: 1em;
border-bottom-left-radius: 1em;
}
#imequip {
position: relative;
width: 200px;
height: 100px;
background-image: url(http://localhost/cubitshell/img/about_us/imagenes/equipo.jpg);
background-repeat: no-repeat;
background-size: 200px 100px;
top: 40px;
left: 20px;
border-top-left-radius: 1em;
border-top-right-radius: 1em;
border-bottom-right-radius: 1em;
border-bottom-left-radius: 1em;
}
#mapa {
margin: auto;
background-color: transparent;
width: 1050px;
height: 290px;
position: relative;
}
#ubi {
position: relative;
top: -15px;
width: 1045px;
height: 265px;
}
select#lugares {
background-color: #f0f0f0;
position: relative;
left: -100px;
}
.content-all {
padding: 0px;
margin: auto;
width: 1050px;
height: 150px;
position: relative;
margin-top: 50px;
}
.content-carrusel {
width: 100%;
position: absolute;
animation: rotar 50s infinite linear;
transform-style: preserve-3d;
}
.content-carrusel:hover {
animation-play-state: paused;
cursor: pointer;
}
.content-carrusel figure {
width: 1050px;
height: 100%;
position: absolute;
}
.content-carrusel figure:nth-child(1) {
transform: rotateY(36deg) translateZ(300px);
}
.content-carrusel figure:nth-child(2) {
transform: rotateY(72deg) translateZ(300px);
}
.content-carrusel figure:nth-child(3) {
transform: rotateY(108deg) translateZ(300px);
}
.content-carrusel figure:nth-child(4) {
transform: rotateY(144deg) translateZ(300px);
}
.content-carrusel figure:nth-child(5) {
transform: rotateY(180deg) translateZ(300px);
}
.content-carrusel figure:nth-child(6) {
transform: rotateY(216deg) translateZ(300px);
}
.content-carrusel figure:nth-child(7) {
transform: rotateY(252deg) translateZ(300px);
}
.content-carrusel figure:nth-child(8) {
transform: rotateY(288deg) translateZ(300px);
}
.content-carrusel figure:nth-child(9) {
transform: rotateY(324deg) translateZ(300px);
}
.content-carrusel figure:nth-child(10) {
transform: rotateY(360deg) translateZ(300px);
}
.content-carrusel img {
width: 200px;
height: 100px;
transition: all 300ms;
}
.content-carrusel img:hover {
transform: scale(1.5);
transition: all 300ms;
}
@keyframes rotar {
from {
transform: rotateY(0deg);
}
to {
transform: rotateY(360deg);
}
} | 18.403955 | 150 | 0.627015 |
692a8783a2c254639f0e25e3a6c24152d6b97ff2 | 96,167 | sql | SQL | softdb.sql | jangmac/CodeIgniter | da349a81bb35562a88b9733c8d23a4328bb694c3 | [
"MIT"
] | null | null | null | softdb.sql | jangmac/CodeIgniter | da349a81bb35562a88b9733c8d23a4328bb694c3 | [
"MIT"
] | null | null | null | softdb.sql | jangmac/CodeIgniter | da349a81bb35562a88b9733c8d23a4328bb694c3 | [
"MIT"
] | null | null | null | -- MySQL dump 10.16 Distrib 10.1.13-MariaDB, for Win32 (AMD64)
--
-- Host: localhost Database: softmanage
-- ------------------------------------------------------
-- Server version 10.1.13-MariaDB
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `asiafont_up`
--
DROP TABLE IF EXISTS `asiafont_up`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `asiafont_up` (
`idx` int(20) NOT NULL AUTO_INCREMENT,
`asiafont2008` varchar(15) DEFAULT NULL,
`integrated_Package` varchar(15) DEFAULT NULL,
PRIMARY KEY (`idx`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `asiafont_up`
--
LOCK TABLES `asiafont_up` WRITE;
/*!40000 ALTER TABLE `asiafont_up` DISABLE KEYS */;
INSERT INTO `asiafont_up` VALUES (1,'WKTTF2008-24736',''),(2,'WKTTF2008-24736','\r'),(3,'WKTTF2008-24736','\r'),(4,'WKTTF2008-24736','\r'),(5,'WKTTF2008-24736','\r'),(6,'WKTTF2008-24737','\r'),(7,'WKTTF2008-24737','\r'),(8,'WKTTF2008-24737','\r');
/*!40000 ALTER TABLE `asiafont_up` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `ci_sessions`
--
DROP TABLE IF EXISTS `ci_sessions`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ci_sessions` (
`session_id` varchar(40) NOT NULL DEFAULT '0',
`id_address` varchar(40) NOT NULL DEFAULT '0',
`user_agent` varchar(120) NOT NULL,
`last_activity` int(10) unsigned NOT NULL DEFAULT '0',
`user_data` text NOT NULL,
PRIMARY KEY (`session_id`),
KEY `last_activity_idx` (`last_activity`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `ci_sessions`
--
LOCK TABLES `ci_sessions` WRITE;
/*!40000 ALTER TABLE `ci_sessions` DISABLE KEYS */;
/*!40000 ALTER TABLE `ci_sessions` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `g_adobe`
--
DROP TABLE IF EXISTS `g_adobe`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `g_adobe` (
`idx` int(20) NOT NULL AUTO_INCREMENT,
`user_idx` int(15) NOT NULL,
`photoshop` varchar(50) DEFAULT NULL,
`illustrator` varchar(50) DEFAULT NULL,
`acrobat` varchar(50) DEFAULT NULL,
`gian_num` varchar(30) DEFAULT NULL,
`duration` varchar(30) DEFAULT NULL,
`remarks` varchar(50) DEFAULT NULL,
`adobe_product` varchar(100) DEFAULT NULL,
PRIMARY KEY (`idx`)
) ENGINE=MyISAM AUTO_INCREMENT=76 DEFAULT CHARSET=utf8 COMMENT='전산_어도비';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `g_adobe`
--
LOCK TABLES `g_adobe` WRITE;
/*!40000 ALTER TABLE `g_adobe` DISABLE KEYS */;
INSERT INTO `g_adobe` VALUES (13,16,'','','','','영구','','Adobe Design Standard CS6\r\n1543-1007-0926-3322-8577-3250'),(74,55,NULL,NULL,NULL,'','영구','ID: nzine0321@nzine.co.kr\r\nPW: !cjfwls0321','Adobe Design Standard CS6\r\n1543-1505-9384-7342-5915-7301'),(75,56,NULL,NULL,NULL,'','영구','ID: nzine0321@nzine.co.kr\r\npw: !cjfwls0321','Adobe Design Standard CS6\r\n1543-1505-9384-7342-5915-7301'),(67,18,NULL,NULL,NULL,'','','','Adobe Design Standard CS6\r\n1543-1505-9384-7342-5915-7301'),(68,21,NULL,NULL,NULL,'','','','Adobe Design Standard CS6\r\n1118-1000-4627-8070-6640-7698'),(69,21,NULL,NULL,NULL,'','영구','ID: nzine0321@nzine.co.kr\r\nPW: !cjfwls0321','Adobe Design Standard CS6\r\n1543-1505-9384-7342-5915-7301'),(70,22,NULL,NULL,NULL,'','','','Adobe Design Standard CS6\r\n1543-1505-9384-7342-5915-7301'),(72,70,NULL,NULL,NULL,'','영구','ID: nzine0321@nzine.co.kr\r\nPW: !cjfwls0321','Adobe Design Standard CS6\r\n1543-1505-9384-7342-5915-7301'),(73,30,NULL,NULL,NULL,'','','','Adobe Design and Web Premium CS6\r\n9014-8700-2366-4691-3980');
/*!40000 ALTER TABLE `g_adobe` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `g_cell`
--
DROP TABLE IF EXISTS `g_cell`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `g_cell` (
`idx` int(20) NOT NULL AUTO_INCREMENT,
`user_idx` int(15) NOT NULL,
`product_name` varchar(50) DEFAULT NULL,
`identify` varchar(50) DEFAULT NULL,
`produce_ym` varchar(50) DEFAULT NULL,
`gian_num` varchar(30) DEFAULT NULL,
`buy_day` varchar(30) DEFAULT NULL,
PRIMARY KEY (`idx`)
) ENGINE=MyISAM AUTO_INCREMENT=78 DEFAULT CHARSET=utf8 COMMENT='전산_전화기';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `g_cell`
--
LOCK TABLES `g_cell` WRITE;
/*!40000 ALTER TABLE `g_cell` DISABLE KEYS */;
INSERT INTO `g_cell` VALUES (73,9,'IP335S',NULL,NULL,'','2016.02.24'),(8,11,'IP335S','','','','2016.02.24'),(9,12,'IP700S','','','','2016.02.24'),(10,13,'IP335S','','','','2016.02.24'),(11,14,'IP335S','','','','2016.02.24'),(12,15,'IP335S','','','','2016.02.24'),(13,16,'IP335S','','','','2016.02.24'),(14,17,'IP335S','','','','2016.02.24'),(15,18,'IP335S','','','','2016.02.24'),(16,19,'IP335S','','','','2016.02.24'),(17,20,'IP335S','','','','2016.05.09'),(18,21,'IP335S',NULL,NULL,'','2016.02.24'),(19,22,'IP335S',NULL,NULL,'','2016.02.24'),(21,24,'IP700S','','','','2016.02.24'),(22,25,'IP335S','','','','2016.02.24'),(23,26,'IP335S','','','','2016.02.24'),(24,27,'IP335S','','','','2016.05.09'),(25,28,'IP335S','','','','2016.02.24'),(26,29,'IP335S','','','','2016.02.24'),(27,30,'IP335S','','','','2016.02.24'),(28,31,'IP335S','','','','2016.02.24'),(29,32,'IP335S','','','','2016.02.24'),(30,33,'IP335S','','','','2016.02.24'),(31,34,'IP335S','','','','2016.02.24'),(32,35,'IP335S','','','','2016.02.24'),(33,36,'IP335S','','','','2016.02.24'),(35,38,'IP335S','','','','2016.02.24'),(36,39,'IP335S','','','','2016.02.24'),(37,40,'IP335S','','','','2016.02.24'),(38,41,'IP335S','','','','2016.02.24'),(39,42,'IP335S','','','','2016.02.24'),(40,43,'IP335S','','','','2016.02.24'),(41,44,'IP335S','','','','2016.02.24'),(42,45,'IP335S','','','','2016.02.24'),(43,46,'IP335S','','','','2016.02.24'),(44,47,'IP335S','','','','2016.02.24'),(45,48,'IP335S','','','','2016.02.24'),(46,49,'IP335S','','','','2016.02.24'),(47,50,'IP335S','','','','2016.02.24'),(48,51,'IP335S','','','','2016.02.24'),(49,52,'IP335S','','','','2016.02.24'),(50,53,'IP335S','','','','2016.02.24'),(51,54,'IP335S','','','','2016.02.24'),(52,55,'IP335S',NULL,NULL,'','2016.02.24'),(53,56,'IP335S',NULL,NULL,'','2016.02.24'),(55,58,'IP700S','','','','2016.02.24'),(56,59,'IP335S','','','','2016.02.24'),(72,9,'IP700S',NULL,NULL,'','2016.02.24'),(74,10,'IP700S',NULL,NULL,'','2016.02.24'),(75,70,'IP335S',NULL,NULL,'','2016.05.09'),(76,38,'IP335S',NULL,NULL,'','2016.02.24'),(77,59,'IP335S',NULL,NULL,'','2016.02.24');
/*!40000 ALTER TABLE `g_cell` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `g_compress`
--
DROP TABLE IF EXISTS `g_compress`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `g_compress` (
`idx` int(20) NOT NULL AUTO_INCREMENT,
`user_idx` int(15) NOT NULL,
`alzip` varchar(50) DEFAULT NULL,
`gian_num` varchar(30) DEFAULT NULL,
`duration` varchar(30) DEFAULT NULL,
PRIMARY KEY (`idx`)
) ENGINE=MyISAM AUTO_INCREMENT=68 DEFAULT CHARSET=utf8 COMMENT='전산_압축프로그램';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `g_compress`
--
LOCK TABLES `g_compress` WRITE;
/*!40000 ALTER TABLE `g_compress` DISABLE KEYS */;
INSERT INTO `g_compress` VALUES (1,4,'알집 6.0','AS223','영구');
/*!40000 ALTER TABLE `g_compress` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `g_font`
--
DROP TABLE IF EXISTS `g_font`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `g_font` (
`idx` int(20) NOT NULL AUTO_INCREMENT,
`user_idx` int(15) NOT NULL,
`asia` varchar(50) DEFAULT NULL,
`a_gian_num` varchar(30) DEFAULT NULL,
`a_duration` varchar(30) DEFAULT NULL,
`mukhyang` varchar(50) DEFAULT NULL,
`m_gian_num` varchar(30) DEFAULT NULL,
`m_duration` varchar(30) DEFAULT NULL,
`remarks` varchar(50) DEFAULT NULL,
PRIMARY KEY (`idx`)
) ENGINE=MyISAM AUTO_INCREMENT=72 DEFAULT CHARSET=utf8 COMMENT='전산_font';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `g_font`
--
LOCK TABLES `g_font` WRITE;
/*!40000 ALTER TABLE `g_font` DISABLE KEYS */;
INSERT INTO `g_font` VALUES (71,56,'아시아폰트 TTF 통합패키지 398\r\nWTP01-C3C0-3N7ZLL','영업지원-201602-05','영구','','','',NULL),(67,21,'아시아폰트','영업지원-201602-05','영구','','','',NULL),(69,70,'아시아폰트 TTF 통합패키지 398\r\nWTP01-D3C0-VTVZWR','영업지원-201602-05','영구','','','',NULL),(70,55,'아시아폰트 TTF 통합패키지 398\r\nWTP01-F3C0-1CCZW5','영업지원-201602-05','영구','묵향4\r\n2734-0698-1834-6204','','영구',NULL);
/*!40000 ALTER TABLE `g_font` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `g_gs`
--
DROP TABLE IF EXISTS `g_gs`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `g_gs` (
`idx` int(15) NOT NULL AUTO_INCREMENT,
`user_name` varchar(20) DEFAULT NULL,
`user_email` varchar(25) DEFAULT NULL,
`user_group` varchar(25) DEFAULT NULL,
`user_grade` varchar(20) DEFAULT NULL,
`user_number` int(15) DEFAULT NULL,
`group_key` varchar(10) DEFAULT NULL,
PRIMARY KEY (`idx`)
) ENGINE=MyISAM AUTO_INCREMENT=71 DEFAULT CHARSET=utf8 COMMENT='경영지원본부';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `g_gs`
--
LOCK TABLES `g_gs` WRITE;
/*!40000 ALTER TABLE `g_gs` DISABLE KEYS */;
INSERT INTO `g_gs` VALUES (17,'박현숙','','경영지원본부','대리',7740,'gs'),(15,'황익주','','경영지원본부','부장',7788,'gs'),(16,'이승민','','경영지원본부 영업지원팀','차장',7777,'gs'),(9,'황승진','','경영지원팀','경영지원 본부장',7801,'gs'),(10,'곽수정','','경영지원팀','팀장',7822,'gs'),(11,'엄주철','','경영지원팀','과장',7880,'gs'),(12,'박수현','','경영지원팀','사원',7762,'gs'),(13,'이영우','','경영지원팀','사원',7763,'gs'),(14,'최영옥','','경영지원팀','사진매물',7758,'gs'),(18,'윤철진','','R&D사업팀','대리',7773,'gs'),(19,'장근식','','R&D사업팀','사원',7774,'gs'),(20,'홍바울','','R&D사업팀','사원',7778,'gs'),(21,'류정미','','R&D사업팀','대리',7888,'gs'),(22,'이영은(퇴사)','','R&D사업팀','사원',7887,'gs'),(23,'최은정','','R&D사업팀','사원',7779,'gs'),(24,'이순자','','영업1팀','부서장/팀장',7805,'ad1'),(25,'하미옥','','영업1팀','대리',7802,'ad1'),(26,'변길주','','영업1팀','사원',7882,'ad1'),(27,'김민','','영업1팀','사원',7834,'ad1'),(28,'송인규','','영업1팀','사원',7809,'ad1'),(29,'전창우','','영업1팀','사원',7810,'ad1'),(30,'김동회','','영업1팀','사원',7836,'ad1'),(31,'나효순','','영업2팀','팀장',7814,'ad1'),(32,'김병철','','영업2팀','사원',7804,'ad1'),(33,'박희금','','영업2팀','사원',7815,'ad1'),(34,'문현민','','영업2팀','사원',7811,'ad1'),(35,'박혜영','','영업2팀','사원',7816,'ad1'),(36,'김상열','','영업2팀','사원',7806,'ad1'),(38,'유은지','','영업부 지원','사원',7734,'ad1'),(39,'장현정','','영업부 지원','사원',7732,'ad1'),(40,'김성숙','','인바운드','부서장/팀장',7703,'ad2'),(41,'임성희','','인바운드','대리',7714,'ad2'),(42,'오상희','','인바운드','사원',7719,'ad2'),(43,'이계현','','인바운드','사원',7715,'ad2'),(44,'오연희','','인바운드','사원',7704,'ad2'),(45,'양지영','','인바운드','사원',7711,'ad2'),(46,'이민희','','인바운드','사원',7729,'ad2'),(47,'박미영','','인바운드','사원',7713,'ad2'),(48,'황미자','','인바운드','대리',7708,'ad2'),(49,'윤미영','','인바운드','과장',7707,'ad2'),(50,'김승숙','','인바운드','대리',7706,'ad2'),(51,'김진애','','리크루트팀','팀장',7807,'em_edit'),(52,'김은비','','리크루트팀','사원',7730,'em_edit'),(53,'이혜영','','리크루트팀','사원',7731,'em_edit'),(54,'민지희','','리크루트팀','사원',7709,'em_edit'),(55,'백승경','','편집','대리',7833,'em_edit'),(56,'김현영','','편집','사원',7781,'em_edit'),(57,'황주영','','편집','사원',7832,'em_edit'),(58,'장훈','','여행사업팀','팀장',7799,'tv'),(59,'유미라','','여행사업팀','사원',7747,'tv'),(60,'나경희','','여행사업팀','사원',7745,'tv'),(70,'송광헌','','디자인','실장',7776,'gs');
/*!40000 ALTER TABLE `g_gs` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `g_hangul`
--
DROP TABLE IF EXISTS `g_hangul`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `g_hangul` (
`idx` int(20) NOT NULL AUTO_INCREMENT,
`user_idx` int(15) NOT NULL,
`product_number` varchar(50) DEFAULT NULL,
`gian_num` varchar(30) DEFAULT NULL,
`duration` varchar(30) DEFAULT NULL,
PRIMARY KEY (`idx`)
) ENGINE=MyISAM AUTO_INCREMENT=79 DEFAULT CHARSET=utf8 COMMENT='전산_사용한글';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `g_hangul`
--
LOCK TABLES `g_hangul` WRITE;
/*!40000 ALTER TABLE `g_hangul` DISABLE KEYS */;
INSERT INTO `g_hangul` VALUES (6,9,'한글2010 SE+\r\n17011119-000768413','',''),(7,10,'한글2010 SE+\r\n17011119-000768413','',''),(8,11,'한글2010 SE+\r\n17011119-000768413','',''),(9,12,'한글2010 SE+\r\n17011271-239382089','',''),(10,13,'한글2010 SE+\r\n17011119-000768413','',''),(11,14,'한글2010 SE+\r\n17011119-000768413','',''),(12,15,'한글2010 SE+\r\n17011119-000768413','',''),(13,16,'한글2010 SE+\r\n17011119-000768413','',''),(14,17,'한글2010 SE+\r\n17011119-000768413','',''),(15,18,'한글2010 SE+\r\n17011119-000768413','',''),(16,19,'한글2010 SE+\r\n17011119-000768413','',''),(21,24,'한글2010 SE+\r\n17011119-000768413','',''),(22,25,'한글2010 SE+\r\n17011119-000768413','',''),(23,26,'한글2007\r\n16271119-000493224','',''),(24,27,'한글2010 SE+\r\n17011119-000768413','',''),(25,28,'한글2007\r\n16271119-000493224','',''),(26,29,'한글2007\r\n16271119-000493224','',''),(27,30,'한글2007\r\n16271119-000493224','',''),(28,31,'한글2010 SE+\r\n17011119-000768413','',''),(29,32,'한글2007\r\n16271119-000493224','',''),(30,33,'한글2007\r\n16271119-000493224','',''),(31,34,'한글2007\r\n16271119-000493224','',''),(32,35,'한글2007\r\n16271119-000493224','',''),(33,36,'한글2007\r\n16271211-063048230','',''),(35,38,'한글2010 SE+\r\n17011119-000768413','',''),(36,39,'한글2010 SE+\r\n17011119-000768413','',''),(37,40,'한글2007\r\n16271119-000493224','',''),(38,41,'한글2010 SE+\r\n17011119-000768413','',''),(39,42,'한글2010 SE+\r\n17011119-000768413','',''),(40,43,'한글2010 SE+\r\n17011119-000768413','',''),(41,44,'한글2010 SE+\r\n17011119-000768413','',''),(42,45,'한글2010 SE+\r\n17011119-000768413','',''),(43,46,'한글2010 SE+\r\n17011119-000768413','',''),(69,9,'한글2010 SE+\r\n17011119-000768413','',''),(45,48,'한글2010 SE+\r\n17011119-000768413','',''),(46,49,'한글2010 SE+\r\n17011119-000768413','',''),(47,50,'한글2010 SE+\r\n17011119-000768413','',''),(48,51,'한글2010 SE+\r\n17011119-000768413','',''),(49,52,'한글2010 SE+\r\n17011119-000768413','',''),(50,53,'한글2010 SE+\r\n17011119-000768413','',''),(51,54,'한글2010 SE+\r\n17011119-000768413','',''),(76,56,'한글2010 SE+\r\n17011119-000768413','',''),(55,58,'한글2010 SE+\r\n17011119-000768413','',''),(56,59,'한글2010 SE+\r\n17011119-000663086','',''),(67,24,'한글2007\r\n16271119-000493224','',''),(68,47,'한글2010 SE+\r\n17011119-000768413','',''),(70,21,'한글2010 SE+\r\n17011119-000768413','',''),(71,22,'한글2010 SE+\r\n17011119-000768413','',''),(78,20,'한글2010 SE+\r\n17011119-000768413','',''),(73,70,'한글2010 SE+\r\n17011119-000663086','',''),(74,55,'한글2010 SE+\r\n17011119-000768413','',''),(75,55,'한글2010 SE+\r\n17011119-000663086','',''),(77,56,'한글2010 SE+\r\n17011119-000663086','','');
/*!40000 ALTER TABLE `g_hangul` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `g_headset`
--
DROP TABLE IF EXISTS `g_headset`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `g_headset` (
`idx` int(20) NOT NULL AUTO_INCREMENT,
`user_idx` int(15) NOT NULL,
`product_name` varchar(50) DEFAULT NULL,
`identify` varchar(50) DEFAULT NULL,
`produce_ym` varchar(50) DEFAULT NULL,
`gian_num` varchar(30) DEFAULT NULL,
`buy_day` varchar(30) DEFAULT NULL,
PRIMARY KEY (`idx`)
) ENGINE=MyISAM AUTO_INCREMENT=70 DEFAULT CHARSET=utf8 COMMENT='전산_헤드셋';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `g_headset`
--
LOCK TABLES `g_headset` WRITE;
/*!40000 ALTER TABLE `g_headset` DISABLE KEYS */;
INSERT INTO `g_headset` VALUES (37,40,'Jabra GN2110','','','영업지원-201602-04','2016.03.03'),(38,41,'Jabra GN2110','','','영업지원-201602-04','2016.03.03'),(39,42,'Jabra GN2110','','','영업지원-201602-04','2016.03.03'),(40,43,'Jabra GN2110','','','영업지원-201602-04','2016.03.03'),(41,44,'Jabra GN2110','','','영업지원-201602-04','2016.03.03'),(42,45,'Jabra GN2110','','','영업지원-201602-04','2016.03.03'),(43,46,'Jabra GN2110','','','영업지원-201602-04','2016.03.03'),(44,47,'Jabra GN2110','','','영업지원-201602-04','2016.03.03'),(45,48,'Jabra GN2110','','','영업지원-201602-04','2016.03.03'),(46,49,'Jabra GN2110','','','영업지원-201602-04','2016.03.03'),(47,50,'Jabra GN2110','','','영업지원-201602-04','2016.03.03');
/*!40000 ALTER TABLE `g_headset` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `g_keyboard`
--
DROP TABLE IF EXISTS `g_keyboard`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `g_keyboard` (
`idx` int(20) NOT NULL AUTO_INCREMENT,
`user_idx` int(15) NOT NULL,
`product_name` varchar(50) DEFAULT NULL,
`identify` varchar(50) DEFAULT NULL,
`produce_ym` varchar(50) DEFAULT NULL,
`gian_num` varchar(30) DEFAULT NULL,
`buy_day` varchar(30) DEFAULT NULL,
PRIMARY KEY (`idx`)
) ENGINE=MyISAM AUTO_INCREMENT=76 DEFAULT CHARSET=utf8 COMMENT='전산_키보드';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `g_keyboard`
--
LOCK TABLES `g_keyboard` WRITE;
/*!40000 ALTER TABLE `g_keyboard` DISABLE KEYS */;
INSERT INTO `g_keyboard` VALUES (1,4,'SKP-800B','MSIP-REI-SNJ-SKP-800B1','2015.11','영업지원-201601-03','2016.02.15'),(16,19,'SKG-3000UB','SNJ-SKG-3000UB(B)','2012.04','',''),(69,40,'SKP-800B','MSIP-REI-SNJ-SKP-800B1','2016년6월','','2016년10월'),(70,21,'SKP-800B','MSIP-REI-SNJ-SKP-800B1','2016.01','영업지원-201604-05','2016.04.25'),(75,20,'SKP-800B','MSIP-REI-SNJ-SKP-800B1','2016.01','영업지원-201604-04','2016.04.08'),(72,70,'SKP-800B','MSIP-REI-SNJ-SKP-800B1','2015.11','영업지원-201601-03','2016.02.15'),(73,55,'SKP-800B','MSIP-REI-SNJ-SKP-800B1','2015.11','영업지원-201601-03','2016.02.15'),(74,56,'SKP-800B','MSIP-REI-SNJ-SKP-800B1','2015.11','영업지원-201601-03','2016.02.15');
/*!40000 ALTER TABLE `g_keyboard` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `g_moniter`
--
DROP TABLE IF EXISTS `g_moniter`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `g_moniter` (
`idx` int(20) NOT NULL AUTO_INCREMENT,
`user_idx` int(15) NOT NULL,
`company` varchar(50) DEFAULT NULL,
`product_name` varchar(50) DEFAULT NULL,
`model_code` varchar(50) DEFAULT NULL,
`model_name` varchar(50) DEFAULT NULL,
`identify` varchar(50) DEFAULT NULL,
`produce_ym` varchar(50) DEFAULT NULL,
`soft_num` varchar(50) DEFAULT NULL,
`gian_num` varchar(50) DEFAULT NULL,
`buy_day` varchar(50) DEFAULT NULL,
PRIMARY KEY (`idx`)
) ENGINE=MyISAM AUTO_INCREMENT=108 DEFAULT CHARSET=utf8 COMMENT='전산_모니터';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `g_moniter`
--
LOCK TABLES `g_moniter` WRITE;
/*!40000 ALTER TABLE `g_moniter` DISABLE KEYS */;
INSERT INTO `g_moniter` VALUES (1,1,'삼성전자(주)','삼성모니터','DSKVJRJNVNRI','S-M-12038','SJFK3NMV83973','2011.09','LSFN39842082N','AS2023','2014.12'),(5,4,'삼성전자(주)','본체','모델코드','모델명','식별부호','2010.12','1235481263','A54','2015.05'),(10,9,'삼성전자㈜','S24D340H','LS24D340HSA/CR','LS24D340','MSIP-REM-SEC-LS24D300','2015.01','0KW4HTMG102546M','',''),(11,10,'삼성전자㈜','CX2243BW','CX2243BWEQAKOR','MY22WS','SEC-MY22WS(B)','2009.02','N943HMAS200250K','',''),(12,11,'삼성전자㈜','EX2020X','LC-EX2020SF/KR','CB20WS','SEC-CB20WS(B)','2012.06','V8C1H4LC601798P','',''),(13,12,'삼성전자㈜','S20B300B','LS20B300BSC/CR','LS20B300','KCC-REM-SEC-LS20B300','2012.03','ZUF3HTLC304447E','',''),(14,13,'삼성전자㈜','EX2020X','LC-EX2020SF/KR','CB20WS','SEC-CB20WS(B)','2012.06','V8C1H4LC601811B','',''),(15,14,'삼성전자㈜','CX743B','CX743B-EQA/KOR','MY17PS','SEC-MY17PS(B)','2008.09','N940HVCQ912787R','',''),(16,15,'삼성전자㈜','EX2020X','LC-EX2020SF/KR','CB20WS','SEC-CB20WS(B)','2011.06','V8C1H9NB602239L','',''),(17,16,'삼성전자㈜','CX2243BW','CX2243BWEQAKOR','MY22WS','SEC-MY22WS(B)','2009.02','N943HMAS200046V','',''),(19,18,'삼성전자㈜','S27E310H','LS27E310HSE/CR','LS27E310','MSIP-REM-SEC-LS27E310','2015.10','ZZE8H4ZGA01557K','영업지원-201601-03',''),(20,19,'삼성전자㈜','S24D340H','LS24D340HSA/CR','LS24D340','MSIP-REM-SEC-LS24D300','2016.01','ZZCKH4ZH101089H','','2016.02.15'),(21,20,'삼성전자㈜','S24D340H','LS24D340HSA/CR','LS24D340','MSIP-REM-SEC-LS24D300','2016.02','ZZCKH4LH200179A','','2016.5.25'),(23,22,'삼성전자㈜','S27E310H','LS27E310HSE/CR','LS27E310','MSIP-REM-SEC-LS27E310','2015.10월','ZZE8H4ZGA03068J','영업지원-201601-03','2016.02.15'),(104,70,'삼성전자㈜','S24D340H','LS24D340HSA/CR','LS24D340','MSIP-REM-SEC-LS24D300','2016.02','ZZCKH4ZH201150Z','영업지원-201604-04','2016.04.08'),(25,24,'삼성전자㈜','EX2020X','LC-EX2020SF/KR','CB20WS','SEC-CB20WS(B)','2011.06','V8C1H9NB602242X','',''),(26,25,'삼성전자㈜','EX2020X','LC-EX2020SF/KR','CB20WS','SEC-CB20WS(B)','2011.06','V8C1H9NB602244E','',''),(27,26,'삼성전자㈜','EX2020X','LC-EX2020SF/KR','CB20WS','SEC-CB20WS(B)','2011.06','V8C1H9NB602540W','',''),(28,27,'삼성전자㈜','EX2020X','LC-EX2020SF/KR','CB20WS','SEC-CB20WS(B)','2011.06','V8C1H9NB602566W','',''),(29,28,'삼성전자㈜','EX2020X','LC-EX2020SF/KR','CB20WS','SEC-CB20WS(B)','2011.06','V8C1H9NB602562R','',''),(30,29,'삼성전자㈜','EX2020X','LC-EX2020SF/KR','CB20WS','SEC-CB20WS(B)','2011.06','V8C1H9NB602541V','',''),(31,30,'삼성전자㈜','EX2020X','LC-EX2020SF/KR','CB20WS','SEC-CB20WS(B)','2012.06','V8C1H4LC601807E','',''),(32,31,'삼성전자㈜','EX2020X','LC-EX2020SF/KR','CB20WS','SEC-CB20WS(B)','2011.06','V8C1H9NB602563H','',''),(33,32,'삼성전자㈜','EX2020X','LC-EX2020SF/KR','CB20WS','SEC-CB20WS(B)','2011.06','V8C1H9NB602245F','',''),(34,33,'삼성전자㈜','EX2020X','LC-EX2020SF/KR','CB20WS','SEC-CB20WS(B)','2011.06','V8C1H9NB602567V','',''),(35,34,'삼성전자㈜','EX2020X','LC-EX2020SF/KR','CB20WS','SEC-CB20WS(B)','2011.11','V8C1H9NBB00499Y','',''),(36,35,'삼성전자㈜','EX2020X','LC-EX2020SF/KR','CB20WS','SEC-CB20WS(B)','2011.06','V8C1H9NB602561F','',''),(37,36,'삼성전자㈜','CX2243BW','CX2243BWEQAKOR','MY22WS','SEC-MY22WS(B)','2009.02','N943HMAS200231N','',''),(39,38,'삼성전자㈜','S20B300B','LS20B300BSC/CR','LS20B300','KCC-REM-SEC-LS20B300','2012.04','ZUF3HTLC400198J','',''),(40,39,'삼성전자㈜','S20B300B','LS20B300BSC/CR','LS20B300','KCC-REM-SEC-LS20B300','2012.04','ZUF3HTLC400543R','',''),(41,40,'삼성전자㈜','CX2243BW','CX2243BWEQAKOR','MY22WS','SEC-MY22WS(B)','2009.02','N943HMAS200434N','',''),(42,41,'삼성전자㈜','EX2020X','LC-EX2020SF/KR','CB20WS','SEC-CB20WS(B)','2012.06','V8C1H4LC601752R','',''),(43,42,'삼성전자㈜','EX2020X','LC-EX2020SF/KR','CB20WS','SEC-CB20WS(B)','2012.06','V8C1H4LC601789E','',''),(44,43,'삼성전자㈜','EX2020X','LC-EX2020SF/KR','CB20WS','SEC-CB20WS(B)','2011.06','V8C1H9NB602564J','',''),(45,44,'삼성전자㈜','EX2020X','LC-EX2020SF/KR','CB20WS','SEC-CB20WS(B)','2012.06','V8C1H4LC601788N','',''),(46,45,'삼성전자㈜','EX2020X','LC-EX2020SF/KR','CB20WS','SEC-CB20WS(B)','2012.06','V8C1H4LC601750E','',''),(47,46,'삼성전자㈜','EX2020X','LC-EX2020SF/KR','CB20WS','SEC-CB20WS(B)','2012.06','V8C1H4LC601812K','',''),(48,47,'삼성전자㈜','EX2020X','LC-EX2020SF/KR','CB20WS','SEC-CB20WS(B)','2012.06','V8C1H4LC601851X','',''),(49,48,'삼성전자㈜','EX2020X','LC-EX2020SF/KR','CB20WS','SEC-CB20WS(B)','2011.06','V8C1H9NB602240P','',''),(50,49,'삼성전자㈜','EX2020X','LC-EX2020SF/KR','CB20WS','SEC-CB20WS(B)','2012.06','V8C1H4LC601786D','',''),(51,50,'삼성전자㈜','EX2020X','LC-EX2020SF/KR','CB20WS','SEC-CB20WS(B)','2012.06','V8C1H4LC601800Z','',''),(52,51,'삼성전자㈜','EX2020X','LC-EX2020SF/KR','CB20WS','SEC-CB20WS(B)','2012.06','V8C1H4LC600822K','',''),(53,52,'삼성전자㈜','EX2020X','LC-EX2020SF/KR','CB20WS','SEC-CB20WS(B)','2011.06','V8C1H9NB602246R','',''),(54,53,'삼성전자㈜','EX2020X','LC-EX2020SF/KR','CB20WS','SEC-CB20WS(B)','2012.06','V8C1H4LC601946H','',''),(55,54,'삼성전자㈜','EX2020X','LC-EX2020SF/KR','CB20WS','SEC-CB20WS(B)','2012.06','V8C1H4LC601441Y','',''),(56,55,'삼성전자㈜','S24D340H','LS24D340HSA/CR','LS24D340','MSIP-REM-SEC-LS24D300','2015.02','0KW4HTMG205294Z','',''),(57,56,'삼성전자㈜','S24D340H','LS24D340HSA/CR','LS24D340','MSIP-REM-SEC-LS24D300','2016.02','ZZCKH4ZH200629V','',''),(59,58,'','','','','LGE-DMLGA51 (B)','2011.12','112QCBD558189','',''),(60,59,'삼성전자㈜','EX2020X','LC-EX2020SF/KR','CB20WS','SEC-CB20WS(B)','2011.06','V8C1H9NB602241D','',''),(107,21,'삼성전자㈜','S24D340H','LS24D340HSA/CR','LS24D340','MSIP-REM-SEC-LS24D300','2015.02','0KW4HTMG205477E','',''),(100,10,'삼성전자㈜','76B [R] D','76B-KS/KOR','GH17PS','E-B012-05-1445(B)','2007.02','N720HVFP206495N','',''),(106,20,'삼성전자㈜','S24D340H','LS24D340HSA/CR','LS24D340','MSIP-REM-SEC-LS24D300','2016.02','ZZCKH4LH200018B','','2016.5.25'),(99,17,'삼성전자㈜','EX2020X','LC-EX2020SF/KR','CB20WS','SEC-CB20WS(B)','2012.06','V8C1H4LC601787X','',''),(101,12,'삼성전자㈜','CX702B','CX702B-TS4/KOR','GH17PS','E-B012-05-1445(B)','2007.12','N787HVGPC20210W','',''),(102,18,'삼성전자㈜','CX2243BW','CX2243BWEAKOR','MY22WS','SEC-MY22WS(B)','2009.02','N943HMAS200249J','',''),(103,19,'삼성전자㈜','S24D340H','LS24D340HSA/CR','LS24D340','MSIP-REM-SEC-LS24D300','2015.02','0KW4HTMG205274V','',''),(105,55,'삼성전자㈜','76B [R] D','76B-KS/KOR','GH17PS','E-B012-05-1445(B)','2007.02','N720HVFP206491A','','');
/*!40000 ALTER TABLE `g_moniter` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `g_mouse`
--
DROP TABLE IF EXISTS `g_mouse`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `g_mouse` (
`idx` int(20) NOT NULL AUTO_INCREMENT,
`user_idx` int(15) NOT NULL,
`product_name` varchar(50) DEFAULT NULL,
`identify` varchar(50) DEFAULT NULL,
`produce_ym` varchar(50) DEFAULT NULL,
`gian_num` varchar(30) DEFAULT NULL,
`buy_day` varchar(30) DEFAULT NULL,
PRIMARY KEY (`idx`)
) ENGINE=MyISAM AUTO_INCREMENT=75 DEFAULT CHARSET=utf8 COMMENT='전산_키보드';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `g_mouse`
--
LOCK TABLES `g_mouse` WRITE;
/*!40000 ALTER TABLE `g_mouse` DISABLE KEYS */;
INSERT INTO `g_mouse` VALUES (15,18,'SKP-800B','MSIP-REI-SNJ-SKP-800B2','2015.11','영업지원-201601-03','2016.02.15'),(24,27,'SKP-800B','MSIP-REI-SNJ-SKP-800B2','2016.01','영업지원-201604-05','2016.04.25'),(27,30,'SKP-800B','MSIP-REI-SNJ-SKP-800B2','2015.11','영업지원-201601-03','2016.02.15'),(33,36,'SKP-800B','MSIP-REI-SNJ-SKP-800B2','2016.01','영업지원-201604-05','2016.04.25'),(51,54,'SKP-800B','MSIP-REI-SNJ-SKP-800B2','2015.11','영업지원-201601-03','2016.02.15'),(69,46,'SKP-800B','MSIP-REI-SNJ-SKP-800B2','2016년6월','','2016년10월'),(70,40,'SKP-800B','MSIP-REI-SNJ-SKP-800B2','2016년6월','','2016년10월'),(74,20,'SKP-800B','MSIP-REI-SNJ-SKP-800B2','2016.01','영업지원-201604-04','2016.04.08'),(72,70,'SKP-800B','MSIP-REI-SNJ-SKP-800B2','2015.11','영업지원-201601-03','2016.02.15'),(73,56,'SKP-800B','MSIP-REI-SNJ-SKP-800B2','2015.11','영업지원-201601-03','2016.02.15');
/*!40000 ALTER TABLE `g_mouse` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `g_ms`
--
DROP TABLE IF EXISTS `g_ms`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `g_ms` (
`idx` int(20) NOT NULL AUTO_INCREMENT,
`user_idx` int(15) NOT NULL,
`product_number` varchar(100) DEFAULT NULL,
`gian_num` varchar(30) DEFAULT NULL,
`duration` varchar(30) DEFAULT NULL,
PRIMARY KEY (`idx`)
) ENGINE=MyISAM AUTO_INCREMENT=79 DEFAULT CHARSET=utf8 COMMENT='전산_사용msoffice';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `g_ms`
--
LOCK TABLES `g_ms` WRITE;
/*!40000 ALTER TABLE `g_ms` DISABLE KEYS */;
INSERT INTO `g_ms` VALUES (6,9,'MS-Office 2007\r\nJM9VP-83KWM-WP846-CMH64-8VJ7W','',''),(7,10,'MS-Office 2007\r\nJM9VP-83KWM-WP846-CMH64-8VJ7W','',''),(8,11,'MS-Office 2007\r\nB3VCK-YXC3B-9YF3T-4B3QP-WWTBY','',''),(9,12,'MS-Office 2007\r\nJM9VP-83KWM-WP846-CMH64-8VJ7W','',''),(10,13,'MS-Office 2007\r\nJM9VP-83KWM-WP846-CMH64-8VJ7W','',''),(11,14,'MS-Office 2007\r\nJM9VP-83KWM-WP846-CMH64-8VJ7W','',''),(12,15,'MS-Office 2007\r\nJM9VP-83KWM-WP846-CMH64-8VJ7W','',''),(13,16,'MS-Office 2007\r\nJM9VP-83KWM-WP846-CMH64-8VJ7W','',''),(15,18,'MS-Office Standard 2010\r\nHRCYV-TMKFB-CFK8P-V7QDQ-G','',''),(16,19,'MS-Office Standard 2010\r\nHRCYV-TMKFB-CFK8P-V7QDQ-G','',''),(21,24,'MS-Office 2007\r\nJM9VP-83KWM-WP846-CMH64-8VJ7W','',''),(22,25,'MS-Office 2007\r\nM86WF-FFKQ3-Y963M-WXR2H-TJ4FQ','',''),(23,26,'MS-Office 2007\r\nJRD38-PYV8B-YKD4T-JWP9P-CTV4Q','',''),(24,27,'MS-Office 2007\r\nVRF6F-P8P77-3GX3B-6FPMC-D9DJB','',''),(25,28,'MS-Office 2007\r\nGRC7V-969V3-R99YJ-JVT7Y-B7RFQ','',''),(26,29,'MS-Office 2007\r\nPWQ9Y-GWFVH-C2M2F-FJXHQ-VJCM3','',''),(27,30,'MS-Office 2007\r\nBYCVJ-BWJP8-JYFFW-CJJVX-WPKWD','',''),(28,31,'MS-Office 2007\r\nJM9VP-83KWM-WP846-CMH64-8VJ7W','',''),(29,32,'MS-Office 2007\r\nW2DYV-Y3RTH-7G67P-CJ3GJ-CM68D','',''),(30,33,'MS-Office 2007\r\nCMPKQ-GFT7M-WFGM6-XBFXV-WDTB3','',''),(31,34,'MS-Office 2007\r\nDGRCH-M6PPT-6VX3M-9DGKD-9T2M3','',''),(32,35,'MS-Office 2007\r\nFQDJF-G2TFF-W2W2V-38427-GY676','',''),(33,36,'MS-Office 2007\r\nRCD7Y-RFP8V-77RFH-MT3YJ-QG68D','',''),(35,38,'MS-Office 2007\r\nQYMFV-T433H-T8KTB-B93JG-C6QJD','',''),(36,39,'MS-Office 2007\r\nM6XKC-M7TWW-BG82J-D79PX-H9H4Q','',''),(37,40,'MS-Office 2007\r\nJM9VP-83KWM-WP846-CMH64-8VJ7W','',''),(38,41,'MS-Office 2007\r\nJM9VP-83KWM-WP846-CMH64-8VJ7W','',''),(39,42,'MS-Office 2007\r\nJM9VP-83KWM-WP846-CMH64-8VJ7W','',''),(40,43,'MS-Office 2007\r\nJM9VP-83KWM-WP846-CMH64-8VJ7W','',''),(41,44,'MS-Office 2007\r\nJM9VP-83KWM-WP846-CMH64-8VJ7W','',''),(42,45,'MS-Office 2007\r\nJM9VP-83KWM-WP846-CMH64-8VJ7W','',''),(43,46,'MS-Office 2007\r\nJM9VP-83KWM-WP846-CMH64-8VJ7W','',''),(44,47,'MS-Office 2007\r\nJM9VP-83KWM-WP846-CMH64-8VJ7W','',''),(45,48,'MS-Office 2007\r\nJM9VP-83KWM-WP846-CMH64-8VJ7W','',''),(46,49,'MS-Office 2007\r\nJM9VP-83KWM-WP846-CMH64-8VJ7W','',''),(47,50,'MS-Office 2007\r\nJM9VP-83KWM-WP846-CMH64-8VJ7W','',''),(48,51,'MS-Office 2007\r\nJCHDV-PD33J-32G64-P83DP-2774Q','',''),(49,52,'MS-Office 2007\r\nQGW7Y-KQHWR-G7CG3-K7YJ9-T2BRQ','',''),(50,53,'MS-Office 2007\r\nDX79C-FRBMY-88J86-P77HT-RYQJD','',''),(51,54,'MS-Office 2007\r\nMFQQM-D8KRW-QMY4D-YCMBJ-TTQJD','',''),(76,56,'MS-Office 2007\r\nW8B73-FMYCF-DHFKQ-3KM3G-GTV4Q','',''),(55,58,'MS-Office 2007\r\nD7PCX-MVJRH-7RR2B-X43W4-Y7WYY','',''),(56,59,'MS-Office 2007\r\nBDJWG-C9RPW-7QCVY-DD87T-V9H4M','',''),(67,24,'MS-Office 2007\r\nJM9VP-83KWM-WP846-CMH64-8VJ7W','',''),(68,17,'MS-Office 2007\r\nJM9VP-83KWM-WP846-CMH64-8VJ7W','',''),(69,9,'MS-Office Standard 2010\r\nV7QKV-4XVVR-XYV4D-F7DFM-8','',''),(70,21,'MS-Office 2007\r\nPVK96-M387P-RGGYB-HX9XF-6JTB3','',''),(71,22,'MS-Office 2007\r\nJM9VP-83KWM-WP846-CMH64-8VJ7W','',''),(78,20,'MS-Office Standard 2010\r\nHRCYV-TMKFB-CFK8P-V7QDQ-G','',''),(73,70,'MS-Office Standard 2010\r\nHRCYV-TMKFB-CFK8P-V7QDQ-G','',''),(74,55,'MS-Office 2007\r\nM2G3Y-BHJQ7-26H2J-HF6TY-W34FQ','',''),(75,55,'MS-Office Standard 2010\r\nHRCYV-TMKFB-CFK8P-V7QDQ-G','',''),(77,56,'MS-Office Standard 2010\r\nHRCYV-TMKFB-CFK8P-V7QDQ-G','','');
/*!40000 ALTER TABLE `g_ms` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `g_pc`
--
DROP TABLE IF EXISTS `g_pc`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `g_pc` (
`idx` int(20) NOT NULL AUTO_INCREMENT,
`user_idx` int(15) NOT NULL,
`company` varchar(50) DEFAULT NULL,
`model_name` varchar(50) DEFAULT NULL,
`model_code` varchar(50) DEFAULT NULL,
`produce_number` varchar(50) DEFAULT NULL,
`product_code` varchar(50) DEFAULT NULL,
`identify` varchar(50) DEFAULT NULL,
`produce_ym` varchar(50) DEFAULT NULL,
`g_cpu` varchar(30) DEFAULT NULL,
`g_ram` varchar(30) DEFAULT NULL,
`g_hdd_c` varchar(30) DEFAULT NULL,
`g_hdd_d` varchar(30) DEFAULT NULL,
`g_graphic` varchar(30) DEFAULT NULL,
`gian_num` varchar(30) DEFAULT NULL,
`buy_day` varchar(30) DEFAULT NULL,
PRIMARY KEY (`idx`)
) ENGINE=MyISAM AUTO_INCREMENT=89 DEFAULT CHARSET=utf8 COMMENT='전산_본체';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `g_pc`
--
LOCK TABLES `g_pc` WRITE;
/*!40000 ALTER TABLE `g_pc` DISABLE KEYS */;
INSERT INTO `g_pc` VALUES (1,4,'삼성전자(주)','슈퍼PC','FMVNJVKXCJK3','DSFJSKLFN34433','324243','3943204-FDSFSDJFL3','2012.04','i7','16GB','1TB','i7','Geforce','B-3231','2016.01'),(6,9,'삼성전자㈜','DB-P400','DB-P400-PA5E4S','HQ0D98DC4B001TX','BA68-04680B Rev 5.0','KCC-REM-SEC-DM-C610','2012.04','[인텔] i5-2500 3.30GHz','4GB','HDD 404GB','HDD 514GB','지포스 GT 530','',''),(7,10,'삼성전자㈜','DB-P400','DB-P400-PA512S','HQ0E98CC5A0019N','BA68-04680B Rev 5.0','KCC-REM-SEC-DM-C610','2012.05','[인텔] i5-2400 3.10GHz','4GB','HDD 181GB','HDD 271GB','지포스 GT 630','',''),(8,11,'삼성전자㈜','DB400T2A','DB400T2A-C216S','JBZT98CF5A0003R','BA68-07985A Rev 4.0','KCC-REM-SEC-DB400T2A','2014.05','[인텔] Pentium G2120 3.10GHz','4GB','HDD 181GB','HDD 271GB','','',''),(9,12,'삼성전자㈜','DM700T2A','DM700T2A-ASC7','HNMH9NEBC00110P','BA68-07131A Rev 5.0','KCC-REM-SEC-DM00T2A','2011.12','[인텔] 코어 i5-3570 3.40GHz','4GB','HDD 442GB','HDD 488GB','지포스 GT 630','',''),(10,13,'삼성전자㈜','DB400T3A','DB400T3A-A204S','JMLD98CFAA0003R','BA68-07985A Rev 4.0','MSIP-RMM-SEC-DB400T3A','2014.10','[인텔] Pentium G3440 3.30GHz','4GB','HDD 228GB','HDD 224GB','','',''),(11,14,'삼성전자㈜','DB-P400','DB-P400-PC312S','HQ0J98CC7A0037J','BA68-07985A Rev 3.0','KCC-REM-SEC-DM-C610','2012년 7월','[인텔] 코어 i3-2120 3.3GHz','4GB','HDD 181GB','HDD 271GB','','',''),(12,15,'삼성전자㈜','DM-V190','DM-V190-PA11','ZNJ59WAZ600613R','BA68-04084B Rev 3.0','SEC-DM-C200 (B)','2010년 6월','Pentium Dual-Core E5400 2.70GH','2GB','HDD 113GB','HDD 168GB','','',''),(13,16,'삼성전자㈜','DB-P400','DB-P400-PA5E4S','HQ0D98DC4B001CR','BA68-04680B Rev 5.0','KCC-REM-SEC-DM-C610','2012.04','[인텔]코어i5-2500 3.3GHZ','8GB','HDD 367GB','HDD 551GB','지포스 GT 620','',''),(14,17,'삼성전자㈜','DB-P400','DB-P400-PC312S','HQ0J98CC7A0023H','BA68-07985A Rev 3.0','KCC-REM-SEC-DM-C610','2012년 7월','[인텔] 코어 i3-2120 3.3GHz','4GB','HDD 181GB','HDD 271GB','','',''),(15,18,'','','','','','','','[인텔]코어i7-6세대 6700(스카이레이크) 3.4G','32GB','SSD 256GB','HDD 2TB','지포스 GTX960','영업지원-201604-04','2016.04.08'),(16,19,'','','','','','','','[인텔]코어i7-6세대 6700(스카이레이크) 3.4G','32GB','SSD 256GB','HDD 2TB','지포스 GTX960','',''),(17,20,'','','','','','','','[인텔]코어i7-6세대 6700(스카이레이크) 3.4G','32GB','SSD 256GB','HDD 2TB','지포스 GTX960','',''),(19,22,'삼성전자㈜','DB400T2A','DB-400T2A-A5E9S','J9Y298CCBA0008F','BA68-07985A Rev 3.0','KCC-REM-SEC-DB400T2A','2012년 11월','[인텔]i5-3330 3.0GHz','4GB','HDD 195GB','HDD 257GB','','',''),(78,23,'','','','','','','','','','','','','',''),(21,24,'삼성전자㈜','DB-P400','DB-P400-PC312S','HQ0J98CC7A003BL','BA68-07985A Rev 3.0','KCC-REM-SEC-DM-C610','2012년 7월','[인텔] 코어 i3-2120 3.3GHz','4GB','HDD 181GB','HDD 271GB','','',''),(22,25,'삼성전자㈜','DB400T2A','DB400T2A-C216S','JBZT98CF5A0006J','BA68-07985A Rev 4.0','KCC-REM-SEC-DB400T2A','2014년 5월','[인텔] Pentium G2120 3.1GHz','4GB','HDD 181GB','HDD 271GB','','',''),(23,26,'삼성전자㈜','DB400T2A','DB400T2A-C216S','JBZT98CF5A0004T','BA68-07985A Rev 4.0','KCC-REM-SEC-DB400T2A','2014년 5월','[인텔] Pentium G2120 3.1GHz','4GB','HDD 181GB','HDD 271GB','','',''),(24,27,'삼성전자㈜','DB400T3A','DB400T3A-A304S','JMLG98CG3B0010V','BA68-07985A Rev 4.0','MSIP-REM-SEC-DB400T3A','2015년 3월','[인텔] 코어 i3-4150 3.50GHz','4GB','HDD 209GB','HDD 235GB','지포스 GT610','',''),(25,28,'삼성전자㈜','DB-P100','DB-P100-AA02JC','Z9UY97AS300002Z','BA68-04680A Rev 1.0','','2009년 3월','[인텔] Core2 Quad CPU Q8200 2.33','4GB','HDD 119GB','','','',''),(26,29,'삼성전자㈜','DB-P400','DB-P400-PC312S','HQ0J98CC7A0035R','BA68-07985A Rev 3.0','KCC-REM-SEC-DM-C610','2012년 7월','[인텔] 코어i3-2120 3.30GHz','4GB','HDD181GB','HDD 271GB','','',''),(27,30,'삼성전자㈜','DB-P400','DB-P400-PA5E4S','HQ0D98DC4B1500A','','KCC-REM-SEC-DM-C610','2012년 4월','[인텔] 코어i5-2500 3.30GHz','4GB','HDD 367GB','HDD 551GB','지포스 GT 530','',''),(28,31,'삼성전자㈜','DB-P100','DB-P100-AA02JC','Z9UY97AS300010V','BA68-04680A Rev 1.0','','2009년 3월','[인텔] 코어2 Quad 2.33GHz','4GB','HDD 119GB','','지포스 GT 430','',''),(29,32,'삼성전자㈜','DB-P100','DB-P100-AA02JC','Z9UY97AS300006D','BA68-04680A Rev 1.0','','2009년 3월','[인텔] Core2 Quad CPU Q8200 2.33','4GB','HDD 119GB','','','',''),(30,33,'삼성전자㈜','DB-P100','DB-P100-AA02JC','Z9UY97AS300007X','BA68-04680A Rev 1.0','','2009년 3월','[인텔] 코어2 Quad 2.33GHz','4GB','HDD 119GB','지포스 GT 430','','',''),(31,34,'삼성전자㈜','DB-P100','DB-P100-AA02JC','Z9UY97AS300009E','','','2009년 3월','[인텔] 코어2 Quad 2.33GHz','4GB','HDD 119GB','','지포스 GT 520','',''),(32,35,'삼성전자㈜','DB400T2A','DB400T2A-C216S','JBZT98CF5A0008N','BA68-07985A Rev 4.0','KCC-REM-SEC-DB400T2A','2014년 5월','[인텔] Pentium G2120 3.1GHz','4GB','HDD 181GB','HDD 271GB','','',''),(33,36,'삼성전자㈜','DB400T3A','DB400T3A-A204S','JMLD98CFAA000EJ','BA68-07985A Rev 4.0','MSIP-RMM-SEC-DB400T3A','2014년 10월','[인텔] Pentium G3440 3.3GHz','4GB','HDD 228GB','HDD 224GB','','',''),(35,38,'삼성전자㈜','DB-P400','DB-P400-PA512S','HQ0E98CC5A000KZ','BA68-04680B Rev 5.0','KCC-REM-SEC-DM-C610','2012년 5월','[인텔] 코어 i5-2400 3.10GHz','4GB','HDD 181GB','HDD 271GB','','',''),(36,39,'삼성전자㈜','DB-P400','DB-P400-PA512S','HQ0E98CC4A005XK','BA68-04680B Rev 5.0','KCC-REM-SEC-DM-C610','2012년 4월','[인텔] 코어 i5-2400 3.10GHz','4GB','HDD181GB','HDD 271GB','','',''),(37,40,'삼성전자㈜','DB-P400','DB-P400-PC312S','HQ0J98CC7A003AV','BA68-07985A Rev 3.0','KCC-REM-SEC-DM-C610','2012년 7월','[인텔] 코어 i3-2120 3.30GHz','4GB','HDD 181GB','HDD 271GB','','',''),(38,41,'삼성전자㈜','DB-P400','DB-P400-PC312S','HQ0J98CC7A003HA','BA68-07985A Rev 3.0','KCC-REM-SEC-DM-C610','2012년 7월','[인텔] 코어i3-2120 3.30GHz','4GB','HDD181GB','HDD 271GB','','',''),(39,42,'삼성전자㈜','DB-P400','DB-P400-PC312S','HQ0J98CC7A0003KD','BA68-07985A Rev 3.0','KCC-REM-SEC-DM-C610','2012년 7월','[인텔] 코어i3-2120 3.30GHz','4GB','HDD181GB','HDD 271GB','','',''),(40,43,'삼성전자㈜','DB-P400','DB-P400-PC312S','HQ0J98CC7A003JP','BA68-07985A Rev 3.0','KCC-REM-SEC-DM-C610','2012년 7월','[인텔] 코어i3-2120 3.30GHz','4GB','HDD 181GB','HDD 271GB','','',''),(42,45,'삼성전자㈜','DB-P400','DB-P400-PC312S','HQ0J98CC7A003EK','BA68-07985A Rev 3.0','KCC-REM-SEC-DM-C610','2012년 7월','[인텔] 코어i3-2120 3.30GHz','4GB','HDD 181GB','HDD 271GB','','',''),(43,46,'삼성전자㈜','DM-V190','DM-V190-PA11','ZNJ59WAZ600613R','BA68-04084B Rev 3.0','SEC-DM-C200 (B)','2010년 6월','Pentium Dual-Core E5400 2.70GH','2GB','HDD 113GB','HDD 168GB','','',''),(44,47,'삼성전자㈜','DB-P400','DB-P400-PC312S','HQ0J98CC7A0039W','BA68-07985A Rev 3.0','KCC-REM-SEC-DM-C610','2012년 7월','[인텔] 코어i3-2120 3.30GHz','4GB','HDD 181GB','HDD 271GB','','',''),(45,48,'삼성전자㈜','DB-P400','DB-P400-PC312S','HQ0J98CC7A003CT','BA68-07985A Rev 3.0','KCC-REM-SEC-DM-C610','2012년 7월','[인텔] 코어 i3-2120 3.30GHz','4GB','HDD 181GB','HDD 271GB','','',''),(46,49,'삼성전자㈜','DB-P400','DB-P400-PC312S','HQ0J98CC7A0038M','BA68-07985A Rev 3.0','KCC-REM-SEC-DM-C610','2012년 7월','[인텔] 코어 i3-2120 3.30GHz','4GB','HDD181GB','HDD 271GB','','',''),(47,50,'삼성전자㈜','DB-P400','DB-P400-PC312S','HQ0J98CC7A003DB','BA68-07985A Rev 3.0','KCC-REM-SEC-DM-C610','2012년 7월','[인텔] 코어 i3-2120 3.30GHz','4GB','HDD 181GB','HDD 271GB','','',''),(48,51,'삼성전자㈜','DB400T2A','DB400T2A-C216S','JBZT98CF5A000AY','BA68-07985A Rev 4.0','KCC-REM-SEC-DB400T2A','2014년 5월','[인텔] Pentium G2120 3.10GHz','4GB','HDD 181GB','HDD 271GB','','',''),(49,52,'삼성전자㈜','DB400T2A','DB400T2A-C216S','JBZT98CF5A0002A','BA68-07985A Rev 4.0','KCC-REM-SEC-DB400T2A','2014년 5월','[인텔] Pentium G2120 3.10GHz','4GB','HDD 181GB','HDD 271GB','','',''),(50,53,'삼성전자㈜','DB-P400','DB-P400-PC312S','HQ0J98CC7A0032N','BA68-07985A Rev 3.0','KCC-REM-SEC-DM-C610','2012년 7월','[인텔] 코어i3-2120 3.30GHz','4GB','HDD 181GB','HDD 271GB','','',''),(51,54,'삼성전자㈜','DB-P400','DB-P400-PC312S','HQ0J98CC7A003MN','BA68-07985A Rev 3.0','KCC-REM-SEC-DM-C610','2012년 7월','[인텔] 코어i3-2120 3.30GHz','4GB','HDD181GB','HDD 271GB','','',''),(52,55,'삼성전자㈜','DB400T2A','DB400T2A-A5E9S','J9Y298CCBA000EW','BA68-07985A Rev 3.0','KCC-REM-SEC-DB400T2A','2012.11','[인텔] 코어 i5-3330 3.00GHz','3.48GB','HDD 195GB','HDD 257GB','지포스 GT620','',''),(53,56,'삼성전자㈜','DB400T2A','DB400T2A-A5E9S','J9Y298CCBA000DR','BA68-07985A Rev 3.0','KCC-REM-SEC-DB400T2A','2012년 11월','[인텔] 코어 i5-3330 3.00GHz','3.48GB','HDD 195GB','HDD 270GB','지포스 GT620','',''),(55,58,'엘지전자㈜','LGA51(노트북)','A530-PE15K','MEZ63476020','','','2011년 12월','[인텔] 코어 i7-2670QM 2.20GHz','8GB','HDD 296GB','HDD 282GB','','',''),(56,59,'삼성전자㈜','DB-P400','DB-P400-PA5E4S','HQ0D98DC4B001QA','BA68-04680B Rev 5.0','KCC-REM-SEC-DM-C610','2012년 4월','[인텔]코어i5-2500 3.30GHz','4GB','HDD 367GB','HDD 551GB','지포스 GT530','',''),(73,44,'삼성전자㈜','DB400T3A','DB400T3A-A304S','JMLG98CG3A001ZR','BA68-07985A Rev 4.0','MSIP-REM-SEC-DB400T3A','2015년 3월','[인텔] 코어i3-4150 3.50GHz','4GB','HDD229GB','HDD 223GB','HDD 223GB','',''),(74,24,'삼성(노트북)','NT-RV520','NT-RV520-S58L','S/N : HTKA91SC600172X','BA68-07369A 20','SEC-NT-RV411','2012년 6월','[인텔] 코어 i5-2450M 2.5GHz','8GB','HDD 150GB','HDD 295GB','HDD 295GB','지포스 GT 520M',''),(75,9,'삼성전자(주)/노트북','NT-RF511','NT-RF511-WT87','HKU193BBB00286E','BA68-06687A 20','SEC-NT-RF410 (B)','2011.11','[인텔] i7-2670QM 2.20GHz','8GB','HDD 364GB','HDD 546GB','HDD 546GB','',''),(76,12,'삼성전자㈜','DB400T2A','DB400T2A-A5E7S','J9Y098CDBA0003A','BA68-07985A Rev 4.0','KCC-REM-SEC-DB400T2A','2013.11','[인텔] 코어i7-2600 3.40GHz','16GB','1.84GB','891GB','891GB','ATI display adapter',''),(87,21,'삼성전자㈜','DB400T2A','DB400T2A-A5E9S','J9Y298CCBA0006Z','BA68-07985A Rev 3.0','KCC-REM-SEC-DB400T2A','2012.11','[인텔] 코어 i5-3330 3.00GHz','3.48GB','HDD 195GB','HDD 257GB','지포스 GT620','',''),(88,21,'','','','','','','','[인텔]코어i7-6세대 6700(스카이레이크) 3.4G','32GB','SSD 256GB','HDD 2TB','지포스 GTX960','영업지원-201601-03','2016.02.15'),(79,70,'','','','','','','','[인텔]코어i7-6세대 6700(스카이레이크) 3.4G','32GB','SSD 256GB','HDD 2TB','지포스 GTX960','영업지원-201601-03','2016.02.15'),(80,55,'','','','','','','','[인텔]코어i7-6세대 6700(스카이레이크) 3.4G','32GB','SSD 256GB','HDD 2TB','HDD 2TB','지포스 GTX960','영업지원-201601-03'),(81,56,'','','','','','','','[인텔]코어i7-6세대 6700(스카이레이크) 3.4G','32GB','SSD 256GB','HDD 2TB','HDD 2TB','지포스 GTX960','영업지원-201601-03');
/*!40000 ALTER TABLE `g_pc` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `g_quark`
--
DROP TABLE IF EXISTS `g_quark`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `g_quark` (
`idx` int(20) NOT NULL AUTO_INCREMENT,
`user_idx` int(15) NOT NULL,
`product_number` varchar(200) DEFAULT NULL,
`font` varchar(50) DEFAULT NULL,
`gian_num` varchar(30) DEFAULT NULL,
`duration` varchar(30) DEFAULT NULL,
PRIMARY KEY (`idx`)
) ENGINE=MyISAM AUTO_INCREMENT=76 DEFAULT CHARSET=utf8 COMMENT='전산_Quark';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `g_quark`
--
LOCK TABLES `g_quark` WRITE;
/*!40000 ALTER TABLE `g_quark` DISABLE KEYS */;
INSERT INTO `g_quark` VALUES (1,4,'ㅋㅋ','333','33','3'),(74,56,'Quark 6.5k','','',''),(67,21,'Quark 6.5K','','',''),(68,21,'Quark2015 S/N : JQ50881414050\r\n제품설치코드 : 2C53GDKDQ52X482FBFKQA889CXBJYKQYKNUR35KAJVCGYKZ','세종서체\r\n1TNM-1TZC-N91R-QYFA','','영구'),(71,70,'Quark2015 S/N : JQ51601945817\r\n제품설치코드 : RTR1N762YQNK7X4WZHKFQQKVYCBAVPUG8C7ZYMHGKKSGUKG ','세종서체\r\nELQR-SYKG-FEGZ-D3XA','','영구'),(72,55,'Quark 6.5K','','',''),(73,55,'Quark2015 S/N : JQ51692124866\r\n제품설치코드 : 1X6AP487HAFVZUQV8ZENUVDCCBCZY8P3B9QMN1X3PGVPMR3','세종서체\r\nSLR3-5ZRG-YHOW-6BIV','','영구'),(75,56,'Quark2015 S/N : JQ50091381458\r\n제품설치코드 : SEPKX2FPXF4TDTG4H8A5P322HXW1DA9D9N78BEUCUH49MRA','세종서체\r\n11SU-LL8N-OY37-NNE1','','영구');
/*!40000 ALTER TABLE `g_quark` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `g_security`
--
DROP TABLE IF EXISTS `g_security`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `g_security` (
`idx` int(20) NOT NULL AUTO_INCREMENT,
`user_idx` int(15) NOT NULL,
`product_number` varchar(50) DEFAULT NULL,
`gian_num` varchar(30) DEFAULT NULL,
`duration` varchar(30) DEFAULT NULL,
PRIMARY KEY (`idx`)
) ENGINE=MyISAM AUTO_INCREMENT=79 DEFAULT CHARSET=utf8 COMMENT='전산_사용보안프로그램';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `g_security`
--
LOCK TABLES `g_security` WRITE;
/*!40000 ALTER TABLE `g_security` DISABLE KEYS */;
INSERT INTO `g_security` VALUES (1,4,'카스퍼스키2016 4B18C4B0.key','',''),(6,9,'카스퍼스키2016\r\n4B18C4B0.key','',''),(7,10,'카스퍼스키2016\r\n4B18C4B0.key','',''),(8,11,'카스퍼스키2016\r\n4B18C4B0.key','',''),(9,12,'카스퍼스키2016\r\n4B18C4B0.key','',''),(10,13,'카스퍼스키2016\r\n4B18C4B0.key','',''),(11,14,'카스퍼스키2016\r\n4B18C4B0.key','',''),(12,15,'카스퍼스키2016\r\n4B18C4B0.key','',''),(13,16,'카스퍼스키2016\r\n4B18C4B0.key','',''),(14,17,'카스퍼스키2016\r\n4B18C4B0.key','',''),(15,18,'카스퍼스키2016\r\n4B18C4B0.key','',''),(16,19,'카스퍼스키2016\r\n4B18C4B0.key','',''),(21,24,'카스퍼스키2016\r\n4B18C4B0.key','',''),(22,25,'카스퍼스키2016\r\n4B18C4B2.key','',''),(23,26,'카스퍼스키2016\r\n4B18C4B3.key','',''),(24,27,'카스퍼스키2016\r\n4B18C4B17.key','',''),(25,28,'카스퍼스키2016\r\n4B18C4B6.key','',''),(26,29,'카스퍼스키2016\r\n4B18C4B9.key','',''),(27,30,'카스퍼스키2016\r\n4B18C4B5.key','',''),(28,31,'카스퍼스키2016\r\n4B18C4B0.key','',''),(29,32,'카스퍼스키2016\r\n4B18C4B4.key','',''),(30,33,'카스퍼스키2016\r\n4B18C4B5.key','',''),(31,34,'카스퍼스키2016\r\n4B18C4B7.key','',''),(32,35,'카스퍼스키2016\r\n4B18C4B8.key','',''),(33,36,'카스퍼스키2016\r\n4B18C4B7.key','',''),(35,38,'카스퍼스키2016\r\n4B18C4B9.key','',''),(36,39,'카스퍼스키2016\r\n4B18C4B9.key','',''),(37,40,'카스퍼스키2016\r\n4B18C4B9.key','',''),(38,41,'카스퍼스키2016\r\n4B18C4B13.key','',''),(39,42,'카스퍼스키2016\r\n4B18C4B15.key','',''),(40,43,'카스퍼스키2016\r\n4B18C4B16.key','',''),(41,44,'카스퍼스키2016\r\n4B18C4B20.key','',''),(42,45,'카스퍼스키2016\r\n4B18C4B21.key','',''),(43,46,'카스퍼스키2016\r\n4B18C4B22.key','',''),(44,47,'카스퍼스키2016\r\n4B18C4B17.key','',''),(45,48,'카스퍼스키2016\r\n4B18C4B9.key','',''),(46,49,'카스퍼스키2016\r\n4B18C4B10.key','',''),(47,50,'카스퍼스키2016\r\n4B18C4B11.key','',''),(48,51,'카스퍼스키2016\r\n4B18C4B23.key','',''),(49,52,'카스퍼스키2016\r\n4B18C4B25.key','',''),(50,53,'카스퍼스키2016\r\n4B18C4B26.key','',''),(51,54,'카스퍼스키2016\r\n4B18C4B24.key','',''),(76,56,'카스퍼스키2016\r\n4B18C4B9.key','',''),(55,58,'카스퍼스키2016\r\n4B18C4B27.key','',''),(56,59,'카스퍼스키2016\r\n4B18C4B27.key','',''),(67,24,'카스퍼스키2016\r\n4B18C4B0.key','',''),(68,9,'카스퍼스키2016\r\n4B18C4B0.key','',''),(69,21,'카스퍼스키2016\r\n4B18C4B0.key','',''),(70,22,'카스퍼스키2016\r\n4B18C4B0.key','',''),(78,20,'카스퍼스키2016\r\n4B18C4B0.key','',''),(72,70,'카스퍼스키2016\r\n4B18C4B0.key','',''),(73,55,'카스퍼스키2016\r\n4B18C4B9.key','',''),(75,55,'카스퍼스키2016\r\n4B18C4B0.key','',''),(77,56,'카스퍼스키2016\r\n4B18C4B0.key','','');
/*!40000 ALTER TABLE `g_security` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `g_window`
--
DROP TABLE IF EXISTS `g_window`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `g_window` (
`idx` int(20) NOT NULL AUTO_INCREMENT,
`user_idx` int(15) NOT NULL,
`product_number` varchar(100) DEFAULT NULL,
`gian_num` varchar(30) DEFAULT NULL,
`duration` varchar(30) DEFAULT NULL,
PRIMARY KEY (`idx`)
) ENGINE=MyISAM AUTO_INCREMENT=84 DEFAULT CHARSET=utf8 COMMENT='전산_사용윈도우OS';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `g_window`
--
LOCK TABLES `g_window` WRITE;
/*!40000 ALTER TABLE `g_window` DISABLE KEYS */;
INSERT INTO `g_window` VALUES (7,10,'Window7 Home Premium\r\n\nCQBVJ-9J697-PWB9R-4K7W4-2BT4J','',''),(8,11,'Window7 Home Premium\r\n\nCQBVJ-9J697-PWB9R-4K7W4-2BT4J','',''),(9,12,'Windows 7 Home Premium\r\n83RTW-WCQQK-G4TDQ-VDVY4-XM','',''),(10,13,'Window7 Home Premium\r\n\nCQBVJ-9J697-PWB9R-4K7W4-2BT4J','',''),(11,14,'Window7 Home Premium\r\n\nCQBVJ-9J697-PWB9R-4K7W4-2BT4J','',''),(71,9,'Window10 Home\r YTMG3-N6DKC-DKB77-7M9GH-8HVX7','',''),(13,16,'Window7 Home Premium\r\n\nCQBVJ-9J697-PWB9R-4K7W4-2BT4J','',''),(14,17,'Window7 Home Premium\r\nCQBVJ-9J697-PWB9R-4K7W4-2BT4J','',''),(15,18,'Window10\r\nX7D3N-YCGRC-FXQKQ-7DPXH-B7V24','',''),(70,15,'Window7 Home Premium\r\nCQBVJ-9J697-PWB9R-4K7W4-2BT4J','',''),(21,24,'Window7 Home Premium\r\n\nCQBVJ-9J697-PWB9R-4K7W4-2BT4J','',''),(22,25,'Window7 Home Premium\r\n\nCQBVJ-9J697-PWB9R-4K7W4-2BT4J','',''),(23,26,'Window7 Home Premium\r\n\nCQBVJ-9J697-PWB9R-4K7W4-2BT4J','',''),(24,27,'Window7 Professional\r GMJQF-JC7VC-76HMH-M4RKY-V4','',''),(25,28,'Window7 Professional\r\n7RWT3-3P3RR-WXH3R-6FVBV-3YBV','',''),(26,29,'Window7 Home Premium\r\n\nCQBVJ-9J697-PWB9R-4K7W4-2BT4J','',''),(27,30,'Window7 Home Premium\r\n\nCQBVJ-9J697-PWB9R-4K7W4-2BT4J','',''),(28,31,'Window7 Home Premium\r H3RJK-33MYX-JB2M3-XGFV4-3J','',''),(29,32,'Window7 Home Premium\r\n6VXWM-923GC-8692Q-TP86P-GPDJ','',''),(30,33,'Window7 Home Premium K\r\nYMTFY-T3YBV-CF84G-DHFJW-2G','',''),(31,34,'Window7 Home Premium k\r\nK9V47-RY377-JCT47-8C964-7V','',''),(32,35,'Window7 Home Premium\r\n\nCQBVJ-9J697-PWB9R-4K7W4-2BT4J','',''),(33,36,'Window7 Home Premium\r\n\nCQBVJ-9J697-PWB9R-4K7W4-2BT4J','',''),(35,38,'Window7 Home Premium\r\n\nCQBVJ-9J697-PWB9R-4K7W4-2BT4J','',''),(36,39,'Window7 Home Premium\r\n\nCQBVJ-9J697-PWB9R-4K7W4-2BT4J','',''),(37,40,'Window7 Home Premium\r\n\nCQBVJ-9J697-PWB9R-4K7W4-2BT4J','',''),(38,41,'Window7 Home Premium\r\n\nCQBVJ-9J697-PWB9R-4K7W4-2BT4J','',''),(39,42,'Window7 Home Premium\r\n\nCQBVJ-9J697-PWB9R-4K7W4-2BT4J','',''),(40,43,'Window7 Home Premium\r\n\nCQBVJ-9J697-PWB9R-4K7W4-2BT4J','',''),(41,44,'Window7 Professional\r GMJQF-JC7VC-76HMH-M4RKY-V4','',''),(42,45,'Window7 Home Premium\r\n\nCQBVJ-9J697-PWB9R-4K7W4-2BT4J','',''),(43,46,'Window7 Home Premium\r\n\nCQBVJ-9J697-PWB9R-4K7W4-2BT4J','',''),(44,47,'Window7 Home Premium\r\n\nCQBVJ-9J697-PWB9R-4K7W4-2BT4J','',''),(45,48,'Window7 Home Premium\r\n\nCQBVJ-9J697-PWB9R-4K7W4-2BT4J','',''),(46,49,'Window7 Home Premium\r\n\nCQBVJ-9J697-PWB9R-4K7W4-2BT4J','',''),(47,50,'Window7 Home Premium\r\n\nCQBVJ-9J697-PWB9R-4K7W4-2BT4J','',''),(48,51,'Window7 Home Premium\r\n\nCQBVJ-9J697-PWB9R-4K7W4-2BT4J','',''),(49,52,'Window7 Home Premium\r\n\nCQBVJ-9J697-PWB9R-4K7W4-2BT4J','',''),(50,53,'Window7 Home Premium\r\n\nCQBVJ-9J697-PWB9R-4K7W4-2BT4J','',''),(51,54,'Window7 Home Premium\r\n\nCQBVJ-9J697-PWB9R-4K7W4-2BT4J','',''),(81,56,'window XP\r\nV9BG9-Q496K-4BXM7-RJCXG-QYGJT','',''),(55,58,'Window7 Home Premium\r 38GRR-KMG3D-BTP99-TC9G4-BB','',''),(56,59,'Window7 Home Premium\r\n\nCQBVJ-9J697-PWB9R-4K7W4-2BT4J','',''),(69,24,'Window7 Home Premium\r\n\nCQBVJ-9J697-PWB9R-4K7W4-2BT4J','',''),(68,19,'Window10\r\nTNFGR-HFCHC-3HMQR-B979F-6Q724','영업지원-201604-05','영구'),(72,9,'Window7 Home Premium\r\n\nCQBVJ-9J697-PWB9R-4K7W4-2BT4J','',''),(73,12,'Window7 Home Premium\r CQBVJ-9J697-PWB9R-4K7W4-2BT4J','',''),(74,21,'Window XP\r\nV9BG9-Q496K-4BXM7-RJCXG-QYGJT','',''),(75,21,'Window10\r\nG7M6N-HWHC7-FFPQJ-K23Q8-K2FC4','영업지원-201601-03','영구'),(76,22,'Window7 Home Premium K\r\nGMR2K-J6MRX-WJ98J-X72MT-3X','',''),(83,20,'Window10\r\n9V2RC-9NKGP-M6RGM-RQM3F-MWR4','영업지원-201604-05','영구'),(78,70,'Window10\r\n42NH3-GMVXR-673HM-VT2WJ-78RC4','영업지원-201601-03','영구'),(79,55,'window XP\r\nV9BG9-Q496K-4BXM7-RJCXG-QYGJT','',''),(80,55,'Window10\r\nC4P6K-NX238-QC4KC-282BM-88F9F','영업지원-201601-03','영구'),(82,56,'Window10\r\nPCG29-TDNB3-88RP3-YXC9Y-R6YP4','영업지원-201601-03','영구');
/*!40000 ALTER TABLE `g_window` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `jeonsan_cell`
--
DROP TABLE IF EXISTS `jeonsan_cell`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `jeonsan_cell` (
`idx` int(20) NOT NULL AUTO_INCREMENT,
`user_idx` int(15) NOT NULL,
`product_name` varchar(50) DEFAULT 'NULL',
`identify` varchar(50) DEFAULT 'NULL',
`produce_ym` varchar(50) DEFAULT 'NULL',
`gian_num` varchar(30) DEFAULT 'NULL',
`buy_day` varchar(30) DEFAULT 'NULL',
PRIMARY KEY (`idx`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `jeonsan_cell`
--
LOCK TABLES `jeonsan_cell` WRITE;
/*!40000 ALTER TABLE `jeonsan_cell` DISABLE KEYS */;
INSERT INTO `jeonsan_cell` VALUES (14,17,'IP335S','','','','2016.02.24');
/*!40000 ALTER TABLE `jeonsan_cell` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `jeonsan_headset`
--
DROP TABLE IF EXISTS `jeonsan_headset`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `jeonsan_headset` (
`idx` int(20) NOT NULL AUTO_INCREMENT,
`user_idx` int(15) NOT NULL,
`product_name` varchar(50) DEFAULT 'NULL',
`identify` varchar(50) DEFAULT 'NULL',
`produce_ym` varchar(50) DEFAULT 'NULL',
`gian_num` varchar(30) DEFAULT 'NULL',
`buy_day` varchar(30) DEFAULT 'NULL',
PRIMARY KEY (`idx`)
) ENGINE=InnoDB AUTO_INCREMENT=44 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `jeonsan_headset`
--
LOCK TABLES `jeonsan_headset` WRITE;
/*!40000 ALTER TABLE `jeonsan_headset` DISABLE KEYS */;
INSERT INTO `jeonsan_headset` VALUES (43,46,'Jabra GN2110','','','영업지원-201602-04','2016.03.03');
/*!40000 ALTER TABLE `jeonsan_headset` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `jeonsan_keyboard`
--
DROP TABLE IF EXISTS `jeonsan_keyboard`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `jeonsan_keyboard` (
`idx` int(20) NOT NULL AUTO_INCREMENT,
`user_idx` int(15) NOT NULL,
`product_name` varchar(50) DEFAULT NULL,
`identify` varchar(50) DEFAULT NULL,
`produce_ym` varchar(50) DEFAULT NULL,
`gian_num` varchar(30) DEFAULT NULL,
`buy_day` varchar(30) DEFAULT NULL,
PRIMARY KEY (`idx`)
) ENGINE=MyISAM AUTO_INCREMENT=17 DEFAULT CHARSET=utf8 COMMENT='전산실보관_키보드';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `jeonsan_keyboard`
--
LOCK TABLES `jeonsan_keyboard` WRITE;
/*!40000 ALTER TABLE `jeonsan_keyboard` DISABLE KEYS */;
/*!40000 ALTER TABLE `jeonsan_keyboard` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `jeonsan_moniter`
--
DROP TABLE IF EXISTS `jeonsan_moniter`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `jeonsan_moniter` (
`idx` int(20) NOT NULL AUTO_INCREMENT,
`user_idx` int(15) NOT NULL,
`company` varchar(50) DEFAULT NULL,
`product_name` varchar(50) DEFAULT NULL,
`model_code` varchar(50) DEFAULT NULL,
`model_name` varchar(50) DEFAULT NULL,
`identify` varchar(50) DEFAULT NULL,
`produce_ym` varchar(50) DEFAULT NULL,
`soft_num` varchar(50) DEFAULT NULL,
`gian_num` varchar(50) DEFAULT NULL,
`buy_day` varchar(50) DEFAULT NULL,
PRIMARY KEY (`idx`)
) ENGINE=MyISAM AUTO_INCREMENT=42 DEFAULT CHARSET=utf8 COMMENT='전산실_보관_모니터';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `jeonsan_moniter`
--
LOCK TABLES `jeonsan_moniter` WRITE;
/*!40000 ALTER TABLE `jeonsan_moniter` DISABLE KEYS */;
/*!40000 ALTER TABLE `jeonsan_moniter` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `jeonsan_mouse`
--
DROP TABLE IF EXISTS `jeonsan_mouse`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `jeonsan_mouse` (
`idx` int(20) NOT NULL AUTO_INCREMENT,
`user_idx` int(15) NOT NULL,
`product_name` varchar(50) DEFAULT NULL,
`identify` varchar(50) DEFAULT NULL,
`produce_ym` varchar(50) DEFAULT NULL,
`gian_num` varchar(30) DEFAULT NULL,
`buy_day` varchar(30) DEFAULT NULL,
PRIMARY KEY (`idx`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='전산실보관_마우스';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `jeonsan_mouse`
--
LOCK TABLES `jeonsan_mouse` WRITE;
/*!40000 ALTER TABLE `jeonsan_mouse` DISABLE KEYS */;
/*!40000 ALTER TABLE `jeonsan_mouse` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `jeonsan_pc`
--
DROP TABLE IF EXISTS `jeonsan_pc`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `jeonsan_pc` (
`idx` int(20) NOT NULL AUTO_INCREMENT,
`user_idx` int(15) NOT NULL,
`company` varchar(50) DEFAULT NULL,
`model_name` varchar(50) DEFAULT NULL,
`model_code` varchar(50) DEFAULT NULL,
`produce_number` varchar(50) DEFAULT NULL,
`product_code` varchar(50) DEFAULT NULL,
`identify` varchar(50) DEFAULT NULL,
`produce_ym` varchar(50) DEFAULT NULL,
`g_cpu` varchar(30) DEFAULT NULL,
`g_ram` varchar(30) DEFAULT NULL,
`g_hdd_c` varchar(30) DEFAULT NULL,
`g_hdd_d` varchar(30) DEFAULT NULL,
`g_graphic` varchar(30) DEFAULT NULL,
`gian_num` varchar(30) DEFAULT NULL,
`buy_day` varchar(30) DEFAULT NULL,
PRIMARY KEY (`idx`)
) ENGINE=MyISAM AUTO_INCREMENT=88 DEFAULT CHARSET=utf8 COMMENT='전산실_보관_본체';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `jeonsan_pc`
--
LOCK TABLES `jeonsan_pc` WRITE;
/*!40000 ALTER TABLE `jeonsan_pc` DISABLE KEYS */;
INSERT INTO `jeonsan_pc` VALUES (21,24,'삼성전자㈜','DB-P400','DB-P400-PC312S','HQ0J98CC7A003BL','BA68-07985A Rev 3.0','KCC-REM-SEC-DM-C610','2012년 7월','[인텔] 코어 i3-2120 3.3GHz','4GB','HDD 181GB','HDD 271GB','','',''),(37,40,'삼성전자㈜','DB-P400','DB-P400-PC312S','HQ0J98CC7A003AV','BA68-07985A Rev 3.0','KCC-REM-SEC-DM-C610','2012년 7월','[인텔] 코어 i3-2120 3.30GHz','4GB','HDD 181GB','HDD 271GB','','',''),(38,41,'삼성전자㈜','DB-P400','DB-P400-PC312S','HQ0J98CC7A003HA','BA68-07985A Rev 3.0','KCC-REM-SEC-DM-C610','2012년 7월','[인텔] 코어i3-2120 3.30GHz','4GB','HDD181GB','HDD 271GB','','',''),(39,42,'삼성전자㈜','DB-P400','DB-P400-PC312S','HQ0J98CC7A0003KD','BA68-07985A Rev 3.0','KCC-REM-SEC-DM-C610','2012년 7월','[인텔] 코어i3-2120 3.30GHz','4GB','HDD181GB','HDD 271GB','','',''),(40,43,'삼성전자㈜','DB-P400','DB-P400-PC312S','HQ0J98CC7A003JP','BA68-07985A Rev 3.0','KCC-REM-SEC-DM-C610','2012년 7월','[인텔] 코어i3-2120 3.30GHz','4GB','HDD 181GB','HDD 271GB','','',''),(42,45,'삼성전자㈜','DB-P400','DB-P400-PC312S','HQ0J98CC7A003EK','BA68-07985A Rev 3.0','KCC-REM-SEC-DM-C610','2012년 7월','[인텔] 코어i3-2120 3.30GHz','4GB','HDD 181GB','HDD 271GB','','',''),(43,46,'삼성전자㈜','DM-V190','DM-V190-PA11','ZNJ59WAZ600613R','BA68-04084B Rev 3.0','SEC-DM-C200 (B)','2010년 6월','Pentium Dual-Core E5400 2.70GH','2GB','HDD 113GB','HDD 168GB','','',''),(44,47,'삼성전자㈜','DB-P400','DB-P400-PC312S','HQ0J98CC7A0039W','BA68-07985A Rev 3.0','KCC-REM-SEC-DM-C610','2012년 7월','[인텔] 코어i3-2120 3.30GHz','4GB','HDD 181GB','HDD 271GB','','',''),(45,48,'삼성전자㈜','DB-P400','DB-P400-PC312S','HQ0J98CC7A003CT','BA68-07985A Rev 3.0','KCC-REM-SEC-DM-C610','2012년 7월','[인텔] 코어 i3-2120 3.30GHz','4GB','HDD 181GB','HDD 271GB','','',''),(46,49,'삼성전자㈜','DB-P400','DB-P400-PC312S','HQ0J98CC7A0038M','BA68-07985A Rev 3.0','KCC-REM-SEC-DM-C610','2012년 7월','[인텔] 코어 i3-2120 3.30GHz','4GB','HDD181GB','HDD 271GB','','',''),(47,50,'삼성전자㈜','DB-P400','DB-P400-PC312S','HQ0J98CC7A003DB','BA68-07985A Rev 3.0','KCC-REM-SEC-DM-C610','2012년 7월','[인텔] 코어 i3-2120 3.30GHz','4GB','HDD 181GB','HDD 271GB','','',''),(73,44,'삼성전자㈜','DB400T3A','DB400T3A-A304S','JMLG98CG3A001ZR','BA68-07985A Rev 4.0','MSIP-REM-SEC-DB400T3A','2015년 3월','[인텔] 코어i3-4150 3.50GHz','4GB','HDD229GB','HDD 223GB','HDD 223GB','','');
/*!40000 ALTER TABLE `jeonsan_pc` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `kaspersky`
--
DROP TABLE IF EXISTS `kaspersky`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `kaspersky` (
`idx` int(20) NOT NULL AUTO_INCREMENT,
`product_name` varchar(100) DEFAULT NULL,
`version` varchar(50) DEFAULT NULL,
`company` varchar(50) DEFAULT NULL,
`purpose` varchar(50) DEFAULT NULL,
`compatibility` varchar(50) DEFAULT NULL,
`duration` varchar(20) DEFAULT NULL,
`sirial_num` varchar(200) DEFAULT NULL,
`package` varchar(50) DEFAULT NULL,
`license_numb` varchar(20) DEFAULT NULL,
`keep_place` varchar(50) DEFAULT NULL,
`remarks` varchar(50) DEFAULT NULL,
PRIMARY KEY (`idx`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `kaspersky`
--
LOCK TABLES `kaspersky` WRITE;
/*!40000 ALTER TABLE `kaspersky` DISABLE KEYS */;
INSERT INTO `kaspersky` VALUES (1,'Kaspersky Antivirus for Win Workstation(50~99)','','한국카스퍼스키랩','PC 보안','√','2016.04.25~2018.04.2','','','','','\r'),(2,'Kaspersky','','한국카스퍼스키랩','Server','√','2016.04.25~2018.04.2','','','','여기','팩스서버'),(3,'Kaspersky Antivirus for Windows Server','','한국카스퍼스키랩','Server 보안','√','2016.04.25~2018.04.2','','','','','\r'),(4,'Kaspersky Endpoint Security for Server','','한국카스퍼스키랩','Server 보안','√','2017.07.29~2019.07.2','','','','','\r'),(5,'Kaspersky Endpoint Security for Server','','한국카스퍼스키랩','Server 보안','√','2017.07.29~2019.07.2','','','','','\r'),(6,'Kaspersky','','한국카스퍼스키랩','Server','√','2017.07.29~2019.07.2','','','','',''),(7,'Kaspersky Endpoint Security for Server','','한국카스퍼스키랩','Server 보안','√','2017.07.29~2019.07.2','','','','','\r'),(8,'Kaspersky Endpoint Security for Server','','한국카스퍼스키랩','Server 보안','√','2017.07.29~2019.07.2','','','','','\r'),(9,'Kaspersky Endpoint Security for Server','','한국카스퍼스키랩','Server 보안','√','2017.07.29~2019.07.2','','','','','\r'),(10,'Kaspersky Endpoint Security for Server','','한국카스퍼스키랩','Server 보안','√','2017.07.29~2019.07.2','','','','','\r'),(11,'Kaspersky Endpoint Security for Server','','한국카스퍼스키랩','Server 보안','√','2017.07.29~2019.07.2','','','','','\r'),(12,'Kaspersky Endpoint Security for Server','','한국카스퍼스키랩','Server 보안','√','2017.07.29~2019.07.2','','','','','\r'),(13,'Kaspersky Endpoint Security for Server','','한국카스퍼스키랩','Server 보안','√','2017.07.29~2019.07.2','','','','','\r'),(14,'Kaspersky Antivirus for Win Workstation(50~99)3','','','','','','','','','',''),(15,'2222','','','','','','','','','','');
/*!40000 ALTER TABLE `kaspersky` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `ms_up`
--
DROP TABLE IF EXISTS `ms_up`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ms_up` (
`idx` int(20) NOT NULL AUTO_INCREMENT,
`office2003_pro` varchar(20) DEFAULT NULL,
`office2007_pro` varchar(20) DEFAULT NULL,
PRIMARY KEY (`idx`)
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `ms_up`
--
LOCK TABLES `ms_up` WRITE;
/*!40000 ALTER TABLE `ms_up` DISABLE KEYS */;
INSERT INTO `ms_up` VALUES (1,'BD2YC-JB896-33F','BDJWG-C9RPW-7QCVY-DD'),(2,'BD2YC-JB896-CQF9C-4F','D7PCX-MVJRH-7RR2B-X4'),(3,'BD2YC-JB896-CQF9C-4F','B3VCK-YXC3B-9YF3T-4B'),(4,'BD2YC-JB896-CQF9C-4F','GCV28-9WRHX-3WJKP-4J'),(5,'BD2YC-JB896-CQF9C-4F','TQHJ2-KCP23-74CVV-GG'),(6,'BD2YC-JB896-CQF9C-4F','VRF6F-P8P77-3GX3B-6F'),(7,'B3RJ9-VCJW6-8FYCG-M8','KGHQP-HQ2PY-2HP2X-47'),(8,'B3RJ9-VCJW6-8FYCG-M8','G93XY-2MM3K-JKQ99-PM'),(9,'B3RJ9-VCJW6-8FYCG-M8','FV7RD-96TD4-Y8677-9D'),(10,'B3RJ9-VCJW6-8FYCG-M8','P397D-PYMWM-4MBMG-48'),(11,'B3RJ9-VCJW6-8FYCG-M8','F726W-VJ2RT-9DM6G-H7'),(12,'XF37319479','XU52192157599'),(13,'XF37330456','XU50911537837'),(14,'XF37342180','XU51652233016'),(15,'XF37895143','XU52280990697'),(16,'XF97738145','XU50321444728'),(17,'XF97740829','XU50801756539'),(18,'XF98576980','XU50821198570'),(19,'XF38236527','XU50390195095'),(20,'PF42607447','XU51090188222'),(21,'PF42607661','XU51031887624');
/*!40000 ALTER TABLE `ms_up` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `printer`
--
DROP TABLE IF EXISTS `printer`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `printer` (
`idx` int(20) NOT NULL AUTO_INCREMENT,
`product_name` varchar(100) DEFAULT NULL,
`use_place` varchar(50) DEFAULT NULL,
`term` varchar(50) DEFAULT NULL,
`cost` varchar(50) DEFAULT NULL,
`color_a4` varchar(50) DEFAULT NULL,
`color_a3` varchar(50) DEFAULT NULL,
`black_a4` varchar(50) DEFAULT NULL,
`black_a3` varchar(50) DEFAULT NULL,
PRIMARY KEY (`idx`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `printer`
--
LOCK TABLES `printer` WRITE;
/*!40000 ALTER TABLE `printer` DISABLE KEYS */;
INSERT INTO `printer` VALUES (1,'Samsung','1층','','150,000','15','30','100','200'),(2,'Samsung X4300 Series','2층','','150,000','15','30','100','200 \r'),(3,'Samsung SCX-8128NA (흑백)','3층','2016.03.28~2019.03.27','100,000','20','40','-','-\r'),(4,'Samsung X4300 Series','4층','2016.05.03~2018.05.02','150,000','15 ','30','100','200 \r');
/*!40000 ALTER TABLE `printer` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `quark_up`
--
DROP TABLE IF EXISTS `quark_up`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `quark_up` (
`idx` int(20) NOT NULL AUTO_INCREMENT,
`quark3` varchar(100) DEFAULT NULL,
`quark4` varchar(100) DEFAULT NULL,
`quark8` varchar(100) DEFAULT NULL,
`quark9` varchar(100) DEFAULT NULL,
`quark2015` varchar(100) DEFAULT NULL,
`quark2015_serial` varchar(100) DEFAULT NULL,
`sejong_font` varchar(100) DEFAULT NULL,
`user` varchar(20) DEFAULT NULL,
PRIMARY KEY (`idx`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `quark_up`
--
LOCK TABLES `quark_up` WRITE;
/*!40000 ALTER TABLE `quark_up` DISABLE KEYS */;
INSERT INTO `quark_up` VALUES (1,'XF373194794','XU52192157599','KO50930112000','KO50361347104','JQ51692124866','1X6AP487HAFVZUQV8ZENUVDCCBCZY8P3B9QMN1X3PGVPMR3','SLR3-5ZRG-YHOW-6BIV','editor0111'),(2,'XF37330456','XU50911537837','KO51251441128','KO52110898714','JQ50192291816','EFFMTN7W8QKC6GFZECMJF3K87WUBQEE82VCTNN2YNPKCSTP ','O4NQ-YHF0-VC2J-UJ2P','예비\r'),(3,'XF37342180','XU51652233016','KO52182355665','KO52271113594','JQ50091381458','SEPKX2FPXF4TDTG4H8A5P322HXW1DA9D9N78BEUCUH49MRA','11SU-LL8N-OY37-NNE1','editor02\r'),(4,'XF37895143','XU52280990697','KO52131911724','KO50460496652','JQ52410065222','DEVDX8XJXB444R9YVZ74F67VY5UN43QSE3VNVYHT11U78TR ','AR4U-NMS4-QOPS-L2RG','editor03\r'),(5,'XF97738145','XU50321444728','KO50501215126','KO50640961027','JQ50881414050','2C53GDKDQ52X482FBFKQA889CXBJYKQYKNUR35KAJVCGYKZ','1TNM-1TZC-N91R-QYFA','editor04\r'),(6,'XF97740829','XU50801756539','KO51201205623','KO50872376020','JQ51601945817','RTR1N762YQNK7X4WZHKFQQKVYCBAVPUG8C7ZYMHGKKSGUKG ','ELQR-SYKG-FEGZ-D3XA','editor05\r'),(7,'XF98576980','XU50821198570','KO51240617231','KO51801873428','','','','\r'),(8,'XF38236527','XU50390195095','KO51011165684','KO50631538880','','','','\r'),(9,'PF42607447','XU51090188222','','','','','','\r'),(10,'PF42607661','XU51031887624','','','','','','\r');
/*!40000 ALTER TABLE `quark_up` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `soft_keep`
--
DROP TABLE IF EXISTS `soft_keep`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `soft_keep` (
`idx` int(20) NOT NULL AUTO_INCREMENT,
`product_name` varchar(50) DEFAULT NULL,
`version` varchar(50) DEFAULT NULL,
`company` varchar(50) DEFAULT NULL,
`purpose` varchar(50) DEFAULT NULL,
`target` varchar(50) DEFAULT NULL,
`compatibility` varchar(50) DEFAULT NULL,
`sirial_num` varchar(300) DEFAULT NULL,
`package` varchar(50) DEFAULT NULL,
`license_numb` varchar(50) DEFAULT NULL,
`keep_place` varchar(50) DEFAULT NULL,
`remarks` varchar(50) DEFAULT NULL,
PRIMARY KEY (`idx`)
) ENGINE=MyISAM AUTO_INCREMENT=46 DEFAULT CHARSET=utf8 COMMENT='소프트보관';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `soft_keep`
--
LOCK TABLES `soft_keep` WRITE;
/*!40000 ALTER TABLE `soft_keep` DISABLE KEYS */;
INSERT INTO `soft_keep` VALUES (1,'QuarkXpress','4.1K','인큐브테크','편집디자인','','√','최초(3K) : PF42607447 / 변경(4.1K) : XU51090188222 \r\n설치용 사용자 인증 코드 : 39277938ATPEGEP695305539RXYKN \r\nXtension용 사용자 인증 코드 : GRNVHMTGYISWP9QASNW1','','','4층','제품등록완료'),(2,'QuarkXpress','4.1K','인큐브테크','편집디자인','','√','최초(3K) : PF42607661 / 변경(4.1K) : XU51031887624 \r\n설치용 사용자 인증 코드 : 39281934WQZQRFP695295295AYXCU \r\nXtension용 사용자 인증 코드 : MNEMAF1Z7YJGM1OAGWN','','','4층','제품등록완료'),(3,'QuarkXpress xperience design','9','인큐브테크','편집디자인','','√','KO51801873428 \r\n제품설치코드 : JKMQ1-JVKJR-7A3ZN \r\nICP 설치코드 : 69RBY19N2T836Y9U65HQZJMJWXRPGRS31U7SC8QSHX4RJ4D','','','4층','제품등록완료'),(4,'QuarkXpress xperience design','9','인큐브테크','편집디자인','','√','KO50631538880 \r\n제품설치코드 : MA1KT-ONGO8-0E329\r\nICP 설치코드 : 851X3YTPTY9J4K4CDGCE4MN768ZH7XC8P9VG8KZZ8MPP1RS','','','4층','제품등록완료'),(5,'AsiaFont','','아시아소프트','편집디자인','','√','WKTTF2008-247371','','','4층',''),(6,'AsiaFont','','아시아소프트','편집디자인','','√','WKTTF2008-247372','√','','4층','\r'),(7,'Adobe Dreamweaver','CS3','어도비','디자인','','√','1192-1082-5954-5051-5940-8826','√','','4층','\r'),(8,'Adobe Dreamweaver','CS3','어도비','디자인','','√','1192-1082-2111-4891-9305-6562','√','','4층','\r'),(9,'Adobe Flash','5','어도비','디자인','','√','FLW500-01173-90309-05071','√','','4층','\r'),(10,'Adobe Flash (업그레이드)','MX','어도비','디자인','','√','FLD700-00442-08246-50064','√','','4층','\r'),(11,'Adobe Flash','CS3','어도비','디자인','','√','1302-1452-2292-6642-3893-9184','√','','4층','\r'),(12,'Adobe Flash','CS3','어도비','디자인','','√','1302-1438-1092-8626-4225-2132','√','','4층','\r'),(13,'Adobe Illustrator','CS3','어도비','디자인','','√','1034-1044-1970-2689-0934-9905','√','','4층','\r'),(14,'Adobe Illustrator','CS3','어도비','디자인','','√','1034-1043-6537-0420-4148-0033','√','','4층','\r'),(15,'Adobe Photoshop','CS3','어도비','디자인','','√','1045-1060-1343-7640-3380-2463','√','','4층','\r'),(16,'Adobe Photoshop (업그레이드)','CS3','어도비','디자인','','√','구) 1045-1129-5225-9980-6212-0193 \r\n업) 1045-1033-3154-4665-7747-9065','','','4층',''),(17,'Adobe Design Standard','CS3','어도비','디자인','','√','1327-1956-6582-5465-4389-4808','√','','4층','\"CS4 (업그레이드)\"\r'),(18,'Adobe Design Standard','CS3','어도비','디자인','','√','1327-1088-0404-3055-6538-1355','√','','4층','\"CS4 (업그레이드)\"\r'),(19,'Adobe Design Standard','CS3','어도비','디자인','','√','1327-1088-9043-4325-8409-6652','√','','4층','\"CS4 (업그레이드)\"\r'),(20,'Adobe Design Standard','CS4','어도비','디자인','','√','1327-1000-2678-4439-7197-7372','√','','4층','\"CS3 (업그레이드)\"\r'),(21,'Adobe Design Standard','CS4','어도비','디자인','','√','1327-1000-9615-5849-3728-9108','√','','4층','\"CS3 (업그레이드)\"\r'),(22,'Adobe Design Standard','CS4','어도비','디자인','','√','1327-1001-0964-0075-3714-8584','√','','4층','\"CS3 (업그레이드)\"\r'),(23,'Adobe Design Standard','CS4','어도비','디자인','','√','13271522-6173-5866-6112-7912','√','','4층','\r'),(24,'Adobe Design Standard','CS4','어도비','디자인','','√','1327-1520-6388-7994-4976-8308','√','','4층','\r'),(25,'Adobe Design Standard','CS4','어도비','디자인','','√','1327-1776-3511-7503-8717-7182','√','','4층','\r'),(26,'Adobe Design Standard','CS4','어도비','디자인','','√','1327-1775-9098-6852-2735-6028','√','','4층','\r'),(27,'Adobe Design Standard','CS4','어도비','디자인','','√','1327-1521-3523-5763-3463-7743','√','','4층','\r'),(28,'Adobe Design Premium','CS4','어도비','디자인','','√','1326-1002-5701-9208-5948-5465','√','','4층','\r'),(29,'카스퍼스키 안티 바이러스','6','한국카스퍼스키랩','Server 보안','','√','\"고객등록번호 : 915026-411244 8PVGA-2J2G8-F6F7M-AD8FG\"','√','','4층','공유서버\r'),(30,'카스퍼스키 안티 바이러스','6','한국카스퍼스키랩','Server 보안','','√','\"고객등록번호 : 915026-410721 WTZ4R-YHC34-KAV8Y-N1X8N\"','√','','4층','백업서버\r'),(31,'카스퍼스키 안티 바이러스','6','한국카스퍼스키랩','Server 보안','','√','\"고객등록번호 : 915026-417689 WE4KV-1HPTX-5UMQR-N6RUM\"','√','','4층','웹서버\r'),(32,'카스퍼스키 안티 바이러스','6','한국카스퍼스키랩','Server 보안','','√','\"고객등록번호 : 895026-108579 FAQQC-MVSUS-XAXX7-58HAT\"','√','','4층','\r'),(33,'카스퍼스키 안티 바이러스','6','한국카스퍼스키랩','Server 보안','','√','\"고객등록번호 : 895026-107392 27XDA-YFVD1-QFGPZ-HT22E\"','√','','4층','\r'),(34,'카스퍼스키 안티 바이러스','6','한국카스퍼스키랩','Server 보안','','√','\"고객등록번호 : 895026-107663 Y2QEX-D78WN-HCA3V-73NCT\"','√','','4층','\r'),(35,'카스퍼스키 안티 바이러스','6','한국카스퍼스키랩','Server 보안','','√','\"고객등록번호 : 895026-108471 3AHXY-3N453-JNB96-SVD4U\"','√','','4층','\r'),(36,'카스퍼스키 안티 바이러스','6','한국카스퍼스키랩','보안','','√','-','√','','4층','\r'),(37,'카스퍼스키 안티 바이러스','6','한국카스퍼스키랩','통합보안솔루션','','√','-','√','','4층','\r'),(38,'JET-RIP','한컴,신명,서울','장원','Font','','√','-','√','','4층','\r'),(39,'JET-RIP','산돌,춘양','장원','Font','','√','-','√','','4층','\r'),(40,'광수폰트생각','sandoll','산돌글자은행','Font','','√','-','√','','4층','\r'),(41,'윤서체','윤디자인연구소','트루타입서체','Font','','√','인증번호 : 3C5EA849FF580E67\r\nS/N : 530D0B1D-9353-E45275D','','','4층',''),(42,'윤서체','윤디자인연구소','윤서체명필','Font','','√','116863E3-7731-351C734','√','','4층','\r'),(43,'윤서체','윤디자인연구소','윤서체명필','Font','','√','-','√','','4층','\r'),(44,'QuarkXpress(미개봉) xperience design','8K','인큐브테크','편집디자인','','√','KO51201205623','','','폐기','');
/*!40000 ALTER TABLE `soft_keep` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `soft_progress`
--
DROP TABLE IF EXISTS `soft_progress`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `soft_progress` (
`idx` int(20) NOT NULL AUTO_INCREMENT,
`product_name` varchar(50) DEFAULT NULL,
`version` varchar(50) DEFAULT NULL,
`company` varchar(50) DEFAULT NULL,
`purpose` varchar(50) DEFAULT NULL,
`target` varchar(50) DEFAULT NULL,
`compatibility` varchar(50) DEFAULT NULL,
`sirial_num` varchar(200) DEFAULT NULL,
`package` varchar(50) DEFAULT NULL,
`license_numb` int(20) DEFAULT NULL,
`keep_place` varchar(50) DEFAULT NULL,
`use_num` int(20) DEFAULT NULL,
`remarks` varchar(50) DEFAULT NULL,
PRIMARY KEY (`idx`)
) ENGINE=InnoDB AUTO_INCREMENT=136 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `soft_progress`
--
LOCK TABLES `soft_progress` WRITE;
/*!40000 ALTER TABLE `soft_progress` DISABLE KEYS */;
INSERT INTO `soft_progress` VALUES (1,'Windows 2000','Server','마이크로소프트','서버OS','편집부','√','MV9YF-XGXKP-2J66J-9B2GM-F64TY','',0,'4층',0,''),(2,'Windows Server 2003','StandardEdition','마이크로 소프트','서버OS','CMS서버','√','MRV88-KKM4J-CJYYV-RR9XP-J84WM','',0,'4층',0,''),(3,'Windows Server 2003 R2','StandardEdition','마이크로소프트','서버OS','파일서버\r\n(공유서버)','√','CVRVF-H6WQY-K7QGR-BWJ6F-7KFB6','',0,'4층',0,''),(4,'Windows Server 2003 R2','Standard','마이크로소프트','서버OS','재무/회계\r\n백업서버','√','D4FDB-CYC24-TXMDV-Y6G3F-663FT','',0,'4층',0,''),(5,'AsiaFont11','','아시아소프트','편집디자인','','√','WKTTF2008-247371','',0,'4층',NULL,''),(6,'Windows Svr Std 2008','Standard Edition','마이크로 소프트','서버OS','','√','C2221071727154','',0,'4층',0,''),(7,'Windows Sever 2012','CAL','마이크로 소프트','서버OS','','√','39626573939','',0,'4층',0,''),(8,'Windows Sever 2012','CAL','마이크로 소프트','서버OS','','√','39626573966','',0,'4층',0,''),(9,'Windows Sever 2012 R2','StandardEdition','마이크로 소프트','서버OS','','√','DHQHV-FWN7X-VD2F3-PH9DB-6VHJT','',0,'4층',0,''),(10,'Windows Sever 2012 R2','StandardEdition','마이크로 소프트','서버OS','','√','NRH2M-T99CC-BBYYH-KJGGH-8HTPG','',0,'4층',0,''),(11,'Windows XP','Home Edition','마이크로 소프트','PC-OS','줄서버','√','JY7W3-YR6M8-V8CGT-3KVDP-746FD','',0,'4층',0,''),(12,'Windows XP','Professional','마이크로 소프트','PC-OS','전산관리\r\n콘솔PC','√','CHTCB-K28YJ-H4C69-FD9GQ-C76QQ','',0,'',0,''),(13,'Windows XP','Professional','마이크로 소프트','PC-OS','','√','F3T9M-J2PHP-H222F-YWC63-QJX4D','',0,'4층',0,''),(14,'Windows XP','Professional','마이크로 소프트','PC-OS','','√','DDHJ3-89YKJ-CFGBV-4CDHX-HXJBT','',0,'4층',0,''),(15,'Windows XP','Professional','마이크로소프트','PC-OS','','√','MFW3G-TTPDH-9C92C-R6R7T-WBPXY','',0,'',0,'전산실 3장 S/N 無'),(16,'Windows XP','Professional','마이크로소프트','PC-OS','구)공유서버','√','PCK7C-4MYYD-D8X62-KTQV9-QJHCB','',0,'',0,'전산실 3장 S/N 無'),(17,'Windows XP','Professional','마이크로소프트','PC-OS','박스서버','√','RHDYC-2YXRY-RFCX9-K4C3X-6XXCY','',0,'',0,'전산실 3장 S/N 無'),(18,'Windows XP','Professional','마이크로소프트','PC-OS','컬러RIP','√','JVB76-VWXRX-HXV9R-4QW24-46H9B','',0,'',0,'전산실 3장 S/N 無'),(19,'Windows XP','Professional','마이크로소프트','PC-OS','','√','V9BG9-Q496K-4BXM7-RJCXG-QYGJT','',8,'4층',1,'Windows 7 (다운그레이드)'),(20,'Windows 7 32Bit(미개봉)','Professional','마이크로소프트','PC-OS','','√','SX8QZO4007','',0,'4층',0,''),(21,'Windows 7 32Bit(미개봉)','Professional','마이크로소프트','PC-OS','','√','SX9C7KZ0RP','',0,'4층',0,''),(22,'Windows 7 32Bit(미개봉)','Professional','마이크로소프트','PC-OS','','√','SX9C7KZ0RZ','',0,'4층',0,''),(23,'Windows 7 32Bit(미개봉)','Professional','마이크로소프트','PC-OS','','√','SX8QZO402E','',0,'4층',0,''),(24,'Windows 7 32Bit(미개봉)','Professional SP1','마이크로소프트','PC-OS','','√','SX9DA5Z0F6','',0,'4층',0,''),(25,'Windows 7 64Bit','Professional','마이크로소프트','PC-OS','','√','YMTFY-T3YBV-CF84G-DHFJW-2GXTD','',0,'4층',0,''),(26,'Windows 7 64Bit','Professional','마이크로소프트','PC-OS','','√','7RWT3-3P3RR-WXH3R-6FVBV-3YBVY','',0,'4층',0,''),(27,'Windows 7 64Bit','Professional','\"마이크로소프트\"','PC-OS','','√','MMQY3-04FD6-F77RB-B9B4W-CG4M8','√',0,'4층',0,'\r'),(28,'Windows 7 64Bit','Home Premium','마이크로소프트','PC-OS','','√','6VXWM-923GC-8692Q-TP86P-GPDJF','',0,'4층',0,''),(29,'Windows 7 64Bit','\"Home Premium\"','\"마이크로소프트\"','PC-OS','','√','K9V47-RY377-JCT47-8C964-7VYRK','√',0,'4층',0,'\r'),(30,'Windows 7 64Bit','\"Home Premium\"','\"마이크로소프트\"','PC-OS','','√','J39D6-HM4GQ-MH897-97FF6-BJ6WJ','√',0,'4층',0,'\r'),(31,'Windows 7 64Bit','\"Home Premium\"','\"마이크로소프트\"','PC-OS','','√','H3RJK-33MYX-JB2M3-XGFV4-3JM4M','√',0,'4층',0,'\r'),(32,'Windows 10 64Bit','Professional','\"마이크로소프트\"','PC-OS','','√','QD8NW-4CY9H-3V7YD-Q2FHB-R6YP4','√',0,'4층',0,'\r'),(33,'Windows 10 64Bit','Professional','\"마이크로소프트\"','PC-OS','','√','C4P6K-NX238-QC4KC-282BM-88F9F','√',0,'4층',0,'\r'),(34,'Windows 10 64Bit','Professional','\"마이크로소프트\"','PC-OS','','√','PCG29-TDNB3-88RP3-YXC9Y-R6YP4','√',0,'4층',0,'\r'),(35,'Windows 10 64Bit','Professional','\"마이크로소프트\"','PC-OS','','√','RY2X6-8NWR7-QHJ3C-V76R2-P9XTR','√',0,'4층',0,'\r'),(36,'Windows 10 64Bit','Professional','\"마이크로소프트\"','PC-OS','','√','G7M6N-HWHC7-FFPQJ-K23Q8-K2FC4','√',0,'4층',0,'\r'),(37,'Windows 10 64Bit','Professional','\"마이크로소프트\"','PC-OS','','√','42NH3-GMVXR-673HM-VT2WJ-78RC4','√',0,'4층',0,''),(38,'Windows 10 64Bit','Professional','\"마이크로소프트\"','PC-OS','','√','X7D3N-YCGRC-FXQKQ-7DPXH-B7V24','√',0,'4층',0,''),(39,'Windows 10 64Bit','Professional','\"마이크로소프트\"','PC-OS','','√','9V2RC-9NKGP-M6RGM-RQM3F-MWR4','√',0,'4층',0,''),(40,'Windows 10 64Bit','Professional','\"마이크로소프트\"','PC-OS','','√','TNFGR-HFCHC-3HMQR-B979F-6Q724','√',0,'4층',0,''),(41,'MS-Office 2003','\"Standard Edition\"','\"마이크로소프트\"','\"문서작성 / 프리젠테이션\"','','√','KV4XK-79988-W42FM-MWBC2-FRHJD','√',0,'4층',0,''),(42,'MS-Office 2003','\"Standard Edition\"','\"마이크로소프트\"','\"문서작성 / 프리젠테이션\"','','√','W9J2K-FR8XJ-43FYT-YCX4F-YMY4Q','√',0,'4층',0,''),(43,'MS-Office 2007','Professional','\"마이크로소프트\"','\"문서작성/프리젠테이션\"','','√','JM9VP-83KWM-WP846-CMH64-8VJ7W','',30,'4층',0,''),(44,'MS-Office 2007(업그레이드)','Professional','\"마이크로소프트\"','\"문서작성 / 프리젠테이션\"','','√','BDJWG-C9RPW-7QCVY-DD87T-V9H4M','√',0,'4층',0,''),(45,'MS-Office 2007(업그레이드)','Professional','\"마이크로소프트\"','\"문서작성 / 프리젠테이션\"','','√','D7PCX-MVJRH-7RR2B-X43W4-Y7WYY','√',0,'4층',0,''),(46,'MS-Office 2007(업그레이드)','Professional','\"마이크로소프트\"','\"문서작성 / 프리젠테이션\"','','√','B3VCK-YXC3B-9YF3T-4B3QP-WWTBY','√',0,'4층',0,''),(47,'MS-Office 2007(업그레이드)','Professional','\"마이크로소프트\"','\"문서작성 / 프리젠테이션\"','','√','GCV28-9WRHX-3WJKP-4JFBX-Y6FFM','√',0,'4층',0,''),(48,'MS-Office 2007(업그레이드)','Professional','\"마이크로소프트\"','\"문서작성 / 프리젠테이션\"','','√','TQHJ2-KCP23-74CVV-GGHC7-M774M','√',0,'4층',0,''),(49,'MS-Office 2007(업그레이드)','\"Standard Edition\"','\"마이크로소프트\"','\"문서작성 / 프리젠테이션\"','','√','VRF6F-P8P77-3GX3B-6FPMC-D9DJB','√',0,'4층',0,''),(50,'MS-Office 2007(업그레이드)','\"Standard Edition\"','\"마이크로소프트\"','\"문서작성 / 프리젠테이션\"','','√','KGHQP-HQ2PY-2HP2X-47HMH-4DMRM','√',0,'4층',0,''),(51,'MS-Office 2007(업그레이드)','\"Standard Edition\"','\"마이크로소프트\"','\"문서작성 / 프리젠테이션\"','','√','G93XY-2MM3K-JKQ99-PMQPW-P4YRM','√',0,'4층',0,''),(52,'MS-Office 2007(업그레이드)','\"Standard Edition\"','\"마이크로소프트\"','\"문서작성 / 프리젠테이션\"','','√','FV7RD-96TD4-Y8677-9DJXQ-B8MRM','√',0,'4층',0,''),(53,'MS-Office 2007(업그레이드)','\"Standard Edition\"','\"마이크로소프트\"','\"문서작성 / 프리젠테이션\"','','√','P397D-PYMWM-4MBMG-48CPF-RMV4M','√',0,'4층',0,''),(54,'MS-Office 2007(업그레이드)','\"Standard Edition\"','\"마이크로소프트\"','\"문서작성 / 프리젠테이션\"','','√','F726W-VJ2RT-9DM6G-H7YW3-RH3JB','√',0,'4층',0,''),(55,'MS-Office 2007','\"Standard Edition\"','\"마이크로소프트\"','\"문서작성 / 프리젠테이션\"','','√','JRD38-PYV8B-YKD4T-JWP9P-CTV4Q','√',0,'4층',0,''),(56,'MS-Office 2007','\"Standard Edition\"','\"마이크로소프트\"','\"문서작성 / 프리젠테이션\"','','√','W2DYV-Y3RTH-7G67P-CJ3GJ-CM68D','√',0,'4층',0,''),(57,'MS-Office 2007','\"Standard Edition\"','\"마이크로소프트\"','\"문서작성 / 프리젠테이션\"','','√','GRC7V-969V3-R99YJ-JVT7Y-B7RFQ','√',0,'4층',0,''),(58,'MS-Office 2007','\"Standard Edition\"','\"마이크로소프트\"','\"문서작성 / 프리젠테이션\"','','√','CMPKQ-GFT7M-WFGM6-XBFXV-WDTB3','√',0,'4층',0,''),(59,'MS-Office 2007','\"Standard Edition\"','\"마이크로소프트\"','\"문서작성 / 프리젠테이션\"','','√','BYCVJ-BWJP8-JYFFW-CJJVX-WPKWD','√',0,'4층',0,''),(60,'MS-Office 2007','\"Standard Edition\"','\"마이크로소프트\"','\"문서작성 / 프리젠테이션\"','','√','DGRCH-M6PPT-6VX3M-9DGKD-9T2M3','√',0,'4층',0,''),(61,'MS-Office 2007','\"Standard Edition\"','\"마이크로소프트\"','\"문서작성 / 프리젠테이션\"','','√','PWQ9Y-GWFVH-C2M2F-FJXHQ-VJCM3','√',0,'4층',0,''),(62,'MS-Office 2007','\"Standard Edition\"','\"마이크로소프트\"','\"문서작성 / 프리젠테이션\"','','√','VCVP3-YGPVP-6YXV4-G2V96-RKPM3','√',0,'4층',0,''),(63,'MS-Office 2007','\"Standard Edition\"','\"마이크로소프트\"','\"문서작성 / 프리젠테이션\"','','√','JCHDV-PD33J-32G64-P83DP-2774Q','√',0,'4층',0,''),(64,'MS-Office 2007','\"Standard Edition\"','\"마이크로소프트\"','\"문서작성 / 프리젠테이션\"','','√','QYMFV-T433H-T8KTB-B93JG-C6QJD','√',0,'4층',0,''),(65,'MS-Office 2007','\"Standard Edition\"','\"마이크로소프트\"','\"문서작성 / 프리젠테이션\"','','√','M6XKC-M7TWW-BG82J-D79PX-H9H4Q','√',0,'4층',0,''),(66,'MS-Office 2007','\"Standard Edition\"','\"마이크로소프트\"','\"문서작성 / 프리젠테이션\"','','√','FQDJF-G2TFF-W2W2V-38427-GY676','√',0,'4층',0,''),(67,'MS-Office 2007','\"Standard Edition\"','\"마이크로소프트\"','\"문서작성 / 프리젠테이션\"','','√','MFQQM-D8KRW-QMY4D-YCMBJ-TTQJD','√',0,'4층',0,''),(68,'MS-Office 2007','\"Standard Edition\"','\"마이크로소프트\"','\"문서작성 / 프리젠테이션\"','','√','DX79C-FRBMY-88J86-P77HT-RYQJD','√',0,'4층',0,''),(69,'MS-Office 2007','\"Standard Edition\"','\"마이크로소프트\"','\"문서작성 / 프리젠테이션\"','','√','QGW7Y-KQHWR-G7CG3-K7YJ9-T2BRQ','√',0,'4층',0,''),(70,'MS-Office 2007','\"Standard Edition\"','\"마이크로소프트\"','\"문서작성 / 프리젠테이션\"','','√','M86WF-FFKQ3-Y963M-WXR2H-TJ4FQ','√',0,'4층',0,''),(71,'MS-Office 2007','\"Standard Edition\"','\"마이크로소프트\"','\"문서작성 / 프리젠테이션\"','','√','RCD7Y-RFP8V-77RFH-MT3YJ-QG68D','√',0,'4층',0,''),(72,'MS-Office 2007','\"Standard Edition\"','\"마이크로소프트\"','\"문서작성 / 프리젠테이션\"','','√','C6898-YYBFP-39WXT-T8DBM-X7WY3','√',0,'4층',0,''),(73,'MS-Office 2007','\"Standard Edition\"','\"마이크로소프트\"','\"문서작성 / 프리젠테이션\"','','√','PVK96-M387P-RGGYV-HX9XF-6JTB3','√',0,'4층',0,''),(74,'MS-Office 2007','\"Standard Edition\"','\"마이크로소프트\"','\"문서작성 / 프리젠테이션\"','','√','W8B73-FMYCF-DHFKQ-3KM3G-GTV4Q','√',0,'4층',0,''),(75,'MS-Office 2007','\"Standard Edition\"','\"마이크로소프트\"','\"문서작성 / 프리젠테이션\"','','√','FP66C-XKGJH-YMXJ4-BBF9Y-GCBRQ','√',0,'4층',0,''),(76,'MS-Office 2007','\"Standard Edition\"','\"마이크로소프트\"','\"문서작성 / 프리젠테이션\"','','√','M2G3Y-BHJQ7-26H2J-HF6TY-W34FQ','√',0,'4층',0,''),(77,'MS-Office 2010','\"Standard Edition\"','\"마이크로소프트\"','\"문서작성 / 프리젠테이션\"','','√','HRCYV-TMKFB-CFK8P-V7QDQ-GHK2Y','',10,'4층',0,''),(78,'한글 2002','','한글과컴퓨터','문서작성','삼보PC','√','15192145-023176942','번들',0,'4층',0,''),(79,'한글 2002','SE','한글과컴퓨터','문서작성','삼보PC','√','15193725-008817130','번들',0,'4층',0,''),(80,'한글 2004','','한글과컴퓨터','문서작성','삼보PC','√','15353715-002342208','번들',0,'4층',0,''),(81,'한글 2004','','한글과컴퓨터','문서작성','삼보PC','√','15353715-002560884','번들',0,'4층',0,''),(82,'한글 2004','','한글과컴퓨터','문서작성','삼보PC','√','15353715-002586522','번들',0,'4층',0,''),(83,'한글 2004','','한글과컴퓨터','문서작성','삼보PC','√','15353715-002589587','번들',0,'4층',0,''),(84,'한글 2004','','한글과컴퓨터','문서작성','삼보PC','+','15353715-002586933','번들',0,'4층',0,''),(85,'한글 2004','','한글과컴퓨터','문서작성','삼보PC','√','15353715-002537863','번들',0,'4층',0,''),(86,'한글 2004','','한글과컴퓨터','문서작성','삼보PC','√','15353715-006562676','번들',0,'4층',0,''),(87,'한글 2004','','한글과컴퓨터','문서작성','삼보PC','√','15353715-002227723','번들',0,'4층',0,''),(88,'한글 2004','','한글과컴퓨터','문서작성','삼보PC','√','15353715-001576971','번들',0,'4층',0,''),(89,'한글 2004','','한글과컴퓨터','문서작성','삼보PC','√','15353715-002342208','번들',0,'4층',0,''),(90,'한글 2004','','한글과컴퓨터','문서작성','삼보PC','√','15353715-001672365','번들',0,'4층',0,''),(91,'한글 2004','','한글과컴퓨터','문서작성','삼보PC','√','15353755-034625084','번들',0,'4층',0,''),(92,'한글 2007','','한글과컴퓨터','문서작성','','√','16271211-063047935','√',0,'4층',0,''),(93,'한글 2007','','한글과컴퓨터','문서작성','','√','16271211-063048230','√',0,'4층',0,''),(94,'한글 2007','','한글과컴퓨터','문서작성','','√','16271119-000493224','',10,'4층',0,''),(95,'한글 2010','SE','한글과컴퓨터','문서작성','','√','17011271-239382089','√',0,'4층',0,''),(96,'한글 2010','SE','한글과컴퓨터','문서작성','','√','17011271-239388779','√',0,'4층',0,''),(97,'한글 2010','SE+','한글과컴퓨터','문서작성','','√','17011119-000663086','',8,'4층',0,''),(98,'한글 2010','SE+','한글과컴퓨터','문서작성','','√','17011119-000768413','',42,'4층',0,''),(99,'알집 (업그레이드)','7.0','이스트소프트','파일압축','','√','4W00-EXR7-806C-S36F','',8,'4층',0,''),(100,'알 FTP (업그레이드)','4.0','이스트소프트','\"파일송수신\"','','√','9BV5-M4AA-Y1CF-XPRE','',5,'4층',0,''),(101,'알 FTP','5.0','이스트소프트','\"파일송수신\"','','√','83AY-0RJ0-SPS3-FVY5','√',0,'4층',0,''),(102,'알툴즈','8.0 ','이스트소프트','\"편집파일전송확인\"','','√','BKL8-J6VS-C7EL-WR33','',7,'4층',0,''),(103,'알씨','6.0 ','이스트소프트','\"이미지파일확인\"','','√','QTUB-VX97-65EN-KJB9','',9,'4층',0,'장근식'),(104,'Adobe Acrobat','9','어도비','디자인','','√','1118-1727-6481-5488-8225-7497','√',0,'4층',0,''),(105,'Adobe Dreamweaver','4','어도비','디자인','','√','DWW400-01149-78206-45585','√',0,'4층',0,''),(106,'Adobe Dreamweaver(업그레이드)','MX','어도비','디자인','','√','DWD700-08474-08218-58013','',0,'4층',0,''),(107,'Adobe Design Standard','CS6','어도비','디자인','','√','1543-1007-0926-3322-8577-3250','√',0,'4층',0,''),(108,'Adobe Design Standard','CS6','어도비','디자인','','√','1543-1001-7956-8138-2118-9089','√',0,'4층',0,'류정미'),(109,'Adobe Design Standard','CS6','어도비','디자인','','√','1543-1505-9384-7342-5915-7301','',8,'4층',0,'박성경/백승경'),(110,'QuarkXpress xperience design','2015','인큐브테크','편집디자인','','√','제품코드 - JQ51692124866 S/N - 1X6AP487HAFVZUQV8ZENUVDCCBCZY8P3B9QMN1X3PGVPMR3\r\n세종폰트 - SLR3-5ZRG-YHOW-6BIV','',0,'4층',0,'백승경 editer1'),(111,'QuarkXpress xperience design','2015','인큐브테크','편집디자인','','√','제품코드 - JQ50192291816 S/N - EFFMTN7W8QKC6GFZECMJF3K87WUBQEE82VCTNN2YNPKCSTP \r\n세종폰트 - O4NQ-YHF0-VC2J-UJ2P','',0,'4층',0,''),(112,'QuarkXpress xperience design','2015','인큐브테크','편집디자인','','√','제품코드 - JQ50091381458 S/N - SEPKX2FPXF4TDTG4H8A5P322HXW1DA9D9N78BEUCUH49MRA \r\n세종폰트 - 11SU-LL8N-OY37-NNE1','',0,'4층',0,''),(113,'QuarkXpress xperience design','2015','인큐브테크','편집디자인','','√','제품코드 - JQ52410065222 S/N - DEVDX8XJXB444R9YVZ74F67VY5UN43QSE3VNVYHT11U78TR \r\n세종폰트 - AR4U-NMS4-QOPS-L2RG','',0,'4층',0,''),(114,'QuarkXpress xperience design','2015','인큐브테크','편집디자인','','√','제품코드 - JQ50881414050 S/N - 2C53GDKDQ52X482FBFKQA889CXBJYKQYKNUR35KAJVCGYKZ\r\n세종폰트 - 1TNM-1TZC-N91R-QYFA','',0,'4층',0,''),(115,'QuarkXpress xperience design','2015','인큐브테크','편집디자인','','√','제품코드 - JQ51601945817 S/N - RTR1N762YQNK7X4WZHKFQQKVYCBAVPUG8C7ZYMHGKKSGUKG\r\n세종폰트 - ELQR-SYKG-FEGZ-D3XA','',0,'4층',0,''),(116,'QuarkXpress xperience design','2015','인큐브테크','편집디자인','','√','제품코드 - JQ51601945817 S/N - RTR1N762YQNK7X4WZHKFQQKVYCBAVPUG8C7ZYMHGKKSGUKG \r\n세종폰트 - ELQR-SYKG-FEGZ-D3XA','',0,'4층',0,''),(117,'윤소호 Truetype Font','2010','윤디자인','디자인','','√','25E849C9-3509-E2A7E8A','√',0,'4층',0,''),(118,'윤소호 Truetype Font','2010','윤디자인','디자인','','√','3F709A42-3509-C9D60E2','√',0,'4층',0,''),(119,'CreFont','','윤디자인','디자인','','√','35826E8A-03-A23ABDA006','√',0,'4층',0,''),(120,'AsiaFont','TTF 통합패키지 398','아시아소프트','편집디자인','','√','WTP01-04C0-RJTZMW','√',0,'4층',0,'박성경'),(121,'AsiaFont','TTF 통합패키지 398','아시아소프트','편집디자인','','√','WTP01-F3C0-1CCZW5','√',0,'4층',0,'\"백승경 editer1\"'),(122,'AsiaFont','TTF 통합패키지 398','아시아소프트','편집디자인','','√','WTP01-C3C0-3N7ZLL','√',0,'4층',0,''),(123,'AsiaFont','TTF 통합패키지 398','아시아소프트','편집디자인','','√','WTP01-B3C0-Q59ZQZ','√',0,'4층',0,''),(124,'AsiaFont','TTF 통합패키지 398','아시아소프트','편집디자인','','√','WTP01-E3C0-734ZK3','√',0,'4층',0,''),(125,'AsiaFont','TTF 통합패키지 398','아시아소프트','편집디자인','','√','WTP01-D3C0-VTVZWR','√',0,'4층',0,''),(126,'AsiaFont','스탠다드','아시아소프트','편집디자인','','√','WTP11-D100-QS3ZTW','√',0,'4층',0,''),(127,'AsiaFont','스탠다드','아시아소프트','편집디자인','','√','WTP11-C100-MLZZUH','√',0,'4층',0,''),(128,'묵향','4','한양정보통신','편집디자인','','√','2737-1447-6930-7499','√',0,'4층',0,'박성경'),(129,'묵향','4','한양정보통신','편집디자인','','√','2734-0698-1834-6204','√',0,'4층',0,'\"백승경 editer1\"'),(130,'묵향','4','한양정보통신','편집디자인','','√','2714-1744-2953-2896','√',0,'4층',0,''),(131,'묵향','4','한양정보통신','편집디자인','','√','2777-9356-4693-1347','√',0,'4층',0,''),(132,'묵향','4','한양정보통신','편집디자인','','√','2525-0928-5407-6248','√',0,'4층',0,''),(133,'묵향','4','한양정보통신','편집디자인','','√','2698-3538-1936-3651','√',0,'4층',0,''),(134,'묵향','4','한양정보통신','편집디자인','','√','2656-4881-9078-8508','√',0,'4층',0,''),(135,'묵향','4','한양정보통신','편집디자인','','√','2659-5629-4174-9804','√',0,'4층',0,'');
/*!40000 ALTER TABLE `soft_progress` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `soft_stop`
--
DROP TABLE IF EXISTS `soft_stop`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `soft_stop` (
`idx` int(20) NOT NULL AUTO_INCREMENT,
`product_name` varchar(50) DEFAULT NULL,
`version` varchar(50) DEFAULT NULL,
`company` varchar(50) DEFAULT NULL,
`purpose` varchar(50) DEFAULT NULL,
`target` varchar(50) DEFAULT NULL,
`compatibility` varchar(50) DEFAULT NULL,
`sirial_num` varchar(300) DEFAULT NULL,
`package` varchar(50) DEFAULT NULL,
`license_numb` varchar(50) DEFAULT NULL,
`keep_place` varchar(50) DEFAULT NULL,
`remarks` varchar(50) DEFAULT NULL,
PRIMARY KEY (`idx`)
) ENGINE=MyISAM AUTO_INCREMENT=33 DEFAULT CHARSET=utf8 COMMENT='소프트사용불가';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `soft_stop`
--
LOCK TABLES `soft_stop` WRITE;
/*!40000 ALTER TABLE `soft_stop` DISABLE KEYS */;
INSERT INTO `soft_stop` VALUES (1,'QuarkXpress(미개봉) xperience design','8K','인큐브테크','편집디자인','','√','KO51201205623','','','폐기',''),(2,'QuarkXpress(미개봉) xperience design','8K','인큐브테크','편집디자인','','√','KO50501215126','','','폐기',''),(3,'QuarkXpress(미개봉) xperience design','8K','인큐브테크','편집디자인','','√','KO52131911724','','','폐기',''),(4,'QuarkXpress(미개봉) xperience design','8K','인큐브테크','편집디자인','','√','KO51240617231','','','폐기',''),(5,'QuarkXpress(미개봉) xperience design','8K','인큐브테크','편집디자인','','√','KO51011165684','','','폐기',''),(6,'QuarkXpress(미개봉) xperience design','8K','인큐브테크','편집디자인','','√','KO52182355665','','','폐기',''),(7,'QuarkXpress(미개봉) xperience design','8K','인큐브테크','편집디자인','','√','KO51251441128','','','폐기',''),(8,'QuarkXpress(미개봉) xperience design','8K','인큐브테크','편집디자인','','√','KO50930112000','','','폐기',''),(9,'QuarkXpress(미개봉) xperience design','9','인큐브테크','편집디자인','','√','KO50361347104','','','폐기',''),(10,'QuarkXpress(미개봉) xperience design','9','인큐브테크','편집디자인','','√','KO50460496652','','','폐기',''),(11,'QuarkXpress(미개봉) xperience design','9','인큐브테크','편집디자인','','√','KO50640961027','','','폐기',''),(12,'QuarkXpress(미개봉) xperience design','9','인큐브테크','편집디자인','','√','KO50872376020','√','','폐기',''),(13,'QuarkXpress(미개봉) xperience design','9','인큐브테크','편집디자인','','√','KO52110898714','√','','폐기',''),(16,'Windows 7 32Bit(미개봉)','Professional','\"마이크로 소프트\"','PC-OS','','√','SX9X7QE036','√','','4층','\"Windows XP (다운그레이드)\"\r'),(17,'Windows 7 32Bit(미개봉)','Professional','\"마이크로 소프트\"','PC-OS','','√','SX9X7QE03E','√','','4층','\"Windows XP (다운그레이드)\"\r'),(18,'Windows 7 32Bit(미개봉)','Professional','\"마이크로 소프트\"','PC-OS','','√','SX9X7QE03F','√','','4층','\"Windows XP (다운그레이드)\"\r'),(19,'Windows 7 32Bit(미개봉)','Professional','\"마이크로 소프트\"','PC-OS','','√','SX9X7QE038','√','','4층','\"Windows XP (다운그레이드)\"\r'),(20,'Windows 7 32Bit(미개봉)','Professional','\"마이크로 소프트\"','PC-OS','','√','SX9X7QE037','√','','4층','\"Windows XP (다운그레이드)\"\r'),(21,'Windows 7 32Bit(미개봉)','Professional','\"마이크로 소프트\"','PC-OS','','√','SX9X7QE034','√','','4층','\"Windows XP (다운그레이드)\"\r'),(22,'Windows 7 32Bit(미개봉)','Professional','\"마이크로 소프트\"','PC-OS','','√','SX9X7QE039','√','','4층','\"Windows XP (다운그레이드)\"\r'),(23,'Windows 10 64Bit(미개봉)','Professional','\"마이크로 소프트\"','PC-OS','','√','9DT2N-PGDRM-WG7PV-TGDCW-2GYP4','√','','4층','예비1\r'),(24,'Windows 10 64Bit(미개봉)','Professional','\"마이크로 소프트\"','PC-OS','','√','GYQPC-6NVGR-B49JC-76G9F-WFG6R','√','','4층','예비2\r'),(25,'Windows 10 64Bit(미개봉)','Professional','\"마이크로 소프트\"','PC-OS','','√','8KVDN-Y7V6Q-99WG9-DHJVY-KD724','√','','4층','예비3\r');
/*!40000 ALTER TABLE `soft_stop` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `software`
--
DROP TABLE IF EXISTS `software`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `software` (
`idx` int(20) NOT NULL AUTO_INCREMENT,
`window_pro` varchar(20) DEFAULT NULL,
`msoffice_pro` varchar(20) DEFAULT NULL,
`hangeul_pro` varchar(20) DEFAULT NULL,
`use_soft` varchar(10) DEFAULT NULL,
`quantity` int(10) DEFAULT NULL,
PRIMARY KEY (`idx`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `software`
--
LOCK TABLES `software` WRITE;
/*!40000 ALTER TABLE `software` DISABLE KEYS */;
/*!40000 ALTER TABLE `software` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `users`
--
DROP TABLE IF EXISTS `users`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `users` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`username` varchar(50) DEFAULT NULL COMMENT '아이디',
`password` varchar(50) DEFAULT NULL COMMENT '비밀번호',
`name` varchar(50) DEFAULT NULL COMMENT '이름',
`email` varchar(50) DEFAULT NULL COMMENT '이메일',
`reg_date` datetime DEFAULT NULL COMMENT '가입일',
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='회원테이블';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `users`
--
LOCK TABLES `users` WRITE;
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
INSERT INTO `users` VALUES (1,'advisor','1234','palpit','zhfldi4@gmail.com','2016-09-05 10:32:12'),(2,'admin','cjdwnryckfh','admin','keunsik@nzine.co.kr','2016-09-05 15:31:53');
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `xp_down`
--
DROP TABLE IF EXISTS `xp_down`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `xp_down` (
`idx` int(20) NOT NULL AUTO_INCREMENT,
`window7` varchar(20) DEFAULT NULL,
PRIMARY KEY (`idx`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `xp_down`
--
LOCK TABLES `xp_down` WRITE;
/*!40000 ALTER TABLE `xp_down` DISABLE KEYS */;
INSERT INTO `xp_down` VALUES (1,'SX9XX7QE035'),(2,'SX9X7QE036'),(4,'SX9X7QE038'),(5,'SX9X7QE03E'),(6,'SX9X7QE03F'),(7,'SX9X7QE037'),(8,'SX9X7QE034'),(9,'SX9X7QE039');
/*!40000 ALTER TABLE `xp_down` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2016-10-21 17:22:34
| 95.40377 | 15,213 | 0.64388 |
1fcfbf8f0ce5982dfeb9f247a34742ecb18e0803 | 27,280 | html | HTML | using-a-forecast.html | uva-engineering-decision-analysis/class_notes | edb3835e0ae4bb3b14c696e078f650df6bff2ee5 | [
"CC0-1.0"
] | null | null | null | using-a-forecast.html | uva-engineering-decision-analysis/class_notes | edb3835e0ae4bb3b14c696e078f650df6bff2ee5 | [
"CC0-1.0"
] | null | null | null | using-a-forecast.html | uva-engineering-decision-analysis/class_notes | edb3835e0ae4bb3b14c696e078f650df6bff2ee5 | [
"CC0-1.0"
] | null | null | null | <!DOCTYPE html>
<html lang="" xml:lang="">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>11 Using a forecast | Introduction to Decision Analysis</title>
<meta name="description" content="An introduction to decision analysis, based on statistical decision theory, with examples." />
<meta name="generator" content="bookdown 0.18 and GitBook 2.6.7" />
<meta property="og:title" content="11 Using a forecast | Introduction to Decision Analysis" />
<meta property="og:type" content="book" />
<meta property="og:description" content="An introduction to decision analysis, based on statistical decision theory, with examples." />
<meta name="twitter:card" content="summary" />
<meta name="twitter:title" content="11 Using a forecast | Introduction to Decision Analysis" />
<meta name="twitter:description" content="An introduction to decision analysis, based on statistical decision theory, with examples." />
<meta name="author" content="Arthur Small" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<link rel="prev" href="statistical-forecasting-model.html"/>
<script src="libs/jquery-2.2.3/jquery.min.js"></script>
<link href="libs/gitbook-2.6.7/css/style.css" rel="stylesheet" />
<link href="libs/gitbook-2.6.7/css/plugin-table.css" rel="stylesheet" />
<link href="libs/gitbook-2.6.7/css/plugin-bookdown.css" rel="stylesheet" />
<link href="libs/gitbook-2.6.7/css/plugin-highlight.css" rel="stylesheet" />
<link href="libs/gitbook-2.6.7/css/plugin-search.css" rel="stylesheet" />
<link href="libs/gitbook-2.6.7/css/plugin-fontsettings.css" rel="stylesheet" />
<link href="libs/gitbook-2.6.7/css/plugin-clipboard.css" rel="stylesheet" />
<style type="text/css">
a.sourceLine { display: inline-block; line-height: 1.25; }
a.sourceLine { pointer-events: none; color: inherit; text-decoration: inherit; }
a.sourceLine:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode { white-space: pre; position: relative; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
code.sourceCode { white-space: pre-wrap; }
a.sourceLine { text-indent: -1em; padding-left: 1em; }
}
pre.numberSource a.sourceLine
{ position: relative; left: -4em; }
pre.numberSource a.sourceLine::before
{ content: attr(title);
position: relative; left: -1em; text-align: right; vertical-align: baseline;
border: none; pointer-events: all; display: inline-block;
-webkit-touch-callout: none; -webkit-user-select: none;
-khtml-user-select: none; -moz-user-select: none;
-ms-user-select: none; user-select: none;
padding: 0 4px; width: 4em;
color: #aaaaaa;
}
pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
div.sourceCode
{ }
@media screen {
a.sourceLine::before { text-decoration: underline; }
}
code span.al { color: #ff0000; font-weight: bold; } /* Alert */
code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
code span.at { color: #7d9029; } /* Attribute */
code span.bn { color: #40a070; } /* BaseN */
code span.bu { } /* BuiltIn */
code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
code span.ch { color: #4070a0; } /* Char */
code span.cn { color: #880000; } /* Constant */
code span.co { color: #60a0b0; font-style: italic; } /* Comment */
code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
code span.do { color: #ba2121; font-style: italic; } /* Documentation */
code span.dt { color: #902000; } /* DataType */
code span.dv { color: #40a070; } /* DecVal */
code span.er { color: #ff0000; font-weight: bold; } /* Error */
code span.ex { } /* Extension */
code span.fl { color: #40a070; } /* Float */
code span.fu { color: #06287e; } /* Function */
code span.im { } /* Import */
code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
code span.kw { color: #007020; font-weight: bold; } /* Keyword */
code span.op { color: #666666; } /* Operator */
code span.ot { color: #007020; } /* Other */
code span.pp { color: #bc7a00; } /* Preprocessor */
code span.sc { color: #4070a0; } /* SpecialChar */
code span.ss { color: #bb6688; } /* SpecialString */
code span.st { color: #4070a0; } /* String */
code span.va { color: #19177c; } /* Variable */
code span.vs { color: #4070a0; } /* VerbatimString */
code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
</style>
</head>
<body>
<div class="book without-animation with-summary font-size-2 font-family-1" data-basepath=".">
<div class="book-summary">
<nav role="navigation">
<ul class="summary">
<li class="chapter" data-level="1" data-path="index.html"><a href="index.html"><i class="fa fa-check"></i><b>1</b> Introduction</a><ul>
<li class="chapter" data-level="1.1" data-path="index.html"><a href="index.html#data-driven-decision-making"><i class="fa fa-check"></i><b>1.1</b> Data-driven decision-making</a><ul>
<li class="chapter" data-level="1.1.1" data-path="index.html"><a href="index.html#data-driven-decision-making-motivations"><i class="fa fa-check"></i><b>1.1.1</b> Data-driven decision-making: Motivations</a></li>
<li class="chapter" data-level="1.1.2" data-path="index.html"><a href="index.html#the-general-form-of-the-problems-well-take-up"><i class="fa fa-check"></i><b>1.1.2</b> The general form of the problems we’ll take up</a></li>
<li class="chapter" data-level="1.1.3" data-path="index.html"><a href="index.html#building-decision-models"><i class="fa fa-check"></i><b>1.1.3</b> Building decision models</a></li>
</ul></li>
<li class="chapter" data-level="1.2" data-path="index.html"><a href="index.html#formalism-for-statistical-decision-models"><i class="fa fa-check"></i><b>1.2</b> Formalism for statistical decision models</a><ul>
<li class="chapter" data-level="1.2.1" data-path="index.html"><a href="index.html#actions"><i class="fa fa-check"></i><b>1.2.1</b> Actions</a></li>
<li class="chapter" data-level="1.2.2" data-path="index.html"><a href="index.html#states"><i class="fa fa-check"></i><b>1.2.2</b> States</a></li>
<li class="chapter" data-level="1.2.3" data-path="index.html"><a href="index.html#random-states"><i class="fa fa-check"></i><b>1.2.3</b> Random states</a></li>
<li class="chapter" data-level="1.2.4" data-path="index.html"><a href="index.html#random-variables"><i class="fa fa-check"></i><b>1.2.4</b> Random variables</a></li>
<li class="chapter" data-level="1.2.5" data-path="index.html"><a href="index.html#random-states-1"><i class="fa fa-check"></i><b>1.2.5</b> Random states</a></li>
<li class="chapter" data-level="1.2.6" data-path="index.html"><a href="index.html#parameters"><i class="fa fa-check"></i><b>1.2.6</b> Parameters</a></li>
<li class="chapter" data-level="1.2.7" data-path="index.html"><a href="index.html#payoffs"><i class="fa fa-check"></i><b>1.2.7</b> Payoffs</a></li>
</ul></li>
<li class="chapter" data-level="1.3" data-path="index.html"><a href="index.html#statistical-decision-theory"><i class="fa fa-check"></i><b>1.3</b> Statistical decision theory</a><ul>
<li class="chapter" data-level="1.3.1" data-path="index.html"><a href="index.html#formalism-for-statistical-decision-models-1"><i class="fa fa-check"></i><b>1.3.1</b> Formalism for statistical decision models</a></li>
</ul></li>
<li class="chapter" data-level="1.4" data-path="index.html"><a href="index.html#review"><i class="fa fa-check"></i><b>1.4</b> Review</a><ul>
<li class="chapter" data-level="1.4.1" data-path="index.html"><a href="index.html#big-picture-how-to-make-optimal-choices-under-statistical-uncertainty"><i class="fa fa-check"></i><b>1.4.1</b> Big picture: How to make optimal choices under statistical uncertainty?</a></li>
<li class="chapter" data-level="1.4.2" data-path="index.html"><a href="index.html#uncertainty"><i class="fa fa-check"></i><b>1.4.2</b> Uncertainty</a></li>
<li class="chapter" data-level="1.4.3" data-path="index.html"><a href="index.html#optimal-choice"><i class="fa fa-check"></i><b>1.4.3</b> Optimal choice</a></li>
<li class="chapter" data-level="1.4.4" data-path="index.html"><a href="index.html#optimization-defining-objectives"><i class="fa fa-check"></i><b>1.4.4</b> Optimization: Defining objectives</a></li>
<li class="chapter" data-level="1.4.5" data-path="index.html"><a href="index.html#integrating-predictive-and-inferential-tools-into-the-decision-calculus"><i class="fa fa-check"></i><b>1.4.5</b> Integrating predictive and inferential tools into the decision calculus</a></li>
<li class="chapter" data-level="1.4.6" data-path="index.html"><a href="index.html#payoff-functions-define-in-terms-of-x-state-or-theta-parameter-value"><i class="fa fa-check"></i><b>1.4.6</b> Payoff functions: Define in terms of <span class="math inline">\(x\)</span> (state) or <span class="math inline">\(\theta\)</span> (parameter value)?</a></li>
<li class="chapter" data-level="1.4.7" data-path="index.html"><a href="index.html#parameter-dependent-payoffs-as-reduced-form-of-state-dependent-payoffs"><i class="fa fa-check"></i><b>1.4.7</b> Parameter-dependent payoffs as reduced form of state-dependent payoffs</a></li>
</ul></li>
</ul></li>
<li class="chapter" data-level="2" data-path="additional-notes.html"><a href="additional-notes.html"><i class="fa fa-check"></i><b>2</b> Additional notes</a></li>
<li class="chapter" data-level="3" data-path="prediction.html"><a href="prediction.html"><i class="fa fa-check"></i><b>3</b> Prediction</a><ul>
<li class="chapter" data-level="3.0.1" data-path="prediction.html"><a href="prediction.html#big-picture-data-driven-decision-making"><i class="fa fa-check"></i><b>3.0.1</b> Big picture: data-driven decision-making</a></li>
<li class="chapter" data-level="3.0.2" data-path="prediction.html"><a href="prediction.html#predictive-models"><i class="fa fa-check"></i><b>3.0.2</b> Predictive models</a></li>
<li class="chapter" data-level="3.0.3" data-path="prediction.html"><a href="prediction.html#probabilistic-predictions"><i class="fa fa-check"></i><b>3.0.3</b> Probabilistic predictions</a></li>
<li class="chapter" data-level="3.1" data-path="prediction.html"><a href="prediction.html#bayesian-methods"><i class="fa fa-check"></i><b>3.1</b> Bayesian Methods</a><ul>
<li class="chapter" data-level="3.1.1" data-path="prediction.html"><a href="prediction.html#reminder-example-conditional-probabilities"><i class="fa fa-check"></i><b>3.1.1</b> Reminder example: conditional probabilities</a></li>
<li class="chapter" data-level="3.1.2" data-path="prediction.html"><a href="prediction.html#section"><i class="fa fa-check"></i><b>3.1.2</b> </a></li>
<li class="chapter" data-level="3.1.3" data-path="prediction.html"><a href="prediction.html#bayesian-methods-introduction-via-simple-example"><i class="fa fa-check"></i><b>3.1.3</b> Bayesian methods: Introduction via simple example</a></li>
<li class="chapter" data-level="3.1.4" data-path="prediction.html"><a href="prediction.html#sampling-model"><i class="fa fa-check"></i><b>3.1.4</b> Sampling model</a></li>
<li class="chapter" data-level="3.1.5" data-path="prediction.html"><a href="prediction.html#section-1"><i class="fa fa-check"></i><b>3.1.5</b> </a></li>
<li class="chapter" data-level="3.1.6" data-path="prediction.html"><a href="prediction.html#section-2"><i class="fa fa-check"></i><b>3.1.6</b> </a></li>
<li class="chapter" data-level="3.1.7" data-path="prediction.html"><a href="prediction.html#prior-information"><i class="fa fa-check"></i><b>3.1.7</b> Prior information</a></li>
<li class="chapter" data-level="3.1.8" data-path="prediction.html"><a href="prediction.html#the-beta-distribution"><i class="fa fa-check"></i><b>3.1.8</b> The Beta distribution</a></li>
<li class="chapter" data-level="3.1.9" data-path="prediction.html"><a href="prediction.html#section-3"><i class="fa fa-check"></i><b>3.1.9</b> </a></li>
<li class="chapter" data-level="3.1.10" data-path="prediction.html"><a href="prediction.html#section-4"><i class="fa fa-check"></i><b>3.1.10</b> </a></li>
<li class="chapter" data-level="3.1.11" data-path="prediction.html"><a href="prediction.html#bayes-theorem"><i class="fa fa-check"></i><b>3.1.11</b> Bayes Theorem</a></li>
<li class="chapter" data-level="3.1.12" data-path="prediction.html"><a href="prediction.html#section-5"><i class="fa fa-check"></i><b>3.1.12</b> </a></li>
<li class="chapter" data-level="3.1.13" data-path="prediction.html"><a href="prediction.html#section-6"><i class="fa fa-check"></i><b>3.1.13</b> </a></li>
<li class="chapter" data-level="3.1.14" data-path="prediction.html"><a href="prediction.html#sensitivity-analysis"><i class="fa fa-check"></i><b>3.1.14</b> Sensitivity analysis</a></li>
</ul></li>
<li class="chapter" data-level="3.2" data-path="prediction.html"><a href="prediction.html#building-a-predictive-model"><i class="fa fa-check"></i><b>3.2</b> Building a predictive model</a><ul>
<li class="chapter" data-level="3.2.1" data-path="prediction.html"><a href="prediction.html#section-7"><i class="fa fa-check"></i><b>3.2.1</b> </a></li>
<li class="chapter" data-level="3.2.2" data-path="prediction.html"><a href="prediction.html#section-8"><i class="fa fa-check"></i><b>3.2.2</b> </a></li>
<li class="chapter" data-level="3.2.3" data-path="prediction.html"><a href="prediction.html#section-9"><i class="fa fa-check"></i><b>3.2.3</b> </a></li>
<li class="chapter" data-level="3.2.4" data-path="prediction.html"><a href="prediction.html#prediction-via-the-predictive-distribution"><i class="fa fa-check"></i><b>3.2.4</b> Prediction via the predictive distribution</a></li>
</ul></li>
</ul></li>
<li class="chapter" data-level="4" data-path="forecast-evaluation.html"><a href="forecast-evaluation.html"><i class="fa fa-check"></i><b>4</b> Forecast evaluation</a><ul>
<li class="chapter" data-level="4.1" data-path="forecast-evaluation.html"><a href="forecast-evaluation.html#evaluating-forecasting-systems-scoring-rules"><i class="fa fa-check"></i><b>4.1</b> Evaluating forecasting systems: Scoring rules</a><ul>
<li class="chapter" data-level="4.1.1" data-path="forecast-evaluation.html"><a href="forecast-evaluation.html#q-how-good-is-your-forecasting-system"><i class="fa fa-check"></i><b>4.1.1</b> Q: “How good is your forecasting system?”</a></li>
<li class="chapter" data-level="4.1.2" data-path="forecast-evaluation.html"><a href="forecast-evaluation.html#but-is-it-really"><i class="fa fa-check"></i><b>4.1.2</b> But is it really?</a></li>
</ul></li>
</ul></li>
<li class="chapter" data-level="5" data-path="the-value-of-information.html"><a href="the-value-of-information.html"><i class="fa fa-check"></i><b>5</b> The Value of Information</a></li>
<li class="chapter" data-level="6" data-path="example-decision-problem-whether-to-buy-refrigeration.html"><a href="example-decision-problem-whether-to-buy-refrigeration.html"><i class="fa fa-check"></i><b>6</b> Example decision problem: Whether to buy refrigeration</a></li>
<li class="chapter" data-level="7" data-path="formalism.html"><a href="formalism.html"><i class="fa fa-check"></i><b>7</b> Formalism</a><ul>
<li class="chapter" data-level="7.1" data-path="formalism.html"><a href="formalism.html#action-set"><i class="fa fa-check"></i><b>7.1</b> Action set</a></li>
<li class="chapter" data-level="7.2" data-path="formalism.html"><a href="formalism.html#payoffs-the-loss-function"><i class="fa fa-check"></i><b>7.2</b> Payoffs: The loss function</a></li>
<li class="chapter" data-level="7.3" data-path="formalism.html"><a href="formalism.html#uncertainty-1"><i class="fa fa-check"></i><b>7.3</b> Uncertainty</a></li>
<li class="chapter" data-level="7.4" data-path="formalism.html"><a href="formalism.html#decision-criterion"><i class="fa fa-check"></i><b>7.4</b> Decision criterion</a></li>
<li class="chapter" data-level="7.5" data-path="formalism.html"><a href="formalism.html#simulation-of-the-prediction-process-no-covariates"><i class="fa fa-check"></i><b>7.5</b> Simulation of the prediction process, no covariates</a></li>
</ul></li>
<li class="chapter" data-level="8" data-path="the-decision-problem.html"><a href="the-decision-problem.html"><i class="fa fa-check"></i><b>8</b> The decision problem</a></li>
<li class="chapter" data-level="9" data-path="formalism-1.html"><a href="formalism-1.html"><i class="fa fa-check"></i><b>9</b> Formalism</a><ul>
<li class="chapter" data-level="9.1" data-path="formalism-1.html"><a href="formalism-1.html#action-set-1"><i class="fa fa-check"></i><b>9.1</b> Action set</a></li>
<li class="chapter" data-level="9.2" data-path="formalism-1.html"><a href="formalism-1.html#payoffs-the-loss-function-1"><i class="fa fa-check"></i><b>9.2</b> Payoffs: The loss function</a></li>
<li class="chapter" data-level="9.3" data-path="formalism-1.html"><a href="formalism-1.html#uncertainty-2"><i class="fa fa-check"></i><b>9.3</b> Uncertainty</a></li>
<li class="chapter" data-level="9.4" data-path="formalism-1.html"><a href="formalism-1.html#decision-criterion-1"><i class="fa fa-check"></i><b>9.4</b> Decision criterion</a></li>
</ul></li>
<li class="chapter" data-level="10" data-path="statistical-forecasting-model.html"><a href="statistical-forecasting-model.html"><i class="fa fa-check"></i><b>10</b> Statistical forecasting model</a><ul>
<li class="chapter" data-level="10.1" data-path="statistical-forecasting-model.html"><a href="statistical-forecasting-model.html#historical-data"><i class="fa fa-check"></i><b>10.1</b> Historical data</a></li>
<li class="chapter" data-level="10.2" data-path="statistical-forecasting-model.html"><a href="statistical-forecasting-model.html#model-of-the-data-generating-process"><i class="fa fa-check"></i><b>10.2</b> Model of the data generating process</a></li>
<li class="chapter" data-level="10.3" data-path="statistical-forecasting-model.html"><a href="statistical-forecasting-model.html#comments-on-this-statistical-model-the-risk-of-model-mis-specification"><i class="fa fa-check"></i><b>10.3</b> Comments on this statistical model: The risk of model mis-specification</a></li>
<li class="chapter" data-level="10.4" data-path="statistical-forecasting-model.html"><a href="statistical-forecasting-model.html#simulation-of-the-prediction-process-no-covariates-1"><i class="fa fa-check"></i><b>10.4</b> Simulation of the prediction process, no covariates</a></li>
</ul></li>
<li class="chapter" data-level="11" data-path="using-a-forecast.html"><a href="using-a-forecast.html"><i class="fa fa-check"></i><b>11</b> Using a forecast</a></li>
</ul>
</nav>
</div>
<div class="book-body">
<div class="body-inner">
<div class="book-header" role="navigation">
<h1>
<i class="fa fa-circle-o-notch fa-spin"></i><a href="./">Introduction to Decision Analysis</a>
</h1>
</div>
<div class="page-wrapper" tabindex="-1" role="main">
<div class="page-inner">
<section class="normal" id="section-">
<div id="using-a-forecast" class="section level1">
<h1><span class="header-section-number">11</span> Using a forecast</h1>
<div class="sourceCode" id="cb28"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb28-1" title="1">forecast_bias <-<span class="st"> </span><span class="fl">-0.5</span></a>
<a class="sourceLine" id="cb28-2" title="2">forecast_std_error <-<span class="st"> </span><span class="dv">1</span></a>
<a class="sourceLine" id="cb28-3" title="3"></a>
<a class="sourceLine" id="cb28-4" title="4">forecast_errors <-<span class="st"> </span><span class="kw">rnorm</span>(n,<span class="dt">mean =</span> forecast_bias,<span class="dt">sd =</span> forecast_std_error)</a>
<a class="sourceLine" id="cb28-5" title="5"></a>
<a class="sourceLine" id="cb28-6" title="6">x <-<span class="st"> </span>y <span class="op">+</span><span class="st"> </span>forecast_errors</a>
<a class="sourceLine" id="cb28-7" title="7"></a>
<a class="sourceLine" id="cb28-8" title="8">linear_model <-<span class="st"> </span><span class="kw">lm</span>(y<span class="op">~</span>x)</a>
<a class="sourceLine" id="cb28-9" title="9"></a>
<a class="sourceLine" id="cb28-10" title="10"><span class="kw">plot</span>(x,y, <span class="dt">xlab =</span> <span class="st">"Forecast temperature"</span>, <span class="dt">ylab =</span> <span class="st">"Observed temperature"</span>)</a>
<a class="sourceLine" id="cb28-11" title="11"><span class="kw">abline</span>(linear_model)</a></code></pre></div>
<p><img src="_main_files/figure-html/unnamed-chunk-12-1.png" width="672" /></p>
<div class="sourceCode" id="cb29"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb29-1" title="1"><span class="kw">plot</span>(x,y)</a></code></pre></div>
<p><img src="_main_files/figure-html/unnamed-chunk-13-1.png" width="672" /></p>
<p>Simulation of the prediction process, one covariate</p>
<div class="sourceCode" id="cb30"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb30-1" title="1"><span class="kw">library</span>(MASS)</a>
<a class="sourceLine" id="cb30-2" title="2"></a>
<a class="sourceLine" id="cb30-3" title="3"></a>
<a class="sourceLine" id="cb30-4" title="4">Sigma <-<span class="st"> </span><span class="kw">matrix</span>(<span class="kw">c</span>(<span class="dv">10</span>,<span class="dv">3</span>,<span class="dv">3</span>,<span class="dv">2</span>),<span class="dv">2</span>,<span class="dv">2</span>)</a>
<a class="sourceLine" id="cb30-5" title="5">Sigma</a></code></pre></div>
<pre><code>## [,1] [,2]
## [1,] 10 3
## [2,] 3 2</code></pre>
<div class="sourceCode" id="cb32"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb32-1" title="1"><span class="kw">var</span>(<span class="kw">mvrnorm</span>(<span class="dt">n=</span><span class="dv">1000</span>, <span class="kw">rep</span>(<span class="dv">0</span>, <span class="dv">2</span>), Sigma))</a></code></pre></div>
<pre><code>## [,1] [,2]
## [1,] 9.042565 2.692982
## [2,] 2.692982 1.935439</code></pre>
<div class="sourceCode" id="cb34"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb34-1" title="1"><span class="kw">var</span>(<span class="kw">mvrnorm</span>(<span class="dt">n=</span><span class="dv">1000</span>, <span class="kw">rep</span>(<span class="dv">0</span>, <span class="dv">2</span>), Sigma, <span class="dt">empirical =</span> <span class="ot">TRUE</span>))</a></code></pre></div>
<pre><code>## [,1] [,2]
## [1,] 10 3
## [2,] 3 2</code></pre>
<div class="sourceCode" id="cb36"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb36-1" title="1"><span class="kw">library</span>(MASS) <span class="co"># Load packages for working with multivariate normal distributions</span></a>
<a class="sourceLine" id="cb36-2" title="2"></a>
<a class="sourceLine" id="cb36-3" title="3"><span class="kw">set.seed</span>(<span class="dv">1</span>) <span class="co"># Keep random data from changing each time the code is run</span></a>
<a class="sourceLine" id="cb36-4" title="4"></a>
<a class="sourceLine" id="cb36-5" title="5"><span class="co"># Variables</span></a>
<a class="sourceLine" id="cb36-6" title="6"><span class="co"># y : temperature on March 17</span></a>
<a class="sourceLine" id="cb36-7" title="7"><span class="co"># x : covariate, e.g., forecast of temp on Mar 17</span></a>
<a class="sourceLine" id="cb36-8" title="8"></a>
<a class="sourceLine" id="cb36-9" title="9">theta <-<span class="st"> </span><span class="dv">18</span></a>
<a class="sourceLine" id="cb36-10" title="10"></a>
<a class="sourceLine" id="cb36-11" title="11"></a>
<a class="sourceLine" id="cb36-12" title="12"></a>
<a class="sourceLine" id="cb36-13" title="13">x <-<span class="st"> </span><span class="kw">rnorm</span>(N, <span class="dt">mean=</span>theta, <span class="dt">sd=</span>sigma_x)</a>
<a class="sourceLine" id="cb36-14" title="14"></a>
<a class="sourceLine" id="cb36-15" title="15">Theta <-<span class="st"> </span><span class="kw">c</span>(<span class="dv">0</span>,<span class="dv">18</span>) <span class="co"># True long-run average</span></a>
<a class="sourceLine" id="cb36-16" title="16">Sigma <-<span class="st"> </span><span class="dv">3</span> <span class="co"># True stnd dev of temp around this mean</span></a>
<a class="sourceLine" id="cb36-17" title="17">N <-<span class="st"> </span><span class="dv">40</span> <span class="co"># number of simulated historical data points</span></a>
<a class="sourceLine" id="cb36-18" title="18"></a>
<a class="sourceLine" id="cb36-19" title="19">y <-<span class="st"> </span><span class="kw">rnorm</span>(n,theta,sigma)</a>
<a class="sourceLine" id="cb36-20" title="20"></a>
<a class="sourceLine" id="cb36-21" title="21"><span class="kw">hist</span>(y, <span class="dt">breaks =</span> <span class="dv">10</span>, <span class="dt">main =</span> <span class="st">"Histogram of historical temperatures in degrees C"</span>)</a></code></pre></div>
</div>
</section>
</div>
</div>
</div>
<a href="statistical-forecasting-model.html" class="navigation navigation-prev navigation-unique" aria-label="Previous page"><i class="fa fa-angle-left"></i></a>
</div>
</div>
<script src="libs/gitbook-2.6.7/js/app.min.js"></script>
<script src="libs/gitbook-2.6.7/js/lunr.js"></script>
<script src="libs/gitbook-2.6.7/js/clipboard.min.js"></script>
<script src="libs/gitbook-2.6.7/js/plugin-search.js"></script>
<script src="libs/gitbook-2.6.7/js/plugin-sharing.js"></script>
<script src="libs/gitbook-2.6.7/js/plugin-fontsettings.js"></script>
<script src="libs/gitbook-2.6.7/js/plugin-bookdown.js"></script>
<script src="libs/gitbook-2.6.7/js/jquery.highlight.js"></script>
<script src="libs/gitbook-2.6.7/js/plugin-clipboard.js"></script>
<script>
gitbook.require(["gitbook"], function(gitbook) {
gitbook.start({
"sharing": {
"github": false,
"facebook": true,
"twitter": true,
"linkedin": false,
"weibo": false,
"instapaper": false,
"vk": false,
"all": ["facebook", "twitter", "linkedin", "weibo", "instapaper"]
},
"fontsettings": {
"theme": "white",
"family": "sans",
"size": 2
},
"edit": {
"link": null,
"text": null
},
"history": {
"link": null,
"text": null
},
"view": {
"link": null,
"text": null
},
"download": null,
"toc": {
"collapse": "subsection"
}
});
});
</script>
<!-- dynamically load mathjax for compatibility with self-contained -->
<script>
(function () {
var script = document.createElement("script");
script.type = "text/javascript";
var src = "true";
if (src === "" || src === "true") src = "https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-MML-AM_CHTML";
if (location.protocol !== "file:")
if (/^https?:/.test(src))
src = src.replace(/^https?:/, '');
script.src = src;
document.getElementsByTagName("head")[0].appendChild(script);
})();
</script>
</body>
</html>
| 75.777778 | 426 | 0.669941 |
49946d7a9d4baa7d7321eaa2bfc705f14eaa2653 | 3,314 | html | HTML | elements/add-view-dialog.html | EdgeVerve/oe-model-manager | 8e935117902924f8b618f037ad5b4404369f6d3c | [
"MIT"
] | null | null | null | elements/add-view-dialog.html | EdgeVerve/oe-model-manager | 8e935117902924f8b618f037ad5b4404369f6d3c | [
"MIT"
] | null | null | null | elements/add-view-dialog.html | EdgeVerve/oe-model-manager | 8e935117902924f8b618f037ad5b4404369f6d3c | [
"MIT"
] | null | null | null | <!-- ©2015-2016 EdgeVerve Systems Limited (a fully owned Infosys subsidiary), Bangalore, India. All Rights Reserved.
The EdgeVerve proprietary software program ("Program"), is protected by copyrights laws, international treaties and other pending or existing intellectual property rights in India, the United States and other countries.
The Program may contain/reference third party or open source components, the rights to which continue to
remain with the applicable third party licensors or the open source community as the case may be and nothing
here transfers the rights to the third party and open source components, except as expressly permitted.
Any unauthorized reproduction, storage, transmission in any form or by any means (including without limitation to electronic, mechanical, printing, photocopying, recording or otherwise), or any distribution of this Program,or any portion of it, may result in severe civil and criminal penalties, and will be prosecuted to the maximum extent possible under the law. -->
<link rel="import" href="../../polymer/polymer.html">
<dom-module id="add-view-dialog">
<template>
<style include="oe-dialog-styles">
paper-dialog {
background-color: #fff;
}
.dialog-content {
overflow: auto;
}
.add-page-container {
min-width: 300px;
}
.show {
display: block;
}
.hide {
display: none;
}
#view-name {
width: 100%;
}
</style>
<paper-dialog id="addNewViewDialog" modal>
<div class="dialog-header layout horizontal center">
<iron-icon icon="image:view-comfy"></iron-icon>
<span class="title">Add New View</span>
</div>
<div class="dialog-content">
<div class="flex layout start vertical wrap add-page-container">
<paper-input label="Enter View name" value="{{view.name}}" id="view-name"></paper-input>
</div>
</div>
<div class="dialog-footer layout horizontal end-justified">
<paper-button id="close" secondary on-tap="hideDialog">Close</paper-button>
<paper-button id="addview" disabled="{{!validateName(view.name)}}" secondary on-tap="saveView">Add View</paper-button>
</div>
</paper-dialog>
</template>
<script>
Polymer({
is: 'add-view-dialog',
properties: {
view: {
type: Object,
value: function() {
return {
name: '',
models: []
}
},
notify: true
}
},
ready: function() {
this.view = {
name: '',
models: []
}
},
openDialog: function() {
this.$.addNewViewDialog.open();
},
hideDialog: function() {
this.$.addNewViewDialog.close();
},
saveView: function() {
this.fire('save-view', this.view);
this.hideDialog();
},
validateName: function(name) {
return (name && name.trim().length > 0)
}
});
</script>
</dom-module>
| 36.417582 | 369 | 0.568497 |
0e237f679d018a2a9f9fd983972d87657ed14133 | 902 | swift | Swift | AVPlayerCustomUserAgent/CMTime+Util.swift | spreaker/demo-avplayer-custom-user-agent | f1d7995f4a5d711ec3584609c17d4b4cb051048a | [
"MIT"
] | 3 | 2021-05-07T11:27:38.000Z | 2021-05-10T10:06:25.000Z | AVPlayerCustomUserAgent/CMTime+Util.swift | spreaker/demo-avplayer-custom-user-agent | f1d7995f4a5d711ec3584609c17d4b4cb051048a | [
"MIT"
] | null | null | null | AVPlayerCustomUserAgent/CMTime+Util.swift | spreaker/demo-avplayer-custom-user-agent | f1d7995f4a5d711ec3584609c17d4b4cb051048a | [
"MIT"
] | null | null | null | //
// CMTime+Util.swift
// AVPlayerCustomUserAgent
//
// Created by Alessandro "Sandro" Calzavara on 30/04/21.
//
import Foundation
import AVFoundation
extension CMTime {
func timeWithOffset(_ offset: TimeInterval) -> CMTime {
let seconds = CMTimeGetSeconds(self)
let secondsWithOffset = seconds + offset
return CMTimeMakeWithSeconds(secondsWithOffset, preferredTimescale: self.timescale)
}
func humanDescription() -> String {
let totalSeconds = Int(CMTimeGetSeconds(self))
let hours: Int = Int(totalSeconds / 3600)
let minutes: Int = Int(totalSeconds % 3600 / 60)
let seconds: Int = Int((totalSeconds % 3600) % 60)
if hours > 0 {
return String(format: "%i:%02i:%02i", hours, minutes, seconds)
} else {
return String(format: "%02i:%02i", minutes, seconds)
}
}
}
| 28.1875 | 91 | 0.627494 |
48bc38dee1623c1cf1fa49f5ed93bef9cb02faa5 | 7,383 | sql | SQL | sql/patch_75_76_d.sql | manuelcarbajo/ensembl-compara | 0ffe653215a20e6921c5f4983ea9e4755593a491 | [
"Apache-2.0"
] | null | null | null | sql/patch_75_76_d.sql | manuelcarbajo/ensembl-compara | 0ffe653215a20e6921c5f4983ea9e4755593a491 | [
"Apache-2.0"
] | null | null | null | sql/patch_75_76_d.sql | manuelcarbajo/ensembl-compara | 0ffe653215a20e6921c5f4983ea9e4755593a491 | [
"Apache-2.0"
] | null | null | null | -- Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
-- Copyright [2016-2020] EMBL-European Bioinformatics Institute
--
-- 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.
# patch_75_76_d.sql
#
# Title: Split member into seq_member and gene_member
#
# Description:
# First tranforms chr_name into dnafrag_id
# Split member into seq_member and gene_member
-- We first need to insert the missing dnafrags
ALTER TABLE dnafrag AUTO_INCREMENT=200000000000001;
INSERT INTO dnafrag (length, name, genome_db_id, coord_system_name, is_reference)
SELECT MAX(chr_end), chr_name, member.genome_db_id, "lrg", 0
FROM member LEFT JOIN dnafrag ON member.genome_db_id = dnafrag.genome_db_id AND member.chr_name = dnafrag.name
WHERE chr_name LIKE "LRG%" and dnafrag.name IS NULL
GROUP BY chr_name, member.genome_db_id;
INSERT INTO dnafrag (length, name, genome_db_id, coord_system_name, is_reference)
SELECT MAX(chr_end), chr_name, member.genome_db_id, "unknown", 0
FROM member LEFT JOIN dnafrag ON member.genome_db_id = dnafrag.genome_db_id AND member.chr_name = dnafrag.name
WHERE chr_name IS NOT NULL AND dnafrag.name IS NULL
GROUP BY chr_name, member.genome_db_id;
-- At this stage, all the chr_name are registered in dnafrag
DROP TABLE IF EXISTS gene_member;
CREATE TABLE gene_member (
gene_member_id int(10) unsigned NOT NULL AUTO_INCREMENT, # unique internal id
stable_id varchar(128) NOT NULL, # e.g. ENSP000001234 or P31946
version int(10) DEFAULT 0,
source_name ENUM('ENSEMBLGENE','EXTERNALGENE') NOT NULL,
taxon_id int(10) unsigned NOT NULL, # FK taxon.taxon_id
genome_db_id int(10) unsigned, # FK genome_db.genome_db_id
canonical_member_id int(10) unsigned, # FK seq_member.seq_member_id
description text DEFAULT NULL,
dnafrag_id bigint unsigned, # FK dnafrag.dnafrag_id
dnafrag_start int(10),
dnafrag_end int(10),
dnafrag_strand tinyint(4),
display_label varchar(128) default NULL,
`families` tinyint(1) unsigned default 0,
`gene_trees` tinyint(1) unsigned default 0,
`gene_gain_loss_trees` tinyint(1) unsigned default 0,
`orthologues` int(10) unsigned default 0,
`paralogues` int(10) unsigned default 0,
`homoeologues` int(10) unsigned default 0,
/* FOREIGN KEY (taxon_id) REFERENCES ncbi_taxa_node(taxon_id),
FOREIGN KEY (genome_db_id) REFERENCES genome_db(genome_db_id),
FOREIGN KEY (dnafrag_id) REFERENCES dnafrag(dnafrag_id), */
PRIMARY KEY (gene_member_id),
UNIQUE KEY (stable_id),
KEY (taxon_id),
KEY (dnafrag_id),
KEY (source_name),
KEY (canonical_member_id),
KEY dnafrag_id_start (dnafrag_id,dnafrag_start),
KEY dnafrag_id_end (dnafrag_id,dnafrag_end)
) MAX_ROWS = 100000000 COLLATE=latin1_swedish_ci ENGINE=MyISAM
AS SELECT
member_id AS gene_member_id,
stable_id,
version,
source_name,
taxon_id,
member.genome_db_id,
canonical_member_id,
description,
dnafrag_id,
chr_start AS dnafrag_start,
chr_end AS dnafrag_end,
chr_strand AS dnafrag_strand,
display_label,
IFNULL(families, 0) AS families,
IFNULL(gene_trees, 0) AS gene_trees,
IFNULL(gene_gain_loss_trees, 0) AS gene_gain_loss_trees,
IFNULL(orthologues, 0) AS orthologues,
IFNULL(paralogues, 0) AS paralogues,
IFNULL(homoeologues, 0) AS homoeologues
FROM member LEFT JOIN dnafrag ON member.genome_db_id = dnafrag.genome_db_id AND member.chr_name = dnafrag.name LEFT JOIN member_production_counts USING (stable_id)
WHERE source_name = "ENSEMBLGENE";
DROP TABLE IF EXISTS seq_member;
CREATE TABLE seq_member (
seq_member_id int(10) unsigned NOT NULL AUTO_INCREMENT, # unique internal id
stable_id varchar(128) NOT NULL, # e.g. ENSP000001234 or P31946
version int(10) DEFAULT 0,
source_name ENUM('ENSEMBLPEP','ENSEMBLTRANS','Uniprot/SPTREMBL','Uniprot/SWISSPROT','EXTERNALPEP','EXTERNALTRANS','EXTERNALCDS') NOT NULL,
taxon_id int(10) unsigned NOT NULL, # FK taxon.taxon_id
genome_db_id int(10) unsigned, # FK genome_db.genome_db_id
sequence_id int(10) unsigned, # FK sequence.sequence_id
gene_member_id int(10) unsigned, # FK gene_member.gene_member_id
description text DEFAULT NULL,
dnafrag_id bigint unsigned, # FK dnafrag.dnafrag_id
dnafrag_start int(10),
dnafrag_end int(10),
dnafrag_strand tinyint(4),
display_label varchar(128) default NULL,
/* FOREIGN KEY (taxon_id) REFERENCES ncbi_taxa_node(taxon_id),
FOREIGN KEY (genome_db_id) REFERENCES genome_db(genome_db_id),
FOREIGN KEY (sequence_id) REFERENCES sequence(sequence_id),
FOREIGN KEY (gene_member_id) REFERENCES gene_member(gene_member_id),
FOREIGN KEY (dnafrag_id) REFERENCES dnafrag(dnafrag_id), */
PRIMARY KEY (seq_member_id),
UNIQUE KEY (stable_id),
KEY (taxon_id),
KEY (dnafrag_id),
KEY (source_name),
KEY (sequence_id),
KEY (gene_member_id),
KEY dnafrag_id_start (dnafrag_id,dnafrag_start),
KEY dnafrag_id_end (dnafrag_id,dnafrag_end),
KEY seq_member_gene_member_id_end (seq_member_id,gene_member_id)
) MAX_ROWS = 100000000 COLLATE=latin1_swedish_ci ENGINE=MyISAM
AS SELECT
member_id AS seq_member_id,
stable_id,
version,
source_name,
taxon_id,
member.genome_db_id,
sequence_id,
gene_member_id,
description,
dnafrag_id,
chr_start AS dnafrag_start,
chr_end AS dnafrag_end,
chr_strand AS dnafrag_strand,
display_label
FROM member LEFT JOIN dnafrag ON member.genome_db_id = dnafrag.genome_db_id AND member.chr_name = dnafrag.name
WHERE source_name != "ENSEMBLGENE";
-- -- Let's not delete them at the moment
-- DROP TABLE member;
-- DROP TABLE member_production_counts;
DELETE family_member FROM family_member JOIN member USING (member_id) WHERE source_name = "ENSEMBLGENE";
ALTER TABLE family_member CHANGE COLUMN member_id seq_member_id int(10) unsigned not null;
ALTER TABLE gene_align_member CHANGE COLUMN member_id seq_member_id int(10) unsigned not null;
ALTER TABLE gene_tree_node CHANGE COLUMN member_id seq_member_id int(10) unsigned;
ALTER TABLE homology_member CHANGE COLUMN member_id gene_member_id int(10) unsigned not null, CHANGE COLUMN peptide_member_id seq_member_id int(10) unsigned;
ALTER TABLE member_xref CHANGE COLUMN member_id gene_member_id int(10) unsigned not null;
ALTER TABLE other_member_sequence CHANGE COLUMN member_id seq_member_id int(10) unsigned not null;
# Patch identifier
INSERT INTO meta (species_id, meta_key, meta_value)
VALUES (NULL, 'patch', 'patch_75_76_d.sql|gene_member_seq_member');
| 41.477528 | 163 | 0.734254 |
1890dc0f064cf00c3730b3d0a9ef6246f1f4a99c | 2,747 | asm | Assembly | src/serial.asm | ando23/sysa | b94a821f95b2a8ab9725ed81a19004470dff9b64 | [
"MIT"
] | null | null | null | src/serial.asm | ando23/sysa | b94a821f95b2a8ab9725ed81a19004470dff9b64 | [
"MIT"
] | null | null | null | src/serial.asm | ando23/sysa | b94a821f95b2a8ab9725ed81a19004470dff9b64 | [
"MIT"
] | null | null | null | ; Copyright 2022 Andreas Herzig
; Licence: MIT
COM1 equ 0x3F8
COM2 equ 0x2F8
COM3 equ 0x3E8
COM4 equ 0x2E8
PORT equ 0x3F8
init_kcom:
OUTB (PORT + 1), 0x00 ; Disable all interrupts
OUTB (PORT + 3), 0x80 ; Enable DLAB (set baud rate divisor)
OUTB (PORT + 0), 0x03 ; Set divisor to 3 (lo byte) 38400 baud
OUTB (PORT + 1), 0x00 ; (hi byte)
OUTB (PORT + 3), 0x03 ; 8 bits, no parity, one stop bit
OUTB (PORT + 2), 0xC7 ; Enable FIFO, clear them, with 14-byte threshold
OUTB (PORT + 4), 0x0B ; IRQs enabled, RTS/DSR set
OUTB (PORT + 4), 0x1E ; Set in loopback mode, test the serial chip
OUTB (PORT + 0), 0xAE ; Test serial chip (send byte 0xAE and check if serial returns same byte)
; Check if serial is faulty (i.e: not same byte as sent)
INB (PORT), al
cmp al, 0xAE
je .step2
;FIXME Log error
ret
.step2:
; If serial is not faulty set it in normal operation mode
; (not-loopback with IRQs enabled and OUT#1 and OUT#2 bits enabled)
OUTB PORT + 4, 0x0F
ret
kputc:
push eax
.is_busy:
; Prüfe ob bereit
INB PORT+5, al
and al, 0x20
jz .is_busy
pop eax
OUTB PORT, al
ret
kputs:
push edi
mov edi, eax
call color_on
.loop:
mov al, [edi]
cmp al,0
je .end
call kputc
inc edi
jmp .loop
.end:
call color_off
pop edi
ret
; Newline ausgeben
; input: none
; output: none
; clobbers: none
kputnl:
push eax
mov al, 10
call kputc
pop eax
ret
color_on:
push edx
push eax
OUTB PORT, 0x1b
OUTB PORT, '['
OUTB PORT, '3'
OUTB PORT, '6'
OUTB PORT, 'm'
pop eax
pop edx
ret
color_off:
push edx
push eax
OUTB PORT, 0x1b
OUTB PORT, '['
OUTB PORT, '0'
OUTB PORT, 'm'
pop eax
pop edx
ret
; input al
; clobbers al
kputhexc:
cmp al,10
jl .p
sub al, 10
add al, 'A'
call kputc
ret
.p:
add al, '0'
call kputc
ret
; Hexdump of memory
; input: edi Adresse
; input: ecx Anzahl
; output: none
; clobbers: none
kputhd:
push eax
push ecx
push edi
.loop:
mov bl, [edi]
mov al, bl
and al, 0xf
call kputhexc
rol bl,4
mov al, bl
and al, 0xf
call kputhexc
mov al, 32
call kputc
inc edi
dec ecx
jnz .loop
pop edi
pop ecx
pop eax
ret
; Wert als Hex ausgeben
; input: eax 32-Bit-Wert
; output: none
; clobbers: none
kputl:
push eax
push ebx
push eax
mov al, '0'
call kputc
mov al, 'x'
call kputc
pop ebx
rol ebx,4
mov al, bl
and al, 0xf
call kputhexc
rol ebx,4
mov al, bl
and al, 0xf
call kputhexc
rol ebx,4
mov al, bl
and al, 0xf
call kputhexc
rol ebx,4
mov al, bl
and al, 0xf
call kputhexc
rol ebx,4
mov al, bl
and al, 0xf
call kputhexc
rol ebx,4
mov al, bl
and al, 0xf
call kputhexc
rol ebx,4
mov al, bl
and al, 0xf
call kputhexc
rol ebx,4
mov al, bl
and al, 0xf
call kputhexc
pop ebx
pop eax
ret
| 13.53202 | 96 | 0.657444 |
804cd84fb02c69630c7d6abab2ca160cf4c8f56d | 12,409 | java | Java | src/edu/usc/ict/nl/nlu/fst/TraverseFST.java | fmorbini/jmNL | 846dfebc339ea5b30487ef483fe50c8b151a0b05 | [
"Apache-2.0"
] | 19 | 2015-05-06T22:49:17.000Z | 2021-12-27T08:58:31.000Z | src/edu/usc/ict/nl/nlu/fst/TraverseFST.java | fmorbini/jmNL | 846dfebc339ea5b30487ef483fe50c8b151a0b05 | [
"Apache-2.0"
] | 6 | 2017-02-27T15:01:36.000Z | 2018-01-20T00:02:55.000Z | src/edu/usc/ict/nl/nlu/fst/TraverseFST.java | fmorbini/jmNL | 846dfebc339ea5b30487ef483fe50c8b151a0b05 | [
"Apache-2.0"
] | 5 | 2015-09-07T19:41:32.000Z | 2017-08-16T19:07:31.000Z | package edu.usc.ict.nl.nlu.fst;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.OutputStream;
import java.io.Reader;
import java.io.StringReader;
import java.lang.reflect.InvocationTargetException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;
import edu.usc.ict.nl.config.NLUConfig;
import edu.usc.ict.nl.config.NLUConfig.PreprocessingType;
import edu.usc.ict.nl.nlu.Token;
import edu.usc.ict.nl.nlu.io.BuildTrainingData;
import edu.usc.ict.nl.nlu.preprocessing.TokenizerI;
import edu.usc.ict.nl.util.FunctionalLibrary;
import edu.usc.ict.nl.util.Pair;
import edu.usc.ict.nl.util.Rational;
import edu.usc.ict.nl.util.StreamGobbler;
import edu.usc.ict.nl.util.graph.Edge;
import edu.usc.ict.nl.util.graph.GraphElement;
import edu.usc.ict.nl.util.graph.Node;
import edu.usc.ict.nl.utils.LogConfig;
public class TraverseFST {
private File in=null;
private File out=null;
private File model=null;
private static final Logger logger = Logger.getLogger(TraverseFST.class.getName());
private String[] fstCmd;
private NLUConfig config;
//static String[] defaultCmd = {"/bin/bash","-c","fstcompile --isymbols=input.syms --osymbols=input.syms|fstcompose - alignments.fst|fstshortestpath --nshortest=5 |fstprint --isymbols=input.syms --osymbols=output.syms"};
//static String[] defaultCmd = "{"C:\\cygwin\\bin\\bash","-c","export PATH=$PATH:/bin:/usr/local/bin; fstcompile.exe --isymbols=input.syms --osymbols=input.syms|fstcompose.exe - alignments.fst|fstshortestpath.exe --nshortest="+nBest+" |fstprint.exe --isymbols=input.syms --osymbols=output.syms"};
static String[] defaultCmd ={"C:\\cygwin\\bin\\bash", "-c", "export PATH=$PATH:/bin:/usr/local/bin;fstcompile --isymbols=%IN% --osymbols=%IN%|fstcompose - alignments.fst|fstshortestpath --nshortest=%NBEST% |fstprint --isymbols=%IN% --osymbols=%OUT%"};
static {
URL log4Jresource=LogConfig.findLogConfig("src","log4j.properties", false);
if (log4Jresource != null)
PropertyConfigurator.configure( log4Jresource );
}
public TraverseFST() throws Exception {
this(new File("C:\\Users\\morbini\\simcoach_svn\\trunk\\core\\NLModule\\resources\\characters\\Base-All\\nlu\\input.syms"),
new File("C:\\Users\\morbini\\simcoach_svn\\trunk\\core\\NLModule\\resources\\characters\\Base-All\\nlu\\output.syms"),
new File("C:\\Users\\morbini\\simcoach_svn\\trunk\\core\\NLModule\\resources\\characters\\Base-All\\nlu\\alignments.fst"),
defaultCmd,
NLUConfig.WIN_EXE_CONFIG);
}
public TraverseFST(File iSyms,File oSyms, File fst, String[] cmd,NLUConfig config) throws Exception {
this.config=config;
in=iSyms;
out=oSyms;
model=fst;
fstCmd = new String[cmd.length];
for(int i=0;i<fstCmd.length;i++) {
fstCmd[i] = cmd[i];
fstCmd[i] = fstCmd[i].replaceAll("%IN%",in.getName());
fstCmd[i] = fstCmd[i].replaceAll("%OUT%",out.getName());
fstCmd[i] = fstCmd[i].replaceAll("%MODEL%",model.getName());
}
File inP=in.getParentFile(),outP=out.getParentFile(),modelP=model.getParentFile();
if (!((inP==outP && inP==modelP) ||
(inP.equals(outP) && inP.equals(modelP))))
throw new Exception("input, output and model files need to be in the same directory."+
"\n"+in+
"\n"+out+
"\n"+model);
}
public NLUConfig getConfiguration() {
return config;
}
public File getInputSymbols() {return in;}
public File getOutputSymbols() {return out;}
public static Map<Integer,String> openSymbols(File symbols) throws Exception {
Map<Integer,String> ret=new HashMap<Integer, String>();
BufferedReader in=new BufferedReader(new FileReader(symbols));
String line;
int lineCount=1;
while((line=in.readLine())!=null) {
String[] portions=line.split("[\\s]+");
if (portions!=null && portions.length==2) {
int symID=Integer.parseInt(portions[1]);
if (ret==null) ret=new HashMap<Integer, String>();
ret.put(symID,portions[0]);
} else {
in.close();
throw new Exception("error in line "+lineCount);
}
lineCount++;
}
in.close();
return ret;
}
private static final String space="[\\s]+";
private static final String id="([^\\s]+)";
private static final String integer="([-+]?[\\d]+)";
private static final String floating="([-+]?(\\d*[.])?\\d+([eE][-+]?[\\d]+)?)";
private static final Pattern transducerWithWeights=Pattern.compile("[\\s]*"+integer+space+integer+
space+"("+integer+"|"+id+")"+space+"("+integer+"|"+id+")("+space+floating+")?");
private static final Pattern finalWithWeights=Pattern.compile("[\\s]*"+integer+"("+space+floating+")?");
public Collection<Node> openFST(Reader fst) throws Exception {
return openFST(fst, in, out);
}
public Collection<Node> openFST(Reader fst, File inputSymbols, File outputSymbols) throws Exception {
Map<String,Node> nodes=new HashMap<String, Node>();
Set<Node> notInit=new HashSet<Node>();
Map<Integer,String> iSyms=openSymbols(inputSymbols);
Map<Integer,String> oSyms=openSymbols(outputSymbols);
BufferedReader in=new BufferedReader(fst);
String line;
int lineCount=1;
while((line=in.readLine())!=null) {
Matcher m=transducerWithWeights.matcher(line);
Matcher fm=finalWithWeights.matcher(line);
if (m.matches()) {
String source=m.group(1),target=m.group(2);
String consume=resolveSymbol(m.group(3),iSyms);
String produce=resolveSymbol(m.group(6),oSyms);
float w=0;
if(m.group(9)!=null)
w=Float.parseFloat(m.group(9));
Node sn=nodes.get(source),tn=nodes.get(target);
if (sn==null) nodes.put(source, sn=new Node(source));
if (tn==null) nodes.put(target, tn=new Node(target));
notInit.add(tn);
Edge e=new Edge();
e.setSource(sn);
e.setTarget(tn);
e.setConsume(consume);
e.setProduce(produce);
e.setWeight(new Rational(w));
sn.addEdge(e, false, false);
} else if (fm.matches()) {
String source=fm.group(1);
float w=0;
if(fm.group(2)!=null)
w=Float.parseFloat(fm.group(2));
Node sn=nodes.get(source);
if (sn==null) nodes.put(source, sn=new Node(source));
sn.setWeight(new Rational(w));
} else throw new Exception("error in line '"+line+"'.");
lineCount++;
}
Collection<Node> init = nodes.values();
init.removeAll(notInit);
return init;
}
private String resolveSymbol(String id, Map<Integer, String> syms) {
if (syms==null) return id;
try {
int idn=Integer.parseInt(id);
if (syms.containsKey(idn)) return syms.get(idn);
else return id;
} catch (NumberFormatException e) {}
return id;
}
public String generateFSTforUtterance(String input) throws Exception {
return generateFSTforUtterance(input, in);
}
/**
* if iSymbols is not provided, it'll ignore the symbols and leave all words.
* @param input
* @param iSymbols
* @return
* @throws Exception
*/
public List<Token> generateInputTextForFST(String input,File iSymbols) throws Exception {
Set<String> knownWords=null;
if (iSymbols!=null) {
Map<Integer, String> syms = openSymbols(iSymbols);
knownWords=new HashSet<String>(syms.values());
}
TokenizerI tokenizer = getConfiguration().getNluTokenizer(PreprocessingType.RUN);
List<Token> tokens = tokenizer.tokenize1(input);
Iterator<Token> it=tokens.iterator();
while(it.hasNext()) {
Token t=it.next();
if (knownWords!=null && !knownWords.contains(t.getName().toLowerCase())) {
//t.setName("<unk>");
it.remove();
}
}
return tokens;
}
public String generateFSTforUtterance(String input,File iSymbols) throws Exception {
List<Token> tokens = generateInputTextForFST(input, iSymbols);
StringBuffer out=new StringBuffer();
if (!tokens.isEmpty()) {
int i=0;
for(Token t:tokens) {
out.append(i+" "+(++i)+" "+t.getName()+" "+t.getName()+"\n");
}
out.append(i+"\n");
}
return out.toString();
}
public String getNLUforUtterance(String input,int nBest) throws Exception {
if (nBest<1) nBest=1;
TokenizerI tokenizer = getConfiguration().getNluTokenizer(PreprocessingType.RUN);
input=tokenizer.tokAnduntok(input);
for (int i=0;i<fstCmd.length;i++) {
fstCmd[i] = fstCmd[i].replaceAll("%NBEST%",nBest+"");
}
Process p = Runtime.getRuntime().exec(fstCmd,new String[0],in.getParentFile());
StreamGobbler output = new StreamGobbler(p.getInputStream(), "output",false,true);
StreamGobbler error = new StreamGobbler(p.getErrorStream(), "error",true,false);
output.start();
error.start();
OutputStream stdin=p.getOutputStream();
String inputFST=generateFSTforUtterance(input);
if (logger.isDebugEnabled()) logger.debug("input utterance:\n"+inputFST);
stdin.write(inputFST.getBytes());
stdin.close();
p.waitFor();
StringBuffer ret= output.getContent();
if (logger.isDebugEnabled()) logger.debug("returned NLU lattice:\n"+ret);
return (ret!=null)?ret.toString():null;
}
public List<FSTNLUOutput> getResults(String retFST) throws Exception {
List<FSTNLUOutput> ret=null;
if (retFST!=null) {
Collection<Node> start = openFST(new StringReader(retFST), in, out);
if (start!=null) {
for(Node i:start) {
Set<List<GraphElement>> paths = i.getAllEdgesInPathsStartingFromHere();
List<Pair<Float,List<GraphElement>>> results=extractResultsFromPaths(paths);
//normalizeProbabilities(results);
if (results!=null) {
for(Pair<Float,List<GraphElement>> p:results) {
FSTNLUOutput r=new FSTNLUOutput(p);
if (r.getId()!=null) {
if (ret==null) ret=new ArrayList<FSTNLUOutput>();
ret.add(r);
}
}
}
}
}
}
return ret;
}
private void normalizeProbabilities(List<Pair<Float, List<GraphElement>>> results) throws IllegalArgumentException, SecurityException, IllegalAccessException, InvocationTargetException, NoSuchMethodException, InstantiationException {
if (results!=null) {
List<Float> ps=(List<Float>) FunctionalLibrary.map(results, Pair.class.getMethod("getFirst"));
Float max=Collections.max(ps);
Float min=Collections.min(ps);
Float c=0f;
if (max==min) {
logger.debug("probabilities normalization. no range (max==min) => set to 1.");
for(Pair<Float,List<GraphElement>> p:results) {
if (p!=null) {
p.setFirst(1f);
}
}
} else {
logger.debug("probabilities normalization. max="+max+" min="+min+" mult="+c);
c=1.0f/(max-min);
for(Pair<Float,List<GraphElement>> p:results) {
if (p!=null) {
p.setFirst((p.getFirst()-min)*c);
}
}
}
}
}
public List<Pair<Float, List<GraphElement>>> extractResultsFromPaths(Set<List<GraphElement>> paths) {
List<Pair<Float, List<GraphElement>>> ret=null;
if (paths!=null) {
for(List<GraphElement> p:paths) {
if (p!=null) {
float w=0;
Node last=null;
for(GraphElement g:p) {
Edge e=(Edge)g;
w+=e.getWeight();
last=e.getTarget();
}
w+=last.getWeight();
if (ret==null) ret=new ArrayList<Pair<Float,List<GraphElement>>>();
ret.add(new Pair<Float, List<GraphElement>>(w, p));
}
}
if (ret!=null) {
Collections.sort(ret, new Comparator<Pair<Float,List<GraphElement>>>() {
@Override
public int compare(Pair<Float, List<GraphElement>> o1,
Pair<Float, List<GraphElement>> o2) {
return (int)Math.signum(o1.getFirst()-o2.getFirst());
}
});
}
}
return ret;
}
public static void main(String[] args) throws Exception {
TraverseFST tf=new TraverseFST();
String inputFST=tf.generateFSTforUtterance("this is a test",null);
System.out.println(inputFST);
String retFST=tf.getNLUforUtterance("sharp pain",10);
List<FSTNLUOutput> results = tf.getResults(retFST);
System.out.println(FunctionalLibrary.printCollection(results, "", "", "\n"));
}
}
| 37.152695 | 298 | 0.671126 |
8d027b51a99cff9d70e81a169ed21f606c353d75 | 129 | ps1 | PowerShell | artifactory-push.ps1 | DenganID/DenganID.Networking.RemotePing | 4205e432a8d13decba474c0906ec2c1dc6482e20 | [
"MIT"
] | null | null | null | artifactory-push.ps1 | DenganID/DenganID.Networking.RemotePing | 4205e432a8d13decba474c0906ec2c1dc6482e20 | [
"MIT"
] | null | null | null | artifactory-push.ps1 | DenganID/DenganID.Networking.RemotePing | 4205e432a8d13decba474c0906ec2c1dc6482e20 | [
"MIT"
] | null | null | null | nuget push .\src\DenganID.Networking.RemotePing\bin\Release\DenganID.Networking.RemotePing.1.0.1.nupkg -Source ArtifactoryNuGetV3 | 129 | 129 | 0.852713 |
017187346ffe6c37238fb006c5595894b60958b3 | 1,156 | rs | Rust | src/lexeme/special/unlexable.rs | mangolang/compiler | a33d5886c7536fa7d3c0365879fd8e250a8d84f4 | [
"Apache-2.0"
] | 14 | 2017-12-31T11:33:22.000Z | 2021-03-15T18:51:59.000Z | src/lexeme/special/unlexable.rs | mangolang/compiler | a33d5886c7536fa7d3c0365879fd8e250a8d84f4 | [
"Apache-2.0"
] | 44 | 2017-12-30T20:32:09.000Z | 2021-05-20T20:56:31.000Z | src/lexeme/special/unlexable.rs | mangolang/compiler | a33d5886c7536fa7d3c0365879fd8e250a8d84f4 | [
"Apache-2.0"
] | 1 | 2019-06-08T11:28:15.000Z | 2019-06-08T11:28:15.000Z | use ::std::hash;
use crate::common::debug::ToText;
use crate::io::slice::{SourceLocation, SourceSlice};
/// Represents an unlexable string.
#[derive(Debug, Eq, Clone)]
pub struct UnlexableLexeme {
text: String,
source: SourceSlice,
}
impl UnlexableLexeme {
pub fn new(text: impl Into<String>, source: SourceSlice) -> UnlexableLexeme {
UnlexableLexeme { text: text.into(), source }
}
pub fn from_source(source: SourceSlice) -> UnlexableLexeme {
UnlexableLexeme::new(source.as_str().to_owned(), source)
}
//TODO @mark: make name different from field?
pub fn text(&self) -> &str {
self.source.as_str()
}
}
impl PartialEq for UnlexableLexeme {
fn eq(&self, other: &Self) -> bool {
self.text == other.text
}
}
impl hash::Hash for UnlexableLexeme {
fn hash<H: hash::Hasher>(&self, state: &mut H) {
self.text.hash(state)
}
}
impl SourceLocation for UnlexableLexeme {
fn source(&self) -> &SourceSlice {
&self.source
}
}
impl ToText for UnlexableLexeme {
fn to_text(&self) -> String {
format!(" [cannot lex: {}] ", self.text())
}
}
| 22.666667 | 81 | 0.626298 |
158d289a30ca04c9c5840c392bd90f878529713c | 617 | rb | Ruby | app/models/test_suite.rb | hikimochi/bucky-management | 8bc1c8c8e8917ec80689f5f5150029396220e560 | [
"Apache-2.0"
] | 12 | 2019-03-29T12:48:07.000Z | 2020-12-05T05:57:35.000Z | app/models/test_suite.rb | hikimochi/bucky-management | 8bc1c8c8e8917ec80689f5f5150029396220e560 | [
"Apache-2.0"
] | 15 | 2019-03-29T08:41:47.000Z | 2021-07-27T05:36:15.000Z | app/models/test_suite.rb | hikimochi/bucky-management | 8bc1c8c8e8917ec80689f5f5150029396220e560 | [
"Apache-2.0"
] | 13 | 2019-04-24T02:43:57.000Z | 2022-02-17T01:48:24.000Z | # frozen_string_literal: true
# == Schema Information
#
# Table name: test_suites
#
# id :bigint(8) not null, primary key
# test_category :string(255) not null
# service :string(255) not null
# device :string(255) not null
# priority :string(255) not null
# test_suite_name :string(255) not null
# suite_description :string(255) not null
# github_url :string(255) not null
# file_path :string(255) not null
#
class TestSuite < ApplicationRecord
has_many :test_cases, dependent: :destroy
end
| 29.380952 | 60 | 0.598055 |
9ce25e609da1ae05c611c4cd91a7e5b465031863 | 1,707 | sql | SQL | automation/tincrepo/main/pxf/features/hcfs/globbing/match_string_from_string_set/sql/query04.sql | liuyiffan/pxf | 805dc6f12eb2fbd24432fb7939722c04ad15ef6a | [
"Apache-2.0"
] | null | null | null | automation/tincrepo/main/pxf/features/hcfs/globbing/match_string_from_string_set/sql/query04.sql | liuyiffan/pxf | 805dc6f12eb2fbd24432fb7939722c04ad15ef6a | [
"Apache-2.0"
] | null | null | null | automation/tincrepo/main/pxf/features/hcfs/globbing/match_string_from_string_set/sql/query04.sql | liuyiffan/pxf | 805dc6f12eb2fbd24432fb7939722c04ad15ef6a | [
"Apache-2.0"
] | null | null | null | -- @description query04 tests glob to match a string from the given set
-- }{a,b}c will match }bc but it will not match }c
--
select * from hcfs_glob_match_string_from_string_set_4 order by name, num;
-- }{b}c will match }bc but it will not match }c
select * from hcfs_glob_match_string_from_string_set_5 order by name, num;
-- }{}bc will match }bc but it will not match }c
select * from hcfs_glob_match_string_from_string_set_6 order by name, num;
-- }{,}bc will match }bc but it will not match }c
select * from hcfs_glob_match_string_from_string_set_7 order by name, num;
-- }{b,}c will match both }bc and }c
select * from hcfs_glob_match_string_from_string_set_8 order by name, num;
-- }{,b}c will match both }bc and }c
select * from hcfs_glob_match_string_from_string_set_9 order by name, num;
-- }{ac,?} will match }c but it will not match }bc
select * from hcfs_glob_match_string_from_string_set_10 order by name, num;
-- error on ill-formed curly
-- start_matchsubs
--
-- # create a match/subs
--
-- m/Illegal file pattern: Unclosed group near index.*/
-- s/Illegal file pattern: Unclosed group near index.*/Unclosed group near index xxx/
--
-- m/Unclosed group near index.*/
-- s/Unclosed group near index.*/Unclosed group near index xxx/
--
-- m/DETAIL/
-- s/DETAIL/CONTEXT/
--
-- m/pxf:\/\/(.*)\/pxf_automation_data/
-- s/pxf:\/\/.*match_string_from_string_set_4.*/pxf:\/\/pxf_automation_data?PROFILE=*:text/
--
-- m/CONTEXT:.*line.*/
-- s/line \d* of //g
--
-- end_matchsubs
select * from hcfs_glob_match_string_from_string_set_11 order by name, num;
-- }\{bc will match }{bc but it will not match }bc
select * from hcfs_glob_match_string_from_string_set_12 order by name, num;
| 28.932203 | 91 | 0.726421 |
043bb0ef9aacb1c52f6912be6a02327418262aff | 2,141 | dart | Dart | lib/utils/authentication_client.dart | sbis04/puzzle_hack | fb7512b48bd0aaf766dea4d9c9eabda6e0482632 | [
"MIT"
] | 23 | 2022-03-14T22:43:49.000Z | 2022-03-31T14:19:32.000Z | lib/utils/authentication_client.dart | sbis04/puzzle_hack | fb7512b48bd0aaf766dea4d9c9eabda6e0482632 | [
"MIT"
] | null | null | null | lib/utils/authentication_client.dart | sbis04/puzzle_hack | fb7512b48bd0aaf766dea4d9c9eabda6e0482632 | [
"MIT"
] | 1 | 2022-03-14T22:43:41.000Z | 2022-03-14T22:43:41.000Z | import 'dart:developer';
import 'package:firebase_auth/firebase_auth.dart';
class AuthenticationClient {
FirebaseAuth auth = FirebaseAuth.instance;
Future<User> signInAnonymously({required String name}) async {
User? currentUser;
try {
UserCredential userCredential =
await FirebaseAuth.instance.signInAnonymously();
User? user = userCredential.user;
if (user != null) {
user.updateDisplayName(name);
currentUser = user;
} else {
throw ('User is empty');
}
} catch (e) {
throw (e.toString());
}
return currentUser;
}
User? getCurrentUser() {
final user = auth.currentUser;
return user;
}
Future<User?> signInUsingEmailPassword({
required String email,
required String password,
}) async {
User? user;
try {
UserCredential userCredential = await auth.signInWithEmailAndPassword(
email: email,
password: password,
);
user = userCredential.user;
} on FirebaseAuthException catch (e) {
if (e.code == 'user-not-found') {
throw('No user found for that email.');
} else if (e.code == 'wrong-password') {
throw('Wrong password provided.');
}
} catch (e) {
throw (e.toString());
}
return user;
}
Future<User?> registerUsingEmailPassword({
required String name,
required String email,
required String password,
}) async {
FirebaseAuth auth = FirebaseAuth.instance;
User? user;
try {
UserCredential userCredential = await auth.createUserWithEmailAndPassword(
email: email,
password: password,
);
user = userCredential.user;
await user!.updateDisplayName(name);
await user.reload();
user = auth.currentUser;
} on FirebaseAuthException catch (e) {
if (e.code == 'weak-password') {
throw('The password provided is too weak.');
} else if (e.code == 'email-already-in-use') {
throw('The account already exists for that email.');
}
} catch (e) {
throw(e.toString());
}
return user;
}
}
| 23.788889 | 80 | 0.611397 |
f702a98de9f757b6f66654a80f9d376c782f1677 | 1,744 | h | C | hexagon1/hexagon1/hexgraph.h | csuver/hex | 67bec21c9269db473b9733e5247c331de331b4cf | [
"MIT"
] | null | null | null | hexagon1/hexagon1/hexgraph.h | csuver/hex | 67bec21c9269db473b9733e5247c331de331b4cf | [
"MIT"
] | null | null | null | hexagon1/hexagon1/hexgraph.h | csuver/hex | 67bec21c9269db473b9733e5247c331de331b4cf | [
"MIT"
] | null | null | null | //
// hexgraph - turtle graphics for generating paths
//
#pragma once
#include "hex.h"
typedef struct _hexgraph HexGraph;
typedef struct _hexpoint HexPoint;
struct _hexpoint {
double x;
double y;
};
#define HEXGRAPH_NUMBER_BUF_SIZE 50
//static double PI = 3.1415926535897932384626433832795;
//#define TO_RADIANS(angle) ((angle/180)*PI)
typedef enum _hexgraph_dir { LEFT, RIGHT } HexGraphDir;
void hexgraph_copy_point(HexPoint *src, HexPoint *dst);
HexGraph *hexgraph_create(void);
void hexgraph_clear(HexGraph *graph);
void hexgraph_destroy(HexGraph *graph);
void hexgraph_set_origin(HexGraph *graph, double x, double y);
void hexgraph_set_scale(HexGraph *graph, double scale);
void hexgraph_set_offset(HexGraph *graph, double offset_x, double offset_y);
void hexgraph_set_to_continue(HexGraph *graph, HexGraph *prev);
HexPoint *hexgraph_scale(HexGraph *graph, HexPoint *p);
void hexgraph_reset_to_end(HexGraph *graph);
void hexgraph_turn(HexGraph *graph, HexGraphDir d, double angle);
void hexgraph_draw(HexGraph *graph, double distance);
void hexgraph_print_path(HexGraph *graph, FILE *o);
void hexgraph_print_closed_path(HexGraph *graph, FILE *o);
void hexgraph_bounds(HexGraph *graph, HexPoint *min, HexPoint *max);
void hexgraph_print_g_header(HexGraph *graph, HexPoint *min, FILE *o);
void hexgraph_print_g_tail(HexGraph *graph, FILE *o);
void hexgraph_print_path_header(HexGraph *graph, FILE *o);
void hexgraph_print_path_helper(HexGraph *graph, FILE *o);
char *hexgraph_format_number(char *buf, SIZE size, double v);
void hexgraph_print_path_tail(HexGraph *graph, FILE *o);
| 35.591837 | 82 | 0.724197 |
411779c508cd41ca66efc8d676ddc296bf4dd7d9 | 6,941 | c | C | source/blender/modifiers/intern/MOD_meshsequencecache.c | 1-MillionParanoidTterabytes/Blender-2.79b-blackened | e8d767324e69015aa66850d13bee7db1dc7d084b | [
"Unlicense"
] | 2 | 2018-06-18T01:50:25.000Z | 2018-06-18T01:50:32.000Z | source/blender/modifiers/intern/MOD_meshsequencecache.c | 1-MillionParanoidTterabytes/Blender-2.79b-blackened | e8d767324e69015aa66850d13bee7db1dc7d084b | [
"Unlicense"
] | null | null | null | source/blender/modifiers/intern/MOD_meshsequencecache.c | 1-MillionParanoidTterabytes/Blender-2.79b-blackened | e8d767324e69015aa66850d13bee7db1dc7d084b | [
"Unlicense"
] | null | null | null | /*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Contributor(s): Campbell Barton
*
* ***** END GPL LICENSE BLOCK *****
*/
/** \file blender/modifiers/intern/MOD_meshsequencecache.c
* \ingroup modifiers
*/
#include "DNA_cachefile_types.h"
#include "DNA_mesh_types.h"
#include "DNA_modifier_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "BKE_cachefile.h"
#include "BKE_DerivedMesh.h"
#include "BKE_cdderivedmesh.h"
#include "BKE_global.h"
#include "BKE_library.h"
#include "BKE_library_query.h"
#include "BKE_scene.h"
#include "depsgraph_private.h"
#include "DEG_depsgraph_build.h"
#include "MOD_modifiertypes.h"
#ifdef WITH_ALEMBIC
# include "ABC_alembic.h"
#endif
static void initData(ModifierData *md)
{
MeshSeqCacheModifierData *mcmd = (MeshSeqCacheModifierData *)md;
mcmd->cache_file = NULL;
mcmd->object_path[0] = '\0';
mcmd->read_flag = MOD_MESHSEQ_READ_ALL;
}
static void copyData(ModifierData *md, ModifierData *target)
{
#if 0
MeshSeqCacheModifierData *mcmd = (MeshSeqCacheModifierData *)md;
#endif
MeshSeqCacheModifierData *tmcmd = (MeshSeqCacheModifierData *)target;
modifier_copyData_generic(md, target);
if (tmcmd->cache_file) {
id_us_plus(&tmcmd->cache_file->id);
tmcmd->reader = NULL;
}
}
static void freeData(ModifierData *md)
{
MeshSeqCacheModifierData *mcmd = (MeshSeqCacheModifierData *) md;
if (mcmd->cache_file) {
id_us_min(&mcmd->cache_file->id);
}
if (mcmd->reader) {
#ifdef WITH_ALEMBIC
CacheReader_free(mcmd->reader);
#endif
mcmd->reader = NULL;
}
}
static bool isDisabled(ModifierData *md, int UNUSED(useRenderParams))
{
MeshSeqCacheModifierData *mcmd = (MeshSeqCacheModifierData *) md;
/* leave it up to the modifier to check the file is valid on calculation */
return (mcmd->cache_file == NULL) || (mcmd->object_path[0] == '\0');
}
static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
DerivedMesh *dm,
ModifierApplyFlag UNUSED(flag))
{
#ifdef WITH_ALEMBIC
MeshSeqCacheModifierData *mcmd = (MeshSeqCacheModifierData *) md;
/* Only used to check wehther we are operating on org data or not... */
Mesh *me = (ob->type == OB_MESH) ? ob->data : NULL;
DerivedMesh *org_dm = dm;
Scene *scene = md->scene;
const float frame = BKE_scene_frame_get(scene);
const float time = BKE_cachefile_time_offset(mcmd->cache_file, frame, FPS);
const char *err_str = NULL;
CacheFile *cache_file = mcmd->cache_file;
BKE_cachefile_ensure_handle(G.main, cache_file);
if (!mcmd->reader) {
mcmd->reader = CacheReader_open_alembic_object(cache_file->handle,
NULL,
ob,
mcmd->object_path);
if (!mcmd->reader) {
modifier_setError(md, "Could not create Alembic reader for file %s", cache_file->filepath);
return dm;
}
}
if (me != NULL) {
MVert *mvert = dm->getVertArray(dm);
MEdge *medge = dm->getEdgeArray(dm);
MPoly *mpoly = dm->getPolyArray(dm);
if ((me->mvert == mvert) || (me->medge == medge) || (me->mpoly == mpoly)) {
/* We need to duplicate data here, otherwise we'll modify org mesh, see T51701. */
dm = CDDM_copy(dm);
}
}
DerivedMesh *result = ABC_read_mesh(mcmd->reader,
ob,
dm,
time,
&err_str,
mcmd->read_flag);
if (err_str) {
modifier_setError(md, "%s", err_str);
}
if (!ELEM(result, NULL, dm) && (dm != org_dm)) {
dm->release(dm);
dm = org_dm;
}
return result ? result : dm;
#else
return dm;
UNUSED_VARS(md, ob);
#endif
}
static bool dependsOnTime(ModifierData *md)
{
UNUSED_VARS(md);
return true;
}
static void foreachIDLink(ModifierData *md, Object *ob,
IDWalkFunc walk, void *userData)
{
MeshSeqCacheModifierData *mcmd = (MeshSeqCacheModifierData *) md;
walk(userData, ob, (ID **)&mcmd->cache_file, IDWALK_CB_USER);
}
static void updateDepgraph(ModifierData *md, DagForest *forest,
struct Main *bmain,
struct Scene *scene,
Object *ob, DagNode *obNode)
{
MeshSeqCacheModifierData *mcmd = (MeshSeqCacheModifierData *) md;
if (mcmd->cache_file != NULL) {
DagNode *curNode = dag_get_node(forest, mcmd->cache_file);
dag_add_relation(forest, curNode, obNode,
DAG_RL_DATA_DATA | DAG_RL_OB_DATA, "Cache File Modifier");
}
UNUSED_VARS(bmain, scene, ob);
}
static void updateDepsgraph(ModifierData *md,
struct Main *bmain,
struct Scene *scene,
Object *ob,
struct DepsNodeHandle *node)
{
MeshSeqCacheModifierData *mcmd = (MeshSeqCacheModifierData *) md;
if (mcmd->cache_file != NULL) {
DEG_add_object_cache_relation(node, mcmd->cache_file, DEG_OB_COMP_CACHE, "Mesh Cache File");
}
UNUSED_VARS(bmain, scene, ob);
}
ModifierTypeInfo modifierType_MeshSequenceCache = {
/* name */ "Mesh Sequence Cache",
/* structName */ "MeshSeqCacheModifierData",
/* structSize */ sizeof(MeshSeqCacheModifierData),
/* type */ eModifierTypeType_Constructive,
/* flags */ eModifierTypeFlag_AcceptsMesh |
eModifierTypeFlag_AcceptsCVs,
/* copyData */ copyData,
/* deformVerts */ NULL,
/* deformMatrices */ NULL,
/* deformVertsEM */ NULL,
/* deformMatricesEM */ NULL,
/* applyModifier */ applyModifier,
/* applyModifierEM */ NULL,
/* initData */ initData,
/* requiredDataMask */ NULL,
/* freeData */ freeData,
/* isDisabled */ isDisabled,
/* updateDepgraph */ updateDepgraph,
/* updateDepsgraph */ updateDepsgraph,
/* dependsOnTime */ dependsOnTime,
/* dependsOnNormals */ NULL,
/* foreachObjectLink */ NULL,
/* foreachIDLink */ foreachIDLink,
/* foreachTexLink */ NULL,
};
| 29.411017 | 94 | 0.631465 |
a5749641052e19c500c1d97b9d476d7a0c2285de | 9,928 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_19898_745.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_19898_745.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_19898_745.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r12
push %r14
push %r8
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x16643, %rsi
lea addresses_WC_ht+0x2fe1, %rdi
nop
sub %rax, %rax
mov $80, %rcx
rep movsb
nop
nop
cmp $6386, %r8
lea addresses_normal_ht+0x1060c, %r10
dec %r12
vmovups (%r10), %ymm1
vextracti128 $0, %ymm1, %xmm1
vpextrq $1, %xmm1, %r8
nop
nop
nop
nop
xor $23005, %rax
lea addresses_WT_ht+0x5cc3, %rsi
lea addresses_WC_ht+0xa843, %rdi
nop
nop
nop
nop
and $16417, %r14
mov $84, %rcx
rep movsl
nop
nop
nop
nop
xor %rsi, %rsi
lea addresses_A_ht+0x1c643, %rsi
lea addresses_D_ht+0x843, %rdi
nop
nop
nop
nop
inc %r10
mov $9, %rcx
rep movsb
nop
and %r8, %r8
lea addresses_UC_ht+0x19443, %rax
nop
nop
sub $60359, %r12
movb $0x61, (%rax)
nop
nop
nop
nop
nop
and $56541, %rdi
lea addresses_UC_ht+0xf043, %rsi
lea addresses_A_ht+0x1db03, %rdi
nop
nop
nop
nop
nop
add %r10, %r10
mov $47, %rcx
rep movsl
nop
nop
nop
nop
nop
sub $171, %rax
lea addresses_A_ht+0x13d53, %rsi
lea addresses_WC_ht+0x17243, %rdi
nop
nop
sub %r10, %r10
mov $113, %rcx
rep movsb
nop
sub %rsi, %rsi
lea addresses_A_ht+0x11919, %r8
nop
nop
cmp %r14, %r14
mov $0x6162636465666768, %r10
movq %r10, (%r8)
nop
nop
xor %r8, %r8
lea addresses_normal_ht+0x303, %r8
clflush (%r8)
nop
nop
nop
nop
nop
inc %r12
mov $0x6162636465666768, %r10
movq %r10, %xmm1
vmovups %ymm1, (%r8)
nop
nop
nop
nop
nop
add $56059, %rcx
lea addresses_A_ht+0x65c3, %r14
add $25727, %rcx
movups (%r14), %xmm7
vpextrq $1, %xmm7, %rsi
nop
nop
and %r14, %r14
lea addresses_normal_ht+0x6143, %r10
nop
sub %r8, %r8
mov $0x6162636465666768, %rax
movq %rax, %xmm4
movups %xmm4, (%r10)
cmp %r14, %r14
lea addresses_A_ht+0x1b623, %rsi
lea addresses_UC_ht+0x19443, %rdi
nop
nop
nop
nop
add $9975, %r10
mov $54, %rcx
rep movsl
dec %rdi
lea addresses_A_ht+0x13f7b, %r12
nop
nop
nop
nop
add $47305, %rcx
movups (%r12), %xmm1
vpextrq $1, %xmm1, %r14
nop
nop
nop
dec %r12
lea addresses_normal_ht+0xf413, %rsi
nop
nop
nop
nop
dec %rax
movb (%rsi), %cl
cmp $58496, %rax
lea addresses_UC_ht+0xe643, %rsi
lea addresses_WC_ht+0xac03, %rdi
clflush (%rdi)
nop
sub $55153, %r12
mov $30, %rcx
rep movsb
nop
nop
xor %rsi, %rsi
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r8
pop %r14
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r13
push %r8
push %r9
push %rax
push %rbp
push %rbx
push %rcx
// Load
lea addresses_US+0xba33, %r13
nop
nop
nop
nop
nop
xor %rbx, %rbx
movb (%r13), %r9b
nop
nop
add %rbp, %rbp
// Load
lea addresses_RW+0x1a753, %rbx
nop
nop
sub %rbp, %rbp
mov (%rbx), %r13
nop
nop
nop
nop
cmp $39185, %rbp
// Store
lea addresses_UC+0x1752b, %rbx
nop
nop
nop
nop
nop
add %r9, %r9
mov $0x5152535455565758, %rbp
movq %rbp, (%rbx)
nop
nop
xor %r9, %r9
// Store
lea addresses_normal+0x1083, %r8
nop
add %rcx, %rcx
movw $0x5152, (%r8)
nop
add $6342, %rax
// Load
lea addresses_UC+0x1cc0b, %r13
nop
nop
nop
nop
nop
xor %r8, %r8
movups (%r13), %xmm2
vpextrq $1, %xmm2, %rbp
nop
add $2882, %r13
// Store
mov $0x3cb, %rcx
nop
nop
nop
nop
cmp %rbp, %rbp
movb $0x51, (%rcx)
nop
nop
nop
and %rax, %rax
// Store
lea addresses_WC+0x8c23, %rbp
nop
xor $31564, %r8
movw $0x5152, (%rbp)
nop
nop
nop
nop
cmp $21432, %r9
// Store
lea addresses_UC+0xc09d, %rbx
cmp %rcx, %rcx
movw $0x5152, (%rbx)
nop
nop
nop
nop
cmp %r13, %r13
// Faulty Load
lea addresses_WT+0x1043, %rbp
nop
add $27166, %r9
vmovups (%rbp), %ymm2
vextracti128 $1, %ymm2, %xmm2
vpextrq $0, %xmm2, %rcx
lea oracles, %r13
and $0xff, %rcx
shlq $12, %rcx
mov (%r13,%rcx,1), %rcx
pop %rcx
pop %rbx
pop %rbp
pop %rax
pop %r9
pop %r8
pop %r13
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0, 'same': False, 'type': 'addresses_WT'}, 'OP': 'LOAD'}
{'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 4, 'same': False, 'type': 'addresses_US'}, 'OP': 'LOAD'}
{'src': {'NT': True, 'AVXalign': False, 'size': 8, 'congruent': 3, 'same': False, 'type': 'addresses_RW'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 3, 'same': False, 'type': 'addresses_UC'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': True, 'size': 2, 'congruent': 6, 'same': False, 'type': 'addresses_normal'}, 'OP': 'STOR'}
{'src': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 3, 'same': False, 'type': 'addresses_UC'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 3, 'same': False, 'type': 'addresses_P'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 5, 'same': False, 'type': 'addresses_WC'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': True, 'size': 2, 'congruent': 1, 'same': False, 'type': 'addresses_UC'}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0, 'same': True, 'type': 'addresses_WT'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 7, 'same': False, 'type': 'addresses_A_ht'}, 'dst': {'congruent': 1, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM'}
{'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 6, 'same': False, 'type': 'addresses_WT_ht'}, 'dst': {'congruent': 11, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM'}
{'src': {'congruent': 8, 'same': False, 'type': 'addresses_A_ht'}, 'dst': {'congruent': 10, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 9, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'STOR'}
{'src': {'congruent': 10, 'same': False, 'type': 'addresses_UC_ht'}, 'dst': {'congruent': 2, 'same': True, 'type': 'addresses_A_ht'}, 'OP': 'REPM'}
{'src': {'congruent': 2, 'same': True, 'type': 'addresses_A_ht'}, 'dst': {'congruent': 8, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 1, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 6, 'same': True, 'type': 'addresses_normal_ht'}, 'OP': 'STOR'}
{'src': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 7, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 8, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'STOR'}
{'src': {'congruent': 2, 'same': False, 'type': 'addresses_A_ht'}, 'dst': {'congruent': 9, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM'}
{'src': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 3, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'}
{'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 1, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 9, 'same': False, 'type': 'addresses_UC_ht'}, 'dst': {'congruent': 4, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM'}
{'39': 19898}
39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39
*/
| 29.372781 | 2,999 | 0.651491 |
04da8e29caf32f7b4982b6286a7a5130eb4b1165 | 5,284 | java | Java | app/src/main/java/com/ryanst/app/core/BaseSlideActivity.java | Ryanst/AndroidDemo | afbd53705d51412154c4c00b8f65fd45fe00062d | [
"Apache-2.0"
] | 2 | 2016-05-07T04:44:54.000Z | 2016-06-21T12:05:59.000Z | app/src/main/java/com/ryanst/app/core/BaseSlideActivity.java | Ryanst/AndroidDemo | afbd53705d51412154c4c00b8f65fd45fe00062d | [
"Apache-2.0"
] | null | null | null | app/src/main/java/com/ryanst/app/core/BaseSlideActivity.java | Ryanst/AndroidDemo | afbd53705d51412154c4c00b8f65fd45fe00062d | [
"Apache-2.0"
] | null | null | null | package com.ryanst.app.core;
import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.v4.widget.SlidingPaneLayout;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import com.ryanst.app.R;
import com.ryanst.app.view.PagerEnabledSlidingPaneLayout;
import java.lang.reflect.Field;
/**
* Created by Jim on 15/9/14.
*/
public abstract class BaseSlideActivity extends BaseActivity {
private RelativeLayout mLeftView;
private ImageView mShadow;
private int mShadowMarginLeft;
@Override
protected void onCreate(Bundle savedInstanceState) {
setWindowTransparent();
initSlideFinish();
super.onCreate(savedInstanceState);
}
private void setWindowTransparent() {
getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
}
/**
* initialize
*/
private void initSlideFinish() {
PagerEnabledSlidingPaneLayout slidingPaneLayout = new PagerEnabledSlidingPaneLayout(this);
try {
/* Change the 'mOverhangSize' to 0 by reflection, because the default value was 32dp. */
Field overHang = SlidingPaneLayout.class.getDeclaredField("mOverhangSize");
overHang.setAccessible(true);
overHang.set(slidingPaneLayout, 0);
} catch (Exception e) {
e.printStackTrace();
}
slidingPaneLayout.setPanelSlideListener(new MyPanelSlideListener());
if (!isFadingRightView()) {
slidingPaneLayout.setSliderFadeColor(getResources().getColor(android.R.color.transparent));
}
/* Add a transparent Relative Layout at left */
mLeftView = new RelativeLayout(this);
if (isFadingLeftView()) {
mLeftView.setBackgroundColor(0xcccccccc);
}
mLeftView.setLayoutParams(new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT));
/* Add a shadow effect in Relative Layout */
if (isSupportShadow()) {
mShadow = new ImageView(this);
Drawable shadowDrawable = getResources().getDrawable(R.drawable.shadow_left);
mShadow.setImageDrawable(shadowDrawable);
mShadow.setScaleType(ImageView.ScaleType.FIT_XY);
int shadowWidth = DpToPx(this, 20);
RelativeLayout.LayoutParams rlp = new RelativeLayout.LayoutParams(shadowWidth, RelativeLayout.LayoutParams.MATCH_PARENT);
rlp.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
int ms = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);
mShadow.setLayoutParams(rlp);
mShadow.measure(ms, ms);
rlp.leftMargin = -shadowWidth;
mShadowMarginLeft = -shadowWidth;
mLeftView.addView(mShadow, rlp);
}
slidingPaneLayout.addView(mLeftView, 0);
/* Add the decor view to the right of SlidingPaneLayout */
ViewGroup decor = (ViewGroup) getWindow().getDecorView();
ViewGroup decorChild = (ViewGroup) decor.getChildAt(0);
decorChild.setBackgroundColor(getResources().getColor(android.R.color.white));
decor.removeView(decorChild);
decor.addView(slidingPaneLayout);
slidingPaneLayout.addView(decorChild, 1);
}
private class MyPanelSlideListener extends SlidingPaneLayout.SimplePanelSlideListener {
@Override
public void onPanelSlide(View panel, float slideOffset) {
if (isFadingLeftView()) {
mLeftView.setAlpha(1 - slideOffset);
}
if (isSupportShadow()) {
WindowManager mWindowManager = (WindowManager) getSystemService(Context.WINDOW_SERVICE);
int mScreenW = mWindowManager.getDefaultDisplay().getWidth();
int distance = (int) (mScreenW * slideOffset);
RelativeLayout.LayoutParams rlp = (RelativeLayout.LayoutParams) mShadow.getLayoutParams();
rlp.leftMargin = mShadowMarginLeft + distance;
mShadow.setLayoutParams(rlp);
if (slideOffset > 0.5) {
mShadow.setAlpha(2 - slideOffset * 2);
}
}
}
@Override
public void onPanelOpened(View view) {
finish();
}
}
/**
* Is this activity support fading the left view.
*
* @return
*/
protected boolean isFadingLeftView() {
return false;
}
/**
* Is this activity support fading the right view.
*
* @return
*/
protected boolean isFadingRightView() {
return false;
}
/**
* Is this activity support adding the shadow.
*
* @return
*/
protected boolean isSupportShadow() {
return true;
}
private int DpToPx(Context context, float x) {
int result = 0;
final float scale = context.getResources().getDisplayMetrics().density;
result = (int) (x * scale + 0.5f);
return result;
}
}
| 34.763158 | 151 | 0.651022 |
0f815024f553a7196a84504d19f773a54efecc85 | 3,622 | cc | C++ | Xtide/xtide-2.14/libxtide/Offsets.cc | lobrien/TideMonkey | 296d8d24f25f5ef5aeafa1bab4a82246843fe9a7 | [
"MIT"
] | 1 | 2019-05-01T19:56:38.000Z | 2019-05-01T19:56:38.000Z | Xtide/xtide-2.14/libxtide/Offsets.cc | lobrien/TideMonkey | 296d8d24f25f5ef5aeafa1bab4a82246843fe9a7 | [
"MIT"
] | null | null | null | Xtide/xtide-2.14/libxtide/Offsets.cc | lobrien/TideMonkey | 296d8d24f25f5ef5aeafa1bab4a82246843fe9a7 | [
"MIT"
] | null | null | null | // $Id: Offsets.cc 5748 2014-10-11 19:38:53Z flaterco $
// Offsets: storage for tide offsets.
/*
Copyright (C) 1998 David Flater.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "libxtide.hh"
namespace libxtide {
SimpleOffsets::SimpleOffsets (Interval timeAdd,
PredictionValue levelAdd,
double levelMultiply):
_timeAdd(timeAdd),
_levelAdd(levelAdd),
_levelMultiply(levelMultiply) {
if (_levelMultiply == 0.0)
_levelMultiply = 1.0;
assert (_levelMultiply > 0.0);
}
SimpleOffsets::SimpleOffsets():
_levelMultiply(1.0) {}
const Interval SimpleOffsets::timeAdd() const {
return _timeAdd;
}
const PredictionValue SimpleOffsets::levelAdd() const {
return _levelAdd;
}
const double SimpleOffsets::levelMultiply () const {
return _levelMultiply;
}
const bool operator== (const SimpleOffsets &a, const SimpleOffsets &b) {
return (a.timeAdd() == b.timeAdd() &&
a.levelMultiply() == b.levelMultiply() &&
a.levelAdd() == b.levelAdd());
}
const bool operator!= (const SimpleOffsets &a, const SimpleOffsets &b) {
return !(a == b);
}
HairyOffsets::HairyOffsets (const SimpleOffsets &maxso,
const SimpleOffsets &minso,
NullableInterval floodBegins,
NullableInterval ebbBegins):
_maxso(maxso),
_minso(minso),
_floodBegins(floodBegins),
_ebbBegins(ebbBegins) {}
const Interval HairyOffsets::maxTimeAdd() const {
return _maxso.timeAdd();
}
const PredictionValue HairyOffsets::maxLevelAdd() const {
return _maxso.levelAdd();
}
const double HairyOffsets::maxLevelMultiply() const {
return _maxso.levelMultiply();
}
const Interval HairyOffsets::minTimeAdd() const {
return _minso.timeAdd();
}
const PredictionValue HairyOffsets::minLevelAdd() const {
return _minso.levelAdd();
}
const double HairyOffsets::minLevelMultiply() const {
return _minso.levelMultiply();
}
const NullableInterval HairyOffsets::floodBegins() const {
return _floodBegins;
}
const NullableInterval HairyOffsets::ebbBegins() const {
return _ebbBegins;
}
const bool HairyOffsets::trySimplify (SimpleOffsets &simpleOffsets_out) const {
if (_maxso != _minso)
return false;
// equal levelAdds cause the slacks to shift unless they are 0.
// equal levelMults do not move the slacks, even if there's a permanent
// current. (The distance between the middle level and the zero level
// is stretched proportional to the multiplier, so the time at which
// the slack occurs is unchanged.)
// See also special case for hydraulics in HarmonicsFile.cc.
if (!_floodBegins.isNull())
if (_floodBegins != _maxso.timeAdd() || _maxso.levelAdd().val() != 0.0)
return false;
if (!_ebbBegins.isNull())
if (_ebbBegins != _maxso.timeAdd() || _maxso.levelAdd().val() != 0.0)
return false;
simpleOffsets_out = _maxso;
return true;
}
}
| 26.057554 | 79 | 0.684705 |
75eeee57903f841b830a1229567949f088f5c78f | 643 | php | PHP | admin/salestatus.php | ipangpangeran/max-ipb | f7142e233c4f2c49decff23c53499d2fd88b50ae | [
"CC-BY-3.0"
] | null | null | null | admin/salestatus.php | ipangpangeran/max-ipb | f7142e233c4f2c49decff23c53499d2fd88b50ae | [
"CC-BY-3.0"
] | null | null | null | admin/salestatus.php | ipangpangeran/max-ipb | f7142e233c4f2c49decff23c53499d2fd88b50ae | [
"CC-BY-3.0"
] | null | null | null | <?php
include "../connect.php";
include "../login/ceklogin.php";
if (!empty($_GET['n'])){
if ($_GET['n'] == "terima")
{
mysql_query("UPDATE transaksi SET status='accept' WHERE id_transaksi='$_GET[id]'");
header("location: index.php?hal=sale&pesan=terima&id=$_GET[id]");
}
else if ($_GET['n'] == "tolak")
{
mysql_query("UPDATE transaksi SET status='denied' WHERE id_transaksi='$_GET[id]'");
header("location: index.php?hal=sale&pesan=batal&id=$_GET[id]");
}
else if ($_GET['n'] == "hapus")
{
mysql_query("DELETE FROM transaksi WHERE id_transaksi='$_GET[id]'");
header("location: index.php?hal=sale&pesan=hapus");
}
}
?> | 29.227273 | 85 | 0.645412 |
407fa2ede64829d1fce03aba25b8b22803f1c915 | 9,853 | py | Python | bitcoin_sneak/core.py | ozcn/bitcoin_sneak | 574bd851e2d0babdaa47d9655f40f4e333a4cd82 | [
"MIT"
] | 2 | 2017-09-17T07:35:30.000Z | 2018-01-28T22:48:17.000Z | bitcoin_sneak/core.py | ozcn/bitcoin_sneak | 574bd851e2d0babdaa47d9655f40f4e333a4cd82 | [
"MIT"
] | null | null | null | bitcoin_sneak/core.py | ozcn/bitcoin_sneak | 574bd851e2d0babdaa47d9655f40f4e333a4cd82 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from contextlib import closing
from future.moves.urllib import request
import json
import codecs
import sqlite3
from . import util
class BitcoindConnection(object):
def __init__(self, url, username, password):
super(BitcoindConnection, self).__init__()
self.id = 'bitcoin_sneak'
self.url = url
self.username = username
self.password = password
pm = request.HTTPPasswordMgrWithDefaultRealm()
pm.add_password(None, url, username, password)
request.install_opener(request.build_opener(
request.HTTPHandler(), request.HTTPBasicAuthHandler(pm)
))
def send_request(self, method, params=None):
req = request.Request(self.url)
data = {
'jsonrpc': '1.0',
'id': self.id,
'method': method
}
if params is not None:
data['params'] = params
query = bytes(json.dumps(data), encoding='utf-8')
with closing(request.urlopen(req, query)) as conn:
return json.load(
codecs.getreader('utf-8')(conn),
parse_float=util.parse_value
)['result']
def get_txinfo(self, txid, detailed=True):
return self.send_request(
'getrawtransaction',
[txid, 1 if detailed else 0]
)
def get_txioinfo(self, txid):
res = self.get_txinfo(txid)
for vin in res['vin']:
if 'txid' in vin:
tmp = self.get_txinfo(vin['txid'])
if 'vin' in tmp:
tmp = list(filter(
lambda x: x['n'] == vin['vout'],
tmp['vout']
))
if len(tmp) > 0:
vin['prev_out'] = tmp[0]
return res
class Database(object):
@property
def schema_version(self):
return '0'
def __init__(self, connection):
super(Database, self).__init__()
if isinstance(connection, sqlite3.Connection):
self.connection = connection
else:
self.connection = sqlite3.Connection(connection)
if not self.is_init():
self.__init_tables()
def __init_tables(self):
cur = self.connection.cursor()
cur.execute(
'CREATE TABLE metadata (key TEXT PRIMARY KEY, value TEXT)'
)
cur.execute(
'CREATE TABLE wallet (' +
'id TEXT PRIMARY KEY, ' +
'name TEXT'
')'
)
cur.execute(
'CREATE TABLE addr (' +
'address TEXT PRIMARY KEY, ' +
'wallet_id TEXT'
')'
)
cur.execute(
'CREATE TABLE tx (' +
'id TEXT PRIMARY KEY, ' +
'ts INTEGER' +
')'
)
cur.execute(
'CREATE TABLE txtx (' +
'tx_id_from TEXT, ' +
'tx_id_to TEXT, ' +
'n int, ' +
'addr_address TEXT, ' +
'amount int, ' +
'constraint txtx_pkey ' +
'PRIMARY KEY (tx_id_from, tx_id_to, n)'
')'
)
cur.execute(
'CREATE TABLE txio (' +
'tx_id TEXT NOT NULL REFERENCES tx(id), ' +
'addr_address TEXT NOT NULL REFERENCES addr(address), ' +
'incoming INTEGER NOT NULL, ' +
'value INTEGER, ' +
'constraint txio_pkey ' +
'PRIMARY KEY (tx_id, addr_address, incoming)'
')'
)
cur.execute(
'CREATE INDEX txio_ix_addr_address_incoming ON ' +
'txio (addr_address, incoming)'
)
cur.execute(
'CREATE INDEX addr_ix_wallet_id ON ' +
'addr (wallet_id)'
)
cur.executemany(
'INSERT INTO metadata (key, value) VALUES (?, ?)',
(('schema_version', self.schema_version),
('initialized_at', util.now()))
)
self.connection.commit()
def is_init(self):
"""return ``True`` if this object is initialized with current schema\
and return ``False`` otherwise.
"""
cur = self.connection.cursor()
masterdata = list(cur.execute(
'SELECT * FROM sqlite_master WHERE name="metadata"'
))
if len(masterdata) == 0:
return False
schema_version = list(cur.execute(
'SELECT value FROM metadata ' +
'WHERE key="schema_version"'
))
if len(schema_version) > 0 and \
schema_version[0][0] == self.schema_version:
return True
return False
def save_wallet(self, wallet_id, name=None, cur=None, commit=False):
if cur is None:
cur = self.connection.cursor()
if cur.execute('SELECT * FROM wallet WHERE id=?',
(wallet_id, )).fetchone() is not None:
cur.execute('UPDATE wallet SET name=? WHERE id=?',
(name, wallet_id))
else:
cur.execute('INSERT INTO wallet (id, name) VALUES (?, ?)',
(wallet_id, name))
if commit:
self.connection.commit()
def save_addr(self, address, wallet_id, cur=None, commit=False):
if cur is None:
cur = self.connection.cursor()
if cur.execute('SELECT * FROM addr WHERE address=?',
(address, )).fetchone() is not None:
cur.execute('UPDATE addr SET wallet_id=? WHERE address=?',
(wallet_id, address))
else:
cur.execute('INSERT INTO addr (address, wallet_id) VALUES (?, ?)',
(address, wallet_id))
if commit:
self.connection.commit()
def save_tx(self, txid, ts, cur=None, commit=False):
if cur is None:
cur = self.connection.cursor()
if cur.execute('SELECT * FROM tx WHERE id=?',
(txid, )).fetchone() is not None:
cur.execute('UPDATE tx SET ts=? WHERE id=?',
(ts, txid))
else:
cur.execute('INSERT INTO tx (id, ts) VALUES (?, ?)',
(txid, ts))
if commit:
self.connection.commit()
def save_txtx(self, tx_id_from, tx_id_to, n, addr_address,
amount, cur=None, commit=False):
if cur is None:
cur = self.connection.cursor()
if cur.execute(
'SELECT * FROM txtx WHERE ' +
'tx_id_from=? and tx_id_to=? and n=?',
(tx_id_from, tx_id_to, n)).fetchone() is not None:
cur.execute('UPDATE txtx SET addr_address=?, amount=? WHERE ' +
'tx_id_from=? and tx_id_to=? and n=?',
(addr_address, amount, tx_id_from, tx_id_to, n))
else:
cur.execute(
'INSERT INTO txtx ' +
'(tx_id_from, tx_id_to, n, addr_address, amount) ' +
'VALUES (?, ?, ?, ?, ?)',
(tx_id_from, tx_id_to, n, addr_address, amount))
if commit:
self.connection.commit()
def save_txio(self, txid, address, incoming, value,
cur=None, commit=False):
if cur is None:
cur = self.connection.cursor()
if cur.execute(
'SELECT * FROM txio WHERE ' +
'tx_id=? AND addr_address=? AND incoming=?',
(txid, address, incoming)
).fetchone() is not None:
cur.execute(
'UPDATE txio SET value=? WHERE ' +
'tx_id=? AND addr_address=? AND incoming=?',
(value, txid, address, incoming)
)
else:
cur.execute(
'INSERT INTO txio (tx_id, addr_address, incoming, value) ' +
'VALUES (?, ?, ?, ?)',
(txid, address, incoming, value)
)
if commit:
self.connection.commit()
def save_txinfo(self, txinfo, cur=None, commit=False):
if cur is None:
cur = self.connection.cursor()
wallets = []
addresses = []
for d in txinfo['txtx']:
self.save_txtx(d['tx_id_from'], d['tx_id_to'], d['n'],
d['addr_address'], d['amount'], cur=cur)
for d in txinfo['incoming']:
addr_data = cur.execute(
'SELECT wallet_id FROM addr WHERE address=?',
(d['address'], )
).fetchone()
if addr_data is not None:
wid = addr_data[0]
wallets.append(wid)
addresses += [d[0] for d in cur.execute(
'SELECT address FROM addr WHERE wallet_id=?',
(wid, )
)]
else:
addresses.append(d['address'])
if len(wallets) == 0:
wid = util.gen_id()
self.save_wallet(wid, cur=cur)
else:
wid = wallets[0]
for addr in addresses:
self.save_addr(addr, wid, cur=cur)
for d in txinfo['outgoing']:
if cur.execute(
'SELECT wallet_id FROM addr WHERE address=?',
(d['address'], )
).fetchone() is None:
wid = util.gen_id()
self.save_wallet(wid, cur=cur)
self.save_addr(d['address'], wid, cur=cur)
self.save_txio(txinfo['txid'], d['address'], 0, d['value'])
for d in txinfo['incoming']:
self.save_txio(txinfo['txid'], d['address'], 1, d['value'])
self.save_tx(txinfo['txid'], txinfo['ts'], cur)
if commit:
self.connection.commit()
| 35.315412 | 78 | 0.494063 |
61e13ed39e7810c01bd3272f272b4e4e61ef7dcc | 43 | sql | SQL | sql/passage/select.sql | Hiroshiba/KotohiraYu | 1ab5a5376e01aae5c730ae163298e1c34980b586 | [
"MIT"
] | 1 | 2019-12-11T00:05:00.000Z | 2019-12-11T00:05:00.000Z | sql/passage/select.sql | Leies-202/KotohiraYu | e2fe2011504e0ad85ccbd5b2c33eb09172612c16 | [
"MIT"
] | 1 | 2019-05-18T13:16:25.000Z | 2019-05-18T13:16:25.000Z | sql/passage/select.sql | Hiroshiba/KotohiraYu | 1ab5a5376e01aae5c730ae163298e1c34980b586 | [
"MIT"
] | null | null | null | SELECT * FROM `passage` WHERE ID_Inst = ?;
| 21.5 | 42 | 0.674419 |
2859f1a437fca05a2b85b63f27d056b88b2f588e | 3,047 | cpp | C++ | source/adios2/toolkit/transportman/stagingman/StagingMan.cpp | ax3l/ADIOS2 | ad3095eec85604b711d21efceba427cdf4eb25e1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | source/adios2/toolkit/transportman/stagingman/StagingMan.cpp | ax3l/ADIOS2 | ad3095eec85604b711d21efceba427cdf4eb25e1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | source/adios2/toolkit/transportman/stagingman/StagingMan.cpp | ax3l/ADIOS2 | ad3095eec85604b711d21efceba427cdf4eb25e1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | /*
* Distributed under the OSI-approved Apache License, Version 2.0. See
* accompanying file Copyright.txt for details.
*
* StagingMan.cpp
*
* Created on: Oct 1, 2018
* Author: Jason Wang wangr1@ornl.gov
*/
#include <iostream>
#include "StagingMan.h"
namespace adios2
{
namespace transportman
{
StagingMan::StagingMan(const MPI_Comm mpiComm, const Mode openMode,
const int timeout, const size_t maxBufferSize)
: m_MpiComm(mpiComm), m_Timeout(timeout), m_OpenMode(openMode),
m_Transport(mpiComm, timeout), m_MaxBufferSize(maxBufferSize)
{
m_Buffer.reserve(maxBufferSize);
}
StagingMan::~StagingMan() {}
void StagingMan::OpenTransport(const std::string &fullAddress)
{
m_Transport.Open(fullAddress, m_OpenMode);
}
void StagingMan::CloseTransport() { m_Transport.Close(); }
std::shared_ptr<std::vector<char>>
StagingMan::Request(const std::vector<char> &request,
const std::string &address)
{
auto reply = std::make_shared<std::vector<char>>();
int ret = m_Transport.Open(address, m_OpenMode);
;
auto start_time = std::chrono::system_clock::now();
while (ret)
{
ret = m_Transport.Open(address, m_OpenMode);
auto now_time = std::chrono::system_clock::now();
auto duration = std::chrono::duration_cast<std::chrono::seconds>(
now_time - start_time);
if (duration.count() > m_Timeout)
{
return reply;
}
}
ret = m_Transport.Write(request.data(), request.size());
start_time = std::chrono::system_clock::now();
while (ret < 1)
{
ret = m_Transport.Write(request.data(), request.size());
auto now_time = std::chrono::system_clock::now();
auto duration = std::chrono::duration_cast<std::chrono::seconds>(
now_time - start_time);
if (duration.count() > m_Timeout)
{
return reply;
}
}
ret = m_Transport.Read(m_Buffer.data(), m_MaxBufferSize);
start_time = std::chrono::system_clock::now();
while (ret < 1)
{
ret = m_Transport.Read(m_Buffer.data(), m_MaxBufferSize);
auto now_time = std::chrono::system_clock::now();
auto duration = std::chrono::duration_cast<std::chrono::seconds>(
now_time - start_time);
if (duration.count() > m_Timeout)
{
return reply;
}
}
reply->resize(ret);
std::memcpy(reply->data(), m_Buffer.data(), ret);
m_Transport.Close();
return reply;
}
std::shared_ptr<std::vector<char>> StagingMan::ReceiveRequest()
{
int bytes = m_Transport.Read(m_Buffer.data(), m_MaxBufferSize);
if (bytes < 0)
{
bytes = 0;
}
auto request = std::make_shared<std::vector<char>>(bytes);
std::memcpy(request->data(), m_Buffer.data(), bytes);
return request;
}
void StagingMan::SendReply(std::shared_ptr<std::vector<char>> reply)
{
m_Transport.Write(reply->data(), reply->size());
}
} // end namespace transportman
} // end namespace adios2
| 27.45045 | 73 | 0.633082 |
8f869ce4ba3a07f5d0a4014d76b2987e6d6fa8b8 | 1,143 | kt | Kotlin | app/src/main/java/ru/aasmc/jetnotes/data/database/model/ColorDbModel.kt | aasmc/JetNotes | f67cad537120262bf10b7c35f965b1219aed0ba9 | [
"Unlicense"
] | null | null | null | app/src/main/java/ru/aasmc/jetnotes/data/database/model/ColorDbModel.kt | aasmc/JetNotes | f67cad537120262bf10b7c35f965b1219aed0ba9 | [
"Unlicense"
] | null | null | null | app/src/main/java/ru/aasmc/jetnotes/data/database/model/ColorDbModel.kt | aasmc/JetNotes | f67cad537120262bf10b7c35f965b1219aed0ba9 | [
"Unlicense"
] | null | null | null | package ru.aasmc.jetnotes.data.database.model
import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.PrimaryKey
@Entity
data class ColorDbModel(
@PrimaryKey(autoGenerate = true) val id: Long = 0,
@ColumnInfo(name = "hex") val hex: String,
@ColumnInfo(name = "name") val name: String
) {
companion object {
val DEFAULT_COLORS = listOf(
ColorDbModel(1, "#FFFFFF", "White"),
ColorDbModel(2, "#E57373", "Red"),
ColorDbModel(3, "#F06292", "Pink"),
ColorDbModel(4, "#CE93D8", "Purple"),
ColorDbModel(5, "#2196F3", "Blue"),
ColorDbModel(6, "#00ACC1", "Cyan"),
ColorDbModel(7, "#26A69A", "Teal"),
ColorDbModel(8, "#4CAF50", "Green"),
ColorDbModel(9, "#8BC34A", "Light Green"),
ColorDbModel(10, "#CDDC39", "Lime"),
ColorDbModel(11, "#FFEB3B", "Yellow"),
ColorDbModel(12, "#FF9800", "Orange"),
ColorDbModel(13, "#BCAAA4", "Brown"),
ColorDbModel(14, "#9E9E9E", "Gray")
)
val DEFAULT_COLOR = DEFAULT_COLORS[0]
}
}
| 33.617647 | 54 | 0.570429 |
04191327475de66322f05ef6f5228bfe02d06333 | 5,260 | js | JavaScript | public/src/gameDevLib/Blocks/BlockGrid.js | Chibibyte/BomberBoy | 73f87fb98decd2a0befbbb4a4fe621c5bf3e04c2 | [
"MIT"
] | null | null | null | public/src/gameDevLib/Blocks/BlockGrid.js | Chibibyte/BomberBoy | 73f87fb98decd2a0befbbb4a4fe621c5bf3e04c2 | [
"MIT"
] | null | null | null | public/src/gameDevLib/Blocks/BlockGrid.js | Chibibyte/BomberBoy | 73f87fb98decd2a0befbbb4a4fe621c5bf3e04c2 | [
"MIT"
] | null | null | null | import * as BlockGlobal from "./Block.js";
import * as UnitGlobal from "./Units/Unit.js";
import { Block } from "./Block.js";
/**
* Grid of Blocks
*
* Devides its space into a grid and allows for grid placement of blocks (instead of exact positions)
*/
export class BlockGrid extends Block {
constructor(ctx, maxColumns, maxRows, color, adjustSize = true) {
super(ctx);
this.color = color;
this.maxColumns = maxColumns;
this.maxRows = maxRows;
this.adjustSize = adjustSize;
this.blocks = new Array(maxColumns * maxRows);
this.blocks.fill(false);
this.xStep = 100 / this.maxColumns;
this.yStep = 100 / this.maxRows;
this.index = 0;
}
/**
* Transforms index to grid coords
*
* @param {*} index
*/
indexToCoords(index) {
let coords = {};
coords.x = index % this.maxColumns;
coords.y = (index - coords.x) / this.maxColumns;
return coords;
}
/**
* Transforms grid coords to index
*/
coordsToIndex(gridX, gridY) {
let index = gridY * this.maxColumns + gridX;
return index;
}
/**
* Transforms unit to grid coordinates
*
* @param {*} unitX
* @param {*} unitY
*/
unitToGridCoords(unitX, unitY) {
let gridX = Math.round(unitX / this.xStep);
let gridY = Math.round(unitY / this.yStep);
return { x: gridX, y: gridY };
}
/**
* Transforms unit coords to index
*/
unitCoordsToIndex(gridX, gridY) {
let gridCoords = this.unitToGridCoords(gridX, gridY);
return this.coordsToIndex(gridCoords.x, gridCoords.y);
}
/**
* Transforms grid to unit coordinates
*
* @param {*} unitX
* @param {*} unitY
*/
gridToUnitCoords(gridX, gridY) {
let x = this.xStep * gridX;
let y = this.yStep * gridY;
return { x, y };
}
/**
* Checks if the grid position on @index is empty
*
* @param {*} index
*/
isEmpty(index) {
return (!this.blocks[index] || this.blocks[index] == undefined);
}
/**
* Returns the Block stored in @index
*
* @param {*} index
*/
getBlock(index) {
return this.blocks[index];
}
/**
* Places a block (or false) at the grid location @index
*
* @param {*} index
* @param {*} block
* @param {*} overwrite Whether or not to overwrite an existing block if position taken
* @param {*} spawnOnly If set, block will only be placed at that grid position (for exact placement in grid without tracking)
*/
setBlockByIndex(index, block, overwrite = true, spawnOnly = false) {
// delete existing block globally and locally
if (this.blocks[index]) {
if (!overwrite || spawnOnly) return false;
let oldBlock = this.blocks[index];
oldBlock.removeFromCollection();
delete this.children[oldBlock.key];
}
// set new block and change position
if (!spawnOnly) this.blocks[index] = block;
if (!block) return true;
this.appendChild(block);
let coords = this.indexToCoords(index);
block._x = this.xStep * coords.x;
block._y = this.yStep * coords.y;
if (this.adjustSize) {
block.width = this.xStep;
block.height = this.yStep;
}
return true;
}
/**
*
* @param {number} x grid x
* @param {number} y grid y
* @param {Block} block Block to place on (x,y)
* @param {boolean} overwrite if set, old Block in this position will be overwritten
* @param {boolean} spawnOnly if set, @block will be placed in position (x,y) BUT not stored in grid
* therefore on
*/
setBlock(x, y, block, overwrite = true, spawnOnly = false) {
let index = y * this.maxColumns + x;
return this.setBlockByIndex(index, block, overwrite, spawnOnly);
}
addBlock(block) {
this.setBlockByIndex(this.index, block);
this.index++;
}
/**
* Fills a row with blocks of type given in @data OR false (alternating)
* @param {number} row row index
* @param {...any} data A date can be a blocks class or false (e.g.: BlockA, BlockB, false, BlockC)
*/
fillRow(rowIndex, overwrite = true, spawnOnly = false, ...data) {
let start = this.maxColumns * rowIndex;
let end = start + this.maxColumns;
let dataIndex = 0;
while (start < end) {
let date = data[dataIndex];
dataIndex = (dataIndex + 1) % data.length;
let newBlock = !date ? false : new date(this.ctx);
let success = this.setBlockByIndex(start, newBlock, overwrite, spawnOnly)
if (!success) {
newBlock.removeFromCollection();
}
start++;
}
}
/**
* Applies function @fct on every block element stored in this @BlockGrid
*
* @param {function} fct function to apply
*/
blockApply(fct) {
this.blocks.forEach(block => block ? fct(block) : false);
}
} | 30.229885 | 134 | 0.560837 |
927b72f93f541c51ea00688a78c922ab9a368b0a | 505 | h | C | Resources/WC_7_0_5_Headers/MCLipFilter.h | shuangwei-Ye/WeChat_tweak | 0f496f38f0336908258d606dcbef7067a096926a | [
"MIT"
] | 2 | 2021-05-30T07:50:20.000Z | 2022-02-23T15:42:53.000Z | Resources/WC_7_0_5_Headers/MCLipFilter.h | LP36911/WeChat_tweak | 0f496f38f0336908258d606dcbef7067a096926a | [
"MIT"
] | null | null | null | Resources/WC_7_0_5_Headers/MCLipFilter.h | LP36911/WeChat_tweak | 0f496f38f0336908258d606dcbef7067a096926a | [
"MIT"
] | null | null | null | //
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.
//
#import "MCBaseFilter.h"
@interface MCLipFilter : MCBaseFilter
{
char *vertexSamplingCoordinates;
struct CGSize previousInputTextureSize;
double _strength;
}
- (void)dealloc;
- (id)init;
- (void)renderToTextureWithVertices:(const float *)arg1 textureCoordinates:(const float *)arg2;
@property double strength; // @synthesize strength=_strength;
@end
| 21.956522 | 95 | 0.716832 |
efbeb1d0438c88dc2e6c469efc4ae0e2a9a78372 | 504 | sql | SQL | codebase/projects/cae_reengineering/1.2/db/ACCESSION_CHARACTERISTICS.sql | NCIP/catrip | 1615ab2598cf5ce060e98d69052ae0e52eaf9148 | [
"BSD-3-Clause"
] | null | null | null | codebase/projects/cae_reengineering/1.2/db/ACCESSION_CHARACTERISTICS.sql | NCIP/catrip | 1615ab2598cf5ce060e98d69052ae0e52eaf9148 | [
"BSD-3-Clause"
] | 1 | 2019-04-30T06:37:01.000Z | 2019-04-30T06:37:01.000Z | codebase/projects/cae_reengineering/1.2/db/ACCESSION_CHARACTERISTICS.sql | NCIP/catrip | 1615ab2598cf5ce060e98d69052ae0e52eaf9148 | [
"BSD-3-Clause"
] | null | null | null | /*L
Copyright Duke Comprehensive Cancer Center
Distributed under the OSI-approved BSD 3-Clause License.
See http://ncip.github.com/catrip/LICENSE.txt for details.
L*/
CREATE TABLE ACCESSION_CHARACTERISTICS
(
ID NUMBER(10,2),
OTHER_SURGICAL_PROCEDURE VARCHAR2(255 BYTE)
);
CREATE UNIQUE INDEX PK_ACCESSION_CHARACTERISTICS ON ACCESSION_CHARACTERISTICS
(ID);
ALTER TABLE ACCESSION_CHARACTERISTICS ADD (
CONSTRAINT PK_ACCESSION_CHARACTERISTICS PRIMARY KEY (ID));
| 21 | 77 | 0.755952 |
860da4e8bc61db6fd7a80311d7efbc4f54278cab | 5,616 | java | Java | WEB_APP/src/com/tlcpub/net/ctl/service/SchedulerService.java | tlccpd/tlc_pub | 2c7fa1d9c1e7d2587fbf8f74de30066ad31c6c6f | [
"Apache-2.0"
] | 1 | 2018-07-13T08:23:46.000Z | 2018-07-13T08:23:46.000Z | WEB_APP/src/com/tlcpub/net/ctl/service/SchedulerService.java | tlccpd/tlc_pub | 2c7fa1d9c1e7d2587fbf8f74de30066ad31c6c6f | [
"Apache-2.0"
] | null | null | null | WEB_APP/src/com/tlcpub/net/ctl/service/SchedulerService.java | tlccpd/tlc_pub | 2c7fa1d9c1e7d2587fbf8f74de30066ad31c6c6f | [
"Apache-2.0"
] | null | null | null | package com.tlcpub.net.ctl.service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import org.apache.log4j.Logger;
import org.quartz.CronExpression;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.quartz.CronTriggerBean;
import org.springframework.scheduling.quartz.JobDetailBean;
import org.springframework.scheduling.quartz.QuartzJobBean;
import org.springframework.scheduling.quartz.SchedulerFactoryBean;
import org.springframework.stereotype.Service;
import com.tlcpub.net.core.exception.NotExistException;
import com.tlcpub.net.core.exception.NotFoundException;
import com.tlcpub.net.core.type.Switch;
import com.tlcpub.net.core.type.YesNo;
import com.tlcpub.net.core.util.BeanFinder;
import com.tlcpub.net.core.util.ShellCommander;
import com.tlcpub.net.ctl.dao.SchedulerDao;
import com.tlcpub.net.ctl.dto.Schedule;
import com.tlcpub.net.ctl.dto.Server;
import com.tlcpub.net.usr.dto.User;
@Service
public class SchedulerService {
SchedulerFactoryBean schedulerFactory = new SchedulerFactoryBean();
HashMap<String, CronTriggerBean> cronTriggerMap = new HashMap<String, CronTriggerBean>();
HashMap<String, String> schedulerJobMap = null;
boolean isInitialized = false;
@Resource(name="hostNameShellCommander")
ShellCommander commander;
@Autowired
protected SchedulerDao schedulerDao;
Logger logger = Logger.getLogger(SchedulerService.class);
String hostName;
public void addSchedule(Schedule schedule){
schedulerDao.insertSchedule(schedule);
}
public List<Schedule> getEntireSchedules(){
return schedulerDao.selectEntireSchedules();
}
public User getScheduleById(String schId) throws NotFoundException{
User schedule = schedulerDao.selectScheduleById(schId);
if(schedule == null)
throw new NotFoundException(schId);
return schedule;
}
public void changeSchedule(Schedule schedule) throws NotExistException{
int cnt = schedulerDao.updateSchedule(schedule);
if(cnt == 0)
throw new NotExistException(schedule);
}
public void cancelSchedule(String schId) throws NotExistException{
int cnt = schedulerDao.deleteSchedule(schId);
if(cnt == 0)
throw new NotExistException(schId);
}
public List<Server> getServerList(){
return schedulerDao.selectServerList();
}
public Map<String, String> getSchedulerJobMap() {
if(schedulerJobMap == null){
String[] jobBeanNames = BeanFinder.getBeanNamesForType(QuartzJobBean.class);
schedulerJobMap = new HashMap<String, String>();
for(String name: jobBeanNames)
schedulerJobMap.put(name, name);
}
return schedulerJobMap;
}
@SuppressWarnings("unchecked")
public void reSchedule() throws Exception{
logger.info("# Scheduler (re)start");
schedulerFactory.stop();
logger.info(" > Scheduler stopped.");
if(hostName == null){
commander.execute();
hostName = commander.getResultString().trim();
}
Switch switchState = (Switch) schedulerDao.selectSchedulingByServerName(hostName);
logger.info(" > Host("+hostName+") scheduling state : "+switchState);
if(switchState == Switch.OFF)
return;
cronTriggerMap.clear();
List<Schedule> scheduleList = getEntireSchedules();
for(Schedule sch: scheduleList){
if(sch.getEnabled() == YesNo.NO)
continue;
String schId = Integer.toString(sch.getSchId());
String beanId = sch.getBeanId();
Object bean = BeanFinder.getBean(beanId);
if(bean == null){
logger.fatal("Bean("+beanId+") not found - Please move bean declaration to ContextLoaderListener's context");
continue;
}
Class<QuartzJobBean> clazz = (Class<QuartzJobBean>)bean.getClass();
CronTriggerBean trigger = createTrigger(schId, clazz, sch.getMinute(), sch.getHour(), sch.getDay(), sch.getMonth());
cronTriggerMap.put(schId, trigger);
logger.info(" > JOB : "+ beanId+" - "+sch.getMonth()+"."+sch.getDay()+"."+sch.getHour()+"."+sch.getMinute());
}
CronTriggerBean[] triggers = cronTriggerMap.values().toArray(new CronTriggerBean[cronTriggerMap.size()]);
schedulerFactory.setOverwriteExistingJobs(true);
schedulerFactory.setTriggers(triggers);
schedulerFactory.setWaitForJobsToCompleteOnShutdown(false);
schedulerFactory.afterPropertiesSet();
logger.info(" > Scheduler started.");
return;
}
private CronTriggerBean createTrigger(String id, Class<QuartzJobBean> clazz, String min, String hour, String day, String month) throws Exception{
HashMap<String, Object> schedulerEnvMap = new HashMap<String, Object>();
JobDetailBean jobDetail = new JobDetailBean();
jobDetail.setName(id);
jobDetail.setJobClass(clazz);
jobDetail.setJobDataAsMap(schedulerEnvMap);
jobDetail.afterPropertiesSet();
CronTriggerBean trigger = new CronTriggerBean();
trigger.setName("trigger-"+id);
trigger.setJobDetail(jobDetail);
trigger.setJobName(id);
trigger.afterPropertiesSet();
CronExpression expression = new CronExpression("0 "+min+" "+hour+" "+day+" "+month+" ? *");
trigger.setCronExpression(expression);
return trigger;
}
}
| 34.453988 | 149 | 0.686254 |
83fe8f1f48ecb3707a2729fa8be9030433b71e63 | 6,207 | java | Java | src/main/java/org/nearbyshops/RESTEndpointsCart/CartItemResource.java | WambuaSimon/Nearby-Shops-API | e9bb41b940c573be5c215d005d817ec5d5eba0ca | [
"MIT"
] | null | null | null | src/main/java/org/nearbyshops/RESTEndpointsCart/CartItemResource.java | WambuaSimon/Nearby-Shops-API | e9bb41b940c573be5c215d005d817ec5d5eba0ca | [
"MIT"
] | null | null | null | src/main/java/org/nearbyshops/RESTEndpointsCart/CartItemResource.java | WambuaSimon/Nearby-Shops-API | e9bb41b940c573be5c215d005d817ec5d5eba0ca | [
"MIT"
] | null | null | null | package org.nearbyshops.RESTEndpointsCart;
import org.nearbyshops.DAOsPrepared.ItemDAO;
import org.nearbyshops.Globals.Globals;
import org.nearbyshops.Model.Cart;
import org.nearbyshops.Model.CartItem;
import javax.ws.rs.*;
import javax.ws.rs.core.GenericEntity;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
import java.util.List;
@Path("/api/CartItem")
public class CartItemResource {
private ItemDAO itemDAO = Globals.itemDAO;
public CartItemResource() {
super();
// TODO Auto-generated constructor stub
}
@POST
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public Response createCartItem(CartItem cartItem,
@QueryParam("EndUserID") int endUserID,
@QueryParam("ShopID") int shopID)
{
// System.out.println("End User DELIVERY_GUY_SELF_ID : " + endUserID + " ShopID : " + shopID);
if(endUserID>0 && shopID>0)
{
// Check if the Cart exists if not then create one
List<Cart> list = Globals.cartService.readCarts(endUserID,shopID);
if(list.size()==0)
{
// cart does not exist so create one
Cart cart = new Cart();
cart.setEndUserID(endUserID);
cart.setShopID(shopID);
int idOfInsertedCart = Globals.cartService.saveCart(cart);
cartItem.setCartID(idOfInsertedCart);
}
else if(list.size()==1)
{
// cart exists
cartItem.setCartID(list.get(0).getCartID());
}
}
int rowCount = Globals.cartItemService.saveCartItem(cartItem);
//
// try {
// Thread.sleep(1000);
// } catch (InterruptedException e) {
// e.printStackTrace();
// }
if(rowCount == 1)
{
return Response.status(Status.CREATED)
.entity(null)
.build();
}else if(rowCount <= 0)
{
return Response.status(Status.NOT_MODIFIED)
.entity(null)
.build();
}
return null;
}
@PUT
@Consumes(MediaType.APPLICATION_JSON)
public Response updateCartItem(CartItem cartItem,
@QueryParam("EndUserID") int endUserID,
@QueryParam("ShopID") int shopID)
{
if(endUserID>0 && shopID>0)
{
// Check if the Cart exists if not then create one
List<Cart> list = Globals.cartService.readCarts(endUserID,shopID);
if(list.size()==0)
{
// cart does not exist so create one
Cart cart = new Cart();
cart.setEndUserID(endUserID);
cart.setShopID(shopID);
int idOfInsertedCart = Globals.cartService.saveCart(cart);
cartItem.setCartID(idOfInsertedCart);
}
else if(list.size()==1)
{
// cart exists
cartItem.setCartID(list.get(0).getCartID());
}
}
int rowCount = Globals.cartItemService.updateCartItem(cartItem);
// try {
// Thread.sleep(1000);
// } catch (InterruptedException e) {
// e.printStackTrace();
// }
if(rowCount >= 1)
{
return Response.status(Status.OK)
.build();
}
else if(rowCount == 0)
{
return Response.status(Status.NOT_MODIFIED)
.build();
}
return null;
}
@DELETE
public Response deleteCartItem(@QueryParam("CartID")int cartID, @QueryParam("ItemID") int itemID,
@QueryParam("EndUserID") int endUserID,
@QueryParam("ShopID") int shopID)
{
if(endUserID>0 && shopID>0)
{
// Check if the Cart exists if not then create one
List<Cart> list = Globals.cartService.readCarts(endUserID,shopID);
if(list.size()==1)
{
cartID = list.get(0).getCartID();
}
}
int rowCount = Globals.cartItemService.deleteCartItem(itemID,cartID);
// try {
// Thread.sleep(1000);
// } catch (InterruptedException e) {
// e.printStackTrace();
// }
if(rowCount>=1)
{
// if the cart item is the last item then delete the cart also.
// System.out.println("Cart Items : " + cartID + " : " + Globals.cartItemService.getCartItem(cartID,0,0).size());
if(Globals.cartItemService.getCartItem(cartID,null,null).size() == 0)
{
// System.out.println("Inside Cart Item Delete " + Globals.cartItemService.getCartItem(cartID,null,null).size());
Globals.cartService.deleteCart(cartID);
}
return Response.status(Status.OK)
.build();
}
if(rowCount == 0)
{
return Response.status(Status.NOT_MODIFIED)
.build();
}
return null;
}
@GET
@Produces(MediaType.APPLICATION_JSON)
public Response getCartItem(@QueryParam("CartID")Integer cartID,
@QueryParam("ItemID")Integer itemID,
@QueryParam("EndUserID") Integer endUserID,
@QueryParam("ShopID") Integer shopID,
@QueryParam("GetItems") Boolean getItems,
@QueryParam("SortBy") String sortBy,
@QueryParam("Limit")Integer limit, @QueryParam("Offset")Integer offset,
@QueryParam("metadata_only")Boolean metaonly)
{
List<CartItem> cartList;
if(shopID != null)
{
cartList = Globals.cartItemService
.getCartItemRefined(endUserID, shopID, sortBy,limit,offset);
/*
for(CartItem cartItem: cartList)
{
if(itemID == null && getItems!=null && getItems)
{
cartItem.setItem(itemDAO.getItem(cartItem.getItemID()));
}
// cartItem.setItem(itemDAO.getItem(cartItem.getItemID()));
}
*/
}else
{
cartList = Globals.cartItemService.getCartItem(cartID,itemID,endUserID);
for(CartItem cartItem: cartList)
{
if(cartID == null)
{
cartItem.setCart(Globals.cartService.readCart(cartItem.getCartID()));
}
/*
if(itemID == null && getItems!=null && getItems)
{
cartItem.setItem(itemDAO.getItem(cartItem.getItemID()));
}*/
}
}
GenericEntity<List<CartItem>> listEntity = new GenericEntity<List<CartItem>>(cartList){
};
if(cartList.size()<=0)
{
return Response.status(Status.NO_CONTENT)
.entity(listEntity)
.build();
}else
{
return Response.status(Status.OK)
.entity(listEntity)
.build();
}
}
}
| 19.039877 | 116 | 0.621073 |
16dd70ea2a9df0c52adbb5ce18c1276c840f6d3e | 624 | ts | TypeScript | demo/src/app/components/collapse/index.ts | DannyAn/ag-bootstrap | 823bfd2df24fe9455b0cac6d43992f3be93821b4 | [
"MIT"
] | 2 | 2018-06-24T04:02:54.000Z | 2018-09-29T19:02:07.000Z | demo/src/app/components/collapse/index.ts | DannyAn/ag-bootstrap | 823bfd2df24fe9455b0cac6d43992f3be93821b4 | [
"MIT"
] | null | null | null | demo/src/app/components/collapse/index.ts | DannyAn/ag-bootstrap | 823bfd2df24fe9455b0cac6d43992f3be93821b4 | [
"MIT"
] | null | null | null | export * from './collapse.component';
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { NgbdSharedModule } from '../../shared';
import { NgbdComponentsSharedModule } from '../shared';
import { NgbdCollapse } from './collapse.component';
import { DEMO_DIRECTIVES } from './demos';
import { NgbdCollapseRoutingModule } from './collapse.routing';
@NgModule({
imports: [CommonModule, NgbdSharedModule, NgbdComponentsSharedModule,NgbdCollapseRoutingModule],
exports: [NgbdCollapse],
declarations: [NgbdCollapse, ...DEMO_DIRECTIVES]
})
export class NgbdCollapseModule { }
| 34.666667 | 98 | 0.745192 |
90678f8cd4ef1334cb0eec6685fec68c686510a6 | 2,309 | py | Python | schema.py | MaoRodriguesJ/neo4j-schema-extract-code | 785abe825c3df2197dfe116062a858cea146afc1 | [
"MIT"
] | null | null | null | schema.py | MaoRodriguesJ/neo4j-schema-extract-code | 785abe825c3df2197dfe116062a858cea146afc1 | [
"MIT"
] | null | null | null | schema.py | MaoRodriguesJ/neo4j-schema-extract-code | 785abe825c3df2197dfe116062a858cea146afc1 | [
"MIT"
] | null | null | null | from collator import Collator
from database import Database
from driver import Driver
from extractor import Extractor
from parser import Parser
from pathlib import Path
import sys, os, json
class Schema():
# Schema get the input from the Collator and the Extractor to feed the Parser
# and generate a list of ready json files to be saved
def __init__(self, database):
self._collator = Collator(database)
self._extractor = Extractor()
self._parser = Parser()
def generate(self, path):
grouping_nodes = self._collator.grouping_nodes()
print('\n ---- Done Grouping Nodes ----')
Schema.print_grouping(grouping_nodes)
grouping_relationships = self._collator.grouping_relationships()
print('\n ---- Done Grouping Relationships ----')
Schema.print_grouping(grouping_relationships)
extracted_grouping_nodes = self._extractor.extract(grouping_nodes)
print('\n ---- Done Extracting ----')
Schema.print_grouping({**extracted_grouping_nodes, ** grouping_relationships})
parsed_list = self._parser.parse(extracted_grouping_nodes, grouping_relationships)
self._save(path, parsed_list)
def _save(self, path, parsed_list):
if not os.path.exists(path):
os.makedirs(path)
data_folder = Path(path)
for item in parsed_list:
with open(data_folder / item['$id'], 'w') as parsed_file:
json.dump(item, parsed_file, indent=4)
@staticmethod
def print_grouping(grouping):
for k in grouping:
print('\nKey: ' + str(k))
print('Properties: ' +str(grouping[k]['props']))
if 'relationships' in grouping[k].keys():
print('Relationships: ' + str(grouping[k]['relationships']))
if 'allOf' in grouping[k].keys():
print('allOf: ' + str(grouping[k]['allOf']))
if __name__ == '__main__':
url = "bolt://0.0.0.0:7687"
login = "neo4j"
password = "neo4jadmin"
path = "generated_schema"
if len(sys.argv) == 5:
url = sys.argv[1]
login = sys.argv[2]
password = sys.argv[3]
path = sys.argv[4]
schema = Schema(Database(Driver(url, login, password)))
schema.generate(path)
| 31.630137 | 90 | 0.627544 |
a1adbd6f6beda35d8ff1055ef7dde223e14b2648 | 7,999 | h | C | Cpp/SDK/RadialCenterRearmButton_classes.h | MrManiak/Squad-SDK | 742feb5991ae43d6f0cedd2d6b32b949923ca4f9 | [
"Apache-2.0"
] | 1 | 2020-08-15T08:31:55.000Z | 2020-08-15T08:31:55.000Z | Cpp/SDK/RadialCenterRearmButton_classes.h | MrManiak/Squad-SDK | 742feb5991ae43d6f0cedd2d6b32b949923ca4f9 | [
"Apache-2.0"
] | 2 | 2020-08-15T08:43:56.000Z | 2021-01-15T05:04:48.000Z | Cpp/SDK/RadialCenterRearmButton_classes.h | MrManiak/Squad-SDK | 742feb5991ae43d6f0cedd2d6b32b949923ca4f9 | [
"Apache-2.0"
] | 2 | 2020-08-10T12:05:42.000Z | 2021-02-12T19:56:10.000Z | #pragma once
// Name: S, Version: b
#ifdef _MSC_VER
#pragma pack(push, 0x01)
#endif
/*!!HELPER_DEF!!*/
/*!!DEFINE!!*/
namespace UFT
{
//---------------------------------------------------------------------------
// Classes
//---------------------------------------------------------------------------
// WidgetBlueprintGeneratedClass RadialCenterRearmButton.RadialCenterRearmButton_C
// 0x0108 (FullSize[0x0518] - InheritedSize[0x0410])
class URadialCenterRearmButton_C : public USQRadialIconButton
{
public:
struct FPointerToUberGraphFrame UberGraphFrame; // 0x0410(0x0008) (ZeroConstructor, Transient, DuplicateTransient)
class UImage* BG; // 0x0418(0x0008) (BlueprintVisible, ExportObject, ZeroConstructor, InstancedReference, IsPlainOldData, RepSkip, NoDestructor, PersistentInstance, HasGetValueTypeHash)
class UImage* BPIconImage; // 0x0420(0x0008) (BlueprintVisible, ExportObject, ZeroConstructor, InstancedReference, IsPlainOldData, RepSkip, NoDestructor, PersistentInstance, HasGetValueTypeHash)
class UTextBlock* RearmCostTextbox; // 0x0428(0x0008) (BlueprintVisible, ExportObject, ZeroConstructor, InstancedReference, IsPlainOldData, RepSkip, NoDestructor, PersistentInstance, HasGetValueTypeHash)
class UTextBlock* RearmItemsText; // 0x0430(0x0008) (BlueprintVisible, ExportObject, ZeroConstructor, InstancedReference, IsPlainOldData, RepSkip, NoDestructor, PersistentInstance, HasGetValueTypeHash)
class UImage* ResupplyLitBG; // 0x0438(0x0008) (BlueprintVisible, ExportObject, ZeroConstructor, InstancedReference, IsPlainOldData, RepSkip, NoDestructor, PersistentInstance, HasGetValueTypeHash)
struct FText RearmCostText; // 0x0440(0x0018) (Edit, BlueprintVisible, DisableEditOnInstance)
class UBaseRadialMenu_C* OwnerRadialMenu; // 0x0458(0x0008) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash)
class UBP_RadialItemModel_C* RelatedActionModel; // 0x0460(0x0008) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, HasGetValueTypeHash)
class USQPawnInventoryComponent* InventoryComponent; // 0x0468(0x0008) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, InstancedReference, IsPlainOldData, NoDestructor, HasGetValueTypeHash)
float AmmoCostToRearmSelectedWeapons; // 0x0470(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, HasGetValueTypeHash)
unsigned char UnknownData_MVP1[0x4]; // 0x0474(0x0004) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY)
TMap<class ASQEquipableItem*, int> WeaponsToRearm; // 0x0478(0x0050) (Edit, BlueprintVisible, BlueprintReadOnly, ZeroConstructor, DisableEditOnTemplate, DisableEditOnInstance)
struct FScriptMulticastDelegate UpdateAmmoRemaining; // 0x04C8(0x0010) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, BlueprintAssignable, BlueprintCallable)
float AmmoInSourceRemaining; // 0x04D8(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, HasGetValueTypeHash)
unsigned char UnknownData_IAAS[0x4]; // 0x04DC(0x0004) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY)
TScriptInterface<class USQRearmSource> RearmSource; // 0x04E0(0x0010) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor)
bool bCachedCanRearmAll; // 0x04F0(0x0001) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor)
bool IsRearmAllCostCached; // 0x04F1(0x0001) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor)
unsigned char UnknownData_WZ6E[0x6]; // 0x04F2(0x0006) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY)
struct FScriptMulticastDelegate InventoryUpdated; // 0x04F8(0x0010) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, BlueprintAssignable, BlueprintCallable)
float CachedCostToRearmAll; // 0x0508(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, HasGetValueTypeHash)
bool bCachedCanRearmSelected; // 0x050C(0x0001) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor)
unsigned char UnknownData_ZMFF[0x3]; // 0x050D(0x0003) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY)
int PreviousRearmCount; // 0x0510(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, HasGetValueTypeHash)
int MissingRearmItems; // 0x0514(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData, NoDestructor, HasGetValueTypeHash)
static UClass* StaticClass()
{
static auto ptr = UObject::FindClass("WidgetBlueprintGeneratedClass RadialCenterRearmButton.RadialCenterRearmButton_C");
return ptr;
}
struct FEventReply OnMouseButtonDoubleClick(const struct FGeometry& InMyGeometry, const struct FPointerEvent& InMouseEvent);
struct FEventReply OnPreviewMouseButtonDown(const struct FGeometry& MyGeometry, const struct FPointerEvent& MouseEvent);
void CheckIfCanRearm();
void UpdateSourceAmmoRemaining(float AmmoRemaining);
void CreateRearmRequest(TArray<struct FSQRearmWeaponRequest>* RearmRequest);
void UpdateSelectedCost(float MagCost);
bool CalculateTotalRearmCost(float* OutCost);
struct FText GetRearmingItemCountDisplay();
void OnHoverBegin();
void BPInit();
void AddRearmItems(class ASQEquipableItem* EquippableItem, float RearmItemCount);
void RemoveRearmItems(class ASQEquipableItem* WeaponToRemove, float RearmItemCount);
void RearmWeapons();
void OnHoverEnd();
void SetInventoryComponent(class USQPawnInventoryComponent* InventoryComponent);
void InventoryAmmoUpdated();
void InitializeRearmSourceListener();
void UpdateSelfCanClick();
void AmmoUpdated();
void Destruct();
void ExecuteUbergraph_RadialCenterRearmButton(int EntryPoint);
void InventoryUpdated__DelegateSignature();
void UpdateAmmoRemaining__DelegateSignature(float AmmoRemaining);
};
}
#ifdef _MSC_VER
#pragma pack(pop)
#endif
| 87.901099 | 278 | 0.616327 |
1614582c63462b553be05e6818cf993b7c22ef62 | 809 | ts | TypeScript | projects/form-elements/src/exports.ts | pascaliske/form-elements | 846fd1279560db6c822e99bccb8a8b985d2ed004 | [
"MIT"
] | null | null | null | projects/form-elements/src/exports.ts | pascaliske/form-elements | 846fd1279560db6c822e99bccb8a8b985d2ed004 | [
"MIT"
] | 603 | 2018-09-06T22:11:39.000Z | 2022-03-17T08:53:11.000Z | projects/form-elements/src/exports.ts | pascaliske/form-elements | 846fd1279560db6c822e99bccb8a8b985d2ed004 | [
"MIT"
] | null | null | null | /*
* Public API Surface
*/
export { ModuleOptions, MODULE_OPTIONS } from './lib/options'
export { FormElementsModule } from './lib/form-elements.module'
export * from './lib/f-button/f-button.component'
export * from './lib/f-checkbox/f-checkbox.component'
export * from './lib/f-column/f-column.component'
export * from './lib/f-date/f-date.component'
export * from './lib/f-time/f-time.component'
export * from './lib/f-email/f-email.component'
export * from './lib/f-input/f-input.component'
export * from './lib/f-password/f-password.component'
export * from './lib/f-phone/f-phone.component'
export * from './lib/f-radiobutton/f-radiobutton.component'
export * from './lib/f-row/f-row.component'
export * from './lib/f-select/f-select.component'
export * from './lib/f-text-area/f-text-area.component'
| 42.578947 | 63 | 0.719407 |
0a02279a17da6d20607ff22d072e06abe8c9f2a1 | 112 | h | C | cnd/cnd.modelimpl/test/unit/data/org/netbeans/modules/cnd/modelimpl/trace/FileModelIncludeBodyTest/innerbody.h | leginee/netbeans | 814ad30e2d0a094f4aa3813bcbb5323a95a0b1d6 | [
"Apache-2.0"
] | null | null | null | cnd/cnd.modelimpl/test/unit/data/org/netbeans/modules/cnd/modelimpl/trace/FileModelIncludeBodyTest/innerbody.h | leginee/netbeans | 814ad30e2d0a094f4aa3813bcbb5323a95a0b1d6 | [
"Apache-2.0"
] | null | null | null | cnd/cnd.modelimpl/test/unit/data/org/netbeans/modules/cnd/modelimpl/trace/FileModelIncludeBodyTest/innerbody.h | leginee/netbeans | 814ad30e2d0a094f4aa3813bcbb5323a95a0b1d6 | [
"Apache-2.0"
] | null | null | null |
#include "deepbody.h" // doesn't work yet
int fieldIncluder;
void foooIncluder() {
#include "methodbody.h"
}
| 12.444444 | 41 | 0.705357 |
c6d98c6df8115b9cd1b655442dda603310c3f142 | 3,417 | rb | Ruby | scripts/update-schools.rb | DFE-Digital/improving-internet-access-prototype | fbe1420479a09e60306b22ddc26f9a5d14101fdc | [
"MIT"
] | 3 | 2021-04-07T09:33:43.000Z | 2021-04-21T15:44:59.000Z | scripts/update-schools.rb | DFE-Digital/improving-internet-access-prototype | fbe1420479a09e60306b22ddc26f9a5d14101fdc | [
"MIT"
] | 2 | 2020-12-03T15:59:08.000Z | 2020-12-03T15:59:43.000Z | scripts/update-schools.rb | DFE-Digital/improving-internet-access-prototype | fbe1420479a09e60306b22ddc26f9a5d14101fdc | [
"MIT"
] | 2 | 2021-04-10T21:44:45.000Z | 2021-05-15T19:15:15.000Z | #!/usr/bin/env ruby
# Run './scripts/update-schools.rb'
require 'csv'
require 'JSON'
class UpdateSchoolsList
def run
responsible_body = 'ACADEMIES ENTERPRISE TRUST'
is_trust = true
trust_column_header = 'Column1'
rows = CSV.read(csv_file_location, { headers: true })
grouped_by_responsible_body = rows.group_by { |r| is_trust ? r[trust_column_header] : r['LA'] }
# puts grouped_by_responsible_body.sort_by { |r| r[1].length }.map { |r| "#{r[0]}, #{r[1].length}" }
rb_schools = grouped_by_responsible_body[responsible_body]
schools = rb_schools.sort_by { |r| r['Name'] }.map do |r|
total = Integer(r['Total '])
lower = total < 40 ? 0 : total - 40
upper = total < 40 ? total + 20 : total + 40
{
URN: Integer(r['URN']),
name: r['Name'].gsub("'", "’"),
rb: is_trust ? r[trust_column_header] : r['LA'],
total: total == 0 ? 0 : rand(Range.new(lower, upper))
}
end
puts "Schools: #{schools.count}"
puts "Enriching..."
enrich_schools_data(schools)
if is_trust
puts "Trust schools: #{schools.count}"
update_schools_file(schools)
else
only_la_schools = schools.keep_if do |s|
['Local authority maintained schools', 'Special schools'].include? s[:type]
end
puts "LA schools: #{only_la_schools.count}"
update_schools_file(only_la_schools)
end
end
private
def enrich_schools_data(schools)
urns = schools.map {|s| s[:URN] }
data_rows = CSV.read(schools_data_csv_file_location, { headers: true, converters: :numeric, encoding: 'windows-1251:utf-8' })
schools.each do |school|
row = data_rows.find { |s| s['URN'] == school[:URN] }
school[:phase] = row['PhaseOfEducation (name)']
school[:type] = row['EstablishmentTypeGroup (name)']
school[:headteacher] = "#{row['HeadFirstName']} #{row['HeadLastName']}"
school[:headteacher_email] = "#{row['HeadFirstName']}.#{row['HeadLastName']}@school.gov.uk".downcase
school[:fsm_percentage] = row['PercentageFSM']
school[:street] = row['Street']
school[:locality] = row['Locality']
school[:address3] = row['Address3']
school[:town] = row['Town']
school[:county] = row['County']
school[:postcode] = row['Postcode']
school[:address] = [row['Street'], row['Address3'], row['Town'], row['County'], row['Postcode']].compact.reject {|r| r.empty? }.join(', ')
end
end
def schools_data_csv_file_location
"scripts/edubasealldata.csv"
end
def csv_file_location
"scripts/wave2allocations.csv"
end
def local_authority_schools_file
"app/data/responsible-body-schools.js"
end
def update_schools_file(schools)
json = schools_as_json(schools)
file_contents = json_as_js_object(json)
File.open(local_authority_schools_file, 'wb') do |f|
f.write("module.exports = #{file_contents}\n")
end
end
def schools_as_json(schools)
JSON.pretty_generate(schools)
end
def json_as_js_object(json)
json
.gsub('"URN"', 'URN')
.gsub('"name"', 'name')
.gsub('"rb"', 'rb')
.gsub('"total"', 'total')
.gsub('"phase"', 'phase')
.gsub('"type"', 'type')
.gsub('"headteacher"', 'headteacher')
.gsub('"headteacher_email"', 'headteacher_email')
.gsub('"fsm_percentage"', 'fsm_percentage')
end
end
u = UpdateSchoolsList.new
u.run
| 30.238938 | 144 | 0.631548 |
7b4cc2b7411fa208e3318a3435df3e88601ea8a3 | 364 | ps1 | PowerShell | tools/files/win32/chocolateyBeforeModify.ps1 | jalenplayvs/logdna-agent | e216d6fd123b18abc7dfdc159d79bbc3d94581e5 | [
"MIT"
] | 164 | 2016-03-30T01:18:53.000Z | 2022-03-29T17:48:05.000Z | tools/files/win32/chocolateyBeforeModify.ps1 | Montana/logdna-travis | 249bcc18eeb9ee04eb4aff130b08e1453a1c72a5 | [
"MIT"
] | 146 | 2016-03-30T00:17:12.000Z | 2022-03-29T14:58:41.000Z | tools/files/win32/chocolateyBeforeModify.ps1 | Montana/logdna-travis | 249bcc18eeb9ee04eb4aff130b08e1453a1c72a5 | [
"MIT"
] | 85 | 2016-03-29T23:52:47.000Z | 2022-01-31T04:27:04.000Z | $packageParameters = $env:chocolateyPackageParameters
IF(!($packageParameters))
{
cmd.exe /c "nssm.exe stop logdna-agent & exit /b 0"
cmd.exe /c "nssm.exe remove logdna-agent confirm & exit /b 0"
}
$registryPath = "HKLM:\SYSTEM\CurrentControlSet\Services\logdna-agent"
IF(Test-Path $registryPath)
{
Remove-Item -Path $registryPath -Force -Recurse
}
| 24.266667 | 70 | 0.722527 |
74a22767ec0e17b86fb544ef4c1cad831d5acf1f | 2,918 | kt | Kotlin | src/test/kotlin/com/github/z3d1k/maven/plugin/ktlint/rules/RuleSetsTest.kt | Goooler/ktlint-maven-plugin | cdbf673e2b5519b936e94cb445f707cc77776e49 | [
"MIT"
] | null | null | null | src/test/kotlin/com/github/z3d1k/maven/plugin/ktlint/rules/RuleSetsTest.kt | Goooler/ktlint-maven-plugin | cdbf673e2b5519b936e94cb445f707cc77776e49 | [
"MIT"
] | null | null | null | src/test/kotlin/com/github/z3d1k/maven/plugin/ktlint/rules/RuleSetsTest.kt | Goooler/ktlint-maven-plugin | cdbf673e2b5519b936e94cb445f707cc77776e49 | [
"MIT"
] | null | null | null | package com.github.z3d1k.maven.plugin.ktlint.rules
import com.pinterest.ktlint.core.Rule
import com.pinterest.ktlint.core.RuleSet
import com.pinterest.ktlint.core.RuleSetProvider
import com.pinterest.ktlint.ruleset.experimental.ExperimentalRuleSetProvider
import com.pinterest.ktlint.ruleset.standard.StandardRuleSetProvider
import org.apache.commons.lang3.RandomStringUtils
import org.jetbrains.kotlin.com.intellij.lang.ASTNode
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
import kotlin.test.assertEquals
import kotlin.test.assertTrue
@RunWith(JUnit4::class)
class RuleSetsTest {
@Test
fun `experimental ruleSet should be ignored if experimental rules are disabled`() {
val ruleSetProviders = getRandomRuleSetProviders(10) + standardRuleSetProvider + experimentalRuleSetProvider
val resolvedRuleSets = resolveRuleSets(enableExperimentalRules = false, providers = ruleSetProviders)
assertTrue(resolvedRuleSets.none { ruleSet -> ruleSet.id == experimentalRuleSetProvider.get().id })
assertEquals(ruleSetProviders.size - 1, resolvedRuleSets.size)
}
@Test
fun `experimental ruleSet should be included if experimental rules are enabled`() {
val ruleSetProviders = getRandomRuleSetProviders(10) + standardRuleSetProvider + experimentalRuleSetProvider
val resolvedRuleSets = resolveRuleSets(enableExperimentalRules = true, providers = ruleSetProviders)
assertTrue(resolvedRuleSets.any { ruleSet -> ruleSet.id == experimentalRuleSetProvider.get().id })
assertEquals(ruleSetProviders.size, resolvedRuleSets.size)
}
@Test
fun `standard ruleSet should be first`() {
val ruleSetProviders = getRandomRuleSetProviders() + standardRuleSetProvider + experimentalRuleSetProvider
val resolvedRuleSets = resolveRuleSets(providers = ruleSetProviders)
assertEquals(resolvedRuleSets.first().id, standardRuleSetProvider.get().id)
}
companion object {
const val lowercaseAlphabet = "abcdefghijklmnopqrstuvwxyz"
val standardRuleSetProvider = StandardRuleSetProvider()
val experimentalRuleSetProvider = ExperimentalRuleSetProvider()
private fun getEmptyRuleSetProvider(): RuleSetProvider = object : RuleSetProvider {
override fun get(): RuleSet = RuleSet(RandomStringUtils.random(15, lowercaseAlphabet), NoOpRule())
}
private fun getRandomRuleSetProviders(count: Int = 10): List<RuleSetProvider> = List(count) {
getEmptyRuleSetProvider()
}
internal class NoOpRule(id: String = RandomStringUtils.random(15, lowercaseAlphabet)) : Rule(id) {
override fun visit(
node: ASTNode,
autoCorrect: Boolean,
emit: (offset: Int, errorMessage: String, canBeAutoCorrected: Boolean) -> Unit
) = Unit
}
}
}
| 43.552239 | 116 | 0.73852 |
fab4a6c24e4da1f5e8a54221a9533026204c6878 | 7,420 | lua | Lua | lib_tcp.lua | stuta/Luajit-Tcp-Server | d89228c170debca554c3bc71b200b1e62ccdeb9e | [
"BSD-3-Clause"
] | 24 | 2015-01-15T16:28:33.000Z | 2020-07-16T03:38:37.000Z | lib_tcp.lua | stuta/Luajit-Tcp-Server | d89228c170debca554c3bc71b200b1e62ccdeb9e | [
"BSD-3-Clause"
] | null | null | null | lib_tcp.lua | stuta/Luajit-Tcp-Server | d89228c170debca554c3bc71b200b1e62ccdeb9e | [
"BSD-3-Clause"
] | 9 | 2017-03-08T18:22:42.000Z | 2022-01-18T15:16:56.000Z | -- lib_tcp.lua
module(..., package.seeall)
local ffi = require("ffi")
local C = ffi.C
local util = require "lib_util"
local socket = require "lib_socket"
-- INVALID_SOCKET here, in lib_socket.lua or in C?
local INVALID_SOCKET, SOCKET_ERROR
if util.isWin then
INVALID_SOCKET = ffi.new("SOCKET", -1)
else
INVALID_SOCKET = -1
end
SOCKET_ERROR = -1 -- 0xffffffff
local sendBufSize, receiveBufSize = 65536, 65536
local tcpNoDelay = 1
local err = socket.initialize()
if err ~= 0 then
socket.cleanup(nil, err, "ERROR in socket.initialize(): ")
end
--[[
-- FIX: with this code: http://beej.us/guide/bgnet/output/html/multipage/syscalls.html#bind
local addr = ffi.new("struct sockaddr_in")
addr.sin_family = C.AF_INET
addr.sin_addr.s_addr = C.INADDR_ANY -- does not work in win without changing in_addr.S_addr to in_addr.s_addr
addr.sin_port = socket.htons(port)
-- C.inet_aton("127.0.0.1", addr.sin_addr) -- test this
]]
function listen(port)
-- http://beej.us/guide/bgnet/output/html/multipage/syscalls.html#bind
local res = ffi.new("struct addrinfo*[1]")
local hints = ffi.new("struct addrinfo")
hints.ai_family = C.AF_INET -- DOES NOT work in windows: AF_UNSPEC, AF_UNSPEC == use IPv4 or IPv6, whichever
hints.ai_socktype = C.SOCK_STREAM
hints.ai_protocol = C.IPPROTO_TCP
hints.ai_flags = bit.bor(C.AI_PASSIVE) -- fill in my IP for me
local host = nil -- binding, can be nil
local serv = tostring(port)
local err = socket.getaddrinfo(host, serv, hints, res)
if err ~= 0 then
print(" -- sock.getaddrinfo error: '"..socket.errortext(err).."'")
os.exit()
end
-- Create a SOCKET for connecting to server
local listen_socket = socket.socket(res[0].ai_family, res[0].ai_socktype, res[0].ai_protocol)
--[[if res[0].ai_family ~= C.AF_INET or res[0].ai_socktype ~= C.SOCK_STREAM or res[0].ai_protocol~= C.IPPROTO_TCP then
-- socket.socket(C.AF_INET, C.SOCK_STREAM, C.IPPROTO_TCP)
socket.cleanup(nil, listen_socket, "socket.socket types are incorrect: ")
return -1
end]]
if listen_socket == INVALID_SOCKET then
socket.cleanup(nil, listen_socket, "socket.socket failed with error: ")
os.exit()
return -1
end
-- Setup the TCP listening socket
local result
-- SO_REUSEADDR, set reuse address for listen socket before bind
result = socket.setsockopt(listen_socket, C.SOL_SOCKET, C.SO_REUSEADDR, 1)
if result ~= 0 then
socket.cleanup(listen_socket, result, "socket.setsockopt SO_REUSEADDR failed with error: ")
end
-- set to non-blocking mode
local result
result = socket.set_nonblock(listen_socket, 1)
if result ~= 0 then
socket.cleanup(listen_socket, result, "socket.set_nonblock (set to non-blocking mode) failed with error: ")
end
-- SO_USELOOPBACK, use always loopback when possible
if not util.isLinux then -- SO_USELOOPBACK is not supported by Linux
result = socket.setsockopt(listen_socket, C.SOL_SOCKET, C.SO_USELOOPBACK, 1)
if result ~= 0 then
socket.cleanup(listen_socket, result, "socket.setsockopt SO_USELOOPBACK failed with error: ")
end
end
-- SO_SNDBUF, send buffer size
result = socket.setsockopt(listen_socket, C.SOL_SOCKET, C.SO_SNDBUF, sendBufSize)
if result ~= 0 then
socket.cleanup(listen_socket, result, "socket.setsockopt SO_SNDBUF failed with error: ")
end
-- SO_RCVBUF, reveive buffer size
result = socket.setsockopt(listen_socket, C.SOL_SOCKET, C.SO_RCVBUF, receiveBufSize)
if result ~= 0 then
socket.cleanup(listen_socket, result, "socket.setsockopt SO_RCVBUF failed with error: ")
end
-- TCP_NODELAY, tcp-nodelay to 1
print("tcpNoDelay: "..tcpNoDelay)
if not util.isLinux then
result = socket.setsockopt(listen_socket, C.SOL_SOCKET, C.TCP_NODELAY, tcpNoDelay)
if result ~= 0 then
socket.cleanup(listen_socket, result, "socket.setsockopt TCP_NODELAY failed with error: ")
end
end
-- bind
result = socket.bind(listen_socket, res[0].ai_addr, res[0].ai_addrlen)
if result ~= 0 then
socket.cleanup(listen_socket, result, "socket.bind failed with error: ")
end
-- listen
result = socket.listen(listen_socket, C.SOMAXCONN)
if result ~= 0 then
socket.cleanup(listen_socket, result, "socket.listen failed with error: ")
end
return listen_socket
end
function accept(listen_socket)
-- Accept a client socket
client_addr = ffi.new("struct sockaddr_in[1]") -- "struct sockaddr_in[1]"
client_addr_ptr = ffi.cast("struct sockaddr *", client_addr)
local client_addr_size = ffi.new("int[1]")
client_addr_size[0] = ffi.sizeof("struct sockaddr")
local client_socket = socket.accept(listen_socket, client_addr_ptr, client_addr_size)
if client_socket < 0 then
return client_socket -- poll error, ok
--socket.cleanup(listen_socket, client_socket, "socket.accept failed with error: ")
end
--[[
-- SO_SNDBUF, send buffer size
result = socket.setsockopt(client_socket, C.SOL_SOCKET, C.SO_SNDBUF, sendBufSize)
if result ~= 0 then
socket.cleanup(client_socket, result, "socket.setsockopt SO_SNDBUF failed with error: ")
end
-- SO_RCVBUF, reveive buffer size
result = socket.setsockopt(client_socket, C.SOL_SOCKET, C.SO_RCVBUF, receiveBufSize)
if result ~= 0 then
socket.cleanup(client_socket, result, "socket.setsockopt SO_RCVBUF failed with error: ")
end
-- TCP_NODELAY, tcp-nodelay to 1
result = socket.setsockopt(client_socket, C.SOL_SOCKET, C.TCP_NODELAY, tcpNoDelay)
if result ~= 0 then
socket.cleanup(client_socket, result, "socket.setsockopt TCP_NODELAY failed with error: ")
end
]]
return client_socket --,client_addr_ptr
end
function address(sock)
local addr = ffi.new("struct sockaddr_storage")
local len = ffi.new("unsigned int[1]")
len[0] = ffi.sizeof(addr) --ffi.sizeof("struct sockaddr")
socket.getpeername(sock, ffi.cast("struct sockaddr *", addr), len)
-- deal with both IPv4 and IPv6:
local ipstr, port
if addr.ss_family == C.AF_INET then
ipstr = ffi.new("char[?]", C.INET_ADDRSTRLEN)
local s = ffi.cast("struct sockaddr_in *", addr)
port = socket.ntohs(s.sin_port)
socket.inet_ntop(C.AF_INET, s.sin_addr, ipstr)
else -- C.AF_INET6
ipstr = ffi.new("char[?]", C.INET6_ADDRSTRLEN)
local s = ffi.cast("struct sockaddr_in6 *", addr)
port = socket.ntohs(s.sin6_port)
socket.inet_ntop(C.AF_INET6, s.sin6_addr, ipstr)
end
return ffi.string(ipstr)..":"..port --ffi.string(port)
--[[
-- http://stackoverflow.com/questions/4282292/convert-struct-in-addr-to-text
-- http://www.freelists.org/post/luajit/FFI-pointers-to-pointers,1
-- https://gist.github.com/neomantra/2644943
local hostname = createBuffer(C.NI_MAXHOST)
local servInfo = createBuffer(C.NI_MAXSERV)
local result = socket.getnameinfo(client_addr_ptr, ffi.sizeof("struct sockaddr_in"), hostname, C.NI_MAXHOST, servInfo, C.NI_MAXSERV, 0)
if result ~= 0 then
socket.cleanup(socket, result, "socket.getnameinfo failed with error: ")
end
--print("client ip:port : "..ffi.string(hostname)..":"..ffi.string(servInfo)) -- servInfo is post number
return ffi.string(hostname)..":"..ffi.string(servInfo)
]]
end
local conn_wait_polltype = 0
local conn_wait_fd = {}
local conn_wait_event = {}
local conn_wait_revent = {}
function close(sock)
socket.close(sock) -- not needed anymore
end
function conn_wait_options_set(opts)
conn_wait = 0 -- 0=select, 1=poll, 2=kqueue/iocp/epoll
end
function conn_wait_options_set(opts)
wait_polltype = 0 -- 0=select, 1=poll, 2=kqueue/iocp/epoll
end
function conn_wait()
--socket.poll(wait_opt.) -- not needed anymore
end
| 34.835681 | 136 | 0.737332 |
5406a130f52c2b9287da58c09d05a6b5f0c6de08 | 712 | go | Go | ecc/utils.go | Mikerah/gnark | cab1e5cfb5271450e61108dbccb1916d16ab5144 | [
"Apache-2.0"
] | null | null | null | ecc/utils.go | Mikerah/gnark | cab1e5cfb5271450e61108dbccb1916d16ab5144 | [
"Apache-2.0"
] | null | null | null | ecc/utils.go | Mikerah/gnark | cab1e5cfb5271450e61108dbccb1916d16ab5144 | [
"Apache-2.0"
] | 1 | 2021-09-05T23:49:20.000Z | 2021-09-05T23:49:20.000Z | package ecc
import (
"math/big"
)
var (
zero, one, two, three big.Int
)
func init() {
one.SetUint64(1)
two.SetUint64(2)
three.SetUint64(3)
}
// NafDecomposition gets the naf decomposition of a big number
func NafDecomposition(a *big.Int, result []int8) int {
length := 0
// some buffers
var buf, aCopy big.Int
aCopy.Set(a)
for aCopy.Cmp(&zero) != 0 {
// if aCopy % 2 == 0
buf.And(&aCopy, &one)
// aCopy even
if buf.Cmp(&zero) == 0 {
result[length] = 0
} else { // aCopy odd
buf.And(&aCopy, &three)
if buf.Cmp(&three) == 0 {
result[length] = -1
aCopy.Add(&aCopy, &one)
} else {
result[length] = 1
}
}
aCopy.Rsh(&aCopy, 1)
length++
}
return length
}
| 14.833333 | 62 | 0.59691 |
06433d74c9a296fba1b4f6dded8dca82784bc5e1 | 376 | asm | Assembly | libsrc/fcntl/spectrum/zxbasdrv/rnd_erase.asm | grancier/z180 | e83f35e36c9b4d1457e40585019430e901c86ed9 | [
"ClArtistic"
] | null | null | null | libsrc/fcntl/spectrum/zxbasdrv/rnd_erase.asm | grancier/z180 | e83f35e36c9b4d1457e40585019430e901c86ed9 | [
"ClArtistic"
] | null | null | null | libsrc/fcntl/spectrum/zxbasdrv/rnd_erase.asm | grancier/z180 | e83f35e36c9b4d1457e40585019430e901c86ed9 | [
"ClArtistic"
] | 1 | 2019-12-03T23:57:48.000Z | 2019-12-03T23:57:48.000Z | ;
; Delete a file by the BASIC driver
;
; Stefano - 5/7/2006
;
; int remove(char *name)
;
; $Id: rnd_erase.asm,v 1.3 2016/06/23 20:40:25 dom Exp $
SECTION code_clib
PUBLIC rnd_erase
PUBLIC _rnd_erase
EXTERN zx_goto
EXTERN zxgetfname2
.rnd_erase
._rnd_erase
pop bc
pop hl
push hl
push bc
call zxgetfname2
ld hl,7900 ; BASIC routine for "erase"
jp zx_goto
| 12.965517 | 56 | 0.702128 |
81e3f78eae76b4e5469059c7240f88c83e9c9157 | 2,601 | go | Go | observe/observer.go | zenledger-io/go-utils | 33b2c67b4703440786ad26417c1ab66adc2f1de8 | [
"MIT"
] | null | null | null | observe/observer.go | zenledger-io/go-utils | 33b2c67b4703440786ad26417c1ab66adc2f1de8 | [
"MIT"
] | null | null | null | observe/observer.go | zenledger-io/go-utils | 33b2c67b4703440786ad26417c1ab66adc2f1de8 | [
"MIT"
] | null | null | null | package observe
import (
"context"
"fmt"
"github.com/honeybadger-io/honeybadger-go"
"go.uber.org/zap"
"gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer"
)
type ctxKey int
const observerCtxKey ctxKey = 0
// Field is metadata for an observable event.
type Field struct {
Name string
Value any
}
// Observer is a type that is used to make
// a service observable.
type Observer interface {
Debug(ctx context.Context, message string, fields ...Field)
Error(ctx context.Context, message string, err error, fields ...Field)
Panic(ctx context.Context, message string, stack []byte, fields ...Field)
}
// NewContext returns a new Context that carries a value obs.
func NewContext(ctx context.Context, obs Observer) context.Context {
return context.WithValue(ctx, observerCtxKey, obs)
}
// FromContext returns the Observer value stored in ctx, if any.
// If a value is not found, a nop Observer is returned.
func FromContext(ctx context.Context) Observer {
if obs, ok := ctx.Value(observerCtxKey).(Observer); ok {
return obs
}
return NewNop()
}
// New creates a new observer.
func New(lgr *zap.Logger, hc *honeybadger.Client) Observer {
return &observer{
lgr: lgr,
hc: hc,
}
}
type observer struct {
lgr *zap.Logger
hc *honeybadger.Client
}
func (o *observer) Debug(ctx context.Context, message string, fields ...Field) {
o.lgr.Debug(message, zapFields(fields)...)
}
func (o *observer) Error(ctx context.Context, message string, err error, fields ...Field) {
zfs := append(zapFields(fields), zap.Error(err))
o.lgr.Error(message, zfs...)
honeybadger.Notify(err, message)
if span, ok := tracer.SpanFromContext(ctx); ok {
span.Finish(tracer.WithError(err))
}
}
func (o *observer) Panic(ctx context.Context, message string, stack []byte, fields ...Field) {
zfs := append(zapFields(fields), zap.String("stack", string(stack)))
o.lgr.Panic(message, zfs...)
honeybadger.Notify(message, string(stack))
if span, ok := tracer.SpanFromContext(ctx); ok {
span.Finish(tracer.WithError(
fmt.Errorf("panic: %s\n%s", message, string(stack))))
}
}
func zapFields(fields []Field) []zap.Field {
zf := make([]zap.Field, 0, len(fields))
for _, f := range fields {
zf = append(zf, zap.Any(f.Name, f.Value))
}
return zf
}
// NewNop returns an observer that does nothing.
func NewNop() Observer {
return &nopObserver{}
}
type nopObserver struct{}
func (*nopObserver) Debug(context.Context, string, ...Field) {}
func (*nopObserver) Error(context.Context, string, error, ...Field) {}
func (*nopObserver) Panic(context.Context, string, []byte, ...Field) {}
| 25.5 | 94 | 0.705113 |
f52d18738cf56f20862b7f7ce95bf0259f9663b2 | 16,941 | cpp | C++ | src/kripke.cpp | sma31/Kripke | d85c6bc462f17a2382b11ba363059febc487f771 | [
"BSD-3-Clause-Clear",
"BSD-3-Clause"
] | null | null | null | src/kripke.cpp | sma31/Kripke | d85c6bc462f17a2382b11ba363059febc487f771 | [
"BSD-3-Clause-Clear",
"BSD-3-Clause"
] | null | null | null | src/kripke.cpp | sma31/Kripke | d85c6bc462f17a2382b11ba363059febc487f771 | [
"BSD-3-Clause-Clear",
"BSD-3-Clause"
] | null | null | null | //
// Copyright (c) 2014-19, Lawrence Livermore National Security, LLC
// and Kripke project contributors. See the COPYRIGHT file for details.
//
// SPDX-License-Identifier: (BSD-3-Clause)
//
#include <Kripke.h>
#include <Kripke/Core/Comm.h>
#include <Kripke/Core/DataStore.h>
#include <Kripke/Core/Set.h>
#include <Kripke/ArchLayout.h>
#include <Kripke/Generate.h>
#include <Kripke/InputVariables.h>
#include <Kripke/SteadyStateSolver.h>
#include <Kripke/Timing.h>
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <string>
#include <sstream>
#ifdef KRIPKE_USE_OPENMP
#include <omp.h>
#endif
#ifdef KRIPKE_USE_CALIPER
#include <caliper/cali.h>
#endif
#ifdef __bgq__
#include </bgsys/drivers/ppcfloor/spi/include/kernel/location.h>
#endif
void usage(void){
Kripke::Core::Comm comm;
if(comm.rank() == 0){
// Get a new object with defaulted values
InputVariables def;
// Display command line
printf("Usage: [srun ...] kripke [options...]\n\n");
// Display each option
printf("Problem Size Options:\n");
printf("---------------------\n");
printf(" --groups <ngroups> Number of energy groups\n");
printf(" Default: --groups %d\n\n", def.num_groups);
printf(" --legendre <lorder> Scattering Legendre Expansion Order (0, 1, ...)\n");
printf(" Default: --legendre %d\n\n", def.legendre_order);
printf(" --quad [<ndirs>|<polar>:<azim>]\n");
printf(" Define the quadrature set to use\n");
printf(" Either a fake S2 with <ndirs> points,\n");
printf(" OR Gauss-Legendre with <polar> by <azim> points\n");
printf(" Default: --quad %d\n\n", def.num_directions);
printf(" --zones <x,y,z> Number of zones in x,y,z\n");
printf(" Default: --zones %d,%d,%d\n\n", def.nx, def.ny, def.nz);
printf("\n");
printf("Physics Parameters:\n");
printf("-------------------\n");
printf(" --sigt <st0,st1,st2> Total material cross-sections\n");
printf(" Default: --sigt %lf,%lf,%lf\n\n", def.sigt[0], def.sigt[1], def.sigt[2]);
printf(" --sigs <ss0,ss1,ss2> Scattering material cross-sections\n");
printf(" Default: --sigs %lf,%lf,%lf\n\n", def.sigs[0], def.sigs[1], def.sigs[2]);
printf("\n");
printf("On-Node Options:\n");
printf("----------------\n");
printf(" --arch <ARCH> Architecture selection\n");
printf(" Available: Sequential, OpenMP, CUDA\n");
printf(" Default: --arch %s\n\n", archToString(def.al_v.arch_v).c_str());
printf(" --layout <LAYOUT> Data layout and loop nesting order\n");
printf(" Available: DGZ,DZG,GDZ,GZD,ZDG,ZGD\n");
printf(" Default: --layout %s\n\n", layoutToString(def.al_v.layout_v).c_str());
printf("\n");
printf("Parallel Decomposition Options:\n");
printf("-------------------------------\n");
printf(" --procs <npx,npy,npz> Number of MPI ranks in each spatial dimension\n");
printf(" Default: --procs %d,%d,%d\n\n", def.npx, def.npy, def.npz);
printf(" --dset <ds> Number of direction-sets\n");
printf(" Must be a factor of 8, and divide evenly the number\n");
printf(" of quadrature points\n");
printf(" Default: --dset %d\n\n", def.num_dirsets);
printf(" --gset <gs> Number of energy group-sets\n");
printf(" Must divide evenly the number energy groups\n");
printf(" Default: --gset %d\n\n", def.num_groupsets);
printf(" --zset <zx>,<zy>,<zz> Number of zone-sets in x,y, and z\n");
printf(" Default: --zset %d,%d,%d\n\n", def.num_zonesets_dim[0], def.num_zonesets_dim[1], def.num_zonesets_dim[2]);
printf("\n");
printf("Solver Options:\n");
printf("---------------\n");
printf(" --niter <NITER> Number of solver iterations to run\n");
printf(" Default: --niter %d\n\n", def.niter);
printf(" --pmethod <method> Parallel solver method\n");
printf(" sweep: Full up-wind sweep (wavefront algorithm)\n");
printf(" bj: Block Jacobi\n");
printf(" Default: --pmethod sweep\n\n");
printf("\n");
}
Kripke::Core::Comm::finalize();
exit(1);
}
struct CmdLine {
CmdLine(int argc, char **argv) :
size(argc-1),
cur(0),
args()
{
for(int i = 0;i < size;++ i){
args.push_back(argv[i+1]);
}
}
std::string pop(void){
if(atEnd())
usage();
return args[cur++];
}
bool atEnd(void){
return(cur >= size);
}
int size;
int cur;
std::vector<std::string> args;
};
std::vector<std::string> split(std::string const &str, char delim){
std::vector<std::string> elem;
std::stringstream ss(str);
std::string e;
while(std::getline(ss, e, delim)){
elem.push_back(e);
}
return elem;
}
namespace {
template<typename T>
std::string toString(T const &val){
std::stringstream ss;
ss << val;
return ss.str();
}
}
int main(int argc, char **argv) {
/*
* Initialize MPI
*/
Kripke::Core::Comm::init(&argc, &argv);
Kripke::Core::Comm comm;
int myid = comm.rank();
int num_tasks = comm.size();
if (myid == 0) {
/* Print out a banner message along with a version number. */
printf("\n");
printf(" _ __ _ _\n");
printf(" | |/ / (_) | |\n");
printf(" | ' / _ __ _ _ __ | | __ ___\n");
printf(" | < | '__|| || '_ \\ | |/ // _ \\ \n");
printf(" | . \\ | | | || |_) || <| __/\n");
printf(" |_|\\_\\|_| |_|| .__/ |_|\\_\\\\___|\n");
printf(" | |\n");
printf(" |_| Version %s\n", KRIPKE_VERSION);
printf("\n");
printf("LLNL-CODE-775068\n");
printf("\n");
printf("Copyright (c) 2014-2019, Lawrence Livermore National Security, LLC\n");
printf("\n");
printf("Kripke is released under the BSD 3-Clause License, please see the\n");
printf("LICENSE file for the full license\n");
printf("\n");
printf("This work was produced under the auspices of the U.S. Department of\n");
printf("Energy by Lawrence Livermore National Laboratory under Contract\n");
printf("DE-AC52-07NA27344.\n");
printf("\n");
printf("Author: Adam J. Kunen <kunen1@llnl.gov>\n");
printf("\n");
// Display information about how we were built
printf("Compilation Options:\n");
printf(" Architecture: %s\n", KRIPKE_ARCH);
printf(" Compiler: %s\n", KRIPKE_CXX_COMPILER);
printf(" Compiler Flags: \"%s\"\n", KRIPKE_CXX_FLAGS);
printf(" Linker Flags: \"%s\"\n", KRIPKE_LINK_FLAGS);
#ifdef KRIPKE_USE_CHAI
printf(" CHAI Enabled: Yes\n");
#else
printf(" CHAI Enabled: No\n");
#endif
#ifdef KRIPKE_USE_CUDA
printf(" CUDA Enabled: Yes\n");
printf(" NVCC: %s\n", KRIPKE_NVCC_COMPILER);
printf(" NVCC Flags: \"%s\"\n", KRIPKE_NVCC_FLAGS);
#else
printf(" CUDA Enabled: No\n");
#endif
#ifdef KRIPKE_USE_MPI
printf(" MPI Enabled: Yes\n");
#else
printf(" MPI Enabled: No\n");
#endif
#ifdef KRIPKE_USE_OPENMP
printf(" OpenMP Enabled: Yes\n");
#else
printf(" OpenMP Enabled: No\n");
#endif
#ifdef KRIPKE_USE_CALIPER
printf(" Caliper Enabled: Yes\n");
#else
printf(" Caliper Enabled: No\n");
#endif
/* Print out some information about how OpenMP threads are being mapped
* to CPU cores.
*/
#ifdef KRIPKE_USE_OPENMP
// Get max number of threads
int max_threads = omp_get_max_threads();
// Allocate an array to store which core each thread is running on
std::vector<int> thread_to_core(max_threads, -1);
// Collect thread->core mapping
#pragma omp parallel
{
int tid = omp_get_thread_num();
#ifdef __bgq__
int core = Kernel_ProcessorCoreID();
#else
int core = sched_getcpu();
#endif
thread_to_core[tid] = core;
}
printf("\nOpenMP Thread->Core mapping for %d threads on rank 0", max_threads);
for(int tid = 0;tid < max_threads;++ tid){
if(!(tid%8)){
printf("\n");
}
printf(" %3d->%3d", tid, thread_to_core[tid]);
}
printf("\n");
#endif
}
/*
* Default input parameters
*/
InputVariables vars;
/*
* Parse command line
*/
CmdLine cmd(argc, argv);
while(!cmd.atEnd()){
std::string opt = cmd.pop();
if(opt == "-h" || opt == "--help"){usage();}
else if(opt == "--name"){vars.run_name = cmd.pop();}
else if(opt == "--dset"){
vars.num_dirsets = std::atoi(cmd.pop().c_str());
}
else if(opt == "--gset"){
vars.num_groupsets = std::atoi(cmd.pop().c_str());
}
else if(opt == "--zset"){
std::vector<std::string> nz = split(cmd.pop(), ',');
if(nz.size() != 3) usage();
vars.num_zonesets_dim[0] = std::atoi(nz[0].c_str());
vars.num_zonesets_dim[1] = std::atoi(nz[1].c_str());
vars.num_zonesets_dim[2] = std::atoi(nz[2].c_str());
}
else if(opt == "--zones"){
std::vector<std::string> nz = split(cmd.pop(), ',');
if(nz.size() != 3) usage();
vars.nx = std::atoi(nz[0].c_str());
vars.ny = std::atoi(nz[1].c_str());
vars.nz = std::atoi(nz[2].c_str());
}
else if(opt == "--procs"){
std::vector<std::string> np = split(cmd.pop(), ',');
if(np.size() != 3) usage();
vars.npx = std::atoi(np[0].c_str());
vars.npy = std::atoi(np[1].c_str());
vars.npz = std::atoi(np[2].c_str());
}
else if(opt == "--pmethod"){
std::string method = cmd.pop();
if(!strcasecmp(method.c_str(), "sweep")){
vars.parallel_method = PMETHOD_SWEEP;
}
else if(!strcasecmp(method.c_str(), "bj")){
vars.parallel_method = PMETHOD_BJ;
}
else{
usage();
}
}
else if(opt == "--groups"){
vars.num_groups = std::atoi(cmd.pop().c_str());
}
else if(opt == "--quad"){
std::vector<std::string> p = split(cmd.pop(), ':');
if(p.size() == 1){
vars.num_directions = std::atoi(p[0].c_str());
vars.quad_num_polar = 0;
vars.quad_num_azimuthal = 0;
}
else if(p.size() == 2){
vars.quad_num_polar = std::atoi(p[0].c_str());
vars.quad_num_azimuthal = std::atoi(p[1].c_str());
vars.num_directions = vars.quad_num_polar * vars.quad_num_azimuthal;
}
else{
usage();
}
}
else if(opt == "--legendre"){
vars.legendre_order = std::atoi(cmd.pop().c_str());
}
else if(opt == "--sigs"){
std::vector<std::string> values = split(cmd.pop(), ',');
if(values.size()!=3)usage();
for(int mat = 0;mat < 3;++ mat){
vars.sigs[mat] = std::atof(values[mat].c_str());
}
}
else if(opt == "--sigt"){
std::vector<std::string> values = split(cmd.pop(), ',');
if(values.size()!=3)usage();
for(int mat = 0;mat < 3;++ mat){
vars.sigt[mat] = std::atof(values[mat].c_str());
}
}
else if(opt == "--niter"){
vars.niter = std::atoi(cmd.pop().c_str());
}
else if(opt == "--arch"){
vars.al_v.arch_v = Kripke::stringToArch(cmd.pop());
}
else if(opt == "--layout"){
vars.al_v.layout_v = Kripke::stringToLayout(cmd.pop());
}
else{
printf("Unknwon options %s\n", opt.c_str());
usage();
}
}
// Check that the input arguments are valid
if(vars.checkValues()){
exit(1);
}
/*
* Display Options
*/
if (myid == 0) {
printf("\nInput Parameters\n");
printf("================\n");
printf("\n");
printf(" Problem Size:\n");
printf(" Zones: %d x %d x %d (%d total)\n", vars.nx, vars.ny, vars.nz, vars.nx*vars.ny*vars.nz);
printf(" Groups: %d\n", vars.num_groups);
printf(" Legendre Order: %d\n", vars.legendre_order);
printf(" Quadrature Set: ");
if(vars.quad_num_polar == 0){
printf("Dummy S2 with %d points\n", vars.num_directions);
}
else {
printf("Gauss-Legendre, %d polar, %d azimuthal (%d points)\n", vars.quad_num_polar, vars.quad_num_azimuthal, vars.num_directions);
}
printf("\n");
printf(" Physical Properties:\n");
printf(" Total X-Sec: sigt=[%lf, %lf, %lf]\n", vars.sigt[0], vars.sigt[1], vars.sigt[2]);
printf(" Scattering X-Sec: sigs=[%lf, %lf, %lf]\n", vars.sigs[0], vars.sigs[1], vars.sigs[2]);
printf("\n");
printf(" Solver Options:\n");
printf(" Number iterations: %d\n", vars.niter);
printf("\n");
printf(" MPI Decomposition Options:\n");
printf(" Total MPI tasks: %d\n", num_tasks);
printf(" Spatial decomp: %d x %d x %d MPI tasks\n", vars.npx, vars.npy, vars.npz);
printf(" Block solve method: ");
if(vars.parallel_method == PMETHOD_SWEEP){
printf("Sweep\n");
}
else if(vars.parallel_method == PMETHOD_BJ){
printf("Block Jacobi\n");
}
printf("\n");
printf(" Per-Task Options:\n");
printf(" DirSets/Directions: %d sets, %d directions/set\n", vars.num_dirsets, vars.num_directions/vars.num_dirsets);
printf(" GroupSet/Groups: %d sets, %d groups/set\n", vars.num_groupsets, vars.num_groups/vars.num_groupsets);
printf(" Zone Sets: %d x %d x %d\n", vars.num_zonesets_dim[0], vars.num_zonesets_dim[1], vars.num_zonesets_dim[2]);
printf(" Architecture: %s\n", archToString(vars.al_v.arch_v).c_str());
printf(" Data Layout: %s\n", layoutToString(vars.al_v.layout_v).c_str());
}
/*
* Set Caliper globals
*/
#ifdef KRIPKE_USE_CALIPER
cali_set_global_int_byname("kripke.nx", vars.nx);
cali_set_global_int_byname("kripke.ny", vars.ny);
cali_set_global_int_byname("kripke.nz", vars.nz);
cali_set_global_int_byname("kripke.groups", vars.num_groups);
cali_set_global_int_byname("kripke.legendre_order", vars.legendre_order);
if (vars.parallel_method == PMETHOD_SWEEP)
cali_set_global_string_byname("kripke.parallel_method", "sweep");
else if (vars.parallel_method == PMETHOD_BJ)
cali_set_global_string_byname("kripke.parallel_method", "block jacobi");
cali_set_global_string_byname("kripke.architecture", archToString(vars.al_v.arch_v).c_str());
cali_set_global_string_byname("kripke.layout", layoutToString(vars.al_v.layout_v).c_str());
#endif
// Allocate problem
Kripke::Core::DataStore data_store;
Kripke::generateProblem(data_store, vars);
// Run the solver
Kripke::SteadyStateSolver(data_store, vars.niter, vars.parallel_method == PMETHOD_BJ);
// Print Timing Info
auto &timing = data_store.getVariable<Kripke::Timing>("timing");
timing.print();
// Compute performance metrics
auto &set_group = data_store.getVariable<Kripke::Core::Set>("Set/Group");
auto &set_dir = data_store.getVariable<Kripke::Core::Set>("Set/Direction");
auto &set_zone = data_store.getVariable<Kripke::Core::Set>("Set/Zone");
size_t num_unknowns = set_group.globalSize()
* set_dir.globalSize()
* set_zone.globalSize();
size_t num_iter = timing.getCount("SweepSolver");
double solve_time = timing.getTotal("Solve");
double iter_time = solve_time / num_iter;
double grind_time = iter_time / num_unknowns;
double throughput = num_unknowns / iter_time;
double sweep_eff = 100.0 * timing.getTotal("SweepSubdomain") / timing.getTotal("SweepSolver");
if(myid == 0){
printf("\n");
printf("Figures of Merit\n");
printf("================\n");
printf("\n");
printf(" Throughput: %e [unknowns/(second/iteration)]\n", throughput);
printf(" Grind time : %e [(seconds/iteration)/unknowns]\n", grind_time);
printf(" Sweep efficiency : %4.5lf [100.0 * SweepSubdomain time / SweepSolver time]\n", sweep_eff);
printf(" Number of unknowns: %lu\n", (unsigned long) num_unknowns);
}
// Cleanup and exit
Kripke::Core::Comm::finalize();
if(myid == 0){
printf("\n");
printf("END\n");
}
return (0);
}
| 32.268571 | 144 | 0.553804 |
5995630175e31f1e8f2d2bb6abe076d5acd3bf7a | 7,620 | cpp | C++ | source/profile/PairCollector.cpp | a7420174/ExpansionHunterDenovo | cbe1306aa8ad7c4b33cdf981d64b3415aa057f91 | [
"Apache-2.0",
"BSD-3-Clause"
] | 50 | 2019-09-20T18:37:38.000Z | 2022-03-10T08:55:42.000Z | source/profile/PairCollector.cpp | mfbennett/ExpansionHunterDenovo | abf1cc78535f572ec49d38a65f6e84f4104fae2a | [
"Apache-2.0",
"BSD-3-Clause"
] | 35 | 2019-09-20T18:38:20.000Z | 2022-03-29T22:50:55.000Z | source/profile/PairCollector.cpp | mfbennett/ExpansionHunterDenovo | abf1cc78535f572ec49d38a65f6e84f4104fae2a | [
"Apache-2.0",
"BSD-3-Clause"
] | 21 | 2019-09-20T20:54:43.000Z | 2022-03-30T13:18:25.000Z | //
// ExpansionHunter Denovo
// Copyright 2016-2019 Illumina, Inc.
// All rights reserved.
//
// Author: Egor Dolzhenko <edolzhenko@illumina.com>,
// Michael Eberle <meberle@illumina.com>
//
// 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.
//
//
#include "PairCollector.hh"
#include <cassert>
#include <cstring>
using std::string;
using std::to_string;
bool ReadCache::isReadCached(const Read& read)
{
const auto it = readTypes_.find(read.name);
return it != readTypes_.end();
}
ReadType ReadCache::typeOfRead(const Read& read)
{
const auto it = readTypes_.find(read.name);
if (it == readTypes_.end())
{
throw std::logic_error("Error: " + read.name + " is not cached");
}
const ReadType read_type = it->second;
return read_type;
}
void ReadCache::eraseRead(const Read& read)
{
const ReadType read_type = typeOfRead(read);
const auto it = readTypes_.find(read.name);
readTypes_.erase(it);
if (read_type == ReadType::kIrrRead || read_type == ReadType::kAnchorRead)
{
irrAndAnchorLocations_.erase(read.name);
}
if (read_type == ReadType::kIrrRead)
{
irrUnits_.erase(read.name);
}
}
RegionWithCount ReadCache::extractRegionOfIrrOrAnchor(const Read& read) { return irrAndAnchorLocations_.at(read.name); }
string ReadCache::extractUnitOfIrr(const Read& read) { return irrUnits_.at(read.name); }
void ReadCache::cacheAnchorRead(const Read& read)
{
readTypes_[read.name] = ReadType::kAnchorRead;
RegionWithCount read_region = createCountableRegion(read.contigId, read.pos, read.pos + 1);
irrAndAnchorLocations_.emplace(std::make_pair(read.name, read_region));
}
void ReadCache::cacheInrepeatRead(const Read& read, const string& unit)
{
readTypes_[read.name] = ReadType::kIrrRead;
RegionWithCount read_region = createCountableRegion(read.contigId, read.pos, read.pos + 1);
irrAndAnchorLocations_.emplace(std::make_pair(read.name, read_region));
assert(!unit.empty());
irrUnits_[read.name] = unit;
}
void ReadCache::cacheOtherRead(const Read& read) { readTypes_[read.name] = ReadType::kOtherRead; }
string ReadCache::printStats()
{
const string stats = "Cache stats: # reads = " + to_string(readTypes_.size()) + "; # irr and anchor regions = "
+ to_string(irrAndAnchorLocations_.size()) + "; # repeat units = " + to_string(irrUnits_.size());
return stats;
}
void PairCollector::addAnchor(const Read& read)
{
if (unparedCache_.isReadCached(read))
{
const ReadType mate_type = unparedCache_.typeOfRead(read);
if (mate_type == ReadType::kIrrRead)
{
RegionWithCount irr_region = unparedCache_.extractRegionOfIrrOrAnchor(read);
const string irr_unit = unparedCache_.extractUnitOfIrr(read);
RegionWithCount anchor_region = createCountableRegion(read.contigId, read.pos, read.pos + 1);
anchorRegions_[irr_unit].push_back(anchor_region);
irrRegions_[irr_unit].push_back(irr_region);
logAnchoredIrr(read.name, irr_unit, irr_region, anchor_region);
}
unparedCache_.eraseRead(read);
}
else
{
unparedCache_.cacheAnchorRead(read);
}
}
void PairCollector::addIrr(const Read& read, const std::string& unit)
{
if (unparedCache_.isReadCached(read))
{
const ReadType mate_type = unparedCache_.typeOfRead(read);
if (mate_type == ReadType::kIrrRead)
{
RegionWithCount mate_region = unparedCache_.extractRegionOfIrrOrAnchor(read);
const string mate_unit = unparedCache_.extractUnitOfIrr(read);
RegionWithCount read_region = createCountableRegion(read.contigId, read.pos, read.pos + 1);
logIrrPair(read.name, read_region, unit, mate_region, mate_unit);
if (unit == mate_unit)
{
irrRegions_[unit].push_back(read_region);
irrRegions_[unit].push_back(mate_region);
}
}
else if (mate_type == ReadType::kAnchorRead)
{
RegionWithCount irr_region = createCountableRegion(read.contigId, read.pos, read.pos + 1);
irrRegions_[unit].push_back(irr_region);
RegionWithCount mate_region = unparedCache_.extractRegionOfIrrOrAnchor(read);
anchorRegions_[unit].push_back(mate_region);
logAnchoredIrr(read.name, unit, irr_region, mate_region);
}
unparedCache_.eraseRead(read);
}
else
{
unparedCache_.cacheInrepeatRead(read, unit);
}
}
void PairCollector::addOtherRead(const Read& read)
{
if (unparedCache_.isReadCached(read))
{
unparedCache_.eraseRead(read);
}
else
{
unparedCache_.cacheOtherRead(read);
}
}
string PairCollector::PrintStats()
{
string stats = "Collector stats: # anchor regions = " + to_string(anchorRegions_.size()) + "; # irr regions "
+ to_string(irrRegions_.size());
stats += " " + unparedCache_.printStats();
return stats;
}
void PairCollector::enableReadLogging(const string& pathToReadLog)
{
if (logStream_)
{
throw std::runtime_error("Read logging cannot be enabled twice " + pathToReadLog);
}
logStream_.reset(new std::ofstream());
logStream_->open(pathToReadLog.c_str());
if (!logStream_->is_open())
{
throw std::runtime_error("Failed to open " + pathToReadLog + " for writing (" + strerror(errno) + ")");
}
*logStream_ << "pair_type\tmotif\tread_type\tread_pos\tmate_type\tmate_pos\tname" << std::endl;
}
PairCollector::~PairCollector()
{
if (logStream_)
{
logStream_->close();
}
}
void PairCollector::logIrrPair(
const std::string& fragName, const GenomicRegion& readRegion, const std::string& readUnit,
const GenomicRegion& mateRegion, const std::string& mateUnit)
{
if (logStream_)
{
*logStream_ << "irr_pair\t";
if (readUnit <= mateUnit)
{
*logStream_ << (readUnit == mateUnit ? readUnit : readUnit + "_" + mateUnit);
*logStream_ << "\tirr\t" << readRegion.asString(contigInfo_);
*logStream_ << "\tirr\t" << mateRegion.asString(contigInfo_);
*logStream_ << "\t" << fragName;
}
else
{
*logStream_ << (readUnit == mateUnit ? readUnit : mateUnit + "_" + readUnit);
*logStream_ << "\tirr\t" << mateRegion.asString(contigInfo_);
*logStream_ << "\tirr\t" << readRegion.asString(contigInfo_);
*logStream_ << "\t" << fragName;
}
*logStream_ << std::endl;
}
}
void PairCollector::logAnchoredIrr(
const std::string& fragName, const std::string& unit, const GenomicRegion& irrRegion,
const GenomicRegion& anchorRegion)
{
if (logStream_)
{
*logStream_ << "anchored_irr\t" << unit;
*logStream_ << "\tirr\t" << irrRegion.asString(contigInfo_);
*logStream_ << "\tanchor\t" << anchorRegion.asString(contigInfo_);
*logStream_ << "\t" << fragName;
*logStream_ << std::endl;
}
}
| 31.358025 | 120 | 0.656299 |
c1f75e8c068e8afe33040c5839f5e945071b5142 | 4,926 | lua | Lua | include/sys/socket.lua | chatid/fend | 72dc6b024e2cabb4b707250b89097d4ff0da22f2 | [
"MIT"
] | 10 | 2015-12-22T22:07:35.000Z | 2021-05-27T06:26:57.000Z | include/sys/socket.lua | chatid/fend | 72dc6b024e2cabb4b707250b89097d4ff0da22f2 | [
"MIT"
] | null | null | null | include/sys/socket.lua | chatid/fend | 72dc6b024e2cabb4b707250b89097d4ff0da22f2 | [
"MIT"
] | 2 | 2016-07-06T09:47:25.000Z | 2017-02-24T15:47:26.000Z | include "sys/types"
ffi.cdef [[
typedef __socklen_t socklen_t;
enum __socket_type
{
SOCK_STREAM = 1,
SOCK_DGRAM = 2,
SOCK_RAW = 3,
SOCK_RDM = 4,
SOCK_SEQPACKET = 5,
SOCK_DCCP = 6,
SOCK_PACKET = 10,
SOCK_CLOEXEC = 02000000,
SOCK_NONBLOCK = 04000
};
typedef unsigned short int sa_family_t;
struct sockaddr
{
sa_family_t sa_family;
char sa_data[14];
};
struct sockaddr_storage
{
sa_family_t ss_family;
unsigned long int __ss_align;
char __ss_padding[(128 - (2 * sizeof (unsigned long int)))];
};
enum
{
MSG_OOB = 0x01,
MSG_PEEK = 0x02,
MSG_DONTROUTE = 0x04,
MSG_CTRUNC = 0x08,
MSG_PROXY = 0x10,
MSG_TRUNC = 0x20,
MSG_DONTWAIT = 0x40,
MSG_EOR = 0x80,
MSG_WAITALL = 0x100,
MSG_FIN = 0x200,
MSG_SYN = 0x400,
MSG_CONFIRM = 0x800,
MSG_RST = 0x1000,
MSG_ERRQUEUE = 0x2000,
MSG_NOSIGNAL = 0x4000,
MSG_MORE = 0x8000,
MSG_WAITFORONE = 0x10000,
MSG_CMSG_CLOEXEC = 0x40000000
};
struct msghdr
{
void *msg_name;
socklen_t msg_namelen;
struct iovec *msg_iov;
size_t msg_iovlen;
void *msg_control;
size_t msg_controllen;
int msg_flags;
};
struct cmsghdr
{
size_t cmsg_len;
int cmsg_level;
int cmsg_type;
__extension__ unsigned char __cmsg_data [];
};
extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
struct cmsghdr *__cmsg) __attribute__ ((__nothrow__ , __leaf__));
enum
{
SCM_RIGHTS = 0x01
};
struct linger
{
int l_onoff;
int l_linger;
};
extern int recvmmsg (int __fd, struct mmsghdr *__vmessages,
unsigned int __vlen, int __flags,
__const struct timespec *__tmo);
extern int sendmmsg (int __fd, struct mmsghdr *__vmessages,
unsigned int __vlen, int __flags);
struct osockaddr
{
unsigned short int sa_family;
unsigned char sa_data[14];
};
enum
{
SHUT_RD = 0,
SHUT_WR,
SHUT_RDWR
};
extern int socket (int __domain, int __type, int __protocol) __attribute__ ((__nothrow__ , __leaf__));
extern int socketpair (int __domain, int __type, int __protocol,
int __fds[2]) __attribute__ ((__nothrow__ , __leaf__));
extern int bind (int __fd, __const struct sockaddr * __addr, socklen_t __len)
__attribute__ ((__nothrow__ , __leaf__));
extern int getsockname (int __fd, struct sockaddr *__restrict __addr,
socklen_t *__restrict __len) __attribute__ ((__nothrow__ , __leaf__));
extern int connect (int __fd, __const struct sockaddr * __addr, socklen_t __len);
extern int getpeername (int __fd, struct sockaddr *__restrict __addr,
socklen_t *__restrict __len) __attribute__ ((__nothrow__ , __leaf__));
extern ssize_t send (int __fd, __const void *__buf, size_t __n, int __flags);
extern ssize_t recv (int __fd, void *__buf, size_t __n, int __flags);
extern ssize_t sendto (int __fd, __const void *__buf, size_t __n,
int __flags, __const struct sockaddr * __addr,
socklen_t __addr_len);
extern ssize_t recvfrom (int __fd, void *__restrict __buf, size_t __n,
int __flags, struct sockaddr *__restrict __addr,
socklen_t *__restrict __addr_len);
extern ssize_t sendmsg (int __fd, __const struct msghdr *__message,
int __flags);
extern ssize_t recvmsg (int __fd, struct msghdr *__message, int __flags);
extern int getsockopt (int __fd, int __level, int __optname,
void *__restrict __optval,
socklen_t *__restrict __optlen) __attribute__ ((__nothrow__ , __leaf__));
extern int setsockopt (int __fd, int __level, int __optname,
__const void *__optval, socklen_t __optlen) __attribute__ ((__nothrow__ , __leaf__));
extern int listen (int __fd, int __n) __attribute__ ((__nothrow__ , __leaf__));
extern int accept (int __fd, struct sockaddr *__restrict __addr,
socklen_t *__restrict __addr_len);
extern int shutdown (int __fd, int __how) __attribute__ ((__nothrow__ , __leaf__));
extern int sockatmark (int __fd) __attribute__ ((__nothrow__ , __leaf__));
extern int isfdtype (int __fd, int __fdtype) __attribute__ ((__nothrow__ , __leaf__));
]]
SO_ACCEPTCONN = 30
SO_ATTACH_FILTER = 26
SO_BINDTODEVICE = 25
SO_BROADCAST = 6
SO_BSDCOMPAT = 14
SO_DEBUG = 1
SO_DETACH_FILTER = 27
SO_DOMAIN = 39
SO_DONTROUTE = 5
SO_ERROR = 4
SO_KEEPALIVE = 9
SO_LINGER = 13
SO_MARK = 36
SO_NO_CHECK = 11
SO_OOBINLINE = 10
SO_PASSCRED = 16
SO_PASSSEC = 34
SO_PEERCRED = 17
SO_PEERNAME = 28
SO_PEERSEC = 31
SO_PRIORITY = 12
SO_PROTOCOL = 38
SO_RCVBUF = 8
SO_RCVBUFFORCE = 33
SO_RCVLOWAT = 18
SO_RCVTIMEO = 20
SO_REUSEADDR = 2
SO_RXQ_OVFL = 40
SO_SECURITY_AUTHENTICATION = 22
SO_SECURITY_ENCRYPTION_NETWORK = 24
SO_SECURITY_ENCRYPTION_TRANSPORT = 23
SO_SNDBUF = 7
SO_SNDBUFFORCE = 32
SO_SNDLOWAT = 19
SO_SNDTIMEO = 21
SO_TIMESTAMP = 29
SO_TIMESTAMPING = 37
SO_TIMESTAMPNS = 35
SO_TYPE = 3
SO_WIFI_STATUS = 41
SOL_AAL = 265
SOL_ATM = 264
SOL_DECNET = 261
SOL_IRDA = 266
SOL_PACKET = 263
SOL_RAW = 255
SOL_SOCKET = 1
SOL_X25 = 262
SOMAXCONN = 128
| 27.21547 | 102 | 0.722087 |
feb20136f322837b37667daee1f7d907377d442d | 1,684 | dart | Dart | eCommerce/lib/pages/CartPage.dart | YazeedAlKhalaf/eCommerceAppUser | 4914866073aaffc08ef971f5b58312ca57a5a14d | [
"MIT"
] | 9 | 2020-07-05T17:32:32.000Z | 2021-07-19T19:11:34.000Z | eCommerce/lib/pages/CartPage.dart | YazeedAlKhalaf/eCommerceAppUser | 4914866073aaffc08ef971f5b58312ca57a5a14d | [
"MIT"
] | null | null | null | eCommerce/lib/pages/CartPage.dart | YazeedAlKhalaf/eCommerceAppUser | 4914866073aaffc08ef971f5b58312ca57a5a14d | [
"MIT"
] | 5 | 2020-07-30T19:32:56.000Z | 2021-07-31T08:36:19.000Z | import 'package:flutter/material.dart';
import 'package:eCommerce/componets/cartProducts.dart';
import 'package:eCommerce/pages/HomePage.dart';
class ShoppingCartPage extends StatefulWidget {
@override
_ShoppingCartPageState createState() => _ShoppingCartPageState();
}
class _ShoppingCartPageState extends State<ShoppingCartPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
elevation: 0.1,
backgroundColor: Colors.red,
title: Text(
'Shopping Cart',
),
actions: <Widget>[
IconButton(
icon: Icon(
Icons.home,
color: Colors.white,
),
onPressed: () => Navigator.push(
context,
MaterialPageRoute(
builder: (context) => HomePage(),
),
),
),
],
),
body: CartProducts(),
bottomNavigationBar: Container(
color: Colors.white,
child: Row(
children: <Widget>[
Expanded(
child: ListTile(
title: Text(
"Total:",
),
subtitle: Text(
"\$230",
),
),
),
Expanded(
child: MaterialButton(
onPressed: () {},
child: Text(
"Check out",
style: TextStyle(
color: Colors.white,
),
),
color: Colors.red,
),
)
],
),
),
);
}
}
| 24.764706 | 67 | 0.445962 |
53d9defd038a79efa32f5cd554dda2f27ce87a29 | 1,859 | java | Java | src/test/java/tap/ReducerTests.java | tap-git/tap | 6537585a4bafa5c80352fce92866435744addd01 | [
"Apache-2.0"
] | null | null | null | src/test/java/tap/ReducerTests.java | tap-git/tap | 6537585a4bafa5c80352fce92866435744addd01 | [
"Apache-2.0"
] | null | null | null | src/test/java/tap/ReducerTests.java | tap-git/tap | 6537585a4bafa5c80352fce92866435744addd01 | [
"Apache-2.0"
] | null | null | null | package tap;
import static org.junit.Assert.*;
import junit.framework.Assert;
import org.junit.Test;
import tap.CommandOptions;
import tap.Phase;
import tap.Pipe;
import tap.Tap;
import tap.core.SummationPipeMapper;
import tap.core.SummationPipeReducer;
public class ReducerTests {
@Test
public void summation() {
/*
* Parse options - just use the standard options - input and output
* location, time window, etc.
*/
String args[] = { "-o", "/tmp/wordcount", "-i", "/tmp/out", "-f" };
Assert.assertEquals(5, args.length);
CommandOptions o = new CommandOptions(args);
/* Set up a basic pipeline of map reduce */
Tap summation = new Tap(o).named("summation");
Assert.assertNotNull("must specify input directory", o.input);
Assert.assertNotNull("must specify output directory", o.output);
Pipe<CountRec> input = Pipe.of(CountRec.class).at(o.input);
input.setPrototype(new CountRec());
Pipe<OutputLog> output = Pipe.of(OutputLog.class).at(o.output);
output.setPrototype(new OutputLog());
summation.produces(output);
Phase sum = new Phase().reads(input).writes(output)
.map(SummationPipeMapper.class).groupBy("word")
.reduce(SummationPipeReducer.class);
sum.plan(summation);
if (o.forceRebuild)
summation.forceRebuild();
summation.dryRun();
Assert.assertNotNull("Mapper Out Pipe Class ", sum.getConf().get(Phase.MAP_OUT_PIPE_CLASS));
Assert.assertNotNull("Reducer Out Pipe Class should be specified ", sum.getConf().get(Phase.REDUCER_OUT_PIPE_CLASS));
Assert.assertNotNull("Reducer should be specified ", sum.getConf().get(Phase.REDUCER));
summation.execute();
}
}
| 29.983871 | 125 | 0.637439 |
c296527850a1b3e1121d561d7bea1eff9706b7cb | 224 | go | Go | smartexposure/types/UserPortfolioValuePoint.go | Q-xyz/internal-api | fe98daaf16c0485c780158e8dbbb4c0f7603a4a3 | [
"Apache-2.0"
] | 1 | 2022-02-11T06:24:29.000Z | 2022-02-11T06:24:29.000Z | smartexposure/types/UserPortfolioValuePoint.go | Q-xyz/internal-api | fe98daaf16c0485c780158e8dbbb4c0f7603a4a3 | [
"Apache-2.0"
] | null | null | null | smartexposure/types/UserPortfolioValuePoint.go | Q-xyz/internal-api | fe98daaf16c0485c780158e8dbbb4c0f7603a4a3 | [
"Apache-2.0"
] | 3 | 2021-11-23T20:57:16.000Z | 2022-03-17T15:36:07.000Z | package types
import (
"time"
"github.com/shopspring/decimal"
)
type UserPortfolioValuePoint struct {
Point time.Time `json:"point"`
PortfolioValue decimal.Decimal `json:"portfolioValueSE,omitempty"`
}
| 17.230769 | 67 | 0.714286 |
0f25d3238d5686402aa1a00aa0b08cbf5618989d | 9,710 | cpp | C++ | modules/ti.App/Properties/properties_binding.cpp | mital/titanium | 5e02a4406686d627f6828fd5cc18dc1a75d0714f | [
"Apache-2.0"
] | 4 | 2016-01-02T17:14:06.000Z | 2016-05-09T08:57:33.000Z | modules/ti.App/Properties/properties_binding.cpp | mital/titanium | 5e02a4406686d627f6828fd5cc18dc1a75d0714f | [
"Apache-2.0"
] | null | null | null | modules/ti.App/Properties/properties_binding.cpp | mital/titanium | 5e02a4406686d627f6828fd5cc18dc1a75d0714f | [
"Apache-2.0"
] | null | null | null | /**
* Appcelerator Titanium - licensed under the Apache Public License 2
* see LICENSE in the root folder for details on the license.
* Copyright (c) 2008 Appcelerator, Inc. All Rights Reserved.
*/
#include "properties_binding.h"
#include <Poco/StringTokenizer.h>
#include <Poco/File.h>
using namespace kroll;
namespace ti
{
PropertiesBinding::PropertiesBinding(std::string& file_path)
{
PRINTD("Application properties path=" << file_path);
Poco::File file(file_path);
if (!file.exists())
{
file.createFile();
}
config = new Poco::Util::PropertyFileConfiguration(file_path);
this->file_path = file_path.c_str();
this->Init();
}
PropertiesBinding::PropertiesBinding()
{
this->file_path = "";
this->config = new Poco::Util::PropertyFileConfiguration();
this->Init();
}
void PropertiesBinding::Init()
{
/**
* @tiapi(method=True,name=App.Properties.getBool,since=0.2) Returns a property value as boolean
* @tiarg(for=App.Properties.getBool,name=name,type=string) the property name
* @tiresult(for=App.Properties.getBool,type=boolean) returns the value as a boolean
*/
SetMethod("getBool", &PropertiesBinding::GetBool);
/**
* @tiapi(method=True,name=App.Properties.getDouble,since=0.2) Returns a property value as double
* @tiarg(for=App.Properties.getDouble,name=name,type=string) the property name
* @tiresult(for=App.Properties.getDouble,type=double) returns the value as a double
*/
SetMethod("getDouble", &PropertiesBinding::GetDouble);
/**
* @tiapi(method=True,name=App.Properties.getInt,since=0.2) Returns a property value as integer
* @tiarg(for=App.Properties.getInt,name=name,type=string) the property name
* @tiresult(for=App.Properties.getInt,type=integer) returns the value as an integer
*/
SetMethod("getInt", &PropertiesBinding::GetInt);
/**
* @tiapi(method=True,name=App.Properties.getString,since=0.2) Returns a property value as string
* @tiarg(for=App.Properties.getString,name=name,type=string) the property name
* @tiresult(for=App.Properties.getString,type=string) returns the value as a string
*/
SetMethod("getString", &PropertiesBinding::GetString);
/**
* @tiapi(method=True,name=App.Properties.getList,since=0.2) Returns a property value as a list
* @tiarg(for=App.Properties.getList,name=name,type=string) the property name
* @tiresult(for=App.Properties.getList,type=list) returns the value as a list
*/
SetMethod("getList", &PropertiesBinding::GetList);
/**
* @tiapi(method=True,name=App.Properties.setBool,since=0.2) Sets a boolean property value
* @tiarg(for=App.Properties.setBool,name=name,type=string) the property name
* @tiarg(for=App.Properties.setBool,name=value,type=boolean) the value
*/
SetMethod("setBool", &PropertiesBinding::SetBool);
/**
* @tiapi(method=True,name=App.Properties.setDouble,since=0.2) Sets a double property value
* @tiarg(for=App.Properties.setDouble,name=name,type=string) the property name
* @tiarg(for=App.Properties.setDouble,name=value,type=double) the value
*/
SetMethod("setDouble", &PropertiesBinding::SetDouble);
/**
* @tiapi(method=True,name=App.Properties.setInt,since=0.2) Sets an integer property value
* @tiarg(for=App.Properties.setInt,name=name,type=string) the property name
* @tiarg(for=App.Properties.setInt,name=value,type=integer) the value
*/
SetMethod("setInt", &PropertiesBinding::SetInt);
/**
* @tiapi(method=True,name=App.Properties.setString,since=0.2) Sets a string property value
* @tiarg(for=App.Properties.setString,name=name,type=string) the property name
* @tiarg(for=App.Properties.setString,name=value,type=string) the value
*/
SetMethod("setString", &PropertiesBinding::SetString);
/**
* @tiapi(method=True,name=App.Properties.setList,since=0.2) Sets a list property value
* @tiarg(for=App.Properties.setList,name=name,type=string) the property name
* @tiarg(for=App.Properties.setList,name=value,type=list) the value
*/
SetMethod("setList", &PropertiesBinding::SetList);
/**
* @tiapi(method=True,name=App.Properties.hasProperty,since=0.2) Checks whether a property exists
* @tiarg(for=App.Properties.hasProperty,name=name,type=string) the property name
* @tiresult(for=App.Properties.hasProperty,type=boolean) returns true if the property exists
*/
SetMethod("hasProperty", &PropertiesBinding::HasProperty);
/**
* @tiapi(method=True,name=App.Properties.listProperties,since=0.2) Returns a list of property values
* @tiresult(for=App.Properties.listProperties,type=list) returns a list of property values
*/
SetMethod("listProperties", &PropertiesBinding::ListProperties);
}
PropertiesBinding::~PropertiesBinding() {
if (file_path.size() > 0) {
config->save(file_path);
}
}
void PropertiesBinding::Getter(const ValueList& args, SharedValue result, Type type)
{
if (args.size() > 0 && args.at(0)->IsString()) {
std::string eprefix = "PropertiesBinding::Get: ";
try {
std::string property = args.at(0)->ToString();
if (args.size() == 1) {
switch (type) {
case Bool: result->SetBool(config->getBool(property)); break;
case Double: result->SetDouble(config->getDouble(property)); break;
case Int: result->SetInt(config->getInt(property)); break;
case String: result->SetString(config->getString(property).c_str()); break;
default: break;
}
return;
}
else if (args.size() >= 2) {
switch (type) {
case Bool: result->SetBool(config->getBool(property, args.at(1)->ToBool())); break;
case Double: result->SetDouble(config->getDouble(property, args.at(1)->ToDouble())); break;
case Int: result->SetInt(config->getInt(property, args.at(1)->ToInt())); break;
case String: result->SetString(config->getString(property, args.at(1)->ToString()).c_str()); break;
default: break;
}
return;
}
} catch(Poco::Exception &e) {
throw ValueException::FromString(eprefix + e.displayText());
}
}
}
void PropertiesBinding::Setter(const ValueList& args, Type type)
{
if (args.size() >= 2 && args.at(0)->IsString()) {
std::string eprefix = "PropertiesBinding::Set: ";
try {
std::string property = args.at(0)->ToString();
switch (type) {
case Bool: config->setBool(property, args.at(1)->ToBool()); break;
case Double: config->setDouble(property, args.at(1)->ToDouble()); break;
case Int: config->setInt(property, args.at(1)->ToInt()); break;
case String: config->setString(property, args.at(1)->ToString()); break;
default: break;
}
if (file_path.size() > 0) {
config->save(file_path);
}
} catch(Poco::Exception &e) {
throw ValueException::FromString(eprefix + e.displayText());
}
}
}
void PropertiesBinding::GetBool(const ValueList& args, SharedValue result)
{
Getter(args, result, Bool);
}
void PropertiesBinding::GetDouble(const ValueList& args, SharedValue result)
{
Getter(args, result, Double);
}
void PropertiesBinding::GetInt(const ValueList& args, SharedValue result)
{
Getter(args, result, Int);
}
void PropertiesBinding::GetString(const ValueList& args, SharedValue result)
{
Getter(args, result, String);
}
void PropertiesBinding::GetList(const ValueList& args, SharedValue result)
{
SharedValue stringValue = Value::Null;
GetString(args, stringValue);
if (!stringValue->IsNull()) {
SharedPtr<StaticBoundList> list = new StaticBoundList();
std::string string = stringValue->ToString();
Poco::StringTokenizer t(string, ",", Poco::StringTokenizer::TOK_TRIM);
for (size_t i = 0; i < t.count(); i++) {
SharedValue token = Value::NewString(t[i].c_str());
list->Append(token);
}
SharedKList list2 = list;
result->SetList(list2);
}
}
void PropertiesBinding::SetBool(const ValueList& args, SharedValue result)
{
Setter(args, Bool);
}
void PropertiesBinding::SetDouble(const ValueList& args, SharedValue result)
{
Setter(args, Double);
}
void PropertiesBinding::SetInt(const ValueList& args, SharedValue result)
{
Setter(args, Int);
}
void PropertiesBinding::SetString(const ValueList& args, SharedValue result)
{
Setter(args, String);
}
void PropertiesBinding::SetList(const ValueList& args, SharedValue result)
{
if (args.size() >= 2 && args.at(0)->IsString() && args.at(1)->IsList()) {
std::string property = args.at(0)->ToString();
SharedKList list = args.at(1)->ToList();
std::string value = "";
for (unsigned int i = 0; i < list->Size(); i++) {
SharedValue arg = list->At(i);
if (arg->IsString())
{
value += list->At(i)->ToString();
if (i < list->Size() - 1) {
value += ",";
}
}
else
{
std::cerr << "skipping object: " << arg->ToTypeString() << std::endl;
}
}
config->setString(property, value);
if (file_path.size() > 0) {
config->save(file_path);
}
}
}
void PropertiesBinding::HasProperty(const ValueList& args, SharedValue result)
{
result->SetBool(false);
if (args.size() >= 1 && args.at(0)->IsString()) {
std::string property = args.at(0)->ToString();
result->SetBool(config->hasProperty(property));
}
}
void PropertiesBinding::ListProperties(const ValueList& args, SharedValue result)
{
std::vector<std::string> keys;
config->keys(keys);
SharedPtr<StaticBoundList> property_list = new StaticBoundList();
for (size_t i = 0; i < keys.size(); i++) {
std::string property_name = keys.at(i);
SharedValue name_value = Value::NewString(property_name.c_str());
property_list->Append(name_value);
}
result->SetList(property_list);
}
}
| 34.070175 | 105 | 0.687127 |
7b6bb8cb9ee3e512166c78ee52a5179f6197bdc2 | 1,542 | rb | Ruby | test/controllers/show_classes_controller_test.rb | cody-code-wy/lsahc-high-point | d29c437f30e9465071e7102f672e914ff04e6916 | [
"MIT"
] | null | null | null | test/controllers/show_classes_controller_test.rb | cody-code-wy/lsahc-high-point | d29c437f30e9465071e7102f672e914ff04e6916 | [
"MIT"
] | 3 | 2021-09-28T03:20:14.000Z | 2022-02-12T01:58:06.000Z | test/controllers/show_classes_controller_test.rb | cody-code-wy/lsahc-high-point | d29c437f30e9465071e7102f672e914ff04e6916 | [
"MIT"
] | null | null | null | require 'test_helper'
class ShowClassesControllerTest < ActionDispatch::IntegrationTest
setup do
@show_class = show_classes(:one)
end
test "should get index" do
get show_classes_url
assert_response :success
end
test "should get new" do
get new_show_class_url
assert_response :success
end
test "should create show_class" do
assert_difference('ShowClass.count') do
post show_classes_url, params: { show_class: { name: "unique" } }
end
assert_redirected_to show_class_url(ShowClass.last)
end
test "should not create show_class with invalid params" do
assert_no_difference('ShowClass.count') do
post show_classes_url, params: { show_class: { name: nil } }
end
end
test "should show show_class" do
get show_class_url(@show_class)
assert_response :success
end
test "should get edit" do
get edit_show_class_url(@show_class)
assert_response :success
end
test "should update show_class" do
patch show_class_url(@show_class), params: { show_class: { name: @show_class.name } }
assert_redirected_to show_class_url(@show_class)
end
test "should not update show_class with invalid params" do
patch show_class_url(@show_class), params: { show_class: { name: nil } }
assert_equal @show_class.name, ShowClass.find(@show_class.id).name
end
test "should destroy show_class" do
assert_difference('ShowClass.count', -1) do
delete show_class_url(@show_class)
end
assert_redirected_to show_classes_url
end
end
| 25.7 | 89 | 0.726978 |
2f351b8c80f52ed924433c99dcda880bd624129a | 615 | cs | C# | source/Server.Extensibility/Resources/Configuration/ConnectivityCheckResponse.cs | OctopusDeploy/Octopus.Server.Extensibility | f3a0c926ca1efd3431a7227b45f3b49f8133a471 | [
"Apache-2.0"
] | 4 | 2016-11-17T18:16:16.000Z | 2021-02-09T11:10:02.000Z | source/Server.Extensibility/Resources/Configuration/ConnectivityCheckResponse.cs | OctopusDeploy/Octopus.Server.Extensibility | f3a0c926ca1efd3431a7227b45f3b49f8133a471 | [
"Apache-2.0"
] | 53 | 2019-08-12T01:43:20.000Z | 2022-02-24T06:19:51.000Z | source/Server.Extensibility/Resources/Configuration/ConnectivityCheckResponse.cs | OctopusDeploy/Octopus.Server.Extensibility | f3a0c926ca1efd3431a7227b45f3b49f8133a471 | [
"Apache-2.0"
] | 2 | 2017-10-30T04:16:33.000Z | 2019-06-07T10:44:55.000Z | using System;
using System.Collections.Generic;
namespace Octopus.Server.Extensibility.Resources.Configuration
{
public class ConnectivityCheckResponse
{
readonly List<ConnectivityCheckMessage> messages;
public ConnectivityCheckResponse()
{
messages = new List<ConnectivityCheckMessage>();
}
public IEnumerable<ConnectivityCheckMessage> Messages => messages;
public void AddMessage(ConnectivityCheckMessageCategory category, string message)
{
messages.Add(new ConnectivityCheckMessage(category, message));
}
}
} | 27.954545 | 89 | 0.699187 |
8617e4b352eaaf846e1b4173fa9dba8bc88ada3a | 4,640 | java | Java | hawtdispatch/src/test/java/org/fusesource/hawtdispatch/DispatchSystemTest.java | sam-ma/hawtdispatch | 1bd0a7bbf1edfc79685c8517d06bbc2e50162698 | [
"Apache-2.0"
] | 79 | 2015-01-08T01:02:30.000Z | 2022-02-01T10:49:50.000Z | hawtdispatch/src/test/java/org/fusesource/hawtdispatch/DispatchSystemTest.java | sam-ma/hawtdispatch | 1bd0a7bbf1edfc79685c8517d06bbc2e50162698 | [
"Apache-2.0"
] | 11 | 2015-01-12T19:01:13.000Z | 2018-12-13T21:14:44.000Z | hawtdispatch/src/test/java/org/fusesource/hawtdispatch/DispatchSystemTest.java | sam-ma/hawtdispatch | 1bd0a7bbf1edfc79685c8517d06bbc2e50162698 | [
"Apache-2.0"
] | 40 | 2015-01-03T04:26:01.000Z | 2022-03-13T20:26:01.000Z | /**
* Copyright (C) 2012 FuseSource, Inc.
* http://fusesource.com
*
* 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 org.fusesource.hawtdispatch;
import java.util.concurrent.CountDownLatch;
import org.junit.Test;
import static java.lang.String.format;
/**
*
* @author <a href="http://hiramchirino.com">Hiram Chirino</a>
*/
public class DispatchSystemTest {
static int PARTITIONS = 1000;
static int WARM_UP_ITERATIONS = 10000;
static int RUN_UP_ITERATIONS = 1000*1000*10;
abstract class Scenario {
abstract public void execute(int iterations) throws InterruptedException;
abstract public String getName();
}
public static void main(String[] args) throws Exception {
new DispatchSystemTest().benchmark();
}
@Test
public void benchmark() throws InterruptedException {
// benchmark(new Scenario(){
// public String getName() {
// return "fork join";
// }
//
// public void execute(int iterations) throws InterruptedException {
// final ForkJoinPool pool = new ForkJoinPool();
// final CountDownLatch counter = new CountDownLatch(iterations);
// Task task = new Task(){
// public void run() {
// counter.countDown();
// if( counter.getCount()>0 ) {
// pool.execute(this);
// }
// }
// };
// for (int i = 0; i < 1000; i++) {
// pool.execute(task);
// }
// counter.await();
// pool.shutdown();
// }
// });
benchmark(new Scenario(){
public String getName() {
return "global queue";
}
public void execute(int iterations) throws InterruptedException {
final DispatchQueue queue = Dispatch.getGlobalQueue();
final CountDownLatch counter = new CountDownLatch(iterations);
Task task = new Task(){
public void run() {
counter.countDown();
if( counter.getCount()>0 ) {
queue.execute(this);
}
}
};
for (int i = 0; i < 1000; i++) {
queue.execute(task);
}
counter.await();
}
});
final DispatchQueue queue = Dispatch.createQueue("test");
benchmark(new Scenario(){
public String getName() {
return "serial queue";
}
public void execute(int iterations) throws InterruptedException {
final DispatchQueue queue = Dispatch.createQueue(null);
final CountDownLatch counter = new CountDownLatch(iterations);
Task task = new Task(){
public void run() {
counter.countDown();
if( counter.getCount()>0 ) {
queue.execute(this);
}
}
};
for (int i = 0; i < 1000; i++) {
queue.execute(task);
}
counter.await();
}
});
}
private static void benchmark(Scenario scenario) throws InterruptedException {
System.out.println(format("warm up: %s", scenario.getName()));
scenario.execute(WARM_UP_ITERATIONS);
System.out.println(format("benchmarking: %s", scenario.getName()));
long start = System.nanoTime();
scenario.execute(RUN_UP_ITERATIONS);
long end = System.nanoTime();
double durationMS = 1.0d*(end-start)/1000000d;
double rate = 1000d * RUN_UP_ITERATIONS / durationMS;
System.out.println(format("name: %s, duration: %,.3f ms, rate: %,.2f executions/sec", scenario.getName(), durationMS, rate));
}
}
| 33.623188 | 133 | 0.527802 |
8df96479d72aa90b314a68b1bf2fd28aa3c57f2a | 16,880 | ps1 | PowerShell | source/Classes/1.DscResources/01.nxFile.ps1 | SynEdgy/nxtools | 84ba5248f17df8e1ce955380c9e1452fa953cb22 | [
"MIT"
] | 3 | 2021-04-07T15:31:17.000Z | 2022-02-14T18:42:51.000Z | source/Classes/1.DscResources/01.nxFile.ps1 | SynEdgy/nxtools | 84ba5248f17df8e1ce955380c9e1452fa953cb22 | [
"MIT"
] | 2 | 2021-05-04T11:59:29.000Z | 2021-05-20T15:12:01.000Z | source/Classes/1.DscResources/01.nxFile.ps1 | SynEdgy/nxtools | 84ba5248f17df8e1ce955380c9e1452fa953cb22 | [
"MIT"
] | null | null | null | $script:localizedDataNxFile = Get-LocalizedData -DefaultUICulture en-US -FileName 'nxFile.strings.psd1'
[DscResource()]
class nxFile
{
[DscProperty()]
[Ensure] $Ensure
[DscProperty(key)]
[System.String] $DestinationPath
[DscProperty()]
[System.String] $SourcePath # Write Only
[DscProperty()]
[System.String] $Type = 'File' # directory | file | link
[DscProperty()]
[System.String] $Contents
[DscProperty()]
[System.String] $Checksum # ctime | mtime | md5 | Value
[DscProperty()]
[System.string] $Mode
[DscProperty()]
[bool] $Force # Write Only
[DscProperty()]
[bool] $Recurse # Write Only
[DscProperty()]
[System.String] $Owner
[DscProperty()]
[System.String] $Group
#Links (follow | manage | ignore)
[DscProperty()]
[Reason[]] $Reasons
[nxFile] Get()
{
Write-Verbose -Message (
$script:localizedDataNxFile.RetrieveFile -f $this.DestinationPath
)
$nxFileSystemInfo = Get-nxItem -Path $this.DestinationPath -ErrorAction SilentlyContinue
$currentState = [nxFile]::new()
$currentState.DestinationPath = $this.DestinationPath
if ($nxFileSystemInfo) # The file/folder/link exists
{
$currentState.Ensure = [Ensure]::Present
$currentState.Owner = $nxFileSystemInfo.nxOwner
$currentState.Group = $nxFileSystemInfo.nxGroup
$currentState.Type = $nxFileSystemInfo.nxFileSystemItemType
if ($this.Mode -match '^\d+$') # using octal notation (i.e. 0777)
{
$currentState.Mode = $nxFileSystemInfo.Mode.ToOctal()
if ($this.Mode.Length -eq 3)
{
# if the desired value omits special flags digit (assuming 0), re-add for comparison
$this.Mode = '0' + $this.Mode
}
}
else # Using Symbolic notation (i.e. rwxrwxrwx)
{
$currentState.Mode = $nxFileSystemInfo.Mode.ToString()
}
$isSameFile = $false
if ($this.Checksum -and $this.Type -eq 'File') # checksum checks has precedence over contents check
{
switch ($this.Checksum)
{
'MD5'
{
# Compare Destination with source using MD5
if ($this.SourcePath -and (Test-Path -Path $this.SourcePath))
{
$sourceHash = (Get-FileHash -Path $this.SourcePath -Algorithm 'MD5').Hash
$destinationHash = (Get-FileHash -Path $currentState.DestinationPath -Algorithm 'MD5').Hash
$isSameFile = $sourceHash -eq $destinationHash
if ($this.Contents)
{
# Do not compare contents if the comparison is done by checksum
$currentState.Contents = $this.Contents
}
}
elseif (-not (Test-Path -Path $this.SourcePath))
{
throw ($script:localizedDataNxFile.SourcePathNotFound -f $this.SourcePath)
}
}
'ctime' # change time (metadata)
{
# Compare Destination with source using ctime
if ($this.SourcePath -and (Test-Path -Path $this.SourcePath))
{
$sourceCtime = (Get-nxItem -Path $this.SourcePath).CreationTimeUtc
$destinationCtime = $nxFileSystemInfo.CreationTimeUtc
$isSameFile = $sourceCtime -eq $destinationCtime
Write-Verbose -Message (
$script:localizedDataNxFile.CompareCtime -f $this.DestinationPath, $destinationCtime, $sourceCtime
)
if ($this.Contents)
{
# Do not compare contents if the comparison is done by checksum
$currentState.Contents = $this.Contents
}
}
elseif (-not (Test-Path -Path $this.SourcePath))
{
throw ($script:localizedDataNxFile.SourcePathNotFound -f $this.SourcePath)
}
}
'mtime' # Modify time (data)
{
# Compare Destination with Source using mtime
if ($this.SourcePath -and (Test-Path -Path $this.SourcePath))
{
$sourceMtime = (Get-nxItem -Path $this.SourcePath).LastWriteTimeUtc
$destinationMtime = $nxFileSystemInfo.LastWriteTimeUtc
$isSameFile = $sourceMtime -eq $destinationMtime
Write-Verbose -Message (
$script:localizedDataNxFile.CompareCtime -f $this.DestinationPath, $destinationMtime, $sourceMtime
)
if ($this.Contents)
{
# Do not compare contents if the comparison is done by checksum
$currentState.Contents = $this.Contents
}
}
elseif (-not (Test-Path -Path $this.SourcePath))
{
throw ($script:localizedDataNxFile.SourcePathNotFound -f $this.SourcePath)
}
}
default
{
# Compare Destination with the provided checksum (ignore source file for comparison)
$checksumHashAlgorithm = Get-FileHashAlgorithmFromHash -FileHash $this.Checksum -ErrorAction Stop
$currentDestinationFileChecksum = (Get-FileHash -Algorithm $checksumHashAlgorithm -Path $currentState.DestinationPath).Hash
Write-Verbose -Message (
$script:localizedDataNxFile.CompareChecksum -f $this.Checksum, $currentDestinationFileChecksum
)
$currentState.Checksum = $currentDestinationFileChecksum
$isSameFile = $currentDestinationFileChecksum -eq $this.Checksum
if ($this.Contents)
{
# Do not compare contents if the comparison is done by checksum
$currentState.Contents = $this.Contents
}
}
}
}
elseif ($this.Contents) # no checksum but contents is set. use for comparison
{
if ($this.Type -eq 'File')
{
Write-Verbose -Message (
$script:localizedDataNxFile.GetFileContent -f $currentState.DestinationPath
)
$currentState.Contents = Get-Content -Raw -Path $currentState.DestinationPath
}
else
{
$currentState.Contents = $this.Contents # to make sure it does not flag in the comparison
}
}
else
{
# if we don't check against the source, against a provided checksum, or against the provided content
# assume it's the same file because the file already exists ([ensure]::Present)
$isSameFile = $true
}
if ($isSameFile)
{
$currentState.Checksum = $this.Checksum
}
$valuesToCheck = @(
# DestinationPath can be skipped because it's determined with Ensure absent/present
# SourcePath is write-only property
'Ensure'
'Type'
'Contents'
'Checksum'
'Mode'
# Force is write-only property
# Recurse is write-only property
'Owner'
'Group'
).Where({ $null -ne $this.$_ }) #remove properties not set from comparison
$compareStateParams = @{
CurrentValues = ($currentState | Convert-ObjectToHashtable)
DesiredValues = ($this | Convert-ObjectToHashtable)
ValuesToCheck = $valuesToCheck
IncludeValue = $true
}
$comparedState = Compare-DscParameterState @compareStateParams
$currentState.reasons = switch ($comparedState.Property)
{
'Ensure'
{
[Reason]@{
Code = '{0}:{0}:Ensure' -f $this.GetType()
Phrase = $script:localizedDataNxFile.nxFileShouldBeAbsent -f $this.DestinationPath
}
}
'Type'
{
[Reason]@{
Code = '{0}:{0}:Type' -f $this.GetType()
Phrase = $script:localizedDataNxFile.TypeMismatch -f $this.DestinationPath, $this.Type, $currentState.Type
}
break # If the type is wrong, we can't recover from this.
}
'Contents'
{
[Reason]@{
Code = '{0}:{0}:Contents' -f $this.GetType()
Phrase = $script:localizedDataNxFile.ContentsMismatch -f $this.DestinationPath, $this.Contents, $currentState.Contents
}
}
'Checksum'
{
[Reason]@{
Code = '{0}:{0}:Checksum' -f $this.GetType()
Phrase = $script:localizedDataNxFile.ChecksumMismatch -f $this.DestinationPath, $this.Checksum, $currentState.Checksum
}
}
'Mode'
{
[Reason]@{
Code = '{0}:{0}:Mode' -f $this.GetType()
Phrase = $script:localizedDataNxFile.ModeMismatch -f $this.DestinationPath, $this.Mode, $currentState.Mode
}
}
'Owner'
{
[Reason]@{
Code = '{0}:{0}:Owner' -f $this.GetType()
Phrase = $script:localizedDataNxFile.OwnerMismatch -f $this.DestinationPath, $this.Owner, $currentState.Owner
}
}
'Group'
{
[Reason]@{
Code = '{0}:{0}:Group' -f $this.GetType()
Phrase = $script:localizedDataNxFile.GroupMismatch -f $this.DestinationPath, $this.Group, $currentState.Group
}
}
}
}
else
{
# No item found for this Destination path
$currentState.Ensure = [Ensure]::Absent
if ($this.Ensure -ne $currentState.Ensure)
{
# We expected the file to be Present
$currentState.Reasons = [Reason]@{
Code = '{0}:{0}:Ensure' -f $this.GetType()
Phrase = $script:localizedDataNxFile.nxItemNotFound -f $this.DestinationPath
}
}
else
{
Write-Verbose -Message ($script:localizedDataNxFile.nxFileInDesiredState -f $this.DestinationPath)
}
}
return $currentState
}
[bool] Test()
{
$currentState = $this.Get()
$testTargetResourceResult = $currentState.Reasons -eq 0
return $testTargetResourceResult
}
[void] Set()
{
$currentState = $this.Get()
if ($this.Ensure -eq [Ensure]::Present) # Desired State: Ensure present
{
if ($currentState.Ensure -ne $this.Ensure) # but is absent
{
Write-Verbose -Message (
$script:localizedDataNxFile.CreateFile -f $this.DestinationPath
)
# Copy from source or
# Create new file [with content]
New-Item -ItemType $this.Type -Path $this.DestinationPath -Value $this.Contents -Force:($this.Force)
Set-nxMode -Path $this.DestinationPath -Mode $this.Mode
Set-nxGroupOwnership -Path $this.DestinationPath -Group $this.Group
Set-nxOwner -Path $this.DestinationPath -Owner $this.Owner
}
elseif ($currentState.Reasons.Count -gt 0)
{
# The file exists but is not properly configured
Write-Verbose -Message (
$script:localizedDataNxFile.SetFile -f $this.DestinationPath
)
switch -Regex ($currentState.Reasons.Code)
{
# DestinationPath can be skipped because it's determined with Ensure absent/present
# SourcePath is write-only property
# 'Ensure' is managed by the file being present or not (already covered)
'Type' # if an item of different type, throw... (we can't delete the item to create a new one)
{
throw ($script:localizedDataNxFile.SetTypeError -f $this.DestinationPath, $this.Type, $currentState.Type)
}
'Contents'
{
Write-Verbose -Message (
$script:localizedDataNxFile.SetFileContent -f $this.DestinationPath
)
[System.IO.File]::WriteAllText($currentState.DestinationPath, $this.Contents) # Set content adds a new line
}
'Checksum'
{
# either copy from source
if ($this.SourcePath -and (Test-Path -Path $this.SourcePath))
{
Write-Verbose -Message (
$script:localizedDataNxFile.CopySourceToDestination -f $this.SourcePath, $this.DestinationPath
)
Copy-Item -Confirm:$false -Path $this.SourcePath -Destination $this.DestinationPath -Force -Recurse:($this.Recurse)
}
elseif ($this.Contents -and $this.Type -eq 'File')
{
Write-Verbose -Message (
$script:localizedDataNxFile.SetFileContent -f $this.SourcePath
)
# or set content from $this.Contents
Set-Content -Path $this.DestinationPath -Value $this.Contents -Confirm:$false -Force
}
}
'Mode'
{
Set-nxMode -Path $this.DestinationPath -Mode $this.Mode -Recurse:($this.Force) -Confirm:$false -Force:($this.Force)
}
# Force is write-only property
# Recurse is write-only property
'Owner'
{
Set-nxOwner -Path $this.DestinationPath -Owner $this.Owner -Recurse:($this.Recurse) -Force:($this.Force) -Confirm:$false
}
'Group'
{
Set-nxGroupOwnership -Path $this.DestinationPath -Group $this.Group -Recurse:($this.Recurse) -Force:($this.Force) -Confirm:$false
}
}
}
else
{
# Set has been invoked but the file is compliant with the desired state (no reasons found).
}
}
else # Desired to be Absent
{
$nxFileSystemInfo = Get-nxItem -Path $this.DestinationPath -ErrorAction Stop | Where-Object -FilterScript { $this.Type -eq $_.nxFileSystemItemType}
if ($nxFileSystemInfo -and $currentState.Ensure -eq [Ensure]::Present)
{
Remove-Item -Path $nxFileSystemInfo.DestinationPath -Force:($this.Force) -Recurse:($this.Recurse) -Confirm:$false
}
}
}
}
| 40.576923 | 159 | 0.478791 |
b748b760ec6531b530eac5f11591990fc669ba0b | 1,275 | swift | Swift | Example/Tests/AltTests.swift | siuying/Alt | ed77877f2f7a1bfa0a921ea30523e4197b27651f | [
"MIT"
] | 5 | 2015-11-08T17:17:06.000Z | 2016-01-30T02:12:03.000Z | Example/Tests/AltTests.swift | siuying/Alt | ed77877f2f7a1bfa0a921ea30523e4197b27651f | [
"MIT"
] | null | null | null | Example/Tests/AltTests.swift | siuying/Alt | ed77877f2f7a1bfa0a921ea30523e4197b27651f | [
"MIT"
] | null | null | null | //
// AltTests.swift
// Alt
//
// Created by Chan Fai Chong on 12/11/2015.
// Copyright © 2015 CocoaPods. All rights reserved.
//
import XCTest
import Alt
import Nimble
struct AltTestsActions {
struct Increment : Action {
let value : Int
}
}
struct AltTestsStoreState {
var count = -1
}
class AltTestsStore : Store {
typealias State = AltTestsStoreState
var state : State!
required init() {
}
static func getInitialState() -> State {
return AltTestsStoreState(count: 0)
}
}
class AltTests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}
func testGetStore() {
let store = Alt.getStore(AltTestsStore.self)
let store2 = Alt.getStore(AltTestsStore.self)
expect(store === store2).to(beTrue(), description: "be a singleton")
expect(store.state.count).to(equal(MyStore.getInitialState().count), description: "state should set to initial state")
}
}
| 23.181818 | 126 | 0.642353 |
052da70041f0fc7c563a13174239dfc975b4e028 | 2,945 | rb | Ruby | lib/topological_inventory/azure/parser/network_adapter.rb | pkomanek/topological_inventory-azure | 46222cb50286274fa9a2e007844ba8f3aa6a8176 | [
"Apache-2.0"
] | null | null | null | lib/topological_inventory/azure/parser/network_adapter.rb | pkomanek/topological_inventory-azure | 46222cb50286274fa9a2e007844ba8f3aa6a8176 | [
"Apache-2.0"
] | 30 | 2019-12-10T16:31:33.000Z | 2021-04-08T14:40:31.000Z | lib/topological_inventory/azure/parser/network_adapter.rb | pkomanek/topological_inventory-azure | 46222cb50286274fa9a2e007844ba8f3aa6a8176 | [
"Apache-2.0"
] | 7 | 2020-02-10T18:42:26.000Z | 2020-07-13T09:37:44.000Z | module TopologicalInventory::Azure
class Parser
module NetworkAdapter
def parse_network_adapters(interface, scope)
instance_id = interface.virtual_machine&.id
device = lazy_find(:vms, :source_ref => instance_id) if instance_id
collections[:network_adapters].data << TopologicalInventoryIngressApiClient::NetworkAdapter.new(
:source_ref => interface.id,
:mac_address => interface.mac_address,
:extra => {
:name => interface.name,
:provisioning_state => interface.provisioning_state,
:enable_accelerated_networking => interface.enable_accelerated_networking,
:enable_ipforwarding => interface.enable_ipforwarding,
},
:subscription => lazy_find(:subscriptions, :source_ref => scope[:subscription_id]),
:source_region => lazy_find(:source_regions, :source_ref => interface.location),
:orchestration_stack => nil,
:device => device
)
parse_network_adapter_ipaddresses(interface, scope)
parse_network_adapter_tags(interface.id, interface.tags)
end
def parse_network_adapter_ipaddresses(interface, scope)
interface.ip_configurations.each do |address|
subnet = lazy_find(:subnets, :source_ref => address.subnet&.id) if address.subnet&.id
collections[:ipaddresses].data << TopologicalInventoryIngressApiClient::Ipaddress.new(
:source_ref => address.id,
:ipaddress => address.private_ipaddress,
:network_adapter => lazy_find(:network_adapters, :source_ref => interface.id),
:subscription => lazy_find(:subscriptions, :source_ref => scope[:subscription_id]),
:source_region => lazy_find(:source_regions, :source_ref => interface.location),
:subnet => subnet,
:kind => "private",
:extra => {
:primary => address.primary,
:name => address.name,
:provisioning_state => address.provisioning_state,
:private_ipaddress_version => address.private_ipaddress_version,
:private_ipallocation_method => address.private_ipallocation_method,
}
)
end
end
def parse_network_adapter_tags(network_adapter_uid, tags)
(tags || {}).each do |key, value|
collections[:network_adapter_tags].data << TopologicalInventoryIngressApiClient::NetworkAdapterTag.new(
:network_adapter => lazy_find(:network_adapters, :source_ref => network_adapter_uid),
:tag => lazy_find(:tags, :name => key, :value => value, :namespace => "azure")
)
end
end
end
end
end
| 48.278689 | 113 | 0.596944 |
f043daf48c42d7f929f4d25cb52dddbc3fe2c981 | 2,356 | py | Python | adding/adding_task.py | tk-rusch/coRNN | afd81744d108a2d623761b635b4ba56770d9e05d | [
"MIT"
] | 24 | 2020-10-06T22:25:39.000Z | 2021-11-28T09:33:30.000Z | adding/adding_task.py | tk-rusch/coRNN | afd81744d108a2d623761b635b4ba56770d9e05d | [
"MIT"
] | 2 | 2020-12-02T16:44:10.000Z | 2021-08-20T11:59:49.000Z | adding/adding_task.py | tk-rusch/coRNN | afd81744d108a2d623761b635b4ba56770d9e05d | [
"MIT"
] | 5 | 2020-10-20T13:54:59.000Z | 2021-09-23T06:21:49.000Z | from torch import nn, optim
import torch
import model
import torch.nn.utils
import utils
import argparse
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
parser = argparse.ArgumentParser(description='training parameters')
parser.add_argument('--n_hid', type=int, default=128,
help='hidden size of recurrent net')
parser.add_argument('--T', type=int, default=100,
help='length of sequences')
parser.add_argument('--max_steps', type=int, default=60000,
help='max learning steps')
parser.add_argument('--log_interval', type=int, default=100,
help='log interval')
parser.add_argument('--batch', type=int, default=50,
help='batch size')
parser.add_argument('--batch_test', type=int, default=1000,
help='size of test set')
parser.add_argument('--lr', type=float, default=2e-2,
help='learning rate')
parser.add_argument('--dt',type=float, default=6e-2,
help='step size <dt> of the coRNN')
parser.add_argument('--gamma',type=float, default=66,
help='y controle parameter <gamma> of the coRNN')
parser.add_argument('--epsilon',type=float, default = 15,
help='z controle parameter <epsilon> of the coRNN')
args = parser.parse_args()
n_inp = 2
n_out = 1
model = model.coRNN(n_inp, args.n_hid, n_out, args.dt, args.gamma, args.epsilon).to(device)
objective = nn.MSELoss()
optimizer = optim.Adam(model.parameters(), lr=args.lr)
def test():
model.eval()
with torch.no_grad():
data, label = utils.get_batch(args.T, args.batch_test)
label = label.unsqueeze(1)
out = model(data.to(device))
loss = objective(out, label.to(device))
return loss.item()
def train():
test_mse = []
for i in range(args.max_steps):
data, label = utils.get_batch(args.T,args.batch)
label = label.unsqueeze(1)
optimizer.zero_grad()
out = model(data.to(device))
loss = objective(out, label.to(device))
loss.backward()
optimizer.step()
if(i%100==0 and i!=0):
mse_error = test()
print('Test MSE: {:.6f}'.format(mse_error))
test_mse.append(mse_error)
model.train()
if __name__ == '__main__':
train()
| 31.837838 | 91 | 0.617997 |
b3e846293e6c1d8caa559b98dd9ea59291918ea8 | 1,673 | lua | Lua | gamemodes/underdone/gamemode/core/sharedfiles/sh_progressbars.lua | Nexeonenn/underdone | f3785d2bf5b2d74c14cf73ea91a7f9694c31ce5e | [
"MIT"
] | 1 | 2020-07-13T04:20:11.000Z | 2020-07-13T04:20:11.000Z | gamemode/core/sharedfiles/sh_progressbars.lua | etothepowerof26-s-gmod-projects/underdone | 71c49f12940766d43c9771609c1c15f0c65180e8 | [
"MIT"
] | null | null | null | gamemode/core/sharedfiles/sh_progressbars.lua | etothepowerof26-s-gmod-projects/underdone | 71c49f12940766d43c9771609c1c15f0c65180e8 | [
"MIT"
] | 4 | 2018-04-16T09:55:06.000Z | 2020-12-26T21:16:55.000Z | if CLIENT then
local tblProgressBars = {}
local intBarWidth = 200
local intBarHieght = 20
local intStartingX = (ScrW() / 2) - (intBarWidth / 2)
local intStartingY = ScrH() - intBarHieght - 100
local intSpacing = 5
local function DrawProgressBars()
local intRunningHieght = intStartingY
for Notification, Time in pairs(tblProgressBars or {}) do
local tblProgressBar = jdraw.NewProgressBar()
tblProgressBar:SetDimensions(intStartingX, intRunningHieght, intBarWidth, intBarHieght)
tblProgressBar:SetStyle(4, Green)
tblProgressBar:SetBorder(1, DrakGray)
tblProgressBar:SetValue(Time.Running, Time.Starting)
tblProgressBar:SetText("Default", Notification, White)
jdraw.DrawProgressBar(tblProgressBar)
intRunningHieght = intRunningHieght - intBarHieght - intSpacing
end
end
hook.Add("HUDPaint", "DrawProgressBars", DrawProgressBars)
function AddProgressBar(strNotification, intTime)
tblProgressBars[strNotification] = {Starting = intTime, Running = intTime}
for i = 1, intBarWidth do
timer.Simple(i * (intTime / intBarWidth), function() tblProgressBars[strNotification].Running = tblProgressBars[strNotification].Running - (intTime / intBarWidth) end)
end
timer.Simple(intTime, function() tblProgressBars[strNotification] = nil end)
end
concommand.Add("UD_AddProgressBar", function(ply, command, args) AddProgressBar(string.gsub(args[1], "_", " "), tonumber(args[2])) end)
end
if SERVER then
local Player = FindMetaTable("Player")
function Player:CreateProgressBar(strMessage, intTime)
if IsValid(self) then
self:ConCommand("UD_AddProgressBar " .. string.gsub(strMessage, " ", "_") .. " " .. intTime)
end
end
end
| 39.833333 | 170 | 0.75792 |
4a8c4c6337212c93e3a9fb524d31dc9ed244ed5a | 1,386 | cs | C# | src/KissLog.AspNet.Mvc/KissLogWebMvcExceptionFilterAttribute.cs | catalingavan/KissLog | 61f3c9b03c20a6f02233795a34fb589ac0ee4716 | [
"Apache-2.0"
] | 8 | 2018-09-18T13:08:50.000Z | 2018-11-24T13:10:42.000Z | src/KissLog.AspNet.Mvc/KissLogWebMvcExceptionFilterAttribute.cs | catalingavan/KissLog | 61f3c9b03c20a6f02233795a34fb589ac0ee4716 | [
"Apache-2.0"
] | 2 | 2018-10-24T21:19:36.000Z | 2019-01-04T12:06:22.000Z | src/KissLog.AspNet.Mvc/KissLogWebMvcExceptionFilterAttribute.cs | catalingavan/KissLog-net | 61f3c9b03c20a6f02233795a34fb589ac0ee4716 | [
"Apache-2.0"
] | null | null | null | using System;
using System.Web;
using System.Web.Mvc;
namespace KissLog.AspNet.Mvc
{
public class KissLogWebMvcExceptionFilterAttribute : HandleErrorAttribute
{
static KissLogWebMvcExceptionFilterAttribute()
{
InternalHelpers.WrapInTryCatch(() =>
{
ModuleInitializer.Init();
});
}
public override void OnException(ExceptionContext filterContext)
{
if (filterContext == null || filterContext.Exception == null)
return;
OnException(filterContext.Exception, filterContext.HttpContext);
}
internal void OnException(Exception exception, HttpContextBase httpContext)
{
if (exception == null)
throw new ArgumentNullException(nameof(exception));
if (httpContext == null)
throw new ArgumentNullException(nameof(httpContext));
var factory = new KissLog.AspNet.Web.LoggerFactory();
Logger logger = factory.GetInstance(httpContext);
logger.Error(exception);
if (exception is HttpException)
{
HttpException httpException = (HttpException)exception;
int statusCode = httpException.GetHttpCode();
logger.SetStatusCode(statusCode);
}
}
}
}
| 28.875 | 83 | 0.59596 |
d9c10c3223e957958314fec8cad7a2f6e9069062 | 2,073 | sql | SQL | db/query-pages.sql | negapedia/wiki2overpediadb | a0121e293b5a81b19796e150fb435fe353904b16 | [
"MIT"
] | null | null | null | db/query-pages.sql | negapedia/wiki2overpediadb | a0121e293b5a81b19796e150fb435fe353904b16 | [
"MIT"
] | null | null | null | db/query-pages.sql | negapedia/wiki2overpediadb | a0121e293b5a81b19796e150fb435fe353904b16 | [
"MIT"
] | null | null | null | /*Define the query used for exporting informations for articles, topics and global*/
WITH topics AS (
SELECT page_id AS topic_id
FROM w2o.pages
WHERE page_type = 'topic'::w2o.mypagetype
), percentiledindices AS (
SELECT type, page_id, year, weight,
percent_rank() OVER w AS percentile,
(dense_rank() OVER w - 1.0)/GREATEST((dense_rank() OVER wd + dense_rank() OVER w - 2),1) AS dense_percentile,
rank() OVER wd AS rank,
(dense_rank() OVER tw - 1.0)/GREATEST((dense_rank() OVER twd + dense_rank() OVER tw - 2),1) AS topic_dense_percentile,
percent_rank() OVER tw AS topic_percentile,
rank() OVER twd AS topic_rank
FROM w2o.indicesbyyear
WINDOW w AS (PARTITION BY type, year, page_type ORDER BY weight),
wd AS (PARTITION BY type, year, page_type ORDER BY weight DESC),
tw AS (PARTITION BY type, year, page_type, topic_id ORDER BY weight),
twd AS (PARTITION BY type, year, page_type, topic_id ORDER BY weight DESC)
), percentiledindicesagg AS (
SELECT page_id, type,array_agg(CAST((weight, percentile, dense_percentile, rank, topic_percentile, topic_dense_percentile, topic_rank, year) AS w2o.yearmeasurement) ORDER BY year ASC) AS measurements
FROM percentiledindices
GROUP BY page_id, type
), percentiledindicesaggagg AS (
SELECT page_id, array_agg(CAST((type, measurements) AS w2o.indextype2measurements) ORDER BY type ASC) AS stats
FROM percentiledindicesagg
GROUP BY page_id
) SELECT row_to_json(CAST((
CAST((page_id, page_title, page_abstract, parent_id, page_type, page_creationyear) AS w2o.page),
COALESCE(stats,array[]::w2o.indextype2measurements[]),
COALESCE(socialjumps,array[]::w2o.page[])
) AS w2o.pageinfo))
FROM w2o.pages p LEFT JOIN LATERAL (
SELECT array_agg(CAST((page_id, page_title, page_abstract, parent_id, page_type, page_creationyear) AS w2o.page) ORDER BY nr) AS socialjumps
FROM unnest(p.page_socialjumps) WITH ORDINALITY _(page_id, nr) JOIN w2o.pages USING (page_id)
) _ ON TRUE
JOIN percentiledindicesaggagg USING (page_id)
ORDER BY p.page_id;
| 54.552632 | 203 | 0.742402 |
045ca7b3a8ffe16267d73c10c1336b85921d0311 | 470 | java | Java | sources/com/google/android/gms/internal/ads/C9768vd.java | tusharchoudhary0003/Custom-Football-Game | 47283462b2066ad5c53b3c901182e7ae62a34fc8 | [
"MIT"
] | 1 | 2019-10-01T11:34:10.000Z | 2019-10-01T11:34:10.000Z | sources/com/google/android/gms/internal/ads/C9768vd.java | tusharchoudhary0003/Custom-Football-Game | 47283462b2066ad5c53b3c901182e7ae62a34fc8 | [
"MIT"
] | null | null | null | sources/com/google/android/gms/internal/ads/C9768vd.java | tusharchoudhary0003/Custom-Football-Game | 47283462b2066ad5c53b3c901182e7ae62a34fc8 | [
"MIT"
] | 1 | 2020-05-26T05:10:33.000Z | 2020-05-26T05:10:33.000Z | package com.google.android.gms.internal.ads;
/* renamed from: com.google.android.gms.internal.ads.vd */
final /* synthetic */ class C9768vd implements Runnable {
/* renamed from: a */
private final zzbcq f23257a;
/* renamed from: b */
private final boolean f23258b;
C9768vd(zzbcq zzbcq, boolean z) {
this.f23257a = zzbcq;
this.f23258b = z;
}
public final void run() {
this.f23257a.mo30396a(this.f23258b);
}
}
| 22.380952 | 58 | 0.63617 |
4fa05bd4991b2d34efd759937bc5866360a426c0 | 15,951 | swift | Swift | imPhoto/imPhoto MessagesExtension/MessagesViewController.swift | AndyDentFree/im-plausibilities | 26f7a7a209e4b0c134b17191451ade122fc0a4fa | [
"MIT"
] | 2 | 2020-01-30T20:58:55.000Z | 2020-10-12T07:55:32.000Z | imPhoto/imPhoto MessagesExtension/MessagesViewController.swift | AndyDentFree/im-plausibilities | 26f7a7a209e4b0c134b17191451ade122fc0a4fa | [
"MIT"
] | 1 | 2019-09-28T17:38:49.000Z | 2020-06-22T07:44:01.000Z | imPhoto/imPhoto MessagesExtension/MessagesViewController.swift | AndyDentFree/im-plausibilities | 26f7a7a209e4b0c134b17191451ade122fc0a4fa | [
"MIT"
] | null | null | null | //
// MessagesViewController.swift
// imUrlData MessagesExtension
//
// Created by Andrew Dent on 12/1/19.
// Copyright © 2019 Touchgram Pty Ltd. All rights reserved.
//
import UIKit
import os
import Messages
import AVFoundation
class MessagesViewController: MSMessagesAppViewController, UINavigationControllerDelegate, UIImagePickerControllerDelegate {
@IBOutlet fileprivate weak var useCameraBtn: UIButton!
@IBOutlet fileprivate weak var pickFromRollBtn: UIButton!
@IBOutlet fileprivate weak var sendBtn: UIButton!
@IBOutlet fileprivate weak var sendAtchBtn: UIButton!
@IBOutlet fileprivate weak var imageView: UIImageView!
@IBOutlet weak var tintView: UIView!
@IBOutlet weak var buttonStack: UIStackView!
@IBOutlet weak var imageDetails: UILabel!
var imagePickerController = UIImagePickerController()
var currentPicker = UIImagePickerController.SourceType.photoLibrary
var capturedImages = [UIImage]()
var attachmentPath : URL? = nil
var amShowingReceivedPhoto = false // flag so when we show full window know if should put up picker
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
imagePickerController.modalPresentationStyle = .currentContext
imagePickerController.delegate = self
}
func showReceivedImage(_ img:UIImage) {
amShowingReceivedPhoto = true
imageDetails.isHidden = false
imageDetails.text = img.debugDescription
tintView.isHidden = true
buttonStack.isHidden = true
imageView.isHidden = false
imageView.image = img
sendBtn.isEnabled = false
sendAtchBtn.isEnabled = false
pickFromRollBtn.isEnabled = false
}
func printDetails(_ msg:MSMessage, from:String) {
if msg.layout == nil {
print("\(from) \(msg.debugDescription)\n has no layout")
}
else {
if let lay = msg.layout as? MSMessageTemplateLayout {
if let im = lay.image {
showReceivedImage(im)
print("\(from) \(msg.debugDescription)\n with image in layout\n \(im.debugDescription) ")
} else {
print("\(from) \(msg.debugDescription)\n with layout\n \(lay.debugDescription) BUT NO IMAGE")
}
} else {
print("\(from) \(msg.debugDescription)\n has a layout but cannot cast to MSMessageTemplateLayout")
}
}
}
// MARK: - Conversation Handling
override func willBecomeActive(with conversation: MSConversation) {
// Called when the extension is about to move from the inactive to active state.
// This will happen when the extension is about to present UI.
// NOTE that means you may have launched the extension to compose a new message OR selected previous, which also hits didSelect
// Use this method to configure the extension and restore previously stored state.
}
override func didBecomeActive(with conversation: MSConversation) {
guard let sel = conversation.selectedMessage else {
os_log("didBecomeActive with no selectedMessage in conversation")
return
}
printDetails(sel, from:"didBecomeActive")
// nothing to process as image is in the message layout
}
override func didResignActive(with conversation: MSConversation) {
// Called when the extension is about to move from the active to inactive state.
// This will happen when the user dissmises the extension, changes to a different
// conversation or quits Messages.
// Use this method to release shared resources, save user data, invalidate timers,
// and store enough state information to restore your extension to its current state
// in case it is terminated later.
}
override func didSelect(_ message: MSMessage, conversation: MSConversation) {
os_log("didSelect")
printDetails(message, from:"didSelect")
super.didSelect(message, conversation: conversation)
// nothing to process as image is in the message layout
}
override func didReceive(_ message: MSMessage, conversation: MSConversation) {
// Called when a message arrives that was generated by another instance of this
// extension on a remote device. ONLY if the message arrives whilst
// this extension is active (ie: composing a new message with it)
// nothing to process as image is in the message layout
guard let sel = conversation.selectedMessage else {
os_log("didReceive with no selectedMessage in conversation")
return
}
printDetails(sel, from:"didReceive")
}
override func didStartSending(_ message: MSMessage, conversation: MSConversation) {
// Called when the user taps the send button.
}
override func didCancelSending(_ message: MSMessage, conversation: MSConversation) {
// Called when the user deletes the message without sending it.
// Use this to clean up state related to the deleted message.
}
override func willTransition(to presentationStyle: MSMessagesAppPresentationStyle) {
// Called before the extension transitions to a new presentation style.
// Use this method to prepare for the change in presentation style.
}
override func didTransition(to presentationStyle: MSMessagesAppPresentationStyle) {
// Called after the extension transitions to a new presentation style.
// Use this method to finalize any behaviors associated with the change in presentation style.
if presentationStyle == .expanded && !amShowingReceivedPhoto {
// show the roll if got here by tapping button or just resizing view
showImagePicker(sourceType: currentPicker)
}
}
// MARK: - Comms
func send() {
guard let conversation = activeConversation else { fatalError("Expected a conversation") }
let layout = MSMessageTemplateLayout()
layout.caption = "Your photo from imPhoto sample app"
let session = conversation.selectedMessage?.session
let message = MSMessage(session: session ?? MSSession())
// capturedImages is empty now thanks to end of finishAndUpdate, so use the one from the image
layout.image = imageView!.image! // NOTE in this simple example may find this delivers a flipped image
message.layout = layout // WARNING do this assignment AFTER the image assigned, it's not referential, structures are copied!
conversation.insert(message) { (error) in
if let error = error {
os_log("Error with MSConversation.insert(message)")
print(error)
}
}
dismiss()
}
func sendAttachment() {
guard let conversation = activeConversation else { fatalError("Expected a conversation") }
guard
let imageData = imageView?.image?.jpegData(compressionQuality: 0.8),
let docUrl = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first
else {
dismiss()
return
}
// WARNING this is not great practice - not robust if muliple messages sent without completing upload
attachmentPath = URL(fileURLWithPath: "imPhoto.jpg", relativeTo: docUrl)
if (try? imageData.write(to: attachmentPath!)) != nil {
conversation.insertAttachment(attachmentPath!, withAlternateFilename: "imPhoto.jpg") { (error) in
if let error = error {
os_log("Error with insertAttachment(message)")
print(error)
}
}
}
dismiss()
}
func sendableDisplay(enabled:Bool) {
imageView?.isHidden = !enabled
sendBtn?.isEnabled = enabled
sendAtchBtn?.isEnabled = enabled
}
fileprivate func finishAndUpdate() {
dismiss(animated: true, completion: { [weak self] in
guard let `self` = self else {
return
}
if `self`.capturedImages.count > 0 {
`self`.sendableDisplay(enabled: true)
if `self`.capturedImages.count == 1 {
// Camera took a single picture.
`self`.imageView?.image = `self`.capturedImages[0]
} else {
// Camera took multiple pictures; use the list of images for animation.
`self`.imageView?.animationImages = `self`.capturedImages
`self`.imageView?.animationDuration = 5 // Show each captured photo for 5 seconds.
`self`.imageView?.animationRepeatCount = 0 // Animate forever (show all photos).
`self`.imageView?.startAnimating()
}
// To be ready to start again, clear the captured images array.
`self`.capturedImages.removeAll()
}
})
}
/// Copied from Apple's PhotoPicker sample
/// APLViewController.swift
fileprivate func showImagePicker(sourceType: UIImagePickerController.SourceType) {
// If the image contains multiple frames, stop animating.
if (imageView?.isAnimating)! {
imageView?.stopAnimating()
}
if capturedImages.count > 0 {
capturedImages.removeAll()
}
imagePickerController.sourceType = sourceType
imagePickerController.modalPresentationStyle =
(sourceType == UIImagePickerController.SourceType.camera) ?
UIModalPresentationStyle.fullScreen : UIModalPresentationStyle.popover
let presentationController = imagePickerController.popoverPresentationController
/* unlike the PhotoPicker sample, we don't have a UIBarButtonItem
presentationController?.barButtonItem = button // Display popover from the UIBarButtonItem as an anchor.
*/
presentationController?.sourceView = self.view
let b = self.view.bounds
presentationController?.sourceRect = b.insetBy(dx: 8.0, dy: 20.0)
presentationController?.permittedArrowDirections = UIPopoverArrowDirection.any
/*
if sourceType == UIImagePickerControllerSourceType.camera {
// The user wants to use the camera interface. Set up our custom overlay view for the camera.
imagePickerController.showsCameraControls = false
// Apply our overlay view containing the toolar to take pictures in various ways.
overlayView?.frame = (imagePickerController.cameraOverlayView?.frame)!
imagePickerController.cameraOverlayView = overlayView
}*/
present(imagePickerController, animated: true, completion: {
// Done presenting.
})
}
func showCurrentPicker() {
if presentationStyle == .compact {
amShowingReceivedPhoto = false // in case still resident, reset the flag
requestPresentationStyle(.expanded) // see didTransition(to:)
} else {
showImagePicker(sourceType: currentPicker)
}
}
// MARK: - Buttons
@IBAction func onUseCamera(_ sender: Any) {
currentPicker = UIImagePickerController.SourceType.camera
let authStatus = AVCaptureDevice.authorizationStatus(for: AVMediaType.video)
if authStatus == AVAuthorizationStatus.denied {
// Denied access to camera, alert the user.
// The user has previously denied access. Remind the user that we need camera access to be useful.
let alert = UIAlertController(title: "Unable to access the Camera",
message: "To enable access, go to Settings > Privacy > Camera and turn on Camera access for this app.",
preferredStyle: UIAlertController.Style.alert)
let okAction = UIAlertAction(title: "OK", style: .cancel, handler: nil)
alert.addAction(okAction)
let settingsAction = UIAlertAction(title: "Settings", style: .default, handler: { _ in
// Take the user to Settings app to possibly change permission.
guard let settingsUrl = URL(string: UIApplication.openSettingsURLString) else { return }
/* normal advice for extensions is
self.extensionContext?.open(settingsUrl, completionHandler: { (success) in ...
extensionContext.open does NOT WORK FROM INSIDE iMessage.
however we can go back up the responder chain to get the iMessage parent app
*/
let openSel = #selector(UIApplication.open(_:options:completionHandler:))
var responder = self as UIResponder?
while (responder != nil){
if responder?.responds(to: openSel ) == true{
// cannot package up arguments, so assume is a UIApplication and cast
(responder as? UIApplication)?.open(settingsUrl, completionHandler:{(success) in
if success {
os_log("Successfully opened settings")
} else {
os_log("Failed to open Settings")
}
})
return
}
responder = responder!.next
}
})
alert.addAction(settingsAction)
present(alert, animated: true, completion: nil)
}
else if (authStatus == AVAuthorizationStatus.notDetermined) {
// The user has not yet been presented with the option to grant access to the camera hardware.
// Ask for permission.
//
// (Note: you can test for this case by deleting the app on the device, if already installed).
// (Note: we need a usage description in our Info.plist to request access.
//
AVCaptureDevice.requestAccess(for: AVMediaType.video, completionHandler: { (granted) in
if granted {
DispatchQueue.main.async {
self.showCurrentPicker()
}
}
})
} else {
showCurrentPicker()
}
}
@IBAction public func onPickFromRoll(_ sender: UIButton) {
currentPicker = UIImagePickerController.SourceType.photoLibrary
showCurrentPicker()
}
// should only be enabled when there is a backgroundImage set
@IBAction public func onSend(_ sender: UIButton) {
send()
imageView.image = nil
sendableDisplay(enabled: false)
}
// should only be enabled when there is a backgroundImage set
@IBAction public func onSendAttachment(_ sender: UIButton) {
sendAttachment()
imageView.image = nil
sendableDisplay(enabled: false)
}
// MARK: - UIImagePickerControllerDelegate
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) {
guard let image = info[UIImagePickerController.InfoKey.originalImage] else { return }
capturedImages.append(image as! UIImage)
finishAndUpdate()
}
func imagePickerControllerDidCancel(_ picker: UIImagePickerController) {
dismiss(animated: true, completion: {
// Done cancel dismiss of image picker.
})
}
}
| 43.942149 | 145 | 0.624287 |
809381c1fd73afa527b06bf215aa79631ad87b18 | 2,055 | java | Java | annotations/option-annotations/src/main/java/io/dekorate/option/annotation/GeneratorOptions.java | pollend/dekorate | 80d3d10c002304d0c859cb1530b3953f1356cce8 | [
"Apache-2.0"
] | null | null | null | annotations/option-annotations/src/main/java/io/dekorate/option/annotation/GeneratorOptions.java | pollend/dekorate | 80d3d10c002304d0c859cb1530b3953f1356cce8 | [
"Apache-2.0"
] | null | null | null | annotations/option-annotations/src/main/java/io/dekorate/option/annotation/GeneratorOptions.java | pollend/dekorate | 80d3d10c002304d0c859cb1530b3953f1356cce8 | [
"Apache-2.0"
] | null | null | null | /**
* Copyright 2018 The original 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 io.dekorate.option.annotation;
import io.dekorate.kubernetes.config.Configuration;
import io.sundr.builder.annotations.Adapter;
import io.sundr.builder.annotations.Buildable;
import io.sundr.builder.annotations.Pojo;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Buildable(builderPackage = "io.fabric8.kubernetes.api.builder")
@Pojo(name = "GeneratorConfig", relativePath = "../config",
mutable = true,
superClass = Configuration.class,
withStaticBuilderMethod = false,
withStaticAdapterMethod = false,
adapter = @Adapter(suffix = "Adapter", relativePath = "../adapter", withMapAdapterMethod = true))
@Target({ElementType.CONSTRUCTOR, ElementType.TYPE})
@Retention(RetentionPolicy.SOURCE)
public @interface GeneratorOptions {
/**
* The path to input manifests.
* If the path is specified and the manifests are found, they will be used as input to the generator process.
* In this case, the instead of generating resources from scratch, the existing will be used and will be decarated
* according to the annotation configuration.
* @return The path, or empty string.
*/
String inputPath() default "";
/**
* The output path where the generated/decorated manifests will be stored.
* @return The path, or empty string.
*/
String outputPath() default "";
}
| 37.363636 | 116 | 0.744526 |
05c30b1ec2fe6b5c12620401cc14a43c2f8f71ba | 25,395 | html | HTML | index.html | luclow/salty-wet-man | c2b0b39140d19ab6ac4a77c3439041a531c0bf2c | [
"BSD-4-Clause"
] | 14 | 2019-11-23T06:29:00.000Z | 2021-12-27T04:50:30.000Z | index.html | lucylow/salty-wet-man | c2b0b39140d19ab6ac4a77c3439041a531c0bf2c | [
"BSD-4-Clause"
] | 22 | 2019-08-11T13:54:19.000Z | 2022-02-10T00:14:48.000Z | index.html | luclow/salty-wet-man | c2b0b39140d19ab6ac4a77c3439041a531c0bf2c | [
"BSD-4-Clause"
] | 1 | 2021-05-30T14:01:48.000Z | 2021-05-30T14:01:48.000Z | <!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<title>Legacy Parental Control</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css">
<link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css'>
<link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css'>
<link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.css'>
<link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/jvectormap/2.0.4/jquery-jvectormap.min.css'><link rel="stylesheet" href="./style.css">
</head>
<body>
<!-- partial:index.partial.html -->
<section>
<header>
<nav class="rad-navigation">
<div class="rad-logo-container rad-nav-min">
<a href="#" class="rad-logo">S.W.M.</a>
<a href="#" class="rad-toggle-btn pull-right"><i class="fa fa-bars"></i></a>
</div>
<a href="#" class="rad-logo-hidden">S.W.M.</a>
<div class="rad-top-nav-container">
<a href="" class="brand-icon"></a>
<ul class="pull-right links">
<li class="rad-dropdown no-color">
<a class="rad-menu-item" href="#"><img class="rad-list-img sm-img" src="https://i.ibb.co/7nMzCX1/Screen-Shot-2021-03-22-at-11-01-06-PM.png" alt="me" /></a>
<ul class="rad-dropmenu-item sm-menu">
<li class="rad-notification-item">
<a class="rad-notification-content lg-text" href="#"><i class="fa fa-edit"></i> Child Profile</a>
</li>
<li class="rad-notification-item">
<a class="rad-notification-content lg-text" href="#"><i class="fa fa-power-off"></i> Sign out</a>
</li>
</ul>
</li>
<li class="rad-dropdown"><a class="rad-menu-item" href="#"><i class="fa fa-cog"></i></a>
<ul class="rad-dropmenu-item rad-settings">
<li class="rad-dropmenu-header"><a href="#">Settings</a></li>
<li class="rad-notification-item text-left">
<div class="pull-left"><i class="fa fa-link"></i></div>
<div class="pull-right">
<label class="rad-chk-pin pull-right">
<input type="checkbox" /><span></span></label>
</div>
<div class="rad-notification-body">
<div class="lg-text">Family Mode</div>
<div class="sm-text">Family Mode</div>
</div>
</li>
<li id="rad-color-opts" class="rad-notification-item text-left hide">
<div class="pull-left"><i class="fa fa-puzzle-piece"></i></div>
<div class="pull-right">
<div class="rad-color-swatch">
<label class="colors rad-bg-crimson rad-option-selected">
<input type="radio" checked name="color" value="crimson" />
</label>
<label class="colors rad-bg-teal">
<input type="radio" name="color" value="teal" />
</label>
<label class="colors rad-bg-purple">
<input type="radio" name="color" value="purple">
</label>
<label class="colors rad-bg-orange">
<input type="radio" name="color" value="orange" />
</label>
<label class="colors rad-bg-twitter">
<input type="radio" name="color" value="twitter" />
</label>
</div>
</div>
<div class="rad-notification-body">
<div class="lg-text">Child Profiles (Colour-Coded)</div>
<div class="sm-text"></div>
</div>
</li>
</ul>
</li>
</ul>
<ul class="pull-right links">
<li>
<a class="rad-menu-item" href="#"><i class="fa fa-comment-o"><span class="rad-menu-badge rad-bg-success">0</span></i></a>
</li>
<li class="rad-dropdown"><a class="rad-menu-item" href="#"><i class="fa fa-envelope-o"><span class="rad-menu-badge rad-bg-primary">23</span></i></a>
<ul class="rad-dropmenu-item">
<li class="rad-dropmenu-header"><a href="#">Your Notifications</a></li>
<li class="rad-notification-item text-left">
<a class="rad-notification-content" href="#">
<div class="pull-left"><i class="fa fa-html5 fa-2x"></i>
</div>
<div class="rad-notification-body">
<div class="lg-text">Results from parental control report</div>
<div class="sm-text">Report inappropriate content to authorities</div>
</div>
</a>
</li>
<li class="rad-notification-item text-left">
<a class="rad-notification-content" href="#">
<div class="pull-left"><i class="fa fa-bitbucket fa-2x"></i>
</div>
<div class="rad-notification-body">
<div class="lg-text">RE: Emergency SMS message from Child1</div>
<div class="sm-text">Urgent</div>
</div>
</a>
</li>
<li class="rad-notification-item text-left">
<a class="rad-notification-content" href="#">
<div class="pull-left"><i class="fa fa-google fa-2x"></i>
</div>
<div class="rad-notification-body">
<div class="lg-text">Contact Information</div>
<div class="sm-text">low.lucyy@gmail.com</div>
</div>
</a>
</li>
<li class="rad-dropmenu-footer"><a href="#">See all notifications</a></li>
</ul>
</li>
<li class="rad-dropdown"><a class="rad-menu-item" href="#"><i class="fa fa-bell-o"><span class="rad-menu-badge">49</span></i></a>
<ul class="rad-dropmenu-item">
<li class="rad-dropmenu-header"><a href="#">Alerts</a></li>
<li class="rad-notification-item text-left">
<a class="rad-notification-content" href="#">
<div class="pull-left"><i class="fa fa-html5 fa-2x"></i>
</div>
<div class="rad-notification-body">
<div class="lg-text">Results from email, text, photo, and video computer vision scan report</div>
<div class="sm-text">Social media monitoring activated</div>
<em class="pull-right sm-text"><i class="fa fa-clock-o"></i> 2 sec ago</em>
</div>
</a>
</li>
<li class="rad-notification-item text-left">
<a class="rad-notification-content" href="#">
<div class="pull-left"><i class="fa fa-bitbucket fa-2x"></i>
</div>
<div class="rad-notification-body">
<div class="lg-text"> Parental alerts with recommendations</div>
<div class="sm-text">Connect with child psychologist</div>
<em class="pull-right sm-text"><i class="fa fa-clock-o"></i> 49 mins ago</em>
</div>
</a>
</li>
<li class="rad-notification-item text-left">
<a class="rad-notification-content" href="#">
<div class="pull-left"><i class="fa fa-google fa-2x"></i>
</div>
<div class="rad-notification-body">
<div class="lg-text">Contact information</div>
<div class="sm-text">low.lucyy@gmail.com</div>
<em class="pull-right sm-text"><i class="fa fa-clock-o"></i> 2 days ago</em>
</div>
</a>
</li>
<li class="rad-dropmenu-footer"><a href="#">See all alerts</a></li>
</ul>
</li>
</ul>
</div>
</nav>
</header>
</section>
<aside>
<nav class="rad-sidebar rad-nav-min">
<ul>
<li>
<a href="" class="inbox">
<i class="fa fa-dashboard"><span class="icon-bg rad-bg-success"></span></i>
<span class="rad-sidebar-item">Parental Dashboard</span>
</a>
</li>
<li>
<a href="#">
<i class="fa fa-bar-chart-o">
<span class="icon-bg rad-bg-danger"></span>
</i>
<span class="rad-sidebar-item">Content Filter</span>
</a>
</li>
<li><a href="#" class="snooz"><i class="fa fa-line-chart"><span class="icon-bg rad-bg-primary"></span></i><span class="rad-sidebar-item">Child Monitoring</span></a></li>
<li><a href="#" class="done"><i class="fa fa-area-chart"><span class="icon-bg rad-bg-warning"></span></i><span class="rad-sidebar-item"> safety Recommendations</span></a></li>
<li>
<a href="#">
<i class="fa fa-wrench"><span class="icon-bg rad-bg-violet"></span></i>
<span class="rad-sidebar-item">Reporting TOOL </span>
</a>
</li>
</ul>
</nav>
</aside>
<main>
<section>
<div class="rad-body-wrapper rad-nav-min">
<div class="container-fluid">
<header class="rad-page-title">
<span>Hi Lucy. Welcome to your data-driven parental control dashboard:</span>
<small class="md-txt"> <a href="https://www.google.com/maps/place/3720+Emerald+St,+Torrance,+CA+90503/@33.8403836,-118.3543828,17z/data=!4m18!1m15!4m14!1m6!1m2!1s0x80c2b4d407f58b11:0xdedca55964c89054!2s3720+Emerald+St,+Torrance,+CA+90503!2m2!1d-118.3520761!2d33.8403792!1m6!1m2!1s0x80c2b4d407f58b11:0xdedca55964c89054!2s3720+Emerald+St,+Torrance,+CA+90503!2m2!1d-118.3520761!2d33.8403792!3m1!1s0x80c2b4d407f58b11:0xdedca55964c89054" target="_blank"><i class="fa fa-map-marker rad-txt-danger"></i> GPS Location</a></small> </header>
<div class="row">
<div class="col-lg-3 col-xs-6">
<div class="rad-info-box rad-txt-success">
<span class="heading"></span>
<span class="value"><span>Total Content Blocked</span></span>
</div>
</div>
<div class="col-lg-3 col-xs-6">
<div class="rad-info-box rad-txt-primary">
<span class="heading"></span>
<span class="value"><span>Access Requests</span></span>
</div>
</div>
<div class="col-lg-3 col-xs-6">
<div class="rad-info-box rad-txt-danger">
<span class="heading"> <Button:disabled></Button:disabled></span>
<span class="value"><span>Alerts/Notifications</span></span>
</div>
</div>
<div class="col-lg-3 col-xs-6">
<div class="rad-info-box">
<span class="heading"></span>
<span class="value"><span>Child Device Usage</span></span>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"> Child Location tracking with Safe area Geo-fencing <ul class="rad-panel-action">
<li><i class="fa fa-chevron-down"></i></li>
<li><i class="fa fa-rotate-right"></i></li>
<li><i class="fa fa-cog"></i>
<li><i class="fa fa-close"></i>
</li>
</ul></h3>
</div>
<div class="panel-body rad-map-container">
<div id="world-map" class="rad-map"></div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-6">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">online Search history classification<ul class="rad-panel-action">
<li><i class="fa fa-chevron-down"></i></li>
<li><i class="fa fa-rotate-right"></i></li>
<li><i class="fa fa-cog"></i>
<li><i class="fa fa-close"></i>
</li>
</ul></h3>
</div>
<div class="panel-body">
<div id="areaChart" class="rad-chart"></div>
</div>
</div>
</div>
<div class="col-xs-12 col-md-6">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"> RISKY BEHAVIOR identification<ul class="rad-panel-action">
<li><i class="fa fa-chevron-down"></i></li>
<li><i class="fa fa-rotate-right"></i></li>
<li><i class="fa fa-cog"></i>
<li><i class="fa fa-close"></i>
</li>
</ul></h3>
</div>
<div class="panel-body">
<div id="areaChart2" class="rad-chart"></div>
</div>
</div>
</div>
<div class="col-lg-3 col-md-4 col-xs-12">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Alerts and Notifications<ul class="rad-panel-action">
<li><i class="fa fa-chevron-down"></i></li>
<li><i class="fa fa-rotate-right"></i></li>
<li><i class="fa fa-close"></i>
</li>
</ul></h3>
</div>
<div class="panel-body">
<div class="rad-activity-body">
<div class="rad-list-group group">
<div class="rad-list-group-item">
<div class="rad-list-icon icon-shadow rad-bg-danger pull-left"><i class="fa fa-phone"></i></div>
<div class="rad-list-content"><strong>Emergency Call from UNICEF</strong>
</div>
</div>
<div class="rad-list-group-item">
<div class="rad-list-icon icon-shadow rad-bg-primary pull-left"><i class="fa fa-refresh"></i></div>
<div class="rad-list-content"><strong>AI Scan scheduled</strong>
</div>
</div>
<div class="rad-list-group-item">
<div class="rad-list-icon icon-shadow rad-bg-success pull-left"><i class="fa fa-check"></i></div>
<div class="rad-list-content"><strong>Child psychologist assigned to check results</strong>
<div class="md-text"></div>
</div>
</div>
<div class="rad-list-group-item">
<div class="rad-list-icon icon-shadow rad-bg-violet pull-left"><i class="fa fa-envelope"></i></div>
<div class="rad-list-content"><strong>Diagnosis for child's risky behaviour </strong>
<div class="md-text"> </div>
</div>
</div>
<div class="rad-list-group-item">
<div class="rad-list-icon icon-shadow rad-bg-success pull-left"><i class="fa fa-pencil"></i></div>
<div class="rad-list-content"><strong>Customized online security plan</strong>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-3 col-md-8 col-xs-12">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Content Objects (audio, video, rich text, or pure web HTML)
<ul class="rad-panel-action">
<li><i class="fa fa-chevron-down"></i></li>
<li><i class="fa fa-rotate-right"></i></li>
<li><i class="fa fa-cog"></i>
<li><i class="fa fa-close"></i>
</li>
</ul></h3>
</div>
<div class="panel-body">
<div id="donutChart" class="rad-chart"></div>
</div>
</div>
</div>
<div class="col-lg-6 col-md-12 col-xs-12">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Privacy Protection and Identity Theft risk management<ul class="rad-panel-action">
<li><i class="fa fa-chevron-down"></i></li>
<li><i class="fa fa-rotate-right"></i></li>
<li><i class="fa fa-cog"></i>
<li><i class="fa fa-close"></i>
</li>
</ul></h3>
</div>
<div class="panel-body">
<div id="lineChart" class="rad-chart"></div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6 col-lg-12">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Screen time management
(Schedule online time for child with daily/weekly allowance)<ul class="rad-panel-action">
<li><i class="fa fa-chevron-down"></i></li>
<li><i class="fa fa-rotate-right"></i></li>
<li><i class="fa fa-cog"></i>
<li><i class="fa fa-close"></i>
</li>
</ul></h3>
</div>
<div class="panel-body">
<div id="barChart3" class="rad-chart"></div>
</div>
</div>
</div>
<div class="col-md-6 col-lg-6">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"> low battery alerts (child's phone needs charging) <ul class="rad-panel-action">
<li><i class="fa fa-chevron-down"></i></li>
<li><i class="fa fa-rotate-right"></i></li>
<li><i class="fa fa-cog"></i>
<li><i class="fa fa-close"></i>
</li>
</ul></h3>
</div>
<div class="panel-body">
<div id="barChart2" class="rad-chart"></div>
</div>
</div>
</div>
<div class="col-md-12 col-lg-6">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">block internet access based on age-restriction and category <ul class="rad-panel-action">
<li><i class="fa fa-chevron-down"></i></li>
<li><i class="fa fa-rotate-right"></i></li>
<li><i class="fa fa-cog"></i>
<li><i class="fa fa-close"></i>
</li>
</ul></h3>
</div>
<div class="panel-body">
<div id="barChart" class="rad-chart"></div>
</div>
</div>
</div>
<div class="col-md-6 col-lg-4">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"> Monitor child's sms texting and social media chats<ul class="rad-panel-action">
<li><i class="fa fa-chevron-down"></i></li>
<li><i class="fa fa-close"></i>
</li>
</ul></h3>
</div>
<div class="panel-body">
<div class="rad-chat-body">
<div class="rad-list-group">
<div class="rad-list-group-item left">
<span class="rad-list-icon pull-left"><img class="rad-list-img" src="https://i.ibb.co/7nMzCX1/Screen-Shot-2021-03-22-at-11-01-06-PM.png" alt="me" /></span>
<div class="rad-list-content rad-chat">
<span class="lg-text">Me</span>
<span class="sm-text"><i class="fa fa-clock-o"></i> 11:20 pm</span>
<div class="rad-chat-msg">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur bibendum ornare dolor, quis ullamcorper ligula sodales at.</div>
</div>
</div>
<div class="rad-list-group-item right">
<span class="rad-list-icon pull-right"><img class="rad-list-img" src="https://i.ibb.co/8NYrH6f/Screen-Shot-2021-03-23-at-12-37-14-AM.png" alt=""></span>
<div class="rad-list-content rad-chat">
<span class="lg-text">Child</span>
<span class="sm-text"><i class="fa fa-clock-o"></i> 11:30 pm</span>
<div class="rad-chat-msg">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</div>
</div>
</div>
<div class="rad-list-group-item left">
<span class="rad-list-icon pull-left"><img class="rad-list-img" src="https://i.ibb.co/7nMzCX1/Screen-Shot-2021-03-22-at-11-01-06-PM.png" alt="me" /></span>
<div class="rad-list-content rad-chat">
<span class="lg-text">Me</span>
<span class="sm-text"><i class="fa fa-clock-o"></i> 11:31 pm</span>
<div class="rad-chat-msg">Curabitur bibendum ornare dolor, quis ullamcorper ligula sodales at. <i class="fa fa-smile-o rad-txt-warning"></i></div>
</div>
</div>
<div class="rad-list-group-item left">
<span class="rad-list-icon pull-left"><img class="rad-list-img" src="https://i.ibb.co/7nMzCX1/Screen-Shot-2021-03-22-at-11-01-06-PM.png" alt="me" /></span>
<div class="rad-list-content rad-chat">
<span class="lg-text">Me</span>
<span class="sm-text"><i class="fa fa-clock-o"></i> 11:20 pm</span>
<div class="rad-chat-msg">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur bibendum ornare dolor, quis ullamcorper ligula sodales at.</div>
</div>
</div>
<div class="rad-list-group-item right">
<span class="rad-list-icon pull-right"><img class="rad-list-img" src="https://i.ibb.co/8NYrH6f/Screen-Shot-2021-03-23-at-12-37-14-AM.png" alt=""></span>
<div class="rad-list-content rad-chat">
<span class="lg-text">Child</span>
<span class="sm-text"><i class="fa fa-clock-o"></i> 11:30 pm</span>
<div class="rad-chat-msg">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</div>
</div>
</div>
<div class="rad-list-group-item left">
<span class="rad-list-icon pull-left"><img class="rad-list-img" src="https://i.ibb.co/7nMzCX1/Screen-Shot-2021-03-22-at-11-01-06-PM.png" alt="me" /></span>
<div class="rad-list-content rad-chat">
<span class="lg-text">Me</span>
<span class="sm-text"><i class="fa fa-clock-o"></i> 11:31 pm</span>
<div class="rad-chat-msg">Curabitur bibendum ornare dolor, quis ullamcorper ligula sodales at. <i class="fa fa-smile-o rad-txt-warning"></i></div>
</div>
</div>
</div>
</div>
</div>
<div class="panel-footer">
<div class="input-group">
<input type="text" id="rad-chat-txt" placeholder="Type a message" class="form-control" /><span class="input-group-btn"><button id="rad-chat-send" class="btn btn-info">Send</button></span>
</div>
</div>
</div>
</div>
<div class="col-md-6 col-lg-4">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"> Child school Time table <ul class="rad-panel-action">
<li><i class="fa fa-chevron-down"></i></li>
<li><i class="fa fa-close"></i>
</li>
</ul></h3>
</div>
<div class="panel-body">
<div class="rad-timeline-body">
<ul class="rad-timeline">
<li class="rad-timeline-item">
<div class="rad-timeline-badge rad-bg-danger"><i class="fa fa-signal"></i><span class="pull-right"><i class="fa fa-clock-o"></i> 28m ago</span></div>
<div class="rad-timeline-panel pull-right">Donec id risus convallis, tempor sapien eu, feugiat justo. Nulla luctus ut libero nec aliquet. Mauris non mollis justo. Quisque ac dignissim nulla.</div>
</li>
<li class="rad-timeline-item">
<div class="rad-timeline-badge rad-bg-success"><i class="fa fa-rocket"></i><span class="pull-left"><i class="fa fa-clock-o"></i> 23m ago</span></div>
<div class="rad-timeline-panel ">Nulla eu maximus enim. </div>
</li>
<li class="rad-timeline-item">
<div class="rad-timeline-badge rad-bg-warning"><i class="fa fa-linux"></i><span class="pull-right"><i class="fa fa-clock-o"></i> 13m ago</span></div>
<div class="rad-timeline-panel pull-right">Aliquam commodo odio mi, pulvinar volutpat sem tempor ut. </div>
</li>
<li class="rad-timeline-item">
<div class="rad-timeline-badge rad-bg-violet"><i class="fa fa-stack-overflow"></i><span class="pull-left"><i class="fa fa-clock-o"></i> 13m ago</span></div>
<div class="rad-timeline-panel ">In convallis velit ac arcu volutpat euismod. Vestibulum ultricies nisi et nunc maximus dictum. Mauris id viverra erat. Aliquam varius venenatis enim a blandit. Donec id risus convallis, tempor sapien eu, feugiat justo. </div>
</li>
<li class="rad-timeline-item">
<div class="rad-timeline-badge rad-bg-danger"><i class="fa fa-wordpress"></i><span class="pull-right"><i class="fa fa-clock-o"></i> 7m ago</span></div>
<div class="rad-timeline-panel pull-right">Nulla luctus ut libero nec aliquet. Mauris non mollis justo. Quisque ac dignissim nulla.</div>
</li>
</ul>
</div>
</div>
<div class="panel-footer">
<div class="rad-timeline-footer">
<p></p>
<p class="pull-right"><i class="fa fa-comments-o"></i></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</main>
<!-- partial -->
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.min.js'></script>
<script src='https://code.jquery.com/ui/1.11.4/jquery-ui.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/jQuery-slimScroll/1.3.3/jquery.slimscroll.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.8.0/lodash.min.js'></script>
<script src='https://jvectormap.com/js/jquery-jvectormap-2.0.5.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/jvectormap/2.0.3/jquery-jvectormap.js'></script>
<script src='https://jvectormap.com/js/jquery-jvectormap-world-mill.js'></script><script src="./script.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@1.3.1/dist/tf.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@teachablemachine/image@0.8.3/dist/teachablemachine-image.min.js"></script>
</body>
</html>
| 46.510989 | 540 | 0.56267 |
c3349dbfd99cd010c6ee0f3c564c9e4e7c659af6 | 679 | swift | Swift | southsystem-desafio/Model/DetalhesEvento/DetalhesEventoModel.swift | joaoduartemariucio/South-Events | 827c7440a95fa6f5fcc214be06e3eb14be0726ae | [
"Unlicense"
] | null | null | null | southsystem-desafio/Model/DetalhesEvento/DetalhesEventoModel.swift | joaoduartemariucio/South-Events | 827c7440a95fa6f5fcc214be06e3eb14be0726ae | [
"Unlicense"
] | null | null | null | southsystem-desafio/Model/DetalhesEvento/DetalhesEventoModel.swift | joaoduartemariucio/South-Events | 827c7440a95fa6f5fcc214be06e3eb14be0726ae | [
"Unlicense"
] | null | null | null | //
// DetalhesEventoModel.swift
// southsystem-desafio
//
// Created by João Vitor Duarte Mariucio on 13/04/21.
//
import Foundation
class DetalhesEventoModel {
var eventoId: String
var detalhes: EventoModelElement?
init(eventoId: String) {
self.eventoId = eventoId
}
init() {
eventoId = "0"
}
func setEventoId(id: String){
self.eventoId = id
}
func setEventoDetalhes(_ detalhes: EventoModelElement) {
self.detalhes = detalhes
}
var description: String {
return "<\(type(of: self)): eventId = \(eventoId) detalhes = \(detalhes?.description ?? "nil")>"
}
}
| 19.4 | 104 | 0.596465 |
048e423ddb14f9619e7ebe9a982711805f06f843 | 899 | java | Java | src/utemezo/EventDispatcher.java | szaszm-homeworks/opre-hf1-utemezo | 1f1a40b0101d9d4f1c76271de24adbbfcc4bee65 | [
"Unlicense"
] | null | null | null | src/utemezo/EventDispatcher.java | szaszm-homeworks/opre-hf1-utemezo | 1f1a40b0101d9d4f1c76271de24adbbfcc4bee65 | [
"Unlicense"
] | null | null | null | src/utemezo/EventDispatcher.java | szaszm-homeworks/opre-hf1-utemezo | 1f1a40b0101d9d4f1c76271de24adbbfcc4bee65 | [
"Unlicense"
] | null | null | null | package utemezo;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
/**
* Created by marci on 2017.03.31..
*/
public class EventDispatcher {
private Map<Class, ArrayList> listeners;
public EventDispatcher() {
listeners = new HashMap<>();
}
public <E> void listen(Class<E> eventType, EventListener<E> listener) {
if(!listeners.containsKey(eventType)) {
ArrayList<EventListener<E>> al = new ArrayList<>();
al.add(listener);
listeners.put(eventType, al);
} else {
listeners.get(eventType).add(listener);
}
}
public <E> void dispatch(E event) {
Class<E> eClass = (Class<E>) event.getClass();
ArrayList<EventListener<E>> listeners = (ArrayList<EventListener<E>>)this.listeners.get(eClass);
listeners.forEach(l -> l.handleEvent(event));
}
}
| 27.242424 | 104 | 0.621802 |
806cf971a31dde1be19cc92e8610f1fe4ffb096c | 15,240 | java | Java | core/src/main/java/com/github/ompc/greys/core/server/GaServer.java | ilaotan/greys-anatomy_Java_online_zhenduan | 383d17d4dbc2f0cfcf73ce5b1477204b86f1992a | [
"Apache-2.0"
] | 4,071 | 2015-02-24T15:43:06.000Z | 2022-03-29T22:44:31.000Z | core/src/main/java/com/github/ompc/greys/core/server/GaServer.java | ilaotan/greys-anatomy_Java_online_zhenduan | 383d17d4dbc2f0cfcf73ce5b1477204b86f1992a | [
"Apache-2.0"
] | 228 | 2015-03-05T05:22:00.000Z | 2020-11-29T11:42:26.000Z | core/src/main/java/com/github/ompc/greys/core/server/GaServer.java | ilaotan/greys-anatomy_Java_online_zhenduan | 383d17d4dbc2f0cfcf73ce5b1477204b86f1992a | [
"Apache-2.0"
] | 1,255 | 2015-02-27T05:51:26.000Z | 2022-03-31T11:46:26.000Z | package com.github.ompc.greys.core.server;
import com.github.ompc.greys.core.ClassDataSource;
import com.github.ompc.greys.core.Configure;
import com.github.ompc.greys.core.manager.ReflectManager;
import com.github.ompc.greys.core.manager.TimeFragmentManager;
import com.github.ompc.greys.core.util.GaCheckUtils;
import com.github.ompc.greys.core.util.LogUtil;
import org.slf4j.Logger;
import java.io.IOException;
import java.lang.instrument.Instrumentation;
import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import java.nio.channels.*;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Iterator;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.atomic.AtomicBoolean;
import static com.github.ompc.greys.core.server.LineDecodeState.READ_CHAR;
import static com.github.ompc.greys.core.server.LineDecodeState.READ_EOL;
import static com.github.ompc.greys.core.util.GaStringUtils.getLogo;
import static java.nio.channels.SelectionKey.OP_ACCEPT;
import static java.nio.channels.SelectionKey.OP_READ;
import static org.apache.commons.io.IOUtils.closeQuietly;
/**
* GaServer操作的附件
* Created by oldmanpushcart@gmail.com on 15/5/3.
*/
class GaAttachment {
private final int bufferSize;
private final Session session;
private LineDecodeState lineDecodeState;
private ByteBuffer lineByteBuffer;
GaAttachment(int bufferSize, Session session) {
this.lineByteBuffer = ByteBuffer.allocate(bufferSize);
this.bufferSize = bufferSize;
this.lineDecodeState = READ_CHAR;
this.session = session;
}
public LineDecodeState getLineDecodeState() {
return lineDecodeState;
}
public void setLineDecodeState(LineDecodeState lineDecodeState) {
this.lineDecodeState = lineDecodeState;
}
public void put(byte data) {
if (lineByteBuffer.hasRemaining()) {
lineByteBuffer.put(data);
} else {
final ByteBuffer newLineByteBuffer = ByteBuffer.allocate(lineByteBuffer.capacity() + bufferSize);
lineByteBuffer.flip();
newLineByteBuffer.put(lineByteBuffer);
newLineByteBuffer.put(data);
this.lineByteBuffer = newLineByteBuffer;
}
}
public String clearAndGetLine(Charset charset) {
lineByteBuffer.flip();
final byte[] dataArray = new byte[lineByteBuffer.limit()];
lineByteBuffer.get(dataArray);
final String line = new String(dataArray, charset);
lineByteBuffer.clear();
return line;
}
public Session getSession() {
return session;
}
}
/**
* 行解码
*/
enum LineDecodeState {
// 读字符
READ_CHAR,
// 读换行
READ_EOL
}
/**
* Greys 服务端<br/>
* Created by oldmanpushcart@gmail.com on 15/5/2.
*/
public class GaServer {
private final Logger logger = LogUtil.getLogger();
private static final int BUFFER_SIZE = 4 * 1024;
private static final Charset DEFAULT_CHARSET = Charset.forName("UTF-8");
private static final byte CTRL_D = 0x04;
private static final byte CTRL_X = 0x18;
private static final byte EOT = 0x04;
private static final int EOF = -1;
private final AtomicBoolean isBindRef = new AtomicBoolean(false);
private final SessionManager sessionManager;
private final CommandHandler commandHandler;
private final int javaPid;
private final Thread jvmShutdownHooker = new Thread("ga-shutdown-hooker") {
@Override
public void run() {
GaServer.this._destroy();
}
};
private final ExecutorService executorService = Executors.newCachedThreadPool(new ThreadFactory() {
@Override
public Thread newThread(Runnable r) {
final Thread t = new Thread(r, "ga-command-execute-daemon");
t.setDaemon(true);
return t;
}
});
private GaServer(int javaPid, Instrumentation inst) {
this.javaPid = javaPid;
this.sessionManager = new DefaultSessionManager();
this.commandHandler = new DefaultCommandHandler(this, inst);
initForManager(inst);
Runtime.getRuntime().addShutdownHook(jvmShutdownHooker);
}
/*
* 初始化各种manager
*/
private void initForManager(final Instrumentation inst) {
TimeFragmentManager.Factory.getInstance();
ReflectManager.Factory.initInstance(new ClassDataSource() {
@Override
public Collection<Class<?>> allLoadedClasses() {
final Class<?>[] classArray = inst.getAllLoadedClasses();
return null == classArray
? new ArrayList<Class<?>>()
: Arrays.asList(classArray);
}
});
}
/**
* 判断服务端是否已经启动
*
* @return true:服务端已经启动;false:服务端关闭
*/
public boolean isBind() {
return isBindRef.get();
}
private ServerSocketChannel serverSocketChannel = null;
private Selector selector = null;
/**
* 启动Greys服务端
*
* @param configure 配置信息
* @throws IOException 服务器启动失败
*/
public void bind(Configure configure) throws IOException {
if (!isBindRef.compareAndSet(false, true)) {
throw new IllegalStateException("already bind");
}
try {
serverSocketChannel = ServerSocketChannel.open();
selector = Selector.open();
serverSocketChannel.configureBlocking(false);
serverSocketChannel.socket().setSoTimeout(configure.getConnectTimeout());
serverSocketChannel.socket().setReuseAddress(true);
serverSocketChannel.register(selector, OP_ACCEPT);
// 服务器挂载端口
serverSocketChannel.socket().bind(getInetSocketAddress(configure.getTargetIp(), configure.getTargetPort()), 24);
logger.info("ga-server listening on network={};port={};timeout={};", configure.getTargetIp(),
configure.getTargetPort(),
configure.getConnectTimeout());
activeSelectorDaemon(selector, configure);
} catch (IOException e) {
unbind();
throw e;
}
}
/*
* 获取绑定网络地址信息<br/>
* 这里做个小修正,如果targetIp为127.0.0.1(本地环回口),则需要绑定所有网卡
* 否则外部无法访问,只能通过127.0.0.1来进行了
*/
private InetSocketAddress getInetSocketAddress(String targetIp, int targetPort) {
if (GaCheckUtils.isEquals("127.0.0.1", targetIp)) {
return new InetSocketAddress(targetPort);
} else {
return new InetSocketAddress(targetIp, targetPort);
}
}
private void activeSelectorDaemon(final Selector selector, final Configure configure) {
final ByteBuffer byteBuffer = ByteBuffer.allocate(BUFFER_SIZE);
final Thread gaServerSelectorDaemon = new Thread("ga-selector-daemon") {
@Override
public void run() {
while (!isInterrupted()
&& isBind()) {
try {
while (selector.isOpen()
&& selector.select() > 0) {
final Iterator<SelectionKey> it = selector.selectedKeys().iterator();
while (it.hasNext()) {
final SelectionKey key = it.next();
it.remove();
// do ssc accept
if (key.isValid() && key.isAcceptable()) {
doAccept(key, selector, configure);
}
// do sc read
if (key.isValid() && key.isReadable()) {
doRead(byteBuffer, key);
}
}
}
} catch (IOException e) {
logger.warn("selector failed.", e);
} catch (ClosedSelectorException e) {
logger.debug("selector closed.", e);
}
}
}
};
gaServerSelectorDaemon.setDaemon(true);
gaServerSelectorDaemon.start();
}
private void doAccept(SelectionKey key, Selector selector, Configure configure) throws IOException {
final ServerSocketChannel serverSocketChannel = (ServerSocketChannel) key.channel();
acceptSocketChannel(selector, serverSocketChannel, configure);
}
private SocketChannel acceptSocketChannel(Selector selector, ServerSocketChannel serverSocketChannel, Configure configure) throws IOException {
final SocketChannel socketChannel = serverSocketChannel.accept();
socketChannel.configureBlocking(false);
socketChannel.socket().setSoTimeout(configure.getConnectTimeout());
socketChannel.socket().setTcpNoDelay(true);
final Session session = sessionManager.newSession(javaPid, socketChannel, DEFAULT_CHARSET);
socketChannel.register(selector, OP_READ, new GaAttachment(BUFFER_SIZE, session));
logger.info("accept new connection, client={}@session[{}]", socketChannel, session.getSessionId());
if (!session.isSilent()) {
// 这里输出Logo
writeToSocketChannel(socketChannel, session.getCharset(), getLogo());
// 绘制提示符
writeToSocketChannel(socketChannel, session.getCharset(), session.prompt());
// Logo结束之后输出传输中止符
writeToSocketChannel(socketChannel, ByteBuffer.wrap(new byte[]{EOT}));
}
return socketChannel;
}
private void doRead(final ByteBuffer byteBuffer, SelectionKey key) {
final GaAttachment attachment = (GaAttachment) key.attachment();
final SocketChannel socketChannel = (SocketChannel) key.channel();
final Session session = attachment.getSession();
try {
// 若读到EOF,则说明SocketChannel已经关闭
if (EOF == socketChannel.read(byteBuffer)) {
logger.info("client={}@session[{}] was closed.", socketChannel, session.getSessionId());
// closeSocketChannel(key, socketChannel);
session.destroy();
if(session.isLocked()) {
session.unLock();
}
return;
}
// decode for line
byteBuffer.flip();
while (byteBuffer.hasRemaining()) {
switch (attachment.getLineDecodeState()) {
case READ_CHAR: {
final byte data = byteBuffer.get();
if ('\n' == data) {
attachment.setLineDecodeState(READ_EOL);
}
// 遇到中止命令(CTRL_D),则标记会话为不可写,让后台任务停下
else if (CTRL_D == data
|| CTRL_X == data) {
session.unLock();
break;
}
// 普通byte则持续放入到缓存中
else {
if ('\r' != data) {
attachment.put(data);
}
break;
}
}
case READ_EOL: {
final String line = attachment.clearAndGetLine(session.getCharset());
executorService.execute(new Runnable() {
@Override
public void run() {
// 会话只有未锁定的时候才能响应命令
if (session.tryLock()) {
try {
// 命令执行
commandHandler.executeCommand(line, session);
// 命令结束之后需要传输EOT告诉client命令传输已经完结,可以展示提示符
socketChannel.write(ByteBuffer.wrap(new byte[]{EOT}));
} catch (IOException e) {
logger.info("network communicate failed, session[{}] will be close.",
session.getSessionId());
session.destroy();
} finally {
session.unLock();
}
} else {
logger.info("session[{}] was locked, ignore this command.",
session.getSessionId());
}
}
});
attachment.setLineDecodeState(READ_CHAR);
break;
}
}
}//while for line decode
byteBuffer.clear();
}
// 处理
catch (IOException e) {
logger.warn("read/write data failed, session[{}] will be close.", session.getSessionId(), e);
closeSocketChannel(key, socketChannel);
session.destroy();
}
}
private void writeToSocketChannel(SocketChannel socketChannel, Charset charset, String message) throws IOException {
writeToSocketChannel(socketChannel, ByteBuffer.wrap(message.getBytes(charset)));
}
private void writeToSocketChannel(SocketChannel socketChannel, ByteBuffer buffer) throws IOException {
while (buffer.hasRemaining()) {
socketChannel.write(buffer);
}
}
private void closeSocketChannel(SelectionKey key, SocketChannel socketChannel) {
closeQuietly(socketChannel);
key.cancel();
}
/**
* 关闭Greys服务端
*/
public void unbind() {
closeQuietly(serverSocketChannel);
closeQuietly(selector);
if (!isBindRef.compareAndSet(true, false)) {
throw new IllegalStateException("already unbind");
}
}
private void _destroy() {
if (isBind()) {
unbind();
}
if (!sessionManager.isDestroy()) {
sessionManager.destroy();
}
executorService.shutdown();
logger.info("ga-server destroy completed.");
}
public void destroy() {
Runtime.getRuntime().removeShutdownHook(jvmShutdownHooker);
_destroy();
}
private static volatile GaServer gaServer;
/**
* 单例
*
* @param instrumentation JVM增强
* @return GaServer单例
*/
public static GaServer getInstance(final int javaPid, final Instrumentation instrumentation) {
if (null == gaServer) {
synchronized (GaServer.class) {
if (null == gaServer) {
gaServer = new GaServer(javaPid, instrumentation);
}
}
}
return gaServer;
}
}
| 32.564103 | 147 | 0.561549 |
2f3eb3ec46a31bb92c18b069920ebc47a3d315c8 | 4,205 | cs | C# | src/Bitmovin.Api.Sdk/Encoding/Inputs/RedundantRtmp/RedundantRtmpApi.cs | bitmovin/bitmovin-api-sdk-dotnet | 8a1f0fc319f964f8a5c82abf169fb4919e737d2a | [
"MIT"
] | 8 | 2020-01-09T20:22:33.000Z | 2022-03-06T22:16:18.000Z | src/Bitmovin.Api.Sdk/Encoding/Inputs/RedundantRtmp/RedundantRtmpApi.cs | bitmovin/bitmovin-api-sdk-dotnet | 8a1f0fc319f964f8a5c82abf169fb4919e737d2a | [
"MIT"
] | 1 | 2020-10-12T08:36:41.000Z | 2020-10-12T14:19:15.000Z | src/Bitmovin.Api.Sdk/Encoding/Inputs/RedundantRtmp/RedundantRtmpApi.cs | bitmovin/bitmovin-api-sdk-dotnet | 8a1f0fc319f964f8a5c82abf169fb4919e737d2a | [
"MIT"
] | 4 | 2020-02-04T10:10:18.000Z | 2021-07-01T12:25:11.000Z | using System;
using System.Collections;
using System.Collections.Generic;
using System.Threading.Tasks;
using RestEase;
using Bitmovin.Api.Sdk.Common;
namespace Bitmovin.Api.Sdk.Encoding.Inputs.RedundantRtmp
{
public class RedundantRtmpApi
{
private readonly IRedundantRtmpApiClient _apiClient;
public RedundantRtmpApi(IBitmovinApiClientFactory apiClientFactory)
{
_apiClient = apiClientFactory.CreateClient<IRedundantRtmpApiClient>();
}
/// <summary>
/// Fluent builder for creating an instance of RedundantRtmpApi
/// </summary>
public static BitmovinApiBuilder<RedundantRtmpApi> Builder => new BitmovinApiBuilder<RedundantRtmpApi>();
/// <summary>
/// Create Redundant RTMP Input
/// </summary>
/// <param name="redundantRtmpInput">The Redundant RTMP input to be created</param>
public async Task<Models.RedundantRtmpInput> CreateAsync(Models.RedundantRtmpInput redundantRtmpInput)
{
return await _apiClient.CreateAsync(redundantRtmpInput);
}
/// <summary>
/// Delete Redundant RTMP Input
/// </summary>
/// <param name="inputId">Id of the input (required)</param>
public async Task<Models.BitmovinResponse> DeleteAsync(string inputId)
{
return await _apiClient.DeleteAsync(inputId);
}
/// <summary>
/// Redundant RTMP Input Details
/// </summary>
/// <param name="inputId">Id of the input (required)</param>
public async Task<Models.RedundantRtmpInput> GetAsync(string inputId)
{
return await _apiClient.GetAsync(inputId);
}
/// <summary>
/// List Redundant RTMP Inputs
/// </summary>
/// <param name="queryParams">The query parameters for sorting, filtering and paging options (optional)</param>
public async Task<Models.PaginationResponse<Models.RedundantRtmpInput>> ListAsync(params Func<ListQueryParams, ListQueryParams>[] queryParams)
{
ListQueryParams q = new ListQueryParams();
foreach (var builderFunc in queryParams)
{
builderFunc(q);
}
return await _apiClient.ListAsync(q);
}
internal interface IRedundantRtmpApiClient
{
[Post("/encoding/inputs/redundant-rtmp")]
[AllowAnyStatusCode]
Task<Models.RedundantRtmpInput> CreateAsync([Body] Models.RedundantRtmpInput redundantRtmpInput);
[Delete("/encoding/inputs/redundant-rtmp/{input_id}")]
[AllowAnyStatusCode]
Task<Models.BitmovinResponse> DeleteAsync([Path("input_id")] string inputId);
[Get("/encoding/inputs/redundant-rtmp/{input_id}")]
[AllowAnyStatusCode]
Task<Models.RedundantRtmpInput> GetAsync([Path("input_id")] string inputId);
[Get("/encoding/inputs/redundant-rtmp")]
[AllowAnyStatusCode]
Task<Models.PaginationResponse<Models.RedundantRtmpInput>> ListAsync([QueryMap(SerializationMethod = QuerySerializationMethod.Serialized)] IDictionary<String, Object> queryParams);
}
public class ListQueryParams : Dictionary<string,Object>
{
/// <summary>
/// Index of the first item to return, starting at 0. Default is 0
/// </summary>
public ListQueryParams Offset(int? offset) => SetQueryParam("offset", offset);
/// <summary>
/// Maximum number of items to return. Default is 25, maximum is 100
/// </summary>
public ListQueryParams Limit(int? limit) => SetQueryParam("limit", limit);
/// <summary>
/// Filter inputs by name
/// </summary>
public ListQueryParams Name(string name) => SetQueryParam("name", name);
private ListQueryParams SetQueryParam<T>(string key, T value)
{
if (value != null)
{
this[key] = value;
}
return this;
}
}
}
}
| 36.565217 | 192 | 0.610464 |
0a2775a31b23dc37b8cac4dcb8624ae60bbd315e | 943 | h | C | jlp_wxplot/jlp_wxplot_include/jlp_wx_ipanel_utils.h | jlprieur/jlplib | 6073d7a7eb76d916662b1f8a4eb54f345cf7c772 | [
"MIT"
] | null | null | null | jlp_wxplot/jlp_wxplot_include/jlp_wx_ipanel_utils.h | jlprieur/jlplib | 6073d7a7eb76d916662b1f8a4eb54f345cf7c772 | [
"MIT"
] | null | null | null | jlp_wxplot/jlp_wxplot_include/jlp_wx_ipanel_utils.h | jlprieur/jlplib | 6073d7a7eb76d916662b1f8a4eb54f345cf7c772 | [
"MIT"
] | 1 | 2020-07-09T00:20:49.000Z | 2020-07-09T00:20:49.000Z | /*********************************************************************
* jlp_wx_ipanel_utils.h
* Miscellaneous programs used by JLP_wx_ipanel... classes
* JLP
* Version 03/08/2013
**********************************************************************/
#ifndef _jlp_wx_ipanel_utils_h
#define _jlp_wx_ipanel_utils_h
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
//#ifndef WX_PRECOMP
#include "wx/wx.h"
//#endif
int gdp_sum_circle(double *array1, int nx, int ny, double xc, double yc,
double radius, double *sum, double *npts);
int gdp_offset_correction(double *array1, double *offset1, int nx1, int ny1,
int positive);
int gdp_ffield_correction(double *array1, double *offset1, int nx1, int ny1,
int sigma_level);
int gdp_statistics(double *array1, int nx1, int ny1, double* mean,
double* sigma);
#endif
| 34.925926 | 76 | 0.572641 |
800c1427d893224519e0ea5677c8b621f2ceaa35 | 3,233 | java | Java | src/main/java/microsoft/exchange/webservices/data/property/complex/DeleteRuleOperation.java | balakrishnan-rajkumar/ews-java-api | 0229eb8172feaae060b390ef49152e577c68a86a | [
"MIT"
] | 836 | 2015-01-02T06:48:20.000Z | 2022-03-28T02:22:49.000Z | src/main/java/microsoft/exchange/webservices/data/property/complex/DeleteRuleOperation.java | balakrishnan-rajkumar/ews-java-api | 0229eb8172feaae060b390ef49152e577c68a86a | [
"MIT"
] | 624 | 2015-01-01T14:53:53.000Z | 2022-03-30T03:44:21.000Z | src/main/java/microsoft/exchange/webservices/data/property/complex/DeleteRuleOperation.java | balakrishnan-rajkumar/ews-java-api | 0229eb8172feaae060b390ef49152e577c68a86a | [
"MIT"
] | 595 | 2015-01-06T16:15:18.000Z | 2022-03-29T17:16:41.000Z | /*
* The MIT License
* Copyright (c) 2012 Microsoft Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package microsoft.exchange.webservices.data.property.complex;
import microsoft.exchange.webservices.data.core.EwsServiceXmlWriter;
import microsoft.exchange.webservices.data.core.EwsUtilities;
import microsoft.exchange.webservices.data.core.XmlElementNames;
import microsoft.exchange.webservices.data.core.enumeration.misc.XmlNamespace;
import microsoft.exchange.webservices.data.core.exception.service.local.ServiceXmlSerializationException;
import javax.xml.stream.XMLStreamException;
/**
* Represents an operation to delete an existing rule.
*/
public final class DeleteRuleOperation extends RuleOperation {
/**
* Id of the inbox rule to delete.
*/
private String ruleId;
/**
* Initializes a new instance of the
* <see cref="DeleteRuleOperation"/> class.
*/
public DeleteRuleOperation() {
super();
}
/**
* Initializes a new instance of the
* <see cref="DeleteRuleOperation"/> class.
*
* @param ruleId The Id of the inbox rule to delete.
*/
public DeleteRuleOperation(String ruleId) {
super();
this.ruleId = ruleId;
}
/**
* Gets or sets the Id of the rule to delete.
*/
public String getRuleId() {
return this.ruleId;
}
public void setRuleId(String value) {
if (this.canSetFieldValue(this.ruleId, value)) {
this.ruleId = value;
this.changed();
}
}
/**
* Writes elements to XML.
*
* @param writer the writer
* @throws XMLStreamException the XML stream exception
*/
@Override
public void writeElementsToXml(EwsServiceXmlWriter writer)
throws ServiceXmlSerializationException, XMLStreamException {
writer.writeElementValue(XmlNamespace.Types,
XmlElementNames.RuleId, this.getRuleId());
}
/**
* Validates this instance.
*/
@Override
protected void internalValidate() throws Exception {
EwsUtilities.validateParam(this.ruleId, "RuleId");
}
/**
* Gets the Xml element name of the DeleteRuleOperation object.
*/
@Override public String getXmlElementName() {
return XmlElementNames.DeleteRuleOperation;
}
}
| 30.790476 | 105 | 0.731519 |
c2e478634844584a3ff25ef804bbb24c0cdbbcb0 | 3,714 | swift | Swift | Wallety/Wallety/Presentation/Navigation/Routing/Router.swift | ankonovalov1/FinancialTracker | 1d626c8782252c9abea27af3162756874c6868c0 | [
"MIT"
] | null | null | null | Wallety/Wallety/Presentation/Navigation/Routing/Router.swift | ankonovalov1/FinancialTracker | 1d626c8782252c9abea27af3162756874c6868c0 | [
"MIT"
] | null | null | null | Wallety/Wallety/Presentation/Navigation/Routing/Router.swift | ankonovalov1/FinancialTracker | 1d626c8782252c9abea27af3162756874c6868c0 | [
"MIT"
] | null | null | null | import Foundation
import UIKit
protocol RouterProtocol {
func configure() -> UIViewController
}
extension RouterProtocol {
func sceneDelegate() -> SceneDelegate {
return UIApplication.shared.connectedScenes.first?.delegate as! SceneDelegate
}
func appDelegate() -> AppDelegate {
return UIApplication.shared.delegate as! AppDelegate
}
}
struct MainTabScreenRouter: RouterProtocol {
func configure() -> UIViewController {
let container = appDelegate().persistentContainer
let balanceCDService = BalanceCDService(container: container)
let balanceVM = BalanceVM(balanceCDService: balanceCDService)
let vc = MainTabController()
vc.setViewControllers([
MainScreenVC(balanceVM: balanceVM),
StatisticScreenVC(),
ProfileScreenVC(),
UINavigationController(rootViewController: SettingsScreenVC())
], animated: false)
return vc
}
}
struct MainScreenRouter: RouterProtocol {
func configure() -> UIViewController {
let container = appDelegate().persistentContainer
let balanceCDService = BalanceCDService(container: container)
let balanceVM = BalanceVM(balanceCDService: balanceCDService)
return MainScreenVC(balanceVM: balanceVM)
}
}
struct SplashScreenRouter: RouterProtocol {
func configure() -> UIViewController {
guard
let delegate = UIApplication.shared.connectedScenes.first?.delegate as? SceneDelegate,
let navigationController = delegate.navigationController,
let factory = delegate.routerFactory
else { return UIViewController() }
let navigator = Navigator(navigationController: navigationController, factory: factory)
let userDefaults = UserDefaultsService()
let viewModel = SplashScreenVM(navigator: navigator, userDefaults: userDefaults)
return SplashScreenVC(viewModel: viewModel)
}
}
struct StartCurrencyScreenRouter: RouterProtocol {
func configure() -> UIViewController {
guard
let delegate = UIApplication.shared.connectedScenes.first?.delegate as? SceneDelegate,
let navigationController = delegate.navigationController,
let factory = delegate.routerFactory
else { return UIViewController() }
let navigator = Navigator(navigationController: navigationController, factory: factory)
let userDefaults = UserDefaultsService()
let viewModel = StartCurrencyScreenVM(navigator: navigator, userDefaults: userDefaults)
return StartCurrencyScreenVC(viewModel: viewModel)
}
}
struct AfterLaunchScreenRouter: RouterProtocol {
func configure() -> UIViewController {
guard
let delegate = UIApplication.shared.connectedScenes.first?.delegate as? SceneDelegate,
let navigationController = delegate.navigationController,
let factory = delegate.routerFactory
else { return UIViewController() }
let navigator = Navigator(navigationController: navigationController, factory: factory)
let userDefaults = UserDefaultsService()
let container = appDelegate().persistentContainer
let balanceCDService = BalanceCDService(container: container)
let validator = BalanceValidator()
let viewModel = StartBalanceVM(navigator: navigator, userDefaults: userDefaults,
balanceCDService: balanceCDService, validator: validator)
return StartBalanceScreenVC(viewModel: viewModel)
}
}
| 34.71028 | 98 | 0.680129 |
3d1263524d5349385ff4fbc4fbfcc85d14ca51e7 | 2,172 | swift | Swift | YoongYoong/YoongYoong/Modules/Map/View/MapStoreInfoView/MapStoreInfoView.swift | YAPP-18th/iOS-Team-2-Frontend | beed821ff54b6e4e5fbbb592344d2ed13ddf7c2e | [
"Apache-2.0"
] | null | null | null | YoongYoong/YoongYoong/Modules/Map/View/MapStoreInfoView/MapStoreInfoView.swift | YAPP-18th/iOS-Team-2-Frontend | beed821ff54b6e4e5fbbb592344d2ed13ddf7c2e | [
"Apache-2.0"
] | 18 | 2021-04-04T09:32:08.000Z | 2021-07-11T16:00:18.000Z | YoongYoong/YoongYoong/Modules/Map/View/MapStoreInfoView/MapStoreInfoView.swift | YAPP-18th/iOS-Team-2-Frontend | beed821ff54b6e4e5fbbb592344d2ed13ddf7c2e | [
"Apache-2.0"
] | null | null | null | //
// MapStoreInfoView.swift
// YoongYoong
//
// Created by 손병근 on 2021/04/09.
//
import UIKit
class MapStoreInfoView: UIView {
let nameLabel = UILabel().then {
$0.font = .krTitle2
$0.text = "점포명"
}
let distanceLabel = UILabel().then {
$0.font = .krCaption2
$0.text = "100m"
$0.textColor = .systemGrayText02
}
let postCountLabel = UILabel().then {
$0.font = .krCaption2
$0.text = "| 포스트 20개"
$0.textColor = .systemGrayText02
}
let locationLabel = UILabel().then {
$0.font = .krCaption2
$0.text = "서울 송파구 송파대로 106-17"
}
override init(frame: CGRect) {
super.init(frame: frame)
configuration()
setupView()
setupLayout()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func layoutSubviews() {
super.layoutSubviews()
self.layer.cornerRadius = 16
self.layer.applySketchShadow(color: .black, alpha: 0.2, x: 0, y: 2, blur: 10, spread: 0)
}
}
extension MapStoreInfoView {
private func configuration() {
backgroundColor = .white
}
private func setupView() {
[
postCountLabel,
distanceLabel,
nameLabel,
locationLabel
].forEach {
self.addSubview($0)
}
}
private func setupLayout() {
self.snp.makeConstraints {
$0.width.equalTo(322)
$0.height.equalTo(96)
}
nameLabel.snp.makeConstraints {
$0.leading.equalTo(16)
$0.top.equalTo(16)
}
distanceLabel.snp.makeConstraints {
$0.leading.equalTo(self.snp.leading).offset(16)
$0.top.equalTo(nameLabel.snp.bottom).offset(10)
}
postCountLabel.snp.makeConstraints {
$0.leading.equalTo(distanceLabel.snp.trailing).offset(4)
$0.top.equalTo(nameLabel.snp.bottom).offset(10)
}
[postCountLabel, distanceLabel].forEach {
$0.setContentHuggingPriority(.defaultHigh, for: .horizontal)
}
locationLabel.snp.makeConstraints {
$0.leading.equalTo(self.snp.leading).offset(16)
$0.top.equalTo(distanceLabel.snp.bottom).offset(4)
}
}
private func updateView() {
}
}
| 20.111111 | 92 | 0.619705 |
39be4a3565ac031aa2ea5ac401f40eea3c9e0ebc | 2,408 | js | JavaScript | packages/es2vt/points/tileQuery.js | VertNet/gbif-web | 799d2476f2b6c89f101b73cb2cec066c0d9f0acc | [
"Apache-2.0"
] | 2 | 2021-06-23T14:21:43.000Z | 2022-03-31T23:15:26.000Z | packages/es2vt/points/tileQuery.js | VertNet/gbif-web | 799d2476f2b6c89f101b73cb2cec066c0d9f0acc | [
"Apache-2.0"
] | 38 | 2020-06-02T09:56:57.000Z | 2022-02-23T08:51:20.000Z | packages/es2vt/points/tileQuery.js | VertNet/gbif-web | 799d2476f2b6c89f101b73cb2cec066c0d9f0acc | [
"Apache-2.0"
] | 2 | 2021-04-26T03:29:36.000Z | 2021-05-03T13:52:30.000Z | const tileGenerator = require('./esAgg2tile');
const { Client } = require('@elastic/elasticsearch');
const Agent = require('agentkeepalive');
const composeTileQuery = require('../util/composeTileQuery');
const tile2pbf = require('./tile2pbf');
const hash = require('object-hash');
const { search } = require('../util/esRequest');
const env = require('../config');
const LRU = require('lru-cache');
const searchIndex = env.es.index;
const field = env.es.coordinateField;
const agent = () => new Agent({
maxSockets: 1000, // Default = Infinity
keepAlive: true
});
const client = new Client({
nodes: env.es.hosts,
maxRetries: env.es.maxRetries || 3,
requestTimeout: env.es.requestTimeout || 60000,
agent
});
const cache = new LRU({ max: 10000, maxAge: 1000 * 60 * 10 });
//9 ≈ 2.4 meters
let resolutions = {
low: [2, 2, 3, 3, 4, 4, 4, 4, 5, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10],
medium: [2, 2, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10],
high: [2, 2, 3, 4, 4, 4, 5, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10]
}
async function getTile(x, y, z, q, resolution, req) {
let userQuery = q;
resolution = typeof resolution !== 'undefined' ? resolution : 'medium';
let precisionLookUp = resolutions[resolution] || resolutions.medium;
let precision = precisionLookUp[z] || 11;
// merge tile query and user query
// regarding precision in it can be 1 cm off in what it includes in the bounding box. ES https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-geo-bounding-box-query.html#_notes_on_precision
let tileQuery = composeTileQuery(x, y, z, precision, userQuery, field);
let esQuery = {
size: 0,
query: tileQuery,
aggs: {
geo: {
geohash_grid: {
field: field,
precision: precision,
size: 40000
},
aggs: {
geo: {
geo_centroid: { field: field }
}
}
}
}
};
let queryKey = hash({ esQuery });
let data = cache.get(queryKey);
if (!data) {
data = await getFromES({ esQuery, req });
cache.set(queryKey, data);
}
let tile = tileGenerator(data, x, y, z, 4096);
let buff = tile2pbf(tile);
return buff;
}
async function getFromES({ esQuery, req }) {
let response = await search({ client, index: searchIndex, query: esQuery, req });
let body = response.body;
return body;
}
module.exports = {
getTile: getTile
}; | 28.666667 | 212 | 0.619601 |
9848445227b83b1487b0d22d4dfadc6d722986ba | 951 | html | HTML | src/main/resources/static/play/12.html | iceChen8123/qiong | 861ebfc2b05b27b99a4b218933677a9b355d8969 | [
"Apache-2.0"
] | null | null | null | src/main/resources/static/play/12.html | iceChen8123/qiong | 861ebfc2b05b27b99a4b218933677a9b355d8969 | [
"Apache-2.0"
] | null | null | null | src/main/resources/static/play/12.html | iceChen8123/qiong | 861ebfc2b05b27b99a4b218933677a9b355d8969 | [
"Apache-2.0"
] | null | null | null | <%@ page contentType="text/html;charset=UTF-8"%>
<html>
<head>
<%@include file="./head.jsp"%>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="plane/main.css"/>
</head>
<body>
<div id="contentdiv">
<div id="startdiv">
<button onclick="begin()">开始游戏</button>
</div>
<div id="maindiv">
<div id="scorediv">
<label>分数:</label>
<label id="label">0</label>
</div>
<div id="suspenddiv">
<button>继续</button><br/>
<button>重新开始</button><br/>
<button>回到主页</button>
</div>
<div id="enddiv">
<p class="plantext">飞机大战分数</p>
<p id="planscore">0</p>
<div><button onclick="jixu()">继续</button></div>
</div>
</div>
</div>
<script type="text/javascript" src="plane/main.js"></script>
</body>
</html>
<%@include file="../foot.jsp"%> | 27.970588 | 70 | 0.532072 |
26068ed00b49c388494de29e03cfd7ed4767b9b4 | 2,300 | java | Java | src/main/java/xyz/xiaolong/common/utils/GZipUtils.java | xiaolonghuster/xiaolong-framework-common | 41a2a37354ce80b44adfa5ec21d53ab3846bc4dd | [
"Apache-2.0"
] | null | null | null | src/main/java/xyz/xiaolong/common/utils/GZipUtils.java | xiaolonghuster/xiaolong-framework-common | 41a2a37354ce80b44adfa5ec21d53ab3846bc4dd | [
"Apache-2.0"
] | null | null | null | src/main/java/xyz/xiaolong/common/utils/GZipUtils.java | xiaolonghuster/xiaolong-framework-common | 41a2a37354ce80b44adfa5ec21d53ab3846bc4dd | [
"Apache-2.0"
] | null | null | null | package xyz.xiaolong.common.utils;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream;
/**
* @Author lixiaolong
* created by xlli5 on 2019/3/20 5:03 PM use IntelliJ IDEA
*/
public class GZipUtils {
public GZipUtils() {
}
public static byte[] compress(String str, String encoding) {
if (str == null || str.length() == 0) {
return null;
}
ByteArrayOutputStream out = new ByteArrayOutputStream();
GZIPOutputStream gzip;
try {
gzip = new GZIPOutputStream(out);
gzip.write(str.getBytes(encoding));
gzip.close();
} catch ( Exception e) {
e.printStackTrace();
}
return out.toByteArray();
}
public static byte[] compress(byte[] data) {
if (data == null || data.length == 0) {
return null;
}
ByteArrayOutputStream out = new ByteArrayOutputStream();
GZIPOutputStream gzip;
try {
gzip = new GZIPOutputStream(out);
gzip.write(data);
gzip.close();
} catch ( Exception e) {
e.printStackTrace();
} finally {
try {
out.close();
} catch (IOException e) {
e.printStackTrace();
}
}
return out.toByteArray();
}
public static byte[] decompress(byte[] bytes) {
if (bytes == null || bytes.length == 0) {
return null;
}
ByteArrayOutputStream out = new ByteArrayOutputStream();
ByteArrayInputStream in = new ByteArrayInputStream(bytes);
try {
GZIPInputStream ungzip = new GZIPInputStream(in);
byte[] buffer = new byte[256];
int n;
while ((n = ungzip.read(buffer)) >= 0) {
out.write(buffer, 0, n);
}
} catch (Exception e) {
e.printStackTrace();
}
return out.toByteArray();
}
public static void main(String[] args) {
String str = "hhhdshhsh";
byte[] data = compress(str.getBytes());
System.out.println(new String(decompress(data)));
}
}
| 28.395062 | 66 | 0.547391 |
0ca1f24778ecd88cae66d775c3768ee93dee6382 | 6,217 | py | Python | FarmSwapG.py | resake/DuelsFarm | b6a0da11af4866d4ea6caa30be1436c256a55af4 | [
"MIT"
] | null | null | null | FarmSwapG.py | resake/DuelsFarm | b6a0da11af4866d4ea6caa30be1436c256a55af4 | [
"MIT"
] | null | null | null | FarmSwapG.py | resake/DuelsFarm | b6a0da11af4866d4ea6caa30be1436c256a55af4 | [
"MIT"
] | null | null | null | import re
import time
import aiohttp
CHANGE_CLOTHES = True
# Use swap gear
ACCOUNT_ID = 'b8dd6d09-0bf1-4455-99c5-4cec41b3a789'
# account id goes here
class DuelsAPI:
def __init__(self, account_id, **kwargs):
self.account_id = account_id
self.API_ENTRY = kwargs.get('api_entry_url',
'https://api-duels.galapagosgames.com')
self._session = aiohttp.ClientSession()
self._auth_data = dict()
self._all_data = dict()
@property
def profile(self):
return self._all_data.get('profile')
async def login(self):
app_version = await self.get_app_version()
data = {
'ids': [self.account_id],
'appBundle': 'com.deemedyainc.duels',
'appVersion': app_version,
'platform': 'Android',
'language': 'English'
}
all_data = await self._request('/general/login', data)
self._auth_data['id'] = all_data['profile']['_id']
self._auth_data['appVersion'] = app_version
self._auth_data['token'] = all_data['profile']['token']
self._all_data = all_data
return self._all_data
async def get_app_version(self):
app_version = self._auth_data.get('appVersion')
if app_version is not None:
return app_version
google_play_url = ('https://play.google.com/store/apps/details?id'
'=com.deemedyainc.duels&hl=en')
async with self._session.get(google_play_url) as resp:
data = await resp.text()
pattern = (r'<div class="hAyfc"><div class="BgcNfc">Current '
r'Version</div><span class="htlgb"><div '
r'class="IQ1z0d"><span class="htlgb">(?P<version>.*?)'
r'</span></div></span></div>')
version = re.search(pattern, data)
return version['version']
async def skip_queue(self, container_id):
return await self._request('/queue/claim',
{'containerId': container_id})
async def equip_part(self, part_id):
return await self._request('/inventory/equip', {'partId': part_id})
async def get_clan(self, clan_id):
return await self._request('/clan/info', {'clanId': clan_id})
async def get_player(self, player_id):
return await self._request('/profiles/details',
{'playerId': player_id})
async def play_lootfight(self):
return await self._request('/battle/loot/v2')
async def get_opponent(self, repeat_roll=False):
return await self._request('/battle/loot/opponent/v2',
{'reroll': repeat_roll})
async def get_dungeons_leaderboard(self):
return await self._request('/dungeons/leaderboards/top')
async def search_clan(self, clan_name, only_joinable=False, min_level=1):
payload = {'search': clan_name, 'onlyJoinable': only_joinable}
if min_level > 1:
payload.update({'lvl': min_level})
return await self._request('/clans/search', payload)
async def close(self):
if not self._session.closed:
await self._session.close()
async def _request(self, endpoint, additional_data={}, method='POST'):
additional_data.update(self._auth_data)
func_to_call = getattr(self._session, method.lower())
url = self.API_ENTRY + endpoint
async with func_to_call(url, json=additional_data) as resp:
return await resp.json()
async def main():
api = DuelsAPI(ACCOUNT_ID)
await api.login()
bad_equipment_ids = {}
now_equipment_ids = {}
if CHANGE_CLOTHES:
input(
'Pick better equipment in the game, and press `Enter` to continue'
)
for part in api.profile['character']['parts']:
now_equipment_ids.update({part['__type']: part['__id']})
for item in api.profile['inventory']['items']:
bad_item = bad_equipment_ids.get(item['__type'])
if bad_item is not None:
if bad_item['stat_value'] < item['stat']['value']:
continue
payload = {'id': item['__id'], 'stat_value': item['stat']['value']}
bad_equipment_ids[item['__type']] = payload
total_keys = api.profile['Key@Value']
start_time = time.time()
while True:
try:
for item_value in bad_equipment_ids.values():
await api.equip_part(item_value['id'])
await api.get_opponent()
for item_type, item_value in now_equipment_ids.items():
if bad_equipment_ids.get(item_type) is not None:
await api.equip_part(item_value)
loot_fight = await api.play_lootfight()
if loot_fight['battle']['result']:
print('[+] Ez win, win streak: {}'.format(
loot_fight['_u']['WinStreak@Value']
))
for queue in loot_fight['_q']:
await api.skip_queue(queue['_id'])
await api.skip_queue(queue['pid'])
if queue.get('steps') is None:
continue
for step in queue['steps']:
if step['type'] == 'RewardQueue':
if step['items'][0]['type'] != 'Key':
continue
keys_reward = step['items'][0]['reward']
total_keys += keys_reward
print('[+] We have got +{} keys!'.format(
keys_reward))
print('[+] Total keys: {}'.format(total_keys))
print('[+] Time elapsed: {}'.format(
time.time() - start_time
))
else:
print('[-] Ez lose!')
await asyncio.sleep(1.0)
except KeyboardInterrupt:
print('[+] Exit...')
break
if __name__ == '__main__':
import asyncio
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
| 37.678788 | 79 | 0.551391 |
5bf55f298f51f55f545a2ffafe3878df25aa5bfa | 2,996 | cs | C# | ExchangeRateResolver/Program.cs | oatcrunch/ExchangeRateResolverDotNET | 678d2250e721509306a2bb2aeccbf5717ef1f45a | [
"MIT"
] | null | null | null | ExchangeRateResolver/Program.cs | oatcrunch/ExchangeRateResolverDotNET | 678d2250e721509306a2bb2aeccbf5717ef1f45a | [
"MIT"
] | null | null | null | ExchangeRateResolver/Program.cs | oatcrunch/ExchangeRateResolverDotNET | 678d2250e721509306a2bb2aeccbf5717ef1f45a | [
"MIT"
] | null | null | null | using ExchangeRateResolver.Core;
using ExchangeRateResolver.Data;
using ExchangeRateResolver.Feeder;
using ExchangeRateResolver.Models;
using ExchangeRateResolver.Models.Events;
using ExchangeRateResolver.Parsers;
using System;
using System.Threading;
namespace ExchangeRateResolver
{
class Program
{
private static DataContext _dataContext;
private static CommandProcessor _commandProcessor;
private static ExchangeRateGraphProcessor _exchangeRateGraphProcessor;
private static IDataFeeder<PriceUpdate> _dataFeeder;
private static PriceUpdaterBase _priceUpdater;
static void Main(string[] args)
{
Console.WriteLine("========== Welcome to TenX Exchange Rate Resolver ==========");
/** Initialize root data **/
_dataContext = new DataContext();
/** Initialize processors **/
_commandProcessor = new CommandProcessor(_dataContext);
_exchangeRateGraphProcessor = new ExchangeRateGraphProcessor(_dataContext);
_commandProcessor.SetSuccessor(_exchangeRateGraphProcessor);
/** Prepare data feeder and updater **/
_dataFeeder = GetFeederFeatureToggle(); // feature toggle to switch between mock or real production data
_priceUpdater = _priceUpdater = new PriceUpdater(_dataFeeder);
/** Establish listening service to get initial data **/
_priceUpdater.OnReceived += PriceUpdater_OnReceived;
_priceUpdater.StartReceivingUpdates();
while (true)
{
string cmd = Console.ReadLine().Trim(); //user can either enter price updata data command OR enter the exchange rate request command
if (cmd.ToLower() == "exit") break;
try
{
/** Process command **/
_commandProcessor.Process(cmd);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
}
private static void PriceUpdater_OnReceived(object sender, EventArgs e)
{
var priceUpdateEvent = e as PriceUpdateEvent;
Console.WriteLine(priceUpdateEvent?.Data?.OriginalCommand);
_exchangeRateGraphProcessor.Process(priceUpdateEvent.Data);
}
private static IDataFeeder<PriceUpdate> GetFeederFeatureToggle()
{
bool useMock = false;
try
{
useMock = ConfigManager.GetInstance().GetValue("EnableMock").ToString().ToLower() == "true";
}
catch (Exception)
{
}
if (useMock)
{
return new MockPriceUpdateDataFeeder();
}
else
{
return new PriceUpdateDataFeeder("https://somehost/someapi/exchangerates/pull");
}
}
}
}
| 34.045455 | 148 | 0.596462 |
ff4a75c0d5ac5cfd5f04e2e4512151bc89868368 | 522 | asm | Assembly | libsrc/vz/vz_midstr_callee.asm | andydansby/z88dk-mk2 | 51c15f1387293809c496f5eaf7b196f8a0e9b66b | [
"ClArtistic"
] | 1 | 2020-09-15T08:35:49.000Z | 2020-09-15T08:35:49.000Z | libsrc/vz/vz_midstr_callee.asm | dex4er/deb-z88dk | 9ee4f23444fa6f6043462332a1bff7ae20a8504b | [
"ClArtistic"
] | null | null | null | libsrc/vz/vz_midstr_callee.asm | dex4er/deb-z88dk | 9ee4f23444fa6f6043462332a1bff7ae20a8504b | [
"ClArtistic"
] | null | null | null | ;*****************************************************
;
; Video Technology library for small C compiler
;
; Juergen Buchmueller
;
;*****************************************************
; ----- char __CALLEE__ *vz_midstr_callee(char *str, int pos)
XLIB vz_midstr_callee
XDEF ASMDISP_VZ_MIDSTR_CALLEE
.vz_midstr_callee
pop af
pop de
pop hl
push af
; de = int pos
; hl = char *str
.asmentry
add hl,de
ld l,(hl)
ld h,0
ret
DEFC ASMDISP_VZ_MIDSTR_CALLEE = asmentry - vz_midstr_callee
| 16.3125 | 61 | 0.538314 |
ddd3d283c44e1cf9f26e2d8aa70d5de778435ee4 | 525 | php | PHP | src/Magento/Framework/Api/ExtensibleDataInterface.php | nunomaduro/phpstan-magento | 20572c1325b4da63d4922ea21e35e7a3680d35b0 | [
"MIT"
] | 68 | 2019-03-21T19:55:59.000Z | 2022-03-28T10:47:07.000Z | src/Magento/Framework/Api/ExtensibleDataInterface.php | nunomaduro/phpstan-magento | 20572c1325b4da63d4922ea21e35e7a3680d35b0 | [
"MIT"
] | 76 | 2021-06-18T19:11:12.000Z | 2022-03-31T04:17:32.000Z | src/Magento/Framework/Api/ExtensibleDataInterface.php | torhoehn/phpstan-magento | 7d424e80abe68165aab0ea5412a03fe8971369db | [
"MIT"
] | 16 | 2019-03-23T17:35:58.000Z | 2022-03-30T15:27:01.000Z | <?php
/*
* This file is part of the phpstan-magento package.
*
* (c) bitExpert AG
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Magento\Framework\Api;
/**
* Interface for entities which can be extended with extension attributes.
*
* @api
* @since 100.0.2
*/
interface ExtensibleDataInterface
{
/**
* Key for extension attributes object
*/
const EXTENSION_ATTRIBUTES_KEY = 'extension_attributes';
}
| 19.444444 | 74 | 0.702857 |
9e53f0769d24d3b74b2f2b161678dc509cbb0010 | 2,061 | kt | Kotlin | app/src/main/java/com/faldez/shachi/ui/post_slide/SavedPostSlideFragment.kt | faldez/shachi | 46ac8ba179080635f3180666f280ff075bacd11e | [
"Apache-2.0"
] | null | null | null | app/src/main/java/com/faldez/shachi/ui/post_slide/SavedPostSlideFragment.kt | faldez/shachi | 46ac8ba179080635f3180666f280ff075bacd11e | [
"Apache-2.0"
] | null | null | null | app/src/main/java/com/faldez/shachi/ui/post_slide/SavedPostSlideFragment.kt | faldez/shachi | 46ac8ba179080635f3180666f280ff075bacd11e | [
"Apache-2.0"
] | null | null | null | package com.faldez.shachi.ui.post_slide
import android.os.Bundle
import androidx.core.os.bundleOf
import androidx.navigation.navGraphViewModels
import com.faldez.shachi.R
import com.faldez.shachi.data.database.AppDatabase
import com.faldez.shachi.data.model.Post
import com.faldez.shachi.data.repository.favorite.FavoriteRepositoryImpl
import com.faldez.shachi.data.repository.post.PostRepositoryImpl
import com.faldez.shachi.data.repository.saved_search.SavedSearchRepositoryImpl
import com.faldez.shachi.data.api.BooruApiImpl
import com.faldez.shachi.ui.post_slide.base.BasePostSlideFragment
import com.faldez.shachi.ui.saved.SavedViewModel
import com.faldez.shachi.ui.saved.SavedViewModelFactory
class SavedPostSlideFragment : BasePostSlideFragment() {
companion object {
const val TAG = "SavedPostSlideFragment"
}
private val viewModel: SavedViewModel by navGraphViewModels(R.id.saved) {
val db = AppDatabase.build(requireContext())
val service = BooruApiImpl()
SavedViewModelFactory(SavedSearchRepositoryImpl(db),
PostRepositoryImpl(service), FavoriteRepositoryImpl(db), this)
}
private val savedSearchId by lazy { requireArguments().getInt("saved_search_id") }
override suspend fun collectPagingData(showQuestionable: Boolean, showExplicit: Boolean) {
viewModel.posts(savedSearchId).collect {
if (it != null) {
postSlideAdapter.submitData(it)
}
}
}
override fun onPageChange(position: Int) {
viewModel.putScroll(savedSearchId, position)
}
override fun navigateToPostDetailBundle(post: Post?): Bundle {
val server = requireArguments().get("server")
val tags = requireArguments().get("tags")
return bundleOf("post" to post,
"server" to server,
"tags" to tags)
}
override fun deleteFavoritePost(post: Post) {
viewModel.deleteFavoritePost(post)
}
override fun favoritePost(post: Post) {
viewModel.favoritePost(post)
}
} | 36.157895 | 94 | 0.725861 |
50ff884e067aa35963c1fc809012f31ff736004b | 7,154 | swift | Swift | Sonolib/Classes/Dtos/TransactionRequest.swift | SonoCoin/sonolib-swift | 5f1c632fde4fdd83170048d9ce0a5d8522472cce | [
"MIT"
] | null | null | null | Sonolib/Classes/Dtos/TransactionRequest.swift | SonoCoin/sonolib-swift | 5f1c632fde4fdd83170048d9ce0a5d8522472cce | [
"MIT"
] | null | null | null | Sonolib/Classes/Dtos/TransactionRequest.swift | SonoCoin/sonolib-swift | 5f1c632fde4fdd83170048d9ce0a5d8522472cce | [
"MIT"
] | null | null | null | //
// TransactionRequest.swift
//
//
// Created by Tim Notfoolen on 02.07.2020.
//
import Foundation
public enum TransactionError : Error {
case invalidAddress
case invalidContractAddress
case invalidAmount
case signKeyNotFound
}
public class TransactionRequest {
public var hash: String?
public var type: TransactionType
public var version: UInt32
public var inputs: [InputDto]
public var transfers: [TransferDto]?
public var messages: [ContractMessageDto]?
public var stakes: [StakeDto]?
public var gasPrice: UInt64
private var signers: [String: HD]
private var transferCommission: UInt64
public init() {
self.version = Sono.txVersion
self.inputs = []
self.type = TransactionType.Account
self.signers = [String: HD]()
self.gasPrice = 0
self.transferCommission = 0
}
public func addCommission(gasPrice: UInt64, transferCommission: UInt64) -> TransactionRequest {
self.gasPrice = gasPrice
self.transferCommission = transferCommission
return self
}
public func generateHash() throws -> Data {
let buf = try toBytes()
return Helpers.DHASH(data: buf)
}
public func toBytes() throws -> Data {
var buf = Data()
// Step 1 add Type (4 bytes)
buf.append(type.rawValue.ldata)
// Step 2: add Version (4 bytes)
buf.append(version.ldata)
// Step 3: add gas price (8 bytes)
buf.append(gasPrice.ldata)
// Step 4: add Inputs
for item in inputs {
buf.append(try item.toBytes())
}
// Step 5: add Transfers
if let items = transfers {
for item in items {
buf.append(try item.toBytes())
}
}
// Step 6: add Messages
if let items = messages {
for item in items {
buf.append(try item.toBytes())
}
}
// Step 7: add Stakes
if let items = stakes {
for item in items {
buf.append(try item.toBytes())
}
}
return buf
}
public func validateValue(commission: UInt64) throws {
var len = UInt64(0)
if let items = transfers {
len += UInt64(items.count)
}
if let items = stakes {
len += UInt64(items.count)
}
var outValue = commission * gasPrice * len
if let items = transfers {
for item in items {
outValue += item.value
}
}
if let items = stakes {
for item in items {
outValue += item.value
}
}
if let items = messages {
for item in items {
outValue += item.value + item.gas * gasPrice
}
}
var inValue = UInt64(0)
for item in inputs {
inValue += item.value
}
if inValue != outValue {
throw TransactionError.invalidAmount
}
}
public func addSender(address: String, key: HD, value: UInt64, nonce: UInt64) throws -> TransactionRequest {
if !Wallet.isValidAccountAddress(address: address) {
throw TransactionError.invalidAddress
}
inputs.append(InputDto(address: address, value: value, nonce: nonce, publicKey: key.keyPair.publicKey.hex))
signers[address] = key
return self
}
public func addTransfer(address: String, value: UInt64) throws -> TransactionRequest {
if !Wallet.isValidAccountAddress(address: address) {
throw TransactionError.invalidAddress
}
if transfers == nil {
self.transfers = []
}
self.transfers?.append(TransferDto(address: address, value: value))
return self
}
private func checkContractsData() {
if messages == nil {
messages = []
}
}
public func addContractCreation(sender: String, code: String, value: UInt64, gas: UInt64) throws -> TransactionRequest {
if !Wallet.isValidAccountAddress(address: sender) {
throw TransactionError.invalidAddress
}
self.checkContractsData()
messages?.append(ContractMessageDto(sender: sender, code: code, value: value, gas: gas))
return self
}
public func addContractExecution(sender: String, address: String, input: String, value: UInt64, gas: UInt64) throws -> TransactionRequest {
if !Wallet.isValidAccountAddress(address: sender) {
throw TransactionError.invalidAddress
}
if !Wallet.isValidContractAddress(address: address) {
throw TransactionError.invalidContractAddress
}
self.checkContractsData()
messages?.append(ContractMessageDto(sender: sender, address: address, payload: input, value: value, gas: gas))
return self
}
public func addStake(address: String, value: UInt64, nodeId: String) -> TransactionRequest {
if self.stakes == nil {
self.stakes = []
}
self.stakes?.append(StakeDto(address: address, value: value, nodeId: nodeId))
return self
}
public func validate() throws {
try validateValue(commission: transferCommission)
}
public func sign() throws -> TransactionRequest {
try validate()
for index in 0..<inputs.count {
let input = inputs[index]
let msg = try msgForSignUser(input: input)
guard let hd = signers[input.address] else {
throw TransactionError.signKeyNotFound
}
let sig = try hd.sign(data: msg)
inputs[index].sign = sig.hex
}
let hash = try generateHash()
self.hash = hash.hex
return self
}
private func msgForSignUser(input: InputDto) throws -> Data {
var buf = Data()
// Step 1 add Type (4 bytes)
buf.append(type.rawValue.ldata)
// Step 2: add Version (4 bytes)
buf.append(version.ldata)
// Step 3: add gas price (8 bytes)
buf.append(gasPrice.ldata)
// Step 4: add Inputs
buf.append(try input.toBytes())
// Step 5: add Transfers
if let items = transfers {
for item in items {
buf.append(try item.toBytes())
}
}
// Step 6: add Messages
if let items = messages {
for item in items {
buf.append(try item.toBytes())
}
}
// Step 7: add Stakes
if let items = stakes {
for item in items {
buf.append(try item.toBytes())
}
}
return buf
}
}
| 28.054902 | 143 | 0.541236 |
595cf3e23bd4cf58bb8a78664e36ff38eaafa93a | 12,062 | cpp | C++ | src/io_worker.cpp | planetbeing/cpp-driver | 90b683cb7fce9ab480765f8ed50185af53df791c | [
"Apache-2.0"
] | null | null | null | src/io_worker.cpp | planetbeing/cpp-driver | 90b683cb7fce9ab480765f8ed50185af53df791c | [
"Apache-2.0"
] | null | null | null | src/io_worker.cpp | planetbeing/cpp-driver | 90b683cb7fce9ab480765f8ed50185af53df791c | [
"Apache-2.0"
] | null | null | null | /*
Copyright (c) 2015 DataStax
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.
*/
#include "io_worker.hpp"
#include "config.hpp"
#include "logger.hpp"
#include "pool.hpp"
#include "request_handler.hpp"
#include "session.hpp"
#include "scoped_lock.hpp"
#include "timer.hpp"
#include <boost/bind.hpp>
namespace cass {
IOWorker::IOWorker(Session* session)
: session_(session)
, config_(session->config())
, is_closing_(false)
, pending_request_count_(0)
, request_queue_(config_.queue_size_io()) {
prepare_.data = this;
uv_mutex_init(&keyspace_mutex_);
uv_mutex_init(&unavailable_addresses_mutex_);
}
IOWorker::~IOWorker() {
uv_mutex_destroy(&keyspace_mutex_);
uv_mutex_destroy(&unavailable_addresses_mutex_);
}
int IOWorker::init() {
int rc = EventThread<IOWorkerEvent>::init(config_.queue_size_event());
if (rc != 0) return rc;
rc = request_queue_.init(loop(), this, &IOWorker::on_execute);
if (rc != 0) return rc;
rc = uv_prepare_init(loop(), &prepare_);
if (rc != 0) return rc;
rc = uv_prepare_start(&prepare_, on_prepare);
if (rc != 0) return rc;
return rc;
}
std::string IOWorker::keyspace() {
// Not returned by reference on purpose. This memory can't be shared
// because it could be updated as a result of a "USE <keyspace" query.
ScopedMutex lock(&keyspace_mutex_);
return keyspace_;
}
void IOWorker::set_keyspace(const std::string& keyspace) {
ScopedMutex lock(&keyspace_mutex_);
keyspace_ = keyspace;
}
bool IOWorker::is_current_keyspace(const std::string& keyspace) {
// This mutex is locked on the query request path, but it should
// almost never have any contention. That could only happen when
// there is a "USE <keyspace>" query. These *should* happen
// infrequently. This is preferred over IOWorker::keyspace()
// because it doesn't allocate memory.
ScopedMutex lock(&keyspace_mutex_);
return keyspace_ == keyspace;
}
void IOWorker::broadcast_keyspace_change(const std::string& keyspace) {
set_keyspace(keyspace);
session_->broadcast_keyspace_change(keyspace, this);
}
bool IOWorker::is_host_up(const Address& address) const {
PoolMap::const_iterator it = pools_.find(address);
return it != pools_.end() && it->second->is_ready();
}
void IOWorker::set_host_is_available(const Address& address, bool is_available) {
ScopedMutex lock(&unavailable_addresses_mutex_);
if (is_available) {
unavailable_addresses_.erase(address);
} else {
unavailable_addresses_.insert(address);
}
}
bool IOWorker::is_host_available(const Address& address) {
ScopedMutex lock(&unavailable_addresses_mutex_);
return unavailable_addresses_.count(address) == 0;
}
bool IOWorker::add_pool_async(const Address& address, bool is_initial_connection) {
IOWorkerEvent event;
event.type = IOWorkerEvent::ADD_POOL;
event.address = address;
event.is_initial_connection = is_initial_connection;
return send_event_async(event);
}
bool IOWorker::remove_pool_async(const Address& address, bool cancel_reconnect) {
IOWorkerEvent event;
event.type = IOWorkerEvent::REMOVE_POOL;
event.address = address;
event.cancel_reconnect = cancel_reconnect;
return send_event_async(event);
}
void IOWorker::close_async() {
while (!request_queue_.enqueue(NULL)) {
// Keep trying
}
}
void IOWorker::add_pool(const Address& address, bool is_initial_connection) {
if (!is_closing_ && pools_.count(address) == 0) {
LOG_INFO("Adding pool for host %s io_worker(%p)",
address.to_string(true).c_str(), static_cast<void*>(this));
set_host_is_available(address, false);
SharedRefPtr<Pool> pool(new Pool(this, address, is_initial_connection));
pools_[address] = pool;
pool->connect();
}
}
bool IOWorker::execute(RequestHandler* request_handler) {
return request_queue_.enqueue(request_handler);
}
void IOWorker::retry(RequestHandler* request_handler, RetryType retry_type) {
if (retry_type == RETRY_WITH_NEXT_HOST) {
request_handler->next_host();
}
Address address;
if (!request_handler->get_current_host_address(&address)) {
request_handler->on_error(CASS_ERROR_LIB_NO_HOSTS_AVAILABLE,
"IOWorker: No hosts available");
return;
}
PoolMap::iterator it = pools_.find(address);
if (it != pools_.end() && it->second->is_ready()) {
const SharedRefPtr<Pool>& pool = it->second;
Connection* connection = pool->borrow_connection();
if (connection != NULL) {
if (!pool->write(connection, request_handler)) {
retry(request_handler, RETRY_WITH_NEXT_HOST);
}
} else { // Too busy, or no connections
pool->wait_for_connection(request_handler);
}
} else {
retry(request_handler, RETRY_WITH_NEXT_HOST);
}
}
void IOWorker::request_finished(RequestHandler* request_handler) {
pending_request_count_--;
maybe_close();
request_queue_.send();
}
void IOWorker::notify_pool_ready(Pool* pool) {
if (pool->is_initial_connection()) {
session_->notify_ready_async();
} else if (!is_closing_ && pool->is_ready()){
session_->notify_up_async(pool->address());
}
}
void IOWorker::notify_pool_closed(Pool* pool) {
Address address = pool->address(); // Not a reference on purpose
bool is_critical_failure = pool->is_critical_failure();
bool cancel_reconnect = pool->cancel_reconnect();
LOG_INFO("Pool for host %s closed: pool(%p) io_worker(%p)",
address.to_string().c_str(),
static_cast<void*>(pool),
static_cast<void*>(this));
// All non-shared pointers to this pool are invalid after this call
// and it must be done before maybe_notify_closed().
pools_.erase(address);
if (is_closing_) {
maybe_notify_closed();
} else {
session_->notify_down_async(address);
if (!is_critical_failure && !cancel_reconnect) {
schedule_reconnect(address);
}
}
}
void IOWorker::add_pending_flush(Pool* pool) {
pools_pending_flush_.push_back(SharedRefPtr<Pool>(pool));
}
void IOWorker::maybe_close() {
if (is_closing_ && pending_request_count_ <= 0) {
if (config_.core_connections_per_host() > 0) {
for (PoolMap::iterator it = pools_.begin(); it != pools_.end(); ++it) {
it->second->close();
}
maybe_notify_closed();
} else {
// Pool::close is intertwined with this class via notify_pool_closed.
// Requires special handling to avoid iterator invalidation and double closing
// other resources.
// This path only possible for internal config. API does not allow.
while (!pools_.empty()) pools_.begin()->second->close();
}
}
}
void IOWorker::maybe_notify_closed() {
if (pools_.empty()) {
session_->notify_worker_closed_async();
close_handles();
}
}
void IOWorker::close_handles() {
EventThread<IOWorkerEvent>::close_handles();
request_queue_.close_handles();
uv_prepare_stop(&prepare_);
uv_close(copy_cast<uv_prepare_t*, uv_handle_t*>(&prepare_), NULL);
for (PendingReconnectMap::iterator it = pending_reconnects_.begin(),
end = pending_reconnects_.end(); it != end; ++it) {
LOG_DEBUG("Stopping reconnect timers reconnect(%p timer(%p)) io_worker(%p)",
static_cast<void*>(&it->second),
static_cast<void*>(it->second.timer),
static_cast<void*>(this));
it->second.stop_timer();
}
LOG_DEBUG("Active handles following close: %d", loop()->active_handles);
}
void IOWorker::on_pending_pool_reconnect(Timer* timer) {
PendingReconnect* pending_reconnect =
static_cast<PendingReconnect*>(timer->data());
LOG_DEBUG("Reconnecting pool reconnect(%p timer(%p)) io_worker(%p)",
static_cast<void*>(pending_reconnect),
static_cast<void*>(timer),
static_cast<void*>(this));
const Address& address = pending_reconnect->address;
add_pool(address, false);
pending_reconnects_.erase(address);
}
void IOWorker::on_event(const IOWorkerEvent& event) {
switch (event.type) {
case IOWorkerEvent::ADD_POOL: {
// Stop any attempts to reconnect because add_pool() is going to attempt
// reconnection right away.
cancel_reconnect(event.address);
add_pool(event.address, event.is_initial_connection);
break;
}
case IOWorkerEvent::REMOVE_POOL: {
if (event.cancel_reconnect) {
LOG_DEBUG("REMOVE_POOL event for %s cancelling reconnect io_worker(%p)",
event.address.to_string().c_str(),
static_cast<void*>(this));
cancel_reconnect(event.address);
}
PoolMap::iterator it = pools_.find(event.address);
if (it != pools_.end()) {
LOG_DEBUG("REMOVE_POOL event for %s closing pool(%p) io_worker(%p)",
event.address.to_string().c_str(),
static_cast<void*>(it->second.get()),
static_cast<void*>(this));
it->second->close(event.cancel_reconnect);
}
break;
}
default:
assert(false);
break;
}
}
#if UV_VERSION_MAJOR == 0
void IOWorker::on_execute(uv_async_t* async, int status) {
#else
void IOWorker::on_execute(uv_async_t* async) {
#endif
IOWorker* io_worker = static_cast<IOWorker*>(async->data);
RequestHandler* request_handler = NULL;
size_t remaining = io_worker->config().max_requests_per_flush();
while (remaining != 0 && io_worker->request_queue_.dequeue(request_handler)) {
if (request_handler != NULL) {
io_worker->pending_request_count_++;
request_handler->set_io_worker(io_worker);
request_handler->retry(RETRY_WITH_CURRENT_HOST);
} else {
io_worker->is_closing_ = true;
}
remaining--;
}
io_worker->maybe_close();
}
#if UV_VERSION_MAJOR == 0
void IOWorker::on_prepare(uv_prepare_t* prepare, int status) {
#else
void IOWorker::on_prepare(uv_prepare_t* prepare) {
#endif
IOWorker* io_worker = static_cast<IOWorker*>(prepare->data);
for (PoolVec::iterator it = io_worker->pools_pending_flush_.begin(),
end = io_worker->pools_pending_flush_.end(); it != end; ++it) {
(*it)->flush();
}
io_worker->pools_pending_flush_.clear();
}
void IOWorker::schedule_reconnect(const Address& address) {
if (is_closing_ || pending_reconnects_.count(address) > 0) {
LOG_DEBUG("Reconnect already pending for host %s io_worker(%p)",
address.to_string().c_str(), static_cast<void*>(this));
return;
}
PendingReconnect& pr = pending_reconnects_[address];
pr.address = address;
pr.timer = Timer::start(loop(),
config_.reconnect_wait_time_ms(),
&pr,
boost::bind(&IOWorker::on_pending_pool_reconnect, this, _1));
LOG_DEBUG("Scheduling reconnect(%p timer(%p)) for host %s io_worker(%p)",
static_cast<void*>(&pr),
static_cast<void*>(pr.timer),
address.to_string().c_str(),
static_cast<void*>(this));
}
void IOWorker::cancel_reconnect(const Address& address) {
PendingReconnectMap::iterator it = pending_reconnects_.find(address);
if (it != pending_reconnects_.end()) {
LOG_DEBUG("Cancelling reconnect(%p timer(%p)) for host %s io_worker(%p)",
static_cast<void*>(&it->second),
static_cast<void*>(it->second.timer),
address.to_string().c_str(),
static_cast<void*>(this));
it->second.stop_timer();
pending_reconnects_.erase(it);
}
}
void IOWorker::PendingReconnect::stop_timer() {
if (timer != NULL) {
Timer::stop(timer);
timer = NULL;
}
}
} // namespace cass
| 31.493473 | 87 | 0.685873 |
2a8c81566bdf33da171e591ac557dcb54508f56a | 520 | asm | Assembly | oeis/140/A140248.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/140/A140248.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/140/A140248.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A140248: Decimal expansion of 0.3 * sqrt(15).
; Submitted by Christian Krause
; 1,1,6,1,8,9,5,0,0,3,8,6,2,2,2,5,0,6,5,5,5,3,7,7,9,6,1,9,9,3,4,7,1,9,8,8,3,2,4,9,8,7,6,5,1,1,5,8,7,4,7,7,2,4,7,9,7,6,2,7,2,1,2,9,8,3,4,0,4,4,9,2,7,5,8,1,0,9,3,7,1,0,0,5,5,7,8,6,2,1,3,0,5,7,6,0,2,0,5,5
mov $3,$0
mul $3,3
lpb $3
mov $5,$6
add $6,$2
add $1,$6
mul $1,2
mov $2,51
add $2,$1
mul $1,2
sub $3,1
add $5,$2
add $6,$5
lpe
mov $1,$5
add $2,10
mov $4,10
pow $4,$0
div $2,$4
div $1,$2
mov $0,$1
add $0,$4
mod $0,10
| 18.571429 | 201 | 0.528846 |
6f495890d507015575ef16901766f654c3603e9e | 3,765 | rs | Rust | src/lib.rs | kubo/rosy | 9993ab90392cf9e57f25ef2e359149cd2e11dd35 | [
"Apache-2.0"
] | 11 | 2019-05-17T20:17:22.000Z | 2019-12-17T15:53:54.000Z | src/lib.rs | kubo/rosy | 9993ab90392cf9e57f25ef2e359149cd2e11dd35 | [
"Apache-2.0"
] | 5 | 2019-05-14T01:23:55.000Z | 2019-11-16T08:10:12.000Z | src/lib.rs | nvzqz/rosy | 9993ab90392cf9e57f25ef2e359149cd2e11dd35 | [
"Apache-2.0"
] | 1 | 2019-11-10T01:02:38.000Z | 2019-11-10T01:02:38.000Z | //! [](https://github.com/oceanpkg/rosy)
//!
//! This crate provides high-level bindings to the [Ruby] virtual machine.
//!
//! # Installation
//!
//! This crate is available [on crates.io][crate] and can be used by adding the
//! following to your project's [`Cargo.toml`]:
//!
//! ```toml
//! [dependencies]
//! rosy = "0.0.9"
//! ```
//!
//! Rosy has functionality that is only available for certain Ruby versions. The
//! following features can currently be enabled:
//!
//! - `ruby_2_6`
//!
//! For example:
//!
//! ```toml
//! [dependencies.rosy]
//! version = "0.0.9"
//! features = ["ruby_2_6"]
//! ```
//!
//! Finally add this to your crate root (`main.rs` or `lib.rs`):
//!
//! ```
//! extern crate rosy;
//! ```
//!
//! # Initialization
//!
//! The Ruby virtual machine is initialized via [`vm::init`]:
//!
//! ```
//! rosy::vm::init().expect("Failed to initialize Ruby");
//! ```
//!
//! This should be called
//! once by the thread expected to be associated with Ruby. All mutations to
//! Ruby objects from there on are only safe from that same thread since the VM
//! is not known to be thread-safe.
//!
//! # Cleaning Up
//!
//! When done with the Ruby VM, one should call [`vm::destroy`], which will
//! return a status code appropriate for exiting the program.
//!
//! ```
//! # rosy::vm::init().unwrap();
//! if let Err(code) = unsafe { rosy::vm::destroy() } {
//! code.exit_process();
//! }
//! ```
//!
//! # Catching Ruby Exceptions
//!
//! With Rosy, your Rust code can be [`protected`](fn.protected.html) from Ruby
//! exceptions when calling unchecked functions that may throw.
//!
//! Not catching an exception from Rust will result in a segmentation fault at
//! best. As a result, every function that throws an exception is annotated as
//! [`unsafe`] in Rust-land. If a function is found to not uphold this
//! invariant, please report it at [issue #4][issue4] or file a pull request to
//! fix this.
//!
//! ```
//! # rosy::vm::init().unwrap();
//! use rosy::{Object, String};
//!
//! let string = String::from("hello\r\n");
//!
//! rosy::protected(|| unsafe {
//! string.call("chomp!");
//! }).unwrap();
//!
//! assert_eq!(string.len(), 5);
//! ```
//!
//! [`Cargo.toml`]: https://doc.rust-lang.org/cargo/reference/manifest.html
//! [crate]: https://crates.io/crates/rosy
//! [Ruby]: https://www.ruby-lang.org
//! [`vm::init`]: vm/fn.init.html
//! [`vm::destroy`]: vm/fn.destroy.html
//! [`unsafe`]: https://doc.rust-lang.org/book/ch19-01-unsafe-rust.html
//! [issue4]: https://github.com/oceanpkg/rosy/issues/4
#![cfg_attr(nightly, feature(doc_cfg))]
#![deny(missing_docs)]
#![cfg_attr(all(test, nightly), feature(test))]
#![doc(html_logo_url = "https://raw.githubusercontent.com/oceanpkg/rosy/assets/icon.svg?sanitize=true")]
#[cfg(all(test, nightly))]
extern crate test;
include!(env!("ROSY_RUBY_VERSION_CONST"));
#[path = "ruby_bindings/mod.rs"]
mod ruby;
mod rosy;
mod protected;
mod util;
pub mod array;
pub mod exception;
pub mod gc;
pub mod hash;
pub mod meta;
pub mod mixin;
pub mod num;
pub mod object;
pub mod prelude;
pub mod range;
pub mod string;
pub mod symbol;
pub mod vm;
#[doc(inline)]
pub use protected::*;
#[doc(inline)] // prelude
pub use self::{
array::Array,
exception::{AnyException, Exception},
hash::Hash,
mixin::{Mixin, Class, Module},
num::{Float, Integer},
object::{AnyObject, Object, RosyObject},
range::Range,
rosy::Rosy,
string::String,
symbol::{Symbol, SymbolId},
};
/// A simplified form of
/// [`Result`](https://doc.rust-lang.org/std/result/enum.Result.html) for
/// when exceptions are caught.
pub type Result<T = (), E = AnyException> = std::result::Result<T, E>;
| 26.328671 | 116 | 0.640903 |
c3f43bfcc97464676ec73f20cb0191cdc40a1826 | 23,282 | go | Go | data_server.pb.go | Neo23x0/go-grr-apiclient | eaa42d0a5b16ef14680093f98f526159d648c847 | [
"Apache-2.0"
] | 2 | 2020-04-18T10:38:27.000Z | 2021-10-01T01:45:07.000Z | data_server.pb.go | Neo23x0/go-grr-apiclient | eaa42d0a5b16ef14680093f98f526159d648c847 | [
"Apache-2.0"
] | null | null | null | data_server.pb.go | Neo23x0/go-grr-apiclient | eaa42d0a5b16ef14680093f98f526159d648c847 | [
"Apache-2.0"
] | 6 | 2017-05-27T13:48:31.000Z | 2019-09-29T00:50:10.000Z | // Code generated by protoc-gen-go.
// source: data_server.proto
// DO NOT EDIT!
package apiclient
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
type DataStoreCommand_Command int32
const (
DataStoreCommand_MULTI_SET DataStoreCommand_Command = 0
// Deprecated
// MULTI_RESOLVE_REGEX = 1;
DataStoreCommand_RESOLVE_MULTI DataStoreCommand_Command = 2
DataStoreCommand_DELETE_SUBJECT DataStoreCommand_Command = 3
DataStoreCommand_DELETE_ATTRIBUTES DataStoreCommand_Command = 4
// Deprecated.
// DELETE_ATTRIBUTES_REGEX = 5;
DataStoreCommand_LOCK_SUBJECT DataStoreCommand_Command = 6
DataStoreCommand_UNLOCK_SUBJECT DataStoreCommand_Command = 7
DataStoreCommand_EXTEND_SUBJECT DataStoreCommand_Command = 8
DataStoreCommand_MULTI_RESOLVE_PREFIX DataStoreCommand_Command = 9
DataStoreCommand_SCAN_ATTRIBUTES DataStoreCommand_Command = 10
)
var DataStoreCommand_Command_name = map[int32]string{
0: "MULTI_SET",
2: "RESOLVE_MULTI",
3: "DELETE_SUBJECT",
4: "DELETE_ATTRIBUTES",
6: "LOCK_SUBJECT",
7: "UNLOCK_SUBJECT",
8: "EXTEND_SUBJECT",
9: "MULTI_RESOLVE_PREFIX",
10: "SCAN_ATTRIBUTES",
}
var DataStoreCommand_Command_value = map[string]int32{
"MULTI_SET": 0,
"RESOLVE_MULTI": 2,
"DELETE_SUBJECT": 3,
"DELETE_ATTRIBUTES": 4,
"LOCK_SUBJECT": 6,
"UNLOCK_SUBJECT": 7,
"EXTEND_SUBJECT": 8,
"MULTI_RESOLVE_PREFIX": 9,
"SCAN_ATTRIBUTES": 10,
}
func (x DataStoreCommand_Command) Enum() *DataStoreCommand_Command {
p := new(DataStoreCommand_Command)
*p = x
return p
}
func (x DataStoreCommand_Command) String() string {
return proto.EnumName(DataStoreCommand_Command_name, int32(x))
}
func (x *DataStoreCommand_Command) UnmarshalJSON(data []byte) error {
value, err := proto.UnmarshalJSONEnum(DataStoreCommand_Command_value, data, "DataStoreCommand_Command")
if err != nil {
return err
}
*x = DataStoreCommand_Command(value)
return nil
}
func (DataStoreCommand_Command) EnumDescriptor() ([]byte, []int) { return fileDescriptor7, []int{0, 0} }
type DataServerState_Status int32
const (
DataServerState_AVAILABLE DataServerState_Status = 0
DataServerState_OFFLINE DataServerState_Status = 1
)
var DataServerState_Status_name = map[int32]string{
0: "AVAILABLE",
1: "OFFLINE",
}
var DataServerState_Status_value = map[string]int32{
"AVAILABLE": 0,
"OFFLINE": 1,
}
func (x DataServerState_Status) Enum() *DataServerState_Status {
p := new(DataServerState_Status)
*p = x
return p
}
func (x DataServerState_Status) String() string {
return proto.EnumName(DataServerState_Status_name, int32(x))
}
func (x *DataServerState_Status) UnmarshalJSON(data []byte) error {
value, err := proto.UnmarshalJSONEnum(DataServerState_Status_value, data, "DataServerState_Status")
if err != nil {
return err
}
*x = DataServerState_Status(value)
return nil
}
func (DataServerState_Status) EnumDescriptor() ([]byte, []int) { return fileDescriptor7, []int{2, 0} }
type DataStoreCommand struct {
Command *DataStoreCommand_Command `protobuf:"varint,1,opt,name=command,enum=DataStoreCommand_Command" json:"command,omitempty"`
Request *DataStoreRequest `protobuf:"bytes,2,opt,name=request" json:"request,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *DataStoreCommand) Reset() { *m = DataStoreCommand{} }
func (m *DataStoreCommand) String() string { return proto.CompactTextString(m) }
func (*DataStoreCommand) ProtoMessage() {}
func (*DataStoreCommand) Descriptor() ([]byte, []int) { return fileDescriptor7, []int{0} }
func (m *DataStoreCommand) GetCommand() DataStoreCommand_Command {
if m != nil && m.Command != nil {
return *m.Command
}
return DataStoreCommand_MULTI_SET
}
func (m *DataStoreCommand) GetRequest() *DataStoreRequest {
if m != nil {
return m.Request
}
return nil
}
type DataServerInterval struct {
// Range of hashes used by the server.
// Represented as an interval [start, end[.
Start *uint64 `protobuf:"varint,1,opt,name=start" json:"start,omitempty"`
End *uint64 `protobuf:"varint,2,opt,name=end" json:"end,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *DataServerInterval) Reset() { *m = DataServerInterval{} }
func (m *DataServerInterval) String() string { return proto.CompactTextString(m) }
func (*DataServerInterval) ProtoMessage() {}
func (*DataServerInterval) Descriptor() ([]byte, []int) { return fileDescriptor7, []int{1} }
func (m *DataServerInterval) GetStart() uint64 {
if m != nil && m.Start != nil {
return *m.Start
}
return 0
}
func (m *DataServerInterval) GetEnd() uint64 {
if m != nil && m.End != nil {
return *m.End
}
return 0
}
type DataServerState struct {
Status *DataServerState_Status `protobuf:"varint,1,opt,name=status,enum=DataServerState_Status" json:"status,omitempty"`
Load *uint64 `protobuf:"varint,2,opt,name=load" json:"load,omitempty"`
Size *uint64 `protobuf:"varint,3,opt,name=size" json:"size,omitempty"`
NumComponents *uint64 `protobuf:"varint,4,opt,name=num_components" json:"num_components,omitempty"`
AvgComponent *uint64 `protobuf:"varint,5,opt,name=avg_component" json:"avg_component,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *DataServerState) Reset() { *m = DataServerState{} }
func (m *DataServerState) String() string { return proto.CompactTextString(m) }
func (*DataServerState) ProtoMessage() {}
func (*DataServerState) Descriptor() ([]byte, []int) { return fileDescriptor7, []int{2} }
func (m *DataServerState) GetStatus() DataServerState_Status {
if m != nil && m.Status != nil {
return *m.Status
}
return DataServerState_AVAILABLE
}
func (m *DataServerState) GetLoad() uint64 {
if m != nil && m.Load != nil {
return *m.Load
}
return 0
}
func (m *DataServerState) GetSize() uint64 {
if m != nil && m.Size != nil {
return *m.Size
}
return 0
}
func (m *DataServerState) GetNumComponents() uint64 {
if m != nil && m.NumComponents != nil {
return *m.NumComponents
}
return 0
}
func (m *DataServerState) GetAvgComponent() uint64 {
if m != nil && m.AvgComponent != nil {
return *m.AvgComponent
}
return 0
}
type DataServerInformation struct {
Index *uint64 `protobuf:"varint,1,opt,name=index" json:"index,omitempty"`
Address *string `protobuf:"bytes,2,opt,name=address" json:"address,omitempty"`
Port *uint64 `protobuf:"varint,3,opt,name=port" json:"port,omitempty"`
State *DataServerState `protobuf:"bytes,4,opt,name=state" json:"state,omitempty"`
Interval *DataServerInterval `protobuf:"bytes,5,opt,name=interval" json:"interval,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *DataServerInformation) Reset() { *m = DataServerInformation{} }
func (m *DataServerInformation) String() string { return proto.CompactTextString(m) }
func (*DataServerInformation) ProtoMessage() {}
func (*DataServerInformation) Descriptor() ([]byte, []int) { return fileDescriptor7, []int{3} }
func (m *DataServerInformation) GetIndex() uint64 {
if m != nil && m.Index != nil {
return *m.Index
}
return 0
}
func (m *DataServerInformation) GetAddress() string {
if m != nil && m.Address != nil {
return *m.Address
}
return ""
}
func (m *DataServerInformation) GetPort() uint64 {
if m != nil && m.Port != nil {
return *m.Port
}
return 0
}
func (m *DataServerInformation) GetState() *DataServerState {
if m != nil {
return m.State
}
return nil
}
func (m *DataServerInformation) GetInterval() *DataServerInterval {
if m != nil {
return m.Interval
}
return nil
}
type DataServerMapping struct {
// Version of the mapping.
Version *uint64 `protobuf:"varint,1,opt,name=version" json:"version,omitempty"`
// Number of data servers.
NumServers *uint64 `protobuf:"varint,2,opt,name=num_servers" json:"num_servers,omitempty"`
// Information about each server.
Servers []*DataServerInformation `protobuf:"bytes,3,rep,name=servers" json:"servers,omitempty"`
// Pathing information for subject paths.
Pathing []string `protobuf:"bytes,4,rep,name=pathing" json:"pathing,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *DataServerMapping) Reset() { *m = DataServerMapping{} }
func (m *DataServerMapping) String() string { return proto.CompactTextString(m) }
func (*DataServerMapping) ProtoMessage() {}
func (*DataServerMapping) Descriptor() ([]byte, []int) { return fileDescriptor7, []int{4} }
func (m *DataServerMapping) GetVersion() uint64 {
if m != nil && m.Version != nil {
return *m.Version
}
return 0
}
func (m *DataServerMapping) GetNumServers() uint64 {
if m != nil && m.NumServers != nil {
return *m.NumServers
}
return 0
}
func (m *DataServerMapping) GetServers() []*DataServerInformation {
if m != nil {
return m.Servers
}
return nil
}
func (m *DataServerMapping) GetPathing() []string {
if m != nil {
return m.Pathing
}
return nil
}
type DataServerClientInformation struct {
// Client username.
Username *string `protobuf:"bytes,1,opt,name=username" json:"username,omitempty"`
// Client password.
Password *string `protobuf:"bytes,2,opt,name=password" json:"password,omitempty"`
// Client permissions (r, rw, w).
Permissions *string `protobuf:"bytes,3,opt,name=permissions" json:"permissions,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *DataServerClientInformation) Reset() { *m = DataServerClientInformation{} }
func (m *DataServerClientInformation) String() string { return proto.CompactTextString(m) }
func (*DataServerClientInformation) ProtoMessage() {}
func (*DataServerClientInformation) Descriptor() ([]byte, []int) { return fileDescriptor7, []int{5} }
func (m *DataServerClientInformation) GetUsername() string {
if m != nil && m.Username != nil {
return *m.Username
}
return ""
}
func (m *DataServerClientInformation) GetPassword() string {
if m != nil && m.Password != nil {
return *m.Password
}
return ""
}
func (m *DataServerClientInformation) GetPermissions() string {
if m != nil && m.Permissions != nil {
return *m.Permissions
}
return ""
}
type DataServerEncryptedCreds struct {
InitVector []byte `protobuf:"bytes,1,opt,name=init_vector" json:"init_vector,omitempty"`
Ciphertext []byte `protobuf:"bytes,2,opt,name=ciphertext" json:"ciphertext,omitempty"`
Sha256 []byte `protobuf:"bytes,3,opt,name=sha256" json:"sha256,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *DataServerEncryptedCreds) Reset() { *m = DataServerEncryptedCreds{} }
func (m *DataServerEncryptedCreds) String() string { return proto.CompactTextString(m) }
func (*DataServerEncryptedCreds) ProtoMessage() {}
func (*DataServerEncryptedCreds) Descriptor() ([]byte, []int) { return fileDescriptor7, []int{6} }
func (m *DataServerEncryptedCreds) GetInitVector() []byte {
if m != nil {
return m.InitVector
}
return nil
}
func (m *DataServerEncryptedCreds) GetCiphertext() []byte {
if m != nil {
return m.Ciphertext
}
return nil
}
func (m *DataServerEncryptedCreds) GetSha256() []byte {
if m != nil {
return m.Sha256
}
return nil
}
type DataServerClientCredentials struct {
Users []*DataServerClientInformation `protobuf:"bytes,1,rep,name=users" json:"users,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *DataServerClientCredentials) Reset() { *m = DataServerClientCredentials{} }
func (m *DataServerClientCredentials) String() string { return proto.CompactTextString(m) }
func (*DataServerClientCredentials) ProtoMessage() {}
func (*DataServerClientCredentials) Descriptor() ([]byte, []int) { return fileDescriptor7, []int{7} }
func (m *DataServerClientCredentials) GetUsers() []*DataServerClientInformation {
if m != nil {
return m.Users
}
return nil
}
type DataServerRebalance struct {
// ID of operation.
Id *string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
// New mapping information.
Mapping *DataServerMapping `protobuf:"bytes,2,opt,name=mapping" json:"mapping,omitempty"`
// Number of files need to move.
Moving []uint64 `protobuf:"varint,3,rep,name=moving" json:"moving,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *DataServerRebalance) Reset() { *m = DataServerRebalance{} }
func (m *DataServerRebalance) String() string { return proto.CompactTextString(m) }
func (*DataServerRebalance) ProtoMessage() {}
func (*DataServerRebalance) Descriptor() ([]byte, []int) { return fileDescriptor7, []int{8} }
func (m *DataServerRebalance) GetId() string {
if m != nil && m.Id != nil {
return *m.Id
}
return ""
}
func (m *DataServerRebalance) GetMapping() *DataServerMapping {
if m != nil {
return m.Mapping
}
return nil
}
func (m *DataServerRebalance) GetMoving() []uint64 {
if m != nil {
return m.Moving
}
return nil
}
type DataServerFileCopy struct {
// Rebalance operation.
RebalanceId *string `protobuf:"bytes,1,opt,name=rebalance_id" json:"rebalance_id,omitempty"`
// Directory where the file will be copied.
Directory *string `protobuf:"bytes,2,opt,name=directory" json:"directory,omitempty"`
// Filename for the file to copy.
Filename *string `protobuf:"bytes,3,opt,name=filename" json:"filename,omitempty"`
// Size of file.
Size *uint64 `protobuf:"varint,4,opt,name=size" json:"size,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *DataServerFileCopy) Reset() { *m = DataServerFileCopy{} }
func (m *DataServerFileCopy) String() string { return proto.CompactTextString(m) }
func (*DataServerFileCopy) ProtoMessage() {}
func (*DataServerFileCopy) Descriptor() ([]byte, []int) { return fileDescriptor7, []int{9} }
func (m *DataServerFileCopy) GetRebalanceId() string {
if m != nil && m.RebalanceId != nil {
return *m.RebalanceId
}
return ""
}
func (m *DataServerFileCopy) GetDirectory() string {
if m != nil && m.Directory != nil {
return *m.Directory
}
return ""
}
func (m *DataServerFileCopy) GetFilename() string {
if m != nil && m.Filename != nil {
return *m.Filename
}
return ""
}
func (m *DataServerFileCopy) GetSize() uint64 {
if m != nil && m.Size != nil {
return *m.Size
}
return 0
}
type DataStoreAuthToken struct {
Username *string `protobuf:"bytes,1,opt,name=username" json:"username,omitempty"`
Nonce *string `protobuf:"bytes,2,opt,name=nonce" json:"nonce,omitempty"`
Hash *string `protobuf:"bytes,3,opt,name=hash" json:"hash,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *DataStoreAuthToken) Reset() { *m = DataStoreAuthToken{} }
func (m *DataStoreAuthToken) String() string { return proto.CompactTextString(m) }
func (*DataStoreAuthToken) ProtoMessage() {}
func (*DataStoreAuthToken) Descriptor() ([]byte, []int) { return fileDescriptor7, []int{10} }
func (m *DataStoreAuthToken) GetUsername() string {
if m != nil && m.Username != nil {
return *m.Username
}
return ""
}
func (m *DataStoreAuthToken) GetNonce() string {
if m != nil && m.Nonce != nil {
return *m.Nonce
}
return ""
}
func (m *DataStoreAuthToken) GetHash() string {
if m != nil && m.Hash != nil {
return *m.Hash
}
return ""
}
type DataStoreRegistrationRequest struct {
Port *uint32 `protobuf:"varint,1,opt,name=port" json:"port,omitempty"`
Token *DataStoreAuthToken `protobuf:"bytes,2,opt,name=token" json:"token,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *DataStoreRegistrationRequest) Reset() { *m = DataStoreRegistrationRequest{} }
func (m *DataStoreRegistrationRequest) String() string { return proto.CompactTextString(m) }
func (*DataStoreRegistrationRequest) ProtoMessage() {}
func (*DataStoreRegistrationRequest) Descriptor() ([]byte, []int) { return fileDescriptor7, []int{11} }
func (m *DataStoreRegistrationRequest) GetPort() uint32 {
if m != nil && m.Port != nil {
return *m.Port
}
return 0
}
func (m *DataStoreRegistrationRequest) GetToken() *DataStoreAuthToken {
if m != nil {
return m.Token
}
return nil
}
func init() {
proto.RegisterType((*DataStoreCommand)(nil), "DataStoreCommand")
proto.RegisterType((*DataServerInterval)(nil), "DataServerInterval")
proto.RegisterType((*DataServerState)(nil), "DataServerState")
proto.RegisterType((*DataServerInformation)(nil), "DataServerInformation")
proto.RegisterType((*DataServerMapping)(nil), "DataServerMapping")
proto.RegisterType((*DataServerClientInformation)(nil), "DataServerClientInformation")
proto.RegisterType((*DataServerEncryptedCreds)(nil), "DataServerEncryptedCreds")
proto.RegisterType((*DataServerClientCredentials)(nil), "DataServerClientCredentials")
proto.RegisterType((*DataServerRebalance)(nil), "DataServerRebalance")
proto.RegisterType((*DataServerFileCopy)(nil), "DataServerFileCopy")
proto.RegisterType((*DataStoreAuthToken)(nil), "DataStoreAuthToken")
proto.RegisterType((*DataStoreRegistrationRequest)(nil), "DataStoreRegistrationRequest")
proto.RegisterEnum("DataStoreCommand_Command", DataStoreCommand_Command_name, DataStoreCommand_Command_value)
proto.RegisterEnum("DataServerState_Status", DataServerState_Status_name, DataServerState_Status_value)
}
func init() { proto.RegisterFile("data_server.proto", fileDescriptor7) }
var fileDescriptor7 = []byte{
// 845 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x7c, 0x54, 0xdd, 0x6e, 0x23, 0x45,
0x13, 0x5d, 0xc7, 0x7f, 0x71, 0x8d, 0xed, 0x8c, 0xdb, 0x9b, 0xfd, 0xfc, 0xc1, 0x4a, 0x8c, 0x86,
0x9f, 0x8d, 0x40, 0x1a, 0x81, 0x25, 0x10, 0x77, 0xc8, 0x76, 0x26, 0xc8, 0xbb, 0xde, 0x64, 0x65,
0x4f, 0xc2, 0xde, 0x20, 0xab, 0xf1, 0x54, 0xe2, 0x16, 0x9e, 0xee, 0xa1, 0xbb, 0x6d, 0x36, 0xbc,
0x03, 0x6f, 0xc1, 0x1d, 0x17, 0x3c, 0x02, 0x37, 0x3c, 0x09, 0xbc, 0x06, 0x17, 0xa8, 0xdb, 0xed,
0x8c, 0x49, 0x56, 0xdc, 0xcd, 0x9c, 0x3e, 0x5d, 0x75, 0xea, 0x54, 0x57, 0x41, 0x27, 0xa5, 0x9a,
0xce, 0x15, 0xca, 0x0d, 0xca, 0x28, 0x97, 0x42, 0x8b, 0x77, 0xfc, 0x2d, 0xa4, 0x85, 0x44, 0x87,
0xb4, 0x15, 0x66, 0x94, 0x6b, 0xb6, 0xd8, 0xfe, 0x87, 0xbf, 0x1c, 0x80, 0x7f, 0x4a, 0x35, 0x9d,
0x19, 0xce, 0x48, 0x64, 0x19, 0xe5, 0x29, 0xf9, 0x18, 0xea, 0x8b, 0xed, 0x67, 0xaf, 0x14, 0x94,
0x4e, 0xda, 0xfd, 0xff, 0x47, 0xf7, 0x39, 0xd1, 0x8e, 0x1b, 0x42, 0x5d, 0xe2, 0x0f, 0x6b, 0x54,
0xba, 0x77, 0x10, 0x94, 0x4e, 0xbc, 0x7e, 0xa7, 0xe0, 0x4e, 0xb7, 0x07, 0xe1, 0xef, 0x25, 0xa8,
0xef, 0xf8, 0x2d, 0x68, 0xbc, 0xbc, 0x9c, 0x24, 0xe3, 0xf9, 0x2c, 0x4e, 0xfc, 0x47, 0xa4, 0x03,
0xad, 0x69, 0x3c, 0xbb, 0x98, 0x5c, 0xc5, 0x73, 0x0b, 0xfb, 0x07, 0x84, 0x40, 0xfb, 0x34, 0x9e,
0xc4, 0x49, 0x3c, 0x9f, 0x5d, 0x0e, 0x9f, 0xc7, 0xa3, 0xc4, 0x2f, 0x93, 0x63, 0xe8, 0x38, 0x6c,
0x90, 0x24, 0xd3, 0xf1, 0xf0, 0x32, 0x89, 0x67, 0x7e, 0x85, 0xf8, 0xd0, 0x9c, 0x5c, 0x8c, 0x5e,
0xdc, 0x11, 0x6b, 0xe6, 0xf2, 0xe5, 0xf9, 0xbf, 0xb0, 0xba, 0xc1, 0xe2, 0xd7, 0x49, 0x7c, 0x7e,
0x7a, 0x87, 0x1d, 0x92, 0x1e, 0x3c, 0xde, 0xca, 0xd8, 0x65, 0x7f, 0x35, 0x8d, 0xcf, 0xc6, 0xaf,
0xfd, 0x06, 0xe9, 0xc2, 0xd1, 0x6c, 0x34, 0x38, 0xdf, 0x4f, 0x04, 0xe1, 0xa7, 0x40, 0x6c, 0x55,
0xd6, 0xdc, 0x31, 0xd7, 0x28, 0x37, 0x74, 0x45, 0x5a, 0x50, 0x55, 0x9a, 0x4a, 0x6d, 0x5d, 0xaa,
0x10, 0x0f, 0xca, 0xc8, 0x53, 0x6b, 0x43, 0x25, 0xfc, 0xb5, 0x04, 0x47, 0xc5, 0x95, 0x99, 0xa6,
0x1a, 0xc9, 0x33, 0xa8, 0x29, 0x4d, 0xf5, 0x5a, 0x39, 0x5b, 0xff, 0x17, 0xdd, 0x63, 0x44, 0x33,
0x7b, 0x4c, 0x9a, 0x50, 0x59, 0x09, 0xea, 0x42, 0x99, 0x3f, 0xc5, 0x7e, 0xc2, 0x5e, 0xd9, 0xfe,
0x3d, 0x81, 0x36, 0x5f, 0x67, 0xf3, 0x85, 0xc8, 0x72, 0xc1, 0x91, 0x6b, 0xd5, 0xab, 0x58, 0xfc,
0x18, 0x5a, 0x74, 0x73, 0x53, 0xe0, 0xbd, 0xaa, 0xd5, 0xf1, 0x01, 0xd4, 0x5c, 0xd0, 0x16, 0x34,
0x06, 0x57, 0x83, 0xf1, 0x64, 0x30, 0x9c, 0xc4, 0xfe, 0x23, 0xe2, 0x41, 0xfd, 0xe2, 0xec, 0x6c,
0x32, 0x3e, 0x8f, 0xfd, 0x52, 0xf8, 0x73, 0x09, 0x8e, 0xf7, 0x0b, 0xbc, 0x16, 0x32, 0xa3, 0x9a,
0x09, 0x6e, 0x6a, 0x64, 0x3c, 0xc5, 0x37, 0xae, 0xc6, 0x23, 0xa8, 0xd3, 0x34, 0x95, 0xa8, 0x94,
0x15, 0xd7, 0x30, 0xe2, 0x72, 0x21, 0xb5, 0x13, 0xf7, 0x9e, 0x75, 0x44, 0xa3, 0xd5, 0xe4, 0xf5,
0xfd, 0xfb, 0x05, 0x92, 0x0f, 0xe1, 0x90, 0x39, 0xfb, 0xac, 0x40, 0xaf, 0xdf, 0x8d, 0x1e, 0x3a,
0x1b, 0x2a, 0xe8, 0x14, 0xe8, 0x4b, 0x9a, 0xe7, 0x8c, 0xdf, 0x98, 0xdc, 0x1b, 0x94, 0x8a, 0x09,
0xee, 0xc4, 0x74, 0xc1, 0x33, 0x56, 0x6c, 0x9f, 0xbc, 0x72, 0x6e, 0x3d, 0x83, 0xfa, 0x0e, 0x28,
0x07, 0xe5, 0x13, 0xaf, 0xff, 0x24, 0x7a, 0x7b, 0x65, 0x47, 0x50, 0xcf, 0xa9, 0x5e, 0x32, 0x7e,
0xd3, 0xab, 0x04, 0xe5, 0x93, 0x46, 0x78, 0x05, 0xef, 0x16, 0xcc, 0xd1, 0x8a, 0x21, 0xd7, 0xfb,
0x7c, 0x1f, 0x0e, 0xd7, 0x0a, 0x25, 0xa7, 0x19, 0xda, 0xfc, 0x0d, 0x83, 0xe4, 0x54, 0xa9, 0x1f,
0x85, 0x4c, 0x9d, 0x1b, 0x5d, 0xf0, 0x72, 0x94, 0x19, 0x53, 0x46, 0xa5, 0xb2, 0xa6, 0x34, 0xc2,
0xdf, 0x4a, 0xd0, 0x2b, 0x02, 0xc7, 0x7c, 0x21, 0x6f, 0x73, 0x8d, 0xe9, 0x48, 0x62, 0xaa, 0xc8,
0x47, 0xe0, 0x31, 0xce, 0xf4, 0x7c, 0x83, 0x0b, 0x2d, 0xa4, 0x0d, 0xdc, 0x1c, 0x76, 0xfe, 0xfc,
0xfb, 0xaf, 0x3f, 0x4a, 0x1e, 0x34, 0x06, 0xf1, 0xec, 0xb3, 0xfe, 0x97, 0x2f, 0xf0, 0x96, 0x10,
0x80, 0x05, 0xcb, 0x97, 0x28, 0x35, 0xbe, 0xd9, 0x8e, 0x5a, 0x93, 0x7c, 0x03, 0x35, 0xb5, 0xa4,
0xfd, 0xcf, 0xbf, 0xb0, 0x89, 0x9a, 0xc3, 0xaf, 0xed, 0xb5, 0x01, 0xf9, 0x2a, 0x59, 0x62, 0xb0,
0x3d, 0x09, 0xc4, 0x75, 0xa0, 0x97, 0x18, 0xe4, 0x2b, 0xca, 0x78, 0x60, 0xee, 0x06, 0xb8, 0x13,
0x10, 0x18, 0x64, 0x89, 0x41, 0x11, 0x37, 0xb8, 0x66, 0xb8, 0x4a, 0xa3, 0xf0, 0xf9, 0x43, 0x27,
0x8c, 0x5a, 0xe4, 0x9a, 0xd1, 0x95, 0x22, 0x9f, 0x40, 0xd5, 0x38, 0x61, 0x9e, 0xb1, 0x31, 0xf8,
0x69, 0xf4, 0x1f, 0xb6, 0x85, 0x57, 0xd0, 0x2d, 0x8e, 0xa7, 0xf8, 0x1d, 0x5d, 0x51, 0xbe, 0x40,
0x02, 0x70, 0xc0, 0x52, 0xe7, 0xe3, 0xfb, 0x50, 0xcf, 0xb6, 0x3d, 0x76, 0x3b, 0x84, 0x44, 0x0f,
0xbb, 0xdf, 0x86, 0x5a, 0x26, 0x36, 0x86, 0x63, 0xda, 0x5a, 0x09, 0xbf, 0xdd, 0x1f, 0xc9, 0x33,
0xb6, 0xc2, 0x91, 0xc8, 0x6f, 0xc9, 0x63, 0x68, 0xca, 0x5d, 0x8e, 0xf9, 0x5d, 0x82, 0x0e, 0x34,
0x52, 0x26, 0xad, 0xc3, 0xb7, 0xae, 0x53, 0x3e, 0x1c, 0x5e, 0xb3, 0x15, 0xda, 0x6e, 0x96, 0x77,
0x2f, 0xd9, 0x8e, 0x99, 0x1d, 0xa7, 0x70, 0xe4, 0xc2, 0x9b, 0x3d, 0x36, 0x58, 0xeb, 0x65, 0x22,
0xbe, 0xc7, 0xb7, 0xbd, 0x81, 0x16, 0x54, 0xb9, 0xe0, 0x0b, 0x2c, 0xc6, 0x61, 0x49, 0xd5, 0xd2,
0x75, 0xfe, 0x15, 0x3c, 0xdd, 0x5b, 0x86, 0x37, 0x4c, 0x69, 0x69, 0x4d, 0x71, 0x8b, 0xf1, 0x6e,
0x78, 0x4c, 0xa8, 0x16, 0x09, 0xa1, 0xaa, 0x4d, 0x16, 0x67, 0x42, 0x37, 0x7a, 0x28, 0xe0, 0x9f,
0x00, 0x00, 0x00, 0xff, 0xff, 0x15, 0xb2, 0x63, 0x73, 0xe5, 0x05, 0x00, 0x00,
}
| 38.546358 | 137 | 0.68117 |
50562fb73dbcbfd18761cc4861222a66538226af | 694 | html | HTML | src/ui/html/loadMonitorPanel.html | jmmluna/ogv | 9208e76cc321b503c5c62ef1cb904fe2a5669074 | [
"MIT"
] | 8 | 2019-11-05T12:55:54.000Z | 2022-01-07T17:19:41.000Z | src/ui/html/loadMonitorPanel.html | i62lotor/ogv | 2f722413d5542930a95cb9abfd8ef80981848728 | [
"MIT"
] | 17 | 2019-12-03T13:03:38.000Z | 2021-05-04T09:46:08.000Z | src/ui/html/loadMonitorPanel.html | i62lotor/ogv | 2f722413d5542930a95cb9abfd8ef80981848728 | [
"MIT"
] | 5 | 2019-11-05T13:40:51.000Z | 2019-11-23T14:56:08.000Z | <div class="w3-card-4 w3-animate-top w3-text-white" style="
font-family: Arial, Helvetica, sans-serif;
background-color: #272727;
position: relative;
top: 0px;
margin-top: 0px;
border: 3px solid green;
padding: 10px;
opacity: 0.8;
z-index: 90;
">
<br />
<!-- <i class="ms ms-process w3-spin" style="font-size: 24px"></i> -->
<label id="messageLabel" style="text-shadow: 1px 1px 0 rgb(75, 73, 73)"></label>
<div class="w3-light-grey w3-round">
<div id="progressBar" class="w3-green w3-round w3-center w3-small" style="height: 10px; width: 0"></div>
</div>
<br />
</div> | 36.526316 | 113 | 0.553314 |
f7f66d64141a32bc1fd86131c938c411fab9e2c0 | 294 | swift | Swift | new_yelp_starter/Yelp/Models/SearchKeys.swift | pijit/Yelp | d171e3ac615823a304055accfa7f230f11a110cf | [
"Apache-2.0"
] | null | null | null | new_yelp_starter/Yelp/Models/SearchKeys.swift | pijit/Yelp | d171e3ac615823a304055accfa7f230f11a110cf | [
"Apache-2.0"
] | 1 | 2016-10-29T04:48:47.000Z | 2017-03-01T06:22:00.000Z | new_yelp_starter/Yelp/Models/SearchKeys.swift | pijit/Yelp | d171e3ac615823a304055accfa7f230f11a110cf | [
"Apache-2.0"
] | null | null | null | //
// SearchKeys.swift
// Yelp
//
// Created by Pj Nguyen on 10/21/16.
// Copyright © 2016 CoderSchool. All rights reserved.
//
import Foundation
class SearchKeys {
var name: String! = ""
var categories: [String]! = []
var offset: Int! = 0
var radius: Double! = 0
}
| 15.473684 | 54 | 0.602041 |
c5511f2ae1d686f3c821e446db3b79d362c4e9c8 | 18,528 | hpp | C++ | ork.core/inc/ork/cmatrix3.hpp | tweakoz/micro_ork | 66f69d5866ca30dc6066c2dacdb7bbc5b8aa73e7 | [
"MIT"
] | 4 | 2015-06-04T01:14:43.000Z | 2018-06-16T05:45:57.000Z | ork.core/inc/ork/cmatrix3.hpp | tweakoz/micro_ork | 66f69d5866ca30dc6066c2dacdb7bbc5b8aa73e7 | [
"MIT"
] | null | null | null | ork.core/inc/ork/cmatrix3.hpp | tweakoz/micro_ork | 66f69d5866ca30dc6066c2dacdb7bbc5b8aa73e7 | [
"MIT"
] | null | null | null | ///////////////////////////////////////////////////////////////////////////////
// MicroOrk (Orkid)
// Copyright 1996-2013, Michael T. Mayers
// Provided under the MIT License (see LICENSE.txt)
///////////////////////////////////////////////////////////////////////////////
#include "math_misc.h"
#include "cvector3.h"
#include "cvector4.h"
#include <stdio.h>
namespace ork {
template <typename T> const TMatrix3<T> TMatrix3<T>::Identity;
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
template <typename T> void TMatrix3<T>::SetToIdentity(void)
{
int j,k;
for (j=0;j<3;j++)
{
for (k=0;k<3;k++)
{
elements[j][k] = T( (j==k) );
}
}
}
///////////////////////////////////////////////////////////////////////////////
template <typename T> void TMatrix3<T>::dump( const char* name )
{
printf( "Matrix %p %s\n{ ", this, name );
for( int i=0; i<4; i++ )
{
for( int j=0; j<4; j++ )
{
printf( "%f ", elements[i][j] );
}
printf( "\n " );
}
printf( "\n}\n" );
}
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
template <typename T> void TMatrix3<T>::SetElemYX( int ix, int iy, T val )
{
elements[iy][ix] = val;
}
///////////////////////////////////////////////////////////////////////////////
template <typename T> T TMatrix3<T>::GetElemYX( int ix, int iy ) const
{
return elements[iy][ix];
}
///////////////////////////////////////////////////////////////////////////////
template <typename T> void TMatrix3<T>::SetElemXY( int ix, int iy, T val )
{
elements[ix][iy] = val;
}
///////////////////////////////////////////////////////////////////////////////
template <typename T> T TMatrix3<T>::GetElemXY( int ix, int iy ) const
{
return elements[ix][iy];
}
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
template <typename T> void TMatrix3<T>::Translate(const TVector3<T> &vec )
{
TMatrix3<T> temp, res;
temp.SetTranslation( vec );
res = temp * *this;
*this = res;
}
///////////////////////////////////////////////////////////////////////////////
template <typename T> void TMatrix3<T>::Translate(T vx,T vy)
{
TMatrix3<T> temp, res;
temp.SetTranslation( vx, vy );
res = temp * *this;
*this = res;
}
///////////////////////////////////////////////////////////////////////////////
template <typename T> void TMatrix3<T>::SetTranslation( const TVector2<T> &vec )
{
SetColumn( 2, TVector3<T>( vec, 1.0f ) );
}
///////////////////////////////////////////////////////////////////////////////
template <typename T> TVector2<T> TMatrix3<T>::GetTranslation( void ) const
{
return GetColumn(2).GetXY();
}
///////////////////////////////////////////////////////////////////////////////
template <typename T> void TMatrix3<T>::SetTranslation(T x, T y)
{
SetTranslation( TVector2<T>(x,y) );
}
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// set rotation explicitly
template <typename T> void TMatrix3<T>::SetRotateX(T rad)
{
T cosa, sina;
cosa = cos<T>( rad );
sina = sin<T>( rad );
elements[0][0] = 1.0f;
elements[0][1] = 0.0f;
elements[0][2] = 0.0f;
elements[1][0] = 0.0f;
elements[1][1] = cosa;
elements[1][2] = sina;
elements[2][0] = 0.0f;
elements[2][1] = -sina;
elements[2][2] = cosa;
}
///////////////////////////////////////////////////////////////////////////////
// set rotation explicitly
template <typename T> void TMatrix3<T>::SetRotateY(T rad)
{
T cosa, sina;
cosa = cos<T>( rad );
sina = sin<T>( rad );
elements[0][0] = cosa;
elements[0][1] = 0.0f;
elements[0][2] = -sina;
elements[1][0] = 0.0f;
elements[1][1] = 1.0f;
elements[1][2] = 0.0f;
elements[2][0] = sina;
elements[2][1] = 0.0f;
elements[2][2] = cosa;
}
///////////////////////////////////////////////////////////////////////////////
// set rotation explicitly
template <typename T> void TMatrix3<T>::SetRotateZ(T rad)
{
T cosa, sina;
cosa = cos<T>( rad );
sina = sin<T>( rad );
elements[0][0] = cosa;
elements[0][1] = sina;
elements[0][2] = 0.0f;
elements[1][0] = -sina;
elements[1][1] = cosa;
elements[1][2] = 0.0f;
elements[2][0] = 0.0f;
elements[2][1] = 0.0f;
elements[2][2] = 1.0f;
}
///////////////////////////////////////////////////////////////////////////////
// rotate in place
template <typename T> void TMatrix3<T>::RotateX( T rad )
{
TMatrix3<T> temp, res;
temp.SetRotateX(rad);
res = temp * *this;
*this = res;
}
///////////////////////////////////////////////////////////////////////////////
// rotate in place
template <typename T> void TMatrix3<T>::RotateY( T rad )
{
TMatrix3<T> temp, res;
temp.SetRotateY(rad);
res = temp * *this;
*this = res;
}
///////////////////////////////////////////////////////////////////////////////
// rotate in place
template <typename T> void TMatrix3<T>::RotateZ( T rad )
{
TMatrix3<T> temp, res;
temp.SetRotateZ(rad);
res = temp * *this;
*this = res;
}
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
template <typename T> void TMatrix3<T>::SetScale( const TVector4<T> &vec)
{
SetScale( vec.GetX(), vec.GetY(), vec.GetZ() );
}
///////////////////////////////////////////////////////////////////////////////
template <typename T> void TMatrix3<T>::SetScale(T x, T y, T z)
{
SetElemXY( 0, 0, x );
SetElemXY( 1, 0, 0.0f );
SetElemXY( 2, 0, 0.0f );
SetElemXY( 0, 1, 0.0f );
SetElemXY( 1, 1, y );
SetElemXY( 2, 1, 0.0f );
SetElemXY( 0, 2, 0.0f );
SetElemXY( 1, 2, 0.0f );
SetElemXY( 2, 2, z );
}
///////////////////////////////////////////////////////////////////////////////
template <typename T> void TMatrix3<T>::SetScale(T s)
{
SetScale( s,s,s );
}
///////////////////////////////////////////////////////////////////////////////
template <typename T> void TMatrix3<T>::Scale( const TVector4<T> &vec )
{
TMatrix3<T> temp, res;
temp.SetScale( vec );
res = temp * *this;
*this = res;
}
///////////////////////////////////////////////////////////////////////////////
template <typename T> void TMatrix3<T>::Scale( T xscl, T yscl, T zscl )
{
TMatrix3<T> temp, res;
temp.SetScale( xscl, yscl, zscl );
res = temp * *this;
*this = res;
}
//////////////////////////////////////////////////////////////////////////////
template <typename T> void TMatrix3<T>::Scale( T xscl, T yscl )
{
Scale(xscl, yscl, 1.0);
}
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// sm - rotation matrix from quaternion
template <typename T> void TMatrix3<T>::FromQuaternion(TQuaternion<T> quat)
{
T xx = quat.GetX() * quat.GetX();
T yy = quat.GetY() * quat.GetY();
T zz = quat.GetZ() * quat.GetZ();
T xy = quat.GetX() * quat.GetY();
T zw = quat.GetZ() * quat.GetW();
T zx = quat.GetZ() * quat.GetX();
T yw = quat.GetY() * quat.GetW();
T yz = quat.GetY() * quat.GetZ();
T xw = quat.GetX() * quat.GetW();
elements[0][0] = T(1.0f) - (T(2.0f) * (yy + zz));
elements[0][1] = T(2.0f) * (xy + zw);
elements[0][2] = T(2.0f) * (zx - yw);
elements[1][0] = T(2.0f) * (xy - zw);
elements[1][1] = T(1.0f) - (T(2.0f) * (zz + xx));
elements[1][2] = T(2.0f) * (yz + xw);
elements[2][0] = T(2.0f) * (zx + yw);
elements[2][1] = T(2.0f) * (yz - xw);
elements[2][2] = T(1.0f) - (T(2.0f) * (yy + xx));
}
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
template <typename T> void fpuM33xM33( const T a[3][3], const T b[3][3], T c[3][3] )
{
const T *fa = & a[0][0];
const T *fb = & b[0][0];
T *fc = & c[0][0];
// y x
// i j i k k j i k k j i k k j i k k j
fc[0] = fa[0]*fb[0] + fa[1]*fb[4] + fa[2]*fb[8] + fa[3]*fb[12];
fc[1] = fa[0]*fb[1] + fa[1]*fb[5] + fa[2]*fb[9] + fa[3]*fb[13];
fc[2] = fa[0]*fb[2] + fa[1]*fb[6] + fa[2]*fb[10] + fa[3]*fb[14];
fc[3] = fa[0]*fb[3] + fa[1]*fb[7] + fa[2]*fb[11] + fa[3]*fb[15];
fc[4] = fa[4]*fb[0] + fa[5]*fb[4] + fa[6]*fb[8] + fa[7]*fb[12];
fc[5] = fa[4]*fb[1] + fa[5]*fb[5] + fa[6]*fb[9] + fa[7]*fb[13];
fc[6] = fa[4]*fb[2] + fa[5]*fb[6] + fa[6]*fb[10] + fa[7]*fb[14];
fc[7] = fa[4]*fb[3] + fa[5]*fb[7] + fa[6]*fb[11] + fa[7]*fb[15];
fc[8] = fa[8]*fb[0] + fa[9]*fb[4] + fa[10]*fb[8] + fa[11]*fb[12];
}
///////////////////////////////////////////////////////////////////////////////
template <typename T> TMatrix3<T> TMatrix3<T>::MatrixMult( const TMatrix3<T> &mat1 ) const
{
TMatrix3<T> result;
////////////////////////////////////////////////////////////////
// i j i k k j
result.elements[0][0] = (elements[0][0] * mat1.elements[0][0])
+ (elements[0][1] * mat1.elements[1][0])
+ (elements[0][2] * mat1.elements[2][0]);
result.elements[0][1] = (elements[0][0] * mat1.elements[0][1])
+ (elements[0][1] * mat1.elements[1][1])
+ (elements[0][2] * mat1.elements[2][1]);
result.elements[0][2] = (elements[0][0] * mat1.elements[0][2])
+ (elements[0][1] * mat1.elements[1][2])
+ (elements[0][2] * mat1.elements[2][2]);
////////////////////////////////////////////////////////////////
// i j i k k j
result.elements[1][0] = (elements[1][0] * mat1.elements[0][0])
+ (elements[1][1] * mat1.elements[1][0])
+ (elements[1][2] * mat1.elements[2][0]);
result.elements[1][1] = (elements[1][0] * mat1.elements[0][1])
+ (elements[1][1] * mat1.elements[1][1])
+ (elements[1][2] * mat1.elements[2][1]);
result.elements[1][2] = (elements[1][0] * mat1.elements[0][2])
+ (elements[1][1] * mat1.elements[1][2])
+ (elements[1][2] * mat1.elements[2][2]);
////////////////////////////////////////////////////////////////
// i j i k k j
result.elements[2][0] = (elements[2][0] * mat1.elements[0][0])
+ (elements[2][1] * mat1.elements[1][0])
+ (elements[2][2] * mat1.elements[2][0]);
result.elements[2][1] = (elements[2][0] * mat1.elements[0][1])
+ (elements[2][1] * mat1.elements[1][1])
+ (elements[2][2] * mat1.elements[2][1]);
result.elements[2][2] = (elements[2][0] * mat1.elements[0][2])
+ (elements[2][1] * mat1.elements[1][2])
+ (elements[2][2] * mat1.elements[2][2]);
////////////////////////////////////////////////////////////////
return( result );
}
template <typename T> TMatrix3<T> TMatrix3<T>::Mult( T scalar ) const
{
TMatrix3<T> res;
for(int i = 0; i < 3; ++i)
{
for(int j = 0; j < 3; ++j)
{
res.elements[i][j] = elements[i][j] * scalar;
}
}
return res;
}
///////////////////////////////////////////////////////////////////////////////
template <typename T> void TMatrix3<T>::CorrectionMatrix( const TMatrix3<T> &from, const TMatrix3<T> &to )
{
/////////////////////////
//
// GENERATE CORRECTION TO GET FROM A to C
//
// A * B = C (A and C are known we dont know B)
// (A * iA) * B = iA * C
// B = iA * C we now know B
//
/////////////////////////
TMatrix3<T> iFrom = from;
iFrom.Inverse();
*this = (iFrom * to); // B
}
///////////////////////////////////////////////////////////////////////////////
template <typename T> void TMatrix3<T>::SetRotation( const TMatrix3<T> &from )
{
TMatrix3<T> rval = from;
rval.Normalize();
*this = rval;
}
///////////////////////////////////////////////////////////////////////////////
template <typename T> void TMatrix3<T>::SetScale( const TMatrix3<T> &from ) // assumes rot is zero!
{
TMatrix3<T> RS = from;
TMatrix3<T> R = RS;
R.Normalize();
TMatrix3<T> S;
S.CorrectionMatrix( R, RS );
*this = S;
}
///////////////////////////////////////////////////////////////////////////////
template <typename T> void TMatrix3<T>::Lerp( const TMatrix3<T> &from, const TMatrix3<T> &to, T par ) // par 0.0f .. 1.0f
{
TMatrix3<T> FromR, ToR, CORR, matR;
TQuaternion<T> FromQ, ToQ, Qidn, Qrot;
//////////////////
FromR.SetRotation( from ); // froms ROTATION
ToR.SetRotation( to ); // froms ROTATION
FromQ.FromMatrix3( FromR );
ToQ.FromMatrix3( ToR );
CORR.CorrectionMatrix( from, to ); //CORR.Normalize();
Qrot.FromMatrix3( CORR );
TQuaternion<T> dQ = Qrot;
dQ.Sub( Qidn );
dQ.Scale( par );
dQ.Add( Qidn );
if( dQ.Magnitude() > T(0.0f) )
dQ.Negate();
TQuaternion<T> newQrot = dQ;
matR = newQrot.ToMatrix3();
//////////////////
*this = ( FromR * matR );
}
///////////////////////////////////////////////////////////////////////////////
template <typename T>
void TMatrix3<T>::DecomposeMatrix( TQuaternion<T>& qrot, T& Scale ) const
{
TMatrix3<T> rot = *this;
TVector3<T> UnitVector( T(1.0f), T(0.0f), T(0.0f) );
TVector3<T> XFVector = UnitVector.Transform( rot );
Scale = XFVector.Mag();
for( int i=0; i<3; i++ )
{
for( int j=0; j<3; j++ )
{
rot.SetElemXY( i,j, rot.GetElemXY( i,j ) / Scale );
}
}
qrot.FromMatrix3( rot );
}
///////////////////////////////////////////////////////////////////////////////
template <typename T>
void TMatrix3<T>::ComposeMatrix( const TQuaternion<T>& qrot, const T& Scale )
{
*this = qrot.ToMatrix3();
for( int i=0; i<3; i++ )
{
for( int j=0; j<3; j++ )
{
SetElemYX( i,j, GetElemYX( i,j ) * Scale );
}
}
}
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
template <typename T> TVector3<T> TMatrix3<T>::GetRow( int irow ) const
{
TVector3<T> out;
out.SetX(GetElemXY(0,irow));
out.SetY(GetElemXY(1,irow));
out.SetZ(GetElemXY(2,irow));
return out;
}
///////////////////////////////////////////////////////////////////////////////
template <typename T> TVector3<T> TMatrix3<T>::GetColumn( int icol ) const
{
TVector3<T> out;
out.SetX(GetElemXY(icol,0));
out.SetY(GetElemXY(icol,1));
out.SetZ(GetElemXY(icol,2));
return out;
}
///////////////////////////////////////////////////////////////////////////////
template <typename T> void TMatrix3<T>::SetRow( int irow, const TVector3<T>& v )
{
SetElemXY( 0, irow, v.GetX() );
SetElemXY( 1, irow, v.GetY() );
SetElemXY( 2, irow, v.GetZ() );
}
///////////////////////////////////////////////////////////////////////////////
template <typename T> void TMatrix3<T>::SetColumn( int icol, const TVector3<T>& v )
{
SetElemXY( icol, 0, v.GetX() );
SetElemXY( icol, 1, v.GetY() );
SetElemXY( icol, 2, v.GetZ() );
}
///////////////////////////////////////////////////////////////////////////////
template <typename T> void TMatrix3<T>::NormalVectorsIn( const TVector3<T>& xv, const TVector3<T>& yv, const TVector3<T>& zv )
{
SetColumn( 0, xv );
SetColumn( 1, yv );
SetColumn( 2, zv );
}
///////////////////////////////////////////////////////////////////////////////
template <typename T> void TMatrix3<T>::NormalVectorsOut( TVector3<T>& xv, TVector3<T>& yv, TVector3<T>& zv ) const
{
xv = GetColumn( 0 );
yv = GetColumn( 1 );
zv = GetColumn( 2 );
}
///////////////////////////////////////////////////////////////////////////////
template <typename T> void TMatrix3<T>::Transpose(void)
{
TMatrix3<T> temp = *this;
for( int i=0; i<3; i++ )
{
for( int j=0; j<3; j++ )
{
SetElemYX(i,j, temp.GetElemYX(j,i));
}
}
}
///////////////////////////////////////////////////////////////////////////////
template <typename T> void TMatrix3<T>::Inverse( void )
{
TMatrix3<T> result;
/////////////
// The rotational part of the matrix is simply the transpose of the original matrix.
for( int i=0; i<=2; i++ )
{
for( int j=0; j<=2; j++ )
{
result.SetElemYX( i,j, GetElemYX( j, i ) );
}
}
////////////
*this = result;
}
///////////////////////////////////////////////////////////////////////////////
template <typename T> void TMatrix3<T>::InverseTranspose( void )
{
TMatrix3<T> result;
/////////////
// The rotational part of the matrix is simply the transpose of the original matrix.
for( int i=0; i<=3; i++ )
{
for( int j=0; j<=3; j++ )
{
result.SetElemXY( i,j, GetElemYX( j, i ) );
}
}
////////////
*this = result;
}
///////////////////////////////////////////////////////////////////////////////
template <typename T> void TMatrix3<T>::Normalize( void )
{
TMatrix3<T> result;
T Xx = GetElemXY( 0,0 );
T Xy = GetElemXY( 0,1 );
T Xz = GetElemXY( 0,2 );
T Yx = GetElemXY( 1,0 );
T Yy = GetElemXY( 1,1 );
T Yz = GetElemXY( 1,2 );
T Zx = GetElemXY( 2,0 );
T Zy = GetElemXY( 2,1 );
T Zz = GetElemXY( 2,2 );
T Xi = T(1.0f) / sqrt<T>( (Xx*Xx) + (Xy*Xy) + (Xz*Xz) );
T Yi = T(1.0f) / sqrt<T>( (Yx*Yx) + (Yy*Yy) + (Yz*Yz) );
T Zi = T(1.0f) / sqrt<T>( (Zx*Zx) + (Zy*Zy) + (Zz*Zz) );
Xx *= Xi;
Xy *= Xi;
Xz *= Xi;
Yx *= Yi;
Yy *= Yi;
Yz *= Yi;
Zx *= Zi;
Zy *= Zi;
Zz *= Zi;
result.SetElemXY( 0,0, Xx );
result.SetElemXY( 0,1, Xy );
result.SetElemXY( 0,2, Xz );
result.SetElemXY( 1,0, Yx );
result.SetElemXY( 1,1, Yy );
result.SetElemXY( 1,2, Yz );
result.SetElemXY( 2,0, Zx );
result.SetElemXY( 2,1, Zy );
result.SetElemXY( 2,2, Zz );
*this = result;
}
///////////////////////////////////////////////////////////////////////////////
}
///////////////////////////////////////////////////////////////////////////////
| 26.430813 | 127 | 0.402202 |
63ccbe8997dabf142d1a42c3e2143e5b05da2029 | 467 | sql | SQL | db/user_seeds.sql | jordanks93/Project-2 | 9271e65b71376b070fc59acf710e5f16e0eb0e4b | [
"MIT"
] | null | null | null | db/user_seeds.sql | jordanks93/Project-2 | 9271e65b71376b070fc59acf710e5f16e0eb0e4b | [
"MIT"
] | 2 | 2021-02-08T23:47:50.000Z | 2021-02-09T00:38:43.000Z | db/user_seeds.sql | jordanks93/Project-2 | 9271e65b71376b070fc59acf710e5f16e0eb0e4b | [
"MIT"
] | 2 | 2021-02-08T18:05:33.000Z | 2021-11-29T03:33:41.000Z | USE user_playlist_db;
INSERT INTO users (user_name, email, createdAt, updatedAt)
VALUES ("testuser1", "email1@email.com", CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);
INSERT INTO users (user_name, email, createdAt, updatedAt)
VALUES ("testuser2", "email2@email.com", CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);
INSERT INTO users (user_name, email, createdAt, updatedAt)
VALUES ("testuser3", "email3@email.com", CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);
SELECT * FROM users;
| 35.923077 | 79 | 0.779443 |
933d4c335c353dcccaeb536a57f832141ee079ef | 319 | rs | Rust | synom/src/span.rs | alexcrichton/futures-await-syn | db1e5de09eb887d2028a615137815dae2eb5bc8b | [
"Apache-2.0",
"MIT"
] | 3 | 2017-10-28T08:47:40.000Z | 2017-11-23T18:03:48.000Z | synom/src/span.rs | alexcrichton/futures-await-syn | db1e5de09eb887d2028a615137815dae2eb5bc8b | [
"Apache-2.0",
"MIT"
] | null | null | null | synom/src/span.rs | alexcrichton/futures-await-syn | db1e5de09eb887d2028a615137815dae2eb5bc8b | [
"Apache-2.0",
"MIT"
] | null | null | null | use std::hash::{Hash, Hasher};
use proc_macro2;
#[derive(Clone, Copy, Default, Debug)]
pub struct Span(pub proc_macro2::Span);
impl PartialEq for Span {
fn eq(&self, _other: &Span) -> bool {
true
}
}
impl Eq for Span {}
impl Hash for Span {
fn hash<H: Hasher>(&self, _hasher: &mut H) {
}
}
| 15.95 | 48 | 0.60815 |
fb8353b06c4d948313873623ff9dc6c217ddff4f | 848 | java | Java | spring-boot/springboot-11-rabbitmq/rabbitmq-consumer/src/main/java/com/wing/config/DirectRabbitConfig.java | memory125/magic-spring | 803076f73738116125e20b97d0678bc88a1f6c40 | [
"Apache-2.0"
] | null | null | null | spring-boot/springboot-11-rabbitmq/rabbitmq-consumer/src/main/java/com/wing/config/DirectRabbitConfig.java | memory125/magic-spring | 803076f73738116125e20b97d0678bc88a1f6c40 | [
"Apache-2.0"
] | null | null | null | spring-boot/springboot-11-rabbitmq/rabbitmq-consumer/src/main/java/com/wing/config/DirectRabbitConfig.java | memory125/magic-spring | 803076f73738116125e20b97d0678bc88a1f6c40 | [
"Apache-2.0"
] | null | null | null | package com.wing.config;
import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* @author memory125
*/
@Configuration
public class DirectRabbitConfig {
//队列 起名:testQueue
@Bean
public Queue testQueue() {
return new Queue("testQueue",true);
}
//Direct交换机 起名:testExchange
@Bean
DirectExchange testExchange() {
return new DirectExchange("testExchange");
}
//绑定 将队列和交换机绑定, 并设置用于匹配键:TestDirectRouting
@Bean
Binding bindingDirect() {
return BindingBuilder.bind(testQueue()).to(testExchange()).with("testRouting");
}
} | 25.69697 | 87 | 0.728774 |
0c7542a0ccb28f28414c3f06fcfbb1dfed7a118b | 48 | html | HTML | cask/rar.html | jasonkarns/formulae.brew.sh | 0c343053d4c05070a63891a555752fdcfbc2752f | [
"BSD-2-Clause"
] | 940 | 2017-09-25T13:07:49.000Z | 2022-03-31T14:03:08.000Z | cask/rar.html | jasonkarns/formulae.brew.sh | 0c343053d4c05070a63891a555752fdcfbc2752f | [
"BSD-2-Clause"
] | 176 | 2017-09-08T21:02:03.000Z | 2022-03-25T15:18:42.000Z | cask/rar.html | Manny27nyc/formulae.brew.sh | 3603d58ecad2a6efb0c94d2ffdaeda21a6518684 | [
"BSD-2-Clause"
] | 416 | 2017-09-17T02:30:51.000Z | 2022-03-29T06:46:46.000Z | ---
title: "rar"
layout: cask
---
{{ content }}
| 8 | 13 | 0.520833 |