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
54738d5309259e1d58f5ba094e358c2ee7e6e678
237
h
C
src/manna-api.h
truefusion/manna-server
6667008f02d3279e714ad9a5a23f50b228a7c954
[ "MIT" ]
null
null
null
src/manna-api.h
truefusion/manna-server
6667008f02d3279e714ad9a5a23f50b228a7c954
[ "MIT" ]
null
null
null
src/manna-api.h
truefusion/manna-server
6667008f02d3279e714ad9a5a23f50b228a7c954
[ "MIT" ]
null
null
null
#ifndef MANNAAPII_H #define MANNAAPII_H #include "manna-connection.h" #include "manna-handler.h" namespace manna { class api_interface { public: virtual handle getHandler(std::string,std::string)=0; }; } #endif // MANNAAPII_H
14.8125
56
0.729958
0a79b443d6dcc4bbbdcea60c0449b6aaab4eab16
1,829
cs
C#
GMap/Testing/ConsoleApplication/Program.cs
cschen1205/myob-accounting-plugin
5ef712fc51def08834c813617c81f5a0072f65d1
[ "MIT" ]
null
null
null
GMap/Testing/ConsoleApplication/Program.cs
cschen1205/myob-accounting-plugin
5ef712fc51def08834c813617c81f5a0072f65d1
[ "MIT" ]
null
null
null
GMap/Testing/ConsoleApplication/Program.cs
cschen1205/myob-accounting-plugin
5ef712fc51def08834c813617c81f5a0072f65d1
[ "MIT" ]
null
null
null
using System; using System.Collections.Generic; using System.Linq; using System.Text; using GMap.NET.Projections; using DotSpatial.Projections; using System.Diagnostics; using System.Security.Cryptography; using GMap.NET.MapProviders; using GMap.NET.Internals; namespace ConsoleApplication { class Program { static void Main(string[] args) { if(false) { double x = 25; double y = 50; //Sets up a array to contain the x and y coordinates double[] xy = new double[2]; xy[0] = x; xy[1] = y; //An array for the z coordinate double[] z = new double[1]; z[0] = 1; Debug.WriteLine("first0: " + xy[0] + "; " + xy[1]); Debug.WriteLine(""); ProjectionInfo pStart = KnownCoordinateSystems.Geographic.World.WGS1984; ProjectionInfo pEnd = new ProjectionInfo("+proj=tmerc +lat_0=0 +lon_0=15 +k=0.9996 +x_0=4200000 +y_0=-1300000 +ellps=WGS84 +datum=WGS84 +to_meter=0.03125 +no_defs"); Reproject.ReprojectPoints(xy, z, pStart, pEnd, 0, 1); Debug.WriteLine(" true1: " + (int)xy[0] + "; " + (int)xy[1]); var prj = new MapyCZProjection(); { var p2 = prj.WGSToPP(y, x); Debug.WriteLine("false1: " + p2[0] + "; " + p2[1]); var p3 = prj.PPToWGS(p2[0], p2[1]); Reproject.ReprojectPoints(xy, z, pEnd, pStart, 0, 1); Debug.WriteLine(""); Debug.WriteLine(" true2: " + xy[0] + "; " + xy[1]); Debug.WriteLine("false2: " + p3[1] + "; " + p3[0]); } // 134400000],PARAMETER["false_northing",-41600000 } Console.ReadLine(); } } }
29.5
177
0.525424
1f4fad772e96665659337ca44f14d3ad6e6e0861
917
ps1
PowerShell
internal/classes/DBOpsScriptComparer.class.ps1
bulentgucuk/dbops
616091dec304aea8ff12414c01d7b2996563b66c
[ "MIT" ]
89
2018-08-16T01:58:14.000Z
2021-12-23T17:33:22.000Z
internal/classes/DBOpsScriptComparer.class.ps1
bulentgucuk/dbops
616091dec304aea8ff12414c01d7b2996563b66c
[ "MIT" ]
60
2018-08-17T02:09:49.000Z
2022-01-10T07:12:51.000Z
internal/classes/DBOpsScriptComparer.class.ps1
bulentgucuk/dbops
616091dec304aea8ff12414c01d7b2996563b66c
[ "MIT" ]
19
2018-08-16T06:56:24.000Z
2021-12-01T11:25:12.000Z
using namespace System.Collections.Generic class DBOpsScriptEqualityComparer : IEqualityComparer[String] { [bool] Equals ([string] $x, [string] $y) { return $x.Equals($y) } [int] GetHashCode ([string] $x) { return $x.GetHashCode(); } } class DBOpsScriptComparer : DBOpsScriptEqualityComparer, IComparer[String] { hidden [string[]] $Scripts DBOpsScriptComparer ([string[]]$ScriptList) { $this.Scripts = $ScriptList } [int] Compare ([string] $x, [string] $y) { #Disable all the custom sorting: using array order instead of string order return $this.Scripts.IndexOf($x).CompareTo($this.Scripts.IndexOf($y)) } [bool] Equals ([string] $x, [string] $y) { return ([DBOpsScriptEqualityComparer]$this).Equals($x, $y) } [int] GetHashCode ([string] $x) { return ([DBOpsScriptEqualityComparer]$this).GetHashCode($x) } }
33.962963
82
0.641221
0d4cdd5a1041cb142aba46dfcae22ca5d1d622f5
433
rb
Ruby
app/services/wechat_vendor_platform_proxy/v3/api_base_service.rb
vcooline/wechat_open_vendor_proxy
c9d958bddde9784351e9c6630f36b2b1d5f6f83c
[ "MIT" ]
null
null
null
app/services/wechat_vendor_platform_proxy/v3/api_base_service.rb
vcooline/wechat_open_vendor_proxy
c9d958bddde9784351e9c6630f36b2b1d5f6f83c
[ "MIT" ]
null
null
null
app/services/wechat_vendor_platform_proxy/v3/api_base_service.rb
vcooline/wechat_open_vendor_proxy
c9d958bddde9784351e9c6630f36b2b1d5f6f83c
[ "MIT" ]
null
null
null
module WechatVendorPlatformProxy module V3 class ApiBaseService < VendorBaseService def api_client @api_client ||= ApiClient.new(vendor) end def upload_client @upload_client ||= UploadClient.new(vendor) end def cipher @cipher ||= CipherService.new(vendor) end def media_service @media_service ||= MediaService.new(vendor) end end end end
19.681818
51
0.632794
a387da48088391c5d30b5df341b8e24dcfe64e6d
253
java
Java
thrift/src/main/java/com/bolly/thrift/service/Roc.java
chibaolai/java_wheels
b29efadbf3d056e28be77ae683fcecb83e1ad951
[ "MIT" ]
null
null
null
thrift/src/main/java/com/bolly/thrift/service/Roc.java
chibaolai/java_wheels
b29efadbf3d056e28be77ae683fcecb83e1ad951
[ "MIT" ]
null
null
null
thrift/src/main/java/com/bolly/thrift/service/Roc.java
chibaolai/java_wheels
b29efadbf3d056e28be77ae683fcecb83e1ad951
[ "MIT" ]
null
null
null
package com.bolly.thrift.service; import com.bolly.thrift.client.proxy.SelfCheckService; /** * Roc Facade * */ public interface Roc { /** * 检查(非线程安全,每次调用都需获取新的) * @param hospId 医院ID */ SelfCheckService getSelfCheckService(int hospId); }
14.055556
54
0.703557
3f2ff6130ac412c6c3b449057ae8b24755ea0130
8,540
php
PHP
resources/views/admin/collections/form.blade.php
pakura/sadgegrzelo
7c4be937df32576d0ac55f070d900982368c94c6
[ "MIT" ]
null
null
null
resources/views/admin/collections/form.blade.php
pakura/sadgegrzelo
7c4be937df32576d0ac55f070d900982368c94c6
[ "MIT" ]
null
null
null
resources/views/admin/collections/form.blade.php
pakura/sadgegrzelo
7c4be937df32576d0ac55f070d900982368c94c6
[ "MIT" ]
null
null
null
<div class="form-group{{($error = $errors->first('title')) ? ' validate-has-error' : '' }}"> <label class="col-sm-2 control-label required">Title:</label> <div class="col-sm-10"> <div class="input-group"> <span class="input-group-addon"><i class="fa fa-header"></i></span> {!! Form::text('title', null, [ 'id' => 'title' . $current->language, 'class' => 'form-control', ]) !!} </div> @if ($error) <span class="text-danger">{{$error}}</span> @endif </div> </div> <div class="form-group-separator"></div> <div class="form-group{{($error = $errors->first('type')) ? ' validate-has-error' : '' }}"> <label class="col-sm-2 control-label required">Type:</label> <div class="col-sm-10"> <div class="input-group"> <span class="input-group-addon"><i class="fa fa-ellipsis-h"></i></span> {!! Form::select('type', cms_collections('types'), null, [ 'id' => 'type', 'class' => 'form-control select', ] + ($current->id ? ['disabled' => 'disabled'] : [])) !!} </div> @if ($error) <span class="text-danger">{{$error}}</span> @endif </div> </div> <div class="form-group-separator"></div> <div class="row"> <div class="col-sm-6"> <div class="form-group{{($error = $errors->first('admin_order_by')) ? ' validate-has-error' : '' }}"> <label class="col-sm-4 control-label required">Admin order by:</label> <div class="col-sm-8"> <div class="input-group"> <span class="input-group-addon"><i class="fa fa-list-ol"></i></span> {!! Form::select('admin_order_by', $orderBy = cms_collections('order_by'), null, [ 'id' => 'admin_order_by', 'class' => 'form-control select', ]) !!} </div> @if ($error) <span class="text-danger">{{$error}}</span> @endif </div> </div> </div> <div class="col-sm-6"> <div class="form-group{{($error = $errors->first('web_order_by')) ? ' validate-has-error' : '' }}"> <label class="col-sm-4 control-label required">Web order by:</label> <div class="col-sm-8"> <div class="input-group"> <span class="input-group-addon"><i class="fa fa-list-ol"></i></span> {!! Form::select('web_order_by', $orderBy, null, [ 'id' => 'web_order_by', 'class' => 'form-control select', ]) !!} </div> @if ($error) <span class="text-danger">{{$error}}</span> @endif </div> </div> </div> </div> <div class="form-group-separator"></div> <div class="row"> <div class="col-sm-6"> <div class="form-group{{($error = $errors->first('admin_sort')) ? ' validate-has-error' : '' }}"> <label class="col-sm-4 control-label required">Admin sort:</label> <div class="col-sm-8"> <div class="input-group"> <span class="input-group-addon"><i class="fa fa-sort"></i></span> {!! Form::select('admin_sort', cms_collections('sort'), null, [ 'id' => 'admin_sort', 'class' => 'form-control select', ]) !!} </div> @if ($error) <span class="text-danger">{{$error}}</span> @endif </div> </div> </div> <div class="col-sm-6"> <div class="form-group{{($error = $errors->first('web_sort')) ? ' validate-has-error' : '' }}"> <label class="col-sm-4 control-label required">Web sort:</label> <div class="col-sm-8"> <div class="input-group"> <span class="input-group-addon"><i class="fa fa-sort"></i></span> {!! Form::select('web_sort', cms_collections('sort'), null, [ 'id' => 'web_sort', 'class' => 'form-control select', ]) !!} </div> @if ($error) <span class="text-danger">{{$error}}</span> @endif </div> </div> </div> </div> <div class="form-group-separator"></div> <div class="row"> <div class="col-sm-6"> <div class="form-group{{($error = $errors->first('admin_per_page')) ? ' validate-has-error' : '' }}"> <label class="col-sm-4 control-label required">Admin per page:</label> <div class="col-sm-8"> <div id="admin_per_page" class="input-group spinner" data-step="1" data-min="1" data-max="50"> <div class="input-group-btn"> <span class="btn btn-info" data-type="decrement">-</span> </div> {!! Form::text('admin_per_page', null, [ 'class' => 'form-control text-center', 'readonly' => 1 ]) !!} <div class="input-group-btn"> <span class="btn btn-info" data-type="increment">+</span> </div> </div> @if ($error) <span class="text-danger">{{$error}}</span> @endif </div> </div> </div> <div class="col-sm-6"> <div class="form-group{{($error = $errors->first('web_per_page')) ? ' validate-has-error' : '' }}"> <label class="col-sm-4 control-label required">Web per page:</label> <div class="col-sm-8"> <div id="web_per_page" class="input-group spinner" data-step="1" data-min="1" data-max="50"> <div class="input-group-btn"> <span class="btn btn-info" data-type="decrement">-</span> </div> {!! Form::text('web_per_page', null, [ 'class' => 'form-control text-center', 'readonly' => 1 ]) !!} <div class="input-group-btn"> <span class="btn btn-info" data-type="increment">+</span> </div> </div> @if ($error) <span class="text-danger">{{$error}}</span> @endif </div> </div> </div> </div> <div class="form-group-separator"></div> <div class="form-group"> <label class="col-sm-2 control-label">Description:</label> <div class="col-sm-10"> {!! Form::textarea('description', null, ['class' => 'form-control', 'rows' => '3', 'placeholder' => 'Short description']) !!} </div> </div> <div class="form-group-separator"></div> <div class="form-group"> <div class="col-sm-10 btn-action pull-right"> <button type="submit" class="btn btn-secondary btn-icon-standalone" title="{{ $submit }}"> <i class="fa fa-{{ $icon }}"></i> <span>{{ trans('general.save') }}</span> </button> @if ($current->id) <a href="{{ cms_route($current->type . '.index', [$current->id]) }}" class="btn btn-info btn-icon-standalone" title="{{ trans('general.'.$current->type) }}"> <i class="{{icon_type($current->type)}}"></i> <span>{{ucfirst($current->type)}}</span> </a> @endif <a href="{{ cms_route('collections.index') }}" class="btn btn-blue btn-icon-standalone" title="{{ trans('general.back') }}"> <i class="fa fa-arrow-left"></i> <span>{{ trans('general.back') }}</span> </a> </div> </div> @push('body.bottom') <script type="text/javascript"> $(function() { $('.select').select2({ placeholder: 'Select type...', allowClear: true }).on('select2-open', function() { // Adding Custom Scrollbar $(this).data('select2').results.addClass('overflow-hidden').perfectScrollbar(); }); }); </script> <link rel="stylesheet" href="{{ asset('assets/libs/js/select2/select2.css') }}"> <link rel="stylesheet" href="{{ asset('assets/libs/js/select2/select2-bootstrap.css') }}"> <script src="{{ asset('assets/libs/js/select2/select2.min.js') }}"></script> @endpush
41.256039
169
0.4726
b00daf0093b0feeeb75e2291705f751c57d147f7
552
py
Python
deepART/nlp/glove/import_embeddings.py
nicholaslaw/deepART
ffd425128bec02ca22ac64a6b55425fc1b29f9ba
[ "MIT" ]
1
2021-05-22T00:34:25.000Z
2021-05-22T00:34:25.000Z
deepART/nlp/glove/import_embeddings.py
nicholaslaw/deepART
ffd425128bec02ca22ac64a6b55425fc1b29f9ba
[ "MIT" ]
null
null
null
deepART/nlp/glove/import_embeddings.py
nicholaslaw/deepART
ffd425128bec02ca22ac64a6b55425fc1b29f9ba
[ "MIT" ]
null
null
null
import numpy as np def load_glove(gloveFile): ''' Requires packages: numpy gloveFile: string file path to txt file containing words and glove vectors returns a dictionary of words as keys and their corresponding vectors as values ''' f = open(gloveFile,'r', encoding='utf8') word_vector = {} for line in f: splitLine = line.split(' ') word = splitLine[0] embedding = np.asarray(splitLine[1:], dtype='float32') word_vector[word] = embedding return word_vector
27.6
83
0.630435
2c477cc10ac7069f402f3ce6dcd63622bb8efe67
2,371
py
Python
introducing-python-answers/chapter6.py
DailyYu/python-study
845c3eb13434ca6f83c508817b8d387fa5edd3c1
[ "MIT" ]
1
2021-12-25T14:22:36.000Z
2021-12-25T14:22:36.000Z
introducing-python-answers/chapter6.py
DailyYu/python-study
845c3eb13434ca6f83c508817b8d387fa5edd3c1
[ "MIT" ]
null
null
null
introducing-python-answers/chapter6.py
DailyYu/python-study
845c3eb13434ca6f83c508817b8d387fa5edd3c1
[ "MIT" ]
null
null
null
# Q1 class Thing: pass example = Thing() print(Thing) print(example) # Q2 class Thing2: letters = 'abc' print(Thing2.letters) # Q3 class Thing3: def __init__(self): self.letters = 'xyz' thing3 = Thing3() print(thing3.letters) # Q4 class Element: def __init__(self, name, symbol, number): self.name = name self.symbol = symbol self.number = number hydrogen = Element('Hydrogen', 'H', 1) # Q5 kargs = {'name': 'Hydrogen', 'symbol': 'H', 'number': 1} hydrogen = Element(**kargs) # Q6 class Element: def __init__(self, name, symbol, number): self.name = name self.symbol = symbol self.number = number def dump(self): print(f'Name:{self.name}, Symbol:{self.symbol}, Number:{self.number}') hydrogen = Element('Hydrogen', 'H', 1) hydrogen.dump() # Q7 class Element: def __init__(self, name, symbol, number): self.name = name self.symbol = symbol self.number = number def __str__(self): return f'Name:{self.name}, Symbol:{self.symbol}, Number:{self.number}' hydrogen = Element('Hydrogen', 'H', 1) print(hydrogen) # Q9 class Element: def __init__(self, name, symbol, number): self.__name = name self.__symbol = symbol self.__number = number @property def name(self): return self.__name @property def symbol(self): return self.__symbol @property def number(self): return self.__number def __str__(self): return f'Name:{self.__name}, Symbol:{self.__symbol}, Number:{self.__number}' # Q9 class Bear: def eats(self): return 'berries' class Rabbit: def eats(self): return 'clover' class Octothorpe: def eats(self): return 'campers' bear = Bear() rabbit = Rabbit() octothorpe = Octothorpe() bear.eats() rabbit.eats() octothorpe.eats() # Q10 class Lasor: def does(self): return 'disintegrate' class Claw: def does(self): return 'crush' class SmartPhone: def does(self): return 'ring' class Robot: def __init__(self): self.lasor = Lasor() self.claw = Claw() self.smartPhone = SmartPhone() def does(self): print(f'{self.lasor.does()} {self.claw.does()} {self.smartPhone.does()}') robot = Robot() robot.does()
15.701987
84
0.603543
a3cb20febca56d393c1a1831c692646af19a1ac4
8,648
java
Java
Source/DafnyRuntime/DafnyRuntimeJava/src/test/java/dafny/MultisetTest.java
zhenkuny/dafny
54b8bea1203daadf161fcd837166f97c2f56788b
[ "MIT" ]
651
2019-07-02T11:29:58.000Z
2022-03-31T11:09:15.000Z
Source/DafnyRuntime/DafnyRuntimeJava/src/test/java/dafny/MultisetTest.java
zhenkuny/dafny
54b8bea1203daadf161fcd837166f97c2f56788b
[ "MIT" ]
1,082
2019-06-30T15:29:52.000Z
2022-03-31T23:55:38.000Z
Source/DafnyRuntime/DafnyRuntimeJava/src/test/java/dafny/MultisetTest.java
zhenkuny/dafny
54b8bea1203daadf161fcd837166f97c2f56788b
[ "MIT" ]
127
2019-07-03T22:39:19.000Z
2022-03-28T02:34:44.000Z
package dafny; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; import java.math.BigInteger; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import org.junit.jupiter.api.Test; class MultisetTest { DafnyMultiset<Integer> testMSet = new DafnyMultiset<>( Arrays.asList(1, 2, 3, 1, 2, 4, 3, 5, 7, 3, 2)); DafnyMultiset<Integer> testMSubSet = new DafnyMultiset<>( Arrays.asList(1, 2, 1, 2, 4, 3, 5, 3, 2)); DafnyMultiset<Integer> testMDisjoint = new DafnyMultiset<>( Arrays.asList(-1, -3, -1, -5, 10, 11, -4)); DafnyMultiset<Integer> testMDifference = new DafnyMultiset<>(Arrays.asList(7, 3)); DafnyMultiset<Integer> testMUnion1 = new DafnyMultiset<>(Arrays.asList(1, 2, 3)); DafnyMultiset<Integer> testMUnion2 = new DafnyMultiset<>(Arrays.asList(4, 5, 6)); DafnyMultiset<Integer> testMUnion3 = new DafnyMultiset<>(Arrays.asList(1, 3, 5)); DafnyMultiset<Integer> testMUnion4 = new DafnyMultiset<>(Arrays.asList(1, 2, 3, 4, 5, 6)); DafnyMultiset<Integer> testMUnion5 = new DafnyMultiset<>(Arrays.asList(1, 2, 3, 1, 3, 5)); DafnyMultiset<Integer> testMUnion6 = new DafnyMultiset<>(Arrays.asList(1, 2, 3, 1, 3, 2)); DafnyMultiset<Integer> testMEmpty = new DafnyMultiset<>(Collections.emptyList()); DafnyMultiset<Integer> testCopy = new DafnyMultiset<>( Arrays.asList(1, 2, 3, 1, 2, 4, 3, 5, 7, 3, 2)); @Test void testSubset() { assertFalse(testMSet.isSubsetOf(testMSubSet)); assertTrue(testMSubSet.isSubsetOf(testMSet)); assertTrue(testMSet.isSubsetOf(testMSet)); assertTrue(testMSubSet.isProperSubsetOf(testMSet)); assertFalse(testMSet.isProperSubsetOf(testMSet)); assertFalse(testMSet.isProperSubsetOf(testMSubSet)); } @Test void testContains() { assertFalse(testMSet.contains(0)); assertTrue(testMSet.contains(1)); assertTrue(testMSet.contains(2)); assertTrue(testMSet.contains(3)); assertTrue(testMSet.contains(4)); assertTrue(testMSet.contains(5)); assertTrue(testMSet.contains(7)); assertFalse(testMSubSet.contains(7)); } @Test void testDisjoint() { assertFalse(testMSet.disjoint(testMSubSet)); assertTrue(testMSet.disjoint(testMDisjoint)); assertTrue(testMDisjoint.disjoint(testMSubSet)); assertTrue(testMDisjoint.disjoint(testMSubSet)); Map<Integer, BigInteger> testMap = new HashMap<>(); testMap.put(1, BigInteger.valueOf(7)); testMap.put(45, BigInteger.valueOf(18)); testMap.put(-3, BigInteger.ZERO); DafnyMultiset<Integer> testZeros = new DafnyMultiset<>(testMap); testZeros = DafnyMultiset.<Integer>update(testZeros, 10, BigInteger.ZERO); assertTrue(testMDisjoint.disjoint(testZeros)); assertTrue(testMDisjoint.disjoint(DafnyMultiset.<Integer>intersection(testZeros, testMSubSet))); assertTrue(testMSet.disjoint(DafnyMultiset.<Integer>difference(testMSet, testMSet))); } @Test void testUnion() { assertEquals(testMUnion4, DafnyMultiset.<Integer>union(testMUnion1, testMUnion2)); assertEquals(testMUnion5, DafnyMultiset.<Integer>union(testMUnion1, testMUnion3)); assertEquals(testMUnion1, DafnyMultiset.<Integer>union(testMUnion1, testMEmpty)); assertEquals(testMUnion1, DafnyMultiset.<Integer>union(testMEmpty, testMUnion1)); assertEquals(testMUnion6, DafnyMultiset.<Integer>union(testMUnion1, testMUnion1)); } @Test void testDifference() { assertEquals(testMDifference, DafnyMultiset.<Integer>difference(testMSet, testMSubSet)); assertEquals(testMEmpty, DafnyMultiset.<Integer>difference(testMSubSet, testMSet)); assertEquals(testMSet, DafnyMultiset.<Integer>difference(testMSet, testMDisjoint)); assertEquals(testMDifference, DafnyMultiset.<Integer>difference(DafnyMultiset.<Integer>difference(testMSet, testMDisjoint), testMSubSet)); } @Test void testIntersection() { assertEquals(testMSubSet, DafnyMultiset.<Integer>intersection(testMSubSet, testMSet)); assertEquals(testMSubSet, DafnyMultiset.<Integer>intersection(testMSubSet, testMSubSet)); assertEquals(testMEmpty, DafnyMultiset.<Integer>intersection(testMSubSet, testMDisjoint)); assertEquals(testMEmpty, DafnyMultiset.<Integer>intersection(DafnyMultiset.<Integer>intersection(testMSet, testMSubSet), testMDisjoint)); } @Test void testCardinality() { assertEquals(BigInteger.valueOf(11), testMSet.cardinality()); assertEquals(BigInteger.valueOf(9), testMSubSet.cardinality()); assertEquals(BigInteger.valueOf(7), testMDisjoint.cardinality()); assertEquals(BigInteger.valueOf(6), testMUnion6.cardinality()); assertEquals(BigInteger.valueOf(2), testMDifference.cardinality()); assertEquals(BigInteger.valueOf(0), testMEmpty.cardinality()); } @Test void testMSetObjectMethods() { assertEquals(testMSet, testCopy); assertEquals(testMSet.hashCode(), testCopy.hashCode()); assertEquals("multiset{1, 1, 2, 2, 2, 3, 3, 3, 4, 5, 7}", testMSet.toString()); assertEquals("multiset{1, 1, 2, 2, 2, 3, 3, 3, 4, 5, 7}", testCopy.toString()); } @Test void testUpdate() { testMSet = DafnyMultiset.<Integer>update(testMSet, 7, BigInteger.valueOf(3)); assertEquals(BigInteger.valueOf(3), DafnyMultiset.<Integer>multiplicity(testMSet, 7)); testMSet = DafnyMultiset.<Integer>update(testMSet, 8, BigInteger.valueOf(5)); assertEquals(BigInteger.valueOf(5), DafnyMultiset.<Integer>multiplicity(testMSet, 8)); testMSet = DafnyMultiset.<Integer>update(testMSet, 8, BigInteger.valueOf(0)); assertFalse(testMSet.contains(8)); } @Test void testConstructors() { Set<Integer> s = new HashSet<>(); s.add(1); s.add(2); s.add(3); Map<Integer, BigInteger> testMap = new HashMap<>(); testMap.put(1, BigInteger.ONE); testMap.put(2, BigInteger.ONE); testMap.put(3, BigInteger.ONE); DafnyMultiset<Integer> setImp = new DafnyMultiset<>(s); DafnyMultiset<Integer> mapImp = new DafnyMultiset<>(testMap); assertEquals(setImp, mapImp); assertEquals(setImp, testMUnion1); assertEquals(mapImp, testMUnion1); } @SuppressWarnings("ConstantConditions") @Test void testNullFailures() { List<Integer> l = null; Map<Integer, BigInteger> m = null; Set<Integer> s = null; assertThrows(AssertionError.class, () -> new DafnyMultiset<>(l)); assertThrows(AssertionError.class, () -> new DafnyMultiset<>(m)); assertThrows(AssertionError.class, () -> new DafnyMultiset<>(s)); assertThrows(AssertionError.class, () -> testMSet.isSubsetOf(null)); assertThrows(AssertionError.class, () -> testMSet.isProperSubsetOf(null)); assertThrows(AssertionError.class, () -> testMSet.disjoint(null)); assertThrows(AssertionError.class, () -> DafnyMultiset.<Integer>intersection(testMSet, null)); assertThrows(AssertionError.class, () -> DafnyMultiset.<Integer>update(testMSet, 5, null)); assertThrows(AssertionError.class, () -> DafnyMultiset.<Integer>union(testMSet, null)); assertThrows(AssertionError.class, () -> DafnyMultiset.<Integer>difference(testMSet, null)); } @Test void testNullEntries() { testMSet = DafnyMultiset.<Integer>update(testMSet, null, BigInteger.ONE); assertTrue(testMSet.contains(null)); assertEquals(BigInteger.ONE, DafnyMultiset.<Integer>multiplicity(testMSet, null)); testMSet = DafnyMultiset.<Integer>update(testMSet, null, BigInteger.ZERO); assertFalse(testMSet.contains(null)); assertEquals(BigInteger.ZERO, DafnyMultiset.<Integer>multiplicity(testMSet, null)); } @Test void testNegativeFailures() { Map<Integer, BigInteger> m = new HashMap<>(); m.put(3, BigInteger.valueOf(-3)); m.put(2, BigInteger.valueOf(0)); assertThrows(AssertionError.class, () -> new DafnyMultiset<>(m)); assertThrows(AssertionError.class, () -> DafnyMultiset.<Integer>update(testMSet, 16, BigInteger.valueOf(-18))); } @Test void testElements() { HashMap<Integer, BigInteger> counts = new HashMap<>(); for (Integer i : testMSet.Elements()) { if (!counts.containsKey(i)) { counts.put(i, BigInteger.ONE); } else { counts.put(i, counts.get(i).add(BigInteger.ONE)); } } assertEquals(new DafnyMultiset<>(counts), testMSet); } @Test void testUniqueElements() { for (Integer i : testMSet.UniqueElements()) { assertTrue(testMSet.contains(i)); } } }
42.600985
142
0.723289
294f1e01052e87e10faf4fc059cd01f841fd3857
25,869
sql
SQL
modules/boonex/videos/install/sql/install.sql
TsPlayTime/una
d6ea0534d84e44c8b903078fc94c9f9b557d0d64
[ "MIT" ]
null
null
null
modules/boonex/videos/install/sql/install.sql
TsPlayTime/una
d6ea0534d84e44c8b903078fc94c9f9b557d0d64
[ "MIT" ]
null
null
null
modules/boonex/videos/install/sql/install.sql
TsPlayTime/una
d6ea0534d84e44c8b903078fc94c9f9b557d0d64
[ "MIT" ]
null
null
null
-- TABLE: entries CREATE TABLE IF NOT EXISTS `bx_videos_entries` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `author` int(10) unsigned NOT NULL default '0', `added` int(11) NOT NULL default '0', `changed` int(11) NOT NULL default '0', `thumb` int(11) NOT NULL default '0', `poster` int(11) NOT NULL default '0', `video` int(11) NOT NULL default '0', `title` varchar(255) NOT NULL, `cat` int(11) NOT NULL, `multicat` text NOT NULL, `text` text NOT NULL, `duration` int(11) NOT NULL, `labels` text NOT NULL, `location` text NOT NULL, `views` int(11) NOT NULL default '0', `rate` float NOT NULL default '0', `votes` int(11) NOT NULL default '0', `srate` float NOT NULL default '0', `svotes` int(11) NOT NULL default '0', `rrate` float NOT NULL default '0', `rvotes` int(11) NOT NULL default '0', `score` int(11) NOT NULL default '0', `sc_up` int(11) NOT NULL default '0', `sc_down` int(11) NOT NULL default '0', `favorites` int(11) NOT NULL default '0', `comments` int(11) NOT NULL default '0', `reports` int(11) NOT NULL default '0', `featured` int(11) NOT NULL default '0', `allow_view_to` varchar(16) NOT NULL DEFAULT '3', `status` enum('active','awaiting','failed','hidden') NOT NULL DEFAULT 'active', `status_admin` enum('active','hidden','pending') NOT NULL DEFAULT 'active', PRIMARY KEY (`id`), FULLTEXT KEY `title_text` (`title`,`text`) ); -- TABLE: storages & transcoders CREATE TABLE IF NOT EXISTS `bx_videos_photos` ( `id` int(11) NOT NULL AUTO_INCREMENT, `profile_id` int(10) unsigned NOT NULL, `remote_id` varchar(128) NOT NULL, `path` varchar(255) NOT NULL, `file_name` varchar(255) NOT NULL, `mime_type` varchar(128) NOT NULL, `ext` varchar(32) NOT NULL, `size` bigint(20) NOT NULL, `added` int(11) NOT NULL, `modified` int(11) NOT NULL, `private` int(11) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `remote_id` (`remote_id`) ); CREATE TABLE IF NOT EXISTS `bx_videos_videos` ( `id` int(11) NOT NULL AUTO_INCREMENT, `profile_id` int(10) unsigned NOT NULL, `remote_id` varchar(128) NOT NULL, `path` varchar(255) NOT NULL, `file_name` varchar(255) NOT NULL, `mime_type` varchar(128) NOT NULL, `ext` varchar(32) NOT NULL, `size` bigint(20) NOT NULL, `dimensions` varchar(12) NOT NULL, `added` int(11) NOT NULL, `modified` int(11) NOT NULL, `private` int(11) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `remote_id` (`remote_id`) ); CREATE TABLE IF NOT EXISTS `bx_videos_media_resized` ( `id` int(11) NOT NULL AUTO_INCREMENT, `profile_id` int(10) unsigned NOT NULL, `remote_id` varchar(128) NOT NULL, `path` varchar(255) NOT NULL, `file_name` varchar(255) NOT NULL, `mime_type` varchar(128) NOT NULL, `ext` varchar(32) NOT NULL, `size` bigint(20) NOT NULL, `added` int(11) NOT NULL, `modified` int(11) NOT NULL, `private` int(11) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `remote_id` (`remote_id`) ); -- TABLE: comments CREATE TABLE IF NOT EXISTS `bx_videos_cmts` ( `cmt_id` int(11) NOT NULL AUTO_INCREMENT, `cmt_parent_id` int(11) NOT NULL DEFAULT '0', `cmt_vparent_id` int(11) NOT NULL DEFAULT '0', `cmt_object_id` int(11) NOT NULL DEFAULT '0', `cmt_author_id` int(11) NOT NULL DEFAULT '0', `cmt_level` int(11) NOT NULL DEFAULT '0', `cmt_text` text NOT NULL, `cmt_mood` tinyint(4) NOT NULL DEFAULT '0', `cmt_rate` int(11) NOT NULL DEFAULT '0', `cmt_rate_count` int(11) NOT NULL DEFAULT '0', `cmt_time` int(11) unsigned NOT NULL DEFAULT '0', `cmt_replies` int(11) NOT NULL DEFAULT '0', `cmt_pinned` int(11) NOT NULL default '0', PRIMARY KEY (`cmt_id`), KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`), FULLTEXT KEY `search_fields` (`cmt_text`) ); CREATE TABLE IF NOT EXISTS `bx_videos_cmts_notes` ( `cmt_id` int(11) NOT NULL AUTO_INCREMENT, `cmt_parent_id` int(11) NOT NULL DEFAULT '0', `cmt_vparent_id` int(11) NOT NULL DEFAULT '0', `cmt_object_id` int(11) NOT NULL DEFAULT '0', `cmt_author_id` int(11) NOT NULL DEFAULT '0', `cmt_level` int(11) NOT NULL DEFAULT '0', `cmt_text` text NOT NULL, `cmt_mood` tinyint(4) NOT NULL DEFAULT '0', `cmt_rate` int(11) NOT NULL DEFAULT '0', `cmt_rate_count` int(11) NOT NULL DEFAULT '0', `cmt_time` int(11) unsigned NOT NULL DEFAULT '0', `cmt_replies` int(11) NOT NULL DEFAULT '0', `cmt_pinned` int(11) NOT NULL default '0', PRIMARY KEY (`cmt_id`), KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`), FULLTEXT KEY `search_fields` (`cmt_text`) ); -- TABLE: votes CREATE TABLE IF NOT EXISTS `bx_videos_votes` ( `object_id` int(11) NOT NULL default '0', `count` int(11) NOT NULL default '0', `sum` int(11) NOT NULL default '0', UNIQUE KEY `object_id` (`object_id`) ); CREATE TABLE IF NOT EXISTS `bx_videos_votes_track` ( `id` int(11) NOT NULL AUTO_INCREMENT, `object_id` int(11) NOT NULL default '0', `author_id` int(11) NOT NULL default '0', `author_nip` int(11) unsigned NOT NULL default '0', `value` tinyint(4) NOT NULL default '0', `date` int(11) NOT NULL default '0', PRIMARY KEY (`id`), KEY `vote` (`object_id`, `author_nip`) ); CREATE TABLE IF NOT EXISTS `bx_videos_svotes` ( `object_id` int(11) NOT NULL default '0', `count` int(11) NOT NULL default '0', `sum` int(11) NOT NULL default '0', UNIQUE KEY `object_id` (`object_id`) ); CREATE TABLE IF NOT EXISTS `bx_videos_svotes_track` ( `id` int(11) NOT NULL AUTO_INCREMENT, `object_id` int(11) NOT NULL default '0', `author_id` int(11) NOT NULL default '0', `author_nip` int(11) unsigned NOT NULL default '0', `value` tinyint(4) NOT NULL default '0', `date` int(11) NOT NULL default '0', PRIMARY KEY (`id`), KEY `vote` (`object_id`, `author_nip`) ); CREATE TABLE IF NOT EXISTS `bx_videos_reactions` ( `object_id` int(11) NOT NULL default '0', `reaction` varchar(32) NOT NULL default '', `count` int(11) NOT NULL default '0', `sum` int(11) NOT NULL default '0', UNIQUE KEY `reaction` (`object_id`, `reaction`) ); CREATE TABLE IF NOT EXISTS `bx_videos_reactions_track` ( `id` int(11) NOT NULL AUTO_INCREMENT, `object_id` int(11) NOT NULL default '0', `author_id` int(11) NOT NULL default '0', `author_nip` int(11) unsigned NOT NULL default '0', `reaction` varchar(32) NOT NULL default '', `value` tinyint(4) NOT NULL default '0', `date` int(11) NOT NULL default '0', PRIMARY KEY (`id`), KEY `vote` (`object_id`, `author_nip`) ); -- TABLE: views CREATE TABLE `bx_videos_views_track` ( `object_id` int(11) NOT NULL default '0', `viewer_id` int(11) NOT NULL default '0', `viewer_nip` int(11) unsigned NOT NULL default '0', `date` int(11) NOT NULL default '0', KEY `id` (`object_id`,`viewer_id`,`viewer_nip`) ); -- TABLE: metas CREATE TABLE `bx_videos_meta_keywords` ( `object_id` int(10) unsigned NOT NULL, `keyword` varchar(255) NOT NULL, KEY `object_id` (`object_id`), KEY `keyword` (`keyword`) ); CREATE TABLE `bx_videos_meta_locations` ( `object_id` int(10) unsigned NOT NULL, `lat` double NOT NULL, `lng` double NOT NULL, `country` varchar(2) NOT NULL, `state` varchar(255) NOT NULL, `city` varchar(255) NOT NULL, `zip` varchar(255) NOT NULL, `street` varchar(255) NOT NULL, `street_number` varchar(255) NOT NULL, PRIMARY KEY (`object_id`), KEY `country_state_city` (`country`,`state`(8),`city`(8)) ); CREATE TABLE `bx_videos_meta_mentions` ( `object_id` int(10) unsigned NOT NULL, `profile_id` int(10) unsigned NOT NULL, KEY `object_id` (`object_id`), KEY `profile_id` (`profile_id`) ); -- TABLE: reports CREATE TABLE IF NOT EXISTS `bx_videos_reports` ( `object_id` int(11) NOT NULL default '0', `count` int(11) NOT NULL default '0', UNIQUE KEY `object_id` (`object_id`) ); CREATE TABLE IF NOT EXISTS `bx_videos_reports_track` ( `id` int(11) NOT NULL AUTO_INCREMENT, `object_id` int(11) NOT NULL default '0', `author_id` int(11) NOT NULL default '0', `author_nip` int(11) unsigned NOT NULL default '0', `type` varchar(32) NOT NULL default '', `text` text NOT NULL default '', `date` int(11) NOT NULL default '0', `checked_by` int(11) NOT NULL default '0', `status` tinyint(11) NOT NULL default '0', PRIMARY KEY (`id`), KEY `report` (`object_id`, `author_nip`) ); -- TABLES: favorites CREATE TABLE `bx_videos_favorites_track` ( `object_id` int(11) NOT NULL default '0', `author_id` int(11) NOT NULL default '0', `list_id` int(11) NOT NULL default '0', `date` int(11) NOT NULL default '0', KEY `id` (`object_id`,`author_id`) ); CREATE TABLE `bx_videos_favorites_lists` ( `id` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(255) NOT NULL, `author_id` int(11) NOT NULL default '0', `date` int(11) NOT NULL default '0', `allow_view_favorite_list_to` varchar(16) NOT NULL DEFAULT '3', PRIMARY KEY (`id`) ); -- TABLE: scores CREATE TABLE IF NOT EXISTS `bx_videos_scores` ( `object_id` int(11) NOT NULL default '0', `count_up` int(11) NOT NULL default '0', `count_down` int(11) NOT NULL default '0', UNIQUE KEY `object_id` (`object_id`) ); CREATE TABLE IF NOT EXISTS `bx_videos_scores_track` ( `id` int(11) NOT NULL AUTO_INCREMENT, `object_id` int(11) NOT NULL default '0', `author_id` int(11) NOT NULL default '0', `author_nip` int(11) unsigned NOT NULL default '0', `type` varchar(8) NOT NULL default '', `date` int(11) NOT NULL default '0', PRIMARY KEY (`id`), KEY `vote` (`object_id`, `author_nip`) ); -- STORAGES & TRANSCODERS SET @sStorageEngine = (SELECT `value` FROM `sys_options` WHERE `name` = 'sys_storage_default'); INSERT INTO `sys_objects_storage` (`object`, `engine`, `params`, `token_life`, `cache_control`, `levels`, `table_files`, `ext_mode`, `ext_allow`, `ext_deny`, `quota_size`, `current_size`, `quota_number`, `current_number`, `max_file_size`, `ts`) VALUES ('bx_videos_photos', @sStorageEngine, '', 360, 2592000, 3, 'bx_videos_photos', 'allow-deny', 'jpg,jpeg,jpe,gif,png', '', 0, 0, 0, 0, 0, 0), ('bx_videos_videos', @sStorageEngine, 'a:1:{s:6:"fields";a:1:{s:10:"dimensions";s:17:"getFileDimensions";}}', 360, 2592000, 3, 'bx_videos_videos', 'allow-deny', 'avi,flv,mpg,mpeg,wmv,mp4,m4v,mov,qt,divx,xvid,3gp,3g2,webm,mkv,ogv,ogg,rm,rmvb,asf,drc', '', 0, 0, 0, 0, 0, 0), ('bx_videos_media_resized', @sStorageEngine, '', 360, 2592000, 3, 'bx_videos_media_resized', 'allow-deny', 'jpg,jpeg,jpe,gif,png,avi,flv,mpg,mpeg,wmv,mp4,m4v,mov,qt,divx,xvid,3gp,3g2,webm,mkv,ogv,ogg,rm,rmvb,asf,drc', '', 0, 0, 0, 0, 0, 0); INSERT INTO `sys_objects_transcoder` (`object`, `storage_object`, `source_type`, `source_params`, `private`, `atime_tracking`, `atime_pruning`, `ts`, `override_class_name`, `override_class_file`) VALUES ('bx_videos_preview', 'bx_videos_media_resized', 'Storage', 'a:1:{s:6:"object";s:16:"bx_videos_photos";}', 'no', 1, 2592000, 0, '', ''), ('bx_videos_gallery', 'bx_videos_media_resized', 'Storage', 'a:1:{s:6:"object";s:16:"bx_videos_photos";}', 'no', 1, 2592000, 0, '', ''), ('bx_videos_cover', 'bx_videos_media_resized', 'Storage', 'a:1:{s:6:"object";s:16:"bx_videos_photos";}', 'no', 1, 2592000, 0, '', ''), ('bx_videos_poster', 'bx_videos_media_resized', 'Storage', 'a:1:{s:6:"object";s:16:"bx_videos_photos";}', 'no', 1, 2592000, 0, '', ''), ('bx_videos_video_poster_preview', 'bx_videos_media_resized', 'Storage', 'a:1:{s:6:"object";s:16:"bx_videos_videos";}', 'no', 0, 0, 0, 'BxDolTranscoderVideo', ''), ('bx_videos_video_poster_gallery', 'bx_videos_media_resized', 'Storage', 'a:1:{s:6:"object";s:16:"bx_videos_videos";}', 'no', 0, 0, 0, 'BxDolTranscoderVideo', ''), ('bx_videos_video_poster_cover', 'bx_videos_media_resized', 'Storage', 'a:1:{s:6:"object";s:16:"bx_videos_videos";}', 'no', 0, 0, 0, 'BxDolTranscoderVideo', ''), ('bx_videos_video_mp4', 'bx_videos_media_resized', 'Storage', 'a:1:{s:6:"object";s:16:"bx_videos_videos";}', 'no', 0, 0, 0, 'BxDolTranscoderVideo', ''), ('bx_videos_video_mp4_hd', 'bx_videos_media_resized', 'Storage', 'a:1:{s:6:"object";s:16:"bx_videos_videos";}', 'no', 0, 0, 0, 'BxDolTranscoderVideo', ''); INSERT INTO `sys_transcoder_filters` (`transcoder_object`, `filter`, `filter_params`, `order`) VALUES ('bx_videos_preview', 'Resize', 'a:3:{s:1:"w";s:3:"300";s:1:"h";s:3:"200";s:11:"crop_resize";s:1:"1";}', '0'), ('bx_videos_gallery', 'Resize', 'a:1:{s:1:"w";s:3:"500";}', '0'), ('bx_videos_cover', 'Resize', 'a:1:{s:1:"w";s:4:"2000";}', '0'), ('bx_videos_poster', 'Resize', 'a:2:{s:1:"h";s:3:"480";s:10:"force_type";s:3:"jpg";}', 0), ('bx_videos_video_poster_preview', 'Resize', 'a:3:{s:1:"w";s:3:"300";s:1:"h";s:3:"200";s:13:"square_resize";s:1:"1";}', 10), ('bx_videos_video_poster_preview', 'Poster', 'a:2:{s:1:"h";s:3:"480";s:10:"force_type";s:3:"jpg";}', 0), ('bx_videos_video_poster_gallery', 'Poster', 'a:2:{s:1:"w";s:3:"500";s:10:"force_type";s:3:"jpg";}', 0), ('bx_videos_video_poster_cover', 'Poster', 'a:2:{s:1:"h";s:3:"480";s:10:"force_type";s:3:"jpg";}', 0), ('bx_videos_video_mp4', 'Mp4', 'a:2:{s:1:"h";s:3:"480";s:10:"force_type";s:3:"mp4";}', 0), ('bx_videos_video_mp4_hd', 'Mp4', 'a:3:{s:1:"h";s:3:"720";s:13:"video_bitrate";s:4:"1536";s:10:"force_type";s:3:"mp4";}', 0); -- FORMS INSERT INTO `sys_objects_form`(`object`, `module`, `title`, `action`, `form_attrs`, `table`, `key`, `uri`, `uri_title`, `submit_name`, `params`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES ('bx_videos', 'bx_videos', '_bx_videos_form_entry', '', 'a:1:{s:7:"enctype";s:19:"multipart/form-data";}', 'bx_videos_entries', 'id', '', '', 'a:2:{i:0;s:9:"do_submit";i:1;s:10:"do_publish";}', '', 0, 1, 'BxVideosFormEntry', 'modules/boonex/videos/classes/BxVideosFormEntry.php'); INSERT INTO `sys_form_displays`(`object`, `display_name`, `module`, `view_mode`, `title`) VALUES ('bx_videos', 'bx_videos_entry_add', 'bx_videos', 0, '_bx_videos_form_entry_display_add'), ('bx_videos', 'bx_videos_entry_delete', 'bx_videos', 0, '_bx_videos_form_entry_display_delete'), ('bx_videos', 'bx_videos_entry_edit', 'bx_videos', 0, '_bx_videos_form_entry_display_edit'), ('bx_videos', 'bx_videos_entry_view', 'bx_videos', 1, '_bx_videos_form_entry_display_view'); INSERT INTO `sys_form_inputs`(`object`, `module`, `name`, `value`, `values`, `checked`, `type`, `caption_system`, `caption`, `info`, `required`, `collapsed`, `html`, `attrs`, `attrs_tr`, `attrs_wrapper`, `checker_func`, `checker_params`, `checker_error`, `db_pass`, `db_params`, `editable`, `deletable`) VALUES ('bx_videos', 'bx_videos', 'allow_view_to', '', '', 0, 'custom', '_bx_videos_form_entry_input_sys_allow_view_to', '_bx_videos_form_entry_input_allow_view_to', '', 1, 0, 0, '', '', '', '', '', '', '', '', 1, 0), ('bx_videos', 'bx_videos', 'delete_confirm', 1, '', 0, 'checkbox', '_bx_videos_form_entry_input_sys_delete_confirm', '_bx_videos_form_entry_input_delete_confirm', '_bx_videos_form_entry_input_delete_confirm_info', 1, 0, 0, '', '', '', 'Avail', '', '_bx_videos_form_entry_input_delete_confirm_error', '', '', 1, 0), ('bx_videos', 'bx_videos', 'do_publish', '_bx_videos_form_entry_input_do_publish', '', 0, 'submit', '_bx_videos_form_entry_input_sys_do_publish', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0), ('bx_videos', 'bx_videos', 'do_submit', '_bx_videos_form_entry_input_do_submit', '', 0, 'submit', '_bx_videos_form_entry_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0), ('bx_videos', 'bx_videos', 'location', '', '', 0, 'location', '_sys_form_input_sys_location', '_sys_form_input_location', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0), ('bx_videos', 'bx_videos', 'videos', 'a:2:{i:0;s:15:"bx_videos_html5";i:1;s:22:"bx_videos_record_video";}', 'a:3:{s:16:"bx_videos_simple";s:26:"_sys_uploader_simple_title";s:15:"bx_videos_html5";s:25:"_sys_uploader_html5_title";s:22:"bx_videos_record_video";s:32:"_sys_uploader_record_video_title";}', 0, 'files', '_bx_videos_form_entry_input_sys_videos', '_bx_videos_form_entry_input_videos', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_videos_form_entry_input_videos_error', '', '', 1, 0), ('bx_videos', 'bx_videos', 'pictures', 'a:1:{i:0;s:15:"bx_videos_html5";}', 'a:2:{s:16:"bx_videos_simple";s:26:"_sys_uploader_simple_title";s:15:"bx_videos_html5";s:25:"_sys_uploader_html5_title";}', 0, 'files', '_bx_videos_form_entry_input_sys_pictures', '_bx_videos_form_entry_input_pictures', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0), ('bx_videos', 'bx_videos', 'text', '', '', 0, 'textarea', '_bx_videos_form_entry_input_sys_text', '_bx_videos_form_entry_input_text', '', 0, 0, 3, '', '', '', '', '', '', 'XssHtml', '', 1, 0), ('bx_videos', 'bx_videos', 'title', '', '', 0, 'text', '_bx_videos_form_entry_input_sys_title', '_bx_videos_form_entry_input_title', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_videos_form_entry_input_title_err', 'Xss', '', 1, 0), ('bx_videos', 'bx_videos', 'cat', '', '#!bx_videos_cats', 0, 'select', '_bx_videos_form_entry_input_sys_cat', '_bx_videos_form_entry_input_cat', '', 1, 0, 0, '', '', '', 'avail', '', '_bx_videos_form_entry_input_cat_err', 'Xss', '', 1, 0), ('bx_videos', 'bx_videos', 'multicat', '', '', 0, 'custom', '_bx_videos_form_entry_input_sys_multicat', '_bx_videos_form_entry_input_multicat', '', 1, 0, 0, '', '', '', 'avail', '', '_bx_videos_form_entry_input_multicat_err', 'Xss', '', 1, 0), ('bx_videos', 'bx_videos', 'duration', '', '', 0, 'text', '_bx_videos_form_entry_input_sys_duration', '_bx_videos_form_entry_input_duration', '', 1, 0, 0, '', '', '', '', '', '', 'Int', '', 1, 0), ('bx_videos', 'bx_videos', 'added', '', '', 0, 'datetime', '_bx_videos_form_entry_input_sys_date_added', '_bx_videos_form_entry_input_date_added', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0), ('bx_videos', 'bx_videos', 'changed', '', '', 0, 'datetime', '_bx_videos_form_entry_input_sys_date_changed', '_bx_videos_form_entry_input_date_changed', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0), ('bx_videos', 'bx_videos', 'labels', '', '', 0, 'custom', '_sys_form_input_sys_labels', '_sys_form_input_labels', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0); INSERT INTO `sys_form_display_inputs`(`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES ('bx_videos_entry_add', 'title', 2147483647, 1, 1), ('bx_videos_entry_add', 'cat', 2147483647, 1, 2), ('bx_videos_entry_add', 'text', 2147483647, 1, 3), ('bx_videos_entry_add', 'videos', 2147483647, 1, 4), ('bx_videos_entry_add', 'pictures', 2147483647, 1, 5), ('bx_videos_entry_add', 'allow_view_to', 2147483647, 1, 6), ('bx_videos_entry_add', 'location', 2147483647, 1, 7), ('bx_videos_entry_add', 'do_publish', 2147483647, 1, 8), ('bx_videos_entry_delete', 'delete_confirm', 2147483647, 1, 1), ('bx_videos_entry_delete', 'do_submit', 2147483647, 1, 2), ('bx_videos_entry_edit', 'title', 2147483647, 1, 1), ('bx_videos_entry_edit', 'cat', 2147483647, 1, 2), ('bx_videos_entry_edit', 'text', 2147483647, 1, 3), ('bx_videos_entry_edit', 'videos', 2147483647, 1, 4), ('bx_videos_entry_edit', 'pictures', 2147483647, 1, 5), ('bx_videos_entry_edit', 'allow_view_to', 2147483647, 1, 6), ('bx_videos_entry_edit', 'location', 2147483647, 1, 7), ('bx_videos_entry_edit', 'do_submit', 2147483647, 1, 8), ('bx_videos_entry_view', 'duration', 2147483647, 1, 1), ('bx_videos_entry_view', 'cat', 2147483647, 1, 2), ('bx_videos_entry_view', 'added', 2147483647, 1, 3), ('bx_videos_entry_view', 'changed', 2147483647, 1, 4); -- PRE-VALUES INSERT INTO `sys_form_pre_lists`(`key`, `title`, `module`, `use_for_sets`) VALUES ('bx_videos_cats', '_bx_videos_pre_lists_cats', 'bx_videos', '0'); INSERT INTO `sys_form_pre_values`(`Key`, `Value`, `Order`, `LKey`, `LKey2`) VALUES ('bx_videos_cats', '', 0, '_sys_please_select', ''), ('bx_videos_cats', '1', 1, '_bx_videos_cat_animals_and_pets', ''), ('bx_videos_cats', '2', 2, '_bx_videos_cat_education', ''), ('bx_videos_cats', '3', 3, '_bx_videos_cat_entertainment', ''), ('bx_videos_cats', '4', 4, '_bx_videos_cat_film_and_animation', ''), ('bx_videos_cats', '5', 5, '_bx_videos_cat_music', ''), ('bx_videos_cats', '6', 6, '_bx_videos_cat_news', ''), ('bx_videos_cats', '7', 7, '_bx_videos_cat_people_and_blogs', ''), ('bx_videos_cats', '8', 8, '_bx_videos_cat_sports', ''), ('bx_videos_cats', '9', 9, '_bx_videos_cat_travel', ''); -- COMMENTS INSERT INTO `sys_objects_cmts` (`Name`, `Module`, `Table`, `CharsPostMin`, `CharsPostMax`, `CharsDisplayMax`, `Html`, `PerView`, `PerViewReplies`, `BrowseType`, `IsBrowseSwitch`, `PostFormPosition`, `NumberOfLevels`, `IsDisplaySwitch`, `IsRatable`, `ViewingThreshold`, `IsOn`, `RootStylePrefix`, `BaseUrl`, `ObjectVote`, `TriggerTable`, `TriggerFieldId`, `TriggerFieldAuthor`, `TriggerFieldTitle`, `TriggerFieldComments`, `ClassName`, `ClassFile`) VALUES ('bx_videos', 'bx_videos', 'bx_videos_cmts', 1, 5000, 1000, 3, 5, 3, 'tail', 1, 'bottom', 1, 1, 1, -3, 1, 'cmt', 'page.php?i=view-video&id={object_id}', '', 'bx_videos_entries', 'id', 'author', 'title', 'comments', '', ''), ('bx_videos_notes', 'bx_videos', 'bx_videos_cmts_notes', 1, 5000, 1000, 0, 5, 3, 'tail', 1, 'bottom', 1, 1, 1, -3, 1, 'cmt', 'page.php?i=view-video&id={object_id}', '', 'bx_videos_entries', 'id', 'author', 'title', '', 'BxTemplCmtsNotes', ''); -- VOTES INSERT INTO `sys_objects_vote` (`Name`, `TableMain`, `TableTrack`, `PostTimeout`, `MinValue`, `MaxValue`, `IsUndo`, `IsOn`, `TriggerTable`, `TriggerFieldId`, `TriggerFieldAuthor`, `TriggerFieldRate`, `TriggerFieldRateCount`, `ClassName`, `ClassFile`) VALUES ('bx_videos', 'bx_videos_votes', 'bx_videos_votes_track', '604800', '1', '1', '0', '1', 'bx_videos_entries', 'id', 'author', 'rate', 'votes', '', ''), ('bx_videos_stars', 'bx_videos_svotes', 'bx_videos_svotes_track', '604800', '1', '5', '0', '1', 'bx_videos_entries', 'id', 'author', 'srate', 'svotes', '', ''), ('bx_videos_reactions', 'bx_videos_reactions', 'bx_videos_reactions_track', '604800', '1', '1', '1', '1', 'bx_videos_entries', 'id', 'author', 'rrate', 'rvotes', 'BxTemplVoteReactions', ''); -- SCORES INSERT INTO `sys_objects_score` (`name`, `module`, `table_main`, `table_track`, `post_timeout`, `is_on`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_score`, `trigger_field_cup`, `trigger_field_cdown`, `class_name`, `class_file`) VALUES ('bx_videos', 'bx_videos', 'bx_videos_scores', 'bx_videos_scores_track', '604800', '0', 'bx_videos_entries', 'id', 'author', 'score', 'sc_up', 'sc_down', '', ''); -- REPORTS INSERT INTO `sys_objects_report` (`name`, `module`, `table_main`, `table_track`, `is_on`, `base_url`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES ('bx_videos', 'bx_videos', 'bx_videos_reports', 'bx_videos_reports_track', '1', 'page.php?i=view-video&id={object_id}', 'bx_videos_entries', 'id', 'author', 'reports', '', ''); -- VIEWS INSERT INTO `sys_objects_view` (`name`, `table_track`, `period`, `is_on`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES ('bx_videos', 'bx_videos_views_track', '86400', '1', 'bx_videos_entries', 'id', 'author', 'views', '', ''); -- FAVORITES INSERT INTO `sys_objects_favorite` (`name`, `table_track`, `table_lists`, `is_on`, `is_undo`, `is_public`, `base_url`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES ('bx_videos', 'bx_videos_favorites_track', 'bx_videos_favorites_lists', '1', '1', '1', 'page.php?i=view-video&id={object_id}', 'bx_videos_entries', 'id', 'author', 'favorites', '', ''); -- FEATURED INSERT INTO `sys_objects_feature` (`name`, `module`, `is_on`, `is_undo`, `base_url`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_flag`, `class_name`, `class_file`) VALUES ('bx_videos', 'bx_videos', '1', '1', 'page.php?i=view-video&id={object_id}', 'bx_videos_entries', 'id', 'author', 'featured', '', ''); -- CONTENT INFO INSERT INTO `sys_objects_content_info` (`name`, `title`, `alert_unit`, `alert_action_add`, `alert_action_update`, `alert_action_delete`, `class_name`, `class_file`) VALUES ('bx_videos', '_bx_videos', 'bx_videos', 'added', 'edited', 'deleted', '', ''), ('bx_videos_cmts', '_bx_videos_cmts', 'bx_videos', 'commentPost', 'commentUpdated', 'commentRemoved', 'BxDolContentInfoCmts', ''); INSERT INTO `sys_content_info_grids` (`object`, `grid_object`, `grid_field_id`, `condition`, `selection`) VALUES ('bx_videos', 'bx_videos_administration', 'id', '', ''), ('bx_videos', 'bx_videos_common', 'id', '', ''); -- SEARCH EXTENDED INSERT INTO `sys_objects_search_extended` (`object`, `object_content_info`, `module`, `title`, `active`, `class_name`, `class_file`) VALUES ('bx_videos', 'bx_videos', 'bx_videos', '_bx_videos_search_extended', 1, '', ''), ('bx_videos_cmts', 'bx_videos_cmts', 'bx_videos', '_bx_videos_search_extended_cmts', 1, 'BxTemplSearchExtendedCmts', ''); -- STUDIO: page & widget INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES (3, 'bx_videos', '_bx_videos', '_bx_videos', 'bx_videos@modules/boonex/videos/|std-icon.svg'); SET @iPageId = LAST_INSERT_ID(); SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'home'); SET @iParentPageOrder = (SELECT MAX(`order`) FROM `sys_std_pages_widgets` WHERE `page_id` = @iParentPageId); INSERT INTO `sys_std_widgets` (`page_id`, `module`, `type`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`) VALUES (@iPageId, 'bx_videos', 'content', '{url_studio}module.php?name=bx_videos', '', 'bx_videos@modules/boonex/videos/|std-icon.svg', '_bx_videos', '', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:11:"get_actions";s:6:"params";a:0:{}s:5:"class";s:18:"TemplStudioModules";}'); INSERT INTO `sys_std_pages_widgets` (`page_id`, `widget_id`, `order`) VALUES (@iParentPageId, LAST_INSERT_ID(), IF(ISNULL(@iParentPageOrder), 1, @iParentPageOrder + 1));
57.359202
490
0.674321
a3a054a56a56760d0b24a24296806cc93280fcd3
1,929
java
Java
transpiler/javatests/com/google/j2cl/transpiler/integration/arrayleafinsertion/Main.java
ribrdb/j2cl
69088e3c986a91126936a942876e64e77f083907
[ "Apache-2.0" ]
1
2019-05-27T00:20:15.000Z
2019-05-27T00:20:15.000Z
transpiler/javatests/com/google/j2cl/transpiler/integration/arrayleafinsertion/Main.java
ribrdb/j2cl
69088e3c986a91126936a942876e64e77f083907
[ "Apache-2.0" ]
null
null
null
transpiler/javatests/com/google/j2cl/transpiler/integration/arrayleafinsertion/Main.java
ribrdb/j2cl
69088e3c986a91126936a942876e64e77f083907
[ "Apache-2.0" ]
null
null
null
/* * Copyright 2017 Google 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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.j2cl.transpiler.integration.arrayleafinsertion; import static com.google.j2cl.transpiler.utils.Asserts.fail; public class Main { public static void main(String... args) { testFullArray(); testPartialArray(); } private static void testFullArray() { Object[] array = new HasName[2]; // You can insert a leaf value of a different but conforming type. array[0] = new Person(); // When inserting a leaf value the type must conform. try { array[0] = new Object(); fail("An expected failure did not occur."); } catch (ArrayStoreException e) { // expected } // You can always insert null. array[0] = null; } private static void testPartialArray() { // You can create a partially initialized array. Object[][] partialArray = new Object[1][]; // When trying to insert into the uninitialized section you'll get an NPE. try { partialArray[0][0] = new Person(); fail("An expected failure did not occur."); } catch (NullPointerException e) { // expected } // You can replace it with a fully initialized array. partialArray = new Object[1][1]; // And then insert a leaf value that conforms to the strictest leaf type partialArray[0][0] = new Person(); partialArray[0][0] = null; } }
30.140625
78
0.678072
6b835a122a0967a5e1cd7dbd478792b6be303509
946
cpp
C++
DataOrientedDesign/BoatsTestCase/ood_boat.cpp
SpowNzz/HellocplusplusBlog
492dee9dcce85e3a85fbe3d7fe23fb4d83b4f37b
[ "MIT" ]
null
null
null
DataOrientedDesign/BoatsTestCase/ood_boat.cpp
SpowNzz/HellocplusplusBlog
492dee9dcce85e3a85fbe3d7fe23fb4d83b4f37b
[ "MIT" ]
null
null
null
DataOrientedDesign/BoatsTestCase/ood_boat.cpp
SpowNzz/HellocplusplusBlog
492dee9dcce85e3a85fbe3d7fe23fb4d83b4f37b
[ "MIT" ]
null
null
null
#include "ood_boat.h" BoatMonthlyRentalInfo::BoatMonthlyRentalInfo(const string& inName, unsigned int inNrOfRents, float inMaintenanceCostPerRent, float inEarningsPerRent) : m_EstimatedReturnOnInvestment(0.0f) , m_BoatName(inName) , m_NrOfRents(inNrOfRents) , m_MaintenanceCostPerRent(inMaintenanceCostPerRent) , m_EarningsPerRent(inEarningsPerRent) { } float BoatMonthlyRentalInfo::CalculateReturnOnInvestment() const { const float earnings = CalculateEarning(); const float cost = CalculateMaintenanceCost(); return (earnings / cost) * 100.0f - 100.0f; } float BoatMonthlyRentalInfo::CalculateEarning() const { return m_NrOfRents * m_EarningsPerRent; } float BoatMonthlyRentalInfo::CalculateMaintenanceCost() const { return m_NrOfRents * m_MaintenanceCostPerRent; } void BoatMonthlyRentalInfo::SetEstimatedReturnOnInvestment(const float inValue) { m_EstimatedReturnOnInvestment = inValue; }
27.028571
79
0.785412
dd6c648cf390a2b4871dc4446844f42aac0222a6
3,632
java
Java
src/main/java/com/eziosoft/jgetreal/Effects/Funky.java
EzioisAwesome56/jGetReal
ab2ccb9b19574ed96cc884b93b7a0640f47675e1
[ "Apache-2.0" ]
2
2022-01-03T03:04:22.000Z
2022-01-03T03:07:28.000Z
src/main/java/com/eziosoft/jgetreal/Effects/Funky.java
EzioisAwesome56/jGetReal
ab2ccb9b19574ed96cc884b93b7a0640f47675e1
[ "Apache-2.0" ]
null
null
null
src/main/java/com/eziosoft/jgetreal/Effects/Funky.java
EzioisAwesome56/jGetReal
ab2ccb9b19574ed96cc884b93b7a0640f47675e1
[ "Apache-2.0" ]
1
2021-12-18T05:08:29.000Z
2021-12-18T05:08:29.000Z
package com.eziosoft.jgetreal.Effects; import com.eziosoft.jgetreal.Objects.ImageEffect; import com.eziosoft.jgetreal.Utils.FormatUtils; import com.eziosoft.jgetreal.Utils.GifUtils; import com.eziosoft.jgetreal.Utils.RasterUtils; import com.eziosoft.jgetreal.Objects.EffectResult; import com.eziosoft.jgetreal.Objects.GifContainer; import com.icafe4j.image.gif.GIFFrame; import javax.imageio.ImageIO; import java.awt.*; import java.awt.image.BufferedImage; import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.Locale; public class Funky extends ImageEffect { /** * to be used by the gui; run from an array of effects * @param input image to process * @param caption caption text if required * @return processed image * @throws IOException if something blows up during the process */ @Override public EffectResult runImageEffect(byte[] input, String... caption) throws IOException { return Watermark(input); } public Funky(){ this.name = "funky"; this.needscaption = false; } /** * detects what format the image is and automatically runs it thru the correct parser * @param in image to watermark with new funky mode * @return watermarked image * @throws IOException if something blows up */ public static EffectResult Watermark(byte[] in) throws IOException{ // first get the image format type String type = FormatUtils.getFormatName(in).toLowerCase(Locale.ROOT); // then do shit based on format return new EffectResult(type.contains("gif") ? FunkGif(in) : Funk(in), type.contains("gif") ? "gif" : "png"); } /** * applies "new funky mode" watermark to an image * @param in byte array of image to watermark * @return watermarked image * @throws IOException if something blows up for some reason... */ private static byte[] Funk(byte[] in) throws IOException { // set imageio cache to false ImageIO.setUseCache(false); // load source buffered image BufferedImage source = RasterUtils.ConvertToImage(in); // load the watermark BufferedImage kong = RasterUtils.loadResource("/funky.png"); // mirror source image source = RasterUtils.MirrorImage(source); // create graphics 2d context Graphics2D g = source.createGraphics(); // apply watermark g.drawImage(kong, null, 0, 0); // dispose of graphics g.dispose(); // mirror the image again source = RasterUtils.MirrorImage(source); // output to stream return RasterUtils.ConvertToBytes(source); } /** * applies "new funky mode" watermark to animated gifs * @param in byte array of animated gif to watermark * @return watermarked image * @throws IOException throws if something blows up in the process */ private static byte[] FunkGif(byte[] in) throws IOException { // set imageio cache to false ImageIO.setUseCache(false); // get gif frames as container GifContainer cont = GifUtils.splitAnimatedGifToContainer(in); // create new list for processes frames List<GIFFrame> imgs = new ArrayList<>(); // process every frame for (GIFFrame f : cont.getFrames()) { imgs.add(new GIFFrame(RasterUtils.ConvertToImage(Funk(RasterUtils.ConvertToBytes(f.getFrame()))), f.getDelay() * 10, f.getDisposalMethod())); } // output gif to the stream return GifUtils.ConvertToBytes(imgs); } }
36.32
153
0.669604
3899f50cbe67b9011f22c5e0e8292d7c14711dd6
937
php
PHP
docroot/sites/all/themes/custom/boston/templates/default/pane-header.tpl.php
CityOfBoston/boston.gov-d7
d710855aa5250ce5fcf254d606fa8c68f6cb3737
[ "CC0-1.0" ]
24
2018-07-28T07:41:42.000Z
2022-01-14T08:09:45.000Z
docroot/sites/all/themes/custom/boston/templates/default/pane-header.tpl.php
CityOfBoston/boston.gov-d7
d710855aa5250ce5fcf254d606fa8c68f6cb3737
[ "CC0-1.0" ]
86
2018-07-24T21:10:25.000Z
2019-11-12T22:08:50.000Z
docroot/sites/all/themes/custom/boston/templates/default/pane-header.tpl.php
CityOfBoston/boston.gov-d7
d710855aa5250ce5fcf254d606fa8c68f6cb3737
[ "CC0-1.0" ]
9
2018-09-14T20:58:26.000Z
2020-06-24T09:34:43.000Z
<?php /** * @file * Returns the HTML for Panels Everywhere's navigation pane. * * Complete documentation for this file is available online. * * @see https://drupal.org/node/2052507 */ ?> <?php if (!empty($logo)): ?> <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home" class="header__logo"><img src="<?php print $logo; ?>" alt="<?php print t('Home'); ?>" class="header__logo-image" /></a> <?php endif; ?> <?php if ($site_name || $site_slogan): ?> <div class="header__name-and-slogan"> <?php if ($site_name): ?> <h1 class="header__site-name"> <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" class="header__site-link" rel="home"><span><?php print $site_name; ?></span></a> </h1> <?php endif; ?> <?php if ($site_slogan): ?> <h2 class="header__site-slogan"><?php print $site_slogan; ?></h2> <?php endif; ?> </div> <?php endif; ?>
33.464286
204
0.590181
2ce25ed16654a74c3adf6f284fabdba0360f3f01
228
css
CSS
css/fonts.css
plbrault/christmas-countdown
47bc81a8f1e8804d8adcc4b0e55deff711101a8c
[ "MIT" ]
null
null
null
css/fonts.css
plbrault/christmas-countdown
47bc81a8f1e8804d8adcc4b0e55deff711101a8c
[ "MIT" ]
null
null
null
css/fonts.css
plbrault/christmas-countdown
47bc81a8f1e8804d8adcc4b0e55deff711101a8c
[ "MIT" ]
null
null
null
@font-face { font-family: "MountainsOfChristmas"; font-style: bold; src: url(/fonts/MountainsofChristmas-Regular.ttf); } @font-face { font-family: "AmaticSC"; font-style: bold; src: url(/fonts/AmaticSC-Bold.ttf); }
19
52
0.688596
ddc2170786889bc2e023fd1366e9622c5cc310df
923
java
Java
src/main/java/net/andreho/haxxor/cgen/instr/cflow/exits/DRETURN.java
andreho/haxxor
c9fe340f2566e1e157390a57aa3bf68583fca5f3
[ "Apache-2.0" ]
null
null
null
src/main/java/net/andreho/haxxor/cgen/instr/cflow/exits/DRETURN.java
andreho/haxxor
c9fe340f2566e1e157390a57aa3bf68583fca5f3
[ "Apache-2.0" ]
null
null
null
src/main/java/net/andreho/haxxor/cgen/instr/cflow/exits/DRETURN.java
andreho/haxxor
c9fe340f2566e1e157390a57aa3bf68583fca5f3
[ "Apache-2.0" ]
null
null
null
package net.andreho.haxxor.cgen.instr.cflow.exits; import net.andreho.haxxor.cgen.HxCodeStream; import net.andreho.haxxor.cgen.HxComputationContext; import net.andreho.haxxor.cgen.HxFrame; import net.andreho.haxxor.cgen.HxInstructionType; import net.andreho.haxxor.cgen.HxInstructionTypes; import net.andreho.haxxor.cgen.instr.abstr.ExitInstruction; /** * <br/>Created by a.hofmann on 10.03.2016.<br/> */ public class DRETURN extends ExitInstruction { public DRETURN() { super(); } @Override public HxInstructionType getInstructionType() { return HxInstructionTypes.Exit.DRETURN; } @Override public void visit(HxCodeStream codeStream) { codeStream.DRETURN(); } @Override public void compute(final HxComputationContext context, final HxFrame frame) { context.getExecutor().visit(context, this, frame); } @Override public DRETURN clone() { return new DRETURN(); } }
23.075
80
0.744312
f745c6231d2df00392279308b19d5cb0464afec6
1,543
kt
Kotlin
praesidiume-leader/src/main/kotlin/com/github/mamoru/praesidiume/praesidiumeleader/controler/ArtifactController.kt
Mamoru1234/praesidiume
258ea6d889dd56ff90c3b9d0f85efc716aba6709
[ "MIT" ]
null
null
null
praesidiume-leader/src/main/kotlin/com/github/mamoru/praesidiume/praesidiumeleader/controler/ArtifactController.kt
Mamoru1234/praesidiume
258ea6d889dd56ff90c3b9d0f85efc716aba6709
[ "MIT" ]
null
null
null
praesidiume-leader/src/main/kotlin/com/github/mamoru/praesidiume/praesidiumeleader/controler/ArtifactController.kt
Mamoru1234/praesidiume
258ea6d889dd56ff90c3b9d0f85efc716aba6709
[ "MIT" ]
null
null
null
package com.github.mamoru.praesidiume.praesidiumeleader.controler import com.github.mamoru.praesidiume.praesidiumeleader.dto.PackageDto import com.github.mamoru.praesidiume.praesidiumeleader.dto.PackageVersionDto import com.github.mamoru.praesidiume.praesidiumeleader.service.PackageArtifactService import org.springframework.core.io.FileSystemResource import org.springframework.web.bind.annotation.* @RestController @RequestMapping("/artifact") class ArtifactController( private val artifactService: PackageArtifactService ) { @GetMapping("/metadata/{packageName}") fun getPackageMetadata( @PathVariable("packageName") packageName: String ): PackageDto { return artifactService.getPackageMeta(packageName) } @GetMapping("/metadata/{packageName}/{packageVersion}") fun getMetadata( @RequestParam params: Map<String, String>, @PathVariable("packageName") packageName: String, @PathVariable("packageVersion") packageVersion: String ): PackageVersionDto { return artifactService.getArtifact(params, packageName, packageVersion) } @GetMapping("/download/{packageName}/{packageVersion}") fun getContent( @RequestParam params: Map<String, String>, @PathVariable("packageName") packageName: String, @PathVariable("packageVersion") packageVersion: String ): FileSystemResource { return FileSystemResource(artifactService.getArtifactContent(params, packageName, packageVersion)) } }
39.564103
106
0.742709
25a7d5f898a2a624cfc31912a116617cffd971f1
687
cs
C#
BindingRadioButtonsOrCheckBoxesToEnums.Core/Mvvm/ViewModelBase.cs
PyatyginSY/BindingRadioButtonsOrCheckBoxesToEnums
ce519a1e54b60a2fb65538cb89e5127f855e742f
[ "MIT" ]
null
null
null
BindingRadioButtonsOrCheckBoxesToEnums.Core/Mvvm/ViewModelBase.cs
PyatyginSY/BindingRadioButtonsOrCheckBoxesToEnums
ce519a1e54b60a2fb65538cb89e5127f855e742f
[ "MIT" ]
null
null
null
BindingRadioButtonsOrCheckBoxesToEnums.Core/Mvvm/ViewModelBase.cs
PyatyginSY/BindingRadioButtonsOrCheckBoxesToEnums
ce519a1e54b60a2fb65538cb89e5127f855e742f
[ "MIT" ]
null
null
null
// <copyright file="ViewModelBase.cs" company="Pyatygin S.Y."> // Copyright (c) Pyatygin S.Y.. All rights reserved. // </copyright> using Prism.Mvvm; using Prism.Navigation; namespace BindingRadioButtonsOrCheckBoxesToEnums.Core.Mvvm { /// <summary> /// ViewModelBase. /// </summary> public abstract class ViewModelBase : BindableBase, IDestructible { /// <summary> /// Initializes a new instance of the <see cref="ViewModelBase"/> class. /// </summary> protected ViewModelBase() { } /// <summary> /// Destroy. /// </summary> public virtual void Destroy() { } } }
22.9
80
0.57933
6f4605ec543ad961b2dab4a800cb225d683cf3f6
144
htm
HTML
_data/Vol12_Ch0501-0588/HRS0572/HRS_0572-0014.htm
bronsonavila/hrsscraper
ecbb1048ab284af361fae78adb481eff554b067a
[ "MIT" ]
1
2019-02-22T10:35:29.000Z
2019-02-22T10:35:29.000Z
_data/Vol12_Ch0501-0588/HRS0572/HRS_0572-0014.htm
bronsonavila/hrsscraper
ecbb1048ab284af361fae78adb481eff554b067a
[ "MIT" ]
null
null
null
_data/Vol12_Ch0501-0588/HRS0572/HRS_0572-0014.htm
bronsonavila/hrsscraper
ecbb1048ab284af361fae78adb481eff554b067a
[ "MIT" ]
null
null
null
<div class="WordSection1"> <p class="RegularParagraphs"> <b>§572-14 REPEALED.</b> L 1974, c 31, §3.</p> <p class="RegularParagraphs"></p> </div>
36
76
0.659722
a11dd49db04f966737950b642a8c7f2dc70e4e57
1,352
tsx
TypeScript
kibbeh/src/ui/Twemoji.tsx
LeonardSSH/dogehouse
584055ad407bc37fa35cdf36ebb271622e29d436
[ "MIT" ]
8
2021-06-30T07:02:52.000Z
2021-08-30T18:58:38.000Z
kibbeh/src/ui/Twemoji.tsx
LeonardSSH/dogehouse
584055ad407bc37fa35cdf36ebb271622e29d436
[ "MIT" ]
12
2021-07-06T12:51:13.000Z
2022-03-16T12:38:18.000Z
kibbeh/src/ui/Twemoji.tsx
LeonardSSH/dogehouse
584055ad407bc37fa35cdf36ebb271622e29d436
[ "MIT" ]
4
2021-07-15T20:33:50.000Z
2022-03-27T12:46:47.000Z
import React, { ReactElement } from "react"; import Grapheme from "grapheme-splitter"; import { parse } from "twemoji-parser"; import eRegex from "emoji-regex"; interface TwemojiProps extends React.ImgHTMLAttributes<HTMLImageElement> { text: string; className?: string; } const splitter = new Grapheme(); export const ParseTextToTwemoji: React.FC<TwemojiProps> = ({ text, className = "", ...props }) => { const regex = eRegex(); const chars = splitter.splitGraphemes(text); return ( <> {chars.map((e, i) => eRegex().test(e) ? ( <img {...props} key={i} className={`emoji ${className || ""}`} src={parse(e)[0].url} alt={parse(e)[0].text} /> ) : ( <React.Fragment key={i}>{e}</React.Fragment> ) )} </> ); }; const twemojiMap = { "📣": "1f4e3", }; interface StaticTwemojiProps extends React.ImgHTMLAttributes<HTMLImageElement> { emoji: keyof typeof twemojiMap; className?: string; } export const StaticTwemoji: React.FC<StaticTwemojiProps> = ({ emoji, className = "", ...props }) => { return ( <> <img {...props} className={`emoji ${className || ""}`} src={`https://twemoji.maxcdn.com/v/latest/svg/${twemojiMap[emoji]}.svg`} /> </> ); };
21.125
80
0.564349
c9769c827432d72433935add26e9d14dec2315d4
1,645
tsx
TypeScript
BankApp/BankApp.WebClient/src/layout/Header.tsx
MateuszWkDev/white-label-bank-app
b27eb674df38885dfb9eb2dde4ec7ce4ffbb8a78
[ "MIT" ]
null
null
null
BankApp/BankApp.WebClient/src/layout/Header.tsx
MateuszWkDev/white-label-bank-app
b27eb674df38885dfb9eb2dde4ec7ce4ffbb8a78
[ "MIT" ]
null
null
null
BankApp/BankApp.WebClient/src/layout/Header.tsx
MateuszWkDev/white-label-bank-app
b27eb674df38885dfb9eb2dde4ec7ce4ffbb8a78
[ "MIT" ]
null
null
null
import React, { useContext, useState } from 'react'; import { NavLink as RRNavLink } from 'react-router-dom'; import { Collapse, Navbar, NavbarToggler, NavbarBrand, Nav, NavbarText, NavLink, } from 'reactstrap'; import styled from 'styled-components'; import Routes from '../routes/Routes'; import ContentContext from '../contexts/ContentContext'; import LabelsContext from '../contexts/LabelsContext'; import UserMenu from './UserMenu'; import Logo from './Logo'; const Header: React.FC = () => { const { navbarItems } = useContext(ContentContext); const labels = useContext(LabelsContext); const [isOpen, setIsOpen] = useState(false); const toggle = () => setIsOpen(!isOpen); return ( <NavbarContainer color="light" light expand="md"> <NavbarBrand tag={Logo} /> <NavbarToggler onClick={toggle} /> <Collapse isOpen={isOpen} navbar> <Nav className="mr-auto" navbar> {navbarItems.map(item => { return ( <NavLink key={Routes[item.routeAlias]} tag={RRNavLink} exact to={Routes[item.routeAlias]} activeClassName="active" > {labels[item.label]} </NavLink> ); })} </Nav> <NavbarText tag={UserMenu} /> </Collapse> </NavbarContainer> ); }; const NavbarContainer = styled(Navbar)` border-bottom: solid; border-bottom-color: ${props => props.theme.colors.primary}; ul.navbar-nav > a.active.nav-link { color: ${props => props.theme.colors.primary}; } `; export default Header;
27.881356
62
0.604863
82b146a1da9bab71ce8954a6a53d25af784fcf0a
5,770
rs
Rust
src/pes.rs
CirrusNeptune/mpegts-io
728433981ff1b7b812ea2c6ee19a9b747fdddceb
[ "MIT" ]
null
null
null
src/pes.rs
CirrusNeptune/mpegts-io
728433981ff1b7b812ea2c6ee19a9b747fdddceb
[ "MIT" ]
1
2022-01-14T14:34:45.000Z
2022-01-14T14:34:45.000Z
src/pes.rs
CirrusNeptune/mpegts-io
728433981ff1b7b812ea2c6ee19a9b747fdddceb
[ "MIT" ]
null
null
null
use super::{ parse_timestamp, pts_format_args, read_bitfield, AppDetails, ErrorDetails, MpegTsParser, Payload, PayloadUnitObject, Result, SliceReader, }; use log::warn; use modular_bitfield_msb::prelude::*; use std::fmt::{Arguments, Debug, DebugStruct, Formatter}; use std::rc::Rc; /// Header of PES unit. #[bitfield] #[derive(Debug)] pub struct PesHeader { pub start_code: B24, pub stream_id: B8, pub packet_length: B16, } /// Optional header of PES unit. #[bitfield] #[derive(Debug)] pub struct PesOptionalHeader { pub marker_bits: B2, pub scrambling_control: B2, pub priority: bool, pub data_alignment_indicator: bool, pub copyright: bool, pub original: bool, pub has_pts: bool, pub has_dts: bool, pub escr: bool, pub es_rate: bool, pub dsm_trick_mode: bool, pub has_additional_copy_info: bool, pub has_crc: bool, pub has_extension: bool, pub additional_header_length: B8, } /// An elementary stream object that can be incrementally assembled from multiple /// sequential payloads and finished once the expected payload length has been read. pub trait PesUnitObject<D: AppDetails>: Debug { /// Appends a slice of data to the payload unit. fn extend_from_slice(&mut self, slice: &[u8]); /// Finishes a payload unit after the last slice is appended. fn finish(&mut self, pid: u16, parser: &mut MpegTsParser<D>) -> Result<(), D>; } #[derive(Default)] struct RawPesData(Vec<u8>); impl RawPesData { pub fn new(capacity: usize) -> Self { Self(Vec::with_capacity(capacity)) } } impl Debug for RawPesData { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { f.debug_struct("RawPesData") .field("len", &self.0.len()) .finish() } } impl<D: AppDetails> PesUnitObject<D> for RawPesData { fn extend_from_slice(&mut self, slice: &[u8]) { self.0.extend_from_slice(slice); } fn finish(&mut self, pid: u16, parser: &mut MpegTsParser<D>) -> Result<(), D> { Ok(()) } } /// Parsed Packetized Elementary Stream data (PES). /// /// Encapsulates the actual program A/V content. /// Reference: <https://en.wikipedia.org/wiki/Packetized_elementary_stream> pub struct Pes<D> { /// PES Header. pub header: PesHeader, /// Extra header present when there is enough data and the stream ID is not 0xBF. pub optional_header: Option<PesOptionalHeader>, /// Presentation time stamp. pub pts: Option<u64>, /// Decoder time stamp. pub dts: Option<u64>, /// PES data which is incomplete until the final packet arrives. pub data: Box<dyn PesUnitObject<D>>, } impl<D: AppDetails> PayloadUnitObject<D> for Pes<D> { fn extend_from_slice(&mut self, slice: &[u8]) { self.data.extend_from_slice(slice); } fn finish<'a>(mut self, pid: u16, parser: &mut MpegTsParser<D>) -> Result<Payload<'a, D>, D> { self.data.finish(pid, parser)?; Ok(Payload::Pes(self)) } fn pending<'a>(&self) -> Result<Payload<'a, D>, D> { Ok(Payload::PesPending) } } fn fmt_pts_field(s: &mut DebugStruct, name: &str, ts: &Option<u64>) { if let Some(ts) = ts { s.field(name, &Some(pts_format_args!(ts))); } else { s.field(name, &Option::<Arguments>::None); } } impl<D> Debug for Pes<D> { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { let mut s = f.debug_struct("Pes"); s.field("header", &self.header); s.field("optional_header", &self.optional_header); fmt_pts_field(&mut s, "pts", &self.pts); fmt_pts_field(&mut s, "dts", &self.dts); s.field("data", &self.data); s.finish() } } impl<D: AppDetails> MpegTsParser<D> { pub(crate) fn start_pes<'a>( &mut self, pid: u16, reader: &mut SliceReader<'a, D>, ) -> Result<Payload<'a, D>, D> { let header = read_bitfield!(reader, PesHeader); let pes_length = header.packet_length() as usize; let mut optional_length = 0; let mut pts = None; let mut dts = None; let optional_header = if pes_length >= 3 && header.stream_id() != 0xBF { let pes_optional = read_bitfield!(reader, PesOptionalHeader); let additional_length = pes_optional.additional_header_length() as usize; optional_length = 3 + additional_length; let mut o_reader = reader.new_sub_reader(additional_length)?; if pes_optional.has_pts() { if o_reader.remaining_len() < 5 { warn!("Short read of PTS"); return Err(o_reader.make_error(ErrorDetails::<D>::BadPesHeader)); } pts = Some(parse_timestamp(o_reader.read_array_ref::<5>()?)); } if pes_optional.has_dts() { if o_reader.remaining_len() < 5 { warn!("Short read of DTS"); return Err(o_reader.make_error(ErrorDetails::<D>::BadPesHeader)); } dts = Some(parse_timestamp(o_reader.read_array_ref::<5>()?)); } // TODO: Other fields Some(pes_optional) } else { None }; let unit_length = pes_length - optional_length; let data = if let Some(unit_data) = D::new_pes_unit_data(pid, unit_length) { unit_data } else { Box::new(RawPesData::new(unit_length)) }; self.start_payload_unit( Pes { header, optional_header, pts, dts, data, }, unit_length, pid, reader, ) } }
30.529101
98
0.593761
9614cc4bb0c42f57ae244668cf4522f1e02fed8d
735
swift
Swift
passKit/Helpers/NotificationNames.swift
mxw39/passforios
fcfa59d93ed70e438932f6c02a4404078a4d8dd1
[ "MIT" ]
1
2021-03-09T00:21:21.000Z
2021-03-09T00:21:21.000Z
passKit/Helpers/NotificationNames.swift
mxw39/passforios
fcfa59d93ed70e438932f6c02a4404078a4d8dd1
[ "MIT" ]
null
null
null
passKit/Helpers/NotificationNames.swift
mxw39/passforios
fcfa59d93ed70e438932f6c02a4404078a4d8dd1
[ "MIT" ]
null
null
null
// // NotificationNames.swift // pass // // Created by Yishi Lin on 17/3/17. // Copyright © 2017 Yishi Lin, Bob Sun. All rights reserved. // import Foundation public extension Notification.Name { static let passwordStoreUpdated = Notification.Name("passwordStoreUpdated") static let passwordStoreErased = Notification.Name("passwordStoreErased") static let passwordStoreChangeDiscarded = Notification.Name("passwordStoreChangeDiscarded") static let passwordSearch = Notification.Name("passwordSearch") static let passwordDisplaySettingChanged = Notification.Name("passwordDisplaySettingChanged") static let passwordDetailDisplaySettingChanged = Notification.Name("passwordDetailDisplaySettingChanged") }
36.75
109
0.790476
94de51123d4708a15a64399aed7c0e7c31dc77cc
1,006
swift
Swift
DressAsistant/Services/SkinColorService.swift
Libranner/SmartDresser
f5c2ee9242f2cd0406e7686fe364d36d517a910b
[ "MIT" ]
null
null
null
DressAsistant/Services/SkinColorService.swift
Libranner/SmartDresser
f5c2ee9242f2cd0406e7686fe364d36d517a910b
[ "MIT" ]
2
2021-05-10T10:45:30.000Z
2022-01-22T08:50:40.000Z
DressAsistant/Services/SkinColorService.swift
Libranner/SmartDresser
f5c2ee9242f2cd0406e7686fe364d36d517a910b
[ "MIT" ]
null
null
null
// // SkinColorService.swift // DressAsistant // // Created by Libranner Leonel Santos Espinal on 06/07/2019. // Copyright © 2019 Libranner Leonel Santos Espinal. All rights reserved. // import Foundation import FirebaseFirestore import CodableFirebase struct SkinColorService { private let root = "skinColors" func getAll(completion:@escaping (_ error: CustomError?, _ data: [SkinColor]) -> Void) { let db = Firestore.firestore() let docRef = db.collection(root) docRef.getDocuments { (querySnapshot, err) in var data = [SkinColor]() if let err = err { print("Error getting documents: \(err)") completion(CustomError.errorGettingData, data) } else { for document in querySnapshot!.documents { var model = try! FirestoreDecoder().decode(SkinColor.self, from: document.data()) model.documentID = document.documentID data.append(model) } completion(nil, data) } } } }
25.794872
91
0.651093
a331c70757d4753929ce86694e0e2218b23613aa
166,813
h
C
bsp/gkipc/libraries/drv/710XS/gd/inc/gd_dsp_cmd.h
Davidfind/rt-thread
56f1a8af4f9e8bad0a0fdc5cea7112767267b243
[ "Apache-2.0" ]
10
2019-12-23T07:18:27.000Z
2020-12-19T04:35:43.000Z
bsp/gkipc/libraries/drv/710XS/gd/inc/gd_dsp_cmd.h
zlzerg/rt-thread
c0a400ccbee720fc0e9ee904298f09bd07a21382
[ "Apache-2.0" ]
5
2019-02-28T10:07:03.000Z
2019-03-11T10:40:20.000Z
bsp/gkipc/libraries/drv/710XS/gd/inc/gd_dsp_cmd.h
zlzerg/rt-thread
c0a400ccbee720fc0e9ee904298f09bd07a21382
[ "Apache-2.0" ]
7
2019-07-01T02:50:47.000Z
2020-12-11T10:01:07.000Z
/*! ***************************************************************************** ** \file gd_lib/GK7101/inc/gd_dsp_cmd.h ** ** \version $Id$ ** ** \brief ** ** \attention THIS SAMPLE CODE IS PROVIDED AS IS. GOKE MICROELECTRONICS ** ACCEPTS NO RESPONSIBILITY OR LIABILITY FOR ANY ERRORS OR ** OMMISSIONS ** ** (C) Copyright 2012-2013 by GOKE MICROELECTRONICS CO.,LTD ** ***************************************************************************** */ #ifndef _GD_IDSP_CMD_H_ #define _GD_IDSP_CMD_H_ #include <gtypes.h> #include <gmodids.h> #include "gd_i2c.h" //***************************************************************************** //***************************************************************************** //** Defines and Macros //***************************************************************************** //***************************************************************************** #define GD_IDSP_SECTION_FILTER(x,y) ((x<<8)|(y<<4)) /* Configuration commands */ #define GD_INTERRUPT_SETUP 0x00001001 #define GD_H264_ENCODING_SETUP 0x00001002 #define GD_JPEG_ENCODING_SETUP 0x00001003 #define GD_H264_DECODING_SETUP 0x00001004 #define GD_JPEG_DECODING_SETUP 0x00001005 #define GD_RESET_OPERATION 0x00001006 #define GD_VIDEO_OUTPUT_RESTART 0x00001007 #define GD_H264_ENC_USE_TIMER 0x00001008 #define GD_CHIP_SELECTION 0x00001009 #define GD_HD_ECHO_SETUP 0x0000100A #define GD_SYSTEM_SETUP_INFO 0x0000100B #define GD_EIS_SWITCHVOUT_DURING_ENCODE 0x0000100C #define GD_DSP_DEBUG_LEVEL_SETUP 0x0000100D #define GD_SYSTEM_PARAMETERS_SETUP 0x0000100E #define GD_SYSTEM_IDSP_FREQ_SETUP 0x0000100F #define GD_SENSOR_INPUT_SETUP 0x00002001 #define GD_RGB_GAIN_ADJUSTMENT 0x00002002 #define GD_VIGNETTE_COMPENSATION 0x00002003 #define GD_AAA_STATISTICS_SETUP 0x00002004 #define GD_LUMA_SHARPEN_SETUP 0x00002005 #define GD_RGB_TO_RGB_SETUP 0x00002006 #define GD_RGB_TO_YUV_SETUP 0x00002007 #define GD_GAMMA_CURVE_LOOKUP 0x00002008 #define GD_NOISE_FILTER_SETUP 0x00002009 #define GD_BAD_PIXEL_CORRECT_SETUP 0x0000200A #define GD_VID_FADE_IN_OUT_SETUP 0x0000200B #define GD_CFA_DOMAIN_LEAKAGE_FILTER 0x0000200C #define GD_MCTF_MV_STAB_SETUP 0x0000200D #define GD_SET_SLOW_SHUT_UP_SAMPL_RT 0x0000200E #define GD_SET_REPEAT_FRM 0x0000200F #define GD_MCTF_GMV_SETUP 0x00002010 #define GD_DIS_SETUP 0x00002011 //This command is used to setup the DIS algorithm paramete and related debug stuff. #define GD_SET_VIN_CAPTURE_WIN 0x00002100 #define GD_AMPLIFIER_LINEARIZATION 0x00002101 #define GD_PIXEL_SHUFFLE 0x00002102 #define GD_BLACK_LEVEL_CORRECTION_CONFIG 0x00002103 #define GD_BLACK_LEVEL_STATE_TABLES 0x00002104 #define GD_BLACK_LEVEL_DETECTION_WINDOW 0x00002105 #define GD_FIXED_PATTERN_NOISE_CORRECTION 0x00002106 #define GD_CFA_NOISE_FILTER_INFO 0x00002107 #define GD_DIGITAL_GAIN_SATURATION_LEVEL 0x00002108 #define GD_LOCAL_EXPOSURE 0x00002109 #define GD_DEMOASIC_FILTER 0x0000210A #define GD_RGB_NOISE_FILTER 0x0000210B #define GD_COLOR_CORRECTION 0x0000210C #define GD_CHROMA_MEDIAN_FILTER_INFO 0x0000210D #define GD_CHROMA_SCALE 0x0000210E #define GD_LUMA_SHARPENING 0x0000210F #define GD_AAA_STATISTICS_SETUP1 0x00002110 #define GD_AAA_STATISTICS_SETUP2 0x00002111 #define GD_AAA_PSEUDO_Y_SETUP 0x00002112 #define GD_AAA_HISTORGRAM_SETUP 0x00002113 #define GD_RAW_COMPRESSION 0x00002114 #define GD_RAW_DECOMPRESSION 0x00002115 #define GD_ROLLING_SHUTTER_COMPENSATION 0x00002116 #define GD_SET_ZOOM_FACTOR 0x00002117 #define GD_AAA_STATISTICS_SETUP3 0x00002118 #define GD_VIDEO_PREVIEW_SETUP 0x00002119 #define GD_VIN_RESET 0x0000211A #define GD_ANTI_ALIASING 0x0000211B #define GD_FPN_CALIBRATION 0x0000211C #define GD_BLACK_LEVEL_GLOBAL_OFFSET 0x0000211D #define GD_RGB_DIRECTIONAL_FILTER 0x0000211E #define GD_HDR_MIXER 0x0000211F #define GD_LUMA_SHARPENING_LINEARIZATION 0x00002120 #define GD_LUMA_SHARPENING_FIR_CONFIG 0x00002121 #define GD_LUMA_SHARPENING_LNL 0x00002122 #define GD_LUMA_SHARPENING_TONE 0x00002123 #define GD_MULTI_STREAM_VIDEO_PREVIEW 0x00002124 #define GD_ENA_SECOND_STREAM_ENCODE 0x00002125 #define GD_SET_ALPHA_CHANNEL 0x00002126 #define GD_MODIFY_FRAME_BUFFER 0x00002127 #define GD_SET_ACT_WIN_CENTER 0x00002128 #define GD_SET_WARP_CONTROL 0x00002129 #define GD_EARLY_WB_GAIN 0x0000212A #define GD_LUMA_SHARPENING_EDGE_CONTROL 0x00002130 #define GD_LUMA_SHARPENING_BLEND_CONTROL 0x00002131 #define GD_LUMA_SHARPENING_LEVEL_CONTROL 0x00002132 #define GD_LUMA_SHARPENING_MISC_CONTROL 0x00002133 #define GD_AAA_EARLY_WB_GAIN 0x00002134 // H264/JPEG encoding mode commands #define GD_VIDEO_PREPROCESSING 0x00003001 #define GD_FAST_AAA_CAPTURE 0x00003002 #define GD_H264_ENCODE 0x00003004 #define GD_H264_ENCODE_FROM_MEMORY 0x00003005 #define GD_H264_BITS_FIFO_UPDATE 0x00003006 #define GD_ENCODING_STOP 0x00003007 #define GD_MODIFY_CMD_DLY 0x00003008 #define GD_STILL_CAPTURE 0x00004001 #define GD_JPEG_ENCODE_RESCALE_FROM_MEMORY 0x00004002 #define GD_JPEG_BITS_FIFO_UPDATE 0x00004003 #define GD_FREE_RAW_YUV_PIC_BUFFER 0x00004004 #define GD_JPEG_RAW_YUV_STOP 0x00004005 #define GD_MJPEG_ENCODE 0x00004006 #define GD_VID_FADE_IN_OUT 0x00004007 #define GD_MJPEG_ENCODE_WITH_H264 0x00004008 #define GD_OSD_INSERT 0x00004009 #define GD_YUV422_CAPTURE 0x00004010 #define GD_SEND_CAVLC_RESULT 0x00004011 #define GD_STILL_CAPTURE_IN_REC 0x00004012 // Z.ZHOU added for still capture during active recording #define GD_OSD_BLEND 0x00004013 #define GD_INTERVAL_CAPTURE 0x00004014 #define GD_STILL_CAPTURE_ADV 0x00004015 /* H264/JPEG decode mode commnads */ #define GD_H264_DECODE 0x00005002 #define GD_JPEG_DECODE 0x00005003 #define GD_RAW_PICTURE_DECODE 0x00005004 #define GD_RESCALE_POSTPROCESSING 0x00005005 #define GD_H264_DECODE_BITS_FIFO_UPDATE 0x00005006 #define GD_H264_PLAYBACK_SPEED 0x00005007 #define GD_H264_TRICKPLAY 0x00005008 #define GD_DECODE_STOP 0x00005009 #define GD_MULTI_SCENE_DECODE 0x00005010 #define GD_CAPTURE_VIDEO_PICTURE 0x00005011 #define GD_CAPTURE_STILL_PICTURE 0x00005012 #define GD_JPEG_FREEZE 0x00005013 #define GD_MULTI_SCENE_SETUP 0x00005014 #define GD_MULTI_SCENE_DECODE_ADV 0x00005015 #define GD_JPEG_DECODE_THUMBNAIL_WARP 0x00005016 #define GD_MULTI_SCENE_DECODE_ADV_2 0x00005017 /* IP CAM commands */ #define GD_IPCAM_VIDEO_PREPROCESSING 0x00006001 #define GD_IPCAM_VIDEO_CAPTURE_PREVIEW_SIZE_SETUP 0x00006002 #define GD_IPCAM_VIDEO_ENCODE_SIZE_SETUP 0x00006003 #define GD_IPCAM_REAL_TIME_ENCODE_PARAM_SETUP 0x00006004 #define GD_IPCAM_VIDEO_FORCED_IDR 0x00006005 #define GD_IPCAM_VIDEO_SYSTEM_SETUP 0x00006006 #define GD_IPCAM_OSD_INSERT 0x00006007 #define GD_IPCAM_SET_PRIVACY_MASK 0x00006008 #define GD_IPCAM_QP_RATIO 0x00006009 /* VOUT commands */ #define GD_VOUT_MIXER_SETUP 0x00007001 #define GD_VOUT_VIDEO_SETUP 0x00007002 #define GD_VOUT_DEFAULT_IMG_SETUP 0x00007003 #define GD_VOUT_OSD_SETUP 0x00007004 #define GD_VOUT_OSD_BUFFER_SETUP 0x00007005 #define GD_VOUT_OSD_CLUT_SETUP 0x00007006 #define GD_VOUT_DISPLAY_SETUP 0x00007007 #define GD_VOUT_DVE_SETUP 0x00007008 #define GD_VOUT_RESET 0x00007009 #define GD_VOUT_DISPLAY_CSC_SETUP 0x0000700A #define GD_VOUT_DIGITAL_OUTPUT_MODE_SETUP 0x0000700B /* * These GD_* commands are for experimental use only */ #define GD_CFA_NOISE_FILTER 0x0000f001 #define GD_DIGITAL_GAIN_SATURATION 0x0000f002 #define GD_CHROMA_MEDIAN_FILTER 0x0000f003 #define GD_LUMA_DIRECTIONAL_FILTER 0x0000f004 #define GD_LUMA_SHARPEN 0x0000f005 #define GD_MAIN_RESAMPLER_BANDWIDTH 0x0000f006 #define GD_CFA_RESAMPLER_BANDWIDTH 0x0000f007 #define GD_DSP_DEBUG_0 0x0000ff00 #define GD_DSP_DEBUG_1 0x0000ff01 #define GD_AAA_STATISTICS_DEBUG 0x0000ff02 #define GD_DSP_SPECIAL 0x0000ff03 #define GD_AAA_STATISTICS_DEBUG1 0x0000ff04 #define GD_AAA_STATISTICS_DEBUG2 0x0000ff05 #define GD_BAD_PIXEL_CROP 0x0000ff06 #define GD_DSP_DEBUG_2 0x0000ff07 #define GD_DSP_DEBUG_3 0x0000ff08 #define GD_UPDATE_IDSP_CONFIG 0x0000ff09 #define GD_REAL_TIME_RATE_MODIFY 0x0000ff0a #define GD_STOP_FATAL_UCODE 0x0000ffa0 #define GD_CMD_MSG_CMD_ID(cmd_code) (((cmd_code)&0xffffff)) // cmd_code: 0x00001002 GD_H264_ENCODING_SETUP #define GD_H264_ENCODER_SETUP_GET_CHAN_ID(cmd_code) (((cmd_code)>>24)&0x1f) #define GD_H264_ENCODER_SETUP_GET_STREAM_ID(cmd_code) ((cmd_code)>>30) #define GD_PRIMARY_STREAM (0) #define GD_SECONDARY_STREAM (1) #define GD_NUM_PIC_TYPES (3) // U8 quality; #define GD_QLEVEL_MASK (0x1f) #define GD_LEVEL_MASK (0xE0) #define GD_SIMPLE_GOP (0) #define GD_P2B2REF_GOP (1) #define GD_P2B3REF_GOP (2) #define GD_P2B3_ADV_GOP (3) #define GD_HI_GOP_DRAM (4) #define GD_HI_GOP_SMEM (5) #define GD_NON_REF_P_GOP (6) #define GD_HI_P_GOP (7) // cmd_code: 0x0000100B GD_SYSTEM_SETUP_INFO #define GD_CAMCORDER_APP_MODE 0 #define GD_IP_CAMCORDER_APP_MODE 2 // cmd_code: 0x0000100D GD_DSP_DEBUG_LEVEL_SETUP // U8 debug_level; #define GD_CODING_ORC_THREAD_0_PRINTF_DISABLE 0x1 #define GD_CODING_ORC_THREAD_1_PRINTF_DISABLE 0x2 #define GD_CODING_ORC_THREAD_2_PRINTF_DISABLE 0x4 #define GD_CODING_ORC_THREAD_3_PRINTF_DISABLE 0x8 // cmd_code: 0x0000100E GD_SYSTEM_PARAMETERS_SETUP // U32 audio_clk_freq; #define GD_AUDIO_CLK_12_288_MHZ 12288000 // cmd_code: 0x0000100F GD_SYSTEM_IDSP_FREQ_SETUP // U32 idsp_freq; #define GD_IDSP_FREQ_144_MHZ 144000000 // cmd_code: 0x00002004 GD_AAA_STATISTICS_SETUP #define GD_AAA_FILTER_SELECT_BOTH 0 #define GD_AAA_FILTER_SELECT_CFA 1 #define GD_AAA_FILTER_SELECT_YUV 2 // cmd_code: 0x00002009 GD_NOISE_FILTER_SETUP // U32 strength; #define GD_BAD_PIXEL_CORRECTION_ENABLE 0x00000001 #define GD_LEAKAGE_FILTER_ENABLE 0x00000002 #define GD_NOISE_FILTER_ENABLE 0x00000004 #define GD_LOCAL_EXPOSURE_FILTER_ENABLE 0x00000008 #define GD_DEMOSAIC_FILTER_ENABLE 0x00000010 #define GD_JAGGED_FILTER_ENABLE 0x00000020 #define GD_RGB_DIRECTIONAL_FILTER_ENABLE 0x00000040 #define GD_SPECKLE_FILTER_ENABLE 0x00000080 #define GD_REINTERPOLATE_FILTER_ENABLE 0x00000100 #define GD_LUMA_SHARPENING_FILTER_ENABLE 0x00000200 #define GD_CHROMA_SCALE_FILTER_ENABLE 0x00000400 #define GD_CHROMA_MEDIAN_FILTER_ENABLE 0x00000800 #define GD_BLACK_LEVEL_ENABLE 0x00001000 #define GD_FPN_ENABLE 0x00002000 #define GD_COLOR_CORRECTION_ENABLE 0x00004000 #define GD_IMG_3A_ENABLE 0x00008000 #define GD_AMPLIFIER_LINEARIZATION_ENABLE 0x00010000 // cmd_code: 0x00002100 GD_SET_VIN_CAPTURE_WIN // GD_S_CTRL_REG // U16 data_edge :1; #define GD_DATA_VAL_RISING_EDGE 0 #define GD_DATA_VAL_FALLING_EDGE 1 // U16 mastSlav_mod:2; #define GD_MAS_SLAV_MOD_UND 0x0 #define GD_SLAVE_MOD 0x1 #define GD_MAS_MOD 0x2 #define GD_MAS_SPECIAL 0x3 // U16 emb_sync :1; #define GD_EMB_SYNC_IN_DATA 0x1 // U16 emb_sync_mode:1; #define GD_EMB_SYNC_656 0x0 #define GD_ALL_ZERO_IN_BLANK 0x1 // U16 emb_sync_loc:2; #define GD_EMB_SYNC_IN_LOW_PIX 0x0 #define GD_EMB_SYNC_IN_UP_PIX 0x1 #define GD_EMB_SYNC_IN_BOTH 0x2 // U16 vs_pol :1; #define GD_VSYNC_POL_ACT_H 0x0 #define GD_VSYNC_POL_ACT_L 0x1 // U16 hs_pol :1; #define GD_HSYNC_POL_ACT_H 0x0 #define GD_HSYNC_POL_ACT_L 0x1 // U16 sony_fld_mod:1; #define GD_FLD_MOD_NORMAL 0 #define GD_FLD_MOD_SONY 1 // GD_S_INPUT_CONFIG_REG // U16 pad_type #define GD_LVCMOS 0x0 #define GD_LVDS 0x1 // U16 data_rate #define GD_SDR 0x0 #define GD_DDR 0x1 // U16 :1; #define GD_ONE_PIX_WIDE 0 #define GD_TWO_PIX_WIDE 1 // U16 inp_src #define GD_LVDS_SRC 0x0 #define GD_GPIO_SRC 0x1 // U16 inp_src_ty #define GD_RGB_IN 0x0 #define GD_YUV_IN 0x1 // U16 yuv_inp_ord #define GD_CrYCbY_1PIX 0x0 #define GD_CbYCrY_1PIX 0x1 #define GD_YCrYCb_1PIX 0x2 #define GD_YCbYCr_1PIX 0x3 #define GD_YCrYCb_2PIX 0x0 #define GD_YCbYCr_2PIX 0x1 #define GD_CrYCbY_2PIX 0x2 #define GD_CbYCrY_2PIX 0x3 // cmd_code: 0x00002119 GD_VIDEO_PREVIEW_SETUP // U32 cmd_code; #define GD_PREVIEW_ID_A 0 #define GD_PREVIEW_ID_B 1 // cmd_code: 0x00002129 GD_SET_WARP_CONTROL // U32 warp_control; #define GD_WARP_CONTROL_DISABLE 0 #define GD_WARP_CONTROL_ENABLE 1 // cmd_code: 0x00003001 GD_VIDEO_PREPROCESSING #define GD_RGB_RAW 0 #define GD_YUV_422_INTLC 1 #define GD_YUV_422_PROG 2 // U8 preview_format_A : 4; // U8 preview_format_B : 3; #define GD_PREVIEW_FORMAT_PROGRESS 0 #define GD_PREVIEW_FORMAT_INTERLACE 1 #define GD_PREVIEW_FORMAT_DEFAULT_IMAGE_PROGRESS 2 #define GD_PREVIEW_FORMAT_DEFAULT_IMAGE_INTERLACE 3 #define GD_PREVIEW_FORMAT_PROGRESS_TOP_FIELD 4 #define GD_PREVIEW_FORMAT_PROGRESS_BOT_FIELD 5 #define GD_PREVIEW_FORMAT_NO_OUTPUT 6 // cmd_code: 0x00003007 GD_ENCODING_STOP // U32 stop_method; #define GD_H264_STOP_IMMEDIATELY 0 #define GD_H264_STOP_ON_NEXT_IP 1 #define GD_H264_STOP_ON_NEXT_I 2 #define GD_H264_STOP_ON_NEXT_IDR 3 #define GD_EMERG_STOP 0xff // cmd_code: 0x00004001 GD_STILL_CAPTURE #define GD_JPEG_OUTPUT_SELECT_MAIN_JPEG_BITS 0x1 #define GD_JPEG_OUTPUT_SELECT_THUMB_JPEG_BITS 0x4 #define GD_JPEG_OUTPUT_SELECT_MAIN_YUV 0x8 #define GD_JPEG_OUTPUT_SELECT_PREVIEW_YUV 0x10 // U8 still_process_mode; #define GD_STILL_PROCESS_MODE_NORMAL 0 #define GD_STILL_PROCESS_MODE_HIGH_ISO 1 #define GD_STILL_PROCESS_MODE_LOW_ISO 2 // U8 yuv_proc_mode; #define GD_YUV_START_NO_CNTRL (0) #define GD_YUV_START_EXP_MODE (1) #define GD_YUV_START_SLW_MODE (2) #define GD_YUV_START_SLW_STATS_MODE (3) // cmd_code: 0x00004014 GD_INTERVAL_CAPTURE // U32 action; #define GD_CAP_IDLE (0) #define GD_CAP_INITIATE (1) #define GD_CAP_CAPTURE (2) #define GD_CAP_TERMINATE (3) // cmd_code: 0x00006008 GD_IPCAM_SET_PRIVACY_MASK // U8 Y; // U8 U; // U8 V; // use privacy mask to label a region to let MCTF to pass through it #define GD_PRIVACY_MASK_OFF 0 #define GD_PRIVACY_MASK_ON 1 #define GD_PRIVACY_MASK_LABEL_MCTF_PASS_THROUGH 2 // Adding Macros defined in the interface between ARM and VDSP //following three configuration is predefined inside the coding module. //and shared between the ARM and DSP. //Used to describe the layout of the Coding CTX information in the DRAM sent from //ARM to DSP. #define GD_CTX_WIDTH (416) #define GD_I_CTX_SZ (52*GD_CTX_WIDTH) #define GD_FLD_CTX_OFS (104*GD_CTX_WIDTH) #define GD_CABAC_CTX_MEM_SIZE (GD_CTX_WIDTH*(104*2)) #define GD_JPG_LU_HUFF_DRAM_SIZE (256) #define GD_PG_CH_HUFF_DRAM_SIZE (256) #define GD_MCTF_CFG_SZ (22528) //***************************************************************************** //***************************************************************************** //** Enumerated types //***************************************************************************** //***************************************************************************** typedef enum { GD_IDSP_CMD_SEC1_VIN = GD_IDSP_SECTION_FILTER(1, 0), GD_IDSP_CMD_SEC1_AML = GD_IDSP_SECTION_FILTER(1, 1), GD_IDSP_CMD_SEC1_RLC = GD_IDSP_SECTION_FILTER(1, 2), GD_IDSP_CMD_SEC1_SMM = GD_IDSP_SECTION_FILTER(1,14), GD_IDSP_CMD_SEC1_SMT = GD_IDSP_SECTION_FILTER(1,15), GD_IDSP_CMD_SEC2_BFN = GD_IDSP_SECTION_FILTER(2, 0), GD_IDSP_CMD_SEC2_BPC = GD_IDSP_SECTION_FILTER(2, 1), GD_IDSP_CMD_SEC2_PSC = GD_IDSP_SECTION_FILTER(2, 2), GD_IDSP_CMD_SEC2_AAC = GD_IDSP_SECTION_FILTER(2, 3), GD_IDSP_CMD_SEC2_DGN = GD_IDSP_SECTION_FILTER(2, 4), GD_IDSP_CMD_SEC2_LEA = GD_IDSP_SECTION_FILTER(2, 5), GD_IDSP_CMD_SEC2_DMS = GD_IDSP_SECTION_FILTER(2, 6), GD_IDSP_CMD_SEC2_CLC = GD_IDSP_SECTION_FILTER(2, 7), GD_IDSP_CMD_SEC2_AAA = GD_IDSP_SECTION_FILTER(2, 8), GD_IDSP_CMD_SEC2_RYC = GD_IDSP_SECTION_FILTER(2, 9), GD_IDSP_CMD_SEC2_LSH = GD_IDSP_SECTION_FILTER(2,10), GD_IDSP_CMD_SEC2_CMN = GD_IDSP_SECTION_FILTER(2,11), GD_IDSP_CMD_SEC2_CDS = GD_IDSP_SECTION_FILTER(2,12), GD_IDSP_CMD_SEC2_LRS = GD_IDSP_SECTION_FILTER(2,13), GD_IDSP_CMD_SEC2_CRS = GD_IDSP_SECTION_FILTER(2,14), GD_IDSP_CMD_SEC2_MRS = GD_IDSP_SECTION_FILTER(2,15), GD_IDSP_CMD_SEC3_VWP = GD_IDSP_SECTION_FILTER(3, 0), GD_IDSP_CMD_SEC4_MVU = GD_IDSP_SECTION_FILTER(4, 0), GD_IDSP_CMD_SEC5_LPA = GD_IDSP_SECTION_FILTER(5, 0), GD_IDSP_CMD_SEC5_CPA = GD_IDSP_SECTION_FILTER(5, 1), GD_IDSP_CMD_SEC5_LDA = GD_IDSP_SECTION_FILTER(5, 2), GD_IDSP_CMD_SEC5_CDA = GD_IDSP_SECTION_FILTER(5, 3), GD_IDSP_CMD_SEC6_LPB = GD_IDSP_SECTION_FILTER(6, 0), GD_IDSP_CMD_SEC6_CPB = GD_IDSP_SECTION_FILTER(6, 1), GD_IDSP_CMD_SEC7_LPC = GD_IDSP_SECTION_FILTER(7, 0), GD_IDSP_CMD_SEC7_CPC = GD_IDSP_SECTION_FILTER(7, 1), GD_IDSP_CMD_SEC7_LDC = GD_IDSP_SECTION_FILTER(7, 2), GD_IDSP_CMD_SEC7_CDC = GD_IDSP_SECTION_FILTER(7, 3), GD_IDSP_CMD_SEC7_MRC = GD_IDSP_SECTION_FILTER(7, 4), }GD_IDSP_SECTION_FILTER_E; typedef enum { GD_IDSP_CMD_SECTION_DATA_BIT_UNIT, GD_IDSP_CMD_SECTION_DATA_BYTE_UNIT, GD_IDSP_CMD_SECTION_DATA_WORD_UNIT, GD_IDSP_CMD_SECTION_DATA_DOUBLE_UNIT, }GD_IDSP_CMD_DATA_UNIT_E; typedef enum { GD_IDSP_CMD_FILTER_UNKNOW, GD_IDSP_CMD_FILTER_VIDEO_IN, }GD_IDSP_CMD_FILTER_E; typedef enum { GD_IDSP_CMD_REG_FILTER_DEF_OFFSET, GD_IDSP_CMD_REG_FILTER_DEF_START_BIT, GD_IDSP_CMD_REG_FILTER_DEF_NUM_BITS, GD_IDSP_CMD_REG_FILTER_DEF_NUM_REGISTERS, GD_IDSP_CMD_REG_FILTER_DEF_DATA_UNIT, GD_IDSP_CMD_REG_FILTER_DEF_FILTER, }GD_IDSP_CMD_REG_FILTER_DEF_E; typedef enum { GD_JPEG_THUMB, GD_H264_I_ONLY, GD_RAW_PIC, GD_YUV_PIC, GD_JPEG_MAIN, } GD_DSP_CMD_SCENE_TYPE_E; typedef enum { GD_NORMAL, GD_FLIPPING_BLOCK, GD_FLIPPING_PAGE, GD_ALBUM_MIRROR, } GD_DSP_CMD_EFFECT_TYPE_E; typedef enum { GD_SMALL_SIZE, GD_LARGE_SIZE, } GD_DSP_CMD_THUMBNAIL_TYPE_E; typedef enum { GD_VOUT_ID_A = 0, GD_VOUT_ID_B = 1, } GD_DSP_CMD_VOUT_ID_E; typedef enum { GD_VOUT_SRC_DEFAULT_IMG = 0, GD_VOUT_SRC_BACKGROUND = 1, GD_VOUT_SRC_ENC = 2, GD_VOUT_SRC_DEC = 3, GD_VOUT_SRC_H264_DEC = 3, GD_VOUT_SRC_MPEG2_DEC = 5, GD_VOUT_SRC_MPEG4_DEC = 6, GD_VOUT_SRC_MIXER_A = 7, GD_VOUT_SRC_VCAP = 8, } GD_DSP_CMD_VOUT_SRC_E; typedef enum { GD_VOUT_DATA_SRC_NORMAL = 0, GD_VOUT_DATA_SRC_DRAM = 1, } GD_DSP_CMD_VOUT_DATA_SRC_E; typedef enum { GD_OSD_SRC_MAPPED_IN = 0, GD_OSD_SRC_DIRECT_IN = 1, } GD_DSP_CMD_OSD_SRC_E; typedef enum { GD_OSD_MODE_UYV565 = 0, GD_OSD_MODE_AYUV4444 = 1, GD_OSD_MODE_AYUV1555 = 2, GD_OSD_MODE_YUV1555 = 3, } GD_DSP_CMD_OSD_DIR_MODE_E; typedef enum { GD_CSC_DIGITAL = 0, GD_CSC_ANALOG = 1, GD_CSC_HDMI = 2, } GD_DSP_CMD_CSC_TYPE_E; /* return value for chip_id_ptr in GD_DSP_INIT_DATA_S */ typedef enum { GD_CHIP_ID_UNKNOWN = -1, GD_CHIP_ID_33 = 0, GD_CHIP_ID_55 = 1, GD_CHIP_ID_66 = 2, GD_CHIP_ID_70 = 3, GD_CHIP_ID_88 = 4, GD_CHIP_ID_99 = 5, } GD_CHIP_ID_S; typedef enum { GD_AUDIO_SF_reserved = 0, GD_AUDIO_SF_96000, GD_AUDIO_SF_48000, GD_AUDIO_SF_44100, GD_AUDIO_SF_32000, GD_AUDIO_SF_24000, GD_AUDIO_SF_22050, GD_AUDIO_SF_16000, GD_AUDIO_SF_12000, GD_AUDIO_SF_11025, GD_AUDIO_SF_8000, } GD_AUDIO_IN_FREQ_E; //***************************************************************************** //***************************************************************************** //** Data Structures //***************************************************************************** //***************************************************************************** typedef struct { U64 cmd[4]; }GD_IDSP_CMD_SECTION_S; typedef struct { // Dword #0 U64 config_chan : 8; U64 res0_1 : 14; U64 config_pri : 2; U64 config_en : 8; U64 res0_2 : 31; U64 keep_prev_cfg : 1; // Dword #1 U64 res1_1 ; // Dword #2 U64 out_en : 3; U64 res2_1 : 5; U64 out_line_sync_type : 2; U64 out_line_sync_cnt_log2 : 3; U64 out_line_sync_cnt : 6; U64 out_str_credits : 6; U64 out_frm_sync_en : 1; U64 out_frm_sync_cnt : 6; U64 out_vin_sync_en : 1; U64 out_vin_sync_cnt : 6; U64 res2_2 : 25; // Dword #3 U64 out_sreg_1 : 8; U64 out_pri_1 : 2; U64 out_sreg_2 : 8; U64 out_pri_2 : 2; U64 reserved3_1 : 44; }GD_IDSP_CMD_SEC_1_S; typedef struct { // Dword #0 U64 config_chan : 8; U64 res0_1 : 14; U64 config_pri : 2; U64 config_en : 8; U64 filter_bypass_en : 8; U64 preview_mode : 4; U64 res0_2 : 19; U64 keep_prev_cfg : 1; // Dword #1 U64 in_src : 2; U64 res1_1 : 1; U64 low_noise_luma : 1; U64 in_Sync_type : 2; U64 in_sync_dec : 1; U64 in_line_sync_cnt_log2 : 3; U64 in_sync_cnt_nbr : 6; U64 in_main_sreg : 8; U64 in_main_pri : 2; U64 in_chroma_sreg : 8; U64 in_chroma_pri : 2; U64 in_blk_sreg : 8; U64 in_blk_pri : 2; U64 in_sharpening_sreg : 8; U64 in_sharpening_pri : 2; U64 res1_2 : 8; // Dword #2 U64 out_en : 8; U64 out_line_sync_type : 2; U64 out_line_sync_cnt_log2 : 3; U64 out_line_sync_cnt : 6; U64 out_str_credits : 6; U64 out_frm_sync_en : 1; U64 out_frm_sync_cnt : 6; U64 out_sec_sync_en : 1; U64 out_sec_sync_cnt : 6; U64 res2_1 : 1; U64 out_3rd_sync_en : 1; U64 out_3rd_sync_cnt : 6; U64 res2_3 : 16; U64 out_ext_src : 1; // Dword #3 U64 out_main_luma_sreg : 8; U64 out_main_luma_pri : 2; U64 out_main_chroma_sreg : 8; U64 out_main_chroma_pri : 2; U64 out_me_sreg : 8; U64 out_me_pri : 2; U64 out_aaa_cfa_sreg : 8; U64 out_aaa_cfa_pri : 2; U64 out_aaa_rgb_sreg : 8; U64 out_aaa_rgb_pri : 2; U64 out_ext_raw_sreg : 8; U64 out_ext_raw_pri : 2; U64 reserved3_1 : 4; }GD_IDSP_CMD_SEC_2_S; typedef struct { // Dword #0 U64 config_chan : 8; U64 res0_1 : 14; U64 config_pri : 2; U64 config_en : 8; U64 res0_2 : 30; U64 lastFrame : 1; U64 keep_prev_cfg : 1; // Dword #1 U64 in_src : 2; U64 res1_1 : 2; U64 in_Sync_type : 2; U64 in_sync_dec : 1; U64 in_line_sync_cnt_log2 : 3; U64 in_sync_cnt_nbr : 6; U64 in_sreg_1 : 8; U64 in_pri_1 : 2; U64 in_sreg_2 : 8; U64 in_pri_2 : 2; U64 res1_2 : 28; // Dword #2 U64 out_en : 1; U64 res2_1 : 7; U64 out_line_sync_type : 2; U64 out_line_sync_cnt_log2 : 3; U64 out_line_sync_cnt : 6; U64 out_str_credits : 6; U64 out_frm_sync_en : 1; U64 out_frm_sync_cnt : 6; U64 res2_2 : 16; U64 out_mode420 : 1; U64 res2_3 : 15; // Dword #3 U64 out_smem_reg_1 : 8; U64 out_pri_1 : 2; U64 out_smem_reg_2 : 8; U64 out_pri_2 : 2; U64 reserved3_1 : 44; }GD_IDSP_CMD_SEC_3_S; typedef struct { // Dword #0 U64 config_chan : 8; U64 res0_1 : 14; U64 config_pri : 2; U64 res0_2 : 39; U64 keep_prev_cfg : 1; // Dword #1 U64 in_src : 2; U64 res1_1 : 2; U64 in_Sync_type : 2; U64 in_sync_dec : 1; U64 in_line_sync_cnt_log2 : 3; U64 in_sync_cnt_nbr : 6; U64 in_sreg_1 : 8; U64 in_pri_1 : 2; U64 res1_2 : 38; // Dword #2 U64 out_en : 1; U64 res2_1 : 7; U64 out_line_sync_type : 2; U64 out_line_sync_cnt_log2 : 3; U64 out_line_sync_cnt : 6; U64 out_str_credits : 6; U64 out_frm_sync_en : 1; U64 out_frm_sync_cnt : 6; U64 res2_2 : 32; // Dword #3 U64 out_smem_reg_1 : 8; U64 out_pri_1 : 2; U64 reserved3_1 : 54; }GD_IDSP_CMD_SEC_4_S; typedef struct { // Dword #0 U64 config_chan : 8; U64 res0_1 : 14; U64 config_pri : 2; U64 res0_2 : 39; U64 keep_prev_cfg : 1; // Dword #1 U64 in_src : 2; U64 res1_1 : 2; U64 in_Sync_type : 2; U64 in_sync_dec : 1; U64 in_line_sync_cnt_log2 : 3; U64 in_sync_cnt_nbr : 6; U64 in_sreg_1 : 8; U64 in_pri_1 : 2; U64 in_sreg_2 : 8; U64 in_pri_2 : 2; U64 res1_2 : 28; // Dword #2 U64 out_en : 1; U64 res2_1 : 7; U64 out_line_sync_type : 2; U64 out_line_sync_cnt_log2 : 3; U64 out_line_sync_cnt : 6; U64 out_str_credits : 6; U64 out_frm_sync_en : 1; U64 out_frm_sync_cnt : 6; U64 res2_2 : 32; // Dword #3 U64 out_smem_reg_1 : 8; U64 out_pri_1 : 2; U64 out_smem_reg_2 : 8; U64 out_pri_2 : 2; U64 reserved3_1 : 44; }GD_IDSP_CMD_SEC_5_S; typedef struct { // Dword #0 U64 config_chan : 8; U64 res0_1 : 14; U64 config_pri : 2; U64 res0_2 : 39; U64 keep_prev_cfg : 1; // Dword #1 U64 in_src : 2; U64 res1_1 : 2; U64 in_Sync_type : 2; U64 in_sync_dec : 1; U64 in_line_sync_cnt_log2 : 3; U64 in_sync_cnt_nbr : 6; U64 in_sreg_1 : 8; U64 in_pri_1 : 2; U64 in_sreg_2 : 8; U64 in_pri_2 : 2; U64 res1_2 : 28; // Dword #2 U64 out_en : 1; U64 res2_1 : 7; U64 out_line_sync_type : 2; U64 out_line_sync_cnt_log2 : 3; U64 out_line_sync_cnt : 6; U64 out_str_credits : 6; U64 out_frm_sync_en : 1; U64 out_frm_sync_cnt : 6; U64 res2_2 : 32; // Dword #3 U64 out_smem_reg_1 : 8; U64 out_pri_1 : 2; U64 out_smem_reg_2 : 8; U64 out_pri_2 : 2; U64 reserved3_1 : 44; }GD_IDSP_CMD_SEC_6_S; typedef struct { // Dword #0 U64 config_chan : 8; U64 res0_1 : 14; U64 config_pri : 2; U64 res0_2 : 39; U64 keep_prev_cfg : 1; // Dword #1 U64 in_src : 2; U64 res1_1 : 2; U64 in_Sync_type : 2; U64 in_sync_dec : 1; U64 in_line_sync_cnt_log2 : 3; U64 in_sync_cnt_nbr : 6; U64 in_sreg_1 : 8; U64 in_pri_1 : 2; U64 in_sreg_2 : 8; U64 in_pri_2 : 2; U64 res1_2 : 28; // Dword #2 U64 out_en : 2; U64 res2_1 : 6; U64 out_line_sync_type : 2; U64 out_line_sync_cnt_log2 : 3; U64 out_line_sync_cnt : 6; U64 out_str_credits : 6; U64 out_frm_sync_en : 1; U64 out_frm_sync_cnt : 6; U64 res2_2 : 32; // Dword #3 U64 out_smem_reg_1 : 8; U64 out_pri_1 : 2; U64 out_smem_reg_2 : 8; U64 out_pri_2 : 2; U64 out_smem_reg_3 : 8; U64 out_pri_3 : 2; U64 reserved3_1 : 34; }GD_IDSP_CMD_SEC_7_S; typedef union { GD_IDSP_CMD_SECTION_S sec; GD_IDSP_CMD_SEC_1_S sec1; GD_IDSP_CMD_SEC_2_S sec2; GD_IDSP_CMD_SEC_3_S sec3; GD_IDSP_CMD_SEC_4_S sec4; GD_IDSP_CMD_SEC_5_S sec5; GD_IDSP_CMD_SEC_6_S sec6; GD_IDSP_CMD_SEC_7_S sec7; }GD_IDSP_SEC_CMD_T; typedef struct { char name[100]; U32 dwOffset; // 2bytes (xx*xx) U32 dwStartBit; // 2 U32 dwBits; // 2 U32 dwRegister; // xxxx GD_IDSP_CMD_DATA_UNIT_E eDataType; // GD_IDSP_CMD_FILTER_E eFilterType; // }GD_IDSP_CMD_REG_FILTER_DATA_S; typedef struct { GD_IDSP_CMD_REG_FILTER_DEF_E eDefType; char name[100]; }GD_IDSP_CMD_REG_FILTER_DEF_S; typedef struct { char section[10]; char filter[10]; U32 offset; U32 reg_data_size; GD_IDSP_CMD_REG_FILTER_DATA_S* reg_data; }GD_IDSP_CMD_SEC_REG_FILTER_S; typedef struct { U32 Addr; U32 data; }GD_IDSP_CMD_SEC_REG_SET_DATA_S; typedef struct { char section[10]; char filter[10]; GD_IDSP_SECTION_FILTER_E control; U32 reg_data_size; GD_IDSP_CMD_SEC_REG_SET_DATA_S* reg_data; }GD_IDSP_CMD_SEC_REG_FILTER_DATS_S; typedef struct { // reg 0x00: 0x00 U32 S_Control_reset : 1; // 0: no op 1: reset video in U32 S_Control_enable : 1; // 0: idle 1: enable video in U32 S_Control_win_en : 1; // enable capture window. automatic reset at the end of each capture U32 S_Control_data_edge : 1; // Data clock edge. 0: valid on rising edge of sensor clock // 1: valid on falling edge of sensor clock U32 S_Control_data_slave : 1; // slave mode enable: 0: disabled / 1: enabled U32 S_Control_data_master : 1; // master mode enable: 0: disabled / 1: enabled // Bit [5:4] forms the following combination: // 2b00: undefined // 2b01: slave mode // 2b10: master mode // 2b11: undefined U32 S_Control_data_emb_sync : 1; // sync code embedded in data. When set in master mode, // this indicates sensors have embedded sync code while // receiving seperate sync signals (Sony specific). U32 S_Control_data_emb_sync_mode : 1; // Embedded sync mode. 0: ITU-656 style(8-bit) 1: ITU-656 style(full data range) U32 S_Control_data_emb_sync_loc : 2; // Embedded sync code location (2-pixel wide input only). // 2b00: embedded sync code carried on the lower pixel // 2b01: embedded sync code carried on the upper pixel // 2b1x: embedded sync code carried on both pixels [should programed to 2b1x for serial sensor interface modes] U32 S_Control_data_vs_pol : 1; // vsync polarity. 0: active high (rising edge signals start) 1: active low (falling edge signals start) U32 S_Control_data_hs_pol : 1; // hsync polarity. 0: active high (rising edge signals start) 1: active low (falling edge signals start) U32 S_Control_data_field0_pol : 1; // 0: field 0 has ID set to 0 with wen assertion 1:field 0 has ID set to 1 with wen assertion U32 S_Control_data_sony_field_mode : 1; // 0: normal field mode 1: Sony-specific field mode. The first field of a multi-field readout in Sony CCD/TG is indicated by the state of EXP/ID pin at the first assertion of WEN/FLD U32 S_Control_data_ecc_enable : 1; // 656 error correction enable {including the sync code words in serial sensor mode] U32 S_Control_data_hsync_mask : 1; // 0: Toggle hsync during vertical blanking 1: No hsync toggle during vertical blanking U32 : 16; // reserved // reg 0x01: 0x04 // input mode[4:0] U32 S_InputConfig_pad_type : 1; // 0: LVCMOS 1: LVDS U32 S_InputConfig_data_rate : 1; // 0: SDR 1: DDR U32 S_InputConfig_data_width : 1; // 0: 1-pixel wide 1: 2-pixel wide [should be programed to 1 (2-pixel wide) for serial sensor interface modes] U32 S_InputConfig_input_source : 1; // 0: from LVDS (lvds_idsp_sdata) 1: from GPIO (iopad_idsp_sdata). Input source and pad type forms three combinations:-LVDS source, LVDS pad.-LVDS source, LVCMOS pad.-GPIO source. (Pad type makes no difference.) U32 S_InputConfig_RGB_YUV : 1; // 0: RGB input 1: YUV input // The following are legal combinations for input mode (x: 0 or 1, -: no effect): // x000x:SDR,1-pixel wide RGB/YUV data, from lvds_idsp_sdata[13:0] // x001x:DDR,1-pixel wide RGB/YUV data, from lvds_idsp_sdata[27:0] // x0100:SDR,2-pixel wide RGB/YUV data, from lvds_idsp_sdata[27:0] // x0110:DDR,2-pixel wide RGB/YUV data, from lvds_idsp_sdata[55:0] // 110--:1-pixel wide YUV data, from iopad_idsp_sdata[7:0] // 111--:2-pixel wide YUV data, from iopad_idsp_sdata[15:0] U32 S_InputConfig_Source_pixel_data_width : 2; // Source pixel data width. VIN aligns all pixel values to MSB at output. // For example, 8-bit source means left shift by 6, 14-bit source means no shift, // etc. YUV data coming from GPIO must be 8-bit wide. (Hardware ignores the configuration.) // 2b00: 8-bit 2b01: 10-bit 2b10: 12-bit 2b11: 14-bit U32 S_InputConfig_YUV_input_order : 2; // YUV input order // For 1-pixel wide YUV data // 00:Cr,Y0,Cb,Y1, // 01:Cb,Y0,Cr,Y1, // 10:Y0,Cr,Y1,Cb, // 11:Y0,Cb,Y1,Cr, // For 2-pixel wide YUV data // 00:{Cr,Y},{Cb,Y}, // 01:{Cb,Y},{Cr,Y}, // 10:{Y,Cr},{Y,Cb}, // 11: {Y, Cb}, {Y, Cr}, U32 S_InputConfig_Number_of_active_SLVS_lanes : 2; // Number of active SLVS lanes // 2b00: 4 lanes; 2b01: 8 lanes; 2b10: 12 lanes; 2b11: 16 lanes) U32 S_InputConfig_Serial_sensor_interface_mode : 1; // Serial sensor interface mode (Micron and Sony) U32 S_InputConfig_Sony_serial_sensor_interface_mode : 1; // Sony serial sensor interface mode U32 S_InputConfig_VIN_clock_select : 1; // VIN clock select - use sensor or bit clock instead of IDSP clock U32 : 2; // reserved U32 : 16; // reserved // reg 0x02: 0x08 // Status register: Write logic 1 to the status register clears the corresponding bit. U32 S_Status_vsync : 1; // begin of frame detected U32 S_Status_trig0 : 1; // trigger 0 status. 0: no trigger/ 1: triggered U32 S_Status_trig1 : 1; // trigger 1 status. 0: no trigger/ 1: triggered U32 S_Status_ovfl : 1; // synchronous FIFO overflow. 0: no overflow/ 1: overflow occurred U32 S_Status_shortl : 1; // early hsync detected U32 S_Status_shortf : 1; // early vsync detected U32 S_Status_field : 3; // current video field (read only). U32 S_Status_no_hsync : 1; // no hsync detected (time out) U32 S_Status_no_vsync : 1; // no vsync detected (time out) U32 S_Status_idsp_ahb_vsync : 1; // frame end signal to ARM U32 S_Status_idsp_ahb_mst_vsync : 1; // master mode frame end signal to ARM U32 S_Status_idsp_ahb_last_pxl : 1; // capture window end signal to ARM U32 S_Status_ecc_uncorrectable : 1; // uncorrectable 656 errors U32 S_Status_program_error : 1; // illegal programming detected. Currently the reported error includes:Master mode, active region exceeds frame region U32 : 16; // reserved // reg 0x03: 0x0C // Vertical active region width (master mode only) U32 S_Vwidth : 14; // vsync pulse width in unit of lines U32 : 2; // reserved U32 : 16; // reserved // reg 0x04: 0x10 // Horizontal active region width (master mode only). U32 S_Hwidth : 14; // hsync pulse width in unit of pixels U32 : 2; // reserved U32 : 16; // reserved // reg 0x05: 0x14 U32 S_Hoffset_top : 14; // U32 : 2; // reserved U32 : 16; // reserved // reg 0x06: 0x18 U32 S_Hoffset_bot : 14; // U32 : 2; // reserved U32 : 16; // reserved // reg 0x07: 0x1C // Frame size, vertical (master mode only) U32 S_V : 14; // Number of lines per field U32 : 2; // reserved U32 : 16; // reserved // reg 0x08: 0x20 // Frame size, horizontal (in master mode only) U32 S_H : 14; // Number of pixels per line U32 : 2; // reserved U32 : 16; // reserved // reg 0x09: 0x24 // Minimum frame size, vertical (slave mode only) U32 S_MinV : 14; // number of lines per field U32 : 2; // reserved U32 : 16; // reserved // reg 0x0A: 0x28 // Minimum frame size, horizontal (slave mode only) U32 S_MinH : 14; // number of pixels per line U32 : 2; // reserved U32 : 16; // reserved // reg 0x0B: 0x2C // Trigger 0 control U32 S_Trigger0Start_startline : 14; // startline. Assert trigger at the assertion of hsync of the n-thline of the frame, // where n = startline (counting from 1st line active region) U32 S_Trigger0Start_pol : 1; // polarity. 0: active low trigger/ 1: active high trigger U32 S_Trigger0Start_enable : 1; // 0: trigger disabled/ 1: trigger enabled U32 : 16; // reserved // reg 0x0C: 0x30 // Trigger 0 control U32 S_Trigger0End_startline : 14; // lastline. Deassert trigger at the assertion of hsync of the n-thline of the frame, // where n = lastline (counting from 1st line active region) U32 : 2; // reserved U32 : 16; // reserved // reg 0x0D: 0x34 // Trigger 1 control U32 S_Trigger1Start_startline : 14; // startline. Assert trigger at the assertion of hsync of the n-thline of the frame, // where n = startline (counting from 1st line active region) U32 S_Trigger1Start_pol : 1; // polarity. 0: active low trigger/ 1: active high trigger U32 S_Trigger1Start_enable : 1; // 0: trigger disabled/ 1: trigger enabled U32 : 16; // reserved // reg 0x0E: 0x38 // Trigger 1 control U32 S_Trigger1End_startline : 14; // lastline. Deassert trigger at the assertion of hsync of the n-thline of the frame, // where n = lastline (counting from 1st line active region) U32 : 2; // reserved U32 : 16; // reserved // reg 0x0F: 0x3C // VOUT synchronization control U32 S_VoutStart0_startline : 14; // startline. Synchronization signal is asserted for the duration of the n-th line, // where n = startline (counting from 1st line active region) U32 : 1; // reserved U32 S_VoutStart0_disable_field_check : 1; // 0: synchronization signal is set on even field/ 1: synchronization signal is set on each field U32 : 16; // reserved // reg 0x10: 0x40 // VOUT synchronization control U32 S_VoutStart1_startline : 14; // startline. Synchronization signal is asserted for the duration of the n-th line, // where n = startline (counting from 1st line active region) U32 : 1; // reserved U32 S_VoutStart1_disable_field_check : 1; // 0: synchronization signal is set on even field/ 1: synchronization signal is set on each field U32 : 16; // reserved // reg 0x11: 0x44 // Capture window control, vertical start U32 S_CapStartV : 14; // Start vertical location of capture window U32 : 2; // reserved U32 : 16; // reserved // reg 0x12: 0x48 // Capture window control, horizontal start U32 S_CapStartH : 14; // Start horizontal location of capture window // In 8 channel , Sony serial sensor mode, the capture window should start 4 // pixels after the SAV (i.e. exclude the 4 pixels added by the receiver at the // beginning of every line which are not part of the original active line) U32 : 2; // reserved U32 : 16; // reserved // reg 0x13: 0x4C // Capture window control, vertical end U32 S_CapEndV : 14; // End vertical location of capture window U32 : 2; // reserved U32 : 16; // reserved // reg 0x14: 0x50 // Capture window control, horizontal end U32 S_CapEndH : 14; // End horizontal location of capture window // In 8 channel, Sony serial sensor mode, the capture window should end 4 pixels // before the EAV sync code to exclude the additional sync code pixels. U32 : 2; // reserved U32 : 16; // reserved // reg 0x15: 0x54 // All-zero embedded sync horizontal blank interval length U32 S_BlankLengthH : 14; // Blank interval length in sensor clock cycles U32 : 2; // reserved U32 : 16; // reserved // reg 0x16: 0x58 // Vsync timeout limit (lower 16 bits) and also EAV column for SLVS mode. U32 S_TimeoutVLow : 16; // SLVS mode programing notes:Should be integer multiple of 4 and does not count SAV/EAV sync code pixels U32 : 16; // reserved // reg 0x17: 0x5C // Vsync timeout limit (upper 16 bits) U32 S_TimeoutVHigh : 16; // U32 : 16; // reserved // reg 0x18: 0x60 // Hsync timeout limit (lower 16 bits) and also Horizontal line length (SAV-to-SAV distance) in SLVS mode. U32 S_TimeoutHLow : 16; // SLVS mode programing notes:Should be integer multiple of 4 and does not count SAV/EAV sync code pixels U32 : 16; // reserved // reg 0x19: 0x64 // Hsync timeout limit (lower 16 bits) U32 S_TimeoutHHigh : 16; // U32 : 16; // reserved // reg 0x1A: 0x68 U32 S_mipi_cfg1 : 16; // Add U32 : 16; // reserved // reg 0x1B: 0x6C U32 S_mipi_cfg2 : 16; // Add U32 : 16; // reserved // reg 0x1C: 0x70 U32 S_mipi_bdphyctl : 16; // Add U32 : 16; // reserved // reg 0x1D: 0x74 U32 S_mipi_sdphyctl : 16; // Add U32 : 16; // reserved // reg 0x1E: 0x78 U32 s_reserved0; // reg 0x1F: 0x7C U32 s_reserved1; // reg 0x20: 0x80 RO U32 S_debugFifoCount : 16; // Synchronous FIFO word count (debug only), number of words in synchronous FIFO U32 : 16; // reserved // reg 0x21: 0x84 RO U32 S_debugFifoData0 : 16; // Synchronous FIFO read data (debug only), Pixel 0 read data U32 : 16; // reserved // reg 0x22: 0x88 RO U32 S_debugFifoData1 : 16; // Synchronous FIFO read data (debug only), Pixel 1 read data U32 : 16; // reserved // reg 0x23: 0x8C RO U32 S_debugStall : 16; // Stall (debug only), Output interface stall U32 : 16; // reserved // reg 0x24: 0x90 RO SLSV status (debug only), Output interface stall U32 S_slvStatus_SLSV : 1; // receiver reached LOCK state U32 S_slvStatus_sync : 1; // Detected sync code match on all 4 words. U32 S_slvStatus_Start_Of_Frame : 1; // Detected Start-Of-Frame U32 S_slvStatus_VSYNC : 1; // Detected VSYNC U32 S_slvStatus_Start_of_line : 1; // Detected Start-of-line U32 S_slvStatus_valid_pixel : 1; // Generated valid pixel output U32 S_slvStatus_End_of_line : 1; // Generated an End-of-line output U32 S_slvStatus_Corrected_error : 1; // Corrected error in sync code U32 : 8; // reserved U32 : 16; // reserved // U32 s_reserved0[16]; // reg 0x1A-0x29 // U32 s_rsc_vertical_enable: 1; // reg 0x2A // U32 s_rsc_horizontal_enable:1; // U32 s_rsc_arm_int_enable:1; // U32 s_rsc_reg_config_mask:1; // U32 s_rsc_use_software_sample: 1; // U32 s_reserved1:11; // U32 s_rsc_correction_int_delay;// reg 0x2B // U32 s_rsc_hor_software_gyro_sample; // reg 0x2C // U32 s_rsc_hor_offset; // reg 0x2D // U32 s_rsc_hor_scale; // reg 0x2E // U32 s_rsc_vert_software_gyro_sample; // reg 0x2F // U32 s_rsc_vert_offset; // reg 0x30 // U32 s_rsc_vert_scale; // reg 0x31 } GD_IDSP_VIN_REGS_S; /** * DSP_INIT_DATA contains initialization related parameters * passed from ARM to DSP. The location is used to store a * data structure that contains various buffer pointers and * size information. 128 bytes for DSP_INIT_DATA */ typedef struct { U32 *default_binary_data_ptr; U32 *cmd_data_ptr; U32 cmd_data_size; U32 *result_queue_ptr; U32 result_queue_size; U32 reserved_1[3]; U32 operation_mode; U32 *default_config_ptr; U32 default_config_size; U32 *DSP_buf_ptr; U32 DSP_buf_size; U32 *vdsp_info_ptr; U32 *pjpeg_buf_ptr; U32 pjpeg_buf_size; U32 *chip_id_ptr; U32 reserved_2; U32 reserved_3[14]; } GD_DSP_INIT_DATA_S; // Structure that indicate the vdsp interrupt status typedef struct { U32 dsp_cmd_rx; // if DSP had read from cmd buf U32 dsp_msg_tx; // if DSP had written to msg buf U32 dsp_histogram_tx:1; //if DSP has send at least one histogram to ARM U32 reserv:31; U32 padding[5]; } GD_VDSP_INFO_S; /** * During H264/JPEG encoding mode, ARM will receive vin interrupt. * ARM should copy video input polarity information to video input * register area right after input interrupt is received. */ typedef struct { U32 vin_shadow_register; } GD_VIN_SHADOW_REGISTER_S; /** * The data structure are read by DSP at each video output frame. * DSP reads the data structure after the DMA completion of the * output data. ARM receives each Vout interrrupt at vsync * rising edge. */ typedef struct { U8 format; U8 frame_rate; U8 Audio_Sampling_Clock_Freq; U8 Audio_Output_Clock_Freq; U16 active_width; U16 active_height; U16 video_width; U16 video_height; U32 OSD0_addr; U32 OSD1_addr; U16 OSD0_width; U16 OSD1_width; U16 OSD0_height; U16 OSD1_height; U16 OSD0_pitch; U16 OSD1_pitch; U32 default_image_y_addr; U32 default_image_u_addr; U16 default_image_pitch; U16 default_image_height; U8 polarity; U8 flip_control; U8 reset; U8 OSD_progressive; } GD_VOUT_SETUP_DATA_S; /** * Binary data structure for encode mode */ typedef struct { U32 magic_number; U32 manufacture_id; U32 uCode_version; U32 dram_addr_idsp_default_cfg; U32 dram_addr_luma_huf_tab; U32 dram_addr_chroma_huf_tab; U32 dram_addr_mctf_cfg_buffer; U32 dram_addr_cabac_ctx_tab; U32 dram_addr_jpeg_out_bit_buffer; //BSB start addr U32 dram_addr_cabac_out_bit_buffer; //BSB start addr U32 dram_addr_bit_info_buffer; //Bits INFO BUFFER addr U32 jpeg_out_bit_buf_sz; //BSB size U32 h264_out_bit_buf_sz; //BSB size U32 bit_info_buf_sz; //Bits INFO BUFFER size U32 mctf_cfg_buf_sz; } GD_DEFAULT_ENC_BINARY_DATA_S; /** * Binary data structure for decode mode */ typedef struct { U32 magic_number; U32 manufacture_id; U32 uCode_version; U32 dram_addr_idsp_default_cfg; U32 dram_addr_cabac_ctx_tab; U32 dram_addr_cabac_out_bit_buffer_daddr; U32 dram_addr_cabac_out_bit_buffer_size; U32 still_picture_decode_buffer_daddr; U32 still_picture_decode_buffer_size; U32 h264_frame_buffer_daddr; U32 h264_frame_buffer_size; U32 still_frame_buffer_daddr; U32 still_frame_buffer_size; U32 still_frame_buffer_pitch; U32 dram_addr_luma_huf_tab; U32 dram_addr_chroma_huf_tab; } GD_DEFAULT_DEC_BINARY_DATA_S; /** * DIS histogram information */ typedef struct { U32 seq_nbr : 8; U32 sem_id : 2; U32 hist_x_precision_in_quater_pixel: 3; U32 hist_y_precision_in_quater_pixel: 3; U32 reserved : 16; U32 hist_x_hist_max_item_nbr : 16; //For example, the range of the hist x dimension would be: 128: [-64,63] U32 hist_y_hist_max_item_nbr : 16; //As above // This one and the following one are used to specify the block area in the picture for the ME histogram U32 hist_start_mb_nbr : 16; U32 hist_total_mb_nbr : 16; } GD_DIS_HIST_HEADER_S; /*********************************************************************/ /* MESSAGE */ /** * The length of a record is fixed at 128 bytes. * DSP firmware continuously writes result record into the queue. * ARM reads the result record out and both advance their buffer * pointer. DSP doesn't handshake with ARM on result queue usage. */ typedef struct { U32 time_stamp; U32 frame_number; U32 params[30]; } GD_DSP_RESULT_QUEUE_S; /** * H264/JPEG encoding message */ typedef struct { U8 enable : 1; U8 rsc_enable : 1; U8 proc : 1; U8 reserved : 5; S8 x_angular_velocity; S8 y_angular_velocity; U8 max_angular_velocity; } GD_DIS_STATUS_S; typedef struct { U32 dsp_operation_mode; U32 timecode; U32 cmd_echo; U32 num_cmds; U32 aaa_data_fifo_next; U32 aaa_data_fifo_size; U32 h264_bits_fifo_next; U32 h264_bits_fifo_size; U32 h264_info_fifo_next; U32 h264_info_fifo_size; U32 jpeg_bits_fifo_next; U32 jpeg_bits_fifo_size; U32 jpeg_info_fifo_next; U32 jpeg_info_fifo_size; U32 raw_pic_addr; U32 thumbnail_pic_y_addr; U32 thumbnail_pic_uv_addr; U32 thumbnail_pic_y_pitch; U32 encode_y_pic_addr; U32 encode_uv_pic_addr; U32 encode_yuv_pitch; U32 preview_y_pic_addr; U32 preview_uv_pic_addr; U32 preview_yuv_pitch; U32 total_pic_encoded_h264_mode; U32 total_pic_encoded_jpeg_mode; U32 total_thumbnail_encoded_jpeg_mode; U32 raw_cap_cnt; U32 yuv_pic_cnt; U32 encode_operation_mode; U16 encode_state; U16 capture_state; U32 pts_val; #define NO_ERROR 0 #define ILLEGAL_SIGNAL_1 1 U32 err_code; U32 raw_pic_pitch; U32 raw_pic_width; U32 raw_pic_row; U32 yuv_aaa_data_fifo_next; U32 yuv_aaa_data_fifo_size; U16 re_encode_state[4]; U32 pjpg_bitBuf_addr; U32 pjpg_bitBuf_sz; U32 total_screen_thumbnail_encoded_jpeg_mode; U32 screen_thumbnail_pic_y_addr; U32 screen_thumbnail_pic_uv_addr; U32 total_pic_encoded_mjpeg_mode; U32 main_me1_addr ; U32 main_me1_pitch ; U32 preview_c_me1_addr ; U32 preview_c_me1_pitch ; } GD_ENCODE_MSG_S; /** * H264/JPEG decoding message */ typedef struct { U32 dsp_operation_mode; U32 timecode; U32 cmd_echo; U32 num_cmds; U32 main_yuv_address ; U32 preview_c_yuv_address ; U32 main_me1_address ; U32 preview_c_me1_address ; U16 main_yuv_pitch ; U16 preview_c_pitch ; U16 main_me1_pitch ; U16 preview_c_me1_pitch ; U32 stream_0_mv_address ; U32 stream_1_mv_address ; U32 stream_2_mv_address ; U32 stream_3_mv_address ; U32 stream_0_qp_address ; U32 stream_1_qp_address ; U32 stream_2_qp_address ; U32 stream_3_qp_address ; } GD_ENCODE_MSG_2_S ; /** * H264/JPEG decoding message */ typedef struct { U32 dsp_operation_mode; U32 timecode; U32 cmd_echo; U32 num_cmds; U32 latest_clock_counter; U32 latest_pts; U32 jpeg_frame_count; U32 yuv422_y_addr; U32 yuv422_uv_addr; U32 h264_bits_fifo_next; U32 jpeg_bits_fifo_next; U32 decode_state; U32 error_status; U32 total_error_count; U32 decoded_pic_number; U32 jpeg_thumbnail_size; U32 jpeg_rescale_buf_pitch; /* pitch of scaled JPEG after decoding */ U16 jpeg_rescale_buf_width; U16 jpeg_rescale_buf_height; U32 jpeg_rescale_buf_address_y; /* Y address of scaled JPEG after decoding */ U32 jpeg_rescale_buf_address_uv; U32 second_rescale_buf_pitch; /* pitch of scaled JPEG after decoding */ U16 second_rescale_buf_width; U16 second_rescale_buf_height; U32 second_rescale_buf_address_y; /* Y address of second scaled after decoding */ U32 second_rescale_buf_address_uv; U32 jpeg_y_addr; /*Y address of decoded JPEG */ U32 jpeg_uv_addr; U32 jpeg_pitch; /* DRAM pitch of decoded JPEG */ U32 jpeg_width; /* width of decoded JPEG */ U32 jpeg_height; U32 jpeg_capture_count; U32 jpeg_screennail_size; U32 jpeg_thumbnail_buf_dbase; /*multi scene thumbnail buffer base address*/ U32 jpeg_thumbnail_buf_pitch; /*buffer pitch of each thumbnail buffer */ U32 jpeg_large_thumbnail_buf_dbase; /*multi scene large thumbnail buffer base address*/ U32 jpeg_large_thumbnail_buf_pitch; /*buffer pitch of each large thumbnail buffer */ U16 jpeg_cabac_message_queue_fullness; /* fullness of cabac message queue */ U16 jpeg_rescale_message_queue_fullness; /* fullness of rescale message queue */ } GD_DECODE_MSG_S; typedef struct { U16 awb_tile_col_start; U16 awb_tile_row_start; U16 awb_tile_width; U16 awb_tile_height; U16 awb_tile_active_width; U16 awb_tile_active_height; U16 awb_rgb_shift; U16 awb_y_shift; U16 awb_min_max_shift; U16 ae_tile_col_start; U16 ae_tile_row_start; U16 ae_tile_width; U16 ae_tile_height; U16 ae_y_shift; U16 ae_linear_y_shift; U16 af_tile_col_start; U16 af_tile_row_start; U16 af_tile_width; U16 af_tile_height; U16 af_tile_active_width; U16 af_tile_active_height; U16 af_y_shift; U16 af_cfa_y_shift; U8 awb_tile_num_col; U8 awb_tile_num_row; U8 ae_tile_num_col; U8 ae_tile_num_row; U8 af_tile_num_col; U8 af_tile_num_row; U8 total_slices_x; U8 total_slices_y; U8 slice_index_x; U8 slice_index_y; U16 slice_width; U16 slice_height; U16 slice_start_x; U16 slice_start_y; } GD_AAA_TILE_CONFIG_S; /*------------------------------------------------- * Configuration mode * 1. Interrupt setup (0x00001001) * 2. H264 encoding setup (0x00001002) * 3. JPEG encoding setup (0x00001003) * 4. H264 decoding setup (0x00001004) * 5. JPEG decoding setup (0x00001005) * 6. Reset operation (0x00001006) * 7. Video output restart (0x00001007) * 8. Encode timer operation (0x00001008) * 9. Chip Selection (0x00001009) * 10. HD echo setup (0x0000100A) * 11. System setup info (0x0000100B) * 12. EIS SWITCH VOUT (0x0000100C) * 13. Debug level setup (0x0000100D) * 14. Audio frequency setup (0x0000100E) -------------------------------------------------*/ typedef struct { // cmd_code: 0x00001001 GD_INTERRUPT_SETUP U32 cmd_code; U8 vin_int; U8 vout_int; } GD_DSP_CMD_INTERRUPT_SETUP_S; typedef struct { // cmd_code: 0x00001002 GD_H264_ENCODING_SETUP U32 cmd_code; U8 mode; U8 M; U8 N; U8 quality; U32 average_bitrate; U32 vbr_cntl; U32 vbr_setting : 8; U32 allow_I_adv : 8; U32 cpb_buf_idc : 8; U32 en_panic_rc : 2; U32 cpb_cmp_idc : 2; // cpb compliance idc U32 fast_rc_idc : 4; U32 target_storage_space; U32 bits_fifo_base; U32 bits_fifo_limit; U32 info_fifo_base; U32 info_fifo_limit; U8 audio_in_freq; U8 vin_frame_rate; U8 encoder_frame_rate; U8 frame_sync; U16 initial_fade_in_gain; U16 final_fade_out_gain; U32 idr_interval; U32 cpb_user_size; U8 numRef_P; U8 numRef_B; U8 vin_frame_rate_ext; U8 encoder_frame_rate_ext; U32 pjpg_bits_fifo_base; U32 pjpg_bits_fifo_limit; U32 vbr_cbp_rate; U32 frame_rate_division_factor : 8; U32 force_intlc_tb_iframe : 1; U32 session_id : 4; U32 frame_rate_multiplication_factor: 8; U32 hflip : 1; U32 vflip : 1; U32 rotate : 1; U32 chroma_format : 1; U32 reserved : 7; U32 custom_encoder_frame_rate; } GD_DSP_CMD_H264_ENCODE_SETUP_S, GD_DSP_CMD_VID_ENCODE_SETUP_S; typedef struct { // cmd_code: 0x00001003 GD_JPEG_ENCODING_SETUP U32 cmd_code; U32 chroma_format; U32 bits_fifo_base; U32 bits_fifo_limit; U32 info_fifo_base; U32 info_fifo_limit; U32 *quant_matrix_addr; U32 custom_encoder_frame_rate; U32 mctf_mode : 8; U32 is_mjpeg : 1; U32 frame_rate_division_factor : 8; U32 session_id : 4; U32 frame_rate_multiplication_factor: 8; U32 hflip : 1; U32 vflip : 1; U32 rotate : 1; U32 targ_bits_pp; U32 initial_ql : 8; U32 tolerance : 8; U32 max_recode_lp : 8; U32 total_sample_pts : 8; U32 rate_curve_dram_addr; U16 screen_thumbnail_w; U16 screen_thumbnail_h; U16 screen_thumbnail_active_w; U16 screen_thumbnail_active_h; } GD_DSP_CMD_JPEG_ENCODE_SETUP_S; typedef struct { // cmd_code: 0x00001004 GD_H264_DECODING_SETUP U32 cmd_code; U32 bits_fifo_base; U32 bits_fifo_limit; U32 fade_in_pic_addr; U32 fade_in_pic_pitch; U32 fade_in_alpha_start; U32 fade_in_alpha_step; U32 fade_in_total_frames; U32 fade_out_pic_addr; U32 fade_out_pic_pitch; U32 fade_out_alpha_start; U32 fade_out_alpha_step; U32 fade_out_total_frames; U8 cabac_to_recon_delay; U8 forced_max_fb_size; } GD_DSP_CMD_H264_DECODE_SETUP_S; typedef struct { // cmd_code: 0x00001005 GD_JPEG_DECODING_SETUP U32 cmd_code; U32 bits_fifo_base; U32 bits_fifo_limit; U32 cross_fade_alpha_start; U32 cross_fade_alpha_step; U32 cross_fade_total_frames; U8 background_y; U8 background_cb; U8 background_cr; U8 reserved; U16 max_vout_width; U16 max_vout_height; } GD_DSP_CMD_JPEG_DECODE_SETUP_S; typedef struct { // cmd_code: 0x00001006 GD_RESET_OPERATION U32 cmd_code; } GD_DSP_CMD_RESET_OPERATION_S; typedef struct { // cmd_code: 0x00001007 GD_VIDEO_OUTPUT_RESTART U32 cmd_code; U8 vout_id; } GD_DSP_CMD_VIDEO_OUTPUT_RESTART_S; typedef struct { // cmd_code: 0x00001008 GD_H264_ENC_USE_TIMER U32 cmd_code; U8 timer_scaler; U8 display_opt; U8 video_term_opt; // 0 terminate with frame wait, 1 reset idsp, and terminate right away U8 reserved; } GD_DSP_CMD_VIN_TIMER_MODE_S; typedef struct { // cmd_code: 0x00001009 GD_CHIP_SELECTION U32 cmd_code; U8 chip_type; } GD_DSP_CMD_CHIP_SELECT_S; typedef struct { // cmd_code: 0x0000100A GD_HD_ECHO_SETUP U32 cmd_code; U8 enable; } GD_DSP_CMD_HD_ECHO_SETUP_S; typedef struct { U32 multiple_stream : 7; // 0:single stream, 1: multiple stream U32 power_mode : 1; // 0:high power, 1: low power } gd_application_mode_s; typedef struct { // cmd_code: 0x0000100B GD_SYSTEM_SETUP_INFO U32 cmd_code; U32 preview_A_type : 8; U32 preview_B_type : 8; U32 voutA_osd_blend_enabled : 1 ; // if set, Mixing section of VOUTA is used for DRAM to DRAM OSD blending U32 voutB_osd_blend_enabled : 1 ; // if set, Mixing section of VOUTB is used for DRAM to DRAM OSD blending U32 coded_bits_interrupt_enabled: 1 ; // if set, VOUTA interrupt is generated to ARM for every H.264/MJPEG coded frame written to the bits FIFO U32 pip_size_preview_enabled : 1 ; // if set, preview A/B/C may be downscaled to PiP resolution (ie: preveiw width < 320) U32 low_delay_enabled : 1 ; // if set, IDSP will not insert one dummy frame latency after MCTF to compensate for OSD insertion. Only for M=1 case. U32 padding : 11; gd_application_mode_s sub_mode_sel; // 0: Camcorder mode (single-stream encoder) 1: DVR mode (multiple-stream encoder) U8 num_yuv_src; // number of input YUV sources muxed together. U8 resv_1; U16 resv_2; U32 audio_clk_freq; U32 idsp_freq; U16 sensor_HB_pixel; U16 sensor_VB_pixel; } GD_DSP_CMD_SYSTEM_SETUP_INFO_S; typedef struct { // cmd_code: 0x0000100C GD_EIS_SWITCHVOUT_DURING_ENCODE U32 cmd_code; U8 enable; } GD_DSP_CMD_EIS_SWITCHVOUT_DURING_ENCOD_S; typedef struct { // cmd_code: 0x0000100D GD_DSP_DEBUG_LEVEL_SETUP U32 cmd_code; U8 module; U8 debug_level; U8 coding_thread_printf_disable_mask; U8 padding; } GD_DSP_CMD_DSP_DEBUG_LEVEL_SETUP_S; typedef struct { // cmd_code: 0x0000100E GD_SYSTEM_PARAMETERS_SETUP U32 cmd_code; U32 audio_clk_freq; U32 idsp_freq; U16 sensor_HB_pixel; U16 sensor_VB_pixel; } GD_DSP_CMD_SYSTEM_PARAMETERS_SETUP_S; typedef struct { // cmd_code: 0x0000100F GD_SYSTEM_IDSP_FREQ_SETUP U32 cmd_code; U32 idsp_freq; } GD_DSP_CMD_SYSTEM_IDSP_FREQ_SETUP_S; /*------------------------------------------------- * 1. Sensor Input setup (0x00002001) * 2. RGB gain adjustment (0x00002002) * 3. Vignette compensation (0x00002003) * 4. AAA statistics setup (0x00002004) * 5. Luma Sharpen setup (0x00002005) * 6. RGB to RGB setup (0x00002006) obsolete * 7. RGB to YUV setup (0x00002007) * 8. Gamma curve lookup table setup (0x00002008) obsolete * 9. Noise filter setup (0x00002009) * 10. Bad Pixel Correct setup (0x0000200A) * 11. Vid Fade In Out setup (0x0000200B) * 12. CFA Domain Leakage Filter setup (0x0000200C) * 13. MCTF MV Stab setup (0x0000200D) * 14. Set slow shutter upsampling rate (0x0000200E) * 15. Sensor capture repeat (0x0000200F) * 16. MCTF GMV setup (0x00002010) -------------------------------------------------*/ typedef struct { // cmd_code: 0x00002001 GD_SENSOR_INPUT_SETUP U32 cmd_code; U8 sensor_id; U8 field_format; U8 sensor_resolution; U8 sensor_pattern; U8 first_line_field_0; U8 first_line_field_1; U8 first_line_field_2; U8 first_line_field_3; U8 first_line_field_4; U8 first_line_field_5; U8 first_line_field_6; U8 first_line_field_7; U32 sensor_readout_mode; } GD_DSP_CMD_SENSOR_INPUT_SETUP_S; typedef struct { // cmd_code: 0x00002002 GD_RGB_GAIN_ADJUSTMENT U32 cmd_code; U32 r_gain; U32 g_even_gain; U32 g_odd_gain; U32 b_gain; U32 group_index; } GD_DSP_CMD_RGB_GAIN_ADJUST_S; typedef struct { // cmd_code: 0x00002003 GD_VIGNETTE_COMPENSATION U32 cmd_code; U8 enable; U8 gain_shift; U16 group_index; U32 tile_gain_addr; U32 tile_gain_addr_green_even; U32 tile_gain_addr_green_odd; U32 tile_gain_addr_blue; } GD_DSP_CMD_VIGNETTE_COMPENSATION_S; typedef struct { // cmd_code: 0x00002004 GD_AAA_STATISTICS_SETUP U32 cmd_code; U32 on : 8; U32 auto_shift : 8; U32 reserved :16; U32 data_fifo_base; U32 data_fifo_limit; U32 data_fifo2_base; U32 data_fifo2_limit; U16 awb_tile_num_col; U16 awb_tile_num_row; U16 awb_tile_col_start; U16 awb_tile_row_start; U16 awb_tile_width; U16 awb_tile_height; U16 awb_tile_active_width; U16 awb_tile_active_height; U16 awb_pix_min_value; U16 awb_pix_max_value; U16 ae_tile_num_col; U16 ae_tile_num_row; U16 ae_tile_col_start; U16 ae_tile_row_start; U16 ae_tile_width; U16 ae_tile_height; U16 af_tile_num_col; U16 af_tile_num_row; U16 af_tile_col_start; U16 af_tile_row_start; U16 af_tile_width; U16 af_tile_height; U16 af_tile_active_width; U16 af_tile_active_height; U16 ae_pix_min_value; U16 ae_pix_max_value; } GD_DSP_CMD_AAA_STATISTICS_SETUP_S; typedef struct { // cmd_code: 0x00002005 GD_LUMA_SHARPEN_SETUP U32 cmd_code; U8 strength; } GD_DSP_CMD_LUMA_SHARPEN_SETUP_S; typedef struct { // cmd_code: 0x00002006 GD_RGB_TO_RGB_SETUP U32 cmd_code; S16 matrix_values[9]; } GD_DSP_CMD_RGB_TO_RGB_STUP_S; typedef struct { // cmd_code: 0x00002007 GD_RGB_TO_YUV_SETUP U32 cmd_code; U16 matrix_values[9]; S16 y_offset; S16 u_offset; S16 v_offset; U32 group_index; } GD_DSP_CMD_RGB_TO_YUV_STUP_S; typedef struct { // cmd_code: 0x00002008 GD_GAMMA_CURVE_LOOKUP U32 cmd_code; U32 tone_curve_addr; // for A2 : tone_curve_addr_red U32 tone_curve_addr_green; U32 tone_curve_addr_blue; } GD_DSP_CMD_GAMMA_CURVE_SETUP_S; typedef struct { // cmd_code: 0x00002009 GD_NOISE_FILTER_SETUP U32 cmd_code; U32 strength; } GD_DSP_CMD_NOISE_FILTER_SETUP_S; typedef struct { // cmd_code: 0x0000200A GD_BAD_PIXEL_CORRECT_SETUP U32 cmd_code; U32 dynamic_bad_pixel_enable; U32 correction_mode; U32 hot_pixel_addr; U32 dark_pixel_addr; U16 shift0_4; U16 shift5; U32 static_bad_pixel_map_addr; } GD_DSP_CMD_BAD_PIXEL_CORRECT_SETUP_S; typedef struct { // cmd_code: 0x0000200B GD_VID_FADE_IN_OUT_SETUP U32 cmd_code; U16 fade_in_duration; U16 fade_out_duration; U8 fade_white; } GD_DSP_CMD_VID_FADE_IN_OUT_SETUP_S; typedef struct { // cmd_code: 0x0000200C GD_CFA_DOMAIN_LEAKAGE_FILTER U32 cmd_code; U32 enable; U8 alpha_rr; U8 alpha_rb; U8 alpha_br; U8 alpha_bb; U16 saturation_level; } GD_DSP_CMD_CFA_DOMAIN_LEAKAGE_FILTER_S; typedef struct { // cmd_code: 0x0000200D GD_MCTF_MV_STAB_SETUP U32 cmd_code; U8 noise_filter_strength; U8 image_stabilize_strength; U8 still_noise_filter_strength; U8 reserved; U32 mctf_cfg_dram_addr; } GD_DSP_CMD_MCTF_MV_STAB_SETUP_S; typedef struct { // cmd_code: 0x0000200E GD_SET_SLOW_SHUT_UP_SAMPL_RT U32 cmd_code; U8 slow_shutter_upsampling_rate; } GD_DSP_CMD_SET_SLOW_SHUTTER_UPSAMPLING_RATE_S; typedef struct { // cmd_code: 0x0000200F GD_SET_REPEAT_FRM U32 cmd_code; U32 repeat_cnt; U32 mode_sel; } GD_DSP_CMD_SENSOR_CAP_REPEAT_S; typedef struct { // cmd_code: 0x00002010 GD_MCTF_GMV_SETUP U32 cmd_code; U32 enable_external_gmv; U32 external_gmv; } GD_DSP_CMD_MCTF_GMV_SETUP_S; typedef struct { // cmd_code: 0x00002011 GD_DIS_SETUP U32 cmd_code; U8 x_pan_thd; U8 y_pan_thd; U8 x_dis_strength : 7; U8 flg_mc_enabled : 1; U8 y_dis_strength : 7; U8 flg_rsc_enabled : 1; U8 x_rsc_strength : 7; U8 flg_dis_enabled : 1; U8 y_rsc_strength : 7; U8 blk_select : 1; U16 focal_length; U16 sensor_cell_width : 12; U16 x_win_pullback_speed_if_pan : 4; U16 sensor_cell_height : 12; U16 y_win_pullback_speed_if_pan : 4; U32* dis_hist_dram_addr; U32 dis_hist_dram_size; U16 me_y_top_blk_start_pos : 12; S16 me_x_res : 4; U16 me_y_bot_blk_start_pos : 12; S16 me_y_res : 4; U16 me_y_top_blk_height : 12; U16 me_x_bin : 4; U16 me_y_bot_blk_height : 12; U16 me_y_bin : 4; U32 me_lamda : 8; U32 sensor_row_time : 17; U32 mc_beta : 7; S32 x_mov : 16; S32 y_mov : 16; S32 x_skew : 16; S32 y_skew : 16; } GD_DSP_CMD_DIS_ALGO_PARAMS_S; /*------------------------------------------------- * 0. Set vin capture windows (0x00002100) * 1. Amplifier linearization (0x00002101) * 2. Pixel Shuffle (0x00002102) * 3. Black level correction (0x00002103) * 4. Black level state tables (0x00002104) * 5. Black level detection window (0x00002105) * 6. Fixed pattern noise correction (0x00002106) * 7. CFA noise filter (0x00002107) * 8. Digital gain saturation level (0x00002108) * 9. Local exposure (0x00002109) * 10. Demoasic Filter (0x0000210A) * 11. RGB noise filter (0x0000210B) * 12. Color correction (0x0000210C) * 13. Chroma media filter (0x0000210D) * 14. Chroma scale (0x0000210E) * 15. Luma sharpening (0x0000210F) * 16. AAA statistics setup 1 (0x00002110) * 17. AAA statistics setup 2 (0x00002111) * 18. AAA pseudo Y setup (0x00002112) * 19. AAA histogram setup (0x00002113) * 20. Raw compression (0x00002114) * 21. Raw decompression (0x00002115) * 22. Rolling shutter compensation (0x00002116) * 23. Set zoom factor (0x00002117) * 24. AAA_STATISTICS_SETUP3 (0x00002118) * 25. Set video preview (0x00002119) * 26. Vin Reset (0x0000211A) * 27. Anti-Aliasing (0x0000211B) * 28. FPN Calibration (0x0000211C) * 29. Black level global offset (0x0000211D) -------------------------------------------------*/ typedef union { struct { U16 sw_reset : 1; U16 enb_vin : 1; U16 win_en : 1; U16 data_edge : 1; U16 mastSlav_mod : 2; U16 emb_sync : 1; U16 emb_sync_mode: 1; U16 emb_sync_loc : 2; U16 vs_pol : 1; U16 hs_pol : 1; U16 field_pol : 1; U16 sony_fld_mod : 1; U16 ec_enb : 1; U16 reserved : 1; } s_cntl_bit_fld; U16 s_control; } GD_S_CTRL_REG; typedef union { struct { U16 pad_type :1; U16 data_rate :1; U16 :1; U16 inp_src :1; U16 inp_src_ty :1; U16 src_pix_data_width:2; U16 yuv_inp_ord :2; U16 reserved :4; U16 non_mipi_input:1; // New elemented added for a5s here U16 reserved2 :2; } s_inputCfg_bit_fld; U16 s_inputCfg; } GD_S_INPUT_CONFIG_REG; typedef struct { U16 s_ctrl_reg; U16 s_inpcfg_reg; U16 s_status_reg; U16 s_v_width_reg; U16 s_h_width_reg; U16 s_h_offset_top_reg; U16 s_h_offset_bot_reg; U16 s_v_reg; U16 s_h_reg; U16 s_min_v_reg; U16 s_min_h_reg; U16 s_trigger_0_start_reg; U16 s_trigger_0_end_reg; U16 s_trigger_1_start_reg; U16 s_trigger_1_end_reg; U16 s_vout_start_0_reg; U16 s_vout_start_1_reg; U16 s_cap_start_v_reg; U16 s_cap_start_h_reg; U16 s_cap_end_v_reg; U16 s_cap_end_h_reg; U16 s_blank_leng_h_reg; U32 vsync_timeout; U32 hsync_timeout; } GD_DSP_CMD_VIN_CAP_REG_S; typedef struct { // cmd_code: 0x00002100 GD_SET_VIN_CAPTURE_WIN U32 cmd_code; // reg 0x00: 0x04 U32 S_Control_reset : 1; // 0: no op 1: reset video in U32 S_Control_enable : 1; // 0: idle 1: enable video in U32 S_Control_win_en : 1; // enable capture window. automatic reset at the end of each capture U32 S_Control_data_edge : 1; // Data clock edge. 0: valid on rising edge of sensor clock // 1: valid on falling edge of sensor clock U32 S_Control_mastSlav_mod : 2; // Bit [5:4] forms the following combination: // 2b00: undefined // 2b01: slave mode // 2b10: master mode // 2b11: undefined U32 S_Control_data_emb_sync : 1; // sync code embedded in data. When set in master mode, // this indicates sensors have embedded sync code while // receiving seperate sync signals (Sony specific). U32 S_Control_data_emb_sync_mode : 1; // Embedded sync mode. 0: ITU-656 style(8-bit) 1: ITU-656 style(full data range) U32 S_Control_data_emb_sync_loc : 2; // Embedded sync code location (2-pixel wide input only). // 2b00: embedded sync code carried on the lower pixel // 2b01: embedded sync code carried on the upper pixel // 2b1x: embedded sync code carried on both pixels [should programed to 2b1x for serial sensor interface modes] U32 S_Control_data_vs_pol : 1; // vsync polarity. 0: active high (rising edge signals start) 1: active low (falling edge signals start) U32 S_Control_data_hs_pol : 1; // hsync polarity. 0: active high (rising edge signals start) 1: active low (falling edge signals start) U32 S_Control_data_field0_pol : 1; // 0: field 0 has ID set to 0 with wen assertion 1:field 0 has ID set to 1 with wen assertion U32 S_Control_data_sony_field_mode : 1; // 0: normal field mode 1: Sony-specific field mode. The first field of a multi-field readout in Sony CCD/TG is indicated by the state of EXP/ID pin at the first assertion of WEN/FLD U32 S_Control_data_ecc_enable : 1; // 656 error correction enable {including the sync code words in serial sensor mode] U32 S_Control_data_hsync_mask : 1; // 0: Toggle hsync during vertical blanking 1: No hsync toggle during vertical blanking // reg 0x01: 0x06 // input mode[4:0] U32 S_InputConfig_pad_type : 1; // 0: LVCMOS 1: LVDS U32 S_InputConfig_data_rate : 1; // 0: SDR 1: DDR U32 S_InputConfig_data_width : 1; // 0: 1-pixel wide 1: 2-pixel wide [should be programed to 1 (2-pixel wide) for serial sensor interface modes] U32 S_InputConfig_input_source : 1; // 0: from LVDS (lvds_idsp_sdata) 1: from GPIO (iopad_idsp_sdata). Input source and pad type forms three combinations:-LVDS source, LVDS pad.-LVDS source, LVCMOS pad.-GPIO source. (Pad type makes no difference.) U32 S_InputConfig_RGB_YUV : 1; // 0: RGB input 1: YUV input // The following are legal combinations for input mode (x: 0 or 1, -: no effect): // x000x:SDR,1-pixel wide RGB/YUV data, from lvds_idsp_sdata[13:0] // x001x:DDR,1-pixel wide RGB/YUV data, from lvds_idsp_sdata[27:0] // x0100:SDR,2-pixel wide RGB/YUV data, from lvds_idsp_sdata[27:0] // x0110:DDR,2-pixel wide RGB/YUV data, from lvds_idsp_sdata[55:0] // 110--:1-pixel wide YUV data, from iopad_idsp_sdata[7:0] // 111--:2-pixel wide YUV data, from iopad_idsp_sdata[15:0] U32 S_InputConfig_Source_pixel_data_width : 2; // Source pixel data width. VIN aligns all pixel values to MSB at output. // For example, 8-bit source means left shift by 6, 14-bit source means no shift, // etc. YUV data coming from GPIO must be 8-bit wide. (Hardware ignores the configuration.) // 2b00: 8-bit 2b01: 10-bit 2b10: 12-bit 2b11: 14-bit U32 S_InputConfig_YUV_input_order : 2; // YUV input order // For 1-pixel wide YUV data // 00:Cr,Y0,Cb,Y1, // 01:Cb,Y0,Cr,Y1, // 10:Y0,Cr,Y1,Cb, // 11:Y0,Cb,Y1,Cr, // For 2-pixel wide YUV data // 00:{Cr,Y},{Cb,Y}, // 01:{Cb,Y},{Cr,Y}, // 10:{Y,Cr},{Y,Cb}, // 11: {Y, Cb}, {Y, Cr}, U32 S_InputConfig_Number_of_active_SLVS_lanes : 2; // Number of active SLVS lanes // 2b00: 4 lanes; 2b01: 8 lanes; 2b10: 12 lanes; 2b11: 16 lanes) U32 S_InputConfig_Serial_sensor_interface_mode : 1; // Serial sensor interface mode (Micron and Sony) U32 S_InputConfig_Sony_serial_sensor_interface_mode : 1; // Sony serial sensor interface mode U32 S_InputConfig_VIN_clock_select : 1; // VIN clock select - use sensor or bit clock instead of IDSP clock U32 : 2; // reserved // reg 0x02: 0x08 // Status register: Write logic 1 to the status register clears the corresponding bit. U32 S_Status_vsync : 1; // begin of frame detected U32 S_Status_trig0 : 1; // trigger 0 status. 0: no trigger/ 1: triggered U32 S_Status_trig1 : 1; // trigger 1 status. 0: no trigger/ 1: triggered U32 S_Status_ovfl : 1; // synchronous FIFO overflow. 0: no overflow/ 1: overflow occurred U32 S_Status_shortl : 1; // early hsync detected U32 S_Status_shortf : 1; // early vsync detected U32 S_Status_field : 3; // current video field (read only). U32 S_Status_no_hsync : 1; // no hsync detected (time out) U32 S_Status_no_vsync : 1; // no vsync detected (time out) U32 S_Status_idsp_ahb_vsync : 1; // frame end signal to ARM U32 S_Status_idsp_ahb_mst_vsync : 1; // master mode frame end signal to ARM U32 S_Status_idsp_ahb_last_pxl : 1; // capture window end signal to ARM U32 S_Status_ecc_uncorrectable : 1; // uncorrectable 656 errors U32 S_Status_program_error : 1; // illegal programming detected. Currently the reported error includes:Master mode, active region exceeds frame region // reg 0x03: 0x0A // Vertical active region width (master mode only) U32 S_Vwidth : 14; // vsync pulse width in unit of lines U32 : 2; // reserved // reg 0x04: 0x0C // Horizontal active region width (master mode only). U32 S_Hwidth : 14; // hsync pulse width in unit of pixels U32 : 2; // reserved // reg 0x05: 0x0E U32 S_Hoffset_top : 14; // U32 : 2; // reserved // reg 0x06: 0x10 U32 S_Hoffset_bot : 14; // U32 : 2; // reserved // reg 0x07: 0x12 // Frame size, vertical (master mode only) U32 S_V : 14; // Number of lines per field U32 : 2; // reserved // reg 0x08: 0x14 // Frame size, horizontal (in master mode only) U32 S_H : 14; // Number of pixels per line U32 : 2; // reserved // reg 0x09: 0x16 // Minimum frame size, vertical (slave mode only) U32 S_MinV : 14; // number of lines per field U32 : 2; // reserved // reg 0x0A: 0x18 // Minimum frame size, horizontal (slave mode only) U32 S_MinH : 14; // number of pixels per line U32 : 2; // reserved // reg 0x0B: 0x1A // Trigger 0 control U32 S_Trigger0Start_startline : 14; // startline. Assert trigger at the assertion of hsync of the n-thline of the frame, // where n = startline (counting from 1st line active region) U32 S_Trigger0Start_pol : 1; // polarity. 0: active low trigger/ 1: active high trigger U32 S_Trigger0Start_enable : 1; // 0: trigger disabled/ 1: trigger enabled // reg 0x0C: 0x1C // Trigger 0 control U32 S_Trigger0End_startline : 14; // lastline. Deassert trigger at the assertion of hsync of the n-thline of the frame, // where n = lastline (counting from 1st line active region) U32 : 2; // reserved // reg 0x0D: 0x1E // Trigger 1 control U32 S_Trigger1Start_startline : 14; // startline. Assert trigger at the assertion of hsync of the n-thline of the frame, // where n = startline (counting from 1st line active region) U32 S_Trigger1Start_pol : 1; // polarity. 0: active low trigger/ 1: active high trigger U32 S_Trigger1Start_enable : 1; // 0: trigger disabled/ 1: trigger enabled // reg 0x0E: 0x20 // Trigger 1 control U32 S_Trigger1End_startline : 14; // lastline. Deassert trigger at the assertion of hsync of the n-thline of the frame, // where n = lastline (counting from 1st line active region) U32 : 2; // reserved // reg 0x0F: 0x22 // VOUT synchronization control U32 S_VoutStart0_startline : 14; // startline. Synchronization signal is asserted for the duration of the n-th line, // where n = startline (counting from 1st line active region) U32 : 1; // reserved U32 S_VoutStart0_disable_field_check : 1; // 0: synchronization signal is set on even field/ 1: synchronization signal is set on each field // reg 0x10: 0x24 // VOUT synchronization control U32 S_VoutStart1_startline : 14; // startline. Synchronization signal is asserted for the duration of the n-th line, // where n = startline (counting from 1st line active region) U32 : 1; // reserved U32 S_VoutStart1_disable_field_check : 1; // 0: synchronization signal is set on even field/ 1: synchronization signal is set on each field // reg 0x11: 0x26 // Capture window control, vertical start U32 S_CapStartV : 14; // Start vertical location of capture window U32 : 2; // reserved // reg 0x12: 0x28 // Capture window control, horizontal start U32 S_CapStartH : 14; // Start horizontal location of capture window // In 8 channel , Sony serial sensor mode, the capture window should start 4 // pixels after the SAV (i.e. exclude the 4 pixels added by the receiver at the // beginning of every line which are not part of the original active line) U32 : 2; // reserved // reg 0x13: 0x2A // Capture window control, vertical end U32 S_CapEndV : 14; // End vertical location of capture window U32 : 2; // reserved // reg 0x14: 0x2C // Capture window control, horizontal end U32 S_CapEndH : 14; // End horizontal location of capture window // In 8 channel, Sony serial sensor mode, the capture window should end 4 pixels // before the EAV sync code to exclude the additional sync code pixels. U32 : 2; // reserved // reg 0x15: 0x2E // All-zero embedded sync horizontal blank interval length U32 S_BlankLengthH : 14; // Blank interval length in sensor clock cycles U32 : 2; // reserved // reg 0x16: 0x30 // Vsync timeout limit (lower 16 bits) and also EAV column for SLVS mode. U32 S_TimeoutVLow : 16; // SLVS mode programing notes:Should be integer multiple of 4 and does not count SAV/EAV sync code pixels // reg 0x17: 0x32 // Vsync timeout limit (upper 16 bits) U32 S_TimeoutVHigh : 16; // // reg 0x18: 0x34 // Hsync timeout limit (lower 16 bits) and also Horizontal line length (SAV-to-SAV distance) in SLVS mode. U32 S_TimeoutHLow : 16; // SLVS mode programing notes:Should be integer multiple of 4 and does not count SAV/EAV sync code pixels // reg 0x19: 0x36 // Hsync timeout limit (lower 16 bits) U32 S_TimeoutHHigh : 16; // // reg 0x19: 0x38 U32 S_mipi_cfg1 : 16; // // reg 0x1A: 0x3A U32 S_mipi_cfg2 : 16; // // reg 0x1B: 0x3C U32 S_mipi_bdphyctl : 16; // // reg 0x1C: 0x3E U32 S_mipi_sdphyctl : 16; // } GD_DSP_CMD_VIN_CAP_WIN_S; typedef struct { // cmd_code: 0x00002101 GD_AMPLIFIER_LINEARIZATION U32 cmd_code; U32 enable; U32 look_up_table_addr; U32 exponent_table_addr; U32 black_level_offset_table_addr; } GD_DSP_CMD_AMPLIFIER_LINEAR_S; typedef struct { // cmd_code: 0x00002102 GD_PIXEL_SHUFFLE U32 cmd_code; U32 enable; U32 reorder_mode; U32 input_width; U16 start_index[8]; U16 pitch[8]; } GD_DSP_CMD_PIXEL_SHUFFLE_S; typedef struct { // cmd_code: 0x00002103 GD_BLACK_LEVEL_CORRECTION_CONFIG U32 cmd_code; U32 column_enable; U32 row_enable; U32 black_level_mode; U32 bad_pixel_mode_column; U32 bad_pixel_mode_row; U32 cold_pixel_thresh; U32 hot_pixel_thresh; U32 center_offset; U32 column_replace; U32 column_invalid_replace; U32 column_invalid_thresh; U32 row_invalid_thresh; U32 column_average_k_frames; U32 row_average_k_frames; U32 column_black_gain; U32 row_black_gain; U32 column_bad_pixel_subtract; U32 global_offset_ee; U32 global_offset_eo; U32 global_offset_oe; U32 global_offset_oo; } GD_DSP_CMD_BLACK_LEVEL_CORRECTTION_S; typedef struct { // cmd_code: 0x00002104 GD_BLACK_LEVEL_STATE_TABLES U32 cmd_code; U32 num_columns; U32 column_frame_acc_addr; U32 column_average_acc_addr; U32 num_rows; U32 row_fixed_offset_addr; U32 row_average_acc_addr; } GD_DSP_CMD_BLACK_LEVEL_STATE_TABLE_S; typedef struct { // cmd_code: 0x00002105 GD_BLACK_LEVEL_DETECTION_WINDOW U32 cmd_code; U8 top_black_present; U8 bottom_black_present; U8 left_black_present; U8 right_black_present; U32 top_black_start; U32 top_black_end; U32 bottom_black_start; U32 bottom_black_end; U32 left_black_start; U32 left_black_end; U32 right_black_start; U32 right_black_end; } GD_DSP_CMD_BLACK_LEVEL_DETECT_WIN_S; typedef struct { // cmd_code: 0x00002106 GD_FIXED_PATTERN_NOISE_CORRECTION U32 cmd_code; U32 fpn_pixel_mode; U32 row_gain_enable; U32 column_gain_enable; U32 num_of_rows; U16 num_of_cols; U16 fpn_pitch; U32 fpn_pixels_addr; U32 fpn_pixels_buf_size; U32 intercept_shift; U32 intercepts_and_slopes_addr; U32 row_gain_addr; U32 column_gain_addr; } GD_DSP_CMD_FIXED_PATTERN_NOISE_CORRECT_S; typedef struct { // cmd_code: 0x00002107 GD_CFA_NOISE_FILTER_INFO U32 cmd_code; U32 enable; U32 center_weight_red; U32 center_weight_green; U32 center_weight_blue; U32 thresh_k0_red; U32 thresh_k0_green; U32 thresh_k0_blue; U32 thresh_k0_close; U32 thresh_k1_red; U32 thresh_k1_green; U32 thresh_k1_blue; U32 direct_center_weight_red; U32 direct_center_weight_green; U32 direct_center_weight_blue; U32 direct_thresh_k0_red; U32 direct_thresh_k0_green; U32 direct_thresh_k0_blue; U32 direct_thresh_k1_red; U32 direct_thresh_k1_green; U32 direct_thresh_k1_blue; U32 direct_grad_thresh; } GD_DSP_CMD_CFA_NOISE_FILTER_INFO_S; typedef struct { // cmd_code: 0x00002108 GD_DIGITAL_GAIN_SATURATION_LEVEL U32 cmd_code; U32 level_red; U32 level_green_even; U32 level_green_odd; U32 level_blue; U32 group_index; } GD_DSP_CMD_DIGITAL_GAIN_LEVEL_S; typedef struct { // cmd_code: 0x00002109 GD_LOCAL_EXPOSURE U32 cmd_code; U16 enable; U16 group_index; U32 radius; U8 luma_weight_red; U8 luma_weight_green; U8 luma_weight_blue; U8 luma_weight_sum_shift; U32 gain_curve_table_addr; U16 black_level_offset_red; U16 black_level_offset_green; U16 black_level_offset_blue; U16 luma_offset; U16 global_offset; } GD_DSP_CMD_LOCAL_EXPOSURE_S; typedef struct { // cmd_code: 0x0000210A GD_DEMOASIC_FILTER U32 cmd_code; U16 enable; U16 group_index; U32 grad_clip_thresh; U32 grad_noise_thresh; U32 activity_thresh; U32 activity_difference_thresh; } GD_DSP_CMD_DEMOASIC_FILTER_S; typedef struct { // cmd_code: 0x0000210B GD_RGB_NOISE_FILTER U32 cmd_code; U32 speckle_filter_enable; U32 reinterpol_filter_enable; U32 jag_filter_enable; U32 jag_thresh_grad_add; U32 jag_thresh_grad_mult; U32 jag_thresh_add; U16 jag_thresh_mult; U16 group_index; U8 direction_filter_enable; U8 thresh_grad_mult; U16 thresh_grad_add; U8 streng_origin_red; U8 streng_origin_green; U8 streng_origin_blue; U8 streng_interpol_red; U8 streng_interpol_green; U8 streng_interpol_blue; U8 streng_isotrop_origin_red; U8 streng_isotrop_origin_green; U8 streng_isotrop_origin_blue; U8 streng_isotrop_interpol_red; U8 streng_isotrop_interpol_green; U8 streng_isotrop_interpol_blue; } GD_DSP_CMD_RGB_NOISE_FILTER_S; typedef struct { // cmd_code: 0x0000210C GD_COLOR_CORRECTION U32 cmd_code; U8 enable; U8 no_interpolation; U8 yuv422_foramt; U8 uv_center; U32 multi_red; U32 multi_green; U32 multi_blue; U32 in_lookup_table_addr; U32 matrix_addr; U32 output_lookup_bypass; U32 out_lookup_table_addr; U32 group_index; } GD_DSP_CMD_COLOR_CORRECTION_S; typedef struct { // cmd_code: 0x0000210D GD_CHROMA_MEDIAN_FILTER_INFO U32 cmd_code; U32 enable; U32 group_index; U32 k0123_table_addr; U16 u_sat_t0; U16 u_sat_t1; U16 v_sat_t0; U16 v_sat_t1; U16 u_act_t0; U16 u_act_t1; U16 v_act_t0; U16 v_act_t1; } GD_DSP_CMD_CHROMA_MEDIAN_FILTER_INFO_S; typedef struct { // cmd_code: 0x0000210E GD_CHROMA_SCALE U32 cmd_code; U32 enable; U32 make_legal; S16 u_weight_0; S16 u_weight_1; S16 u_weight_2; S16 v_weight_0; S16 v_weight_1; S16 v_weight_2; U32 gain_curver_addr; U32 group_index; } GD_DSP_CMD_CHROMA_SCALE_S; typedef struct { // cmd_code: 0x0000210F GD_LUMA_SHARPENING U32 cmd_code; U32 enable; U32 grad_thresh_0; U32 grad_thresh_1; U32 smooth_shift; U32 edge_shift; U32 edge_thresh; U32 alpha_table_addr; U32 group_index; U32 unsharp_mask[6]; U8 clip_low; U8 clip_high; U8 max_change_down; U8 max_change_up; } GD_DSP_CMD_LUMA_SHARPENING_S; typedef struct { // cmd_code: 0x00002110 GD_AAA_STATISTICS_SETUP1 // cmd_code: 0x00002111 GD_AAA_STATISTICS_SETUP2 U32 cmd_code; U8 af_horizontal_filter_mode : 4; U8 af_filter_select : 4; U8 af_horizontal_filter_stage1_enb; U8 af_horizontal_filter_stage2_enb; U8 af_horizontal_filter_stage3_enb; U16 af_horizontal_filter_gain[7]; U16 af_horizontal_filter_shift[4]; U16 af_horizontal_filter_bias_off; U16 af_horizontal_filter_thresh; U16 af_vertical_filter_thresh; U16 af_tile_fv_horizontal_shift; U16 af_tile_fv_vertical_shift; U16 af_tile_fv_horizontal_weight; U16 af_tile_fv_vertical_weight; } GD_DSP_CMD_AAA_STATISTICS_SETUP12_S; typedef struct { // cmd_code: 0x00002112 GD_AAA_PSEUDO_Y_SETUP U32 cmd_code; U32 mode; U32 sum_shift; U8 pixel_weight[4]; U8 tone_curve[32]; } GD_DSP_CMD_AAA_PSEUDO_Y_S; typedef struct { // cmd_code: 0x00002113 GD_AAA_HISTORGRAM_SETUP U32 cmd_code; U16 mode; U16 histogram_select; U16 ae_file_mask[8]; } GD_DSP_CMD_AAA_HISTOGRAM_S; typedef struct { // cmd_code: 0x00002114 GD_RAW_COMPRESSION U32 cmd_code; U32 enable; U32 lossy_mode; U32 vic_mode; } GD_DSP_CMD_RAW_COMPRESSION_S; typedef struct { // cmd_code: 0x00002115 GD_RAW_DECOMPRESSION U32 cmd_code; U32 enable; U32 lossy_mode; U32 vic_mode; U32 image_width; U32 image_height; } GD_DSP_CMD_RAW_DECOMPRESSION_S; typedef struct { // cmd_code: 0x00002116 GD_ROLLING_SHUTTER_COMPENSATION U32 cmd_code; U32 enable; U32 skew_init_phase_horizontal; U32 skew_phase_incre_horizontal; U32 skew_phase_incre_vertical; } GD_DSP_CMD_ROLLING_SHUTTER_COMPENSATION_S; typedef struct { // cmd_code: 0x00002117 GD_SET_ZOOM_FACTOR U32 cmd_code; U32 zoom_x; U32 zoom_y; U32 x_center_offset; U32 y_center_offset; } GD_DSP_CMD_ZOOM_FACTOR_S; typedef struct { // cmd_code: 0x00002118 GD_AAA_STATISTICS_SETUP3 U32 cmd_code; U16 awb_tile_rgb_shift; U16 awb_tile_y_shift; U16 awb_tile_min_max_shift; U16 ae_tile_y_shift; U16 ae_tile_linear_y_shift; U16 af_tile_cfa_y_shift; U16 af_tile_y_shift; } GD_DSP_CMD_AAA_STATISTICS_SETUP3_S; typedef struct { // cmd_code: 0x00002119 GD_VIDEO_PREVIEW_SETUP U32 cmd_code; U8 preview_id; U8 preview_format; U16 preview_w; U16 preview_h; U8 preview_frame_rate; U8 preview_en; /* ?* new fields for preview source window parameters of preview A and B ?* x/y offset is relative to the upper left ?* corner of the Main window. ?*/ U16 preview_src_w; U16 preview_src_h; U16 preview_src_x_offset; U16 preview_src_y_offset; U32 preview_freeze_enabled : 1; U32 preview_freeze_offset_x : 10; U32 preview_freeze_offset_y : 10; U32 resv : 11; } GD_DSP_CMD_VIDEO_PREVIEW_S; typedef struct { // cmd_code: 0x0000211B GD_ANTI_ALIASING U32 cmd_code; U32 enable; U32 threshold; U32 shift; } GD_DSP_CMD_ANTI_ALIASING_FILTER_S; typedef struct { // cmd_code: 0x0000211C GD_FPN_CALIBRATION U32 cmd_code; U32 dram_addr; U32 width; U32 height; U32 num_of_frames; } GD_DSP_CMD_FPN_CALIBRATION_S; typedef struct { // cmd_code: 0x0000211D GD_BLACK_LEVEL_GLOBAL_OFFSET U32 cmd_code; U32 global_offset_ee; U32 global_offset_eo; U32 global_offset_oe; U32 global_offset_oo; U16 black_level_offset_red; U16 black_level_offset_green; U16 black_level_offset_blue; } GD_DSP_CMD_BLACK_LEVEL_GLOBAL_OFFSET_S; typedef struct { // cmd_code: 0x0000211E GD_RGB_DIRECTIONAL_FILTER U32 cmd_code; U8 directional_filter_enable; U8 thresh_gradient_mult; U16 thresh_gradient_add; U16 thresh_blend_dir_0; U16 thresh_blend_dir_1; U16 thresh_blend_iso_0; U16 thresh_blend_iso_1; U32 coeff_dir_orig_addr; U32 coeff_iso_orig_addr; U32 coeff_dir_interpolated_addr; U32 coeff_iso_interpolated_addr; } GD_DSP_CMD_RGB_DIRECTIONAL_FILTER_S; typedef struct { // cmd_code: 0x0000211F GD_HDR_MIXER U32 cmd_code; U32 mixer_mode; U8 radius; U8 luma_weight_red; U8 luma_weight_green; U8 luma_weight_blue; U16 threshold; U8 thresh_delta; U8 long_exposure_shift; } GD_DSP_CMD_HDR_MIXER_S; typedef struct { // cmd_code: 0x00002120 GD_LUMA_SHARPENING_LINEARIZATION U32 cmd_code; U32 enable; U32 linearization_table_addr; U32 inverse_linearization_table_addr; U32 low_noise_luma_linearization_table_addr; U32 group_index; } GD_DSP_CMD_LUMA_SHARPENING_LINEARIZATION_S; typedef struct { // cmd_code: 0x00002121 GD_LUMA_SHARPENING_FIR_CONFIG U32 cmd_code; U8 enable_FIR1; U8 enable_FIR2; U16 enable_FIR2_bypass_alpha; U32 fir0_clip_low; U32 fir0_clip_high; U32 fir1_clip_low; U32 fir1_clip_high; U32 fir2_clip_low; U32 fir2_clip_high; U32 coeff_FIR0_addr; U32 coeff_FIR1_addr; U32 coeff_FIR2_addr; U32 coring_table_addr; U32 group_index; } GD_DSP_CMD_LUMA_SHARPENING_FIR_CONFIG_S; typedef struct { // cmd_code: 0x00002122 GD_LUMA_SHARPENING_LNL U32 cmd_code; U8 enable; U8 weight_red; U8 weight_green; U8 weight_blue; U32 input_clip_red; U32 input_clip_green; U32 input_clip_blue; U32 low_noise_luma_linearization_table_addr; U32 tone_curve_addr; U32 group_index; } GD_DSP_CMD_LUMA_SHARPENING_LNL_S; typedef struct { // cmd_code: 0x00002123 GD_LUMA_SHARPENING_TONE U32 cmd_code; U8 enable; U8 enable_manual_luma_adjust; U8 luma_low; U8 luma_high; U8 luma_alpha_low; U8 luma_alpha_high; U8 luma_delta_low; U8 luma_delta_high; U32 tone_control_config_addr; U32 group_index; } GD_DSP_CMD_LUMA_SHARPENING_TONE_CONTROL_S; typedef struct { // cmd_code: 0x00002124 GD_MULTI_STREAM_VIDEO_PREVIEW U32 cmd_code; U16 preview_id; U16 num_preview_ins; U32 preview_src : 8; U32 dis_dev_x_loc : 12; U32 dis_dev_y_loc : 12; U16 preview_width; U16 preview_height; } GD_DSP_CMD_MULTI_STREAM_PREVIEW_S; typedef struct { // cmd_code: 0x00002125 GD_ENA_SECOND_STREAM_ENCODE U32 cmd_code; U32 primary_stream_channel : 24; U32 frame_rate : 8; U16 output_width; U16 output_height; U16 encode_width; U16 encode_height; } GD_DSP_CMD_ENA_SECOND_STREAM_S; typedef struct { // cmd_code: 0x00002126 GD_SET_ALPHA_CHANNEL U32 cmd_code; U32 luma_alpha_addr; U32 chroma_alpha_addr; U16 luma_alpha_pitch; U16 luma_alpha_width; U16 luma_alpha_height; U16 chroma_alpha_pitch; U16 chroma_alpha_width; U16 chroma_alpha_height; } GD_DSP_CMD_SET_ALPHA_CHANNEL_S; /** * * Modify Frame Buffer * Used to get some DRAM from DSP in some mode * and return it back to DSP when finished. * User only send this command when the DSP is in IDEL State. */ typedef struct { // cmd_code: 0x00002127 GD_MODIFY_FRAME_BUFFER U32 cmd_code; U32 dramStart; //32 bits DRAM ADDRSS of the Frame Buffer. Must be 32 bits aligned U32 dramSize; //32 bits Size of the DRAM for DSP. } GD_DSP_CMD_MODIFY_FRAME_BUFFER_S; typedef struct { // cmd_code: 0x00002128 GD_SET_ACT_WIN_CENTER U32 cmd_code; S32 x_offset; S32 y_offset; S32 x_frm_mv; S32 y_frm_mv; } GD_DSP_CMD_SET_ATIVE_WIN_CTR_OFS_S; typedef struct { // cmd_code: 0x00002129 GD_SET_WARP_CONTROL U32 cmd_code; U32 warp_control; U32 warp_horizontal_table_address; U32 warp_vertical_table_address; U32 actual_left_top_x; U32 actual_left_top_y; U32 actual_right_bot_x; U32 actual_right_bot_y; U32 zoom_x; U32 zoom_y; U32 x_center_offset; U32 y_center_offset; U8 grid_array_width; U8 grid_array_height; U8 horz_grid_spacing_exponent; U8 vert_grid_spacing_exponent; U8 vert_warp_enable; U8 vert_warp_grid_array_width; U8 vert_warp_grid_array_height; U8 vert_warp_horz_grid_spacing_exponent; U8 vert_warp_vert_grid_spacing_exponent; U8 binning; U16 reserved_2; S32 hor_skew_phase_inc; /* This one is used for ARM to calcuate the dummy window for Ucode, these fields should be zero for turbo command in case of EIS. could be non-zero valid value only when this warp command is send in non-turbo command way. */ U16 dummy_window_x_left; U16 dummy_window_y_top; U16 dummy_window_width; U16 dummy_window_height; /* This field is used for ARM to calculate the cfa prescaler zoom factor which will affect the warping table value. this should also be zeor during the turbo command sending.Only valid on the non-turbo command time. */ U16 cfa_output_width; U16 cfa_output_height; } GD_DSP_CMD_SET_WARP_CONTROL_S; typedef struct { // cmd_code: 0x0000212A GD_EARLY_WB_GAIN U32 cmd_code; U32 cfa_early_red_multiplier; U32 cfa_early_green_multiplier_even; U32 cfa_early_green_multiplier_odd; U32 cfa_early_blue_multiplier; U32 aaa_early_red_multiplier; U32 aaa_early_green_multiplier_even; U32 aaa_early_green_multiplier_odd; U32 aaa_early_blue_multiplier; } GD_DSP_CMD_EARLY_WB_GAIN_S; typedef struct { // cmd_code: 0x00002130 GD_LUMA_SHARPENING_EDGE_CONTROL U32 cmd_code; U32 group_index; U16 edge_threshold; U8 edge_threshold_multiplier; U8 wide_weight; U8 narrow_weight; } GD_DSP_CMD_LUMA_SHARPENING_EDGE_CONTROL_S; typedef struct { // cmd_code: 0x00002131 GD_LUMA_SHARPENING_BLEND_CONTROL U32 cmd_code; U32 group_index; U16 enable; U8 edge_threshold_multiplier; U8 iso_threshold_multiplier; U16 edge_threshold0; U16 edge_threshold1; U16 dir_threshold0; U16 dir_threshold1; U16 iso_threshold0; U16 iso_threshold1; } GD_DSP_CMD_LUMA_SHARPENING_BLEND_CONTROL_S; typedef struct { // cmd_code: 0x00002132 GD_LUMA_SHARPENING_LEVEL_CONTROL U32 cmd_code; U32 group_index; U32 select; U8 low; U8 low_0; U8 low_delta; U8 low_val; U8 high; U8 high_0; U8 high_delta; U8 high_val; U8 base_val; U8 area; U16 level_control_clip_low; U16 level_control_clip_low2; U16 level_control_clip_high; U16 level_control_clip_high2; } GD_DSP_CMD_LUMA_SHARPENING_LEVEL_CONTROL_S; typedef struct { // cmd_code: 0x00002133 GD_LUMA_SHARPENING_MISC_CONTROL U32 cmd_code; U32 group_index; U8 coring_control; U8 add_in_low_pass; U8 second_input_enable; U8 second_input_signed; U8 second_input_shift; U8 output_signed; U8 output_shift; U8 abs; U8 yuv; } GD_DSP_CMD_LUMA_SHARPENING_MISC_CONTROL_S; typedef struct { // cmd_code: 0x00002134 GD_AAA_EARLY_WB_GAIN U32 cmd_code; U32 red_multiplier; U32 green_multiplier_even; U32 green_multiplier_odd; U32 blue_multiplier; U8 enable_ae_wb_gain; U8 enable_af_wb_gain; U8 enable_histogram_wb_gain; U8 reserved; U32 red_wb_multiplier; U32 green_wb_multiplier_even; U32 green_wb_multiplier_odd; U32 blue_wb_multiplier; } GD_DSP_CMD_AAA_EARLY_WB_GAIN_S; /*------------------------------------------------- * H264/JPEG encoding mode * 1. Video Preprocessing (0x00003001) * 2. Fast AAA capture (0x00003002) * 3. H264 encode (0x00003004) * 4. H264 encode from memory (0x00003005) invalid * 5. H264 bits FIFO update (0x00003006) * 6. H264 encoding stop (0x00003007) * 7. Still capture (0x00004001) * 8. JPEG encode/rescale from memory (0x00004002) * 9. JPEG bits FIFO update (0x00004003) * 10. Free RAW/YUV422 pictures buffers (0x00004004) * 11. JPEG/RQW/YUV/422 Stop (0x00004005) * 12. Vid Fade In Out (0x00004007) * 13. MJPEG encode with h264 (0x00004008) * 14. OSD insert in MJPEG and H264 (0x00004009) * 15. YUV422 capture (0x00004010) * 16. Send cavlc result (0x00004011) -------------------------------------------------*/ typedef struct { // cmd_code: 0x00003001 GD_VIDEO_PREPROCESSING U32 cmd_code; U32 input_format : 8; U32 sensor_id : 8; U32 keep_states : 8; U32 vin_frame_rate : 8; U16 vidcap_w; U16 vidcap_h; U16 main_w; U16 main_h; U16 encode_w; U16 encode_h; U16 encode_x; U16 encode_y; U16 preview_w_A; U16 preview_h_A; U32 input_center_x; U32 input_center_y; U32 zoom_factor_x; U32 zoom_factor_y; U32 aaa_data_fifo_start; U32 sensor_readout_mode; U8 noise_filter_strength; U8 image_stabilize_strength; U8 bit_resolution; U8 bayer_pattern; U8 preview_format_A : 4; U8 preview_format_B : 3; U8 no_pipelineflush : 1; U8 preview_frame_rate_A; U16 preview_w_B; U16 preview_h_B; U8 preview_frame_rate_B; U8 preview_A_en : 4; // 0: dram, 1: smem U8 preview_B_en : 4; // 0: dram, 1: smem U16 horizontal_channel_number; // number of channels (streams) displayed on horizontal direction in preview window. U16 vertical_channel_number; //number of channels (streams) displayed on vertical direction in preview window. U8 vin_frame_rate_ext; U8 vdsp_int_factor; U8 main_out_frame_rate; U8 main_out_frame_rate_ext; U8 vid_skip; //used to skip N start frames in VIN capture to avoid bad frames U8 EIS_enable : 1; //Used to inidcate that EIS will be used. U8 DIS_enable : 1; //Used to indicate that DIS will be used U8 Vert_WARP_enable : 1; //Used to indicate that Vertical WARP will be used U8 no_vin_reset_exiting : 1; //Used to indicate that we do not need to resetting vin and need to wait //out the vin before exiting VIDEO mode to TIMER mode U8 support_cfa_out_win_2129 : 1; //Enable teh CFA output window support in ucode. //This one is only useful for non DIS pipeline U8 oversampling_disabled : 1; // When set to 1, oversampling is disabled U8 hd_sdi_mode : 1; // when set to 1, HD-SDI mode U8 reserved : 1; U16 reserved_2; U32 cmdReadDly; // Used to indicate the turbo command time related to normal interrrupts. // First bit indicate its direction, // 1: before the VDSP interrupt, i.e., turbo command deadline is the // absolute value of cmdReadDly's audio clk before the next normal interrupts. // 0: after the VDSP interrutps, i.e., turbo command deadline is the // absolute value of cmdReadDly's audio clk after the next normal interrutps. // new fields for preview source window parameters of preview A and B // x/y offset is relative to the upper left // corner of the Main window. U16 preview_src_w_A; U16 preview_src_h_A; U16 preview_src_x_offset_A; U16 preview_src_y_offset_A; U16 preview_src_w_B; U16 preview_src_h_B; U16 preview_src_x_offset_B; U16 preview_src_y_offset_B; } GD_DSP_CMD_VIDEO_PREPROC_S; typedef struct { // cmd_code: 0x00003002 GD_FAST_AAA_CAPTURE U32 cmd_code; U16 input_image_width; U16 input_image_height; U32 start_record_id; } GD_DSP_CMD_FAST_AAA_CAPTURE_S; typedef struct { // cmd_code: 0x00003004 GD_H264_ENCODE U32 cmd_code; U32 bits_fifo_next; U32 info_fifo_next; U32 start_encode_frame_no; U32 encode_duration; U8 is_flush; U8 enable_slow_shutter; U8 res_rate_min; // between 0 and 100 S8 alpha; // between -6 and 6 S8 beta; // between -6 and 6 U8 en_loop_filter; // 1 enable loop filtering. U8 max_upsampling_rate; U8 slow_shutter_upsampling_rate; // SPS U8 frame_cropping_flag; U8 high_profile : 1; U8 reserved2 : 7; U16 frame_crop_left_offset; U16 frame_crop_right_offset; U16 frame_crop_top_offset; U16 frame_crop_bottom_offset; U8 num_ref_frame; U8 log2_max_frame_num_minus4; U8 log2_max_pic_order_cnt_lsb_minus4; U8 sony_avc : 1; U8 reserved : 7; U16 height_mjpeg_h264_simultaneous; U16 width_mjpeg_h264_simultaneous; U16 vui_enable : 1; U16 aspect_ratio_info_present_flag : 1; U16 overscan_info_present_flag : 1; U16 overscan_appropriate_flag : 1; U16 video_signal_type_present_flag : 1; U16 video_full_range_flag : 1; U16 colour_description_present_flag : 1; U16 chroma_loc_info_present_flag : 1; U16 timing_info_present_flag : 1; U16 fixed_frame_rate_flag : 1; U16 nal_hrd_parameters_present_flag : 1; U16 vcl_hrd_parameters_present_flag : 1; U16 low_delay_hrd_flag : 1; U16 pic_struct_present_flag : 1; U16 bitstream_restriction_flag : 1; U16 motion_vectors_over_pic_boundaries_flag : 1; // aspect_ratio_info_present_flag U16 SAR_width; U16 SAR_height; // video_signal_type_present_flag U8 video_format; // colour_description_present_flag U8 colour_primaries; U8 transfer_characteristics; U8 matrix_coefficients; // chroma_loc_info_present_flag U8 chroma_sample_loc_type_top_field : 4; U8 chroma_sample_loc_type_bottom_field : 4; U8 aspect_ratio_idc; U8 reserved3; // bitstream_restriction_flag U32 max_bytes_per_pic_denom : 8; U32 max_bits_per_mb_denom : 8; U32 log2_max_mv_length_horizontal : 8; U32 log2_max_mv_length_vertical : 8; U16 num_reorder_frames; U16 max_dec_frame_buffering; U32 I_IDR_sp_rc_handle_mask : 8; U32 IDR_QP_adj_str : 8; U32 IDR_class_adj_limit : 8; U32 reserved_1 : 8; U32 I_QP_adj_str : 8; U32 I_class_adj_limit : 8; U32 firstGOPstartB : 8; U32 au_type : 8; //tune the AQP and mode bias S8 intra16x16_bias; // -64~64, clamp the negative value to -64 to avoid underflow S8 intra4x4_bias; // -64~64, clamp the negative value to -64 to avoid underflow S8 inter16x16_bias; // -64~64, clamp the negative value to -64 to avoid underflow S8 inter8x8_bias; // -64~64, clamp the negative value to -64 to avoid underflow S8 direct16x16_bias; // -64~64, clamp the negative value to -64 to avoid underflow S8 direct8x8_bias; // -64~64, clamp the negative value to -64 to avoid underflow S8 me_lambda_qp_offset; S8 reserved4; } GD_DSP_CMD_H264_ENCODE_S, GD_DSP_CMD_VID_ENCODE_S; typedef struct { // cmd_code: 0x00003005 GD_H264_ENCODE_FROM_MEMORY U32 cmd_code; U16 vidcap_w; U16 vidcap_h; U16 vidcap_pitch; U16 main_w; U16 main_h; U16 encode_w; U16 encode_h; U16 encode_x; U16 encode_y; U16 preview_w; U16 preview_h; U32 input_center_x; U32 input_center_y; U32 zoom_factor_x; U32 zoom_factor_y; U8 num_images; U32 h264_bits_fifo_start; U32 h264_info_fifo_start; U32 input_image_addr_Y_UV[8]; //u_long } GD_DSP_CMD_H264_ENCODE_FROM_MEMORY_PARAM_S, GD_DSP_CMD_VID_ENCODE_FROM_MEMORY_PARAM_S; typedef struct { // cmd_code: 0x00003006 GD_H264_BITS_FIFO_UPDATE U32 cmd_code; U32 bits_output_fifo_end; } GD_DSP_CMD_H264_ENCODE_BITS_FIFO_UPDATE_S, GD_DSP_CMD_H264_VID_ENCODE_BITS_FIFO_UPDATE_S; typedef struct { // cmd_code: 0x00003007 GD_ENCODING_STOP U32 cmd_code; U32 stop_method; } GD_DSP_CMD_H264_ENCODE_STOP_S, GD_DSP_CMD_VID_ENCODE_STOP_S; typedef struct { // cmd_code: 0x00003008 GD_MODIFY_CMD_DLY U32 cmd_code; U32 api_proc_delay; } GD_DSP_CMD_PROC_DELAY_S, GD_DSP_CMD_VID_PROC_DELAY_T; typedef struct { // cmd_code: 0x00004001 GD_STILL_CAPTURE U32 cmd_code; U8 output_select; U8 input_format; U8 vsync_skip; U8 resume; U32 number_frames_to_capture; U16 vidcap_w; U16 vidcap_h; U16 main_w; U16 main_h; U16 encode_w; U16 encode_h; U16 encode_x; U16 encode_y; U16 preview_w; U16 preview_h; U16 thumbnail_w; U16 thumbnail_h; U32 input_center_x; U32 input_center_y; U32 zoom_factor_x; U32 zoom_factor_y; U32 jpeg_bits_fifo_start; U32 jpeg_info_fifo_start; U32 sensor_readout_mode; U8 sensor_id; U8 field_format; U8 sensor_resolution; U8 sensor_pattern; U8 first_line_field_0; U8 first_line_field_1; U8 first_line_field_2; U8 first_line_field_3; U8 first_line_field_4; U8 first_line_field_5; U8 first_line_field_6; U8 first_line_field_7; U16 preview_w_B; U16 preview_h_B; U16 raw_cap_cntl; // Added by Colin chen for the High ISO mode of Still processing U8 still_process_mode; U8 yuv_proc_mode; U32 still_process_data_dram_addr; U32 raw_cap_hw_rsc_ptr; U8 disable_quickview_HDMI : 1; U8 disable_quickview_LCD : 1; // Used to indicate that we do not need to resetting vin and need to wait // out the vin before exiting RJPEG mode to TIMER mode U8 no_vin_reset_exiting : 1; U8 reserved_1 : 5; U8 jpg_enc_cntrl; U16 thumbnail_active_h; } GD_DSP_CMD_STILL_CAPTURE_S; typedef struct { // cmd_code: 0x00004002 GD_JPEG_ENCODE_RESCALE_FROM_MEMORY U32 cmd_code; U8 output_select; U8 input_format; U8 bayer_pattern; U8 resolution; U32 input_address; U32 input_chroma_address; U16 input_pitch; U16 input_chroma_pitch; U16 input_h; U16 input_w; U16 main_w; U16 main_h; U16 encode_w; U16 encode_h; U16 encode_x; U16 encode_y; U16 preview_w_A; U16 preview_h_A; U16 thumbnail_w; U16 thumbnail_h; U32 input_center_x; U32 input_center_y; U32 zoom_factor_x; U32 zoom_factor_y; U32 jpeg_bits_fifo_start; U32 jpeg_info_fifo_start; U16 preview_w_B; U16 preview_h_B; U16 cap_cntl; /* #define STILL_PROCESS_MODE_NORMAL 0 #define STILL_PROCESS_MODE_HIGH_ISO 1 are defined above. Added by Colin chen for the High ISO mode of Still processing */ U8 still_process_mode; U8 still_process_mode_padding; U32 still_process_data_dram_addr; U8 disable_quickview_HDMI : 1; U8 disable_quickview_LCD : 1; U8 no_vin_reset_exiting : 1; //Used to indicate that we do not need to resetting vin and need to wait //out the vin before exiting RJPEG mode to TIMER mode U8 reserved_1 : 5; U8 reserved; U16 thumbnail_active_h; } GD_DSP_CMD_STILL_PROC_FROM_MEMORY_S; typedef struct { // cmd_code: 0x00004003 GD_JPEG_BITS_FIFO_UPDATE U32 cmd_code; U32 bits_fifo_end; } GD_DSP_CMD_JPEG_BITS_FIFO_UPDATE_S; typedef struct { // cmd_code: 0x00004004 GD_FREE_RAW_YUV_PIC_BUFFER U32 cmd_code; U32 number_of_raw_pic_consumed; U32 raw_last_addr_consumed; U32 number_of_thumbnail_pic_consumed; U32 thumbnail_last_addr_consumed; U32 number_of_encode_YUV_pic_consumed; U32 encode_yuv_last_addr_consumed; } GD_DSP_CMD_FREE_RAW_YUV_PICTURE_BUFFER_S; typedef struct { // cmd_code: 0x00004005 GD_JPEG_RAW_YUV_STOP U32 cmd_code; } GD_DSP_CMD_JPEG_STOP_S; typedef struct { // cmd_code: 0x00004006 GD_MJPEG_ENCODE U32 cmd_code; U32 bits_fifo_next; U32 info_fifo_next; U32 start_encode_frame_no; U32 encode_duration; U8 framerate_control_M; U8 framerate_control_N; U16 reserve; } GD_DSP_CMD_MJPEG_CAPTURE_S; typedef struct { // cmd_code: 0x00004007 GD_VID_FADE_IN_OUT U32 cmd_code; // 0: fade in start, 1: fade in stop, 2: fade out start, 3: fade out stop U8 cmd; } GD_DSP_CMD_VID_FADE_IN_OUT_S; typedef struct { // cmd_code: 0x00004008 GD_MJPEG_ENCODE_WITH_H264 U32 cmd_code; U32 enable; } GD_DSP_CMD_MJPEG_CAPTURE_WITH_264_S; typedef struct { // cmd_code: 0x00004009 GD_OSD_INSERT U32 cmd_code; U32 enable; U32 y_osd_addr_h264; U32 uv_osd_addr_h264;// 420 U16 osd_width_h264; U16 osd_pitch_h264; U16 osd_height_h264; U16 osd_vertical_position_h264; U32 y_osd_addr_mjpeg; U32 uv_osd_addr_mjpeg;//422 U16 osd_width_mjpeg; U16 osd_pitch_mjpeg; U16 osd_height_mjpeg; U16 osd_vertical_position_mjpeg; } GD_DSP_CMD_OSD_INSERT_S; typedef struct { // cmd_code: 0x00004010 GD_YUV422_CAPTURE U32 cmd_code; U32 num2Capture; } GD_DSP_CMD_YUV422_CAPTURE_S; typedef struct { // cmd_code: 0x00004011 GD_SEND_CAVLC_RESULT U32 cmd_code; U32 num_of_cavlc_results: 8; U32 pjpg_rd_size : 24; U32 cavlcBits_A[6]; U32 cavlcBits_B[6]; U32 cavlcBits_C[6]; U32 cavlcBits_D[6]; U32 totCavlcBits[6]; } GD_DSP_CMD_CAVLC_RESULT_S; typedef struct { // cmd_code: 0x00004012 GD_STILL_CAPTURE_IN_REC U32 cmd_code; U16 main_jpg_w; U16 main_jpg_h; U16 encode_w; U16 encode_h; U16 encode_x; U16 encode_y; U16 blank_period_duration; // absolute duration, time unit: 1/60000 second. U8 is_use_compaction; // if compaction is needed U8 is_thumbnail_ena; } GD_DSP_CMD_STILL_CAP_IN_REC_S; typedef struct { // cmd_code: 0x00004013 GD_OSD_BLEND U32 cmd_code; U8 chan_id; U8 stream_id; U8 enable; U8 still_osd; U32 osd_addr_y; U32 osd_addr_uv; U32 alpha_addr_y; // alpha mask must be the same size as osd, (osd_width*osd_height), value 0~0xff U32 alpha_addr_uv; U16 osd_width; U16 osd_pitch; U16 osd_height; U16 osd_start_x; // (start_x, start_y)=(0,0) refers to top-left pixel of main image. U16 osd_start_y; U16 reserved_2; U8 blend_area2_enable; U8 reserved_3; U16 blend_area2_width; U16 blend_area2_pitch; U16 blend_area2_height; U16 blend_area2_start_x; U16 blend_area2_start_y; U32 blend_area2_y_addr; U32 blend_area2_uv_addr; U32 blend_area2_alpha_addr; U8 blend_area3_enable; U8 reserved_4; U16 blend_area3_width; U16 blend_area3_pitch; U16 blend_area3_height; U16 blend_area3_start_x; U16 blend_area3_start_y; U32 blend_area3_y_addr; U32 blend_area3_uv_addr; U32 blend_area3_alpha_addr; } GD_DSP_CMD_OSD_BLEND_S; typedef struct { // cmd_code: 0x00004014 GD_INTERVAL_CAPTURE U32 cmd_code; U32 action; U32 num_of_frame; } GD_DSP_CMD_INTERVAL_CAP_S; typedef struct { // cmd_code: 0x00004015 GD_STILL_CAPTURE_ADV U32 cmd_code; } GD_DSP_CMD_STILL_CAPTURE_ADV_S; /*------------------------------------------------- * H264/JPEG decoding mode * 1. H264 decode (0x00005002) * 2. JPEG decode (0x00005003) * 3. RAW picture decode (0x00005004) * 4. Rescale Postprocessing (0x00005005) * 5. H264 decode bits FIFO update (0x00005006) * 6. H264 playback speed (0x00005007) * 7. H264 trickplay (0x00005008) * 8. Decode stop (0x00005009) * 9. Multi-scene decode (0x00005010) * 10. Capture video picture (0x00005011) -------------------------------------------------*/ typedef struct { // cmd_code: 0x00005002 GD_H264_DECODE U32 cmd_code; U32 bits_fifo_start; U32 bits_fifo_end; U32 num_pics; U32 num_frame_decode; U32 first_frame_display; U32 fade_in_on; U32 fade_out_on; } GD_DSP_CMD_H264_DECODE_S; typedef struct { // cmd_code: 0x00005003 GD_JPEG_DECODE U32 cmd_code; U32 bits_fifo_start; U32 bits_fifo_end; U8 main_rotation; U8 ycbcr_position; U16 reserved; U32 frame_duration; U32 num_frame_decode; U8 already_decoded; U8 sec_rotation; } GD_DSP_CMD_JPEG_DECODE_S; typedef struct { // cmd_code: 0x00005004 GD_RAW_PICTURE_DECODE U32 cmd_code; U32 raw_pic_addr; U16 input_width; U16 input_height; U16 input_pitch; U8 rotation; U8 bayer_pattern; U8 resolution; U8 already_decoded; } GD_DSP_CMD_RAW_PIC_DECODE_S; typedef struct { // cmd_code: 0x00005005 GD_RESCALE_POSTPROCESSING U32 cmd_code; U16 input_center_x; U16 input_center_y; U16 display_win_offset_x; U16 display_win_offset_y; U16 display_win_width; U16 display_win_height; U32 zoom_factor_x; U32 zoom_factor_y; U8 apply_yuv; U8 apply_luma; U8 apply_noise; U8 pip_enable; U16 pip_x_offset; U16 pip_y_offset; U16 pip_x_size; U16 pip_y_size; U16 sec_display_win_offset_x; U16 sec_display_win_offset_y; U16 sec_display_win_width; U16 sec_display_win_height; U32 sec_zoom_factor_x; U32 sec_zoom_factor_y; U32 reserved : 31; U32 animated_rotation : 1; U32 warp_horizontal_table_address; U32 warp_vertical_table_address; U8 grid_array_width; U8 grid_array_height; U8 horz_grid_spacing_exponent; U8 vert_grid_spacing_exponent; U8 vert_warp_grid_array_width; U8 vert_warp_grid_array_height; U8 vert_warp_horz_grid_spacing_exponent; U8 vert_warp_vert_grid_spacing_exponent; } GD_DSP_CMD_RESCALE_POSTPROC_S; typedef struct { // cmd_code: 0x00005006 GD_H264_DECODE_BITS_FIFO_UPDATE U32 cmd_code; U32 bits_fifo_start; U32 bits_fifo_end; U32 num_pics; } GD_DSP_CMD_H264_DECODE_BITS_FIFO_UPDATE_S; typedef struct { // cmd_code: 0x00005007 GD_H264_PLAYBACK_SPEED U32 cmd_code; U16 speed; U8 scan_mode; U8 direction; } GD_DSP_CMD_H264_PLAYBACK_SPEED_S; typedef struct { // cmd_code: 0x00005008 GD_H264_TRICKPLAY U32 cmd_code; U8 mode; } GD_DSP_CMD_H264_TRICKPLAY_S; typedef struct { // cmd_code: 0x00005009 GD_DECODE_STOP U32 cmd_code; U8 stop_flag; } GD_DSP_CMD_H264_DECODE_STOP_S; typedef struct { S16 offset_x; //for TV S16 offset_y; U16 width; U16 height; S16 sec_offset_x; //for LCD S16 sec_offset_y; U16 sec_width; U16 sec_height; U32 source_base; U32 source_size : 24; U32 source_type : 4; U32 rotation : 4; // for main rotation U32 thumbnail_id : 8; U32 decode_only : 4; U32 sec_rotation : 4; // for LCD rotation U32 reserved : 16; } GD_DSP_CMD_SCENE_STRUCTURE_S; typedef struct { // cmd_code: 0x00005010 GD_MULTI_SCENE_DECODE U32 cmd_code; U32 total_scenes : 8; U32 start_scene_num : 8; U32 scene_num : 8; U32 end : 4; U32 fast_mode : 4; GD_DSP_CMD_SCENE_STRUCTURE_S scene[4]; } GD_DSP_CMD_MULTI_SCENE_DECODE_S; typedef struct { U32 cmd_code; // cmd_code: 0x00005011 GD_CAPTURE_VIDEO_PICTURE U32 coded_pic_base; U32 coded_pic_limit; U32 thumbnail_pic_base; U32 thumbnail_pic_limit; U16 thumbnail_width; U16 thumbnail_height; U16 thumbnail_letterbox_strip_width; U16 thumbnail_letterbox_strip_height; U8 thumbnail_letterbox_strip_y; U8 thumbnail_letterbox_strip_cb; U8 thumbnail_letterbox_strip_cr; U8 reserved0; U32 quant_matrix_addr; U16 target_pic_width; U16 target_pic_height; U32 pic_structure : 8; U32 reserved1 : 24; U32 screennail_pic_base; U32 screennail_pic_limit; U16 screennail_width; U16 screennail_height; U16 screennail_letterbox_strip_width; U16 screennail_letterbox_strip_height; U8 screennail_letterbox_strip_y; U8 screennail_letterbox_strip_cb; U8 screennail_letterbox_strip_cr; U8 reserved2; } GD_DSP_CMD_CAPTURE_VIDEO_PIC_S; typedef struct { // cmd_code: 0x00005012 GD_CAPTURE_STILL_PICTURE U32 cmd_code; U32 coded_pic_base; /*DRAM address to hold JPEG to encode */ U32 coded_pic_limit; U32 thumbnail_pic_base; /*DRAM address to store JPEG in thumbnail form */ U32 thumbnail_pic_limit; U16 thumbnail_width; U16 thumbnail_height; U16 thumbnail_letterbox_strip_width; /*will change order when it's finalized */ U16 thumbnail_letterbox_strip_height; U8 thumbnail_letterbox_strip_y; /*Y value for painting letterbox */ U8 thumbnail_letterbox_strip_cb; /*Cb value for painting letterbox */ U8 thumbnail_letterbox_strip_cr; /*Cr value for painting letterbox */ U8 capture_multi_scene; /* capture the multi scene picture */ U32 quant_matrix_addr; /*DRAM address to hold quant matrix, refer to capture_video_pic_s*/ U32 screennail_pic_base; /*DRAM address to store JPEG in screennail form */ U32 screennail_pic_limit; U16 screennail_width; U16 screennail_height; U16 screennail_letterbox_strip_width; /*will change order when it's finalized */ U16 screennail_letterbox_strip_height; U8 screennail_letterbox_strip_y; /*Y value for painting letterbox */ U8 screennail_letterbox_strip_cb; /*Cb value for painting letterbox */ U8 screennail_letterbox_strip_cr; /*Cr value for painting letterbox */ U8 reserved0; U16 input_offset_x; /* offset x to crop the input picture */ U16 input_offset_y; /* offset y to crop the input picture */ U16 input_width; /* default=0: capture original size */ U16 input_height; /* default=0 */ U16 target_pic_width; /* regular capture width */ U16 target_pic_height; /* regular capture height */ } GD_DSP_CMD_CAPTURE_STILL_PIC_S; typedef struct { // cmd_code: 0x00005013 GD_JPEG_FREEZE U32 cmd_code; U8 freeze_state; U8 reserved[3]; } GD_DSP_CMD_JPEG_FREEZE_S; typedef struct { // cmd_code: 0x00005014 GD_MULTI_SCENE_SETUP U32 cmd_code; U8 if_save_thumbnail; /* indicate if we need to allocate a regular thumbnail buffer*/ U8 total_thumbnail; U16 saving_thumbnail_width; U16 saving_thumbnail_height; U8 if_save_large_thumbnail; /* indicate if we need to allocate a large size thumbnail buffer*/ U8 total_large_thumbnail; U16 saving_large_thumbnail_width; U16 saving_large_thumbnail_height; U8 if_capture_large_size_thumbnail; /* indicate if we need to capture a large size multi scene picture */ U8 reserved; U16 large_thumbnail_pic_width; /* picture width of large size multi-scene */ U16 large_thumbnail_pic_height; /* picture height of large size multi-scene */ U8 visual_effect_type; /* special effect type */ U8 reserved1; U16 extra_total_thumbnail; /*number of thumnails if total > 1000 */ } GD_DSP_CMD_MULTI_SCENE_SETUP_S; typedef struct { S16 input_offset_x; //for input cropping S16 input_offset_y; U16 input_width; U16 input_height; S16 main_output_offset_x; //for TV S16 main_output_offset_y; U16 main_output_width; U16 main_output_height; S16 sec_output_offset_x; //for LCD S16 sec_output_offset_y; U16 sec_output_width; U16 sec_output_height; U32 source_base; U32 source_size : 24; U32 source_type : 4; U32 rotation : 4; U32 thumbnail_id : 8; U32 decode_only : 4; U32 luma_gain : 8; // for luma scaling U32 thumbnail_type : 2; // indicate different thumbnail size, 0: small size thumbnail 1: large size thumbnail. U32 reserved : 10; } GD_DSP_CMD_SCENE_STRUCTURE_ADV_S; typedef struct { // cmd_code: 0x00005015 GD_MULTI_SCENE_DECODE_ADV U32 cmd_code; U32 total_scenes : 8; U32 start_scene_num : 8; U32 scene_num : 8; U32 end : 4; U32 buffer_source_only : 2; // indicate if the scene source is TYPE3=YUV_PIC only U32 fast_mode : 2; GD_DSP_CMD_SCENE_STRUCTURE_ADV_S scene[3]; } GD_DSP_CMD_MULTI_SCENE_DECODE_ADV_S; typedef struct { // cmd_code: 0x00005016 GD_JPEG_DECODE_THUMBNAIL_WARP U32 cmd_code; // src and dst thumbnail id U8 src_thm_id; U8 dst_thm_id; U16 origin_height; U16 mirror_height; U16 reserved; // if draw border on src thumbnail buffer U8 if_draw_border; U8 border_y; U8 border_u; U8 border_v; // mirror U8 if_mirror_effect; U8 mirror_luma_gain; //warp related field U8 horz_warp_control; U8 vert_warp_control; U32 warp_horizontal_table_address; U32 warp_vertical_table_address; U8 grid_array_width; U8 grid_array_height; U8 horz_grid_spacing_exponent; U8 vert_grid_spacing_exponent; U8 vert_warp_grid_array_width; U8 vert_warp_grid_array_height; U8 vert_warp_horz_grid_spacing_exponent; U8 vert_warp_vert_grid_spacing_exponent; } GD_DSP_CMD_JPEG_DECODE_THUMBNAIL_WARP_S; typedef struct { S16 input_offset_x; //for input cropping S16 input_offset_y; U16 input_width; U16 input_height; S16 main_output_offset_x; //for TV S16 main_output_offset_y; U16 main_output_width; U16 main_output_height; S16 sec_output_offset_x; //for LCD S16 sec_output_offset_y; U16 sec_output_width; U16 sec_output_height; U32 source_base; U32 source_size : 24; U32 source_type : 4; U32 main_rotation : 4; U32 sec_rotation : 4; U32 thumbnail_id : 11; // to support 2048 thumbnails U32 decode_only : 1; U32 luma_gain : 8; // for luma scaling U32 thumbnail_type : 2; // indicate different thumbnail size, 0: small size thumbnail 1: large size thumbnail. U32 reserved : 6; } GD_DSP_CMD_SCENE_STRUCTURE_ADV_2_S; typedef struct { // cmd_code: 0x00005017 GD_MULTI_SCENE_DECODE_ADV_2 U32 cmd_code; U32 total_scenes : 8; U32 start_scene_num : 8; U32 scene_num : 8; U32 end : 1; U32 update_lcd_only : 1; //indicate if we only update lcd U32 buffer_source_only : 1; // indicate if the scene source is TYPE3=YUV_PIC only U32 fast_mode : 1; U32 reserved : 4; GD_DSP_CMD_SCENE_STRUCTURE_ADV_2_S scene[3]; } GD_DSP_CMD_MULTI_SCENE_DECODE_ADV_2_S; /*------------------------------------------------- -------------------------------------------------*/ typedef struct { // cmd_code: 0x00006001 GD_IPCAM_VIDEO_PREPROCESSING U32 cmd_code; U32 input_format: 8; U32 sensor_id : 8; U32 keep_states : 8; U32 reserved1 : 8; U32 vin_frame_rate; U16 vidcap_w; U16 vidcap_h; U32 input_center_x; U32 input_center_y; U32 zoom_factor_x; U32 zoom_factor_y; U32 aaa_data_fifo_start; U32 sensor_readout_mode; U8 noise_filter_strength; U8 image_stabilize_strength; U8 bit_resolution; U8 bayer_pattern; U8 preview_format_A : 4; U8 preview_format_B : 3; U8 no_pipelineflush : 1; U8 preview_frame_rate_A; U8 preview_frame_rate_B; U8 preview_A_en : 4; // 0: dram, 1: smem U8 preview_B_en : 4; // 0: dram, 1: smem U16 horizontal_channel_number; // number of channels (streams) displayed on horizontal direction in preview window. U16 vertical_channel_number; //number of channels (streams) displayed on vertical direction in preview window. U32 vdsp_int_factor : 8; U32 main_out_frame_type : 1; U32 reserved2 : 23; } GD_DSP_CMD_IPCAM_VIDEO_PREPROC_S; typedef struct { // cmd_code: 0x00006002 GD_IPCAM_VIDEO_CAPTURE_PREVIEW_SIZE_SETUP U32 cmd_code; U32 capture_source : 2; U32 output_scan_format : 1; U32 deinterlace_mode : 2; U32 disabled : 1; U32 Reserved1 : 26; U16 cap_width; U16 cap_height; U16 input_win_offset_x; U16 input_win_offset_y; U16 input_win_width; U16 input_win_height; } GD_DSP_CMD_IPCAM_CAPTURE_PREVIEW_SIZE_SETUP_S; typedef struct { // cmd_code: 0x00006003 GD_IPCAM_VIDEO_ENCODE_SIZE_SETUP U32 cmd_code; U32 capture_source : 2; U32 Reserved1 : 30; U16 enc_x; U16 enc_y; U16 enc_width; U16 enc_height; } GD_DSP_CMD_IPCAM_VIDEO_ENCODE_SIZE_SETUP_S; typedef struct { // cmd_code: 0x00006004 GD_IPCAM_REAL_TIME_ENCODE_PARAM_SETUP U32 cmd_code; U32 enable_flags; U32 cbr_modify; U32 custom_encoder_frame_rate; U8 frame_rate_division_factor; U8 qp_min_on_I; U8 qp_max_on_I; U8 qp_min_on_P; U8 qp_max_on_P; U8 qp_min_on_B; U8 qp_max_on_B; U8 aqp; U8 frame_rate_multiplication_factor; U8 i_qp_reduce; U8 skip_flags; U8 M; U8 N; U8 p_qp_reduce; U8 intra_refresh_num_mb_row; U8 preview_A_frame_rate_divison_factor; U32 idr_interval; U32 custom_vin_frame_rate; U32 roi_daddr; S8 roi_delta[GD_NUM_PIC_TYPES][4]; /* 3 num pic types and 4 categories */ U32 panic_div : 8; U32 is_monochrome : 1; U32 scene_change_detect_on : 1; U32 reserved : 22; U32 pic_size_control; U32 quant_matrix_addr; U16 P_IntraBiasAdd; U16 B_IntraBiasAdd; //tune the AQP and mode bias S8 intra16x16_bias; // -64~64, clamp the negative value to -64 to avoid underflow S8 intra4x4_bias; // -64~64, clamp the negative value to -64 to avoid underflow S8 inter16x16_bias; // -64~64, clamp the negative value to -64 to avoid underflow S8 inter8x8_bias; // -64~64, clamp the negative value to -64 to avoid underflow S8 direct16x16_bias; // -64~64, clamp the negative value to -64 to avoid underflow S8 direct8x8_bias; // -64~64, clamp the negative value to -64 to avoid underflow S8 me_lambda_qp_offset; U8 reserved1; //S8 aqp_strength; // 0: Automatic = existing code, 1-81: fixed strength; 1 for no AQP; -1 for inverse AQP //tune the deblocking parameters S8 alpha; // between -6 and 6 S8 beta; // between -6 and 6 U16 reserved2; } GD_DSP_CMD_IPCAM_REAL_TIME_ENCODE_PARAM_SETUP_S; typedef struct { // cmd_code: 0x00006005 GD_IPCAM_VIDEO_FORCED_IDR U32 cmd_code; U8 force_idr; U8 reserved[3]; } GD_DSP_CMD_FORCE_IDR_S; typedef struct { // cmd_code: 0x00006006 GD_IPCAM_VIDEO_SYSTEM_SETUP U32 cmd_code; U16 main_max_width; U16 main_max_height; U16 preview_A_max_width; U16 preview_A_max_height; U16 preview_B_max_width; U16 preview_B_max_height; U16 preview_C_max_width; U16 preview_C_max_height; U8 stream_0_max_GOP_M; U8 stream_1_max_GOP_M; U8 stream_2_max_GOP_M; U8 stream_3_max_GOP_M; U8 stream_0_max_GOP_N; U8 stream_1_max_GOP_N; U8 stream_2_max_GOP_N; U8 stream_3_max_GOP_N; U8 stream_0_max_advanced_quality_model; U8 stream_1_max_advanced_quality_model; U8 stream_2_max_advanced_quality_model; U8 stream_3_max_advanced_quality_model; U16 stream_0_max_width; U16 stream_0_max_height; U16 stream_1_max_width; U16 stream_1_max_height; U16 stream_2_max_width; U16 stream_2_max_height; U16 stream_3_max_width; U16 stream_3_max_height; U32 MCTF_possible : 1; U32 max_num_streams : 3; U32 max_num_cap_sources : 2; U32 use_1Gb_DRAM_config : 1; U32 reserved1 : 25; U16 raw_max_width; U16 raw_max_height; } GD_DSP_CMD_IPCAM_VIDEO_SYSTEM_SETUP_S; typedef struct { // cmd_code: 0x00006007 GD_IPCAM_OSD_INSERT U32 cmd_code; U32 vout_id : 1; U32 osd_enable : 1; U32 osd_num_regions : 2; U32 reserved1 : 28; U32 osd_clut_dram_address[3]; U32 osd_buf_dram_address[3]; U16 osd_buf_pitch[3]; U16 osd_win_offset_x[3]; U16 osd_win_offset_y[3]; U16 osd_win_w[3]; U16 osd_win_h[3]; U16 reserved2; } GD_DSP_CMD_IPCAM_OSD_INSERT_S; typedef struct { // cmd_code: 0x00006008 GD_IPCAM_SET_PRIVACY_MASK U32 cmd_code; U32 enabled_flags_dram_address ; // use privacy mask to label a region to let MCTF to pass through it U8 Y; U8 U; U8 V; } GD_DSP_CMD_IPCAM_SET_PRIVACY_MASK_S; typedef struct { // cmd_code: 0x00006009 GD_IPCAM_QP_RATIO U32 cmd_code; U8 iframe_numerator; U8 iframe_denominator; U8 bframe_numerator; U8 bframe_denominator; U8 pframe_numerator; U8 pframe_denominator; U16 reserved; } GD_DSP_CMD_IPCAM_QP_RATIO_S; /*------------------------------------------------- -------------------------------------------------*/ typedef struct { // cmd_code: 0x00007001 GD_VOUT_MIXER_SETUP U32 cmd_code; U16 vout_id; U8 interlaced; U8 frm_rate; U16 act_win_width; U16 act_win_height; U8 back_ground_v; U8 back_ground_u; U8 back_ground_y; U8 reserved; U8 highlight_v; U8 highlight_u; U8 highlight_y; U8 highlight_thresh; } GD_DSP_CMD_VOUT_MIXER_SETUP_S; typedef struct { // cmd_code: 0x00007002 GD_VOUT_VIDEO_SETUP U32 cmd_code; U16 vout_id; U8 en; U8 src; U8 flip; U8 rotate; U8 data_src; U8 reserved; U16 win_offset_x; U16 win_offset_y; U16 win_width; U16 win_height; U32 default_img_y_addr; U32 default_img_uv_addr; U16 default_img_pitch; U8 default_img_repeat_field; U8 reserved2; } GD_DSP_CMD_VOUT_VIDEO_SETUP_S; typedef struct { // cmd_code: 0x00007003 GD_VOUT_DEFAULT_IMG_SETUP U32 cmd_code; U16 vout_id; U16 reserved; U32 default_img_y_addr; U32 default_img_uv_addr; U16 default_img_pitch; U8 default_img_repeat_field; U8 reserved2; } GD_DSP_CMD_VOUT_DEFAULT_IMG_SETUP_S; typedef struct { // cmd_code: 0x00007004 GD_VOUT_OSD_SETUP U32 cmd_code; U16 vout_id; U8 en; U8 src; U8 flip; U8 rescaler_en; U8 premultiplied; U8 global_blend; U16 win_offset_x; U16 win_offset_y; U16 win_width; U16 win_height; U16 rescaler_input_width; U16 rescaler_input_height; U32 osd_buf_dram_addr; U16 osd_buf_pitch; U8 osd_buf_repeat_field; U8 osd_direct_mode; U16 osd_transparent_color; U8 osd_transparent_color_en; U8 reserved; U32 osd_buf_info_dram_addr;//24 } GD_DSP_CMD_VOUT_OSD_SETUP_S; typedef struct { // cmd_code: 0x00007005 GD_VOUT_OSD_BUFFER_SETUP U32 cmd_code; U16 vout_id; U16 reserved; U32 osd_buf_dram_addr; U16 osd_buf_pitch; U8 osd_buf_repeat_field; U8 reserved2; } GD_DSP_CMD_VOUT_OSD_BUF_SETUP_S; typedef struct { // cmd_code: 0x00007006 GD_VOUT_OSD_CLUT_SETUP U32 cmd_code; U16 vout_id; U16 reserved; U32 clut_dram_addr; } GD_DSP_CMD_VOUT_OSD_CLUT_SETUP_S; typedef struct { // cmd_code: 0x00007007 GD_VOUT_DISPLAY_SETUP U32 cmd_code; U16 vout_id; U16 reserved; U32 disp_config_dram_addr; } GD_DSP_CMD_VOUT_DISPLAY_SETUP_S; typedef struct { // cmd_code: 0x00007008 GD_VOUT_DVE_SETUP U32 cmd_code; U16 vout_id; U16 reserved; U32 dve_config_dram_addr; } GD_DSP_CMD_VOUT_DVE_SETUP_S; typedef struct { // cmd_code: 0x00007009 GD_VOUT_RESET U32 cmd_code; U16 vout_id; U8 reset_mixer; U8 reset_disp; } GD_DSP_CMD_VOUT_RESET_S; typedef struct { // cmd_code: 0x0000700A GD_VOUT_DISPLAY_CSC_SETUP U32 cmd_code; U16 vout_id; U16 csc_type; // 0: digital; 1: analog; 2: hdmi U32 csc_parms[9]; } GD_DSP_CMD_VOUT_DISPLAY_CSC_SETUP_S; typedef struct { // cmd_code: 0x0000700B GD_VOUT_DIGITAL_OUTPUT_MODE_SETUP U32 cmd_code; U16 vout_id; U16 reserved; U32 output_mode; } GD_DSP_CMD_VOUT_DIGITAL_OUTPUT_MODE_SETUP_S; /*------------------------------------------------- experimental commands -------------------------------------------------*/ typedef struct { // cmd_code: 0x0000f001 GD_CFA_NOISE_FILTER U32 cmd_code; U32 enable; U32 center_weight_red; U32 center_weight_green; U32 center_weight_blue; U32 thresh_red; U32 thresh_green; U32 thresh_blue; } GD_DSP_CMD_CFA_NOISE_FILTER_S; typedef struct { // cmd_code: 0x0000f002 GD_DIGITAL_GAIN_SATURATION U32 cmd_code; U32 level; } GD_DSP_CMD_DIGITAL_GAIN_SATURATION_S; typedef struct { // cmd_code: 0x0000f003 GD_CHROMA_MEDIAN_FILTER U32 cmd_code; U32 enable; } GD_DSP_CMD_CHROMA_MEDIAN_FILTER_S; typedef struct { // cmd_code: 0x0000f004 GD_LUMA_DIRECTIONAL_FILTER U32 cmd_code; U32 strength; } GD_DSP_CMD_LUMA_DIRECTIONAL_FILTER_S; typedef struct { // cmd_code: 0x0000f005 GD_LUMA_SHARPEN U32 cmd_code; U32 enable; U32 lp_coef[6]; U32 alpha_max_pos; U32 alpha_max_neg; U32 thresh_gradient; } GD_DSP_CMD_LUMA_SHARPEN_S; typedef struct { // cmd_code: 0x0000f006 GD_MAIN_RESAMPLER_BANDWIDTH U32 cmd_code; U8 strength_luma; U8 strength_chroma; } GD_DSP_CMD_MAIN_RESAMPLER_S; typedef struct { // cmd_code: 0x0000f007 GD_CFA_RESAMPLER_BANDWIDTH U32 cmd_code; U8 strength; } GD_DSP_CMD_CFA_RESAMPLER_BANDWIDTH_S; typedef struct { // cmd_code: 0x0000ff00 GD_DSP_DEBUG_0 // cmd_code: 0x0000ff01 GD_DSP_DEBUG_1 U32 cmd_code; U32 dram_addr; } GD_DSP_CMD_DSP_DEBUG_S; typedef struct { // cmd_code: 0x0000ff02 GD_AAA_STATISTICS_DEBUG U32 cmd_code; U32 on : 8; U32 reserved: 24; U32 data_fifo_base; U32 data_fifo_limit; U16 ae_awb_tile_num_col; U16 ae_awb_tile_num_row; U16 ae_awb_tile_col_start; U16 ae_awb_tile_row_start; U16 ae_awb_tile_width; U16 ae_awb_tile_height; U32 ae_awb_pix_min_value; U32 ae_awb_pix_max_value; U16 ae_awb_tile_rgb_shift; U16 ae_awb_tile_y_shift; U16 ae_awb_tile_min_max_shift; U16 af_tile_num_col; U16 af_tile_num_row; U16 af_tile_col_start; U16 af_tile_row_start; U16 af_tile_width; U16 af_tile_height; U16 af_tile_active_width; U16 af_tile_active_height; U16 af_tile_focus_value_shift; U16 af_tile_y_shift; U8 af_horizontal_filter1_mode; U8 af_horizontal_filter1_stage1_enb; U8 af_horizontal_filter1_stage2_enb; U8 af_horizontal_filter1_stage3_enb; U16 af_horizontal_filter1_gain[7]; U16 af_horizontal_filter1_shift[4]; U16 af_horizontal_filter1_bias_off; U16 af_vertical_filter1_thresh; U8 af_horizontal_filter2_mode; U8 af_horizontal_filter2_stage1_enb; U8 af_horizontal_filter2_stage2_enb; U8 af_horizontal_filter2_stage3_enb; U16 af_horizontal_filter2_gain[7]; U16 af_horizontal_filter2_shift[4]; U16 af_horizontal_filter2_bias_off; U16 af_vertical_filter2_thresh; U16 af_tile_fv1_horizontal_shift; U16 af_tile_fv1_vertical_shift; U16 af_tile_fv1_horizontal_weight; U16 af_tile_fv1_vertical_weight; U16 af_tile_fv2_horizontal_shift; U16 af_tile_fv2_vertical_shift; U16 af_tile_fv2_horizontal_weight; U16 af_tile_fv2_vertical_weight; } GD_DSP_CMD_AAA_STATISTICS_DEBUG_S; typedef struct { // cmd_code: 0x0000ff03 GD_DSP_SPECIAL U32 cmd_code; U32 p0; U32 p1; U32 p2; } GD_DSP_CMD_DSP_SPECIAL_S; typedef struct { // cmd_code: 0x0000ff04 GD_AAA_STATISTICS_DEBUG1 // cmd_code: 0x0000ff05 GD_AAA_STATISTICS_DEBUG2 U32 cmd_code; U32 on : 8; U32 reserved: 24; U32 data_fifo_base; U32 data_fifo_limit; U16 ae_awb_tile_num_col; U16 ae_awb_tile_num_row; U16 ae_awb_tile_col_start; U16 ae_awb_tile_row_start; U16 ae_awb_tile_width; U16 ae_awb_tile_height; U32 ae_awb_pix_min_value; U32 ae_awb_pix_max_value; U16 ae_awb_tile_rgb_shift; U16 ae_awb_tile_y_shift; U16 ae_awb_tile_min_max_shift; U16 af_tile_num_col; U16 af_tile_num_row; U16 af_tile_col_start; U16 af_tile_row_start; U16 af_tile_width; U16 af_tile_height; U16 af_tile_active_width; U16 af_tile_active_height; U16 af_tile_focus_value_shift; U16 af_tile_y_shift; U8 af_horizontal_filter_mode; U8 af_horizontal_filter_stage1_enb; U8 af_horizontal_filter_stage2_enb; U8 af_horizontal_filter_stage3_enb; U16 af_horizontal_filter_gain[7]; U16 af_horizontal_filter_shift[4]; U16 af_horizontal_filter_bias_off; U16 af_vertical_filter1_thresh; U16 af_tile_fv_horizontal_shift; U16 af_tile_fv_vertical_shift; U16 af_tile_fv_horizontal_weight; U16 af_tile_fv_vertical_weight; } GD_DSP_CMD_AAA_STATISTICS_DEBUG12_S; typedef struct { // cmd_code: 0x0000ff06 GD_BAD_PIXEL_CROP U32 cmd_code; U8 enable; U16 offset_horiz; U16 offset_vert; } GD_DSP_CMD_BAD_PIXEL_CROP_S; typedef struct { // cmd_code: 0x0000ff07 GD_DSP_DEBUG_2 U32 cmd_code; U32 dram_addr; U32 dram_size; U32 mode; } GD_DSP_CMD_DSP_DEBUG_2_S; typedef struct { // cmd_code: 0x0000ff08 GD_DSP_DEBUG_3 U32 cmd_code; U32 mode; U32 param1; U32 param2; U32 param3; U32 param4; U32 param5; U32 param6; U32 param7; U32 param8; } GD_DSP_CMD_DSP_DEBUG_3_S; typedef struct { // cmd_code: 0x0000ff09 GD_UPDATE_IDSP_CONFIG U32 cmd_code; U16 section_id; U8 mode; U8 table_sel; U32 dram_addr; U32 data_size; } GD_DSP_CMD_UPDATE_IDSP_CONFIG_S; typedef struct { // cmd_code: 0x0000ff0a GD_REAL_TIME_RATE_MODIFY U32 cmd_code; U32 real_time_rate_modify; U32 chan_id; } GD_DSP_CMD_REAL_TIME_RATE_MODIFY_S; typedef struct { U32 cmd_code; //??? U32 real_time_cbr_modify; U32 chan_id; } GD_DSP_CMD_REAL_TIME_CBR_MODIFY_S; typedef union { U32 cmddata[32]; GD_DSP_CMD_INTERRUPT_SETUP_S interrupt_setup; GD_DSP_CMD_H264_ENCODE_SETUP_S h264_encode_setup; GD_DSP_CMD_JPEG_ENCODE_SETUP_S jpeg_encode_setup; GD_DSP_CMD_H264_DECODE_SETUP_S h264_decode_setup; GD_DSP_CMD_JPEG_DECODE_SETUP_S jpeg_decode_setup; GD_DSP_CMD_RESET_OPERATION_S reset_operation; GD_DSP_CMD_VIDEO_OUTPUT_RESTART_S video_output_restart; GD_DSP_CMD_VIN_TIMER_MODE_S vin_timer_mode; GD_DSP_CMD_CHIP_SELECT_S chip_select; GD_DSP_CMD_HD_ECHO_SETUP_S hd_echo_setup; GD_DSP_CMD_SYSTEM_SETUP_INFO_S system_setup_info; GD_DSP_CMD_EIS_SWITCHVOUT_DURING_ENCOD_S eis_switchvout_during_encod; GD_DSP_CMD_DSP_DEBUG_LEVEL_SETUP_S dsp_debug_level_setup; GD_DSP_CMD_SYSTEM_PARAMETERS_SETUP_S system_parameters_setup; GD_DSP_CMD_SYSTEM_IDSP_FREQ_SETUP_S system_idsp_freq_setup; GD_DSP_CMD_SENSOR_INPUT_SETUP_S sensor_input_setup; GD_DSP_CMD_RGB_GAIN_ADJUST_S rgb_gain_adjust; GD_DSP_CMD_VIGNETTE_COMPENSATION_S vignette_compensation; GD_DSP_CMD_AAA_STATISTICS_SETUP_S aaa_statistics_setup; GD_DSP_CMD_LUMA_SHARPEN_SETUP_S luma_sharpen_setup; GD_DSP_CMD_RGB_TO_RGB_STUP_S rgb_to_rgb_stup; GD_DSP_CMD_RGB_TO_YUV_STUP_S rgb_to_yuv_stup; GD_DSP_CMD_GAMMA_CURVE_SETUP_S gamma_curve_setup; GD_DSP_CMD_NOISE_FILTER_SETUP_S noise_filter_setup; GD_DSP_CMD_BAD_PIXEL_CORRECT_SETUP_S bad_pixel_correct_setup; GD_DSP_CMD_VID_FADE_IN_OUT_SETUP_S vid_fade_in_out_setup; GD_DSP_CMD_CFA_DOMAIN_LEAKAGE_FILTER_S cfa_domain_leakage_filter; GD_DSP_CMD_MCTF_MV_STAB_SETUP_S mctf_mv_stab_setup; GD_DSP_CMD_SET_SLOW_SHUTTER_UPSAMPLING_RATE_S set_slow_shutter_upsampling_rate; GD_DSP_CMD_SENSOR_CAP_REPEAT_S sensor_cap_repeat; GD_DSP_CMD_MCTF_GMV_SETUP_S mctf_gmv_setup; GD_DSP_CMD_DIS_ALGO_PARAMS_S dis_algo_params; GD_DSP_CMD_VIN_CAP_WIN_S vin_cap_win; GD_DSP_CMD_AMPLIFIER_LINEAR_S amplifier_linear; GD_DSP_CMD_PIXEL_SHUFFLE_S pixel_shuffle; GD_DSP_CMD_BLACK_LEVEL_CORRECTTION_S black_level_correcttion; GD_DSP_CMD_BLACK_LEVEL_STATE_TABLE_S black_level_state_table; GD_DSP_CMD_BLACK_LEVEL_DETECT_WIN_S black_level_detect_win; GD_DSP_CMD_FIXED_PATTERN_NOISE_CORRECT_S fixed_pattern_noise_correct; GD_DSP_CMD_CFA_NOISE_FILTER_INFO_S cfa_noise_filter_info; GD_DSP_CMD_DIGITAL_GAIN_LEVEL_S digital_gain_level; GD_DSP_CMD_LOCAL_EXPOSURE_S local_exposure; GD_DSP_CMD_DEMOASIC_FILTER_S demoasic_filter; GD_DSP_CMD_RGB_NOISE_FILTER_S rgb_noise_filter; GD_DSP_CMD_COLOR_CORRECTION_S color_correction; GD_DSP_CMD_CHROMA_MEDIAN_FILTER_INFO_S chroma_median_filter_info; GD_DSP_CMD_CHROMA_SCALE_S chroma_scale; GD_DSP_CMD_LUMA_SHARPENING_S luma_sharpening; GD_DSP_CMD_AAA_STATISTICS_SETUP12_S aaat_satistics_setup12; GD_DSP_CMD_AAA_PSEUDO_Y_S aaa_pseudo_y; GD_DSP_CMD_AAA_HISTOGRAM_S aaa_histogram; GD_DSP_CMD_RAW_COMPRESSION_S raw_compression; GD_DSP_CMD_RAW_DECOMPRESSION_S raw_decompression; GD_DSP_CMD_ROLLING_SHUTTER_COMPENSATION_S rolling_shutter_compensation; GD_DSP_CMD_ZOOM_FACTOR_S zoom_factor; GD_DSP_CMD_AAA_STATISTICS_SETUP3_S aaa_statistics_setup3; GD_DSP_CMD_VIDEO_PREVIEW_S video_preview; GD_DSP_CMD_ANTI_ALIASING_FILTER_S anti_aliasing_filter; GD_DSP_CMD_FPN_CALIBRATION_S fpn_calibration; GD_DSP_CMD_BLACK_LEVEL_GLOBAL_OFFSET_S black_level_global_offset; GD_DSP_CMD_RGB_DIRECTIONAL_FILTER_S rgb_directional_filter; GD_DSP_CMD_HDR_MIXER_S hdr_mixer; GD_DSP_CMD_LUMA_SHARPENING_LINEARIZATION_S luma_sharpening_linearization; GD_DSP_CMD_LUMA_SHARPENING_FIR_CONFIG_S luma_sharpening_fir_config; GD_DSP_CMD_LUMA_SHARPENING_LNL_S luma_sharpening_lnl; GD_DSP_CMD_LUMA_SHARPENING_TONE_CONTROL_S luma_sharpening_tone_control; GD_DSP_CMD_MULTI_STREAM_PREVIEW_S multi_stream_preview; GD_DSP_CMD_ENA_SECOND_STREAM_S ena_second_stream; GD_DSP_CMD_SET_ALPHA_CHANNEL_S set_alpha_channel; GD_DSP_CMD_MODIFY_FRAME_BUFFER_S modify_frame_buffer; GD_DSP_CMD_SET_ATIVE_WIN_CTR_OFS_S set_ative_win_ctr_ofs; GD_DSP_CMD_SET_WARP_CONTROL_S set_warp_control; GD_DSP_CMD_EARLY_WB_GAIN_S early_wb_gain; GD_DSP_CMD_LUMA_SHARPENING_EDGE_CONTROL_S luma_sharpening_edge_control; GD_DSP_CMD_LUMA_SHARPENING_BLEND_CONTROL_S luma_sharpening_blend_control; GD_DSP_CMD_LUMA_SHARPENING_LEVEL_CONTROL_S luma_sharpening_level_control; GD_DSP_CMD_LUMA_SHARPENING_MISC_CONTROL_S luma_sharpening_misc_control; GD_DSP_CMD_AAA_EARLY_WB_GAIN_S aaa_early_wb_gain; GD_DSP_CMD_VIDEO_PREPROC_S video_preproc; GD_DSP_CMD_FAST_AAA_CAPTURE_S fast_aaa_capture; GD_DSP_CMD_H264_ENCODE_S h264_encode; GD_DSP_CMD_H264_ENCODE_FROM_MEMORY_PARAM_S h264_encode_from_memory_param; GD_DSP_CMD_H264_ENCODE_BITS_FIFO_UPDATE_S h264_encode_bits_fifo_update; GD_DSP_CMD_H264_ENCODE_STOP_S h264_encode_stop; GD_DSP_CMD_PROC_DELAY_S proc_delay; GD_DSP_CMD_STILL_CAPTURE_S still_capture; GD_DSP_CMD_STILL_PROC_FROM_MEMORY_S still_proc_from_memory; GD_DSP_CMD_JPEG_BITS_FIFO_UPDATE_S jpeg_bits_fifo_update; GD_DSP_CMD_FREE_RAW_YUV_PICTURE_BUFFER_S free_raw_yuv_picture_buffer; GD_DSP_CMD_JPEG_STOP_S jpeg_stop; GD_DSP_CMD_MJPEG_CAPTURE_S mjpeg_capture; GD_DSP_CMD_VID_FADE_IN_OUT_S vid_fade_in_out; GD_DSP_CMD_MJPEG_CAPTURE_WITH_264_S mjpeg_capture_with_264; GD_DSP_CMD_OSD_INSERT_S osd_insert; GD_DSP_CMD_YUV422_CAPTURE_S yuv422_capture; GD_DSP_CMD_CAVLC_RESULT_S cavlc_result; GD_DSP_CMD_STILL_CAP_IN_REC_S still_cap_in_rec; GD_DSP_CMD_OSD_BLEND_S osd_blend; GD_DSP_CMD_INTERVAL_CAP_S interval_cap; GD_DSP_CMD_STILL_CAPTURE_ADV_S still_capture_adv; GD_DSP_CMD_H264_DECODE_S h264_decode; GD_DSP_CMD_JPEG_DECODE_S jpeg_decode; GD_DSP_CMD_RAW_PIC_DECODE_S raw_pic_decode; GD_DSP_CMD_RESCALE_POSTPROC_S rescale_postproc; GD_DSP_CMD_H264_DECODE_BITS_FIFO_UPDATE_S h264_decode_bits_fifo_update; GD_DSP_CMD_H264_PLAYBACK_SPEED_S h264_playback_speed; GD_DSP_CMD_H264_TRICKPLAY_S h264_trickplay; GD_DSP_CMD_H264_DECODE_STOP_S h264_decode_stop; GD_DSP_CMD_MULTI_SCENE_DECODE_S multi_scene_decode; GD_DSP_CMD_CAPTURE_VIDEO_PIC_S capture_video_pic; GD_DSP_CMD_CAPTURE_STILL_PIC_S capture_still_pic; GD_DSP_CMD_JPEG_FREEZE_S jpeg_freeze; GD_DSP_CMD_MULTI_SCENE_SETUP_S multi_scene_setup; GD_DSP_CMD_MULTI_SCENE_DECODE_ADV_S multi_scene_decode_adv; GD_DSP_CMD_JPEG_DECODE_THUMBNAIL_WARP_S jpeg_decode_thumbnail_warp; GD_DSP_CMD_MULTI_SCENE_DECODE_ADV_2_S multi_scene_decode_adv_2; GD_DSP_CMD_IPCAM_VIDEO_PREPROC_S ipcam_video_preproc; GD_DSP_CMD_IPCAM_CAPTURE_PREVIEW_SIZE_SETUP_S ipcam_capture_preview_size_setup; GD_DSP_CMD_IPCAM_VIDEO_ENCODE_SIZE_SETUP_S ipcam_video_encode_size_setup; GD_DSP_CMD_IPCAM_REAL_TIME_ENCODE_PARAM_SETUP_S ipcam_real_time_encode_param_setup; GD_DSP_CMD_FORCE_IDR_S force_idr; GD_DSP_CMD_IPCAM_VIDEO_SYSTEM_SETUP_S ipcam_video_system_setup; GD_DSP_CMD_IPCAM_OSD_INSERT_S ipcam_osd_insert; GD_DSP_CMD_IPCAM_SET_PRIVACY_MASK_S ipcam_set_privacy_mask; GD_DSP_CMD_IPCAM_QP_RATIO_S ipcam_qp_ratio; GD_DSP_CMD_VOUT_MIXER_SETUP_S vout_mixer_setup; GD_DSP_CMD_VOUT_VIDEO_SETUP_S vout_video_setup; GD_DSP_CMD_VOUT_DEFAULT_IMG_SETUP_S vout_default_img_setup; GD_DSP_CMD_VOUT_OSD_SETUP_S vout_osd_setup; GD_DSP_CMD_VOUT_OSD_BUF_SETUP_S vout_osd_buf_setup; GD_DSP_CMD_VOUT_OSD_CLUT_SETUP_S vout_osd_clut_setup; GD_DSP_CMD_VOUT_DISPLAY_SETUP_S vout_display_setup; GD_DSP_CMD_VOUT_DVE_SETUP_S vout_dve_setup; GD_DSP_CMD_VOUT_RESET_S vout_reset; GD_DSP_CMD_VOUT_DISPLAY_CSC_SETUP_S vout_display_csc_setup; GD_DSP_CMD_VOUT_DIGITAL_OUTPUT_MODE_SETUP_S vout_digital_output_mode_setup; GD_DSP_CMD_CFA_NOISE_FILTER_S cfa_noise_filter; GD_DSP_CMD_DIGITAL_GAIN_SATURATION_S digital_gain_saturation; GD_DSP_CMD_CHROMA_MEDIAN_FILTER_S chroma_median_filter; GD_DSP_CMD_LUMA_DIRECTIONAL_FILTER_S luma_directional_filter; GD_DSP_CMD_LUMA_SHARPEN_S luma_sharpen; GD_DSP_CMD_MAIN_RESAMPLER_S main_resampler; GD_DSP_CMD_CFA_RESAMPLER_BANDWIDTH_S cfa_resampler_bandwidth; GD_DSP_CMD_DSP_DEBUG_S dsp_debug; GD_DSP_CMD_AAA_STATISTICS_DEBUG_S aaa_statistics_debug; GD_DSP_CMD_DSP_SPECIAL_S dsp_special; GD_DSP_CMD_AAA_STATISTICS_DEBUG12_S aaa_statistics_debug12; GD_DSP_CMD_BAD_PIXEL_CROP_S bad_pixel_crop; GD_DSP_CMD_DSP_DEBUG_2_S dsp_debug_2; GD_DSP_CMD_DSP_DEBUG_3_S dsp_debug_3; GD_DSP_CMD_UPDATE_IDSP_CONFIG_S update_idsp_config; GD_DSP_CMD_REAL_TIME_RATE_MODIFY_S real_time_rate_modify; GD_DSP_CMD_REAL_TIME_CBR_MODIFY_S real_time_cbr_modify; }GD_DSP_CMD_S; //***************************************************************************** //***************************************************************************** //** Global Data //***************************************************************************** //***************************************************************************** //***************************************************************************** //***************************************************************************** //** API Functions //***************************************************************************** //***************************************************************************** U32 GD_DSP_CMD_GET_CODE_CR_PC_T0_ADDR(void); #ifdef __cplusplus extern "C" { #endif #ifdef __cplusplus } #endif #endif /* _GD_IDSP_CMD_H_ */
31.332269
263
0.626294
b6bb2a2a037a9e63d230eec309b1f51f55c3e40a
5,317
rb
Ruby
app/models/workfile.rb
nkapinos/chorus
5f7da6b99383916f2a566caad326a6e6414894fe
[ "Apache-2.0" ]
1
2015-11-06T09:32:53.000Z
2015-11-06T09:32:53.000Z
app/models/workfile.rb
nkapinos/chorus
5f7da6b99383916f2a566caad326a6e6414894fe
[ "Apache-2.0" ]
null
null
null
app/models/workfile.rb
nkapinos/chorus
5f7da6b99383916f2a566caad326a6e6414894fe
[ "Apache-2.0" ]
null
null
null
class Workfile < ActiveRecord::Base include SoftDelete include TaggableBehavior include Notable @@entity_subtypes = Hash.new('ChorusWorkfile').merge!({ 'alpine' => 'AlpineWorkfile' }) attr_accessible :description, :file_name, :as => [:default, :create] attr_accessible :owner, :workspace, :as => :create attr_accessible :status attr_accessor :resolve_name_conflicts serialize :additional_data, JsonHashSerializer belongs_to :workspace belongs_to :owner, :class_name => 'User' belongs_to :execution_location, :polymorphic => true has_many :activities, :as => :entity has_many :events, :through => :activities has_many :comments, :through => :events has_many :most_recent_comments, :through => :events, :source => :comments, :class_name => "Comment", :order => "id DESC", :limit => 1 has_many :versions, :class_name => 'WorkfileVersion', :dependent => :destroy belongs_to :latest_workfile_version, :class_name => 'WorkfileVersion' validates :workspace, presence: true validates :owner, presence: true validates_presence_of :file_name validates_uniqueness_of :file_name, :scope => [:workspace_id, :deleted_at] validates_format_of :file_name, :with => /^[a-zA-Z0-9_ \.\(\)\-]+$/ before_validation :init_file_name, :on => :create before_update :ensure_proper_content_type def ensure_proper_content_type file_is_an_image = self.content_type == 'image' file_name_ends_in_SQL = self.file_name =~ (/^.*\.sql$/i) file_name_ends_in_TXT = self.file_name =~ (/^.*\.txt$/i) unless file_is_an_image self.content_type='sql' if file_name_ends_in_SQL self.content_type='text' if file_name_ends_in_TXT end end after_create :create_workfile_created_event, :if => :current_user after_create :update_has_added_workfile_on_workspace after_create { touch(:user_modified_at) } delegate :member_ids, :public, :to => :workspace attr_accessor :highlighted_attributes, :search_result_notes searchable_model :name_for_sort => :file_name do text :file_name, :stored => true, :boost => SOLR_PRIMARY_FIELD_BOOST text :description, :stored => true, :boost => SOLR_SECONDARY_FIELD_BOOST text :version_comments, :stored => true, :boost => SOLR_SECONDARY_FIELD_BOOST do versions.map { |version| version.commit_message } end integer :workspace_id, :multiple => true integer :member_ids, :multiple => true boolean :public end def self.eager_load_associations [ { :latest_workfile_version => [ { :workfile => [ :workspace, :owner, :tags, {:most_recent_comments => :author}, {:most_recent_notes => :actor} ] }, :owner, :modifier ] } ] end def self.build_for(params) klass = @@entity_subtypes[params[:entity_subtype]].constantize klass.new(params, :as => :create) end def self.with_file_type(file_type) where(content_type: file_type.downcase) end def self.order_by(column_name) if column_name.blank? || column_name == "file_name" order("lower(workfiles.file_name), workfiles.id") else order("user_modified_at desc") end end def self.type_name 'Workfile' end def self.add_search_permissions(current_user, search) unless current_user.admin? search.build do any_of do without :security_type_name, Workfile.security_type_name with :member_ids, current_user.id with :public, true end end end end def entity_type_name 'workfile' end def create_new_version(*args) end def remove_draft(*args) end def attempt_data_source_connection end def run_now(user) end def copy(user, workspace, new_file_name = nil) new_workfile = self.class.new new_workfile.file_name = new_file_name.nil? ? file_name : new_file_name new_workfile.description = description new_workfile.workspace = workspace new_workfile.owner = user new_workfile.additional_data = additional_data new_workfile.execution_location = execution_location new_workfile end def copy!(user, workspace, new_file_name=nil) new_workfile = self.copy(user, workspace, new_file_name) new_workfile.resolve_name_conflicts = new_file_name.nil? new_workfile.build_new_version(user, self.latest_workfile_version.contents, '') if new_workfile.respond_to?(:build_new_version) new_workfile.save! new_workfile end def create_result_event(result_id) event = Events::WorkfileResult.by(current_user).add(:workfile => self, :workspace => workspace) event.notes_work_flow_results.create(:result_id => result_id) if result_id event end private def init_file_name WorkfileName.resolve_name_for!(self) if resolve_name_conflicts true end def create_workfile_created_event Events::WorkfileCreated.by(current_user).add( :workfile => self, :workspace => workspace, :commit_message => description ) end def update_has_added_workfile_on_workspace workspace.has_added_workfile = true workspace.save! end end
28.896739
135
0.685725
0ef4d798e395209bc41d1cf47dc1485e6422c653
2,563
kt
Kotlin
base-kotlin-compiler/src/main/java/com/izikode/izilib/basekotlincompiler/component/CompilationRound.kt
iFanie/BaseKotlinCompiler
524a42ba3d339bf75fc5a33e61bb7758451eb0f4
[ "Apache-2.0" ]
null
null
null
base-kotlin-compiler/src/main/java/com/izikode/izilib/basekotlincompiler/component/CompilationRound.kt
iFanie/BaseKotlinCompiler
524a42ba3d339bf75fc5a33e61bb7758451eb0f4
[ "Apache-2.0" ]
null
null
null
base-kotlin-compiler/src/main/java/com/izikode/izilib/basekotlincompiler/component/CompilationRound.kt
iFanie/BaseKotlinCompiler
524a42ba3d339bf75fc5a33e61bb7758451eb0f4
[ "Apache-2.0" ]
null
null
null
package com.izikode.izilib.basekotlincompiler.component import com.izikode.izilib.basekotlincompiler.CompilationUtilities import com.izikode.izilib.basekotlincompiler.source.member.field.AnnotatedVariableSource import com.izikode.izilib.basekotlincompiler.source.member.method.AnnotatedFunctionSource import com.izikode.izilib.basekotlincompiler.source.type.AnnotatedClassSource import javax.annotation.processing.RoundEnvironment import javax.lang.model.element.TypeElement import javax.lang.model.util.ElementFilter import kotlin.reflect.KClass data class CompilationRound( private val compilationUtilities: CompilationUtilities, private val annotations: MutableSet<out TypeElement>, private val roundEnvironment: RoundEnvironment ) { fun <ClassAnnotation> classesWith(annotation: KClass<out ClassAnnotation>) : ArrayList<AnnotatedClassSource<ClassAnnotation>> where ClassAnnotation : Annotation { val classes = arrayListOf<AnnotatedClassSource<ClassAnnotation>>() ElementFilter.typesIn(roundEnvironment.getElementsAnnotatedWith(annotation.java)).forEach { classes.add(AnnotatedClassSource( it, it.getAnnotation(annotation.java), compilationUtilities )) } return classes } fun <VariableAnnotation> variablesWith(annotation: KClass<out VariableAnnotation>) : ArrayList<AnnotatedVariableSource<VariableAnnotation>> where VariableAnnotation : Annotation { val variables = arrayListOf<AnnotatedVariableSource<VariableAnnotation>>() ElementFilter.fieldsIn(roundEnvironment.getElementsAnnotatedWith(annotation.java)).forEach { variables.add(AnnotatedVariableSource( it, it.getAnnotation(annotation.java), compilationUtilities )) } return variables } fun <FunctionAnnotation> functionsWith(annotation: KClass<out FunctionAnnotation>) : ArrayList<AnnotatedFunctionSource<FunctionAnnotation>> where FunctionAnnotation : Annotation { val methods = arrayListOf<AnnotatedFunctionSource<FunctionAnnotation>>() ElementFilter.methodsIn(roundEnvironment.getElementsAnnotatedWith(annotation.java)).forEach { methods.add(AnnotatedFunctionSource( it, it.getAnnotation(annotation.java), compilationUtilities )) } return methods } }
37.144928
108
0.708155
d645e20730b81fcb5f11065aadbf65037cab4e04
5,022
cs
C#
Source/MT4LiquidityIndicator/MT4LiquidityIndicator.Net/Settings/Configuration.cs
siwtom/MT4-liquidity-indicator
a83712832c555d3e0b0a8c352602b02bef043d1b
[ "Apache-2.0" ]
null
null
null
Source/MT4LiquidityIndicator/MT4LiquidityIndicator.Net/Settings/Configuration.cs
siwtom/MT4-liquidity-indicator
a83712832c555d3e0b0a8c352602b02bef043d1b
[ "Apache-2.0" ]
null
null
null
Source/MT4LiquidityIndicator/MT4LiquidityIndicator.Net/Settings/Configuration.cs
siwtom/MT4-liquidity-indicator
a83712832c555d3e0b0a8c352602b02bef043d1b
[ "Apache-2.0" ]
null
null
null
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Xml.Serialization; using MT4LiquidityIndicator.Net.Core; using MT4LiquidityIndicator.Net.Settings.Version0; namespace MT4LiquidityIndicator.Net.Settings { public class Configuration { #region construction public Configuration() { } internal Configuration(Dictionary<string, ChartSettings> symbolToSettings) { if (null == symbolToSettings) { throw new ArgumentNullException("symbolToSettings"); } this.Settings0 = new Settings0(); this.Settings0.Charts = CreateCharts(symbolToSettings); } private static List<ChartSettings0> CreateCharts(Dictionary<string, ChartSettings> symbolToSettings) { List<ChartSettings0> result = new List<ChartSettings0>(); result.Capacity = symbolToSettings.Count; foreach (var element in symbolToSettings) { ChartSettings0 item = CreateChart(element.Key, element.Value); result.Add(item); } return result; } private static ChartSettings0 CreateChart(string symbol, ChartSettings settings) { ChartSettings0 result = new ChartSettings0(); result.Symbol = symbol; result.Mode = (Mode0)settings.Mode; result.Type = (LineType0)settings.Type; result.Grid = settings.Grid; result.BackgroundColor = ColorSerializer.StringFromColor(settings.BackgroundColor); result.ForegroundColor = ColorSerializer.StringFromColor(settings.ForegroundColor); result.Duration = settings.Duration; result.Height = settings.Height; result.UpdateInterval = settings.UpdateInterval; result.Lines = CreateLines(settings.Lines); return result; } private static List<LineSettings0> CreateLines(List<LineSettings> settings) { List<LineSettings0> result = new List<LineSettings0>(); result.Capacity = settings.Count; foreach (var element in settings) { LineSettings0 item = CreateLine(element); result.Add(item); } return result; } private static LineSettings0 CreateLine(LineSettings settings) { LineSettings0 result = new LineSettings0(); result.BidColor = ColorSerializer.StringFromColor(settings.BidColor); result.AskColor = ColorSerializer.StringFromColor(settings.AskColor); result.Volume = settings.Volume; return result; } #endregion #region converting internal Dictionary<string, ChartSettings> ToSettings() { Dictionary<string, ChartSettings> result = new Dictionary<string, ChartSettings>(); foreach (var element in this.Settings0.Charts) { string key = element.Symbol; ChartSettings settings = CreateChart(element); result[key] = settings; } return result; } private static ChartSettings CreateChart(ChartSettings0 settings) { ChartSettings result = new ChartSettings(); result.Mode = (RenderingMode)settings.Mode; result.Type = (LineType)settings.Type; result.Grid = settings.Grid; result.BackgroundColor = ColorSerializer.ColorFromString(settings.BackgroundColor); result.ForegroundColor = ColorSerializer.ColorFromString(settings.ForegroundColor); result.Duration = settings.Duration; result.Height = settings.Height; result.UpdateInterval = settings.UpdateInterval; CreateLines(settings.Lines, result.Lines); return result; } private static void CreateLines(List<LineSettings0> settings, List<LineSettings> lines) { lines.Capacity = settings.Count; foreach (var element in settings) { LineSettings item = CreateLine(element); lines.Add(item); } } private static LineSettings CreateLine(LineSettings0 settings) { LineSettings result = new LineSettings(); result.Volume = settings.Volume; result.BidColor = ColorSerializer.ColorFromString(settings.BidColor); result.AskColor = ColorSerializer.ColorFromString(settings.AskColor); return result; } #endregion #region properties public Settings0 Settings0 { get; set; } #endregion #region saving and loading internal static void Save(string path, Configuration config) { CreateDirectoriesFromPath(path); XmlSerializer serializer = new XmlSerializer(typeof(Configuration)); using (StreamWriter stream = new StreamWriter(path)) { serializer.Serialize(stream, config); } } internal static Configuration Load(string path) { XmlSerializer serializer = new XmlSerializer(typeof(Configuration)); using (StreamReader stream = new StreamReader(path)) { object obj = serializer.Deserialize(stream); Configuration result = (Configuration)obj; return result; } } private static void CreateDirectoriesFromPath(string path) { string directory = Path.GetDirectoryName(path); string[] items = directory.Split('\\'); path = items[0] + "\\"; int count = items.Length; for (int index = 1; index < count; ++index) { string item = items[index]; path = Path.Combine(path, item); if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } } } #endregion } }
30.809816
102
0.736161
23c7a7ae09c4eb5dc85dc4819afd7337cede6d52
528
js
JavaScript
models/Museos.js
a01374942/Back-end
97d58b8aba268e0f237202acd5896e8c4288863d
[ "Apache-2.0" ]
null
null
null
models/Museos.js
a01374942/Back-end
97d58b8aba268e0f237202acd5896e8c4288863d
[ "Apache-2.0" ]
null
null
null
models/Museos.js
a01374942/Back-end
97d58b8aba268e0f237202acd5896e8c4288863d
[ "Apache-2.0" ]
1
2021-11-04T04:57:40.000Z
2021-11-04T04:57:40.000Z
const mongoose = require('mongoose') const { stringify } = require('querystring') const Museos = mongoose.Schema({ _id: mongoose.Schema.Types.ObjectId, //Formato con el que se recibira el Json y se tendra la BD Nombre:{ type: String, required: true }, Ubicacion:{ type: String, required: false }, Descripcion:{ type: String, required: false } },{collection:'Museos'}) //Modulo para exportar la base module.exports = mongoose.model('Museos',Museos)
26.4
63
0.626894
3f7ed99b498fef34e0450078364fc0a9928ef349
7,078
php
PHP
app/Http/Controllers/Admin/PlanController.php
yinmanman/20k
386e45f23cb2a9ab955df2c4a22d6f43203ca51a
[ "MIT" ]
null
null
null
app/Http/Controllers/Admin/PlanController.php
yinmanman/20k
386e45f23cb2a9ab955df2c4a22d6f43203ca51a
[ "MIT" ]
null
null
null
app/Http/Controllers/Admin/PlanController.php
yinmanman/20k
386e45f23cb2a9ab955df2c4a22d6f43203ca51a
[ "MIT" ]
null
null
null
<?php namespace App\Http\Controllers\Admin; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use Illuminate\Support\Facades\Input; use DB; class PlanController extends Controller{ public $normal= "正常播放"; public $abnormal= "取消播放"; public function movie_plan_list(){ $data = DB::table('cinema')->paginate(5); return view('qiao/index',['data'=>$data]); } public function cinema_num(){ $cinema_id = Input::all('cinema_id'); $c_id = json_decode(json_encode($cinema_id),true); $cinema_id = (int)($c_id['cinema_id']); $cinema_data = DB::table('movie_house')->where('cinema_id','=',$cinema_id)->get(); $movie_name = DB::table('films')->select('film_name','film_id','time')->get(); return view('qiao/cinema',[ 'cinema_data' => $cinema_data, 'movie_name' => $movie_name, 'cinema_id' => $cinema_id ]); } public function house_setting(){ $house_id = Input::get('house_id'); $cinema_id = Input::get('cinema_id'); // var_dump($cinema_id);die; // $house_id1 = (int)($house_id['house_id']); $sql = "SELECT MAX(next_movie_start) FROM house_setting WHERE house_id=".$house_id." GROUP BY house_id"; $movie_start_object = DB::select($sql); if (!empty($movie_start_object)) { $movie_start_arr = json_decode(json_encode($movie_start_object),true); $next_movie_start = $movie_start_arr[0]['MAX(next_movie_start)']; $tt = $next_movie_start; $end = strtotime('23:30:00'); $aa = strtotime($next_movie_start); $movie_name = DB::table('films')->select('film_name','film_id')->get(); return view('qiao/house',[ 'movie_name' =>$movie_name, 'house_id' =>$house_id, 'cinema_id' =>$cinema_id, 'next_movie_start' => $tt ]); }else{ $movie_name = DB::table('films')->select('film_name','film_id')->get(); return view('qiao/house',[ 'movie_name' =>$movie_name, 'cinema_id' =>$cinema_id, 'house_id' =>$house_id ]); } } public function ajax_moie_begin(){ if(Input::all('movie_id')){ $movie_id = Input::all('movie_id'); $film_id = $movie_id['film_id']; $kaishi = $movie_id['movie_begin']; $movie_time = DB::table('films')->select('time')->where('film_id','=',$film_id)->get(); $movie_time = json_decode(json_encode($movie_time),true); if (!empty($movie_time)) { $movie_time = (int)($movie_time[0]['time']); $clean = 17; $time = explode(':',$kaishi); $hour = (int)($time[0]); $minute = (int)($time[1]); $timetoday = strtotime(date("Y-m-d",time())); $kaishishijian = $hour*60*60+$minute*60; $movie_time1 = $movie_time*60; $jieshushijian = date('Y-m-d H:i:s',$timetoday+$kaishishijian); $rest = $clean*60; $aa = $timetoday+$kaishishijian+$movie_time1; $oo = $timetoday+$kaishishijian+$movie_time1+$rest; $sanchang = date('H:i:s',$aa); $kaishi = date('H:i:s',$oo); $data['movie_leave'] = $sanchang; $data['next_movie_start'] = $kaishi; return $data; }else{ return 1; } } } public function addMovie(){ $data = Input::all(); $data['status'] = 1; //电影默认是正常播放状态 $house_id = $data['house_id']; $cinema_id = $data['cinema_id']; if ($data) { unset($data['_token']); } $sql = "SELECT COUNT(house_id) FROM house_setting WHERE house_id = ".$house_id." GROUP BY house_id"; $count_num_object = DB::select($sql); if (!empty($count_num_object)) { $num_arr = json_decode(json_encode($count_num_object),true); $num = $num_arr[0]['COUNT(house_id)']; if ($num>=7) { return '<script>alert("安排已满");location.href="'.'house_Setting_list?house_id='.$house_id.'";</script>'; }else{ $res = DB::table("house_setting")->insert($data); if($res){ return '<script>alert("添加成功");location.href="'.'house_Setting_list?house_id='.$house_id.'&cinema_id='.$cinema_id.'";</script>'; } } }else{ $res = DB::table("house_setting")->insert($data); if($res){ return '<script>alert("添加成功");location.href="'.'house_Setting_list?house_id='.$house_id.'&cinema_id='.$cinema_id.'";</script>'; } } } public function house_Setting_list(){ $house_id = (int)(Input::get('house_id')); $cinema_id = (int)(Input::get('cinema_id')); $movie_data = DB::TABLE('house_setting') ->JOIN('films','house_setting.film_id','=','films.film_id') ->select('id','film_name','movie_leave','house_id','movie_start','movie_leave','next_movie_start','movie_dangqi_start','movie_dangqi_stop','status') ->WHERE('house_id','=',$house_id) ->orderBy('movie_start', 'ASC') ->get(); return view('qiao/house_setting_list',[ 'movie_data' => $movie_data, 'house_id' => $house_id, 'cinema_id' => $cinema_id, ]); } public function edit_setting(){ $id = Input::get('id'); $status = Input::get('status'); $house_id = Input::get('house_id'); if ($status == '正常播放') { $status = 0; }elseif($status == '取消播放'){ $status = 1; }elseif ($status == 0 ) { $status = 1; }else{ $status = 0; } $sql = "UPDATE house_setting SET STATUS =".$status." WHERE id =".$id; $res = DB::update($sql); if ($res) { $data = DB::TABLE('house_setting') ->JOIN('films','house_setting.film_id','=','films.film_id') ->select('id','film_name','movie_leave','house_id','movie_start','movie_leave','next_movie_start','movie_dangqi_start','movie_dangqi_stop','status') ->WHERE('house_id','=',$house_id) ->orderBy('movie_start', 'ASC') ->get(); $data = json_decode(json_encode($data),true); return $this->str($data,$house_id); } } public function str($data,$house_id){ $str = ""; foreach ($data as $key => $value) { if ($value['status'] == 1) { $str .= "<tr>"; }else{ $str .= "<tr style='color:red';>"; } $str .= "<td>".$value['film_name']."</td>"; $str .= "<td>".$value['house_id']."</td>"; $str .= "<td>".$value['movie_start']."</td>"; $str .= "<td>".$value['movie_leave']."</td>"; $str .= "<td>".$value['next_movie_start']."</td>"; $str .= "<td>".$value['movie_dangqi_start']."</td>"; $str .= "<td>".$value['movie_dangqi_stop']."</td>"; $str .= "<input type='hidden' value=".$house_id.">"; $str .= "<input type='hidden' value=".$value['id']." id='hidden_id'>"; if ($value['status'] == 1) { $str .= "<td>".$this->normal."</td>"; }else{ $str .= "<td>".$this->abnormal."</td>"; } $str .= "<td><p class='btn' ><i class='fa fa-edit'></i>编辑</p></td>"; $str .= "</tr>"; } return $str; } } ?>
35.39
157
0.55284
a5b2d2db54cb8e40cec13fd26c32445d2b9e947c
1,432
rs
Rust
jni-android-sys/src/generated/api-level-29/android/se/omapi/SEService_OnConnectedListener.rs
sjeohp/jni-bindgen
848121402484f114fa978e8d4b4c19379f9e22a8
[ "Apache-2.0", "MIT" ]
null
null
null
jni-android-sys/src/generated/api-level-29/android/se/omapi/SEService_OnConnectedListener.rs
sjeohp/jni-bindgen
848121402484f114fa978e8d4b4c19379f9e22a8
[ "Apache-2.0", "MIT" ]
null
null
null
jni-android-sys/src/generated/api-level-29/android/se/omapi/SEService_OnConnectedListener.rs
sjeohp/jni-bindgen
848121402484f114fa978e8d4b4c19379f9e22a8
[ "Apache-2.0", "MIT" ]
null
null
null
// WARNING: This file was autogenerated by jni-bindgen. Any changes to this file may be lost!!! #[cfg(any(feature = "all", feature = "android-se-omapi-SEService_OnConnectedListener"))] __jni_bindgen! { /// public interface [SEService.OnConnectedListener](https://developer.android.com/reference/android/se/omapi/SEService.OnConnectedListener.html) /// /// Required feature: android-se-omapi-SEService_OnConnectedListener public interface SEService_OnConnectedListener ("android/se/omapi/SEService$OnConnectedListener") extends crate::java::lang::Object { /// [onConnected](https://developer.android.com/reference/android/se/omapi/SEService.OnConnectedListener.html#onConnected()) pub fn onConnected<'env>(&'env self) -> __jni_bindgen::std::result::Result<(), __jni_bindgen::Local<'env, crate::java::lang::Throwable>> { // class.path == "android/se/omapi/SEService$OnConnectedListener", java.flags == PUBLIC | ABSTRACT, .name == "onConnected", .descriptor == "()V" unsafe { let __jni_args = []; let __jni_env = __jni_bindgen::Env::from_ptr(self.0.env); let (__jni_class, __jni_method) = __jni_env.require_class_method("android/se/omapi/SEService$OnConnectedListener\0", "onConnected\0", "()V\0"); __jni_env.call_void_method_a(self.0.object, __jni_method, __jni_args.as_ptr()) } } } }
62.26087
159
0.685754
644306edfc5e7ff2f1d50e528da45b87d61c7aef
656
py
Python
bot_box/features/bot_info.py
faizal3199/thecsebot
cd7d8553e60f72724b6f3c862651f4b1841e58ce
[ "MIT" ]
8
2017-10-26T12:39:37.000Z
2018-04-06T03:46:12.000Z
bot_box/features/bot_info.py
faizal3199/thecsebot
cd7d8553e60f72724b6f3c862651f4b1841e58ce
[ "MIT" ]
3
2020-06-05T17:34:41.000Z
2021-03-19T21:53:38.000Z
bot_box/features/bot_info.py
faizal3199/thecsebot
cd7d8553e60f72724b6f3c862651f4b1841e58ce
[ "MIT" ]
1
2018-10-04T16:40:16.000Z
2018-10-04T16:40:16.000Z
from django.shortcuts import get_object_or_404 from slack_bot.models import SlackUser def bot_info_api(query): user = get_object_or_404(SlackUser, uid=query.upper()) username = user.user_name name = user.name eno = user.eno room_no = user.room_no bhawan = user.get_bhawan_display() phone_no = user.phone_no phone_no_alt = user.phone_no_alt email = user.email email2 = user.email2 user_tuple = (username, name, eno, room_no, bhawan, phone_no, email) user_data = \ """ \ Username: %s Name: %s E. No.: %s Room No: %s Bhawan: %s Phone No: %s Email: %s """ % user_tuple return user_data
20.5
72
0.666159
af4e562e647a6838680281ad30337f6c0ce3fb47
3,770
py
Python
code_submission/demo_torch_memory_management.py
joneswong/AutoGraph
62ea5dd250424ace5c6d6aa72cb196ed335dc2e3
[ "Apache-2.0" ]
4
2020-06-13T02:11:06.000Z
2020-10-12T09:08:02.000Z
code_submission/demo_torch_memory_management.py
joneswong/AutoGraph
62ea5dd250424ace5c6d6aa72cb196ed335dc2e3
[ "Apache-2.0" ]
null
null
null
code_submission/demo_torch_memory_management.py
joneswong/AutoGraph
62ea5dd250424ace5c6d6aa72cb196ed335dc2e3
[ "Apache-2.0" ]
3
2020-06-11T09:06:01.000Z
2020-10-16T05:37:38.000Z
import numpy as np import torch from pynvml import * nvmlInit() from algorithms.gcn_algo import GCN device = torch.device('cuda:0') print("*********** 0 ***********") #print(torch.cuda.get_device_properties(0).total_memory) #print(torch.cuda.memory_cached(0)) print(torch.cuda.memory_cached(0)) #print(torch.cuda.max_memory_cached(0)) print(torch.cuda.memory_allocated(0)) #print(torch.cuda.max_memory_allocated(0)) print("**********************") h = nvmlDeviceGetHandleByIndex(0) info = nvmlDeviceGetMemoryInfo(h) print(f'total : {info.total}') print(f'free : {info.free}') print(f'used : {info.used}') print("*********** 0 ***********") ts = list() for i in range(100): a_cpu = torch.ones((26843540,), dtype=torch.float32) a_gpu = a_cpu.to(device) ts.append(a_gpu) print("********** {} ************".format(i)) #print(torch.cuda.get_device_properties(0).total_memory) #print(torch.cuda.memory_cached(0)) print(torch.cuda.memory_cached(0)) print(torch.cuda.max_memory_cached(0)) print(torch.cuda.memory_allocated(0)) print(torch.cuda.max_memory_allocated(0)) print("**********************") h = nvmlDeviceGetHandleByIndex(0) info = nvmlDeviceGetMemoryInfo(h) print(f'total : {info.total}') print(f'free : {info.free}') print(f'used : {info.used}') print("*********** {} ***********".format(i)) if i % 10 == 0: input() del ts[:50] print("********** del half before empty ************") #print(torch.cuda.get_device_properties(0).total_memory) #print(torch.cuda.memory_cached(0)) print(torch.cuda.memory_cached(0)) print(torch.cuda.max_memory_cached(0)) print(torch.cuda.memory_allocated(0)) print(torch.cuda.max_memory_allocated(0)) print("**********************") h = nvmlDeviceGetHandleByIndex(0) info = nvmlDeviceGetMemoryInfo(h) print(f'total : {info.total}') print(f'free : {info.free}') print(f'used : {info.used}') print("*********** del half before empty ***********") input() """ torch.cuda.empty_cache() print("********** del half after empty ************") #print(torch.cuda.get_device_properties(0).total_memory) #print(torch.cuda.memory_cached(0)) print(torch.cuda.memory_cached(0)) print(torch.cuda.max_memory_cached(0)) print(torch.cuda.memory_allocated(0)) print(torch.cuda.max_memory_allocated(0)) print("**********************") h = nvmlDeviceGetHandleByIndex(0) info = nvmlDeviceGetMemoryInfo(h) print(f'total : {info.total}') print(f'free : {info.free}') print(f'used : {info.used}') print("*********** del half after empty ***********") input() """ estimate_available = info.free + (torch.cuda.memory_cached(0) - torch.cuda.memory_allocated(0)) print(estimate_available) a_cpu = torch.ones((int((0.9*estimate_available)/4),), dtype=torch.float32) a_gpu = a_cpu.to(device) print("********** success or fail ************") #print(torch.cuda.get_device_properties(0).total_memory) #print(torch.cuda.memory_cached(0)) print(torch.cuda.memory_cached(0)) print(torch.cuda.max_memory_cached(0)) print(torch.cuda.memory_allocated(0)) print(torch.cuda.max_memory_allocated(0)) print("**********************") h = nvmlDeviceGetHandleByIndex(0) info = nvmlDeviceGetMemoryInfo(h) print(f'total : {info.total}') print(f'free : {info.free}') print(f'used : {info.used}') print("*********** success or fail ***********") input() """ a = GCN(2, 123) b = list(a.parameters()) num_floats = 0 for param in b: print(param.size()) tmp = np.prod(param.size()) num_floats += tmp print(tmp) print(num_floats) mye = GCN.estimate_mem_consumption(10000, 600000, 2, 123) print(torch.cuda.get_device_properties(0).total_memory) print(torch.cuda.memory_cached(0)) print(torch.cuda.memory_allocated(0)) print(mye) """
31.157025
95
0.649337
6be1c4ce50c532503f30b6f3665e917e0f3d9b93
42,291
sql
SQL
core/store/migrations/testdata/1554131520_dump.postgres.sql
jalextowle/chainlink
4dd42fb5118670fda9e59ef8971177e329099bd7
[ "MIT" ]
null
null
null
core/store/migrations/testdata/1554131520_dump.postgres.sql
jalextowle/chainlink
4dd42fb5118670fda9e59ef8971177e329099bd7
[ "MIT" ]
null
null
null
core/store/migrations/testdata/1554131520_dump.postgres.sql
jalextowle/chainlink
4dd42fb5118670fda9e59ef8971177e329099bd7
[ "MIT" ]
null
null
null
-- -- PostgreSQL database dump -- -- Dumped from database version 11.1 -- Dumped by pg_dump version 11.1 SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SELECT pg_catalog.set_config('search_path', '', false); SET check_function_bodies = false; SET client_min_messages = warning; SET row_security = off; SET default_tablespace = ''; SET default_with_oids = false; -- -- Name: bridge_types; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.bridge_types ( name character varying(255) NOT NULL, url character varying(255), confirmations bigint, incoming_token character varying(255), outgoing_token character varying(255), minimum_contract_payment character varying(255) ); -- -- Name: encumbrances; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.encumbrances ( id integer NOT NULL, payment character varying(255), expiration bigint, end_at timestamp with time zone, oracles text ); -- -- Name: encumbrances_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.encumbrances_id_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: encumbrances_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE public.encumbrances_id_seq OWNED BY public.encumbrances.id; -- -- Name: heads; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.heads ( hash character varying NOT NULL, number bigint NOT NULL ); -- -- Name: initiators; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.initiators ( id integer NOT NULL, job_spec_id character varying(36), type text NOT NULL, created_at timestamp with time zone, schedule text, "time" timestamp with time zone, ran boolean, address bytea, requesters text, deleted_at timestamp with time zone ); -- -- Name: initiators_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.initiators_id_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: initiators_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE public.initiators_id_seq OWNED BY public.initiators.id; -- -- Name: job_runs; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.job_runs ( id text NOT NULL, job_spec_id character varying(36) NOT NULL, result_id integer, run_request_id integer, status text, created_at timestamp with time zone, completed_at timestamp with time zone, updated_at timestamp with time zone, initiator_id integer, creation_height character varying(255), observed_height character varying(255), overrides_id integer, deleted_at timestamp with time zone ); -- -- Name: job_specs; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.job_specs ( id text NOT NULL, created_at timestamp with time zone, start_at timestamp with time zone, end_at timestamp with time zone, deleted_at timestamp with time zone ); -- -- Name: keys; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.keys ( address character varying(64) NOT NULL, json text ); -- -- Name: migrations; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.migrations ( id character varying(12) NOT NULL ); -- -- Name: run_requests; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.run_requests ( id integer NOT NULL, request_id text, tx_hash bytea, requester bytea, created_at timestamp with time zone ); -- -- Name: run_requests_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.run_requests_id_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: run_requests_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE public.run_requests_id_seq OWNED BY public.run_requests.id; -- -- Name: run_results; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.run_results ( id integer NOT NULL, cached_job_run_id text, cached_task_run_id text, data text, status text, error_message text, amount character varying(255) ); -- -- Name: run_results_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.run_results_id_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: run_results_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE public.run_results_id_seq OWNED BY public.run_results.id; -- -- Name: service_agreements; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.service_agreements ( id text NOT NULL, created_at timestamp with time zone, encumbrance_id integer, request_body text, signature character varying(255), job_spec_id character varying(36) NOT NULL ); -- -- Name: sessions; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.sessions ( id text NOT NULL, last_used timestamp with time zone, created_at timestamp with time zone ); -- -- Name: sync_events; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.sync_events ( id integer NOT NULL, created_at timestamp with time zone, updated_at timestamp with time zone, body text ); -- -- Name: sync_events_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.sync_events_id_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: sync_events_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE public.sync_events_id_seq OWNED BY public.sync_events.id; -- -- Name: task_runs; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.task_runs ( id text NOT NULL, job_run_id character varying(36) NOT NULL, result_id integer, status text, task_spec_id integer, minimum_confirmations bigint, created_at timestamp with time zone ); -- -- Name: task_specs; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.task_specs ( id integer NOT NULL, created_at timestamp with time zone, updated_at timestamp with time zone, deleted_at timestamp with time zone, job_spec_id character varying(36), type text NOT NULL, confirmations bigint, params text ); -- -- Name: task_specs_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.task_specs_id_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: task_specs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE public.task_specs_id_seq OWNED BY public.task_specs.id; -- -- Name: tx_attempts; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.tx_attempts ( hash bytea NOT NULL, tx_id bigint, gas_price character varying(255), confirmed boolean, hex text, sent_at bigint, created_at timestamp with time zone ); -- -- Name: txes; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.txes ( id bigint NOT NULL, "from" bytea NOT NULL, "to" bytea NOT NULL, data bytea, nonce bigint, value character varying(255), gas_limit bigint, hash bytea, gas_price character varying(255), confirmed boolean, hex text, sent_at bigint ); -- -- Name: txes_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.txes_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: txes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE public.txes_id_seq OWNED BY public.txes.id; -- -- Name: users; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.users ( email text NOT NULL, hashed_password text, created_at timestamp with time zone ); -- -- Name: encumbrances id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.encumbrances ALTER COLUMN id SET DEFAULT nextval('public.encumbrances_id_seq'::regclass); -- -- Name: initiators id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.initiators ALTER COLUMN id SET DEFAULT nextval('public.initiators_id_seq'::regclass); -- -- Name: run_requests id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.run_requests ALTER COLUMN id SET DEFAULT nextval('public.run_requests_id_seq'::regclass); -- -- Name: run_results id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.run_results ALTER COLUMN id SET DEFAULT nextval('public.run_results_id_seq'::regclass); -- -- Name: sync_events id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.sync_events ALTER COLUMN id SET DEFAULT nextval('public.sync_events_id_seq'::regclass); -- -- Name: task_specs id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.task_specs ALTER COLUMN id SET DEFAULT nextval('public.task_specs_id_seq'::regclass); -- -- Name: txes id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.txes ALTER COLUMN id SET DEFAULT nextval('public.txes_id_seq'::regclass); -- -- Data for Name: bridge_types; Type: TABLE DATA; Schema: public; Owner: - -- COPY public.bridge_types (name, url, confirmations, incoming_token, outgoing_token, minimum_contract_payment) FROM stdin; \. -- -- Data for Name: encumbrances; Type: TABLE DATA; Schema: public; Owner: - -- COPY public.encumbrances (id, payment, expiration, end_at, oracles) FROM stdin; \. -- -- Data for Name: heads; Type: TABLE DATA; Schema: public; Owner: - -- COPY public.heads (hash, number) FROM stdin; 2639889a465c75b75d747a8c64b597ba58b9b1569c36390719ead14393e1caa6 124365 fb2f6931161a54f2fac09f7b68594b893614b147b2b5b319c0a84d0f4f314baf 124366 32ef05b89f508476a908a3f834452e5523d10e5cc608f3209e2057b0fcbda19a 124367 ee507e0c6c7abfeeb2711af4c171ef425e928b37501fd44586c8a727a454b88d 124368 fb11bb20dffcb1e3121563c0eb9e25d03ef47466254d4eb9b2c067435a9270c8 124369 0d6d569b25b7ee943b995b5feaf7f80baabf5b13be1ae5f181b492070f26b128 124370 9f963c5813cca84f68637e1b03d15d453554aa93b5ed51f55d34a22897e6761b 124371 3a869128de0b58ba1af83555905e5909fc9c2dfbcc5757e52097316f52928fdc 124372 cc3d503c1bb033ca678eb2f349df796a59896b3a6c89fd8abf86d71638cc6712 124373 70f055ed04de621077166019b8456c7ca023f2dc0fefe2f35b6835471b9e5eb9 124374 f22b426cac7d929a80ddb04d0c4f46125e3d819a69b5da77652477e630d35b42 124375 c2f8bcf4409e0efe5b0d8ea7ab2d4984738348c7b105c37071bb52e427e3a9af 124376 83f778d44e336a0116b45e6cb38547013cb42ba7a4c9879ae2414a92ae6e126f 124377 33472e1ed18a8f4b4a81521934e4fcd73f1447360c779010d6f4fbee8081c4e2 124378 d67c041ed041fe187894060b6c46e643e0f7d06b1e297f55f252ecafcfd04b18 124379 ebd8542c77361897d0be267647d7a31f9e436d3571bd973a0a40858c8156ff01 124380 9d552b13346d9e124805281957d7abc80ee8fd60f4537acf2be8dd85bed65748 124381 ef80b92847a44f1805db6acc0930e75f36154c1523f66a2f1c6136542128d86f 124382 19463c7d180ed79801331809d550715052da039313f8c842cf0f3ea189433a7b 124383 40cf82a21bf2ac72cbde914c5e7afe97975f9f0506d78b641a5aac617ae08921 124384 42ceba6c42a0fb76aa4c3f9be713073278cc148db1511e26789b162eed4daf2c 124385 61bf44ad12cc10f2518baa3f49c48c1fcaf2550ee81bc63e948cb19678ebb5cd 124386 29b62c15c3b072e3f0ab5c63737e9023f8a35defbb1f7a8d0e5166886b1a1f7c 124387 e26118c48249d2a2fc36f14a69b3b15c406401dda30d7de06e31175dc4a35875 124388 de52131a5548934de406de5b4bdadcb2561d8b54cc1f2803383919fe266a6209 124389 300ac3b765f88a4b173c2206e558154bd8048c839621e0476d27779289a049b0 124390 58ebecc469490be97baaffd0884ba31683cbc656a4ac6882e9258263b3bd163a 124391 bfc3e52c0a5bbcad6148cbfdc4942c6960874faecbaf84a7175798a54f74705a 124392 ca7753e16aa186059d94165642d6518edf7754bbc5a8cf3dc8e564d5426fdd6e 124393 47d1a7c6184405f95caf618087bd2063326acb0402661754c5985a93b3f56110 124394 d8c66b7bdbeb4ca0d85345227b38f4a32f807ba02024ef3359bc73fc508ccdf8 124395 a94d77e653205a724d2d9122de83c31ebd4fa8fd77b3c7e57ef94ad0b9e63ac2 124396 312183af37e91340b21571812a84694e1e6f8a39779b8e049ed11af18fca2ff9 124397 e3d063b9764825435f5a480f4b3b4d09d3f05eb551c6e7fdce35cc3b8f285516 124398 5512db0d9268e276a85c0f9e9d61824e8a5ccc71b1fa7a3b3e0063b630ff0703 124399 3b2fb5fe139ef83556819e85f04664f17923ebac935f86625001bfb8dc7fded6 124400 9e011b3af724b926af20079790607737c31e1b16742419916c91ed74220c61e3 124401 392fa199f7afbe95330d8eee606ba5972c17ce4ba37741bb40a800bb04540aab 124402 11aabaacbd9a2382823f574ea37c57156dd06c39bbafe44378ff776ada3343a1 124403 65114bc1f142d2f442b955894b9d7dcc33884e78d962c537fc18e2c99462729f 124404 4a06491560a4637974267dcabb49f2db5fb3efb6db6829a2dfb17798ace1ed6b 124405 28422d3ea4285958c8b8b74b421c78ceb5b1cda99df04e08e95361959b8717f1 124406 329bc867fddbf45adafa9b5879f7f4d38d2fc935d6e9410bbef94887e017a0f9 124407 cc5252ae01c9ebd42aa20247c5054fbe8cf01d4d15cefd73798b7615c134e31a 124408 534a40639a3a3ada62aa9ec637a3a2bb690d4f71add8b39c00113d3deea1042a 124409 6c2306559534f06e42103616fde45be5757be79fa613160b4e02cca654aa5ae3 124410 c25452fefce82d16a74e53a21387343cc8f43ca713814e7d5dd139cd37b947c6 124411 980788e52ca9cc676e66c3233662299ec3b92d1b0af2a0fc0be271b5c6de978f 124412 e8e4fe1696cfa80c33493ba1140d383f15bc975a6d752c1cec446593a66948b6 124413 310ec7c52077ca2aa1ead327e707236d64ca19ed245984e5fb097af75359eba4 124414 93c60b5848116f903011a219c831ae6032cf7e742c13f70e271d6f4e0bd9c030 124415 3d8d67f66c45ccdfef1028779e998a0b7b301867ab600984cc7358814edcc31c 124416 c626b77c7dc84689cfbcc90d09cce69dfe5269cd8dc9a018063d7facce8da385 124417 e3d3b82afd37541e5bbc1f97974af49493738345229e310c39984f9fcd4f6b1d 124418 019d0e9bac1fdc9680d4615e06b67113d17b824383b61b8f7af7fd57b7029ec6 124419 6a55dd953c30bd8b19a584e708ee0de44f0d601764072332f27c38c58f7756b8 124420 60f96fc8c423b98c9c867359c3305a2297035d40bd57ede9f7e2ff8eaf3f9f4f 124421 09bb31b6237a009eac7025a80cafc3622f1e27db42344559f59003bafe12615c 124422 06336176a564ff96f7447d597e489b5798231016f00e5439b409d5a7239facce 124423 bb011ef02747ba1af094660317ae1fc3a6fd27c2ed662dd77da1c5b8736918fd 124424 83f12a20f4ddc1e9b23e2410fa5c4fc3a37993c9424c30710dae0b75aa770bf1 124425 969ad07267d7d412b5f6d2cbaaa5c787ea7d1da899d0c893c517388b352cbd5c 124426 b81b16ddd867a73e901659b304b311b199a7c949835cbc3603768fca027b935a 124427 d88adf00a7b8c3b77ee8b203efedf563ec51999679776e75bb15618f57dee9b2 124428 d85591f0453809092c75d5e5997798caeb16cd7b195e579271818be2f5ca4d96 124429 936c0e306c3c92ee30f9db8794020a3f97ac3a6ae20871b8725f175e593bb19f 124430 311cd99c71aae9ca53ac782523afef564e0e80fa4223a9f8a3c5c1a83fe4b6f3 124431 c78777741907c1b6bc35dd7530494087e0860f717df6f8f4469711e7d1e24c37 124432 6e3cd539949866442515d1332f2ea2ee16b38828b157e555353813ed43d2c526 124433 75f5e02b371ee915a71b11d760ced6c01edc6178c2b0aca533b0ccc1d7d361c2 124434 a6bd928efa878305b6e2a7865c8eb85c7342545ddfdd94d406c336ab2818ee12 124435 f1cf4da843299ec42be3f128a1da9cc720d64578b7133c7d972be8ee37fba303 124436 5c62d3b6bdea56b3674523b63f5f3823bfd37aa81edb123bde0c648c31affaa7 124437 b88fdc1904ac2d41064372aff49de686eb6765bc6fec2e73d415dba8cd44c4d9 124438 984cec3e582d417bcf9ff325939bcf6103e27606c0a218298df325eb9bc73775 124439 63314299f0c3c5564e09b51ffae7b9d1704608338b86f3619cf0418c0677fdf7 124440 8ee9df64d96253f4236c59f45b3a882aa06d466fcbd77f602b80a46a5535d63b 124441 4ea3cbbd2aa3d3d48e9a0f987274fb98d94d2bdd91fe9cc97f87ec45a11dc4e9 124442 b64b4bb2b59e1d77f62e193388afc8acd3f3cf498deb06a1b45c6b6eea24cf89 124443 684c9d073dbb309837c61da46d4478140033723fcc1c14ee165bf5b8727692f1 124444 ee05fffbbcb23d433ab1ad42306e3ab2103ba1e6601fc38643faa195683e9316 124445 497d7b0fe30d475b4d8fd58414519197180fbcbae6c05f46a22018d2cfa59b71 124446 \. -- -- Data for Name: initiators; Type: TABLE DATA; Schema: public; Owner: - -- COPY public.initiators (id, job_spec_id, type, created_at, schedule, "time", ran, address, requesters, deleted_at) FROM stdin; 1 7b6e4281dba042c28a38758a34ed06ed runlog 2019-04-08 14:11:17.521224-04 \N f \\x0000000000000000000000000000000000000000 0xEc4f6443e71c5131Ab5033e8fB46C6bCaF8b1b2B \N 2 fe3793164b664937a371fff12c5fac01 ethlog 2019-04-08 14:11:41.121886-04 \N f \\x7d0e877e7fdd362a8c5249244fbbd437a1fc3032 \N 3 f439c385b52448ccafae205e7f49f37a web 2019-04-08 14:11:53.429544-04 \N f \\x0000000000000000000000000000000000000000 \N \. -- -- Data for Name: job_runs; Type: TABLE DATA; Schema: public; Owner: - -- COPY public.job_runs (id, job_spec_id, result_id, run_request_id, status, created_at, completed_at, updated_at, initiator_id, creation_height, observed_height, overrides_id, deleted_at) FROM stdin; 33cf659338ac4af7aa431c993cd30210 7b6e4281dba042c28a38758a34ed06ed 5 1 completed 2019-04-08 14:11:21.004589-04 2019-04-08 14:11:33.023895-04 2019-04-08 14:11:33.024868-04 1 124382 124388 2 \N 29cf7ba429414c95b954f6484757aa44 fe3793164b664937a371fff12c5fac01 8 2 completed 2019-04-08 14:11:45.005121-04 2019-04-08 14:11:45.013889-04 2019-04-08 14:11:45.014862-04 2 124394 124394 7 \N 7bf368af7d3e4ee9bf7146bce7150efb f439c385b52448ccafae205e7f49f37a 13 0 completed 2019-04-08 14:11:53.545652-04 2019-04-08 14:11:59.020282-04 2019-04-08 14:11:59.02098-04 3 \N 124401 10 \N \. -- -- Data for Name: job_specs; Type: TABLE DATA; Schema: public; Owner: - -- COPY public.job_specs (id, created_at, start_at, end_at, deleted_at) FROM stdin; 7b6e4281dba042c28a38758a34ed06ed 2019-04-08 14:11:17.52048-04 \N \N \N fe3793164b664937a371fff12c5fac01 2019-04-08 14:11:41.121636-04 \N \N \N f439c385b52448ccafae205e7f49f37a 2019-04-08 14:11:53.429206-04 \N \N \N \. -- -- Data for Name: keys; Type: TABLE DATA; Schema: public; Owner: - -- COPY public.keys (address, json) FROM stdin; 0xc1e6ED650D11BBcB0b8bE72c548A0370D1F7ac79 {"address":"c1e6ed650d11bbcb0b8be72c548a0370d1f7ac79","crypto":{"cipher":"aes-128-ctr","ciphertext":"9732e18fc9b0ccd9b772bcb2632e658fa950583e9e1db4bb86ee98b0491e8a55","cipherparams":{"iv":"83ee401f5252c6fdb31e9e3f87fdfaea"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"a454ca06c8d216e015cf27a2981bd84bb7d703792365814349ac3d631fba5e5e"},"mac":"6b6748476b11e876f028cd9354b70cd116271d6c1fc305710a52e802490de01b"},"id":"af25bf97-5c99-4475-8700-8bc453c26b46","version":3} \. -- -- Data for Name: migrations; Type: TABLE DATA; Schema: public; Owner: - -- COPY public.migrations (id) FROM stdin; 0 1549496047 1551816486 1551895034 1552418531 1553029703 1554131520 \. -- -- Data for Name: run_requests; Type: TABLE DATA; Schema: public; Owner: - -- COPY public.run_requests (id, request_id, tx_hash, requester, created_at) FROM stdin; 1 0xb35b1199fdf3a4f9ee87cb71c8cd7e7857ae395d93cd19cfa9e7f704aa3fb1cd \\x9178a8fb2c92222ac6dc925bce71e76ea77a813031235846ea8923ed4ec9e1cb \\xec4f6443e71c5131ab5033e8fb46c6bcaf8b1b2b 2019-04-08 14:11:21.015264-04 2 \N \\xe7308e92f3168f6d9eef8316180f2dff85c5331adf27646415933028819fd371 \N 2019-04-08 14:11:45.005741-04 \. -- -- Data for Name: run_results; Type: TABLE DATA; Schema: public; Owner: - -- COPY public.run_results (id, cached_job_run_id, cached_task_run_id, data, status, error_message, amount) FROM stdin; 1 {"address":"0xa8fFA679D1f78D30928461D64e4c4bE92E8bDd35","dataPrefix":"0xb35b1199fdf3a4f9ee87cb71c8cd7e7857ae395d93cd19cfa9e7f704aa3fb1cd0000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000ec4f6443e71c5131ab5033e8fb46c6bcaf8b1b2b042f2b6500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005cab8ff5","functionSelector":"0x4ab0d190","msg":"hello_chainlink"} \N 1000000000000000000 2 {"address":"0xa8fFA679D1f78D30928461D64e4c4bE92E8bDd35","dataPrefix":"0xb35b1199fdf3a4f9ee87cb71c8cd7e7857ae395d93cd19cfa9e7f704aa3fb1cd0000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000ec4f6443e71c5131ab5033e8fb46c6bcaf8b1b2b042f2b6500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005cab8ff5","functionSelector":"0x4ab0d190","msg":"hello_chainlink"} \N 1000000000000000000 3 33cf659338ac4af7aa431c993cd30210 b193bdd969c94bc38ac66524acff140d {"address":"0xa8fFA679D1f78D30928461D64e4c4bE92E8bDd35","dataPrefix":"0xb35b1199fdf3a4f9ee87cb71c8cd7e7857ae395d93cd19cfa9e7f704aa3fb1cd0000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000ec4f6443e71c5131ab5033e8fb46c6bcaf8b1b2b042f2b6500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005cab8ff5","functionSelector":"0x4ab0d190","msg":"hello_chainlink"} pending_sleep \N \N 5 33cf659338ac4af7aa431c993cd30210 0f7ef39aa5c34fa1aed7f9579a3d4a92 {"address":"0xa8fFA679D1f78D30928461D64e4c4bE92E8bDd35","dataPrefix":"0xb35b1199fdf3a4f9ee87cb71c8cd7e7857ae395d93cd19cfa9e7f704aa3fb1cd0000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000ec4f6443e71c5131ab5033e8fb46c6bcaf8b1b2b042f2b6500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005cab8ff5","ethereumReceipts":[{"blockNumber":124387,"transactionHash":"0x0e7c006fb7d97cc78f3f9c6171fad8ac6acf443d9dc213f41a5c6757f26ec01d"}],"functionSelector":"0x4ab0d190","msg":"hello_chainlink","result":"0x0e7c006fb7d97cc78f3f9c6171fad8ac6acf443d9dc213f41a5c6757f26ec01d"} completed \N \N 6 {"address":"0x7d0e877e7fdd362a8c5249244fbbd437a1fc3032","topics":["0xd226ed2bc8a4081ee6d62540525cd9a44aa022eca68e344a7f7b924a75faeed5","0x68656c6c6f5f636861696e6c696e6b0000000000000000000000000000000000"],"data":"0x","blockNumber":"0x1e5ea","transactionHash":"0xe7308e92f3168f6d9eef8316180f2dff85c5331adf27646415933028819fd371","transactionIndex":"0x0","blockHash":"0x47d1a7c6184405f95caf618087bd2063326acb0402661754c5985a93b3f56110","logIndex":"0x0","removed":false} \N \N 7 {"address":"0x7d0e877e7fdd362a8c5249244fbbd437a1fc3032","topics":["0xd226ed2bc8a4081ee6d62540525cd9a44aa022eca68e344a7f7b924a75faeed5","0x68656c6c6f5f636861696e6c696e6b0000000000000000000000000000000000"],"data":"0x","blockNumber":"0x1e5ea","transactionHash":"0xe7308e92f3168f6d9eef8316180f2dff85c5331adf27646415933028819fd371","transactionIndex":"0x0","blockHash":"0x47d1a7c6184405f95caf618087bd2063326acb0402661754c5985a93b3f56110","logIndex":"0x0","removed":false} \N \N 8 29cf7ba429414c95b954f6484757aa44 cdc439fb67d847648fe04d820e3cf9e2 {"address":"0x7d0e877e7fdd362a8c5249244fbbd437a1fc3032","blockHash":"0x47d1a7c6184405f95caf618087bd2063326acb0402661754c5985a93b3f56110","blockNumber":"0x1e5ea","data":"0x","logIndex":"0x0","removed":false,"result":"{\\"headers\\":{\\"host\\":\\"127.0.0.1:6690\\",\\"user-agent\\":\\"Go-http-client/1.1\\",\\"content-length\\":\\"467\\",\\"content-type\\":\\"application/json\\"},\\"body\\":{\\"address\\":\\"0x7d0e877e7fdd362a8c5249244fbbd437a1fc3032\\",\\"blockHash\\":\\"0x47d1a7c6184405f95caf618087bd2063326acb0402661754c5985a93b3f56110\\",\\"blockNumber\\":\\"0x1e5ea\\",\\"data\\":\\"0x\\",\\"logIndex\\":\\"0x0\\",\\"removed\\":false,\\"topics\\":[\\"0xd226ed2bc8a4081ee6d62540525cd9a44aa022eca68e344a7f7b924a75faeed5\\",\\"0x68656c6c6f5f636861696e6c696e6b0000000000000000000000000000000000\\"],\\"transactionHash\\":\\"0xe7308e92f3168f6d9eef8316180f2dff85c5331adf27646415933028819fd371\\",\\"transactionIndex\\":\\"0x0\\"}}","topics":["0xd226ed2bc8a4081ee6d62540525cd9a44aa022eca68e344a7f7b924a75faeed5","0x68656c6c6f5f636861696e6c696e6b0000000000000000000000000000000000"],"transactionHash":"0xe7308e92f3168f6d9eef8316180f2dff85c5331adf27646415933028819fd371","transactionIndex":"0x0"} completed \N \N 4 33cf659338ac4af7aa431c993cd30210 b1e770326cf44891944a8f8dabf4b626 {"address":"0xa8fFA679D1f78D30928461D64e4c4bE92E8bDd35","dataPrefix":"0xb35b1199fdf3a4f9ee87cb71c8cd7e7857ae395d93cd19cfa9e7f704aa3fb1cd0000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000ec4f6443e71c5131ab5033e8fb46c6bcaf8b1b2b042f2b6500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005cab8ff5","functionSelector":"0x4ab0d190","msg":"hello_chainlink","result":"{\\"headers\\":{\\"host\\":\\"127.0.0.1:6690\\",\\"user-agent\\":\\"Go-http-client/1.1\\",\\"content-length\\":\\"450\\",\\"content-type\\":\\"application/json\\"},\\"body\\":{\\"address\\":\\"0xa8fFA679D1f78D30928461D64e4c4bE92E8bDd35\\",\\"dataPrefix\\":\\"0xb35b1199fdf3a4f9ee87cb71c8cd7e7857ae395d93cd19cfa9e7f704aa3fb1cd0000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000ec4f6443e71c5131ab5033e8fb46c6bcaf8b1b2b042f2b6500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005cab8ff5\\",\\"functionSelector\\":\\"0x4ab0d190\\",\\"msg\\":\\"hello_chainlink\\"}}"} completed \N \N 9 {} \N \N 10 {} \N \N 11 7bf368af7d3e4ee9bf7146bce7150efb de76106638224af0afb1b34a6dfb623f {"result":"{\\"last\\": \\"3843.95\\"}"} completed \N \N 12 7bf368af7d3e4ee9bf7146bce7150efb 167181e65aff4bd4939b0d2ad68fb066 {"result":"3843.95"} completed \N \N 13 7bf368af7d3e4ee9bf7146bce7150efb 54ce916133c441b596b8821a497bca64 {"ethereumReceipts":[{"blockNumber":124400,"transactionHash":"0x272820b76613a5eacef327a0505b7319b0e04024419e90b217d96ae66ac93c72"}],"result":"0x272820b76613a5eacef327a0505b7319b0e04024419e90b217d96ae66ac93c72"} completed \N \N \. -- -- Data for Name: service_agreements; Type: TABLE DATA; Schema: public; Owner: - -- COPY public.service_agreements (id, created_at, encumbrance_id, request_body, signature, job_spec_id) FROM stdin; \. -- -- Data for Name: sessions; Type: TABLE DATA; Schema: public; Owner: - -- COPY public.sessions (id, last_used, created_at) FROM stdin; 4f7a229e5f694fc58371c8ffe31b841c 2019-04-08 14:11:17.519207-04 2019-04-08 14:11:17.511328-04 e3acc2c32ea54819b7cf922c7c696cc4 2019-04-08 14:11:41.12049-04 2019-04-08 14:11:41.111321-04 f1db7ff333c34c02a390e538651b7004 2019-04-08 14:11:45.427575-04 2019-04-08 14:11:06.352503-04 2b55fcb9582d462abdf2611ea8b3563f 2019-04-08 14:11:53.670918-04 2019-04-08 14:11:50.695922-04 \. -- -- Data for Name: sync_events; Type: TABLE DATA; Schema: public; Owner: - -- COPY public.sync_events (id, created_at, updated_at, body) FROM stdin; \. -- -- Data for Name: task_runs; Type: TABLE DATA; Schema: public; Owner: - -- COPY public.task_runs (id, job_run_id, result_id, status, task_spec_id, minimum_confirmations, created_at) FROM stdin; de76106638224af0afb1b34a6dfb623f 7bf368af7d3e4ee9bf7146bce7150efb 11 completed 5 0 2019-04-08 14:11:53.548242-04 167181e65aff4bd4939b0d2ad68fb066 7bf368af7d3e4ee9bf7146bce7150efb 12 completed 6 0 2019-04-08 14:11:53.550249-04 54ce916133c441b596b8821a497bca64 7bf368af7d3e4ee9bf7146bce7150efb 13 completed 7 0 2019-04-08 14:11:53.55209-04 b193bdd969c94bc38ac66524acff140d 33cf659338ac4af7aa431c993cd30210 3 completed 1 0 2019-04-08 14:11:21.020935-04 b1e770326cf44891944a8f8dabf4b626 33cf659338ac4af7aa431c993cd30210 4 completed 2 0 2019-04-08 14:11:21.023587-04 0f7ef39aa5c34fa1aed7f9579a3d4a92 33cf659338ac4af7aa431c993cd30210 5 completed 3 0 2019-04-08 14:11:21.025124-04 cdc439fb67d847648fe04d820e3cf9e2 29cf7ba429414c95b954f6484757aa44 8 completed 4 0 2019-04-08 14:11:45.007899-04 \. -- -- Data for Name: task_specs; Type: TABLE DATA; Schema: public; Owner: - -- COPY public.task_specs (id, created_at, updated_at, deleted_at, job_spec_id, type, confirmations, params) FROM stdin; 1 2019-04-08 14:11:17.522027-04 2019-04-08 14:11:17.522027-04 \N 7b6e4281dba042c28a38758a34ed06ed sleep 0 {"until":1554747087} 2 2019-04-08 14:11:17.522784-04 2019-04-08 14:11:17.522784-04 \N 7b6e4281dba042c28a38758a34ed06ed httppost 0 {"url":"http://127.0.0.1:6690/count"} 3 2019-04-08 14:11:17.523087-04 2019-04-08 14:11:17.523087-04 \N 7b6e4281dba042c28a38758a34ed06ed ethtx 0 {"functionSelector":"fulfillOracleRequest(uint256,bytes32)"} 4 2019-04-08 14:11:41.122187-04 2019-04-08 14:11:41.122187-04 \N fe3793164b664937a371fff12c5fac01 httppost 0 {"url":"http://127.0.0.1:6690/count"} 5 2019-04-08 14:11:53.42991-04 2019-04-08 14:11:53.42991-04 \N f439c385b52448ccafae205e7f49f37a httpget 0 {"get":"http://localhost:55362"} 6 2019-04-08 14:11:53.430221-04 2019-04-08 14:11:53.430221-04 \N f439c385b52448ccafae205e7f49f37a jsonparse 0 {"path":["last"]} 7 2019-04-08 14:11:53.430557-04 2019-04-08 14:11:53.430557-04 \N f439c385b52448ccafae205e7f49f37a ethtx 0 {"address":"0xaa664fa2fdc390c662de1dbacf1218ac6e066ae6","functionSelector":"setBytes(bytes32,bytes)"} \. -- -- Data for Name: tx_attempts; Type: TABLE DATA; Schema: public; Owner: - -- COPY public.tx_attempts (hash, tx_id, gas_price, confirmed, hex, sent_at, created_at) FROM stdin; \\x0e7c006fb7d97cc78f3f9c6171fad8ac6acf443d9dc213f41a5c6757f26ec01d 1 20000000000 t 0xf9012c808504a817c8008307a12094a8ffa679d1f78d30928461d64e4c4be92e8bdd3580b8c44ab0d190b35b1199fdf3a4f9ee87cb71c8cd7e7857ae395d93cd19cfa9e7f704aa3fb1cd0000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000ec4f6443e71c5131ab5033e8fb46c6bcaf8b1b2b042f2b6500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005cab8ff50000000000000000000000000000000000000000000000000000000000000000820a96a0f99f220704644beb6ea89dc6a4a500319b466e22b5ea2024b10984bc45824fe2a0766948d3c4071b3c82b8c4c86adc07eec6cd02938022cbeb94e69292c21eb58d 124385 2019-04-08 14:11:27.038954-04 \\x272820b76613a5eacef327a0505b7319b0e04024419e90b217d96ae66ac93c72 2 20000000000 t 0xf88b018504a817c8008307a12094aa664fa2fdc390c662de1dbacf1218ac6e066ae680a42e28d0840000000000000000000000000000000000000000000000000000000000000384820a95a005515856466c4593d6bedf806bdde5927113d71dff45ecea79fccbdca667a02da02ea620c566c0b031df93d0e0bf3f12b1a78352e472bbdc3ac619559f456cd6fc 124398 2019-04-08 14:11:53.573541-04 \. -- -- Data for Name: txes; Type: TABLE DATA; Schema: public; Owner: - -- COPY public.txes (id, "from", "to", data, nonce, value, gas_limit, hash, gas_price, confirmed, hex, sent_at) FROM stdin; 1 \\xc1e6ed650d11bbcb0b8be72c548a0370d1f7ac79 \\xa8ffa679d1f78d30928461d64e4c4be92e8bdd35 \\x4ab0d190b35b1199fdf3a4f9ee87cb71c8cd7e7857ae395d93cd19cfa9e7f704aa3fb1cd0000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000ec4f6443e71c5131ab5033e8fb46c6bcaf8b1b2b042f2b6500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005cab8ff50000000000000000000000000000000000000000000000000000000000000000 0 0 500000 \\x0e7c006fb7d97cc78f3f9c6171fad8ac6acf443d9dc213f41a5c6757f26ec01d 20000000000 t 0xf9012c808504a817c8008307a12094a8ffa679d1f78d30928461d64e4c4be92e8bdd3580b8c44ab0d190b35b1199fdf3a4f9ee87cb71c8cd7e7857ae395d93cd19cfa9e7f704aa3fb1cd0000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000ec4f6443e71c5131ab5033e8fb46c6bcaf8b1b2b042f2b6500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005cab8ff50000000000000000000000000000000000000000000000000000000000000000820a96a0f99f220704644beb6ea89dc6a4a500319b466e22b5ea2024b10984bc45824fe2a0766948d3c4071b3c82b8c4c86adc07eec6cd02938022cbeb94e69292c21eb58d 124385 2 \\xc1e6ed650d11bbcb0b8be72c548a0370d1f7ac79 \\xaa664fa2fdc390c662de1dbacf1218ac6e066ae6 \\x2e28d0840000000000000000000000000000000000000000000000000000000000000384 1 0 500000 \\x272820b76613a5eacef327a0505b7319b0e04024419e90b217d96ae66ac93c72 20000000000 t 0xf88b018504a817c8008307a12094aa664fa2fdc390c662de1dbacf1218ac6e066ae680a42e28d0840000000000000000000000000000000000000000000000000000000000000384820a95a005515856466c4593d6bedf806bdde5927113d71dff45ecea79fccbdca667a02da02ea620c566c0b031df93d0e0bf3f12b1a78352e472bbdc3ac619559f456cd6fc 124398 \. -- -- Data for Name: users; Type: TABLE DATA; Schema: public; Owner: - -- COPY public.users (email, hashed_password, created_at) FROM stdin; notreal@fakeemail.ch $2a$10$qVUatuT8/dVsieoIgH/vmux9nT2nhUWxujEwfq1AwRGMIOPr5XdJW 2019-04-08 14:10:45.04635-04 \. -- -- Name: encumbrances_id_seq; Type: SEQUENCE SET; Schema: public; Owner: - -- SELECT pg_catalog.setval('public.encumbrances_id_seq', 1, false); -- -- Name: initiators_id_seq; Type: SEQUENCE SET; Schema: public; Owner: - -- SELECT pg_catalog.setval('public.initiators_id_seq', 3, true); -- -- Name: run_requests_id_seq; Type: SEQUENCE SET; Schema: public; Owner: - -- SELECT pg_catalog.setval('public.run_requests_id_seq', 2, true); -- -- Name: run_results_id_seq; Type: SEQUENCE SET; Schema: public; Owner: - -- SELECT pg_catalog.setval('public.run_results_id_seq', 13, true); -- -- Name: sync_events_id_seq; Type: SEQUENCE SET; Schema: public; Owner: - -- SELECT pg_catalog.setval('public.sync_events_id_seq', 1, false); -- -- Name: task_specs_id_seq; Type: SEQUENCE SET; Schema: public; Owner: - -- SELECT pg_catalog.setval('public.task_specs_id_seq', 7, true); -- -- Name: txes_id_seq; Type: SEQUENCE SET; Schema: public; Owner: - -- SELECT pg_catalog.setval('public.txes_id_seq', 2, true); -- -- Name: bridge_types bridge_types_with_pk_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.bridge_types ADD CONSTRAINT bridge_types_with_pk_pkey PRIMARY KEY (name); -- -- Name: encumbrances encumbrances_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.encumbrances ADD CONSTRAINT encumbrances_pkey PRIMARY KEY (id); -- -- Name: heads heads_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.heads ADD CONSTRAINT heads_pkey PRIMARY KEY (hash); -- -- Name: initiators initiators_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.initiators ADD CONSTRAINT initiators_pkey PRIMARY KEY (id); -- -- Name: job_runs job_runs_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.job_runs ADD CONSTRAINT job_runs_pkey PRIMARY KEY (id); -- -- Name: job_specs job_specs_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.job_specs ADD CONSTRAINT job_specs_pkey PRIMARY KEY (id); -- -- Name: keys keys_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.keys ADD CONSTRAINT keys_pkey PRIMARY KEY (address); -- -- Name: migrations migrations_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.migrations ADD CONSTRAINT migrations_pkey PRIMARY KEY (id); -- -- Name: run_requests run_requests_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.run_requests ADD CONSTRAINT run_requests_pkey PRIMARY KEY (id); -- -- Name: run_results run_results_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.run_results ADD CONSTRAINT run_results_pkey PRIMARY KEY (id); -- -- Name: service_agreements service_agreements_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.service_agreements ADD CONSTRAINT service_agreements_pkey PRIMARY KEY (id); -- -- Name: sessions sessions_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.sessions ADD CONSTRAINT sessions_pkey PRIMARY KEY (id); -- -- Name: sync_events sync_events_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.sync_events ADD CONSTRAINT sync_events_pkey PRIMARY KEY (id); -- -- Name: task_runs task_runs_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.task_runs ADD CONSTRAINT task_runs_pkey PRIMARY KEY (id); -- -- Name: task_specs task_specs_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.task_specs ADD CONSTRAINT task_specs_pkey PRIMARY KEY (id); -- -- Name: tx_attempts tx_attempts_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.tx_attempts ADD CONSTRAINT tx_attempts_pkey PRIMARY KEY (hash); -- -- Name: txes txes_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.txes ADD CONSTRAINT txes_pkey PRIMARY KEY (id); -- -- Name: users users_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.users ADD CONSTRAINT users_pkey PRIMARY KEY (email); -- -- Name: idx_heads_number; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX idx_heads_number ON public.heads USING btree (number); -- -- Name: idx_initiators_address; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX idx_initiators_address ON public.initiators USING btree (address); -- -- Name: idx_initiators_created_at; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX idx_initiators_created_at ON public.initiators USING btree (created_at); -- -- Name: idx_initiators_deleted_at; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX idx_initiators_deleted_at ON public.initiators USING btree (deleted_at); -- -- Name: idx_initiators_job_spec_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX idx_initiators_job_spec_id ON public.initiators USING btree (job_spec_id); -- -- Name: idx_initiators_type; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX idx_initiators_type ON public.initiators USING btree (type); -- -- Name: idx_job_runs_created_at; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX idx_job_runs_created_at ON public.job_runs USING btree (created_at); -- -- Name: idx_job_runs_deleted_at; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX idx_job_runs_deleted_at ON public.job_runs USING btree (deleted_at); -- -- Name: idx_job_runs_job_spec_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX idx_job_runs_job_spec_id ON public.job_runs USING btree (job_spec_id); -- -- Name: idx_job_runs_status; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX idx_job_runs_status ON public.job_runs USING btree (status); -- -- Name: idx_job_specs_created_at; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX idx_job_specs_created_at ON public.job_specs USING btree (created_at); -- -- Name: idx_job_specs_deleted_at; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX idx_job_specs_deleted_at ON public.job_specs USING btree (deleted_at); -- -- Name: idx_job_specs_end_at; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX idx_job_specs_end_at ON public.job_specs USING btree (end_at); -- -- Name: idx_job_specs_start_at; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX idx_job_specs_start_at ON public.job_specs USING btree (start_at); -- -- Name: idx_service_agreements_created_at; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX idx_service_agreements_created_at ON public.service_agreements USING btree (created_at); -- -- Name: idx_service_agreements_job_spec_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX idx_service_agreements_job_spec_id ON public.service_agreements USING btree (job_spec_id); -- -- Name: idx_sessions_created_at; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX idx_sessions_created_at ON public.sessions USING btree (created_at); -- -- Name: idx_sessions_last_used; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX idx_sessions_last_used ON public.sessions USING btree (last_used); -- -- Name: idx_task_runs_created_at; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX idx_task_runs_created_at ON public.task_runs USING btree (created_at); -- -- Name: idx_task_runs_job_run_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX idx_task_runs_job_run_id ON public.task_runs USING btree (job_run_id); -- -- Name: idx_task_runs_task_spec_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX idx_task_runs_task_spec_id ON public.task_runs USING btree (task_spec_id); -- -- Name: idx_task_specs_deleted_at; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX idx_task_specs_deleted_at ON public.task_specs USING btree (deleted_at); -- -- Name: idx_task_specs_job_spec_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX idx_task_specs_job_spec_id ON public.task_specs USING btree (job_spec_id); -- -- Name: idx_task_specs_type; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX idx_task_specs_type ON public.task_specs USING btree (type); -- -- Name: idx_tx_attempts_created_at; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX idx_tx_attempts_created_at ON public.tx_attempts USING btree (created_at); -- -- Name: idx_tx_attempts_tx_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX idx_tx_attempts_tx_id ON public.tx_attempts USING btree (tx_id); -- -- Name: idx_txes_from; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX idx_txes_from ON public.txes USING btree ("from"); -- -- Name: idx_txes_nonce; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX idx_txes_nonce ON public.txes USING btree (nonce); -- -- Name: idx_users_created_at; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX idx_users_created_at ON public.users USING btree (created_at); -- -- Name: initiators initiators_job_spec_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.initiators ADD CONSTRAINT initiators_job_spec_id_fkey FOREIGN KEY (job_spec_id) REFERENCES public.job_specs(id); -- -- Name: job_runs job_runs_job_spec_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.job_runs ADD CONSTRAINT job_runs_job_spec_id_fkey FOREIGN KEY (job_spec_id) REFERENCES public.job_specs(id); -- -- Name: service_agreements service_agreements_job_spec_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.service_agreements ADD CONSTRAINT service_agreements_job_spec_id_fkey FOREIGN KEY (job_spec_id) REFERENCES public.job_specs(id); -- -- Name: task_runs task_runs_job_run_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.task_runs ADD CONSTRAINT task_runs_job_run_id_fkey FOREIGN KEY (job_run_id) REFERENCES public.job_runs(id) ON DELETE CASCADE; -- -- Name: task_specs task_specs_job_spec_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.task_specs ADD CONSTRAINT task_specs_job_spec_id_fkey FOREIGN KEY (job_spec_id) REFERENCES public.job_specs(id); -- -- PostgreSQL database dump complete --
35.809483
1,278
0.805751
da42bcb9a0f12670422e6668bd4ea68e131a55d3
1,724
php
PHP
apps/Backoffice/src/RPGIdleGame/Character/Controller/CharactersListController.php
Kishlin/RPGIdleGame
c332d8327e1b80d4f57f6468650d7c061993caf1
[ "MIT" ]
1
2022-02-01T14:41:21.000Z
2022-02-01T14:41:21.000Z
apps/Backoffice/src/RPGIdleGame/Character/Controller/CharactersListController.php
Kishlin/RPGIdleGame
c332d8327e1b80d4f57f6468650d7c061993caf1
[ "MIT" ]
null
null
null
apps/Backoffice/src/RPGIdleGame/Character/Controller/CharactersListController.php
Kishlin/RPGIdleGame
c332d8327e1b80d4f57f6468650d7c061993caf1
[ "MIT" ]
1
2022-03-09T01:49:41.000Z
2022-03-09T01:49:41.000Z
<?php declare(strict_types=1); namespace Kishlin\Apps\Backoffice\RPGIdleGame\Character\Controller; use Doctrine\ORM\EntityManagerInterface; use Exception; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; #[Route('/all', name: 'characters_all', methods: [Request::METHOD_GET])] final class CharactersListController extends AbstractController { public const CHARACTERS_QUERY = <<<'SQL' SELECT characters.name, characters.skill_points, characters.rank, characters.fights_count, characters.wins_count, characters.draws_count, characters.losses_count, accounts.username as owner FROM characters LEFT JOIN accounts ON characters.owner = accounts.id SQL; public function __construct( private EntityManagerInterface $entityManager, ) { } /** * @throws Exception */ public function __invoke(Request $request): Response { $query = self::CHARACTERS_QUERY; if ( $request->query->has('order') && $request->query->has('dir') && in_array($request->query->get('dir'), ['ASC', 'DESC'], true) && in_array($request->query->get('order'), ['skill_points', 'rank', 'fights_count'], true) ) { $query .= ' ORDER BY ' . $request->query->get('order') . ' ' . $request->query->get('dir'); } $characters = $this->entityManager->getConnection()->fetchAllAssociative($query); assert(false !== $characters); return $this->render('pages/characters/all.html.twig', [ 'characters' => $characters, ]); } }
33.153846
189
0.672854
23d11b18a6fc8d72235be94a32150e3cc3a3911c
144
js
JavaScript
test/integration/env-config-errors/app/pages/api/hello.js
IAmMorrow/next.js
d9cede8e272a04a2ad7bd29346f910fc88ec1826
[ "MIT" ]
26
2020-03-03T22:32:27.000Z
2022-01-02T12:16:38.000Z
test/integration/env-config-errors/app/pages/api/hello.js
IAmMorrow/next.js
d9cede8e272a04a2ad7bd29346f910fc88ec1826
[ "MIT" ]
2
2020-03-07T01:37:49.000Z
2020-03-07T01:38:01.000Z
test/integration/env-config-errors/app/pages/api/hello.js
IAmMorrow/next.js
d9cede8e272a04a2ad7bd29346f910fc88ec1826
[ "MIT" ]
3
2020-03-06T20:10:21.000Z
2020-12-01T22:56:28.000Z
export const config = { env: ['NOTION_KEY', 'SENTRY_DSN', 'DATABASE_KEY', 'DATABASE_USER'], } export default (req, res) => res.json(req.env)
24
69
0.673611
0db940f145ae517e4c433f0be5bdbf5b0bdbe2f2
6,474
cs
C#
src/NServiceBus.Core/Licensing/LicenseLocationConventions.cs
marinkobabic/NServiceBus
7e7c5f6b31399ffba847702c5e9397f3577283c4
[ "Apache-2.0", "MIT" ]
1
2015-01-12T12:39:29.000Z
2015-01-12T12:39:29.000Z
src/NServiceBus.Core/Licensing/LicenseLocationConventions.cs
marinkobabic/NServiceBus
7e7c5f6b31399ffba847702c5e9397f3577283c4
[ "Apache-2.0", "MIT" ]
null
null
null
src/NServiceBus.Core/Licensing/LicenseLocationConventions.cs
marinkobabic/NServiceBus
7e7c5f6b31399ffba847702c5e9397f3577283c4
[ "Apache-2.0", "MIT" ]
null
null
null
namespace NServiceBus.Licensing { using System; using System.Configuration; using System.IO; using Logging; using Microsoft.Win32; static class LicenseLocationConventions { static ILog Logger = LogManager.GetLogger(typeof(LicenseLocationConventions)); public static string TryFindLicenseText() { var appConfigLicenseString = ConfigurationManager.AppSettings["NServiceBus/License"]; if (!String.IsNullOrEmpty(appConfigLicenseString)) { Logger.Info(@"Using embedded license supplied via config file AppSettings/NServiceBus/License."); return appConfigLicenseString; } var appConfigLicenseFile = ConfigurationManager.AppSettings["NServiceBus/LicensePath"]; if (!String.IsNullOrEmpty(appConfigLicenseFile)) { if (File.Exists(appConfigLicenseFile)) { Logger.InfoFormat(@"Using license supplied via config file AppSettings/NServiceBus/LicensePath ({0}).", appConfigLicenseFile); return NonLockingFileReader.ReadAllTextWithoutLocking(appConfigLicenseFile); } //TODO: should we throw if file does not exist? throw new Exception(string.Format("You have a configured licensing via AppConfigLicenseFile to use the file at '{0}'. However this file does not exist. Either place a valid license at this location or remove the app setting.", appConfigLicenseFile)); } var localLicenseFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"NServiceBus\License.xml"); if (File.Exists(localLicenseFile)) { Logger.InfoFormat(@"Using license in current folder ({0}).", localLicenseFile); return NonLockingFileReader.ReadAllTextWithoutLocking(localLicenseFile); } var oldLocalLicenseFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"License\License.xml"); if (File.Exists(oldLocalLicenseFile)) { Logger.InfoFormat(@"Using license in current folder ({0}).", oldLocalLicenseFile); return NonLockingFileReader.ReadAllTextWithoutLocking(oldLocalLicenseFile); } var registryLicense = LoadLicenseFromRegistry(); if (!String.IsNullOrEmpty(registryLicense)) { return registryLicense; } registryLicense = LoadLicenseFromPreviousRegistryLocation("4.3"); if (!String.IsNullOrEmpty(registryLicense)) { return registryLicense; } registryLicense = LoadLicenseFromPreviousRegistryLocation("4.2"); if (!String.IsNullOrEmpty(registryLicense)) { return registryLicense; } registryLicense = LoadLicenseFromPreviousRegistryLocation("4.1"); if (!String.IsNullOrEmpty(registryLicense)) { return registryLicense; } registryLicense = LoadLicenseFromPreviousRegistryLocation("4.0"); if (!String.IsNullOrEmpty(registryLicense)) { return registryLicense; } return null; } static string LoadLicenseFromRegistry() { var hkcuLicense = GetHKCULicense(@"ParticularSoftware\NServiceBus"); if (!String.IsNullOrEmpty(hkcuLicense)) { Logger.Info(@"Using embedded license found in registry [HKEY_CURRENT_USER\Software\ParticularSoftware\NServiceBus\License]."); return hkcuLicense; } var hklmLicense = GetHKLMLicense(@"ParticularSoftware\NServiceBus"); if (!String.IsNullOrEmpty(hklmLicense)) { Logger.Info(@"Using embedded license found in registry [HKEY_LOCAL_MACHINE\Software\ParticularSoftware\NServiceBus\License]."); return hklmLicense; } return null; } static string LoadLicenseFromPreviousRegistryLocation(string version) { var hkcuLicense = GetHKCULicense(subKey: version); if (!String.IsNullOrEmpty(hkcuLicense)) { Logger.InfoFormat(@"Using embedded license found in registry [HKEY_CURRENT_USER\Software\NServiceBus\{0}\License].", version); return hkcuLicense; } var hklmLicense = GetHKLMLicense(subKey: version); if (!String.IsNullOrEmpty(hklmLicense)) { Logger.InfoFormat(@"Using embedded license found in registry [HKEY_LOCAL_MACHINE\Software\NServiceBus\{0}\License].", version); return hklmLicense; } return null; } static string GetHKCULicense(string softwareKey = "NServiceBus", string subKey = null) { var keyPath = @"SOFTWARE\" + softwareKey; if (subKey != null) { keyPath += @"\" + subKey; } using (var registryKey = Registry.CurrentUser.OpenSubKey(keyPath)) { if (registryKey != null) { return (string) registryKey.GetValue("License", null); } } return null; } static string GetHKLMLicense(string softwareKey = "NServiceBus", string subKey = null) { var keyPath = @"SOFTWARE\" + softwareKey; if (subKey != null) { keyPath += @"\" + subKey; } try { using (var registryKey = Registry.LocalMachine.OpenSubKey(keyPath)) { if (registryKey != null) { return (string) registryKey.GetValue("License", null); } } } // ReSharper disable once EmptyGeneralCatchClause catch (Exception) { //Swallow exception if we can't read HKLM } return null; } } }
37.859649
267
0.555916
444832e9d47e0322e82209351c24fb055aa09699
12,537
py
Python
wear_color_glasses.py
keyurr2/virtual-tryon
0670c82b4f01ce8eb41bc8efff56e0f172fc2910
[ "MIT" ]
null
null
null
wear_color_glasses.py
keyurr2/virtual-tryon
0670c82b4f01ce8eb41bc8efff56e0f172fc2910
[ "MIT" ]
1
2019-04-05T09:22:55.000Z
2019-09-09T09:38:26.000Z
wear_color_glasses.py
keyurr2/virtual-try-on
0670c82b4f01ce8eb41bc8efff56e0f172fc2910
[ "MIT" ]
null
null
null
""" Created on Thu Dec 13 17:15:47 2018 @author: keyur-r Gui application to try different color goggles on your eyes [Using Eye Detection] """ import numpy as np import cv2 from PIL import Image, ImageTk import time import tkinter as tk from tkinter.colorchooser import * import dlib from imutils import face_utils, video class MyCameraApp(): def __init__(self): # initialize hog + svm based face detector self.face_detector = dlib.get_frontal_face_detector() # landmark predictor self.predictor = dlib.shape_predictor( "./shape_predictor_68_face_landmarks.dat") self.glass_color = None self.frame_color = None self.side_color = None self.prev_glass_color = None self.prev_frame_color = None self.prev_side_color = None self.root = tk.Tk() self.l_eye = self.r_eye = None self.glass_line_pt1 = self.glass_line_pt2 = None self.cam = video.VideoStream(src=0).start() def start_camera_app(self): ''' Start camera app by building gui interface and starting tkinter eventloop ''' self._create_interface() self.root.after(0, func=lambda: self.update_all()) self.root.mainloop() def _from_rgb(self, rgb): ''' translates an rgb tuple to a int tkinter friendly color code ''' return "#%02x%02x%02x" % tuple(map(int, rgb))[::-1] def _create_interface(self): ''' Creating image display window and buttons on ''' self.root.title("Try it Before you WEAR it ...") self.image_label = tk.Label(master=self.root, text="OpenCV") # label for the video frame self.image_label.pack() tk.Label(self.root, text="CHOOSE COLOR FROM BELOW", fg="light green", bg="#495647", font="Helvetica 16 bold italic").pack(fill="both") self.quit_button = tk.Button(master=self.root, text='Quit', command=self._quit, bg='#BA5843', width=10, height=2) self.quit_button.pack(fill="both", side=tk.RIGHT) self.change_glass_btn = tk.Button(master=self.root, text='CHANGE GLASS', command=self._change_glass_color, bg='#55BA43') self.change_glass_btn.pack(fill="both", side=tk.LEFT) self.change_frame_btn = tk.Button(master=self.root, text='CHANGE FRAME', command=self._change_frame_color, bg='#D2691E') self.change_frame_btn.pack(fill="both", side=tk.LEFT) self.change_sideframe_btn = tk.Button(master=self.root, text='CHANGE SIDEVIEW', command=self._change_side_color, bg='#7B68EE') self.change_sideframe_btn.pack(fill="both", side=tk.LEFT) self.clear_effect = tk.Button(master=self.root, text='CLEAR', command=self._clear_effect, bg='#BDB76B', width=10) self.clear_effect.pack(fill="both", side=tk.RIGHT) def _clear_effect(self): ''' Removing the effect ''' self.glass_color = self.prev_glass_color = None self.change_glass_btn.config(bg='#55BA43') self.change_frame_btn.config(bg='#D2691E') self.change_sideframe_btn.config(bg='#7B68EE') self.root.update() def _change_side_color(self): ''' Changing the side color of frame ''' self.prev_side_color = self.side_color side_color = askcolor() self.side_color = side_color[0][::-1] if side_color[0] else self.prev_side_color if self.side_color: self.change_sideframe_btn.config(bg=self._from_rgb(self.side_color)) self.root.update() def _change_glass_color(self): ''' Changing the color of glasses ''' self.prev_glass_color = self.glass_color glass_color = askcolor() self.glass_color = glass_color[0][::-1] if glass_color[0] else self.prev_glass_color if self.glass_color: self.change_glass_btn.config(bg=self._from_rgb(self.glass_color)) self.root.update() def _change_frame_color(self): ''' Changing the rounded frame color ''' self.prev_frame_color = self.frame_color frame_color = askcolor() self.frame_color = frame_color[0][::-1] if frame_color[0] else self.prev_frame_color if self.frame_color: self.change_frame_btn.config(bg=self._from_rgb(self.frame_color)) self.root.update() def _find_offset(self, shape): ''' This is where magic happens. We are finding offsets to add in eye landmarks found by 68 points landmarks model. We are using this offset to create 10 points from eye's six landmarks for each eye ''' return ((shape[39] - shape[36]) / 2).astype('int')[0], ((shape[45] - shape[42]) / 2).astype('int')[0] def fill_glasses(self, image, shape): ''' Drawing glass ellipse fitting to all calculated pts and filling it. ''' left_offset, right_offset = self._find_offset(shape) EyeEllipse = EyePoints(shape, left_offset, right_offset) self.left_ellipse, self.right_ellipse = EyeEllipse.find_eye_points() self.l_eye, self.r_eye = cv2.fitEllipse( self.left_ellipse), cv2.fitEllipse(self.right_ellipse) self.glass_line_pt1, self.glass_line_pt2 = EyeEllipse._frame_line() self.glass_leftside_line, self.glass_rightside_line = EyeEllipse._frame_side_line() cv2.ellipse(image, self.l_eye, self.glass_color, -1) cv2.ellipse(image, self.r_eye, self.glass_color, -1) return image def draw_frame(self, image): ''' Drawing glass frame ''' if self.frame_color: self.left_ellipse_half, self.right_ellipse_half = self.left_ellipse[ :6], self.right_ellipse[:6] self.left_ellipse_half, self.right_ellipse_half = self.left_ellipse_half.astype( np.int32), self.right_ellipse_half.astype(np.int32) self.left_ellipse_half, self.right_ellipse_half = self.left_ellipse_half.reshape( (-1, 1, 2)), self.right_ellipse_half.reshape((-1, 1, 2)) cv2.polylines(image, [self.left_ellipse_half, self.right_ellipse_half], False, self.frame_color, 2, cv2.LINE_AA) cv2.polylines(image, [self.left_ellipse_half[1:5], self.right_ellipse_half[1:5]], False, self.frame_color, 4, cv2.LINE_AA) return image def draw_side_frame(self, image_copy): ''' Side frame for glasses ''' if self.side_color: # side lines cv2.line(image_copy, self.glass_leftside_line[0], self.glass_leftside_line[1], self.side_color, 3) cv2.line(image_copy, self.glass_rightside_line[0], self.glass_rightside_line[1], self.side_color, 3) return image_copy def face_detection(self, image): ''' Face detection and facial landmarks points ''' image_copy = image.copy() gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) faces_hog = self.face_detector(gray, 0) for (i, face) in enumerate(faces_hog): # Finding points for rectangle to draw on face x, y, w, h = face.left(), face.top(), face.width(), face.height() # Make the prediction and transfom it to numpy array shape = self.predictor(gray, face) shape = face_utils.shape_to_np(shape) image = self.fill_glasses(image, shape) image = self.draw_frame(image) image_copy = self.draw_side_frame(image_copy) alpha = 0.5 cv2.addWeighted(image, alpha, image_copy, 1 - alpha, 0, image_copy) # middle line for glasses cv2.line(image_copy, self.glass_line_pt1, self.glass_line_pt2, self.glass_color[::-1], 2) return image_copy def update_image(self): f = self.cam.read() if not self.glass_color: rgb_img = cv2.cvtColor(f, cv2.COLOR_BGR2RGB) a = Image.fromarray(rgb_img) b = ImageTk.PhotoImage(image=a) self.image_label.configure(image=b) self.image_label._image_cache = b # avoid garbage collection else: image = self.face_detection(f) rgb_img = cv2.cvtColor(image, cv2.COLOR_BGR2RGBA) a = Image.fromarray(rgb_img) b = ImageTk.PhotoImage(image=a) self.image_label.configure(image=b) self.image_label._image_cache = b # avoid garbage collection self.root.update() def update_all(self): self.update_image() self.root.after(10, func=lambda: self.update_all()) def _quit(self): self.root.destroy() class EyePoints(): ''' This is the main class which will calculate the points to make a eye glasses. 1. First find eye facial landmarks (from 36 to 48 for both eyes) 2. Calculate offset 3. Calculate 10 drawing pts for each eye for fitting eyes glasses (So we will get 20 pts for both eyes by below calculation) 4. Calculate 2 drawing pts for middle line joining the glasses. 5. Calculate 4 drawing pts for side line joining the glasses to face (2 for each eye). ''' def __init__(self, shape, left_offset, right_offset): self.shape = shape self.left_offset = left_offset self.right_offset = right_offset self.left_eye_raw_pts = self.shape[36:42] self.right_eye_raw_pts = self.shape[42:48] self.left_eye_pts = [] self.right_eye_pts = [] def _left_eye(self): pts1 = self.left_eye_raw_pts[0] - (self.left_offset, 0) pts2 = self.left_eye_raw_pts[0] - (0, self.left_offset) pts3 = self.left_eye_raw_pts[1] - (0, self.left_offset) pts4 = self.left_eye_raw_pts[2] - (0, self.left_offset) pts5 = self.left_eye_raw_pts[3] - (0, self.left_offset) pts6 = self.left_eye_raw_pts[3] + (self.left_offset, 0) pts7 = self.left_eye_raw_pts[3] + (0, self.left_offset) pts8 = self.left_eye_raw_pts[4] + (0, int(self.left_offset * 1.8)) pts9 = self.left_eye_raw_pts[5] + (0, int(self.left_offset * 1.8)) pts10 = self.left_eye_raw_pts[0] + (0, self.left_offset) self.left_eye_pts.extend([pts1, pts2, pts3, pts4, pts5, pts6, pts7, pts8, pts9, pts10]) def _right_eye(self): pts1 = self.right_eye_raw_pts[0] - (self.right_offset, 0) pts2 = self.right_eye_raw_pts[0] - (0, self.right_offset) pts3 = self.right_eye_raw_pts[1] - (0, self.right_offset) pts4 = self.right_eye_raw_pts[2] - (0, self.right_offset) pts5 = self.right_eye_raw_pts[3] - (0, self.right_offset) pts6 = self.right_eye_raw_pts[3] + (self.right_offset, 0) pts7 = self.right_eye_raw_pts[3] + (0, self.right_offset) pts8 = self.right_eye_raw_pts[4] + (0, int(self.right_offset * 1.8)) pts9 = self.right_eye_raw_pts[5] + (0, int(self.right_offset * 1.8)) pts10 = self.right_eye_raw_pts[0] + (0, self.right_offset) self.right_eye_pts.extend([pts1, pts2, pts3, pts4, pts5, pts6, pts7, pts8, pts9, pts10]) def _frame_line(self): ''' Calculation of pts for frame middle line ''' pt1 = self.left_eye_raw_pts[3] + (self.left_offset, 0) pt2 = self.right_eye_raw_pts[0] - (self.left_offset, 0) return tuple(pt1), tuple(pt2) def _frame_side_line(self): ''' Calculation of pts for frame side lines ''' pt1 = self.left_eye_raw_pts[0] - (self.left_offset, 0) pt2 = self.shape[0] left_side_pts = (tuple(pt1), tuple(pt2)) pt3 = self.right_eye_raw_pts[3] + (self.right_offset, 0) pt4 = self.shape[16] right_side_pts = (tuple(pt3), tuple(pt4)) return left_side_pts, right_side_pts def find_eye_points(self): ''' Returning calculated eye points ''' self._left_eye() self._right_eye() return np.array(self.left_eye_pts), np.array(self.right_eye_pts) CameraApp = MyCameraApp() CameraApp.start_camera_app()
39.424528
132
0.616575
7f41e3f1da05ecfad1240d2d209346962cfd1f39
416
php
PHP
src/Facades/Apmprovinsi.php
indralaksmana/modul-apmprovinsi-satudata
417e22faf1d060c6da5d6ababf43eb812ccf8a4a
[ "MIT" ]
null
null
null
src/Facades/Apmprovinsi.php
indralaksmana/modul-apmprovinsi-satudata
417e22faf1d060c6da5d6ababf43eb812ccf8a4a
[ "MIT" ]
null
null
null
src/Facades/Apmprovinsi.php
indralaksmana/modul-apmprovinsi-satudata
417e22faf1d060c6da5d6ababf43eb812ccf8a4a
[ "MIT" ]
null
null
null
<?php namespace Satudata\Apmprovinsi\Facades; use Illuminate\Support\Facades\Facade; /** * The Apmprovinsi facade. * * @package Satudata\Apmprovinsi * @author MKI <info@mkitech.net> */ class Apmprovinsi extends Facade { /** * Get the registered name of the component. * * @return string */ protected static function getFacadeAccessor() { return 'apmprovinsi'; } }
18.086957
49
0.653846
8de529ef4df642ede2a6c2803d80bbca09eed6d1
644
js
JavaScript
test/transform.test.js
KapMug/generator-feathers
2f9ac34c6d3d8ca27ccaf2d29c4061d5365d053e
[ "MIT" ]
null
null
null
test/transform.test.js
KapMug/generator-feathers
2f9ac34c6d3d8ca27ccaf2d29c4061d5365d053e
[ "MIT" ]
null
null
null
test/transform.test.js
KapMug/generator-feathers
2f9ac34c6d3d8ca27ccaf2d29c4061d5365d053e
[ "MIT" ]
null
null
null
'use strict'; const assert = require('assert'); const j = require('../lib/transform'); describe('transforms', () => { it('findConfigure', () => { const code = ` const feathers = require('feathers'); const app = feathers(); app.configure(thing); app.configure(authentication); `; const result = j(code).findConfigure('authentication').insertBefore('app.configure(muhkuh);').toSource(); assert.equal(result, ` const feathers = require('feathers'); const app = feathers(); app.configure(thing); app.configure(muhkuh); app.configure(authentication); `); }); });
21.466667
109
0.60559
79d1695f0880888bfa1b3a0bc371f3cedf1fcb9a
2,932
php
PHP
database/seeds/TiposTelTableSeeder.php
isbrqu/guia-telefonica
e8432d180d910ba974acc48ca64f8e357e741eff
[ "MIT" ]
null
null
null
database/seeds/TiposTelTableSeeder.php
isbrqu/guia-telefonica
e8432d180d910ba974acc48ca64f8e357e741eff
[ "MIT" ]
null
null
null
database/seeds/TiposTelTableSeeder.php
isbrqu/guia-telefonica
e8432d180d910ba974acc48ca64f8e357e741eff
[ "MIT" ]
null
null
null
<?php use Illuminate\Database\Seeder; use GuiaTelefonica\TipoTel; class TiposTelTableSeeder extends Seeder { /** * Run the database seeds. * * @return void */ public function run() { // CCO TipoTel::create([ 'id' => 1, 'tipo'=> 'CCO', 'descripcion' => 'Descripcion CCO', 'campos' => 'usuarios;Usuarios, sector;Sector, lugar;Lugar, interno;Interno', ]); // Celular TipoTel::create([ 'id' => 2, 'tipo'=> 'Celular', 'descripcion' => 'Descripcion celulares', 'campos' => 'usuarios;Usuarios, sector;Sector, lugar;Lugar, localidad;Localidad, regional;Regional, interno;Interno, numero;Numero, codigo;Codigo', ]); // Come TipoTel::create([ 'id' => 3, 'tipo'=> 'COME', 'descripcion' => 'Descripcion come', 'campos' => 'usuarios;Usuarios, sector;Sector, lugar;Lugar, interno;Interno', ]); // EPEN TipoTel::create([ 'id' => 4, 'tipo'=> 'EPEN', 'descripcion' => 'Descripcion EPEN', 'campos' => 'usuarios;Usuarios, sector;Sector, lugar;Lugar, interno;Interno', ]); // Interno ST sede TipoTel::create([ 'id' => 5, 'tipo'=> 'Interno ST sede', 'descripcion' => 'Descripcion interno st sede', 'campos' => 'usuarios;Usuarios, sector;Sector, lugar;Lugar, interno;Interno', ]); // Ip TipoTel::create([ 'id' => 6, 'tipo'=> 'IP', 'descripcion' => 'Descripcion ip', 'campos' => 'usuarios;Usuarios, sector;Sector, lugar;Lugar, interno;Interno', ]); // PAX TipoTel::create([ 'id' => 7, 'tipo'=> 'PAX', 'descripcion' => 'Descripcion PAX', 'campos' => 'usuarios;Usuarios, sector;Sector, lugar;Lugar, interno;Interno', ]); // Proveedor TipoTel::create([ 'id' => 8, 'tipo'=> 'Proveedor', 'descripcion' => 'Descripcion proveedor', 'campos' => 'usuarios;Usuarios, sector;Sector, lugar;Lugar, empresa;Empresa, interno;Interno', ]); // Publico TipoTel::create([ 'id' => 9, 'tipo'=> 'Publico', 'descripcion' => 'Descripcion publico', 'campos' => 'usuarios;Usuarios, sector;Sector, lugar;Lugar, direccion;Direccion, regional;Regional, numero;Numero', ]); // Satelital TipoTel::create([ 'id' => 10, 'tipo'=> 'Satelital', 'descripcion' => 'Descripcion satelital', 'campos' => 'usuarios;Usuarios, sector;Sector, lugar;Lugar, codigo;Codigo, linea;Linea', ]); } }
29.918367
160
0.489427
da30d71777fffab22b08be88abd3c11861322fe4
3,046
php
PHP
resources/views/tenants/tenant_profile_confirmation.blade.php
asifkinfroninfotech/jobsite
a482ab5fd3877226294f735c4ddc8f1cbc05cba1
[ "MIT" ]
null
null
null
resources/views/tenants/tenant_profile_confirmation.blade.php
asifkinfroninfotech/jobsite
a482ab5fd3877226294f735c4ddc8f1cbc05cba1
[ "MIT" ]
null
null
null
resources/views/tenants/tenant_profile_confirmation.blade.php
asifkinfroninfotech/jobsite
a482ab5fd3877226294f735c4ddc8f1cbc05cba1
[ "MIT" ]
null
null
null
@extends('layouts.tenant_layout') @section('content') <div class="all-wrapper menu-side login-information"> <div class="auth-box-w"> @if(isset($tenantdetails) && !empty($tenantdetails)) @if(isset($tenantdetails->logo) && !empty($tenantdetails->logo) && File::exists(public_path('/storage/tenant/logoimage/'.$tenantdetails->logo))) <div class="logo-w"> <img alt="" src="{{'/storage/tenant/logoimage/'.$tenantdetails->logo}}"> </div> @else <div class="logo-w"> <a href="/"><img alt="" src="/img/logo_desktop.png"></a> </div> @endif @else <div class="logo-w"> <a href="/"><img alt="" src="/img/logo_desktop.png"></a> </div> @endif <!-- START - login info content area profile-setup-confim--> <div class="col-sm-12 col-md-12"> <div class="element-wrapper"> <div class="login-info-hd text-center"> <h5 class="element-inner-header"> Welcome back {{$tenantdetails->company}} </h5> {{-- <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor <br/> incididunt ut labore et dolore magna aliqua. </p> --}} </div> <div class="steps-w"> <div class="step-contents payment-faild payment-success"> <a href="#"><i class="icon-check"></i></a> <div class="text-center payment-faild-message"> <h5 class="element-inner-header"> Setup Completed</h5> {{-- <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor <br> incididunt ut labore et dolore magna aliqua. </p> --}} </div> <div class="text-center"> <a class="btn btn-primary" href="/">Go To My Dashboard</a> </div> </div> </div> </div> </div> <!-- END - login info content area --> </div> <p class="copy-right text-center"> &copy; Copyright {{date('Y')}} {{\App\Helpers\AppGlobal::$Artha_Company_Name}}. All rights reseved. </p> </div> @endsection @section('scripts') @endsection
42.305556
171
0.396257
8b286eb5c4a0ec4d82a00c594ec81f07ce5a99c8
509
sql
SQL
backend/de.metas.acct.base/src/main/sql/postgresql/system/43-de.metas.acct/5596730_sys_gh11426_add_SourceTableColumn_for_attachment.sql
dram/metasfresh
a1b881a5b7df8b108d4c4ac03082b72c323873eb
[ "RSA-MD" ]
1,144
2016-02-14T10:29:35.000Z
2022-03-30T09:50:41.000Z
backend/de.metas.acct.base/src/main/sql/postgresql/system/43-de.metas.acct/5596730_sys_gh11426_add_SourceTableColumn_for_attachment.sql
vestigegroup/metasfresh
4b2d48c091fb2a73e6f186260a06c715f5e2fe96
[ "RSA-MD" ]
8,283
2016-04-28T17:41:34.000Z
2022-03-30T13:30:12.000Z
backend/de.metas.acct.base/src/main/sql/postgresql/system/43-de.metas.acct/5596730_sys_gh11426_add_SourceTableColumn_for_attachment.sql
vestigegroup/metasfresh
4b2d48c091fb2a73e6f186260a06c715f5e2fe96
[ "RSA-MD" ]
441
2016-04-29T08:06:07.000Z
2022-03-28T06:09:56.000Z
-- 2021-07-06T05:38:03.416Z -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator INSERT INTO AD_SQLColumn_SourceTableColumn (AD_Client_ID,AD_Column_ID,AD_Org_ID,AD_SQLColumn_SourceTableColumn_ID,AD_Table_ID,Created,CreatedBy,FetchTargetRecordsMethod,IsActive,Link_Column_ID,Source_Table_ID,Updated,UpdatedBy) VALUES (0,563224,0,540039,541144,TO_TIMESTAMP('2021-07-06 08:38:03','YYYY-MM-DD HH24:MI:SS'),100,'L','Y',557027,540833,TO_TIMESTAMP('2021-07-06 08:38:03','YYYY-MM-DD HH24:MI:SS'),100) ;
84.833333
411
0.81336
0d9ede1873e806468701872c7b1b2b41776419a6
737
lua
Lua
test_scripts/API/IsReady/TTS_IsReady/ATF_TTS_IsReady_available_false_SingleRPC.lua
HSavynetska/sdl_atf_test_scripts
30d49436b27074e2e0d0661869d53e707aee1452
[ "BSD-3-Clause" ]
3
2016-03-17T02:26:56.000Z
2021-11-06T08:04:19.000Z
test_scripts/API/IsReady/TTS_IsReady/ATF_TTS_IsReady_available_false_SingleRPC.lua
HSavynetska/sdl_atf_test_scripts
30d49436b27074e2e0d0661869d53e707aee1452
[ "BSD-3-Clause" ]
1,335
2016-03-14T18:29:40.000Z
2022-03-30T10:40:28.000Z
test_scripts/API/IsReady/TTS_IsReady/ATF_TTS_IsReady_available_false_SingleRPC.lua
mvorobio/sdl_atf_test_scripts
1f664c4b297046c8d7fa46d655dd75d4f6c72cbb
[ "BSD-3-Clause" ]
72
2016-03-30T13:44:17.000Z
2021-07-26T06:48:24.000Z
--------------------------------------------------------------------------------------------- -- CRQ: APPLINK-25117: [GENIVI] TTS interface: SDL behavior in case HMI does not respond to -- IsReady_request or respond with "available" = false -- -- Requirement(s): APPLINK-25140:[TTS Interface] Conditions for SDL to respond -- 'UNSUPPORTED_RESOURCE, success:false' to mobile app -- APPLINK-25303:[HMI_API] TTS.IsReady --------------------------------------------------------------------------------------------- TestedInterface = "TTS" Test = require('user_modules/IsReady_Template/ATF_Interface_IsReady_available_false_SingleRPC_Template') return Test
49.133333
105
0.497965
c3cd0c6a1c565fcf2ec9857891722e1abb16e55b
12,223
lua
Lua
init.lua
andreyorst/itable
5597cd6835479683329249356495311285b554cc
[ "MIT" ]
4
2021-09-17T07:36:06.000Z
2022-02-11T20:32:31.000Z
init.lua
andreyorst/itable
5597cd6835479683329249356495311285b554cc
[ "MIT" ]
null
null
null
init.lua
andreyorst/itable
5597cd6835479683329249356495311285b554cc
[ "MIT" ]
null
null
null
-- -*- buffer-read-only: t -*- local _local_1_ = table local table_pack = _local_1_["pack"] local table_sort = _local_1_["sort"] local table_concat = _local_1_["concat"] local table_remove = _local_1_["remove"] local table_move = _local_1_["move"] local table_insert = _local_1_["insert"] local table_unpack = (table.unpack or _G.unpack) local lua_pairs = pairs local lua_ipairs = ipairs local function pairs(t) local _3_ do local _2_ = getmetatable(t) if ((_G.type(_2_) == "table") and (nil ~= (_2_).__pairs)) then local p = (_2_).__pairs _3_ = p elseif true then local _ = _2_ _3_ = lua_pairs else _3_ = nil end end return _3_(t) end local function ipairs(t) local _8_ do local _7_ = getmetatable(t) if ((_G.type(_7_) == "table") and (nil ~= (_7_).__ipairs)) then local i = (_7_).__ipairs _8_ = i elseif true then local _ = _7_ _8_ = lua_ipairs else _8_ = nil end end return _8_(t) end local function length_2a(t) local _13_ do local _12_ = getmetatable(t) if ((_G.type(_12_) == "table") and (nil ~= (_12_).__len)) then local l = (_12_).__len _13_ = l elseif true then local _ = _12_ local function _17_(...) return #... end _13_ = _17_ else _13_ = nil end end return _13_(t) end local function copy(t) if t then local tbl_11_auto = {} for k, v in pairs(t) do local _19_, _20_ = k, v if ((nil ~= _19_) and (nil ~= _20_)) then local k_12_auto = _19_ local v_13_auto = _20_ tbl_11_auto[k_12_auto] = v_13_auto else end end return tbl_11_auto else return nil end end local function immutable(t) local len = length_2a(t) local proxy = {} local __len local function _23_() return len end __len = _23_ local __index local function _24_(_241, _242) return t[_242] end __index = _24_ local __newindex local function _25_() return error((tostring(proxy) .. " is immutable"), 2) end __newindex = _25_ local __pairs local function _26_() local function _27_(_, k) return next(t, k) end return _27_, nil, nil end __pairs = _26_ local __ipairs local function _28_() local function _29_(_, k) return next(t, k) end return _29_ end __ipairs = _28_ local __call local function _30_(_241, _242) return t[_242] end __call = _30_ local __fennelview local function _31_(_241, _242, _243, _244) return _242(t, _243, _244) end __fennelview = _31_ local __fennelrest local function _32_(_241, _242) return immutable({table_unpack(t, _242)}) end __fennelrest = _32_ return setmetatable(proxy, {__index = __index, __newindex = __newindex, __len = __len, __pairs = __pairs, __ipairs = __ipairs, __call = __call, __metatable = {__len = __len, __pairs = __pairs, __ipairs = __ipairs, __call = __call, __fennelrest = __fennelrest, __fennelview = __fennelview}}) end local function insert(t, ...) local t0 = copy(t) do local _33_, _34_, _35_ = select("#", ...), ... if (_33_ == 0) then error("wrong number of arguments to 'insert'") elseif ((_33_ == 1) and true) then local _3fv = _34_ table_insert(t0, _3fv) elseif (true and true and true) then local _ = _33_ local _3fk = _34_ local _3fv = _35_ table_insert(t0, _3fk, _3fv) else end end return immutable(t0) end local move if table_move then local function _37_(src, start, _end, tgt, dest) local src0 = copy(src) local dest0 = copy(dest) return immutable(table_move(src0, start, _end, tgt, dest0)) end move = _37_ else move = nil end local function pack(...) local function _40_(...) local _39_ = {...} _39_["n"] = select("#", ...) return _39_ end return immutable(_40_(...)) end local function remove(t, key) local t0 = copy(t) local v = table_remove(t0, key) return immutable(t0), v end local function concat(t, sep, start, _end, serializer, opts) local serializer0 = (serializer or tostring) local _41_ do local tbl_14_auto = {} local i_15_auto = #tbl_14_auto for _, v in ipairs(t) do local val_16_auto = serializer0(v, opts) if (nil ~= val_16_auto) then i_15_auto = (i_15_auto + 1) do end (tbl_14_auto)[i_15_auto] = val_16_auto else end end _41_ = tbl_14_auto end return table_concat(_41_, sep, start, _end) end local function unpack(t) return table_unpack(copy(t)) end local function eq(...) local _43_, _44_, _45_ = select("#", ...), ... local function _46_(...) return true end if ((_43_ == 0) and _46_(...)) then return true else local function _47_(...) return true end if ((_43_ == 1) and _47_(...)) then return true elseif ((_43_ == 2) and true and true) then local _3fa = _44_ local _3fb = _45_ if (_3fa == _3fb) then return true elseif (function(_48_,_49_,_50_) return (_48_ == _49_) and (_49_ == _50_) end)(type(_3fa),type(_3fb),"table") then local res, count_a, count_b = true, 0, 0 for k, v in pairs(_3fa) do if not res then break end local function _51_(...) local res0 = nil for k_2a, v0 in pairs(_3fb) do if res0 then break end if eq(k_2a, k) then res0 = v0 else end end return res0 end res = eq(v, _51_(...)) count_a = (count_a + 1) end if res then for _, _0 in pairs(_3fb) do count_b = (count_b + 1) end res = (count_a == count_b) else end return res else return false end elseif (true and true and true) then local _ = _43_ local _3fa = _44_ local _3fb = _45_ return (eq(_3fa, _3fb) and eq(select(2, ...))) else return nil end end end local function assoc(t, key, val) local function _57_() local _56_ = copy(t) do end (_56_)[key] = val return _56_ end return immutable(_57_()) end local function assoc_in(t, _58_, val) local _arg_59_ = _58_ local k = _arg_59_[1] local ks = (function (t, k) local mt = getmetatable(t) if "table" == type(mt) and mt.__fennelrest then return mt.__fennelrest(t, k) else return {(table.unpack or unpack)(t, k)} end end)(_arg_59_, 2) local t0 = (t or {}) if next(ks) then return assoc(t0, k, assoc_in(((t0)[k] or {}), ks, val)) else return assoc(t0, k, val) end end local function update(t, key, f) local function _62_() local _61_ = copy(t) do end (_61_)[key] = f(t[key]) return _61_ end return immutable(_62_()) end local function update_in(t, _63_, f) local _arg_64_ = _63_ local k = _arg_64_[1] local ks = (function (t, k) local mt = getmetatable(t) if "table" == type(mt) and mt.__fennelrest then return mt.__fennelrest(t, k) else return {(table.unpack or unpack)(t, k)} end end)(_arg_64_, 2) local t0 = (t or {}) if next(ks) then return assoc(t0, k, update_in((t0)[k], ks, f)) else return update(t0, k, f) end end local function deepcopy(x) local function deepcopy_2a(x0, seen) local _66_ = type(x0) if (_66_ == "table") then local _67_ = seen[x0] if (_67_ == true) then return error("immutable tables can't contain self reference", 2) elseif true then local _ = _67_ seen[x0] = true local function _68_() local tbl_11_auto = {} for k, v in pairs(x0) do local _69_, _70_ = deepcopy_2a(k, seen), deepcopy_2a(v, seen) if ((nil ~= _69_) and (nil ~= _70_)) then local k_12_auto = _69_ local v_13_auto = _70_ tbl_11_auto[k_12_auto] = v_13_auto else end end return tbl_11_auto end return immutable(_68_()) else return nil end elseif true then local _ = _66_ return x0 else return nil end end return deepcopy_2a(x, {}) end local function first(_74_) local _arg_75_ = _74_ local x = _arg_75_[1] return x end local function rest(t) local _76_ = remove(t, 1) return _76_ end local function nthrest(t, n) local t_2a = {} for i = (n + 1), length_2a(t) do table_insert(t_2a, t[i]) end return immutable(t_2a) end local function last(t) return t[length_2a(t)] end local function butlast(t) local _77_ = remove(t, length_2a(t)) return _77_ end local function join(...) local _78_, _79_, _80_ = select("#", ...), ... if (_78_ == 0) then return nil elseif ((_78_ == 1) and true) then local _3ft = _79_ return immutable(copy(_3ft)) elseif ((_78_ == 2) and true and true) then local _3ft1 = _79_ local _3ft2 = _80_ local to = copy(_3ft1) local from = (_3ft2 or {}) for _, v in ipairs(from) do table_insert(to, v) end return immutable(to) elseif (true and true and true) then local _ = _78_ local _3ft1 = _79_ local _3ft2 = _80_ return join(join(_3ft1, _3ft2), select(3, ...)) else return nil end end local function take(n, t) local t_2a = {} for i = 1, n do table_insert(t_2a, t[i]) end return immutable(t_2a) end local function drop(n, t) return nthrest(t, n) end local function partition(...) local res = {} local function partition_2a(...) local _82_, _83_, _84_, _85_, _86_ = select("#", ...), ... local function _87_(...) return true end if ((_82_ == 0) and _87_(...)) then return error("wrong amount arguments to 'partition'") else local function _88_(...) return true end if ((_82_ == 1) and _88_(...)) then return error("wrong amount arguments to 'partition'") elseif ((_82_ == 2) and true and true) then local _3fn = _83_ local _3ft = _84_ return partition_2a(_3fn, _3fn, _3ft) elseif ((_82_ == 3) and true and true and true) then local _3fn = _83_ local _3fstep = _84_ local _3ft = _85_ local p = take(_3fn, _3ft) if (_3fn == length_2a(p)) then table_insert(res, p) return partition_2a(_3fn, _3fstep, {table_unpack(_3ft, (_3fstep + 1))}) else return nil end elseif (true and true and true and true and true) then local _ = _82_ local _3fn = _83_ local _3fstep = _84_ local _3fpad = _85_ local _3ft = _86_ local p = take(_3fn, _3ft) if (_3fn == length_2a(p)) then table_insert(res, p) return partition_2a(_3fn, _3fstep, _3fpad, {table_unpack(_3ft, (_3fstep + 1))}) else return table_insert(res, take(_3fn, join(p, _3fpad))) end else return nil end end end partition_2a(...) return immutable(res) end local function keys(t) local function _92_() local tbl_14_auto = {} local i_15_auto = #tbl_14_auto for k, _ in pairs(t) do local val_16_auto = k if (nil ~= val_16_auto) then i_15_auto = (i_15_auto + 1) do end (tbl_14_auto)[i_15_auto] = val_16_auto else end end return tbl_14_auto end return immutable(_92_()) end local function vals(t) local function _94_() local tbl_14_auto = {} local i_15_auto = #tbl_14_auto for _, v in pairs(t) do local val_16_auto = v if (nil ~= val_16_auto) then i_15_auto = (i_15_auto + 1) do end (tbl_14_auto)[i_15_auto] = val_16_auto else end end return tbl_14_auto end return immutable(_94_()) end local function group_by(f, t) local res = {} local ungroupped = {} for _, v in pairs(t) do local k = f(v) if (nil ~= k) then local _96_ = res[k] if (nil ~= _96_) then local t_2a = _96_ table_insert(t_2a, v) elseif true then local _0 = _96_ res[k] = {v} else end else table_insert(ungroupped, v) end end local function _99_() local tbl_11_auto = {} for k, t0 in pairs(res) do local _100_, _101_ = k, immutable(t0) if ((nil ~= _100_) and (nil ~= _101_)) then local k_12_auto = _100_ local v_13_auto = _101_ tbl_11_auto[k_12_auto] = v_13_auto else end end return tbl_11_auto end return immutable(_99_()), immutable(ungroupped) end local function frequencies(t) local res = {} for _, v in pairs(t) do local _103_ = res[v] if (nil ~= _103_) then local a = _103_ res[v] = (a + 1) elseif true then local _0 = _103_ res[v] = 1 else end end return immutable(res) end local itable local function _105_(t, f) local function _107_() local _106_ = copy(t) table_sort(_106_, f) return _106_ end return immutable(_107_()) end itable = {sort = _105_, pack = pack, unpack = unpack, concat = concat, insert = insert, move = move, remove = remove, pairs = pairs, ipairs = ipairs, length = length_2a, eq = eq, deepcopy = deepcopy, assoc = assoc, ["assoc-in"] = assoc_in, update = update, ["update-in"] = update_in, keys = keys, vals = vals, ["group-by"] = group_by, frequencies = frequencies, first = first, rest = rest, nthrest = nthrest, last = last, butlast = butlast, join = join, partition = partition, take = take, drop = drop} local function _108_(_241, _242) return immutable(copy(_242)) end return setmetatable(itable, {__call = _108_, __index = {_MODULE_NAME = "itable", _DESCRIPTION = "`itable` - immutable tables for Lua runtime."}})
20.270315
616
0.677821
257faba8a3339bb2e929b757c2c6f24f23a5ab6e
1,610
cs
C#
src/TiffLibrary/ImageDecoder/Jpeg8BitSampleExpansionMiddleware.cs
JTOne123/TiffLibrary
0ca03871ee58a618ee9578ea2f39bed28c7340cd
[ "MIT" ]
null
null
null
src/TiffLibrary/ImageDecoder/Jpeg8BitSampleExpansionMiddleware.cs
JTOne123/TiffLibrary
0ca03871ee58a618ee9578ea2f39bed28c7340cd
[ "MIT" ]
null
null
null
src/TiffLibrary/ImageDecoder/Jpeg8BitSampleExpansionMiddleware.cs
JTOne123/TiffLibrary
0ca03871ee58a618ee9578ea2f39bed28c7340cd
[ "MIT" ]
null
null
null
using System; using System.Diagnostics; using System.Runtime.CompilerServices; using System.Threading.Tasks; namespace TiffLibrary.ImageDecoder { internal sealed class Jpeg8BitSampleExpansionMiddleware : ITiffImageDecoderMiddleware { private readonly int _bitCount; public Jpeg8BitSampleExpansionMiddleware(int bitCount) { Debug.Assert(bitCount > 0 && bitCount <= 8); _bitCount = bitCount; } public ValueTask InvokeAsync(TiffImageDecoderContext context, ITiffImageDecoderPipelineNode next) { if (context is null) { throw new ArgumentNullException(nameof(context)); } if (next is null) { throw new ArgumentNullException(nameof(next)); } int bitCount = _bitCount; Span<byte> uncompressedData = context.UncompressedData.Span; for (int i = 0; i < uncompressedData.Length; i++) { uncompressedData[i] = (byte)FastExpandBits(uncompressedData[i], bitCount); } return next.RunAsync(new JpegDataEndianContextWrapper(context)); } [MethodImpl(MethodImplOptions.AggressiveInlining)] private static uint FastExpandBits(uint bits, int bitCount) { const int TargetBitCount = 8; Debug.Assert(bitCount * 2 >= TargetBitCount); int remainingBits = TargetBitCount - bitCount; return (bits << remainingBits) | (bits & ((uint)(1 << remainingBits) - 1)); } } }
31.568627
105
0.607453
df27d41ca618abbe934e07c42628996d32563e56
233
rb
Ruby
config/routes.rb
mesalva/ranking_points
5cf7734ba45673db853134cb2e9e3398bd1a634b
[ "MIT" ]
null
null
null
config/routes.rb
mesalva/ranking_points
5cf7734ba45673db853134cb2e9e3398bd1a634b
[ "MIT" ]
null
null
null
config/routes.rb
mesalva/ranking_points
5cf7734ba45673db853134cb2e9e3398bd1a634b
[ "MIT" ]
null
null
null
Rails.application.routes.draw do resources :paths #get 'test_mq/test' resources :user_rankings resources :users resources :posts get "*all" => 'user_rankings#path_index' post "*all" => 'user_rankings#path_create' end
21.181818
44
0.725322
dda1d8617055661615953d5c7d49e09958c91c42
5,103
java
Java
src/test/java/mx/nic/rdap/store/model/EntityStoreModel.java
NICMx/rdap-sql-provider
4460ec284ddd5a8796218ce34faa57868ee80d06
[ "Apache-2.0" ]
1
2019-10-20T16:24:18.000Z
2019-10-20T16:24:18.000Z
src/test/java/mx/nic/rdap/store/model/EntityStoreModel.java
NICMx/rdap-sql-provider
4460ec284ddd5a8796218ce34faa57868ee80d06
[ "Apache-2.0" ]
20
2017-07-05T21:17:03.000Z
2019-06-07T22:50:17.000Z
src/test/java/mx/nic/rdap/store/model/EntityStoreModel.java
NICMx/rdap-sql-provider
4460ec284ddd5a8796218ce34faa57868ee80d06
[ "Apache-2.0" ]
1
2020-10-21T16:05:39.000Z
2020-10-21T16:05:39.000Z
package mx.nic.rdap.store.model; import java.io.IOException; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; import mx.nic.rdap.core.db.Entity; import mx.nic.rdap.core.db.VCard; import mx.nic.rdap.sql.QueryGroup; import mx.nic.rdap.sql.exception.IncompleteObjectException; /** * Model for the {@link Entity} Object * */ public class EntityStoreModel { private final static Logger logger = Logger.getLogger(EntityStoreModel.class.getName()); private final static String QUERY_GROUP = "EntityStore"; private static QueryGroup queryGroup = null; private final static String STORE_QUERY = "storeToDatabase"; private final static String GET_ID_BY_HANDLE_QUERY = "getIdByHandle"; public static void loadQueryGroup(String schema) { try { QueryGroup qG = new QueryGroup(QUERY_GROUP, schema); setQueryGroup(qG); } catch (IOException e) { throw new RuntimeException("Error loading query group"); } } private static void setQueryGroup(QueryGroup qG) { queryGroup = qG; } private static QueryGroup getQueryGroup() { return queryGroup; } public static Long getIdByHandle(String entityHandle, Connection connection) throws SQLException { String query = getQueryGroup().getQuery(GET_ID_BY_HANDLE_QUERY); Long entId = null; try (PreparedStatement statement = connection.prepareStatement(query);) { statement.setString(1, entityHandle); logger.log(Level.INFO, "Executing QUERY:" + statement.toString()); ResultSet rs = statement.executeQuery(); if (!rs.next()) { return null; } long long1 = rs.getLong("ent_id"); if (!rs.wasNull()) { entId = long1; } } return entId; } public static void validateParentEntities(List<Entity> entities, Connection connection) throws SQLException { for (Entity ent : entities) { Long entId = EntityStoreModel.getIdByHandle(ent.getHandle(), connection); if (entId == null) { throw new NullPointerException( "Entity: " + ent.getHandle() + " was not inserted previously to the database"); } ent.setId(entId); } } public static long storeToDatabase(Entity entity, Connection connection) throws SQLException { return storeToDatabase(entity, connection, true); } private static long storeToDatabase(Entity entity, Connection connection, boolean isParentEntity) throws SQLException { Long entityId = EntityStoreModel.getIdByHandle(entity.getHandle(), connection); if (entityId != null) { entity.setId(entityId); return entityId; } String query = getQueryGroup().getQuery(STORE_QUERY); try (PreparedStatement statement = connection.prepareStatement(query, Statement.RETURN_GENERATED_KEYS);) { fillPreparedStatement(statement, entity); logger.log(Level.INFO, "Executing QUERY:" + statement.toString()); statement.executeUpdate(); ResultSet resultSet = statement.getGeneratedKeys(); resultSet.next(); entityId = resultSet.getLong(1); entity.setId(entityId); } if (isParentEntity && !entity.getRoles().isEmpty()) { RoleStoreModel.storeMainEntityRol(entity, connection); } storeNestedObjects(entity, connection); return entityId; } private static void isValidForStore(Entity entity) throws IncompleteObjectException { if (entity.getHandle() == null || entity.getHandle().isEmpty()) throw new IncompleteObjectException("handle", "Entity"); } private static void storeNestedObjects(Entity entity, Connection connection) throws SQLException { isValidForStore(entity); storeVcardList(entity, connection); PublicIdStoreModel.storePublicIdByEntity(entity.getPublicIds(), entity.getId(), connection); StatusStoreModel.storeEntityStatusToDatabase(entity.getStatus(), entity.getId(), connection); RemarkStoreModel.storeEntityRemarksToDatabase(entity.getRemarks(), entity.getId(), connection); LinkStoreModel.storeEntityLinksToDatabase(entity.getLinks(), entity.getId(), connection); EventStoreModel.storeEntityEventsToDatabase(entity.getEvents(), entity.getId(), connection); for (Entity ent : entity.getEntities()) { storeToDatabase(ent, connection, false); } RoleStoreModel.storeEntityEntityRoles(entity.getEntities(), entity.getId(), connection); } private static void storeVcardList(Entity entity, Connection connection) throws SQLException { List<VCard> vCardList = entity.getVCardList(); if (!vCardList.isEmpty()) { for (VCard vCard : vCardList) { VCardStoreModel.storeToDatabase(vCard, connection); } VCardStoreModel.storeRegistrarContactToDatabase(vCardList, entity.getId(), connection); } } private static void fillPreparedStatement(PreparedStatement preparedStatement, Entity entity) throws SQLException { preparedStatement.setString(1, entity.getHandle()); preparedStatement.setString(2, entity.getPort43()); } }
34.02
117
0.733882
4bde1fd7b39980d0fc9805060124878b1ecf2fab
91,287
c
C
TraceStore/TraceStoreConstants.c
IMULMUL/tracer
221ae67558fa08a8a45ddd82c237417c0085b5a5
[ "MIT" ]
51
2017-12-18T20:49:36.000Z
2022-02-19T13:28:51.000Z
TraceStore/TraceStoreConstants.c
IMULMUL/tracer
221ae67558fa08a8a45ddd82c237417c0085b5a5
[ "MIT" ]
1
2018-05-15T19:46:47.000Z
2018-05-15T19:59:25.000Z
TraceStore/TraceStoreConstants.c
IMULMUL/tracer
221ae67558fa08a8a45ddd82c237417c0085b5a5
[ "MIT" ]
8
2018-05-07T13:59:53.000Z
2022-01-20T02:06:00.000Z
/*++ Copyright (c) 2016 Trent Nelson <trent@trent.me> Module Name: TraceStoreConstants.c Abstract: This module defines constants used by the TraceStore component. --*/ #include "stdafx.h" volatile BOOL PauseBeforeThreadpoolWorkEnabled = FALSE; volatile BOOL PauseBeforeBindMetadataInfo = TRUE; volatile BOOL PauseBeforeBindRemainingMetadata = TRUE; volatile BOOL PauseBeforeBindTraceStore = TRUE; volatile BOOL PauseBeforePrepareReadonlyNonStreamingMap = TRUE; volatile BOOL PauseBeforeReadonlyNonStreamingBindComplete = TRUE; volatile BOOL PauseBeforeRelocate = TRUE; CONST LPCWSTR TraceStoreFileNames[] = { L"PythonTracer_TraceEvent.dat", L"TraceStore_StringBuffer.dat", L"Python_PythonFunctionTable.dat", L"Python_PythonFunctionTableEntry.dat", L"Python_PythonPathTable.dat", L"Python_PythonPathTableEntry.dat", L"TraceStore_PageFault.dat", L"StringTable_StringArray.dat", L"StringTable_StringTable.dat", L"PythonTracer_TraceEventTraitsEx.dat", L"TraceStore_WsWatchInfoEx.dat", L"TraceStore_WsWorkingSetExInfo.dat", L"TraceStore_CCallStackTable.dat", L"TraceStore_CCallStackTableEntry.dat", L"TraceStore_ModuleTable.dat", L"TraceStore_ModuleTableEntry.dat", L"Python_PythonCallStackTable.dat", L"Python_PythonCallStackTableEntry.dat", L"Python_PythonModuleTable.dat", L"Python_PythonModuleTableEntry.dat", L"TraceStore_LineTable.dat", L"TraceStore_LineTableEntry.dat", L"TraceStore_LineStringBuffer.dat", L"TraceStore_CallStack.dat", L"TraceStore_Performance.dat", L"TraceStore_PerformanceDelta.dat", L"TraceStore_SourceCode.dat", L"TraceStore_Bitmap.dat", L"TraceStore_ImageFile.dat", L"TraceStore_UnicodeStringBuffer.dat", L"TraceStore_Line.dat", L"TraceStore_Object.dat", L"TraceStore_ModuleLoadEvent.dat", L"TraceStore_SymbolTable.dat", L"TraceStore_SymbolTableEntry.dat", L"TraceStore_SymbolModuleInfo.dat", L"TraceStore_SymbolFile.dat", L"TraceStore_SymbolInfo.dat", L"TraceStore_SymbolLine.dat", L"TraceStore_SymbolType.dat", L"TraceStore_StackFrame.dat", L"TraceStore_TypeInfoTable.dat", L"TraceStore_TypeInfoTableEntry.dat", L"TraceStore_TypeStringBuffer.dat", L"TraceStore_FunctionTable.dat", L"TraceStore_FunctionTableEntry.dat", L"TraceStore_FunctionAssembly.dat", L"TraceStore_FunctionSourceCode.dat", L"TraceStore_ExamineSymbolsLines.dat", L"TraceStore_ExamineSymbolsText.txt", L"TraceStore_ExaminedSymbol.dat", L"TraceStore_ExaminedSymbolSecondary.dat", L"TraceStore_UnassembleFunctionLines.dat", L"TraceStore_UnassembleFunctionText.txt", L"TraceStore_UnassembledFunction.dat", L"TraceStore_UnassembledFunctionSecondary.dat", L"TraceStore_DisplayTypeLines.dat", L"TraceStore_DisplayTypeText.txt", L"TraceStore_DisplayedType.dat", L"TraceStore_DisplayedTypeSecondary.dat", }; CONST LPCSTR TraceStoreSqlite3VirtualTableNames[] = { "PythonTracer_TraceEvent", "PythonTracer_TraceEvent_MetadataInfo", "PythonTracer_TraceEvent_Allocation", "PythonTracer_TraceEvent_Relocation", "PythonTracer_TraceEvent_Address", "PythonTracer_TraceEvent_AddressRange", "PythonTracer_TraceEvent_AllocationTimestamp", "PythonTracer_TraceEvent_AllocationTimestampDelta", "PythonTracer_TraceEvent_Synchronization", "PythonTracer_TraceEvent_Info", "TraceStore_StringBuffer", "TraceStore_StringBuffer_MetadataInfo", "TraceStore_StringBuffer_Allocation", "TraceStore_StringBuffer_Relocation", "TraceStore_StringBuffer_Address", "TraceStore_StringBuffer_AddressRange", "TraceStore_StringBuffer_AllocationTimestamp", "TraceStore_StringBuffer_AllocationTimestampDelta", "TraceStore_StringBuffer_Synchronization", "TraceStore_StringBuffer_Info", "Python_PythonFunctionTable", "Python_PythonFunctionTable_MetadataInfo", "Python_PythonFunctionTable_Allocation", "Python_PythonFunctionTable_Relocation", "Python_PythonFunctionTable_Address", "Python_PythonFunctionTable_AddressRange", "Python_PythonFunctionTable_AllocationTimestamp", "Python_PythonFunctionTable_AllocationTimestampDelta", "Python_PythonFunctionTable_Synchronization", "Python_PythonFunctionTable_Info", "Python_PythonFunctionTableEntry", "Python_PythonFunctionTableEntry_MetadataInfo", "Python_PythonFunctionTableEntry_Allocation", "Python_PythonFunctionTableEntry_Relocation", "Python_PythonFunctionTableEntry_Address", "Python_PythonFunctionTableEntry_AddressRange", "Python_PythonFunctionTableEntry_AllocationTimestamp", "Python_PythonFunctionTableEntry_AllocationTimestampDelta", "Python_PythonFunctionTableEntry_Synchronization", "Python_PythonFunctionTableEntry_Info", "Python_PythonPathTable", "Python_PythonPathTable_MetadataInfo", "Python_PythonPathTable_Allocation", "Python_PythonPathTable_Relocation", "Python_PythonPathTable_Address", "Python_PythonPathTable_AddressRange", "Python_PythonPathTable_AllocationTimestamp", "Python_PythonPathTable_AllocationTimestampDelta", "Python_PythonPathTable_Synchronization", "Python_PythonPathTable_Info", "Python_PythonPathTableEntry", "Python_PythonPathTableEntry_MetadataInfo", "Python_PythonPathTableEntry_Allocation", "Python_PythonPathTableEntry_Relocation", "Python_PythonPathTableEntry_Address", "Python_PythonPathTableEntry_AddressRange", "Python_PythonPathTableEntry_AllocationTimestamp", "Python_PythonPathTableEntry_AllocationTimestampDelta", "Python_PythonPathTableEntry_Synchronization", "Python_PythonPathTableEntry_Info", "TraceStore_PageFault", "TraceStore_PageFault_MetadataInfo", "TraceStore_PageFault_Allocation", "TraceStore_PageFault_Relocation", "TraceStore_PageFault_Address", "TraceStore_PageFault_AddressRange", "TraceStore_PageFault_AllocationTimestamp", "TraceStore_PageFault_AllocationTimestampDelta", "TraceStore_PageFault_Synchronization", "TraceStore_PageFault_Info", "StringTable_StringArray", "StringTable_StringArray_MetadataInfo", "StringTable_StringArray_Allocation", "StringTable_StringArray_Relocation", "StringTable_StringArray_Address", "StringTable_StringArray_AddressRange", "StringTable_StringArray_AllocationTimestamp", "StringTable_StringArray_AllocationTimestampDelta", "StringTable_StringArray_Synchronization", "StringTable_StringArray_Info", "StringTable_StringTable", "StringTable_StringTable_MetadataInfo", "StringTable_StringTable_Allocation", "StringTable_StringTable_Relocation", "StringTable_StringTable_Address", "StringTable_StringTable_AddressRange", "StringTable_StringTable_AllocationTimestamp", "StringTable_StringTable_AllocationTimestampDelta", "StringTable_StringTable_Synchronization", "StringTable_StringTable_Info", "PythonTracer_EventTraitsEx", "PythonTracer_EventTraitsEx_MetadataInfo", "PythonTracer_EventTraitsEx_Allocation", "PythonTracer_EventTraitsEx_Relocation", "PythonTracer_EventTraitsEx_Address", "PythonTracer_EventTraitsEx_AddressRange", "PythonTracer_EventTraitsEx_AllocationTimestamp", "PythonTracer_EventTraitsEx_AllocationTimestampDelta", "PythonTracer_EventTraitsEx_Synchronization", "PythonTracer_EventTraitsEx_Info", "TraceStore_WsWatchInfoEx", "TraceStore_WsWatchInfoEx_MetadataInfo", "TraceStore_WsWatchInfoEx_Allocation", "TraceStore_WsWatchInfoEx_Relocation", "TraceStore_WsWatchInfoEx_Address", "TraceStore_WsWatchInfoEx_AddressRange", "TraceStore_WsWatchInfoEx_AllocationTimestamp", "TraceStore_WsWatchInfoEx_AllocationTimestampDelta", "TraceStore_WsWatchInfoEx_Synchronization", "TraceStore_WsWatchInfoEx_Info", "TraceStore_WsWorkingSetExInfo", "TraceStore_WsWorkingSetExInfo_MetadataInfo", "TraceStore_WsWorkingSetExInfo_Allocation", "TraceStore_WsWorkingSetExInfo_Relocation", "TraceStore_WsWorkingSetExInfo_Address", "TraceStore_WsWorkingSetExInfo_AddressRange", "TraceStore_WsWorkingSetExInfo_AllocationTimestamp", "TraceStore_WsWorkingSetExInfo_AllocationTimestampDelta", "TraceStore_WsWorkingSetExInfo_Synchronization", "TraceStore_WsWorkingSetExInfo_Info", "TraceStore_CCallStackTable", "TraceStore_CCallStackTable_MetadataInfo", "TraceStore_CCallStackTable_Allocation", "TraceStore_CCallStackTable_Relocation", "TraceStore_CCallStackTable_Address", "TraceStore_CCallStackTable_AddressRange", "TraceStore_CCallStackTable_AllocationTimestamp", "TraceStore_CCallStackTable_AllocationTimestampDelta", "TraceStore_CCallStackTable_Synchronization", "TraceStore_CCallStackTable_Info", "TraceStore_CCallStackTableEntry", "TraceStore_CCallStackTableEntry_MetadataInfo", "TraceStore_CCallStackTableEntry_Allocation", "TraceStore_CCallStackTableEntry_Relocation", "TraceStore_CCallStackTableEntry_Address", "TraceStore_CCallStackTableEntry_AddressRange", "TraceStore_CCallStackTableEntry_AllocationTimestamp", "TraceStore_CCallStackTableEntry_AllocationTimestampDelta", "TraceStore_CCallStackTableEntry_Synchronization", "TraceStore_CCallStackTableEntry_Info", "TraceStore_ModuleTable", "TraceStore_ModuleTable_MetadataInfo", "TraceStore_ModuleTable_Allocation", "TraceStore_ModuleTable_Relocation", "TraceStore_ModuleTable_Address", "TraceStore_ModuleTable_AddressRange", "TraceStore_ModuleTable_AllocationTimestamp", "TraceStore_ModuleTable_AllocationTimestampDelta", "TraceStore_ModuleTable_Synchronization", "TraceStore_ModuleTable_Info", "TraceStore_ModuleTableEntry", "TraceStore_ModuleTableEntry_MetadataInfo", "TraceStore_ModuleTableEntry_Allocation", "TraceStore_ModuleTableEntry_Relocation", "TraceStore_ModuleTableEntry_Address", "TraceStore_ModuleTableEntry_AddressRange", "TraceStore_ModuleTableEntry_AllocationTimestamp", "TraceStore_ModuleTableEntry_AllocationTimestampDelta", "TraceStore_ModuleTableEntry_Synchronization", "TraceStore_ModuleTableEntry_Info", "Python_PythonCallStackTable", "Python_PythonCallStackTable_MetadataInfo", "Python_PythonCallStackTable_Allocation", "Python_PythonCallStackTable_Relocation", "Python_PythonCallStackTable_Address", "Python_PythonCallStackTable_AddressRange", "Python_PythonCallStackTable_AllocationTimestamp", "Python_PythonCallStackTable_AllocationTimestampDelta", "Python_PythonCallStackTable_Synchronization", "Python_PythonCallStackTable_Info", "Python_PythonCallStackTableEntry", "Python_PythonCallStackTableEntry_MetadataInfo", "Python_PythonCallStackTableEntry_Allocation", "Python_PythonCallStackTableEntry_Relocation", "Python_PythonCallStackTableEntry_Address", "Python_PythonCallStackTableEntry_AddressRange", "Python_PythonCallStackTableEntry_AllocationTimestamp", "Python_PythonCallStackTableEntry_AllocationTimestampDelta", "Python_PythonCallStackTableEntry_Synchronization", "Python_PythonCallStackTableEntry_Info", "Python_PythonModuleTable", "Python_PythonModuleTable_MetadataInfo", "Python_PythonModuleTable_Allocation", "Python_PythonModuleTable_Relocation", "Python_PythonModuleTable_Address", "Python_PythonModuleTable_AddressRange", "Python_PythonModuleTable_AllocationTimestamp", "Python_PythonModuleTable_AllocationTimestampDelta", "Python_PythonModuleTable_Synchronization", "Python_PythonModuleTable_Info", "Python_PythonModuleTableEntry", "Python_PythonModuleTableEntry_MetadataInfo", "Python_PythonModuleTableEntry_Allocation", "Python_PythonModuleTableEntry_Relocation", "Python_PythonModuleTableEntry_Address", "Python_PythonModuleTableEntry_AddressRange", "Python_PythonModuleTableEntry_AllocationTimestamp", "Python_PythonModuleTableEntry_AllocationTimestampDelta", "Python_PythonModuleTableEntry_Synchronization", "Python_PythonModuleTableEntry_Info", "TraceStore_LineTable", "TraceStore_LineTable_MetadataInfo", "TraceStore_LineTable_Allocation", "TraceStore_LineTable_Relocation", "TraceStore_LineTable_Address", "TraceStore_LineTable_AddressRange", "TraceStore_LineTable_AllocationTimestamp", "TraceStore_LineTable_AllocationTimestampDelta", "TraceStore_LineTable_Synchronization", "TraceStore_LineTable_Info", "TraceStore_LineTableEntry", "TraceStore_LineTableEntry_MetadataInfo", "TraceStore_LineTableEntry_Allocation", "TraceStore_LineTableEntry_Relocation", "TraceStore_LineTableEntry_Address", "TraceStore_LineTableEntry_AddressRange", "TraceStore_LineTableEntry_AllocationTimestamp", "TraceStore_LineTableEntry_AllocationTimestampDelta", "TraceStore_LineTableEntry_Synchronization", "TraceStore_LineTableEntry_Info", "TraceStore_LineStringBuffer", "TraceStore_LineStringBuffer_MetadataInfo", "TraceStore_LineStringBuffer_Allocation", "TraceStore_LineStringBuffer_Relocation", "TraceStore_LineStringBuffer_Address", "TraceStore_LineStringBuffer_AddressRange", "TraceStore_LineStringBuffer_AllocationTimestamp", "TraceStore_LineStringBuffer_AllocationTimestampDelta", "TraceStore_LineStringBuffer_Synchronization", "TraceStore_LineStringBuffer_Info", "TraceStore_CallStack", "TraceStore_CallStack_MetadataInfo", "TraceStore_CallStack_Allocation", "TraceStore_CallStack_Relocation", "TraceStore_CallStack_Address", "TraceStore_CallStack_AddressRange", "TraceStore_CallStack_AllocationTimestamp", "TraceStore_CallStack_AllocationTimestampDelta", "TraceStore_CallStack_Synchronization", "TraceStore_CallStack_Info", "TraceStore_Performance", "TraceStore_Performance_MetadataInfo", "TraceStore_Performance_Allocation", "TraceStore_Performance_Relocation", "TraceStore_Performance_Address", "TraceStore_Performance_AddressRange", "TraceStore_Performance_AllocationTimestamp", "TraceStore_Performance_AllocationTimestampDelta", "TraceStore_Performance_Synchronization", "TraceStore_Performance_Info", "TraceStore_PerformanceDelta", "TraceStore_PerformanceDelta_MetadataInfo", "TraceStore_PerformanceDelta_Allocation", "TraceStore_PerformanceDelta_Relocation", "TraceStore_PerformanceDelta_Address", "TraceStore_PerformanceDelta_AddressRange", "TraceStore_PerformanceDelta_AllocationTimestamp", "TraceStore_PerformanceDelta_AllocationTimestampDelta", "TraceStore_PerformanceDelta_Synchronization", "TraceStore_PerformanceDelta_Info", "TraceStore_SourceCode", "TraceStore_SourceCode_MetadataInfo", "TraceStore_SourceCode_Allocation", "TraceStore_SourceCode_Relocation", "TraceStore_SourceCode_Address", "TraceStore_SourceCode_AddressRange", "TraceStore_SourceCode_AllocationTimestamp", "TraceStore_SourceCode_AllocationTimestampDelta", "TraceStore_SourceCode_Synchronization", "TraceStore_SourceCode_Info", "TraceStore_Bitmap", "TraceStore_Bitmap_MetadataInfo", "TraceStore_Bitmap_Allocation", "TraceStore_Bitmap_Relocation", "TraceStore_Bitmap_Address", "TraceStore_Bitmap_AddressRange", "TraceStore_Bitmap_AllocationTimestamp", "TraceStore_Bitmap_AllocationTimestampDelta", "TraceStore_Bitmap_Synchronization", "TraceStore_Bitmap_Info", "TraceStore_ImageFile", "TraceStore_ImageFile_MetadataInfo", "TraceStore_ImageFile_Allocation", "TraceStore_ImageFile_Relocation", "TraceStore_ImageFile_Address", "TraceStore_ImageFile_AddressRange", "TraceStore_ImageFile_AllocationTimestamp", "TraceStore_ImageFile_AllocationTimestampDelta", "TraceStore_ImageFile_Synchronization", "TraceStore_ImageFile_Info", "TraceStore_UnicodeStringBuffer", "TraceStore_UnicodeStringBuffer_MetadataInfo", "TraceStore_UnicodeStringBuffer_Allocation", "TraceStore_UnicodeStringBuffer_Relocation", "TraceStore_UnicodeStringBuffer_Address", "TraceStore_UnicodeStringBuffer_AddressRange", "TraceStore_UnicodeStringBuffer_AllocationTimestamp", "TraceStore_UnicodeStringBuffer_AllocationTimestampDelta", "TraceStore_UnicodeStringBuffer_Synchronization", "TraceStore_UnicodeStringBuffer_Info", "TraceStore_Line", "TraceStore_Line_MetadataInfo", "TraceStore_Line_Allocation", "TraceStore_Line_Relocation", "TraceStore_Line_Address", "TraceStore_Line_AddressRange", "TraceStore_Line_AllocationTimestamp", "TraceStore_Line_AllocationTimestampDelta", "TraceStore_Line_Synchronization", "TraceStore_Line_Info", "TraceStore_Object", "TraceStore_Object_MetadataInfo", "TraceStore_Object_Allocation", "TraceStore_Object_Relocation", "TraceStore_Object_Address", "TraceStore_Object_AddressRange", "TraceStore_Object_AllocationTimestamp", "TraceStore_Object_AllocationTimestampDelta", "TraceStore_Object_Synchronization", "TraceStore_Object_Info", "TraceStore_ModuleLoadEvent", "TraceStore_ModuleLoadEvent_MetadataInfo", "TraceStore_ModuleLoadEvent_Allocation", "TraceStore_ModuleLoadEvent_Relocation", "TraceStore_ModuleLoadEvent_Address", "TraceStore_ModuleLoadEvent_AddressRange", "TraceStore_ModuleLoadEvent_AllocationTimestamp", "TraceStore_ModuleLoadEvent_AllocationTimestampDelta", "TraceStore_ModuleLoadEvent_Synchronization", "TraceStore_ModuleLoadEvent_Info", "TraceStore_SymbolTable", "TraceStore_SymbolTable_MetadataInfo", "TraceStore_SymbolTable_Allocation", "TraceStore_SymbolTable_Relocation", "TraceStore_SymbolTable_Address", "TraceStore_SymbolTable_AddressRange", "TraceStore_SymbolTable_AllocationTimestamp", "TraceStore_SymbolTable_AllocationTimestampDelta", "TraceStore_SymbolTable_Synchronization", "TraceStore_SymbolTable_Info", "TraceStore_SymbolTableEntry", "TraceStore_SymbolTableEntry_MetadataInfo", "TraceStore_SymbolTableEntry_Allocation", "TraceStore_SymbolTableEntry_Relocation", "TraceStore_SymbolTableEntry_Address", "TraceStore_SymbolTableEntry_AddressRange", "TraceStore_SymbolTableEntry_AllocationTimestamp", "TraceStore_SymbolTableEntry_AllocationTimestampDelta", "TraceStore_SymbolTableEntry_Synchronization", "TraceStore_SymbolTableEntry_Info", "TraceStore_SymbolModuleInfo", "TraceStore_SymbolModuleInfo_MetadataInfo", "TraceStore_SymbolModuleInfo_Allocation", "TraceStore_SymbolModuleInfo_Relocation", "TraceStore_SymbolModuleInfo_Address", "TraceStore_SymbolModuleInfo_AddressRange", "TraceStore_SymbolModuleInfo_AllocationTimestamp", "TraceStore_SymbolModuleInfo_AllocationTimestampDelta", "TraceStore_SymbolModuleInfo_Synchronization", "TraceStore_SymbolModuleInfo_Info", "TraceStore_SymbolFile", "TraceStore_SymbolFile_MetadataInfo", "TraceStore_SymbolFile_Allocation", "TraceStore_SymbolFile_Relocation", "TraceStore_SymbolFile_Address", "TraceStore_SymbolFile_AddressRange", "TraceStore_SymbolFile_AllocationTimestamp", "TraceStore_SymbolFile_AllocationTimestampDelta", "TraceStore_SymbolFile_Synchronization", "TraceStore_SymbolFile_Info", "TraceStore_SymbolInfo", "TraceStore_SymbolInfo_MetadataInfo", "TraceStore_SymbolInfo_Allocation", "TraceStore_SymbolInfo_Relocation", "TraceStore_SymbolInfo_Address", "TraceStore_SymbolInfo_AddressRange", "TraceStore_SymbolInfo_AllocationTimestamp", "TraceStore_SymbolInfo_AllocationTimestampDelta", "TraceStore_SymbolInfo_Synchronization", "TraceStore_SymbolInfo_Info", "TraceStore_SymbolLine", "TraceStore_SymbolLine_MetadataInfo", "TraceStore_SymbolLine_Allocation", "TraceStore_SymbolLine_Relocation", "TraceStore_SymbolLine_Address", "TraceStore_SymbolLine_AddressRange", "TraceStore_SymbolLine_AllocationTimestamp", "TraceStore_SymbolLine_AllocationTimestampDelta", "TraceStore_SymbolLine_Synchronization", "TraceStore_SymbolLine_Info", "TraceStore_SymbolType", "TraceStore_SymbolType_MetadataInfo", "TraceStore_SymbolType_Allocation", "TraceStore_SymbolType_Relocation", "TraceStore_SymbolType_Address", "TraceStore_SymbolType_AddressRange", "TraceStore_SymbolType_AllocationTimestamp", "TraceStore_SymbolType_AllocationTimestampDelta", "TraceStore_SymbolType_Synchronization", "TraceStore_SymbolType_Info", "TraceStore_StackFrame", "TraceStore_StackFrame_MetadataInfo", "TraceStore_StackFrame_Allocation", "TraceStore_StackFrame_Relocation", "TraceStore_StackFrame_Address", "TraceStore_StackFrame_AddressRange", "TraceStore_StackFrame_AllocationTimestamp", "TraceStore_StackFrame_AllocationTimestampDelta", "TraceStore_StackFrame_Synchronization", "TraceStore_StackFrame_Info", "TraceStore_TypeInfoTable", "TraceStore_TypeInfoTable_MetadataInfo", "TraceStore_TypeInfoTable_Allocation", "TraceStore_TypeInfoTable_Relocation", "TraceStore_TypeInfoTable_Address", "TraceStore_TypeInfoTable_AddressRange", "TraceStore_TypeInfoTable_AllocationTimestamp", "TraceStore_TypeInfoTable_AllocationTimestampDelta", "TraceStore_TypeInfoTable_Synchronization", "TraceStore_TypeInfoTable_Info", "TraceStore_TypeInfoTableEntry", "TraceStore_TypeInfoTableEntry_MetadataInfo", "TraceStore_TypeInfoTableEntry_Allocation", "TraceStore_TypeInfoTableEntry_Relocation", "TraceStore_TypeInfoTableEntry_Address", "TraceStore_TypeInfoTableEntry_AddressRange", "TraceStore_TypeInfoTableEntry_AllocationTimestamp", "TraceStore_TypeInfoTableEntry_AllocationTimestampDelta", "TraceStore_TypeInfoTableEntry_Synchronization", "TraceStore_TypeInfoTableEntry_Info", "TraceStore_TypeInfoStringBuffer", "TraceStore_TypeInfoStringBuffer_MetadataInfo", "TraceStore_TypeInfoStringBuffer_Allocation", "TraceStore_TypeInfoStringBuffer_Relocation", "TraceStore_TypeInfoStringBuffer_Address", "TraceStore_TypeInfoStringBuffer_AddressRange", "TraceStore_TypeInfoStringBuffer_AllocationTimestamp", "TraceStore_TypeInfoStringBuffer_AllocationTimestampDelta", "TraceStore_TypeInfoStringBuffer_Synchronization", "TraceStore_TypeInfoStringBuffer_Info", "TraceStore_FunctionTable", "TraceStore_FunctionTable_MetadataInfo", "TraceStore_FunctionTable_Allocation", "TraceStore_FunctionTable_Relocation", "TraceStore_FunctionTable_Address", "TraceStore_FunctionTable_AddressRange", "TraceStore_FunctionTable_AllocationTimestamp", "TraceStore_FunctionTable_AllocationTimestampDelta", "TraceStore_FunctionTable_Synchronization", "TraceStore_FunctionTable_Info", "TraceStore_FunctionTableEntry", "TraceStore_FunctionTableEntry_MetadataInfo", "TraceStore_FunctionTableEntry_Allocation", "TraceStore_FunctionTableEntry_Relocation", "TraceStore_FunctionTableEntry_Address", "TraceStore_FunctionTableEntry_AddressRange", "TraceStore_FunctionTableEntry_AllocationTimestamp", "TraceStore_FunctionTableEntry_AllocationTimestampDelta", "TraceStore_FunctionTableEntry_Synchronization", "TraceStore_FunctionTableEntry_Info", "TraceStore_FunctionAssembly", "TraceStore_FunctionAssembly_MetadataInfo", "TraceStore_FunctionAssembly_Allocation", "TraceStore_FunctionAssembly_Relocation", "TraceStore_FunctionAssembly_Address", "TraceStore_FunctionAssembly_AddressRange", "TraceStore_FunctionAssembly_AllocationTimestamp", "TraceStore_FunctionAssembly_AllocationTimestampDelta", "TraceStore_FunctionAssembly_Synchronization", "TraceStore_FunctionAssembly_Info", "TraceStore_FunctionSourceCode", "TraceStore_FunctionSourceCode_MetadataInfo", "TraceStore_FunctionSourceCode_Allocation", "TraceStore_FunctionSourceCode_Relocation", "TraceStore_FunctionSourceCode_Address", "TraceStore_FunctionSourceCode_AddressRange", "TraceStore_FunctionSourceCode_AllocationTimestamp", "TraceStore_FunctionSourceCode_AllocationTimestampDelta", "TraceStore_FunctionSourceCode_Synchronization", "TraceStore_FunctionSourceCode_Info", "TraceStore_ExamineSymbolsLine", "TraceStore_ExamineSymbolsLine_MetadataInfo", "TraceStore_ExamineSymbolsLine_Allocation", "TraceStore_ExamineSymbolsLine_Relocation", "TraceStore_ExamineSymbolsLine_Address", "TraceStore_ExamineSymbolsLine_AddressRange", "TraceStore_ExamineSymbolsLine_AllocationTimestamp", "TraceStore_ExamineSymbolsLine_AllocationTimestampDelta", "TraceStore_ExamineSymbolsLine_Synchronization", "TraceStore_ExamineSymbolsLine_Info", "TraceStore_ExamineSymbolsText", "TraceStore_ExamineSymbolsText_MetadataInfo", "TraceStore_ExamineSymbolsText_Allocation", "TraceStore_ExamineSymbolsText_Relocation", "TraceStore_ExamineSymbolsText_Address", "TraceStore_ExamineSymbolsText_AddressRange", "TraceStore_ExamineSymbolsText_AllocationTimestamp", "TraceStore_ExamineSymbolsText_AllocationTimestampDelta", "TraceStore_ExamineSymbolsText_Synchronization", "TraceStore_ExamineSymbolsText_Info", "TraceStore_ExaminedSymbol", "TraceStore_ExaminedSymbol_MetadataInfo", "TraceStore_ExaminedSymbol_Allocation", "TraceStore_ExaminedSymbol_Relocation", "TraceStore_ExaminedSymbol_Address", "TraceStore_ExaminedSymbol_AddressRange", "TraceStore_ExaminedSymbol_AllocationTimestamp", "TraceStore_ExaminedSymbol_AllocationTimestampDelta", "TraceStore_ExaminedSymbol_Synchronization", "TraceStore_ExaminedSymbol_Info", "TraceStore_ExaminedSymbolSecondary", "TraceStore_ExaminedSymbolSecondary_MetadataInfo", "TraceStore_ExaminedSymbolSecondary_Allocation", "TraceStore_ExaminedSymbolSecondary_Relocation", "TraceStore_ExaminedSymbolSecondary_Address", "TraceStore_ExaminedSymbolSecondary_AddressRange", "TraceStore_ExaminedSymbolSecondary_AllocationTimestamp", "TraceStore_ExaminedSymbolSecondary_AllocationTimestampDelta", "TraceStore_ExaminedSymbolSecondary_Synchronization", "TraceStore_ExaminedSymbolSecondary_Info", "TraceStore_UnassembleFunctionLine", "TraceStore_UnassembleFunctionLine_MetadataInfo", "TraceStore_UnassembleFunctionLine_Allocation", "TraceStore_UnassembleFunctionLine_Relocation", "TraceStore_UnassembleFunctionLine_Address", "TraceStore_UnassembleFunctionLine_AddressRange", "TraceStore_UnassembleFunctionLine_AllocationTimestamp", "TraceStore_UnassembleFunctionLine_AllocationTimestampDelta", "TraceStore_UnassembleFunctionLine_Synchronization", "TraceStore_UnassembleFunctionLine_Info", "TraceStore_UnassembleFunctionText", "TraceStore_UnassembleFunctionText_MetadataInfo", "TraceStore_UnassembleFunctionText_Allocation", "TraceStore_UnassembleFunctionText_Relocation", "TraceStore_UnassembleFunctionText_Address", "TraceStore_UnassembleFunctionText_AddressRange", "TraceStore_UnassembleFunctionText_AllocationTimestamp", "TraceStore_UnassembleFunctionText_AllocationTimestampDelta", "TraceStore_UnassembleFunctionText_Synchronization", "TraceStore_UnassembleFunctionText_Info", "TraceStore_UnassembledFunction", "TraceStore_UnassembledFunction_MetadataInfo", "TraceStore_UnassembledFunction_Allocation", "TraceStore_UnassembledFunction_Relocation", "TraceStore_UnassembledFunction_Address", "TraceStore_UnassembledFunction_AddressRange", "TraceStore_UnassembledFunction_AllocationTimestamp", "TraceStore_UnassembledFunction_AllocationTimestampDelta", "TraceStore_UnassembledFunction_Synchronization", "TraceStore_UnassembledFunction_Info", "TraceStore_UnassembledFunctionSecondary", "TraceStore_UnassembledFunctionSecondary_MetadataInfo", "TraceStore_UnassembledFunctionSecondary_Allocation", "TraceStore_UnassembledFunctionSecondary_Relocation", "TraceStore_UnassembledFunctionSecondary_Address", "TraceStore_UnassembledFunctionSecondary_AddressRange", "TraceStore_UnassembledFunctionSecondary_AllocationTimestamp", "TraceStore_UnassembledFunctionSecondary_AllocationTimestampDelta", "TraceStore_UnassembledFunctionSecondary_Synchronization", "TraceStore_UnassembledFunctionSecondary_Info", "TraceStore_DisplayTypeLine", "TraceStore_DisplayTypeLine_MetadataInfo", "TraceStore_DisplayTypeLine_Allocation", "TraceStore_DisplayTypeLine_Relocation", "TraceStore_DisplayTypeLine_Address", "TraceStore_DisplayTypeLine_AddressRange", "TraceStore_DisplayTypeLine_AllocationTimestamp", "TraceStore_DisplayTypeLine_AllocationTimestampDelta", "TraceStore_DisplayTypeLine_Synchronization", "TraceStore_DisplayTypeLine_Info", "TraceStore_DisplayTypeText", "TraceStore_DisplayTypeText_MetadataInfo", "TraceStore_DisplayTypeText_Allocation", "TraceStore_DisplayTypeText_Relocation", "TraceStore_DisplayTypeText_Address", "TraceStore_DisplayTypeText_AddressRange", "TraceStore_DisplayTypeText_AllocationTimestamp", "TraceStore_DisplayTypeText_AllocationTimestampDelta", "TraceStore_DisplayTypeText_Synchronization", "TraceStore_DisplayTypeText_Info", "TraceStore_DisplayedType", "TraceStore_DisplayedType_MetadataInfo", "TraceStore_DisplayedType_Allocation", "TraceStore_DisplayedType_Relocation", "TraceStore_DisplayedType_Address", "TraceStore_DisplayedType_AddressRange", "TraceStore_DisplayedType_AllocationTimestamp", "TraceStore_DisplayedType_AllocationTimestampDelta", "TraceStore_DisplayedType_Synchronization", "TraceStore_DisplayedType_Info", "TraceStore_DisplayedTypeSecondary", "TraceStore_DisplayedTypeSecondary_MetadataInfo", "TraceStore_DisplayedTypeSecondary_Allocation", "TraceStore_DisplayedTypeSecondary_Relocation", "TraceStore_DisplayedTypeSecondary_Address", "TraceStore_DisplayedTypeSecondary_AddressRange", "TraceStore_DisplayedTypeSecondary_AllocationTimestamp", "TraceStore_DisplayedTypeSecondary_AllocationTimestampDelta", "TraceStore_DisplayedTypeSecondary_Synchronization", "TraceStore_DisplayedTypeSecondary_Info", }; CONST LPCSTR TraceStoreSqlite3IntervalVirtualTableNames[] = { "PythonTracer_TraceEvent_Interval", "TraceStore_StringBuffer_Interval", "Python_PythonFunctionTable_Interval", "Python_PythonFunctionTableEntry_Interval", "Python_PythonPathTable_Interval", "Python_PythonPathTableEntry_Interval", "TraceStore_PageFault_Interval", "StringTable_StringArray_Interval", "StringTable_StringTable_Interval", "PythonTracer_TraceEventTraitsEx_Interval", "TraceStore_WsWatchInfoEx_Interval", "TraceStore_WsWorkingSetExInfo_Interval", "TraceStore_CCallStackTable_Interval", "TraceStore_CCallStackTableEntry_Interval", "TraceStore_ModuleTable_Interval", "TraceStore_ModuleTableEntry_Interval", "Python_PythonCallStackTable_Interval", "Python_PythonCallStackTableEntry_Interval", "Python_PythonModuleTable_Interval", "Python_PythonModuleTableEntry_Interval", "TraceStore_LineTable_Interval", "TraceStore_LineTableEntry_Interval", "TraceStore_LineStringBuffer_Interval", "TraceStore_CallStack_Interval", "TraceStore_Performance_Interval", "TraceStore_PerformanceDelta_Interval", "TraceStore_SourceCode_Interval", "TraceStore_Bitmap_Interval", "TraceStore_ImageFile_Interval", "TraceStore_UnicodeStringBuffer_Interval", "TraceStore_Line_Interval", "TraceStore_Object_Interval", "TraceStore_ModuleLoadEvent_Interval", "TraceStore_SymbolTable_Interval", "TraceStore_SymbolTableEntry_Interval", "TraceStore_SymbolModuleInfo_Interval", "TraceStore_SymbolFile_Interval", "TraceStore_SymbolInfo_Interval", "TraceStore_SymbolLine_Interval", "TraceStore_SymbolType_Interval", "TraceStore_StackFrame_Interval", "TraceStore_TypeInfoTable_Interval", "TraceStore_TypeInfoTableEntry_Interval", "TraceStore_TypeStringBuffer_Interval", "TraceStore_FunctionTable_Interval", "TraceStore_FunctionTableEntry_Interval", "TraceStore_FunctionAssembly_Interval", "TraceStore_FunctionSourceCode_Interval", "TraceStore_ExamineSymbolsLines_Interval", "TraceStore_ExamineSymbolsText_Interval", "TraceStore_ExaminedSymbol_Interval", "TraceStore_ExaminedSymbolSecondary_Interval", "TraceStore_UnassembleFunctionLines_Interval", "TraceStore_UnassembleFunctionText_Interval", "TraceStore_UnassembledFunction_Interval", "TraceStore_UnassembledFunctionSecondary_Interval", "TraceStore_DisplayTypeLines_Interval", "TraceStore_DisplayTypeText_Interval", "TraceStore_DisplayedType_Interval", "TraceStore_DisplayedTypeSecondary_Interval", }; CONST TRACE_STORE_ID TraceStoreIds[] = { TraceStoreNullId, TraceStoreEventId, TraceStoreStringBufferId, TraceStorePythonFunctionTableId, TraceStorePythonFunctionTableEntryId, TraceStorePythonPathTableId, TraceStorePythonPathTableEntryId, TraceStorePageFaultId, TraceStoreStringArrayId, TraceStoreStringTableId, TraceStoreEventTraitsExId, TraceStoreWsWatchInfoExId, TraceStoreWsWorkingSetExInfoId, TraceStoreCCallStackTableId, TraceStoreCCallStackTableEntryId, TraceStoreModuleTableId, TraceStoreModuleTableEntryId, TraceStorePythonCallStackTableId, TraceStorePythonCallStackTableEntryId, TraceStorePythonModuleTableId, TraceStorePythonModuleTableEntryId, TraceStoreLineTableId, TraceStoreLineTableEntryId, TraceStoreLineStringBufferId, TraceStoreCallStackId, TraceStorePerformanceId, TraceStorePerformanceDeltaId, TraceStoreSourceCodeId, TraceStoreBitmapId, TraceStoreImageFileId, TraceStoreUnicodeStringBufferId, TraceStoreLineId, TraceStoreObjectId, TraceStoreModuleLoadEventId, TraceStoreSymbolTableId, TraceStoreSymbolTableEntryId, TraceStoreSymbolModuleInfoId, TraceStoreSymbolFileId, TraceStoreSymbolInfoId, TraceStoreSymbolLineId, TraceStoreSymbolTypeId, TraceStoreStackFrameId, TraceStoreTypeInfoTableId, TraceStoreTypeInfoTableEntryId, TraceStoreTypeInfoStringBufferId, TraceStoreFunctionTableId, TraceStoreFunctionTableEntryId, TraceStoreFunctionAssemblyId, TraceStoreFunctionSourceCodeId, TraceStoreExamineSymbolsLineId, TraceStoreExamineSymbolsTextId, TraceStoreExaminedSymbolId, TraceStoreExaminedSymbolSecondaryId, TraceStoreUnassembleFunctionLineId, TraceStoreUnassembleFunctionTextId, TraceStoreUnassembledFunctionId, TraceStoreUnassembledFunctionSecondaryId, TraceStoreDisplayTypeLineId, TraceStoreDisplayTypeTextId, TraceStoreDisplayedTypeId, TraceStoreDisplayedTypeSecondaryId, TraceStoreInvalidId, }; CONST WCHAR TraceStoreMetadataInfoSuffix[] = L":MetadataInfo"; CONST DWORD TraceStoreMetadataInfoSuffixLength = ( sizeof(TraceStoreMetadataInfoSuffix) / sizeof(WCHAR) ); CONST WCHAR TraceStoreAllocationSuffix[] = L":Allocation"; CONST DWORD TraceStoreAllocationSuffixLength = ( sizeof(TraceStoreAllocationSuffix) / sizeof(WCHAR) ); CONST WCHAR TraceStoreRelocationSuffix[] = L":Relocation"; CONST DWORD TraceStoreRelocationSuffixLength = ( sizeof(TraceStoreRelocationSuffix) / sizeof(WCHAR) ); CONST WCHAR TraceStoreAddressSuffix[] = L":Address"; CONST DWORD TraceStoreAddressSuffixLength = ( sizeof(TraceStoreAddressSuffix) / sizeof(WCHAR) ); CONST WCHAR TraceStoreAddressRangeSuffix[] = L":AddressRange"; CONST DWORD TraceStoreAddressRangeSuffixLength = ( sizeof(TraceStoreAddressRangeSuffix) / sizeof(WCHAR) ); CONST WCHAR TraceStoreAllocationTimestampSuffix[] = L":AllocationTimestamp"; CONST DWORD TraceStoreAllocationTimestampSuffixLength = ( sizeof(TraceStoreAllocationTimestampSuffix) / sizeof(WCHAR) ); CONST WCHAR TraceStoreAllocationTimestampDeltaSuffix[] = ( L":AllocationTimestampDelta" ); CONST DWORD TraceStoreAllocationTimestampDeltaSuffixLength = ( sizeof(TraceStoreAllocationTimestampDeltaSuffix) / sizeof(WCHAR) ); CONST WCHAR TraceStoreSynchronizationSuffix[] = L":Synchronization"; CONST DWORD TraceStoreSynchronizationSuffixLength = ( sizeof(TraceStoreSynchronizationSuffix) / sizeof(WCHAR) ); CONST WCHAR TraceStoreInfoSuffix[] = L":Info"; CONST DWORD TraceStoreInfoSuffixLength = ( sizeof(TraceStoreInfoSuffix) / sizeof(WCHAR) ); CONST USHORT LongestTraceStoreSuffixLength = ( sizeof(TraceStoreAllocationTimestampDeltaSuffixLength) / sizeof(WCHAR) ); CONST USHORT NumberOfTraceStores = ( sizeof(TraceStoreFileNames) / sizeof(LPCWSTR) ); CONST LPCWSTR TraceStoreMetadataSuffixes[] = { TraceStoreMetadataInfoSuffix, TraceStoreAllocationSuffix, TraceStoreRelocationSuffix, TraceStoreAddressSuffix, TraceStoreAddressRangeSuffix, TraceStoreAllocationTimestampSuffix, TraceStoreAllocationTimestampDeltaSuffix, TraceStoreSynchronizationSuffix, TraceStoreInfoSuffix, }; CONST TRACE_STORE_METADATA_ID TraceStoreMetadataIds[] = { TraceStoreMetadataNullId, TraceStoreMetadataMetadataInfoId, TraceStoreMetadataAllocationId, TraceStoreMetadataRelocationId, TraceStoreMetadataAddressId, TraceStoreMetadataAddressRangeId, TraceStoreMetadataAllocationTimestampId, TraceStoreMetadataAllocationTimestampDeltaId, TraceStoreMetadataSynchronizationId, TraceStoreMetadataInfoId, TraceStoreMetadataInvalidId, }; #define NUMBER_OF_METADATA_STORES ( \ sizeof(TraceStoreMetadataSuffixes) / \ sizeof(TraceStoreMetadataSuffixes[0]) \ ) CONST USHORT NumberOfMetadataStores = NUMBER_OF_METADATA_STORES; CONST USHORT ElementsPerTraceStore = NUMBER_OF_METADATA_STORES + 1; // // Size key: // 1 << 16 == 64KB // 1 << 21 == 2MB // 1 << 22 == 4MB // 1 << 23 == 8MB // 1 << 24 == 16MB // 1 << 25 == 32MB // 1 << 26 == 64MB // 1 << 27 == 128MB // 1 << 28 == 256MB // 1 << 29 == 512MB // 1 << 30 == 1024MB // 1 << 31 == 2048MB // 1 << 32 == 4096MB // // N.B.: the trace store size should always be greater than or equal to the // mapping size. // #ifdef _DEBUG // // Use smaller versions of files when debugging. // #define TRACE_STORE_USE_SMALLER_INITIAL_FILE_SIZES #endif #ifdef TRACE_STORE_USE_SMALLER_INITIAL_FILE_SIZES LONGLONG InitialTraceStoreFileSizesAsLongLong[] = { 1 << 30, // Event 1 << 25, // StringBuffer 1 << 16, // PythonFunctionTable 1 << 25, // PythonFunctionTableEntry 1 << 16, // PathTable 1 << 25, // PathTableEntry 1 << 26, // TracePageFault 1 << 21, // StringArray 1 << 21, // StringTable 1 << 25, // EventTraitsEx 1 << 25, // WsWatchInfoEx 1 << 25, // WorkingSetExInfo 1 << 16, // CCallStackTable 1 << 25, // CCallStackTableEntry 1 << 16, // ModuleTable 1 << 25, // ModuleTableEntry 1 << 16, // PythonCallStackTable 1 << 25, // PythonCallStackTableEntry 1 << 16, // PythonModuleTable 1 << 25, // PythonModuleTableEntry 1 << 16, // LineTable 1 << 25, // LineTableEntry 1 << 25, // LineStringBuffer 1 << 25, // CallStack 1 << 25, // Performance 1 << 25, // PerformanceDelta 1 << 25, // SourceCode 1 << 24, // Bitmap 1 << 27, // ImageFile 1 << 23, // UnicodeStringBuffer 1 << 24, // Line 1 << 23, // Object 1 << 23, // ModuleLoadEvent 1 << 16, // SymbolTable 1 << 25, // SymbolTableEntry 1 << 25, // SymbolModuleInfo 1 << 27, // SymbolFile 1 << 24, // SymbolInfo 1 << 24, // SymbolLine 1 << 24, // SymbolType 1 << 25, // StackFrame 1 << 16, // TypeInfoTable 1 << 25, // TypeInfoTableEntry 1 << 25, // TypeInfoStringBuffer 1 << 16, // FunctionTable 1 << 26, // FunctionTableEntry 1 << 25, // FunctionAssembly 1 << 25, // FunctionSourceCode 1 << 23, // ExamineSymbolsLines 1 << 25, // ExamineSymbolsText 1 << 25, // ExaminedSymbol 1 << 23, // ExaminedSymbolSecondary 1 << 23, // UnassembleFunctionLines 1 << 25, // UnassembleFunctionText 1 << 25, // UnassembledFunction 1 << 23, // UnassembledFunctionSecondary 1 << 23, // DisplayTypeLines 1 << 25, // DisplayTypeText 1 << 25, // DisplayedType 1 << 23, // DisplayedTypeSecondary }; #else LONGLONG InitialTraceStoreFileSizesAsLongLong[] = { 1 << 30, // Event 1 << 25, // StringBuffer 1 << 16, // PythonFunctionTable 1 << 26, // PythonFunctionTableEntry 1 << 16, // PathTable 1 << 26, // PathTableEntry 1 << 26, // TracePageFault 1 << 21, // StringArray 1 << 21, // StringTable 1 << 30, // EventTraitsEx 1 << 27, // WsWatchInfoEx 1 << 26, // WorkingSetExInfo 1 << 16, // CCallStackTable 1 << 25, // CCallStackTableEntry 1 << 16, // ModuleTable 1 << 25, // ModuleTableEntry 1 << 16, // PythonCallStackTable 1 << 25, // PythonCallStackTableEntry 1 << 16, // PythonModuleTable 1 << 25, // PythonModuleTableEntry 1 << 16, // LineTable 1 << 25, // LineTableEntry 1 << 25, // LineStringBuffer 1 << 27, // CallStack 1 << 25, // Performance 1 << 25, // PerformanceDelta 1 << 27, // SourceCode 1 << 24, // Bitmap 1 << 29, // ImageFile 1 << 23, // UnicodeStringBuffer 1 << 24, // Line 1 << 23, // Object 1 << 23, // ModuleLoadEvent 1 << 16, // SymbolTable 1 << 28, // SymbolTableEntry 1 << 27, // SymbolModuleInfo 1 << 29, // SymbolFile 1 << 24, // SymbolInfo 1 << 24, // SymbolLine 1 << 24, // SymbolType 1 << 25, // StackFrame 1 << 16, // TypeInfoTable 1 << 27, // TypeInfoTableEntry 1 << 26, // TypeInfoStringBuffer 1 << 16, // FunctionTable 1 << 26, // FunctionTableEntry 1 << 27, // FunctionAssembly 1 << 27, // FunctionSourceCode 1 << 23, // ExamineSymbolsLines 1 << 25, // ExamineSymbolsText 1 << 25, // ExaminedSymbol 1 << 23, // ExaminedSymbolSecondary 1 << 23, // UnassembleFunctionLines 1 << 25, // UnassembleFunctionText 1 << 25, // UnassembledFunction 1 << 23, // UnassembledFunctionSecondary 1 << 23, // DisplayTypeLines 1 << 25, // DisplayTypeText 1 << 25, // DisplayedType 1 << 23, // DisplayedTypeSecondary }; #endif CONST PLARGE_INTEGER InitialTraceStoreFileSizes = (PLARGE_INTEGER)( InitialTraceStoreFileSizesAsLongLong ); // // N.B. To add a new flag to each store in vim, mark the brace boundaries with // ma and mb, and then run the command: // // :'a,'b s:0 // Unused$:0, // NewFlag\r 0 // Unused: // // Where NewFlag is the name of the new flag to add. // CONST TRACE_STORE_TRAITS TraceStoreTraits[] = { // // Event // { 0, // VaryingRecordSize 1, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 1, // StreamingWrite 1, // StreamingRead 1, // FrequentAllocations 0, // BlockingAllocations 0, // LinkedStore 1, // CoalescedAllocations 0, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 1, // Compress 0 // Unused }, // // StringBuffer // { 1, // VaryingRecordSize 0, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 0, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 0, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 0, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 1, // Compress 0 // Unused }, // // PythonFunctionTable // { 0, // VaryingRecordSize 1, // RecordSizeIsAlwaysPowerOf2 0, // MultipleRecords 0, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 0, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 0, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 0, // Compress 0 // Unused }, // // PythonFunctionTableEntry // { 0, // VaryingRecordSize 1, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 0, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 0, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 0, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 0, // Compress 0 // Unused }, // // PythonPathTable // { 0, // VaryingRecordSize 1, // RecordSizeIsAlwaysPowerOf2 0, // MultipleRecords 0, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 0, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 0, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 0, // Compress 0 // Unused }, // // PythonPathTableEntry // { 0, // VaryingRecordSize 1, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 0, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 0, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 0, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 0, // Compress 0 // Unused }, // // TracePageFault // { 0, // VaryingRecordSize 1, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 1, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 1, // BlockingAllocations 0, // LinkedStore 1, // CoalescedAllocations 0, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 1, // Compress 0 // Unused }, // // StringArray // { 1, // VaryingRecordSize 0, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 0, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 1, // BlockingAllocations 0, // LinkedStore 1, // CoalescedAllocations 1, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 0, // Compress 0 // Unused }, // // StringTable // { 0, // VaryingRecordSize 1, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 0, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 1, // BlockingAllocations 0, // LinkedStore 1, // CoalescedAllocations 1, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 0, // Compress 0 // Unused }, // // EventTraitsEx // { 0, // VaryingRecordSize 1, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 1, // StreamingWrite 1, // StreamingRead 1, // FrequentAllocations 1, // BlockingAllocations 1, // LinkedStore 1, // CoalescedAllocations 0, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 1, // Compress 0 // Unused }, // // WsWatchInfoEx // { 0, // VaryingRecordSize 1, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 1, // StreamingWrite 1, // StreamingRead 1, // FrequentAllocations 0, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 0, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 1, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 1, // Compress 0 // Unused }, // // WsWorkingSetEx // { 0, // VaryingRecordSize 1, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 1, // StreamingWrite 1, // StreamingRead 1, // FrequentAllocations 1, // BlockingAllocations 1, // LinkedStore (linked to WsWatchInfoEx) 0, // CoalescedAllocations 0, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 1, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 1, // Compress 0 // Unused }, // // CCallStackTable // { 0, // VaryingRecordSize 1, // RecordSizeIsAlwaysPowerOf2 0, // MultipleRecords 0, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 0, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 0, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 0, // Compress 0 // Unused }, // // CCallStackTableEntry // { 0, // VaryingRecordSize 1, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 0, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 0, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 1, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 0, // Compress 0 // Unused }, // // ModuleTable // { 0, // VaryingRecordSize 1, // RecordSizeIsAlwaysPowerOf2 0, // MultipleRecords 0, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 0, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 0, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 1, // ConcurrentDataStructure 0, // NoAllocationAlignment 0, // Compress 0 // Unused }, // // ModuleTableEntry // { 0, // VaryingRecordSize 1, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 0, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 0, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 0, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 0, // Compress 0 // Unused }, // // PythonCallStackTable // { 0, // VaryingRecordSize 1, // RecordSizeIsAlwaysPowerOf2 0, // MultipleRecords 0, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 0, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 0, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 0, // Compress 0 // Unused }, // // PythonCallStackTableEntry // { 0, // VaryingRecordSize 1, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 0, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 0, // BlockingAllocations 0, // LinkedStore 0, // PythonoalescedAllocations 0, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 0, // Compress 0 // Unused }, // // PythonModuleTable // { 0, // VaryingRecordSize 1, // RecordSizeIsAlwaysPowerOf2 0, // MultipleRecords 0, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 0, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 0, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 0, // Compress 0 // Unused }, // // PythonModuleTableEntry // { 0, // VaryingRecordSize 1, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 0, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 0, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 0, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 0, // Compress 0 // Unused }, // // LineTable // { 0, // VaryingRecordSize 1, // RecordSizeIsAlwaysPowerOf2 0, // MultipleRecords 0, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 0, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 0, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 0, // Compress 0 // Unused }, // // LineTableEntry // { 0, // VaryingRecordSize 1, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 0, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 1, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 1, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 0, // Compress 0 // Unused }, // // LineStringBuffer // { 1, // VaryingRecordSize 1, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 0, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 0, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 1, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 0, // Compress 0 // Unused }, // // CallStack // { 0, // VaryingRecordSize 1, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 1, // StreamingWrite 1, // StreamingRead 1, // FrequentAllocations 0, // BlockingAllocations 0, // LinkedStore 1, // CoalescedAllocations 0, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 1, // Compress 0 // Unused }, // // Performance // { 0, // VaryingRecordSize 1, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 1, // StreamingWrite 1, // StreamingRead 0, // FrequentAllocations 1, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 0, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 1, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 1, // Compress 0 // Unused }, // // PerformanceDelta // { 0, // VaryingRecordSize 1, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 1, // StreamingWrite 1, // StreamingRead 0, // FrequentAllocations 1, // BlockingAllocations 1, // LinkedStore 1, // CoalescedAllocations 0, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 1, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 1, // Compress 0 // Unused }, // // SourceCode // { 1, // VaryingRecordSize 0, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 0, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 1, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 1, // ConcurrentAllocations 0, // AllowPageSpill 1, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 1, // Compress 0 // Unused }, // // Bitmap // { 1, // VaryingRecordSize 0, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 0, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 1, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 1, // ConcurrentAllocations 1, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 1, // Compress 0 // Unused }, // // ImageFile // { 1, // VaryingRecordSize 0, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 0, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 1, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 1, // ConcurrentAllocations 0, // AllowPageSpill 1, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 1, // Compress 0 // Unused }, // // UnicodeStringBuffer // { 1, // VaryingRecordSize 0, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 0, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 1, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 1, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 1, // Compress 0 // Unused }, // // Line // { 0, // VaryingRecordSize 1, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 0, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 1, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 1, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 0, // Compress 0 // Unused }, // // Object // { 1, // VaryingRecordSize 0, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 0, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 1, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 1, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 0, // Compress 0 // Unused }, // // ModuleLoadEvent // { 0, // VaryingRecordSize 1, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 0, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 1, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 1, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 0, // Compress 0 // Unused }, // // SymbolTable // { 0, // VaryingRecordSize 1, // RecordSizeIsAlwaysPowerOf2 0, // MultipleRecords 0, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 0, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 0, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 1, // ConcurrentDataStructure 0, // NoAllocationAlignment 0, // Compress 0 // Unused }, // // SymbolTableEntry // { 0, // VaryingRecordSize 1, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 0, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 1, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 0, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 0, // Compress 0 // Unused }, // // SymbolModuleInfo // { 0, // VaryingRecordSize 0, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 0, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 1, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 0, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 0, // Compress 0 // Unused }, // // SymbolFile // { 1, // VaryingRecordSize 0, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 0, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 1, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 1, // ConcurrentAllocations 0, // AllowPageSpill 1, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 0, // Compress 0 // Unused }, // // SymbolInfo // { 1, // VaryingRecordSize 0, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 0, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 1, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 1, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 1, // Compress 0 // Unused }, // // SymbolLine // { 1, // VaryingRecordSize 0, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 0, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 1, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 0, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 0, // Compress 0 // Unused }, // // SymbolType // { 1, // VaryingRecordSize 0, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 0, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 1, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 0, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 0, // Compress 0 // Unused }, // // StackFrame // { 1, // VaryingRecordSize 0, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 0, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 1, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 1, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 0, // Compress 0 // Unused }, // // TypeInfoTable // { 0, // VaryingRecordSize 1, // RecordSizeIsAlwaysPowerOf2 0, // MultipleRecords 0, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 0, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 0, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 1, // ConcurrentDataStructure 0, // NoAllocationAlignment 0, // Compress 0 // Unused }, // // TypeInfoTableEntry // { 0, // VaryingRecordSize 1, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 0, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 1, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 1, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 1, // ConcurrentDataStructure 0, // NoAllocationAlignment 0, // Compress 0 // Unused }, // // TypeInfoStringBuffer // { 1, // VaryingRecordSize 0, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 0, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 1, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 1, // ConcurrentAllocations 1, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 0, // Compress 0 // Unused }, // // FunctionTable // { 0, // VaryingRecordSize 1, // RecordSizeIsAlwaysPowerOf2 0, // MultipleRecords 0, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 0, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 0, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 1, // ConcurrentDataStructure 0, // NoAllocationAlignment 0, // Compress 0 // Unused }, // // FunctionTableEntry // { 0, // VaryingRecordSize 1, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 0, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 1, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 1, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 0, // Compress 0 // Unused }, // // FunctionAssembly // { 1, // VaryingRecordSize 0, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 0, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 1, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 1, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 0, // Compress 0 // Unused }, // // FunctionSourceCode // { 1, // VaryingRecordSize 0, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 0, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 1, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 1, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 1, // Compress 0 // Unused }, // // ExamineSymbolsLines // { 0, // VaryingRecordSize 1, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 1, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 1, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 0, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 0, // Compress 0 // Unused }, // // ExamineSymbolsText // { 1, // VaryingRecordSize 0, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 0, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 1, // BlockingAllocations 1, // LinkedStore 0, // CoalescedAllocations 0, // ConcurrentAllocations 1, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 1, // NoAllocationAlignment 0, // Compress 0 // Unused }, // // ExaminedSymbol // { 0, // VaryingRecordSize 0, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 0, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 1, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 0, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 0, // Compress 0 // Unused }, // // ExaminedSymbolSecondary // { 1, // VaryingRecordSize 0, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 0, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 1, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 0, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 0, // Compress 0 // Unused }, // // UnassembleFunctionLines // { 0, // VaryingRecordSize 1, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 1, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 1, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 0, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 0, // Compress 0 // Unused }, // // UnassembleFunctionText // { 1, // VaryingRecordSize 0, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 0, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 1, // BlockingAllocations 1, // LinkedStore 0, // CoalescedAllocations 0, // ConcurrentAllocations 1, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 1, // NoAllocationAlignment 0, // Compress 0 // Unused }, // // UnassembledFunction // { 0, // VaryingRecordSize 0, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 0, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 1, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 0, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 0, // Compress 0 // Unused }, // // UnassembledFunctionSecondary // { 1, // VaryingRecordSize 0, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 0, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 1, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 0, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 0, // Compress 0 // Unused }, // // DisplayTypeLines // { 0, // VaryingRecordSize 1, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 1, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 1, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 0, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 0, // Compress 0 // Unused }, // // DisplayTypeText // { 1, // VaryingRecordSize 0, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 0, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 1, // BlockingAllocations 1, // LinkedStore 0, // CoalescedAllocations 0, // ConcurrentAllocations 1, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 1, // NoAllocationAlignment 0, // Compress 0 // Unused }, // // DisplayedType // { 0, // VaryingRecordSize 0, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 0, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 1, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 0, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 0, // Compress 0 // Unused }, // // DisplayedTypeSecondary // { 1, // VaryingRecordSize 0, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 0, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 1, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 0, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 0, // Compress 0 // Unused }, }; CONST TRACE_STORE_STRUCTURE_SIZES TraceStoreStructureSizes = { sizeof(TRACE_STORE), sizeof(TRACE_STORES), sizeof(TRACE_CONTEXT), sizeof(TRACE_STORE_START_TIME), sizeof(TRACE_STORE_INFO), sizeof(TRACE_STORE_METADATA_INFO), sizeof(TRACE_STORE_RELOC), sizeof(TRACE_STORE_ADDRESS), sizeof(TRACE_STORE_ADDRESS_RANGE), sizeof(ADDRESS_BIT_COUNTS), }; CONST LARGE_INTEGER MinimumMappingSize = { 1 << 16 }; // 64KB CONST LARGE_INTEGER MaximumMappingSize = { 1 << 31 }; // 2GB CONST USHORT InitialFreeMemoryMapsForNonStreamingReaders = 64; CONST USHORT InitialFreeMemoryMapsForNonStreamingMetadataReaders = 64; CONST USHORT InitialFreeMemoryMapsForNonStreamingWriters = 64; CONST USHORT InitialFreeMemoryMapsForNonStreamingMetadataWriters = 64; CONST USHORT InitialFreeMemoryMapsForStreamingReaders = 64; CONST USHORT InitialFreeMemoryMapsForStreamingWriters = 64; CONST USHORT InitialFreeMemoryMapMultiplierForFrequentAllocators = 1; CONST USHORT TraceStoreMetadataInfoStructSize = ( sizeof(TRACE_STORE_METADATA_INFO) ); CONST USHORT TraceStoreAllocationStructSize = ( sizeof(TRACE_STORE_ALLOCATION) ); CONST USHORT TraceStoreRelocationStructSize = ( sizeof(TRACE_STORE_FIELD_RELOC) ); CONST USHORT TraceStoreAddressStructSize = sizeof(TRACE_STORE_ADDRESS); CONST USHORT TraceStoreAddressRangeStructSize = sizeof(TRACE_STORE_ADDRESS_RANGE); CONST USHORT TraceStoreAllocationTimestampStructSize = ( sizeof(TRACE_STORE_ALLOCATION_TIMESTAMP) ); CONST USHORT TraceStoreAllocationTimestampDeltaStructSize = ( sizeof(TRACE_STORE_ALLOCATION_TIMESTAMP_DELTA) ); CONST USHORT TraceStoreInfoStructSize = sizeof(TRACE_STORE_INFO); // // Size key: // 1 << 16 == 64KB // 1 << 21 == 2MB // 1 << 22 == 4MB // 1 << 23 == 8MB // 1 << 25 == // // N.B.: the trace store size should always be greater than or equal to the // mapping size. // CONST LARGE_INTEGER DefaultTraceStoreMappingSize = { 1 << 26 }; CONST LARGE_INTEGER DefaultTraceStoreEventMappingSize = { 1 << 30 }; CONST LARGE_INTEGER DefaultAllocationTraceStoreSize = { 1 << 21 }; CONST LARGE_INTEGER DefaultAllocationTraceStoreMappingSize = { 1 << 21 }; CONST LARGE_INTEGER DefaultRelocationTraceStoreSize = { 1 << 16 }; CONST LARGE_INTEGER DefaultRelocationTraceStoreMappingSize = { 1 << 16 }; CONST LARGE_INTEGER DefaultAddressTraceStoreSize = { 1 << 21 }; CONST LARGE_INTEGER DefaultAddressTraceStoreMappingSize = { 1 << 21 }; CONST LARGE_INTEGER DefaultAddressRangeTraceStoreSize = { 1 << 20 }; CONST LARGE_INTEGER DefaultAddressRangeTraceStoreMappingSize = { 1 << 20 }; CONST LARGE_INTEGER DefaultAllocationTimestampTraceStoreSize = { 1 << 26 }; CONST LARGE_INTEGER DefaultAllocationTimestampTraceStoreMappingSize = { 1 << 26 }; CONST LARGE_INTEGER DefaultAllocationTimestampDeltaTraceStoreSize = { 1 << 25 }; CONST LARGE_INTEGER DefaultAllocationTimestampDeltaTraceStoreMappingSize = { 1 << 25 }; CONST LARGE_INTEGER DefaultMetadataInfoTraceStoreSize = { sizeof(TRACE_STORE_METADATA_INFO) }; CONST LARGE_INTEGER DefaultMetadataInfoTraceStoreMappingSize = { sizeof(TRACE_STORE_METADATA_INFO) }; CONST LARGE_INTEGER DefaultInfoTraceStoreSize = { sizeof(TRACE_STORE_INFO) }; CONST LARGE_INTEGER DefaultInfoTraceStoreMappingSize = { sizeof(TRACE_STORE_INFO) }; CONST LARGE_INTEGER DefaultSynchronizationTraceStoreSize = { sizeof(TRACE_STORE_SYNC) }; CONST LARGE_INTEGER DefaultSynchronizationTraceStoreMappingSize = { sizeof(TRACE_STORE_SYNC) }; // // N.B. To add a new flag to each store in vim, mark the brace boundaries with // ma and mb, and then run the command: // // 'a,'b s:0 // Unused$:0, // NewFlag\r 0 // Unused: // // Where NewFlag is the name of the new flag to add. // CONST TRACE_STORE_TRAITS MetadataInfoStoreTraits = { 0, // VaryingRecordSize 0, // RecordSizeIsAlwaysPowerOf2 0, // MultipleRecords 0, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 0, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 0, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 0, // Compress 0 // Unused }; CONST TRACE_STORE_TRAITS AllocationStoreTraits = { 0, // VaryingRecordSize 1, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 1, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 0, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 0, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 1, // Compress 0 // Unused }; CONST TRACE_STORE_TRAITS RelocationStoreTraits = { 1, // VaryingRecordSize 0, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 0, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 0, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 0, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 0, // Compress 0 // Unused }; CONST TRACE_STORE_TRAITS AddressStoreTraits = { 0, // VaryingRecordSize 1, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 0, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 0, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 0, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 0, // Compress 0 // Unused }; CONST TRACE_STORE_TRAITS AddressRangeStoreTraits = { 0, // VaryingRecordSize 1, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 0, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 0, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 0, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 1, // Compress 0 // Unused }; CONST TRACE_STORE_TRAITS AllocationTimestampStoreTraits = { 0, // VaryingRecordSize 1, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 1, // StreamingWrite 1, // StreamingRead 1, // FrequentAllocations 1, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 0, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 0, // Compress 0 // Unused }; CONST TRACE_STORE_TRAITS AllocationTimestampDeltaStoreTraits = { 0, // VaryingRecordSize 1, // RecordSizeIsAlwaysPowerOf2 1, // MultipleRecords 1, // StreamingWrite 1, // StreamingRead 1, // FrequentAllocations 1, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 0, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 0, // Compress 0 // Unused }; CONST TRACE_STORE_TRAITS SynchronizationStoreTraits = { 0, // VaryingRecordSize 1, // RecordSizeIsAlwaysPowerOf2 0, // MultipleRecords 0, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 0, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 0, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 0, // Compress 0 // Unused }; CONST TRACE_STORE_TRAITS InfoStoreTraits = { 0, // VaryingRecordSize 1, // RecordSizeIsAlwaysPowerOf2 0, // MultipleRecords 0, // StreamingWrite 0, // StreamingRead 0, // FrequentAllocations 0, // BlockingAllocations 0, // LinkedStore 0, // CoalescedAllocations 0, // ConcurrentAllocations 0, // AllowPageSpill 0, // PageAligned 0, // Periodic 0, // ConcurrentDataStructure 0, // NoAllocationAlignment 0, // Compress 0 // Unused }; // // StringTable-related constants. Each table consists of a maximum of 16 // strings, as this is the limit of an individual string table. // #undef DSTR #define DSTR(String) String ";" CONST CHAR TraceStoreSqlite3StringTableDelimiter = ';'; CONST STRING TraceStoreSqlite3FunctionsString = RTL_CONSTANT_STRING( DSTR("tscount") DSTR("tsavg") DSTR("tssum") DSTR("tsmin") DSTR("tsmax") ); CONST TRACE_STORE_SQLITE3_FUNCTION TraceStoreSqlite3Functions[] = { // // tscount, 0 arguments. // { // // Id // CountFunctionId, // // Flags // { 0, // Unused }, // // Name // "tscount", // // NumberOfArguments // 0, // // TextEncodingAndDeterministicFlag // SQLITE_UTF8 | SQLITE_DETERMINISTIC, // // ScalarFunction // NULL, // // AggregateStepFunction // TraceStoreSqlite3CountStep, // // AggregateFinalFunction // TraceStoreSqlite3CountFinal, // // DestroyFunction // TraceStoreSqlite3CountDestroy, }, // // tscount, 1 argument. // { // // Id // CountFunctionId, // // Flags // { 0, // Unused }, // // Name // "tscount", // // NumberOfArguments // 1, // // TextEncodingAndDeterministicFlag // SQLITE_UTF8 | SQLITE_DETERMINISTIC, // // ScalarFunction // NULL, // // AggregateStepFunction // TraceStoreSqlite3CountStep, // // AggregateFinalFunction // TraceStoreSqlite3CountFinal, // // DestroyFunction // TraceStoreSqlite3CountDestroy, }, // // count, 0 arguments. // { // // Id // CountFunctionId, // // Flags // { 0, // Unused }, // // Name // "count", // // NumberOfArguments // 0, // // TextEncodingAndDeterministicFlag // SQLITE_UTF8 | SQLITE_DETERMINISTIC, // // ScalarFunction // NULL, // // AggregateStepFunction // TraceStoreSqlite3CountStep, // // AggregateFinalFunction // TraceStoreSqlite3CountFinal, // // DestroyFunction // TraceStoreSqlite3CountDestroy, }, // // count, 1 argument. // { // // Id // CountFunctionId, // // Flags // { 0, // Unused }, // // Name // "count", // // NumberOfArguments // 1, // // TextEncodingAndDeterministicFlag // SQLITE_UTF8 | SQLITE_DETERMINISTIC, // // ScalarFunction // NULL, // // AggregateStepFunction // TraceStoreSqlite3CountStep, // // AggregateFinalFunction // TraceStoreSqlite3CountFinal, // // DestroyFunction // TraceStoreSqlite3CountDestroy, }, LAST_FUNCTION_ENTRY, }; // vim:set ts=8 sw=4 sts=4 tw=80 expandtab nowrap :
28.788079
82
0.650695
81a5633ee20def7ff5e0dbc3e669607ab87cd9bb
277
dart
Dart
lib/src/core/wgl.dart
jld3103/gl_dart
3aa1a2b6c581bb7ab9c332b7fa2193a886194c7f
[ "MIT" ]
null
null
null
lib/src/core/wgl.dart
jld3103/gl_dart
3aa1a2b6c581bb7ab9c332b7fa2193a886194c7f
[ "MIT" ]
null
null
null
lib/src/core/wgl.dart
jld3103/gl_dart
3aa1a2b6c581bb7ab9c332b7fa2193a886194c7f
[ "MIT" ]
null
null
null
import 'dart:ffi'; import 'package:ffi/ffi.dart'; typedef PROC = Pointer Function(); typedef TwglGetProcAddress_Native = Pointer<NativeFunction<PROC>> Function( Pointer<Utf8>); typedef TwglGetProcAddress_Func = Pointer<NativeFunction<PROC>> Function( Pointer<Utf8>);
27.7
75
0.765343
ef019fecf4db69f85cdf366ee538627420832d33
4,720
h
C
common/stream.h
darthrake/openpnp-capture
1b2153d4b8550120c5e58a30eb85e4f3a5529a73
[ "MIT" ]
76
2017-02-20T09:35:16.000Z
2022-03-03T23:59:43.000Z
common/stream.h
darthrake/openpnp-capture
1b2153d4b8550120c5e58a30eb85e4f3a5529a73
[ "MIT" ]
39
2017-07-17T18:10:33.000Z
2022-03-26T21:51:33.000Z
common/stream.h
darthrake/openpnp-capture
1b2153d4b8550120c5e58a30eb85e4f3a5529a73
[ "MIT" ]
35
2017-07-04T07:31:53.000Z
2022-03-10T13:50:02.000Z
/* OpenPnp-Capture: a video capture subsystem. Platform independent stream class Copyright (c) 2017 Jason von Nieda, Niels Moseley. 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. */ #ifndef stream_h #define stream_h #include <stdint.h> #include <vector> #include <mutex> #include "logging.h" class Context; // pre-declaration class deviceInfo; // pre-declaration class Stream; // pre-declaration /** The stream class handles the capturing of a single device */ class Stream { public: Stream(); virtual ~Stream(); /** Open a capture stream to a device and request a specific (internal) stream format. When succesfully opened, capturing starts immediately. */ virtual bool open(Context *owner, deviceInfo *device, uint32_t width, uint32_t height, uint32_t fourCC, uint32_t fps) = 0; /** Close a capture stream */ virtual void close() {}; /** Returns true if a new frame is available for reading using 'captureFrame'. The internal new frame flag is reset by captureFrame. */ bool hasNewFrame(); /** Retrieve the most recently captured frame and copy it in a buffer pointed to by RGBbufferPtr. The maximum buffer size must be supplied in RGBbufferBytes. */ bool captureFrame(uint8_t *RGBbufferPtr, uint32_t RGBbufferBytes); /** Set the frame rate of this stream. Returns false if the camera does not support the desired frame rate. */ virtual bool setFrameRate(uint32_t fps) = 0; /** Returns true if the stream is open and capturing */ bool isOpen() const { return m_isOpen; } /** Return the FOURCC media type of the stream */ virtual uint32_t getFOURCC() = 0; /** Return the number of frames captured. FIXME: protect by mutex */ uint32_t getFrameCount() const { return m_frames; } /** get the limits of a camera/stream property (exposure, zoom etc) */ virtual bool getPropertyLimits(uint32_t propID, int32_t *min, int32_t *max, int32_t *dValue) = 0; /** set property (exposure, zoom etc) of camera/stream */ virtual bool setProperty(uint32_t propID, int32_t value) = 0; /** set automatic state of property (exposure, zoom etc) of camera/stream */ virtual bool setAutoProperty(uint32_t propID, bool enabled) = 0; /** get property (exposure, zoom etc) of camera/stream */ virtual bool getProperty(uint32_t propID, int32_t &outValue) = 0; /** get automatic state of property (exposure, zoom etc) of camera/stream */ virtual bool getAutoProperty(uint32_t propID, bool &enable) = 0; protected: /** Thread-safe copying of the 24-bit RGB buffer pointed to by 'ptr' with length 'bytes'. If no bitmap conversion needs to take place, call this function from the platform dependent code. Otherwise, re- implement this function with the conversion to avoid needing multiple frame buffers. */ virtual void submitBuffer(const uint8_t* ptr, size_t bytes); Context* m_owner; ///< The context object associated with this stream uint32_t m_width; ///< The width of the frame in pixels uint32_t m_height; ///< The height of the frame in pixels bool m_isOpen; std::mutex m_bufferMutex; ///< mutex to protect m_frameBuffer and m_newFrame bool m_newFrame; ///< new frame buffer flag std::vector<uint8_t> m_frameBuffer; ///< raw frame buffer uint32_t m_frames; ///< number of frames captured }; #endif
36.307692
101
0.677542
b51d56925560da71e1f91ae6e8ee5f646ee91bdd
1,492
asm
Assembly
programs/oeis/093/A093328.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/093/A093328.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/093/A093328.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A093328: a(n) = 2*n^2 + 3. ; 3,5,11,21,35,53,75,101,131,165,203,245,291,341,395,453,515,581,651,725,803,885,971,1061,1155,1253,1355,1461,1571,1685,1803,1925,2051,2181,2315,2453,2595,2741,2891,3045,3203,3365,3531,3701,3875,4053,4235,4421,4611,4805,5003,5205,5411,5621,5835,6053,6275,6501,6731,6965,7203,7445,7691,7941,8195,8453,8715,8981,9251,9525,9803,10085,10371,10661,10955,11253,11555,11861,12171,12485,12803,13125,13451,13781,14115,14453,14795,15141,15491,15845,16203,16565,16931,17301,17675,18053,18435,18821,19211,19605,20003,20405,20811,21221,21635,22053,22475,22901,23331,23765,24203,24645,25091,25541,25995,26453,26915,27381,27851,28325,28803,29285,29771,30261,30755,31253,31755,32261,32771,33285,33803,34325,34851,35381,35915,36453,36995,37541,38091,38645,39203,39765,40331,40901,41475,42053,42635,43221,43811,44405,45003,45605,46211,46821,47435,48053,48675,49301,49931,50565,51203,51845,52491,53141,53795,54453,55115,55781,56451,57125,57803,58485,59171,59861,60555,61253,61955,62661,63371,64085,64803,65525,66251,66981,67715,68453,69195,69941,70691,71445,72203,72965,73731,74501,75275,76053,76835,77621,78411,79205,80003,80805,81611,82421,83235,84053,84875,85701,86531,87365,88203,89045,89891,90741,91595,92453,93315,94181,95051,95925,96803,97685,98571,99461,100355,101253,102155,103061,103971,104885,105803,106725,107651,108581,109515,110453,111395,112341,113291,114245,115203,116165,117131,118101,119075,120053,121035,122021,123011,124005 mov $1,$0 pow $1,2 mul $1,2 add $1,3
186.5
1,424
0.808311
b39e84db9401406b9dcfaa0d510a723774877853
3,797
dart
Dart
test.disabled/charts/transformers/transpose_transformer_test.dart
google/charted
946509279f41566016e0cc1825f964de67d96d6d
[ "BSD-3-Clause" ]
148
2015-01-08T22:30:52.000Z
2021-11-30T07:28:10.000Z
test.disabled/charts/transformers/transpose_transformer_test.dart
google/charted
946509279f41566016e0cc1825f964de67d96d6d
[ "BSD-3-Clause" ]
65
2015-01-09T19:05:45.000Z
2019-10-24T15:00:00.000Z
test.disabled/charts/transformers/transpose_transformer_test.dart
google/charted
946509279f41566016e0cc1825f964de67d96d6d
[ "BSD-3-Clause" ]
76
2015-02-02T20:13:25.000Z
2021-03-10T03:06:00.000Z
library charted.test.transposetransformer; import 'package:charted/charts/charts.dart'; import 'package:test/test.dart'; main() { List COLUMNS = [ new ChartColumnSpec(label:'Country', type:ChartColumnSpec.TYPE_STRING), new ChartColumnSpec(label:'Stats1'), new ChartColumnSpec(label:'Stats2'), new ChartColumnSpec(label:'Stats3') ]; const List DATA = const [ const['USA', 9.50, 50, 2000], const['Japan',1.50, 99, 2000], const['Taiwan', 3.50, 127, 1337], const['France', 2.50, 29, 6000], const['Germany', 10.99, 999, 10000], const['England', 2.50, 10, 3000], const['Brazil', 1.50, 27, 6000], const['Argentina', 5.50, 37, 2000], ]; ChartData inputData = new ChartData(COLUMNS, DATA); test('Transpose ChartData', () { TransposeTransformer transformer = new TransposeTransformer(); ChartData result = transformer.transform(inputData); // Expected data: // ['Stats1', 9.50, 1.50, 3.50, 2.50, 10.99, 2.50, 1.50, 5.50] // ['Stats2', 50, 99, 127, 29, 999, 10, 27, 37] // ['Stats3', 2000, 2000, 1337, 6000, 10000, 3000, 6000, 2000] // While The chart column spec should contain new column specs with label // equal to the list of country names. // Stats1 expect(result.rows.elementAt(0).elementAt(0), equals('Stats1')); expect(result.rows.elementAt(0).elementAt(1), equals(9.50)); expect(result.rows.elementAt(0).elementAt(2), equals(1.50)); expect(result.rows.elementAt(0).elementAt(3), equals(3.50)); expect(result.rows.elementAt(0).elementAt(4), equals(2.50)); expect(result.rows.elementAt(0).elementAt(5), equals(10.99)); // Stats2 expect(result.rows.elementAt(1).elementAt(0), equals('Stats2')); expect(result.rows.elementAt(1).elementAt(1), equals(50)); expect(result.rows.elementAt(1).elementAt(2), equals(99)); expect(result.rows.elementAt(1).elementAt(3), equals(127)); expect(result.rows.elementAt(1).elementAt(4), equals(29)); expect(result.rows.elementAt(1).elementAt(5), equals(999)); // Stats3 expect(result.rows.elementAt(2).elementAt(0), equals('Stats3')); expect(result.rows.elementAt(2).elementAt(1), equals(2000)); expect(result.rows.elementAt(2).elementAt(2), equals(2000)); expect(result.rows.elementAt(2).elementAt(3), equals(1337)); expect(result.rows.elementAt(2).elementAt(4), equals(6000)); expect(result.rows.elementAt(2).elementAt(5), equals(10000)); // ColumnSpecs expect(result.columns.elementAt(0).label, equals('Country')); expect(result.columns.elementAt(1).label, equals('USA')); expect(result.columns.elementAt(2).label, equals('Japan')); expect(result.columns.elementAt(3).label, equals('Taiwan')); expect(result.columns.elementAt(4).label, equals('France')); expect(result.columns.elementAt(5).label, equals('Germany')); expect(result.columns.elementAt(6).label, equals('England')); expect(result.columns.elementAt(7).label, equals('Brazil')); }); test('Transposing data twice should produce the original data', () { TransposeTransformer t1 = new TransposeTransformer(); TransposeTransformer t2 = new TransposeTransformer(); ChartData result = t2.transform(t1.transform(inputData)); // Check all values are the same in the result and original data. for (var i = 0; i < result.rows.length; i++) { var row = result.rows.elementAt(i); for (var j = 0; j < row.length; j++) { expect(row.elementAt(j), equals((DATA.elementAt(i) as List).elementAt(j))); } } for (var i = 0; i < result.columns.length; i++) { expect(result.columns.elementAt(i).label, equals((COLUMNS.elementAt(i) as ChartColumnSpec).label)); } }); }
40.827957
77
0.655518
a3926477a7c27dbd6b53ff789295570232af8554
5,463
java
Java
Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/model/memory/TraceMemoryRegisterSpace.java
oldmud0/ghidra
bbe07f5690bde0d3525d561d36e4d3ee059bc870
[ "Apache-2.0" ]
1
2021-11-23T11:53:41.000Z
2021-11-23T11:53:41.000Z
Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/model/memory/TraceMemoryRegisterSpace.java
oldmud0/ghidra
bbe07f5690bde0d3525d561d36e4d3ee059bc870
[ "Apache-2.0" ]
null
null
null
Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/model/memory/TraceMemoryRegisterSpace.java
oldmud0/ghidra
bbe07f5690bde0d3525d561d36e4d3ee059bc870
[ "Apache-2.0" ]
1
2021-10-02T01:25:14.000Z
2021-10-02T01:25:14.000Z
/* ### * IP: GHIDRA * * 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 ghidra.trace.model.memory; import java.nio.ByteBuffer; import java.util.*; import java.util.Map.Entry; import ghidra.program.model.lang.Register; import ghidra.program.model.lang.RegisterValue; import ghidra.trace.model.TraceAddressSnapRange; import ghidra.trace.model.listing.TraceCodeRegisterSpace; import ghidra.trace.model.thread.TraceThread; import ghidra.trace.util.TraceRegisterUtils; public interface TraceMemoryRegisterSpace extends TraceMemorySpace { TraceThread getThread(); default List<Register> getRegisters() { return getThread().getRegisters(); } default void setState(long snap, Register register, TraceMemoryState state) { setState(snap, TraceRegisterUtils.rangeForRegister(register), state); } default TraceMemoryState getState(long snap, Register register) { Collection<Entry<TraceAddressSnapRange, TraceMemoryState>> states = getStates(snap, register); if (states.isEmpty()) { return TraceMemoryState.UNKNOWN; } if (states.size() != 1) { throw new IllegalStateException("More than one state is present in " + register); } return states.iterator().next().getValue(); } default Collection<Entry<TraceAddressSnapRange, TraceMemoryState>> getStates(long snap, Register register) { return getStates(snap, TraceRegisterUtils.rangeForRegister(register)); } /** * Set the value of a register at the given snap * * <p> * <b>IMPORTANT:</b> The trace database cannot track the state ({@link TraceMemoryState#KNOWN}, * etc.) with per-bit accuracy. It only has byte precision. If the given value specifies, e.g., * only a single bit, then the entire byte will become marked {@link TraceMemoryState#KNOWN}, * even though the remaining 7 bits could technically be unknown. * * @param snap the snap * @param value the register value * @return the number of bytes written */ default int setValue(long snap, RegisterValue value) { if (!value.hasAnyValue()) { return 0; } Register reg = value.getRegister(); if (!value.hasValue() || !TraceRegisterUtils.isByteBound(reg)) { RegisterValue old = getValue(snap, reg.getBaseRegister()); // Do not use .getRegisterValue, as that will zero unmasked bits // Instead, we'll pass the original register to bufferForValue value = old.combineValues(value); } ByteBuffer buf = TraceRegisterUtils.bufferForValue(reg, value); return putBytes(snap, reg.getAddress(), buf); } /** * Write bytes at the given snap and register address * * <p> * Note that bit-masked registers are not properly heeded. If the caller wishes to preserve * non-masked bits, it must first retrieve the current value and combine it with the desired * value. The caller must also account for any bit shift in the passed buffer. Alternatively, * consider {@link #setValue(long, RegisterValue)}. * * @param snap the snap * @param register the register to modify * @param buf the buffer of bytes to write * @return the number of bytes written */ default int putBytes(long snap, Register register, ByteBuffer buf) { int byteLength = register.getNumBytes(); int limit = buf.limit(); buf.limit(Math.min(limit, buf.position() + byteLength)); int result = putBytes(snap, register.getAddress(), buf); buf.limit(limit); return result; } default RegisterValue getValue(long snap, Register register) { return TraceRegisterUtils.getRegisterValue(register, (a, buf) -> getBytes(snap, a, buf)); } default RegisterValue getViewValue(long snap, Register register) { return TraceRegisterUtils.getRegisterValue(register, (a, buf) -> getViewBytes(snap, a, buf)); } default int getBytes(long snap, Register register, ByteBuffer buf) { int byteLength = register.getNumBytes(); int limit = buf.limit(); buf.limit(Math.min(limit, buf.position() + byteLength)); int result = getBytes(snap, register.getAddress(), buf); buf.limit(limit); return result; } /** * Remove a value from the given time and register * * <p> * <b>IMPORANT:</b> The trace database cannot track the state ({@link TraceMemoryState#KNOWN}, * etc.) with per-bit accuracy. It only has byte precision. If the given register specifies, * e.g., only a single bit, then the entire byte will become marked * {@link TraceMemoryState#UNKNOWN}, even though the remaining 7 bits could technically be * known. * * @param snap the snap * @param register the register */ default void removeValue(long snap, Register register) { int byteLength = register.getNumBytes(); removeBytes(snap, register.getAddress(), byteLength); } default Collection<RegisterValue> getAllValues(long snap) { Set<RegisterValue> result = new LinkedHashSet<>(); for (Register reg : getRegisters()) { result.add(getValue(snap, reg)); } return result; } @Override TraceCodeRegisterSpace getCodeSpace(boolean createIfAbsent); }
35.019231
96
0.731283
af551816eac684fcec0cc64108ec736589d1b5c2
23,961
py
Python
py/device/power.py
arccode/factory
a1b0fccd68987d8cd9c89710adc3c04b868347ec
[ "BSD-3-Clause" ]
3
2022-01-06T16:52:52.000Z
2022-03-07T11:30:47.000Z
py/device/power.py
arccode/factory
a1b0fccd68987d8cd9c89710adc3c04b868347ec
[ "BSD-3-Clause" ]
null
null
null
py/device/power.py
arccode/factory
a1b0fccd68987d8cd9c89710adc3c04b868347ec
[ "BSD-3-Clause" ]
1
2021-10-24T01:47:22.000Z
2021-10-24T01:47:22.000Z
# Copyright 2015 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import collections import logging import re import statistics import time from cros.factory.device import device_types from cros.factory.utils import type_utils class PowerException(device_types.DeviceException): pass def CreatePower(dut, *mixins, **kargs): """Creates an instance of Power class inherited from PowerBase with mixins. This function is equivalent to def CreatePower(dut, *mixins, **kargs): class Power(*mixins, PowerBase): pass return Power(dut, **kargs) except that we actually cannot use *mixins in class declaration. Args: dut: A device_types.DeviceBoard instance. mixins: One or more mixin classes. kargs: Key arguments to pass to base constructor. Returns: An instance of Power class with given mixins, with `dut` and `kargs` passed as constructor arguments. Example: power = CreatePower(dut, ECToolPowerControlMixin, ECToolPowerInfoMixin) """ bases = mixins + (PowerBase,) power_cls = type('Power', bases, {}) return power_cls(dut, **kargs) class PowerBase(device_types.DeviceComponent): """Base class for power. The base class is basically empty, and needs mixin classes to add its functions. """ # Power source types PowerSource = type_utils.Enum(['BATTERY', 'AC']) # An enumeration of possible charge states. # - ``CHARGE``: Charge the device as usual. # - ``IDLE``: Do not charge the device, even if connected to mains. # - ``DISCHARGE``: Force the device to discharge. # - ``FULL``: Full charge states. ChargeState = type_utils.Enum(['CHARGE', 'IDLE', 'DISCHARGE', 'FULL']) def __init__(self, dut, pd_name=None): super(PowerBase, self).__init__(dut) self._pd_name = pd_name class PowerControlMixinBase: """Base class for power control mixin.""" def SetChargeState(self, state): """Sets the charge state.""" raise NotImplementedError class DummyPowerControlMixin(PowerControlMixinBase): """Power control mixin that does nothing.""" def SetChargeState(self, state): """See PowerControlMixinBase.SetChargeState""" class ECToolPowerControlMixin(PowerControlMixinBase): """Power control mixin that uses ectool.""" def SetChargeState(self, state): """See PowerControlMixinBase.SetChargeState""" try: if state == self.ChargeState.CHARGE: self._device.CheckCall(['ectool', 'chargecontrol', 'normal']) elif state == self.ChargeState.IDLE: self._device.CheckCall(['ectool', 'chargecontrol', 'idle']) elif state == self.ChargeState.DISCHARGE: self._device.CheckCall(['ectool', 'chargecontrol', 'discharge']) else: raise self.Error('Unknown EC charge state: %s' % state) except Exception as e: raise self.Error('Unable to set charge state: %s' % e) class PowerInfoMixinBase: """Base class for power info mixin.""" _CHARGE_STATE_MAP = { 'Charging': PowerBase.ChargeState.CHARGE, 'Idle': PowerBase.ChargeState.IDLE, 'Discharging': PowerBase.ChargeState.DISCHARGE, 'Full': PowerBase.ChargeState.FULL } def CheckACPresent(self): """Check if AC power is present.""" raise NotImplementedError def GetACType(self): """Get AC power type.""" raise NotImplementedError def CheckBatteryPresent(self): """Check if battery is present.""" raise NotImplementedError def GetCharge(self): """Get current charge level in mAh.""" raise NotImplementedError def GetChargeMedian(self, read_count=10): """Read charge level several times and return the median.""" charge_nows = [] for unused_i in range(read_count): charge_now = self.GetCharge() if charge_now: charge_nows.append(charge_now) time.sleep(0.1) return statistics.median(charge_nows) def GetChargeFull(self): """Get full charge level in mAh.""" raise NotImplementedError def GetChargePct(self, get_float=False): """Get current charge level in percentage. Args: get_float: Returns charge percentage in float. Returns: Charge percentage in int/float. """ raise NotImplementedError def GetWearPct(self): """Get current battery wear in percentage of new capacity.""" raise NotImplementedError def GetChargeState(self): """Returns the charge state. Returns: One of the three states in ChargeState. """ raise NotImplementedError def GetChargerCurrent(self): """Gets the amount of current we ask from charger. Returns: Interger value in mA. """ raise NotImplementedError def GetBatteryCurrent(self): """Gets the amount of current battery is charging/discharging at. Returns: Integer value in mA. """ raise NotImplementedError def GetBatteryDesignCapacity(self): """Gets battery's design capacity. Returns: Battery's design capacity in mAh. Raises: DeviceException if battery's design capacity cannot be obtained. """ raise NotImplementedError def GetBatteryVoltage(self): """Gets battery's current voltage. Returns: Battery's current voltage in mV. """ raise NotImplementedError def GetBatteryCycleCount(self): """Gets battery's cycle count.""" raise NotImplementedError def GetBatteryManufacturer(self): """Gets battery's manufacturer.""" raise NotImplementedError def GetInfoDict(self): """Returns a dict containing information about the battery. TODO(kitching): Determine whether this function is necessary (who uses it?). """ _SysfsBatteryAttributes = [ ('current_now', self.GetBatteryCurrent), ('present', self.CheckBatteryPresent), ('status', self.GetChargeState), ('voltage_now', self.GetBatteryVoltage), ('charge_full', self.GetChargeFull), ('charge_full_design', self.GetBatteryDesignCapacity), ('charge_now', self.GetCharge), ('fraction_full', lambda: self.GetChargePct(True) / 100), ] result = {} for k, getter in _SysfsBatteryAttributes: try: result[k] = getter() except Exception as e: exc_str = '%s: %s' % (e.__class__.__name__, e) logging.error('battery attribute %s is unavailable: %s', k, exc_str) return result class SysfsPowerInfoMixin(PowerInfoMixinBase): """Power info mixin that uses sysfs files.""" _sys = '/sys' # Regular expression for parsing charger current. EC_CHARGER_CURRENT_RE = re.compile(r'^chg_current = (\d+)mA', re.MULTILINE) def ReadOneLine(self, file_path): """Reads one stripped line from given file on DUT. Args: file_path: The file path on DUT. Returns: String for the first line of file contents. """ # splitlines() does not work on empty string so we have to check. contents = self._device.ReadSpecialFile(file_path) if contents: return contents.splitlines()[0].strip() return '' def FindPowerPath(self, power_source): """Find battery path in sysfs. Note few attributes, especially 'online', is usually implemented as cached value and only updated if we read some dynamic values (for example voltage_now) or a host event from EC is discovered. This implies if host events are broken, many values won't be updated - and this is critical for FindPowerPath. For devices in early stage, you probably want to extend FindPowerPath by reading voltage_now from all power_supply entries. """ def GetValue(path, sub_path): full_path = self._device.path.join(path, sub_path) if not self._device.path.exists(full_path): return None return self.ReadOneLine(full_path) all_power_supplies = self._device.Glob( self._device.path.join(self._sys, 'class/power_supply/*')) if power_source == self.PowerSource.BATTERY: # Some HID peripherals, for example Stylus, may has its own battery and # appear in power_supply as well, with scope='Device'; and we do want to # skip them. power_supplies = [ p for p in all_power_supplies if GetValue(p, 'type') == 'Battery' and GetValue(p, 'scope') != 'Device' ] else: power_supplies = [ p for p in all_power_supplies if GetValue(p, 'type') != 'Battery' ] if power_supplies: # Systems with multiple USB-C ports may have multiple power sources. # Since the end goal is to determine if the system is powered, let's # just return the first powered AC path if there's any; otherwise # return the first in the list. for p in power_supplies: if GetValue(p, 'online') == '1': return p return power_supplies[0] raise PowerException('Cannot find %s' % power_source) def CheckACPresent(self): """See PowerInfoMixinBase.CheckACPresent""" try: p = self.FindPowerPath(self.PowerSource.AC) return self.ReadOneLine(self._device.path.join(p, 'online')) == '1' except (PowerException, IOError): return False def GetACType(self): """See PowerInfoMixinBase.GetACType""" try: p = self.FindPowerPath(self.PowerSource.AC) return self.ReadOneLine(self._device.path.join(p, 'type')) except (PowerException, IOError): return 'Unknown' @device_types.DeviceProperty def _battery_path(self): """Get battery path. Use cached value if available. Returns: Battery path if available, None otherwise. """ try: return self.FindPowerPath(self.PowerSource.BATTERY) except PowerException: return None def CheckBatteryPresent(self): """See PowerInfoMixinBase.CheckBatteryPresent""" return bool(self._battery_path) def GetBatteryAttribute(self, attribute_name): """Get a battery attribute. Args: attribute_name: The name of attribute in sysfs. Returns: Content of the attribute in str. """ try: return self.ReadOneLine( self._device.path.join(self._battery_path, attribute_name)) except IOError: # Battery driver is not fully initialized return None def GetCharge(self): """See PowerInfoMixinBase.GetCharge""" charge_now = self.GetBatteryAttribute('charge_now') if charge_now: return int(charge_now) // 1000 return None def GetChargeFull(self): """See PowerInfoMixinBase.GetChargeFull""" charge_full = self.GetBatteryAttribute('charge_full') if charge_full: return int(charge_full) // 1000 return None def GetChargePct(self, get_float=False): """See PowerInfoMixinBase.GetChargePct""" now = self.GetBatteryAttribute('charge_now') full = self.GetBatteryAttribute('charge_full') if now is None or full is None: now = self.GetBatteryAttribute('energy_now') full = self.GetBatteryAttribute('energy_full') if now is None or full is None: return None if float(full) <= 0: return None # Something wrong with the battery charge_pct = float(now) * 100 / float(full) if get_float: return charge_pct return round(charge_pct) def GetWearPct(self): """See PowerInfoMixinBase.GetWearPct""" capacity = self.GetBatteryAttribute('charge_full') design_capacity = self.GetBatteryAttribute('charge_full_design') if capacity is None or design_capacity is None: # No charge values, check for energy-reporting batteries capacity = self.GetBatteryAttribute('energy_full') design_capacity = self.GetBatteryAttribute('energy_full_design') if capacity is None or design_capacity is None: # Battery driver is not fully initialized return None if float(design_capacity) <= 0: return None # Something wrong with the battery return 100 - (round(capacity * 100 / float(design_capacity))) def GetChargeState(self): """See PowerInfoMixinBase.GetChargeState""" return self._CHARGE_STATE_MAP[self.GetBatteryAttribute('status')] def GetChargerCurrent(self): """See PowerInfoMixinBase.GetChargerCurrent TODO(chenghan): Currently cros-usb-pd-charger does not provide 'current_now' file in sysfs (crbug/807753), so we use ectool to get this information. Change this function to use 'current_now' when the issue is fixed. """ re_object = self.EC_CHARGER_CURRENT_RE.findall( self._device.CheckOutput(['ectool', 'chargestate', 'show'])) if re_object: return int(re_object[0]) raise self.Error('Cannot find current in ectool chargestate show') def GetBatteryCurrent(self): """See PowerInfoMixinBase.GetBatteryCurrent""" charging = (self.GetBatteryAttribute('status') == 'Charging') current = self.GetBatteryAttribute('current_now') if current is None: raise self.Error('Cannot find %s/current_now' % self._battery_path) current_ma = abs(int(current)) // 1000 return current_ma if charging else -current_ma def GetBatteryDesignCapacity(self): """See PowerInfoMixinBase.GetBatteryDesignCapacity""" design_capacity = self.GetBatteryAttribute('charge_full_design') if design_capacity is None: raise self.Error('Design capacity not found.') try: return int(design_capacity) // 1000 except Exception as e: raise self.Error('Unable to get battery design capacity: %s' % e) def GetBatteryVoltage(self): """See PowerInfoMixinBase.GetBatteryVoltage""" voltage = self.GetBatteryAttribute('voltage_now') return int(voltage) // 1000 def GetBatteryCycleCount(self): """See PowerInfoMixinBase.GetBatteryCycleCount""" return int(self.GetBatteryAttribute('cycle_count')) def GetBatteryManufacturer(self): """See PowerInfoMixinBase.GetBatteryManufacturer""" return self.GetBatteryAttribute('manufacturer') class ECToolPowerInfoMixin(PowerInfoMixinBase): """Power info mixin that uses ectool.""" # Regular expression for parsing output. EC_BATTERY_CHARGING_RE = re.compile(r'^\s+Flags\s+.*\s+CHARGING.*$', re.MULTILINE) EC_CHARGER_CURRENT_RE = re.compile(r'^chg_current = (\d+)mA', re.MULTILINE) BATTERY_FLAGS_RE = re.compile(r'Flags\s+(.*)$') def _GetECToolBatteryFlags(self): re_object = self.BATTERY_FLAGS_RE.findall( self._device.CallOutput(['ectool', 'battery'])) if re_object: return re_object[0].split() return [] def _GetECToolBatteryAttribute(self, key_name, item_type=str): re_object = re.findall(r'%s\s+(\S+)' % key_name, self._device.CallOutput(['ectool', 'battery'])) if re_object: return item_type(re_object[0]) raise self.Error('Cannot find key "%s" in ectool battery' % key_name) def CheckACPresent(self): """See PowerInfoMixinBase.CheckACPresent""" return 'AC_PRESENT' in self._GetECToolBatteryFlags() def GetACType(self): """See PowerInfoMixinBase.GetACType. There is no ectool command to get AC type, so just return 'Unknown'. """ return 'Unknown' def CheckBatteryPresent(self): """See PowerInfoMixinBase.CheckBatteryPresent""" return 'BATT_PRESENT' in self._GetECToolBatteryFlags() def GetCharge(self): """See PowerInfoMixinBase.GetCharge""" return self._GetECToolBatteryAttribute('Remaining capacity', int) def GetChargeFull(self): """See PowerInfoMixinBase.GetChargeFull""" return self._GetECToolBatteryAttribute('Last full charge:', int) def GetChargePct(self, get_float=False): """See PowerInfoMixinBase.GetChargePct""" charge_pct = self.GetCharge() * 100 / self.GetChargeFull() if get_float: return charge_pct return round(charge_pct) def GetWearPct(self): """See PowerInfoMixinBase.GetWearPct""" capacity = self.GetChargeFull() design_capacity = self.GetBatteryDesignCapacity() if design_capacity <= 0: return None # Something wrong with the battery return 100 - round(capacity * 100 / design_capacity) def GetChargeState(self): """See PowerInfoMixinBase.GetWearPct""" if 'CHARGING' in self._GetECToolBatteryFlags(): return self.ChargeState.CHARGE return self.ChargeState.DISCHARGE def GetBatteryCurrent(self): """See PowerInfoMixinBase.GetBatteryCurrent""" charging = 'CHARGING' in self._GetECToolBatteryFlags() current = self._GetECToolBatteryAttribute('Present current', int) return current if charging else -current def GetBatteryDesignCapacity(self): """See PowerInfoMixinBase.GetBatteryDesignCapacity""" return self._GetECToolBatteryAttribute('Design capacity:', int) def GetChargerCurrent(self): """See PowerInfoMixinBase.GetChargerCurrent""" re_object = self.EC_CHARGER_CURRENT_RE.findall( self._device.CheckOutput(['ectool', 'chargestate', 'show'])) if re_object: return int(re_object[0]) raise self.Error('Cannot find current in ectool chargestate show') def GetBatteryVoltage(self): """See PowerInfoMixinBase.GetBatteryVoltage""" return self._GetECToolBatteryAttribute('Present voltage', int) def GetBatteryCycleCount(self): """See PowerInfoMixinBase.GetBatteryCycleCount""" return self._GetECToolBatteryAttribute('Cycle count', int) def GetBatteryManufacturer(self): """See PowerInfoMixinBase.GetBatteryManufacturer""" return self._GetECToolBatteryAttribute('OEM name:') def GetPowerInfo(self): """Gets power information. Returns: The output of ectool powerinfo, like:: AC Voltage: 5143 mV System Voltage: 11753 mV System Current: 1198 mA System Power: 14080 mW USB Device Type: 0x20010 USB Current Limit: 2958 mA It can be further parsed by :py:func:`cros.factory.utils.string_utils.ParseDict` into a dict. Raises: DeviceException if power information cannot be obtained. """ return self._device.CallOutput(['ectool', 'powerinfo']) def GetUSBPDPowerInfo(self): """Gets USB PD power information. Returns: The output of ectool usbpdpower, like:: Port 0: Disconnected Port 1: SNK Charger PD 20714mV / 3000mA, max 20000mV / 3000mA / 60000mW Port 2: SRC """ command = ['ectool', 'usbpdpower'] if self._pd_name: command.append('--name=' + self._pd_name) output = self._device.CheckOutput(command) USBPortInfo = collections.namedtuple( 'USBPortInfo', 'id state voltage current') ports = [] for line in output.strip().splitlines(): match = re.match(r'Port\s+(\d+):\s+(\w+)', line) if not match: raise self.Error('unexpected output: %s' % output) port_id, port_state = int(match.group(1)), match.group(2) if port_state not in ['Disconnected', 'SNK', 'SRC']: raise self.Error('unexpected PD state: %s\noutput="""%s"""' % (port_state, output)) voltage = None current = None if port_state == 'SNK': match = re.search(r'SNK Charger PD (\d+)mV\s+/\s+(\d+)mA', line) if not match: raise self.Error('unexpected output for SNK state: %s' % output) voltage, current = int(match.group(1)), int(match.group(2)) ports.append(USBPortInfo(port_id, port_state, voltage, current)) return ports class PowerDaemonPowerInfoMixin(PowerInfoMixinBase): """Power info mixin that uses powerd.""" def _GetDumpPowerStatus(self): return self._device.CallOutput(['dump_power_status']) def _GetPowerAttribute(self, key_name, item_type=str): re_object = re.findall( r'^%s ?(\S*)$' % key_name, self._GetDumpPowerStatus(), re.MULTILINE) if re_object: return item_type(re_object[0]) raise self.Error('Cannot find key "%s" in dump_power_status' % key_name) def CheckACPresent(self): """See PowerInfoMixinBase.CheckACPresent""" return self._GetPowerAttribute('line_power_connected', int) == 1 def GetACType(self): """See PowerInfoMixinBase.GetACType""" return self._GetPowerAttribute('line_power_type') def CheckBatteryPresent(self): """See PowerInfoMixinBase.CheckBatteryPresent""" return self._GetPowerAttribute('battery_present', int) == 1 def GetCharge(self): """See PowerInfoMixinBase.GetCharge""" return int(self._GetPowerAttribute('battery_charge', float) * 1000) def GetChargeFull(self): """See PowerInfoMixinBase.GetChargeFull""" return int(self._GetPowerAttribute('battery_charge_full', float) * 1000) def GetChargePct(self, get_float=False): """See PowerInfoMixinBase.GetChargePct""" charge_pct = self._GetPowerAttribute('battery_percent', float) if get_float: return charge_pct return round(charge_pct) def GetWearPct(self): """See PowerInfoMixinBase.GetWearPct""" capacity = self.GetChargeFull() design_capacity = self.GetBatteryDesignCapacity() if design_capacity <= 0: return None # Something wrong with the battery return 100 - round(capacity * 100 / design_capacity) def GetChargeState(self): """See PowerInfoMixinBase.GetChargeState""" return self._CHARGE_STATE_MAP[self._GetPowerAttribute('battery_status')] # pylint: disable=useless-super-delegation def GetChargerCurrent(self): """See PowerInfoMixinBase.GetChargerCurrent TODO(chenghan): Currently cros-usb-pd-charger does not provide 'current_now' file in sysfs (crbug/807753), which is read by `dump_power_status` to get 'line_power_current' field. Change this function to use 'line_power_current' when the issue is fixed. """ return super(PowerDaemonPowerInfoMixin, self).GetChargerCurrent() def GetBatteryCurrent(self): """See PowerInfoMixinBase.GetBatteryCurrent""" charging = self.GetChargeState() == self.ChargeState.CHARGE current = int(self._GetPowerAttribute('battery_current', float) * 1000) return current if charging else -current def GetBatteryDesignCapacity(self): """See PowerInfoMixinBase.GetBatteryDesignCapacity""" return int( self._GetPowerAttribute('battery_charge_full_design', float) * 1000) def GetBatteryVoltage(self): """See PowerInfoMixinBase.GetBatteryVoltage""" return int( self._GetPowerAttribute('battery_voltage', float) * 1000) # pylint: disable=useless-super-delegation def GetBatteryCycleCount(self): """See PowerInfoMixinBase.GetBatteryCycleCount TODO(chenghan): Change this function when `dump_power_status` supports this field. """ return super(PowerDaemonPowerInfoMixin, self).GetBatteryCycleCount() # pylint: disable=useless-super-delegation def GetBatteryManufacturer(self): """See PowerInfoMixinBase.GetBatteryManufacturer TODO(chenghan): Change this function when `dump_power_status` supports this field. """ return super(PowerDaemonPowerInfoMixin, self).GetBatteryManufacturer() class LinuxPower(DummyPowerControlMixin, SysfsPowerInfoMixin, PowerBase): """Power with no power control and info from sysfs.""" class ChromeOSPowerLegacy( ECToolPowerControlMixin, SysfsPowerInfoMixin, PowerBase): """Power with ectool power control and info from sysfs.""" class ChromeOSPower(ECToolPowerControlMixin, PowerDaemonPowerInfoMixin, ECToolPowerInfoMixin, PowerBase): """Power with ectool power control and info from powerd. If powerd does not support the function, fall back to use ectool. """ # Some board implementations create their own power class by inheriting from # power.Power, which is the previous power class with ectool power control # and sysfs power info. For compatibility we also define Power here. Power = ChromeOSPowerLegacy
32.823288
80
0.693627
19622400350428c2e2205d0909fefe3699f3168f
2,539
lua
Lua
tests/spec/eventQueue.lua
athros/rotLove
9b89af61684df87d752796642a9cab7993421fb5
[ "BSD-3-Clause" ]
196
2015-02-20T23:56:30.000Z
2022-03-21T15:15:24.000Z
tests/spec/eventQueue.lua
ARBUCHELI/rotLove
9b89af61684df87d752796642a9cab7993421fb5
[ "BSD-3-Clause" ]
41
2016-01-02T22:47:07.000Z
2021-09-27T21:29:26.000Z
tests/spec/eventQueue.lua
ARBUCHELI/rotLove
9b89af61684df87d752796642a9cab7993421fb5
[ "BSD-3-Clause" ]
31
2015-02-26T22:28:20.000Z
2022-03-14T10:51:17.000Z
local ROT = require 'src.rot' local expect = require 'tests.expect' (assert) describe("EventQueue", function() it("should return added event", function() local q = ROT.EventQueue() q:add("a", 100) expect(q:get()).toEqual("a") end) it("should return nil when no events are available", function() local q = ROT.EventQueue() expect(q:get()).toEqual(nil) end) it("should remove returned events", function() local q = ROT.EventQueue() q:add(0, 0) q:get() expect(q:get()).toEqual(nil) end) it("should look up time of events", function() local q = ROT.EventQueue() q:add(123, 187) q:add(456, 42) expect(q:getEventTime(123)).toEqual(187) expect(q:getEventTime(456)).toEqual(42) end) it("should look up correct times after events removed", function() local q = ROT.EventQueue() q:add(123, 187) q:add(456, 42) q:add(789, 411) q:get() expect(q:getEventTime(456)).toBeUndefined() expect(q:getEventTime(123)).toEqual(187 - 42) expect(q:getEventTime(789)).toEqual(411 - 42) end) it("should remove events", function() local q = ROT.EventQueue() q:add(123, 0) q:add(456, 0) local result = q:remove(123) expect(result).toEqual(true) expect(q:get()).toEqual(456) end) it("should survive removal of non-existant events", function() local q = ROT.EventQueue() q:add(0, 0) local result = q:remove(1) expect(result).toEqual(false) expect(q:get()).toEqual(0) end) it("should return events sorted", function() local q = ROT.EventQueue() q:add(456, 10) q:add(123, 5) q:add(789, 15) expect(q:get()).toEqual(123) expect(q:get()).toEqual(456) expect(q:get()).toEqual(789) end) it("should compute elapsed time", function() local q = ROT.EventQueue() q:add(456, 10) q:add(123, 5) q:add(789, 15) q:get() q:get() q:get() expect(q:getTime()).toEqual(15) end) it("should maintain event order for same timestamps", function() local q = ROT.EventQueue() q:add(456, 10) q:add(123, 10) q:add(789, 10) expect(q:get()).toEqual(456) expect(q:get()).toEqual(123) expect(q:get()).toEqual(789) expect(q:getTime()).toEqual(10) end) end)
27.597826
70
0.552186
a4365d2d5da7bef08e64a816d46929d0e43a0276
411
php
PHP
src/Component/OpenApi3/Tests/fixtures/issue-337/expected/Exception/CompanyEventsForbiddenException.php
janephp/jane-master
5abd13eed92d1f6998f0e097f3d12c569236d0c9
[ "MIT" ]
401
2017-12-03T22:42:21.000Z
2022-03-22T08:19:55.000Z
src/Component/OpenApi3/Tests/fixtures/issue-337/expected/Exception/CompanyEventsForbiddenException.php
janephp/jane-master
5abd13eed92d1f6998f0e097f3d12c569236d0c9
[ "MIT" ]
345
2017-12-05T10:08:09.000Z
2022-03-31T08:55:49.000Z
src/Component/OpenApi3/Tests/fixtures/issue-337/expected/Exception/CompanyEventsForbiddenException.php
janephp/jane-master
5abd13eed92d1f6998f0e097f3d12c569236d0c9
[ "MIT" ]
110
2017-12-05T06:00:46.000Z
2022-03-03T21:17:24.000Z
<?php namespace CreditSafe\API\Exception; class CompanyEventsForbiddenException extends ForbiddenException { public function __construct() { parent::__construct('This error is returned when your user account does have access to the requested service, or because the service has expired, or has reached its full usage limit. Check `/Access/Countries for a full list of your services.'); } }
37.363636
252
0.76399
a19c43988ee6cdc26ee4bfa2b82aa91f86379179
318
ts
TypeScript
src/SandDance.InteractiveExtension.js/lib/interface.d.ts
LittleLittleCloud/dotnet-interactive-extension-lab
e55e4c9bdb98df11d14f27790f9927a2fad5e375
[ "MIT" ]
5
2022-02-03T22:24:20.000Z
2022-03-18T09:17:51.000Z
src/SandDance.InteractiveExtension.js/lib/interface.d.ts
LittleLittleCloud/dotnet-interactive-extension-lab
e55e4c9bdb98df11d14f27790f9927a2fad5e375
[ "MIT" ]
null
null
null
src/SandDance.InteractiveExtension.js/lib/interface.d.ts
LittleLittleCloud/dotnet-interactive-extension-lab
e55e4c9bdb98df11d14f27790f9927a2fad5e375
[ "MIT" ]
2
2022-02-26T17:38:51.000Z
2022-03-29T22:05:47.000Z
import { Data } from "./dataTypes"; import "@msrvida/sanddance-explorer/dist/css/sanddance-explorer.css"; import "./app.css"; export interface DataExplorerSettings { container: HTMLDivElement; data: Data; id: string; } export declare function createSandDanceExplorer(settings: DataExplorerSettings): void;
31.8
86
0.761006
cd9a0de4f92a8cedcd1af2bdcbc31d7887b7b8d5
239
cs
C#
Nyp_Proje/Nakit.cs
cihancifci/SiparisOtomasyon
d47ffd5a64ab1648eb45f666ede3269be7571ee4
[ "MIT" ]
2
2020-02-03T13:19:02.000Z
2021-01-19T15:18:27.000Z
Nyp_Proje/Nakit.cs
cihancifci/SiparisOtomasyon
d47ffd5a64ab1648eb45f666ede3269be7571ee4
[ "MIT" ]
null
null
null
Nyp_Proje/Nakit.cs
cihancifci/SiparisOtomasyon
d47ffd5a64ab1648eb45f666ede3269be7571ee4
[ "MIT" ]
1
2021-01-19T15:18:56.000Z
2021-01-19T15:18:56.000Z
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Nyp_Proje { public class Nakit : Odeme { public int nakit { get; set; } } }
15.933333
39
0.644351
23bd53258c39e0d65fa0bb59415c297d2f5dae1a
1,829
js
JavaScript
test/index.js
ResourcefulHumans/svg-template-builder
5bcc1ea3801e545134d6c2a8181a6752b9daf125
[ "MIT" ]
1
2020-06-04T01:07:33.000Z
2020-06-04T01:07:33.000Z
test/index.js
ResourcefulHumans/svg-template-builder
5bcc1ea3801e545134d6c2a8181a6752b9daf125
[ "MIT" ]
18
2017-05-06T16:18:57.000Z
2020-05-24T20:28:11.000Z
test/index.js
ResourcefulHumans/svg-template-builder
5bcc1ea3801e545134d6c2a8181a6752b9daf125
[ "MIT" ]
null
null
null
'use strict' /* global describe, it */ const Promise = require('bluebird') const fs = Promise.promisifyAll(require('fs')) const expect = require('chai').expect const minify = require('../src/minify') const transform = require('../src/transform') const template = require('../src/template') const path = require('path') describe('svg-template-builder', () => { it('should minify SVGs', (done) => { Promise.join( fs.readFileAsync(path.join(__dirname, './data/01-in.svg'), 'utf8'), fs.readFileAsync(path.join(__dirname, './data/01-out.svg'), 'utf8') ) .spread((input, expectedOutput) => { minify(input).then((output) => { expect(output.data.trim()).to.equal(expectedOutput.trim()) done() }) }) }) it('should transform SVG properties to React properties', (done) => { Promise.join( fs.readFileAsync(path.join(__dirname, './data/01-in.svg'), 'utf8'), fs.readFileAsync(path.join(__dirname, './data/02-out.svg'), 'utf8') ) .spread((input, expectedOutput) => { minify(input).then((output) => { expect(transform(output.data).trim()).to.equal(expectedOutput.trim()) done() }) }) }) it('should wrap SVG contents inside a template file', (done) => { Promise.join( fs.readFileAsync(path.join(__dirname, './data/01-in.svg'), 'utf8'), fs.readFileAsync(path.join(__dirname, './data/03-out.svg'), 'utf8') ) .spread((input, expectedOutput) => { minify(input).then((output) => { const icons = [{content: output.data, name: 'Sample'}] const templateFile = path.join(__dirname, './data/test.tpl') return template(templateFile, 'Icon', icons) }).then((output) => { expect(output.trim()).to.equal(expectedOutput.trim()) done() }) }) }) })
33.254545
77
0.604702
8ea632a99daad3674fd223e4155ba19525200081
51,735
rb
Ruby
config/routes_old.rb
jon-nine/caboose-cms
8cd9de663228e3fbd231657d46206238c32da076
[ "MIT" ]
16
2015-02-11T05:21:54.000Z
2019-12-07T02:33:25.000Z
config/routes_old.rb
jon-nine/caboose-cms
8cd9de663228e3fbd231657d46206238c32da076
[ "MIT" ]
3
2016-04-04T16:28:40.000Z
2016-04-04T16:28:40.000Z
config/routes_old.rb
jon-nine/caboose-cms
8cd9de663228e3fbd231657d46206238c32da076
[ "MIT" ]
8
2015-06-02T09:26:09.000Z
2019-12-29T14:46:06.000Z
Caboose::Engine.routes.draw do if Caboose::use_comment_routes eval(Caboose::CommentRoutes.controller_routes) end #============================================================================= # Front end #============================================================================= #get "/admin" => "admin#index" #put "/admin/station" => "station#index_admin" #get "/station" => "station#index" #get "/station/plugin-count" => "station#plugin_count" #get "/modal" => "modal#layout" #get "/modal/:url" => "modal#index", :constraints => {:url => /.*/} #get "/login/forgot-password" => "login#forgot_password_form" #post "/login/forgot-password" => "login#send_reset_email" #get "/login/reset-password/:reset_id" => "login#reset_password_form" #post "/login/reset-password" => "login#reset_password" #get "/login" => "login#index" #post "/login" => "login#login" #get "/logout" => "logout#index" #get "/register" => "register#index" #post "/register" => "register#register" #============================================================================= # My Account #============================================================================= #get "/my-account/orders/:order_id/line-items/:id/download" => "my_account_line_items#download" #get "/my-account/orders/:order_id/line-items/:id" => "my_account_line_items#edit" #get "/my-account/orders/:order_id/line-items" => "my_account_line_items#index" #get "/my-account/orders/:order_id/billing-address/json" => "billing_addresses#my_account_json" #put "/my-account/orders/:order_id/billing-address" => "billing_addresses#my_account_update" #get "/my-account/orders/:order_id/shipping-address/json" => "shipping_addresses#my_account_json" #put "/my-account/orders/:order_id/shipping-address" => "shipping_addresses#my_account_update" #get "/my-account/orders/authnet-relay" => "my_account_orders#authnet_relay" #post "/my-account/orders/authnet-relay" => "my_account_orders#authnet_relay" #get "/my-account/orders/:id/authnet-response" => "my_account_orders#authnet_response" #post "/my-account/orders/:id/authnet-response" => "my_account_orders#authnet_response" #get "/my-account/orders/:id/payment-form" => "my_account_orders#payment_form" #get "/my-account/orders/:id/json" => "my_account_orders#order_json" #get "/my-account/orders/:id" => "my_account_orders#edit" #get "/my-account/orders" => "my_account_orders#index" #get "/my-account" => "my_account#index" #put "/my-account" => "my_account#update" #============================================================================= # Retargeting #============================================================================= #get "/admin/sites/:site_id/retargeting" => "retargeting#admin_edit" #put "/admin/sites/:site_id/retargeting" => "retargeting#admin_update" #============================================================================= # Sites #============================================================================= #get "/admin/sites/options" => "sites#options" #get "/admin/sites/new" => "sites#admin_new" #get "/admin/sites/:id/default-layout-options" => "sites#admin_default_layout_options" #get "/admin/sites/:id/css" => "sites#admin_edit_css" #get "/admin/sites/:id/js" => "sites#admin_edit_js" #get "/admin/sites/:id/block-types" => "sites#admin_edit_block_types" #get "/admin/sites/:id/delete" => "sites#admin_delete_form" #get "/admin/sites/:id" => "sites#admin_edit" #get "/admin/sites" => "sites#admin_index" #post "/admin/sites" => "sites#admin_add" #post "/admin/sites/:id/logo" => "sites#admin_update_logo" #put "/admin/sites/:id" => "sites#admin_update" #delete "/admin/sites/:id" => "sites#admin_delete" #post "/admin/sites/:id/members" => "sites#admin_add_member" #delete "/admin/sites/:id/members/:user_id" => "sites#admin_remove_member" #post "/admin/sites/:site_id/domains" => "domains#admin_add" #put "/admin/sites/:site_id/domains/:id" => "domains#admin_update" #delete "/admin/sites/:site_id/domains/:id" => "domains#admin_delete" #put "/admin/sites/:site_id/domains/:id/set-primary" => "domains#admin_set_primary" #============================================================================= # Login Logs #============================================================================= #get "/admin/login-logs/json" => "login_logs#admin_json" #get "/admin/login-logs" => "login_logs#admin_index" #============================================================================= # Store #============================================================================= #get "/admin/store/shipping-method-options" => "store#shipping_method_options" #get "/admin/store/payment-processor-options" => "store#payment_processor_options" #get "/admin/store/length-unit-options" => "store#length_unit_options" #get "/admin/store/weight-unit-options" => "store#weight_unit_options" #get "/admin/store/json" => "store#admin_json_single" #get "/admin/store/payment" => "store#admin_edit_payment" #get "/admin/store/shipping" => "store#admin_edit_shipping" #get "/admin/store/tax" => "store#admin_edit_tax" #get "/admin/store/packages" => "store#admin_edit_packages" #get "/admin/store" => "store#admin_edit_general" #put "/admin/store" => "store#admin_update" #============================================================================= # SMTP #============================================================================= #get "/admin/smtp/auth-options" => "smtp#auth_options" #get "/admin/smtp" => "smtp#admin_edit" #put "/admin/smtp" => "smtp#admin_update" #============================================================================= # Social #============================================================================= #get "/admin/social" => "social#admin_edit" #put "/admin/social" => "social#admin_update" #get "/admin/analytics" => "social#analytics" #============================================================================= # Amazon SNS #============================================================================= #get "/admin/sns/confirm" => "sns#admin_confirm" #post "/admin/sns/confirm" => "sns#admin_confirm" #get "/admin/sns" => "sns#admin_index" #post "/admin/sns" => "sns#admin_add" #put "/admin/sns/:id" => "sns#admin_update" #delete "/admin/sns/:id" => "sns#admin_delete" #============================================================================= # Fonts #============================================================================= #get "/admin/fonts" => "fonts#admin_index" #put "/admin/fonts" => "fonts#admin_update" #============================================================================= # Shipping Packages #============================================================================= #get "/admin/shipping-packages/options" => "shipping_packages#admin_options" #get "/admin/shipping-packages/json" => "shipping_packages#admin_json" #get "/admin/shipping-packages/:id/json" => "shipping_packages#admin_json_single" #get "/admin/shipping-packages/:id/shipping-method-options" => "shipping_packages#admin_shipping_method_options" #get "/admin/shipping-packages/package-method-options" => "shipping_packages#admin_package_method_options" #get "/admin/shipping-packages/:id" => "shipping_packages#admin_edit" #get "/admin/shipping-packages" => "shipping_packages#admin_index" #put "/admin/shipping-packages/bulk" => "shipping_packages#admin_bulk_update" #put "/admin/shipping-packages/:id" => "shipping_packages#admin_update" #post "/admin/shipping-packages/bulk" => "shipping_packages#admin_bulk_add" #post "/admin/shipping-packages" => "shipping_packages#admin_add" #delete "/admin/shipping-packages/bulk" => "shipping_packages#admin_bulk_delete" #delete "/admin/shipping-packages/:id" => "shipping_packages#admin_delete" #get "/admin/shipping-methods/options" => "shipping_packages#admin_shipping_method_options" #============================================================================= # 301 Redirects #============================================================================= #get "/admin/redirects" => "redirects#admin_index" #get "/admin/redirects/new" => "redirects#admin_new" #get "/admin/redirects/:id" => "redirects#admin_edit" #put "/admin/redirects/:id" => "redirects#admin_update" #post "/admin/redirects" => "redirects#admin_add" #delete "/admin/redirects/:id" => "redirects#admin_delete" #============================================================================= # Users #============================================================================= #get "/admin/users" => "users#admin_index" #get "/admin/users/json" => "users#admin_json" #get "/admin/users/options" => "users#admin_options" #get "/admin/users/new" => "users#admin_new" #get "/admin/users/import" => "users#admin_import_form" #post "/admin/users/import" => "users#admin_import" #get "/admin/users/:id/json" => "users#admin_json_single" #get "/admin/users/:id/su/:token" => "users#admin_su_token" #get "/admin/users/:id/su" => "users#admin_su" #get "/admin/users/:id/edit-password" => "users#admin_edit_password" #get "/admin/users/:id" => "users#admin_edit" #put "/admin/users/:id" => "users#admin_update" #post "/admin/users" => "users#admin_add" #delete "/admin/users/:id" => "users#admin_delete" #post "/admin/users/:id/roles/:role_id" => "users#admin_add_to_role" #delete "/admin/users/:id/roles/:role_id" => "users#admin_remove_from_role" #============================================================================= # Roles #============================================================================= #get "/admin/roles" => "roles#index" #get "/admin/roles/options" => "roles#options" #get "/admin/roles/new" => "roles#new" #get "/admin/roles/:id" => "roles#edit" #put "/admin/roles/:id" => "roles#update" #post "/admin/roles" => "roles#create" #delete "/admin/roles/:id" => "roles#destroy" # #post "/admin/roles/:id/permissions/:permission_id" => "roles#add_permission" #delete "/admin/roles/:id/permissions/:permission_id" => "roles#remove_permission" #============================================================================= # Permissions #============================================================================= #get "/admin/permissions" => "permissions#index" #get "/admin/permissions/options" => "permissions#options" #get "/admin/permissions/new" => "permissions#new" #get "/admin/permissions/:id" => "permissions#edit" #put "/admin/permissions/:id" => "permissions#update" #post "/admin/permissions" => "permissions#create" #delete "/admin/permissions/:id" => "permissions#destroy" #============================================================================= # Images #============================================================================= #get "/admin/media/last-upload-processed" => "media#admin_last_upload_processed" #post "/admin/media/pre-upload" => "media#admin_pre_upload" #get "/admin/media" => "media#admin_index" #get "/admin/media/new" => "media#admin_new" #get "/admin/media/json" => "media#admin_json" #get "/admin/media/:id/process" => "media#admin_process" #get "/admin/media/:id/finished" => "media#admin_process_finished" #get "/admin/media/:id/description" => "media#admin_edit_description" #get "/admin/media/:id" => "media#admin_edit" #put "/admin/media/:id" => "media#admin_update" #post "/admin/media/:id/image" => "media#admin_update_image" ##post "/admin/media/edit-image" => "media#admin_edit_image" #post "/admin/media" => "media#admin_add" #delete "/admin/media/bulk" => "media#admin_bulk_delete" #delete "/admin/media/:id" => "media#admin_delete" #get "/admin/media-categories/json" => "media_categories#admin_json" #get "/admin/media-categories/options" => "media_categories#admin_options" #get "/admin/media-categories/flat-tree" => "media_categories#admin_flat_tree" #get "/admin/media-categories/tree" => "media_categories#admin_tree" #post "/admin/media-categories" => "media_categories#admin_add" #post "/admin/media-categories/:id/attach" => "media_categories#admin_attach" #put "/admin/media-categories/:id/sort-order" => "media_categories#admin_update_sort_order" #put "/admin/media-categories/:id" => "media_categories#admin_update" #delete "/admin/media-categories/:id" => "media_categories#admin_delete" #============================================================================= # Settings #============================================================================= #get "/admin/settings" => "settings#index" #get "/admin/settings/options" => "settings#options" #get "/admin/settings/new" => "settings#new" #get "/admin/settings/:id" => "settings#edit" #put "/admin/settings/:id" => "settings#update" #post "/admin/settings" => "settings#create" #delete "/admin/settings/:id" => "settings#destroy" #============================================================================= # Pages #============================================================================= #get "/pages/:id" => "pages#show" #get "/pages/:id/redirect" => "pages#redirect" #get "/admin/pages/sitemap-options" => "pages#admin_sitemap_options" #get "/admin/pages/robots-options" => "pages#admin_robots_options" #get "/admin/pages/format-options" => "pages#admin_content_format_options" #get "/admin/pages/new" => "pages#admin_new" #get "/admin/pages/:id/block-options" => "pages#admin_block_options" #get "/admin/pages/:id/uri" => "pages#admin_page_uri" #get "/admin/pages/:id/duplicate" => "pages#admin_duplicate_form" #post "/admin/pages/:id/duplicate" => "pages#admin_duplicate" #get "/admin/pages/:id/delete" => "pages#admin_delete_form" #get "/admin/pages/:id/sitemap" => "pages#admin_sitemap" #get "/admin/pages/:id/custom-fields" => "pages#admin_edit_custom_fields" #get "/admin/pages/:id/permissions" => "pages#admin_edit_permissions" #get "/admin/pages/:id/css" => "pages#admin_edit_css" #get "/admin/pages/:id/js" => "pages#admin_edit_js" #get "/admin/pages/:id/seo" => "pages#admin_edit_seo" #get "/admin/pages/:id/block-order" => "pages#admin_edit_block_order" #put "/admin/pages/:id/block-order" => "pages#admin_update_block_order" #get "/admin/pages/:id/child-order" => "pages#admin_edit_child_sort_order" #put "/admin/pages/:id/child-order" => "pages#admin_update_child_sort_order" #get "/admin/pages/:id/new-blocks" => "pages#admin_new_blocks" #get "/admin/pages/:id/content" => "pages#admin_edit_content" #get "/admin/pages/:id/layout" => "pages#admin_edit_layout" #put "/admin/pages/:id/layout" => "pages#admin_update_layout" #put "/admin/pages/:id/viewers" => "pages#admin_update_viewers" #put "/admin/pages/:id/editors" => "pages#admin_update_editors" #get "/admin/pages/:id" => "pages#admin_edit_general" #put "/admin/pages/:id/update-child-permissions" => "pages#admin_update_child_permissions" #put "/admin/pages/:id" => "pages#admin_update" #get "/admin/pages" => "pages#admin_index" #post "/admin/pages" => "pages#admin_create" #delete "/admin/pages/:id" => "pages#admin_delete" #post "/admin/page-permissions" => "page_permissions#admin_add" #delete "/admin/page-permissions" => "page_permissions#admin_delete" #delete "/admin/page-permissions/:id" => "page_permissions#admin_delete" #get "/admin/pages/:page_id/blocks/new" => "blocks#admin_new" #get "/admin/pages/:page_id/blocks/tree" => "blocks#admin_tree" #get "/admin/pages/:page_id/blocks/render" => "blocks#admin_render_all" #get "/admin/pages/:page_id/blocks/render-second-level" => "blocks#admin_render_second_level" #get "/admin/pages/:page_id/blocks/:id/render" => "blocks#admin_render" #get "/admin/pages/:page_id/blocks/:id/tree" => "blocks#admin_tree" #get "/admin/pages/:page_id/blocks/:id/render" => "blocks#admin_render" #get "/admin/pages/:page_id/blocks/:id/edit" => "blocks#admin_edit" #get "/admin/pages/:page_id/blocks/:id/advanced" => "blocks#admin_edit_advanced" #put "/admin/pages/:page_id/blocks/:id/move-up" => "blocks#admin_move_up" #put "/admin/pages/:page_id/blocks/:id/move-down" => "blocks#admin_move_down" #get "/admin/pages/:page_id/blocks/:id" => "blocks#admin_show" #get "/admin/pages/:page_id/blocks" => "blocks#admin_index" #post "/admin/pages/:page_id/blocks" => "blocks#admin_create" #get "/admin/pages/:page_id/blocks/:id/new" => "blocks#admin_new" #post "/admin/pages/:page_id/blocks/:id" => "blocks#admin_create" #put "/admin/pages/:page_id/blocks/:id" => "blocks#admin_update" #delete "/admin/pages/:page_id/blocks/:id" => "blocks#admin_delete" #put "/admin/pages/:page_id/blocks/:id" => "blocks#admin_update" #post "/admin/pages/:page_id/blocks/:id/image" => "blocks#admin_update_image" #post "/admin/pages/:page_id/blocks/:id/file" => "blocks#admin_update_file" #get "/admin/posts/:post_id/blocks/new" => "blocks#admin_new" #get "/admin/posts/:post_id/blocks/tree" => "blocks#admin_tree" #get "/admin/posts/:post_id/blocks/render" => "blocks#admin_render_all" #get "/admin/posts/:post_id/blocks/render-second-level" => "blocks#admin_render_second_level" #get "/admin/posts/:post_id/blocks/:id/render" => "blocks#admin_render" #get "/admin/posts/:post_id/blocks/:id/tree" => "blocks#admin_tree" #get "/admin/posts/:post_id/blocks/:id/render" => "blocks#admin_render" #get "/admin/posts/:post_id/blocks/:id/edit" => "blocks#admin_edit" #get "/admin/posts/:post_id/blocks/:id/advanced" => "blocks#admin_edit_advanced" #put "/admin/posts/:post_id/blocks/:id/move-up" => "blocks#admin_move_up" #put "/admin/posts/:post_id/blocks/:id/move-down" => "blocks#admin_move_down" #get "/admin/posts/:post_id/blocks/:id" => "blocks#admin_show" #get "/admin/posts/:post_id/blocks" => "blocks#admin_index" #post "/admin/posts/:post_id/blocks" => "blocks#admin_create" #get "/admin/posts/:post_id/blocks/:id/new" => "blocks#admin_new" #post "/admin/posts/:post_id/blocks/:id" => "blocks#admin_create" #put "/admin/posts/:post_id/blocks/:id" => "blocks#admin_update" #delete "/admin/posts/:post_id/blocks/:id" => "blocks#admin_delete" #put "/admin/posts/:post_id/blocks/:id" => "blocks#admin_update" #post "/admin/posts/:post_id/blocks/:id/image" => "blocks#admin_update_image" #post "/admin/posts/:post_id/blocks/:id/file" => "blocks#admin_update_file" #============================================================================= # Block types #============================================================================= #get "/admin/block-types/store/sources" => "block_type_sources#admin_index" #get "/admin/block-types/store/sources/new" => "block_type_sources#admin_new" #get "/admin/block-types/store/sources/options" => "block_type_sources#admin_options" #get "/admin/block-types/store/sources/:id" => "block_type_sources#admin_edit" #get "/admin/block-types/store/sources/:id/refresh" => "block_type_sources#admin_refresh" #post "/admin/block-types/store/sources" => "block_type_sources#admin_create" #put "/admin/block-types/store/sources/:id" => "block_type_sources#admin_update" #delete "/admin/block-types/store/sources/:id" => "block_type_sources#admin_delete" #get "/admin/block-types/store/:block_type_summary_id/download" => "block_type_store#admin_download" #get "/admin/block-types/store/:block_type_summary_id" => "block_type_store#admin_details" #get "/admin/block-types/store" => "block_type_store#admin_index" #get "/admin/block-types/new" => "block_types#admin_new" #get "/admin/block-types/json" => "block_types#admin_json" #get "/admin/block-types/options" => "block_types#admin_options" #get "/admin/block-types/:field-options" => "block_types#admin_options" #get "/admin/block-types/:id/options" => "block_types#admin_options" #get "/admin/block-types/:id/json" => "block_types#admin_json_single" #get "/admin/block-types/:id/new" => "block_types#admin_new" #get "/admin/block-types/:id/icon" => "block_types#admin_edit_icon" #get "/admin/block-types/:id" => "block_types#admin_edit" #put "/admin/block-types/:id" => "block_types#admin_update" #delete "/admin/block-types/:id" => "block_types#admin_delete" #get "/admin/block-types" => "block_types#admin_index" #post "/admin/block-types" => "block_types#admin_create" #get "/admin/block-type-categories/tree-options" => "block_type_categories#admin_tree_options" #============================================================================= # Posts #============================================================================= #get "/posts" => "posts#index" #get "/posts/:id" => "posts#show" #get "/posts/:year/:month/:day/:slug" => "posts#show" #get "/admin/posts/new" => "posts#admin_new" #get "/admin/posts/:id/json" => "posts#admin_json_single" #get "/admin/posts/:id/delete" => "posts#admin_delete_form" #get "/admin/posts/:id/preview" => "posts#admin_edit_preview" #get "/admin/posts/:id/content" => "posts#admin_edit_content" #get "/admin/posts/:id/layout" => "posts#admin_edit_layout" #put "/admin/posts/:id/layout" => "posts#admin_update_layout" #get "/admin/posts/:id/categories" => "posts#admin_edit_categories" #put "/admin/posts/:id/add-to-category" => "posts#admin_add_to_category" #put "/admin/posts/:id/remove-from-category" => "posts#admin_remove_from_category" #get "/admin/posts/:id/delete" => "posts#admin_delete_form" #get "/admin/posts/:id" => "posts#admin_edit_general" #put "/admin/posts/:id" => "posts#admin_update" #post "/admin/posts/:id/image" => "posts#admin_update_image" #get "/admin/posts" => "posts#admin_index" #post "/admin/posts" => "posts#admin_add" #delete "/admin/posts/:id" => "posts#admin_delete" #============================================================================= # Post Categories #============================================================================= #get "/admin/post-categories" => "post_categories#admin_index" #get "/admin/post-categories/new" => "post_categories#admin_new" #get "/admin/post-categories/options" => "post_categories#admin_options" #get "/admin/post-categories/:id" => "post_categories#admin_edit" #put "/admin/post-categories/:id" => "post_categories#admin_update" #post "/admin/post-categories" => "post_categories#admin_add" #delete "/admin/post-categories/:id" => "post_categories#admin_delete" #============================================================================= # Post Custom Fields and Values #============================================================================= #put "/admin/post-custom-field-values/:id" => "post_custom_field_values#admin_update" #get "/admin/post-custom-fields/json" => "post_custom_fields#admin_json" #get "/admin/post-custom-fields/:field-options" => "post_custom_fields#admin_options" #get "/admin/post-custom-fields/:id/json" => "post_custom_fields#admin_json_single" #get "/admin/post-custom-fields/:id" => "post_custom_fields#admin_edit" #put "/admin/post-custom-fields/:id" => "post_custom_fields#admin_update" #get "/admin/post-custom-fields" => "post_custom_fields#admin_index" #post "/admin/post-custom-fields" => "post_custom_fields#admin_add" #delete "/admin/post-custom-fields/:id" => "post_custom_fields#admin_delete" #============================================================================= # Page Custom Fields and Values #============================================================================= #put "/admin/page-custom-field-values/:id" => "page_custom_field_values#admin_update" #get "/admin/page-custom-fields/json" => "page_custom_fields#admin_json" #get "/admin/page-custom-fields/:field-options" => "page_custom_fields#admin_options" #get "/admin/page-custom-fields/:id/json" => "page_custom_fields#admin_json_single" #get "/admin/page-custom-fields/:id" => "page_custom_fields#admin_edit" #put "/admin/page-custom-fields/:id" => "page_custom_fields#admin_update" #get "/admin/page-custom-fields" => "page_custom_fields#admin_index" #post "/admin/page-custom-fields" => "page_custom_fields#admin_add" #delete "/admin/page-custom-fields/:id" => "page_custom_fields#admin_delete" #============================================================================= # Google Spreadsheets #============================================================================= #get "/google-spreadsheets/:spreadsheet_id/csv" => "google_spreadsheets#csv_data" #============================================================================= # Calendar #============================================================================= #get "/admin/calendars" => "calendars#admin_index" #get "/admin/calendars/:id" => "calendars#admin_edit" #put "/admin/calendars/:id" => "calendars#admin_update" #post "/admin/calendars" => "calendars#admin_add" #delete "/admin/calendars/:id" => "calendars#admin_delete" #get "/admin/calendars/:calendar_id/events" => "events#admin_index" #get "/admin/calendars/:calendar_id/events/new" => "events#admin_new" #get "/admin/calendars/:calendar_id/events/:id" => "events#admin_edit" #put "/admin/calendars/:calendar_id/events/:id" => "events#admin_update" #post "/admin/calendars/:calendar_id/events" => "events#admin_add" #delete "/admin/calendars/:calendar_id/events/:id" => "events#admin_delete" #put "/admin/calendars/:calendar_id/event-groups/:id" => "event_groups#admin_update" #get "/admin/event-groups/period-options" => "event_groups#admin_period_options" #get "/admin/event-groups/frequency-options" => "event_groups#admin_frequency_options" #get "/admin/event-groups/repeat-by-options" => "event_groups#admin_repeat_by_options" #============================================================================= # AB Testing #============================================================================= # get "/admin/ab-variants" => "ab_variants#admin_index" # get "/admin/ab-variants/new" => "ab_variants#admin_new" # get "/admin/ab-variants/:id" => "ab_variants#admin_edit" # put "/admin/ab-variants/:id" => "ab_variants#admin_update" # post "/admin/ab-variants" => "ab_variants#admin_create" # delete "/admin/ab-variants/:id" => "ab_variants#admin_delete" # get "/admin/ab-variants/:variant_id/options" => "ab_options#admin_index" # put "/admin/ab-options/:id" => "ab_options#admin_update" # post "/admin/ab-variants/:variant_id/options" => "ab_options#admin_create" # delete "/admin/ab-options/:id" => "ab_options#admin_delete" #============================================================================= # Reviews #============================================================================= # post "/reviews/add" => "reviews#add" #============================================================================= # Cart #============================================================================= # get '/cart' => 'cart#index' # get '/cart/items' => 'cart#list' # get '/cart/item-count' => 'cart#item_count' # post '/cart' => 'cart#add' # post '/cart/gift-cards' => 'cart#add_gift_card' # delete '/cart/discounts/:discount_id' => 'cart#remove_discount' # put '/cart/:line_item_id' => 'cart#update' # delete '/cart/:line_item_id' => 'cart#remove' #============================================================================= # Checkout #============================================================================= #get '/checkout' => 'checkout#index' #get '/checkout/total' => 'checkout#verify_total' #post '/checkout/attach-user' => 'checkout#attach_user' #post '/checkout/attach-guest' => 'checkout#attach_guest' #get '/checkout/addresses' => 'checkout#addresses' #put '/checkout/addresses' => 'checkout#update_addresses' #get '/checkout/shipping' => 'checkout#shipping' #put '/checkout/shipping' => 'checkout#update_shipping' #get '/checkout/gift-cards' => 'checkout#gift_cards' #get '/checkout/payment' => 'checkout#payment' #get '/checkout/confirm' => 'checkout#confirm_without_payment' #post '/checkout/confirm' => 'checkout#confirm' #get '/checkout/thanks' => 'checkout#thanks' #get '/checkout/test-email' => 'checkout#test_email' # #get '/checkout/authnet-profile-form' => 'checkout#authnet_profile_form' #get '/checkout/authnet-relay/:order_id' => 'checkout#authnet_relay' #post '/checkout/authnet-relay/:order_id' => 'checkout#authnet_relay' #get '/checkout/authnet-relay' => 'checkout#authnet_relay' #post '/checkout/authnet-relay' => 'checkout#authnet_relay' #get '/checkout/authnet-response/:order_id' => 'checkout#authnet_response' #post '/checkout/authnet-response/:order_id' => 'checkout#authnet_response' #get '/checkout/empty' => 'checkout#empty' #============================================================================= # Product Modifications #============================================================================= # get "/admin/products/:product_id/modifications/:mod_id/values/json" => "modification_values#admin_json" # get "/admin/products/:product_id/modifications/:mod_id/values/:id/json" => "modification_values#admin_json_single" # put "/admin/products/:product_id/modifications/:mod_id/values/:id" => "modification_values#admin_update" # post "/admin/products/:product_id/modifications/:mod_id/values" => "modification_values#admin_add" # delete "/admin/products/:product_id/modifications/:mod_id/values/:id" => "modification_values#admin_delete" # put "/admin/products/:product_id/modifications/:mod_id/values/sort-order" => "modification_values#admin_update_sort_order" # get "/admin/products/:product_id/modifications/json" => "modifications#admin_json" # get "/admin/products/:product_id/modifications/:id/json" => "modifications#admin_json_single" # put "/admin/products/:product_id/modifications/:id" => "modifications#admin_update" # post "/admin/products/:product_id/modifications" => "modifications#admin_add" # delete "/admin/products/:product_id/modifications/:id" => "modifications#admin_delete" # put "/admin/products/:product_id/modifications/sort-order" => "modifications#admin_update_sort_order" #============================================================================= # Products #============================================================================= #get '/products/:id/info' => 'products#info' #get '/products/:id' => 'products#index', :constraints => { :id => /.*/ } #get '/products' => 'products#index' #post '/variants/find-by-options' => 'variants#find_by_options' #get '/variants/:id/display-image' => 'variants#display_image' # get "/admin/products" => "products#admin_index" # get "/admin/products/json" => "products#admin_json" # get '/admin/products/sort' => 'products#admin_sort' # put "/admin/categories/:category_id/products/sort-order" => "products#admin_update_sort_order" # put "/admin/products/update-vendor-status/:id" => "products#admin_update_vendor_status" # get "/admin/products/new" => "products#admin_new" # get "/admin/products/status-options" => "products#admin_status_options" # get "/admin/products/:id/general" => "products#admin_edit_general" # get "/admin/products/:id/description" => "products#admin_edit_description" # get "/admin/products/:id/categories" => "products#admin_edit_categories" # post "/admin/products/:id/categories" => "products#admin_add_to_category" # delete "/admin/products/:id/categories/:category_id" => "products#admin_remove_from_category" #get "/admin/products/:product_id/variants" => "variants#admin_index" #get "/admin/products/:product_id/variants/json" => "variants#admin_json" #get "/admin/products/:product_id/variants/option1-media" => "variants#admin_edit_option1_media" #get "/admin/products/:product_id/variants/option2-media" => "variants#admin_edit_option2_media" #get "/admin/products/:product_id/variants/option3-media" => "variants#admin_edit_option3_media" #get "/admin/products/:product_id/variants/sort-order" => "variants#admin_edit_sort_order" #put '/admin/products/:product_id/variants/option1-sort-order' => 'variants#admin_update_option1_sort_order' #put '/admin/products/:product_id/variants/option2-sort-order' => 'variants#admin_update_option2_sort_order' #put '/admin/products/:product_id/variants/option3-sort-order' => 'variants#admin_update_option3_sort_order' #put "/admin/products/:product_id/variants/:id/attach-to-image" => "variants#admin_attach_to_image" #put "/admin/products/:product_id/variants/:id/unattach-from-image" => "variants#admin_unattach_from_image" #get "/admin/products/:product_id/variants/:id/download-url" => "variants#admin_download_url" #get "/admin/products/:product_id/variants/:id/json" => "variants#admin_json_single" #get "/admin/products/:product_id/variants/:id" => "variants#admin_edit" #put '/admin/products/:product_id/variants/bulk' => 'variants#admin_bulk_update' #put "/admin/products/:product_id/variants/:id" => "variants#admin_update" #get "/admin/products/:product_id/variants/new" => "variants#admin_new" #post '/admin/products/:product_id/variants/bulk' => 'variants#admin_bulk_add' #post "/admin/products/:product_id/variants" => "variants#admin_add" #delete '/admin/products/:product_id/variants/bulk' => 'variants#admin_bulk_delete' #delete "/admin/products/:product_id/variants/:id" => "variants#admin_delete" #get "/admin/variants/status-options" => "variants#admin_status_options" #get '/admin/variants/group' => 'variants#admin_group' # get "/admin/products/:id/images" => "products#admin_edit_images" # post "/admin/products/:id/images" => "products#admin_add_image" # get "/admin/products/:id/collections" => "products#admin_edit_collections" # get "/admin/products/:id/seo" => "products#admin_edit_seo" # get "/admin/products/:id/options" => "products#admin_edit_options" # get "/admin/products/:id/delete" => "products#admin_delete_form" # get "/admin/products/:id/json" => "products#admin_json_single" # get "/admin/products/:id" => "products#admin_edit_general" # put "/admin/products/:id" => "products#admin_update" # post "/admin/products" => "products#admin_add" # delete "/admin/products/:id" => "products#admin_delete" # put "/admin/products/:id/update-vendor" => "products#admin_update_vendor" #put "/admin/product-images/sort-order" => "product_images#admin_update_sort_order" #get "/admin/product-images/:id/variant-ids" => "product_images#admin_variant_ids" #get "/admin/product-images/:id/variants" => "product_images#admin_variants" #delete "/admin/product-images/:id" => "product_images#admin_delete" #get "/variant-images/:id" => "product_images#variant_images" #============================================================================= # Stackable groups #============================================================================= # get "/admin/stackable-groups/options" => "stackable_groups#admin_options" # get "/admin/stackable-groups/json" => "stackable_groups#admin_json" # get "/admin/stackable-groups/:id/json" => "stackable_groups#admin_json_single" # get "/admin/stackable-groups" => "stackable_groups#admin_index" # put "/admin/stackable-groups/:id" => "stackable_groups#admin_update" # post "/admin/stackable-groups" => "stackable_groups#admin_add" # delete "/admin/stackable-groups/bulk" => "stackable_groups#admin_bulk_delete" # delete "/admin/stackable-groups/:id" => "stackable_groups#admin_delete" #============================================================================= # Categories #============================================================================= # get "/admin/categories" => "categories#admin_index" # get "/admin/categories/new" => "categories#admin_new" # get "/admin/categories/options" => "categories#admin_options" # get '/admin/categories/status-options' => 'categories#admin_status_options' # get "/admin/categories/:id/sort-children" => "categories#admin_sort_children" # put "/admin/categories/:id/children/sort-order" => "categories#admin_update_sort_order" # get "/admin/categories/:id/products/json" => "categories#admin_category_products" # get "/admin/categories/:id" => "categories#admin_edit" # put "/admin/categories/:id" => "categories#admin_update" # post "/admin/categories/:id" => "categories#admin_update" # post "/admin/categories" => "categories#admin_add" # delete "/admin/categories/:id" => "categories#admin_delete" #============================================================================= # Orders #============================================================================= # get "/admin/orders/city-report" => "orders#admin_city_report" # get "/admin/orders/summary-report" => "orders#admin_summary_report" # get "/admin/orders/weird-test" => "orders#admin_weird_test" # get "/admin/orders" => "orders#admin_index" # get "/admin/orders/test-info" => "orders#admin_mail_test_info" # get "/admin/orders/test-gmail" => "orders#admin_mail_test_gmail" # get "/admin/orders/status-options" => "orders#admin_status_options" # get "/admin/orders/new" => "orders#admin_new" # get "/admin/orders/print-pending" => "orders#admin_print_pending" # get "/admin/orders/:id/calculate-tax" => "orders#admin_calculate_tax" # get "/admin/orders/:id/calculate-handling" => "orders#admin_calculate_handling" # get "/admin/orders/:id/send-for-authorization" => "orders#admin_send_for_authorization" # get "/admin/orders/:id/capture" => "orders#capture_funds" # get "/admin/orders/:id/json" => "orders#admin_json" # get "/admin/orders/:id/print" => "orders#admin_print" # get "/admin/orders/:id/send-to-quickbooks" => "orders#admin_send_to_quickbooks" # get "/admin/orders/:id" => "orders#admin_edit" # put "/admin/orders/:id" => "orders#admin_update" # delete "/admin/orders/:id" => "orders#admin_delete" # get '/admin/orders/:id/void' => 'orders#admin_void' # get '/admin/orders/:id/refund' => 'orders#admin_refund' # post '/admin/orders/:id/resend-confirmation' => 'orders#admin_resend_confirmation' # post '/admin/orders' => 'orders#admin_add' # get "/admin/orders/line-items/status-options" => "line_items#admin_status_options" # get "/admin/orders/line-items/product-stubs" => "line_items#admin_product_stubs" # get "/admin/orders/:order_id/line-items/new" => "line_items#admin_new" # get "/admin/orders/:order_id/line-items/json" => "line_items#admin_json" # post "/admin/orders/:order_id/line-items" => "line_items#admin_add" # get "/admin/orders/:order_id/line-items/:id/highlight" => "line_items#admin_highlight" # put "/admin/orders/:order_id/line-items/:id" => "line_items#admin_update" # delete "/admin/orders/:order_id/line-items/:id" => "line_items#admin_delete" # get "/admin/orders/:order_id/packages/json" => "order_packages#admin_json" # get "/admin/orders/:order_id/packages/:id/calculate-shipping" => "order_packages#calculate_shipping" # get "/admin/orders/:order_id/packages/:id/shipping-rates" => "order_packages#shipping_rates" # put "/admin/orders/:order_id/packages/:id" => "order_packages#admin_update" # post "/admin/orders/:order_id/packages" => "order_packages#admin_add" # delete "/admin/orders/:order_id/packages/:id" => "order_packages#admin_delete" # get "/admin/orders/:order_id/packages/json" => "line_items#admin_json" # put "/admin/orders/:order_id/line-items/:id" => "line_items#admin_update" # delete "/admin/orders/:order_id/line-items/:id" => "line_items#admin_delete" #get "/admin/orders/:order_id/billing-address/json" => "billing_addresses#admin_json" #put "/admin/orders/:order_id/billing-address" => "billing_addresses#admin_update" #get "/admin/orders/:order_id/shipping-address/json" => "shipping_addresses#admin_json" #put "/admin/orders/:order_id/shipping-address" => "shipping_addresses#admin_update" #============================================================================= # Gift cards #============================================================================= # get "/admin/gift-cards" => "gift_cards#admin_index" # get "/admin/gift-cards/json" => "gift_cards#admin_json" # get "/admin/gift-cards/new" => "gift_cards#admin_new" # get "/admin/gift-cards/status-options" => "gift_cards#admin_status_options" # get "/admin/gift-cards/card-type-options" => "gift_cards#admin_card_type_options" # get "/admin/gift-cards/:id/json" => "gift_cards#admin_json_single" # get "/admin/gift-cards/:id" => "gift_cards#admin_edit" # put "/admin/gift-cards/bulk" => "gift_cards#admin_bulk_update" # put "/admin/gift-cards/:id" => "gift_cards#admin_update" # post "/admin/gift-cards/bulk" => "gift_cards#admin_bulk_add" # post "/admin/gift-cards" => "gift_cards#admin_add" # delete "/admin/gift-cards/bulk" => "gift_cards#admin_bulk_delete" # delete "/admin/gift-cards/:id" => "gift_cards#admin_delete" #============================================================================= # Vendors #============================================================================= # get '/admin/vendors/options' => 'vendors#options' # get '/admin/vendors/status-options' => 'vendors#status_options' # get '/admin/vendors/new' => 'vendors#admin_new' # get '/admin/vendors/:id' => 'vendors#admin_edit' # get '/admin/vendors' => 'vendors#admin_index' # post '/admin/vendors/:id/image' => 'vendors#admin_update_image' # put '/admin/vendors/:id' => 'vendors#admin_update' # post '/admin/vendors' => 'vendors#admin_add' # delete '/admin/vendors/:id' => 'vendors#admin_delete' #============================================================================= # API #============================================================================= # get "/api/products" => "products#api_index" #get "/api/instagram" => "social#authorize_instagram" #delete "/api/instagram" => "social#deauthorize_instagram" # get "/api/products/:id" => "products#api_details" # get "/api/products/:id/variants" => "products#api_variants" # get "caboose/block-types" => "block_types#api_block_type_list" # get "caboose/block-types/:name" => "block_types#api_block_type" #============================================================================= # Catch all #============================================================================= match '*path' => 'pages#show' root :to => 'pages#show' end
68.072368
142
0.504591
dd53d4d27412c0e8f9561cba6bcb3a7008764d4c
602
java
Java
src/main/java/br/com/mesquitas/projecttask/repository/TaskRepository.java
adxmesquita/project-task-spring-boot
64ac0d670cb0da7d0b97c6646e11fb5ff29a35c5
[ "MIT" ]
null
null
null
src/main/java/br/com/mesquitas/projecttask/repository/TaskRepository.java
adxmesquita/project-task-spring-boot
64ac0d670cb0da7d0b97c6646e11fb5ff29a35c5
[ "MIT" ]
null
null
null
src/main/java/br/com/mesquitas/projecttask/repository/TaskRepository.java
adxmesquita/project-task-spring-boot
64ac0d670cb0da7d0b97c6646e11fb5ff29a35c5
[ "MIT" ]
null
null
null
/** * */ package br.com.mesquitas.projecttask.repository; import java.util.List; import javax.transaction.Transactional; import org.springframework.data.repository.CrudRepository; import br.com.mesquitas.projecttask.model.Task; /** * @author Alessandro Mesquita * */ @Transactional public interface TaskRepository extends CrudRepository<Task, Long>{ public Task findByName(String name); public Task findByNameIgnoreCase(String name); public Task findByNameAndId(String name, long id); public List<Task> findAllByOrderByIdDesc(); public List<Task> findAllByOrderByNameAsc(); }
18.242424
67
0.774086
da855c64083cf128b74def3449fa1126c99a1c02
2,596
php
PHP
src/common.php
manifestinteractive/weather-underground-alfred-workflow
9d36c4393f0dcdd8280daf0458bfdaaaf0e57d53
[ "MIT" ]
3
2018-06-04T16:21:09.000Z
2020-08-09T12:41:52.000Z
src/common.php
manifestinteractive/weather-underground-alfred-workflow
9d36c4393f0dcdd8280daf0458bfdaaaf0e57d53
[ "MIT" ]
null
null
null
src/common.php
manifestinteractive/weather-underground-alfred-workflow
9d36c4393f0dcdd8280daf0458bfdaaaf0e57d53
[ "MIT" ]
null
null
null
<?php error_reporting(0); require_once('workflows.php'); $workflow = new Workflows(); define('API_KEY', $workflow->get('api.key', 'settings.plist')); define('ICON_COLOR', $workflow->get('icon.color', 'settings.plist')); define('WEATHER_LOCATION', $workflow->get('default.location', 'settings.plist')); define('WEATHER_UNIT', $workflow->get('preferred.unit', 'settings.plist')); define('CACHE_PATH', getcwd() . '/cache/'); define('CACHE_EXPIRE', 300); define('WEATHER_FORECAST_URL', "https://api.wunderground.com/api/" . API_KEY . "/forecast/" . WEATHER_LOCATION . ".json"); define('WEATHER_CONDITIONS_URL', "https://api.wunderground.com/api/" . API_KEY . "/conditions/" . WEATHER_LOCATION . ".json"); /** * @param $url * @return mixed|string */ function get_content($url) { /** Purge old files from cache */ foreach (glob(CACHE_PATH . '*.json') as $file) { if (filemtime($file) > time() - CACHE_EXPIRE) { unlink($file); } } $file = CACHE_PATH . md5($url) . '.json'; $current_time = time(); $expire_time = CACHE_EXPIRE; $file_time = filemtime($file); $time_difference = $current_time - $expire_time; if(file_exists($file) && ($time_difference < $file_time)) { return file_get_contents($file); } else { $content = get_url($url); file_put_contents($file, $content); return $content; } } /** * @param $url * @return mixed */ function get_url($url) { $workflow = new Workflows(); return $workflow->request($url); } /** * @param $icon * @return string */ function weather_icon($icon) { return "icons/" . ICON_COLOR . "/{$icon}.png"; } /** * @param $weather * @return string */ function weather_title($weather) { return "{$weather->display_location->full}: {$weather->weather}"; } /** * @param $weather * @return string */ function weather_subtitle($weather) { if (WEATHER_UNIT === 'F') { return "{$weather->temp_f}'°F"; } else { return "{$weather->temp_c}'°C"; } } /** * @param $fc * @return string */ function forecast_title($fc) { return "{$fc->date->weekday}: $fc->conditions"; } /** * @param $fc * @return string */ function forecast_subtitle($fc) { if (WEATHER_UNIT === 'F') { return "" . "High: {$fc->high->fahrenheit}°F " . "Low: {$fc->low->fahrenheit}°F " . "Precipitation: {$fc->pop}%"; } else { return "" . "High: {$fc->high->celsius}°C " . "Low: {$fc->low->celsius}°C " . "Precipitation: {$fc->pop}%"; } }
24.490566
126
0.585131
a1871782c7c35752a76b796d6225778a0539c257
402
ts
TypeScript
src/router/beforeEach.ts
117sparta/personal-stuff-fe
d4ac0b4be3705df2bf36646c59e16bd894cca81b
[ "MIT" ]
null
null
null
src/router/beforeEach.ts
117sparta/personal-stuff-fe
d4ac0b4be3705df2bf36646c59e16bd894cca81b
[ "MIT" ]
2
2022-02-19T00:14:05.000Z
2022-02-27T02:35:07.000Z
src/router/beforeEach.ts
117sparta/personal-stuff-fe
d4ac0b4be3705df2bf36646c59e16bd894cca81b
[ "MIT" ]
null
null
null
import store from '@/store'; export default function beforeEachHooks (to, from, next) { const isAuth = store.getters['user/isAuth']; if ((!isAuth && to.meta.needAuth) || (!isAuth && to.fullPath === '/')) { next({ path: '/login' }); // 没有登录,跳转到登录页 } else if ((isAuth && to.fullPath === '/') || (isAuth && to.fullPath === '/login')) { next({ path: '/home' }); } else { next(); } }
30.923077
87
0.554726
af2b28257b96746d4ba4c68f60dc180d302ba0cc
6,083
py
Python
Lib/site-packages/numarray/random_array/dtest.py
raychorn/svn_Python-2.5.1
425005b1b489ba44ec0bb989e077297e8953d9be
[ "PSF-2.0" ]
null
null
null
Lib/site-packages/numarray/random_array/dtest.py
raychorn/svn_Python-2.5.1
425005b1b489ba44ec0bb989e077297e8953d9be
[ "PSF-2.0" ]
null
null
null
Lib/site-packages/numarray/random_array/dtest.py
raychorn/svn_Python-2.5.1
425005b1b489ba44ec0bb989e077297e8953d9be
[ "PSF-2.0" ]
null
null
null
""" >>> eps = 1e-4 >>> seed(104162795, 1578461743) >>> int((random()-0.0780920758843) < eps) 1 Average of 10000 random numbers >>> int((num.sum(random(10000))/10000. - 0.49829185756540684) < eps) 1 >>> x = random([10,1000]) >>> x.shape (10, 1000) >>> x.shape = 10000 Average of 100 by 100 random numbers >>> int((num.sum(x)/10000. - 0.50674083693527938) < eps) 1 >>> y = uniform(0.5,0.6, (1000,10)) >>> y.shape (1000, 10) >>> y.shape = 10000 >>> num.minimum.reduce(y) <= 0.5 0 >>> num.maximum.reduce(y) >= 0.6 0 >>> showint(randint(1, 10, shape=[50])) array([4, 8, 5, 4, 9, 7, 2, 8, 6, 2, 5, 9, 1, 4, 6, 2, 2, 1, 4, 4, 9, 1, 5, 5, 8, 6, 9, 5, 5, 7, 5, 2, 6, 9, 1, 3, 2, 3, 5, 2, 8, 9, 8, 4, 3, 6, 6, 1, 4, 9], type=Int32) >>> showint(permutation(10)) array([3, 9, 7, 2, 1, 6, 5, 4, 8, 0], type=Int32) >>> showint(randint(3,9)) array(5, type=Int32) >>> showint(random_integers(10, shape=[20])) array([ 3, 6, 10, 5, 6, 2, 4, 1, 10, 7, 4, 10, 2, 7, 8, 7, 4, 6, 9, 9], type=Int32) >>> s = 3.0; x = normal(2.0, s, [10, 1000]) >>> x.shape (10, 1000) >>> x.shape = 10000 >>> mean_var_test(x, "normally distributed numbers with mean 2 and variance %f"%(s**2,), 2, s**2, 0, 1.98057479, 8.96347252, 0.01992834, eps=eps) OK OK OK >>> mean_var_test(exponential(3, 10000), "random numbers exponentially distributed with mean %f"%(s,), s, s**2, 2, 2.97389160, 8.93841228, 1.93402556, eps=eps) OK OK OK A multivariate normal >>> x = multivariate_normal(num.array([10,20]), num.array(([1,2],[2,4]))); x array([ 9.95170432, 19.90340867]) >>> x.shape (2,) A 4x3x2 array containing multivariate normals >>> case(multivariate_normal(num.array([10,20]), num.array([[1,2],[2,4]]), [4,3]), ... num.array([[[ 10.78558756, 21.57117509], ... [ 8.81081523, 17.62163042], ... [ 10.48636767, 20.97273535]], ... [[ 9.75619604, 19.51239207], ... [ 9.24218798, 18.48437595], ... [ 10.38599356, 20.77198715]], ... [[ 11.93676401, 23.873528 ], ... [ 8.26186252, 16.52372503], ... [ 11.73060812, 23.46121621]], ... [[ 8.94173038, 17.88346076], ... [ 10.95564306, 21.91128612], ... [ 8.53284202, 17.06568409]]]), ... eps) OK Average of 10000 multivariate normals with mean [-100,0,100] >>> x = multivariate_normal(num.array([-100,0,100]), ... num.array([[3,2,1],[2,2,1],[1,1,1]]), 10000) >>> x_mean = num.sum(x)/10000. >>> x_minus_mean = x - x_mean Estimated covariance of 10000 multivariate normals with covariance [[3,2,1],[2,2,1],[1,1,1]] >>> case(num.matrixmultiply(num.transpose(x_minus_mean),x_minus_mean)/9999., ... num.array([[ 2.97686405, 1.98555651, 1.00144592], ... [ 1.98555651, 1.98528312, 0.99716822], ... [ 1.00144592, 0.99716822, 0.99382558]]), ... eps) OK >>> x = beta(5.0, 10.0, 10000) >>> mean_var_test(x, "beta(5.,10.) random numbers", 0.333, 0.014, [], ... 0.33464588, 0.01402210, eps=eps) OK OK >>> x = gamma(.01, 2., 10000) >>> mean_var_test(x, "gamma(.01,2.) random numbers", 2*100, 2*100*100, [], ... 200.10160522, 19908.49448647, eps=eps) OK OK >>> x = chi_square(11., 10000) >>> mean_var_test(x, "chi squared random numbers with 11 degrees of freedom", ... 11, 22, 2*num.sqrt(2./11.), ... 10.97071185, 21.70231540, 0.81841066, eps=eps) OK OK OK >>> x = F(5., 10., 10000) >>> mean_var_test(x, "F random numbers with 5 and 10 degrees of freedom", ... 1.25, 1.35, [], ... 1.24867357, 1.27926212, eps=eps) OK OK >>> x = poisson(50., 10000) >>> mean_var_test(x, "poisson random numbers with mean 50", 50, 50, 0.14, ... 50.03410000, 49.84952214, 0.13964030, eps=eps) OK OK OK Each element is the result of 16 binomial trials with probability 0.5: >>> binomial(16, 0.5, 16) array([ 5, 8, 6, 5, 7, 5, 4, 10, 6, 9, 7, 8, 10, 8, 5, 9]) Each element is the result of 16 negative binomial trials with probability 0.5: >>> negative_binomial(16, 0.5, [16,]) array([10, 8, 14, 11, 30, 17, 19, 9, 10, 23, 22, 16, 9, 15, 20, 17]) Each row is the result of 16 multinomial trials with probabilities [0.1, 0.5, 0.1 0.3]: >>> x = multinomial(16, [0.1, 0.5, 0.1], 8); x array([[ 2, 6, 4, 4], [ 1, 6, 4, 5], [ 1, 11, 1, 3], [ 0, 9, 2, 5], [ 0, 9, 3, 4], [ 2, 8, 3, 3], [ 0, 7, 3, 6], [ 2, 8, 4, 2]]) >>> num.sum(x)/8. # Mean array([ 1., 8., 3., 4.]) Using array arguments: >>> y = beta([5.0, 50.], [10.0, 100.0]) >>> int(y.shape in [(1,), (2,)]) 1 >>> y = beta([5.0, 50.], 10.0) >>> int(y.shape in [(1,), (2,)]) 1 >>> y = beta(5.0, [10.0, 100.0]) >>> int(y.shape in [(1,), (2,)]) 1 >>> y = beta(5.0, [[10.0, 100.0, 50.0], [12.0, 200.0, 150.0]]) >>> int(y.shape == (2, 3)) 1 >>> y = beta(5.0, [10.0, 100.0], shape = (3, 2)) >>> int(y.shape == (3, 2)) 1 """ from RandomArray2 import * import numarray.numeric as num class SelftestFailure(Exception): pass def showint(x): return num.explicit_type(num.inputarray(x).astype('Int32')) def cndns(m): return num.maximum.reduce(num.inputarray(num.abs(m)).flat) def case(expr, ans, eps=1e-9): if abs(cndns(ans-expr)/cndns(ans)) < eps: print "OK" else: raise SelftestFailure def mean_var_test(x, type, mean, var, skew=[], mean_ans=None, var_ans=None, skew_ans=None, eps=1e-9): if mean_ans is None or var_ans is None: raise ValueError, "Invalid test parameters" n = len(x) * 1.0 x_mean = num.sum(x)/n x_minus_mean = x - x_mean x_var = num.sum(x_minus_mean*x_minus_mean)/(n-1.0) case(x_mean, mean_ans, eps) case(x_var, var_ans, eps) if skew != []: x_skew = (num.sum(x_minus_mean*x_minus_mean*x_minus_mean)/9998.)/x_var**(3./2.) case(x_skew, skew_ans, eps) from numarray.numtest import dtp def test(): import doctest, dtest return doctest.testmod(dtest)
28.032258
159
0.551701
5af3de346dd0e541989e818ddca5eb8c0bd6516a
580
dart
Dart
example/lib/model/user/person/person.dart
DimmyMaenhout/flutter-model-generator
a46b9790353892359b5dce4756226266182ab0e3
[ "MIT" ]
null
null
null
example/lib/model/user/person/person.dart
DimmyMaenhout/flutter-model-generator
a46b9790353892359b5dce4756226266182ab0e3
[ "MIT" ]
null
null
null
example/lib/model/user/person/person.dart
DimmyMaenhout/flutter-model-generator
a46b9790353892359b5dce4756226266182ab0e3
[ "MIT" ]
2
2020-08-28T16:53:29.000Z
2020-09-28T06:35:57.000Z
import 'package:flutter/material.dart'; import 'package:json_annotation/json_annotation.dart'; import 'package:model_generator_example/model/user/person/gender.dart'; part 'person.g.dart'; @JsonSerializable() class Person { @JsonKey(name: 'firstName', required: true) final String firstName; @JsonKey(name: 'gender', required: true) final Gender gender; Person({ @required this.firstName, @required this.gender, }); factory Person.fromJson(Map<String, dynamic> json) => _$PersonFromJson(json); Map<String, dynamic> toJson() => _$PersonToJson(this); }
25.217391
79
0.731034
bb22405114556c53a4ebc6341e8ca82406554b0b
10,570
cs
C#
IPv6SubnettingTool/AboutBox1.Designer.cs
ygvn/IPv6-Subnet-Calculator-Tool-CSharp
fdf47a25eeb0ee2db91720feff41b7048234cc2e
[ "BSD-3-Clause" ]
25
2018-06-17T01:51:29.000Z
2022-03-29T11:15:38.000Z
IPv6SubnettingTool/AboutBox1.Designer.cs
ygvn/IPv6-Subnet-Calculator-Tool-CSharp
fdf47a25eeb0ee2db91720feff41b7048234cc2e
[ "BSD-3-Clause" ]
1
2018-12-08T14:54:48.000Z
2018-12-08T19:14:18.000Z
IPv6SubnettingTool/AboutBox1.Designer.cs
ygvn/IPv6-Subnet-Calculator-Tool-CSharp
fdf47a25eeb0ee2db91720feff41b7048234cc2e
[ "BSD-3-Clause" ]
4
2018-06-17T01:51:56.000Z
2019-02-27T08:34:20.000Z
/* * Copyright (c) 2010-2020 Yucel Guven * All rights reserved. * * This file is part of IPv6 Subnetting Tool. * * Version: 4.5 * Release Date: 16 April 2020 * * Redistribution and use in source and binary forms, with or without * modification, are permitted (subject to the limitations in the * disclaimer below) provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE * GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS * AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ namespace IPv6SubnettingTool { partial class AboutBox1 { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.okButton = new System.Windows.Forms.Button(); this.labelCopyright = new System.Windows.Forms.Label(); this.labelVersion = new System.Windows.Forms.Label(); this.labelProductName = new System.Windows.Forms.Label(); this.tableLayoutPanel = new System.Windows.Forms.TableLayoutPanel(); this.labelEmail = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.labelNET = new System.Windows.Forms.Label(); this.tableLayoutPanel.SuspendLayout(); this.SuspendLayout(); // // okButton // this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.okButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.okButton.Location = new System.Drawing.Point(215, 200); this.okButton.Name = "okButton"; this.okButton.Size = new System.Drawing.Size(75, 26); this.okButton.TabIndex = 24; this.okButton.Text = "&OK"; // // labelCopyright // this.labelCopyright.Dock = System.Windows.Forms.DockStyle.Fill; this.labelCopyright.Location = new System.Drawing.Point(6, 30); this.labelCopyright.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0); this.labelCopyright.MaximumSize = new System.Drawing.Size(0, 17); this.labelCopyright.Name = "labelCopyright"; this.labelCopyright.Size = new System.Drawing.Size(272, 15); this.labelCopyright.TabIndex = 21; this.labelCopyright.Text = "Copyright"; this.labelCopyright.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // labelVersion // this.labelVersion.Dock = System.Windows.Forms.DockStyle.Fill; this.labelVersion.Location = new System.Drawing.Point(6, 15); this.labelVersion.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0); this.labelVersion.MaximumSize = new System.Drawing.Size(0, 17); this.labelVersion.Name = "labelVersion"; this.labelVersion.Size = new System.Drawing.Size(272, 15); this.labelVersion.TabIndex = 0; this.labelVersion.Text = "Version"; this.labelVersion.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // labelProductName // this.labelProductName.Dock = System.Windows.Forms.DockStyle.Fill; this.labelProductName.Location = new System.Drawing.Point(6, 0); this.labelProductName.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0); this.labelProductName.MaximumSize = new System.Drawing.Size(0, 17); this.labelProductName.Name = "labelProductName"; this.labelProductName.Size = new System.Drawing.Size(272, 15); this.labelProductName.TabIndex = 19; this.labelProductName.Text = "Product Name"; this.labelProductName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // tableLayoutPanel // this.tableLayoutPanel.ColumnCount = 1; this.tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tableLayoutPanel.Controls.Add(this.labelEmail, 0, 3); this.tableLayoutPanel.Controls.Add(this.labelProductName, 0, 0); this.tableLayoutPanel.Controls.Add(this.labelVersion, 0, 1); this.tableLayoutPanel.Controls.Add(this.labelCopyright, 0, 2); this.tableLayoutPanel.Controls.Add(this.label2, 0, 5); this.tableLayoutPanel.Controls.Add(this.labelNET, 0, 4); this.tableLayoutPanel.Location = new System.Drawing.Point(9, 9); this.tableLayoutPanel.Name = "tableLayoutPanel"; this.tableLayoutPanel.RowCount = 6; this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 15F)); this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 15F)); this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 15F)); this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 15F)); this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 19F)); this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 77F)); this.tableLayoutPanel.Size = new System.Drawing.Size(281, 185); this.tableLayoutPanel.TabIndex = 0; // // labelEmail // this.labelEmail.AutoSize = true; this.labelEmail.Dock = System.Windows.Forms.DockStyle.Fill; this.labelEmail.Location = new System.Drawing.Point(3, 45); this.labelEmail.Name = "labelEmail"; this.labelEmail.Size = new System.Drawing.Size(275, 15); this.labelEmail.TabIndex = 26; // // label2 // this.label2.Location = new System.Drawing.Point(3, 79); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(275, 98); this.label2.TabIndex = 1; this.label2.Text = "\r\n\r\n IPv4> FF.FF.FF.FF \r\n 4294967295\r\n \r\nIPv6> FFFF:FFFF:F" + "FFF:FFFF:FFFF:FFFF:FFFF:FFFF 340282366920938463463374607431768" + "211455"; // // labelNET // this.labelNET.AutoSize = true; this.labelNET.Location = new System.Drawing.Point(3, 60); this.labelNET.Name = "labelNET"; this.labelNET.Size = new System.Drawing.Size(35, 13); this.labelNET.TabIndex = 25; this.labelNET.Text = ".NET "; this.labelNET.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // AboutBox1 // this.AcceptButton = this.okButton; this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.SystemColors.Control; this.ClientSize = new System.Drawing.Size(299, 234); this.Controls.Add(this.tableLayoutPanel); this.Controls.Add(this.okButton); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.KeyPreview = true; this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "AboutBox1"; this.Padding = new System.Windows.Forms.Padding(9); this.ShowIcon = false; this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "IPv6 Subnet Calculator - AboutBox"; this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.AboutBox1_KeyDown); this.tableLayoutPanel.ResumeLayout(false); this.tableLayoutPanel.PerformLayout(); this.ResumeLayout(false); } #endregion private System.Windows.Forms.Button okButton; private System.Windows.Forms.Label labelCopyright; private System.Windows.Forms.Label labelVersion; private System.Windows.Forms.Label labelProductName; private System.Windows.Forms.TableLayoutPanel tableLayoutPanel; private System.Windows.Forms.Label labelEmail; private System.Windows.Forms.Label label2; private System.Windows.Forms.Label labelNET; } }
50.817308
159
0.639924
14b9f96c18e8b048e2059790236441ea88805540
1,101
tsx
TypeScript
src/index.tsx
leo-lucas/context-extend
85600a9c77525a53b0836708c623be13309bc93a
[ "MIT" ]
null
null
null
src/index.tsx
leo-lucas/context-extend
85600a9c77525a53b0836708c623be13309bc93a
[ "MIT" ]
21
2021-03-02T00:40:09.000Z
2022-03-08T23:02:10.000Z
src/index.tsx
leo-lucas/context-extend
85600a9c77525a53b0836708c623be13309bc93a
[ "MIT" ]
null
null
null
import React, { createContext, useContext, useReducer, Reducer } from 'react'; export const StateContext = createContext({}); type ActionCreator = { type: string } interface createReducer{ reducer: Reducer<Object, ActionCreator> , children: JSX.Element } export function combineReducers(reducer: any){ return (state: any , action: any) => { const nextReducers: any= {}; for (const prop in reducer) { nextReducers[prop] = reducer[prop](state[prop], action) } return nextReducers; }; }; export const Provider = ({ reducer, children }: createReducer) => { return ( <StateContext.Provider value={useReducer(reducer, {})}> {children} </StateContext.Provider> )}; export const useStateValue = () => useContext(StateContext); export function useSelector (selector: Function) { const [state]:any = useStateValue() return selector(state); } export function useDipatch(): Function { const [state, dispatch]:any = useStateValue(); return (action: Function| ActionCreator) => typeof action === "function" ? action(dispatch, state) : dispatch(action) }
26.853659
119
0.695731
b061c62a26c61b8287eb3e27d9f7cd1455f02e27
1,169
py
Python
3) Cartoonizing and Video Capture/#2 Keyboard Inputs/keyboard_input.py
RezaFirouzii/python-opencv-review
454a2be7fa36516a2b1fbd4e6162068bba25c989
[ "MIT" ]
null
null
null
3) Cartoonizing and Video Capture/#2 Keyboard Inputs/keyboard_input.py
RezaFirouzii/python-opencv-review
454a2be7fa36516a2b1fbd4e6162068bba25c989
[ "MIT" ]
null
null
null
3) Cartoonizing and Video Capture/#2 Keyboard Inputs/keyboard_input.py
RezaFirouzii/python-opencv-review
454a2be7fa36516a2b1fbd4e6162068bba25c989
[ "MIT" ]
null
null
null
# press any numeric key on your keyboard including [0 to 9] # to change the color space of your stream and current frame! import cv2 as cv if __name__ == "__main__": cap = cv.VideoCapture(0, cv.CAP_DSHOW) if not cap.isOpened(): raise IOError("Webcam could not be opened!\nTry a static video instead.") options = { 0: None, # reset 1: cv.COLOR_BGR2GRAY, 2: cv.COLOR_BGR2HSV, 3: cv.COLOR_BGR2YUV, 4: cv.COLOR_BGR2RGB, 5: cv.COLOR_BGR2LUV, 6: cv.COLOR_BGR2XYZ, 7: cv.COLOR_BGR2HLS, 8: cv.COLOR_BGR2LAB, 9: cv.COLOR_BGR2YCrCb } current_mode = 0 while True: res, frame = cap.read() if not res: break # frame = cv.resize(frame, None, fx=.5, fy=.5) key = cv.waitKey(20) if key == 27: break key -= 48 # ascii code of key - ascii of '0' if key in options.keys(): current_mode = key if current_mode: frame = cv.cvtColor(frame, options[current_mode]) cv.imshow('Webcam', frame) cap.release() cv.destroyAllWindows()
23.857143
81
0.560308
925d72b788392d3c1906ed8b7e00b615377aa630
647
rb
Ruby
app/controllers/spree/admin/orders_controller_decorator.rb
ricardomzz/spree_admin_activity_tracker
e2099216e0d6de000cb9b6cf240cec7492fde320
[ "BSD-3-Clause" ]
2
2018-07-02T20:56:23.000Z
2020-11-09T05:29:29.000Z
app/controllers/spree/admin/orders_controller_decorator.rb
ricardomzz/spree_admin_activity_tracker
e2099216e0d6de000cb9b6cf240cec7492fde320
[ "BSD-3-Clause" ]
1
2019-04-24T14:43:42.000Z
2019-04-24T14:43:42.000Z
app/controllers/spree/admin/orders_controller_decorator.rb
vinsol-spree-contrib/spree_admin_activity_tracker
e2099216e0d6de000cb9b6cf240cec7492fde320
[ "BSD-3-Clause" ]
6
2018-09-12T06:50:56.000Z
2021-06-01T13:17:22.000Z
Spree::Admin::OrdersController.class_eval do def close_adjustments adjustments = @order.all_adjustments.open adjustments.update_all(state: 'closed') flash[:success] = Spree.t(:all_adjustments_closed) respond_with(@order) { |format| format.html { redirect_back fallback_location: admin_order_adjustments_url(@order) } } end def open_adjustments adjustments = @order.all_adjustments.closed adjustments.update_all(state: 'open') flash[:success] = Spree.t(:all_adjustments_opened) respond_with(@order) { |format| format.html { redirect_back fallback_location: admin_order_adjustments_url(@order) } } end end
35.944444
122
0.757342
dd80873e04a5e7b23def7918c3e754b4da019c76
2,217
sh
Shell
manual-import/manual-import.sh
blockchain-etl/bitcoin-etl-airflow-neo4j
158c4f37bed17818c873123cf8dba1781ea69182
[ "MIT" ]
12
2019-03-30T13:58:32.000Z
2021-11-15T05:30:09.000Z
manual-import/manual-import.sh
manolaz/bitcoin-etl-airflow-neo4j
ac2461d5af35a12f3af78e2d18a80ade6746a8e2
[ "MIT" ]
7
2020-08-18T09:00:48.000Z
2022-03-01T23:25:38.000Z
manual-import/manual-import.sh
manolaz/bitcoin-etl-airflow-neo4j
ac2461d5af35a12f3af78e2d18a80ade6746a8e2
[ "MIT" ]
5
2019-03-19T03:22:49.000Z
2019-11-26T13:27:03.000Z
#!/usr/bin/env bash set -e for var in PROJECT NEO_PASSWORD NEO_HOST; do if [[ -z "${!var:-}" ]]; then echo "You need to provide a value for env variable $var" exit 1 fi done # Create all loading entries declare -A points ordered_dates=() for year in $(seq 2009 2010); do start_of_year="$year-01-01" ordered_dates+=($start_of_year) points[$start_of_year]="YEAR" done # for year in $(seq 2011 2012); do # for month in $(seq -f "%02g" 1 12); do # start_of_month="${year}-${month}-01" # ordered_dates+=($start_of_month) # points[$start_of_month]="MONTH" # done # done # # for year in $(seq 2013 2018); do # for week in $(seq 0 52); do # start_of_week=$(date -d"$year-01-01 +$(($week * 7))days" +%Y-%m-%d) # ordered_dates+=($start_of_week) # points[$start_of_week]="WEEK" # done # done # First export all data # for START_DATE in ${ordered_dates[@]}; do # echo "Import for $START_DATE with interval ${points[${START_DATE}]} starting at $(date)" # START_DATE=$START_DATE INTERVAL=${points[${START_DATE}]} ./create-tables.sh # START_DATE=$START_DATE ./tables-to-bucket.sh # done # First create all nodes independent of indexes for START_DATE in ${ordered_dates[@]}; do echo "Import for $START_DATE with interval ${points[${START_DATE}]} starting at $(date)" START_DATE=$START_DATE ./create-non-linked-nodes.sh done # Then we create indexes echo "$(date -Iseconds): Creating indexes" ./setup-indexes.sh # Once indexes are created we link previously created nodes. CYPHER_CMD="cypher-shell -u neo4j -p $NEO_PASSWORD -a bolt+routing://$NEO_HOST:7687 " echo "$(date -Iseconds): Linking blocks together" cat cypher/link-blocks.cypher | $CYPHER_CMD echo "$(date -Iseconds): Linking transactions to blocks" cat cypher/link-txns.cypher | $CYPHER_CMD # Now that indexes are created and some other links also we create nodes and relationships that require extra information for START_DATE in ${ordered_dates[@]}; do echo "Import for $START_DATE with interval ${points[${START_DATE}]} starting at $(date)" START_DATE=$START_DATE ./create-dependent-nodes.sh done
31.225352
121
0.669824
4cdf98be10bbadb46dced6192475b5c018f7556e
3,349
py
Python
Python Scripts And Model/HandGestureModel/HandNetMaker.py
karthik-charan/HandGestureDetection
824b8a38d3de5eb6346a2adc6f54acdbaf5daa5e
[ "MIT" ]
null
null
null
Python Scripts And Model/HandGestureModel/HandNetMaker.py
karthik-charan/HandGestureDetection
824b8a38d3de5eb6346a2adc6f54acdbaf5daa5e
[ "MIT" ]
null
null
null
Python Scripts And Model/HandGestureModel/HandNetMaker.py
karthik-charan/HandGestureDetection
824b8a38d3de5eb6346a2adc6f54acdbaf5daa5e
[ "MIT" ]
null
null
null
""" HandNetMaker.py This script is only to be runs ONCE. It creates the JSON model file for the neural network which will be used to train and creature the neural network. By: https://www.youtube.com/user/toy741life Video Demo: https://www.youtube.com/watch?v=Y6oLbRKwmPk Hand gesture detection. """ from keras.models import Sequential from keras.layers.core import Dense, Dropout, Activation, Flatten from keras.layers import Convolution2D, ZeroPadding2D, MaxPooling2D import time import numpy as np def custom_model_hand(): ''' USER CODE STARTS HERE ''' image_model = Sequential() image_model.add(ZeroPadding2D((2, 2), batch_input_shape=(1, 1, 50, 50))) #54x54 fed in due to zero padding image_model.add(Convolution2D(8, 5, 5, activation='relu', name='conv1_1')) image_model.add(ZeroPadding2D((2, 2))) image_model.add(Convolution2D(8, 5, 5, activation='relu', name='conv1_2')) image_model.add(MaxPooling2D((2, 2), strides=(2, 2))) #convert 50x50 to 25x25 #25x25 fed in image_model.add(ZeroPadding2D((2, 2))) image_model.add(Convolution2D(16, 5, 5, activation='relu', name='conv2_1')) image_model.add(ZeroPadding2D((2, 2))) image_model.add(Convolution2D(16, 5, 5, activation='relu', name='conv2_2')) image_model.add(MaxPooling2D((5, 5), strides=(5, 5))) #convert 25x25 to 5x5 #5x5 fed in image_model.add(ZeroPadding2D((2, 2))) image_model.add(Convolution2D(40, 5, 5, activation='relu', name='conv3_1')) image_model.add(ZeroPadding2D((2, 2))) image_model.add(Convolution2D(32, 5, 5, activation='relu', name='conv3_2')) image_model.add(Dropout(0.2)) image_model.add(Flatten()) image_model.add(Dense(512)) image_model.add(Activation('tanh')) image_model.add(Dropout(0.2)) image_model.add(Dense(512)) image_model.add(Activation('tanh')) image_model.add(Dropout(0.15)) image_model.add(Dense(512)) image_model.add(Activation('tanh')) image_model.add(Dropout(0.1)) image_model.add(Dense(512)) image_model.add(Activation('tanh')) image_model.add(Dense(512)) image_model.add(Activation('tanh')) image_model.add(Dense(512)) image_model.add(Activation('tanh')) image_model.add(Dense(512)) image_model.add(Activation('tanh')) image_model.add(Dense(512)) image_model.add(Activation('tanh')) image_model.add(Dense(10)) image_model.add(Activation('sigmoid')) return image_model ''' USER CODE ENDS HERE ''' def make_model(file): print("==================================================") print("Creating Model At: ",file) start_time = time.time() model = custom_model_hand() json_model = model.to_json() with open(file, "w") as json_file: json_file.write(json_model) end_time = time.time() total_time = end_time-start_time print("Model Created: ",total_time, " seconds") print("==================================================") if __name__ == "__main__": make_model("hand_detection_model_3.json")
28.142857
82
0.60854
1baff280e0ce3828f007ec1418dbb0598caf1e59
4,241
swift
Swift
CPU Simulator 2019/Overview.swift
Haoy2001/CPU-Simulator-2019
0e460fb9784808948698671178790ed76fc06081
[ "Apache-2.0" ]
1
2018-09-12T00:10:43.000Z
2018-09-12T00:10:43.000Z
CPU Simulator 2019/Overview.swift
Haoy2001/CPU-Simulator-2019
0e460fb9784808948698671178790ed76fc06081
[ "Apache-2.0" ]
null
null
null
CPU Simulator 2019/Overview.swift
Haoy2001/CPU-Simulator-2019
0e460fb9784808948698671178790ed76fc06081
[ "Apache-2.0" ]
null
null
null
// // Overview.swift // CPU Simulator 2019 // // Created by Hao Yun on 2018-01-11. // Copyright © 2018 Hao Yun. All rights reserved. // import Foundation import SpriteKit import Cocoa class Overview: Scene { //locations and dimen of 3 buttons let x = [654, 66, 66] let y = [66, 458, 158] let w = [703, 315, 315] let h = [651, 268, 203] var buttons: Array<SKShapeNode>? var dataBus: HorizontalBus? var addressBus: HorizontalBus? var readLine: HorizontalBus? var writeLine: HorizontalBus? var reg1Line: Bus? var reg2Line: Bus? var reg3Line: Bus? var subLine: Bus? override init(id: Int, controller: SceneController, bg: String) { super.init(id: id, controller: controller, bg: bg) //remove back button and label nodeArray.remove(at: 1).isHidden = true nodeArray.remove(at: 1).isHidden = true //generate buttons buttons = [] for i in 0...2 { let button = SKShapeNode(rect: CGRect(x: x[i], y: y[i], width: w[i], height: h[i]), cornerRadius: 20) button.lineWidth = 14 button.strokeColor = SKColor.cyan button.fillColor = SKColor.clear button.zPosition = 12 buttons?.append(button) addNode(node: button) } //busses dataBus = HorizontalBus(x: 516, y: 485, width: 264, height: 231, bits: 16, spacing: 1.0, scene: self) dataBus?.enableLabel(x: 517, y: 573, fontSize: 50, scene: self) addressBus = HorizontalBus(x: 520, y: 176, width: 270, height: 110, bits: 8, spacing: 1, scene: self) addressBus?.enableLabel(x: 517, y: 205, fontSize: 50, scene: self) readLine = HorizontalBus(x: 519, y: 295, width: 270, height: 10, bits: 1, spacing: 1, scene: self) readLine?.activeColour = NSColor.purple writeLine = HorizontalBus(x: 519, y: 315, width: 270, height: 10, bits: 1, spacing: 1, scene: self) writeLine?.activeColour = NSColor.green reg1Line = Bus(x: 110, y: 408, width: 20, height: 90, bits: 1, scene: self) reg1Line?.activeColour = SKColor.green reg2Line = Bus(x: 150, y: 408, width: 20, height: 90, bits: 1, scene: self) reg2Line?.activeColour = SKColor.green reg3Line = Bus(x: 190, y: 408, width: 20, height: 90, bits: 1, scene: self) reg3Line?.activeColour = SKColor.purple subLine = Bus(x: 230, y: 408, width: 20, height: 90, bits: 1, scene: self) subLine?.activeColour = SKColor.yellow //labels addNode(node: controller.makeLabel(x: 1007, y: 385, fontSize: 40, colour: SKColor.green, text: "Memory")) addNode(node: controller.makeLabel(x: 220, y: 580, fontSize: 40, colour: SKColor.green, text: "ALU")) addNode(node: controller.makeLabel(x: 217, y: 250, fontSize: 40, colour: SKColor.green, text: "Control Unit")) } override func event(id: Int, data: Array<Int> = []) { switch id { case 1: //value sent to data bus dataBus?.value = data[0] //send value back //shouldn't cause loop cause only actually read actions send here controller.memory?.event(id: 3, data: [(dataBus?.value)!]) controller.alu?.event(id: 4, data: [(dataBus?.value)!]) case 2: //value sent to address bus addressBus?.value = data[0] case 3: //read line update readLine?.value = data[0] case 4: //write line update writeLine?.value = data[0] case 5: //write line update reg1Line?.value = data[0] case 6: //write line update reg2Line?.value = data[0] case 7: //write line update reg3Line?.value = data[0] case 8: //write line update subLine?.value = data[0] default: print("Overview Event Error") } } override func mouseDown(point: CGPoint) { for (index, i) in buttons!.enumerated() { if i.contains(point) { controller.changeScene(id: index + 1) } } } }
34.201613
118
0.572035
c6d69507ba9f1a3dcbdaaba252b2fc45677931ee
6,418
rs
Rust
crates/hrpc/src/server/mod.rs
harmony-development/hrpc-rs
76b2bdc81451826da4ba4e11f657fda01dc7338a
[ "MIT" ]
26
2021-02-24T14:32:48.000Z
2022-01-30T16:49:02.000Z
crates/hrpc/src/server/mod.rs
harmony-development/hrpc-rs
76b2bdc81451826da4ba4e11f657fda01dc7338a
[ "MIT" ]
27
2021-02-05T21:02:19.000Z
2022-02-13T15:32:55.000Z
crates/hrpc/src/server/mod.rs
harmony-development/hrpc-rs
76b2bdc81451826da4ba4e11f657fda01dc7338a
[ "MIT" ]
1
2021-12-14T01:26:08.000Z
2021-12-14T01:26:08.000Z
use std::convert::Infallible; use tower::{Layer, Service as TowerService}; use router::Routes; use service::HrpcService; use crate::{common::future, request::BoxRequest, response::BoxResponse}; use self::router::RoutesFinalized; /// Error types used by hRPC. pub mod error; /// Layers for hRPC services. pub mod layer; /// The router used by hRPC. pub mod router; /// Handler type and handlers used by hRPC. pub mod service; /// Socket used by hRPC for "streaming" RPCs. pub mod socket; /// Transports for hRPC services. pub mod transport; /// Other useful types, traits and functions used by hRPC. pub mod utils; mod macros; pub use service::HrpcLayer; // Prelude used by generated code. It is not meant to be used by users. #[doc(hidden)] pub mod gen_prelude { pub use super::{ error::ServerResult, router::Routes, service::{unary_handler, ws_handler, HrpcLayer, HrpcService}, socket::Socket, transport::Transport, MakeRoutes, }; pub use crate::{BoxError, Request as HrpcRequest, Response as HrpcResponse}; pub use bytes::Bytes; pub use futures_util::future::BoxFuture; pub use std::{convert::Infallible, future::Future, net::ToSocketAddrs, sync::Arc}; pub use tower::{layer::util::Identity, Layer, Service as TowerService}; } /// Prelude that exports commonly used server types. pub mod prelude { pub use super::{ error::{HrpcError, ServerResult}, service::{HrpcLayer, HrpcLayerExt}, socket::Socket, transport::Transport, MakeRoutes, }; pub use crate::{make_handler, response::IntoResponse, Request, Response}; pub use hrpc_proc_macro::handler; } /// The core trait of `hrpc-rs` servers. This trait acts as a `tower::MakeService`, /// it can produce a set of [`Routes`] and can be combined with other [`MakeRoutes`]s. /// /// Not to be confused with [`tower::Service`]. pub trait MakeRoutes: Send + 'static { /// Creates a [`Routes`], which will be used to build a [`RoutesFinalized`] instance. fn make_routes(&self) -> Routes; /// Combines this server with another server. fn combine_with<Other>(self, other: Other) -> ServiceStack<Other, Self> where Other: MakeRoutes, Self: Sized, { ServiceStack { outer: other, inner: self, } } /// Turns this server into a type that implements `MakeService`, so that /// it can be used with [`hyper`]. fn into_make_service(self) -> IntoMakeService<Self> where Self: Sized, { IntoMakeService { mk_router: self } } /// Layers this server with a layer. /// /// If your layer does not implement [`Clone`], you can wrap it using /// [`HrpcLayer::new`]. fn layer<S, L>(self, layer: L) -> LayeredService<S, L, Self> where L: Layer<HrpcService, Service = S> + Clone + Sync + Send + 'static, S: tower::Service<BoxRequest, Response = BoxResponse, Error = Infallible> + Send + 'static, S::Future: Send, Self: Sized, { LayeredService { inner: self, layer } } } /// Type that layers the handlers that are produced by a [`MakeRoutes`]. pub struct LayeredService<S, L, M> where L: Layer<HrpcService, Service = S> + Clone + Sync + Send + 'static, S: tower::Service<BoxRequest, Response = BoxResponse, Error = Infallible> + Send + 'static, S::Future: Send, M: MakeRoutes, { inner: M, layer: L, } impl<S, L, M> Clone for LayeredService<S, L, M> where L: Layer<HrpcService, Service = S> + Clone + Sync + Send + 'static, S: tower::Service<BoxRequest, Response = BoxResponse, Error = Infallible> + Send + 'static, S::Future: Send, M: MakeRoutes + Clone, { fn clone(&self) -> Self { Self { inner: self.inner.clone(), layer: self.layer.clone(), } } } impl<S, L, M> MakeRoutes for LayeredService<S, L, M> where L: Layer<HrpcService, Service = S> + Clone + Sync + Send + 'static, S: tower::Service<BoxRequest, Response = BoxResponse, Error = Infallible> + Send + 'static, S::Future: Send, M: MakeRoutes, { fn make_routes(&self) -> Routes { let rb = MakeRoutes::make_routes(&self.inner); rb.layer_all(self.layer.clone()) } } /// Type that contains two [`MakeRoutes`]s and stacks (combines) them. pub struct ServiceStack<Outer, Inner> where Outer: MakeRoutes, Inner: MakeRoutes, { outer: Outer, inner: Inner, } impl<Outer, Inner> Clone for ServiceStack<Outer, Inner> where Outer: MakeRoutes + Clone, Inner: MakeRoutes + Clone, { fn clone(&self) -> Self { Self { outer: self.outer.clone(), inner: self.inner.clone(), } } } impl<Outer, Inner> MakeRoutes for ServiceStack<Outer, Inner> where Outer: MakeRoutes, Inner: MakeRoutes, { fn make_routes(&self) -> Routes { let outer_rb = MakeRoutes::make_routes(&self.outer); let inner_rb = MakeRoutes::make_routes(&self.inner); outer_rb.combine_with(inner_rb) } } /// Type that contains a [`MakeRoutes`] and implements `tower::MakeService` to /// create [`RoutesFinalized`] instances. pub struct IntoMakeService<S: MakeRoutes> { mk_router: S, } impl<S: MakeRoutes + Clone> Clone for IntoMakeService<S> { fn clone(&self) -> Self { Self { mk_router: self.mk_router.clone(), } } } impl<T, S: MakeRoutes> TowerService<T> for IntoMakeService<S> { type Response = RoutesFinalized; type Error = Infallible; type Future = future::Ready<Result<RoutesFinalized, Infallible>>; fn poll_ready( &mut self, _cx: &mut std::task::Context<'_>, ) -> std::task::Poll<Result<(), Self::Error>> { Ok(()).into() } fn call(&mut self, _req: T) -> Self::Future { future::ready(Ok(self.mk_router.make_routes().build())) } } #[cfg(test)] mod tests { use tower::layer::util::Identity; use crate::server::{router::Routes, HrpcLayer, MakeRoutes}; struct TestServer; impl MakeRoutes for TestServer { fn make_routes(&self) -> Routes { Routes::new() } } #[test] fn layered_identity() { let s = TestServer; // we can't poll it, and we don't want to anyways let _ = s.layer(HrpcLayer::new(Identity::new())); } }
27.194915
99
0.625896
d657640f7133308403704eb34154b363fc2937f8
2,894
cs
C#
tools/mac/VMRestSsoSnapIn/VMRestSsoSnapIn/Views/AddNewSignatureAlgorithmController.cs
wfu8/lightwave
cf6a7417cd9807bfcf9bcd99c43c5b2eecf2d298
[ "Apache-2.0" ]
357
2015-04-20T00:16:30.000Z
2022-03-17T05:34:09.000Z
tools/mac/VMRestSsoSnapIn/VMRestSsoSnapIn/Views/AddNewSignatureAlgorithmController.cs
wfu8/lightwave
cf6a7417cd9807bfcf9bcd99c43c5b2eecf2d298
[ "Apache-2.0" ]
38
2015-11-19T05:20:53.000Z
2022-03-31T07:21:59.000Z
tools/mac/VMRestSsoSnapIn/VMRestSsoSnapIn/Views/AddNewSignatureAlgorithmController.cs
wfu8/lightwave
cf6a7417cd9807bfcf9bcd99c43c5b2eecf2d298
[ "Apache-2.0" ]
135
2015-04-21T15:23:21.000Z
2022-03-30T11:46:36.000Z
/* * Copyright © 2012-2016 VMware, Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the “License”); you may not * use this file except in compliance with the License. You may obtain a copy * of the License at http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an “AS IS” BASIS, without * warranties or conditions of any kind, EITHER EXPRESS OR IMPLIED. See the * License for the specific language governing permissions and limitations * under the License. */ using System; using System.Collections.Generic; using System.Linq; using System.Security.Cryptography.X509Certificates; using Foundation; using AppKit; using Vmware.Tools.RestSsoAdminSnapIn.Dto; using Vmware.Tools.RestSsoAdminSnapIn.Core.Extensions; using Vmware.Tools.RestSsoAdminSnapIn.DataSource; using Vmware.Tools.RestSsoAdminSnapIn.Helpers; namespace RestSsoAdminSnapIn { public partial class AddNewSignatureAlgorithmController : NSWindowController { public SignatureAlgorithmDto SignatureAlgorithmDto { get; set;} public bool IsUpdated { get; private set;} public AddNewSignatureAlgorithmController (IntPtr handle) : base (handle) { } [Export ("initWithCoder:")] public AddNewSignatureAlgorithmController (NSCoder coder) : base (coder) { } public AddNewSignatureAlgorithmController () : base ("AddNewSignatureAlgorithm") { } public new AddNewSignatureAlgorithm Window { get { return (AddNewSignatureAlgorithm)base.Window; } } public override void AwakeFromNib () { base.AwakeFromNib (); IsUpdated = false; //Events this.BtnAdd.Activated += (object sender, EventArgs e) => { if(string.IsNullOrEmpty(TxtMaxKeySize.StringValue)) { UIErrorHelper.ShowAlert ("Max Key size has invalid value", "Alert"); } else if(string.IsNullOrEmpty(TxtMinKeySize.StringValue)) { UIErrorHelper.ShowAlert ("Min Key size has invalid value", "Alert"); } else if(string.IsNullOrEmpty(TxtPriority.StringValue)) { UIErrorHelper.ShowAlert ("Priority has invalid value", "Alert"); } else { SignatureAlgorithmDto = new SignatureAlgorithmDto { MaxKeySize = TxtMaxKeySize.IntValue, MinKeySize = TxtMinKeySize.IntValue, Priority = TxtPriority.IntValue, }; IsUpdated = true; this.Close (); NSApplication.SharedApplication.StopModalWithCode (0); } }; this.BtnClose.Activated += (object sender, EventArgs e) => { this.Close (); NSApplication.SharedApplication.StopModalWithCode (0); }; if (SignatureAlgorithmDto != null) { TxtMaxKeySize.IntValue = SignatureAlgorithmDto.MaxKeySize; TxtMinKeySize.IntValue = SignatureAlgorithmDto.MinKeySize; TxtPriority.IntValue = SignatureAlgorithmDto.Priority; } } } }
30.145833
82
0.732896
640a1e9c0021e877850d77dfcd8d80863636459f
2,232
py
Python
aliyun-python-sdk-cms/aliyunsdkcms/request/v20180308/CreateTaskRequest.py
liusc27/aliyun-openapi-python-sdk
5e3db3535dd21de987dc5981e71151327d5a884f
[ "Apache-2.0" ]
1
2019-12-23T12:36:43.000Z
2019-12-23T12:36:43.000Z
aliyun-python-sdk-cms/aliyunsdkcms/request/v20180308/CreateTaskRequest.py
liusc27/aliyun-openapi-python-sdk
5e3db3535dd21de987dc5981e71151327d5a884f
[ "Apache-2.0" ]
null
null
null
aliyun-python-sdk-cms/aliyunsdkcms/request/v20180308/CreateTaskRequest.py
liusc27/aliyun-openapi-python-sdk
5e3db3535dd21de987dc5981e71151327d5a884f
[ "Apache-2.0" ]
null
null
null
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you 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. from aliyunsdkcore.request import RpcRequest class CreateTaskRequest(RpcRequest): def __init__(self): RpcRequest.__init__(self, 'Cms', '2018-03-08', 'CreateTask','cms') def get_Address(self): return self.get_query_params().get('Address') def set_Address(self,Address): self.add_query_param('Address',Address) def get_TaskType(self): return self.get_query_params().get('TaskType') def set_TaskType(self,TaskType): self.add_query_param('TaskType',TaskType) def get_IspCity(self): return self.get_query_params().get('IspCity') def set_IspCity(self,IspCity): self.add_query_param('IspCity',IspCity) def get_AlertIds(self): return self.get_query_params().get('AlertIds') def set_AlertIds(self,AlertIds): self.add_query_param('AlertIds',AlertIds) def get_Options(self): return self.get_query_params().get('Options') def set_Options(self,Options): self.add_query_param('Options',Options) def get_TaskName(self): return self.get_query_params().get('TaskName') def set_TaskName(self,TaskName): self.add_query_param('TaskName',TaskName) def get_Interval(self): return self.get_query_params().get('Interval') def set_Interval(self,Interval): self.add_query_param('Interval',Interval) def get_AlertRule(self): return self.get_query_params().get('AlertRule') def set_AlertRule(self,AlertRule): self.add_query_param('AlertRule',AlertRule)
31
69
0.749104
2175744ddc191fcaa87247cbe6ac3674d433f8e3
345
js
JavaScript
src/collections/annotation-track-collection.js
Neubias-WG5/Cytomine-js-client
599547d7fe770c316363f8fa2e066cbe3a2eeb81
[ "Apache-2.0" ]
3
2018-08-21T08:14:51.000Z
2021-12-07T05:24:56.000Z
src/collections/annotation-track-collection.js
Neubias-WG5/Cytomine-js-client
599547d7fe770c316363f8fa2e066cbe3a2eeb81
[ "Apache-2.0" ]
7
2021-03-08T21:19:59.000Z
2022-03-02T02:48:16.000Z
src/collections/annotation-track-collection.js
Neubias-WG5/Cytomine-js-client
599547d7fe770c316363f8fa2e066cbe3a2eeb81
[ "Apache-2.0" ]
5
2019-02-26T09:35:01.000Z
2022-02-23T15:11:09.000Z
import Collection from './collection.js'; import AnnotationTrack from '../models/annotation-track.js'; export default class AnnotationTrackCollection extends Collection { /** @inheritdoc */ static get model() { return AnnotationTrack; } /** @inheritdoc */ static get allowedFilters() { return ['annotation', 'track']; } }
21.5625
67
0.692754
2c6041a42c1226fed0a22354f062500d4da83054
599
py
Python
tiknib/feature/__init__.py
SoftSec-KAIST/tiknib
5f1e25df0ff652cf35574dae3e6a3cfb3b163e63
[ "MIT" ]
69
2020-11-24T06:50:49.000Z
2022-03-22T08:53:38.000Z
tiknib/feature/__init__.py
SoftSec-KAIST/tiknib
5f1e25df0ff652cf35574dae3e6a3cfb3b163e63
[ "MIT" ]
8
2020-11-27T12:11:25.000Z
2022-03-20T14:11:13.000Z
tiknib/feature/__init__.py
SoftSec-KAIST/tiknib
5f1e25df0ff652cf35574dae3e6a3cfb3b163e63
[ "MIT" ]
13
2020-11-26T03:25:14.000Z
2022-03-24T03:25:24.000Z
__all__ = ["Feature"] class Feature: """ template class for feature extraction modules """ def __init__(self): pass @staticmethod def get(f): """ feature extraction function get receives function data extracted from IDA script, which is dictionary of various fields (see tiknib/ida/fetch_funcdata.py). get should return dictionary of features. ex) features = {} features['feature_A_B'] = C features['feature_X_Y'] = Z """ pass from .feature_manager import FeatureManager
19.966667
81
0.604341
4d810dc420a9bafbb3ab8e46c52d84e257c37a23
323
cs
C#
Exercises/04 DEFINING CLASSES - EXERCISES/DefineClass-Exercises/05_Date_Modifier/StartUp.cs
inser788/CSharp-Fundamentals-OOP-Basics
03124740ddb0ba26e708dc29001c7354fc3ac9ee
[ "MIT" ]
null
null
null
Exercises/04 DEFINING CLASSES - EXERCISES/DefineClass-Exercises/05_Date_Modifier/StartUp.cs
inser788/CSharp-Fundamentals-OOP-Basics
03124740ddb0ba26e708dc29001c7354fc3ac9ee
[ "MIT" ]
null
null
null
Exercises/04 DEFINING CLASSES - EXERCISES/DefineClass-Exercises/05_Date_Modifier/StartUp.cs
inser788/CSharp-Fundamentals-OOP-Basics
03124740ddb0ba26e708dc29001c7354fc3ac9ee
[ "MIT" ]
null
null
null
using System; using System.Globalization; public class StartUp { public static void Main() { string firstDate = Console.ReadLine(); string secondDate = Console.ReadLine(); int daysValue=DateModifier.GetDaysDifference(firstDate, secondDate); Console.WriteLine(daysValue); } }
20.1875
76
0.678019
267e1bf12add53e7136a4038adc3fd0409f0b8b1
403
swift
Swift
Sources/Swoosh/Matchers/EqRequestMatcher.swift
sgoodwin/Swish
0e02f59d5caa1a6979e49107237cee13dcc0c38d
[ "MIT" ]
420
2015-09-02T21:58:45.000Z
2022-02-06T10:05:25.000Z
Sources/Swoosh/Matchers/EqRequestMatcher.swift
sgoodwin/Swish
0e02f59d5caa1a6979e49107237cee13dcc0c38d
[ "MIT" ]
116
2015-09-02T02:25:52.000Z
2021-03-04T09:45:18.000Z
Sources/Swoosh/Matchers/EqRequestMatcher.swift
sgoodwin/Swish
0e02f59d5caa1a6979e49107237cee13dcc0c38d
[ "MIT" ]
60
2015-09-07T15:46:44.000Z
2021-04-26T10:54:44.000Z
import Swish internal struct EqRequestMatcher<T: Request>: RequestMatcher where T: Equatable { func match<S>(_ request: S) -> Result<S.ResponseObject, SwishError>? where S: Request { if self.request == request as? T { return response as? Result<S.ResponseObject, SwishError> } else { return .none } } let request: T let response: Result<T.ResponseObject, SwishError> }
26.866667
89
0.689826
2c8d20993a5f1d1e0802f30929fb9382688b35a5
1,870
py
Python
trees_and_forests/utils.py
remykarem/trees-and-forests
cbec2ad41a9599ff4bd1d7b21f490981f1318eb2
[ "MIT" ]
null
null
null
trees_and_forests/utils.py
remykarem/trees-and-forests
cbec2ad41a9599ff4bd1d7b21f490981f1318eb2
[ "MIT" ]
null
null
null
trees_and_forests/utils.py
remykarem/trees-and-forests
cbec2ad41a9599ff4bd1d7b21f490981f1318eb2
[ "MIT" ]
null
null
null
import numpy as np __all__ = ["select_features", "select_split_indices", "calculate_criterion", "calculate_criterion_initial", "gen"] def select_features(n_features, method="all"): if method == "all": return range(n_features) elif method == "sqrt": n_cols_to_choose = min(1, int(np.ceil(np.sqrt(n_features)))) return list(np.random.choice(n_features, n_cols_to_choose, replace=False)) def select_split_indices(n_unique_samples, method): all_split_indices = range(1, n_unique_samples) if method == "all": return all_split_indices elif method == "random": return list(np.random.choice(n_features, 1)) elif isinstance(method, int): return list(np.sort(np.random.choice(n_features, method, replace=False))) def calculate_criterion(criterion, left, right, n_classes): if criterion == "gini": # `probas`: # # probas_left probas_right # class 0 ... ... # class 1 ... ... # class 2 ... ... probas_left = np.bincount(left, minlength=n_classes)/len(left) probas_right = np.bincount( right, minlength=n_classes)/len(right) probas = np.vstack([probas_left, probas_right]).T # sum across the classes ie axis 0 gini = np.sum(probas * (1-probas), axis=0) return gini else: # TODO check if this is right sse_left = left.var(keepdims=True) sse_right = right.var(keepdims=True) sse = sse_left + sse_right return sse def calculate_criterion_initial(criterion, y): if criterion == "gini": proportion = np.bincount(y)/len(y) gini_initial = np.sum(proportion*(1-proportion)) return gini_initial else: return y.var() def gen(a, b): yield a, b
29.68254
82
0.608021
b535970529e556110cb3256aecf6117965504499
95
sql
SQL
cli/railssample/db/schema.sql
walf443/mig
6f7a3a5484622b8df46d19d50f8ecb2c38c15e9b
[ "Unlicense" ]
null
null
null
cli/railssample/db/schema.sql
walf443/mig
6f7a3a5484622b8df46d19d50f8ecb2c38c15e9b
[ "Unlicense" ]
null
null
null
cli/railssample/db/schema.sql
walf443/mig
6f7a3a5484622b8df46d19d50f8ecb2c38c15e9b
[ "Unlicense" ]
null
null
null
CREATE TABLE `hoge` ( id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, PRIMARY KEY (id) );
19
48
0.663158
e850d62b5346804788088bfb10eb71c17d43c43c
5,642
cs
C#
Source/DigitalRune.Graphics.Tests/_TODO/Scene/SceneNodeCollectionTest.cs
Drul1337/DigitalRune
a907452c8922a3360761e0569aa33110b0201b91
[ "CC-BY-4.0", "MS-PL" ]
234
2016-06-04T21:11:43.000Z
2022-03-09T13:02:05.000Z
Source/DigitalRune.Graphics.Tests/_TODO/Scene/SceneNodeCollectionTest.cs
socky886/DigitalRune
a907452c8922a3360761e0569aa33110b0201b91
[ "CC-BY-4.0", "MS-PL" ]
10
2016-06-06T11:12:36.000Z
2021-01-05T20:48:55.000Z
Source/DigitalRune.Graphics.Tests/_TODO/Scene/SceneNodeCollectionTest.cs
socky886/DigitalRune
a907452c8922a3360761e0569aa33110b0201b91
[ "CC-BY-4.0", "MS-PL" ]
98
2016-06-04T21:26:50.000Z
2022-02-23T08:10:30.000Z
using System; using DigitalRune.Graphics.Scene3D; using NUnit.Framework; namespace DigitalRune.Graphics.Tests { [TestFixture] public class SceneNodeCollectionTest { [Test] [ExpectedException(typeof(ArgumentNullException))] public void ShouldThrowWhenOwnerIsNull() { new SceneNodeCollection(null); } [Test] [ExpectedException(typeof(ArgumentException))] public void ShouldThrowWhenOwnerHasCollection() { DummySceneNode node = new DummySceneNode(); new SceneNodeCollection(node); } [Test] [ExpectedException(typeof(ArgumentNullException))] public void ShouldThrowWhenChildIsNull() { DummySceneNode node = new DummySceneNode(); node.Children.Add(null); } [Test] [ExpectedException(typeof(ArgumentNullException))] public void ShouldThrowWhenChildIsNull2() { DummySceneNode node = new DummySceneNode(); node.Children.Add(new DummySceneNode()); node.Children[0] = null; } [Test] [ExpectedException(typeof(InvalidOperationException))] public void ShouldThrowWhenChildExists() { DummySceneNode node = new DummySceneNode(); DummySceneNode child = new DummySceneNode(); node.Children.Add(child); node.Children.Add(child); } [Test] [ExpectedException(typeof(InvalidOperationException))] public void ShouldThrowWhenChildExists2() { DummySceneNode node = new DummySceneNode(); DummySceneNode childA = new DummySceneNode(); DummySceneNode childB = new DummySceneNode(); node.Children.Add(childA); node.Children.Add(childB); node.Children[1] = childA; } [Test] public void ReplaceChild() { DummySceneNode node = new DummySceneNode(); DummySceneNode childA = new DummySceneNode(); DummySceneNode childB = new DummySceneNode(); node.Children.Add(childA); Assert.AreEqual(1, node.Children.Count); Assert.AreSame(childA, node.Children[0]); node.Children[0] = childB; Assert.AreEqual(1, node.Children.Count); Assert.AreSame(childB, node.Children[0]); } [Test] [ExpectedException(typeof(InvalidOperationException))] public void ShoudThrowWhenChildHasParent() { DummySceneNode node = new DummySceneNode(); DummySceneNode node2 = new DummySceneNode(); DummySceneNode childA = new DummySceneNode(); DummySceneNode childB = new DummySceneNode(); node.Children.Add(childA); node2.Children.Add(childB); node.Children[0] = childB; } [Test] public void CheckSequence() { DummySceneNode node = new DummySceneNode(); Assert.AreEqual(0, node.Children.Count); DummySceneNode nodeA = new DummySceneNode(); DummySceneNode nodeB = new DummySceneNode(); DummySceneNode nodeC = new DummySceneNode(); node.Children.Add(nodeA); node.Children.Add(nodeB); node.Children.Add(nodeC); Assert.AreEqual(3, node.Children.Count); Assert.AreSame(nodeA, node.Children[0]); Assert.AreSame(nodeB, node.Children[1]); Assert.AreSame(nodeC, node.Children[2]); } [Test] public void ShouldSetParent() { DummySceneNode node = new DummySceneNode(); DummySceneNode nodeA = new DummySceneNode(); DummySceneNode nodeB = new DummySceneNode(); DummySceneNode nodeC = new DummySceneNode(); node.Children.Add(nodeA); node.Children.Add(nodeB); node.Children.Add(nodeC); Assert.AreSame(node, nodeA.Parent); Assert.AreSame(node, nodeB.Parent); Assert.AreSame(node, nodeC.Parent); } [Test] public void SwitchingCollection() { DummySceneNode node = new DummySceneNode(); DummySceneNode node2 = new DummySceneNode(); DummySceneNode nodeA = new DummySceneNode(); DummySceneNode nodeB = new DummySceneNode(); DummySceneNode nodeC = new DummySceneNode(); node.Children.Add(nodeA); node.Children.Add(nodeB); node.Children.Add(nodeC); Assert.AreSame(node, nodeA.Parent); Assert.AreSame(node, nodeB.Parent); Assert.AreSame(node, nodeC.Parent); node.Children.Remove(nodeB); node.Children.Remove(nodeC); node2.Children.Add(nodeB); node2.Children.Add(nodeC); Assert.AreEqual(1, node.Children.Count); Assert.AreSame(node, nodeA.Parent); Assert.AreEqual(2, node2.Children.Count); Assert.AreSame(node2, nodeB.Parent); Assert.AreSame(node2, nodeC.Parent); } [Test] public void RemoveShouldResetParents() { DummySceneNode node = new DummySceneNode(); DummySceneNode child = new DummySceneNode(); node.Children.Add(child); Assert.AreSame(node, child.Parent); node.Children.Remove(child); Assert.IsNull(child.Parent); } [Test] public void ClearShouldResetParents() { DummySceneNode node = new DummySceneNode(); Assert.AreEqual(0, node.Children.Count); node.Children.Clear(); // Test clear on empty collection. DummySceneNode nodeA = new DummySceneNode(); DummySceneNode nodeB = new DummySceneNode(); DummySceneNode nodeC = new DummySceneNode(); node.Children.Add(nodeA); node.Children.Add(nodeB); node.Children.Add(nodeC); Assert.AreSame(node, nodeA.Parent); Assert.AreSame(node, nodeB.Parent); Assert.AreSame(node, nodeC.Parent); node.Children.Clear(); Assert.IsNull(nodeA.Parent); Assert.IsNull(nodeB.Parent); Assert.IsNull(nodeC.Parent); } } }
26.364486
64
0.664303
c4b70786ac6fe650ea1059b9261450c4c4c558d2
60
ps1
PowerShell
Powershell Module/Devolutions.Server/Private/Types/enums/ProxyMode.generated.ps1
MMMoA/devolutions-server
8a19bcb403d9cd094a58b68be5579efc55adc825
[ "Apache-2.0" ]
null
null
null
Powershell Module/Devolutions.Server/Private/Types/enums/ProxyMode.generated.ps1
MMMoA/devolutions-server
8a19bcb403d9cd094a58b68be5579efc55adc825
[ "Apache-2.0" ]
null
null
null
Powershell Module/Devolutions.Server/Private/Types/enums/ProxyMode.generated.ps1
MMMoA/devolutions-server
8a19bcb403d9cd094a58b68be5579efc55adc825
[ "Apache-2.0" ]
null
null
null
enum ProxyMode { None = 0 Link = 1 Custom = 2 }
10
15
0.5
05f091da16c201c0f2b19349e88c003aaae6cb03
341
rb
Ruby
stories/primer/auto_complete_item_component_stories.rb
TanZng/view_components
9c780009fd06a73f8d39fa5f8e1e7d7eff5fd20f
[ "MIT" ]
null
null
null
stories/primer/auto_complete_item_component_stories.rb
TanZng/view_components
9c780009fd06a73f8d39fa5f8e1e7d7eff5fd20f
[ "MIT" ]
null
null
null
stories/primer/auto_complete_item_component_stories.rb
TanZng/view_components
9c780009fd06a73f8d39fa5f8e1e7d7eff5fd20f
[ "MIT" ]
null
null
null
# frozen_string_literal: true class Primer::AutoCompleteItemComponentStories < ViewComponent::Storybook::Stories layout "storybook_preview" story(:auto_complete_item) do controls do text(:value, "value") selected false disabled false end content do "<div>An item</div>".html_safe end end end
18.944444
82
0.695015
dbba42e9bfb148ab91ca3fecb6d43f462ab47e8c
1,572
php
PHP
routes/vouchers.php
fontesrp/voucher_pool
2608ebd48d392d82a585c06635284066f62a10c1
[ "MIT" ]
null
null
null
routes/vouchers.php
fontesrp/voucher_pool
2608ebd48d392d82a585c06635284066f62a10c1
[ "MIT" ]
null
null
null
routes/vouchers.php
fontesrp/voucher_pool
2608ebd48d392d82a585c06635284066f62a10c1
[ "MIT" ]
null
null
null
<?php /** * routes/vouchers.php * * Matches the request method with the corresponding controller method * */ require_once __DIR__ . "/../controllers/vouchers.php"; function call_voucher_method(string $name): void { $voucher = new VouchersController(); call_user_func([$voucher, $name]); } function vouchers_path(string $method): void { $routes = [ "GET" => "index", "POST" => "create" ]; call_voucher_method($routes[$method]); } function show_voucher_path(string $method): void { $routes = [ "GET" => "show" ]; call_voucher_method($routes[$method]); } function update_voucher_path(string $method): void { $routes = [ "PATCH" => "update", "PUT" => "update" ]; call_voucher_method($routes[$method]); } function gen_voucher_code_path(string $method): void { $routes = [ "GET" => "genCode" ]; call_voucher_method($routes[$method]); } function vouchers_report_path(string $method): void { $routes = [ "GET" => "report" ]; call_voucher_method($routes[$method]); } function vouchers_gen_path(string $method): void { $routes = [ "POST" => "generate" ]; call_voucher_method($routes[$method]); } function voucher_validate_path(string $method): void { $routes = [ "PATCH" => "validate" ]; call_voucher_method($routes[$method]); } function vouchers_search_path(string $method): void { $routes = [ "GET" => "searchByEmail" ]; call_voucher_method($routes[$method]); }
17.086957
70
0.607506
e701cc586e82a20d2db0255666feb976586a8392
722
php
PHP
resources/views/events/eventTypes.blade.php
Haniem/ISforEvents
c2bc6b666d488e541081be4d4b721b74118a43d2
[ "MIT" ]
null
null
null
resources/views/events/eventTypes.blade.php
Haniem/ISforEvents
c2bc6b666d488e541081be4d4b721b74118a43d2
[ "MIT" ]
null
null
null
resources/views/events/eventTypes.blade.php
Haniem/ISforEvents
c2bc6b666d488e541081be4d4b721b74118a43d2
[ "MIT" ]
null
null
null
@extends('layouts.app') @section('title', "Мероприятие") @section('content') @include('partials.header') <div class="container"> <div class="event_types"> @foreach ($event_types as $event_type ) <a class="event_types__link" href="{{ route('show_event_with_type', $event_type -> id) }}"> <div class="event_types__group"> <img src="/public/images/{{ $event_type -> event_type_logo_name }}" alt="" class="event_types-logo"> <p class="event_types__text">{{ $event_type -> event_type_name }}</p> </div> </a> @endforeach </div> </div> @endsection
31.391304
124
0.527701
97e4e440bdbd1fe42769b4cd3edb3dc05ed95f4f
108
rb
Ruby
lib/exceptions.rb
lsfernandes92/the_hateful_vicent
ddbf17d16c209da6c3f3d97bb6dd5350df8cd86a
[ "MIT" ]
2
2017-11-29T19:43:55.000Z
2017-11-29T20:01:29.000Z
lib/exceptions.rb
lsfernandes92/the_hateful_vicent
ddbf17d16c209da6c3f3d97bb6dd5350df8cd86a
[ "MIT" ]
null
null
null
lib/exceptions.rb
lsfernandes92/the_hateful_vicent
ddbf17d16c209da6c3f3d97bb6dd5350df8cd86a
[ "MIT" ]
null
null
null
module TheHatefulVicent module Exceptions class ElementNotFoundError < RuntimeError end end end
15.428571
45
0.777778
e737eb40d4dcb37edda166835c8bfbc89f24f28a
5,387
php
PHP
backend/views/layouts/kontributor/nav.php
dyhaz/yii2-company-profile
39256ba01ac040d3505a112f5ab2b1df2a01fe4b
[ "BSD-3-Clause" ]
null
null
null
backend/views/layouts/kontributor/nav.php
dyhaz/yii2-company-profile
39256ba01ac040d3505a112f5ab2b1df2a01fe4b
[ "BSD-3-Clause" ]
null
null
null
backend/views/layouts/kontributor/nav.php
dyhaz/yii2-company-profile
39256ba01ac040d3505a112f5ab2b1df2a01fe4b
[ "BSD-3-Clause" ]
null
null
null
<?php use yii\web\Session; $session = new Session; $session->open(); ?> <div class="navbar main"> <!-- Menu Toggle Button --> <button type="button" class="btn btn-navbar pull-left visible-phone"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <!-- // Menu Toggle Button END --> <!-- Not Blank page --> <!-- Full Top Style --> <?php use yii\widgets\Menu; echo Menu::widget([ 'items' => [ ['label' => 'Dashboard', 'url' => ['kontributor/dashboard'], 'template' => '<a class="glyphicons dashboard" href="{url}"><i></i>{label}</a>'], ['label' => 'Berita', 'url' => ['kontributor/berita'], 'template' => '<a class="glyphicons pencil" href="{url}"><i></i>{label}</a>'], ], 'options' => [ 'class' => 'topnav pull-left' ], 'activateParents'=>true, ]); ?> <!-- // Full Top Style END --> <!-- // Not Blank Page END --> <!-- Top Menu Right --> <ul class="topnav pull-right hidden-phone"> <!-- Themer --> <li><a href="#themer" data-toggle="collapse" class="glyphicons eyedropper single-icon"><i></i></a></li> <!-- // Themer END --> <!-- Language menu --> <li class="hidden-phone dropdown dd-1 dd-flags" id="lang_nav"> <a href="#" data-toggle="dropdown"><img src="./theme/images/lang/en.png" alt="en" /></a> <ul class="dropdown-menu pull-right"> <li class="active"><a href="?module=admin&amp;page=index&amp;url_rewrite=&amp;layout_type=fluid&amp;menu_position=menu-left&amp;style=style-default-menus-dark&amp;sidebar_type=collapsible&amp;lang=en" title="English"><img src="./theme/images/lang/en.png" alt="English"> English</a></li> <li><a href="?module=admin&amp;page=index&amp;url_rewrite=&amp;layout_type=fluid&amp;menu_position=menu-left&amp;style=style-default-menus-dark&amp;sidebar_type=collapsible&amp;lang=ro" title="Romanian"><img src="./theme/images/lang/ro.png" alt="Romanian"> Romanian</a></li> <li><a href="?module=admin&amp;page=index&amp;url_rewrite=&amp;layout_type=fluid&amp;menu_position=menu-left&amp;style=style-default-menus-dark&amp;sidebar_type=collapsible&amp;lang=it" title="Italian"><img src="./theme/images/lang/it.png" alt="Italian"> Italian</a></li> <li><a href="?module=admin&amp;page=index&amp;url_rewrite=&amp;layout_type=fluid&amp;menu_position=menu-left&amp;style=style-default-menus-dark&amp;sidebar_type=collapsible&amp;lang=fr" title="French"><img src="./theme/images/lang/fr.png" alt="French"> French</a></li> <li><a href="?module=admin&amp;page=index&amp;url_rewrite=&amp;layout_type=fluid&amp;menu_position=menu-left&amp;style=style-default-menus-dark&amp;sidebar_type=collapsible&amp;lang=pl" title="Polish"><img src="./theme/images/lang/pl.png" alt="Polish"> Polish</a></li> </ul> </li> <!-- // Language menu END --> <!-- Profile / Logout menu --> <li class="account dropdown dd-1"> <a data-toggle="dropdown" href="my_account_advanced.html?lang=en&amp;layout_type=fluid&amp;menu_position=menu-left&amp;style=style-default-menus-dark&amp;sidebar_type=collapsible" class="glyphicons logout lock"><span class="hidden-tablet hidden-phone hidden-desktop-1"><?= is_object($session['user'])?$session['user']->nama_lengkap:''?></span><i></i></a> <ul class="dropdown-menu pull-right"> <li><a href="my_account_advanced.html?lang=en&amp;layout_type=fluid&amp;menu_position=menu-left&amp;style=style-default-menus-dark&amp;sidebar_type=collapsible" class="glyphicons cogwheel">Settings<i></i></a></li> <li><a href="my_account_advanced.html?lang=en&amp;layout_type=fluid&amp;menu_position=menu-left&amp;style=style-default-menus-dark&amp;sidebar_type=collapsible" class="glyphicons camera">My Photos<i></i></a></li> <li class="profile"> <span> <span class="heading">Profile <a href="my_account_advanced.html?lang=en&amp;layout_type=fluid&amp;menu_position=menu-left&amp;style=style-default-menus-dark&amp;sidebar_type=collapsible" class="pull-right text-primary text-weight-regular">edit</a></span> <a href="my_account_advanced.html?lang=en&amp;layout_type=fluid&amp;menu_position=menu-left&amp;style=style-default-menus-dark&amp;sidebar_type=collapsible" class="img thumb"> <img data-src="holder.js/51x51/dark" alt="Avatar" /> </a> <span class="details"> <a href="my_account_advanced.html?lang=en&amp;layout_type=fluid&amp;menu_position=menu-left&amp;style=style-default-menus-dark&amp;sidebar_type=collapsible" class="strong text-regular">Mosaic Pro</a> contact@mosaicpro.biz </span> <span class="clearfix"></span> </span> </li> <li> <span> <a class="btn btn-default btn-mini pull-right" href="index.php?r=site/logout">Sign Out</a> </span> </li> </ul> </li> <!-- // Profile / Logout menu END --> </ul> <!-- // Top Menu Right END --> <ul class="topnav pull-right hidden-phone"> <li><a href="" class="glyphicons envelope single-icon"><i></i><span class="badge fix badge-primary">5</span></a></li> <li><a href="" class="glyphicons cup single-icon"><i></i><span class="badge fix badge-primary">7</span></a></li> <li class="hidden-tablet"><a href="" class="glyphicons comments single-icon"><i></i><span class="badge fix badge-primary">3</span></a></li> </ul> <div class="clearfix"></div> </div>
57.308511
362
0.668647
f49da83272ef62a0734a73450861f557d7370cd5
3,669
lua
Lua
KabSavedMythics/KabSavedMythics.lua
arcadepro/KabSavedMythics
7e682f3d91096fcccea3e1db813bb309f3c45363
[ "MIT" ]
null
null
null
KabSavedMythics/KabSavedMythics.lua
arcadepro/KabSavedMythics
7e682f3d91096fcccea3e1db813bb309f3c45363
[ "MIT" ]
null
null
null
KabSavedMythics/KabSavedMythics.lua
arcadepro/KabSavedMythics
7e682f3d91096fcccea3e1db813bb309f3c45363
[ "MIT" ]
null
null
null
local saved = {} local report = {} local dungeons = {} -- local d1 = false -- local d2 = false --[[ local function isAttunedKingsRest() -- id, name, points, completed, month, day, year, description, flags, icon, rewardText, isGuild, wasEarnedByMe, earnedBy = GetAchievementInfo(12479) local _, _, _, achievementFlag, _, _, _, _, _, _, _, _, _, _ = GetAchievementInfo(12479) return achievementFlag end local function isAttunedBoralus() return IsQuestFlaggedCompleted(53121) end --]] local function buildList() dungeons = { "De Other Side", "Halls of Atonement", "Mists of Tirna Scithe", "Plaguefall", "Sanguine Depths", "Spires of Ascension", "The Necrotic Wake", "Theater of Pain" } --[[ if isAttunedKingsRest() then --print("not attuned") tinsert(dungeons,"Kings' Rest") d1 = true end if isAttunedBoralus() then --print("not attuned") tinsert(dungeons,"Siege of Boralus") d2 = true end --]] table.sort(dungeons) end local abbr = { ["De Other Side"] = "Other Side", ["Halls of Atonement"] = "Halls", ["Mists of Tirna Scithe"] = "Mists", ["Plaguefall"] = "Plaguefall", ["Sanguine Depths"] = "Sanguine", ["Spires of Ascension"] = "Spires", ["The Necrotic Wake"] = "Necrotic Wake", ["Theater of Pain"] = "Theater" } local function inRaid() return IsInRaid() end local function inParty() return IsInGroup() end local function clearTables() wipe(saved) wipe(report) wipe(dungeons) end local function gatherInfo() clearTables() buildList() for i = 1, GetNumSavedInstances() do local name, _ , _ , difficulty, locked = GetSavedInstanceInfo(i) if difficulty == 23 then -- 23mythic, 2heroic saved[name] = locked end end end local function tabulate() for _, v in pairs(dungeons) do if saved[v] == false or saved[v] == nil then --print(abbr[v]) table.insert (report, abbr[v]) end end table.sort(report) output = table.concat (report,", ") end local function reportInfo(var) -- self if var == "self" then gatherInfo() print("---") print("\124cff00ff00Mythic Lockouts") print("---") for _, v in pairs(dungeons) do print(v, saved[v] and "\124cffff0000Saved" or "\124cff00ff00Available") end --[[ local a1, a2 if d1 == false then a1 = "Kings' Rest" else a1 = "" end if d2 == false then a2 = "Boralus" else a2 = "" end if d1 and d2 then return else print ("\124cffff0000Not attuned to:", a1, a2) end --]] end -- party if var == "party" then gatherInfo() tabulate() SendChatMessage("Unsaved to: " .. output, "PARTY", nil, nil) end -- guild if var == "guild" then gatherInfo() tabulate() SendChatMessage("Unsaved to: " .. output, "GUILD", nil, nil) end -- custom if var == "custom" then gatherInfo() tabulate() if inParty() and not inRaid() then SendChatMessage("Unsaved to: " .. output, "PARTY", nil, nil) elseif inRaid() then SendChatMessage("Unsaved to: " .. output, "RAID", nil, nil) else SendChatMessage("Unsaved to: " .. output, "GUILD", nil, nil) end end end SlashCmdList["SELFREPORT"] = function() --print("self") reportInfo("self") end SLASH_SELFREPORT1 = '/sm' -- solo report SlashCmdList["CUSTOMREPORT"] = function() --print("custom") reportInfo("custom") end SLASH_CUSTOMREPORT1 = '/smr' -- intelligent report SlashCmdList["GUILDREPORT"] = function() --print("guild") reportInfo("guild") end SLASH_GUILDREPORT1 = '/smg' -- guild report SlashCmdList["PARTYREPORT"] = function() --print("party") reportInfo("party") end SLASH_PARTYREPORT1 = '/smp' -- party report
23.670968
149
0.642137
60e49fbe44cab3771106ccc3b93e48330ea93bd3
1,922
sql
SQL
app/background-process/dbs/schemas/profile-data.v1.sql
Bhanditz/beaker
796c99977d4137cfd8e050fae5af405658bcd5ce
[ "Unlicense", "MIT" ]
4
2017-07-15T18:18:15.000Z
2017-07-31T12:39:53.000Z
app/background-process/dbs/schemas/profile-data.v1.sql
Bhanditz/beaker
796c99977d4137cfd8e050fae5af405658bcd5ce
[ "Unlicense", "MIT" ]
2
2017-07-18T20:10:01.000Z
2017-07-18T20:10:33.000Z
app/background-process/dbs/schemas/profile-data.v1.sql
Bhanditz/beaker
796c99977d4137cfd8e050fae5af405658bcd5ce
[ "Unlicense", "MIT" ]
1
2019-01-16T08:00:17.000Z
2019-01-16T08:00:17.000Z
CREATE TABLE profiles ( id INTEGER PRIMARY KEY NOT NULL, url TEXT, createdAt INTEGER DEFAULT (strftime('%s', 'now')) ); CREATE TABLE archives ( profileId INTEGER NOT NULL, key TEXT NOT NULL, localPath TEXT, isSaved INTEGER, createdAt INTEGER DEFAULT (strftime('%s', 'now')) ); CREATE TABLE archives_meta ( key TEXT PRIMARY KEY, title TEXT, description TEXT, forkOf TEXT, createdByUrl TEXT, createdByTitle TEXT, mtime INTEGER, metaSize INTEGER, stagingSize INTEGER, isOwner INTEGER ); CREATE TABLE bookmarks ( profileId INTEGER, url TEXT NOT NULL, title TEXT, pinned INTEGER, createdAt INTEGER DEFAULT (strftime('%s', 'now')), PRIMARY KEY (profileId, url), FOREIGN KEY (profileId) REFERENCES profiles (id) ON DELETE CASCADE ); CREATE TABLE visits ( profileId INTEGER, url TEXT NOT NULL, title TEXT NOT NULL, ts INTEGER NOT NULL, FOREIGN KEY (profileId) REFERENCES profiles (id) ON DELETE CASCADE ); CREATE TABLE visit_stats ( url TEXT NOT NULL, num_visits INTEGER, last_visit_ts INTEGER ); CREATE VIRTUAL TABLE visit_fts USING fts4 (url, title); CREATE UNIQUE INDEX visits_stats_url ON visit_stats (url); -- default profile INSERT INTO profiles (id) VALUES (0); -- default bookmarks INSERT INTO bookmarks (profileId, title, url, pinned) VALUES (0, 'Beaker Homepage', 'https://beakerbrowser.com', 1); INSERT INTO bookmarks (profileId, title, url, pinned) VALUES (0, 'Beaker Twitter', 'https://twitter.com/beakerbrowser', 1); INSERT INTO bookmarks (profileId, title, url, pinned) VALUES (0, 'Beaker Mailing List', 'https://groups.google.com/forum/#!forum/beaker-browser', 1); INSERT INTO bookmarks (profileId, title, url, pinned) VALUES (0, 'Report an Issue', 'https://github.com/beakerbrowser/beaker/issues', 1); INSERT INTO bookmarks (profileId, title, url, pinned) VALUES (0, 'DuckDuckGo', 'https://duckduckgo.com', 1); PRAGMA user_version = 1;
28.264706
149
0.726847
4bd876c651b0b631850c31611f1713792d4cd9c0
9,261
c
C
Tachy/Tachy/main.c
rdpoor/tachy
5233b19433af1ff9da19cc1877c988a75529289f
[ "MIT" ]
null
null
null
Tachy/Tachy/main.c
rdpoor/tachy
5233b19433af1ff9da19cc1877c988a75529289f
[ "MIT" ]
null
null
null
Tachy/Tachy/main.c
rdpoor/tachy
5233b19433af1ff9da19cc1877c988a75529289f
[ "MIT" ]
null
null
null
/** * \file * * \brief Application implement * * Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries. * * \asf_license_start * * \page License * * Subject to your compliance with these terms, you may use Microchip * software and any derivatives exclusively with Microchip products. * It is your responsibility to comply with third party license terms applicable * to your use of third party software (including open source software) that * may accompany Microchip software. * * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. * * \asf_license_stop * */ /* * Support and FAQ: visit <a href="https://www.microchip.com/support/">Microchip * Support</a> */ #include "adxl345.h" #include "adxl345_dev.h" #include "adxl345_err.h" #include "atmel_start.h" #include "atmel_start_pins.h" // ============================================================================= // definitions and typedefs /* Logo */ #define TSLCD_SEG_B0 SLCD_SEGID(1, 0) #define TSLCD_SEG_B1 SLCD_SEGID(2, 0) #define TSLCD_SEG_B2 SLCD_SEGID(0, 0) /* Narrow */ #define TSLCD_SEG_N0 SLCD_SEGID(3, 0) #define TSLCD_SEG_N1 SLCD_SEGID(4, 0) #define TSLCD_SEG_N2 SLCD_SEGID(5, 0) #define TSLCD_SEG_N3 SLCD_SEGID(6, 0) #define TSLCD_SEG_N4 SLCD_SEGID(7, 0) /* symbal */ #define TSLCD_SEG_S0 SLCD_SEGID(0, 21) #define TSLCD_SEG_S1 SLCD_SEGID(0, 20) #define TSLCD_SEG_S2 SLCD_SEGID(0, 19) #define TSLCD_SEG_S3 SLCD_SEGID(0, 22) #define TSLCD_SEG_S4 SLCD_SEGID(0, 14) #define TSLCD_SEG_S5 SLCD_SEGID(0, 13) #define TSLCD_SEG_S6 SLCD_SEGID(0, 15) #define TSLCD_SEG_S7 SLCD_SEGID(0, 23) /* Digital */ #define TSLCD_SEG_D01 SLCD_SEGID(0, 16) #define TSLCD_SEG_D02 SLCD_SEGID(0, 17) #define TSLCD_SEG_D03 SLCD_SEGID(0, 18) /* Wifi */ #define TSLCD_SEG_W0 SLCD_SEGID(0, 2) #define TSLCD_SEG_W1 SLCD_SEGID(0, 3) #define TSLCD_SEG_W2 SLCD_SEGID(1, 2) #define TSLCD_SEG_W3 SLCD_SEGID(1, 3) /* Battery */ #define TSLCD_SEG_BT0 SLCD_SEGID(4, 2) #define TSLCD_SEG_BT1 SLCD_SEGID(4, 3) #define TSLCD_SEG_BT2 SLCD_SEGID(5, 2) #define TSLCD_SEG_BT3 SLCD_SEGID(5, 3) #define SAMPLE_BUF_SIZE 512 #define WINDOW_SIZE (SAMPLE_BUF_SIZE / 2) #define MIN_OFFSET 12 typedef struct { int32_t dot_product; int offset; } correlation_t; // ============================================================================= // local declarations static void turn_on_segments(void); static void blink_segments(void); static void animation_segments(void); static void display_characters(void); static void fetch_samples(adxl345_t *adxl345); static void set_test_pin(bool val); /** @brief Fetch a sample from the circular buffer */ static int32_t get_sample(int index); /** @brief Write a sample to the circular buffer */ static void put_sample(int32_t sample); /** @brief Compute one point of the autocorrlation */ static int32_t dot_product(int offset); /** @brief Return the offset that produces the highest correlation */ static void autocorrelate(correlation_t *corr); static void dump_sample_buf(void); // ============================================================================= // local storage static uint8_t s_high_water; static uint32_t s_samples_read; static int32_t sample_buf[SAMPLE_BUF_SIZE]; static int s_sample_index; // ============================================================================= // main code int main(void) { atmel_start_init(); adxl345_err_t err; adxl345_t adxl345; adxl345_dev_t adxl345_dev; correlation_t corr; /* Replace with your application code */ slcd_sync_enable(&SEGMENT_LCD_0); turn_on_segments(); blink_segments(); animation_segments(); display_characters(); err = adxl345_dev_init(&adxl345_dev, &ADXL345_0, ADXL345_I2C_PRIMARY_ADDRESS, I2C_M_SEVEN); printf("adxl345_dev_init() => %d\n", err); err = adxl345_init(&adxl345, &adxl345_dev); printf("adxl345_init() => %d\n", err); err = adxl345_stop(&adxl345); printf("adxl345_stop() => %d\n", err); // Configure ADXL345: 100 Hz, FIFO enabled, water mark = 1 sample err = adxl345_set_bw_rate_reg(&adxl345, ADXL345_RATE_200); printf("adxl345_set_bw_rate_reg() => %d\n", err); err = adxl345_set_fifo_ctl_reg(&adxl345, ADXL345_FIFO_MODE_ENABLE | 1); printf("adxl345_set_fifo_ctl_reg() => %d\n", err); err = adxl345_start(&adxl345); printf("adxl345_start() => %d\n", err); s_high_water = 0; s_samples_read = 0; while (1) { fetch_samples(&adxl345); autocorrelate(&corr); printf("%d %5ld %3d %ld\n", s_high_water, s_samples_read, corr.offset, corr.dot_product); // if (s_samples_read > SAMPLE_BUF_SIZE) { // dump_sample_buf(); // return 0; // } } } // ============================================================================= // local functions static void turn_on_segments(void) { slcd_sync_seg_on(&SEGMENT_LCD_0, TSLCD_SEG_N0); slcd_sync_seg_on(&SEGMENT_LCD_0, TSLCD_SEG_N1); slcd_sync_seg_on(&SEGMENT_LCD_0, TSLCD_SEG_N2); slcd_sync_seg_on(&SEGMENT_LCD_0, TSLCD_SEG_N3); slcd_sync_seg_on(&SEGMENT_LCD_0, TSLCD_SEG_N4); slcd_sync_seg_on(&SEGMENT_LCD_0, TSLCD_SEG_S0); slcd_sync_seg_on(&SEGMENT_LCD_0, TSLCD_SEG_S1); slcd_sync_seg_on(&SEGMENT_LCD_0, TSLCD_SEG_S2); slcd_sync_seg_on(&SEGMENT_LCD_0, TSLCD_SEG_S3); slcd_sync_seg_on(&SEGMENT_LCD_0, TSLCD_SEG_S4); slcd_sync_seg_on(&SEGMENT_LCD_0, TSLCD_SEG_S5); slcd_sync_seg_on(&SEGMENT_LCD_0, TSLCD_SEG_S6); slcd_sync_seg_on(&SEGMENT_LCD_0, TSLCD_SEG_S7); slcd_sync_seg_on(&SEGMENT_LCD_0, TSLCD_SEG_D01); slcd_sync_seg_on(&SEGMENT_LCD_0, TSLCD_SEG_D02); slcd_sync_seg_on(&SEGMENT_LCD_0, TSLCD_SEG_D03); } static void blink_segments(void) { slcd_sync_seg_blink(&SEGMENT_LCD_0, TSLCD_SEG_B0, 1000); slcd_sync_seg_blink(&SEGMENT_LCD_0, TSLCD_SEG_B1, 1000); slcd_sync_seg_blink(&SEGMENT_LCD_0, TSLCD_SEG_B2, 1000); } static void animation_segments(void) { uint32_t segs[8] = {TSLCD_SEG_W0, TSLCD_SEG_W1, TSLCD_SEG_W2, TSLCD_SEG_W3, TSLCD_SEG_BT0, TSLCD_SEG_BT1, TSLCD_SEG_BT2, TSLCD_SEG_BT3}; slcd_sync_start_animation(&SEGMENT_LCD_0, segs, 8, 1000); } static void display_characters(void) { slcd_sync_write_char(&SEGMENT_LCD_0, '0', 0); slcd_sync_write_char(&SEGMENT_LCD_0, '1', 1); slcd_sync_write_string(&SEGMENT_LCD_0, (uint8_t *)"234", 3, 2); slcd_sync_write_string(&SEGMENT_LCD_0, (uint8_t *)"abcdefgh", 8, 5); } /** @brief Slurp available samples from FIFO and store in circular buffer */ static void fetch_samples(adxl345_t *adxl345) { uint8_t available; adxl345_isample_t sample; // adxl345_err_t err; /* err = */ adxl345_available_samples(adxl345, &available); // note high water mark if (available > s_high_water) s_high_water = available; s_samples_read += available; for (int i = 0; i < available; i++) { /* err = */ adxl345_get_isample(adxl345, &sample); // use only the z axis // printf("%d\n", sample.z - 245); put_sample(sample.z); } } static void set_test_pin(bool val) { gpio_set_pin_level(TEST_PIN, val); // PC03 on EXT1.10 } /** @brief Read a sample from the circular buffer. * * @param index Index into the buffer. index = 0 is the oldest sample, * index = SAMPLES_BUFFER_SIZE-1 is the newest * @return The sample. */ static int32_t get_sample(int index) { return sample_buf[(s_sample_index + index) % SAMPLE_BUF_SIZE]; } /** @brief Write a sample into the circular buffer. * * This replaces the oldest sample with the newest. * * @param sample The sample to write. */ static void put_sample(int32_t sample) { sample_buf[s_sample_index++] = sample; if (s_sample_index >= SAMPLE_BUF_SIZE) { s_sample_index %= SAMPLE_BUF_SIZE; } } static int32_t dot_product(int offset) { int32_t total = 0; for (int i=0; i<WINDOW_SIZE; i++) { int32_t a = get_sample(i); int32_t b = get_sample(i+offset); total += a * b; } return total; } static void autocorrelate(correlation_t *corr) { set_test_pin(true); // for scope timing // compute first point (makes inner loop more efficient) corr->dot_product = dot_product(MIN_OFFSET); corr->offset = MIN_OFFSET; // compute the rest of the points for (int offset=MIN_OFFSET+1; offset<WINDOW_SIZE; offset++) { int32_t dp = dot_product(offset); if (dp > corr->dot_product) { corr->dot_product = dp; corr->offset = offset; } } set_test_pin(false); // for scope timing } static void dump_sample_buf() { for (int i=0; i<SAMPLE_BUF_SIZE; i++) { printf("%d, %ld\n", i, get_sample(i)); } }
30.767442
93
0.697225
15ef3053a4663980cde5dfa8cef8640600ff595b
20,323
rb
Ruby
lib/docrb/lib/docrb/ruby_parser.rb
heyvito/docrb
2cd5fe015584f561d4edb93dcab55bb9a651f469
[ "MIT" ]
4
2021-10-24T00:49:47.000Z
2021-11-14T16:15:33.000Z
lib/docrb/lib/docrb/ruby_parser.rb
heyvito/docrb
2cd5fe015584f561d4edb93dcab55bb9a651f469
[ "MIT" ]
null
null
null
lib/docrb/lib/docrb/ruby_parser.rb
heyvito/docrb
2cd5fe015584f561d4edb93dcab55bb9a651f469
[ "MIT" ]
null
null
null
# frozen_string_literal: true module Docrb # RubyParser parses comments and source from a given file path and provides # its digested contents in standardised structures. class RubyParser COMMENT_PREFIX = /^\s*#\s?/ attr_reader :modules, :classes, :methods, :ast # Initializes a new parser for a given path # # path - Path of the file to be parsed def initialize(path) @ast, @comments = ::Parser::CurrentRuby.parse_file_with_comments(path) @modules = [] @classes = [] @methods = [] end # Kicks off the parsing process # # After this method is called, #modules, #classes, and #methods can be # used to enumerate items contained within the parsed file. def parse parse!(@ast) cleanup! end private # Recursivelly cleans modules and classes found in the parsed file by # removing uneeded internal fields used by the parser. def cleanup! clean_modules! clean_classes! end # Parses a given node and parent. This method is a dispatch source for # other parsing methods. # # node - Node to be parsed # parent - Parent node of the node being parsed def parse!(node = nil, parent = nil) return if node.nil? case node.type when :def parse_def(node, parent) when :defs parse_singleton_method(node, parent) when :class parse_class(node, parent) when :sclass parse_singleton_class(node, parent) when :module parse_module(node, parent) when :begin parse_begin(node, parent) when :send parse_send(node, parent) end end # Attempts to find a comment associated with a given line. # # line - Integer representing the line number to be checked for comments # # Returns a comment preceding the provided line, or nil, in case there's # none. def comment_for_line(line) return nil if line.zero? || line.negative? @comments.find { |c| c.loc.line == line } end # Finds and parses a comment block preceding a given line number. # # line - Integer representing the line being processed. # type: - Type of node depicted in the provided line number. This is used # to provide better utilities to handle the node being commented. # # Returns a hash containing the parsed comment. def comments_from(line, type:) # First, find a comment for the line before this comments = [] comment = comment_for_line(line) while comment comments << comment comment = comment_for_line(line - 1) line -= 1 end return nil if comments.empty? comments = comments .collect(&:text) .collect { |l| l.gsub(COMMENT_PREFIX, "") } .reverse .join("\n") CommentParser.parse(type: type, comment: comments) end # Parses a `begin` keyword # # node - The node being parsed # parent - The node's parent object def parse_begin(node, parent) node.children.each { |n| parse!(n, parent) } end ATTRIBUTES = %i[attr_reader attr_writer attr_accessor].freeze CLASS_MODIFIERS = %i[extend include].freeze VISIBILITY_MODIFIERS = %i[private protected public].freeze MODULE_MODIFIERS = [:module_function].freeze SEND_DISPATCH = { ATTRIBUTES => :parse_attribute, CLASS_MODIFIERS => :parse_class_modifier, VISIBILITY_MODIFIERS => :parse_visibility_modifier, MODULE_MODIFIERS => :parse_module_modifier }.freeze PARSEABLE_SENDS = [*ATTRIBUTES, *CLASS_MODIFIERS, *VISIBILITY_MODIFIERS, *MODULE_MODIFIERS].freeze # Parses a `send` instruction (a method call) # # node - The node being parsed # parent - The node's parent object def parse_send(node, parent) arr = node.to_a target, name = arr.slice(0..1) args = arr.slice(2..) # TODO: Parse when target is not nil? return if target || !PARSEABLE_SENDS.include?(name) delegate = SEND_DISPATCH.find { |inner, _del| inner.include? name }&.last send(delegate, node, parent, target, name, args) if delegate end # Parses a module modifier. Currently this only handles a `module_function` # keyword. # # _node - Unused. # parent - The parent object of this modifier # _target - Unused. # name - Name of the modifier being invoked # args - Arguments passed to the modifier method def parse_module_modifier(_node, parent, _target, name, args) # FIXME: `module_function` does a lot: # Creates module functions for the named methods. These functions may # be called with the module as a receiver, and also become available as # instance methods to classes that mix in the module. Module functions # are copies of the original, and so may be changed independently. The # instance-method versions are made private. If used with no arguments, # subsequently defined methods become module functions. String arguments # are converted to symbols. # ...but we will only treat it as defs, for now. return if args.empty? # So when nothing is provided, nothing is done. # That's a poor decision by itself, but we may # address this in the future. args.each do |a| handle_module_function(parent, name, a) end end # Handles a `module_function` call and either registers and modifies a # function definition following it, or attempts to change previously-defined # functions visibility based on the call arguments. # # parent - The object on which the function has as its receiver # _name - Unused. # target - Target object being passed to the function def handle_module_function(parent, _name, target) case target.try?(:type) when :def # This will not be ideal, but let's parse the def as a def (duh), then # apply the same logic of :sym here. This is as not ideal as the impl. # of parse_module_modifier itself. parse_def(target, parent) change_method_kind(of: target.children.first, to: :sdef, on: parent) when :sym # This moves the target from `def` to `sdef`... change_method_kind(of: target.children.first, to: :sdef, on: parent) when :string change_method_kind(of: target.children.first.to_sym, to: :sdef, on: parent) end end # Parses an attribute definition # # node - The node being parsed # parent - The parent containing the node being parsed # _target - Unused. # name - Name of the attribute definer being called # args - List of attribute names being defined def parse_attribute(node, parent, _target, name, args) parent[name] ||= [] docs = nil if args.length == 1 # When we have a single accessor, we may check for docs before it. docs = comments_from(node.loc.expression.first_line - 1, type: :attribute) end args.map(&:to_a).flatten.each do |n| parent[name].append({ docs: docs, name: n, writer_visibility: parent[:_visibility], reader_visibility: parent[:_visibility] }) end end # Parses a given class modifier (`include`, `extend`). # # _node - Unused. # parent - Parent object on which the modified is being called against. # _target - Unused. # name - Name of the modifier being called. # args - List of objects passed to the modifier. def parse_class_modifier(_node, parent, _target, name, args) parent[name] ||= [] args.each do |n| path, base_name = parse_class_path(n) parent[name].append({ name: base_name, class_path: path }) end end # Parses a given visibility modifier (`private`, `public`, `protected`) and # sets the current class visibility option based on whether the call # contains extra parameters or not. When passing names or a method # definition after the keyword, only listed objects are changed. Otherwise, # marks all subsequent objects following the keyword with its access level # until another modifier is found. # # _node - Unused. # parent - Parent on which the keyword is being invoked against. # _target - Unused. # name - Name of the modifier being invoked. # args - List of arguments passed to the modifier. def parse_visibility_modifier(_node, parent, _target, name, args) # Empty args changes all items defined after that point to the # visibility level `name` return parent[:_visibility] = name if args.empty? args.each do |a| handle_visibility_keyword(parent, name, a) end end # Handles a visibility keyword for a specific target. # # parent - Parent containing the method call. # name - Name of the visibility keyword being applied # target - Target object on which the visibility keyword is being invoked # against. def handle_visibility_keyword(parent, name, target) case target.try?(:type) when :def old_visibility = parent[:_visibility] parent[:_visibility] = name parse_def(target, parent) parent[:_visibility] = old_visibility when :defs old_visibility = parent[:_visibility] parent[:_visibility] = name parse_singleton_method(target, parent) parent[:_visibility] = old_visibility when :send # This one will be tricky... The called method can return anything, # so we will support at least the attr_* family. old_visibility = parent[:_visibility] parent[:_visibility] = name parse_send(target, parent) parent[:_visibility] = old_visibility when :sym # Oh no. change_visibility(of: target.children.first, to: name, on: parent) else puts "BUG: Unexpected element on handle_visibility_keyword. Please file an issue." exit(1) end end # Changes the visibility of a single object on a given parent to a provided # value. # # of: - Name of the object having its visibility changed. # to: - New visibility value for the object. # on: - The object's parent container. def change_visibility(of:, to:, on:) # Method? if on.key?(:methods) && (method = on[:methods].find { |m| m[:name] == of }) return method[:visibility] = to end # Accessor? writer = of.end_with? "=" normalized = of.to_s.gsub(/=$/, "").to_sym if on.key?(:attr_accessor) && (acc = on[:attr_accessor].find { |a| a[:name] == normalized }) return acc[writer ? :writer_visibility : :reader_visibility] = to end # Reader or writer? type = writer ? :attr_writer : :attr_reader return unless on.key?(type) && (acc = on[type].find { |a| a[:name] == normalized }) acc[writer ? :writer_visibility : :reader_visibility] = to end # Changes the kind of a method object (E.g.: Between sdef and def) # # of: - Name of the method having its kind changed. # to: - New kind value for the method. # on: - The methods's parent container. def change_method_kind(of:, to:, on:) return unless on.key?(:methods) && (method = on[:methods].find { |m| m[:name] == of }) method[:type] = to end # Parses an instance method definition # # node - Node representing the method being defined # parent - The node's parent container (e.g. class on which it is being # defined on) def parse_def(node, parent) loc = node.loc.keyword comments = comments_from(loc.line - 1, type: :def) def_meta = method_to_meta(node) def_meta[:doc] = comments def_meta[:visibility] = parent ? parent[:_visibility] : :public if parent.nil? @methods << def_meta else parent[:methods] ||= [] parent[:methods] << def_meta end end # Parses a class method definition # # node - Node representing the method being defined # parent - The node's parent container (e.g. class on which it is being # defined on) def parse_singleton_method(node, parent) loc = node.loc.keyword comments = comments_from(loc.line - 1, type: :defs) def_meta = singleton_method_to_meta(node) def_meta[:doc] = comments def_meta[:visibility] = parent ? parent[:_visibility] : :public if parent.nil? @methods << def_meta else parent[:methods] ||= [] parent[:methods] << def_meta end end # Parses a class definition # # node - Node representing the class being defined # parent - The node's parent container (e.g. class/module on which it is # being defined on) def parse_class(node, parent) loc = node.loc.keyword comments = comments_from(loc.line - 1, type: :class) class_meta = class_to_meta(node) class_meta[:doc] = comments if parent.nil? @classes << class_meta else parent[:classes] ||= [] parent[:classes] << class_meta end node.to_a.slice(2...).each do |n| parse!(n, class_meta) end end # Parses a singleton class definition # # node - Node representing the singleton class being defined # parent - The node's parent container (e.g. class/module on which it is # being defined on) def parse_singleton_class(node, parent) loc = node.loc.keyword comments = comments_from(loc.line - 1, type: :sclass) class_meta = singleton_class_to_meta(node) class_meta[:doc] = comments if parent.nil? @classes << class_meta else parent[:classes] ||= [] parent[:classes] << class_meta end node.to_a.slice(1...).each do |n| parse!(n, class_meta) end end # Parses a module definition # # node - Node representing the module being defined # parent - The node's parent container (e.g. class/module on which it is # being defined on) def parse_module(node, parent) loc = node.loc.keyword comments = comments_from(loc.line - 1, type: :module) module_meta = module_to_meta(node) module_meta[:doc] = comments if parent.nil? @modules << module_meta else parent[:modules] ||= [] parent[:modules] << module_meta end node.to_a.slice(1...).each do |n| parse!(n, module_meta) end end # Generates metadata for a given method, such as its name, arguments, # and boundaries. # # node - Method node being processed # # Returns a Hash containing metadata about the provided method. def method_to_meta(node) { type: :def, name: node.children.first, args: parse_method_args(node), start_at: node.loc.keyword.line, end_at: node.loc.end.line } end # Generates metadata for a given singleton method, such as its name, # arguments, and boundaries. # # node - Method node being processed # # Returns a Hash containing metadata about the provided singleton method. def singleton_method_to_meta(node) class_path, name = parse_class_path(node.children.first) { type: :defs, target: name, class_path: class_path, name: node.children[1], args: parse_method_args(node), start_at: node.loc.keyword.line, end_at: node.loc.end.line } end # Generates metadata for a given class, such as its name, arguments, # and boundaries. # # node - Class node being processed # # Returns a Hash containing metadata about the provided class. def class_to_meta(node) class_path, name = parse_class_path(node.children.first) { type: :class, name: name, class_path: class_path, start_at: node.loc.keyword.line, end_at: node.loc.end.line, _visibility: :public }.tap do |h| if (inherits = node.children[1]) h[:inherits] = inherits.children.last end end end # Generates metadata for a given singleton class, such as its name, # arguments, and boundaries. # # node - Singleton class node being processed # # Returns a Hash containing metadata about the provided singleton class. def singleton_class_to_meta(node) target = node.children.first.type target = node.children[0].children.last if target == :const { type: :sclass, target: target, _visibility: :public, start_at: node.loc.keyword.line, end_at: node.loc.end.line } end # Generates metadata for a given module, such as its name, arguments, # and boundaries. # # node - Class node being processed # # Returns a Hash containing metadata about the provided module. def module_to_meta(node) class_path, name = parse_class_path(node.children.first) { type: :module, name: name, _visibility: :public, class_path: class_path, start_at: node.loc.keyword.line, end_at: node.loc.end.line } end # Parses an argument list of a method defintion # # node - The method's node definition # # Returns a list of standardised hashes representing all method's arguments def parse_method_args(node) node.children .find { |n| n.try?(:type) == :args } &.to_a &.map do |n| { type: n.type, name: n.children.first }.tap do |m| if n.children.length > 1 val = n.children[1] represented_type = nil represented_value = nil case val.type when true, :true represented_type = :bool represented_value = true when false, :false represented_type = :bool represented_value = false when :nil represented_type = :nil represented_value = :nil when :send represented_type = :send represented_value = { target: parse_class_path(val.children.first).flatten.compact, name: val.children.last } else represented_type = val.type represented_value = val.children.first end m[:value_type] = represented_type m[:value] = represented_value end end end end # Parses a given class path into an interable list of objects representing # its full path # # path - Path to be processed # # Returns a multidimensional array structure representing the path to the # provided value. def parse_class_path(path) return [[], :self] if path.try?(:type) == :self path = path.to_a name = path[1] parents = [] parent = path.first.try?(:to_a) || [] until parent&.empty? parents << parent.last parent = parent.first.to_a end [parents.reverse, name] end # Strips all contained module's structures of its internal keys used by # the parser. def clean_modules! @modules.each { |m| m.delete(:_visibility) } end # Recursivelly calls #clean_class for all classes contained within the # parser. def clean_classes! @classes.map! { |c| clean_class(c) } end # Strps the provided class structure of its internal keys used by the # parser. # # cls - Class structure to be cleaned. def clean_class(cls) cls.delete(:_visibility) cls[:classes].map! { |c| clean_class(c) } if cls.key? :classes cls end end end
32.5168
102
0.612606
340ffc6bb0376376a3b5ea41fe5341fe22454938
359
swift
Swift
OwlDemo/Emoji/UI/EmojiCell.swift
bunnyhero/Owl
a0215bc2610fa090bcdc27922b19ab986ade61af
[ "MIT" ]
466
2019-04-30T15:55:21.000Z
2022-02-22T00:22:15.000Z
OwlDemo/Emoji/UI/EmojiCell.swift
bunnyhero/Owl
a0215bc2610fa090bcdc27922b19ab986ade61af
[ "MIT" ]
37
2019-05-03T07:38:05.000Z
2021-11-18T06:03:02.000Z
OwlDemo/Emoji/UI/EmojiCell.swift
bunnyhero/Owl
a0215bc2610fa090bcdc27922b19ab986ade61af
[ "MIT" ]
37
2019-05-08T01:56:04.000Z
2021-12-16T16:49:04.000Z
// // EmojiCell.swift // Example // // Created by dan on 04/04/2019. // Copyright © 2019 FlowKit2. All rights reserved. // import UIKit public class EmojiCell: UICollectionViewCell { @IBOutlet public var emojiLabel: UILabel! public var emoji: String? { didSet { emojiLabel.text = emoji ?? "" } } }
16.318182
51
0.587744
eb29c007585c6f1bb8b7b547a1db487e2b9fd689
514
dart
Dart
lib/views/tabs/dashboard.dart
Vedantgupta2303/GetSetPro
b63ab5cc7479a5077f7c9dd91848cb9c7e2c02d0
[ "MIT" ]
1
2021-05-30T05:13:07.000Z
2021-05-30T05:13:07.000Z
lib/views/tabs/dashboard.dart
aman440/Taskify
b63ab5cc7479a5077f7c9dd91848cb9c7e2c02d0
[ "MIT" ]
null
null
null
lib/views/tabs/dashboard.dart
aman440/Taskify
b63ab5cc7479a5077f7c9dd91848cb9c7e2c02d0
[ "MIT" ]
null
null
null
import 'package:flutter/material.dart'; class DashboardTab extends StatefulWidget { @override _DashboardTabState createState() => _DashboardTabState(); } class _DashboardTabState extends State<DashboardTab> { @override Widget build(BuildContext context) { return SingleChildScrollView( padding: EdgeInsets.only(top: 20, bottom: 100, right: 20), child: Container( height: MediaQuery.of(context).size.height * 2, width: 200, color: Colors.red, ), ); } }
24.47619
64
0.682879
4bc7fc3fe4a6a59b229a50091693c0b6fd6bec16
4,019
c
C
source/objects/elements/Comic/Comic.c
VUEngine/Capitan-Sevilla-3D
109b614c6b084b1f6828e53cc8cb67ced51e1032
[ "MIT" ]
5
2021-07-05T15:27:29.000Z
2021-09-09T23:47:31.000Z
source/objects/elements/Comic/Comic.c
VUEngine/Capitan-Sevilla-3D
109b614c6b084b1f6828e53cc8cb67ced51e1032
[ "MIT" ]
null
null
null
source/objects/elements/Comic/Comic.c
VUEngine/Capitan-Sevilla-3D
109b614c6b084b1f6828e53cc8cb67ced51e1032
[ "MIT" ]
null
null
null
/* * Capitán Sevilla 3D, an adventure platforming game demo for Nintendo Virtual Boy * * (c) Christian Radke, Jorge Eremiev and Rubén Garcerá Soto * * For the full copyright and license information, please view the LICENSE file * that was distributed with this source code. */ //--------------------------------------------------------------------------------------------------------- // INCLUDES //--------------------------------------------------------------------------------------------------------- #include <GameEvents.h> #include <Game.h> #include <CollisionManager.h> #include <MessageDispatcher.h> #include <Box.h> #include "Comic.h" #include <PlatformerLevelState.h> #include <EventManager.h> #include <Gui.h> //--------------------------------------------------------------------------------------------------------- // CLASS'S METHODS //--------------------------------------------------------------------------------------------------------- void Comic::constructor(LocalizedEntitySpec* localizedEntitySpec, int16 internalId, const char* const name) { // construct base Base::constructor(localizedEntitySpec, internalId, name); // init members this->mode = kComicStill; // add event listeners Object eventManager = Object::safeCast(EventManager::getInstance()); Object::addEventListener(PlatformerLevelState::getInstance(), Object::safeCast(this), (EventListener)Comic::onUserInput, kEventUserInput); Object::addEventListener(eventManager, Object::safeCast(this), (EventListener)Comic::onLevelStarted, kEventLevelStarted); } void Comic::destructor() { // If set right after the user presses the key, a race condition with the other objects listening // for the kEventUserInput event will crash the game Object::fireEvent(EventManager::getInstance(), kEventComicDeleted); // remove event listeners Object eventManager = Object::safeCast(EventManager::getInstance()); Object::removeEventListener(PlatformerLevelState::getInstance(), Object::safeCast(this), (EventListener)Comic::onUserInput, kEventUserInput); Object::removeEventListener(eventManager, Object::safeCast(this), (EventListener)Comic::onLevelStarted, kEventLevelStarted); // discard pending delayed message MessageDispatcher::discardDelayedMessagesFromSender(MessageDispatcher::getInstance(), Object::safeCast(this), kComicMove); // delete the super object // must always be called at the end of the destructor Base::destructor(); } void Comic::ready(bool recursive) { // call base Base::ready(this, recursive); } void Comic::startMovement() { if(this->mode == kComicStill) { Object::removeEventListener(Object::safeCast(PlatformerLevelState::getInstance()), Object::safeCast(this), (EventListener)Comic::onUserInput, kEventUserInput); MessageDispatcher::dispatchMessage(COMIC_MOVE_DELAY, Object::safeCast(this), Object::safeCast(this), kComicMove, NULL); this->mode = kComicMoving; } } // process user input void Comic::onUserInput(Object eventFirer __attribute__ ((unused))) { UserInput userInput = PlatformerLevelState::getUserInput(PlatformerLevelState::getInstance(), true); if((K_STA | K_A) & userInput.releasedKey) { Comic::startMovement(this); } } bool Comic::handleMessage(Telegram telegram) { switch(Telegram::getMessage(telegram)) { case kComicMove: Comic::move(this); break; } return false; } // move comic down void Comic::move() { // get local position of comic and modify y value Vector3D offset = *Container::getLocalPosition(this); offset.y += __PIXELS_TO_METERS(COMIC_MOVE_OFFSET); // update position Container::setLocalPosition(this, &offset); // send delayed message to self to trigger next movement MessageDispatcher::dispatchMessage(COMIC_MOVE_DELAY, Object::safeCast(this), Object::safeCast(this), kComicMove, NULL); } bool Comic::respawn() { return false; } void Comic::onLevelStarted(Object eventFirer __attribute__ ((unused))) { PlatformerLevelState::setModeToPaused(PlatformerLevelState::getInstance()); }
31.896825
161
0.679273
d42d20bf71a2a796d094d65ec9fb390333ca9c90
526
cc
C++
tb/riscv-isa-sim/build/amomaxu_w.cc
ljhsiun2/hackdac
f62399ddf9e9c79b22fbec07d59aa907a78a537e
[ "ECL-2.0", "Apache-2.0" ]
1
2021-08-13T03:12:15.000Z
2021-08-13T03:12:15.000Z
tb/riscv-isa-sim/build/amomaxu_w.cc
ljhsiun2/hackdac
f62399ddf9e9c79b22fbec07d59aa907a78a537e
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
tb/riscv-isa-sim/build/amomaxu_w.cc
ljhsiun2/hackdac
f62399ddf9e9c79b22fbec07d59aa907a78a537e
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
// See LICENSE for license details. #include "insn_template.h" reg_t rv32_amomaxu_w(processor_t* p, insn_t insn, reg_t pc) { int xlen = 32; reg_t npc = sext_xlen(pc + insn_length( MATCH_AMOMAXU_W)); #include "insns/amomaxu_w.h" trace_opcode(p, MATCH_AMOMAXU_W, insn); return npc; } reg_t rv64_amomaxu_w(processor_t* p, insn_t insn, reg_t pc) { int xlen = 64; reg_t npc = sext_xlen(pc + insn_length( MATCH_AMOMAXU_W)); #include "insns/amomaxu_w.h" trace_opcode(p, MATCH_AMOMAXU_W, insn); return npc; }
23.909091
60
0.718631
da140553f9c0d1455f56c159550021ee2b406c1c
538
php
PHP
patterns/php/tests/SplStackTest.php
NorthArea/design-patterns
2db680e916accc9a7c0dd0d0bab6905cf1a9db44
[ "MIT" ]
null
null
null
patterns/php/tests/SplStackTest.php
NorthArea/design-patterns
2db680e916accc9a7c0dd0d0bab6905cf1a9db44
[ "MIT" ]
null
null
null
patterns/php/tests/SplStackTest.php
NorthArea/design-patterns
2db680e916accc9a7c0dd0d0bab6905cf1a9db44
[ "MIT" ]
null
null
null
<?php namespace Test; use PHPUnit\Framework\TestCase; use SplDoublyLinkedList; use SplStack; class SplStackTest extends TestCase { public function testMain() { $array1 = ['hello'=>'world']; $array2 = ['key'=>'val']; $stack = new SplStack(); self::assertTrue($stack->isEmpty()); $stack->push($array1); $stack->push($array2); self::assertFalse($stack->isEmpty()); self::assertEquals($array2, $stack->pop()); self::assertFalse($stack->isEmpty()); } }
19.925926
51
0.583643
ede2666d3276466841e50c46f74dce7b6116af39
2,047
ps1
PowerShell
hsdp-iam/Public/PasswordPolicy/Remove-PasswordPolicy.ps1
philips-software/powershell-hsdp-iam
e3c42041480ef0fa18cd6045808081b7b2166cf2
[ "MIT" ]
6
2020-04-22T19:52:22.000Z
2021-03-26T18:15:40.000Z
hsdp-iam/Public/PasswordPolicy/Remove-PasswordPolicy.ps1
philips-software/powershell-hsdp-iam
e3c42041480ef0fa18cd6045808081b7b2166cf2
[ "MIT" ]
5
2020-06-02T16:18:28.000Z
2020-09-14T18:39:12.000Z
hsdp-iam/Public/PasswordPolicy/Remove-PasswordPolicy.ps1
philips-software/powershell-hsdp-iam
e3c42041480ef0fa18cd6045808081b7b2166cf2
[ "MIT" ]
null
null
null
<# .SYNOPSIS Remove a password policy .DESCRIPTION Removes a password policy from an organization. Any user with PASSWORDPOLICY.WRITE permission can delete the policy. .INPUTS The policy resource object .OUTPUTS Nothing .PARAMETER Policy The password policy resource object .LINK https://www.hsdp.io/documentation/identity-and-access-management-iam/api-documents/password-api#/Password%20Policy/delete_authorize_identity_PasswordPolicy__id_ .EXAMPLE Remove-PasswordPolicy (Get-Policy -Id "3c9ac645-b8c8-46c8-8781-a78e318e2e2d") .NOTES DELETE: /authorize/identity/PasswordPolicy/{id} v1 #> function Remove-PasswordPolicy { [CmdletBinding(SupportsShouldProcess, ConfirmImpact='High')] param( [Parameter(Mandatory, Position = 0, ValueFromPipeline)] [ValidateNotNull()] [PSObject]$Policy, [Parameter()] [switch] $Force ) begin { Write-Verbose "[$($MyInvocation.MyCommand.Name)] Function started" if (-not $PSBoundParameters.ContainsKey('Verbose')) { $VerbosePreference = $PSCmdlet.SessionState.PSVariable.GetValue('VerbosePreference') } if (-not $PSBoundParameters.ContainsKey('Confirm')) { $ConfirmPreference = $PSCmdlet.SessionState.PSVariable.GetValue('ConfirmPreference') } if (-not $PSBoundParameters.ContainsKey('WhatIf')) { $WhatIfPreference = $PSCmdlet.SessionState.PSVariable.GetValue('WhatIfPreference') } } process { Write-Debug "[$($MyInvocation.MyCommand.Name)] PSBoundParameters: $($PSBoundParameters | Out-String)" if ($Force -or $PSCmdlet.ShouldProcess("ShouldProcess?")) { $ConfirmPreference = 'None' Invoke-ApiRequest -Path "/authorize/identity/PasswordPolicy/$($Policy.id)" -Version 1 -Method Delete -Body $Policy -ValidStatusCodes @(204) | Out-Null } } end { Write-Verbose "[$($MyInvocation.MyCommand.Name)] Complete" } }
31.984375
164
0.667807
ead2b5e11ecf399e21725b292f57d37ce75579bf
979
sql
SQL
queries/most_flaky_spec_cases.sql
ionut998/jenkins_statistics
d930a9b12b1512e054290cf9733d49c9ba2bbdb6
[ "MIT" ]
null
null
null
queries/most_flaky_spec_cases.sql
ionut998/jenkins_statistics
d930a9b12b1512e054290cf9733d49c9ba2bbdb6
[ "MIT" ]
1
2015-12-17T09:46:08.000Z
2015-12-20T13:12:04.000Z
queries/most_flaky_spec_cases.sql
ionut998/jenkins_statistics
d930a9b12b1512e054290cf9733d49c9ba2bbdb6
[ "MIT" ]
null
null
null
SELECT p.name AS project, s.file_path, sc.description, edges, last_failed FROM spec_cases sc JOIN specs s ON s.id = sc.spec_id JOIN projects p ON p.id = s.project_id JOIN ( SELECT project_id, spec_case_id, count(*) AS edges, max(last_failed) AS last_failed FROM ( SELECT project_id, spec_case_id, regexp_matches(results, '(01+0)', 'g'), last_failed FROM ( SELECT project_id, spec_case_id, string_agg(status, '') AS results, COUNT(*), max(created_at) AS last_failed FROM ( SELECT b.project_id, b.id, sc.id AS spec_case_id, (CASE scr.status WHEN 'passed' THEN '1' WHEN 'failed' THEN '0' ELSE 'x' END) AS status, scr.created_at FROM spec_cases sc JOIN spec_case_runs scr ON sc.id = scr.spec_case_id JOIN builds b ON b.id = scr.build_id ORDER BY 1,2 ) status_query GROUP BY 1,2 ) aggregated ) pattern_match GROUP BY 1,2 ) counted_edges ON counted_edges.spec_case_id = sc.id WHERE edges > 2 ORDER BY edges desc;
44.5
160
0.701736