code
stringlengths
5
1.01M
repo_name
stringlengths
5
84
path
stringlengths
4
311
language
stringclasses
30 values
license
stringclasses
15 values
size
int64
5
1.01M
input_ids
listlengths
502
502
token_type_ids
listlengths
502
502
attention_mask
listlengths
502
502
labels
listlengths
502
502
/* ScummVM - Graphic Adventure Engine * * ScummVM is the legal property of its developers, whose names * are too numerous to list here. Please refer to the COPYRIGHT * file distributed with this source distribution. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * */ #ifndef GRAPHICS_PRIMITIVES_H #define GRAPHICS_PRIMITIVES_H namespace Graphics { void drawLine(int x0, int y0, int x1, int y1, int color, void (*plotProc)(int, int, int, void *), void *data); void drawThickLine(int x0, int y0, int x1, int y1, int penX, int penY, int color, void (*plotProc)(int, int, int, void *), void *data); } // End of namespace Graphics #endif
LasDesu/scummvm
graphics/primitives.h
C
gpl-2.0
1,319
[ 30522, 1013, 1008, 8040, 2819, 2213, 2615, 2213, 1011, 8425, 6172, 3194, 1008, 1008, 8040, 2819, 2213, 2615, 2213, 2003, 1996, 3423, 3200, 1997, 2049, 9797, 1010, 3005, 3415, 1008, 2024, 2205, 3365, 2000, 2862, 2182, 1012, 3531, 6523, 200...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# Dovyalis engleri Gilg SPECIES #### Status ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Malpighiales/Salicaceae/Dovyalis/Dovyalis engleri/README.md
Markdown
apache-2.0
171
[ 30522, 1001, 2079, 10736, 13911, 25540, 3917, 2072, 13097, 2290, 2427, 1001, 1001, 1001, 1001, 3570, 3970, 1001, 1001, 1001, 1001, 2429, 2000, 2248, 3269, 3415, 5950, 1001, 1001, 1001, 1001, 2405, 1999, 19701, 1001, 1001, 1001, 1001, 2434, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# Cyrtopodium woodfordii Sims SPECIES #### Status SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Liliopsida/Asparagales/Orchidaceae/Eulophia/Eulophia alta/ Syn. Cyrtopodium woodfordii/README.md
Markdown
apache-2.0
184
[ 30522, 1001, 22330, 5339, 7361, 7716, 5007, 3536, 3877, 6137, 18135, 2427, 1001, 1001, 1001, 1001, 3570, 10675, 1001, 1001, 1001, 1001, 2429, 2000, 1996, 10161, 1997, 2166, 1010, 3822, 2254, 2249, 1001, 1001, 1001, 1001, 2405, 1999, 19701, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package play.modules.morphia.utils; import com.google.code.morphia.logging.Logr; import com.google.code.morphia.logging.LogrFactory; import com.google.code.morphia.logging.SilentLogger; public class SilentLogrFactory implements LogrFactory { @Override public Logr get(Class<?> c) { return new SilentLogger(); } }
jamesward/play-morphia
src/play/modules/morphia/utils/SilentLogrFactory.java
Java
apache-2.0
337
[ 30522, 7427, 2377, 1012, 14184, 1012, 22822, 21850, 2050, 1012, 21183, 12146, 1025, 12324, 4012, 1012, 8224, 1012, 3642, 1012, 22822, 21850, 2050, 1012, 15899, 1012, 8833, 2099, 1025, 12324, 30524, 8833, 12881, 18908, 10253, 1025, 12324, 4012...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
@ECHO OFF lein trampoline run -m clojure.main -e "(require '[cljs.repl :as repl]) (require '[ambly.core :as ambly]) (repl/repl (ambly/repl-env))"
domesticmouse/ambly
Clojure/script/repl.bat
Batchfile
epl-1.0
146
[ 30522, 1030, 9052, 2125, 26947, 2078, 12517, 18155, 3170, 2448, 1011, 1049, 18856, 29147, 5397, 1012, 2364, 1011, 1041, 1000, 1006, 5478, 1005, 1031, 18856, 22578, 1012, 16360, 2140, 1024, 2004, 16360, 2140, 1033, 1007, 1006, 5478, 1005, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
--- title: "Ny fiarahan'Andriamanitra" date: 30/03/2021 --- Mariho ireo teny voalohany indrindra nataon'Andriamanitra tamin'ny olombelona, na farafaharatsiny araka izay fisehony voalohany ao amin'ny Soratra Masina. Nampahafantarin'Andriamanitra azy ireo ny fahafahany mamorona, miteraka olona tahaka azy ireo ihany. Nasehony azy koa ny tany, ny voary, ary nasaina nameno, nampanompo, sy nanjaka taminy izy ireo. Natorony azy ireo koa ireo zava-maniry azon'izy ireo ihinanana. Raha fintinina izany ny voalazan'ny Baiboly dia mikasika ny fifandraisan'izy ireo amin'ny tontolo mísy azy sy ny fampiasany izany no teny voalohany nataon'Andriamanitra ho an'ny lehilahy sy ny vehivavy. `Inona no ambaran'ny Gen. 1:28,29 antsika mikasika ny fomba fijerin'Andriamanitra ny tontolo hita maso sy azo-tsapain-tanana? Mampiseho ve ireo andininy ireo fa misy ratsy ao amin'ny zavatra ara-materialy na ny fisitrahantsika izany? Inona no lesona azontsika raisina avy amin'ireo toe-javatra voalohany teo amin'ny tantaran'ny taranak'olombelona ireo, mikasika ny tokony ho fifandraisantsika amin'ny voary?` Amin'ireo teny ireo ihany koa Andriamanitra dia manao dingana voalohany amin'ny fifandraisana amin'ny olombelona. Miresaka amin'izy ireo Izy; manome toromarika azy, milaza aminy ny tokony hataony. Misy andraikitra ihany koa ao ambadik'ireo teny ireo. Nasain'Andriamanitra nifehy io voary mahatalanjona noforonin'ny Tenany io izy ireo. `Milaza ny Gen. 1:28 fa nitso-drano an'i Adama sy Eva Andriamanitra. Inona no hevitr'izany? Karazam-pifandraisana inona eo amin'izy ireo sy ny Mpahary azy no asehon'izany?` Ny firesak’Andriamanitra tamin'i Adama sy Eva dia toy ny amin'ny voary manan-tsaina izay afaka hanisy setriny ny hatsaram-panahiny sy afaka hifandray am-po Aminy. I Adama sy Eva koa, amin'ny maha-voary zanaka azy ireo, dia niankina tamin'ny fitahiana sy ny fiahian'llay Rainy Mpahary azy. Tsy nisy na inona na inona naha-mendrika azy ireo hahazo izay nomen'ny Mpahary azy. Nandray maimaimpoana zavatra izay tsy nisasarany izy ireo. `Rehefa mamaky ny momba ny famoronana ny lehilahy sy ny vehivavy talohan'ny nisian'ny fahotana isika, dia mahita santionany amin'ilay karazam-pifandraisana tian'Andriamanitra ifandraisana amintsika ankehitriny, dia amin'izao fotoana efa isian'ny fahotana izao. Avereno jerena ity lesona androany ity. Inona ireo hevitra mifanindran-dalana ao ka afaka hanampy antsika hahatakatra ny fomba mety ifandraisantsika Aminy, na dia amin'izao fahalavoana misy antsika izao aza?`
imasaru/sabbath-school-lessons
src/mg/2021-02/01/04.md
Markdown
mit
2,507
[ 30522, 1011, 1011, 1011, 2516, 1024, 1000, 6396, 19807, 10404, 2319, 1005, 1998, 25557, 7088, 6494, 1000, 3058, 1024, 2382, 1013, 6021, 1013, 25682, 1011, 1011, 1011, 16266, 6806, 20868, 8780, 2702, 2100, 29536, 23067, 4819, 2100, 27427, 66...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
jsonp({"cep":"54715620","logradouro":"Rua Louren\u00e7o Lucas Ribeiro","bairro":"Penedo","cidade":"S\u00e3o Louren\u00e7o da Mata","uf":"PE","estado":"Pernambuco"});
lfreneda/cepdb
api/v1/54715620.jsonp.js
JavaScript
cc0-1.0
166
[ 30522, 1046, 3385, 2361, 1006, 1063, 1000, 8292, 2361, 1000, 1024, 1000, 5139, 2581, 16068, 2575, 11387, 1000, 1010, 1000, 8833, 12173, 8162, 2080, 1000, 1024, 1000, 21766, 2050, 10223, 7389, 1032, 1057, 8889, 2063, 2581, 2080, 6326, 19395,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/** * @file KeyboardButtonTest.h * @brief Contains KeyboardButtonTest fixture * @author Khalin Yevhen * @version 0.0.1 * @date 28.09.17 */ #pragma once #include <gtest\gtest.h> #include "..\khalin04\KeyboardButton.h" #include "..\khalin04\KeyboardButton.cpp" /** * @brief Test fixture for using the same data * @author Khalin Yevhen */ class KeyboardButtonTest : public ::testing::Test { protected: virtual void SetUp() { btnForm = ButtonForm::RECTANGULAR; btnName = "ABC"; btnCode = 123; static KeyboardButton src(btnForm, btnCode, btnName); btn = &src; } ButtonForm btnForm; string btnName; int btnCode; KeyboardButton *btn; };
kit25a/se-cpp
khalin-yevhen/src/khalin04_tests/KeyboardButtonTest.h
C
mit
681
[ 30522, 1013, 1008, 1008, 1008, 1030, 5371, 9019, 8569, 15474, 22199, 1012, 1044, 1008, 1030, 4766, 3397, 9019, 8569, 15474, 22199, 15083, 1008, 1030, 3166, 1047, 8865, 30524, 1044, 1028, 1001, 2421, 1000, 1012, 1012, 1032, 1047, 8865, 2378,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h> #include <linux/io.h> #include <linux/delay.h> #include <linux/mutex.h> #include <linux/err.h> #include <linux/errno.h> #include <linux/cpufreq.h> #include <linux/cpu.h> #include <linux/regulator/consumer.h> #include <linux/iopoll.h> #include <asm/mach-types.h> #include <asm/cpu.h> #include <mach/board.h> #include <mach/msm_iomap.h> #include <mach/socinfo.h> #include <mach/msm-krait-l2-accessors.h> #include <mach/rpm-regulator.h> #include <mach/rpm-regulator-smd.h> #include <mach/msm_bus.h> #include <mach/msm_dcvs.h> #include "acpuclock.h" #include "acpuclock-krait.h" #include "avs.h" /* MUX source selects. */ #define PRI_SRC_SEL_SEC_SRC 0 #define PRI_SRC_SEL_HFPLL 1 #define PRI_SRC_SEL_HFPLL_DIV2 2 static DEFINE_MUTEX(driver_lock); static DEFINE_SPINLOCK(l2_lock); static struct drv_data drv; static unsigned long acpuclk_krait_get_rate(int cpu) { return drv.scalable[cpu].cur_speed->khz; } /* Select a source on the primary MUX. */ static void set_pri_clk_src(struct scalable *sc, u32 pri_src_sel) { u32 regval; regval = get_l2_indirect_reg(sc->l2cpmr_iaddr); regval &= ~0x3; regval |= (pri_src_sel & 0x3); set_l2_indirect_reg(sc->l2cpmr_iaddr, regval); /* Wait for switch to complete. */ mb(); udelay(1); } /* Select a source on the secondary MUX. */ static void __cpuinit set_sec_clk_src(struct scalable *sc, u32 sec_src_sel) { u32 regval; regval = get_l2_indirect_reg(sc->l2cpmr_iaddr); regval &= ~(0x3 << 2); regval |= ((sec_src_sel & 0x3) << 2); set_l2_indirect_reg(sc->l2cpmr_iaddr, regval); /* Wait for switch to complete. */ mb(); udelay(1); } static int enable_rpm_vreg(struct vreg *vreg) { int ret = 0; if (vreg->rpm_reg) { ret = rpm_regulator_enable(vreg->rpm_reg); if (ret) dev_err(drv.dev, "%s regulator enable failed (%d)\n", vreg->name, ret); } return ret; } static void disable_rpm_vreg(struct vreg *vreg) { int rc; if (vreg->rpm_reg) { rc = rpm_regulator_disable(vreg->rpm_reg); if (rc) dev_err(drv.dev, "%s regulator disable failed (%d)\n", vreg->name, rc); } } /* Enable an already-configured HFPLL. */ static void hfpll_enable(struct scalable *sc, bool skip_regulators) { if (!skip_regulators) { /* Enable regulators required by the HFPLL. */ enable_rpm_vreg(&sc->vreg[VREG_HFPLL_A]); enable_rpm_vreg(&sc->vreg[VREG_HFPLL_B]); } /* Disable PLL bypass mode. */ writel_relaxed(0x2, sc->hfpll_base + drv.hfpll_data->mode_offset); /* * H/W requires a 5us delay between disabling the bypass and * de-asserting the reset. Delay 10us just to be safe. */ mb(); udelay(10); /* De-assert active-low PLL reset. */ writel_relaxed(0x6, sc->hfpll_base + drv.hfpll_data->mode_offset); /* Wait for PLL to lock. */ if (drv.hfpll_data->has_lock_status) { u32 regval; readl_tight_poll(sc->hfpll_base + drv.hfpll_data->status_offset, regval, regval & BIT(16)); } else { mb(); udelay(60); } /* Enable PLL output. */ writel_relaxed(0x7, sc->hfpll_base + drv.hfpll_data->mode_offset); } /* Disable a HFPLL for power-savings or while it's being reprogrammed. */ static void hfpll_disable(struct scalable *sc, bool skip_regulators) { /* * Disable the PLL output, disable test mode, enable the bypass mode, * and assert the reset. */ writel_relaxed(0, sc->hfpll_base + drv.hfpll_data->mode_offset); if (!skip_regulators) { /* Remove voltage votes required by the HFPLL. */ disable_rpm_vreg(&sc->vreg[VREG_HFPLL_B]); disable_rpm_vreg(&sc->vreg[VREG_HFPLL_A]); } } /* Program the HFPLL rate. Assumes HFPLL is already disabled. */ static void hfpll_set_rate(struct scalable *sc, const struct core_speed *tgt_s) { void __iomem *base = sc->hfpll_base; u32 regval; writel_relaxed(tgt_s->pll_l_val, base + drv.hfpll_data->l_offset); if (drv.hfpll_data->has_user_reg) { regval = readl_relaxed(base + drv.hfpll_data->user_offset); if (tgt_s->pll_l_val <= drv.hfpll_data->low_vco_l_max) regval &= ~drv.hfpll_data->user_vco_mask; else regval |= drv.hfpll_data->user_vco_mask; writel_relaxed(regval, base + drv.hfpll_data->user_offset); } } /* Return the L2 speed that should be applied. */ static unsigned int compute_l2_level(struct scalable *sc, unsigned int vote_l) { unsigned int new_l = 0; int cpu; /* Find max L2 speed vote. */ sc->l2_vote = vote_l; for_each_present_cpu(cpu) new_l = max(new_l, drv.scalable[cpu].l2_vote); return new_l; } /* Update the bus bandwidth request. */ static void set_bus_bw(unsigned int bw) { int ret; /* Update bandwidth if request has changed. This may sleep. */ ret = msm_bus_scale_client_update_request(drv.bus_perf_client, bw); if (ret) dev_err(drv.dev, "bandwidth request failed (%d)\n", ret); } /* Set the CPU or L2 clock speed. */ static void set_speed(struct scalable *sc, const struct core_speed *tgt_s, bool skip_regulators) { const struct core_speed *strt_s = sc->cur_speed; if (strt_s == tgt_s) return; if (strt_s->src == HFPLL && tgt_s->src == HFPLL) { /* * Move to an always-on source running at a frequency * that does not require an elevated CPU voltage. */ set_pri_clk_src(sc, PRI_SRC_SEL_SEC_SRC); /* Re-program HFPLL. */ hfpll_disable(sc, true); hfpll_set_rate(sc, tgt_s); hfpll_enable(sc, true); /* Move to HFPLL. */ set_pri_clk_src(sc, tgt_s->pri_src_sel); } else if (strt_s->src == HFPLL && tgt_s->src != HFPLL) { set_pri_clk_src(sc, tgt_s->pri_src_sel); hfpll_disable(sc, skip_regulators); } else if (strt_s->src != HFPLL && tgt_s->src == HFPLL) { hfpll_set_rate(sc, tgt_s); hfpll_enable(sc, skip_regulators); set_pri_clk_src(sc, tgt_s->pri_src_sel); } sc->cur_speed = tgt_s; } struct vdd_data { int vdd_mem; int vdd_dig; int vdd_core; int ua_core; }; /* Apply any per-cpu voltage increases. */ static int increase_vdd(int cpu, struct vdd_data *data, enum setrate_reason reason) { struct scalable *sc = &drv.scalable[cpu]; int rc; /* * Increase vdd_mem active-set before vdd_dig. * vdd_mem should be >= vdd_dig. */ if (data->vdd_mem > sc->vreg[VREG_MEM].cur_vdd) { rc = rpm_regulator_set_voltage(sc->vreg[VREG_MEM].rpm_reg, data->vdd_mem, sc->vreg[VREG_MEM].max_vdd); if (rc) { dev_err(drv.dev, "vdd_mem (cpu%d) increase failed (%d)\n", cpu, rc); return rc; } sc->vreg[VREG_MEM].cur_vdd = data->vdd_mem; } /* Increase vdd_dig active-set vote. */ if (data->vdd_dig > sc->vreg[VREG_DIG].cur_vdd) { rc = rpm_regulator_set_voltage(sc->vreg[VREG_DIG].rpm_reg, data->vdd_dig, sc->vreg[VREG_DIG].max_vdd); if (rc) { dev_err(drv.dev, "vdd_dig (cpu%d) increase failed (%d)\n", cpu, rc); return rc; } sc->vreg[VREG_DIG].cur_vdd = data->vdd_dig; } /* Increase current request. */ if (data->ua_core > sc->vreg[VREG_CORE].cur_ua) { rc = regulator_set_optimum_mode(sc->vreg[VREG_CORE].reg, data->ua_core); if (rc < 0) { dev_err(drv.dev, "regulator_set_optimum_mode(%s) failed (%d)\n", sc->vreg[VREG_CORE].name, rc); return rc; } sc->vreg[VREG_CORE].cur_ua = data->ua_core; } /* * Update per-CPU core voltage. Don't do this for the hotplug path for * which it should already be correct. Attempting to set it is bad * because we don't know what CPU we are running on at this point, but * the CPU regulator API requires we call it from the affected CPU. */ if (data->vdd_core > sc->vreg[VREG_CORE].cur_vdd && reason != SETRATE_HOTPLUG) { rc = regulator_set_voltage(sc->vreg[VREG_CORE].reg, data->vdd_core, sc->vreg[VREG_CORE].max_vdd); if (rc) { dev_err(drv.dev, "vdd_core (cpu%d) increase failed (%d)\n", cpu, rc); return rc; } sc->vreg[VREG_CORE].cur_vdd = data->vdd_core; } return 0; } /* Apply any per-cpu voltage decreases. */ static void decrease_vdd(int cpu, struct vdd_data *data, enum setrate_reason reason) { struct scalable *sc = &drv.scalable[cpu]; int ret; /* * Update per-CPU core voltage. This must be called on the CPU * that's being affected. Don't do this in the hotplug remove path, * where the rail is off and we're executing on the other CPU. */ if (data->vdd_core < sc->vreg[VREG_CORE].cur_vdd && reason != SETRATE_HOTPLUG) { ret = regulator_set_voltage(sc->vreg[VREG_CORE].reg, data->vdd_core, sc->vreg[VREG_CORE].max_vdd); if (ret) { dev_err(drv.dev, "vdd_core (cpu%d) decrease failed (%d)\n", cpu, ret); return; } sc->vreg[VREG_CORE].cur_vdd = data->vdd_core; } /* Decrease current request. */ if (data->ua_core < sc->vreg[VREG_CORE].cur_ua) { ret = regulator_set_optimum_mode(sc->vreg[VREG_CORE].reg, data->ua_core); if (ret < 0) { dev_err(drv.dev, "regulator_set_optimum_mode(%s) failed (%d)\n", sc->vreg[VREG_CORE].name, ret); return; } sc->vreg[VREG_CORE].cur_ua = data->ua_core; } /* Decrease vdd_dig active-set vote. */ if (data->vdd_dig < sc->vreg[VREG_DIG].cur_vdd) { ret = rpm_regulator_set_voltage(sc->vreg[VREG_DIG].rpm_reg, data->vdd_dig, sc->vreg[VREG_DIG].max_vdd); if (ret) { dev_err(drv.dev, "vdd_dig (cpu%d) decrease failed (%d)\n", cpu, ret); return; } sc->vreg[VREG_DIG].cur_vdd = data->vdd_dig; } /* * Decrease vdd_mem active-set after vdd_dig. * vdd_mem should be >= vdd_dig. */ if (data->vdd_mem < sc->vreg[VREG_MEM].cur_vdd) { ret = rpm_regulator_set_voltage(sc->vreg[VREG_MEM].rpm_reg, data->vdd_mem, sc->vreg[VREG_MEM].max_vdd); if (ret) { dev_err(drv.dev, "vdd_mem (cpu%d) decrease failed (%d)\n", cpu, ret); return; } sc->vreg[VREG_MEM].cur_vdd = data->vdd_mem; } } static int calculate_vdd_mem(const struct acpu_level *tgt) { return drv.l2_freq_tbl[tgt->l2_level].vdd_mem; } static int get_src_dig(const struct core_speed *s) { const int *hfpll_vdd = drv.hfpll_data->vdd; const u32 low_vdd_l_max = drv.hfpll_data->low_vdd_l_max; const u32 nom_vdd_l_max = drv.hfpll_data->nom_vdd_l_max; if (s->src != HFPLL) return hfpll_vdd[HFPLL_VDD_NONE]; else if (s->pll_l_val > nom_vdd_l_max) return hfpll_vdd[HFPLL_VDD_HIGH]; else if (s->pll_l_val > low_vdd_l_max) return hfpll_vdd[HFPLL_VDD_NOM]; else return hfpll_vdd[HFPLL_VDD_LOW]; } static int calculate_vdd_dig(const struct acpu_level *tgt) { int l2_pll_vdd_dig, cpu_pll_vdd_dig; l2_pll_vdd_dig = get_src_dig(&drv.l2_freq_tbl[tgt->l2_level].speed); cpu_pll_vdd_dig = get_src_dig(&tgt->speed); return max(drv.l2_freq_tbl[tgt->l2_level].vdd_dig, max(l2_pll_vdd_dig, cpu_pll_vdd_dig)); } static bool enable_boost = true; module_param_named(boost, enable_boost, bool, S_IRUGO | S_IWUSR); static int calculate_vdd_core(const struct acpu_level *tgt) { return tgt->vdd_core + (enable_boost ? drv.boost_uv : 0); } static DEFINE_MUTEX(l2_regulator_lock); static int l2_vreg_count; static int enable_l2_regulators(void) { int ret = 0; mutex_lock(&l2_regulator_lock); if (l2_vreg_count == 0) { ret = enable_rpm_vreg(&drv.scalable[L2].vreg[VREG_HFPLL_A]); if (ret) goto out; ret = enable_rpm_vreg(&drv.scalable[L2].vreg[VREG_HFPLL_B]); if (ret) { disable_rpm_vreg(&drv.scalable[L2].vreg[VREG_HFPLL_A]); goto out; } } l2_vreg_count++; out: mutex_unlock(&l2_regulator_lock); return ret; } static void disable_l2_regulators(void) { mutex_lock(&l2_regulator_lock); if (WARN(!l2_vreg_count, "L2 regulator votes are unbalanced!")) goto out; if (l2_vreg_count == 1) { disable_rpm_vreg(&drv.scalable[L2].vreg[VREG_HFPLL_B]); disable_rpm_vreg(&drv.scalable[L2].vreg[VREG_HFPLL_A]); } l2_vreg_count--; out: mutex_unlock(&l2_regulator_lock); } /* Set the CPU's clock rate and adjust the L2 rate, voltage and BW requests. */ static int acpuclk_krait_set_rate(int cpu, unsigned long rate, enum setrate_reason reason) { const struct core_speed *strt_acpu_s, *tgt_acpu_s; const struct acpu_level *tgt; int tgt_l2_l; enum src_id prev_l2_src = NUM_SRC_ID; struct vdd_data vdd_data; bool skip_regulators; int rc = 0; if (cpu > num_possible_cpus()) return -EINVAL; if (reason == SETRATE_CPUFREQ || reason == SETRATE_HOTPLUG) mutex_lock(&driver_lock); strt_acpu_s = drv.scalable[cpu].cur_speed; /* Return early if rate didn't change. */ if (rate == strt_acpu_s->khz) goto out; /* Find target frequency. */ for (tgt = drv.acpu_freq_tbl; tgt->speed.khz != 0; tgt++) { if (tgt->speed.khz == rate) { tgt_acpu_s = &tgt->speed; break; } } if (tgt->speed.khz == 0) { rc = -EINVAL; goto out; } /* Calculate voltage requirements for the current CPU. */ vdd_data.vdd_mem = calculate_vdd_mem(tgt); vdd_data.vdd_dig = calculate_vdd_dig(tgt); vdd_data.vdd_core = calculate_vdd_core(tgt); vdd_data.ua_core = tgt->ua_core; /* Disable AVS before voltage switch */ if (reason == SETRATE_CPUFREQ && drv.scalable[cpu].avs_enabled) { AVS_DISABLE(cpu); drv.scalable[cpu].avs_enabled = false; } /* Increase VDD levels if needed. */ if (reason == SETRATE_CPUFREQ || reason == SETRATE_HOTPLUG) { rc = increase_vdd(cpu, &vdd_data, reason); if (rc) goto out; prev_l2_src = drv.l2_freq_tbl[drv.scalable[cpu].l2_vote].speed.src; /* Vote for the L2 regulators here if necessary. */ if (drv.l2_freq_tbl[tgt->l2_level].speed.src == HFPLL) { rc = enable_l2_regulators(); if (rc) goto out; } } dev_dbg(drv.dev, "Switching from ACPU%d rate %lu KHz -> %lu KHz\n", cpu, strt_acpu_s->khz, tgt_acpu_s->khz); /* * If we are setting the rate as part of power collapse or in the resume * path after power collapse, skip the vote for the HFPLL regulators, * which are active-set-only votes that will be removed when apps enters * its sleep set. This is needed to avoid voting for regulators with * sleeping APIs from an atomic context. */ skip_regulators = (reason == SETRATE_PC); /* Set the new CPU speed. */ set_speed(&drv.scalable[cpu], tgt_acpu_s, skip_regulators); /* * Update the L2 vote and apply the rate change. A spinlock is * necessary to ensure L2 rate is calculated and set atomically * with the CPU frequency, even if acpuclk_krait_set_rate() is * called from an atomic context and the driver_lock mutex is not * acquired. */ spin_lock(&l2_lock); tgt_l2_l = compute_l2_level(&drv.scalable[cpu], tgt->l2_level); set_speed(&drv.scalable[L2], &drv.l2_freq_tbl[tgt_l2_l].speed, true); spin_unlock(&l2_lock); /* Nothing else to do for power collapse or SWFI. */ if (reason == SETRATE_PC || reason == SETRATE_SWFI) goto out; /* * Remove the vote for the L2 HFPLL regulators only if the L2 * was already on an HFPLL source. */ if (prev_l2_src == HFPLL) disable_l2_regulators(); /* Update bus bandwith request. */ set_bus_bw(drv.l2_freq_tbl[tgt_l2_l].bw_level); /* Drop VDD levels if we can. */ decrease_vdd(cpu, &vdd_data, reason); /* Re-enable AVS */ if (reason == SETRATE_CPUFREQ && tgt->avsdscr_setting) { AVS_ENABLE(cpu, tgt->avsdscr_setting); drv.scalable[cpu].avs_enabled = true; } dev_dbg(drv.dev, "ACPU%d speed change complete\n", cpu); out: if (reason == SETRATE_CPUFREQ || reason == SETRATE_HOTPLUG) mutex_unlock(&driver_lock); return rc; } static struct acpuclk_data acpuclk_krait_data = { .set_rate = acpuclk_krait_set_rate, .get_rate = acpuclk_krait_get_rate, }; /* Initialize a HFPLL at a given rate and enable it. */ static void __cpuinit hfpll_init(struct scalable *sc, const struct core_speed *tgt_s) { dev_dbg(drv.dev, "Initializing HFPLL%d\n", sc - drv.scalable); /* Disable the PLL for re-programming. */ hfpll_disable(sc, true); /* Configure PLL parameters for integer mode. */ writel_relaxed(drv.hfpll_data->config_val, sc->hfpll_base + drv.hfpll_data->config_offset); writel_relaxed(0, sc->hfpll_base + drv.hfpll_data->m_offset); writel_relaxed(1, sc->hfpll_base + drv.hfpll_data->n_offset); if (drv.hfpll_data->has_user_reg) writel_relaxed(drv.hfpll_data->user_val, sc->hfpll_base + drv.hfpll_data->user_offset); /* Program droop controller, if supported */ if (drv.hfpll_data->has_droop_ctl) writel_relaxed(drv.hfpll_data->droop_val, sc->hfpll_base + drv.hfpll_data->droop_offset); /* Set an initial PLL rate. */ hfpll_set_rate(sc, tgt_s); } static int __cpuinit rpm_regulator_init(struct scalable *sc, enum vregs vreg, int vdd, bool enable) { int ret; if (!sc->vreg[vreg].name) return 0; sc->vreg[vreg].rpm_reg = rpm_regulator_get(drv.dev, sc->vreg[vreg].name); if (IS_ERR(sc->vreg[vreg].rpm_reg)) { ret = PTR_ERR(sc->vreg[vreg].rpm_reg); dev_err(drv.dev, "rpm_regulator_get(%s) failed (%d)\n", sc->vreg[vreg].name, ret); goto err_get; } ret = rpm_regulator_set_voltage(sc->vreg[vreg].rpm_reg, vdd, sc->vreg[vreg].max_vdd); if (ret) { dev_err(drv.dev, "%s initialization failed (%d)\n", sc->vreg[vreg].name, ret); goto err_conf; } sc->vreg[vreg].cur_vdd = vdd; if (enable) { ret = enable_rpm_vreg(&sc->vreg[vreg]); if (ret) goto err_conf; } return 0; err_conf: rpm_regulator_put(sc->vreg[vreg].rpm_reg); err_get: return ret; } static void __cpuinit rpm_regulator_cleanup(struct scalable *sc, enum vregs vreg) { if (!sc->vreg[vreg].rpm_reg) return; disable_rpm_vreg(&sc->vreg[vreg]); rpm_regulator_put(sc->vreg[vreg].rpm_reg); } /* Voltage regulator initialization. */ static int __cpuinit regulator_init(struct scalable *sc, const struct acpu_level *acpu_level) { int ret, vdd_mem, vdd_dig, vdd_core; vdd_mem = calculate_vdd_mem(acpu_level); ret = rpm_regulator_init(sc, VREG_MEM, vdd_mem, true); if (ret) goto err_mem; vdd_dig = calculate_vdd_dig(acpu_level); ret = rpm_regulator_init(sc, VREG_DIG, vdd_dig, true); if (ret) goto err_dig; ret = rpm_regulator_init(sc, VREG_HFPLL_A, sc->vreg[VREG_HFPLL_A].max_vdd, false); if (ret) goto err_hfpll_a; ret = rpm_regulator_init(sc, VREG_HFPLL_B, sc->vreg[VREG_HFPLL_B].max_vdd, false); if (ret) goto err_hfpll_b; /* Setup Krait CPU regulators and initial core voltage. */ sc->vreg[VREG_CORE].reg = regulator_get(drv.dev, sc->vreg[VREG_CORE].name); if (IS_ERR(sc->vreg[VREG_CORE].reg)) { ret = PTR_ERR(sc->vreg[VREG_CORE].reg); dev_err(drv.dev, "regulator_get(%s) failed (%d)\n", sc->vreg[VREG_CORE].name, ret); goto err_core_get; } ret = regulator_set_optimum_mode(sc->vreg[VREG_CORE].reg, acpu_level->ua_core); if (ret < 0) { dev_err(drv.dev, "regulator_set_optimum_mode(%s) failed (%d)\n", sc->vreg[VREG_CORE].name, ret); goto err_core_conf; } sc->vreg[VREG_CORE].cur_ua = acpu_level->ua_core; vdd_core = calculate_vdd_core(acpu_level); ret = regulator_set_voltage(sc->vreg[VREG_CORE].reg, vdd_core, sc->vreg[VREG_CORE].max_vdd); if (ret) { dev_err(drv.dev, "regulator_set_voltage(%s) (%d)\n", sc->vreg[VREG_CORE].name, ret); goto err_core_conf; } sc->vreg[VREG_CORE].cur_vdd = vdd_core; ret = regulator_enable(sc->vreg[VREG_CORE].reg); if (ret) { dev_err(drv.dev, "regulator_enable(%s) failed (%d)\n", sc->vreg[VREG_CORE].name, ret); goto err_core_conf; } /* * Increment the L2 HFPLL regulator refcount if _this_ CPU's frequency * requires a corresponding target L2 frequency that needs the L2 to * run off of an HFPLL. */ if (drv.l2_freq_tbl[acpu_level->l2_level].speed.src == HFPLL) l2_vreg_count++; return 0; err_core_conf: regulator_put(sc->vreg[VREG_CORE].reg); err_core_get: rpm_regulator_cleanup(sc, VREG_HFPLL_B); err_hfpll_b: rpm_regulator_cleanup(sc, VREG_HFPLL_A); err_hfpll_a: rpm_regulator_cleanup(sc, VREG_DIG); err_dig: rpm_regulator_cleanup(sc, VREG_MEM); err_mem: return ret; } static void __cpuinit regulator_cleanup(struct scalable *sc) { regulator_disable(sc->vreg[VREG_CORE].reg); regulator_put(sc->vreg[VREG_CORE].reg); rpm_regulator_cleanup(sc, VREG_HFPLL_B); rpm_regulator_cleanup(sc, VREG_HFPLL_A); rpm_regulator_cleanup(sc, VREG_DIG); rpm_regulator_cleanup(sc, VREG_MEM); } /* Set initial rate for a given core. */ static int __cpuinit init_clock_sources(struct scalable *sc, const struct core_speed *tgt_s) { u32 regval; void __iomem *aux_reg; /* Program AUX source input to the secondary MUX. */ if (sc->aux_clk_sel_phys) { aux_reg = ioremap(sc->aux_clk_sel_phys, 4); if (!aux_reg) return -ENOMEM; writel_relaxed(sc->aux_clk_sel, aux_reg); iounmap(aux_reg); } /* Switch away from the HFPLL while it's re-initialized. */ set_sec_clk_src(sc, sc->sec_clk_sel); set_pri_clk_src(sc, PRI_SRC_SEL_SEC_SRC); hfpll_init(sc, tgt_s); /* Set PRI_SRC_SEL_HFPLL_DIV2 divider to div-2. */ regval = get_l2_indirect_reg(sc->l2cpmr_iaddr); regval &= ~(0x3 << 6); set_l2_indirect_reg(sc->l2cpmr_iaddr, regval); /* Enable and switch to the target clock source. */ if (tgt_s->src == HFPLL) hfpll_enable(sc, false); set_pri_clk_src(sc, tgt_s->pri_src_sel); sc->cur_speed = tgt_s; return 0; } static void __cpuinit fill_cur_core_speed(struct core_speed *s, struct scalable *sc) { s->pri_src_sel = get_l2_indirect_reg(sc->l2cpmr_iaddr) & 0x3; s->pll_l_val = readl_relaxed(sc->hfpll_base + drv.hfpll_data->l_offset); } static bool __cpuinit speed_equal(const struct core_speed *s1, const struct core_speed *s2) { return (s1->pri_src_sel == s2->pri_src_sel && s1->pll_l_val == s2->pll_l_val); } static const struct acpu_level __cpuinit *find_cur_acpu_level(int cpu) { struct scalable *sc = &drv.scalable[cpu]; const struct acpu_level *l; struct core_speed cur_speed; fill_cur_core_speed(&cur_speed, sc); for (l = drv.acpu_freq_tbl; l->speed.khz != 0; l++) if (speed_equal(&l->speed, &cur_speed)) return l; return NULL; } static const struct l2_level __init *find_cur_l2_level(void) { struct scalable *sc = &drv.scalable[L2]; const struct l2_level *l; struct core_speed cur_speed; fill_cur_core_speed(&cur_speed, sc); for (l = drv.l2_freq_tbl; l->speed.khz != 0; l++) if (speed_equal(&l->speed, &cur_speed)) return l; return NULL; } static const struct acpu_level __cpuinit *find_min_acpu_level(void) { struct acpu_level *l; for (l = drv.acpu_freq_tbl; l->speed.khz != 0; l++) if (l->use_for_scaling) return l; return NULL; } static int __cpuinit per_cpu_init(int cpu) { struct scalable *sc = &drv.scalable[cpu]; const struct acpu_level *acpu_level; int ret; sc->hfpll_base = ioremap(sc->hfpll_phys_base, SZ_32); if (!sc->hfpll_base) { ret = -ENOMEM; goto err_ioremap; } acpu_level = find_cur_acpu_level(cpu); if (!acpu_level) { acpu_level = find_min_acpu_level(); if (!acpu_level) { ret = -ENODEV; goto err_table; } dev_dbg(drv.dev, "CPU%d is running at an unknown rate. Defaulting to %lu KHz.\n", cpu, acpu_level->speed.khz); } else { dev_dbg(drv.dev, "CPU%d is running at %lu KHz\n", cpu, acpu_level->speed.khz); } ret = regulator_init(sc, acpu_level); if (ret) goto err_regulators; ret = init_clock_sources(sc, &acpu_level->speed); if (ret) goto err_clocks; sc->l2_vote = acpu_level->l2_level; sc->initialized = true; return 0; err_clocks: regulator_cleanup(sc); err_regulators: err_table: iounmap(sc->hfpll_base); err_ioremap: return ret; } /* Register with bus driver. */ static void __init bus_init(const struct l2_level *l2_level) { int ret; drv.bus_perf_client = msm_bus_scale_register_client(drv.bus_scale); if (!drv.bus_perf_client) { dev_err(drv.dev, "unable to register bus client\n"); BUG(); } ret = msm_bus_scale_client_update_request(drv.bus_perf_client, l2_level->bw_level); if (ret) dev_err(drv.dev, "initial bandwidth req failed (%d)\n", ret); } #ifdef CONFIG_CPU_FREQ_MSM static struct cpufreq_frequency_table freq_table[NR_CPUS][35]; static void __init cpufreq_table_init(void) { int cpu; int freq_cnt = 0; for_each_possible_cpu(cpu) { int i; /* Construct the freq_table tables from acpu_freq_tbl. */ for (i = 0, freq_cnt = 0; drv.acpu_freq_tbl[i].speed.khz != 0 && freq_cnt < ARRAY_SIZE(*freq_table)-1; i++) { if (drv.acpu_freq_tbl[i].use_for_scaling) { freq_table[cpu][freq_cnt].index = freq_cnt; freq_table[cpu][freq_cnt].frequency = drv.acpu_freq_tbl[i].speed.khz; freq_cnt++; } } /* freq_table not big enough to store all usable freqs. */ BUG_ON(drv.acpu_freq_tbl[i].speed.khz != 0); freq_table[cpu][freq_cnt].index = freq_cnt; freq_table[cpu][freq_cnt].frequency = CPUFREQ_TABLE_END; /* Register table with CPUFreq. */ cpufreq_frequency_table_get_attr(freq_table[cpu], cpu); } dev_info(drv.dev, "CPU Frequencies Supported: %d\n", freq_cnt); } #else static void __init cpufreq_table_init(void) {} #endif static void __init dcvs_freq_init(void) { int i; for (i = 0; drv.acpu_freq_tbl[i].speed.khz != 0; i++) if (drv.acpu_freq_tbl[i].use_for_scaling) msm_dcvs_register_cpu_freq( drv.acpu_freq_tbl[i].speed.khz, drv.acpu_freq_tbl[i].vdd_core / 1000); } static int __cpuinit acpuclk_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) { static int prev_khz[NR_CPUS]; int rc, cpu = (int)hcpu; struct scalable *sc = &drv.scalable[cpu]; unsigned long hot_unplug_khz = acpuclk_krait_data.power_collapse_khz; switch (action & ~CPU_TASKS_FROZEN) { case CPU_DEAD: prev_khz[cpu] = acpuclk_krait_get_rate(cpu); /* Fall through. */ case CPU_UP_CANCELED: acpuclk_krait_set_rate(cpu, hot_unplug_khz, SETRATE_HOTPLUG); regulator_disable(sc->vreg[VREG_CORE].reg); regulator_set_optimum_mode(sc->vreg[VREG_CORE].reg, 0); regulator_set_voltage(sc->vreg[VREG_CORE].reg, 0, sc->vreg[VREG_CORE].max_vdd); break; case CPU_UP_PREPARE: if (!sc->initialized) { rc = per_cpu_init(cpu); if (rc) return NOTIFY_BAD; break; } if (WARN_ON(!prev_khz[cpu])) return NOTIFY_BAD; rc = regulator_set_voltage(sc->vreg[VREG_CORE].reg, sc->vreg[VREG_CORE].cur_vdd, sc->vreg[VREG_CORE].max_vdd); if (rc < 0) return NOTIFY_BAD; rc = regulator_set_optimum_mode(sc->vreg[VREG_CORE].reg, sc->vreg[VREG_CORE].cur_ua); if (rc < 0) return NOTIFY_BAD; rc = regulator_enable(sc->vreg[VREG_CORE].reg); if (rc < 0) return NOTIFY_BAD; acpuclk_krait_set_rate(cpu, prev_khz[cpu], SETRATE_HOTPLUG); break; default: break; } return NOTIFY_OK; } static struct notifier_block __cpuinitdata acpuclk_cpu_notifier = { .notifier_call = acpuclk_cpu_callback, }; static const int __init krait_needs_vmin(void) { switch (read_cpuid_id()) { case 0x511F04D0: /* KR28M2A20 */ case 0x511F04D1: /* KR28M2A21 */ case 0x510F06F0: /* KR28M4A10 */ return 1; default: return 0; }; } static void __init krait_apply_vmin(struct acpu_level *tbl) { for (; tbl->speed.khz != 0; tbl++) { if (tbl->vdd_core < 1150000) tbl->vdd_core = 1150000; tbl->avsdscr_setting = 0; } } void __init get_krait_bin_format_a(void __iomem *base, struct bin_info *bin) { u32 pte_efuse = readl_relaxed(base); bin->speed = pte_efuse & 0xF; if (bin->speed == 0xF) bin->speed = (pte_efuse >> 4) & 0xF; bin->speed_valid = bin->speed != 0xF; bin->pvs = (pte_efuse >> 10) & 0x7; if (bin->pvs == 0x7) bin->pvs = (pte_efuse >> 13) & 0x7; bin->pvs_valid = bin->pvs != 0x7; } void __init get_krait_bin_format_b(void __iomem *base, struct bin_info *bin) { u32 pte_efuse, redundant_sel; pte_efuse = readl_relaxed(base); redundant_sel = (pte_efuse >> 24) & 0x7; bin->speed = pte_efuse & 0x7; bin->pvs = (pte_efuse >> 6) & 0x7; switch (redundant_sel) { case 1: bin->speed = (pte_efuse >> 27) & 0x7; break; case 2: bin->pvs = (pte_efuse >> 27) & 0x7; break; } bin->speed_valid = true; /* Check PVS_BLOW_STATUS */ pte_efuse = readl_relaxed(base + 0x4); bin->pvs_valid = !!(pte_efuse & BIT(21)); } static struct pvs_table * __init select_freq_plan( const struct acpuclk_krait_params *params) { void __iomem *pte_efuse_base; struct bin_info bin; pte_efuse_base = ioremap(params->pte_efuse_phys, 8); if (!pte_efuse_base) { dev_err(drv.dev, "Unable to map PTE eFuse base\n"); return NULL; } params->get_bin_info(pte_efuse_base, &bin); iounmap(pte_efuse_base); if (bin.speed_valid) { drv.speed_bin = bin.speed; dev_info(drv.dev, "SPEED BIN: %d\n", drv.speed_bin); } else { drv.speed_bin = 0; dev_warn(drv.dev, "SPEED BIN: Defaulting to %d\n", drv.speed_bin); } if (bin.pvs_valid) { drv.pvs_bin = bin.pvs; dev_info(drv.dev, "ACPU PVS: %d\n", drv.pvs_bin); } else { drv.pvs_bin = 0; dev_warn(drv.dev, "ACPU PVS: Defaulting to %d\n", drv.pvs_bin); } return &params->pvs_tables[drv.speed_bin][drv.pvs_bin]; } static void __init drv_data_init(struct device *dev, const struct acpuclk_krait_params *params) { struct pvs_table *pvs; drv.dev = dev; drv.scalable = kmemdup(params->scalable, params->scalable_size, GFP_KERNEL); BUG_ON(!drv.scalable); drv.hfpll_data = kmemdup(params->hfpll_data, sizeof(*drv.hfpll_data), GFP_KERNEL); BUG_ON(!drv.hfpll_data); drv.l2_freq_tbl = kmemdup(params->l2_freq_tbl, params->l2_freq_tbl_size, GFP_KERNEL); BUG_ON(!drv.l2_freq_tbl); drv.bus_scale = kmemdup(params->bus_scale, sizeof(*drv.bus_scale), GFP_KERNEL); BUG_ON(!drv.bus_scale); drv.bus_scale->usecase = kmemdup(drv.bus_scale->usecase, drv.bus_scale->num_usecases * sizeof(*drv.bus_scale->usecase), GFP_KERNEL); BUG_ON(!drv.bus_scale->usecase); pvs = select_freq_plan(params); BUG_ON(!pvs->table); drv.acpu_freq_tbl = kmemdup(pvs->table, pvs->size, GFP_KERNEL); BUG_ON(!drv.acpu_freq_tbl); drv.boost_uv = pvs->boost_uv; acpuclk_krait_data.power_collapse_khz = params->stby_khz; acpuclk_krait_data.wait_for_irq_khz = params->stby_khz; } static void __init hw_init(void) { struct scalable *l2 = &drv.scalable[L2]; const struct l2_level *l2_level; int cpu, rc; if (krait_needs_vmin()) krait_apply_vmin(drv.acpu_freq_tbl); l2->hfpll_base = ioremap(l2->hfpll_phys_base, SZ_32); BUG_ON(!l2->hfpll_base); rc = rpm_regulator_init(l2, VREG_HFPLL_A, l2->vreg[VREG_HFPLL_A].max_vdd, false); BUG_ON(rc); rc = rpm_regulator_init(l2, VREG_HFPLL_B, l2->vreg[VREG_HFPLL_B].max_vdd, false); BUG_ON(rc); l2_level = find_cur_l2_level(); if (!l2_level) { l2_level = drv.l2_freq_tbl; dev_dbg(drv.dev, "L2 is running at an unknown rate. Defaulting to %lu KHz.\n", l2_level->speed.khz); } else { dev_dbg(drv.dev, "L2 is running at %lu KHz\n", l2_level->speed.khz); } rc = init_clock_sources(l2, &l2_level->speed); BUG_ON(rc); for_each_online_cpu(cpu) { rc = per_cpu_init(cpu); BUG_ON(rc); } bus_init(l2_level); } int __init acpuclk_krait_init(struct device *dev, const struct acpuclk_krait_params *params) { drv_data_init(dev, params); hw_init(); cpufreq_table_init(); dcvs_freq_init(); acpuclk_register(&acpuclk_krait_data); register_hotcpu_notifier(&acpuclk_cpu_notifier); acpuclk_krait_debug_init(&drv); return 0; }
mdmower/android_kernel_htc_msm8960
arch/arm/mach-msm/acpuclock-krait.c
C
gpl-2.0
31,405
[ 30522, 1013, 1008, 1008, 9385, 1006, 1039, 1007, 2249, 1011, 2286, 1010, 1996, 11603, 3192, 1012, 2035, 2916, 9235, 1012, 1008, 1008, 2023, 2565, 2003, 2489, 4007, 1025, 2017, 2064, 2417, 2923, 3089, 8569, 2618, 2009, 1998, 1013, 2030, 19...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package com.InfinityRaider.AgriCraft.handler; import com.InfinityRaider.AgriCraft.blocks.BlockCrop; import com.InfinityRaider.AgriCraft.tileentity.TileEntityCrop; import cpw.mods.fml.common.eventhandler.Event; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.event.entity.player.BonemealEvent; import java.util.Random; //a class to handle bonemeal events public class BonemealEventHandler { @SubscribeEvent public void onBonemealEvent(BonemealEvent event) { if (event.block instanceof BlockCrop) { TileEntityCrop crop = (TileEntityCrop) event.world.getTileEntity(event.x, event.y, event.z); if((crop.hasPlant() && crop.getBlockMetadata()<7) || (crop.crossCrop && ConfigurationHandler.bonemealMutation)) { ((BlockCrop) event.world.getBlock(event.x, event.y, event.z)).func_149853_b(event.world, new Random(), event.x, event.y, event.z); event.setResult(Event.Result.ALLOW); } else { event.setCanceled(true); event.setResult(Event.Result.DENY); } } } }
Mazdallier/AgriCraft
src/main/java/com/InfinityRaider/AgriCraft/handler/BonemealEventHandler.java
Java
mit
1,127
[ 30522, 7427, 30524, 12943, 7277, 27528, 2102, 1012, 5991, 1012, 3796, 26775, 7361, 1025, 12324, 4012, 1012, 15579, 14995, 4063, 1012, 12943, 7277, 27528, 2102, 1012, 14090, 4765, 3012, 1012, 14090, 4765, 3012, 26775, 7361, 1025, 12324, 18133,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* Byte-wise substring search, using the Two-Way algorithm. * Copyright (C) 2008 Eric Blake * Permission to use, copy, modify, and distribute this software * is freely granted, provided that this notice is preserved. */ /* FUNCTION <<memmem>>---find memory segment INDEX memmem ANSI_SYNOPSIS #include <string.h> char *memmem(const void *<[s1]>, size_t <[l1]>, const void *<[s2]>, size_t <[l2]>); DESCRIPTION Locates the first occurrence in the memory region pointed to by <[s1]> with length <[l1]> of the sequence of bytes pointed to by <[s2]> of length <[l2]>. If you already know the lengths of your haystack and needle, <<memmem>> can be much faster than <<strstr>>. RETURNS Returns a pointer to the located segment, or a null pointer if <[s2]> is not found. If <[l2]> is 0, <[s1]> is returned. PORTABILITY <<memmem>> is a newlib extension. <<memmem>> requires no supporting OS subroutines. QUICKREF memmem pure */ #include <string.h> #if !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__) # define RETURN_TYPE void * # define AVAILABLE(h, h_l, j, n_l) ((j) <= (h_l) - (n_l)) # include "str-two-way.h" #endif void * _DEFUN (memmem, (haystack_start, haystack_len, needle_start, needle_len), const void *haystack_start _AND size_t haystack_len _AND const void *needle_start _AND size_t needle_len) { /* Abstract memory is considered to be an array of 'unsigned char' values, not an array of 'char' values. See ISO C 99 section 6.2.6.1. */ const unsigned char *haystack = (const unsigned char *) haystack_start; const unsigned char *needle = (const unsigned char *) needle_start; if (needle_len == 0) /* The first occurrence of the empty string is deemed to occur at the beginning of the string. */ return (void *) haystack; #if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__) /* Less code size, but quadratic performance in the worst case. */ while (needle_len <= haystack_len) { if (!memcmp (haystack, needle, needle_len)) return (void *) haystack; haystack++; haystack_len--; } return NULL; #else /* compilation for speed */ /* Larger code size, but guaranteed linear performance. */ /* Sanity check, otherwise the loop might search through the whole memory. */ if (haystack_len < needle_len) return NULL; /* Use optimizations in memchr when possible, to reduce the search size of haystack using a linear algorithm with a smaller coefficient. However, avoid memchr for long needles, since we can often achieve sublinear performance. */ if (needle_len < LONG_NEEDLE_THRESHOLD) { haystack = memchr (haystack, *needle, haystack_len); if (!haystack || needle_len == 1) return (void *) haystack; haystack_len -= haystack - (const unsigned char *) haystack_start; if (haystack_len < needle_len) return NULL; return two_way_short_needle (haystack, haystack_len, needle, needle_len); } return two_way_long_needle (haystack, haystack_len, needle, needle_len); #endif /* compilation for speed */ }
GarethNelson/Zoidberg
userland/newlib/newlib/libc/string/memmem.c
C
gpl-2.0
3,117
[ 30522, 1013, 1008, 24880, 1011, 7968, 4942, 3367, 4892, 3945, 1010, 2478, 1996, 2048, 1011, 2126, 9896, 1012, 1008, 9385, 1006, 1039, 1007, 2263, 4388, 6511, 1008, 6656, 2000, 2224, 1010, 6100, 1010, 19933, 1010, 1998, 16062, 2023, 4007, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include "annotation.h" #include <vector> #include <cassert> namespace document { struct SpanNode; struct SpanTreeVisitor; class SpanTree { typedef std::vector<Annotation> AnnotationVector; vespalib::string _name; std::unique_ptr<SpanNode> _root; std::vector<Annotation> _annotations; public: typedef std::unique_ptr<SpanTree> UP; typedef AnnotationVector::const_iterator const_iterator; template <typename T> SpanTree(vespalib::stringref name, std::unique_ptr<T> root) : _name(name), _root(std::move(root)) { assert(_root.get()); } ~SpanTree(); // The annotate functions return the annotation index. size_t annotate(std::unique_ptr<Annotation> annotation); size_t annotate(const SpanNode &node, std::unique_ptr<Annotation> a); size_t annotate(const SpanNode &node, const AnnotationType &a_type); Annotation & annotation(size_t index) { return _annotations[index]; } const Annotation & annotation(size_t index) const { return _annotations[index]; } void accept(SpanTreeVisitor &visitor) const; const vespalib::string & getName() const { return _name; } const SpanNode &getRoot() const { return *_root; } size_t numAnnotations() const { return _annotations.size(); } void reserveAnnotations(size_t sz) { _annotations.resize(sz); } const_iterator begin() const { return _annotations.begin(); } const_iterator end() const { return _annotations.end(); } int compare(const SpanTree &other) const; vespalib::string toString() const; }; } // namespace document
vespa-engine/vespa
document/src/vespa/document/annotation/spantree.h
C
apache-2.0
1,711
[ 30522, 1013, 1013, 9385, 20643, 1012, 7000, 2104, 1996, 3408, 30524, 8490, 2863, 2320, 1001, 2421, 1000, 5754, 17287, 3508, 1012, 1044, 1000, 1001, 2421, 1026, 9207, 1028, 1001, 2421, 1026, 16220, 8743, 1028, 3415, 15327, 6254, 1063, 2358, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
-- Vazruden the herald DELETE FROM `creature_text` WHERE `entry`=17307; INSERT INTO `creature_text`(`entry`,`groupid`,`id`,`type`,`probability`,`sound`,`comment`,`text`) VALUES (17307,0,0,14,100,10292,"vazruden the herald SAY_INTRO","You have faced many challenges, pity they were all in vain. Soon your people will kneel to my lord!"); -- Nazan DELETE FROM `creature_text` WHERE `entry`=17536; INSERT INTO `creature_text`(`entry`,`groupid`,`id`,`type`,`probability`,`comment`,`text`) VALUE (17536,0,0,41,100,"nazan EMOTE","%s descends from the sky"); -- Vazruden DELETE FROM `creature_text` WHERE `entry`=17537; INSERT INTO `creature_text`(`entry`,`groupid`,`id`,`type`,`probability`,`sound`,`comment`,`text`) VALUES (17537,0,0,14,100,10293,"vazruden SAY_WIPE","Is there no one left to test me?"), (17537,1,0,14,100,10294,"vazruden SAY_AGGRO_1","Your time is running out!"), (17537,1,1,14,100,10295,"vazruden SAY_AGGRO_2","You are nothing, I answer a higher call!"), (17537,1,2,14,100,10296,"vazruden SAY_AGGRO_3","The Dark Lord laughs at you!"), (17537,2,0,14,100,10297,"vazruden SAY_KILL_1","It is over. Finished!"), (17537,2,1,14,100,10298,"vazruden SAY_KILL_2","Your days are done!"), (17537,3,0,14,100,10299,"vazruden SAY_DIE","My lord will be the end you all..."); -- Talbot aka Prince Valanar (There's an UpdateEntry() call in the script which I did not see) UPDATE `creature_text` SET `entry`=28189 WHERE `entry`=25301; -- Darion Mograine UPDATE `creature_text` SET `entry`=29228 WHERE `entry`=29173 AND `groupid`=74; -- Core rager UPDATE `creature_text` SET `entry`=11672 WHERE `entry`=11988; DELETE FROM `creature_text` WHERE `entry` IN (15550,16151); INSERT INTO `creature_text`(`entry`,`groupid`,`id`,`type`,`probability`,`sound`,`comment`,`text`) VALUES -- Attumen (15550,0,0,14,100,9169,"attumen SAY_KILL1","It was... inevitable."), (15550,0,1,14,100,9300,"attumen SAY_KILL2","Another trophy to add to my collection!"), (15550,1,0,14,100,9166,"attumen SAY_DISARMED","Weapons are merely a convenience for a warrior of my skill!"), (15550,2,0,14,100,9165,"attumen SAY_DEATH","I always knew... someday I would become... the hunted."), (15550,3,0,14,100,9170,"attumen SAY_RANDOM1","Such easy sport."), (15550,3,1,14,100,9304,"attumen SAY_RANDOM2","Amateurs! Do not think you can best me! I kill for a living."), -- Midnight (16151,0,0,14,100,9173,"attumen SAY_MIDNIGHT_KILL","Well done Midnight!"), (16151,1,0,14,100,9167,"attumen SAY_APPEAR1","Cowards! Wretches!"), (16151,1,1,14,100,9298,"attumen SAY_APPEAR2","Who dares attack the steed of the Huntsman?"), (16151,1,2,14,100,9299,"attumen SAY_APPEAR3","Perhaps you would rather test yourselves against a more formidable opponent?!"), (16151,2,0,14,100,9168,"attumen SAY_MOUNT","Come, Midnight, let\'s disperse this petty rabble!"); -- Creature text preparation for rajaxx DELETE FROM `creature_text` WHERE `entry` IN (15471,15341); INSERT INTO `creature_text`(`entry`,`groupid`,`sound`,`type`,`probability`,`comment`,`text`) VALUES (15471,0,0,14,100,"andorov SAY_ANDOROV_INTRO","They come now. Try not to get yourself killed, young blood."), (15471,1,0,14,100,"andorov SAY_ANDOROV_ATTACK","Remember, Rajaxx, when I said I\'d kill you last? I lied..."), (15341,0,8612,14,100,"rajaxx SAY_WAVE3","The time of our retribution is at hand! Let darkness reign in the hearts of our enemies!"), (15341,1,8610,14,100,"rajaxx SAY_WAVE4","No longer will we wait behind barred doors and walls of stone! No longer will our vengeance be denied! The dragons themselves will tremble before our wrath!"), (15341,2,8608,14,100,"rajaxx SAY_WAVE5","Fear is for the enemy! Fear and death!"), (15341,3,8611,14,100,"rajaxx SAY_WAVE6","Staghelm will whimper and beg for his life, just as his whelp of a son did! One thousand years of injustice will end this day!"), (15341,4,8607,14,100,"rajaxx SAY_WAVE7","Fandral! Your time has come! Go and hide in the Emerald Dream and pray we never find you!"), (15341,5,8609,14,100,"rajaxx SAY_INTRO","Impudent fool! I will kill you myself!"), (15341,6,8603,14,100,"rajaxx SAY_UNK1","Attack and make them pay dearly!"), (15341,7,8605,14,100,"rajaxx SAY_UNK2","Crush them! Drive them out!"), (15341,8,8606,14,100,"rajaxx SAY_UNK3","Do not hesitate! Destroy them!"), (15341,9,8613,14,100,"rajaxx SAY_UNK4","Warriors! Captains! Continue the fight!"), (15341,10,8614,14,100,"rajaxx SAY_DEAGGRO","You are not worth my time $N!"), (15341,11,8604,14,100,"rajaxx SAY_KILLS_ANDOROV","Breath your last!"), (15341,12,0,14,100,"rajaxx SAY_COMPLETE_QUEST","Soon you will know the price of your meddling, mortals... The master is nearly whole... And when he rises, your world will be cease!"); -- moam DELETE FROM `creature_text` WHERE `entry`=15340; INSERT INTO `creature_text`(`entry`,`groupid`,`type`,`probability`,`comment`,`text`) VALUES (15340,0,16,100,"moam EMOTE_AGGRO","%s senses your fear."), (15340,1,16,100,"moan EMOTE_MANA_FULL","%s bristles with energy!"); -- buru DELETE FROM `creature_text` WHERE `entry`=15370; INSERT INTO `creature_text`(`entry`,`groupid`,`type`,`probability`,`comment`,`text`) VALUES (15370,0,16,100,"buru EMOTE_TARGET","%s sets eyes on $N!");
ralph93/ShuriCore
sql/updates/worldacc/2012_12_18_01_world_creature_text.sql
SQL
gpl-2.0
5,153
[ 30522, 1011, 1011, 12436, 2480, 28121, 2368, 1996, 9536, 3972, 12870, 2013, 1036, 6492, 1035, 3793, 1036, 2073, 1036, 4443, 1036, 1027, 23272, 2581, 1025, 19274, 2046, 1036, 6492, 1035, 3793, 1036, 1006, 1036, 4443, 1036, 1010, 1036, 2177, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/*-------------------------------------------------------------------------- * linq-vsdoc.js - LINQ for JavaScript * ver 2.2.0.2 (Jan. 21th, 2011) * * created and maintained by neuecc <ils@neue.cc> * licensed under Microsoft Public License(Ms-PL) * http://neue.cc/ * http://linqjs.codeplex.com/ *--------------------------------------------------------------------------*/ Enumerable = (function () { var Enumerable = function (getEnumerator) { this.GetEnumerator = getEnumerator; } Enumerable.Choice = function (Params_Contents) { /// <summary>Random choice from arguments. /// Ex: Choice(1,2,3) - 1,3,2,3,3,2,1...</summary> /// <param type="T" name="Params_Contents" parameterArray="true">Array or Params Contents</param> /// <returns type="Enumerable"></returns> } Enumerable.Cycle = function (Params_Contents) { /// <summary>Cycle Repeat from arguments. /// Ex: Cycle(1,2,3) - 1,2,3,1,2,3,1,2,3...</summary> /// <param type="T" name="Params_Contents" parameterArray="true">Array or Params Contents</param> /// <returns type="Enumerable"></returns> } Enumerable.Empty = function () { /// <summary>Returns an empty Enumerable.</summary> /// <returns type="Enumerable"></returns> } Enumerable.From = function (obj) { /// <summary> /// Make Enumerable from obj. /// 1. null = Enumerable.Empty(). /// 2. Enumerable = Enumerable. /// 3. Number/Boolean = Enumerable.Repeat(obj, 1). /// 4. String = to CharArray.(Ex:"abc" => "a","b","c"). /// 5. Object/Function = to KeyValuePair(except function) Ex:"{a:0}" => (.Key=a, .Value=0). /// 6. Array or ArrayLikeObject(has length) = to Enumerable. /// 7. JScript's IEnumerable = to Enumerable(using Enumerator). /// </summary> /// <param name="obj">object</param> /// <returns type="Enumerable"></returns> } Enumerable.Return = function (element) { /// <summary>Make one sequence. This equals Repeat(element, 1)</summary> /// <param name="element">element</param> /// <returns type="Enumerable"></returns> } Enumerable.Matches = function (input, pattern, flags) { /// <summary>Global regex match and send regexp object. /// Ex: Matches((.)z,"0z1z2z") - $[1] => 0,1,2</summary> /// <param type="String" name="input">input string</param> /// <param type="RegExp/String" name="pattern">RegExp or Pattern string</param> /// <param type="Optional:String" name="flags" optional="true">If pattern is String then can use regexp flags "i" or "m" or "im"</param> /// <returns type="Enumerable"></returns> } Enumerable.Range = function (start, count, step) { /// <summary>Generates a sequence of integral numbers within a specified range. /// Ex: Range(1,5) - 1,2,3,4,5</summary> /// <param type="Number" integer="true" name="start">The value of the first integer in the sequence.</param> /// <param type="Number" integer="true" name="count">The number of sequential integers to generate.</param> /// <param type="Optional:Number" integer="true" name="step" optional="true">Step of generate number.(Ex:Range(0,3,5) - 0,5,10)</param> /// <returns type="Enumerable"></returns> } Enumerable.RangeDown = function (start, count, step) { /// <summary>Generates a sequence of integral numbers within a specified range. /// Ex: RangeDown(5,5) - 5,4,3,2,1</summary> /// <param type="Number" integer="true" name="start">The value of the first integer in the sequence.</param> /// <param type="Number" integer="true" name="count">The number of sequential integers to generate.</param> /// <param type="Optional:Number" integer="true" name="step" optional="true">Step of generate number.(Ex:RangeDown(0,3,5) - 0,-5,-10)</param> /// <returns type="Enumerable"></returns> } Enumerable.RangeTo = function (start, to, step) { /// <summary>Generates a sequence of integral numbers. /// Ex: RangeTo(10,12) - 10,11,12 RangeTo(0,-2) - 0, -1, -2</summary> /// <param type="Number" integer="true" name="start">start integer</param> /// <param type="Number" integer="true" name="to">to integer</param> /// <param type="Optional:Number" integer="true" name="step" optional="true">Step of generate number.(Ex:RangeTo(0,7,3) - 0,3,6)</param> /// <returns type="Enumerable"></returns> } Enumerable.Repeat = function (obj, count) { /// <summary>Generates a sequence that contains one repeated value. /// If omit count then generate to infinity. /// Ex: Repeat("foo",3) - "foo","foo","foo"</summary> /// <param type="TResult" name="obj">The value to be repeated.</param> /// <param type="Optional:Number" integer="true" name="count" optional="true">The number of times to repeat the value in the generated sequence.</param> /// <returns type="Enumerable"></returns> } Enumerable.RepeatWithFinalize = function (initializer, finalizer) { /// <summary>Lazy Generates one value by initializer's result and do finalize when enumerate end</summary> /// <param type="Func&lt;T>" name="initializer">value factory.</param> /// <param type="Action&lt;T>" name="finalizer">execute when finalize.</param> /// <returns type="Enumerable"></returns> } Enumerable.Generate = function (func, count) { /// <summary>Generates a sequence that execute func value. /// If omit count then generate to infinity. /// Ex: Generate("Math.random()", 5) - 0.131341,0.95425252,...</summary> /// <param type="Func&lt;T>" name="func">The value of execute func to be repeated.</param> /// <param type="Optional:Number" integer="true" name="count" optional="true">The number of times to repeat the value in the generated sequence.</param> /// <returns type="Enumerable"></returns> } Enumerable.ToInfinity = function (start, step) { /// <summary>Generates a sequence of integral numbers to infinity. /// Ex: ToInfinity() - 0,1,2,3...</summary> /// <param type="Optional:Number" integer="true" name="start" optional="true">start integer</param> /// <param type="Optional:Number" integer="true" name="step" optional="true">Step of generate number.(Ex:ToInfinity(10,3) - 10,13,16,19,...)</param> /// <returns type="Enumerable"></returns> } Enumerable.ToNegativeInfinity = function (start, step) { /// <summary>Generates a sequence of integral numbers to negative infinity. /// Ex: ToNegativeInfinity() - 0,-1,-2,-3...</summary> /// <param type="Optional:Number" integer="true" name="start" optional="true">start integer</param> /// <param type="Optional:Number" integer="true" name="step" optional="true">Step of generate number.(Ex:ToNegativeInfinity(10,3) - 10,7,4,1,...)</param> /// <returns type="Enumerable"></returns> } Enumerable.Unfold = function (seed, func) { /// <summary>Applies function and generates a infinity sequence. /// Ex: Unfold(3,"$+10") - 3,13,23,...</summary> /// <param type="T" name="seed">The initial accumulator value.</param> /// <param type="Func&lt;T,T>" name="func">An accumulator function to be invoked on each element.</param> /// <returns type="Enumerable"></returns> } Enumerable.prototype = { /* Projection and Filtering Methods */ CascadeBreadthFirst: function (func, resultSelector) { /// <summary>Projects each element of sequence and flattens the resulting sequences into one sequence use breadth first search.</summary> /// <param name="func" type="Func&lt;T,T[]>">Select child sequence.</param> /// <param name="resultSelector" type="Optional:Func&lt;T>_or_Func&lt;T,int>" optional="true">Optional:the second parameter of the function represents the nestlevel of the source sequence.</param> /// <returns type="Enumerable"></returns> }, CascadeDepthFirst: function (func, resultSelector) { /// <summary>Projects each element of sequence and flattens the resulting sequences into one sequence use depth first search.</summary> /// <param name="func" type="Func&lt;T,T[]>">Select child sequence.</param> /// <param name="resultSelector" type="Optional:Func&lt;T>_or_Func&lt;T,int>" optional="true">Optional:the second parameter of the function represents the nestlevel of the source sequence.</param> /// <returns type="Enumerable"></returns> }, Flatten: function () { /// <summary>Flatten sequences into one sequence.</summary> /// <returns type="Enumerable"></returns> }, Pairwise: function (selector) { /// <summary>Projects current and next element of a sequence into a new form.</summary> /// <param type="Func&lt;TSource,TSource,TResult>" name="selector">A transform function to apply to current and next element.</param> /// <returns type="Enumerable"></returns> }, Scan: function (func_or_seed, func, resultSelector) { /// <summary>Applies an accumulator function over a sequence.</summary> /// <param name="func_or_seed" type="Func&lt;T,T,T>_or_TAccumulate">Func is an accumulator function to be invoked on each element. Seed is the initial accumulator value.</param> /// <param name="func" type="Optional:Func&lt;TAccumulate,T,TAccumulate>" optional="true">An accumulator function to be invoked on each element.</param> /// <param name="resultSelector" type="Optional:Func&lt;TAccumulate,TResult>" optional="true">A function to transform the final accumulator value into the result value.</param> /// <returns type="Enumerable"></returns> }, Select: function (selector) { /// <summary>Projects each element of a sequence into a new form.</summary> /// <param name="selector" type="Func&lt;T,T>_or_Func&lt;T,int,T>">A transform function to apply to each source element; Optional:the second parameter of the function represents the index of the source element.</param> /// <returns type="Enumerable"></returns> }, SelectMany: function (collectionSelector, resultSelector) { /// <summary>Projects each element of a sequence and flattens the resulting sequences into one sequence.</summary> /// <param name="collectionSelector" type="Func&lt;T,TCollection[]>_or_Func&lt;T,int,TCollection[]>">A transform function to apply to each source element; Optional:the second parameter of the function represents the index of the source element.</param> /// <param name="resultSelector" type="Optional:Func&lt;T,TCollection,TResult>" optional="true">Optional:A transform function to apply to each element of the intermediate sequence.</param> /// <returns type="Enumerable"></returns> }, Where: function (predicate) { /// <summary>Filters a sequence of values based on a predicate.</summary> /// <param name="predicate" type="Func&lt;T,bool>_or_Func&lt;T,int,bool>">A function to test each source element for a condition; Optional:the second parameter of the function represents the index of the source element.</param> /// <returns type="Enumerable"></returns> }, OfType: function (type) { /// <summary>Filters the elements based on a specified type.</summary> /// <param name="type" type="T">The type to filter the elements of the sequence on.</param> /// <returns type="Enumerable"></returns> }, Zip: function (second, selector) { /// <summary>Merges two sequences by using the specified predicate function.</summary> /// <param name="second" type="T[]">The second sequence to merge.</param> /// <param name="selector" type="Func&lt;TFirst,TSecond,TResult>_or_Func&lt;TFirst,TSecond,int,TResult>">A function that specifies how to merge the elements from the two sequences. Optional:the third parameter of the function represents the index of the source element.</param> /// <returns type="Enumerable"></returns> }, /* Join Methods */ Join: function (inner, outerKeySelector, innerKeySelector, resultSelector, compareSelector) { /// <summary>Correlates the elements of two sequences based on matching keys.</summary> /// <param name="inner" type="T[]">The sequence to join to the first sequence.</param> /// <param name="outerKeySelector" type="Func&lt;TOuter,TKey>">A function to extract the join key from each element of the first sequence.</param> /// <param name="innerKeySelector" type="Func&lt;TInner,TKey>">A function to extract the join key from each element of the second sequence.</param> /// <param name="resultSelector" type="Func&lt;TOuter,TInner,TResult>">A function to create a result element from two matching elements.</param> /// <param name="compareSelector" type="Optional:Func&lt;TKey,TCompare>" optional="true">An equality comparer to compare values.</param> /// <returns type="Enumerable"></returns> }, GroupJoin: function (inner, outerKeySelector, innerKeySelector, resultSelector, compareSelector) { /// <summary>Correlates the elements of two sequences based on equality of keys and groups the results.</summary> /// <param name="inner" type="T[]">The sequence to join to the first sequence.</param> /// <param name="outerKeySelector" type="Func&lt;TOuter>">A function to extract the join key from each element of the first sequence.</param> /// <param name="innerKeySelector" type="Func&lt;TInner>">A function to extract the join key from each element of the second sequence.</param> /// <param name="resultSelector" type="Func&lt;TOuter,Enumerable&lt;TInner>,TResult">A function to create a result element from an element from the first sequence and a collection of matching elements from the second sequence.</param> /// <param name="compareSelector" type="Optional:Func&lt;TKey,TCompare>" optional="true">An equality comparer to compare values.</param> /// <returns type="Enumerable"></returns> }, /* Set Methods */ All: function (predicate) { /// <summary>Determines whether all elements of a sequence satisfy a condition.</summary> /// <param type="Func&lt;T,bool>" name="predicate">A function to test each element for a condition.</param> /// <returns type="Boolean"></returns> }, Any: function (predicate) { /// <summary>Determines whether a sequence contains any elements or any element of a sequence satisfies a condition.</summary> /// <param name="predicate" type="Optional:Func&lt;T,bool>" optional="true">A function to test each element for a condition.</param> /// <returns type="Boolean"></returns> }, Concat: function (second) { /// <summary>Concatenates two sequences.</summary> /// <param name="second" type="T[]">The sequence to concatenate to the first sequence.</param> /// <returns type="Enumerable"></returns> }, Insert: function (index, second) { /// <summary>Merge two sequences.</summary> /// <param name="index" type="Number" integer="true">The index of insert start position.</param> /// <param name="second" type="T[]">The sequence to concatenate to the first sequence.</param> /// <returns type="Enumerable"></returns> }, Alternate: function (value) { /// <summary>Insert value to between sequence.</summary> /// <param name="value" type="T">The value of insert.</param> /// <returns type="Enumerable"></returns> }, // Overload:function(value) // Overload:function(value, compareSelector) Contains: function (value, compareSelector) { /// <summary>Determines whether a sequence contains a specified element.</summary> /// <param name="value" type="T">The value to locate in the sequence.</param> /// <param name="compareSelector" type="Optional:Func&lt;T,TKey>" optional="true">An equality comparer to compare values.</param> /// <returns type="Boolean"></returns> }, DefaultIfEmpty: function (defaultValue) { /// <summary>Returns the elements of the specified sequence or the specified value in a singleton collection if the sequence is empty.</summary> /// <param name="defaultValue" type="T">The value to return if the sequence is empty.</param> /// <returns type="Enumerable"></returns> }, Distinct: function (compareSelector) { /// <summary>Returns distinct elements from a sequence.</summary> /// <param name="compareSelector" type="Optional:Func&lt;T,TKey>" optional="true">An equality comparer to compare values.</param> /// <returns type="Enumerable"></returns> }, Except: function (second, compareSelector) { /// <summary>Produces the set difference of two sequences.</summary> /// <param name="second" type="T[]">An T[] whose Elements that also occur in the first sequence will cause those elements to be removed from the returned sequence.</param> /// <param name="compareSelector" type="Optional:Func&lt;T,TKey>" optional="true">An equality comparer to compare values.</param> /// <returns type="Enumerable"></returns> }, Intersect: function (second, compareSelector) { /// <summary>Produces the set difference of two sequences.</summary> /// <param name="second" type="T[]">An T[] whose distinct elements that also appear in the first sequence will be returned.</param> /// <param name="compareSelector" type="Optional:Func&lt;T,TKey>" optional="true">An equality comparer to compare values.</param> /// <returns type="Enumerable"></returns> }, SequenceEqual: function (second, compareSelector) { /// <summary>Determines whether two sequences are equal by comparing the elements.</summary> /// <param name="second" type="T[]">An T[] to compare to the first sequence.</param> /// <param name="compareSelector" type="Optional:Func&lt;T,TKey>" optional="true">An equality comparer to compare values.</param> /// <returns type="Enumerable"></returns> }, Union: function (second, compareSelector) { /// <summary>Produces the union of two sequences.</summary> /// <param name="second" type="T[]">An T[] whose distinct elements form the second set for the union.</param> /// <param name="compareSelector" type="Optional:Func&lt;T,TKey>" optional="true">An equality comparer to compare values.</param> /// <returns type="Enumerable"></returns> }, /* Ordering Methods */ OrderBy: function (keySelector) { /// <summary>Sorts the elements of a sequence in ascending order according to a key.</summary> /// <param name="keySelector" type="Optional:Func&lt;T,TKey>">A function to extract a key from an element.</param> return new OrderedEnumerable(); }, OrderByDescending: function (keySelector) { /// <summary>Sorts the elements of a sequence in descending order according to a key.</summary> /// <param name="keySelector" type="Optional:Func&lt;T,TKey>">A function to extract a key from an element.</param> return new OrderedEnumerable(); }, Reverse: function () { /// <summary>Inverts the order of the elements in a sequence.</summary> /// <returns type="Enumerable"></returns> }, Shuffle: function () { /// <summary>Shuffle sequence.</summary> /// <returns type="Enumerable"></returns> }, /* Grouping Methods */ GroupBy: function (keySelector, elementSelector, resultSelector, compareSelector) { /// <summary>Groups the elements of a sequence according to a specified key selector function.</summary> /// <param name="keySelector" type="Func&lt;T,TKey>">A function to extract the key for each element.</param> /// <param name="elementSelector" type="Optional:Func&lt;T,TElement>">A function to map each source element to an element in an Grouping&lt;TKey, TElement>.</param> /// <param name="resultSelector" type="Optional:Func&lt;TKey,Enumerable&lt;TElement>,TResult>">A function to create a result value from each group.</param> /// <param name="compareSelector" type="Optional:Func&lt;TKey,TCompare>" optional="true">An equality comparer to compare values.</param> /// <returns type="Enumerable"></returns> }, PartitionBy: function (keySelector, elementSelector, resultSelector, compareSelector) { /// <summary>Create Group by continuation key.</summary> /// <param name="keySelector" type="Func&lt;T,TKey>">A function to extract the key for each element.</param> /// <param name="elementSelector" type="Optional:Func&lt;T,TElement>">A function to map each source element to an element in an Grouping&lt;TKey, TElement>.</param> /// <param name="resultSelector" type="Optional:Func&lt;TKey,Enumerable&lt;TElement>,TResult>">A function to create a result value from each group.</param> /// <param name="compareSelector" type="Optional:Func&lt;TKey,TCompare>" optional="true">An equality comparer to compare values.</param> /// <returns type="Enumerable"></returns> }, BufferWithCount: function (count) { /// <summary>Divide by count</summary> /// <param name="count" type="Number" integer="true">integer</param> /// <returns type="Enumerable"></returns> }, /* Aggregate Methods */ Aggregate: function (func_or_seed, func, resultSelector) { /// <summary>Applies an accumulator function over a sequence.</summary> /// <param name="func_or_seed" type="Func&lt;T,T,T>_or_TAccumulate">Func is an accumulator function to be invoked on each element. Seed is the initial accumulator value.</param> /// <param name="func" type="Optional:Func&lt;TAccumulate,T,TAccumulate>" optional="true">An accumulator function to be invoked on each element.</param> /// <param name="resultSelector" type="Optional:Func&lt;TAccumulate,TResult>" optional="true">A function to transform the final accumulator value into the result value.</param> /// <returns type="TResult"></returns> }, Average: function (selector) { /// <summary>Computes the average of a sequence.</summary> /// <param name="selector" type="Optional:Func&lt;T,Number>" optional="true">A transform function to apply to each element.</param> /// <returns type="Number"></returns> }, Count: function (predicate) { /// <summary>Returns the number of elements in a sequence.</summary> /// <param name="predicate" type="Optional:Func&lt;T,Boolean>" optional="true">A function to test each element for a condition.</param> /// <returns type="Number"></returns> }, Max: function (selector) { /// <summary>Returns the maximum value in a sequence</summary> /// <param name="selector" type="Optional:Func&lt;T,TKey>" optional="true">A transform function to apply to each element.</param> /// <returns type="Number"></returns> }, Min: function (selector) { /// <summary>Returns the minimum value in a sequence</summary> /// <param name="selector" type="Optional:Func&lt;T,TKey>" optional="true">A transform function to apply to each element.</param> /// <returns type="Number"></returns> }, MaxBy: function (keySelector) { /// <summary>Returns the maximum value in a sequence by keySelector</summary> /// <param name="keySelector" type="Func&lt;T,TKey>">A compare selector of element.</param> /// <returns type="T"></returns> }, MinBy: function (keySelector) { /// <summary>Returns the minimum value in a sequence by keySelector</summary> /// <param name="keySelector" type="Func&lt;T,TKey>">A compare selector of element.</param> /// <returns type="T"></returns> }, Sum: function (selector) { /// <summary>Computes the sum of a sequence of values.</summary> /// <param name="selector" type="Optional:Func&lt;T,TKey>" optional="true">A transform function to apply to each element.</param> /// <returns type="Number"></returns> }, /* Paging Methods */ ElementAt: function (index) { /// <summary>Returns the element at a specified index in a sequence.</summary> /// <param name="index" type="Number" integer="true">The zero-based index of the element to retrieve.</param> /// <returns type="T"></returns> }, ElementAtOrDefault: function (index, defaultValue) { /// <summary>Returns the element at a specified index in a sequence or a default value if the index is out of range.</summary> /// <param name="index" type="Number" integer="true">The zero-based index of the element to retrieve.</param> /// <param name="defaultValue" type="T">The value if the index is outside the bounds then send.</param> /// <returns type="T"></returns> }, First: function (predicate) { /// <summary>Returns the first element of a sequence.</summary> /// <param name="predicate" type="Optional:Func&lt;T,Boolean>">A function to test each element for a condition.</param> /// <returns type="T"></returns> }, FirstOrDefault: function (defaultValue, predicate) { /// <summary>Returns the first element of a sequence, or a default value.</summary> /// <param name="defaultValue" type="T">The value if not found then send.</param> /// <param name="predicate" type="Optional:Func&lt;T,Boolean>">A function to test each element for a condition.</param> /// <returns type="T"></returns> }, Last: function (predicate) { /// <summary>Returns the last element of a sequence.</summary> /// <param name="predicate" type="Optional:Func&lt;T,Boolean>">A function to test each element for a condition.</param> /// <returns type="T"></returns> }, LastOrDefault: function (defaultValue, predicate) { /// <summary>Returns the last element of a sequence, or a default value.</summary> /// <param name="defaultValue" type="T">The value if not found then send.</param> /// <param name="predicate" type="Optional:Func&lt;T,Boolean>">A function to test each element for a condition.</param> /// <returns type="T"></returns> }, Single: function (predicate) { /// <summary>Returns the only element of a sequence that satisfies a specified condition, and throws an exception if more than one such element exists.</summary> /// <param name="predicate" type="Optional:Func&lt;T,Boolean>">A function to test each element for a condition.</param> /// <returns type="T"></returns> }, SingleOrDefault: function (defaultValue, predicate) { /// <summary>Returns a single, specific element of a sequence of values, or a default value if no such element is found.</summary> /// <param name="defaultValue" type="T">The value if not found then send.</param> /// <param name="predicate" type="Optional:Func&lt;T,Boolean>">A function to test each element for a condition.</param> /// <returns type="T"></returns> }, Skip: function (count) { /// <summary>Bypasses a specified number of elements in a sequence and then returns the remaining elements.</summary> /// <param name="count" type="Number" integer="true">The number of elements to skip before returning the remaining elements.</param> /// <returns type="Enumerable"></returns> }, SkipWhile: function (predicate) { /// <summary>Bypasses elements in a sequence as long as a specified condition is true and then returns the remaining elements.</summary> /// <param name="predicate" type="Func&lt;T,Boolean>_or_Func&lt;T,int,Boolean>">A function to test each source element for a condition; Optional:the second parameter of the function represents the index of the source element.</param> /// <returns type="Enumerable"></returns> }, Take: function (count) { /// <summary>Returns a specified number of contiguous elements from the start of a sequence.</summary> /// <param name="count" type="Number" integer="true">The number of elements to return.</param> /// <returns type="Enumerable"></returns> }, TakeWhile: function (predicate) { /// <summary>Returns elements from a sequence as long as a specified condition is true, and then skips the remaining elements.</summary> /// <param name="predicate" type="Func&lt;T,Boolean>_or_Func&lt;T,int,Boolean>">A function to test each source element for a condition; Optional:the second parameter of the function represents the index of the source element.</param> /// <returns type="Enumerable"></returns> }, TakeExceptLast: function (count) { /// <summary>Take a sequence except last count.</summary> /// <param name="count" type="Optional:Number" integer="true">The number of skip count.</param> /// <returns type="Enumerable"></returns> }, TakeFromLast: function (count) { /// <summary>Take a sequence from last count.</summary> /// <param name="count" type="Number" integer="true">The number of take count.</param> /// <returns type="Enumerable"></returns> }, IndexOf: function (item) { /// <summary>Returns the zero-based index of the flrst occurrence of a value.</summary> /// <param name="item" type="T">The zero-based starting index of the search.</param> /// <returns type="Number" integer="true"></returns> }, LastIndexOf: function (item) { /// <summary>Returns the zero-based index of the last occurrence of a value.</summary> /// <param name="item" type="T">The zero-based starting index of the search.</param> /// <returns type="Number" integer="true"></returns> }, /* Convert Methods */ ToArray: function () { /// <summary>Creates an array from this sequence.</summary> /// <returns type="Array"></returns> }, ToLookup: function (keySelector, elementSelector, compareSelector) { /// <summary>Creates a Lookup from this sequence.</summary> /// <param name="keySelector" type="Func&lt;T,TKey>">A function to extract a key from each element.</param> /// <param name="elementSelector" type="Optional:Func&lt;T,TElement>">A transform function to produce a result element value from each element.</param> /// <param name="compareSelector" type="Optional:Func&lt;TKey,TCompare>" optional="true">An equality comparer to compare values.</param> return new Lookup(); }, ToObject: function (keySelector, elementSelector) { /// <summary>Creates a Object from this sequence.</summary> /// <param name="keySelector" type="Func&lt;T,String>">A function to extract a key from each element.</param> /// <param name="elementSelector" type="Func&lt;T,TElement>">A transform function to produce a result element value from each element.</param> /// <returns type="Object"></returns> }, ToDictionary: function (keySelector, elementSelector, compareSelector) { /// <summary>Creates a Dictionary from this sequence.</summary> /// <param name="keySelector" type="Func&lt;T,TKey>">A function to extract a key from each element.</param> /// <param name="elementSelector" type="Func&lt;T,TElement>">A transform function to produce a result element value from each element.</param> /// <param name="compareSelector" type="Optional:Func&lt;TKey,TCompare>" optional="true">An equality comparer to compare values.</param> return new Dictionary(); }, // Overload:function() // Overload:function(replacer) // Overload:function(replacer, space) ToJSON: function (replacer, space) { /// <summary>Creates a JSON String from sequence, performed only native JSON support browser or included json2.js.</summary> /// <param name="replacer" type="Optional:Func">a replacer.</param> /// <param name="space" type="Optional:Number">indent spaces.</param> /// <returns type="String"></returns> }, // Overload:function() // Overload:function(separator) // Overload:function(separator,selector) ToString: function (separator, selector) { /// <summary>Creates Joined string from this sequence.</summary> /// <param name="separator" type="Optional:String">A String.</param> /// <param name="selector" type="Optional:Func&lt;T,String>">A transform function to apply to each source element.</param> /// <returns type="String"></returns> }, /* Action Methods */ Do: function (action) { /// <summary>Performs the specified action on each element of the sequence.</summary> /// <param name="action" type="Action&lt;T>_or_Action&lt;T,int>">Optional:the second parameter of the function represents the index of the source element.</param> /// <returns type="Enumerable"></returns> }, ForEach: function (action) { /// <summary>Performs the specified action on each element of the sequence.</summary> /// <param name="action" type="Action&lt;T>_or_Action&lt;T,int>">[return true;]continue iteration.[return false;]break iteration. Optional:the second parameter of the function represents the index of the source element.</param> /// <returns type="void"></returns> }, Write: function (separator, selector) { /// <summary>Do document.write.</summary> /// <param name="separator" type="Optional:String">A String.</param> /// <param name="selector" type="Optional:Func&lt;T,String>">A transform function to apply to each source element.</param> /// <returns type="void"></returns> }, WriteLine: function (selector) { /// <summary>Do document.write + &lt;br />.</summary> /// <param name="selector" type="Optional:Func&lt;T,String>">A transform function to apply to each source element.</param> /// <returns type="void"></returns> }, Force: function () { /// <summary>Execute enumerate.</summary> /// <returns type="void"></returns> }, /* Functional Methods */ Let: function (func) { /// <summary>Bind the source to the parameter so that it can be used multiple times.</summary> /// <param name="func" type="Func&lt;Enumerable&lt;T>,Enumerable&lt;TR>>">apply function.</param> /// <returns type="Enumerable"></returns> }, Share: function () { /// <summary>Shares cursor of all enumerators to the sequence.</summary> /// <returns type="Enumerable"></returns> }, MemoizeAll: function () { /// <summary>Creates an enumerable that enumerates the original enumerable only once and caches its results.</summary> /// <returns type="Enumerable"></returns> }, /* Error Handling Methods */ Catch: function (handler) { /// <summary>catch error and do handler.</summary> /// <param name="handler" type="Action&lt;Error>">execute if error occured.</param> /// <returns type="Enumerable"></returns> }, Finally: function (finallyAction) { /// <summary>do action if enumerate end or disposed or error occured.</summary> /// <param name="handler" type="Action">finally execute.</param> /// <returns type="Enumerable"></returns> }, /* For Debug Methods */ Trace: function (message, selector) { /// <summary>Trace object use console.log.</summary> /// <param name="message" type="Optional:String">Default is 'Trace:'.</param> /// <param name="selector" type="Optional:Func&lt;T,String>">A transform function to apply to each source element.</param> /// <returns type="Enumerable"></returns> } } // vsdoc-dummy Enumerable.prototype.GetEnumerator = function () { /// <summary>Returns an enumerator that iterates through the collection.</summary> return new IEnumerator(); } var IEnumerator = function () { } IEnumerator.prototype.Current = function () { /// <summary>Gets the element in the collection at the current position of the enumerator.</summary> /// <returns type="T"></returns> } IEnumerator.prototype.MoveNext = function () { /// <summary>Advances the enumerator to the next element of the collection.</summary> /// <returns type="Boolean"></returns> } IEnumerator.prototype.Dispose = function () { /// <summary>Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.</summary> /// <returns type="Void"></returns> } var Dictionary = function () { } Dictionary.prototype = { Add: function (key, value) { /// <summary>add new pair. if duplicate key then overwrite new value.</summary> /// <returns type="Void"></returns> }, Get: function (key) { /// <summary>get value. if not find key then return undefined.</summary> /// <returns type="T"></returns> }, Set: function (key, value) { /// <summary>set value. if complete set value then return true, not find key then return false.</summary> /// <returns type="Boolean"></returns> }, Contains: function (key) { /// <summary>check contains key.</summary> /// <returns type="Boolean"></returns> }, Clear: function () { /// <summary>clear dictionary.</summary> /// <returns type="Void"></returns> }, Remove: function (key) { /// <summary>remove key and value.</summary> /// <returns type="Void"></returns> }, Count: function () { /// <summary>contains value's count.</summary> /// <returns type="Number"></returns> }, ToEnumerable: function () { /// <summary>Convert to Enumerable&lt;{Key:, Value:}&gt;.</summary> /// <returns type="Enumerable"></returns> } } var Lookup = function () { } Lookup.prototype = { Count: function () { /// <summary>contains value's count.</summary> /// <returns type="Number"></returns> }, Get: function (key) { /// <summary>get grouped enumerable.</summary> /// <returns type="Enumerable"></returns> }, Contains: function (key) { /// <summary>check contains key.</summary> /// <returns type="Boolean"></returns> }, ToEnumerable: function () { /// <summary>Convert to Enumerable&lt;Grouping&gt;.</summary> /// <returns type="Enumerable"></returns> } } var Grouping = function () { } Grouping.prototype = new Enumerable(); Grouping.prototype.Key = function () { /// <summary>get grouping key.</summary> /// <returns type="T"></returns> } var OrderedEnumerable = function () { } OrderedEnumerable.prototype = new Enumerable(); OrderedEnumerable.prototype.ThenBy = function (keySelector) { /// <summary>Performs a subsequent ordering of the elements in a sequence in ascending order according to a key.</summary> /// <param name="keySelector" type="Func&lt;T,TKey>">A function to extract a key from each element.</param> return Enumerable.Empty().OrderBy(); } OrderedEnumerable.prototype.ThenByDescending = function (keySelector) { /// <summary>Performs a subsequent ordering of the elements in a sequence in descending order, according to a key.</summary> /// <param name="keySelector" type="Func&lt;T,TKey>">A function to extract a key from each element.</param> return Enumerable.Empty().OrderBy(); } return Enumerable; })()
HackerDom/qctf-starter-2015
tasks/transl/src/scripts/linq-vsdoc.js
JavaScript
mit
42,857
[ 30522, 1013, 1008, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 101...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* $FreeBSD: src/sys/net80211/ieee80211_radiotap.h,v 1.5 2005/01/22 20:12:05 sam Exp $ */ /* $NetBSD: ieee80211_radiotap.h,v 1.11 2005/06/22 06:16:02 dyoung Exp $ */ /*- * Copyright (c) 2003, 2004 David Young. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted 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. * 3. The name of David Young may not be used to endorse or promote * products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED BY DAVID YOUNG ``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 DAVID * YOUNG 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. */ /* * Modifications to fit into the linux IEEE 802.11 stack, * Mike Kershaw (dragorn@kismetwireless.net) */ #ifndef IEEE80211RADIOTAP_H #define IEEE80211RADIOTAP_H #include <linux/if_ether.h> #include <linux/kernel.h> /* Radiotap header version (from official NetBSD feed) */ #define IEEE80211RADIOTAP_VERSION "1.5" /* Base version of the radiotap packet header data */ #define PKTHDR_RADIOTAP_VERSION 0 /* A generic radio capture format is desirable. There is one for * Linux, but it is neither rigidly defined (there were not even * units given for some fields) nor easily extensible. * * I suggest the following extensible radio capture format. It is * based on a bitmap indicating which fields are present. * * I am trying to describe precisely what the application programmer * should expect in the following, and for that reason I tell the * units and origin of each measurement (where it applies), or else I * use sufficiently weaselly language ("is a monotonically nondecreasing * function of...") that I cannot set false expectations for lawyerly * readers. */ /* XXX tcpdump/libpcap do not tolerate variable-length headers, * yet, so we pad every radiotap header to 64 bytes. Ugh. */ #define IEEE80211_RADIOTAP_HDRLEN 64 /* The radio capture header precedes the 802.11 header. */ struct ieee80211_radiotap_header { u8 it_version; /* Version 0. Only increases * for drastic changes, * introduction of compatible * new fields does not count. */ u8 it_pad; u16 it_len; /* length of the whole * header in bytes, including * it_version, it_pad, * it_len, and data fields. */ u32 it_present; /* A bitmap telling which * fields are present. Set bit 31 * (0x80000000) to extend the * bitmap by another 32 bits. * Additional extensions are made * by setting bit 31. */ }; /* Name Data type Units * ---- --------- ----- * * IEEE80211_RADIOTAP_TSFT u64 microseconds * * Value in microseconds of the MAC's 64-bit 802.11 Time * Synchronization Function timer when the first bit of the * MPDU arrived at the MAC. For received frames, only. * * IEEE80211_RADIOTAP_CHANNEL 2 x u16 MHz, bitmap * * Tx/Rx frequency in MHz, followed by flags (see below). * * IEEE80211_RADIOTAP_FHSS u16 see below * * For frequency-hopping radios, the hop set (first byte) * and pattern (second byte). * * IEEE80211_RADIOTAP_RATE u8 500kb/s * * Tx/Rx data rate * * IEEE80211_RADIOTAP_DBM_ANTSIGNAL int8_t decibels from * one milliwatt (dBm) * * RF signal power at the antenna, decibel difference from * one milliwatt. * * IEEE80211_RADIOTAP_DBM_ANTNOISE int8_t decibels from * one milliwatt (dBm) * * RF noise power at the antenna, decibel difference from one * milliwatt. * * IEEE80211_RADIOTAP_DB_ANTSIGNAL u8 decibel (dB) * * RF signal power at the antenna, decibel difference from an * arbitrary, fixed reference. * * IEEE80211_RADIOTAP_DB_ANTNOISE u8 decibel (dB) * * RF noise power at the antenna, decibel difference from an * arbitrary, fixed reference point. * * IEEE80211_RADIOTAP_LOCK_QUALITY u16 unitless * * Quality of Barker code lock. Unitless. Monotonically * nondecreasing with "better" lock strength. Called "Signal * Quality" in datasheets. (Is there a standard way to measure * this?) * * IEEE80211_RADIOTAP_TX_ATTENUATION u16 unitless * * Transmit power expressed as unitless distance from max * power set at factory calibration. 0 is max power. * Monotonically nondecreasing with lower power levels. * * IEEE80211_RADIOTAP_DB_TX_ATTENUATION u16 decibels (dB) * * Transmit power expressed as decibel distance from max power * set at factory calibration. 0 is max power. Monotonically * nondecreasing with lower power levels. * * IEEE80211_RADIOTAP_DBM_TX_POWER int8_t decibels from * one milliwatt (dBm) * * Transmit power expressed as dBm (decibels from a 1 milliwatt * reference). This is the absolute power level measured at * the antenna port. * * IEEE80211_RADIOTAP_FLAGS u8 bitmap * * Properties of transmitted and received frames. See flags * defined below. * * IEEE80211_RADIOTAP_ANTENNA u8 antenna index * * Unitless indication of the Rx/Tx antenna for this packet. * The first antenna is antenna 0. * * IEEE80211_RADIOTAP_FCS u32 data * * FCS from frame in network byte order. */ enum ieee80211_radiotap_type { IEEE80211_RADIOTAP_TSFT = 0, IEEE80211_RADIOTAP_FLAGS = 1, IEEE80211_RADIOTAP_RATE = 2, IEEE80211_RADIOTAP_CHANNEL = 3, IEEE80211_RADIOTAP_FHSS = 4, IEEE80211_RADIOTAP_DBM_ANTSIGNAL = 5, IEEE80211_RADIOTAP_DBM_ANTNOISE = 6, IEEE80211_RADIOTAP_LOCK_QUALITY = 7, IEEE80211_RADIOTAP_TX_ATTENUATION = 8, IEEE80211_RADIOTAP_DB_TX_ATTENUATION = 9, IEEE80211_RADIOTAP_DBM_TX_POWER = 10, IEEE80211_RADIOTAP_ANTENNA = 11, IEEE80211_RADIOTAP_DB_ANTSIGNAL = 12, IEEE80211_RADIOTAP_DB_ANTNOISE = 13, IEEE80211_RADIOTAP_EXT = 31, }; /* Channel flags. */ #define IEEE80211_CHAN_TURBO 0x0010 /* Turbo channel */ #define IEEE80211_CHAN_CCK 0x0020 /* CCK channel */ #define IEEE80211_CHAN_OFDM 0x0040 /* OFDM channel */ #define IEEE80211_CHAN_2GHZ 0x0080 /* 2 GHz spectrum channel. */ #define IEEE80211_CHAN_5GHZ 0x0100 /* 5 GHz spectrum channel */ #define IEEE80211_CHAN_PASSIVE 0x0200 /* Only passive scan allowed */ #define IEEE80211_CHAN_DYN 0x0400 /* Dynamic CCK-OFDM channel */ #define IEEE80211_CHAN_GFSK 0x0800 /* GFSK channel (FHSS PHY) */ /* For IEEE80211_RADIOTAP_FLAGS */ #define IEEE80211_RADIOTAP_F_CFP 0x01 /* sent/received * during CFP */ #define IEEE80211_RADIOTAP_F_SHORTPRE 0x02 /* sent/received * with short * preamble */ #define IEEE80211_RADIOTAP_F_WEP 0x04 /* sent/received * with WEP encryption */ #define IEEE80211_RADIOTAP_F_FRAG 0x08 /* sent/received * with fragmentation */ #define IEEE80211_RADIOTAP_F_FCS 0x10 /* frame includes FCS */ #define IEEE80211_RADIOTAP_F_DATAPAD 0x20 /* frame has padding between * 802.11 header and payload * (to 32-bit boundary) */ /* Ugly macro to convert literal channel numbers into their mhz equivalents * There are certianly some conditions that will break this (like feeding it '30') * but they shouldn't arise since nothing talks on channel 30. */ #define ieee80211chan2mhz(x) \ (((x) <= 14) ? \ (((x) == 14) ? 2484 : ((x) * 5) + 2407) : \ ((x) + 1000) * 5) #endif /* IEEE80211_RADIOTAP_H */
impedimentToProgress/UCI-BlueChip
snapgear_linux/linux-2.6.21.1/include/net/ieee80211_radiotap.h
C
mit
8,722
[ 30522, 1013, 1008, 1002, 2489, 5910, 2094, 1024, 5034, 2278, 1013, 25353, 2015, 1013, 5658, 17914, 17465, 2487, 1013, 15368, 17914, 17465, 2487, 1035, 2557, 2696, 2361, 1012, 1044, 1010, 1058, 1015, 1012, 1019, 2384, 1013, 5890, 1013, 2570,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<html> <head> <script src="../../../resources/js-test.js"></script> </head> <body> <script> worker = startWorker('../resources/simple-persistent.js'); </script> </body> </html>
scheib/chromium
third_party/blink/web_tests/fast/filesystem/workers/simple-persistent.html
HTML
bsd-3-clause
177
[ 30522, 1026, 16129, 1028, 1026, 2132, 1028, 1026, 5896, 5034, 2278, 1027, 1000, 1012, 1012, 1013, 1012, 1012, 1013, 1012, 1012, 1013, 4219, 1013, 1046, 2015, 1011, 3231, 1012, 1046, 2015, 1000, 1028, 1026, 1013, 5896, 1028, 1026, 1013, 21...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * Copyright (C) 2012 Freescale Semiconductor, Inc. All Rights Reserved. */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include <linux/module.h> #include <linux/init.h> #include <linux/slab.h> #include <linux/ctype.h> #include <linux/types.h> #include <linux/delay.h> #include <linux/device.h> #include <linux/i2c.h> #include <linux/regulator/consumer.h> #include <linux/fsl_devices.h> #include <media/v4l2-chip-ident.h> #include <media/v4l2-int-device.h> #include "mxc_v4l2_capture.h" #define OV5642_VOLTAGE_ANALOG 2800000 #define OV5642_VOLTAGE_DIGITAL_CORE 1500000 #define OV5642_VOLTAGE_DIGITAL_IO 1800000 #define MIN_FPS 15 #define MAX_FPS 30 #define DEFAULT_FPS 30 #define OV5642_XCLK_MIN 6000000 #define OV5642_XCLK_MAX 24000000 #define OV5642_CHIP_ID_HIGH_BYTE 0x300A #define OV5642_CHIP_ID_LOW_BYTE 0x300B enum ov5642_mode { ov5642_mode_MIN = 0, ov5642_mode_VGA_640_480 = 0, ov5642_mode_QVGA_320_240 = 1, ov5642_mode_NTSC_720_480 = 2, ov5642_mode_PAL_720_576 = 3, ov5642_mode_720P_1280_720 = 4, ov5642_mode_1080P_1920_1080 = 5, ov5642_mode_QSXGA_2592_1944 = 6, ov5642_mode_QCIF_176_144 = 7, ov5642_mode_XGA_1024_768 = 8, ov5642_mode_MAX = 8 }; enum ov5642_frame_rate { ov5642_15_fps, ov5642_30_fps }; static int ov5642_framerates[] = { [ov5642_15_fps] = 15, [ov5642_30_fps] = 30, }; struct reg_value { u16 u16RegAddr; u8 u8Val; u8 u8Mask; u32 u32Delay_ms; }; struct ov5642_mode_info { enum ov5642_mode mode; u32 width; u32 height; struct reg_value *init_data_ptr; u32 init_data_size; }; /*! * Maintains the information on the current state of the sesor. */ static struct sensor_data ov5642_data; static struct reg_value ov5642_rotate_none_VGA[] = { {0x3818, 0xc1, 0x00, 0x00}, {0x3621, 0x87, 0x00, 0x00}, }; static struct reg_value ov5642_rotate_vert_flip_VGA[] = { {0x3818, 0x20, 0xbf, 0x00}, {0x3621, 0x20, 0xff, 0x00}, }; static struct reg_value ov5642_rotate_horiz_flip_VGA[] = { {0x3818, 0x81, 0x00, 0x01}, {0x3621, 0xa7, 0x00, 0x00}, }; static struct reg_value ov5642_rotate_180_VGA[] = { {0x3818, 0x60, 0xff, 0x00}, {0x3621, 0x00, 0xdf, 0x00}, }; static struct reg_value ov5642_rotate_none_FULL[] = { {0x3818, 0xc0, 0x00, 0x00}, {0x3621, 0x09, 0x00, 0x00}, }; static struct reg_value ov5642_rotate_vert_flip_FULL[] = { {0x3818, 0x20, 0xbf, 0x01}, {0x3621, 0x20, 0xff, 0x00}, }; static struct reg_value ov5642_rotate_horiz_flip_FULL[] = { {0x3818, 0x80, 0x00, 0x01}, {0x3621, 0x29, 0x00, 0x00}, }; static struct reg_value ov5642_rotate_180_FULL[] = { {0x3818, 0x60, 0xff, 0x00}, {0x3621, 0x00, 0xdf, 0x00}, }; static struct reg_value ov5642_initial_setting[] = { {0x3103, 0x93, 0, 0}, {0x3008, 0x82, 0, 0}, {0x3017, 0x7f, 0, 0}, {0x3018, 0xfc, 0, 0}, {0x3810, 0xc2, 0, 0}, {0x3615, 0xf0, 0, 0}, {0x3000, 0x00, 0, 0}, {0x3001, 0x00, 0, 0}, {0x3002, 0x5c, 0, 0}, {0x3003, 0x00, 0, 0}, {0x3004, 0xff, 0, 0}, {0x3005, 0xff, 0, 0}, {0x3006, 0x43, 0, 0}, {0x3007, 0x37, 0, 0}, {0x3011, 0x08, 0, 0}, {0x3010, 0x00, 0, 0}, {0x460c, 0x22, 0, 0}, {0x3815, 0x04, 0, 0}, {0x370c, 0xa0, 0, 0}, {0x3602, 0xfc, 0, 0}, {0x3612, 0xff, 0, 0}, {0x3634, 0xc0, 0, 0}, {0x3613, 0x00, 0, 0}, {0x3605, 0x7c, 0, 0}, {0x3621, 0x09, 0, 0}, {0x3622, 0x60, 0, 0}, {0x3604, 0x40, 0, 0}, {0x3603, 0xa7, 0, 0}, {0x3603, 0x27, 0, 0}, {0x4000, 0x21, 0, 0}, {0x401d, 0x22, 0, 0}, {0x3600, 0x54, 0, 0}, {0x3605, 0x04, 0, 0}, {0x3606, 0x3f, 0, 0}, {0x3c00, 0x04, 0, 0}, {0x3c01, 0x80, 0, 0}, {0x5000, 0x4f, 0, 0}, {0x5020, 0x04, 0, 0}, {0x5181, 0x79, 0, 0}, {0x5182, 0x00, 0, 0}, {0x5185, 0x22, 0, 0}, {0x5197, 0x01, 0, 0}, {0x5001, 0xff, 0, 0}, {0x5500, 0x0a, 0, 0}, {0x5504, 0x00, 0, 0}, {0x5505, 0x7f, 0, 0}, {0x5080, 0x08, 0, 0}, {0x300e, 0x18, 0, 0}, {0x4610, 0x00, 0, 0}, {0x471d, 0x05, 0, 0}, {0x4708, 0x06, 0, 0}, {0x3808, 0x02, 0, 0}, {0x3809, 0x80, 0, 0}, {0x380a, 0x01, 0, 0}, {0x380b, 0xe0, 0, 0}, {0x380e, 0x07, 0, 0}, {0x380f, 0xd0, 0, 0}, {0x501f, 0x00, 0, 0}, {0x5000, 0x4f, 0, 0}, {0x4300, 0x30, 0, 0}, {0x3503, 0x07, 0, 0}, {0x3501, 0x73, 0, 0}, {0x3502, 0x80, 0, 0}, {0x350b, 0x00, 0, 0}, {0x3503, 0x07, 0, 0}, {0x3824, 0x11, 0, 0}, {0x3501, 0x1e, 0, 0}, {0x3502, 0x80, 0, 0}, {0x350b, 0x7f, 0, 0}, {0x380c, 0x0c, 0, 0}, {0x380d, 0x80, 0, 0}, {0x380e, 0x03, 0, 0}, {0x380f, 0xe8, 0, 0}, {0x3a0d, 0x04, 0, 0}, {0x3a0e, 0x03, 0, 0}, {0x3818, 0xc1, 0, 0}, {0x3705, 0xdb, 0, 0}, {0x370a, 0x81, 0, 0}, {0x3801, 0x80, 0, 0}, {0x3621, 0x87, 0, 0}, {0x3801, 0x50, 0, 0}, {0x3803, 0x08, 0, 0}, {0x3827, 0x08, 0, 0}, {0x3810, 0x40, 0, 0}, {0x3804, 0x05, 0, 0}, {0x3805, 0x00, 0, 0}, {0x5682, 0x05, 0, 0}, {0x5683, 0x00, 0, 0}, {0x3806, 0x03, 0, 0}, {0x3807, 0xc0, 0, 0}, {0x5686, 0x03, 0, 0}, {0x5687, 0xbc, 0, 0}, {0x3a00, 0x78, 0, 0}, {0x3a1a, 0x05, 0, 0}, {0x3a13, 0x30, 0, 0}, {0x3a18, 0x00, 0, 0}, {0x3a19, 0x7c, 0, 0}, {0x3a08, 0x12, 0, 0}, {0x3a09, 0xc0, 0, 0}, {0x3a0a, 0x0f, 0, 0}, {0x3a0b, 0xa0, 0, 0}, {0x350c, 0x07, 0, 0}, {0x350d, 0xd0, 0, 0}, {0x3500, 0x00, 0, 0}, {0x3501, 0x00, 0, 0}, {0x3502, 0x00, 0, 0}, {0x350a, 0x00, 0, 0}, {0x350b, 0x00, 0, 0}, {0x3503, 0x00, 0, 0}, {0x528a, 0x02, 0, 0}, {0x528b, 0x04, 0, 0}, {0x528c, 0x08, 0, 0}, {0x528d, 0x08, 0, 0}, {0x528e, 0x08, 0, 0}, {0x528f, 0x10, 0, 0}, {0x5290, 0x10, 0, 0}, {0x5292, 0x00, 0, 0}, {0x5293, 0x02, 0, 0}, {0x5294, 0x00, 0, 0}, {0x5295, 0x02, 0, 0}, {0x5296, 0x00, 0, 0}, {0x5297, 0x02, 0, 0}, {0x5298, 0x00, 0, 0}, {0x5299, 0x02, 0, 0}, {0x529a, 0x00, 0, 0}, {0x529b, 0x02, 0, 0}, {0x529c, 0x00, 0, 0}, {0x529d, 0x02, 0, 0}, {0x529e, 0x00, 0, 0}, {0x529f, 0x02, 0, 0}, {0x3a0f, 0x3c, 0, 0}, {0x3a10, 0x30, 0, 0}, {0x3a1b, 0x3c, 0, 0}, {0x3a1e, 0x30, 0, 0}, {0x3a11, 0x70, 0, 0}, {0x3a1f, 0x10, 0, 0}, {0x3030, 0x0b, 0, 0}, {0x3a02, 0x00, 0, 0}, {0x3a03, 0x7d, 0, 0}, {0x3a04, 0x00, 0, 0}, {0x3a14, 0x00, 0, 0}, {0x3a15, 0x7d, 0, 0}, {0x3a16, 0x00, 0, 0}, {0x3a00, 0x78, 0, 0}, {0x5193, 0x70, 0, 0}, {0x589b, 0x04, 0, 0}, {0x589a, 0xc5, 0, 0}, {0x401e, 0x20, 0, 0}, {0x4001, 0x42, 0, 0}, {0x401c, 0x04, 0, 0}, {0x528a, 0x01, 0, 0}, {0x528b, 0x04, 0, 0}, {0x528c, 0x08, 0, 0}, {0x528d, 0x10, 0, 0}, {0x528e, 0x20, 0, 0}, {0x528f, 0x28, 0, 0}, {0x5290, 0x30, 0, 0}, {0x5292, 0x00, 0, 0}, {0x5293, 0x01, 0, 0}, {0x5294, 0x00, 0, 0}, {0x5295, 0x04, 0, 0}, {0x5296, 0x00, 0, 0}, {0x5297, 0x08, 0, 0}, {0x5298, 0x00, 0, 0}, {0x5299, 0x10, 0, 0}, {0x529a, 0x00, 0, 0}, {0x529b, 0x20, 0, 0}, {0x529c, 0x00, 0, 0}, {0x529d, 0x28, 0, 0}, {0x529e, 0x00, 0, 0}, {0x529f, 0x30, 0, 0}, {0x5282, 0x00, 0, 0}, {0x5300, 0x00, 0, 0}, {0x5301, 0x20, 0, 0}, {0x5302, 0x00, 0, 0}, {0x5303, 0x7c, 0, 0}, {0x530c, 0x00, 0, 0}, {0x530d, 0x0c, 0, 0}, {0x530e, 0x20, 0, 0}, {0x530f, 0x80, 0, 0}, {0x5310, 0x20, 0, 0}, {0x5311, 0x80, 0, 0}, {0x5308, 0x20, 0, 0}, {0x5309, 0x40, 0, 0}, {0x5304, 0x00, 0, 0}, {0x5305, 0x30, 0, 0}, {0x5306, 0x00, 0, 0}, {0x5307, 0x80, 0, 0}, {0x5314, 0x08, 0, 0}, {0x5315, 0x20, 0, 0}, {0x5319, 0x30, 0, 0}, {0x5316, 0x10, 0, 0}, {0x5317, 0x00, 0, 0}, {0x5318, 0x02, 0, 0}, {0x5380, 0x01, 0, 0}, {0x5381, 0x00, 0, 0}, {0x5382, 0x00, 0, 0}, {0x5383, 0x4e, 0, 0}, {0x5384, 0x00, 0, 0}, {0x5385, 0x0f, 0, 0}, {0x5386, 0x00, 0, 0}, {0x5387, 0x00, 0, 0}, {0x5388, 0x01, 0, 0}, {0x5389, 0x15, 0, 0}, {0x538a, 0x00, 0, 0}, {0x538b, 0x31, 0, 0}, {0x538c, 0x00, 0, 0}, {0x538d, 0x00, 0, 0}, {0x538e, 0x00, 0, 0}, {0x538f, 0x0f, 0, 0}, {0x5390, 0x00, 0, 0}, {0x5391, 0xab, 0, 0}, {0x5392, 0x00, 0, 0}, {0x5393, 0xa2, 0, 0}, {0x5394, 0x08, 0, 0}, {0x5480, 0x14, 0, 0}, {0x5481, 0x21, 0, 0}, {0x5482, 0x36, 0, 0}, {0x5483, 0x57, 0, 0}, {0x5484, 0x65, 0, 0}, {0x5485, 0x71, 0, 0}, {0x5486, 0x7d, 0, 0}, {0x5487, 0x87, 0, 0}, {0x5488, 0x91, 0, 0}, {0x5489, 0x9a, 0, 0}, {0x548a, 0xaa, 0, 0}, {0x548b, 0xb8, 0, 0}, {0x548c, 0xcd, 0, 0}, {0x548d, 0xdd, 0, 0}, {0x548e, 0xea, 0, 0}, {0x548f, 0x1d, 0, 0}, {0x5490, 0x05, 0, 0}, {0x5491, 0x00, 0, 0}, {0x5492, 0x04, 0, 0}, {0x5493, 0x20, 0, 0}, {0x5494, 0x03, 0, 0}, {0x5495, 0x60, 0, 0}, {0x5496, 0x02, 0, 0}, {0x5497, 0xb8, 0, 0}, {0x5498, 0x02, 0, 0}, {0x5499, 0x86, 0, 0}, {0x549a, 0x02, 0, 0}, {0x549b, 0x5b, 0, 0}, {0x549c, 0x02, 0, 0}, {0x549d, 0x3b, 0, 0}, {0x549e, 0x02, 0, 0}, {0x549f, 0x1c, 0, 0}, {0x54a0, 0x02, 0, 0}, {0x54a1, 0x04, 0, 0}, {0x54a2, 0x01, 0, 0}, {0x54a3, 0xed, 0, 0}, {0x54a4, 0x01, 0, 0}, {0x54a5, 0xc5, 0, 0}, {0x54a6, 0x01, 0, 0}, {0x54a7, 0xa5, 0, 0}, {0x54a8, 0x01, 0, 0}, {0x54a9, 0x6c, 0, 0}, {0x54aa, 0x01, 0, 0}, {0x54ab, 0x41, 0, 0}, {0x54ac, 0x01, 0, 0}, {0x54ad, 0x20, 0, 0}, {0x54ae, 0x00, 0, 0}, {0x54af, 0x16, 0, 0}, {0x54b0, 0x01, 0, 0}, {0x54b1, 0x20, 0, 0}, {0x54b2, 0x00, 0, 0}, {0x54b3, 0x10, 0, 0}, {0x54b4, 0x00, 0, 0}, {0x54b5, 0xf0, 0, 0}, {0x54b6, 0x00, 0, 0}, {0x54b7, 0xdf, 0, 0}, {0x5402, 0x3f, 0, 0}, {0x5403, 0x00, 0, 0}, {0x3406, 0x00, 0, 0}, {0x5180, 0xff, 0, 0}, {0x5181, 0x52, 0, 0}, {0x5182, 0x11, 0, 0}, {0x5183, 0x14, 0, 0}, {0x5184, 0x25, 0, 0}, {0x5185, 0x24, 0, 0}, {0x5186, 0x06, 0, 0}, {0x5187, 0x08, 0, 0}, {0x5188, 0x08, 0, 0}, {0x5189, 0x7c, 0, 0}, {0x518a, 0x60, 0, 0}, {0x518b, 0xb2, 0, 0}, {0x518c, 0xb2, 0, 0}, {0x518d, 0x44, 0, 0}, {0x518e, 0x3d, 0, 0}, {0x518f, 0x58, 0, 0}, {0x5190, 0x46, 0, 0}, {0x5191, 0xf8, 0, 0}, {0x5192, 0x04, 0, 0}, {0x5193, 0x70, 0, 0}, {0x5194, 0xf0, 0, 0}, {0x5195, 0xf0, 0, 0}, {0x5196, 0x03, 0, 0}, {0x5197, 0x01, 0, 0}, {0x5198, 0x04, 0, 0}, {0x5199, 0x12, 0, 0}, {0x519a, 0x04, 0, 0}, {0x519b, 0x00, 0, 0}, {0x519c, 0x06, 0, 0}, {0x519d, 0x82, 0, 0}, {0x519e, 0x00, 0, 0}, {0x5025, 0x80, 0, 0}, {0x3a0f, 0x38, 0, 0}, {0x3a10, 0x30, 0, 0}, {0x3a1b, 0x3a, 0, 0}, {0x3a1e, 0x2e, 0, 0}, {0x3a11, 0x60, 0, 0}, {0x3a1f, 0x10, 0, 0}, {0x5688, 0xa6, 0, 0}, {0x5689, 0x6a, 0, 0}, {0x568a, 0xea, 0, 0}, {0x568b, 0xae, 0, 0}, {0x568c, 0xa6, 0, 0}, {0x568d, 0x6a, 0, 0}, {0x568e, 0x62, 0, 0}, {0x568f, 0x26, 0, 0}, {0x5583, 0x40, 0, 0}, {0x5584, 0x40, 0, 0}, {0x5580, 0x02, 0, 0}, {0x5000, 0xcf, 0, 0}, {0x5800, 0x27, 0, 0}, {0x5801, 0x19, 0, 0}, {0x5802, 0x12, 0, 0}, {0x5803, 0x0f, 0, 0}, {0x5804, 0x10, 0, 0}, {0x5805, 0x15, 0, 0}, {0x5806, 0x1e, 0, 0}, {0x5807, 0x2f, 0, 0}, {0x5808, 0x15, 0, 0}, {0x5809, 0x0d, 0, 0}, {0x580a, 0x0a, 0, 0}, {0x580b, 0x09, 0, 0}, {0x580c, 0x0a, 0, 0}, {0x580d, 0x0c, 0, 0}, {0x580e, 0x12, 0, 0}, {0x580f, 0x19, 0, 0}, {0x5810, 0x0b, 0, 0}, {0x5811, 0x07, 0, 0}, {0x5812, 0x04, 0, 0}, {0x5813, 0x03, 0, 0}, {0x5814, 0x03, 0, 0}, {0x5815, 0x06, 0, 0}, {0x5816, 0x0a, 0, 0}, {0x5817, 0x0f, 0, 0}, {0x5818, 0x0a, 0, 0}, {0x5819, 0x05, 0, 0}, {0x581a, 0x01, 0, 0}, {0x581b, 0x00, 0, 0}, {0x581c, 0x00, 0, 0}, {0x581d, 0x03, 0, 0}, {0x581e, 0x08, 0, 0}, {0x581f, 0x0c, 0, 0}, {0x5820, 0x0a, 0, 0}, {0x5821, 0x05, 0, 0}, {0x5822, 0x01, 0, 0}, {0x5823, 0x00, 0, 0}, {0x5824, 0x00, 0, 0}, {0x5825, 0x03, 0, 0}, {0x5826, 0x08, 0, 0}, {0x5827, 0x0c, 0, 0}, {0x5828, 0x0e, 0, 0}, {0x5829, 0x08, 0, 0}, {0x582a, 0x06, 0, 0}, {0x582b, 0x04, 0, 0}, {0x582c, 0x05, 0, 0}, {0x582d, 0x07, 0, 0}, {0x582e, 0x0b, 0, 0}, {0x582f, 0x12, 0, 0}, {0x5830, 0x18, 0, 0}, {0x5831, 0x10, 0, 0}, {0x5832, 0x0c, 0, 0}, {0x5833, 0x0a, 0, 0}, {0x5834, 0x0b, 0, 0}, {0x5835, 0x0e, 0, 0}, {0x5836, 0x15, 0, 0}, {0x5837, 0x19, 0, 0}, {0x5838, 0x32, 0, 0}, {0x5839, 0x1f, 0, 0}, {0x583a, 0x18, 0, 0}, {0x583b, 0x16, 0, 0}, {0x583c, 0x17, 0, 0}, {0x583d, 0x1e, 0, 0}, {0x583e, 0x26, 0, 0}, {0x583f, 0x53, 0, 0}, {0x5840, 0x10, 0, 0}, {0x5841, 0x0f, 0, 0}, {0x5842, 0x0d, 0, 0}, {0x5843, 0x0c, 0, 0}, {0x5844, 0x0e, 0, 0}, {0x5845, 0x09, 0, 0}, {0x5846, 0x11, 0, 0}, {0x5847, 0x10, 0, 0}, {0x5848, 0x10, 0, 0}, {0x5849, 0x10, 0, 0}, {0x584a, 0x10, 0, 0}, {0x584b, 0x0e, 0, 0}, {0x584c, 0x10, 0, 0}, {0x584d, 0x10, 0, 0}, {0x584e, 0x11, 0, 0}, {0x584f, 0x10, 0, 0}, {0x5850, 0x0f, 0, 0}, {0x5851, 0x0c, 0, 0}, {0x5852, 0x0f, 0, 0}, {0x5853, 0x10, 0, 0}, {0x5854, 0x10, 0, 0}, {0x5855, 0x0f, 0, 0}, {0x5856, 0x0e, 0, 0}, {0x5857, 0x0b, 0, 0}, {0x5858, 0x10, 0, 0}, {0x5859, 0x0d, 0, 0}, {0x585a, 0x0d, 0, 0}, {0x585b, 0x0c, 0, 0}, {0x585c, 0x0c, 0, 0}, {0x585d, 0x0c, 0, 0}, {0x585e, 0x0b, 0, 0}, {0x585f, 0x0c, 0, 0}, {0x5860, 0x0c, 0, 0}, {0x5861, 0x0c, 0, 0}, {0x5862, 0x0d, 0, 0}, {0x5863, 0x08, 0, 0}, {0x5864, 0x11, 0, 0}, {0x5865, 0x18, 0, 0}, {0x5866, 0x18, 0, 0}, {0x5867, 0x19, 0, 0}, {0x5868, 0x17, 0, 0}, {0x5869, 0x19, 0, 0}, {0x586a, 0x16, 0, 0}, {0x586b, 0x13, 0, 0}, {0x586c, 0x13, 0, 0}, {0x586d, 0x12, 0, 0}, {0x586e, 0x13, 0, 0}, {0x586f, 0x16, 0, 0}, {0x5870, 0x14, 0, 0}, {0x5871, 0x12, 0, 0}, {0x5872, 0x10, 0, 0}, {0x5873, 0x11, 0, 0}, {0x5874, 0x11, 0, 0}, {0x5875, 0x16, 0, 0}, {0x5876, 0x14, 0, 0}, {0x5877, 0x11, 0, 0}, {0x5878, 0x10, 0, 0}, {0x5879, 0x0f, 0, 0}, {0x587a, 0x10, 0, 0}, {0x587b, 0x14, 0, 0}, {0x587c, 0x13, 0, 0}, {0x587d, 0x12, 0, 0}, {0x587e, 0x11, 0, 0}, {0x587f, 0x11, 0, 0}, {0x5880, 0x12, 0, 0}, {0x5881, 0x15, 0, 0}, {0x5882, 0x14, 0, 0}, {0x5883, 0x15, 0, 0}, {0x5884, 0x15, 0, 0}, {0x5885, 0x15, 0, 0}, {0x5886, 0x13, 0, 0}, {0x5887, 0x17, 0, 0}, {0x3710, 0x10, 0, 0}, {0x3632, 0x51, 0, 0}, {0x3702, 0x10, 0, 0}, {0x3703, 0xb2, 0, 0}, {0x3704, 0x18, 0, 0}, {0x370b, 0x40, 0, 0}, {0x370d, 0x03, 0, 0}, {0x3631, 0x01, 0, 0}, {0x3632, 0x52, 0, 0}, {0x3606, 0x24, 0, 0}, {0x3620, 0x96, 0, 0}, {0x5785, 0x07, 0, 0}, {0x3a13, 0x30, 0, 0}, {0x3600, 0x52, 0, 0}, {0x3604, 0x48, 0, 0}, {0x3606, 0x1b, 0, 0}, {0x370d, 0x0b, 0, 0}, {0x370f, 0xc0, 0, 0}, {0x3709, 0x01, 0, 0}, {0x3823, 0x00, 0, 0}, {0x5007, 0x00, 0, 0}, {0x5009, 0x00, 0, 0}, {0x5011, 0x00, 0, 0}, {0x5013, 0x00, 0, 0}, {0x519e, 0x00, 0, 0}, {0x5086, 0x00, 0, 0}, {0x5087, 0x00, 0, 0}, {0x5088, 0x00, 0, 0}, {0x5089, 0x00, 0, 0}, {0x302b, 0x00, 0, 300}, }; static struct reg_value ov5642_setting_15fps_QCIF_176_144[] = { {0x3103, 0x93, 0, 0}, {0x3008, 0x82, 0, 0}, {0x3017, 0x7f, 0, 0}, {0x3018, 0xfc, 0, 0}, {0x3810, 0xc2, 0, 0}, {0x3615, 0xf0, 0, 0}, {0x3000, 0x00, 0, 0}, {0x3001, 0x00, 0, 0}, {0x3002, 0x5c, 0, 0}, {0x3003, 0x00, 0, 0}, {0x3004, 0xff, 0, 0}, {0x3005, 0xff, 0, 0}, {0x3006, 0x43, 0, 0}, {0x3007, 0x37, 0, 0}, {0x3011, 0x08, 0, 0}, {0x3010, 0x10, 0, 0}, {0x460c, 0x22, 0, 0}, {0x3815, 0x04, 0, 0}, {0x370c, 0xa0, 0, 0}, {0x3602, 0xfc, 0, 0}, {0x3612, 0xff, 0, 0}, {0x3634, 0xc0, 0, 0}, {0x3613, 0x00, 0, 0}, {0x3605, 0x7c, 0, 0}, {0x3621, 0x09, 0, 0}, {0x3622, 0x60, 0, 0}, {0x3604, 0x40, 0, 0}, {0x3603, 0xa7, 0, 0}, {0x3603, 0x27, 0, 0}, {0x4000, 0x21, 0, 0}, {0x401d, 0x22, 0, 0}, {0x3600, 0x54, 0, 0}, {0x3605, 0x04, 0, 0}, {0x3606, 0x3f, 0, 0}, {0x3c01, 0x80, 0, 0}, {0x5000, 0x4f, 0, 0}, {0x5020, 0x04, 0, 0}, {0x5181, 0x79, 0, 0}, {0x5182, 0x00, 0, 0}, {0x5185, 0x22, 0, 0}, {0x5197, 0x01, 0, 0}, {0x5001, 0xff, 0, 0}, {0x5500, 0x0a, 0, 0}, {0x5504, 0x00, 0, 0}, {0x5505, 0x7f, 0, 0}, {0x5080, 0x08, 0, 0}, {0x300e, 0x18, 0, 0}, {0x4610, 0x00, 0, 0}, {0x471d, 0x05, 0, 0}, {0x4708, 0x06, 0, 0}, {0x3808, 0x02, 0, 0}, {0x3809, 0x80, 0, 0}, {0x380a, 0x01, 0, 0}, {0x380b, 0xe0, 0, 0}, {0x380e, 0x07, 0, 0}, {0x380f, 0xd0, 0, 0}, {0x501f, 0x00, 0, 0}, {0x5000, 0x4f, 0, 0}, {0x4300, 0x30, 0, 0}, {0x3503, 0x07, 0, 0}, {0x3501, 0x73, 0, 0}, {0x3502, 0x80, 0, 0}, {0x350b, 0x00, 0, 0}, {0x3503, 0x07, 0, 0}, {0x3824, 0x11, 0, 0}, {0x3501, 0x1e, 0, 0}, {0x3502, 0x80, 0, 0}, {0x350b, 0x7f, 0, 0}, {0x380c, 0x0c, 0, 0}, {0x380d, 0x80, 0, 0}, {0x380e, 0x03, 0, 0}, {0x380f, 0xe8, 0, 0}, {0x3a0d, 0x04, 0, 0}, {0x3a0e, 0x03, 0, 0}, {0x3818, 0xc1, 0, 0}, {0x3705, 0xdb, 0, 0}, {0x370a, 0x81, 0, 0}, {0x3801, 0x80, 0, 0}, {0x3621, 0x87, 0, 0}, {0x3801, 0x50, 0, 0}, {0x3803, 0x08, 0, 0}, {0x3827, 0x08, 0, 0}, {0x3810, 0x40, 0, 0}, {0x3804, 0x05, 0, 0}, {0x3805, 0x00, 0, 0}, {0x5682, 0x05, 0, 0}, {0x5683, 0x00, 0, 0}, {0x3806, 0x03, 0, 0}, {0x3807, 0xc0, 0, 0}, {0x5686, 0x03, 0, 0}, {0x5687, 0xbc, 0, 0}, {0x3a00, 0x78, 0, 0}, {0x3a1a, 0x05, 0, 0}, {0x3a13, 0x30, 0, 0}, {0x3a18, 0x00, 0, 0}, {0x3a19, 0x7c, 0, 0}, {0x3a08, 0x12, 0, 0}, {0x3a09, 0xc0, 0, 0}, {0x3a0a, 0x0f, 0, 0}, {0x3a0b, 0xa0, 0, 0}, {0x350c, 0x07, 0, 0}, {0x350d, 0xd0, 0, 0}, {0x3500, 0x00, 0, 0}, {0x3501, 0x00, 0, 0}, {0x3502, 0x00, 0, 0}, {0x350a, 0x00, 0, 0}, {0x350b, 0x00, 0, 0}, {0x3503, 0x00, 0, 0}, {0x528a, 0x02, 0, 0}, {0x528b, 0x04, 0, 0}, {0x528c, 0x08, 0, 0}, {0x528d, 0x08, 0, 0}, {0x528e, 0x08, 0, 0}, {0x528f, 0x10, 0, 0}, {0x5290, 0x10, 0, 0}, {0x5292, 0x00, 0, 0}, {0x5293, 0x02, 0, 0}, {0x5294, 0x00, 0, 0}, {0x5295, 0x02, 0, 0}, {0x5296, 0x00, 0, 0}, {0x5297, 0x02, 0, 0}, {0x5298, 0x00, 0, 0}, {0x5299, 0x02, 0, 0}, {0x529a, 0x00, 0, 0}, {0x529b, 0x02, 0, 0}, {0x529c, 0x00, 0, 0}, {0x529d, 0x02, 0, 0}, {0x529e, 0x00, 0, 0}, {0x529f, 0x02, 0, 0}, {0x3a0f, 0x3c, 0, 0}, {0x3a10, 0x30, 0, 0}, {0x3a1b, 0x3c, 0, 0}, {0x3a1e, 0x30, 0, 0}, {0x3a11, 0x70, 0, 0}, {0x3a1f, 0x10, 0, 0}, {0x3030, 0x2b, 0, 0}, {0x3a02, 0x00, 0, 0}, {0x3a03, 0x7d, 0, 0}, {0x3a04, 0x00, 0, 0}, {0x3a14, 0x00, 0, 0}, {0x3a15, 0x7d, 0, 0}, {0x3a16, 0x00, 0, 0}, {0x3a00, 0x78, 0, 0}, {0x3a08, 0x09, 0, 0}, {0x3a09, 0x60, 0, 0}, {0x3a0a, 0x07, 0, 0}, {0x3a0b, 0xd0, 0, 0}, {0x3a0d, 0x08, 0, 0}, {0x3a0e, 0x06, 0, 0}, {0x5193, 0x70, 0, 0}, {0x589b, 0x04, 0, 0}, {0x589a, 0xc5, 0, 0}, {0x401e, 0x20, 0, 0}, {0x4001, 0x42, 0, 0}, {0x401c, 0x04, 0, 0}, {0x528a, 0x01, 0, 0}, {0x528b, 0x04, 0, 0}, {0x528c, 0x08, 0, 0}, {0x528d, 0x10, 0, 0}, {0x528e, 0x20, 0, 0}, {0x528f, 0x28, 0, 0}, {0x5290, 0x30, 0, 0}, {0x5292, 0x00, 0, 0}, {0x5293, 0x01, 0, 0}, {0x5294, 0x00, 0, 0}, {0x5295, 0x04, 0, 0}, {0x5296, 0x00, 0, 0}, {0x5297, 0x08, 0, 0}, {0x5298, 0x00, 0, 0}, {0x5299, 0x10, 0, 0}, {0x529a, 0x00, 0, 0}, {0x529b, 0x20, 0, 0}, {0x529c, 0x00, 0, 0}, {0x529d, 0x28, 0, 0}, {0x529e, 0x00, 0, 0}, {0x529f, 0x30, 0, 0}, {0x5282, 0x00, 0, 0}, {0x5300, 0x00, 0, 0}, {0x5301, 0x20, 0, 0}, {0x5302, 0x00, 0, 0}, {0x5303, 0x7c, 0, 0}, {0x530c, 0x00, 0, 0}, {0x530d, 0x0c, 0, 0}, {0x530e, 0x20, 0, 0}, {0x530f, 0x80, 0, 0}, {0x5310, 0x20, 0, 0}, {0x5311, 0x80, 0, 0}, {0x5308, 0x20, 0, 0}, {0x5309, 0x40, 0, 0}, {0x5304, 0x00, 0, 0}, {0x5305, 0x30, 0, 0}, {0x5306, 0x00, 0, 0}, {0x5307, 0x80, 0, 0}, {0x5314, 0x08, 0, 0}, {0x5315, 0x20, 0, 0}, {0x5319, 0x30, 0, 0}, {0x5316, 0x10, 0, 0}, {0x5317, 0x00, 0, 0}, {0x5318, 0x02, 0, 0}, {0x5380, 0x01, 0, 0}, {0x5381, 0x00, 0, 0}, {0x5382, 0x00, 0, 0}, {0x5383, 0x4e, 0, 0}, {0x5384, 0x00, 0, 0}, {0x5385, 0x0f, 0, 0}, {0x5386, 0x00, 0, 0}, {0x5387, 0x00, 0, 0}, {0x5388, 0x01, 0, 0}, {0x5389, 0x15, 0, 0}, {0x538a, 0x00, 0, 0}, {0x538b, 0x31, 0, 0}, {0x538c, 0x00, 0, 0}, {0x538d, 0x00, 0, 0}, {0x538e, 0x00, 0, 0}, {0x538f, 0x0f, 0, 0}, {0x5390, 0x00, 0, 0}, {0x5391, 0xab, 0, 0}, {0x5392, 0x00, 0, 0}, {0x5393, 0xa2, 0, 0}, {0x5394, 0x08, 0, 0}, {0x5480, 0x14, 0, 0}, {0x5481, 0x21, 0, 0}, {0x5482, 0x36, 0, 0}, {0x5483, 0x57, 0, 0}, {0x5484, 0x65, 0, 0}, {0x5485, 0x71, 0, 0}, {0x5486, 0x7d, 0, 0}, {0x5487, 0x87, 0, 0}, {0x5488, 0x91, 0, 0}, {0x5489, 0x9a, 0, 0}, {0x548a, 0xaa, 0, 0}, {0x548b, 0xb8, 0, 0}, {0x548c, 0xcd, 0, 0}, {0x548d, 0xdd, 0, 0}, {0x548e, 0xea, 0, 0}, {0x548f, 0x1d, 0, 0}, {0x5490, 0x05, 0, 0}, {0x5491, 0x00, 0, 0}, {0x5492, 0x04, 0, 0}, {0x5493, 0x20, 0, 0}, {0x5494, 0x03, 0, 0}, {0x5495, 0x60, 0, 0}, {0x5496, 0x02, 0, 0}, {0x5497, 0xb8, 0, 0}, {0x5498, 0x02, 0, 0}, {0x5499, 0x86, 0, 0}, {0x549a, 0x02, 0, 0}, {0x549b, 0x5b, 0, 0}, {0x549c, 0x02, 0, 0}, {0x549d, 0x3b, 0, 0}, {0x549e, 0x02, 0, 0}, {0x549f, 0x1c, 0, 0}, {0x54a0, 0x02, 0, 0}, {0x54a1, 0x04, 0, 0}, {0x54a2, 0x01, 0, 0}, {0x54a3, 0xed, 0, 0}, {0x54a4, 0x01, 0, 0}, {0x54a5, 0xc5, 0, 0}, {0x54a6, 0x01, 0, 0}, {0x54a7, 0xa5, 0, 0}, {0x54a8, 0x01, 0, 0}, {0x54a9, 0x6c, 0, 0}, {0x54aa, 0x01, 0, 0}, {0x54ab, 0x41, 0, 0}, {0x54ac, 0x01, 0, 0}, {0x54ad, 0x20, 0, 0}, {0x54ae, 0x00, 0, 0}, {0x54af, 0x16, 0, 0}, {0x54b0, 0x01, 0, 0}, {0x54b1, 0x20, 0, 0}, {0x54b2, 0x00, 0, 0}, {0x54b3, 0x10, 0, 0}, {0x54b4, 0x00, 0, 0}, {0x54b5, 0xf0, 0, 0}, {0x54b6, 0x00, 0, 0}, {0x54b7, 0xdf, 0, 0}, {0x5402, 0x3f, 0, 0}, {0x5403, 0x00, 0, 0}, {0x3406, 0x00, 0, 0}, {0x5180, 0xff, 0, 0}, {0x5181, 0x52, 0, 0}, {0x5182, 0x11, 0, 0}, {0x5183, 0x14, 0, 0}, {0x5184, 0x25, 0, 0}, {0x5185, 0x24, 0, 0}, {0x5186, 0x06, 0, 0}, {0x5187, 0x08, 0, 0}, {0x5188, 0x08, 0, 0}, {0x5189, 0x7c, 0, 0}, {0x518a, 0x60, 0, 0}, {0x518b, 0xb2, 0, 0}, {0x518c, 0xb2, 0, 0}, {0x518d, 0x44, 0, 0}, {0x518e, 0x3d, 0, 0}, {0x518f, 0x58, 0, 0}, {0x5190, 0x46, 0, 0}, {0x5191, 0xf8, 0, 0}, {0x5192, 0x04, 0, 0}, {0x5193, 0x70, 0, 0}, {0x5194, 0xf0, 0, 0}, {0x5195, 0xf0, 0, 0}, {0x5196, 0x03, 0, 0}, {0x5197, 0x01, 0, 0}, {0x5198, 0x04, 0, 0}, {0x5199, 0x12, 0, 0}, {0x519a, 0x04, 0, 0}, {0x519b, 0x00, 0, 0}, {0x519c, 0x06, 0, 0}, {0x519d, 0x82, 0, 0}, {0x519e, 0x00, 0, 0}, {0x5025, 0x80, 0, 0}, {0x3a0f, 0x38, 0, 0}, {0x3a10, 0x30, 0, 0}, {0x3a1b, 0x3a, 0, 0}, {0x3a1e, 0x2e, 0, 0}, {0x3a11, 0x60, 0, 0}, {0x3a1f, 0x10, 0, 0}, {0x5688, 0xa6, 0, 0}, {0x5689, 0x6a, 0, 0}, {0x568a, 0xea, 0, 0}, {0x568b, 0xae, 0, 0}, {0x568c, 0xa6, 0, 0}, {0x568d, 0x6a, 0, 0}, {0x568e, 0x62, 0, 0}, {0x568f, 0x26, 0, 0}, {0x5583, 0x40, 0, 0}, {0x5584, 0x40, 0, 0}, {0x5580, 0x02, 0, 0}, {0x5000, 0xcf, 0, 0}, {0x5800, 0x27, 0, 0}, {0x5801, 0x19, 0, 0}, {0x5802, 0x12, 0, 0}, {0x5803, 0x0f, 0, 0}, {0x5804, 0x10, 0, 0}, {0x5805, 0x15, 0, 0}, {0x5806, 0x1e, 0, 0}, {0x5807, 0x2f, 0, 0}, {0x5808, 0x15, 0, 0}, {0x5809, 0x0d, 0, 0}, {0x580a, 0x0a, 0, 0}, {0x580b, 0x09, 0, 0}, {0x580c, 0x0a, 0, 0}, {0x580d, 0x0c, 0, 0}, {0x580e, 0x12, 0, 0}, {0x580f, 0x19, 0, 0}, {0x5810, 0x0b, 0, 0}, {0x5811, 0x07, 0, 0}, {0x5812, 0x04, 0, 0}, {0x5813, 0x03, 0, 0}, {0x5814, 0x03, 0, 0}, {0x5815, 0x06, 0, 0}, {0x5816, 0x0a, 0, 0}, {0x5817, 0x0f, 0, 0}, {0x5818, 0x0a, 0, 0}, {0x5819, 0x05, 0, 0}, {0x581a, 0x01, 0, 0}, {0x581b, 0x00, 0, 0}, {0x581c, 0x00, 0, 0}, {0x581d, 0x03, 0, 0}, {0x581e, 0x08, 0, 0}, {0x581f, 0x0c, 0, 0}, {0x5820, 0x0a, 0, 0}, {0x5821, 0x05, 0, 0}, {0x5822, 0x01, 0, 0}, {0x5823, 0x00, 0, 0}, {0x5824, 0x00, 0, 0}, {0x5825, 0x03, 0, 0}, {0x5826, 0x08, 0, 0}, {0x5827, 0x0c, 0, 0}, {0x5828, 0x0e, 0, 0}, {0x5829, 0x08, 0, 0}, {0x582a, 0x06, 0, 0}, {0x582b, 0x04, 0, 0}, {0x582c, 0x05, 0, 0}, {0x582d, 0x07, 0, 0}, {0x582e, 0x0b, 0, 0}, {0x582f, 0x12, 0, 0}, {0x5830, 0x18, 0, 0}, {0x5831, 0x10, 0, 0}, {0x5832, 0x0c, 0, 0}, {0x5833, 0x0a, 0, 0}, {0x5834, 0x0b, 0, 0}, {0x5835, 0x0e, 0, 0}, {0x5836, 0x15, 0, 0}, {0x5837, 0x19, 0, 0}, {0x5838, 0x32, 0, 0}, {0x5839, 0x1f, 0, 0}, {0x583a, 0x18, 0, 0}, {0x583b, 0x16, 0, 0}, {0x583c, 0x17, 0, 0}, {0x583d, 0x1e, 0, 0}, {0x583e, 0x26, 0, 0}, {0x583f, 0x53, 0, 0}, {0x5840, 0x10, 0, 0}, {0x5841, 0x0f, 0, 0}, {0x5842, 0x0d, 0, 0}, {0x5843, 0x0c, 0, 0}, {0x5844, 0x0e, 0, 0}, {0x5845, 0x09, 0, 0}, {0x5846, 0x11, 0, 0}, {0x5847, 0x10, 0, 0}, {0x5848, 0x10, 0, 0}, {0x5849, 0x10, 0, 0}, {0x584a, 0x10, 0, 0}, {0x584b, 0x0e, 0, 0}, {0x584c, 0x10, 0, 0}, {0x584d, 0x10, 0, 0}, {0x584e, 0x11, 0, 0}, {0x584f, 0x10, 0, 0}, {0x5850, 0x0f, 0, 0}, {0x5851, 0x0c, 0, 0}, {0x5852, 0x0f, 0, 0}, {0x5853, 0x10, 0, 0}, {0x5854, 0x10, 0, 0}, {0x5855, 0x0f, 0, 0}, {0x5856, 0x0e, 0, 0}, {0x5857, 0x0b, 0, 0}, {0x5858, 0x10, 0, 0}, {0x5859, 0x0d, 0, 0}, {0x585a, 0x0d, 0, 0}, {0x585b, 0x0c, 0, 0}, {0x585c, 0x0c, 0, 0}, {0x585d, 0x0c, 0, 0}, {0x585e, 0x0b, 0, 0}, {0x585f, 0x0c, 0, 0}, {0x5860, 0x0c, 0, 0}, {0x5861, 0x0c, 0, 0}, {0x5862, 0x0d, 0, 0}, {0x5863, 0x08, 0, 0}, {0x5864, 0x11, 0, 0}, {0x5865, 0x18, 0, 0}, {0x5866, 0x18, 0, 0}, {0x5867, 0x19, 0, 0}, {0x5868, 0x17, 0, 0}, {0x5869, 0x19, 0, 0}, {0x586a, 0x16, 0, 0}, {0x586b, 0x13, 0, 0}, {0x586c, 0x13, 0, 0}, {0x586d, 0x12, 0, 0}, {0x586e, 0x13, 0, 0}, {0x586f, 0x16, 0, 0}, {0x5870, 0x14, 0, 0}, {0x5871, 0x12, 0, 0}, {0x5872, 0x10, 0, 0}, {0x5873, 0x11, 0, 0}, {0x5874, 0x11, 0, 0}, {0x5875, 0x16, 0, 0}, {0x5876, 0x14, 0, 0}, {0x5877, 0x11, 0, 0}, {0x5878, 0x10, 0, 0}, {0x5879, 0x0f, 0, 0}, {0x587a, 0x10, 0, 0}, {0x587b, 0x14, 0, 0}, {0x587c, 0x13, 0, 0}, {0x587d, 0x12, 0, 0}, {0x587e, 0x11, 0, 0}, {0x587f, 0x11, 0, 0}, {0x5880, 0x12, 0, 0}, {0x5881, 0x15, 0, 0}, {0x5882, 0x14, 0, 0}, {0x5883, 0x15, 0, 0}, {0x5884, 0x15, 0, 0}, {0x5885, 0x15, 0, 0}, {0x5886, 0x13, 0, 0}, {0x5887, 0x17, 0, 0}, {0x3710, 0x10, 0, 0}, {0x3632, 0x51, 0, 0}, {0x3702, 0x10, 0, 0}, {0x3703, 0xb2, 0, 0}, {0x3704, 0x18, 0, 0}, {0x370b, 0x40, 0, 0}, {0x370d, 0x03, 0, 0}, {0x3631, 0x01, 0, 0}, {0x3632, 0x52, 0, 0}, {0x3606, 0x24, 0, 0}, {0x3620, 0x96, 0, 0}, {0x5785, 0x07, 0, 0}, {0x3a13, 0x30, 0, 0}, {0x3600, 0x52, 0, 0}, {0x3604, 0x48, 0, 0}, {0x3606, 0x1b, 0, 0}, {0x370d, 0x0b, 0, 0}, {0x370f, 0xc0, 0, 0}, {0x3709, 0x01, 0, 0}, {0x3823, 0x00, 0, 0}, {0x5007, 0x00, 0, 0}, {0x5009, 0x00, 0, 0}, {0x5011, 0x00, 0, 0}, {0x5013, 0x00, 0, 0}, {0x519e, 0x00, 0, 0}, {0x5086, 0x00, 0, 0}, {0x5087, 0x00, 0, 0}, {0x5088, 0x00, 0, 0}, {0x5089, 0x00, 0, 0}, {0x302b, 0x00, 0, 0}, {0x3808, 0x00, 0, 0}, {0x3809, 0xb0, 0, 0}, {0x380a, 0x00, 0, 0}, {0x380b, 0x90, 0, 0}, {0x3a00, 0x78, 0, 0}, }; static struct reg_value ov5642_setting_30fps_QCIF_176_144[] = { {0x3103, 0x93, 0, 0}, {0x3008, 0x82, 0, 0}, {0x3017, 0x7f, 0, 0}, {0x3018, 0xfc, 0, 0}, {0x3810, 0xc2, 0, 0}, {0x3615, 0xf0, 0, 0}, {0x3000, 0x00, 0, 0}, {0x3001, 0x00, 0, 0}, {0x3002, 0x5c, 0, 0}, {0x3003, 0x00, 0, 0}, {0x3004, 0xff, 0, 0}, {0x3005, 0xff, 0, 0}, {0x3006, 0x43, 0, 0}, {0x3007, 0x37, 0, 0}, {0x3011, 0x10, 0, 0}, {0x3010, 0x10, 0, 0}, {0x460c, 0x22, 0, 0}, {0x3815, 0x04, 0, 0}, {0x370c, 0xa0, 0, 0}, {0x3602, 0xfc, 0, 0}, {0x3612, 0xff, 0, 0}, {0x3634, 0xc0, 0, 0}, {0x3613, 0x00, 0, 0}, {0x3605, 0x7c, 0, 0}, {0x3621, 0x09, 0, 0}, {0x3622, 0x60, 0, 0}, {0x3604, 0x40, 0, 0}, {0x3603, 0xa7, 0, 0}, {0x3603, 0x27, 0, 0}, {0x4000, 0x21, 0, 0}, {0x401d, 0x22, 0, 0}, {0x3600, 0x54, 0, 0}, {0x3605, 0x04, 0, 0}, {0x3606, 0x3f, 0, 0}, {0x3c01, 0x80, 0, 0}, {0x5000, 0x4f, 0, 0}, {0x5020, 0x04, 0, 0}, {0x5181, 0x79, 0, 0}, {0x5182, 0x00, 0, 0}, {0x5185, 0x22, 0, 0}, {0x5197, 0x01, 0, 0}, {0x5001, 0xff, 0, 0}, {0x5500, 0x0a, 0, 0}, {0x5504, 0x00, 0, 0}, {0x5505, 0x7f, 0, 0}, {0x5080, 0x08, 0, 0}, {0x300e, 0x18, 0, 0}, {0x4610, 0x00, 0, 0}, {0x471d, 0x05, 0, 0}, {0x4708, 0x06, 0, 0}, {0x3808, 0x02, 0, 0}, {0x3809, 0x80, 0, 0}, {0x380a, 0x01, 0, 0}, {0x380b, 0xe0, 0, 0}, {0x380e, 0x07, 0, 0}, {0x380f, 0xd0, 0, 0}, {0x501f, 0x00, 0, 0}, {0x5000, 0x4f, 0, 0}, {0x4300, 0x30, 0, 0}, {0x3503, 0x07, 0, 0}, {0x3501, 0x73, 0, 0}, {0x3502, 0x80, 0, 0}, {0x350b, 0x00, 0, 0}, {0x3503, 0x07, 0, 0}, {0x3824, 0x11, 0, 0}, {0x3501, 0x1e, 0, 0}, {0x3502, 0x80, 0, 0}, {0x350b, 0x7f, 0, 0}, {0x380c, 0x0c, 0, 0}, {0x380d, 0x80, 0, 0}, {0x380e, 0x03, 0, 0}, {0x380f, 0xe8, 0, 0}, {0x3a0d, 0x04, 0, 0}, {0x3a0e, 0x03, 0, 0}, {0x3818, 0xc1, 0, 0}, {0x3705, 0xdb, 0, 0}, {0x370a, 0x81, 0, 0}, {0x3801, 0x80, 0, 0}, {0x3621, 0x87, 0, 0}, {0x3801, 0x50, 0, 0}, {0x3803, 0x08, 0, 0}, {0x3827, 0x08, 0, 0}, {0x3810, 0x40, 0, 0}, {0x3804, 0x05, 0, 0}, {0x3805, 0x00, 0, 0}, {0x5682, 0x05, 0, 0}, {0x5683, 0x00, 0, 0}, {0x3806, 0x03, 0, 0}, {0x3807, 0xc0, 0, 0}, {0x5686, 0x03, 0, 0}, {0x5687, 0xbc, 0, 0}, {0x3a00, 0x78, 0, 0}, {0x3a1a, 0x05, 0, 0}, {0x3a13, 0x30, 0, 0}, {0x3a18, 0x00, 0, 0}, {0x3a19, 0x7c, 0, 0}, {0x3a08, 0x12, 0, 0}, {0x3a09, 0xc0, 0, 0}, {0x3a0a, 0x0f, 0, 0}, {0x3a0b, 0xa0, 0, 0}, {0x350c, 0x07, 0, 0}, {0x350d, 0xd0, 0, 0}, {0x3500, 0x00, 0, 0}, {0x3501, 0x00, 0, 0}, {0x3502, 0x00, 0, 0}, {0x350a, 0x00, 0, 0}, {0x350b, 0x00, 0, 0}, {0x3503, 0x00, 0, 0}, {0x528a, 0x02, 0, 0}, {0x528b, 0x04, 0, 0}, {0x528c, 0x08, 0, 0}, {0x528d, 0x08, 0, 0}, {0x528e, 0x08, 0, 0}, {0x528f, 0x10, 0, 0}, {0x5290, 0x10, 0, 0}, {0x5292, 0x00, 0, 0}, {0x5293, 0x02, 0, 0}, {0x5294, 0x00, 0, 0}, {0x5295, 0x02, 0, 0}, {0x5296, 0x00, 0, 0}, {0x5297, 0x02, 0, 0}, {0x5298, 0x00, 0, 0}, {0x5299, 0x02, 0, 0}, {0x529a, 0x00, 0, 0}, {0x529b, 0x02, 0, 0}, {0x529c, 0x00, 0, 0}, {0x529d, 0x02, 0, 0}, {0x529e, 0x00, 0, 0}, {0x529f, 0x02, 0, 0}, {0x3a0f, 0x3c, 0, 0}, {0x3a10, 0x30, 0, 0}, {0x3a1b, 0x3c, 0, 0}, {0x3a1e, 0x30, 0, 0}, {0x3a11, 0x70, 0, 0}, {0x3a1f, 0x10, 0, 0}, {0x3030, 0x2b, 0, 0}, {0x3a02, 0x00, 0, 0}, {0x3a03, 0x7d, 0, 0}, {0x3a04, 0x00, 0, 0}, {0x3a14, 0x00, 0, 0}, {0x3a15, 0x7d, 0, 0}, {0x3a16, 0x00, 0, 0}, {0x3a00, 0x78, 0, 0}, {0x3a08, 0x09, 0, 0}, {0x3a09, 0x60, 0, 0}, {0x3a0a, 0x07, 0, 0}, {0x3a0b, 0xd0, 0, 0}, {0x3a0d, 0x08, 0, 0}, {0x3a0e, 0x06, 0, 0}, {0x5193, 0x70, 0, 0}, {0x589b, 0x04, 0, 0}, {0x589a, 0xc5, 0, 0}, {0x401e, 0x20, 0, 0}, {0x4001, 0x42, 0, 0}, {0x401c, 0x04, 0, 0}, {0x528a, 0x01, 0, 0}, {0x528b, 0x04, 0, 0}, {0x528c, 0x08, 0, 0}, {0x528d, 0x10, 0, 0}, {0x528e, 0x20, 0, 0}, {0x528f, 0x28, 0, 0}, {0x5290, 0x30, 0, 0}, {0x5292, 0x00, 0, 0}, {0x5293, 0x01, 0, 0}, {0x5294, 0x00, 0, 0}, {0x5295, 0x04, 0, 0}, {0x5296, 0x00, 0, 0}, {0x5297, 0x08, 0, 0}, {0x5298, 0x00, 0, 0}, {0x5299, 0x10, 0, 0}, {0x529a, 0x00, 0, 0}, {0x529b, 0x20, 0, 0}, {0x529c, 0x00, 0, 0}, {0x529d, 0x28, 0, 0}, {0x529e, 0x00, 0, 0}, {0x529f, 0x30, 0, 0}, {0x5282, 0x00, 0, 0}, {0x5300, 0x00, 0, 0}, {0x5301, 0x20, 0, 0}, {0x5302, 0x00, 0, 0}, {0x5303, 0x7c, 0, 0}, {0x530c, 0x00, 0, 0}, {0x530d, 0x0c, 0, 0}, {0x530e, 0x20, 0, 0}, {0x530f, 0x80, 0, 0}, {0x5310, 0x20, 0, 0}, {0x5311, 0x80, 0, 0}, {0x5308, 0x20, 0, 0}, {0x5309, 0x40, 0, 0}, {0x5304, 0x00, 0, 0}, {0x5305, 0x30, 0, 0}, {0x5306, 0x00, 0, 0}, {0x5307, 0x80, 0, 0}, {0x5314, 0x08, 0, 0}, {0x5315, 0x20, 0, 0}, {0x5319, 0x30, 0, 0}, {0x5316, 0x10, 0, 0}, {0x5317, 0x00, 0, 0}, {0x5318, 0x02, 0, 0}, {0x5380, 0x01, 0, 0}, {0x5381, 0x00, 0, 0}, {0x5382, 0x00, 0, 0}, {0x5383, 0x4e, 0, 0}, {0x5384, 0x00, 0, 0}, {0x5385, 0x0f, 0, 0}, {0x5386, 0x00, 0, 0}, {0x5387, 0x00, 0, 0}, {0x5388, 0x01, 0, 0}, {0x5389, 0x15, 0, 0}, {0x538a, 0x00, 0, 0}, {0x538b, 0x31, 0, 0}, {0x538c, 0x00, 0, 0}, {0x538d, 0x00, 0, 0}, {0x538e, 0x00, 0, 0}, {0x538f, 0x0f, 0, 0}, {0x5390, 0x00, 0, 0}, {0x5391, 0xab, 0, 0}, {0x5392, 0x00, 0, 0}, {0x5393, 0xa2, 0, 0}, {0x5394, 0x08, 0, 0}, {0x5480, 0x14, 0, 0}, {0x5481, 0x21, 0, 0}, {0x5482, 0x36, 0, 0}, {0x5483, 0x57, 0, 0}, {0x5484, 0x65, 0, 0}, {0x5485, 0x71, 0, 0}, {0x5486, 0x7d, 0, 0}, {0x5487, 0x87, 0, 0}, {0x5488, 0x91, 0, 0}, {0x5489, 0x9a, 0, 0}, {0x548a, 0xaa, 0, 0}, {0x548b, 0xb8, 0, 0}, {0x548c, 0xcd, 0, 0}, {0x548d, 0xdd, 0, 0}, {0x548e, 0xea, 0, 0}, {0x548f, 0x1d, 0, 0}, {0x5490, 0x05, 0, 0}, {0x5491, 0x00, 0, 0}, {0x5492, 0x04, 0, 0}, {0x5493, 0x20, 0, 0}, {0x5494, 0x03, 0, 0}, {0x5495, 0x60, 0, 0}, {0x5496, 0x02, 0, 0}, {0x5497, 0xb8, 0, 0}, {0x5498, 0x02, 0, 0}, {0x5499, 0x86, 0, 0}, {0x549a, 0x02, 0, 0}, {0x549b, 0x5b, 0, 0}, {0x549c, 0x02, 0, 0}, {0x549d, 0x3b, 0, 0}, {0x549e, 0x02, 0, 0}, {0x549f, 0x1c, 0, 0}, {0x54a0, 0x02, 0, 0}, {0x54a1, 0x04, 0, 0}, {0x54a2, 0x01, 0, 0}, {0x54a3, 0xed, 0, 0}, {0x54a4, 0x01, 0, 0}, {0x54a5, 0xc5, 0, 0}, {0x54a6, 0x01, 0, 0}, {0x54a7, 0xa5, 0, 0}, {0x54a8, 0x01, 0, 0}, {0x54a9, 0x6c, 0, 0}, {0x54aa, 0x01, 0, 0}, {0x54ab, 0x41, 0, 0}, {0x54ac, 0x01, 0, 0}, {0x54ad, 0x20, 0, 0}, {0x54ae, 0x00, 0, 0}, {0x54af, 0x16, 0, 0}, {0x54b0, 0x01, 0, 0}, {0x54b1, 0x20, 0, 0}, {0x54b2, 0x00, 0, 0}, {0x54b3, 0x10, 0, 0}, {0x54b4, 0x00, 0, 0}, {0x54b5, 0xf0, 0, 0}, {0x54b6, 0x00, 0, 0}, {0x54b7, 0xdf, 0, 0}, {0x5402, 0x3f, 0, 0}, {0x5403, 0x00, 0, 0}, {0x3406, 0x00, 0, 0}, {0x5180, 0xff, 0, 0}, {0x5181, 0x52, 0, 0}, {0x5182, 0x11, 0, 0}, {0x5183, 0x14, 0, 0}, {0x5184, 0x25, 0, 0}, {0x5185, 0x24, 0, 0}, {0x5186, 0x06, 0, 0}, {0x5187, 0x08, 0, 0}, {0x5188, 0x08, 0, 0}, {0x5189, 0x7c, 0, 0}, {0x518a, 0x60, 0, 0}, {0x518b, 0xb2, 0, 0}, {0x518c, 0xb2, 0, 0}, {0x518d, 0x44, 0, 0}, {0x518e, 0x3d, 0, 0}, {0x518f, 0x58, 0, 0}, {0x5190, 0x46, 0, 0}, {0x5191, 0xf8, 0, 0}, {0x5192, 0x04, 0, 0}, {0x5193, 0x70, 0, 0}, {0x5194, 0xf0, 0, 0}, {0x5195, 0xf0, 0, 0}, {0x5196, 0x03, 0, 0}, {0x5197, 0x01, 0, 0}, {0x5198, 0x04, 0, 0}, {0x5199, 0x12, 0, 0}, {0x519a, 0x04, 0, 0}, {0x519b, 0x00, 0, 0}, {0x519c, 0x06, 0, 0}, {0x519d, 0x82, 0, 0}, {0x519e, 0x00, 0, 0}, {0x5025, 0x80, 0, 0}, {0x3a0f, 0x38, 0, 0}, {0x3a10, 0x30, 0, 0}, {0x3a1b, 0x3a, 0, 0}, {0x3a1e, 0x2e, 0, 0}, {0x3a11, 0x60, 0, 0}, {0x3a1f, 0x10, 0, 0}, {0x5688, 0xa6, 0, 0}, {0x5689, 0x6a, 0, 0}, {0x568a, 0xea, 0, 0}, {0x568b, 0xae, 0, 0}, {0x568c, 0xa6, 0, 0}, {0x568d, 0x6a, 0, 0}, {0x568e, 0x62, 0, 0}, {0x568f, 0x26, 0, 0}, {0x5583, 0x40, 0, 0}, {0x5584, 0x40, 0, 0}, {0x5580, 0x02, 0, 0}, {0x5000, 0xcf, 0, 0}, {0x5800, 0x27, 0, 0}, {0x5801, 0x19, 0, 0}, {0x5802, 0x12, 0, 0}, {0x5803, 0x0f, 0, 0}, {0x5804, 0x10, 0, 0}, {0x5805, 0x15, 0, 0}, {0x5806, 0x1e, 0, 0}, {0x5807, 0x2f, 0, 0}, {0x5808, 0x15, 0, 0}, {0x5809, 0x0d, 0, 0}, {0x580a, 0x0a, 0, 0}, {0x580b, 0x09, 0, 0}, {0x580c, 0x0a, 0, 0}, {0x580d, 0x0c, 0, 0}, {0x580e, 0x12, 0, 0}, {0x580f, 0x19, 0, 0}, {0x5810, 0x0b, 0, 0}, {0x5811, 0x07, 0, 0}, {0x5812, 0x04, 0, 0}, {0x5813, 0x03, 0, 0}, {0x5814, 0x03, 0, 0}, {0x5815, 0x06, 0, 0}, {0x5816, 0x0a, 0, 0}, {0x5817, 0x0f, 0, 0}, {0x5818, 0x0a, 0, 0}, {0x5819, 0x05, 0, 0}, {0x581a, 0x01, 0, 0}, {0x581b, 0x00, 0, 0}, {0x581c, 0x00, 0, 0}, {0x581d, 0x03, 0, 0}, {0x581e, 0x08, 0, 0}, {0x581f, 0x0c, 0, 0}, {0x5820, 0x0a, 0, 0}, {0x5821, 0x05, 0, 0}, {0x5822, 0x01, 0, 0}, {0x5823, 0x00, 0, 0}, {0x5824, 0x00, 0, 0}, {0x5825, 0x03, 0, 0}, {0x5826, 0x08, 0, 0}, {0x5827, 0x0c, 0, 0}, {0x5828, 0x0e, 0, 0}, {0x5829, 0x08, 0, 0}, {0x582a, 0x06, 0, 0}, {0x582b, 0x04, 0, 0}, {0x582c, 0x05, 0, 0}, {0x582d, 0x07, 0, 0}, {0x582e, 0x0b, 0, 0}, {0x582f, 0x12, 0, 0}, {0x5830, 0x18, 0, 0}, {0x5831, 0x10, 0, 0}, {0x5832, 0x0c, 0, 0}, {0x5833, 0x0a, 0, 0}, {0x5834, 0x0b, 0, 0}, {0x5835, 0x0e, 0, 0}, {0x5836, 0x15, 0, 0}, {0x5837, 0x19, 0, 0}, {0x5838, 0x32, 0, 0}, {0x5839, 0x1f, 0, 0}, {0x583a, 0x18, 0, 0}, {0x583b, 0x16, 0, 0}, {0x583c, 0x17, 0, 0}, {0x583d, 0x1e, 0, 0}, {0x583e, 0x26, 0, 0}, {0x583f, 0x53, 0, 0}, {0x5840, 0x10, 0, 0}, {0x5841, 0x0f, 0, 0}, {0x5842, 0x0d, 0, 0}, {0x5843, 0x0c, 0, 0}, {0x5844, 0x0e, 0, 0}, {0x5845, 0x09, 0, 0}, {0x5846, 0x11, 0, 0}, {0x5847, 0x10, 0, 0}, {0x5848, 0x10, 0, 0}, {0x5849, 0x10, 0, 0}, {0x584a, 0x10, 0, 0}, {0x584b, 0x0e, 0, 0}, {0x584c, 0x10, 0, 0}, {0x584d, 0x10, 0, 0}, {0x584e, 0x11, 0, 0}, {0x584f, 0x10, 0, 0}, {0x5850, 0x0f, 0, 0}, {0x5851, 0x0c, 0, 0}, {0x5852, 0x0f, 0, 0}, {0x5853, 0x10, 0, 0}, {0x5854, 0x10, 0, 0}, {0x5855, 0x0f, 0, 0}, {0x5856, 0x0e, 0, 0}, {0x5857, 0x0b, 0, 0}, {0x5858, 0x10, 0, 0}, {0x5859, 0x0d, 0, 0}, {0x585a, 0x0d, 0, 0}, {0x585b, 0x0c, 0, 0}, {0x585c, 0x0c, 0, 0}, {0x585d, 0x0c, 0, 0}, {0x585e, 0x0b, 0, 0}, {0x585f, 0x0c, 0, 0}, {0x5860, 0x0c, 0, 0}, {0x5861, 0x0c, 0, 0}, {0x5862, 0x0d, 0, 0}, {0x5863, 0x08, 0, 0}, {0x5864, 0x11, 0, 0}, {0x5865, 0x18, 0, 0}, {0x5866, 0x18, 0, 0}, {0x5867, 0x19, 0, 0}, {0x5868, 0x17, 0, 0}, {0x5869, 0x19, 0, 0}, {0x586a, 0x16, 0, 0}, {0x586b, 0x13, 0, 0}, {0x586c, 0x13, 0, 0}, {0x586d, 0x12, 0, 0}, {0x586e, 0x13, 0, 0}, {0x586f, 0x16, 0, 0}, {0x5870, 0x14, 0, 0}, {0x5871, 0x12, 0, 0}, {0x5872, 0x10, 0, 0}, {0x5873, 0x11, 0, 0}, {0x5874, 0x11, 0, 0}, {0x5875, 0x16, 0, 0}, {0x5876, 0x14, 0, 0}, {0x5877, 0x11, 0, 0}, {0x5878, 0x10, 0, 0}, {0x5879, 0x0f, 0, 0}, {0x587a, 0x10, 0, 0}, {0x587b, 0x14, 0, 0}, {0x587c, 0x13, 0, 0}, {0x587d, 0x12, 0, 0}, {0x587e, 0x11, 0, 0}, {0x587f, 0x11, 0, 0}, {0x5880, 0x12, 0, 0}, {0x5881, 0x15, 0, 0}, {0x5882, 0x14, 0, 0}, {0x5883, 0x15, 0, 0}, {0x5884, 0x15, 0, 0}, {0x5885, 0x15, 0, 0}, {0x5886, 0x13, 0, 0}, {0x5887, 0x17, 0, 0}, {0x3710, 0x10, 0, 0}, {0x3632, 0x51, 0, 0}, {0x3702, 0x10, 0, 0}, {0x3703, 0xb2, 0, 0}, {0x3704, 0x18, 0, 0}, {0x370b, 0x40, 0, 0}, {0x370d, 0x03, 0, 0}, {0x3631, 0x01, 0, 0}, {0x3632, 0x52, 0, 0}, {0x3606, 0x24, 0, 0}, {0x3620, 0x96, 0, 0}, {0x5785, 0x07, 0, 0}, {0x3a13, 0x30, 0, 0}, {0x3600, 0x52, 0, 0}, {0x3604, 0x48, 0, 0}, {0x3606, 0x1b, 0, 0}, {0x370d, 0x0b, 0, 0}, {0x370f, 0xc0, 0, 0}, {0x3709, 0x01, 0, 0}, {0x3823, 0x00, 0, 0}, {0x5007, 0x00, 0, 0}, {0x5009, 0x00, 0, 0}, {0x5011, 0x00, 0, 0}, {0x5013, 0x00, 0, 0}, {0x519e, 0x00, 0, 0}, {0x5086, 0x00, 0, 0}, {0x5087, 0x00, 0, 0}, {0x5088, 0x00, 0, 0}, {0x5089, 0x00, 0, 0}, {0x302b, 0x00, 0, 0}, {0x3808, 0x00, 0, 0}, {0x3809, 0xb0, 0, 0}, {0x380a, 0x00, 0, 0}, {0x380b, 0x90, 0, 0}, {0x3a00, 0x78, 0, 0}, }; static struct reg_value ov5642_setting_15fps_QSXGA_2592_1944[] = { {0x3503, 0x07, 0, 0}, {0x3000, 0x00, 0, 0}, {0x3001, 0x00, 0, 0}, {0x3002, 0x00, 0, 0}, {0x3003, 0x00, 0, 0}, {0x3004, 0xff, 0, 0}, {0x3005, 0xff, 0, 0}, {0x3006, 0xff, 0, 0}, {0x3007, 0x3f, 0, 0}, {0x3011, 0x08, 0, 0}, {0x3010, 0x10, 0, 0}, {0x3818, 0xc0, 0, 0}, {0x3621, 0x09, 0, 0}, {0x350c, 0x07, 0, 0}, {0x350d, 0xd0, 0, 0}, {0x3602, 0xe4, 0, 0}, {0x3612, 0xac, 0, 0}, {0x3613, 0x44, 0, 0}, {0x3622, 0x60, 0, 0}, {0x3623, 0x22, 0, 0}, {0x3604, 0x48, 0, 0}, {0x3705, 0xda, 0, 0}, {0x370a, 0x80, 0, 0}, {0x3801, 0x95, 0, 0}, {0x3803, 0x0e, 0, 0}, {0x3804, 0x0a, 0, 0}, {0x3805, 0x20, 0, 0}, {0x3806, 0x07, 0, 0}, {0x3807, 0x98, 0, 0}, {0x3808, 0x0a, 0, 0}, {0x3809, 0x20, 0, 0}, {0x380a, 0x07, 0, 0}, {0x380b, 0x98, 0, 0}, {0x380c, 0x0c, 0, 0}, {0x380d, 0x80, 0, 0}, {0x380e, 0x07, 0, 0}, {0x380f, 0xd0, 0, 0}, {0x3810, 0xc2, 0, 0}, {0x3815, 0x44, 0, 0}, {0x3824, 0x11, 0, 0}, {0x3825, 0xac, 0, 0}, {0x3827, 0x0c, 0, 0}, {0x3a00, 0x78, 0, 0}, {0x3a0d, 0x10, 0, 0}, {0x3a0e, 0x0d, 0, 0}, {0x5682, 0x0a, 0, 0}, {0x5683, 0x20, 0, 0}, {0x5686, 0x07, 0, 0}, {0x5687, 0x98, 0, 0}, {0x5001, 0xff, 0, 0}, {0x589b, 0x00, 0, 0}, {0x589a, 0xc0, 0, 0}, {0x4407, 0x04, 0, 0}, {0x3008, 0x02, 0, 0}, {0x460b, 0x37, 0, 0}, {0x460c, 0x22, 0, 0}, {0x471d, 0x05, 0, 0}, {0x4713, 0x03, 0, 0}, {0x471c, 0xd0, 0, 0}, {0x3815, 0x01, 0, 0}, {0x501f, 0x00, 0, 0}, {0x3002, 0x1c, 0, 0}, {0x3819, 0x80, 0, 0}, {0x5002, 0xe0, 0, 0}, {0x530a, 0x01, 0, 0}, {0x530d, 0x10, 0, 0}, {0x530c, 0x04, 0, 0}, {0x5312, 0x20, 0, 0}, {0x5282, 0x01, 0, 0}, {0x3010, 0x10, 0, 0}, {0x3012, 0x00, 0, 0}, }; static struct reg_value ov5642_setting_VGA_2_QVGA[] = { {0x3808, 0x01, 0, 0}, {0x3809, 0x40, 0, 0}, {0x380a, 0x00, 0, 0}, {0x380b, 0xf0, 0, 0}, {0x3815, 0x04, 0, 0}, }; static struct reg_value ov5642_setting_QSXGA_2_VGA[] = { {0x3503, 0x00, 0, 0}, {0x3000, 0x00, 0, 0}, {0x3001, 0x00, 0, 0}, {0x3002, 0x5c, 0, 0}, {0x3003, 0x00, 0, 0}, {0x3004, 0xff, 0, 0}, {0x3005, 0xff, 0, 0}, {0x3006, 0x43, 0, 0}, {0x3007, 0x37, 0, 0}, {0x3010, 0x00, 0, 0}, {0x3818, 0xc1, 0, 0}, {0x3621, 0x87, 0, 0}, {0x350c, 0x03, 0, 0}, {0x350d, 0xe8, 0, 0}, {0x3602, 0xfc, 0, 0}, {0x3612, 0xff, 0, 0}, {0x3613, 0x00, 0, 0}, {0x3622, 0x60, 0, 0}, {0x3623, 0x01, 0, 0}, {0x3604, 0x48, 0, 0}, {0x3705, 0xdb, 0, 0}, {0x370a, 0x81, 0, 0}, {0x3801, 0x50, 0, 0}, {0x3803, 0x08, 0, 0}, {0x3804, 0x05, 0, 0}, {0x3805, 0x00, 0, 0}, {0x3806, 0x03, 0, 0}, {0x3807, 0xc0, 0, 0}, {0x3808, 0x02, 0, 0}, {0x3809, 0x80, 0, 0}, {0x380a, 0x01, 0, 0}, {0x380b, 0xe0, 0, 0}, {0x380c, 0x0c, 0, 0}, {0x380d, 0x80, 0, 0}, {0x380e, 0x03, 0, 0}, {0x380f, 0xe8, 0, 0}, {0x3810, 0x40, 0, 0}, {0x3815, 0x04, 0, 0}, {0x3824, 0x11, 0, 0}, {0x3825, 0xb4, 0, 0}, {0x3827, 0x08, 0, 0}, {0x3a00, 0x78, 0, 0}, {0x3a0d, 0x04, 0, 0}, {0x3a0e, 0x03, 0, 0}, {0x5682, 0x05, 0, 0}, {0x5683, 0x00, 0, 0}, {0x5686, 0x03, 0, 0}, {0x5687, 0xbc, 0, 0}, {0x5001, 0xff, 0, 0}, {0x589b, 0x04, 0, 0}, {0x589a, 0xc5, 0, 0}, {0x4407, 0x0c, 0, 0}, {0x3008, 0x02, 0, 0}, {0x460b, 0x37, 0, 0}, {0x460c, 0x22, 0, 0}, {0x471d, 0x05, 0, 0}, {0x4713, 0x02, 0, 0}, {0x471c, 0xd0, 0, 0}, {0x3815, 0x04, 0, 0}, {0x501f, 0x00, 0, 0}, {0x3002, 0x5c, 0, 0}, {0x3819, 0x80, 0, 0}, {0x5002, 0xe0, 0, 0}, {0x530a, 0x01, 0, 0}, {0x530d, 0x0c, 0, 0}, {0x530c, 0x00, 0, 0}, {0x5312, 0x40, 0, 0}, {0x5282, 0x00, 0, 0}, {0x3012, 0x02, 0, 0}, {0x3010, 0x00, 0, 0}, }; static struct reg_value ov5642_setting_30fps_VGA_640_480[] = { {0x3103, 0x93, 0, 0}, {0x3008, 0x82, 0, 0}, {0x3017, 0x7f, 0, 0}, {0x3018, 0xfc, 0, 0}, {0x3615, 0xf0, 0, 0}, {0x3000, 0x00, 0, 0}, {0x3001, 0x00, 0, 0}, {0x3002, 0x5c, 0, 0}, {0x3003, 0x00, 0, 0}, {0x3004, 0xff, 0, 0}, {0x3005, 0xff, 0, 0}, {0x3006, 0x43, 0, 0}, {0x3007, 0x37, 0, 0}, {0x3011, 0x09, 0, 0}, {0x3012, 0x02, 0, 0}, {0x3010, 0x00, 0, 0}, {0x460c, 0x20, 0, 0}, {0x3815, 0x04, 0, 0}, {0x370c, 0xa0, 0, 0}, {0x3602, 0xfc, 0, 0}, {0x3612, 0xff, 0, 0}, {0x3634, 0xc0, 0, 0}, {0x3613, 0x00, 0, 0}, {0x3605, 0x7c, 0, 0}, {0x3621, 0x09, 0, 0}, {0x3622, 0x60, 0, 0}, {0x3604, 0x40, 0, 0}, {0x3603, 0xa7, 0, 0}, {0x3603, 0x27, 0, 0}, {0x4000, 0x21, 0, 0}, {0x401d, 0x22, 0, 0}, {0x3600, 0x54, 0, 0}, {0x3605, 0x04, 0, 0}, {0x3606, 0x3f, 0, 0}, {0x3c01, 0x80, 0, 0}, {0x5000, 0x4f, 0, 0}, {0x5020, 0x04, 0, 0}, {0x5181, 0x79, 0, 0}, {0x5182, 0x00, 0, 0}, {0x5185, 0x22, 0, 0}, {0x5197, 0x01, 0, 0}, {0x5001, 0xff, 0, 0}, {0x5500, 0x0a, 0, 0}, {0x5504, 0x00, 0, 0}, {0x5505, 0x7f, 0, 0}, {0x5080, 0x08, 0, 0}, {0x300e, 0x18, 0, 0}, {0x4610, 0x00, 0, 0}, {0x471d, 0x05, 0, 0}, {0x4708, 0x06, 0, 0}, {0x3808, 0x02, 0, 0}, {0x3809, 0x80, 0, 0}, {0x380a, 0x01, 0, 0}, {0x380b, 0xe0, 0, 0}, {0x380e, 0x07, 0, 0}, {0x380f, 0xd0, 0, 0}, {0x501f, 0x00, 0, 0}, {0x5000, 0x4f, 0, 0}, {0x4300, 0x30, 0, 0}, {0x3503, 0x07, 0, 0}, {0x3501, 0x73, 0, 0}, {0x3502, 0x80, 0, 0}, {0x350b, 0x00, 0, 0}, {0x3503, 0x07, 0, 0}, {0x3824, 0x11, 0, 0}, {0x3825, 0xb0, 0, 0}, {0x3501, 0x1e, 0, 0}, {0x3502, 0x80, 0, 0}, {0x350b, 0x7f, 0, 0}, {0x380c, 0x07, 0, 0}, {0x380d, 0x2a, 0, 0}, {0x380e, 0x03, 0, 0}, {0x380f, 0xe8, 0, 0}, {0x3a0d, 0x04, 0, 0}, {0x3a0e, 0x03, 0, 0}, {0x3818, 0xc1, 0, 0}, {0x3705, 0xdb, 0, 0}, {0x370a, 0x81, 0, 0}, {0x3801, 0x80, 0, 0}, {0x3621, 0xc7, 0, 0}, {0x3801, 0x50, 0, 0}, {0x3803, 0x08, 0, 0}, {0x3827, 0x08, 0, 0}, {0x3810, 0x80, 0, 0}, {0x3804, 0x05, 0, 0}, {0x3805, 0x00, 0, 0}, {0x5682, 0x05, 0, 0}, {0x5683, 0x00, 0, 0}, {0x3806, 0x03, 0, 0}, {0x3807, 0xc0, 0, 0}, {0x5686, 0x03, 0, 0}, {0x5687, 0xbc, 0, 0}, {0x3a00, 0x78, 0, 0}, {0x3a1a, 0x05, 0, 0}, {0x3a13, 0x30, 0, 0}, {0x3a18, 0x00, 0, 0}, {0x3a19, 0x7c, 0, 0}, {0x3a08, 0x12, 0, 0}, {0x3a09, 0xc0, 0, 0}, {0x3a0a, 0x0f, 0, 0}, {0x3a0b, 0xa0, 0, 0}, {0x350c, 0x07, 0, 0}, {0x350d, 0xd0, 0, 0}, {0x3500, 0x00, 0, 0}, {0x3501, 0x00, 0, 0}, {0x3502, 0x00, 0, 0}, {0x350a, 0x00, 0, 0}, {0x350b, 0x00, 0, 0}, {0x3503, 0x00, 0, 0}, {0x528a, 0x02, 0, 0}, {0x528b, 0x04, 0, 0}, {0x528c, 0x08, 0, 0}, {0x528d, 0x08, 0, 0}, {0x528e, 0x08, 0, 0}, {0x528f, 0x10, 0, 0}, {0x5290, 0x10, 0, 0}, {0x5292, 0x00, 0, 0}, {0x5293, 0x02, 0, 0}, {0x5294, 0x00, 0, 0}, {0x5295, 0x02, 0, 0}, {0x5296, 0x00, 0, 0}, {0x5297, 0x02, 0, 0}, {0x5298, 0x00, 0, 0}, {0x5299, 0x02, 0, 0}, {0x529a, 0x00, 0, 0}, {0x529b, 0x02, 0, 0}, {0x529c, 0x00, 0, 0}, {0x529d, 0x02, 0, 0}, {0x529e, 0x00, 0, 0}, {0x529f, 0x02, 0, 0}, {0x3a0f, 0x3c, 0, 0}, {0x3a10, 0x30, 0, 0}, {0x3a1b, 0x3c, 0, 0}, {0x3a1e, 0x30, 0, 0}, {0x3a11, 0x70, 0, 0}, {0x3a1f, 0x10, 0, 0}, {0x3030, 0x2b, 0, 0}, {0x3a02, 0x00, 0, 0}, {0x3a03, 0x7d, 0, 0}, {0x3a04, 0x00, 0, 0}, {0x3a14, 0x00, 0, 0}, {0x3a15, 0x7d, 0, 0}, {0x3a16, 0x00, 0, 0}, {0x3a00, 0x78, 0, 0}, {0x3a08, 0x12, 0, 0}, {0x3a09, 0xc0, 0, 0}, {0x3a0a, 0x0f, 0, 0}, {0x3a0b, 0xa0, 0, 0}, {0x3a0d, 0x04, 0, 0}, {0x3a0e, 0x03, 0, 0}, {0x5193, 0x70, 0, 0}, {0x589b, 0x04, 0, 0}, {0x589a, 0xc5, 0, 0}, {0x401e, 0x20, 0, 0}, {0x4001, 0x42, 0, 0}, {0x401c, 0x04, 0, 0}, {0x528a, 0x01, 0, 0}, {0x528b, 0x04, 0, 0}, {0x528c, 0x08, 0, 0}, {0x528d, 0x10, 0, 0}, {0x528e, 0x20, 0, 0}, {0x528f, 0x28, 0, 0}, {0x5290, 0x30, 0, 0}, {0x5292, 0x00, 0, 0}, {0x5293, 0x01, 0, 0}, {0x5294, 0x00, 0, 0}, {0x5295, 0x04, 0, 0}, {0x5296, 0x00, 0, 0}, {0x5297, 0x08, 0, 0}, {0x5298, 0x00, 0, 0}, {0x5299, 0x10, 0, 0}, {0x529a, 0x00, 0, 0}, {0x529b, 0x20, 0, 0}, {0x529c, 0x00, 0, 0}, {0x529d, 0x28, 0, 0}, {0x529e, 0x00, 0, 0}, {0x529f, 0x30, 0, 0}, {0x5282, 0x00, 0, 0}, {0x5300, 0x00, 0, 0}, {0x5301, 0x20, 0, 0}, {0x5302, 0x00, 0, 0}, {0x5303, 0x7c, 0, 0}, {0x530c, 0x00, 0, 0}, {0x530d, 0x0c, 0, 0}, {0x530e, 0x20, 0, 0}, {0x530f, 0x80, 0, 0}, {0x5310, 0x20, 0, 0}, {0x5311, 0x80, 0, 0}, {0x5308, 0x20, 0, 0}, {0x5309, 0x40, 0, 0}, {0x5304, 0x00, 0, 0}, {0x5305, 0x30, 0, 0}, {0x5306, 0x00, 0, 0}, {0x5307, 0x80, 0, 0}, {0x5314, 0x08, 0, 0}, {0x5315, 0x20, 0, 0}, {0x5319, 0x30, 0, 0}, {0x5316, 0x10, 0, 0}, {0x5317, 0x00, 0, 0}, {0x5318, 0x02, 0, 0}, {0x5380, 0x01, 0, 0}, {0x5381, 0x00, 0, 0}, {0x5382, 0x00, 0, 0}, {0x5383, 0x4e, 0, 0}, {0x5384, 0x00, 0, 0}, {0x5385, 0x0f, 0, 0}, {0x5386, 0x00, 0, 0}, {0x5387, 0x00, 0, 0}, {0x5388, 0x01, 0, 0}, {0x5389, 0x15, 0, 0}, {0x538a, 0x00, 0, 0}, {0x538b, 0x31, 0, 0}, {0x538c, 0x00, 0, 0}, {0x538d, 0x00, 0, 0}, {0x538e, 0x00, 0, 0}, {0x538f, 0x0f, 0, 0}, {0x5390, 0x00, 0, 0}, {0x5391, 0xab, 0, 0}, {0x5392, 0x00, 0, 0}, {0x5393, 0xa2, 0, 0}, {0x5394, 0x08, 0, 0}, {0x5480, 0x14, 0, 0}, {0x5481, 0x21, 0, 0}, {0x5482, 0x36, 0, 0}, {0x5483, 0x57, 0, 0}, {0x5484, 0x65, 0, 0}, {0x5485, 0x71, 0, 0}, {0x5486, 0x7d, 0, 0}, {0x5487, 0x87, 0, 0}, {0x5488, 0x91, 0, 0}, {0x5489, 0x9a, 0, 0}, {0x548a, 0xaa, 0, 0}, {0x548b, 0xb8, 0, 0}, {0x548c, 0xcd, 0, 0}, {0x548d, 0xdd, 0, 0}, {0x548e, 0xea, 0, 0}, {0x548f, 0x1d, 0, 0}, {0x5490, 0x05, 0, 0}, {0x5491, 0x00, 0, 0}, {0x5492, 0x04, 0, 0}, {0x5493, 0x20, 0, 0}, {0x5494, 0x03, 0, 0}, {0x5495, 0x60, 0, 0}, {0x5496, 0x02, 0, 0}, {0x5497, 0xb8, 0, 0}, {0x5498, 0x02, 0, 0}, {0x5499, 0x86, 0, 0}, {0x549a, 0x02, 0, 0}, {0x549b, 0x5b, 0, 0}, {0x549c, 0x02, 0, 0}, {0x549d, 0x3b, 0, 0}, {0x549e, 0x02, 0, 0}, {0x549f, 0x1c, 0, 0}, {0x54a0, 0x02, 0, 0}, {0x54a1, 0x04, 0, 0}, {0x54a2, 0x01, 0, 0}, {0x54a3, 0xed, 0, 0}, {0x54a4, 0x01, 0, 0}, {0x54a5, 0xc5, 0, 0}, {0x54a6, 0x01, 0, 0}, {0x54a7, 0xa5, 0, 0}, {0x54a8, 0x01, 0, 0}, {0x54a9, 0x6c, 0, 0}, {0x54aa, 0x01, 0, 0}, {0x54ab, 0x41, 0, 0}, {0x54ac, 0x01, 0, 0}, {0x54ad, 0x20, 0, 0}, {0x54ae, 0x00, 0, 0}, {0x54af, 0x16, 0, 0}, {0x54b0, 0x01, 0, 0}, {0x54b1, 0x20, 0, 0}, {0x54b2, 0x00, 0, 0}, {0x54b3, 0x10, 0, 0}, {0x54b4, 0x00, 0, 0}, {0x54b5, 0xf0, 0, 0}, {0x54b6, 0x00, 0, 0}, {0x54b7, 0xdf, 0, 0}, {0x5402, 0x3f, 0, 0}, {0x5403, 0x00, 0, 0}, {0x3406, 0x00, 0, 0}, {0x5180, 0xff, 0, 0}, {0x5181, 0x52, 0, 0}, {0x5182, 0x11, 0, 0}, {0x5183, 0x14, 0, 0}, {0x5184, 0x25, 0, 0}, {0x5185, 0x24, 0, 0}, {0x5186, 0x06, 0, 0}, {0x5187, 0x08, 0, 0}, {0x5188, 0x08, 0, 0}, {0x5189, 0x7c, 0, 0}, {0x518a, 0x60, 0, 0}, {0x518b, 0xb2, 0, 0}, {0x518c, 0xb2, 0, 0}, {0x518d, 0x44, 0, 0}, {0x518e, 0x3d, 0, 0}, {0x518f, 0x58, 0, 0}, {0x5190, 0x46, 0, 0}, {0x5191, 0xf8, 0, 0}, {0x5192, 0x04, 0, 0}, {0x5193, 0x70, 0, 0}, {0x5194, 0xf0, 0, 0}, {0x5195, 0xf0, 0, 0}, {0x5196, 0x03, 0, 0}, {0x5197, 0x01, 0, 0}, {0x5198, 0x04, 0, 0}, {0x5199, 0x12, 0, 0}, {0x519a, 0x04, 0, 0}, {0x519b, 0x00, 0, 0}, {0x519c, 0x06, 0, 0}, {0x519d, 0x82, 0, 0}, {0x519e, 0x00, 0, 0}, {0x5025, 0x80, 0, 0}, {0x3a0f, 0x38, 0, 0}, {0x3a10, 0x30, 0, 0}, {0x3a1b, 0x3a, 0, 0}, {0x3a1e, 0x2e, 0, 0}, {0x3a11, 0x60, 0, 0}, {0x3a1f, 0x10, 0, 0}, {0x5688, 0xa6, 0, 0}, {0x5689, 0x6a, 0, 0}, {0x568a, 0xea, 0, 0}, {0x568b, 0xae, 0, 0}, {0x568c, 0xa6, 0, 0}, {0x568d, 0x6a, 0, 0}, {0x568e, 0x62, 0, 0}, {0x568f, 0x26, 0, 0}, {0x5583, 0x40, 0, 0}, {0x5584, 0x40, 0, 0}, {0x5580, 0x02, 0, 0}, {0x5000, 0xcf, 0, 0}, {0x5800, 0x27, 0, 0}, {0x5801, 0x19, 0, 0}, {0x5802, 0x12, 0, 0}, {0x5803, 0x0f, 0, 0}, {0x5804, 0x10, 0, 0}, {0x5805, 0x15, 0, 0}, {0x5806, 0x1e, 0, 0}, {0x5807, 0x2f, 0, 0}, {0x5808, 0x15, 0, 0}, {0x5809, 0x0d, 0, 0}, {0x580a, 0x0a, 0, 0}, {0x580b, 0x09, 0, 0}, {0x580c, 0x0a, 0, 0}, {0x580d, 0x0c, 0, 0}, {0x580e, 0x12, 0, 0}, {0x580f, 0x19, 0, 0}, {0x5810, 0x0b, 0, 0}, {0x5811, 0x07, 0, 0}, {0x5812, 0x04, 0, 0}, {0x5813, 0x03, 0, 0}, {0x5814, 0x03, 0, 0}, {0x5815, 0x06, 0, 0}, {0x5816, 0x0a, 0, 0}, {0x5817, 0x0f, 0, 0}, {0x5818, 0x0a, 0, 0}, {0x5819, 0x05, 0, 0}, {0x581a, 0x01, 0, 0}, {0x581b, 0x00, 0, 0}, {0x581c, 0x00, 0, 0}, {0x581d, 0x03, 0, 0}, {0x581e, 0x08, 0, 0}, {0x581f, 0x0c, 0, 0}, {0x5820, 0x0a, 0, 0}, {0x5821, 0x05, 0, 0}, {0x5822, 0x01, 0, 0}, {0x5823, 0x00, 0, 0}, {0x5824, 0x00, 0, 0}, {0x5825, 0x03, 0, 0}, {0x5826, 0x08, 0, 0}, {0x5827, 0x0c, 0, 0}, {0x5828, 0x0e, 0, 0}, {0x5829, 0x08, 0, 0}, {0x582a, 0x06, 0, 0}, {0x582b, 0x04, 0, 0}, {0x582c, 0x05, 0, 0}, {0x582d, 0x07, 0, 0}, {0x582e, 0x0b, 0, 0}, {0x582f, 0x12, 0, 0}, {0x5830, 0x18, 0, 0}, {0x5831, 0x10, 0, 0}, {0x5832, 0x0c, 0, 0}, {0x5833, 0x0a, 0, 0}, {0x5834, 0x0b, 0, 0}, {0x5835, 0x0e, 0, 0}, {0x5836, 0x15, 0, 0}, {0x5837, 0x19, 0, 0}, {0x5838, 0x32, 0, 0}, {0x5839, 0x1f, 0, 0}, {0x583a, 0x18, 0, 0}, {0x583b, 0x16, 0, 0}, {0x583c, 0x17, 0, 0}, {0x583d, 0x1e, 0, 0}, {0x583e, 0x26, 0, 0}, {0x583f, 0x53, 0, 0}, {0x5840, 0x10, 0, 0}, {0x5841, 0x0f, 0, 0}, {0x5842, 0x0d, 0, 0}, {0x5843, 0x0c, 0, 0}, {0x5844, 0x0e, 0, 0}, {0x5845, 0x09, 0, 0}, {0x5846, 0x11, 0, 0}, {0x5847, 0x10, 0, 0}, {0x5848, 0x10, 0, 0}, {0x5849, 0x10, 0, 0}, {0x584a, 0x10, 0, 0}, {0x584b, 0x0e, 0, 0}, {0x584c, 0x10, 0, 0}, {0x584d, 0x10, 0, 0}, {0x584e, 0x11, 0, 0}, {0x584f, 0x10, 0, 0}, {0x5850, 0x0f, 0, 0}, {0x5851, 0x0c, 0, 0}, {0x5852, 0x0f, 0, 0}, {0x5853, 0x10, 0, 0}, {0x5854, 0x10, 0, 0}, {0x5855, 0x0f, 0, 0}, {0x5856, 0x0e, 0, 0}, {0x5857, 0x0b, 0, 0}, {0x5858, 0x10, 0, 0}, {0x5859, 0x0d, 0, 0}, {0x585a, 0x0d, 0, 0}, {0x585b, 0x0c, 0, 0}, {0x585c, 0x0c, 0, 0}, {0x585d, 0x0c, 0, 0}, {0x585e, 0x0b, 0, 0}, {0x585f, 0x0c, 0, 0}, {0x5860, 0x0c, 0, 0}, {0x5861, 0x0c, 0, 0}, {0x5862, 0x0d, 0, 0}, {0x5863, 0x08, 0, 0}, {0x5864, 0x11, 0, 0}, {0x5865, 0x18, 0, 0}, {0x5866, 0x18, 0, 0}, {0x5867, 0x19, 0, 0}, {0x5868, 0x17, 0, 0}, {0x5869, 0x19, 0, 0}, {0x586a, 0x16, 0, 0}, {0x586b, 0x13, 0, 0}, {0x586c, 0x13, 0, 0}, {0x586d, 0x12, 0, 0}, {0x586e, 0x13, 0, 0}, {0x586f, 0x16, 0, 0}, {0x5870, 0x14, 0, 0}, {0x5871, 0x12, 0, 0}, {0x5872, 0x10, 0, 0}, {0x5873, 0x11, 0, 0}, {0x5874, 0x11, 0, 0}, {0x5875, 0x16, 0, 0}, {0x5876, 0x14, 0, 0}, {0x5877, 0x11, 0, 0}, {0x5878, 0x10, 0, 0}, {0x5879, 0x0f, 0, 0}, {0x587a, 0x10, 0, 0}, {0x587b, 0x14, 0, 0}, {0x587c, 0x13, 0, 0}, {0x587d, 0x12, 0, 0}, {0x587e, 0x11, 0, 0}, {0x587f, 0x11, 0, 0}, {0x5880, 0x12, 0, 0}, {0x5881, 0x15, 0, 0}, {0x5882, 0x14, 0, 0}, {0x5883, 0x15, 0, 0}, {0x5884, 0x15, 0, 0}, {0x5885, 0x15, 0, 0}, {0x5886, 0x13, 0, 0}, {0x5887, 0x17, 0, 0}, {0x3710, 0x10, 0, 0}, {0x3632, 0x51, 0, 0}, {0x3702, 0x10, 0, 0}, {0x3703, 0xb2, 0, 0}, {0x3704, 0x18, 0, 0}, {0x370b, 0x40, 0, 0}, {0x370d, 0x03, 0, 0}, {0x3631, 0x01, 0, 0}, {0x3632, 0x52, 0, 0}, {0x3606, 0x24, 0, 0}, {0x3620, 0x96, 0, 0}, {0x5785, 0x07, 0, 0}, {0x3a13, 0x30, 0, 0}, {0x3600, 0x52, 0, 0}, {0x3604, 0x48, 0, 0}, {0x3606, 0x1b, 0, 0}, {0x370d, 0x0b, 0, 0}, {0x370f, 0xc0, 0, 0}, {0x3709, 0x01, 0, 0}, {0x3823, 0x00, 0, 0}, {0x5007, 0x00, 0, 0}, {0x5009, 0x00, 0, 0}, {0x5011, 0x00, 0, 0}, {0x5013, 0x00, 0, 0}, {0x519e, 0x00, 0, 0}, {0x5086, 0x00, 0, 0}, {0x5087, 0x00, 0, 0}, {0x5088, 0x00, 0, 0}, {0x5089, 0x00, 0, 0}, {0x302b, 0x00, 0, 0}, {0x3621, 0x87, 0, 0}, {0x3a00, 0x78, 0, 0}, }; static struct reg_value ov5642_setting_15fps_VGA_640_480[] = { {0x3103, 0x93, 0, 0}, {0x3008, 0x82, 0, 0}, {0x3017, 0x7f, 0, 0}, {0x3018, 0xfc, 0, 0}, {0x3615, 0xf0, 0, 0}, {0x3000, 0x00, 0, 0}, {0x3001, 0x00, 0, 0}, {0x3002, 0x5c, 0, 0}, {0x3003, 0x00, 0, 0}, {0x3004, 0xff, 0, 0}, {0x3005, 0xff, 0, 0}, {0x3006, 0x43, 0, 0}, {0x3007, 0x37, 0, 0}, {0x3011, 0x09, 0, 0}, {0x3012, 0x02, 0, 0}, {0x3010, 0x00, 0, 0}, {0x460c, 0x20, 0, 0}, {0x3815, 0x04, 0, 0}, {0x370c, 0xa0, 0, 0}, {0x3602, 0xfc, 0, 0}, {0x3612, 0xff, 0, 0}, {0x3634, 0xc0, 0, 0}, {0x3613, 0x00, 0, 0}, {0x3605, 0x7c, 0, 0}, {0x3621, 0x09, 0, 0}, {0x3622, 0x60, 0, 0}, {0x3604, 0x40, 0, 0}, {0x3603, 0xa7, 0, 0}, {0x3603, 0x27, 0, 0}, {0x4000, 0x21, 0, 0}, {0x401d, 0x22, 0, 0}, {0x3600, 0x54, 0, 0}, {0x3605, 0x04, 0, 0}, {0x3606, 0x3f, 0, 0}, {0x3c01, 0x80, 0, 0}, {0x5000, 0x4f, 0, 0}, {0x5020, 0x04, 0, 0}, {0x5181, 0x79, 0, 0}, {0x5182, 0x00, 0, 0}, {0x5185, 0x22, 0, 0}, {0x5197, 0x01, 0, 0}, {0x5001, 0xff, 0, 0}, {0x5500, 0x0a, 0, 0}, {0x5504, 0x00, 0, 0}, {0x5505, 0x7f, 0, 0}, {0x5080, 0x08, 0, 0}, {0x300e, 0x18, 0, 0}, {0x4610, 0x00, 0, 0}, {0x471d, 0x05, 0, 0}, {0x4708, 0x06, 0, 0}, {0x3808, 0x02, 0, 0}, {0x3809, 0x80, 0, 0}, {0x380a, 0x01, 0, 0}, {0x380b, 0xe0, 0, 0}, {0x380e, 0x07, 0, 0}, {0x380f, 0xd0, 0, 0}, {0x501f, 0x00, 0, 0}, {0x5000, 0x4f, 0, 0}, {0x4300, 0x30, 0, 0}, {0x3503, 0x07, 0, 0}, {0x3501, 0x73, 0, 0}, {0x3502, 0x80, 0, 0}, {0x350b, 0x00, 0, 0}, {0x3503, 0x07, 0, 0}, {0x3824, 0x11, 0, 0}, {0x3825, 0xb0, 0, 0}, {0x3501, 0x1e, 0, 0}, {0x3502, 0x80, 0, 0}, {0x350b, 0x7f, 0, 0}, {0x380c, 0x07, 0, 0}, {0x380d, 0x2a, 0, 0}, {0x380e, 0x07, 0, 0}, {0x380f, 0xd0, 0, 0}, {0x3a0d, 0x04, 0, 0}, {0x3a0e, 0x03, 0, 0}, {0x3818, 0xc1, 0, 0}, {0x3705, 0xdb, 0, 0}, {0x370a, 0x81, 0, 0}, {0x3801, 0x80, 0, 0}, {0x3621, 0xc7, 0, 0}, {0x3801, 0x50, 0, 0}, {0x3803, 0x08, 0, 0}, {0x3827, 0x08, 0, 0}, {0x3810, 0x80, 0, 0}, {0x3804, 0x05, 0, 0}, {0x3805, 0x00, 0, 0}, {0x5682, 0x05, 0, 0}, {0x5683, 0x00, 0, 0}, {0x3806, 0x03, 0, 0}, {0x3807, 0xc0, 0, 0}, {0x5686, 0x03, 0, 0}, {0x5687, 0xbc, 0, 0}, {0x3a00, 0x78, 0, 0}, {0x3a1a, 0x05, 0, 0}, {0x3a13, 0x30, 0, 0}, {0x3a18, 0x00, 0, 0}, {0x3a19, 0x7c, 0, 0}, {0x3a08, 0x12, 0, 0}, {0x3a09, 0xc0, 0, 0}, {0x3a0a, 0x0f, 0, 0}, {0x3a0b, 0xa0, 0, 0}, {0x350c, 0x07, 0, 0}, {0x350d, 0xd0, 0, 0}, {0x3500, 0x00, 0, 0}, {0x3501, 0x00, 0, 0}, {0x3502, 0x00, 0, 0}, {0x350a, 0x00, 0, 0}, {0x350b, 0x00, 0, 0}, {0x3503, 0x00, 0, 0}, {0x528a, 0x02, 0, 0}, {0x528b, 0x04, 0, 0}, {0x528c, 0x08, 0, 0}, {0x528d, 0x08, 0, 0}, {0x528e, 0x08, 0, 0}, {0x528f, 0x10, 0, 0}, {0x5290, 0x10, 0, 0}, {0x5292, 0x00, 0, 0}, {0x5293, 0x02, 0, 0}, {0x5294, 0x00, 0, 0}, {0x5295, 0x02, 0, 0}, {0x5296, 0x00, 0, 0}, {0x5297, 0x02, 0, 0}, {0x5298, 0x00, 0, 0}, {0x5299, 0x02, 0, 0}, {0x529a, 0x00, 0, 0}, {0x529b, 0x02, 0, 0}, {0x529c, 0x00, 0, 0}, {0x529d, 0x02, 0, 0}, {0x529e, 0x00, 0, 0}, {0x529f, 0x02, 0, 0}, {0x3a0f, 0x3c, 0, 0}, {0x3a10, 0x30, 0, 0}, {0x3a1b, 0x3c, 0, 0}, {0x3a1e, 0x30, 0, 0}, {0x3a11, 0x70, 0, 0}, {0x3a1f, 0x10, 0, 0}, {0x3030, 0x2b, 0, 0}, {0x3a02, 0x00, 0, 0}, {0x3a03, 0x7d, 0, 0}, {0x3a04, 0x00, 0, 0}, {0x3a14, 0x00, 0, 0}, {0x3a15, 0x7d, 0, 0}, {0x3a16, 0x00, 0, 0}, {0x3a00, 0x78, 0, 0}, {0x3a08, 0x12, 0, 0}, {0x3a09, 0xc0, 0, 0}, {0x3a0a, 0x0f, 0, 0}, {0x3a0b, 0xa0, 0, 0}, {0x3a0d, 0x04, 0, 0}, {0x3a0e, 0x03, 0, 0}, {0x5193, 0x70, 0, 0}, {0x589b, 0x04, 0, 0}, {0x589a, 0xc5, 0, 0}, {0x401e, 0x20, 0, 0}, {0x4001, 0x42, 0, 0}, {0x401c, 0x04, 0, 0}, {0x528a, 0x01, 0, 0}, {0x528b, 0x04, 0, 0}, {0x528c, 0x08, 0, 0}, {0x528d, 0x10, 0, 0}, {0x528e, 0x20, 0, 0}, {0x528f, 0x28, 0, 0}, {0x5290, 0x30, 0, 0}, {0x5292, 0x00, 0, 0}, {0x5293, 0x01, 0, 0}, {0x5294, 0x00, 0, 0}, {0x5295, 0x04, 0, 0}, {0x5296, 0x00, 0, 0}, {0x5297, 0x08, 0, 0}, {0x5298, 0x00, 0, 0}, {0x5299, 0x10, 0, 0}, {0x529a, 0x00, 0, 0}, {0x529b, 0x20, 0, 0}, {0x529c, 0x00, 0, 0}, {0x529d, 0x28, 0, 0}, {0x529e, 0x00, 0, 0}, {0x529f, 0x30, 0, 0}, {0x5282, 0x00, 0, 0}, {0x5300, 0x00, 0, 0}, {0x5301, 0x20, 0, 0}, {0x5302, 0x00, 0, 0}, {0x5303, 0x7c, 0, 0}, {0x530c, 0x00, 0, 0}, {0x530d, 0x0c, 0, 0}, {0x530e, 0x20, 0, 0}, {0x530f, 0x80, 0, 0}, {0x5310, 0x20, 0, 0}, {0x5311, 0x80, 0, 0}, {0x5308, 0x20, 0, 0}, {0x5309, 0x40, 0, 0}, {0x5304, 0x00, 0, 0}, {0x5305, 0x30, 0, 0}, {0x5306, 0x00, 0, 0}, {0x5307, 0x80, 0, 0}, {0x5314, 0x08, 0, 0}, {0x5315, 0x20, 0, 0}, {0x5319, 0x30, 0, 0}, {0x5316, 0x10, 0, 0}, {0x5317, 0x00, 0, 0}, {0x5318, 0x02, 0, 0}, {0x5380, 0x01, 0, 0}, {0x5381, 0x00, 0, 0}, {0x5382, 0x00, 0, 0}, {0x5383, 0x4e, 0, 0}, {0x5384, 0x00, 0, 0}, {0x5385, 0x0f, 0, 0}, {0x5386, 0x00, 0, 0}, {0x5387, 0x00, 0, 0}, {0x5388, 0x01, 0, 0}, {0x5389, 0x15, 0, 0}, {0x538a, 0x00, 0, 0}, {0x538b, 0x31, 0, 0}, {0x538c, 0x00, 0, 0}, {0x538d, 0x00, 0, 0}, {0x538e, 0x00, 0, 0}, {0x538f, 0x0f, 0, 0}, {0x5390, 0x00, 0, 0}, {0x5391, 0xab, 0, 0}, {0x5392, 0x00, 0, 0}, {0x5393, 0xa2, 0, 0}, {0x5394, 0x08, 0, 0}, {0x5480, 0x14, 0, 0}, {0x5481, 0x21, 0, 0}, {0x5482, 0x36, 0, 0}, {0x5483, 0x57, 0, 0}, {0x5484, 0x65, 0, 0}, {0x5485, 0x71, 0, 0}, {0x5486, 0x7d, 0, 0}, {0x5487, 0x87, 0, 0}, {0x5488, 0x91, 0, 0}, {0x5489, 0x9a, 0, 0}, {0x548a, 0xaa, 0, 0}, {0x548b, 0xb8, 0, 0}, {0x548c, 0xcd, 0, 0}, {0x548d, 0xdd, 0, 0}, {0x548e, 0xea, 0, 0}, {0x548f, 0x1d, 0, 0}, {0x5490, 0x05, 0, 0}, {0x5491, 0x00, 0, 0}, {0x5492, 0x04, 0, 0}, {0x5493, 0x20, 0, 0}, {0x5494, 0x03, 0, 0}, {0x5495, 0x60, 0, 0}, {0x5496, 0x02, 0, 0}, {0x5497, 0xb8, 0, 0}, {0x5498, 0x02, 0, 0}, {0x5499, 0x86, 0, 0}, {0x549a, 0x02, 0, 0}, {0x549b, 0x5b, 0, 0}, {0x549c, 0x02, 0, 0}, {0x549d, 0x3b, 0, 0}, {0x549e, 0x02, 0, 0}, {0x549f, 0x1c, 0, 0}, {0x54a0, 0x02, 0, 0}, {0x54a1, 0x04, 0, 0}, {0x54a2, 0x01, 0, 0}, {0x54a3, 0xed, 0, 0}, {0x54a4, 0x01, 0, 0}, {0x54a5, 0xc5, 0, 0}, {0x54a6, 0x01, 0, 0}, {0x54a7, 0xa5, 0, 0}, {0x54a8, 0x01, 0, 0}, {0x54a9, 0x6c, 0, 0}, {0x54aa, 0x01, 0, 0}, {0x54ab, 0x41, 0, 0}, {0x54ac, 0x01, 0, 0}, {0x54ad, 0x20, 0, 0}, {0x54ae, 0x00, 0, 0}, {0x54af, 0x16, 0, 0}, {0x54b0, 0x01, 0, 0}, {0x54b1, 0x20, 0, 0}, {0x54b2, 0x00, 0, 0}, {0x54b3, 0x10, 0, 0}, {0x54b4, 0x00, 0, 0}, {0x54b5, 0xf0, 0, 0}, {0x54b6, 0x00, 0, 0}, {0x54b7, 0xdf, 0, 0}, {0x5402, 0x3f, 0, 0}, {0x5403, 0x00, 0, 0}, {0x3406, 0x00, 0, 0}, {0x5180, 0xff, 0, 0}, {0x5181, 0x52, 0, 0}, {0x5182, 0x11, 0, 0}, {0x5183, 0x14, 0, 0}, {0x5184, 0x25, 0, 0}, {0x5185, 0x24, 0, 0}, {0x5186, 0x06, 0, 0}, {0x5187, 0x08, 0, 0}, {0x5188, 0x08, 0, 0}, {0x5189, 0x7c, 0, 0}, {0x518a, 0x60, 0, 0}, {0x518b, 0xb2, 0, 0}, {0x518c, 0xb2, 0, 0}, {0x518d, 0x44, 0, 0}, {0x518e, 0x3d, 0, 0}, {0x518f, 0x58, 0, 0}, {0x5190, 0x46, 0, 0}, {0x5191, 0xf8, 0, 0}, {0x5192, 0x04, 0, 0}, {0x5193, 0x70, 0, 0}, {0x5194, 0xf0, 0, 0}, {0x5195, 0xf0, 0, 0}, {0x5196, 0x03, 0, 0}, {0x5197, 0x01, 0, 0}, {0x5198, 0x04, 0, 0}, {0x5199, 0x12, 0, 0}, {0x519a, 0x04, 0, 0}, {0x519b, 0x00, 0, 0}, {0x519c, 0x06, 0, 0}, {0x519d, 0x82, 0, 0}, {0x519e, 0x00, 0, 0}, {0x5025, 0x80, 0, 0}, {0x3a0f, 0x38, 0, 0}, {0x3a10, 0x30, 0, 0}, {0x3a1b, 0x3a, 0, 0}, {0x3a1e, 0x2e, 0, 0}, {0x3a11, 0x60, 0, 0}, {0x3a1f, 0x10, 0, 0}, {0x5688, 0xa6, 0, 0}, {0x5689, 0x6a, 0, 0}, {0x568a, 0xea, 0, 0}, {0x568b, 0xae, 0, 0}, {0x568c, 0xa6, 0, 0}, {0x568d, 0x6a, 0, 0}, {0x568e, 0x62, 0, 0}, {0x568f, 0x26, 0, 0}, {0x5583, 0x40, 0, 0}, {0x5584, 0x40, 0, 0}, {0x5580, 0x02, 0, 0}, {0x5000, 0xcf, 0, 0}, {0x5800, 0x27, 0, 0}, {0x5801, 0x19, 0, 0}, {0x5802, 0x12, 0, 0}, {0x5803, 0x0f, 0, 0}, {0x5804, 0x10, 0, 0}, {0x5805, 0x15, 0, 0}, {0x5806, 0x1e, 0, 0}, {0x5807, 0x2f, 0, 0}, {0x5808, 0x15, 0, 0}, {0x5809, 0x0d, 0, 0}, {0x580a, 0x0a, 0, 0}, {0x580b, 0x09, 0, 0}, {0x580c, 0x0a, 0, 0}, {0x580d, 0x0c, 0, 0}, {0x580e, 0x12, 0, 0}, {0x580f, 0x19, 0, 0}, {0x5810, 0x0b, 0, 0}, {0x5811, 0x07, 0, 0}, {0x5812, 0x04, 0, 0}, {0x5813, 0x03, 0, 0}, {0x5814, 0x03, 0, 0}, {0x5815, 0x06, 0, 0}, {0x5816, 0x0a, 0, 0}, {0x5817, 0x0f, 0, 0}, {0x5818, 0x0a, 0, 0}, {0x5819, 0x05, 0, 0}, {0x581a, 0x01, 0, 0}, {0x581b, 0x00, 0, 0}, {0x581c, 0x00, 0, 0}, {0x581d, 0x03, 0, 0}, {0x581e, 0x08, 0, 0}, {0x581f, 0x0c, 0, 0}, {0x5820, 0x0a, 0, 0}, {0x5821, 0x05, 0, 0}, {0x5822, 0x01, 0, 0}, {0x5823, 0x00, 0, 0}, {0x5824, 0x00, 0, 0}, {0x5825, 0x03, 0, 0}, {0x5826, 0x08, 0, 0}, {0x5827, 0x0c, 0, 0}, {0x5828, 0x0e, 0, 0}, {0x5829, 0x08, 0, 0}, {0x582a, 0x06, 0, 0}, {0x582b, 0x04, 0, 0}, {0x582c, 0x05, 0, 0}, {0x582d, 0x07, 0, 0}, {0x582e, 0x0b, 0, 0}, {0x582f, 0x12, 0, 0}, {0x5830, 0x18, 0, 0}, {0x5831, 0x10, 0, 0}, {0x5832, 0x0c, 0, 0}, {0x5833, 0x0a, 0, 0}, {0x5834, 0x0b, 0, 0}, {0x5835, 0x0e, 0, 0}, {0x5836, 0x15, 0, 0}, {0x5837, 0x19, 0, 0}, {0x5838, 0x32, 0, 0}, {0x5839, 0x1f, 0, 0}, {0x583a, 0x18, 0, 0}, {0x583b, 0x16, 0, 0}, {0x583c, 0x17, 0, 0}, {0x583d, 0x1e, 0, 0}, {0x583e, 0x26, 0, 0}, {0x583f, 0x53, 0, 0}, {0x5840, 0x10, 0, 0}, {0x5841, 0x0f, 0, 0}, {0x5842, 0x0d, 0, 0}, {0x5843, 0x0c, 0, 0}, {0x5844, 0x0e, 0, 0}, {0x5845, 0x09, 0, 0}, {0x5846, 0x11, 0, 0}, {0x5847, 0x10, 0, 0}, {0x5848, 0x10, 0, 0}, {0x5849, 0x10, 0, 0}, {0x584a, 0x10, 0, 0}, {0x584b, 0x0e, 0, 0}, {0x584c, 0x10, 0, 0}, {0x584d, 0x10, 0, 0}, {0x584e, 0x11, 0, 0}, {0x584f, 0x10, 0, 0}, {0x5850, 0x0f, 0, 0}, {0x5851, 0x0c, 0, 0}, {0x5852, 0x0f, 0, 0}, {0x5853, 0x10, 0, 0}, {0x5854, 0x10, 0, 0}, {0x5855, 0x0f, 0, 0}, {0x5856, 0x0e, 0, 0}, {0x5857, 0x0b, 0, 0}, {0x5858, 0x10, 0, 0}, {0x5859, 0x0d, 0, 0}, {0x585a, 0x0d, 0, 0}, {0x585b, 0x0c, 0, 0}, {0x585c, 0x0c, 0, 0}, {0x585d, 0x0c, 0, 0}, {0x585e, 0x0b, 0, 0}, {0x585f, 0x0c, 0, 0}, {0x5860, 0x0c, 0, 0}, {0x5861, 0x0c, 0, 0}, {0x5862, 0x0d, 0, 0}, {0x5863, 0x08, 0, 0}, {0x5864, 0x11, 0, 0}, {0x5865, 0x18, 0, 0}, {0x5866, 0x18, 0, 0}, {0x5867, 0x19, 0, 0}, {0x5868, 0x17, 0, 0}, {0x5869, 0x19, 0, 0}, {0x586a, 0x16, 0, 0}, {0x586b, 0x13, 0, 0}, {0x586c, 0x13, 0, 0}, {0x586d, 0x12, 0, 0}, {0x586e, 0x13, 0, 0}, {0x586f, 0x16, 0, 0}, {0x5870, 0x14, 0, 0}, {0x5871, 0x12, 0, 0}, {0x5872, 0x10, 0, 0}, {0x5873, 0x11, 0, 0}, {0x5874, 0x11, 0, 0}, {0x5875, 0x16, 0, 0}, {0x5876, 0x14, 0, 0}, {0x5877, 0x11, 0, 0}, {0x5878, 0x10, 0, 0}, {0x5879, 0x0f, 0, 0}, {0x587a, 0x10, 0, 0}, {0x587b, 0x14, 0, 0}, {0x587c, 0x13, 0, 0}, {0x587d, 0x12, 0, 0}, {0x587e, 0x11, 0, 0}, {0x587f, 0x11, 0, 0}, {0x5880, 0x12, 0, 0}, {0x5881, 0x15, 0, 0}, {0x5882, 0x14, 0, 0}, {0x5883, 0x15, 0, 0}, {0x5884, 0x15, 0, 0}, {0x5885, 0x15, 0, 0}, {0x5886, 0x13, 0, 0}, {0x5887, 0x17, 0, 0}, {0x3710, 0x10, 0, 0}, {0x3632, 0x51, 0, 0}, {0x3702, 0x10, 0, 0}, {0x3703, 0xb2, 0, 0}, {0x3704, 0x18, 0, 0}, {0x370b, 0x40, 0, 0}, {0x370d, 0x03, 0, 0}, {0x3631, 0x01, 0, 0}, {0x3632, 0x52, 0, 0}, {0x3606, 0x24, 0, 0}, {0x3620, 0x96, 0, 0}, {0x5785, 0x07, 0, 0}, {0x3a13, 0x30, 0, 0}, {0x3600, 0x52, 0, 0}, {0x3604, 0x48, 0, 0}, {0x3606, 0x1b, 0, 0}, {0x370d, 0x0b, 0, 0}, {0x370f, 0xc0, 0, 0}, {0x3709, 0x01, 0, 0}, {0x3823, 0x00, 0, 0}, {0x5007, 0x00, 0, 0}, {0x5009, 0x00, 0, 0}, {0x5011, 0x00, 0, 0}, {0x5013, 0x00, 0, 0}, {0x519e, 0x00, 0, 0}, {0x5086, 0x00, 0, 0}, {0x5087, 0x00, 0, 0}, {0x5088, 0x00, 0, 0}, {0x5089, 0x00, 0, 0}, {0x302b, 0x00, 0, 0}, {0x3621, 0x87, 0, 0}, {0x3a00, 0x78, 0, 0}, }; static struct reg_value ov5642_setting_30fps_XGA_1024_768[] = { {0x3103, 0x93, 0, 0}, {0x3008, 0x82, 0, 0}, {0x3017, 0x7f, 0, 0}, {0x3018, 0xfc, 0, 0}, {0x3615, 0xf0, 0, 0}, {0x3000, 0x00, 0, 0}, {0x3001, 0x00, 0, 0}, {0x3002, 0x5c, 0, 0}, {0x3003, 0x00, 0, 0}, {0x3004, 0xff, 0, 0}, {0x3005, 0xff, 0, 0}, {0x3006, 0x43, 0, 0}, {0x3007, 0x37, 0, 0}, {0x3011, 0x09, 0, 0}, {0x3012, 0x02, 0, 0}, {0x3010, 0x00, 0, 0}, {0x460c, 0x20, 0, 0}, {0x3815, 0x04, 0, 0}, {0x370c, 0xa0, 0, 0}, {0x3602, 0xfc, 0, 0}, {0x3612, 0xff, 0, 0}, {0x3634, 0xc0, 0, 0}, {0x3613, 0x00, 0, 0}, {0x3605, 0x7c, 0, 0}, {0x3621, 0x09, 0, 0}, {0x3622, 0x60, 0, 0}, {0x3604, 0x40, 0, 0}, {0x3603, 0xa7, 0, 0}, {0x3603, 0x27, 0, 0}, {0x4000, 0x21, 0, 0}, {0x401d, 0x22, 0, 0}, {0x3600, 0x54, 0, 0}, {0x3605, 0x04, 0, 0}, {0x3606, 0x3f, 0, 0}, {0x3c01, 0x80, 0, 0}, {0x5000, 0x4f, 0, 0}, {0x5020, 0x04, 0, 0}, {0x5181, 0x79, 0, 0}, {0x5182, 0x00, 0, 0}, {0x5185, 0x22, 0, 0}, {0x5197, 0x01, 0, 0}, {0x5001, 0xff, 0, 0}, {0x5500, 0x0a, 0, 0}, {0x5504, 0x00, 0, 0}, {0x5505, 0x7f, 0, 0}, {0x5080, 0x08, 0, 0}, {0x300e, 0x18, 0, 0}, {0x4610, 0x00, 0, 0}, {0x471d, 0x05, 0, 0}, {0x4708, 0x06, 0, 0}, {0x3808, 0x02, 0, 0}, {0x3809, 0x80, 0, 0}, {0x380a, 0x01, 0, 0}, {0x380b, 0xe0, 0, 0}, {0x380e, 0x07, 0, 0}, {0x380f, 0xd0, 0, 0}, {0x501f, 0x00, 0, 0}, {0x5000, 0x4f, 0, 0}, {0x4300, 0x30, 0, 0}, {0x3503, 0x07, 0, 0}, {0x3501, 0x73, 0, 0}, {0x3502, 0x80, 0, 0}, {0x350b, 0x00, 0, 0}, {0x3503, 0x07, 0, 0}, {0x3824, 0x11, 0, 0}, {0x3825, 0xb0, 0, 0}, {0x3501, 0x1e, 0, 0}, {0x3502, 0x80, 0, 0}, {0x350b, 0x7f, 0, 0}, {0x380c, 0x07, 0, 0}, {0x380d, 0x2a, 0, 0}, {0x380e, 0x03, 0, 0}, {0x380f, 0xe8, 0, 0}, {0x3a0d, 0x04, 0, 0}, {0x3a0e, 0x03, 0, 0}, {0x3818, 0xc1, 0, 0}, {0x3705, 0xdb, 0, 0}, {0x370a, 0x81, 0, 0}, {0x3801, 0x80, 0, 0}, {0x3621, 0xc7, 0, 0}, {0x3801, 0x50, 0, 0}, {0x3803, 0x08, 0, 0}, {0x3827, 0x08, 0, 0}, {0x3810, 0x80, 0, 0}, {0x3804, 0x05, 0, 0}, {0x3805, 0x00, 0, 0}, {0x5682, 0x05, 0, 0}, {0x5683, 0x00, 0, 0}, {0x3806, 0x03, 0, 0}, {0x3807, 0xc0, 0, 0}, {0x5686, 0x03, 0, 0}, {0x5687, 0xbc, 0, 0}, {0x3a00, 0x78, 0, 0}, {0x3a1a, 0x05, 0, 0}, {0x3a13, 0x30, 0, 0}, {0x3a18, 0x00, 0, 0}, {0x3a19, 0x7c, 0, 0}, {0x3a08, 0x12, 0, 0}, {0x3a09, 0xc0, 0, 0}, {0x3a0a, 0x0f, 0, 0}, {0x3a0b, 0xa0, 0, 0}, {0x350c, 0x07, 0, 0}, {0x350d, 0xd0, 0, 0}, {0x3500, 0x00, 0, 0}, {0x3501, 0x00, 0, 0}, {0x3502, 0x00, 0, 0}, {0x350a, 0x00, 0, 0}, {0x350b, 0x00, 0, 0}, {0x3503, 0x00, 0, 0}, {0x528a, 0x02, 0, 0}, {0x528b, 0x04, 0, 0}, {0x528c, 0x08, 0, 0}, {0x528d, 0x08, 0, 0}, {0x528e, 0x08, 0, 0}, {0x528f, 0x10, 0, 0}, {0x5290, 0x10, 0, 0}, {0x5292, 0x00, 0, 0}, {0x5293, 0x02, 0, 0}, {0x5294, 0x00, 0, 0}, {0x5295, 0x02, 0, 0}, {0x5296, 0x00, 0, 0}, {0x5297, 0x02, 0, 0}, {0x5298, 0x00, 0, 0}, {0x5299, 0x02, 0, 0}, {0x529a, 0x00, 0, 0}, {0x529b, 0x02, 0, 0}, {0x529c, 0x00, 0, 0}, {0x529d, 0x02, 0, 0}, {0x529e, 0x00, 0, 0}, {0x529f, 0x02, 0, 0}, {0x3a0f, 0x3c, 0, 0}, {0x3a10, 0x30, 0, 0}, {0x3a1b, 0x3c, 0, 0}, {0x3a1e, 0x30, 0, 0}, {0x3a11, 0x70, 0, 0}, {0x3a1f, 0x10, 0, 0}, {0x3030, 0x2b, 0, 0}, {0x3a02, 0x00, 0, 0}, {0x3a03, 0x7d, 0, 0}, {0x3a04, 0x00, 0, 0}, {0x3a14, 0x00, 0, 0}, {0x3a15, 0x7d, 0, 0}, {0x3a16, 0x00, 0, 0}, {0x3a00, 0x78, 0, 0}, {0x3a08, 0x12, 0, 0}, {0x3a09, 0xc0, 0, 0}, {0x3a0a, 0x0f, 0, 0}, {0x3a0b, 0xa0, 0, 0}, {0x3a0d, 0x04, 0, 0}, {0x3a0e, 0x03, 0, 0}, {0x5193, 0x70, 0, 0}, {0x589b, 0x04, 0, 0}, {0x589a, 0xc5, 0, 0}, {0x401e, 0x20, 0, 0}, {0x4001, 0x42, 0, 0}, {0x401c, 0x04, 0, 0}, {0x528a, 0x01, 0, 0}, {0x528b, 0x04, 0, 0}, {0x528c, 0x08, 0, 0}, {0x528d, 0x10, 0, 0}, {0x528e, 0x20, 0, 0}, {0x528f, 0x28, 0, 0}, {0x5290, 0x30, 0, 0}, {0x5292, 0x00, 0, 0}, {0x5293, 0x01, 0, 0}, {0x5294, 0x00, 0, 0}, {0x5295, 0x04, 0, 0}, {0x5296, 0x00, 0, 0}, {0x5297, 0x08, 0, 0}, {0x5298, 0x00, 0, 0}, {0x5299, 0x10, 0, 0}, {0x529a, 0x00, 0, 0}, {0x529b, 0x20, 0, 0}, {0x529c, 0x00, 0, 0}, {0x529d, 0x28, 0, 0}, {0x529e, 0x00, 0, 0}, {0x529f, 0x30, 0, 0}, {0x5282, 0x00, 0, 0}, {0x5300, 0x00, 0, 0}, {0x5301, 0x20, 0, 0}, {0x5302, 0x00, 0, 0}, {0x5303, 0x7c, 0, 0}, {0x530c, 0x00, 0, 0}, {0x530d, 0x0c, 0, 0}, {0x530e, 0x20, 0, 0}, {0x530f, 0x80, 0, 0}, {0x5310, 0x20, 0, 0}, {0x5311, 0x80, 0, 0}, {0x5308, 0x20, 0, 0}, {0x5309, 0x40, 0, 0}, {0x5304, 0x00, 0, 0}, {0x5305, 0x30, 0, 0}, {0x5306, 0x00, 0, 0}, {0x5307, 0x80, 0, 0}, {0x5314, 0x08, 0, 0}, {0x5315, 0x20, 0, 0}, {0x5319, 0x30, 0, 0}, {0x5316, 0x10, 0, 0}, {0x5317, 0x00, 0, 0}, {0x5318, 0x02, 0, 0}, {0x5380, 0x01, 0, 0}, {0x5381, 0x00, 0, 0}, {0x5382, 0x00, 0, 0}, {0x5383, 0x4e, 0, 0}, {0x5384, 0x00, 0, 0}, {0x5385, 0x0f, 0, 0}, {0x5386, 0x00, 0, 0}, {0x5387, 0x00, 0, 0}, {0x5388, 0x01, 0, 0}, {0x5389, 0x15, 0, 0}, {0x538a, 0x00, 0, 0}, {0x538b, 0x31, 0, 0}, {0x538c, 0x00, 0, 0}, {0x538d, 0x00, 0, 0}, {0x538e, 0x00, 0, 0}, {0x538f, 0x0f, 0, 0}, {0x5390, 0x00, 0, 0}, {0x5391, 0xab, 0, 0}, {0x5392, 0x00, 0, 0}, {0x5393, 0xa2, 0, 0}, {0x5394, 0x08, 0, 0}, {0x5480, 0x14, 0, 0}, {0x5481, 0x21, 0, 0}, {0x5482, 0x36, 0, 0}, {0x5483, 0x57, 0, 0}, {0x5484, 0x65, 0, 0}, {0x5485, 0x71, 0, 0}, {0x5486, 0x7d, 0, 0}, {0x5487, 0x87, 0, 0}, {0x5488, 0x91, 0, 0}, {0x5489, 0x9a, 0, 0}, {0x548a, 0xaa, 0, 0}, {0x548b, 0xb8, 0, 0}, {0x548c, 0xcd, 0, 0}, {0x548d, 0xdd, 0, 0}, {0x548e, 0xea, 0, 0}, {0x548f, 0x1d, 0, 0}, {0x5490, 0x05, 0, 0}, {0x5491, 0x00, 0, 0}, {0x5492, 0x04, 0, 0}, {0x5493, 0x20, 0, 0}, {0x5494, 0x03, 0, 0}, {0x5495, 0x60, 0, 0}, {0x5496, 0x02, 0, 0}, {0x5497, 0xb8, 0, 0}, {0x5498, 0x02, 0, 0}, {0x5499, 0x86, 0, 0}, {0x549a, 0x02, 0, 0}, {0x549b, 0x5b, 0, 0}, {0x549c, 0x02, 0, 0}, {0x549d, 0x3b, 0, 0}, {0x549e, 0x02, 0, 0}, {0x549f, 0x1c, 0, 0}, {0x54a0, 0x02, 0, 0}, {0x54a1, 0x04, 0, 0}, {0x54a2, 0x01, 0, 0}, {0x54a3, 0xed, 0, 0}, {0x54a4, 0x01, 0, 0}, {0x54a5, 0xc5, 0, 0}, {0x54a6, 0x01, 0, 0}, {0x54a7, 0xa5, 0, 0}, {0x54a8, 0x01, 0, 0}, {0x54a9, 0x6c, 0, 0}, {0x54aa, 0x01, 0, 0}, {0x54ab, 0x41, 0, 0}, {0x54ac, 0x01, 0, 0}, {0x54ad, 0x20, 0, 0}, {0x54ae, 0x00, 0, 0}, {0x54af, 0x16, 0, 0}, {0x54b0, 0x01, 0, 0}, {0x54b1, 0x20, 0, 0}, {0x54b2, 0x00, 0, 0}, {0x54b3, 0x10, 0, 0}, {0x54b4, 0x00, 0, 0}, {0x54b5, 0xf0, 0, 0}, {0x54b6, 0x00, 0, 0}, {0x54b7, 0xdf, 0, 0}, {0x5402, 0x3f, 0, 0}, {0x5403, 0x00, 0, 0}, {0x3406, 0x00, 0, 0}, {0x5180, 0xff, 0, 0}, {0x5181, 0x52, 0, 0}, {0x5182, 0x11, 0, 0}, {0x5183, 0x14, 0, 0}, {0x5184, 0x25, 0, 0}, {0x5185, 0x24, 0, 0}, {0x5186, 0x06, 0, 0}, {0x5187, 0x08, 0, 0}, {0x5188, 0x08, 0, 0}, {0x5189, 0x7c, 0, 0}, {0x518a, 0x60, 0, 0}, {0x518b, 0xb2, 0, 0}, {0x518c, 0xb2, 0, 0}, {0x518d, 0x44, 0, 0}, {0x518e, 0x3d, 0, 0}, {0x518f, 0x58, 0, 0}, {0x5190, 0x46, 0, 0}, {0x5191, 0xf8, 0, 0}, {0x5192, 0x04, 0, 0}, {0x5193, 0x70, 0, 0}, {0x5194, 0xf0, 0, 0}, {0x5195, 0xf0, 0, 0}, {0x5196, 0x03, 0, 0}, {0x5197, 0x01, 0, 0}, {0x5198, 0x04, 0, 0}, {0x5199, 0x12, 0, 0}, {0x519a, 0x04, 0, 0}, {0x519b, 0x00, 0, 0}, {0x519c, 0x06, 0, 0}, {0x519d, 0x82, 0, 0}, {0x519e, 0x00, 0, 0}, {0x5025, 0x80, 0, 0}, {0x3a0f, 0x38, 0, 0}, {0x3a10, 0x30, 0, 0}, {0x3a1b, 0x3a, 0, 0}, {0x3a1e, 0x2e, 0, 0}, {0x3a11, 0x60, 0, 0}, {0x3a1f, 0x10, 0, 0}, {0x5688, 0xa6, 0, 0}, {0x5689, 0x6a, 0, 0}, {0x568a, 0xea, 0, 0}, {0x568b, 0xae, 0, 0}, {0x568c, 0xa6, 0, 0}, {0x568d, 0x6a, 0, 0}, {0x568e, 0x62, 0, 0}, {0x568f, 0x26, 0, 0}, {0x5583, 0x40, 0, 0}, {0x5584, 0x40, 0, 0}, {0x5580, 0x02, 0, 0}, {0x5000, 0xcf, 0, 0}, {0x5800, 0x27, 0, 0}, {0x5801, 0x19, 0, 0}, {0x5802, 0x12, 0, 0}, {0x5803, 0x0f, 0, 0}, {0x5804, 0x10, 0, 0}, {0x5805, 0x15, 0, 0}, {0x5806, 0x1e, 0, 0}, {0x5807, 0x2f, 0, 0}, {0x5808, 0x15, 0, 0}, {0x5809, 0x0d, 0, 0}, {0x580a, 0x0a, 0, 0}, {0x580b, 0x09, 0, 0}, {0x580c, 0x0a, 0, 0}, {0x580d, 0x0c, 0, 0}, {0x580e, 0x12, 0, 0}, {0x580f, 0x19, 0, 0}, {0x5810, 0x0b, 0, 0}, {0x5811, 0x07, 0, 0}, {0x5812, 0x04, 0, 0}, {0x5813, 0x03, 0, 0}, {0x5814, 0x03, 0, 0}, {0x5815, 0x06, 0, 0}, {0x5816, 0x0a, 0, 0}, {0x5817, 0x0f, 0, 0}, {0x5818, 0x0a, 0, 0}, {0x5819, 0x05, 0, 0}, {0x581a, 0x01, 0, 0}, {0x581b, 0x00, 0, 0}, {0x581c, 0x00, 0, 0}, {0x581d, 0x03, 0, 0}, {0x581e, 0x08, 0, 0}, {0x581f, 0x0c, 0, 0}, {0x5820, 0x0a, 0, 0}, {0x5821, 0x05, 0, 0}, {0x5822, 0x01, 0, 0}, {0x5823, 0x00, 0, 0}, {0x5824, 0x00, 0, 0}, {0x5825, 0x03, 0, 0}, {0x5826, 0x08, 0, 0}, {0x5827, 0x0c, 0, 0}, {0x5828, 0x0e, 0, 0}, {0x5829, 0x08, 0, 0}, {0x582a, 0x06, 0, 0}, {0x582b, 0x04, 0, 0}, {0x582c, 0x05, 0, 0}, {0x582d, 0x07, 0, 0}, {0x582e, 0x0b, 0, 0}, {0x582f, 0x12, 0, 0}, {0x5830, 0x18, 0, 0}, {0x5831, 0x10, 0, 0}, {0x5832, 0x0c, 0, 0}, {0x5833, 0x0a, 0, 0}, {0x5834, 0x0b, 0, 0}, {0x5835, 0x0e, 0, 0}, {0x5836, 0x15, 0, 0}, {0x5837, 0x19, 0, 0}, {0x5838, 0x32, 0, 0}, {0x5839, 0x1f, 0, 0}, {0x583a, 0x18, 0, 0}, {0x583b, 0x16, 0, 0}, {0x583c, 0x17, 0, 0}, {0x583d, 0x1e, 0, 0}, {0x583e, 0x26, 0, 0}, {0x583f, 0x53, 0, 0}, {0x5840, 0x10, 0, 0}, {0x5841, 0x0f, 0, 0}, {0x5842, 0x0d, 0, 0}, {0x5843, 0x0c, 0, 0}, {0x5844, 0x0e, 0, 0}, {0x5845, 0x09, 0, 0}, {0x5846, 0x11, 0, 0}, {0x5847, 0x10, 0, 0}, {0x5848, 0x10, 0, 0}, {0x5849, 0x10, 0, 0}, {0x584a, 0x10, 0, 0}, {0x584b, 0x0e, 0, 0}, {0x584c, 0x10, 0, 0}, {0x584d, 0x10, 0, 0}, {0x584e, 0x11, 0, 0}, {0x584f, 0x10, 0, 0}, {0x5850, 0x0f, 0, 0}, {0x5851, 0x0c, 0, 0}, {0x5852, 0x0f, 0, 0}, {0x5853, 0x10, 0, 0}, {0x5854, 0x10, 0, 0}, {0x5855, 0x0f, 0, 0}, {0x5856, 0x0e, 0, 0}, {0x5857, 0x0b, 0, 0}, {0x5858, 0x10, 0, 0}, {0x5859, 0x0d, 0, 0}, {0x585a, 0x0d, 0, 0}, {0x585b, 0x0c, 0, 0}, {0x585c, 0x0c, 0, 0}, {0x585d, 0x0c, 0, 0}, {0x585e, 0x0b, 0, 0}, {0x585f, 0x0c, 0, 0}, {0x5860, 0x0c, 0, 0}, {0x5861, 0x0c, 0, 0}, {0x5862, 0x0d, 0, 0}, {0x5863, 0x08, 0, 0}, {0x5864, 0x11, 0, 0}, {0x5865, 0x18, 0, 0}, {0x5866, 0x18, 0, 0}, {0x5867, 0x19, 0, 0}, {0x5868, 0x17, 0, 0}, {0x5869, 0x19, 0, 0}, {0x586a, 0x16, 0, 0}, {0x586b, 0x13, 0, 0}, {0x586c, 0x13, 0, 0}, {0x586d, 0x12, 0, 0}, {0x586e, 0x13, 0, 0}, {0x586f, 0x16, 0, 0}, {0x5870, 0x14, 0, 0}, {0x5871, 0x12, 0, 0}, {0x5872, 0x10, 0, 0}, {0x5873, 0x11, 0, 0}, {0x5874, 0x11, 0, 0}, {0x5875, 0x16, 0, 0}, {0x5876, 0x14, 0, 0}, {0x5877, 0x11, 0, 0}, {0x5878, 0x10, 0, 0}, {0x5879, 0x0f, 0, 0}, {0x587a, 0x10, 0, 0}, {0x587b, 0x14, 0, 0}, {0x587c, 0x13, 0, 0}, {0x587d, 0x12, 0, 0}, {0x587e, 0x11, 0, 0}, {0x587f, 0x11, 0, 0}, {0x5880, 0x12, 0, 0}, {0x5881, 0x15, 0, 0}, {0x5882, 0x14, 0, 0}, {0x5883, 0x15, 0, 0}, {0x5884, 0x15, 0, 0}, {0x5885, 0x15, 0, 0}, {0x5886, 0x13, 0, 0}, {0x5887, 0x17, 0, 0}, {0x3710, 0x10, 0, 0}, {0x3632, 0x51, 0, 0}, {0x3702, 0x10, 0, 0}, {0x3703, 0xb2, 0, 0}, {0x3704, 0x18, 0, 0}, {0x370b, 0x40, 0, 0}, {0x370d, 0x03, 0, 0}, {0x3631, 0x01, 0, 0}, {0x3632, 0x52, 0, 0}, {0x3606, 0x24, 0, 0}, {0x3620, 0x96, 0, 0}, {0x5785, 0x07, 0, 0}, {0x3a13, 0x30, 0, 0}, {0x3600, 0x52, 0, 0}, {0x3604, 0x48, 0, 0}, {0x3606, 0x1b, 0, 0}, {0x370d, 0x0b, 0, 0}, {0x370f, 0xc0, 0, 0}, {0x3709, 0x01, 0, 0}, {0x3823, 0x00, 0, 0}, {0x5007, 0x00, 0, 0}, {0x5009, 0x00, 0, 0}, {0x5011, 0x00, 0, 0}, {0x5013, 0x00, 0, 0}, {0x519e, 0x00, 0, 0}, {0x5086, 0x00, 0, 0}, {0x5087, 0x00, 0, 0}, {0x5088, 0x00, 0, 0}, {0x5089, 0x00, 0, 0}, {0x302b, 0x00, 0, 0}, {0x3621, 0x87, 0, 0}, {0x3a00, 0x78, 0, 0}, {0x3808, 0x04, 0, 0}, {0x3809, 0x00, 0, 0}, {0x380a, 0x03, 0, 0}, {0x380b, 0x00, 0, 0}, {0x3815, 0x02, 0, 0}, {0x302c, 0x60, 0x60, 0}, }; static struct reg_value ov5642_setting_15fps_XGA_1024_768[] = { {0x3103, 0x93, 0, 0}, {0x3008, 0x82, 0, 0}, {0x3017, 0x7f, 0, 0}, {0x3018, 0xfc, 0, 0}, {0x3615, 0xf0, 0, 0}, {0x3000, 0x00, 0, 0}, {0x3001, 0x00, 0, 0}, {0x3002, 0x5c, 0, 0}, {0x3003, 0x00, 0, 0}, {0x3004, 0xff, 0, 0}, {0x3005, 0xff, 0, 0}, {0x3006, 0x43, 0, 0}, {0x3007, 0x37, 0, 0}, {0x3011, 0x09, 0, 0}, {0x3012, 0x02, 0, 0}, {0x3010, 0x00, 0, 0}, {0x460c, 0x20, 0, 0}, {0x3815, 0x04, 0, 0}, {0x370c, 0xa0, 0, 0}, {0x3602, 0xfc, 0, 0}, {0x3612, 0xff, 0, 0}, {0x3634, 0xc0, 0, 0}, {0x3613, 0x00, 0, 0}, {0x3605, 0x7c, 0, 0}, {0x3621, 0x09, 0, 0}, {0x3622, 0x60, 0, 0}, {0x3604, 0x40, 0, 0}, {0x3603, 0xa7, 0, 0}, {0x3603, 0x27, 0, 0}, {0x4000, 0x21, 0, 0}, {0x401d, 0x22, 0, 0}, {0x3600, 0x54, 0, 0}, {0x3605, 0x04, 0, 0}, {0x3606, 0x3f, 0, 0}, {0x3c01, 0x80, 0, 0}, {0x5000, 0x4f, 0, 0}, {0x5020, 0x04, 0, 0}, {0x5181, 0x79, 0, 0}, {0x5182, 0x00, 0, 0}, {0x5185, 0x22, 0, 0}, {0x5197, 0x01, 0, 0}, {0x5001, 0xff, 0, 0}, {0x5500, 0x0a, 0, 0}, {0x5504, 0x00, 0, 0}, {0x5505, 0x7f, 0, 0}, {0x5080, 0x08, 0, 0}, {0x300e, 0x18, 0, 0}, {0x4610, 0x00, 0, 0}, {0x471d, 0x05, 0, 0}, {0x4708, 0x06, 0, 0}, {0x3808, 0x02, 0, 0}, {0x3809, 0x80, 0, 0}, {0x380a, 0x01, 0, 0}, {0x380b, 0xe0, 0, 0}, {0x380e, 0x07, 0, 0}, {0x380f, 0xd0, 0, 0}, {0x501f, 0x00, 0, 0}, {0x5000, 0x4f, 0, 0}, {0x4300, 0x30, 0, 0}, {0x3503, 0x07, 0, 0}, {0x3501, 0x73, 0, 0}, {0x3502, 0x80, 0, 0}, {0x350b, 0x00, 0, 0}, {0x3503, 0x07, 0, 0}, {0x3824, 0x11, 0, 0}, {0x3825, 0xb0, 0, 0}, {0x3501, 0x1e, 0, 0}, {0x3502, 0x80, 0, 0}, {0x350b, 0x7f, 0, 0}, {0x380c, 0x07, 0, 0}, {0x380d, 0x2a, 0, 0}, {0x380e, 0x07, 0, 0}, {0x380f, 0xd0, 0, 0}, {0x3a0d, 0x04, 0, 0}, {0x3a0e, 0x03, 0, 0}, {0x3818, 0xc1, 0, 0}, {0x3705, 0xdb, 0, 0}, {0x370a, 0x81, 0, 0}, {0x3801, 0x80, 0, 0}, {0x3621, 0xc7, 0, 0}, {0x3801, 0x50, 0, 0}, {0x3803, 0x08, 0, 0}, {0x3827, 0x08, 0, 0}, {0x3810, 0x80, 0, 0}, {0x3804, 0x05, 0, 0}, {0x3805, 0x00, 0, 0}, {0x5682, 0x05, 0, 0}, {0x5683, 0x00, 0, 0}, {0x3806, 0x03, 0, 0}, {0x3807, 0xc0, 0, 0}, {0x5686, 0x03, 0, 0}, {0x5687, 0xbc, 0, 0}, {0x3a00, 0x78, 0, 0}, {0x3a1a, 0x05, 0, 0}, {0x3a13, 0x30, 0, 0}, {0x3a18, 0x00, 0, 0}, {0x3a19, 0x7c, 0, 0}, {0x3a08, 0x12, 0, 0}, {0x3a09, 0xc0, 0, 0}, {0x3a0a, 0x0f, 0, 0}, {0x3a0b, 0xa0, 0, 0}, {0x350c, 0x07, 0, 0}, {0x350d, 0xd0, 0, 0}, {0x3500, 0x00, 0, 0}, {0x3501, 0x00, 0, 0}, {0x3502, 0x00, 0, 0}, {0x350a, 0x00, 0, 0}, {0x350b, 0x00, 0, 0}, {0x3503, 0x00, 0, 0}, {0x528a, 0x02, 0, 0}, {0x528b, 0x04, 0, 0}, {0x528c, 0x08, 0, 0}, {0x528d, 0x08, 0, 0}, {0x528e, 0x08, 0, 0}, {0x528f, 0x10, 0, 0}, {0x5290, 0x10, 0, 0}, {0x5292, 0x00, 0, 0}, {0x5293, 0x02, 0, 0}, {0x5294, 0x00, 0, 0}, {0x5295, 0x02, 0, 0}, {0x5296, 0x00, 0, 0}, {0x5297, 0x02, 0, 0}, {0x5298, 0x00, 0, 0}, {0x5299, 0x02, 0, 0}, {0x529a, 0x00, 0, 0}, {0x529b, 0x02, 0, 0}, {0x529c, 0x00, 0, 0}, {0x529d, 0x02, 0, 0}, {0x529e, 0x00, 0, 0}, {0x529f, 0x02, 0, 0}, {0x3a0f, 0x3c, 0, 0}, {0x3a10, 0x30, 0, 0}, {0x3a1b, 0x3c, 0, 0}, {0x3a1e, 0x30, 0, 0}, {0x3a11, 0x70, 0, 0}, {0x3a1f, 0x10, 0, 0}, {0x3030, 0x2b, 0, 0}, {0x3a02, 0x00, 0, 0}, {0x3a03, 0x7d, 0, 0}, {0x3a04, 0x00, 0, 0}, {0x3a14, 0x00, 0, 0}, {0x3a15, 0x7d, 0, 0}, {0x3a16, 0x00, 0, 0}, {0x3a00, 0x78, 0, 0}, {0x3a08, 0x12, 0, 0}, {0x3a09, 0xc0, 0, 0}, {0x3a0a, 0x0f, 0, 0}, {0x3a0b, 0xa0, 0, 0}, {0x3a0d, 0x04, 0, 0}, {0x3a0e, 0x03, 0, 0}, {0x5193, 0x70, 0, 0}, {0x589b, 0x04, 0, 0}, {0x589a, 0xc5, 0, 0}, {0x401e, 0x20, 0, 0}, {0x4001, 0x42, 0, 0}, {0x401c, 0x04, 0, 0}, {0x528a, 0x01, 0, 0}, {0x528b, 0x04, 0, 0}, {0x528c, 0x08, 0, 0}, {0x528d, 0x10, 0, 0}, {0x528e, 0x20, 0, 0}, {0x528f, 0x28, 0, 0}, {0x5290, 0x30, 0, 0}, {0x5292, 0x00, 0, 0}, {0x5293, 0x01, 0, 0}, {0x5294, 0x00, 0, 0}, {0x5295, 0x04, 0, 0}, {0x5296, 0x00, 0, 0}, {0x5297, 0x08, 0, 0}, {0x5298, 0x00, 0, 0}, {0x5299, 0x10, 0, 0}, {0x529a, 0x00, 0, 0}, {0x529b, 0x20, 0, 0}, {0x529c, 0x00, 0, 0}, {0x529d, 0x28, 0, 0}, {0x529e, 0x00, 0, 0}, {0x529f, 0x30, 0, 0}, {0x5282, 0x00, 0, 0}, {0x5300, 0x00, 0, 0}, {0x5301, 0x20, 0, 0}, {0x5302, 0x00, 0, 0}, {0x5303, 0x7c, 0, 0}, {0x530c, 0x00, 0, 0}, {0x530d, 0x0c, 0, 0}, {0x530e, 0x20, 0, 0}, {0x530f, 0x80, 0, 0}, {0x5310, 0x20, 0, 0}, {0x5311, 0x80, 0, 0}, {0x5308, 0x20, 0, 0}, {0x5309, 0x40, 0, 0}, {0x5304, 0x00, 0, 0}, {0x5305, 0x30, 0, 0}, {0x5306, 0x00, 0, 0}, {0x5307, 0x80, 0, 0}, {0x5314, 0x08, 0, 0}, {0x5315, 0x20, 0, 0}, {0x5319, 0x30, 0, 0}, {0x5316, 0x10, 0, 0}, {0x5317, 0x00, 0, 0}, {0x5318, 0x02, 0, 0}, {0x5380, 0x01, 0, 0}, {0x5381, 0x00, 0, 0}, {0x5382, 0x00, 0, 0}, {0x5383, 0x4e, 0, 0}, {0x5384, 0x00, 0, 0}, {0x5385, 0x0f, 0, 0}, {0x5386, 0x00, 0, 0}, {0x5387, 0x00, 0, 0}, {0x5388, 0x01, 0, 0}, {0x5389, 0x15, 0, 0}, {0x538a, 0x00, 0, 0}, {0x538b, 0x31, 0, 0}, {0x538c, 0x00, 0, 0}, {0x538d, 0x00, 0, 0}, {0x538e, 0x00, 0, 0}, {0x538f, 0x0f, 0, 0}, {0x5390, 0x00, 0, 0}, {0x5391, 0xab, 0, 0}, {0x5392, 0x00, 0, 0}, {0x5393, 0xa2, 0, 0}, {0x5394, 0x08, 0, 0}, {0x5480, 0x14, 0, 0}, {0x5481, 0x21, 0, 0}, {0x5482, 0x36, 0, 0}, {0x5483, 0x57, 0, 0}, {0x5484, 0x65, 0, 0}, {0x5485, 0x71, 0, 0}, {0x5486, 0x7d, 0, 0}, {0x5487, 0x87, 0, 0}, {0x5488, 0x91, 0, 0}, {0x5489, 0x9a, 0, 0}, {0x548a, 0xaa, 0, 0}, {0x548b, 0xb8, 0, 0}, {0x548c, 0xcd, 0, 0}, {0x548d, 0xdd, 0, 0}, {0x548e, 0xea, 0, 0}, {0x548f, 0x1d, 0, 0}, {0x5490, 0x05, 0, 0}, {0x5491, 0x00, 0, 0}, {0x5492, 0x04, 0, 0}, {0x5493, 0x20, 0, 0}, {0x5494, 0x03, 0, 0}, {0x5495, 0x60, 0, 0}, {0x5496, 0x02, 0, 0}, {0x5497, 0xb8, 0, 0}, {0x5498, 0x02, 0, 0}, {0x5499, 0x86, 0, 0}, {0x549a, 0x02, 0, 0}, {0x549b, 0x5b, 0, 0}, {0x549c, 0x02, 0, 0}, {0x549d, 0x3b, 0, 0}, {0x549e, 0x02, 0, 0}, {0x549f, 0x1c, 0, 0}, {0x54a0, 0x02, 0, 0}, {0x54a1, 0x04, 0, 0}, {0x54a2, 0x01, 0, 0}, {0x54a3, 0xed, 0, 0}, {0x54a4, 0x01, 0, 0}, {0x54a5, 0xc5, 0, 0}, {0x54a6, 0x01, 0, 0}, {0x54a7, 0xa5, 0, 0}, {0x54a8, 0x01, 0, 0}, {0x54a9, 0x6c, 0, 0}, {0x54aa, 0x01, 0, 0}, {0x54ab, 0x41, 0, 0}, {0x54ac, 0x01, 0, 0}, {0x54ad, 0x20, 0, 0}, {0x54ae, 0x00, 0, 0}, {0x54af, 0x16, 0, 0}, {0x54b0, 0x01, 0, 0}, {0x54b1, 0x20, 0, 0}, {0x54b2, 0x00, 0, 0}, {0x54b3, 0x10, 0, 0}, {0x54b4, 0x00, 0, 0}, {0x54b5, 0xf0, 0, 0}, {0x54b6, 0x00, 0, 0}, {0x54b7, 0xdf, 0, 0}, {0x5402, 0x3f, 0, 0}, {0x5403, 0x00, 0, 0}, {0x3406, 0x00, 0, 0}, {0x5180, 0xff, 0, 0}, {0x5181, 0x52, 0, 0}, {0x5182, 0x11, 0, 0}, {0x5183, 0x14, 0, 0}, {0x5184, 0x25, 0, 0}, {0x5185, 0x24, 0, 0}, {0x5186, 0x06, 0, 0}, {0x5187, 0x08, 0, 0}, {0x5188, 0x08, 0, 0}, {0x5189, 0x7c, 0, 0}, {0x518a, 0x60, 0, 0}, {0x518b, 0xb2, 0, 0}, {0x518c, 0xb2, 0, 0}, {0x518d, 0x44, 0, 0}, {0x518e, 0x3d, 0, 0}, {0x518f, 0x58, 0, 0}, {0x5190, 0x46, 0, 0}, {0x5191, 0xf8, 0, 0}, {0x5192, 0x04, 0, 0}, {0x5193, 0x70, 0, 0}, {0x5194, 0xf0, 0, 0}, {0x5195, 0xf0, 0, 0}, {0x5196, 0x03, 0, 0}, {0x5197, 0x01, 0, 0}, {0x5198, 0x04, 0, 0}, {0x5199, 0x12, 0, 0}, {0x519a, 0x04, 0, 0}, {0x519b, 0x00, 0, 0}, {0x519c, 0x06, 0, 0}, {0x519d, 0x82, 0, 0}, {0x519e, 0x00, 0, 0}, {0x5025, 0x80, 0, 0}, {0x3a0f, 0x38, 0, 0}, {0x3a10, 0x30, 0, 0}, {0x3a1b, 0x3a, 0, 0}, {0x3a1e, 0x2e, 0, 0}, {0x3a11, 0x60, 0, 0}, {0x3a1f, 0x10, 0, 0}, {0x5688, 0xa6, 0, 0}, {0x5689, 0x6a, 0, 0}, {0x568a, 0xea, 0, 0}, {0x568b, 0xae, 0, 0}, {0x568c, 0xa6, 0, 0}, {0x568d, 0x6a, 0, 0}, {0x568e, 0x62, 0, 0}, {0x568f, 0x26, 0, 0}, {0x5583, 0x40, 0, 0}, {0x5584, 0x40, 0, 0}, {0x5580, 0x02, 0, 0}, {0x5000, 0xcf, 0, 0}, {0x5800, 0x27, 0, 0}, {0x5801, 0x19, 0, 0}, {0x5802, 0x12, 0, 0}, {0x5803, 0x0f, 0, 0}, {0x5804, 0x10, 0, 0}, {0x5805, 0x15, 0, 0}, {0x5806, 0x1e, 0, 0}, {0x5807, 0x2f, 0, 0}, {0x5808, 0x15, 0, 0}, {0x5809, 0x0d, 0, 0}, {0x580a, 0x0a, 0, 0}, {0x580b, 0x09, 0, 0}, {0x580c, 0x0a, 0, 0}, {0x580d, 0x0c, 0, 0}, {0x580e, 0x12, 0, 0}, {0x580f, 0x19, 0, 0}, {0x5810, 0x0b, 0, 0}, {0x5811, 0x07, 0, 0}, {0x5812, 0x04, 0, 0}, {0x5813, 0x03, 0, 0}, {0x5814, 0x03, 0, 0}, {0x5815, 0x06, 0, 0}, {0x5816, 0x0a, 0, 0}, {0x5817, 0x0f, 0, 0}, {0x5818, 0x0a, 0, 0}, {0x5819, 0x05, 0, 0}, {0x581a, 0x01, 0, 0}, {0x581b, 0x00, 0, 0}, {0x581c, 0x00, 0, 0}, {0x581d, 0x03, 0, 0}, {0x581e, 0x08, 0, 0}, {0x581f, 0x0c, 0, 0}, {0x5820, 0x0a, 0, 0}, {0x5821, 0x05, 0, 0}, {0x5822, 0x01, 0, 0}, {0x5823, 0x00, 0, 0}, {0x5824, 0x00, 0, 0}, {0x5825, 0x03, 0, 0}, {0x5826, 0x08, 0, 0}, {0x5827, 0x0c, 0, 0}, {0x5828, 0x0e, 0, 0}, {0x5829, 0x08, 0, 0}, {0x582a, 0x06, 0, 0}, {0x582b, 0x04, 0, 0}, {0x582c, 0x05, 0, 0}, {0x582d, 0x07, 0, 0}, {0x582e, 0x0b, 0, 0}, {0x582f, 0x12, 0, 0}, {0x5830, 0x18, 0, 0}, {0x5831, 0x10, 0, 0}, {0x5832, 0x0c, 0, 0}, {0x5833, 0x0a, 0, 0}, {0x5834, 0x0b, 0, 0}, {0x5835, 0x0e, 0, 0}, {0x5836, 0x15, 0, 0}, {0x5837, 0x19, 0, 0}, {0x5838, 0x32, 0, 0}, {0x5839, 0x1f, 0, 0}, {0x583a, 0x18, 0, 0}, {0x583b, 0x16, 0, 0}, {0x583c, 0x17, 0, 0}, {0x583d, 0x1e, 0, 0}, {0x583e, 0x26, 0, 0}, {0x583f, 0x53, 0, 0}, {0x5840, 0x10, 0, 0}, {0x5841, 0x0f, 0, 0}, {0x5842, 0x0d, 0, 0}, {0x5843, 0x0c, 0, 0}, {0x5844, 0x0e, 0, 0}, {0x5845, 0x09, 0, 0}, {0x5846, 0x11, 0, 0}, {0x5847, 0x10, 0, 0}, {0x5848, 0x10, 0, 0}, {0x5849, 0x10, 0, 0}, {0x584a, 0x10, 0, 0}, {0x584b, 0x0e, 0, 0}, {0x584c, 0x10, 0, 0}, {0x584d, 0x10, 0, 0}, {0x584e, 0x11, 0, 0}, {0x584f, 0x10, 0, 0}, {0x5850, 0x0f, 0, 0}, {0x5851, 0x0c, 0, 0}, {0x5852, 0x0f, 0, 0}, {0x5853, 0x10, 0, 0}, {0x5854, 0x10, 0, 0}, {0x5855, 0x0f, 0, 0}, {0x5856, 0x0e, 0, 0}, {0x5857, 0x0b, 0, 0}, {0x5858, 0x10, 0, 0}, {0x5859, 0x0d, 0, 0}, {0x585a, 0x0d, 0, 0}, {0x585b, 0x0c, 0, 0}, {0x585c, 0x0c, 0, 0}, {0x585d, 0x0c, 0, 0}, {0x585e, 0x0b, 0, 0}, {0x585f, 0x0c, 0, 0}, {0x5860, 0x0c, 0, 0}, {0x5861, 0x0c, 0, 0}, {0x5862, 0x0d, 0, 0}, {0x5863, 0x08, 0, 0}, {0x5864, 0x11, 0, 0}, {0x5865, 0x18, 0, 0}, {0x5866, 0x18, 0, 0}, {0x5867, 0x19, 0, 0}, {0x5868, 0x17, 0, 0}, {0x5869, 0x19, 0, 0}, {0x586a, 0x16, 0, 0}, {0x586b, 0x13, 0, 0}, {0x586c, 0x13, 0, 0}, {0x586d, 0x12, 0, 0}, {0x586e, 0x13, 0, 0}, {0x586f, 0x16, 0, 0}, {0x5870, 0x14, 0, 0}, {0x5871, 0x12, 0, 0}, {0x5872, 0x10, 0, 0}, {0x5873, 0x11, 0, 0}, {0x5874, 0x11, 0, 0}, {0x5875, 0x16, 0, 0}, {0x5876, 0x14, 0, 0}, {0x5877, 0x11, 0, 0}, {0x5878, 0x10, 0, 0}, {0x5879, 0x0f, 0, 0}, {0x587a, 0x10, 0, 0}, {0x587b, 0x14, 0, 0}, {0x587c, 0x13, 0, 0}, {0x587d, 0x12, 0, 0}, {0x587e, 0x11, 0, 0}, {0x587f, 0x11, 0, 0}, {0x5880, 0x12, 0, 0}, {0x5881, 0x15, 0, 0}, {0x5882, 0x14, 0, 0}, {0x5883, 0x15, 0, 0}, {0x5884, 0x15, 0, 0}, {0x5885, 0x15, 0, 0}, {0x5886, 0x13, 0, 0}, {0x5887, 0x17, 0, 0}, {0x3710, 0x10, 0, 0}, {0x3632, 0x51, 0, 0}, {0x3702, 0x10, 0, 0}, {0x3703, 0xb2, 0, 0}, {0x3704, 0x18, 0, 0}, {0x370b, 0x40, 0, 0}, {0x370d, 0x03, 0, 0}, {0x3631, 0x01, 0, 0}, {0x3632, 0x52, 0, 0}, {0x3606, 0x24, 0, 0}, {0x3620, 0x96, 0, 0}, {0x5785, 0x07, 0, 0}, {0x3a13, 0x30, 0, 0}, {0x3600, 0x52, 0, 0}, {0x3604, 0x48, 0, 0}, {0x3606, 0x1b, 0, 0}, {0x370d, 0x0b, 0, 0}, {0x370f, 0xc0, 0, 0}, {0x3709, 0x01, 0, 0}, {0x3823, 0x00, 0, 0}, {0x5007, 0x00, 0, 0}, {0x5009, 0x00, 0, 0}, {0x5011, 0x00, 0, 0}, {0x5013, 0x00, 0, 0}, {0x519e, 0x00, 0, 0}, {0x5086, 0x00, 0, 0}, {0x5087, 0x00, 0, 0}, {0x5088, 0x00, 0, 0}, {0x5089, 0x00, 0, 0}, {0x302b, 0x00, 0, 0}, {0x3621, 0x87, 0, 0}, {0x3a00, 0x78, 0, 0}, {0x3808, 0x04, 0, 0}, {0x3809, 0x00, 0, 0}, {0x380a, 0x03, 0, 0}, {0x380b, 0x00, 0, 0}, {0x3815, 0x02, 0, 0}, {0x302c, 0x60, 0x60, 0}, }; static struct reg_value ov5642_setting_30fps_QVGA_320_240[] = { {0x3103, 0x93, 0, 0}, {0x3008, 0x82, 0, 0}, {0x3017, 0x7f, 0, 0}, {0x3018, 0xfc, 0, 0}, {0x3615, 0xf0, 0, 0}, {0x3000, 0x00, 0, 0}, {0x3001, 0x00, 0, 0}, {0x3002, 0x5c, 0, 0}, {0x3003, 0x00, 0, 0}, {0x3004, 0xff, 0, 0}, {0x3005, 0xff, 0, 0}, {0x3006, 0x43, 0, 0}, {0x3007, 0x37, 0, 0}, {0x3011, 0x09, 0, 0}, {0x3012, 0x02, 0, 0}, {0x3010, 0x00, 0, 0}, {0x460c, 0x20, 0, 0}, {0x3815, 0x04, 0, 0}, {0x370c, 0xa0, 0, 0}, {0x3602, 0xfc, 0, 0}, {0x3612, 0xff, 0, 0}, {0x3634, 0xc0, 0, 0}, {0x3613, 0x00, 0, 0}, {0x3605, 0x7c, 0, 0}, {0x3621, 0x09, 0, 0}, {0x3622, 0x60, 0, 0}, {0x3604, 0x40, 0, 0}, {0x3603, 0xa7, 0, 0}, {0x3603, 0x27, 0, 0}, {0x4000, 0x21, 0, 0}, {0x401d, 0x22, 0, 0}, {0x3600, 0x54, 0, 0}, {0x3605, 0x04, 0, 0}, {0x3606, 0x3f, 0, 0}, {0x3c01, 0x80, 0, 0}, {0x5000, 0x4f, 0, 0}, {0x5020, 0x04, 0, 0}, {0x5181, 0x79, 0, 0}, {0x5182, 0x00, 0, 0}, {0x5185, 0x22, 0, 0}, {0x5197, 0x01, 0, 0}, {0x5001, 0xff, 0, 0}, {0x5500, 0x0a, 0, 0}, {0x5504, 0x00, 0, 0}, {0x5505, 0x7f, 0, 0}, {0x5080, 0x08, 0, 0}, {0x300e, 0x18, 0, 0}, {0x4610, 0x00, 0, 0}, {0x471d, 0x05, 0, 0}, {0x4708, 0x06, 0, 0}, {0x3808, 0x02, 0, 0}, {0x3809, 0x80, 0, 0}, {0x380a, 0x01, 0, 0}, {0x380b, 0xe0, 0, 0}, {0x380e, 0x07, 0, 0}, {0x380f, 0xd0, 0, 0}, {0x501f, 0x00, 0, 0}, {0x5000, 0x4f, 0, 0}, {0x4300, 0x30, 0, 0}, {0x3503, 0x07, 0, 0}, {0x3501, 0x73, 0, 0}, {0x3502, 0x80, 0, 0}, {0x350b, 0x00, 0, 0}, {0x3503, 0x07, 0, 0}, {0x3824, 0x11, 0, 0}, {0x3825, 0xb0, 0, 0}, {0x3501, 0x1e, 0, 0}, {0x3502, 0x80, 0, 0}, {0x350b, 0x7f, 0, 0}, {0x380c, 0x07, 0, 0}, {0x380d, 0x2a, 0, 0}, {0x380e, 0x03, 0, 0}, {0x380f, 0xe8, 0, 0}, {0x3a0d, 0x04, 0, 0}, {0x3a0e, 0x03, 0, 0}, {0x3818, 0xc1, 0, 0}, {0x3705, 0xdb, 0, 0}, {0x370a, 0x81, 0, 0}, {0x3801, 0x80, 0, 0}, {0x3621, 0xc7, 0, 0}, {0x3801, 0x50, 0, 0}, {0x3803, 0x08, 0, 0}, {0x3827, 0x08, 0, 0}, {0x3810, 0x80, 0, 0}, {0x3804, 0x05, 0, 0}, {0x3805, 0x00, 0, 0}, {0x5682, 0x05, 0, 0}, {0x5683, 0x00, 0, 0}, {0x3806, 0x03, 0, 0}, {0x3807, 0xc0, 0, 0}, {0x5686, 0x03, 0, 0}, {0x5687, 0xbc, 0, 0}, {0x3a00, 0x78, 0, 0}, {0x3a1a, 0x05, 0, 0}, {0x3a13, 0x30, 0, 0}, {0x3a18, 0x00, 0, 0}, {0x3a19, 0x7c, 0, 0}, {0x3a08, 0x12, 0, 0}, {0x3a09, 0xc0, 0, 0}, {0x3a0a, 0x0f, 0, 0}, {0x3a0b, 0xa0, 0, 0}, {0x350c, 0x07, 0, 0}, {0x350d, 0xd0, 0, 0}, {0x3500, 0x00, 0, 0}, {0x3501, 0x00, 0, 0}, {0x3502, 0x00, 0, 0}, {0x350a, 0x00, 0, 0}, {0x350b, 0x00, 0, 0}, {0x3503, 0x00, 0, 0}, {0x528a, 0x02, 0, 0}, {0x528b, 0x04, 0, 0}, {0x528c, 0x08, 0, 0}, {0x528d, 0x08, 0, 0}, {0x528e, 0x08, 0, 0}, {0x528f, 0x10, 0, 0}, {0x5290, 0x10, 0, 0}, {0x5292, 0x00, 0, 0}, {0x5293, 0x02, 0, 0}, {0x5294, 0x00, 0, 0}, {0x5295, 0x02, 0, 0}, {0x5296, 0x00, 0, 0}, {0x5297, 0x02, 0, 0}, {0x5298, 0x00, 0, 0}, {0x5299, 0x02, 0, 0}, {0x529a, 0x00, 0, 0}, {0x529b, 0x02, 0, 0}, {0x529c, 0x00, 0, 0}, {0x529d, 0x02, 0, 0}, {0x529e, 0x00, 0, 0}, {0x529f, 0x02, 0, 0}, {0x3a0f, 0x3c, 0, 0}, {0x3a10, 0x30, 0, 0}, {0x3a1b, 0x3c, 0, 0}, {0x3a1e, 0x30, 0, 0}, {0x3a11, 0x70, 0, 0}, {0x3a1f, 0x10, 0, 0}, {0x3030, 0x2b, 0, 0}, {0x3a02, 0x00, 0, 0}, {0x3a03, 0x7d, 0, 0}, {0x3a04, 0x00, 0, 0}, {0x3a14, 0x00, 0, 0}, {0x3a15, 0x7d, 0, 0}, {0x3a16, 0x00, 0, 0}, {0x3a00, 0x78, 0, 0}, {0x3a08, 0x12, 0, 0}, {0x3a09, 0xc0, 0, 0}, {0x3a0a, 0x0f, 0, 0}, {0x3a0b, 0xa0, 0, 0}, {0x3a0d, 0x04, 0, 0}, {0x3a0e, 0x03, 0, 0}, {0x5193, 0x70, 0, 0}, {0x589b, 0x04, 0, 0}, {0x589a, 0xc5, 0, 0}, {0x401e, 0x20, 0, 0}, {0x4001, 0x42, 0, 0}, {0x401c, 0x04, 0, 0}, {0x528a, 0x01, 0, 0}, {0x528b, 0x04, 0, 0}, {0x528c, 0x08, 0, 0}, {0x528d, 0x10, 0, 0}, {0x528e, 0x20, 0, 0}, {0x528f, 0x28, 0, 0}, {0x5290, 0x30, 0, 0}, {0x5292, 0x00, 0, 0}, {0x5293, 0x01, 0, 0}, {0x5294, 0x00, 0, 0}, {0x5295, 0x04, 0, 0}, {0x5296, 0x00, 0, 0}, {0x5297, 0x08, 0, 0}, {0x5298, 0x00, 0, 0}, {0x5299, 0x10, 0, 0}, {0x529a, 0x00, 0, 0}, {0x529b, 0x20, 0, 0}, {0x529c, 0x00, 0, 0}, {0x529d, 0x28, 0, 0}, {0x529e, 0x00, 0, 0}, {0x529f, 0x30, 0, 0}, {0x5282, 0x00, 0, 0}, {0x5300, 0x00, 0, 0}, {0x5301, 0x20, 0, 0}, {0x5302, 0x00, 0, 0}, {0x5303, 0x7c, 0, 0}, {0x530c, 0x00, 0, 0}, {0x530d, 0x0c, 0, 0}, {0x530e, 0x20, 0, 0}, {0x530f, 0x80, 0, 0}, {0x5310, 0x20, 0, 0}, {0x5311, 0x80, 0, 0}, {0x5308, 0x20, 0, 0}, {0x5309, 0x40, 0, 0}, {0x5304, 0x00, 0, 0}, {0x5305, 0x30, 0, 0}, {0x5306, 0x00, 0, 0}, {0x5307, 0x80, 0, 0}, {0x5314, 0x08, 0, 0}, {0x5315, 0x20, 0, 0}, {0x5319, 0x30, 0, 0}, {0x5316, 0x10, 0, 0}, {0x5317, 0x00, 0, 0}, {0x5318, 0x02, 0, 0}, {0x5380, 0x01, 0, 0}, {0x5381, 0x00, 0, 0}, {0x5382, 0x00, 0, 0}, {0x5383, 0x4e, 0, 0}, {0x5384, 0x00, 0, 0}, {0x5385, 0x0f, 0, 0}, {0x5386, 0x00, 0, 0}, {0x5387, 0x00, 0, 0}, {0x5388, 0x01, 0, 0}, {0x5389, 0x15, 0, 0}, {0x538a, 0x00, 0, 0}, {0x538b, 0x31, 0, 0}, {0x538c, 0x00, 0, 0}, {0x538d, 0x00, 0, 0}, {0x538e, 0x00, 0, 0}, {0x538f, 0x0f, 0, 0}, {0x5390, 0x00, 0, 0}, {0x5391, 0xab, 0, 0}, {0x5392, 0x00, 0, 0}, {0x5393, 0xa2, 0, 0}, {0x5394, 0x08, 0, 0}, {0x5480, 0x14, 0, 0}, {0x5481, 0x21, 0, 0}, {0x5482, 0x36, 0, 0}, {0x5483, 0x57, 0, 0}, {0x5484, 0x65, 0, 0}, {0x5485, 0x71, 0, 0}, {0x5486, 0x7d, 0, 0}, {0x5487, 0x87, 0, 0}, {0x5488, 0x91, 0, 0}, {0x5489, 0x9a, 0, 0}, {0x548a, 0xaa, 0, 0}, {0x548b, 0xb8, 0, 0}, {0x548c, 0xcd, 0, 0}, {0x548d, 0xdd, 0, 0}, {0x548e, 0xea, 0, 0}, {0x548f, 0x1d, 0, 0}, {0x5490, 0x05, 0, 0}, {0x5491, 0x00, 0, 0}, {0x5492, 0x04, 0, 0}, {0x5493, 0x20, 0, 0}, {0x5494, 0x03, 0, 0}, {0x5495, 0x60, 0, 0}, {0x5496, 0x02, 0, 0}, {0x5497, 0xb8, 0, 0}, {0x5498, 0x02, 0, 0}, {0x5499, 0x86, 0, 0}, {0x549a, 0x02, 0, 0}, {0x549b, 0x5b, 0, 0}, {0x549c, 0x02, 0, 0}, {0x549d, 0x3b, 0, 0}, {0x549e, 0x02, 0, 0}, {0x549f, 0x1c, 0, 0}, {0x54a0, 0x02, 0, 0}, {0x54a1, 0x04, 0, 0}, {0x54a2, 0x01, 0, 0}, {0x54a3, 0xed, 0, 0}, {0x54a4, 0x01, 0, 0}, {0x54a5, 0xc5, 0, 0}, {0x54a6, 0x01, 0, 0}, {0x54a7, 0xa5, 0, 0}, {0x54a8, 0x01, 0, 0}, {0x54a9, 0x6c, 0, 0}, {0x54aa, 0x01, 0, 0}, {0x54ab, 0x41, 0, 0}, {0x54ac, 0x01, 0, 0}, {0x54ad, 0x20, 0, 0}, {0x54ae, 0x00, 0, 0}, {0x54af, 0x16, 0, 0}, {0x54b0, 0x01, 0, 0}, {0x54b1, 0x20, 0, 0}, {0x54b2, 0x00, 0, 0}, {0x54b3, 0x10, 0, 0}, {0x54b4, 0x00, 0, 0}, {0x54b5, 0xf0, 0, 0}, {0x54b6, 0x00, 0, 0}, {0x54b7, 0xdf, 0, 0}, {0x5402, 0x3f, 0, 0}, {0x5403, 0x00, 0, 0}, {0x3406, 0x00, 0, 0}, {0x5180, 0xff, 0, 0}, {0x5181, 0x52, 0, 0}, {0x5182, 0x11, 0, 0}, {0x5183, 0x14, 0, 0}, {0x5184, 0x25, 0, 0}, {0x5185, 0x24, 0, 0}, {0x5186, 0x06, 0, 0}, {0x5187, 0x08, 0, 0}, {0x5188, 0x08, 0, 0}, {0x5189, 0x7c, 0, 0}, {0x518a, 0x60, 0, 0}, {0x518b, 0xb2, 0, 0}, {0x518c, 0xb2, 0, 0}, {0x518d, 0x44, 0, 0}, {0x518e, 0x3d, 0, 0}, {0x518f, 0x58, 0, 0}, {0x5190, 0x46, 0, 0}, {0x5191, 0xf8, 0, 0}, {0x5192, 0x04, 0, 0}, {0x5193, 0x70, 0, 0}, {0x5194, 0xf0, 0, 0}, {0x5195, 0xf0, 0, 0}, {0x5196, 0x03, 0, 0}, {0x5197, 0x01, 0, 0}, {0x5198, 0x04, 0, 0}, {0x5199, 0x12, 0, 0}, {0x519a, 0x04, 0, 0}, {0x519b, 0x00, 0, 0}, {0x519c, 0x06, 0, 0}, {0x519d, 0x82, 0, 0}, {0x519e, 0x00, 0, 0}, {0x5025, 0x80, 0, 0}, {0x3a0f, 0x38, 0, 0}, {0x3a10, 0x30, 0, 0}, {0x3a1b, 0x3a, 0, 0}, {0x3a1e, 0x2e, 0, 0}, {0x3a11, 0x60, 0, 0}, {0x3a1f, 0x10, 0, 0}, {0x5688, 0xa6, 0, 0}, {0x5689, 0x6a, 0, 0}, {0x568a, 0xea, 0, 0}, {0x568b, 0xae, 0, 0}, {0x568c, 0xa6, 0, 0}, {0x568d, 0x6a, 0, 0}, {0x568e, 0x62, 0, 0}, {0x568f, 0x26, 0, 0}, {0x5583, 0x40, 0, 0}, {0x5584, 0x40, 0, 0}, {0x5580, 0x02, 0, 0}, {0x5000, 0xcf, 0, 0}, {0x5800, 0x27, 0, 0}, {0x5801, 0x19, 0, 0}, {0x5802, 0x12, 0, 0}, {0x5803, 0x0f, 0, 0}, {0x5804, 0x10, 0, 0}, {0x5805, 0x15, 0, 0}, {0x5806, 0x1e, 0, 0}, {0x5807, 0x2f, 0, 0}, {0x5808, 0x15, 0, 0}, {0x5809, 0x0d, 0, 0}, {0x580a, 0x0a, 0, 0}, {0x580b, 0x09, 0, 0}, {0x580c, 0x0a, 0, 0}, {0x580d, 0x0c, 0, 0}, {0x580e, 0x12, 0, 0}, {0x580f, 0x19, 0, 0}, {0x5810, 0x0b, 0, 0}, {0x5811, 0x07, 0, 0}, {0x5812, 0x04, 0, 0}, {0x5813, 0x03, 0, 0}, {0x5814, 0x03, 0, 0}, {0x5815, 0x06, 0, 0}, {0x5816, 0x0a, 0, 0}, {0x5817, 0x0f, 0, 0}, {0x5818, 0x0a, 0, 0}, {0x5819, 0x05, 0, 0}, {0x581a, 0x01, 0, 0}, {0x581b, 0x00, 0, 0}, {0x581c, 0x00, 0, 0}, {0x581d, 0x03, 0, 0}, {0x581e, 0x08, 0, 0}, {0x581f, 0x0c, 0, 0}, {0x5820, 0x0a, 0, 0}, {0x5821, 0x05, 0, 0}, {0x5822, 0x01, 0, 0}, {0x5823, 0x00, 0, 0}, {0x5824, 0x00, 0, 0}, {0x5825, 0x03, 0, 0}, {0x5826, 0x08, 0, 0}, {0x5827, 0x0c, 0, 0}, {0x5828, 0x0e, 0, 0}, {0x5829, 0x08, 0, 0}, {0x582a, 0x06, 0, 0}, {0x582b, 0x04, 0, 0}, {0x582c, 0x05, 0, 0}, {0x582d, 0x07, 0, 0}, {0x582e, 0x0b, 0, 0}, {0x582f, 0x12, 0, 0}, {0x5830, 0x18, 0, 0}, {0x5831, 0x10, 0, 0}, {0x5832, 0x0c, 0, 0}, {0x5833, 0x0a, 0, 0}, {0x5834, 0x0b, 0, 0}, {0x5835, 0x0e, 0, 0}, {0x5836, 0x15, 0, 0}, {0x5837, 0x19, 0, 0}, {0x5838, 0x32, 0, 0}, {0x5839, 0x1f, 0, 0}, {0x583a, 0x18, 0, 0}, {0x583b, 0x16, 0, 0}, {0x583c, 0x17, 0, 0}, {0x583d, 0x1e, 0, 0}, {0x583e, 0x26, 0, 0}, {0x583f, 0x53, 0, 0}, {0x5840, 0x10, 0, 0}, {0x5841, 0x0f, 0, 0}, {0x5842, 0x0d, 0, 0}, {0x5843, 0x0c, 0, 0}, {0x5844, 0x0e, 0, 0}, {0x5845, 0x09, 0, 0}, {0x5846, 0x11, 0, 0}, {0x5847, 0x10, 0, 0}, {0x5848, 0x10, 0, 0}, {0x5849, 0x10, 0, 0}, {0x584a, 0x10, 0, 0}, {0x584b, 0x0e, 0, 0}, {0x584c, 0x10, 0, 0}, {0x584d, 0x10, 0, 0}, {0x584e, 0x11, 0, 0}, {0x584f, 0x10, 0, 0}, {0x5850, 0x0f, 0, 0}, {0x5851, 0x0c, 0, 0}, {0x5852, 0x0f, 0, 0}, {0x5853, 0x10, 0, 0}, {0x5854, 0x10, 0, 0}, {0x5855, 0x0f, 0, 0}, {0x5856, 0x0e, 0, 0}, {0x5857, 0x0b, 0, 0}, {0x5858, 0x10, 0, 0}, {0x5859, 0x0d, 0, 0}, {0x585a, 0x0d, 0, 0}, {0x585b, 0x0c, 0, 0}, {0x585c, 0x0c, 0, 0}, {0x585d, 0x0c, 0, 0}, {0x585e, 0x0b, 0, 0}, {0x585f, 0x0c, 0, 0}, {0x5860, 0x0c, 0, 0}, {0x5861, 0x0c, 0, 0}, {0x5862, 0x0d, 0, 0}, {0x5863, 0x08, 0, 0}, {0x5864, 0x11, 0, 0}, {0x5865, 0x18, 0, 0}, {0x5866, 0x18, 0, 0}, {0x5867, 0x19, 0, 0}, {0x5868, 0x17, 0, 0}, {0x5869, 0x19, 0, 0}, {0x586a, 0x16, 0, 0}, {0x586b, 0x13, 0, 0}, {0x586c, 0x13, 0, 0}, {0x586d, 0x12, 0, 0}, {0x586e, 0x13, 0, 0}, {0x586f, 0x16, 0, 0}, {0x5870, 0x14, 0, 0}, {0x5871, 0x12, 0, 0}, {0x5872, 0x10, 0, 0}, {0x5873, 0x11, 0, 0}, {0x5874, 0x11, 0, 0}, {0x5875, 0x16, 0, 0}, {0x5876, 0x14, 0, 0}, {0x5877, 0x11, 0, 0}, {0x5878, 0x10, 0, 0}, {0x5879, 0x0f, 0, 0}, {0x587a, 0x10, 0, 0}, {0x587b, 0x14, 0, 0}, {0x587c, 0x13, 0, 0}, {0x587d, 0x12, 0, 0}, {0x587e, 0x11, 0, 0}, {0x587f, 0x11, 0, 0}, {0x5880, 0x12, 0, 0}, {0x5881, 0x15, 0, 0}, {0x5882, 0x14, 0, 0}, {0x5883, 0x15, 0, 0}, {0x5884, 0x15, 0, 0}, {0x5885, 0x15, 0, 0}, {0x5886, 0x13, 0, 0}, {0x5887, 0x17, 0, 0}, {0x3710, 0x10, 0, 0}, {0x3632, 0x51, 0, 0}, {0x3702, 0x10, 0, 0}, {0x3703, 0xb2, 0, 0}, {0x3704, 0x18, 0, 0}, {0x370b, 0x40, 0, 0}, {0x370d, 0x03, 0, 0}, {0x3631, 0x01, 0, 0}, {0x3632, 0x52, 0, 0}, {0x3606, 0x24, 0, 0}, {0x3620, 0x96, 0, 0}, {0x5785, 0x07, 0, 0}, {0x3a13, 0x30, 0, 0}, {0x3600, 0x52, 0, 0}, {0x3604, 0x48, 0, 0}, {0x3606, 0x1b, 0, 0}, {0x370d, 0x0b, 0, 0}, {0x370f, 0xc0, 0, 0}, {0x3709, 0x01, 0, 0}, {0x3823, 0x00, 0, 0}, {0x5007, 0x00, 0, 0}, {0x5009, 0x00, 0, 0}, {0x5011, 0x00, 0, 0}, {0x5013, 0x00, 0, 0}, {0x519e, 0x00, 0, 0}, {0x5086, 0x00, 0, 0}, {0x5087, 0x00, 0, 0}, {0x5088, 0x00, 0, 0}, {0x5089, 0x00, 0, 0}, {0x302b, 0x00, 0, 0}, {0x3621, 0x87, 0, 0}, {0x3808, 0x01, 0, 0}, {0x3809, 0x40, 0, 0}, {0x380a, 0x00, 0, 0}, {0x380b, 0xf0, 0, 0}, }; static struct reg_value ov5642_setting_30fps_NTSC_720_480[] = { {0x3103, 0x93, 0, 0}, {0x3008, 0x82, 0, 0}, {0x3017, 0x7f, 0, 0}, {0x3018, 0xfc, 0, 0}, {0x3615, 0xf0, 0, 0}, {0x3000, 0x00, 0, 0}, {0x3001, 0x00, 0, 0}, {0x3002, 0x5c, 0, 0}, {0x3003, 0x00, 0, 0}, {0x3004, 0xff, 0, 0}, {0x3005, 0xff, 0, 0}, {0x3006, 0x43, 0, 0}, {0x3007, 0x37, 0, 0}, {0x3011, 0x09, 0, 0}, {0x3012, 0x02, 0, 0}, {0x3010, 0x00, 0, 0}, {0x460c, 0x20, 0, 0}, {0x3815, 0x04, 0, 0}, {0x370c, 0xa0, 0, 0}, {0x3602, 0xfc, 0, 0}, {0x3612, 0xff, 0, 0}, {0x3634, 0xc0, 0, 0}, {0x3613, 0x00, 0, 0}, {0x3605, 0x7c, 0, 0}, {0x3621, 0x09, 0, 0}, {0x3622, 0x60, 0, 0}, {0x3604, 0x40, 0, 0}, {0x3603, 0xa7, 0, 0}, {0x3603, 0x27, 0, 0}, {0x4000, 0x21, 0, 0}, {0x401d, 0x22, 0, 0}, {0x3600, 0x54, 0, 0}, {0x3605, 0x04, 0, 0}, {0x3606, 0x3f, 0, 0}, {0x3c01, 0x80, 0, 0}, {0x5000, 0x4f, 0, 0}, {0x5020, 0x04, 0, 0}, {0x5181, 0x79, 0, 0}, {0x5182, 0x00, 0, 0}, {0x5185, 0x22, 0, 0}, {0x5197, 0x01, 0, 0}, {0x5001, 0xff, 0, 0}, {0x5500, 0x0a, 0, 0}, {0x5504, 0x00, 0, 0}, {0x5505, 0x7f, 0, 0}, {0x5080, 0x08, 0, 0}, {0x300e, 0x18, 0, 0}, {0x4610, 0x00, 0, 0}, {0x471d, 0x05, 0, 0}, {0x4708, 0x06, 0, 0}, {0x3808, 0x02, 0, 0}, {0x3809, 0xd0, 0, 0}, {0x380a, 0x01, 0, 0}, {0x380b, 0xe0, 0, 0}, {0x380e, 0x07, 0, 0}, {0x380f, 0xd0, 0, 0}, {0x501f, 0x00, 0, 0}, {0x5000, 0x4f, 0, 0}, {0x4300, 0x30, 0, 0}, {0x3503, 0x07, 0, 0}, {0x3501, 0x73, 0, 0}, {0x3502, 0x80, 0, 0}, {0x350b, 0x00, 0, 0}, {0x3503, 0x07, 0, 0}, {0x3824, 0x11, 0, 0}, {0x3825, 0xb0, 0, 0}, {0x3501, 0x1e, 0, 0}, {0x3502, 0x80, 0, 0}, {0x350b, 0x7f, 0, 0}, {0x380c, 0x07, 0, 0}, {0x380d, 0x2a, 0, 0}, {0x380e, 0x03, 0, 0}, {0x380f, 0xe8, 0, 0}, {0x3a0d, 0x04, 0, 0}, {0x3a0e, 0x03, 0, 0}, {0x3818, 0xc1, 0, 0}, {0x3705, 0xdb, 0, 0}, {0x370a, 0x81, 0, 0}, {0x3801, 0x80, 0, 0}, {0x3621, 0xc7, 0, 0}, {0x3801, 0x50, 0, 0}, {0x3803, 0x08, 0, 0}, {0x3827, 0x3c, 0, 0}, {0x3810, 0x80, 0, 0}, {0x3804, 0x05, 0, 0}, {0x3805, 0x00, 0, 0}, {0x5682, 0x05, 0, 0}, {0x5683, 0x00, 0, 0}, {0x3806, 0x03, 0, 0}, {0x3807, 0x58, 0, 0}, {0x5686, 0x03, 0, 0}, {0x5687, 0x58, 0, 0}, {0x3a00, 0x78, 0, 0}, {0x3a1a, 0x05, 0, 0}, {0x3a13, 0x30, 0, 0}, {0x3a18, 0x00, 0, 0}, {0x3a19, 0x7c, 0, 0}, {0x3a08, 0x12, 0, 0}, {0x3a09, 0xc0, 0, 0}, {0x3a0a, 0x0f, 0, 0}, {0x3a0b, 0xa0, 0, 0}, {0x350c, 0x07, 0, 0}, {0x350d, 0xd0, 0, 0}, {0x3500, 0x00, 0, 0}, {0x3501, 0x00, 0, 0}, {0x3502, 0x00, 0, 0}, {0x350a, 0x00, 0, 0}, {0x350b, 0x00, 0, 0}, {0x3503, 0x00, 0, 0}, {0x528a, 0x02, 0, 0}, {0x528b, 0x04, 0, 0}, {0x528c, 0x08, 0, 0}, {0x528d, 0x08, 0, 0}, {0x528e, 0x08, 0, 0}, {0x528f, 0x10, 0, 0}, {0x5290, 0x10, 0, 0}, {0x5292, 0x00, 0, 0}, {0x5293, 0x02, 0, 0}, {0x5294, 0x00, 0, 0}, {0x5295, 0x02, 0, 0}, {0x5296, 0x00, 0, 0}, {0x5297, 0x02, 0, 0}, {0x5298, 0x00, 0, 0}, {0x5299, 0x02, 0, 0}, {0x529a, 0x00, 0, 0}, {0x529b, 0x02, 0, 0}, {0x529c, 0x00, 0, 0}, {0x529d, 0x02, 0, 0}, {0x529e, 0x00, 0, 0}, {0x529f, 0x02, 0, 0}, {0x3a0f, 0x3c, 0, 0}, {0x3a10, 0x30, 0, 0}, {0x3a1b, 0x3c, 0, 0}, {0x3a1e, 0x30, 0, 0}, {0x3a11, 0x70, 0, 0}, {0x3a1f, 0x10, 0, 0}, {0x3030, 0x2b, 0, 0}, {0x3a02, 0x00, 0, 0}, {0x3a03, 0x7d, 0, 0}, {0x3a04, 0x00, 0, 0}, {0x3a14, 0x00, 0, 0}, {0x3a15, 0x7d, 0, 0}, {0x3a16, 0x00, 0, 0}, {0x3a00, 0x78, 0, 0}, {0x3a08, 0x12, 0, 0}, {0x3a09, 0xc0, 0, 0}, {0x3a0a, 0x0f, 0, 0}, {0x3a0b, 0xa0, 0, 0}, {0x3a0d, 0x04, 0, 0}, {0x3a0e, 0x03, 0, 0}, {0x5193, 0x70, 0, 0}, {0x589b, 0x04, 0, 0}, {0x589a, 0xc5, 0, 0}, {0x401e, 0x20, 0, 0}, {0x4001, 0x42, 0, 0}, {0x401c, 0x04, 0, 0}, {0x528a, 0x01, 0, 0}, {0x528b, 0x04, 0, 0}, {0x528c, 0x08, 0, 0}, {0x528d, 0x10, 0, 0}, {0x528e, 0x20, 0, 0}, {0x528f, 0x28, 0, 0}, {0x5290, 0x30, 0, 0}, {0x5292, 0x00, 0, 0}, {0x5293, 0x01, 0, 0}, {0x5294, 0x00, 0, 0}, {0x5295, 0x04, 0, 0}, {0x5296, 0x00, 0, 0}, {0x5297, 0x08, 0, 0}, {0x5298, 0x00, 0, 0}, {0x5299, 0x10, 0, 0}, {0x529a, 0x00, 0, 0}, {0x529b, 0x20, 0, 0}, {0x529c, 0x00, 0, 0}, {0x529d, 0x28, 0, 0}, {0x529e, 0x00, 0, 0}, {0x529f, 0x30, 0, 0}, {0x5282, 0x00, 0, 0}, {0x5300, 0x00, 0, 0}, {0x5301, 0x20, 0, 0}, {0x5302, 0x00, 0, 0}, {0x5303, 0x7c, 0, 0}, {0x530c, 0x00, 0, 0}, {0x530d, 0x0c, 0, 0}, {0x530e, 0x20, 0, 0}, {0x530f, 0x80, 0, 0}, {0x5310, 0x20, 0, 0}, {0x5311, 0x80, 0, 0}, {0x5308, 0x20, 0, 0}, {0x5309, 0x40, 0, 0}, {0x5304, 0x00, 0, 0}, {0x5305, 0x30, 0, 0}, {0x5306, 0x00, 0, 0}, {0x5307, 0x80, 0, 0}, {0x5314, 0x08, 0, 0}, {0x5315, 0x20, 0, 0}, {0x5319, 0x30, 0, 0}, {0x5316, 0x10, 0, 0}, {0x5317, 0x00, 0, 0}, {0x5318, 0x02, 0, 0}, {0x5380, 0x01, 0, 0}, {0x5381, 0x00, 0, 0}, {0x5382, 0x00, 0, 0}, {0x5383, 0x4e, 0, 0}, {0x5384, 0x00, 0, 0}, {0x5385, 0x0f, 0, 0}, {0x5386, 0x00, 0, 0}, {0x5387, 0x00, 0, 0}, {0x5388, 0x01, 0, 0}, {0x5389, 0x15, 0, 0}, {0x538a, 0x00, 0, 0}, {0x538b, 0x31, 0, 0}, {0x538c, 0x00, 0, 0}, {0x538d, 0x00, 0, 0}, {0x538e, 0x00, 0, 0}, {0x538f, 0x0f, 0, 0}, {0x5390, 0x00, 0, 0}, {0x5391, 0xab, 0, 0}, {0x5392, 0x00, 0, 0}, {0x5393, 0xa2, 0, 0}, {0x5394, 0x08, 0, 0}, {0x5480, 0x14, 0, 0}, {0x5481, 0x21, 0, 0}, {0x5482, 0x36, 0, 0}, {0x5483, 0x57, 0, 0}, {0x5484, 0x65, 0, 0}, {0x5485, 0x71, 0, 0}, {0x5486, 0x7d, 0, 0}, {0x5487, 0x87, 0, 0}, {0x5488, 0x91, 0, 0}, {0x5489, 0x9a, 0, 0}, {0x548a, 0xaa, 0, 0}, {0x548b, 0xb8, 0, 0}, {0x548c, 0xcd, 0, 0}, {0x548d, 0xdd, 0, 0}, {0x548e, 0xea, 0, 0}, {0x548f, 0x1d, 0, 0}, {0x5490, 0x05, 0, 0}, {0x5491, 0x00, 0, 0}, {0x5492, 0x04, 0, 0}, {0x5493, 0x20, 0, 0}, {0x5494, 0x03, 0, 0}, {0x5495, 0x60, 0, 0}, {0x5496, 0x02, 0, 0}, {0x5497, 0xb8, 0, 0}, {0x5498, 0x02, 0, 0}, {0x5499, 0x86, 0, 0}, {0x549a, 0x02, 0, 0}, {0x549b, 0x5b, 0, 0}, {0x549c, 0x02, 0, 0}, {0x549d, 0x3b, 0, 0}, {0x549e, 0x02, 0, 0}, {0x549f, 0x1c, 0, 0}, {0x54a0, 0x02, 0, 0}, {0x54a1, 0x04, 0, 0}, {0x54a2, 0x01, 0, 0}, {0x54a3, 0xed, 0, 0}, {0x54a4, 0x01, 0, 0}, {0x54a5, 0xc5, 0, 0}, {0x54a6, 0x01, 0, 0}, {0x54a7, 0xa5, 0, 0}, {0x54a8, 0x01, 0, 0}, {0x54a9, 0x6c, 0, 0}, {0x54aa, 0x01, 0, 0}, {0x54ab, 0x41, 0, 0}, {0x54ac, 0x01, 0, 0}, {0x54ad, 0x20, 0, 0}, {0x54ae, 0x00, 0, 0}, {0x54af, 0x16, 0, 0}, {0x54b0, 0x01, 0, 0}, {0x54b1, 0x20, 0, 0}, {0x54b2, 0x00, 0, 0}, {0x54b3, 0x10, 0, 0}, {0x54b4, 0x00, 0, 0}, {0x54b5, 0xf0, 0, 0}, {0x54b6, 0x00, 0, 0}, {0x54b7, 0xdf, 0, 0}, {0x5402, 0x3f, 0, 0}, {0x5403, 0x00, 0, 0}, {0x3406, 0x00, 0, 0}, {0x5180, 0xff, 0, 0}, {0x5181, 0x52, 0, 0}, {0x5182, 0x11, 0, 0}, {0x5183, 0x14, 0, 0}, {0x5184, 0x25, 0, 0}, {0x5185, 0x24, 0, 0}, {0x5186, 0x06, 0, 0}, {0x5187, 0x08, 0, 0}, {0x5188, 0x08, 0, 0}, {0x5189, 0x7c, 0, 0}, {0x518a, 0x60, 0, 0}, {0x518b, 0xb2, 0, 0}, {0x518c, 0xb2, 0, 0}, {0x518d, 0x44, 0, 0}, {0x518e, 0x3d, 0, 0}, {0x518f, 0x58, 0, 0}, {0x5190, 0x46, 0, 0}, {0x5191, 0xf8, 0, 0}, {0x5192, 0x04, 0, 0}, {0x5193, 0x70, 0, 0}, {0x5194, 0xf0, 0, 0}, {0x5195, 0xf0, 0, 0}, {0x5196, 0x03, 0, 0}, {0x5197, 0x01, 0, 0}, {0x5198, 0x04, 0, 0}, {0x5199, 0x12, 0, 0}, {0x519a, 0x04, 0, 0}, {0x519b, 0x00, 0, 0}, {0x519c, 0x06, 0, 0}, {0x519d, 0x82, 0, 0}, {0x519e, 0x00, 0, 0}, {0x5025, 0x80, 0, 0}, {0x3a0f, 0x38, 0, 0}, {0x3a10, 0x30, 0, 0}, {0x3a1b, 0x3a, 0, 0}, {0x3a1e, 0x2e, 0, 0}, {0x3a11, 0x60, 0, 0}, {0x3a1f, 0x10, 0, 0}, {0x5688, 0xa6, 0, 0}, {0x5689, 0x6a, 0, 0}, {0x568a, 0xea, 0, 0}, {0x568b, 0xae, 0, 0}, {0x568c, 0xa6, 0, 0}, {0x568d, 0x6a, 0, 0}, {0x568e, 0x62, 0, 0}, {0x568f, 0x26, 0, 0}, {0x5583, 0x40, 0, 0}, {0x5584, 0x40, 0, 0}, {0x5580, 0x02, 0, 0}, {0x5000, 0xcf, 0, 0}, {0x5800, 0x27, 0, 0}, {0x5801, 0x19, 0, 0}, {0x5802, 0x12, 0, 0}, {0x5803, 0x0f, 0, 0}, {0x5804, 0x10, 0, 0}, {0x5805, 0x15, 0, 0}, {0x5806, 0x1e, 0, 0}, {0x5807, 0x2f, 0, 0}, {0x5808, 0x15, 0, 0}, {0x5809, 0x0d, 0, 0}, {0x580a, 0x0a, 0, 0}, {0x580b, 0x09, 0, 0}, {0x580c, 0x0a, 0, 0}, {0x580d, 0x0c, 0, 0}, {0x580e, 0x12, 0, 0}, {0x580f, 0x19, 0, 0}, {0x5810, 0x0b, 0, 0}, {0x5811, 0x07, 0, 0}, {0x5812, 0x04, 0, 0}, {0x5813, 0x03, 0, 0}, {0x5814, 0x03, 0, 0}, {0x5815, 0x06, 0, 0}, {0x5816, 0x0a, 0, 0}, {0x5817, 0x0f, 0, 0}, {0x5818, 0x0a, 0, 0}, {0x5819, 0x05, 0, 0}, {0x581a, 0x01, 0, 0}, {0x581b, 0x00, 0, 0}, {0x581c, 0x00, 0, 0}, {0x581d, 0x03, 0, 0}, {0x581e, 0x08, 0, 0}, {0x581f, 0x0c, 0, 0}, {0x5820, 0x0a, 0, 0}, {0x5821, 0x05, 0, 0}, {0x5822, 0x01, 0, 0}, {0x5823, 0x00, 0, 0}, {0x5824, 0x00, 0, 0}, {0x5825, 0x03, 0, 0}, {0x5826, 0x08, 0, 0}, {0x5827, 0x0c, 0, 0}, {0x5828, 0x0e, 0, 0}, {0x5829, 0x08, 0, 0}, {0x582a, 0x06, 0, 0}, {0x582b, 0x04, 0, 0}, {0x582c, 0x05, 0, 0}, {0x582d, 0x07, 0, 0}, {0x582e, 0x0b, 0, 0}, {0x582f, 0x12, 0, 0}, {0x5830, 0x18, 0, 0}, {0x5831, 0x10, 0, 0}, {0x5832, 0x0c, 0, 0}, {0x5833, 0x0a, 0, 0}, {0x5834, 0x0b, 0, 0}, {0x5835, 0x0e, 0, 0}, {0x5836, 0x15, 0, 0}, {0x5837, 0x19, 0, 0}, {0x5838, 0x32, 0, 0}, {0x5839, 0x1f, 0, 0}, {0x583a, 0x18, 0, 0}, {0x583b, 0x16, 0, 0}, {0x583c, 0x17, 0, 0}, {0x583d, 0x1e, 0, 0}, {0x583e, 0x26, 0, 0}, {0x583f, 0x53, 0, 0}, {0x5840, 0x10, 0, 0}, {0x5841, 0x0f, 0, 0}, {0x5842, 0x0d, 0, 0}, {0x5843, 0x0c, 0, 0}, {0x5844, 0x0e, 0, 0}, {0x5845, 0x09, 0, 0}, {0x5846, 0x11, 0, 0}, {0x5847, 0x10, 0, 0}, {0x5848, 0x10, 0, 0}, {0x5849, 0x10, 0, 0}, {0x584a, 0x10, 0, 0}, {0x584b, 0x0e, 0, 0}, {0x584c, 0x10, 0, 0}, {0x584d, 0x10, 0, 0}, {0x584e, 0x11, 0, 0}, {0x584f, 0x10, 0, 0}, {0x5850, 0x0f, 0, 0}, {0x5851, 0x0c, 0, 0}, {0x5852, 0x0f, 0, 0}, {0x5853, 0x10, 0, 0}, {0x5854, 0x10, 0, 0}, {0x5855, 0x0f, 0, 0}, {0x5856, 0x0e, 0, 0}, {0x5857, 0x0b, 0, 0}, {0x5858, 0x10, 0, 0}, {0x5859, 0x0d, 0, 0}, {0x585a, 0x0d, 0, 0}, {0x585b, 0x0c, 0, 0}, {0x585c, 0x0c, 0, 0}, {0x585d, 0x0c, 0, 0}, {0x585e, 0x0b, 0, 0}, {0x585f, 0x0c, 0, 0}, {0x5860, 0x0c, 0, 0}, {0x5861, 0x0c, 0, 0}, {0x5862, 0x0d, 0, 0}, {0x5863, 0x08, 0, 0}, {0x5864, 0x11, 0, 0}, {0x5865, 0x18, 0, 0}, {0x5866, 0x18, 0, 0}, {0x5867, 0x19, 0, 0}, {0x5868, 0x17, 0, 0}, {0x5869, 0x19, 0, 0}, {0x586a, 0x16, 0, 0}, {0x586b, 0x13, 0, 0}, {0x586c, 0x13, 0, 0}, {0x586d, 0x12, 0, 0}, {0x586e, 0x13, 0, 0}, {0x586f, 0x16, 0, 0}, {0x5870, 0x14, 0, 0}, {0x5871, 0x12, 0, 0}, {0x5872, 0x10, 0, 0}, {0x5873, 0x11, 0, 0}, {0x5874, 0x11, 0, 0}, {0x5875, 0x16, 0, 0}, {0x5876, 0x14, 0, 0}, {0x5877, 0x11, 0, 0}, {0x5878, 0x10, 0, 0}, {0x5879, 0x0f, 0, 0}, {0x587a, 0x10, 0, 0}, {0x587b, 0x14, 0, 0}, {0x587c, 0x13, 0, 0}, {0x587d, 0x12, 0, 0}, {0x587e, 0x11, 0, 0}, {0x587f, 0x11, 0, 0}, {0x5880, 0x12, 0, 0}, {0x5881, 0x15, 0, 0}, {0x5882, 0x14, 0, 0}, {0x5883, 0x15, 0, 0}, {0x5884, 0x15, 0, 0}, {0x5885, 0x15, 0, 0}, {0x5886, 0x13, 0, 0}, {0x5887, 0x17, 0, 0}, {0x3710, 0x10, 0, 0}, {0x3632, 0x51, 0, 0}, {0x3702, 0x10, 0, 0}, {0x3703, 0xb2, 0, 0}, {0x3704, 0x18, 0, 0}, {0x370b, 0x40, 0, 0}, {0x370d, 0x03, 0, 0}, {0x3631, 0x01, 0, 0}, {0x3632, 0x52, 0, 0}, {0x3606, 0x24, 0, 0}, {0x3620, 0x96, 0, 0}, {0x5785, 0x07, 0, 0}, {0x3a13, 0x30, 0, 0}, {0x3600, 0x52, 0, 0}, {0x3604, 0x48, 0, 0}, {0x3606, 0x1b, 0, 0}, {0x370d, 0x0b, 0, 0}, {0x370f, 0xc0, 0, 0}, {0x3709, 0x01, 0, 0}, {0x3823, 0x00, 0, 0}, {0x5007, 0x00, 0, 0}, {0x5009, 0x00, 0, 0}, {0x5011, 0x00, 0, 0}, {0x5013, 0x00, 0, 0}, {0x519e, 0x00, 0, 0}, {0x5086, 0x00, 0, 0}, {0x5087, 0x00, 0, 0}, {0x5088, 0x00, 0, 0}, {0x5089, 0x00, 0, 0}, {0x302b, 0x00, 0, 0}, {0x3621, 0x87, 0, 0}, {0x3a00, 0x78, 0, 0}, {0x302c, 0x60, 0x60, 0}, }; static struct reg_value ov5642_setting_30fps_PAL_720_576[] = { {0x3103, 0x93, 0, 0}, {0x3008, 0x82, 0, 0}, {0x3017, 0x7f, 0, 0}, {0x3018, 0xfc, 0, 0}, {0x3615, 0xf0, 0, 0}, {0x3000, 0x00, 0, 0}, {0x3001, 0x00, 0, 0}, {0x3002, 0x5c, 0, 0}, {0x3003, 0x00, 0, 0}, {0x3004, 0xff, 0, 0}, {0x3005, 0xff, 0, 0}, {0x3006, 0x43, 0, 0}, {0x3007, 0x37, 0, 0}, {0x3011, 0x09, 0, 0}, {0x3012, 0x02, 0, 0}, {0x3010, 0x00, 0, 0}, {0x460c, 0x20, 0, 0}, {0x3815, 0x04, 0, 0}, {0x370c, 0xa0, 0, 0}, {0x3602, 0xfc, 0, 0}, {0x3612, 0xff, 0, 0}, {0x3634, 0xc0, 0, 0}, {0x3613, 0x00, 0, 0}, {0x3605, 0x7c, 0, 0}, {0x3621, 0x09, 0, 0}, {0x3622, 0x60, 0, 0}, {0x3604, 0x40, 0, 0}, {0x3603, 0xa7, 0, 0}, {0x3603, 0x27, 0, 0}, {0x4000, 0x21, 0, 0}, {0x401d, 0x22, 0, 0}, {0x3600, 0x54, 0, 0}, {0x3605, 0x04, 0, 0}, {0x3606, 0x3f, 0, 0}, {0x3c01, 0x80, 0, 0}, {0x5000, 0x4f, 0, 0}, {0x5020, 0x04, 0, 0}, {0x5181, 0x79, 0, 0}, {0x5182, 0x00, 0, 0}, {0x5185, 0x22, 0, 0}, {0x5197, 0x01, 0, 0}, {0x5001, 0xff, 0, 0}, {0x5500, 0x0a, 0, 0}, {0x5504, 0x00, 0, 0}, {0x5505, 0x7f, 0, 0}, {0x5080, 0x08, 0, 0}, {0x300e, 0x18, 0, 0}, {0x4610, 0x00, 0, 0}, {0x471d, 0x05, 0, 0}, {0x4708, 0x06, 0, 0}, {0x3808, 0x02, 0, 0}, {0x3809, 0xd0, 0, 0}, {0x380a, 0x02, 0, 0}, {0x380b, 0x40, 0, 0}, {0x380e, 0x07, 0, 0}, {0x380f, 0xd0, 0, 0}, {0x501f, 0x00, 0, 0}, {0x5000, 0x4f, 0, 0}, {0x4300, 0x30, 0, 0}, {0x3503, 0x07, 0, 0}, {0x3501, 0x73, 0, 0}, {0x3502, 0x80, 0, 0}, {0x350b, 0x00, 0, 0}, {0x3503, 0x07, 0, 0}, {0x3824, 0x11, 0, 0}, {0x3825, 0xd8, 0, 0}, {0x3501, 0x1e, 0, 0}, {0x3502, 0x80, 0, 0}, {0x350b, 0x7f, 0, 0}, {0x380c, 0x07, 0, 0}, {0x380d, 0x2a, 0, 0}, {0x380e, 0x03, 0, 0}, {0x380f, 0xe8, 0, 0}, {0x3a0d, 0x04, 0, 0}, {0x3a0e, 0x03, 0, 0}, {0x3818, 0xc1, 0, 0}, {0x3705, 0xdb, 0, 0}, {0x370a, 0x81, 0, 0}, {0x3801, 0x80, 0, 0}, {0x3621, 0xc7, 0, 0}, {0x3801, 0x50, 0, 0}, {0x3803, 0x08, 0, 0}, {0x3827, 0x3c, 0, 0}, {0x3810, 0x80, 0, 0}, {0x3804, 0x04, 0, 0}, {0x3805, 0xb0, 0, 0}, {0x5682, 0x04, 0, 0}, {0x5683, 0xb0, 0, 0}, {0x3806, 0x03, 0, 0}, {0x3807, 0x58, 0, 0}, {0x5686, 0x03, 0, 0}, {0x5687, 0x58, 0, 0}, {0x3a00, 0x78, 0, 0}, {0x3a1a, 0x05, 0, 0}, {0x3a13, 0x30, 0, 0}, {0x3a18, 0x00, 0, 0}, {0x3a19, 0x7c, 0, 0}, {0x3a08, 0x12, 0, 0}, {0x3a09, 0xc0, 0, 0}, {0x3a0a, 0x0f, 0, 0}, {0x3a0b, 0xa0, 0, 0}, {0x350c, 0x07, 0, 0}, {0x350d, 0xd0, 0, 0}, {0x3500, 0x00, 0, 0}, {0x3501, 0x00, 0, 0}, {0x3502, 0x00, 0, 0}, {0x350a, 0x00, 0, 0}, {0x350b, 0x00, 0, 0}, {0x3503, 0x00, 0, 0}, {0x528a, 0x02, 0, 0}, {0x528b, 0x04, 0, 0}, {0x528c, 0x08, 0, 0}, {0x528d, 0x08, 0, 0}, {0x528e, 0x08, 0, 0}, {0x528f, 0x10, 0, 0}, {0x5290, 0x10, 0, 0}, {0x5292, 0x00, 0, 0}, {0x5293, 0x02, 0, 0}, {0x5294, 0x00, 0, 0}, {0x5295, 0x02, 0, 0}, {0x5296, 0x00, 0, 0}, {0x5297, 0x02, 0, 0}, {0x5298, 0x00, 0, 0}, {0x5299, 0x02, 0, 0}, {0x529a, 0x00, 0, 0}, {0x529b, 0x02, 0, 0}, {0x529c, 0x00, 0, 0}, {0x529d, 0x02, 0, 0}, {0x529e, 0x00, 0, 0}, {0x529f, 0x02, 0, 0}, {0x3a0f, 0x3c, 0, 0}, {0x3a10, 0x30, 0, 0}, {0x3a1b, 0x3c, 0, 0}, {0x3a1e, 0x30, 0, 0}, {0x3a11, 0x70, 0, 0}, {0x3a1f, 0x10, 0, 0}, {0x3030, 0x2b, 0, 0}, {0x3a02, 0x00, 0, 0}, {0x3a03, 0x7d, 0, 0}, {0x3a04, 0x00, 0, 0}, {0x3a14, 0x00, 0, 0}, {0x3a15, 0x7d, 0, 0}, {0x3a16, 0x00, 0, 0}, {0x3a00, 0x78, 0, 0}, {0x3a08, 0x12, 0, 0}, {0x3a09, 0xc0, 0, 0}, {0x3a0a, 0x0f, 0, 0}, {0x3a0b, 0xa0, 0, 0}, {0x3a0d, 0x04, 0, 0}, {0x3a0e, 0x03, 0, 0}, {0x5193, 0x70, 0, 0}, {0x589b, 0x04, 0, 0}, {0x589a, 0xc5, 0, 0}, {0x401e, 0x20, 0, 0}, {0x4001, 0x42, 0, 0}, {0x401c, 0x04, 0, 0}, {0x528a, 0x01, 0, 0}, {0x528b, 0x04, 0, 0}, {0x528c, 0x08, 0, 0}, {0x528d, 0x10, 0, 0}, {0x528e, 0x20, 0, 0}, {0x528f, 0x28, 0, 0}, {0x5290, 0x30, 0, 0}, {0x5292, 0x00, 0, 0}, {0x5293, 0x01, 0, 0}, {0x5294, 0x00, 0, 0}, {0x5295, 0x04, 0, 0}, {0x5296, 0x00, 0, 0}, {0x5297, 0x08, 0, 0}, {0x5298, 0x00, 0, 0}, {0x5299, 0x10, 0, 0}, {0x529a, 0x00, 0, 0}, {0x529b, 0x20, 0, 0}, {0x529c, 0x00, 0, 0}, {0x529d, 0x28, 0, 0}, {0x529e, 0x00, 0, 0}, {0x529f, 0x30, 0, 0}, {0x5282, 0x00, 0, 0}, {0x5300, 0x00, 0, 0}, {0x5301, 0x20, 0, 0}, {0x5302, 0x00, 0, 0}, {0x5303, 0x7c, 0, 0}, {0x530c, 0x00, 0, 0}, {0x530d, 0x0c, 0, 0}, {0x530e, 0x20, 0, 0}, {0x530f, 0x80, 0, 0}, {0x5310, 0x20, 0, 0}, {0x5311, 0x80, 0, 0}, {0x5308, 0x20, 0, 0}, {0x5309, 0x40, 0, 0}, {0x5304, 0x00, 0, 0}, {0x5305, 0x30, 0, 0}, {0x5306, 0x00, 0, 0}, {0x5307, 0x80, 0, 0}, {0x5314, 0x08, 0, 0}, {0x5315, 0x20, 0, 0}, {0x5319, 0x30, 0, 0}, {0x5316, 0x10, 0, 0}, {0x5317, 0x00, 0, 0}, {0x5318, 0x02, 0, 0}, {0x5380, 0x01, 0, 0}, {0x5381, 0x00, 0, 0}, {0x5382, 0x00, 0, 0}, {0x5383, 0x4e, 0, 0}, {0x5384, 0x00, 0, 0}, {0x5385, 0x0f, 0, 0}, {0x5386, 0x00, 0, 0}, {0x5387, 0x00, 0, 0}, {0x5388, 0x01, 0, 0}, {0x5389, 0x15, 0, 0}, {0x538a, 0x00, 0, 0}, {0x538b, 0x31, 0, 0}, {0x538c, 0x00, 0, 0}, {0x538d, 0x00, 0, 0}, {0x538e, 0x00, 0, 0}, {0x538f, 0x0f, 0, 0}, {0x5390, 0x00, 0, 0}, {0x5391, 0xab, 0, 0}, {0x5392, 0x00, 0, 0}, {0x5393, 0xa2, 0, 0}, {0x5394, 0x08, 0, 0}, {0x5480, 0x14, 0, 0}, {0x5481, 0x21, 0, 0}, {0x5482, 0x36, 0, 0}, {0x5483, 0x57, 0, 0}, {0x5484, 0x65, 0, 0}, {0x5485, 0x71, 0, 0}, {0x5486, 0x7d, 0, 0}, {0x5487, 0x87, 0, 0}, {0x5488, 0x91, 0, 0}, {0x5489, 0x9a, 0, 0}, {0x548a, 0xaa, 0, 0}, {0x548b, 0xb8, 0, 0}, {0x548c, 0xcd, 0, 0}, {0x548d, 0xdd, 0, 0}, {0x548e, 0xea, 0, 0}, {0x548f, 0x1d, 0, 0}, {0x5490, 0x05, 0, 0}, {0x5491, 0x00, 0, 0}, {0x5492, 0x04, 0, 0}, {0x5493, 0x20, 0, 0}, {0x5494, 0x03, 0, 0}, {0x5495, 0x60, 0, 0}, {0x5496, 0x02, 0, 0}, {0x5497, 0xb8, 0, 0}, {0x5498, 0x02, 0, 0}, {0x5499, 0x86, 0, 0}, {0x549a, 0x02, 0, 0}, {0x549b, 0x5b, 0, 0}, {0x549c, 0x02, 0, 0}, {0x549d, 0x3b, 0, 0}, {0x549e, 0x02, 0, 0}, {0x549f, 0x1c, 0, 0}, {0x54a0, 0x02, 0, 0}, {0x54a1, 0x04, 0, 0}, {0x54a2, 0x01, 0, 0}, {0x54a3, 0xed, 0, 0}, {0x54a4, 0x01, 0, 0}, {0x54a5, 0xc5, 0, 0}, {0x54a6, 0x01, 0, 0}, {0x54a7, 0xa5, 0, 0}, {0x54a8, 0x01, 0, 0}, {0x54a9, 0x6c, 0, 0}, {0x54aa, 0x01, 0, 0}, {0x54ab, 0x41, 0, 0}, {0x54ac, 0x01, 0, 0}, {0x54ad, 0x20, 0, 0}, {0x54ae, 0x00, 0, 0}, {0x54af, 0x16, 0, 0}, {0x54b0, 0x01, 0, 0}, {0x54b1, 0x20, 0, 0}, {0x54b2, 0x00, 0, 0}, {0x54b3, 0x10, 0, 0}, {0x54b4, 0x00, 0, 0}, {0x54b5, 0xf0, 0, 0}, {0x54b6, 0x00, 0, 0}, {0x54b7, 0xdf, 0, 0}, {0x5402, 0x3f, 0, 0}, {0x5403, 0x00, 0, 0}, {0x3406, 0x00, 0, 0}, {0x5180, 0xff, 0, 0}, {0x5181, 0x52, 0, 0}, {0x5182, 0x11, 0, 0}, {0x5183, 0x14, 0, 0}, {0x5184, 0x25, 0, 0}, {0x5185, 0x24, 0, 0}, {0x5186, 0x06, 0, 0}, {0x5187, 0x08, 0, 0}, {0x5188, 0x08, 0, 0}, {0x5189, 0x7c, 0, 0}, {0x518a, 0x60, 0, 0}, {0x518b, 0xb2, 0, 0}, {0x518c, 0xb2, 0, 0}, {0x518d, 0x44, 0, 0}, {0x518e, 0x3d, 0, 0}, {0x518f, 0x58, 0, 0}, {0x5190, 0x46, 0, 0}, {0x5191, 0xf8, 0, 0}, {0x5192, 0x04, 0, 0}, {0x5193, 0x70, 0, 0}, {0x5194, 0xf0, 0, 0}, {0x5195, 0xf0, 0, 0}, {0x5196, 0x03, 0, 0}, {0x5197, 0x01, 0, 0}, {0x5198, 0x04, 0, 0}, {0x5199, 0x12, 0, 0}, {0x519a, 0x04, 0, 0}, {0x519b, 0x00, 0, 0}, {0x519c, 0x06, 0, 0}, {0x519d, 0x82, 0, 0}, {0x519e, 0x00, 0, 0}, {0x5025, 0x80, 0, 0}, {0x3a0f, 0x38, 0, 0}, {0x3a10, 0x30, 0, 0}, {0x3a1b, 0x3a, 0, 0}, {0x3a1e, 0x2e, 0, 0}, {0x3a11, 0x60, 0, 0}, {0x3a1f, 0x10, 0, 0}, {0x5688, 0xa6, 0, 0}, {0x5689, 0x6a, 0, 0}, {0x568a, 0xea, 0, 0}, {0x568b, 0xae, 0, 0}, {0x568c, 0xa6, 0, 0}, {0x568d, 0x6a, 0, 0}, {0x568e, 0x62, 0, 0}, {0x568f, 0x26, 0, 0}, {0x5583, 0x40, 0, 0}, {0x5584, 0x40, 0, 0}, {0x5580, 0x02, 0, 0}, {0x5000, 0xcf, 0, 0}, {0x5800, 0x27, 0, 0}, {0x5801, 0x19, 0, 0}, {0x5802, 0x12, 0, 0}, {0x5803, 0x0f, 0, 0}, {0x5804, 0x10, 0, 0}, {0x5805, 0x15, 0, 0}, {0x5806, 0x1e, 0, 0}, {0x5807, 0x2f, 0, 0}, {0x5808, 0x15, 0, 0}, {0x5809, 0x0d, 0, 0}, {0x580a, 0x0a, 0, 0}, {0x580b, 0x09, 0, 0}, {0x580c, 0x0a, 0, 0}, {0x580d, 0x0c, 0, 0}, {0x580e, 0x12, 0, 0}, {0x580f, 0x19, 0, 0}, {0x5810, 0x0b, 0, 0}, {0x5811, 0x07, 0, 0}, {0x5812, 0x04, 0, 0}, {0x5813, 0x03, 0, 0}, {0x5814, 0x03, 0, 0}, {0x5815, 0x06, 0, 0}, {0x5816, 0x0a, 0, 0}, {0x5817, 0x0f, 0, 0}, {0x5818, 0x0a, 0, 0}, {0x5819, 0x05, 0, 0}, {0x581a, 0x01, 0, 0}, {0x581b, 0x00, 0, 0}, {0x581c, 0x00, 0, 0}, {0x581d, 0x03, 0, 0}, {0x581e, 0x08, 0, 0}, {0x581f, 0x0c, 0, 0}, {0x5820, 0x0a, 0, 0}, {0x5821, 0x05, 0, 0}, {0x5822, 0x01, 0, 0}, {0x5823, 0x00, 0, 0}, {0x5824, 0x00, 0, 0}, {0x5825, 0x03, 0, 0}, {0x5826, 0x08, 0, 0}, {0x5827, 0x0c, 0, 0}, {0x5828, 0x0e, 0, 0}, {0x5829, 0x08, 0, 0}, {0x582a, 0x06, 0, 0}, {0x582b, 0x04, 0, 0}, {0x582c, 0x05, 0, 0}, {0x582d, 0x07, 0, 0}, {0x582e, 0x0b, 0, 0}, {0x582f, 0x12, 0, 0}, {0x5830, 0x18, 0, 0}, {0x5831, 0x10, 0, 0}, {0x5832, 0x0c, 0, 0}, {0x5833, 0x0a, 0, 0}, {0x5834, 0x0b, 0, 0}, {0x5835, 0x0e, 0, 0}, {0x5836, 0x15, 0, 0}, {0x5837, 0x19, 0, 0}, {0x5838, 0x32, 0, 0}, {0x5839, 0x1f, 0, 0}, {0x583a, 0x18, 0, 0}, {0x583b, 0x16, 0, 0}, {0x583c, 0x17, 0, 0}, {0x583d, 0x1e, 0, 0}, {0x583e, 0x26, 0, 0}, {0x583f, 0x53, 0, 0}, {0x5840, 0x10, 0, 0}, {0x5841, 0x0f, 0, 0}, {0x5842, 0x0d, 0, 0}, {0x5843, 0x0c, 0, 0}, {0x5844, 0x0e, 0, 0}, {0x5845, 0x09, 0, 0}, {0x5846, 0x11, 0, 0}, {0x5847, 0x10, 0, 0}, {0x5848, 0x10, 0, 0}, {0x5849, 0x10, 0, 0}, {0x584a, 0x10, 0, 0}, {0x584b, 0x0e, 0, 0}, {0x584c, 0x10, 0, 0}, {0x584d, 0x10, 0, 0}, {0x584e, 0x11, 0, 0}, {0x584f, 0x10, 0, 0}, {0x5850, 0x0f, 0, 0}, {0x5851, 0x0c, 0, 0}, {0x5852, 0x0f, 0, 0}, {0x5853, 0x10, 0, 0}, {0x5854, 0x10, 0, 0}, {0x5855, 0x0f, 0, 0}, {0x5856, 0x0e, 0, 0}, {0x5857, 0x0b, 0, 0}, {0x5858, 0x10, 0, 0}, {0x5859, 0x0d, 0, 0}, {0x585a, 0x0d, 0, 0}, {0x585b, 0x0c, 0, 0}, {0x585c, 0x0c, 0, 0}, {0x585d, 0x0c, 0, 0}, {0x585e, 0x0b, 0, 0}, {0x585f, 0x0c, 0, 0}, {0x5860, 0x0c, 0, 0}, {0x5861, 0x0c, 0, 0}, {0x5862, 0x0d, 0, 0}, {0x5863, 0x08, 0, 0}, {0x5864, 0x11, 0, 0}, {0x5865, 0x18, 0, 0}, {0x5866, 0x18, 0, 0}, {0x5867, 0x19, 0, 0}, {0x5868, 0x17, 0, 0}, {0x5869, 0x19, 0, 0}, {0x586a, 0x16, 0, 0}, {0x586b, 0x13, 0, 0}, {0x586c, 0x13, 0, 0}, {0x586d, 0x12, 0, 0}, {0x586e, 0x13, 0, 0}, {0x586f, 0x16, 0, 0}, {0x5870, 0x14, 0, 0}, {0x5871, 0x12, 0, 0}, {0x5872, 0x10, 0, 0}, {0x5873, 0x11, 0, 0}, {0x5874, 0x11, 0, 0}, {0x5875, 0x16, 0, 0}, {0x5876, 0x14, 0, 0}, {0x5877, 0x11, 0, 0}, {0x5878, 0x10, 0, 0}, {0x5879, 0x0f, 0, 0}, {0x587a, 0x10, 0, 0}, {0x587b, 0x14, 0, 0}, {0x587c, 0x13, 0, 0}, {0x587d, 0x12, 0, 0}, {0x587e, 0x11, 0, 0}, {0x587f, 0x11, 0, 0}, {0x5880, 0x12, 0, 0}, {0x5881, 0x15, 0, 0}, {0x5882, 0x14, 0, 0}, {0x5883, 0x15, 0, 0}, {0x5884, 0x15, 0, 0}, {0x5885, 0x15, 0, 0}, {0x5886, 0x13, 0, 0}, {0x5887, 0x17, 0, 0}, {0x3710, 0x10, 0, 0}, {0x3632, 0x51, 0, 0}, {0x3702, 0x10, 0, 0}, {0x3703, 0xb2, 0, 0}, {0x3704, 0x18, 0, 0}, {0x370b, 0x40, 0, 0}, {0x370d, 0x03, 0, 0}, {0x3631, 0x01, 0, 0}, {0x3632, 0x52, 0, 0}, {0x3606, 0x24, 0, 0}, {0x3620, 0x96, 0, 0}, {0x5785, 0x07, 0, 0}, {0x3a13, 0x30, 0, 0}, {0x3600, 0x52, 0, 0}, {0x3604, 0x48, 0, 0}, {0x3606, 0x1b, 0, 0}, {0x370d, 0x0b, 0, 0}, {0x370f, 0xc0, 0, 0}, {0x3709, 0x01, 0, 0}, {0x3823, 0x00, 0, 0}, {0x5007, 0x00, 0, 0}, {0x5009, 0x00, 0, 0}, {0x5011, 0x00, 0, 0}, {0x5013, 0x00, 0, 0}, {0x519e, 0x00, 0, 0}, {0x5086, 0x00, 0, 0}, {0x5087, 0x00, 0, 0}, {0x5088, 0x00, 0, 0}, {0x5089, 0x00, 0, 0}, {0x302b, 0x00, 0, 0}, {0x3621, 0x87, 0, 0}, {0x3a00, 0x78, 0, 0}, {0x302c, 0x60, 0x60, 0}, }; static struct reg_value ov5642_setting_15fps_720P_1280_720[] = { {0x3103, 0x93, 0, 0}, {0x3008, 0x82, 0, 0}, {0x3017, 0x7f, 0, 0}, {0x3018, 0xfc, 0, 0}, {0x3810, 0xc2, 0, 0}, {0x3615, 0xf0, 0, 0}, {0x3000, 0x00, 0, 0}, {0x3001, 0x00, 0, 0}, {0x3002, 0x00, 0, 0}, {0x3003, 0x00, 0, 0}, {0x3004, 0xff, 0, 0}, {0x3030, 0x2b, 0, 0}, {0x3011, 0x08, 0, 0}, {0x3010, 0x10, 0, 0}, {0x3604, 0x60, 0, 0}, {0x3622, 0x60, 0, 0}, {0x3621, 0x09, 0, 0}, {0x3709, 0x00, 0, 0}, {0x4000, 0x21, 0, 0}, {0x401d, 0x22, 0, 0}, {0x3600, 0x54, 0, 0}, {0x3605, 0x04, 0, 0}, {0x3606, 0x3f, 0, 0}, {0x3c01, 0x80, 0, 0}, {0x300d, 0x22, 0, 0}, {0x3623, 0x22, 0, 0}, {0x5000, 0x4f, 0, 0}, {0x5020, 0x04, 0, 0}, {0x5181, 0x79, 0, 0}, {0x5182, 0x00, 0, 0}, {0x5185, 0x22, 0, 0}, {0x5197, 0x01, 0, 0}, {0x5500, 0x0a, 0, 0}, {0x5504, 0x00, 0, 0}, {0x5505, 0x7f, 0, 0}, {0x5080, 0x08, 0, 0}, {0x300e, 0x18, 0, 0}, {0x4610, 0x00, 0, 0}, {0x471d, 0x05, 0, 0}, {0x4708, 0x06, 0, 0}, {0x370c, 0xa0, 0, 0}, {0x3808, 0x0a, 0, 0}, {0x3809, 0x20, 0, 0}, {0x380a, 0x07, 0, 0}, {0x380b, 0x98, 0, 0}, {0x380c, 0x0c, 0, 0}, {0x380d, 0x80, 0, 0}, {0x380e, 0x07, 0, 0}, {0x380f, 0xd0, 0, 0}, {0x5687, 0x94, 0, 0}, {0x501f, 0x00, 0, 0}, {0x5000, 0x4f, 0, 0}, {0x5001, 0xcf, 0, 0}, {0x4300, 0x30, 0, 0}, {0x4300, 0x30, 0, 0}, {0x460b, 0x35, 0, 0}, {0x471d, 0x00, 0, 0}, {0x3002, 0x0c, 0, 0}, {0x3002, 0x00, 0, 0}, {0x4713, 0x03, 0, 0}, {0x471c, 0x50, 0, 0}, {0x4721, 0x02, 0, 0}, {0x4402, 0x90, 0, 0}, {0x460c, 0x22, 0, 0}, {0x3815, 0x44, 0, 0}, {0x3503, 0x07, 0, 0}, {0x3501, 0x73, 0, 0}, {0x3502, 0x80, 0, 0}, {0x350b, 0x00, 0, 0}, {0x3818, 0xc8, 0, 0}, {0x3801, 0x88, 0, 0}, {0x3824, 0x11, 0, 0}, {0x3a00, 0x78, 0, 0}, {0x3a1a, 0x04, 0, 0}, {0x3a13, 0x30, 0, 0}, {0x3a18, 0x00, 0, 0}, {0x3a19, 0x7c, 0, 0}, {0x3a08, 0x12, 0, 0}, {0x3a09, 0xc0, 0, 0}, {0x3a0a, 0x0f, 0, 0}, {0x3a0b, 0xa0, 0, 0}, {0x350c, 0x07, 0, 0}, {0x350d, 0xd0, 0, 0}, {0x3a0d, 0x08, 0, 0}, {0x3a0e, 0x06, 0, 0}, {0x3500, 0x00, 0, 0}, {0x3501, 0x00, 0, 0}, {0x3502, 0x00, 0, 0}, {0x350a, 0x00, 0, 0}, {0x350b, 0x00, 0, 0}, {0x3503, 0x00, 0, 0}, {0x3a0f, 0x3c, 0, 0}, {0x3a10, 0x32, 0, 0}, {0x3a1b, 0x3c, 0, 0}, {0x3a1e, 0x32, 0, 0}, {0x3a11, 0x80, 0, 0}, {0x3a1f, 0x20, 0, 0}, {0x3030, 0x2b, 0, 0}, {0x3a02, 0x00, 0, 0}, {0x3a03, 0x7d, 0, 0}, {0x3a04, 0x00, 0, 0}, {0x3a14, 0x00, 0, 0}, {0x3a15, 0x7d, 0, 0}, {0x3a16, 0x00, 0, 0}, {0x3a00, 0x78, 0, 0}, {0x3a08, 0x09, 0, 0}, {0x3a09, 0x60, 0, 0}, {0x3a0a, 0x07, 0, 0}, {0x3a0b, 0xd0, 0, 0}, {0x3a0d, 0x10, 0, 0}, {0x3a0e, 0x0d, 0, 0}, {0x4407, 0x04, 0, 0}, {0x5193, 0x70, 0, 0}, {0x589b, 0x00, 0, 0}, {0x589a, 0xc0, 0, 0}, {0x401e, 0x20, 0, 0}, {0x4001, 0x42, 0, 0}, {0x401c, 0x06, 0, 0}, {0x3825, 0xac, 0, 0}, {0x3827, 0x0c, 0, 0}, {0x528a, 0x01, 0, 0}, {0x528b, 0x04, 0, 0}, {0x528c, 0x08, 0, 0}, {0x528d, 0x10, 0, 0}, {0x528e, 0x20, 0, 0}, {0x528f, 0x28, 0, 0}, {0x5290, 0x30, 0, 0}, {0x5292, 0x00, 0, 0}, {0x5293, 0x01, 0, 0}, {0x5294, 0x00, 0, 0}, {0x5295, 0x04, 0, 0}, {0x5296, 0x00, 0, 0}, {0x5297, 0x08, 0, 0}, {0x5298, 0x00, 0, 0}, {0x5299, 0x10, 0, 0}, {0x529a, 0x00, 0, 0}, {0x529b, 0x20, 0, 0}, {0x529c, 0x00, 0, 0}, {0x529d, 0x28, 0, 0}, {0x529e, 0x00, 0, 0}, {0x529f, 0x30, 0, 0}, {0x5282, 0x00, 0, 0}, {0x5300, 0x00, 0, 0}, {0x5301, 0x20, 0, 0}, {0x5302, 0x00, 0, 0}, {0x5303, 0x7c, 0, 0}, {0x530c, 0x00, 0, 0}, {0x530d, 0x0c, 0, 0}, {0x530e, 0x20, 0, 0}, {0x530f, 0x80, 0, 0}, {0x5310, 0x20, 0, 0}, {0x5311, 0x80, 0, 0}, {0x5308, 0x20, 0, 0}, {0x5309, 0x40, 0, 0}, {0x5304, 0x00, 0, 0}, {0x5305, 0x30, 0, 0}, {0x5306, 0x00, 0, 0}, {0x5307, 0x80, 0, 0}, {0x5314, 0x08, 0, 0}, {0x5315, 0x20, 0, 0}, {0x5319, 0x30, 0, 0}, {0x5316, 0x10, 0, 0}, {0x5317, 0x00, 0, 0}, {0x5318, 0x02, 0, 0}, {0x5380, 0x01, 0, 0}, {0x5381, 0x00, 0, 0}, {0x5382, 0x00, 0, 0}, {0x5383, 0x4e, 0, 0}, {0x5384, 0x00, 0, 0}, {0x5385, 0x0f, 0, 0}, {0x5386, 0x00, 0, 0}, {0x5387, 0x00, 0, 0}, {0x5388, 0x01, 0, 0}, {0x5389, 0x15, 0, 0}, {0x538a, 0x00, 0, 0}, {0x538b, 0x31, 0, 0}, {0x538c, 0x00, 0, 0}, {0x538d, 0x00, 0, 0}, {0x538e, 0x00, 0, 0}, {0x538f, 0x0f, 0, 0}, {0x5390, 0x00, 0, 0}, {0x5391, 0xab, 0, 0}, {0x5392, 0x00, 0, 0}, {0x5393, 0xa2, 0, 0}, {0x5394, 0x08, 0, 0}, {0x5480, 0x14, 0, 0}, {0x5481, 0x21, 0, 0}, {0x5482, 0x36, 0, 0}, {0x5483, 0x57, 0, 0}, {0x5484, 0x65, 0, 0}, {0x5485, 0x71, 0, 0}, {0x5486, 0x7d, 0, 0}, {0x5487, 0x87, 0, 0}, {0x5488, 0x91, 0, 0}, {0x5489, 0x9a, 0, 0}, {0x548a, 0xaa, 0, 0}, {0x548b, 0xb8, 0, 0}, {0x548c, 0xcd, 0, 0}, {0x548d, 0xdd, 0, 0}, {0x548e, 0xea, 0, 0}, {0x548f, 0x1d, 0, 0}, {0x5490, 0x05, 0, 0}, {0x5491, 0x00, 0, 0}, {0x5492, 0x04, 0, 0}, {0x5493, 0x20, 0, 0}, {0x5494, 0x03, 0, 0}, {0x5495, 0x60, 0, 0}, {0x5496, 0x02, 0, 0}, {0x5497, 0xb8, 0, 0}, {0x5498, 0x02, 0, 0}, {0x5499, 0x86, 0, 0}, {0x549a, 0x02, 0, 0}, {0x549b, 0x5b, 0, 0}, {0x549c, 0x02, 0, 0}, {0x549d, 0x3b, 0, 0}, {0x549e, 0x02, 0, 0}, {0x549f, 0x1c, 0, 0}, {0x54a0, 0x02, 0, 0}, {0x54a1, 0x04, 0, 0}, {0x54a2, 0x01, 0, 0}, {0x54a3, 0xed, 0, 0}, {0x54a4, 0x01, 0, 0}, {0x54a5, 0xc5, 0, 0}, {0x54a6, 0x01, 0, 0}, {0x54a7, 0xa5, 0, 0}, {0x54a8, 0x01, 0, 0}, {0x54a9, 0x6c, 0, 0}, {0x54aa, 0x01, 0, 0}, {0x54ab, 0x41, 0, 0}, {0x54ac, 0x01, 0, 0}, {0x54ad, 0x20, 0, 0}, {0x54ae, 0x00, 0, 0}, {0x54af, 0x16, 0, 0}, {0x54b0, 0x01, 0, 0}, {0x54b1, 0x20, 0, 0}, {0x54b2, 0x00, 0, 0}, {0x54b3, 0x10, 0, 0}, {0x54b4, 0x00, 0, 0}, {0x54b5, 0xf0, 0, 0}, {0x54b6, 0x00, 0, 0}, {0x54b7, 0xdf, 0, 0}, {0x5402, 0x3f, 0, 0}, {0x5403, 0x00, 0, 0}, {0x3406, 0x00, 0, 0}, {0x5180, 0xff, 0, 0}, {0x5181, 0x52, 0, 0}, {0x5182, 0x11, 0, 0}, {0x5183, 0x14, 0, 0}, {0x5184, 0x25, 0, 0}, {0x5185, 0x24, 0, 0}, {0x5186, 0x06, 0, 0}, {0x5187, 0x08, 0, 0}, {0x5188, 0x08, 0, 0}, {0x5189, 0x7c, 0, 0}, {0x518a, 0x60, 0, 0}, {0x518b, 0xb2, 0, 0}, {0x518c, 0xb2, 0, 0}, {0x518d, 0x44, 0, 0}, {0x518e, 0x3d, 0, 0}, {0x518f, 0x58, 0, 0}, {0x5190, 0x46, 0, 0}, {0x5191, 0xf8, 0, 0}, {0x5192, 0x04, 0, 0}, {0x5193, 0x70, 0, 0}, {0x5194, 0xf0, 0, 0}, {0x5195, 0xf0, 0, 0}, {0x5196, 0x03, 0, 0}, {0x5197, 0x01, 0, 0}, {0x5198, 0x04, 0, 0}, {0x5199, 0x12, 0, 0}, {0x519a, 0x04, 0, 0}, {0x519b, 0x00, 0, 0}, {0x519c, 0x06, 0, 0}, {0x519d, 0x82, 0, 0}, {0x519e, 0x00, 0, 0}, {0x5025, 0x80, 0, 0}, {0x3a0f, 0x38, 0, 0}, {0x3a10, 0x30, 0, 0}, {0x3a1b, 0x3a, 0, 0}, {0x3a1e, 0x2e, 0, 0}, {0x3a11, 0x60, 0, 0}, {0x3a1f, 0x10, 0, 0}, {0x5688, 0xa6, 0, 0}, {0x5689, 0x6a, 0, 0}, {0x568a, 0xea, 0, 0}, {0x568b, 0xae, 0, 0}, {0x568c, 0xa6, 0, 0}, {0x568d, 0x6a, 0, 0}, {0x568e, 0x62, 0, 0}, {0x568f, 0x26, 0, 0}, {0x5583, 0x40, 0, 0}, {0x5584, 0x40, 0, 0}, {0x5580, 0x02, 0, 0}, {0x5000, 0xcf, 0, 0}, {0x5800, 0x27, 0, 0}, {0x5801, 0x19, 0, 0}, {0x5802, 0x12, 0, 0}, {0x5803, 0x0f, 0, 0}, {0x5804, 0x10, 0, 0}, {0x5805, 0x15, 0, 0}, {0x5806, 0x1e, 0, 0}, {0x5807, 0x2f, 0, 0}, {0x5808, 0x15, 0, 0}, {0x5809, 0x0d, 0, 0}, {0x580a, 0x0a, 0, 0}, {0x580b, 0x09, 0, 0}, {0x580c, 0x0a, 0, 0}, {0x580d, 0x0c, 0, 0}, {0x580e, 0x12, 0, 0}, {0x580f, 0x19, 0, 0}, {0x5810, 0x0b, 0, 0}, {0x5811, 0x07, 0, 0}, {0x5812, 0x04, 0, 0}, {0x5813, 0x03, 0, 0}, {0x5814, 0x03, 0, 0}, {0x5815, 0x06, 0, 0}, {0x5816, 0x0a, 0, 0}, {0x5817, 0x0f, 0, 0}, {0x5818, 0x0a, 0, 0}, {0x5819, 0x05, 0, 0}, {0x581a, 0x01, 0, 0}, {0x581b, 0x00, 0, 0}, {0x581c, 0x00, 0, 0}, {0x581d, 0x03, 0, 0}, {0x581e, 0x08, 0, 0}, {0x581f, 0x0c, 0, 0}, {0x5820, 0x0a, 0, 0}, {0x5821, 0x05, 0, 0}, {0x5822, 0x01, 0, 0}, {0x5823, 0x00, 0, 0}, {0x5824, 0x00, 0, 0}, {0x5825, 0x03, 0, 0}, {0x5826, 0x08, 0, 0}, {0x5827, 0x0c, 0, 0}, {0x5828, 0x0e, 0, 0}, {0x5829, 0x08, 0, 0}, {0x582a, 0x06, 0, 0}, {0x582b, 0x04, 0, 0}, {0x582c, 0x05, 0, 0}, {0x582d, 0x07, 0, 0}, {0x582e, 0x0b, 0, 0}, {0x582f, 0x12, 0, 0}, {0x5830, 0x18, 0, 0}, {0x5831, 0x10, 0, 0}, {0x5832, 0x0c, 0, 0}, {0x5833, 0x0a, 0, 0}, {0x5834, 0x0b, 0, 0}, {0x5835, 0x0e, 0, 0}, {0x5836, 0x15, 0, 0}, {0x5837, 0x19, 0, 0}, {0x5838, 0x32, 0, 0}, {0x5839, 0x1f, 0, 0}, {0x583a, 0x18, 0, 0}, {0x583b, 0x16, 0, 0}, {0x583c, 0x17, 0, 0}, {0x583d, 0x1e, 0, 0}, {0x583e, 0x26, 0, 0}, {0x583f, 0x53, 0, 0}, {0x5840, 0x10, 0, 0}, {0x5841, 0x0f, 0, 0}, {0x5842, 0x0d, 0, 0}, {0x5843, 0x0c, 0, 0}, {0x5844, 0x0e, 0, 0}, {0x5845, 0x09, 0, 0}, {0x5846, 0x11, 0, 0}, {0x5847, 0x10, 0, 0}, {0x5848, 0x10, 0, 0}, {0x5849, 0x10, 0, 0}, {0x584a, 0x10, 0, 0}, {0x584b, 0x0e, 0, 0}, {0x584c, 0x10, 0, 0}, {0x584d, 0x10, 0, 0}, {0x584e, 0x11, 0, 0}, {0x584f, 0x10, 0, 0}, {0x5850, 0x0f, 0, 0}, {0x5851, 0x0c, 0, 0}, {0x5852, 0x0f, 0, 0}, {0x5853, 0x10, 0, 0}, {0x5854, 0x10, 0, 0}, {0x5855, 0x0f, 0, 0}, {0x5856, 0x0e, 0, 0}, {0x5857, 0x0b, 0, 0}, {0x5858, 0x10, 0, 0}, {0x5859, 0x0d, 0, 0}, {0x585a, 0x0d, 0, 0}, {0x585b, 0x0c, 0, 0}, {0x585c, 0x0c, 0, 0}, {0x585d, 0x0c, 0, 0}, {0x585e, 0x0b, 0, 0}, {0x585f, 0x0c, 0, 0}, {0x5860, 0x0c, 0, 0}, {0x5861, 0x0c, 0, 0}, {0x5862, 0x0d, 0, 0}, {0x5863, 0x08, 0, 0}, {0x5864, 0x11, 0, 0}, {0x5865, 0x18, 0, 0}, {0x5866, 0x18, 0, 0}, {0x5867, 0x19, 0, 0}, {0x5868, 0x17, 0, 0}, {0x5869, 0x19, 0, 0}, {0x586a, 0x16, 0, 0}, {0x586b, 0x13, 0, 0}, {0x586c, 0x13, 0, 0}, {0x586d, 0x12, 0, 0}, {0x586e, 0x13, 0, 0}, {0x586f, 0x16, 0, 0}, {0x5870, 0x14, 0, 0}, {0x5871, 0x12, 0, 0}, {0x5872, 0x10, 0, 0}, {0x5873, 0x11, 0, 0}, {0x5874, 0x11, 0, 0}, {0x5875, 0x16, 0, 0}, {0x5876, 0x14, 0, 0}, {0x5877, 0x11, 0, 0}, {0x5878, 0x10, 0, 0}, {0x5879, 0x0f, 0, 0}, {0x587a, 0x10, 0, 0}, {0x587b, 0x14, 0, 0}, {0x587c, 0x13, 0, 0}, {0x587d, 0x12, 0, 0}, {0x587e, 0x11, 0, 0}, {0x587f, 0x11, 0, 0}, {0x5880, 0x12, 0, 0}, {0x5881, 0x15, 0, 0}, {0x5882, 0x14, 0, 0}, {0x5883, 0x15, 0, 0}, {0x5884, 0x15, 0, 0}, {0x5885, 0x15, 0, 0}, {0x5886, 0x13, 0, 0}, {0x5887, 0x17, 0, 0}, {0x3710, 0x10, 0, 0}, {0x3632, 0x51, 0, 0}, {0x3702, 0x10, 0, 0}, {0x3703, 0xb2, 0, 0}, {0x3704, 0x18, 0, 0}, {0x370b, 0x40, 0, 0}, {0x370d, 0x03, 0, 0}, {0x3631, 0x01, 0, 0}, {0x3632, 0x52, 0, 0}, {0x3606, 0x24, 0, 0}, {0x3620, 0x96, 0, 0}, {0x5785, 0x07, 0, 0}, {0x3a13, 0x30, 0, 0}, {0x3600, 0x52, 0, 0}, {0x3604, 0x48, 0, 0}, {0x3606, 0x1b, 0, 0}, {0x370d, 0x0b, 0, 0}, {0x370f, 0xc0, 0, 0}, {0x3709, 0x01, 0, 0}, {0x3823, 0x00, 0, 0}, {0x5007, 0x00, 0, 0}, {0x5009, 0x00, 0, 0}, {0x5011, 0x00, 0, 0}, {0x5013, 0x00, 0, 0}, {0x519e, 0x00, 0, 0}, {0x5086, 0x00, 0, 0}, {0x5087, 0x00, 0, 0}, {0x5088, 0x00, 0, 0}, {0x5089, 0x00, 0, 0}, {0x302b, 0x00, 0, 0}, {0x3503, 0x07, 0, 0}, {0x3011, 0x08, 0, 0}, {0x350c, 0x02, 0, 0}, {0x350d, 0xe4, 0, 0}, {0x3621, 0xc9, 0, 0}, {0x370a, 0x81, 0, 0}, {0x3803, 0x08, 0, 0}, {0x3804, 0x05, 0, 0}, {0x3805, 0x00, 0, 0}, {0x3806, 0x02, 0, 0}, {0x3807, 0xd0, 0, 0}, {0x3808, 0x05, 0, 0}, {0x3809, 0x00, 0, 0}, {0x380a, 0x02, 0, 0}, {0x380b, 0xd0, 0, 0}, {0x380c, 0x08, 0, 0}, {0x380d, 0x72, 0, 0}, {0x380e, 0x02, 0, 0}, {0x380f, 0xe4, 0, 0}, {0x3810, 0xc0, 0, 0}, {0x3818, 0xc9, 0, 0}, {0x381c, 0x10, 0, 0}, {0x381d, 0xa0, 0, 0}, {0x381e, 0x05, 0, 0}, {0x381f, 0xb0, 0, 0}, {0x3820, 0x00, 0, 0}, {0x3821, 0x00, 0, 0}, {0x3824, 0x11, 0, 0}, {0x3a08, 0x1b, 0, 0}, {0x3a09, 0xc0, 0, 0}, {0x3a0a, 0x17, 0, 0}, {0x3a0b, 0x20, 0, 0}, {0x3a0d, 0x02, 0, 0}, {0x3a0e, 0x01, 0, 0}, {0x401c, 0x04, 0, 0}, {0x5682, 0x05, 0, 0}, {0x5683, 0x00, 0, 0}, {0x5686, 0x02, 0, 0}, {0x5687, 0xcc, 0, 0}, {0x5001, 0x7f, 0, 0}, {0x589b, 0x06, 0, 0}, {0x589a, 0xc5, 0, 0}, {0x3503, 0x00, 0, 0}, {0x3010, 0x10, 0, 0}, {0x460c, 0x20, 0, 0}, {0x460b, 0x37, 0, 0}, {0x471c, 0xd0, 0, 0}, {0x471d, 0x05, 0, 0}, {0x3815, 0x01, 0, 0}, {0x3818, 0x00, 0x08, 0}, {0x501f, 0x00, 0, 0}, {0x4300, 0x30, 0, 0}, {0x3002, 0x1c, 0, 0}, {0x3819, 0x80, 0, 0}, {0x5002, 0xe0, 0, 0}, {0x3010, 0x30, 0, 0}, {0x3a08, 0x06, 0, 0}, {0x3a09, 0x60, 0, 0}, {0x3a0a, 0x05, 0, 0}, {0x3a0b, 0x50, 0, 0}, {0x3a0d, 0x08, 0, 0}, {0x3a0e, 0x07, 0, 0}, }; static struct reg_value ov5642_setting_30fps_720P_1280_720[] = { {0x3103, 0x93, 0, 0}, {0x3008, 0x82, 0, 0}, {0x3017, 0x7f, 0, 0}, {0x3018, 0xfc, 0, 0}, {0x3810, 0xc2, 0, 0}, {0x3615, 0xf0, 0, 0}, {0x3000, 0x00, 0, 0}, {0x3001, 0x00, 0, 0}, {0x3002, 0x00, 0, 0}, {0x3003, 0x00, 0, 0}, {0x3004, 0xff, 0, 0}, {0x3030, 0x2b, 0, 0}, {0x3011, 0x08, 0, 0}, {0x3010, 0x10, 0, 0}, {0x3604, 0x60, 0, 0}, {0x3622, 0x60, 0, 0}, {0x3621, 0x09, 0, 0}, {0x3709, 0x00, 0, 0}, {0x4000, 0x21, 0, 0}, {0x401d, 0x22, 0, 0}, {0x3600, 0x54, 0, 0}, {0x3605, 0x04, 0, 0}, {0x3606, 0x3f, 0, 0}, {0x3c01, 0x80, 0, 0}, {0x300d, 0x22, 0, 0}, {0x3623, 0x22, 0, 0}, {0x5000, 0x4f, 0, 0}, {0x5020, 0x04, 0, 0}, {0x5181, 0x79, 0, 0}, {0x5182, 0x00, 0, 0}, {0x5185, 0x22, 0, 0}, {0x5197, 0x01, 0, 0}, {0x5500, 0x0a, 0, 0}, {0x5504, 0x00, 0, 0}, {0x5505, 0x7f, 0, 0}, {0x5080, 0x08, 0, 0}, {0x300e, 0x18, 0, 0}, {0x4610, 0x00, 0, 0}, {0x471d, 0x05, 0, 0}, {0x4708, 0x06, 0, 0}, {0x370c, 0xa0, 0, 0}, {0x3808, 0x0a, 0, 0}, {0x3809, 0x20, 0, 0}, {0x380a, 0x07, 0, 0}, {0x380b, 0x98, 0, 0}, {0x380c, 0x0c, 0, 0}, {0x380d, 0x80, 0, 0}, {0x380e, 0x07, 0, 0}, {0x380f, 0xd0, 0, 0}, {0x5687, 0x94, 0, 0}, {0x501f, 0x00, 0, 0}, {0x5000, 0x4f, 0, 0}, {0x5001, 0xcf, 0, 0}, {0x4300, 0x30, 0, 0}, {0x4300, 0x30, 0, 0}, {0x460b, 0x35, 0, 0}, {0x471d, 0x00, 0, 0}, {0x3002, 0x0c, 0, 0}, {0x3002, 0x00, 0, 0}, {0x4713, 0x03, 0, 0}, {0x471c, 0x50, 0, 0}, {0x4721, 0x02, 0, 0}, {0x4402, 0x90, 0, 0}, {0x460c, 0x22, 0, 0}, {0x3815, 0x44, 0, 0}, {0x3503, 0x07, 0, 0}, {0x3501, 0x73, 0, 0}, {0x3502, 0x80, 0, 0}, {0x350b, 0x00, 0, 0}, {0x3818, 0xc8, 0, 0}, {0x3801, 0x88, 0, 0}, {0x3824, 0x11, 0, 0}, {0x3a00, 0x78, 0, 0}, {0x3a1a, 0x04, 0, 0}, {0x3a13, 0x30, 0, 0}, {0x3a18, 0x00, 0, 0}, {0x3a19, 0x7c, 0, 0}, {0x3a08, 0x12, 0, 0}, {0x3a09, 0xc0, 0, 0}, {0x3a0a, 0x0f, 0, 0}, {0x3a0b, 0xa0, 0, 0}, {0x350c, 0x07, 0, 0}, {0x350d, 0xd0, 0, 0}, {0x3a0d, 0x08, 0, 0}, {0x3a0e, 0x06, 0, 0}, {0x3500, 0x00, 0, 0}, {0x3501, 0x00, 0, 0}, {0x3502, 0x00, 0, 0}, {0x350a, 0x00, 0, 0}, {0x350b, 0x00, 0, 0}, {0x3503, 0x00, 0, 0}, {0x3a0f, 0x3c, 0, 0}, {0x3a10, 0x32, 0, 0}, {0x3a1b, 0x3c, 0, 0}, {0x3a1e, 0x32, 0, 0}, {0x3a11, 0x80, 0, 0}, {0x3a1f, 0x20, 0, 0}, {0x3030, 0x2b, 0, 0}, {0x3a02, 0x00, 0, 0}, {0x3a03, 0x7d, 0, 0}, {0x3a04, 0x00, 0, 0}, {0x3a14, 0x00, 0, 0}, {0x3a15, 0x7d, 0, 0}, {0x3a16, 0x00, 0, 0}, {0x3a00, 0x78, 0, 0}, {0x3a08, 0x09, 0, 0}, {0x3a09, 0x60, 0, 0}, {0x3a0a, 0x07, 0, 0}, {0x3a0b, 0xd0, 0, 0}, {0x3a0d, 0x10, 0, 0}, {0x3a0e, 0x0d, 0, 0}, {0x4407, 0x04, 0, 0}, {0x5193, 0x70, 0, 0}, {0x589b, 0x00, 0, 0}, {0x589a, 0xc0, 0, 0}, {0x401e, 0x20, 0, 0}, {0x4001, 0x42, 0, 0}, {0x401c, 0x06, 0, 0}, {0x3825, 0xac, 0, 0}, {0x3827, 0x0c, 0, 0}, {0x528a, 0x01, 0, 0}, {0x528b, 0x04, 0, 0}, {0x528c, 0x08, 0, 0}, {0x528d, 0x10, 0, 0}, {0x528e, 0x20, 0, 0}, {0x528f, 0x28, 0, 0}, {0x5290, 0x30, 0, 0}, {0x5292, 0x00, 0, 0}, {0x5293, 0x01, 0, 0}, {0x5294, 0x00, 0, 0}, {0x5295, 0x04, 0, 0}, {0x5296, 0x00, 0, 0}, {0x5297, 0x08, 0, 0}, {0x5298, 0x00, 0, 0}, {0x5299, 0x10, 0, 0}, {0x529a, 0x00, 0, 0}, {0x529b, 0x20, 0, 0}, {0x529c, 0x00, 0, 0}, {0x529d, 0x28, 0, 0}, {0x529e, 0x00, 0, 0}, {0x529f, 0x30, 0, 0}, {0x5282, 0x00, 0, 0}, {0x5300, 0x00, 0, 0}, {0x5301, 0x20, 0, 0}, {0x5302, 0x00, 0, 0}, {0x5303, 0x7c, 0, 0}, {0x530c, 0x00, 0, 0}, {0x530d, 0x0c, 0, 0}, {0x530e, 0x20, 0, 0}, {0x530f, 0x80, 0, 0}, {0x5310, 0x20, 0, 0}, {0x5311, 0x80, 0, 0}, {0x5308, 0x20, 0, 0}, {0x5309, 0x40, 0, 0}, {0x5304, 0x00, 0, 0}, {0x5305, 0x30, 0, 0}, {0x5306, 0x00, 0, 0}, {0x5307, 0x80, 0, 0}, {0x5314, 0x08, 0, 0}, {0x5315, 0x20, 0, 0}, {0x5319, 0x30, 0, 0}, {0x5316, 0x10, 0, 0}, {0x5317, 0x00, 0, 0}, {0x5318, 0x02, 0, 0}, {0x5380, 0x01, 0, 0}, {0x5381, 0x00, 0, 0}, {0x5382, 0x00, 0, 0}, {0x5383, 0x4e, 0, 0}, {0x5384, 0x00, 0, 0}, {0x5385, 0x0f, 0, 0}, {0x5386, 0x00, 0, 0}, {0x5387, 0x00, 0, 0}, {0x5388, 0x01, 0, 0}, {0x5389, 0x15, 0, 0}, {0x538a, 0x00, 0, 0}, {0x538b, 0x31, 0, 0}, {0x538c, 0x00, 0, 0}, {0x538d, 0x00, 0, 0}, {0x538e, 0x00, 0, 0}, {0x538f, 0x0f, 0, 0}, {0x5390, 0x00, 0, 0}, {0x5391, 0xab, 0, 0}, {0x5392, 0x00, 0, 0}, {0x5393, 0xa2, 0, 0}, {0x5394, 0x08, 0, 0}, {0x5480, 0x14, 0, 0}, {0x5481, 0x21, 0, 0}, {0x5482, 0x36, 0, 0}, {0x5483, 0x57, 0, 0}, {0x5484, 0x65, 0, 0}, {0x5485, 0x71, 0, 0}, {0x5486, 0x7d, 0, 0}, {0x5487, 0x87, 0, 0}, {0x5488, 0x91, 0, 0}, {0x5489, 0x9a, 0, 0}, {0x548a, 0xaa, 0, 0}, {0x548b, 0xb8, 0, 0}, {0x548c, 0xcd, 0, 0}, {0x548d, 0xdd, 0, 0}, {0x548e, 0xea, 0, 0}, {0x548f, 0x1d, 0, 0}, {0x5490, 0x05, 0, 0}, {0x5491, 0x00, 0, 0}, {0x5492, 0x04, 0, 0}, {0x5493, 0x20, 0, 0}, {0x5494, 0x03, 0, 0}, {0x5495, 0x60, 0, 0}, {0x5496, 0x02, 0, 0}, {0x5497, 0xb8, 0, 0}, {0x5498, 0x02, 0, 0}, {0x5499, 0x86, 0, 0}, {0x549a, 0x02, 0, 0}, {0x549b, 0x5b, 0, 0}, {0x549c, 0x02, 0, 0}, {0x549d, 0x3b, 0, 0}, {0x549e, 0x02, 0, 0}, {0x549f, 0x1c, 0, 0}, {0x54a0, 0x02, 0, 0}, {0x54a1, 0x04, 0, 0}, {0x54a2, 0x01, 0, 0}, {0x54a3, 0xed, 0, 0}, {0x54a4, 0x01, 0, 0}, {0x54a5, 0xc5, 0, 0}, {0x54a6, 0x01, 0, 0}, {0x54a7, 0xa5, 0, 0}, {0x54a8, 0x01, 0, 0}, {0x54a9, 0x6c, 0, 0}, {0x54aa, 0x01, 0, 0}, {0x54ab, 0x41, 0, 0}, {0x54ac, 0x01, 0, 0}, {0x54ad, 0x20, 0, 0}, {0x54ae, 0x00, 0, 0}, {0x54af, 0x16, 0, 0}, {0x54b0, 0x01, 0, 0}, {0x54b1, 0x20, 0, 0}, {0x54b2, 0x00, 0, 0}, {0x54b3, 0x10, 0, 0}, {0x54b4, 0x00, 0, 0}, {0x54b5, 0xf0, 0, 0}, {0x54b6, 0x00, 0, 0}, {0x54b7, 0xdf, 0, 0}, {0x5402, 0x3f, 0, 0}, {0x5403, 0x00, 0, 0}, {0x3406, 0x00, 0, 0}, {0x5180, 0xff, 0, 0}, {0x5181, 0x52, 0, 0}, {0x5182, 0x11, 0, 0}, {0x5183, 0x14, 0, 0}, {0x5184, 0x25, 0, 0}, {0x5185, 0x24, 0, 0}, {0x5186, 0x06, 0, 0}, {0x5187, 0x08, 0, 0}, {0x5188, 0x08, 0, 0}, {0x5189, 0x7c, 0, 0}, {0x518a, 0x60, 0, 0}, {0x518b, 0xb2, 0, 0}, {0x518c, 0xb2, 0, 0}, {0x518d, 0x44, 0, 0}, {0x518e, 0x3d, 0, 0}, {0x518f, 0x58, 0, 0}, {0x5190, 0x46, 0, 0}, {0x5191, 0xf8, 0, 0}, {0x5192, 0x04, 0, 0}, {0x5193, 0x70, 0, 0}, {0x5194, 0xf0, 0, 0}, {0x5195, 0xf0, 0, 0}, {0x5196, 0x03, 0, 0}, {0x5197, 0x01, 0, 0}, {0x5198, 0x04, 0, 0}, {0x5199, 0x12, 0, 0}, {0x519a, 0x04, 0, 0}, {0x519b, 0x00, 0, 0}, {0x519c, 0x06, 0, 0}, {0x519d, 0x82, 0, 0}, {0x519e, 0x00, 0, 0}, {0x5025, 0x80, 0, 0}, {0x3a0f, 0x38, 0, 0}, {0x3a10, 0x30, 0, 0}, {0x3a1b, 0x3a, 0, 0}, {0x3a1e, 0x2e, 0, 0}, {0x3a11, 0x60, 0, 0}, {0x3a1f, 0x10, 0, 0}, {0x5688, 0xa6, 0, 0}, {0x5689, 0x6a, 0, 0}, {0x568a, 0xea, 0, 0}, {0x568b, 0xae, 0, 0}, {0x568c, 0xa6, 0, 0}, {0x568d, 0x6a, 0, 0}, {0x568e, 0x62, 0, 0}, {0x568f, 0x26, 0, 0}, {0x5583, 0x40, 0, 0}, {0x5584, 0x40, 0, 0}, {0x5580, 0x02, 0, 0}, {0x5000, 0xcf, 0, 0}, {0x5800, 0x27, 0, 0}, {0x5801, 0x19, 0, 0}, {0x5802, 0x12, 0, 0}, {0x5803, 0x0f, 0, 0}, {0x5804, 0x10, 0, 0}, {0x5805, 0x15, 0, 0}, {0x5806, 0x1e, 0, 0}, {0x5807, 0x2f, 0, 0}, {0x5808, 0x15, 0, 0}, {0x5809, 0x0d, 0, 0}, {0x580a, 0x0a, 0, 0}, {0x580b, 0x09, 0, 0}, {0x580c, 0x0a, 0, 0}, {0x580d, 0x0c, 0, 0}, {0x580e, 0x12, 0, 0}, {0x580f, 0x19, 0, 0}, {0x5810, 0x0b, 0, 0}, {0x5811, 0x07, 0, 0}, {0x5812, 0x04, 0, 0}, {0x5813, 0x03, 0, 0}, {0x5814, 0x03, 0, 0}, {0x5815, 0x06, 0, 0}, {0x5816, 0x0a, 0, 0}, {0x5817, 0x0f, 0, 0}, {0x5818, 0x0a, 0, 0}, {0x5819, 0x05, 0, 0}, {0x581a, 0x01, 0, 0}, {0x581b, 0x00, 0, 0}, {0x581c, 0x00, 0, 0}, {0x581d, 0x03, 0, 0}, {0x581e, 0x08, 0, 0}, {0x581f, 0x0c, 0, 0}, {0x5820, 0x0a, 0, 0}, {0x5821, 0x05, 0, 0}, {0x5822, 0x01, 0, 0}, {0x5823, 0x00, 0, 0}, {0x5824, 0x00, 0, 0}, {0x5825, 0x03, 0, 0}, {0x5826, 0x08, 0, 0}, {0x5827, 0x0c, 0, 0}, {0x5828, 0x0e, 0, 0}, {0x5829, 0x08, 0, 0}, {0x582a, 0x06, 0, 0}, {0x582b, 0x04, 0, 0}, {0x582c, 0x05, 0, 0}, {0x582d, 0x07, 0, 0}, {0x582e, 0x0b, 0, 0}, {0x582f, 0x12, 0, 0}, {0x5830, 0x18, 0, 0}, {0x5831, 0x10, 0, 0}, {0x5832, 0x0c, 0, 0}, {0x5833, 0x0a, 0, 0}, {0x5834, 0x0b, 0, 0}, {0x5835, 0x0e, 0, 0}, {0x5836, 0x15, 0, 0}, {0x5837, 0x19, 0, 0}, {0x5838, 0x32, 0, 0}, {0x5839, 0x1f, 0, 0}, {0x583a, 0x18, 0, 0}, {0x583b, 0x16, 0, 0}, {0x583c, 0x17, 0, 0}, {0x583d, 0x1e, 0, 0}, {0x583e, 0x26, 0, 0}, {0x583f, 0x53, 0, 0}, {0x5840, 0x10, 0, 0}, {0x5841, 0x0f, 0, 0}, {0x5842, 0x0d, 0, 0}, {0x5843, 0x0c, 0, 0}, {0x5844, 0x0e, 0, 0}, {0x5845, 0x09, 0, 0}, {0x5846, 0x11, 0, 0}, {0x5847, 0x10, 0, 0}, {0x5848, 0x10, 0, 0}, {0x5849, 0x10, 0, 0}, {0x584a, 0x10, 0, 0}, {0x584b, 0x0e, 0, 0}, {0x584c, 0x10, 0, 0}, {0x584d, 0x10, 0, 0}, {0x584e, 0x11, 0, 0}, {0x584f, 0x10, 0, 0}, {0x5850, 0x0f, 0, 0}, {0x5851, 0x0c, 0, 0}, {0x5852, 0x0f, 0, 0}, {0x5853, 0x10, 0, 0}, {0x5854, 0x10, 0, 0}, {0x5855, 0x0f, 0, 0}, {0x5856, 0x0e, 0, 0}, {0x5857, 0x0b, 0, 0}, {0x5858, 0x10, 0, 0}, {0x5859, 0x0d, 0, 0}, {0x585a, 0x0d, 0, 0}, {0x585b, 0x0c, 0, 0}, {0x585c, 0x0c, 0, 0}, {0x585d, 0x0c, 0, 0}, {0x585e, 0x0b, 0, 0}, {0x585f, 0x0c, 0, 0}, {0x5860, 0x0c, 0, 0}, {0x5861, 0x0c, 0, 0}, {0x5862, 0x0d, 0, 0}, {0x5863, 0x08, 0, 0}, {0x5864, 0x11, 0, 0}, {0x5865, 0x18, 0, 0}, {0x5866, 0x18, 0, 0}, {0x5867, 0x19, 0, 0}, {0x5868, 0x17, 0, 0}, {0x5869, 0x19, 0, 0}, {0x586a, 0x16, 0, 0}, {0x586b, 0x13, 0, 0}, {0x586c, 0x13, 0, 0}, {0x586d, 0x12, 0, 0}, {0x586e, 0x13, 0, 0}, {0x586f, 0x16, 0, 0}, {0x5870, 0x14, 0, 0}, {0x5871, 0x12, 0, 0}, {0x5872, 0x10, 0, 0}, {0x5873, 0x11, 0, 0}, {0x5874, 0x11, 0, 0}, {0x5875, 0x16, 0, 0}, {0x5876, 0x14, 0, 0}, {0x5877, 0x11, 0, 0}, {0x5878, 0x10, 0, 0}, {0x5879, 0x0f, 0, 0}, {0x587a, 0x10, 0, 0}, {0x587b, 0x14, 0, 0}, {0x587c, 0x13, 0, 0}, {0x587d, 0x12, 0, 0}, {0x587e, 0x11, 0, 0}, {0x587f, 0x11, 0, 0}, {0x5880, 0x12, 0, 0}, {0x5881, 0x15, 0, 0}, {0x5882, 0x14, 0, 0}, {0x5883, 0x15, 0, 0}, {0x5884, 0x15, 0, 0}, {0x5885, 0x15, 0, 0}, {0x5886, 0x13, 0, 0}, {0x5887, 0x17, 0, 0}, {0x3710, 0x10, 0, 0}, {0x3632, 0x51, 0, 0}, {0x3702, 0x10, 0, 0}, {0x3703, 0xb2, 0, 0}, {0x3704, 0x18, 0, 0}, {0x370b, 0x40, 0, 0}, {0x370d, 0x03, 0, 0}, {0x3631, 0x01, 0, 0}, {0x3632, 0x52, 0, 0}, {0x3606, 0x24, 0, 0}, {0x3620, 0x96, 0, 0}, {0x5785, 0x07, 0, 0}, {0x3a13, 0x30, 0, 0}, {0x3600, 0x52, 0, 0}, {0x3604, 0x48, 0, 0}, {0x3606, 0x1b, 0, 0}, {0x370d, 0x0b, 0, 0}, {0x370f, 0xc0, 0, 0}, {0x3709, 0x01, 0, 0}, {0x3823, 0x00, 0, 0}, {0x5007, 0x00, 0, 0}, {0x5009, 0x00, 0, 0}, {0x5011, 0x00, 0, 0}, {0x5013, 0x00, 0, 0}, {0x519e, 0x00, 0, 0}, {0x5086, 0x00, 0, 0}, {0x5087, 0x00, 0, 0}, {0x5088, 0x00, 0, 0}, {0x5089, 0x00, 0, 0}, {0x302b, 0x00, 0, 0}, {0x3503, 0x07, 0, 0}, {0x3011, 0x08, 0, 0}, {0x350c, 0x02, 0, 0}, {0x350d, 0xe4, 0, 0}, {0x3621, 0xc9, 0, 0}, {0x370a, 0x81, 0, 0}, {0x3803, 0x08, 0, 0}, {0x3804, 0x05, 0, 0}, {0x3805, 0x00, 0, 0}, {0x3806, 0x02, 0, 0}, {0x3807, 0xd0, 0, 0}, {0x3808, 0x05, 0, 0}, {0x3809, 0x00, 0, 0}, {0x380a, 0x02, 0, 0}, {0x380b, 0xd0, 0, 0}, {0x380c, 0x08, 0, 0}, {0x380d, 0x72, 0, 0}, {0x380e, 0x02, 0, 0}, {0x380f, 0xe4, 0, 0}, {0x3810, 0xc0, 0, 0}, {0x3818, 0xc9, 0, 0}, {0x381c, 0x10, 0, 0}, {0x381d, 0xa0, 0, 0}, {0x381e, 0x05, 0, 0}, {0x381f, 0xb0, 0, 0}, {0x3820, 0x00, 0, 0}, {0x3821, 0x00, 0, 0}, {0x3824, 0x11, 0, 0}, {0x3a08, 0x1b, 0, 0}, {0x3a09, 0xc0, 0, 0}, {0x3a0a, 0x17, 0, 0}, {0x3a0b, 0x20, 0, 0}, {0x3a0d, 0x02, 0, 0}, {0x3a0e, 0x01, 0, 0}, {0x401c, 0x04, 0, 0}, {0x5682, 0x05, 0, 0}, {0x5683, 0x00, 0, 0}, {0x5686, 0x02, 0, 0}, {0x5687, 0xcc, 0, 0}, {0x5001, 0x7f, 0, 0}, {0x589b, 0x06, 0, 0}, {0x589a, 0xc5, 0, 0}, {0x3503, 0x00, 0, 0}, {0x3010, 0x10, 0, 0}, {0x460c, 0x20, 0, 0}, {0x460b, 0x37, 0, 0}, {0x471c, 0xd0, 0, 0}, {0x471d, 0x05, 0, 0}, {0x3815, 0x01, 0, 0}, {0x3818, 0x00, 0x08, 0}, {0x501f, 0x00, 0, 0}, {0x4300, 0x30, 0, 0}, {0x3002, 0x1c, 0, 0}, {0x3819, 0x80, 0, 0}, {0x5002, 0xe0, 0, 0}, }; static struct reg_value ov5642_setting_15fps_1080P_1920_1080[] = { {0x3103, 0x93, 0, 0}, {0x3008, 0x82, 0, 0}, {0x3017, 0x7f, 0, 0}, {0x3018, 0xfc, 0, 0}, {0x3810, 0xc2, 0, 0}, {0x3615, 0xf0, 0, 0}, {0x3000, 0x00, 0, 0}, {0x3001, 0x00, 0, 0}, {0x3002, 0x00, 0, 0}, {0x3003, 0x00, 0, 0}, {0x3004, 0xff, 0, 0}, {0x3030, 0x2b, 0, 0}, {0x3011, 0x08, 0, 0}, {0x3010, 0x10, 0, 0}, {0x3604, 0x60, 0, 0}, {0x3622, 0x60, 0, 0}, {0x3621, 0x09, 0, 0}, {0x3709, 0x00, 0, 0}, {0x4000, 0x21, 0, 0}, {0x401d, 0x22, 0, 0}, {0x3600, 0x54, 0, 0}, {0x3605, 0x04, 0, 0}, {0x3606, 0x3f, 0, 0}, {0x3c01, 0x80, 0, 0}, {0x300d, 0x22, 0, 0}, {0x3623, 0x22, 0, 0}, {0x5000, 0x4f, 0, 0}, {0x5020, 0x04, 0, 0}, {0x5181, 0x79, 0, 0}, {0x5182, 0x00, 0, 0}, {0x5185, 0x22, 0, 0}, {0x5197, 0x01, 0, 0}, {0x5500, 0x0a, 0, 0}, {0x5504, 0x00, 0, 0}, {0x5505, 0x7f, 0, 0}, {0x5080, 0x08, 0, 0}, {0x300e, 0x18, 0, 0}, {0x4610, 0x00, 0, 0}, {0x471d, 0x05, 0, 0}, {0x4708, 0x06, 0, 0}, {0x370c, 0xa0, 0, 0}, {0x3808, 0x0a, 0, 0}, {0x3809, 0x20, 0, 0}, {0x380a, 0x07, 0, 0}, {0x380b, 0x98, 0, 0}, {0x380c, 0x0c, 0, 0}, {0x380d, 0x80, 0, 0}, {0x380e, 0x07, 0, 0}, {0x380f, 0xd0, 0, 0}, {0x5687, 0x94, 0, 0}, {0x501f, 0x00, 0, 0}, {0x5000, 0x4f, 0, 0}, {0x5001, 0xcf, 0, 0}, {0x4300, 0x30, 0, 0}, {0x4300, 0x30, 0, 0}, {0x460b, 0x35, 0, 0}, {0x471d, 0x00, 0, 0}, {0x3002, 0x0c, 0, 0}, {0x3002, 0x00, 0, 0}, {0x4713, 0x03, 0, 0}, {0x471c, 0x50, 0, 0}, {0x4721, 0x02, 0, 0}, {0x4402, 0x90, 0, 0}, {0x460c, 0x22, 0, 0}, {0x3815, 0x44, 0, 0}, {0x3503, 0x07, 0, 0}, {0x3501, 0x73, 0, 0}, {0x3502, 0x80, 0, 0}, {0x350b, 0x00, 0, 0}, {0x3818, 0xc8, 0, 0}, {0x3801, 0x88, 0, 0}, {0x3824, 0x11, 0, 0}, {0x3a00, 0x78, 0, 0}, {0x3a1a, 0x04, 0, 0}, {0x3a13, 0x30, 0, 0}, {0x3a18, 0x00, 0, 0}, {0x3a19, 0x7c, 0, 0}, {0x3a08, 0x12, 0, 0}, {0x3a09, 0xc0, 0, 0}, {0x3a0a, 0x0f, 0, 0}, {0x3a0b, 0xa0, 0, 0}, {0x350c, 0x07, 0, 0}, {0x350d, 0xd0, 0, 0}, {0x3a0d, 0x08, 0, 0}, {0x3a0e, 0x06, 0, 0}, {0x3500, 0x00, 0, 0}, {0x3501, 0x00, 0, 0}, {0x3502, 0x00, 0, 0}, {0x350a, 0x00, 0, 0}, {0x350b, 0x00, 0, 0}, {0x3503, 0x00, 0, 0}, {0x3a0f, 0x3c, 0, 0}, {0x3a10, 0x32, 0, 0}, {0x3a1b, 0x3c, 0, 0}, {0x3a1e, 0x32, 0, 0}, {0x3a11, 0x80, 0, 0}, {0x3a1f, 0x20, 0, 0}, {0x3030, 0x2b, 0, 0}, {0x3a02, 0x00, 0, 0}, {0x3a03, 0x7d, 0, 0}, {0x3a04, 0x00, 0, 0}, {0x3a14, 0x00, 0, 0}, {0x3a15, 0x7d, 0, 0}, {0x3a16, 0x00, 0, 0}, {0x3a00, 0x78, 0, 0}, {0x3a08, 0x09, 0, 0}, {0x3a09, 0x60, 0, 0}, {0x3a0a, 0x07, 0, 0}, {0x3a0b, 0xd0, 0, 0}, {0x3a0d, 0x10, 0, 0}, {0x3a0e, 0x0d, 0, 0}, {0x4407, 0x04, 0, 0}, {0x5193, 0x70, 0, 0}, {0x589b, 0x00, 0, 0}, {0x589a, 0xc0, 0, 0}, {0x401e, 0x20, 0, 0}, {0x4001, 0x42, 0, 0}, {0x401c, 0x06, 0, 0}, {0x3825, 0xac, 0, 0}, {0x3827, 0x0c, 0, 0}, {0x528a, 0x01, 0, 0}, {0x528b, 0x04, 0, 0}, {0x528c, 0x08, 0, 0}, {0x528d, 0x10, 0, 0}, {0x528e, 0x20, 0, 0}, {0x528f, 0x28, 0, 0}, {0x5290, 0x30, 0, 0}, {0x5292, 0x00, 0, 0}, {0x5293, 0x01, 0, 0}, {0x5294, 0x00, 0, 0}, {0x5295, 0x04, 0, 0}, {0x5296, 0x00, 0, 0}, {0x5297, 0x08, 0, 0}, {0x5298, 0x00, 0, 0}, {0x5299, 0x10, 0, 0}, {0x529a, 0x00, 0, 0}, {0x529b, 0x20, 0, 0}, {0x529c, 0x00, 0, 0}, {0x529d, 0x28, 0, 0}, {0x529e, 0x00, 0, 0}, {0x529f, 0x30, 0, 0}, {0x5282, 0x00, 0, 0}, {0x5300, 0x00, 0, 0}, {0x5301, 0x20, 0, 0}, {0x5302, 0x00, 0, 0}, {0x5303, 0x7c, 0, 0}, {0x530c, 0x00, 0, 0}, {0x530d, 0x0c, 0, 0}, {0x530e, 0x20, 0, 0}, {0x530f, 0x80, 0, 0}, {0x5310, 0x20, 0, 0}, {0x5311, 0x80, 0, 0}, {0x5308, 0x20, 0, 0}, {0x5309, 0x40, 0, 0}, {0x5304, 0x00, 0, 0}, {0x5305, 0x30, 0, 0}, {0x5306, 0x00, 0, 0}, {0x5307, 0x80, 0, 0}, {0x5314, 0x08, 0, 0}, {0x5315, 0x20, 0, 0}, {0x5319, 0x30, 0, 0}, {0x5316, 0x10, 0, 0}, {0x5317, 0x00, 0, 0}, {0x5318, 0x02, 0, 0}, {0x5380, 0x01, 0, 0}, {0x5381, 0x00, 0, 0}, {0x5382, 0x00, 0, 0}, {0x5383, 0x4e, 0, 0}, {0x5384, 0x00, 0, 0}, {0x5385, 0x0f, 0, 0}, {0x5386, 0x00, 0, 0}, {0x5387, 0x00, 0, 0}, {0x5388, 0x01, 0, 0}, {0x5389, 0x15, 0, 0}, {0x538a, 0x00, 0, 0}, {0x538b, 0x31, 0, 0}, {0x538c, 0x00, 0, 0}, {0x538d, 0x00, 0, 0}, {0x538e, 0x00, 0, 0}, {0x538f, 0x0f, 0, 0}, {0x5390, 0x00, 0, 0}, {0x5391, 0xab, 0, 0}, {0x5392, 0x00, 0, 0}, {0x5393, 0xa2, 0, 0}, {0x5394, 0x08, 0, 0}, {0x5480, 0x14, 0, 0}, {0x5481, 0x21, 0, 0}, {0x5482, 0x36, 0, 0}, {0x5483, 0x57, 0, 0}, {0x5484, 0x65, 0, 0}, {0x5485, 0x71, 0, 0}, {0x5486, 0x7d, 0, 0}, {0x5487, 0x87, 0, 0}, {0x5488, 0x91, 0, 0}, {0x5489, 0x9a, 0, 0}, {0x548a, 0xaa, 0, 0}, {0x548b, 0xb8, 0, 0}, {0x548c, 0xcd, 0, 0}, {0x548d, 0xdd, 0, 0}, {0x548e, 0xea, 0, 0}, {0x548f, 0x1d, 0, 0}, {0x5490, 0x05, 0, 0}, {0x5491, 0x00, 0, 0}, {0x5492, 0x04, 0, 0}, {0x5493, 0x20, 0, 0}, {0x5494, 0x03, 0, 0}, {0x5495, 0x60, 0, 0}, {0x5496, 0x02, 0, 0}, {0x5497, 0xb8, 0, 0}, {0x5498, 0x02, 0, 0}, {0x5499, 0x86, 0, 0}, {0x549a, 0x02, 0, 0}, {0x549b, 0x5b, 0, 0}, {0x549c, 0x02, 0, 0}, {0x549d, 0x3b, 0, 0}, {0x549e, 0x02, 0, 0}, {0x549f, 0x1c, 0, 0}, {0x54a0, 0x02, 0, 0}, {0x54a1, 0x04, 0, 0}, {0x54a2, 0x01, 0, 0}, {0x54a3, 0xed, 0, 0}, {0x54a4, 0x01, 0, 0}, {0x54a5, 0xc5, 0, 0}, {0x54a6, 0x01, 0, 0}, {0x54a7, 0xa5, 0, 0}, {0x54a8, 0x01, 0, 0}, {0x54a9, 0x6c, 0, 0}, {0x54aa, 0x01, 0, 0}, {0x54ab, 0x41, 0, 0}, {0x54ac, 0x01, 0, 0}, {0x54ad, 0x20, 0, 0}, {0x54ae, 0x00, 0, 0}, {0x54af, 0x16, 0, 0}, {0x54b0, 0x01, 0, 0}, {0x54b1, 0x20, 0, 0}, {0x54b2, 0x00, 0, 0}, {0x54b3, 0x10, 0, 0}, {0x54b4, 0x00, 0, 0}, {0x54b5, 0xf0, 0, 0}, {0x54b6, 0x00, 0, 0}, {0x54b7, 0xdf, 0, 0}, {0x5402, 0x3f, 0, 0}, {0x5403, 0x00, 0, 0}, {0x3406, 0x00, 0, 0}, {0x5180, 0xff, 0, 0}, {0x5181, 0x52, 0, 0}, {0x5182, 0x11, 0, 0}, {0x5183, 0x14, 0, 0}, {0x5184, 0x25, 0, 0}, {0x5185, 0x24, 0, 0}, {0x5186, 0x06, 0, 0}, {0x5187, 0x08, 0, 0}, {0x5188, 0x08, 0, 0}, {0x5189, 0x7c, 0, 0}, {0x518a, 0x60, 0, 0}, {0x518b, 0xb2, 0, 0}, {0x518c, 0xb2, 0, 0}, {0x518d, 0x44, 0, 0}, {0x518e, 0x3d, 0, 0}, {0x518f, 0x58, 0, 0}, {0x5190, 0x46, 0, 0}, {0x5191, 0xf8, 0, 0}, {0x5192, 0x04, 0, 0}, {0x5193, 0x70, 0, 0}, {0x5194, 0xf0, 0, 0}, {0x5195, 0xf0, 0, 0}, {0x5196, 0x03, 0, 0}, {0x5197, 0x01, 0, 0}, {0x5198, 0x04, 0, 0}, {0x5199, 0x12, 0, 0}, {0x519a, 0x04, 0, 0}, {0x519b, 0x00, 0, 0}, {0x519c, 0x06, 0, 0}, {0x519d, 0x82, 0, 0}, {0x519e, 0x00, 0, 0}, {0x5025, 0x80, 0, 0}, {0x3a0f, 0x38, 0, 0}, {0x3a10, 0x30, 0, 0}, {0x3a1b, 0x3a, 0, 0}, {0x3a1e, 0x2e, 0, 0}, {0x3a11, 0x60, 0, 0}, {0x3a1f, 0x10, 0, 0}, {0x5688, 0xa6, 0, 0}, {0x5689, 0x6a, 0, 0}, {0x568a, 0xea, 0, 0}, {0x568b, 0xae, 0, 0}, {0x568c, 0xa6, 0, 0}, {0x568d, 0x6a, 0, 0}, {0x568e, 0x62, 0, 0}, {0x568f, 0x26, 0, 0}, {0x5583, 0x40, 0, 0}, {0x5584, 0x40, 0, 0}, {0x5580, 0x02, 0, 0}, {0x5000, 0xcf, 0, 0}, {0x5800, 0x27, 0, 0}, {0x5801, 0x19, 0, 0}, {0x5802, 0x12, 0, 0}, {0x5803, 0x0f, 0, 0}, {0x5804, 0x10, 0, 0}, {0x5805, 0x15, 0, 0}, {0x5806, 0x1e, 0, 0}, {0x5807, 0x2f, 0, 0}, {0x5808, 0x15, 0, 0}, {0x5809, 0x0d, 0, 0}, {0x580a, 0x0a, 0, 0}, {0x580b, 0x09, 0, 0}, {0x580c, 0x0a, 0, 0}, {0x580d, 0x0c, 0, 0}, {0x580e, 0x12, 0, 0}, {0x580f, 0x19, 0, 0}, {0x5810, 0x0b, 0, 0}, {0x5811, 0x07, 0, 0}, {0x5812, 0x04, 0, 0}, {0x5813, 0x03, 0, 0}, {0x5814, 0x03, 0, 0}, {0x5815, 0x06, 0, 0}, {0x5816, 0x0a, 0, 0}, {0x5817, 0x0f, 0, 0}, {0x5818, 0x0a, 0, 0}, {0x5819, 0x05, 0, 0}, {0x581a, 0x01, 0, 0}, {0x581b, 0x00, 0, 0}, {0x581c, 0x00, 0, 0}, {0x581d, 0x03, 0, 0}, {0x581e, 0x08, 0, 0}, {0x581f, 0x0c, 0, 0}, {0x5820, 0x0a, 0, 0}, {0x5821, 0x05, 0, 0}, {0x5822, 0x01, 0, 0}, {0x5823, 0x00, 0, 0}, {0x5824, 0x00, 0, 0}, {0x5825, 0x03, 0, 0}, {0x5826, 0x08, 0, 0}, {0x5827, 0x0c, 0, 0}, {0x5828, 0x0e, 0, 0}, {0x5829, 0x08, 0, 0}, {0x582a, 0x06, 0, 0}, {0x582b, 0x04, 0, 0}, {0x582c, 0x05, 0, 0}, {0x582d, 0x07, 0, 0}, {0x582e, 0x0b, 0, 0}, {0x582f, 0x12, 0, 0}, {0x5830, 0x18, 0, 0}, {0x5831, 0x10, 0, 0}, {0x5832, 0x0c, 0, 0}, {0x5833, 0x0a, 0, 0}, {0x5834, 0x0b, 0, 0}, {0x5835, 0x0e, 0, 0}, {0x5836, 0x15, 0, 0}, {0x5837, 0x19, 0, 0}, {0x5838, 0x32, 0, 0}, {0x5839, 0x1f, 0, 0}, {0x583a, 0x18, 0, 0}, {0x583b, 0x16, 0, 0}, {0x583c, 0x17, 0, 0}, {0x583d, 0x1e, 0, 0}, {0x583e, 0x26, 0, 0}, {0x583f, 0x53, 0, 0}, {0x5840, 0x10, 0, 0}, {0x5841, 0x0f, 0, 0}, {0x5842, 0x0d, 0, 0}, {0x5843, 0x0c, 0, 0}, {0x5844, 0x0e, 0, 0}, {0x5845, 0x09, 0, 0}, {0x5846, 0x11, 0, 0}, {0x5847, 0x10, 0, 0}, {0x5848, 0x10, 0, 0}, {0x5849, 0x10, 0, 0}, {0x584a, 0x10, 0, 0}, {0x584b, 0x0e, 0, 0}, {0x584c, 0x10, 0, 0}, {0x584d, 0x10, 0, 0}, {0x584e, 0x11, 0, 0}, {0x584f, 0x10, 0, 0}, {0x5850, 0x0f, 0, 0}, {0x5851, 0x0c, 0, 0}, {0x5852, 0x0f, 0, 0}, {0x5853, 0x10, 0, 0}, {0x5854, 0x10, 0, 0}, {0x5855, 0x0f, 0, 0}, {0x5856, 0x0e, 0, 0}, {0x5857, 0x0b, 0, 0}, {0x5858, 0x10, 0, 0}, {0x5859, 0x0d, 0, 0}, {0x585a, 0x0d, 0, 0}, {0x585b, 0x0c, 0, 0}, {0x585c, 0x0c, 0, 0}, {0x585d, 0x0c, 0, 0}, {0x585e, 0x0b, 0, 0}, {0x585f, 0x0c, 0, 0}, {0x5860, 0x0c, 0, 0}, {0x5861, 0x0c, 0, 0}, {0x5862, 0x0d, 0, 0}, {0x5863, 0x08, 0, 0}, {0x5864, 0x11, 0, 0}, {0x5865, 0x18, 0, 0}, {0x5866, 0x18, 0, 0}, {0x5867, 0x19, 0, 0}, {0x5868, 0x17, 0, 0}, {0x5869, 0x19, 0, 0}, {0x586a, 0x16, 0, 0}, {0x586b, 0x13, 0, 0}, {0x586c, 0x13, 0, 0}, {0x586d, 0x12, 0, 0}, {0x586e, 0x13, 0, 0}, {0x586f, 0x16, 0, 0}, {0x5870, 0x14, 0, 0}, {0x5871, 0x12, 0, 0}, {0x5872, 0x10, 0, 0}, {0x5873, 0x11, 0, 0}, {0x5874, 0x11, 0, 0}, {0x5875, 0x16, 0, 0}, {0x5876, 0x14, 0, 0}, {0x5877, 0x11, 0, 0}, {0x5878, 0x10, 0, 0}, {0x5879, 0x0f, 0, 0}, {0x587a, 0x10, 0, 0}, {0x587b, 0x14, 0, 0}, {0x587c, 0x13, 0, 0}, {0x587d, 0x12, 0, 0}, {0x587e, 0x11, 0, 0}, {0x587f, 0x11, 0, 0}, {0x5880, 0x12, 0, 0}, {0x5881, 0x15, 0, 0}, {0x5882, 0x14, 0, 0}, {0x5883, 0x15, 0, 0}, {0x5884, 0x15, 0, 0}, {0x5885, 0x15, 0, 0}, {0x5886, 0x13, 0, 0}, {0x5887, 0x17, 0, 0}, {0x3710, 0x10, 0, 0}, {0x3632, 0x51, 0, 0}, {0x3702, 0x10, 0, 0}, {0x3703, 0xb2, 0, 0}, {0x3704, 0x18, 0, 0}, {0x370b, 0x40, 0, 0}, {0x370d, 0x03, 0, 0}, {0x3631, 0x01, 0, 0}, {0x3632, 0x52, 0, 0}, {0x3606, 0x24, 0, 0}, {0x3620, 0x96, 0, 0}, {0x5785, 0x07, 0, 0}, {0x3a13, 0x30, 0, 0}, {0x3600, 0x52, 0, 0}, {0x3604, 0x48, 0, 0}, {0x3606, 0x1b, 0, 0}, {0x370d, 0x0b, 0, 0}, {0x370f, 0xc0, 0, 0}, {0x3709, 0x01, 0, 0}, {0x3823, 0x00, 0, 0}, {0x5007, 0x00, 0, 0}, {0x5009, 0x00, 0, 0}, {0x5011, 0x00, 0, 0}, {0x5013, 0x00, 0, 0}, {0x519e, 0x00, 0, 0}, {0x5086, 0x00, 0, 0}, {0x5087, 0x00, 0, 0}, {0x5088, 0x00, 0, 0}, {0x5089, 0x00, 0, 0}, {0x302b, 0x00, 0, 0}, {0x3503, 0x07, 0, 0}, {0x3011, 0x07, 0, 0}, {0x350c, 0x04, 0, 0}, {0x350d, 0x58, 0, 0}, {0x3801, 0x8a, 0, 0}, {0x3803, 0x0a, 0, 0}, {0x3804, 0x07, 0, 0}, {0x3805, 0x80, 0, 0}, {0x3806, 0x04, 0, 0}, {0x3807, 0x39, 0, 0}, {0x3808, 0x07, 0, 0}, {0x3809, 0x80, 0, 0}, {0x380a, 0x04, 0, 0}, {0x380b, 0x38, 0, 0}, {0x380c, 0x09, 0, 0}, {0x380d, 0xd6, 0, 0}, {0x380e, 0x04, 0, 0}, {0x380f, 0x58, 0, 0}, {0x381c, 0x11, 0, 0}, {0x381d, 0xba, 0, 0}, {0x381e, 0x04, 0, 0}, {0x381f, 0x48, 0, 0}, {0x3820, 0x04, 0, 0}, {0x3821, 0x18, 0, 0}, {0x3a08, 0x14, 0, 0}, {0x3a09, 0xe0, 0, 0}, {0x3a0a, 0x11, 0, 0}, {0x3a0b, 0x60, 0, 0}, {0x3a0d, 0x04, 0, 0}, {0x3a0e, 0x03, 0, 0}, {0x5682, 0x07, 0, 0}, {0x5683, 0x60, 0, 0}, {0x5686, 0x04, 0, 0}, {0x5687, 0x1c, 0, 0}, {0x5001, 0x7f, 0, 0}, {0x3503, 0x00, 0, 0}, {0x3010, 0x10, 0, 0}, {0x460c, 0x20, 0, 0}, {0x460b, 0x37, 0, 0}, {0x471c, 0xd0, 0, 0}, {0x471d, 0x05, 0, 0}, {0x3815, 0x01, 0, 0}, {0x3818, 0x00, 0x08, 0}, {0x501f, 0x00, 0, 0}, {0x4300, 0x30, 0, 0}, {0x3002, 0x1c, 0, 0}, {0x3819, 0x80, 0, 0}, {0x5002, 0xe0, 0, 0}, }; static struct reg_value ov5642_setting_15fps_QVGA_320_240[] = { {0x3103, 0x93, 0, 0}, {0x3008, 0x82, 0, 0}, {0x3017, 0x7f, 0, 0}, {0x3018, 0xfc, 0, 0}, {0x3810, 0xc2, 0, 0}, {0x3615, 0xf0, 0, 0}, {0x3000, 0x00, 0, 0}, {0x3001, 0x00, 0, 0}, {0x3002, 0x5c, 0, 0}, {0x3003, 0x00, 0, 0}, {0x3004, 0xff, 0, 0}, {0x3005, 0xff, 0, 0}, {0x3006, 0x43, 0, 0}, {0x3007, 0x37, 0, 0}, {0x3011, 0x08, 0, 0}, {0x3010, 0x10, 0, 0}, {0x460c, 0x22, 0, 0}, {0x3815, 0x04, 0, 0}, {0x370c, 0xa0, 0, 0}, {0x3602, 0xfc, 0, 0}, {0x3612, 0xff, 0, 0}, {0x3634, 0xc0, 0, 0}, {0x3613, 0x00, 0, 0}, {0x3605, 0x7c, 0, 0}, {0x3621, 0x09, 0, 0}, {0x3622, 0x60, 0, 0}, {0x3604, 0x40, 0, 0}, {0x3603, 0xa7, 0, 0}, {0x3603, 0x27, 0, 0}, {0x4000, 0x21, 0, 0}, {0x401d, 0x22, 0, 0}, {0x3600, 0x54, 0, 0}, {0x3605, 0x04, 0, 0}, {0x3606, 0x3f, 0, 0}, {0x3c01, 0x80, 0, 0}, {0x5000, 0x4f, 0, 0}, {0x5020, 0x04, 0, 0}, {0x5181, 0x79, 0, 0}, {0x5182, 0x00, 0, 0}, {0x5185, 0x22, 0, 0}, {0x5197, 0x01, 0, 0}, {0x5001, 0xff, 0, 0}, {0x5500, 0x0a, 0, 0}, {0x5504, 0x00, 0, 0}, {0x5505, 0x7f, 0, 0}, {0x5080, 0x08, 0, 0}, {0x300e, 0x18, 0, 0}, {0x4610, 0x00, 0, 0}, {0x471d, 0x05, 0, 0}, {0x4708, 0x06, 0, 0}, {0x3808, 0x02, 0, 0}, {0x3809, 0x80, 0, 0}, {0x380a, 0x01, 0, 0}, {0x380b, 0xe0, 0, 0}, {0x380e, 0x07, 0, 0}, {0x380f, 0xd0, 0, 0}, {0x501f, 0x00, 0, 0}, {0x5000, 0x4f, 0, 0}, {0x4300, 0x30, 0, 0}, {0x3503, 0x07, 0, 0}, {0x3501, 0x73, 0, 0}, {0x3502, 0x80, 0, 0}, {0x350b, 0x00, 0, 0}, {0x3503, 0x07, 0, 0}, {0x3824, 0x11, 0, 0}, {0x3501, 0x1e, 0, 0}, {0x3502, 0x80, 0, 0}, {0x350b, 0x7f, 0, 0}, {0x380c, 0x0c, 0, 0}, {0x380d, 0x80, 0, 0}, {0x380e, 0x03, 0, 0}, {0x380f, 0xe8, 0, 0}, {0x3a0d, 0x04, 0, 0}, {0x3a0e, 0x03, 0, 0}, {0x3818, 0xc1, 0, 0}, {0x3705, 0xdb, 0, 0}, {0x370a, 0x81, 0, 0}, {0x3801, 0x80, 0, 0}, {0x3621, 0x87, 0, 0}, {0x3801, 0x50, 0, 0}, {0x3803, 0x08, 0, 0}, {0x3827, 0x08, 0, 0}, {0x3810, 0x40, 0, 0}, {0x3804, 0x05, 0, 0}, {0x3805, 0x00, 0, 0}, {0x5682, 0x05, 0, 0}, {0x5683, 0x00, 0, 0}, {0x3806, 0x03, 0, 0}, {0x3807, 0xc0, 0, 0}, {0x5686, 0x03, 0, 0}, {0x5687, 0xbc, 0, 0}, {0x3a00, 0x78, 0, 0}, {0x3a1a, 0x05, 0, 0}, {0x3a13, 0x30, 0, 0}, {0x3a18, 0x00, 0, 0}, {0x3a19, 0x7c, 0, 0}, {0x3a08, 0x12, 0, 0}, {0x3a09, 0xc0, 0, 0}, {0x3a0a, 0x0f, 0, 0}, {0x3a0b, 0xa0, 0, 0}, {0x350c, 0x07, 0, 0}, {0x350d, 0xd0, 0, 0}, {0x3500, 0x00, 0, 0}, {0x3501, 0x00, 0, 0}, {0x3502, 0x00, 0, 0}, {0x350a, 0x00, 0, 0}, {0x350b, 0x00, 0, 0}, {0x3503, 0x00, 0, 0}, {0x528a, 0x02, 0, 0}, {0x528b, 0x04, 0, 0}, {0x528c, 0x08, 0, 0}, {0x528d, 0x08, 0, 0}, {0x528e, 0x08, 0, 0}, {0x528f, 0x10, 0, 0}, {0x5290, 0x10, 0, 0}, {0x5292, 0x00, 0, 0}, {0x5293, 0x02, 0, 0}, {0x5294, 0x00, 0, 0}, {0x5295, 0x02, 0, 0}, {0x5296, 0x00, 0, 0}, {0x5297, 0x02, 0, 0}, {0x5298, 0x00, 0, 0}, {0x5299, 0x02, 0, 0}, {0x529a, 0x00, 0, 0}, {0x529b, 0x02, 0, 0}, {0x529c, 0x00, 0, 0}, {0x529d, 0x02, 0, 0}, {0x529e, 0x00, 0, 0}, {0x529f, 0x02, 0, 0}, {0x3a0f, 0x3c, 0, 0}, {0x3a10, 0x30, 0, 0}, {0x3a1b, 0x3c, 0, 0}, {0x3a1e, 0x30, 0, 0}, {0x3a11, 0x70, 0, 0}, {0x3a1f, 0x10, 0, 0}, {0x3030, 0x2b, 0, 0}, {0x3a02, 0x00, 0, 0}, {0x3a03, 0x7d, 0, 0}, {0x3a04, 0x00, 0, 0}, {0x3a14, 0x00, 0, 0}, {0x3a15, 0x7d, 0, 0}, {0x3a16, 0x00, 0, 0}, {0x3a00, 0x78, 0, 0}, {0x3a08, 0x09, 0, 0}, {0x3a09, 0x60, 0, 0}, {0x3a0a, 0x07, 0, 0}, {0x3a0b, 0xd0, 0, 0}, {0x3a0d, 0x08, 0, 0}, {0x3a0e, 0x06, 0, 0}, {0x5193, 0x70, 0, 0}, {0x589b, 0x04, 0, 0}, {0x589a, 0xc5, 0, 0}, {0x401e, 0x20, 0, 0}, {0x4001, 0x42, 0, 0}, {0x401c, 0x04, 0, 0}, {0x528a, 0x01, 0, 0}, {0x528b, 0x04, 0, 0}, {0x528c, 0x08, 0, 0}, {0x528d, 0x10, 0, 0}, {0x528e, 0x20, 0, 0}, {0x528f, 0x28, 0, 0}, {0x5290, 0x30, 0, 0}, {0x5292, 0x00, 0, 0}, {0x5293, 0x01, 0, 0}, {0x5294, 0x00, 0, 0}, {0x5295, 0x04, 0, 0}, {0x5296, 0x00, 0, 0}, {0x5297, 0x08, 0, 0}, {0x5298, 0x00, 0, 0}, {0x5299, 0x10, 0, 0}, {0x529a, 0x00, 0, 0}, {0x529b, 0x20, 0, 0}, {0x529c, 0x00, 0, 0}, {0x529d, 0x28, 0, 0}, {0x529e, 0x00, 0, 0}, {0x529f, 0x30, 0, 0}, {0x5282, 0x00, 0, 0}, {0x5300, 0x00, 0, 0}, {0x5301, 0x20, 0, 0}, {0x5302, 0x00, 0, 0}, {0x5303, 0x7c, 0, 0}, {0x530c, 0x00, 0, 0}, {0x530d, 0x0c, 0, 0}, {0x530e, 0x20, 0, 0}, {0x530f, 0x80, 0, 0}, {0x5310, 0x20, 0, 0}, {0x5311, 0x80, 0, 0}, {0x5308, 0x20, 0, 0}, {0x5309, 0x40, 0, 0}, {0x5304, 0x00, 0, 0}, {0x5305, 0x30, 0, 0}, {0x5306, 0x00, 0, 0}, {0x5307, 0x80, 0, 0}, {0x5314, 0x08, 0, 0}, {0x5315, 0x20, 0, 0}, {0x5319, 0x30, 0, 0}, {0x5316, 0x10, 0, 0}, {0x5317, 0x00, 0, 0}, {0x5318, 0x02, 0, 0}, {0x5380, 0x01, 0, 0}, {0x5381, 0x00, 0, 0}, {0x5382, 0x00, 0, 0}, {0x5383, 0x4e, 0, 0}, {0x5384, 0x00, 0, 0}, {0x5385, 0x0f, 0, 0}, {0x5386, 0x00, 0, 0}, {0x5387, 0x00, 0, 0}, {0x5388, 0x01, 0, 0}, {0x5389, 0x15, 0, 0}, {0x538a, 0x00, 0, 0}, {0x538b, 0x31, 0, 0}, {0x538c, 0x00, 0, 0}, {0x538d, 0x00, 0, 0}, {0x538e, 0x00, 0, 0}, {0x538f, 0x0f, 0, 0}, {0x5390, 0x00, 0, 0}, {0x5391, 0xab, 0, 0}, {0x5392, 0x00, 0, 0}, {0x5393, 0xa2, 0, 0}, {0x5394, 0x08, 0, 0}, {0x5480, 0x14, 0, 0}, {0x5481, 0x21, 0, 0}, {0x5482, 0x36, 0, 0}, {0x5483, 0x57, 0, 0}, {0x5484, 0x65, 0, 0}, {0x5485, 0x71, 0, 0}, {0x5486, 0x7d, 0, 0}, {0x5487, 0x87, 0, 0}, {0x5488, 0x91, 0, 0}, {0x5489, 0x9a, 0, 0}, {0x548a, 0xaa, 0, 0}, {0x548b, 0xb8, 0, 0}, {0x548c, 0xcd, 0, 0}, {0x548d, 0xdd, 0, 0}, {0x548e, 0xea, 0, 0}, {0x548f, 0x1d, 0, 0}, {0x5490, 0x05, 0, 0}, {0x5491, 0x00, 0, 0}, {0x5492, 0x04, 0, 0}, {0x5493, 0x20, 0, 0}, {0x5494, 0x03, 0, 0}, {0x5495, 0x60, 0, 0}, {0x5496, 0x02, 0, 0}, {0x5497, 0xb8, 0, 0}, {0x5498, 0x02, 0, 0}, {0x5499, 0x86, 0, 0}, {0x549a, 0x02, 0, 0}, {0x549b, 0x5b, 0, 0}, {0x549c, 0x02, 0, 0}, {0x549d, 0x3b, 0, 0}, {0x549e, 0x02, 0, 0}, {0x549f, 0x1c, 0, 0}, {0x54a0, 0x02, 0, 0}, {0x54a1, 0x04, 0, 0}, {0x54a2, 0x01, 0, 0}, {0x54a3, 0xed, 0, 0}, {0x54a4, 0x01, 0, 0}, {0x54a5, 0xc5, 0, 0}, {0x54a6, 0x01, 0, 0}, {0x54a7, 0xa5, 0, 0}, {0x54a8, 0x01, 0, 0}, {0x54a9, 0x6c, 0, 0}, {0x54aa, 0x01, 0, 0}, {0x54ab, 0x41, 0, 0}, {0x54ac, 0x01, 0, 0}, {0x54ad, 0x20, 0, 0}, {0x54ae, 0x00, 0, 0}, {0x54af, 0x16, 0, 0}, {0x54b0, 0x01, 0, 0}, {0x54b1, 0x20, 0, 0}, {0x54b2, 0x00, 0, 0}, {0x54b3, 0x10, 0, 0}, {0x54b4, 0x00, 0, 0}, {0x54b5, 0xf0, 0, 0}, {0x54b6, 0x00, 0, 0}, {0x54b7, 0xdf, 0, 0}, {0x5402, 0x3f, 0, 0}, {0x5403, 0x00, 0, 0}, {0x3406, 0x00, 0, 0}, {0x5180, 0xff, 0, 0}, {0x5181, 0x52, 0, 0}, {0x5182, 0x11, 0, 0}, {0x5183, 0x14, 0, 0}, {0x5184, 0x25, 0, 0}, {0x5185, 0x24, 0, 0}, {0x5186, 0x06, 0, 0}, {0x5187, 0x08, 0, 0}, {0x5188, 0x08, 0, 0}, {0x5189, 0x7c, 0, 0}, {0x518a, 0x60, 0, 0}, {0x518b, 0xb2, 0, 0}, {0x518c, 0xb2, 0, 0}, {0x518d, 0x44, 0, 0}, {0x518e, 0x3d, 0, 0}, {0x518f, 0x58, 0, 0}, {0x5190, 0x46, 0, 0}, {0x5191, 0xf8, 0, 0}, {0x5192, 0x04, 0, 0}, {0x5193, 0x70, 0, 0}, {0x5194, 0xf0, 0, 0}, {0x5195, 0xf0, 0, 0}, {0x5196, 0x03, 0, 0}, {0x5197, 0x01, 0, 0}, {0x5198, 0x04, 0, 0}, {0x5199, 0x12, 0, 0}, {0x519a, 0x04, 0, 0}, {0x519b, 0x00, 0, 0}, {0x519c, 0x06, 0, 0}, {0x519d, 0x82, 0, 0}, {0x519e, 0x00, 0, 0}, {0x5025, 0x80, 0, 0}, {0x3a0f, 0x38, 0, 0}, {0x3a10, 0x30, 0, 0}, {0x3a1b, 0x3a, 0, 0}, {0x3a1e, 0x2e, 0, 0}, {0x3a11, 0x60, 0, 0}, {0x3a1f, 0x10, 0, 0}, {0x5688, 0xa6, 0, 0}, {0x5689, 0x6a, 0, 0}, {0x568a, 0xea, 0, 0}, {0x568b, 0xae, 0, 0}, {0x568c, 0xa6, 0, 0}, {0x568d, 0x6a, 0, 0}, {0x568e, 0x62, 0, 0}, {0x568f, 0x26, 0, 0}, {0x5583, 0x40, 0, 0}, {0x5584, 0x40, 0, 0}, {0x5580, 0x02, 0, 0}, {0x5000, 0xcf, 0, 0}, {0x5800, 0x27, 0, 0}, {0x5801, 0x19, 0, 0}, {0x5802, 0x12, 0, 0}, {0x5803, 0x0f, 0, 0}, {0x5804, 0x10, 0, 0}, {0x5805, 0x15, 0, 0}, {0x5806, 0x1e, 0, 0}, {0x5807, 0x2f, 0, 0}, {0x5808, 0x15, 0, 0}, {0x5809, 0x0d, 0, 0}, {0x580a, 0x0a, 0, 0}, {0x580b, 0x09, 0, 0}, {0x580c, 0x0a, 0, 0}, {0x580d, 0x0c, 0, 0}, {0x580e, 0x12, 0, 0}, {0x580f, 0x19, 0, 0}, {0x5810, 0x0b, 0, 0}, {0x5811, 0x07, 0, 0}, {0x5812, 0x04, 0, 0}, {0x5813, 0x03, 0, 0}, {0x5814, 0x03, 0, 0}, {0x5815, 0x06, 0, 0}, {0x5816, 0x0a, 0, 0}, {0x5817, 0x0f, 0, 0}, {0x5818, 0x0a, 0, 0}, {0x5819, 0x05, 0, 0}, {0x581a, 0x01, 0, 0}, {0x581b, 0x00, 0, 0}, {0x581c, 0x00, 0, 0}, {0x581d, 0x03, 0, 0}, {0x581e, 0x08, 0, 0}, {0x581f, 0x0c, 0, 0}, {0x5820, 0x0a, 0, 0}, {0x5821, 0x05, 0, 0}, {0x5822, 0x01, 0, 0}, {0x5823, 0x00, 0, 0}, {0x5824, 0x00, 0, 0}, {0x5825, 0x03, 0, 0}, {0x5826, 0x08, 0, 0}, {0x5827, 0x0c, 0, 0}, {0x5828, 0x0e, 0, 0}, {0x5829, 0x08, 0, 0}, {0x582a, 0x06, 0, 0}, {0x582b, 0x04, 0, 0}, {0x582c, 0x05, 0, 0}, {0x582d, 0x07, 0, 0}, {0x582e, 0x0b, 0, 0}, {0x582f, 0x12, 0, 0}, {0x5830, 0x18, 0, 0}, {0x5831, 0x10, 0, 0}, {0x5832, 0x0c, 0, 0}, {0x5833, 0x0a, 0, 0}, {0x5834, 0x0b, 0, 0}, {0x5835, 0x0e, 0, 0}, {0x5836, 0x15, 0, 0}, {0x5837, 0x19, 0, 0}, {0x5838, 0x32, 0, 0}, {0x5839, 0x1f, 0, 0}, {0x583a, 0x18, 0, 0}, {0x583b, 0x16, 0, 0}, {0x583c, 0x17, 0, 0}, {0x583d, 0x1e, 0, 0}, {0x583e, 0x26, 0, 0}, {0x583f, 0x53, 0, 0}, {0x5840, 0x10, 0, 0}, {0x5841, 0x0f, 0, 0}, {0x5842, 0x0d, 0, 0}, {0x5843, 0x0c, 0, 0}, {0x5844, 0x0e, 0, 0}, {0x5845, 0x09, 0, 0}, {0x5846, 0x11, 0, 0}, {0x5847, 0x10, 0, 0}, {0x5848, 0x10, 0, 0}, {0x5849, 0x10, 0, 0}, {0x584a, 0x10, 0, 0}, {0x584b, 0x0e, 0, 0}, {0x584c, 0x10, 0, 0}, {0x584d, 0x10, 0, 0}, {0x584e, 0x11, 0, 0}, {0x584f, 0x10, 0, 0}, {0x5850, 0x0f, 0, 0}, {0x5851, 0x0c, 0, 0}, {0x5852, 0x0f, 0, 0}, {0x5853, 0x10, 0, 0}, {0x5854, 0x10, 0, 0}, {0x5855, 0x0f, 0, 0}, {0x5856, 0x0e, 0, 0}, {0x5857, 0x0b, 0, 0}, {0x5858, 0x10, 0, 0}, {0x5859, 0x0d, 0, 0}, {0x585a, 0x0d, 0, 0}, {0x585b, 0x0c, 0, 0}, {0x585c, 0x0c, 0, 0}, {0x585d, 0x0c, 0, 0}, {0x585e, 0x0b, 0, 0}, {0x585f, 0x0c, 0, 0}, {0x5860, 0x0c, 0, 0}, {0x5861, 0x0c, 0, 0}, {0x5862, 0x0d, 0, 0}, {0x5863, 0x08, 0, 0}, {0x5864, 0x11, 0, 0}, {0x5865, 0x18, 0, 0}, {0x5866, 0x18, 0, 0}, {0x5867, 0x19, 0, 0}, {0x5868, 0x17, 0, 0}, {0x5869, 0x19, 0, 0}, {0x586a, 0x16, 0, 0}, {0x586b, 0x13, 0, 0}, {0x586c, 0x13, 0, 0}, {0x586d, 0x12, 0, 0}, {0x586e, 0x13, 0, 0}, {0x586f, 0x16, 0, 0}, {0x5870, 0x14, 0, 0}, {0x5871, 0x12, 0, 0}, {0x5872, 0x10, 0, 0}, {0x5873, 0x11, 0, 0}, {0x5874, 0x11, 0, 0}, {0x5875, 0x16, 0, 0}, {0x5876, 0x14, 0, 0}, {0x5877, 0x11, 0, 0}, {0x5878, 0x10, 0, 0}, {0x5879, 0x0f, 0, 0}, {0x587a, 0x10, 0, 0}, {0x587b, 0x14, 0, 0}, {0x587c, 0x13, 0, 0}, {0x587d, 0x12, 0, 0}, {0x587e, 0x11, 0, 0}, {0x587f, 0x11, 0, 0}, {0x5880, 0x12, 0, 0}, {0x5881, 0x15, 0, 0}, {0x5882, 0x14, 0, 0}, {0x5883, 0x15, 0, 0}, {0x5884, 0x15, 0, 0}, {0x5885, 0x15, 0, 0}, {0x5886, 0x13, 0, 0}, {0x5887, 0x17, 0, 0}, {0x3710, 0x10, 0, 0}, {0x3632, 0x51, 0, 0}, {0x3702, 0x10, 0, 0}, {0x3703, 0xb2, 0, 0}, {0x3704, 0x18, 0, 0}, {0x370b, 0x40, 0, 0}, {0x370d, 0x03, 0, 0}, {0x3631, 0x01, 0, 0}, {0x3632, 0x52, 0, 0}, {0x3606, 0x24, 0, 0}, {0x3620, 0x96, 0, 0}, {0x5785, 0x07, 0, 0}, {0x3a13, 0x30, 0, 0}, {0x3600, 0x52, 0, 0}, {0x3604, 0x48, 0, 0}, {0x3606, 0x1b, 0, 0}, {0x370d, 0x0b, 0, 0}, {0x370f, 0xc0, 0, 0}, {0x3709, 0x01, 0, 0}, {0x3823, 0x00, 0, 0}, {0x5007, 0x00, 0, 0}, {0x5009, 0x00, 0, 0}, {0x5011, 0x00, 0, 0}, {0x5013, 0x00, 0, 0}, {0x519e, 0x00, 0, 0}, {0x5086, 0x00, 0, 0}, {0x5087, 0x00, 0, 0}, {0x5088, 0x00, 0, 0}, {0x5089, 0x00, 0, 0}, {0x302b, 0x00, 0, 0}, {0x3808, 0x01, 0, 0}, {0x3809, 0x40, 0, 0}, {0x380a, 0x00, 0, 0}, {0x380b, 0xf0, 0, 0}, {0x3a00, 0x78, 0, 0}, }; static struct reg_value ov5642_setting_15fps_NTSC_720_480[] = { {0x3103, 0x93, 0, 0}, {0x3008, 0x82, 0, 0}, {0x3017, 0x7f, 0, 0}, {0x3018, 0xfc, 0, 0}, {0x3810, 0xc2, 0, 0}, {0x3615, 0xf0, 0, 0}, {0x3000, 0x00, 0, 0}, {0x3001, 0x00, 0, 0}, {0x3002, 0x5c, 0, 0}, {0x3003, 0x00, 0, 0}, {0x3004, 0xff, 0, 0}, {0x3005, 0xff, 0, 0}, {0x3006, 0x43, 0, 0}, {0x3007, 0x37, 0, 0}, {0x3011, 0x08, 0, 0}, {0x3010, 0x10, 0, 0}, {0x460c, 0x22, 0, 0}, {0x3815, 0x04, 0, 0}, {0x370c, 0xa0, 0, 0}, {0x3602, 0xfc, 0, 0}, {0x3612, 0xff, 0, 0}, {0x3634, 0xc0, 0, 0}, {0x3613, 0x00, 0, 0}, {0x3605, 0x7c, 0, 0}, {0x3621, 0x09, 0, 0}, {0x3622, 0x60, 0, 0}, {0x3604, 0x40, 0, 0}, {0x3603, 0xa7, 0, 0}, {0x3603, 0x27, 0, 0}, {0x4000, 0x21, 0, 0}, {0x401d, 0x22, 0, 0}, {0x3600, 0x54, 0, 0}, {0x3605, 0x04, 0, 0}, {0x3606, 0x3f, 0, 0}, {0x3c01, 0x80, 0, 0}, {0x5000, 0x4f, 0, 0}, {0x5020, 0x04, 0, 0}, {0x5181, 0x79, 0, 0}, {0x5182, 0x00, 0, 0}, {0x5185, 0x22, 0, 0}, {0x5197, 0x01, 0, 0}, {0x5001, 0xff, 0, 0}, {0x5500, 0x0a, 0, 0}, {0x5504, 0x00, 0, 0}, {0x5505, 0x7f, 0, 0}, {0x5080, 0x08, 0, 0}, {0x300e, 0x18, 0, 0}, {0x4610, 0x00, 0, 0}, {0x471d, 0x05, 0, 0}, {0x4708, 0x06, 0, 0}, {0x3808, 0x02, 0, 0}, {0x3809, 0x80, 0, 0}, {0x380a, 0x01, 0, 0}, {0x380b, 0xe0, 0, 0}, {0x380e, 0x07, 0, 0}, {0x380f, 0xd0, 0, 0}, {0x501f, 0x00, 0, 0}, {0x5000, 0x4f, 0, 0}, {0x4300, 0x30, 0, 0}, {0x3503, 0x07, 0, 0}, {0x3501, 0x73, 0, 0}, {0x3502, 0x80, 0, 0}, {0x350b, 0x00, 0, 0}, {0x3503, 0x07, 0, 0}, {0x3824, 0x11, 0, 0}, {0x3501, 0x1e, 0, 0}, {0x3502, 0x80, 0, 0}, {0x350b, 0x7f, 0, 0}, {0x380c, 0x0c, 0, 0}, {0x380d, 0x80, 0, 0}, {0x380e, 0x03, 0, 0}, {0x380f, 0xe8, 0, 0}, {0x3a0d, 0x04, 0, 0}, {0x3a0e, 0x03, 0, 0}, {0x3818, 0xc1, 0, 0}, {0x3705, 0xdb, 0, 0}, {0x370a, 0x81, 0, 0}, {0x3801, 0x80, 0, 0}, {0x3621, 0x87, 0, 0}, {0x3801, 0x50, 0, 0}, {0x3803, 0x08, 0, 0}, {0x3827, 0x08, 0, 0}, {0x3810, 0x40, 0, 0}, {0x3804, 0x05, 0, 0}, {0x3805, 0x00, 0, 0}, {0x5682, 0x05, 0, 0}, {0x5683, 0x00, 0, 0}, {0x3806, 0x03, 0, 0}, {0x3807, 0xc0, 0, 0}, {0x5686, 0x03, 0, 0}, {0x5687, 0xbc, 0, 0}, {0x3a00, 0x78, 0, 0}, {0x3a1a, 0x05, 0, 0}, {0x3a13, 0x30, 0, 0}, {0x3a18, 0x00, 0, 0}, {0x3a19, 0x7c, 0, 0}, {0x3a08, 0x12, 0, 0}, {0x3a09, 0xc0, 0, 0}, {0x3a0a, 0x0f, 0, 0}, {0x3a0b, 0xa0, 0, 0}, {0x350c, 0x07, 0, 0}, {0x350d, 0xd0, 0, 0}, {0x3500, 0x00, 0, 0}, {0x3501, 0x00, 0, 0}, {0x3502, 0x00, 0, 0}, {0x350a, 0x00, 0, 0}, {0x350b, 0x00, 0, 0}, {0x3503, 0x00, 0, 0}, {0x528a, 0x02, 0, 0}, {0x528b, 0x04, 0, 0}, {0x528c, 0x08, 0, 0}, {0x528d, 0x08, 0, 0}, {0x528e, 0x08, 0, 0}, {0x528f, 0x10, 0, 0}, {0x5290, 0x10, 0, 0}, {0x5292, 0x00, 0, 0}, {0x5293, 0x02, 0, 0}, {0x5294, 0x00, 0, 0}, {0x5295, 0x02, 0, 0}, {0x5296, 0x00, 0, 0}, {0x5297, 0x02, 0, 0}, {0x5298, 0x00, 0, 0}, {0x5299, 0x02, 0, 0}, {0x529a, 0x00, 0, 0}, {0x529b, 0x02, 0, 0}, {0x529c, 0x00, 0, 0}, {0x529d, 0x02, 0, 0}, {0x529e, 0x00, 0, 0}, {0x529f, 0x02, 0, 0}, {0x3a0f, 0x3c, 0, 0}, {0x3a10, 0x30, 0, 0}, {0x3a1b, 0x3c, 0, 0}, {0x3a1e, 0x30, 0, 0}, {0x3a11, 0x70, 0, 0}, {0x3a1f, 0x10, 0, 0}, {0x3030, 0x2b, 0, 0}, {0x3a02, 0x00, 0, 0}, {0x3a03, 0x7d, 0, 0}, {0x3a04, 0x00, 0, 0}, {0x3a14, 0x00, 0, 0}, {0x3a15, 0x7d, 0, 0}, {0x3a16, 0x00, 0, 0}, {0x3a00, 0x78, 0, 0}, {0x3a08, 0x09, 0, 0}, {0x3a09, 0x60, 0, 0}, {0x3a0a, 0x07, 0, 0}, {0x3a0b, 0xd0, 0, 0}, {0x3a0d, 0x08, 0, 0}, {0x3a0e, 0x06, 0, 0}, {0x5193, 0x70, 0, 0}, {0x589b, 0x04, 0, 0}, {0x589a, 0xc5, 0, 0}, {0x401e, 0x20, 0, 0}, {0x4001, 0x42, 0, 0}, {0x401c, 0x04, 0, 0}, {0x528a, 0x01, 0, 0}, {0x528b, 0x04, 0, 0}, {0x528c, 0x08, 0, 0}, {0x528d, 0x10, 0, 0}, {0x528e, 0x20, 0, 0}, {0x528f, 0x28, 0, 0}, {0x5290, 0x30, 0, 0}, {0x5292, 0x00, 0, 0}, {0x5293, 0x01, 0, 0}, {0x5294, 0x00, 0, 0}, {0x5295, 0x04, 0, 0}, {0x5296, 0x00, 0, 0}, {0x5297, 0x08, 0, 0}, {0x5298, 0x00, 0, 0}, {0x5299, 0x10, 0, 0}, {0x529a, 0x00, 0, 0}, {0x529b, 0x20, 0, 0}, {0x529c, 0x00, 0, 0}, {0x529d, 0x28, 0, 0}, {0x529e, 0x00, 0, 0}, {0x529f, 0x30, 0, 0}, {0x5282, 0x00, 0, 0}, {0x5300, 0x00, 0, 0}, {0x5301, 0x20, 0, 0}, {0x5302, 0x00, 0, 0}, {0x5303, 0x7c, 0, 0}, {0x530c, 0x00, 0, 0}, {0x530d, 0x0c, 0, 0}, {0x530e, 0x20, 0, 0}, {0x530f, 0x80, 0, 0}, {0x5310, 0x20, 0, 0}, {0x5311, 0x80, 0, 0}, {0x5308, 0x20, 0, 0}, {0x5309, 0x40, 0, 0}, {0x5304, 0x00, 0, 0}, {0x5305, 0x30, 0, 0}, {0x5306, 0x00, 0, 0}, {0x5307, 0x80, 0, 0}, {0x5314, 0x08, 0, 0}, {0x5315, 0x20, 0, 0}, {0x5319, 0x30, 0, 0}, {0x5316, 0x10, 0, 0}, {0x5317, 0x00, 0, 0}, {0x5318, 0x02, 0, 0}, {0x5380, 0x01, 0, 0}, {0x5381, 0x00, 0, 0}, {0x5382, 0x00, 0, 0}, {0x5383, 0x4e, 0, 0}, {0x5384, 0x00, 0, 0}, {0x5385, 0x0f, 0, 0}, {0x5386, 0x00, 0, 0}, {0x5387, 0x00, 0, 0}, {0x5388, 0x01, 0, 0}, {0x5389, 0x15, 0, 0}, {0x538a, 0x00, 0, 0}, {0x538b, 0x31, 0, 0}, {0x538c, 0x00, 0, 0}, {0x538d, 0x00, 0, 0}, {0x538e, 0x00, 0, 0}, {0x538f, 0x0f, 0, 0}, {0x5390, 0x00, 0, 0}, {0x5391, 0xab, 0, 0}, {0x5392, 0x00, 0, 0}, {0x5393, 0xa2, 0, 0}, {0x5394, 0x08, 0, 0}, {0x5480, 0x14, 0, 0}, {0x5481, 0x21, 0, 0}, {0x5482, 0x36, 0, 0}, {0x5483, 0x57, 0, 0}, {0x5484, 0x65, 0, 0}, {0x5485, 0x71, 0, 0}, {0x5486, 0x7d, 0, 0}, {0x5487, 0x87, 0, 0}, {0x5488, 0x91, 0, 0}, {0x5489, 0x9a, 0, 0}, {0x548a, 0xaa, 0, 0}, {0x548b, 0xb8, 0, 0}, {0x548c, 0xcd, 0, 0}, {0x548d, 0xdd, 0, 0}, {0x548e, 0xea, 0, 0}, {0x548f, 0x1d, 0, 0}, {0x5490, 0x05, 0, 0}, {0x5491, 0x00, 0, 0}, {0x5492, 0x04, 0, 0}, {0x5493, 0x20, 0, 0}, {0x5494, 0x03, 0, 0}, {0x5495, 0x60, 0, 0}, {0x5496, 0x02, 0, 0}, {0x5497, 0xb8, 0, 0}, {0x5498, 0x02, 0, 0}, {0x5499, 0x86, 0, 0}, {0x549a, 0x02, 0, 0}, {0x549b, 0x5b, 0, 0}, {0x549c, 0x02, 0, 0}, {0x549d, 0x3b, 0, 0}, {0x549e, 0x02, 0, 0}, {0x549f, 0x1c, 0, 0}, {0x54a0, 0x02, 0, 0}, {0x54a1, 0x04, 0, 0}, {0x54a2, 0x01, 0, 0}, {0x54a3, 0xed, 0, 0}, {0x54a4, 0x01, 0, 0}, {0x54a5, 0xc5, 0, 0}, {0x54a6, 0x01, 0, 0}, {0x54a7, 0xa5, 0, 0}, {0x54a8, 0x01, 0, 0}, {0x54a9, 0x6c, 0, 0}, {0x54aa, 0x01, 0, 0}, {0x54ab, 0x41, 0, 0}, {0x54ac, 0x01, 0, 0}, {0x54ad, 0x20, 0, 0}, {0x54ae, 0x00, 0, 0}, {0x54af, 0x16, 0, 0}, {0x54b0, 0x01, 0, 0}, {0x54b1, 0x20, 0, 0}, {0x54b2, 0x00, 0, 0}, {0x54b3, 0x10, 0, 0}, {0x54b4, 0x00, 0, 0}, {0x54b5, 0xf0, 0, 0}, {0x54b6, 0x00, 0, 0}, {0x54b7, 0xdf, 0, 0}, {0x5402, 0x3f, 0, 0}, {0x5403, 0x00, 0, 0}, {0x3406, 0x00, 0, 0}, {0x5180, 0xff, 0, 0}, {0x5181, 0x52, 0, 0}, {0x5182, 0x11, 0, 0}, {0x5183, 0x14, 0, 0}, {0x5184, 0x25, 0, 0}, {0x5185, 0x24, 0, 0}, {0x5186, 0x06, 0, 0}, {0x5187, 0x08, 0, 0}, {0x5188, 0x08, 0, 0}, {0x5189, 0x7c, 0, 0}, {0x518a, 0x60, 0, 0}, {0x518b, 0xb2, 0, 0}, {0x518c, 0xb2, 0, 0}, {0x518d, 0x44, 0, 0}, {0x518e, 0x3d, 0, 0}, {0x518f, 0x58, 0, 0}, {0x5190, 0x46, 0, 0}, {0x5191, 0xf8, 0, 0}, {0x5192, 0x04, 0, 0}, {0x5193, 0x70, 0, 0}, {0x5194, 0xf0, 0, 0}, {0x5195, 0xf0, 0, 0}, {0x5196, 0x03, 0, 0}, {0x5197, 0x01, 0, 0}, {0x5198, 0x04, 0, 0}, {0x5199, 0x12, 0, 0}, {0x519a, 0x04, 0, 0}, {0x519b, 0x00, 0, 0}, {0x519c, 0x06, 0, 0}, {0x519d, 0x82, 0, 0}, {0x519e, 0x00, 0, 0}, {0x5025, 0x80, 0, 0}, {0x3a0f, 0x38, 0, 0}, {0x3a10, 0x30, 0, 0}, {0x3a1b, 0x3a, 0, 0}, {0x3a1e, 0x2e, 0, 0}, {0x3a11, 0x60, 0, 0}, {0x3a1f, 0x10, 0, 0}, {0x5688, 0xa6, 0, 0}, {0x5689, 0x6a, 0, 0}, {0x568a, 0xea, 0, 0}, {0x568b, 0xae, 0, 0}, {0x568c, 0xa6, 0, 0}, {0x568d, 0x6a, 0, 0}, {0x568e, 0x62, 0, 0}, {0x568f, 0x26, 0, 0}, {0x5583, 0x40, 0, 0}, {0x5584, 0x40, 0, 0}, {0x5580, 0x02, 0, 0}, {0x5000, 0xcf, 0, 0}, {0x5800, 0x27, 0, 0}, {0x5801, 0x19, 0, 0}, {0x5802, 0x12, 0, 0}, {0x5803, 0x0f, 0, 0}, {0x5804, 0x10, 0, 0}, {0x5805, 0x15, 0, 0}, {0x5806, 0x1e, 0, 0}, {0x5807, 0x2f, 0, 0}, {0x5808, 0x15, 0, 0}, {0x5809, 0x0d, 0, 0}, {0x580a, 0x0a, 0, 0}, {0x580b, 0x09, 0, 0}, {0x580c, 0x0a, 0, 0}, {0x580d, 0x0c, 0, 0}, {0x580e, 0x12, 0, 0}, {0x580f, 0x19, 0, 0}, {0x5810, 0x0b, 0, 0}, {0x5811, 0x07, 0, 0}, {0x5812, 0x04, 0, 0}, {0x5813, 0x03, 0, 0}, {0x5814, 0x03, 0, 0}, {0x5815, 0x06, 0, 0}, {0x5816, 0x0a, 0, 0}, {0x5817, 0x0f, 0, 0}, {0x5818, 0x0a, 0, 0}, {0x5819, 0x05, 0, 0}, {0x581a, 0x01, 0, 0}, {0x581b, 0x00, 0, 0}, {0x581c, 0x00, 0, 0}, {0x581d, 0x03, 0, 0}, {0x581e, 0x08, 0, 0}, {0x581f, 0x0c, 0, 0}, {0x5820, 0x0a, 0, 0}, {0x5821, 0x05, 0, 0}, {0x5822, 0x01, 0, 0}, {0x5823, 0x00, 0, 0}, {0x5824, 0x00, 0, 0}, {0x5825, 0x03, 0, 0}, {0x5826, 0x08, 0, 0}, {0x5827, 0x0c, 0, 0}, {0x5828, 0x0e, 0, 0}, {0x5829, 0x08, 0, 0}, {0x582a, 0x06, 0, 0}, {0x582b, 0x04, 0, 0}, {0x582c, 0x05, 0, 0}, {0x582d, 0x07, 0, 0}, {0x582e, 0x0b, 0, 0}, {0x582f, 0x12, 0, 0}, {0x5830, 0x18, 0, 0}, {0x5831, 0x10, 0, 0}, {0x5832, 0x0c, 0, 0}, {0x5833, 0x0a, 0, 0}, {0x5834, 0x0b, 0, 0}, {0x5835, 0x0e, 0, 0}, {0x5836, 0x15, 0, 0}, {0x5837, 0x19, 0, 0}, {0x5838, 0x32, 0, 0}, {0x5839, 0x1f, 0, 0}, {0x583a, 0x18, 0, 0}, {0x583b, 0x16, 0, 0}, {0x583c, 0x17, 0, 0}, {0x583d, 0x1e, 0, 0}, {0x583e, 0x26, 0, 0}, {0x583f, 0x53, 0, 0}, {0x5840, 0x10, 0, 0}, {0x5841, 0x0f, 0, 0}, {0x5842, 0x0d, 0, 0}, {0x5843, 0x0c, 0, 0}, {0x5844, 0x0e, 0, 0}, {0x5845, 0x09, 0, 0}, {0x5846, 0x11, 0, 0}, {0x5847, 0x10, 0, 0}, {0x5848, 0x10, 0, 0}, {0x5849, 0x10, 0, 0}, {0x584a, 0x10, 0, 0}, {0x584b, 0x0e, 0, 0}, {0x584c, 0x10, 0, 0}, {0x584d, 0x10, 0, 0}, {0x584e, 0x11, 0, 0}, {0x584f, 0x10, 0, 0}, {0x5850, 0x0f, 0, 0}, {0x5851, 0x0c, 0, 0}, {0x5852, 0x0f, 0, 0}, {0x5853, 0x10, 0, 0}, {0x5854, 0x10, 0, 0}, {0x5855, 0x0f, 0, 0}, {0x5856, 0x0e, 0, 0}, {0x5857, 0x0b, 0, 0}, {0x5858, 0x10, 0, 0}, {0x5859, 0x0d, 0, 0}, {0x585a, 0x0d, 0, 0}, {0x585b, 0x0c, 0, 0}, {0x585c, 0x0c, 0, 0}, {0x585d, 0x0c, 0, 0}, {0x585e, 0x0b, 0, 0}, {0x585f, 0x0c, 0, 0}, {0x5860, 0x0c, 0, 0}, {0x5861, 0x0c, 0, 0}, {0x5862, 0x0d, 0, 0}, {0x5863, 0x08, 0, 0}, {0x5864, 0x11, 0, 0}, {0x5865, 0x18, 0, 0}, {0x5866, 0x18, 0, 0}, {0x5867, 0x19, 0, 0}, {0x5868, 0x17, 0, 0}, {0x5869, 0x19, 0, 0}, {0x586a, 0x16, 0, 0}, {0x586b, 0x13, 0, 0}, {0x586c, 0x13, 0, 0}, {0x586d, 0x12, 0, 0}, {0x586e, 0x13, 0, 0}, {0x586f, 0x16, 0, 0}, {0x5870, 0x14, 0, 0}, {0x5871, 0x12, 0, 0}, {0x5872, 0x10, 0, 0}, {0x5873, 0x11, 0, 0}, {0x5874, 0x11, 0, 0}, {0x5875, 0x16, 0, 0}, {0x5876, 0x14, 0, 0}, {0x5877, 0x11, 0, 0}, {0x5878, 0x10, 0, 0}, {0x5879, 0x0f, 0, 0}, {0x587a, 0x10, 0, 0}, {0x587b, 0x14, 0, 0}, {0x587c, 0x13, 0, 0}, {0x587d, 0x12, 0, 0}, {0x587e, 0x11, 0, 0}, {0x587f, 0x11, 0, 0}, {0x5880, 0x12, 0, 0}, {0x5881, 0x15, 0, 0}, {0x5882, 0x14, 0, 0}, {0x5883, 0x15, 0, 0}, {0x5884, 0x15, 0, 0}, {0x5885, 0x15, 0, 0}, {0x5886, 0x13, 0, 0}, {0x5887, 0x17, 0, 0}, {0x3710, 0x10, 0, 0}, {0x3632, 0x51, 0, 0}, {0x3702, 0x10, 0, 0}, {0x3703, 0xb2, 0, 0}, {0x3704, 0x18, 0, 0}, {0x370b, 0x40, 0, 0}, {0x370d, 0x03, 0, 0}, {0x3631, 0x01, 0, 0}, {0x3632, 0x52, 0, 0}, {0x3606, 0x24, 0, 0}, {0x3620, 0x96, 0, 0}, {0x5785, 0x07, 0, 0}, {0x3a13, 0x30, 0, 0}, {0x3600, 0x52, 0, 0}, {0x3604, 0x48, 0, 0}, {0x3606, 0x1b, 0, 0}, {0x370d, 0x0b, 0, 0}, {0x370f, 0xc0, 0, 0}, {0x3709, 0x01, 0, 0}, {0x3823, 0x00, 0, 0}, {0x5007, 0x00, 0, 0}, {0x5009, 0x00, 0, 0}, {0x5011, 0x00, 0, 0}, {0x5013, 0x00, 0, 0}, {0x519e, 0x00, 0, 0}, {0x5086, 0x00, 0, 0}, {0x5087, 0x00, 0, 0}, {0x5088, 0x00, 0, 0}, {0x5089, 0x00, 0, 0}, {0x302b, 0x00, 0, 0}, {0x3824, 0x11, 0, 0}, {0x3825, 0xb4, 0, 0}, {0x3826, 0x00, 0, 0}, {0x3827, 0x3d, 0, 0}, {0x380c, 0x0c, 0, 0}, {0x380d, 0x80, 0, 0}, {0x380e, 0x03, 0, 0}, {0x380f, 0xe8, 0, 0}, {0x3808, 0x02, 0, 0}, {0x3809, 0xd0, 0, 0}, {0x380A, 0x01, 0, 0}, {0x380B, 0xe0, 0, 0}, {0x3804, 0x05, 0, 0}, {0x3805, 0x00, 0, 0}, {0x3806, 0x03, 0, 0}, {0x3807, 0x55, 0, 0}, {0x5686, 0x03, 0, 0}, {0x5687, 0x55, 0, 0}, {0x5682, 0x05, 0, 0}, {0x5683, 0x00, 0, 0}, }; static struct reg_value ov5642_setting_15fps_PAL_720_576[] = { {0x3103, 0x93, 0, 0}, {0x3008, 0x82, 0, 0}, {0x3017, 0x7f, 0, 0}, {0x3018, 0xfc, 0, 0}, {0x3810, 0xc2, 0, 0}, {0x3615, 0xf0, 0, 0}, {0x3000, 0x00, 0, 0}, {0x3001, 0x00, 0, 0}, {0x3002, 0x5c, 0, 0}, {0x3003, 0x00, 0, 0}, {0x3004, 0xff, 0, 0}, {0x3005, 0xff, 0, 0}, {0x3006, 0x43, 0, 0}, {0x3007, 0x37, 0, 0}, {0x3011, 0x08, 0, 0}, {0x3010, 0x10, 0, 0}, {0x460c, 0x22, 0, 0}, {0x3815, 0x04, 0, 0}, {0x370c, 0xa0, 0, 0}, {0x3602, 0xfc, 0, 0}, {0x3612, 0xff, 0, 0}, {0x3634, 0xc0, 0, 0}, {0x3613, 0x00, 0, 0}, {0x3605, 0x7c, 0, 0}, {0x3621, 0x09, 0, 0}, {0x3622, 0x60, 0, 0}, {0x3604, 0x40, 0, 0}, {0x3603, 0xa7, 0, 0}, {0x3603, 0x27, 0, 0}, {0x4000, 0x21, 0, 0}, {0x401d, 0x22, 0, 0}, {0x3600, 0x54, 0, 0}, {0x3605, 0x04, 0, 0}, {0x3606, 0x3f, 0, 0}, {0x3c01, 0x80, 0, 0}, {0x5000, 0x4f, 0, 0}, {0x5020, 0x04, 0, 0}, {0x5181, 0x79, 0, 0}, {0x5182, 0x00, 0, 0}, {0x5185, 0x22, 0, 0}, {0x5197, 0x01, 0, 0}, {0x5001, 0xff, 0, 0}, {0x5500, 0x0a, 0, 0}, {0x5504, 0x00, 0, 0}, {0x5505, 0x7f, 0, 0}, {0x5080, 0x08, 0, 0}, {0x300e, 0x18, 0, 0}, {0x4610, 0x00, 0, 0}, {0x471d, 0x05, 0, 0}, {0x4708, 0x06, 0, 0}, {0x3808, 0x02, 0, 0}, {0x3809, 0x80, 0, 0}, {0x380a, 0x01, 0, 0}, {0x380b, 0xe0, 0, 0}, {0x380e, 0x07, 0, 0}, {0x380f, 0xd0, 0, 0}, {0x501f, 0x00, 0, 0}, {0x5000, 0x4f, 0, 0}, {0x4300, 0x30, 0, 0}, {0x3503, 0x07, 0, 0}, {0x3501, 0x73, 0, 0}, {0x3502, 0x80, 0, 0}, {0x350b, 0x00, 0, 0}, {0x3503, 0x07, 0, 0}, {0x3824, 0x11, 0, 0}, {0x3501, 0x1e, 0, 0}, {0x3502, 0x80, 0, 0}, {0x350b, 0x7f, 0, 0}, {0x380c, 0x0c, 0, 0}, {0x380d, 0x80, 0, 0}, {0x380e, 0x03, 0, 0}, {0x380f, 0xe8, 0, 0}, {0x3a0d, 0x04, 0, 0}, {0x3a0e, 0x03, 0, 0}, {0x3818, 0xc1, 0, 0}, {0x3705, 0xdb, 0, 0}, {0x370a, 0x81, 0, 0}, {0x3801, 0x80, 0, 0}, {0x3621, 0x87, 0, 0}, {0x3801, 0x50, 0, 0}, {0x3803, 0x08, 0, 0}, {0x3827, 0x08, 0, 0}, {0x3810, 0x40, 0, 0}, {0x3804, 0x05, 0, 0}, {0x3805, 0x00, 0, 0}, {0x5682, 0x05, 0, 0}, {0x5683, 0x00, 0, 0}, {0x3806, 0x03, 0, 0}, {0x3807, 0xc0, 0, 0}, {0x5686, 0x03, 0, 0}, {0x5687, 0xbc, 0, 0}, {0x3a00, 0x78, 0, 0}, {0x3a1a, 0x05, 0, 0}, {0x3a13, 0x30, 0, 0}, {0x3a18, 0x00, 0, 0}, {0x3a19, 0x7c, 0, 0}, {0x3a08, 0x12, 0, 0}, {0x3a09, 0xc0, 0, 0}, {0x3a0a, 0x0f, 0, 0}, {0x3a0b, 0xa0, 0, 0}, {0x350c, 0x07, 0, 0}, {0x350d, 0xd0, 0, 0}, {0x3500, 0x00, 0, 0}, {0x3501, 0x00, 0, 0}, {0x3502, 0x00, 0, 0}, {0x350a, 0x00, 0, 0}, {0x350b, 0x00, 0, 0}, {0x3503, 0x00, 0, 0}, {0x528a, 0x02, 0, 0}, {0x528b, 0x04, 0, 0}, {0x528c, 0x08, 0, 0}, {0x528d, 0x08, 0, 0}, {0x528e, 0x08, 0, 0}, {0x528f, 0x10, 0, 0}, {0x5290, 0x10, 0, 0}, {0x5292, 0x00, 0, 0}, {0x5293, 0x02, 0, 0}, {0x5294, 0x00, 0, 0}, {0x5295, 0x02, 0, 0}, {0x5296, 0x00, 0, 0}, {0x5297, 0x02, 0, 0}, {0x5298, 0x00, 0, 0}, {0x5299, 0x02, 0, 0}, {0x529a, 0x00, 0, 0}, {0x529b, 0x02, 0, 0}, {0x529c, 0x00, 0, 0}, {0x529d, 0x02, 0, 0}, {0x529e, 0x00, 0, 0}, {0x529f, 0x02, 0, 0}, {0x3a0f, 0x3c, 0, 0}, {0x3a10, 0x30, 0, 0}, {0x3a1b, 0x3c, 0, 0}, {0x3a1e, 0x30, 0, 0}, {0x3a11, 0x70, 0, 0}, {0x3a1f, 0x10, 0, 0}, {0x3030, 0x2b, 0, 0}, {0x3a02, 0x00, 0, 0}, {0x3a03, 0x7d, 0, 0}, {0x3a04, 0x00, 0, 0}, {0x3a14, 0x00, 0, 0}, {0x3a15, 0x7d, 0, 0}, {0x3a16, 0x00, 0, 0}, {0x3a00, 0x78, 0, 0}, {0x3a08, 0x09, 0, 0}, {0x3a09, 0x60, 0, 0}, {0x3a0a, 0x07, 0, 0}, {0x3a0b, 0xd0, 0, 0}, {0x3a0d, 0x08, 0, 0}, {0x3a0e, 0x06, 0, 0}, {0x5193, 0x70, 0, 0}, {0x589b, 0x04, 0, 0}, {0x589a, 0xc5, 0, 0}, {0x401e, 0x20, 0, 0}, {0x4001, 0x42, 0, 0}, {0x401c, 0x04, 0, 0}, {0x528a, 0x01, 0, 0}, {0x528b, 0x04, 0, 0}, {0x528c, 0x08, 0, 0}, {0x528d, 0x10, 0, 0}, {0x528e, 0x20, 0, 0}, {0x528f, 0x28, 0, 0}, {0x5290, 0x30, 0, 0}, {0x5292, 0x00, 0, 0}, {0x5293, 0x01, 0, 0}, {0x5294, 0x00, 0, 0}, {0x5295, 0x04, 0, 0}, {0x5296, 0x00, 0, 0}, {0x5297, 0x08, 0, 0}, {0x5298, 0x00, 0, 0}, {0x5299, 0x10, 0, 0}, {0x529a, 0x00, 0, 0}, {0x529b, 0x20, 0, 0}, {0x529c, 0x00, 0, 0}, {0x529d, 0x28, 0, 0}, {0x529e, 0x00, 0, 0}, {0x529f, 0x30, 0, 0}, {0x5282, 0x00, 0, 0}, {0x5300, 0x00, 0, 0}, {0x5301, 0x20, 0, 0}, {0x5302, 0x00, 0, 0}, {0x5303, 0x7c, 0, 0}, {0x530c, 0x00, 0, 0}, {0x530d, 0x0c, 0, 0}, {0x530e, 0x20, 0, 0}, {0x530f, 0x80, 0, 0}, {0x5310, 0x20, 0, 0}, {0x5311, 0x80, 0, 0}, {0x5308, 0x20, 0, 0}, {0x5309, 0x40, 0, 0}, {0x5304, 0x00, 0, 0}, {0x5305, 0x30, 0, 0}, {0x5306, 0x00, 0, 0}, {0x5307, 0x80, 0, 0}, {0x5314, 0x08, 0, 0}, {0x5315, 0x20, 0, 0}, {0x5319, 0x30, 0, 0}, {0x5316, 0x10, 0, 0}, {0x5317, 0x00, 0, 0}, {0x5318, 0x02, 0, 0}, {0x5380, 0x01, 0, 0}, {0x5381, 0x00, 0, 0}, {0x5382, 0x00, 0, 0}, {0x5383, 0x4e, 0, 0}, {0x5384, 0x00, 0, 0}, {0x5385, 0x0f, 0, 0}, {0x5386, 0x00, 0, 0}, {0x5387, 0x00, 0, 0}, {0x5388, 0x01, 0, 0}, {0x5389, 0x15, 0, 0}, {0x538a, 0x00, 0, 0}, {0x538b, 0x31, 0, 0}, {0x538c, 0x00, 0, 0}, {0x538d, 0x00, 0, 0}, {0x538e, 0x00, 0, 0}, {0x538f, 0x0f, 0, 0}, {0x5390, 0x00, 0, 0}, {0x5391, 0xab, 0, 0}, {0x5392, 0x00, 0, 0}, {0x5393, 0xa2, 0, 0}, {0x5394, 0x08, 0, 0}, {0x5480, 0x14, 0, 0}, {0x5481, 0x21, 0, 0}, {0x5482, 0x36, 0, 0}, {0x5483, 0x57, 0, 0}, {0x5484, 0x65, 0, 0}, {0x5485, 0x71, 0, 0}, {0x5486, 0x7d, 0, 0}, {0x5487, 0x87, 0, 0}, {0x5488, 0x91, 0, 0}, {0x5489, 0x9a, 0, 0}, {0x548a, 0xaa, 0, 0}, {0x548b, 0xb8, 0, 0}, {0x548c, 0xcd, 0, 0}, {0x548d, 0xdd, 0, 0}, {0x548e, 0xea, 0, 0}, {0x548f, 0x1d, 0, 0}, {0x5490, 0x05, 0, 0}, {0x5491, 0x00, 0, 0}, {0x5492, 0x04, 0, 0}, {0x5493, 0x20, 0, 0}, {0x5494, 0x03, 0, 0}, {0x5495, 0x60, 0, 0}, {0x5496, 0x02, 0, 0}, {0x5497, 0xb8, 0, 0}, {0x5498, 0x02, 0, 0}, {0x5499, 0x86, 0, 0}, {0x549a, 0x02, 0, 0}, {0x549b, 0x5b, 0, 0}, {0x549c, 0x02, 0, 0}, {0x549d, 0x3b, 0, 0}, {0x549e, 0x02, 0, 0}, {0x549f, 0x1c, 0, 0}, {0x54a0, 0x02, 0, 0}, {0x54a1, 0x04, 0, 0}, {0x54a2, 0x01, 0, 0}, {0x54a3, 0xed, 0, 0}, {0x54a4, 0x01, 0, 0}, {0x54a5, 0xc5, 0, 0}, {0x54a6, 0x01, 0, 0}, {0x54a7, 0xa5, 0, 0}, {0x54a8, 0x01, 0, 0}, {0x54a9, 0x6c, 0, 0}, {0x54aa, 0x01, 0, 0}, {0x54ab, 0x41, 0, 0}, {0x54ac, 0x01, 0, 0}, {0x54ad, 0x20, 0, 0}, {0x54ae, 0x00, 0, 0}, {0x54af, 0x16, 0, 0}, {0x54b0, 0x01, 0, 0}, {0x54b1, 0x20, 0, 0}, {0x54b2, 0x00, 0, 0}, {0x54b3, 0x10, 0, 0}, {0x54b4, 0x00, 0, 0}, {0x54b5, 0xf0, 0, 0}, {0x54b6, 0x00, 0, 0}, {0x54b7, 0xdf, 0, 0}, {0x5402, 0x3f, 0, 0}, {0x5403, 0x00, 0, 0}, {0x3406, 0x00, 0, 0}, {0x5180, 0xff, 0, 0}, {0x5181, 0x52, 0, 0}, {0x5182, 0x11, 0, 0}, {0x5183, 0x14, 0, 0}, {0x5184, 0x25, 0, 0}, {0x5185, 0x24, 0, 0}, {0x5186, 0x06, 0, 0}, {0x5187, 0x08, 0, 0}, {0x5188, 0x08, 0, 0}, {0x5189, 0x7c, 0, 0}, {0x518a, 0x60, 0, 0}, {0x518b, 0xb2, 0, 0}, {0x518c, 0xb2, 0, 0}, {0x518d, 0x44, 0, 0}, {0x518e, 0x3d, 0, 0}, {0x518f, 0x58, 0, 0}, {0x5190, 0x46, 0, 0}, {0x5191, 0xf8, 0, 0}, {0x5192, 0x04, 0, 0}, {0x5193, 0x70, 0, 0}, {0x5194, 0xf0, 0, 0}, {0x5195, 0xf0, 0, 0}, {0x5196, 0x03, 0, 0}, {0x5197, 0x01, 0, 0}, {0x5198, 0x04, 0, 0}, {0x5199, 0x12, 0, 0}, {0x519a, 0x04, 0, 0}, {0x519b, 0x00, 0, 0}, {0x519c, 0x06, 0, 0}, {0x519d, 0x82, 0, 0}, {0x519e, 0x00, 0, 0}, {0x5025, 0x80, 0, 0}, {0x3a0f, 0x38, 0, 0}, {0x3a10, 0x30, 0, 0}, {0x3a1b, 0x3a, 0, 0}, {0x3a1e, 0x2e, 0, 0}, {0x3a11, 0x60, 0, 0}, {0x3a1f, 0x10, 0, 0}, {0x5688, 0xa6, 0, 0}, {0x5689, 0x6a, 0, 0}, {0x568a, 0xea, 0, 0}, {0x568b, 0xae, 0, 0}, {0x568c, 0xa6, 0, 0}, {0x568d, 0x6a, 0, 0}, {0x568e, 0x62, 0, 0}, {0x568f, 0x26, 0, 0}, {0x5583, 0x40, 0, 0}, {0x5584, 0x40, 0, 0}, {0x5580, 0x02, 0, 0}, {0x5000, 0xcf, 0, 0}, {0x5800, 0x27, 0, 0}, {0x5801, 0x19, 0, 0}, {0x5802, 0x12, 0, 0}, {0x5803, 0x0f, 0, 0}, {0x5804, 0x10, 0, 0}, {0x5805, 0x15, 0, 0}, {0x5806, 0x1e, 0, 0}, {0x5807, 0x2f, 0, 0}, {0x5808, 0x15, 0, 0}, {0x5809, 0x0d, 0, 0}, {0x580a, 0x0a, 0, 0}, {0x580b, 0x09, 0, 0}, {0x580c, 0x0a, 0, 0}, {0x580d, 0x0c, 0, 0}, {0x580e, 0x12, 0, 0}, {0x580f, 0x19, 0, 0}, {0x5810, 0x0b, 0, 0}, {0x5811, 0x07, 0, 0}, {0x5812, 0x04, 0, 0}, {0x5813, 0x03, 0, 0}, {0x5814, 0x03, 0, 0}, {0x5815, 0x06, 0, 0}, {0x5816, 0x0a, 0, 0}, {0x5817, 0x0f, 0, 0}, {0x5818, 0x0a, 0, 0}, {0x5819, 0x05, 0, 0}, {0x581a, 0x01, 0, 0}, {0x581b, 0x00, 0, 0}, {0x581c, 0x00, 0, 0}, {0x581d, 0x03, 0, 0}, {0x581e, 0x08, 0, 0}, {0x581f, 0x0c, 0, 0}, {0x5820, 0x0a, 0, 0}, {0x5821, 0x05, 0, 0}, {0x5822, 0x01, 0, 0}, {0x5823, 0x00, 0, 0}, {0x5824, 0x00, 0, 0}, {0x5825, 0x03, 0, 0}, {0x5826, 0x08, 0, 0}, {0x5827, 0x0c, 0, 0}, {0x5828, 0x0e, 0, 0}, {0x5829, 0x08, 0, 0}, {0x582a, 0x06, 0, 0}, {0x582b, 0x04, 0, 0}, {0x582c, 0x05, 0, 0}, {0x582d, 0x07, 0, 0}, {0x582e, 0x0b, 0, 0}, {0x582f, 0x12, 0, 0}, {0x5830, 0x18, 0, 0}, {0x5831, 0x10, 0, 0}, {0x5832, 0x0c, 0, 0}, {0x5833, 0x0a, 0, 0}, {0x5834, 0x0b, 0, 0}, {0x5835, 0x0e, 0, 0}, {0x5836, 0x15, 0, 0}, {0x5837, 0x19, 0, 0}, {0x5838, 0x32, 0, 0}, {0x5839, 0x1f, 0, 0}, {0x583a, 0x18, 0, 0}, {0x583b, 0x16, 0, 0}, {0x583c, 0x17, 0, 0}, {0x583d, 0x1e, 0, 0}, {0x583e, 0x26, 0, 0}, {0x583f, 0x53, 0, 0}, {0x5840, 0x10, 0, 0}, {0x5841, 0x0f, 0, 0}, {0x5842, 0x0d, 0, 0}, {0x5843, 0x0c, 0, 0}, {0x5844, 0x0e, 0, 0}, {0x5845, 0x09, 0, 0}, {0x5846, 0x11, 0, 0}, {0x5847, 0x10, 0, 0}, {0x5848, 0x10, 0, 0}, {0x5849, 0x10, 0, 0}, {0x584a, 0x10, 0, 0}, {0x584b, 0x0e, 0, 0}, {0x584c, 0x10, 0, 0}, {0x584d, 0x10, 0, 0}, {0x584e, 0x11, 0, 0}, {0x584f, 0x10, 0, 0}, {0x5850, 0x0f, 0, 0}, {0x5851, 0x0c, 0, 0}, {0x5852, 0x0f, 0, 0}, {0x5853, 0x10, 0, 0}, {0x5854, 0x10, 0, 0}, {0x5855, 0x0f, 0, 0}, {0x5856, 0x0e, 0, 0}, {0x5857, 0x0b, 0, 0}, {0x5858, 0x10, 0, 0}, {0x5859, 0x0d, 0, 0}, {0x585a, 0x0d, 0, 0}, {0x585b, 0x0c, 0, 0}, {0x585c, 0x0c, 0, 0}, {0x585d, 0x0c, 0, 0}, {0x585e, 0x0b, 0, 0}, {0x585f, 0x0c, 0, 0}, {0x5860, 0x0c, 0, 0}, {0x5861, 0x0c, 0, 0}, {0x5862, 0x0d, 0, 0}, {0x5863, 0x08, 0, 0}, {0x5864, 0x11, 0, 0}, {0x5865, 0x18, 0, 0}, {0x5866, 0x18, 0, 0}, {0x5867, 0x19, 0, 0}, {0x5868, 0x17, 0, 0}, {0x5869, 0x19, 0, 0}, {0x586a, 0x16, 0, 0}, {0x586b, 0x13, 0, 0}, {0x586c, 0x13, 0, 0}, {0x586d, 0x12, 0, 0}, {0x586e, 0x13, 0, 0}, {0x586f, 0x16, 0, 0}, {0x5870, 0x14, 0, 0}, {0x5871, 0x12, 0, 0}, {0x5872, 0x10, 0, 0}, {0x5873, 0x11, 0, 0}, {0x5874, 0x11, 0, 0}, {0x5875, 0x16, 0, 0}, {0x5876, 0x14, 0, 0}, {0x5877, 0x11, 0, 0}, {0x5878, 0x10, 0, 0}, {0x5879, 0x0f, 0, 0}, {0x587a, 0x10, 0, 0}, {0x587b, 0x14, 0, 0}, {0x587c, 0x13, 0, 0}, {0x587d, 0x12, 0, 0}, {0x587e, 0x11, 0, 0}, {0x587f, 0x11, 0, 0}, {0x5880, 0x12, 0, 0}, {0x5881, 0x15, 0, 0}, {0x5882, 0x14, 0, 0}, {0x5883, 0x15, 0, 0}, {0x5884, 0x15, 0, 0}, {0x5885, 0x15, 0, 0}, {0x5886, 0x13, 0, 0}, {0x5887, 0x17, 0, 0}, {0x3710, 0x10, 0, 0}, {0x3632, 0x51, 0, 0}, {0x3702, 0x10, 0, 0}, {0x3703, 0xb2, 0, 0}, {0x3704, 0x18, 0, 0}, {0x370b, 0x40, 0, 0}, {0x370d, 0x03, 0, 0}, {0x3631, 0x01, 0, 0}, {0x3632, 0x52, 0, 0}, {0x3606, 0x24, 0, 0}, {0x3620, 0x96, 0, 0}, {0x5785, 0x07, 0, 0}, {0x3a13, 0x30, 0, 0}, {0x3600, 0x52, 0, 0}, {0x3604, 0x48, 0, 0}, {0x3606, 0x1b, 0, 0}, {0x370d, 0x0b, 0, 0}, {0x370f, 0xc0, 0, 0}, {0x3709, 0x01, 0, 0}, {0x3823, 0x00, 0, 0}, {0x5007, 0x00, 0, 0}, {0x5009, 0x00, 0, 0}, {0x5011, 0x00, 0, 0}, {0x5013, 0x00, 0, 0}, {0x519e, 0x00, 0, 0}, {0x5086, 0x00, 0, 0}, {0x5087, 0x00, 0, 0}, {0x5088, 0x00, 0, 0}, {0x5089, 0x00, 0, 0}, {0x302b, 0x00, 0, 0}, {0x3824, 0x11, 0, 0}, {0x3825, 0xdc, 0, 0}, {0x3826, 0x00, 0, 0}, {0x3827, 0x08, 0, 0}, {0x380c, 0x0c, 0, 0}, {0x380d, 0x80, 0, 0}, {0x380e, 0x03, 0, 0}, {0x380f, 0xe8, 0, 0}, {0x3808, 0x02, 0, 0}, {0x3809, 0xd0, 0, 0}, {0x380A, 0x02, 0, 0}, {0x380B, 0x40, 0, 0}, {0x3804, 0x04, 0, 0}, {0x3805, 0xb0, 0, 0}, {0x3806, 0x03, 0, 0}, {0x3807, 0xc0, 0, 0}, {0x5686, 0x03, 0, 0}, {0x5687, 0xc0, 0, 0}, {0x5682, 0x04, 0, 0}, {0x5683, 0xb0, 0, 0}, }; static struct ov5642_mode_info ov5642_mode_info_data[2][ov5642_mode_MAX + 1] = { { {ov5642_mode_VGA_640_480, 640, 480, ov5642_setting_15fps_VGA_640_480, ARRAY_SIZE(ov5642_setting_15fps_VGA_640_480)}, {ov5642_mode_QVGA_320_240, 320, 240, ov5642_setting_15fps_QVGA_320_240, ARRAY_SIZE(ov5642_setting_15fps_QVGA_320_240)}, {ov5642_mode_NTSC_720_480, 720, 480, ov5642_setting_15fps_NTSC_720_480, ARRAY_SIZE(ov5642_setting_15fps_NTSC_720_480)}, {ov5642_mode_PAL_720_576, 720, 576, ov5642_setting_15fps_PAL_720_576, ARRAY_SIZE(ov5642_setting_15fps_PAL_720_576)}, {ov5642_mode_720P_1280_720, 1280, 720, ov5642_setting_15fps_720P_1280_720, ARRAY_SIZE(ov5642_setting_15fps_720P_1280_720)}, {ov5642_mode_1080P_1920_1080, 1920, 1080, ov5642_setting_15fps_1080P_1920_1080, ARRAY_SIZE(ov5642_setting_15fps_1080P_1920_1080)}, {ov5642_mode_QSXGA_2592_1944, 2592, 1944, ov5642_setting_15fps_QSXGA_2592_1944, ARRAY_SIZE(ov5642_setting_15fps_QSXGA_2592_1944)}, {ov5642_mode_QCIF_176_144, 176, 144, ov5642_setting_15fps_QCIF_176_144, ARRAY_SIZE(ov5642_setting_15fps_QCIF_176_144)}, {ov5642_mode_XGA_1024_768, 1024, 768, ov5642_setting_15fps_XGA_1024_768, ARRAY_SIZE(ov5642_setting_15fps_XGA_1024_768)}, }, { {ov5642_mode_VGA_640_480, 640, 480, ov5642_setting_30fps_VGA_640_480, ARRAY_SIZE(ov5642_setting_30fps_VGA_640_480)}, {ov5642_mode_QVGA_320_240, 320, 240, ov5642_setting_30fps_QVGA_320_240, ARRAY_SIZE(ov5642_setting_30fps_QVGA_320_240)}, {ov5642_mode_NTSC_720_480, 720, 480, ov5642_setting_30fps_NTSC_720_480, ARRAY_SIZE(ov5642_setting_30fps_NTSC_720_480)}, {ov5642_mode_PAL_720_576, 720, 576, ov5642_setting_30fps_PAL_720_576, ARRAY_SIZE(ov5642_setting_30fps_PAL_720_576)}, {ov5642_mode_720P_1280_720, 1280, 720, ov5642_setting_30fps_720P_1280_720, ARRAY_SIZE(ov5642_setting_30fps_720P_1280_720)}, {ov5642_mode_1080P_1920_1080, 0, 0, NULL, 0}, {ov5642_mode_QSXGA_2592_1944, 0, 0, NULL, 0}, {ov5642_mode_QCIF_176_144, 176, 144, ov5642_setting_30fps_QCIF_176_144, ARRAY_SIZE(ov5642_setting_30fps_QCIF_176_144)}, {ov5642_mode_XGA_1024_768, 1024, 768, ov5642_setting_30fps_XGA_1024_768, ARRAY_SIZE(ov5642_setting_30fps_XGA_1024_768)}, }, }; static struct regulator *io_regulator; static struct regulator *core_regulator; static struct regulator *analog_regulator; static struct regulator *gpo_regulator; static struct fsl_mxc_camera_platform_data *camera_plat; static int ov5642_probe(struct i2c_client *adapter, const struct i2c_device_id *device_id); static int ov5642_remove(struct i2c_client *client); static s32 ov5642_read_reg(u16 reg, u8 *val); static s32 ov5642_write_reg(u16 reg, u8 val); static const struct i2c_device_id ov5642_id[] = { {"ov5642", 0}, {}, }; MODULE_DEVICE_TABLE(i2c, ov5642_id); static struct i2c_driver ov5642_i2c_driver = { .driver = { .owner = THIS_MODULE, .name = "ov5642", }, .probe = ov5642_probe, .remove = ov5642_remove, .id_table = ov5642_id, }; static s32 ov5642_write_reg(u16 reg, u8 val) { u8 au8Buf[3] = {0}; au8Buf[0] = reg >> 8; au8Buf[1] = reg & 0xff; au8Buf[2] = val; if (i2c_master_send(ov5642_data.i2c_client, au8Buf, 3) < 0) { pr_err("%s:write reg error:reg=%x,val=%x\n", __func__, reg, val); return -1; } return 0; } static s32 ov5642_read_reg(u16 reg, u8 *val) { u8 au8RegBuf[2] = {0}; u8 u8RdVal = 0; au8RegBuf[0] = reg >> 8; au8RegBuf[1] = reg & 0xff; if (2 != i2c_master_send(ov5642_data.i2c_client, au8RegBuf, 2)) { pr_err("%s:write reg error:reg=%x\n", __func__, reg); return -1; } if (1 != i2c_master_recv(ov5642_data.i2c_client, &u8RdVal, 1)) { pr_err("%s:read reg error:reg=%x,val=%x\n", __func__, reg, u8RdVal); return -1; } *val = u8RdVal; return u8RdVal; } static int ov5642_set_rotate_mode(struct reg_value *rotate_mode) { s32 i = 0; s32 iModeSettingArySize = 2; register u32 Delay_ms = 0; register u16 RegAddr = 0; register u8 Mask = 0; register u8 Val = 0; u8 RegVal = 0; int retval = 0; for (i = 0; i < iModeSettingArySize; ++i, ++rotate_mode) { Delay_ms = rotate_mode->u32Delay_ms; RegAddr = rotate_mode->u16RegAddr; Val = rotate_mode->u8Val; Mask = rotate_mode->u8Mask; if (Mask) { retval = ov5642_read_reg(RegAddr, &RegVal); if (retval < 0) { pr_err("%s, read reg 0x%x failed\n", __FUNCTION__, RegAddr); goto err; } Val |= RegVal; Val &= Mask; } retval = ov5642_write_reg(RegAddr, Val); if (retval < 0) { pr_err("%s, write reg 0x%x failed\n", __FUNCTION__, RegAddr); goto err; } if (Delay_ms) mdelay(Delay_ms); } err: return retval; } static int ov5642_init_mode(enum ov5642_frame_rate frame_rate, enum ov5642_mode mode); static int ov5642_write_snapshot_para(enum ov5642_frame_rate frame_rate, enum ov5642_mode mode); static int ov5642_change_mode(enum ov5642_frame_rate new_frame_rate, enum ov5642_frame_rate old_frame_rate, enum ov5642_mode new_mode, enum ov5642_mode orig_mode) { struct reg_value *pModeSetting = NULL; s32 i = 0; s32 iModeSettingArySize = 0; register u32 Delay_ms = 0; register u16 RegAddr = 0; register u8 Mask = 0; register u8 Val = 0; u8 RegVal = 0; int retval = 0; if (new_mode > ov5642_mode_MAX || new_mode < ov5642_mode_MIN) { pr_err("Wrong ov5642 mode detected!\n"); return -1; } if ((new_frame_rate == old_frame_rate) && (new_mode == ov5642_mode_VGA_640_480) && (orig_mode == ov5642_mode_QSXGA_2592_1944)) { pModeSetting = ov5642_setting_QSXGA_2_VGA; iModeSettingArySize = ARRAY_SIZE(ov5642_setting_QSXGA_2_VGA); ov5642_data.pix.width = 640; ov5642_data.pix.height = 480; } else if ((new_frame_rate == old_frame_rate) && (new_mode == ov5642_mode_QVGA_320_240) && (orig_mode == ov5642_mode_VGA_640_480)) { pModeSetting = ov5642_setting_VGA_2_QVGA; iModeSettingArySize = ARRAY_SIZE(ov5642_setting_VGA_2_QVGA); ov5642_data.pix.width = 320; ov5642_data.pix.height = 240; } else { retval = ov5642_write_snapshot_para(new_frame_rate, new_mode); goto err; } if (ov5642_data.pix.width == 0 || ov5642_data.pix.height == 0 || pModeSetting == NULL || iModeSettingArySize == 0) return -EINVAL; for (i = 0; i < iModeSettingArySize; ++i, ++pModeSetting) { Delay_ms = pModeSetting->u32Delay_ms; RegAddr = pModeSetting->u16RegAddr; Val = pModeSetting->u8Val; Mask = pModeSetting->u8Mask; if (Mask) { retval = ov5642_read_reg(RegAddr, &RegVal); if (retval < 0) { pr_err("read reg error addr=0x%x", RegAddr); goto err; } RegVal &= ~(u8)Mask; Val &= Mask; Val |= RegVal; } retval = ov5642_write_reg(RegAddr, Val); if (retval < 0) { pr_err("write reg error addr=0x%x", RegAddr); goto err; } if (Delay_ms) msleep(Delay_ms); } err: return retval; } static int ov5642_init_mode(enum ov5642_frame_rate frame_rate, enum ov5642_mode mode) { struct reg_value *pModeSetting = NULL; s32 i = 0; s32 iModeSettingArySize = 0; register u32 Delay_ms = 0; register u16 RegAddr = 0; register u8 Mask = 0; register u8 Val = 0; u8 RegVal = 0; int retval = 0; if (mode > ov5642_mode_MAX || mode < ov5642_mode_MIN) { pr_err("Wrong ov5642 mode detected!\n"); return -1; } pModeSetting = ov5642_mode_info_data[frame_rate][mode].init_data_ptr; iModeSettingArySize = ov5642_mode_info_data[frame_rate][mode].init_data_size; ov5642_data.pix.width = ov5642_mode_info_data[frame_rate][mode].width; ov5642_data.pix.height = ov5642_mode_info_data[frame_rate][mode].height; if (ov5642_data.pix.width == 0 || ov5642_data.pix.height == 0 || pModeSetting == NULL || iModeSettingArySize == 0) return -EINVAL; for (i = 0; i < iModeSettingArySize; ++i, ++pModeSetting) { Delay_ms = pModeSetting->u32Delay_ms; RegAddr = pModeSetting->u16RegAddr; Val = pModeSetting->u8Val; Mask = pModeSetting->u8Mask; if (Mask) { retval = ov5642_read_reg(RegAddr, &RegVal); if (retval < 0) { pr_err("read reg error addr=0x%x", RegAddr); goto err; } RegVal &= ~(u8)Mask; Val &= Mask; Val |= RegVal; } retval = ov5642_write_reg(RegAddr, Val); if (retval < 0) { pr_err("write reg error addr=0x%x", RegAddr); goto err; } if (Delay_ms) msleep(Delay_ms); } err: return retval; } static int ov5642_write_snapshot_para(enum ov5642_frame_rate frame_rate, enum ov5642_mode mode) { int ret = 0; bool m_60Hz = false; u16 capture_frame_rate = 50; u16 g_preview_frame_rate = 225; u8 exposure_low, exposure_mid, exposure_high; u8 ret_l, ret_m, ret_h, gain, lines_10ms; u16 ulcapture_exposure, icapture_gain, preview_maxlines; u32 ulcapture_exposure_gain, capture_maxlines, g_preview_exposure; ov5642_write_reg(0x3503, 0x07); ret_h = ret_m = ret_l = 0; g_preview_exposure = 0; ov5642_read_reg(0x3500, &ret_h); ov5642_read_reg(0x3501, &ret_m); ov5642_read_reg(0x3502, &ret_l); g_preview_exposure = (ret_h << 12) + (ret_m << 4) + (ret_l >> 4); ret_h = ret_m = ret_l = 0; preview_maxlines = 0; ov5642_read_reg(0x380e, &ret_h); ov5642_read_reg(0x380f, &ret_l); preview_maxlines = (ret_h << 8) + ret_l; /*Read back AGC Gain for preview*/ gain = 0; ov5642_read_reg(0x350b, &gain); ret = ov5642_init_mode(frame_rate, mode); if (ret < 0) return ret; ret_h = ret_m = ret_l = 0; ov5642_read_reg(0x380e, &ret_h); ov5642_read_reg(0x380f, &ret_l); capture_maxlines = (ret_h << 8) + ret_l; if (m_60Hz == true) lines_10ms = capture_frame_rate * capture_maxlines/12000; else lines_10ms = capture_frame_rate * capture_maxlines/10000; if (preview_maxlines == 0) preview_maxlines = 1; ulcapture_exposure = (g_preview_exposure*(capture_frame_rate)*(capture_maxlines))/ (((preview_maxlines)*(g_preview_frame_rate))); icapture_gain = (gain & 0x0f) + 16; if (gain & 0x10) icapture_gain = icapture_gain << 1; if (gain & 0x20) icapture_gain = icapture_gain << 1; if (gain & 0x40) icapture_gain = icapture_gain << 1; if (gain & 0x80) icapture_gain = icapture_gain << 1; ulcapture_exposure_gain = 2 * ulcapture_exposure * icapture_gain; if (ulcapture_exposure_gain < capture_maxlines*16) { ulcapture_exposure = ulcapture_exposure_gain/16; if (ulcapture_exposure > lines_10ms) { ulcapture_exposure /= lines_10ms; ulcapture_exposure *= lines_10ms; } } else ulcapture_exposure = capture_maxlines; if (ulcapture_exposure == 0) ulcapture_exposure = 1; icapture_gain = (ulcapture_exposure_gain*2/ulcapture_exposure + 1)/2; exposure_low = ((unsigned char)ulcapture_exposure)<<4; exposure_mid = (unsigned char)(ulcapture_exposure >> 4) & 0xff; exposure_high = (unsigned char)(ulcapture_exposure >> 12); gain = 0; if (icapture_gain > 31) { gain |= 0x10; icapture_gain = icapture_gain >> 1; } if (icapture_gain > 31) { gain |= 0x20; icapture_gain = icapture_gain >> 1; } if (icapture_gain > 31) { gain |= 0x40; icapture_gain = icapture_gain >> 1; } if (icapture_gain > 31) { gain |= 0x80; icapture_gain = icapture_gain >> 1; } if (icapture_gain > 16) gain |= ((icapture_gain - 16) & 0x0f); if (gain == 0x10) gain = 0x11; ov5642_write_reg(0x350b, gain); ov5642_write_reg(0x3502, exposure_low); ov5642_write_reg(0x3501, exposure_mid); ov5642_write_reg(0x3500, exposure_high); msleep(500); return ret ; } /* --------------- IOCTL functions from v4l2_int_ioctl_desc --------------- */ static int ioctl_g_ifparm(struct v4l2_int_device *s, struct v4l2_ifparm *p) { if (s == NULL) { pr_err(" ERROR!! no slave device set!\n"); return -1; } memset(p, 0, sizeof(*p)); p->u.bt656.clock_curr = ov5642_data.mclk; pr_debug(" clock_curr=mclk=%d\n", ov5642_data.mclk); p->if_type = V4L2_IF_TYPE_BT656; p->u.bt656.mode = V4L2_IF_TYPE_BT656_MODE_NOBT_8BIT; p->u.bt656.clock_min = OV5642_XCLK_MIN; p->u.bt656.clock_max = OV5642_XCLK_MAX; p->u.bt656.bt_sync_correct = 1; /* Indicate external vsync */ return 0; } /*! * ioctl_s_power - V4L2 sensor interface handler for VIDIOC_S_POWER ioctl * @s: pointer to standard V4L2 device structure * @on: indicates power mode (on or off) * * Turns the power on or off, depending on the value of on and returns the * appropriate error code. */ static int ioctl_s_power(struct v4l2_int_device *s, int on) { struct sensor_data *sensor = s->priv; if (on && !sensor->on) { if (io_regulator) if (regulator_enable(io_regulator) != 0) return -EIO; if (core_regulator) if (regulator_enable(core_regulator) != 0) return -EIO; if (gpo_regulator) if (regulator_enable(gpo_regulator) != 0) return -EIO; if (analog_regulator) if (regulator_enable(analog_regulator) != 0) return -EIO; /* Make sure power on */ if (camera_plat->pwdn) camera_plat->pwdn(0); } else if (!on && sensor->on) { if (analog_regulator) regulator_disable(analog_regulator); if (core_regulator) regulator_disable(core_regulator); if (io_regulator) regulator_disable(io_regulator); if (gpo_regulator) regulator_disable(gpo_regulator); if (camera_plat->pwdn) camera_plat->pwdn(1); } sensor->on = on; return 0; } /*! * ioctl_g_parm - V4L2 sensor interface handler for VIDIOC_G_PARM ioctl * @s: pointer to standard V4L2 device structure * @a: pointer to standard V4L2 VIDIOC_G_PARM ioctl structure * * Returns the sensor's video CAPTURE parameters. */ static int ioctl_g_parm(struct v4l2_int_device *s, struct v4l2_streamparm *a) { struct sensor_data *sensor = s->priv; struct v4l2_captureparm *cparm = &a->parm.capture; int ret = 0; switch (a->type) { /* This is the only case currently handled. */ case V4L2_BUF_TYPE_VIDEO_CAPTURE: memset(a, 0, sizeof(*a)); a->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; cparm->capability = sensor->streamcap.capability; cparm->timeperframe = sensor->streamcap.timeperframe; cparm->capturemode = sensor->streamcap.capturemode; ret = 0; break; /* These are all the possible cases. */ case V4L2_BUF_TYPE_VIDEO_OUTPUT: case V4L2_BUF_TYPE_VIDEO_OVERLAY: case V4L2_BUF_TYPE_VBI_CAPTURE: case V4L2_BUF_TYPE_VBI_OUTPUT: case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE: case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT: ret = -EINVAL; break; default: pr_debug(" type is unknown - %d\n", a->type); ret = -EINVAL; break; } return ret; } /*! * ioctl_s_parm - V4L2 sensor interface handler for VIDIOC_S_PARM ioctl * @s: pointer to standard V4L2 device structure * @a: pointer to standard V4L2 VIDIOC_S_PARM ioctl structure * * Configures the sensor to use the input parameters, if possible. If * not possible, reverts to the old parameters and returns the * appropriate error code. */ static int ioctl_s_parm(struct v4l2_int_device *s, struct v4l2_streamparm *a) { struct sensor_data *sensor = s->priv; struct v4l2_fract *timeperframe = &a->parm.capture.timeperframe; u32 tgt_fps, old_fps; /* target frames per secound */ enum ov5642_frame_rate new_frame_rate, old_frame_rate; int ret = 0; /* Make sure power on */ if (camera_plat->pwdn) camera_plat->pwdn(0); switch (a->type) { /* This is the only case currently handled. */ case V4L2_BUF_TYPE_VIDEO_CAPTURE: /* Check that the new frame rate is allowed. */ if ((timeperframe->numerator == 0) || (timeperframe->denominator == 0)) { timeperframe->denominator = DEFAULT_FPS; timeperframe->numerator = 1; } tgt_fps = timeperframe->denominator / timeperframe->numerator; if (tgt_fps > MAX_FPS) { timeperframe->denominator = MAX_FPS; timeperframe->numerator = 1; } else if (tgt_fps < MIN_FPS) { timeperframe->denominator = MIN_FPS; timeperframe->numerator = 1; } /* Actual frame rate we use */ tgt_fps = timeperframe->denominator / timeperframe->numerator; if (tgt_fps == 15) new_frame_rate = ov5642_15_fps; else if (tgt_fps == 30) new_frame_rate = ov5642_30_fps; else { pr_err(" The camera frame rate is not supported!\n"); return -EINVAL; } if (sensor->streamcap.timeperframe.numerator != 0) old_fps = sensor->streamcap.timeperframe.denominator / sensor->streamcap.timeperframe.numerator; else old_fps = 30; if (old_fps == 15) old_frame_rate = ov5642_15_fps; else if (old_fps == 30) old_frame_rate = ov5642_30_fps; else { pr_warning(" No valid frame rate set!\n"); old_frame_rate = ov5642_30_fps; } ret = ov5642_change_mode(new_frame_rate, old_frame_rate, a->parm.capture.capturemode, sensor->streamcap.capturemode); if (ret < 0) return ret; sensor->streamcap.timeperframe = *timeperframe; sensor->streamcap.capturemode = (u32)a->parm.capture.capturemode; break; /* These are all the possible cases. */ case V4L2_BUF_TYPE_VIDEO_OUTPUT: case V4L2_BUF_TYPE_VIDEO_OVERLAY: case V4L2_BUF_TYPE_VBI_CAPTURE: case V4L2_BUF_TYPE_VBI_OUTPUT: case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE: case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT: pr_debug(" type is not " \ "V4L2_BUF_TYPE_VIDEO_CAPTURE but %d\n", a->type); ret = -EINVAL; break; default: pr_debug(" type is unknown - %d\n", a->type); ret = -EINVAL; break; } return ret; } /*! * ioctl_g_fmt_cap - V4L2 sensor interface handler for ioctl_g_fmt_cap * @s: pointer to standard V4L2 device structure * @f: pointer to standard V4L2 v4l2_format structure * * Returns the sensor's current pixel format in the v4l2_format * parameter. */ static int ioctl_g_fmt_cap(struct v4l2_int_device *s, struct v4l2_format *f) { struct sensor_data *sensor = s->priv; f->fmt.pix = sensor->pix; return 0; } /*! * ioctl_g_ctrl - V4L2 sensor interface handler for VIDIOC_G_CTRL ioctl * @s: pointer to standard V4L2 device structure * @vc: standard V4L2 VIDIOC_G_CTRL ioctl structure * * If the requested control is supported, returns the control's current * value from the video_control[] array. Otherwise, returns -EINVAL * if the control is not supported. */ static int ioctl_g_ctrl(struct v4l2_int_device *s, struct v4l2_control *vc) { int ret = 0; switch (vc->id) { case V4L2_CID_BRIGHTNESS: vc->value = ov5642_data.brightness; break; case V4L2_CID_HUE: vc->value = ov5642_data.hue; break; case V4L2_CID_CONTRAST: vc->value = ov5642_data.contrast; break; case V4L2_CID_SATURATION: vc->value = ov5642_data.saturation; break; case V4L2_CID_RED_BALANCE: vc->value = ov5642_data.red; break; case V4L2_CID_BLUE_BALANCE: vc->value = ov5642_data.blue; break; case V4L2_CID_EXPOSURE: vc->value = ov5642_data.ae_mode; break; default: ret = -EINVAL; } return ret; } /*! * ioctl_s_ctrl - V4L2 sensor interface handler for VIDIOC_S_CTRL ioctl * @s: pointer to standard V4L2 device structure * @vc: standard V4L2 VIDIOC_S_CTRL ioctl structure * * If the requested control is supported, sets the control's current * value in HW (and updates the video_control[] array). Otherwise, * returns -EINVAL if the control is not supported. */ static int ioctl_s_ctrl(struct v4l2_int_device *s, struct v4l2_control *vc) { int retval = 0; struct sensor_data *sensor = s->priv; __u32 captureMode = sensor->streamcap.capturemode; pr_debug("In ov5642:ioctl_s_ctrl %d\n", vc->id); switch (vc->id) { case V4L2_CID_BRIGHTNESS: break; case V4L2_CID_CONTRAST: break; case V4L2_CID_SATURATION: break; case V4L2_CID_HUE: break; case V4L2_CID_AUTO_WHITE_BALANCE: break; case V4L2_CID_DO_WHITE_BALANCE: break; case V4L2_CID_RED_BALANCE: break; case V4L2_CID_BLUE_BALANCE: break; case V4L2_CID_GAMMA: break; case V4L2_CID_EXPOSURE: break; case V4L2_CID_AUTOGAIN: break; case V4L2_CID_GAIN: break; case V4L2_CID_HFLIP: break; case V4L2_CID_VFLIP: break; case V4L2_CID_MXC_ROT: case V4L2_CID_MXC_VF_ROT: switch (vc->value) { case V4L2_MXC_ROTATE_NONE: if (captureMode == ov5642_mode_QSXGA_2592_1944) { if (ov5642_set_rotate_mode(ov5642_rotate_none_FULL)) retval = -EPERM; } else { if (ov5642_set_rotate_mode(ov5642_rotate_none_VGA)) retval = -EPERM; } break; case V4L2_MXC_ROTATE_VERT_FLIP: if (captureMode == ov5642_mode_QSXGA_2592_1944) { if (ov5642_set_rotate_mode(ov5642_rotate_vert_flip_FULL)) retval = -EPERM; } else { if (ov5642_set_rotate_mode(ov5642_rotate_vert_flip_VGA)) retval = -EPERM; } break; case V4L2_MXC_ROTATE_HORIZ_FLIP: if (captureMode == ov5642_mode_QSXGA_2592_1944) { if (ov5642_set_rotate_mode(ov5642_rotate_horiz_flip_FULL)) retval = -EPERM; } else { if (ov5642_set_rotate_mode(ov5642_rotate_horiz_flip_VGA)) retval = -EPERM; } break; case V4L2_MXC_ROTATE_180: if (captureMode == ov5642_mode_QSXGA_2592_1944) { if (ov5642_set_rotate_mode(ov5642_rotate_180_FULL)) retval = -EPERM; } else { if (ov5642_set_rotate_mode(ov5642_rotate_180_VGA)) retval = -EPERM; } break; default: retval = -EPERM; break; } break; default: retval = -EPERM; break; } return retval; } /*! * ioctl_enum_framesizes - V4L2 sensor interface handler for * VIDIOC_ENUM_FRAMESIZES ioctl * @s: pointer to standard V4L2 device structure * @fsize: standard V4L2 VIDIOC_ENUM_FRAMESIZES ioctl structure * * Return 0 if successful, otherwise -EINVAL. */ static int ioctl_enum_framesizes(struct v4l2_int_device *s, struct v4l2_frmsizeenum *fsize) { if (fsize->index > ov5642_mode_MAX) return -EINVAL; fsize->pixel_format = ov5642_data.pix.pixelformat; fsize->discrete.width = max(ov5642_mode_info_data[0][fsize->index].width, ov5642_mode_info_data[1][fsize->index].width); fsize->discrete.height = max(ov5642_mode_info_data[0][fsize->index].height, ov5642_mode_info_data[1][fsize->index].height); return 0; } /*! * ioctl_enum_frameintervals - V4L2 sensor interface handler for * VIDIOC_ENUM_FRAMEINTERVALS ioctl * @s: pointer to standard V4L2 device structure * @fival: standard V4L2 VIDIOC_ENUM_FRAMEINTERVALS ioctl structure * * Return 0 if successful, otherwise -EINVAL. */ static int ioctl_enum_frameintervals(struct v4l2_int_device *s, struct v4l2_frmivalenum *fival) { int i, j, count; if (fival->index < 0 || fival->index > ov5642_mode_MAX) return -EINVAL; if (fival->pixel_format == 0 || fival->width == 0 || fival->height == 0) { pr_warning("Please assign pixelformat, width and height.\n"); return -EINVAL; } fival->type = V4L2_FRMIVAL_TYPE_DISCRETE; fival->discrete.numerator = 1; count = 0; for (i = 0; i < ARRAY_SIZE(ov5642_mode_info_data); i++) { for (j = 0; j < (ov5642_mode_MAX + 1); j++) { if (fival->pixel_format == ov5642_data.pix.pixelformat && fival->width == ov5642_mode_info_data[i][j].width && fival->height == ov5642_mode_info_data[i][j].height && ov5642_mode_info_data[i][j].init_data_ptr != NULL) { count++; } if (fival->index == (count - 1)) { fival->discrete.denominator = ov5642_framerates[i]; return 0; } } } return -EINVAL; } /*! * ioctl_g_chip_ident - V4L2 sensor interface handler for * VIDIOC_DBG_G_CHIP_IDENT ioctl * @s: pointer to standard V4L2 device structure * @id: pointer to int * * Return 0. */ static int ioctl_g_chip_ident(struct v4l2_int_device *s, int *id) { ((struct v4l2_dbg_chip_ident *)id)->match.type = V4L2_CHIP_MATCH_I2C_DRIVER; strcpy(((struct v4l2_dbg_chip_ident *)id)->match.name, "ov5642_camera"); return 0; } /*! * ioctl_init - V4L2 sensor interface handler for VIDIOC_INT_INIT * @s: pointer to standard V4L2 device structure */ static int ioctl_init(struct v4l2_int_device *s) { return 0; } /*! * ioctl_enum_fmt_cap - V4L2 sensor interface handler for VIDIOC_ENUM_FMT * @s: pointer to standard V4L2 device structure * @fmt: pointer to standard V4L2 fmt description structure * * Return 0. */ static int ioctl_enum_fmt_cap(struct v4l2_int_device *s, struct v4l2_fmtdesc *fmt) { if (fmt->index > 0) /* only 1 pixelformat support so far */ return -EINVAL; fmt->pixelformat = ov5642_data.pix.pixelformat; return 0; } /*! * ioctl_dev_init - V4L2 sensor interface handler for vidioc_int_dev_init_num * @s: pointer to standard V4L2 device structure * * Initialise the device when slave attaches to the master. */ static int ioctl_dev_init(struct v4l2_int_device *s) { struct reg_value *pModeSetting = NULL; s32 i = 0; s32 iModeSettingArySize = 0; register u32 Delay_ms = 0; register u16 RegAddr = 0; register u8 Mask = 0; register u8 Val = 0; u8 RegVal = 0; int retval = 0; struct sensor_data *sensor = s->priv; u32 tgt_xclk; /* target xclk */ u32 tgt_fps; /* target frames per secound */ enum ov5642_frame_rate frame_rate; ov5642_data.on = true; /* mclk */ tgt_xclk = ov5642_data.mclk; tgt_xclk = min(tgt_xclk, (u32)OV5642_XCLK_MAX); tgt_xclk = max(tgt_xclk, (u32)OV5642_XCLK_MIN); ov5642_data.mclk = tgt_xclk; pr_debug(" Setting mclk to %d MHz\n", tgt_xclk / 1000000); set_mclk_rate(&ov5642_data.mclk, ov5642_data.mclk_source); /* Default camera frame rate is set in probe */ tgt_fps = sensor->streamcap.timeperframe.denominator / sensor->streamcap.timeperframe.numerator; if (tgt_fps == 15) frame_rate = ov5642_15_fps; else if (tgt_fps == 30) frame_rate = ov5642_30_fps; else return -EINVAL; /* Only support 15fps or 30fps now. */ pModeSetting = ov5642_initial_setting; iModeSettingArySize = ARRAY_SIZE(ov5642_initial_setting); for (i = 0; i < iModeSettingArySize; ++i, ++pModeSetting) { Delay_ms = pModeSetting->u32Delay_ms; RegAddr = pModeSetting->u16RegAddr; Val = pModeSetting->u8Val; Mask = pModeSetting->u8Mask; if (Mask) { retval = ov5642_read_reg(RegAddr, &RegVal); if (retval < 0) goto err; RegVal &= ~(u8)Mask; Val &= Mask; Val |= RegVal; } retval = ov5642_write_reg(RegAddr, Val); if (retval < 0) goto err; if (Delay_ms) msleep(Delay_ms); } err: return retval; } /*! * ioctl_dev_exit - V4L2 sensor interface handler for vidioc_int_dev_exit_num * @s: pointer to standard V4L2 device structure * * Delinitialise the device when slave detaches to the master. */ static int ioctl_dev_exit(struct v4l2_int_device *s) { return 0; } /*! * This structure defines all the ioctls for this module and links them to the * enumeration. */ static struct v4l2_int_ioctl_desc ov5642_ioctl_desc[] = { {vidioc_int_dev_init_num, (v4l2_int_ioctl_func *)ioctl_dev_init}, {vidioc_int_dev_exit_num, ioctl_dev_exit}, {vidioc_int_s_power_num, (v4l2_int_ioctl_func *)ioctl_s_power}, {vidioc_int_g_ifparm_num, (v4l2_int_ioctl_func *)ioctl_g_ifparm}, /* {vidioc_int_g_needs_reset_num, (v4l2_int_ioctl_func *)ioctl_g_needs_reset}, */ /* {vidioc_int_reset_num, (v4l2_int_ioctl_func *)ioctl_reset}, */ {vidioc_int_init_num, (v4l2_int_ioctl_func *)ioctl_init}, {vidioc_int_enum_fmt_cap_num, (v4l2_int_ioctl_func *)ioctl_enum_fmt_cap}, /* {vidioc_int_try_fmt_cap_num, (v4l2_int_ioctl_func *)ioctl_try_fmt_cap}, */ {vidioc_int_g_fmt_cap_num, (v4l2_int_ioctl_func *)ioctl_g_fmt_cap}, /* {vidioc_int_s_fmt_cap_num, (v4l2_int_ioctl_func *)ioctl_s_fmt_cap}, */ {vidioc_int_g_parm_num, (v4l2_int_ioctl_func *)ioctl_g_parm}, {vidioc_int_s_parm_num, (v4l2_int_ioctl_func *)ioctl_s_parm}, /* {vidioc_int_queryctrl_num, (v4l2_int_ioctl_func *)ioctl_queryctrl}, */ {vidioc_int_g_ctrl_num, (v4l2_int_ioctl_func *)ioctl_g_ctrl}, {vidioc_int_s_ctrl_num, (v4l2_int_ioctl_func *)ioctl_s_ctrl}, {vidioc_int_enum_framesizes_num, (v4l2_int_ioctl_func *)ioctl_enum_framesizes}, {vidioc_int_enum_frameintervals_num, (v4l2_int_ioctl_func *)ioctl_enum_frameintervals}, {vidioc_int_g_chip_ident_num, (v4l2_int_ioctl_func *)ioctl_g_chip_ident}, }; static struct v4l2_int_slave ov5642_slave = { .ioctls = ov5642_ioctl_desc, .num_ioctls = ARRAY_SIZE(ov5642_ioctl_desc), }; static struct v4l2_int_device ov5642_int_device = { .module = THIS_MODULE, .name = "ov5642", .type = v4l2_int_type_slave, .u = { .slave = &ov5642_slave, }, }; /*! * ov5642 I2C probe function * * @param adapter struct i2c_adapter * * @return Error code indicating success or failure */ static int ov5642_probe(struct i2c_client *client, const struct i2c_device_id *id) { int retval; struct fsl_mxc_camera_platform_data *plat_data = client->dev.platform_data; u8 chip_id_high, chip_id_low; /* Set initial values for the sensor struct. */ memset(&ov5642_data, 0, sizeof(ov5642_data)); ov5642_data.mclk = 24000000; /* 6 - 54 MHz, typical 24MHz */ ov5642_data.mclk = plat_data->mclk; ov5642_data.mclk_source = plat_data->mclk_source; ov5642_data.csi = plat_data->csi; ov5642_data.io_init = plat_data->io_init; ov5642_data.i2c_client = client; ov5642_data.pix.pixelformat = V4L2_PIX_FMT_YUYV; ov5642_data.pix.width = 640; ov5642_data.pix.height = 480; ov5642_data.streamcap.capability = V4L2_MODE_HIGHQUALITY | V4L2_CAP_TIMEPERFRAME; ov5642_data.streamcap.capturemode = 0; ov5642_data.streamcap.timeperframe.denominator = DEFAULT_FPS; ov5642_data.streamcap.timeperframe.numerator = 1; if (plat_data->io_regulator) { io_regulator = regulator_get(&client->dev, plat_data->io_regulator); if (!IS_ERR(io_regulator)) { regulator_set_voltage(io_regulator, OV5642_VOLTAGE_DIGITAL_IO, OV5642_VOLTAGE_DIGITAL_IO); retval = regulator_enable(io_regulator); if (retval) { pr_err("%s:io set voltage error\n", __func__); goto err1; } else { dev_dbg(&client->dev, "%s:io set voltage ok\n", __func__); } } else io_regulator = NULL; } if (plat_data->core_regulator) { core_regulator = regulator_get(&client->dev, plat_data->core_regulator); if (!IS_ERR(core_regulator)) { regulator_set_voltage(core_regulator, OV5642_VOLTAGE_DIGITAL_CORE, OV5642_VOLTAGE_DIGITAL_CORE); retval = regulator_enable(core_regulator); if (retval) { pr_err("%s:core set voltage error\n", __func__); goto err2; } else { dev_dbg(&client->dev, "%s:core set voltage ok\n", __func__); } } else core_regulator = NULL; } if (plat_data->analog_regulator) { analog_regulator = regulator_get(&client->dev, plat_data->analog_regulator); if (!IS_ERR(analog_regulator)) { regulator_set_voltage(analog_regulator, OV5642_VOLTAGE_ANALOG, OV5642_VOLTAGE_ANALOG); retval = regulator_enable(analog_regulator); if (retval) { pr_err("%s:analog set voltage error\n", __func__); goto err3; } else { dev_dbg(&client->dev, "%s:analog set voltage ok\n", __func__); } } else analog_regulator = NULL; } if (plat_data->io_init) plat_data->io_init(); if (plat_data->pwdn) plat_data->pwdn(0); retval = ov5642_read_reg(OV5642_CHIP_ID_HIGH_BYTE, &chip_id_high); if (retval < 0 || chip_id_high != 0x56) { pr_err("%s:cannot find camera\n", __func__); retval = -ENODEV; goto err4; } retval = ov5642_read_reg(OV5642_CHIP_ID_LOW_BYTE, &chip_id_low); if (retval < 0 || chip_id_low != 0x42) { pr_err("%s:cannot find camera\n", __func__); retval = -ENODEV; goto err4; } if (plat_data->pwdn) plat_data->pwdn(1); camera_plat = plat_data; ov5642_int_device.priv = &ov5642_data; retval = v4l2_int_device_register(&ov5642_int_device); return retval; err4: if (analog_regulator) { regulator_disable(analog_regulator); regulator_put(analog_regulator); } err3: if (core_regulator) { regulator_disable(core_regulator); regulator_put(core_regulator); } err2: if (io_regulator) { regulator_disable(io_regulator); regulator_put(io_regulator); } err1: return retval; } /*! * ov5642 I2C detach function * * @param client struct i2c_client * * @return Error code indicating success or failure */ static int ov5642_remove(struct i2c_client *client) { v4l2_int_device_unregister(&ov5642_int_device); if (gpo_regulator) { regulator_disable(gpo_regulator); regulator_put(gpo_regulator); } if (analog_regulator) { regulator_disable(analog_regulator); regulator_put(analog_regulator); } if (core_regulator) { regulator_disable(core_regulator); regulator_put(core_regulator); } if (io_regulator) { regulator_disable(io_regulator); regulator_put(io_regulator); } return 0; } /*! * ov5642 init function * Called by insmod ov5642_camera.ko. * * @return Error code indicating success or failure */ static __init int ov5642_init(void) { u8 err; err = i2c_add_driver(&ov5642_i2c_driver); if (err != 0) pr_err("%s:driver registration failed, error=%d \n", __func__, err); return err; } /*! * OV5642 cleanup function * Called on rmmod ov5642_camera.ko * * @return Error code indicating success or failure */ static void __exit ov5642_clean(void) { i2c_del_driver(&ov5642_i2c_driver); } module_init(ov5642_init); module_exit(ov5642_clean); MODULE_AUTHOR("Freescale Semiconductor, Inc."); MODULE_DESCRIPTION("OV5642 Camera Driver"); MODULE_LICENSE("GPL"); MODULE_VERSION("1.0"); MODULE_ALIAS("CSI");
imx6-dongle/linux-imx
drivers/media/video/mxc/capture/ov5642.c
C
gpl-2.0
220,993
[ 30522, 1013, 1008, 1008, 9385, 1006, 1039, 1007, 2262, 2489, 15782, 2571, 20681, 1010, 4297, 1012, 2035, 2916, 9235, 1012, 1008, 1013, 1013, 1008, 1008, 2023, 2565, 2003, 2489, 4007, 1025, 2017, 2064, 2417, 2923, 3089, 8569, 2618, 2009, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package logging import ( "fmt" "os" "time" "github.com/op/go-logging" ) const ( size = 1024 ) var ( Log *CTopLogger exited bool level = logging.INFO // default level format = logging.MustStringFormatter( `%{color}%{time:15:04:05.000} ▶ %{level:.4s} %{id:03x}%{color:reset} %{message}`, ) ) type statusMsg struct { Text string IsError bool } type CTopLogger struct { *logging.Logger backend *logging.MemoryBackend logFile *os.File sLog []statusMsg } func (c *CTopLogger) FlushStatus() chan statusMsg { ch := make(chan statusMsg) go func() { for _, sm := range c.sLog { ch <- sm } close(ch) c.sLog = []statusMsg{} }() return ch } func (c *CTopLogger) StatusQueued() bool { return len(c.sLog) > 0 } func (c *CTopLogger) Status(s string) { c.addStatus(statusMsg{s, false}) } func (c *CTopLogger) StatusErr(err error) { c.addStatus(statusMsg{err.Error(), true}) } func (c *CTopLogger) addStatus(sm statusMsg) { c.sLog = append(c.sLog, sm) } func (c *CTopLogger) Statusf(s string, a ...interface{}) { c.Status(fmt.Sprintf(s, a...)) } func Init() *CTopLogger { if Log == nil { logging.SetFormatter(format) // setup default formatter Log = &CTopLogger{ logging.MustGetLogger("ctop"), logging.NewMemoryBackend(size), nil, []statusMsg{}, } debugMode := debugMode() if debugMode { level = logging.DEBUG } backendLvl := logging.AddModuleLevel(Log.backend) backendLvl.SetLevel(level, "") logFilePath := debugModeFile() if logFilePath == "" { logging.SetBackend(backendLvl) } else { logFile, err := os.OpenFile(logFilePath, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0666) if err != nil { logging.SetBackend(backendLvl) Log.Error("Unable to create log file: %s", err.Error()) } else { backendFile := logging.NewLogBackend(logFile, "", 0) backendFileLvl := logging.AddModuleLevel(backendFile) backendFileLvl.SetLevel(level, "") logging.SetBackend(backendLvl, backendFileLvl) Log.logFile = logFile } } if debugMode { StartServer() } Log.Notice("logger initialized") } return Log } func (log *CTopLogger) tail() chan string { stream := make(chan string) node := log.backend.Head() go func() { for { stream <- node.Record.Formatted(0) for { nnode := node.Next() if nnode != nil { node = nnode break } if exited { close(stream) return } time.Sleep(1 * time.Second) } } }() return stream } func (log *CTopLogger) Exit() { exited = true if log.logFile != nil { _ = log.logFile.Close() } StopServer() } func debugMode() bool { return os.Getenv("CTOP_DEBUG") == "1" } func debugModeTCP() bool { return os.Getenv("CTOP_DEBUG_TCP") == "1" } func debugModeFile() string { return os.Getenv("CTOP_DEBUG_FILE") }
bcicen/ctop
logging/main.go
GO
mit
2,827
[ 30522, 7427, 15899, 12324, 1006, 1000, 4718, 2102, 1000, 1000, 9808, 1000, 1000, 2051, 1000, 1000, 21025, 2705, 12083, 1012, 4012, 1013, 6728, 1013, 2175, 1011, 15899, 1000, 1007, 9530, 3367, 1006, 2946, 1027, 9402, 2549, 1007, 13075, 1006,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# Chlorobotryaceae FAMILY #### Status ACCEPTED #### According to Interim Register of Marine and Nonmarine Genera #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Chromista/Ochrophyta/Eustigmatophyceae/Chlorobotryaceae/README.md
Markdown
apache-2.0
181
[ 30522, 1001, 10381, 10626, 16429, 4140, 20444, 9071, 2155, 1001, 1001, 1001, 1001, 3570, 3970, 1001, 1001, 1001, 1001, 2429, 2000, 9455, 4236, 1997, 3884, 1998, 2512, 21966, 11416, 1001, 1001, 1001, 1001, 2405, 1999, 19701, 1001, 1001, 1001...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#!/usr/bin/python # Copyright (c) 2012 The Native Client 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 json import os import subprocess import sys sys.path.append(os.path.join(os.path.dirname(__file__), '..')) import pynacl.platform python = sys.executable bash = '/bin/bash' echo = 'echo' BOT_ASSIGNMENT = { ###################################################################### # Buildbots. ###################################################################### 'xp-newlib-opt': python + ' buildbot\\buildbot_standard.py opt 32 newlib --no-gyp', 'xp-glibc-opt': python + ' buildbot\\buildbot_standard.py opt 32 glibc --no-gyp', 'xp-bare-newlib-opt': python + ' buildbot\\buildbot_standard.py opt 32 newlib --no-gyp', 'xp-bare-glibc-opt': python + ' buildbot\\buildbot_standard.py opt 32 glibc --no-gyp', 'precise-64-validator-opt': python + ' buildbot/buildbot_standard.py opt 64 glibc --validator', # Clang. 'precise_64-newlib-dbg-clang': python + ' buildbot/buildbot_standard.py dbg 64 newlib --clang', 'mac10.7-newlib-dbg-clang': python + ' buildbot/buildbot_standard.py dbg 32 newlib --clang', # ASan. 'precise_64-newlib-dbg-asan': python + ' buildbot/buildbot_standard.py opt 64 newlib --asan', 'mac10.7-newlib-dbg-asan': python + ' buildbot/buildbot_standard.py opt 32 newlib --asan', # PNaCl. 'oneiric_32-newlib-arm_hw-pnacl-panda-dbg': bash + ' buildbot/buildbot_pnacl.sh mode-buildbot-arm-hw-dbg', 'oneiric_32-newlib-arm_hw-pnacl-panda-opt': bash + ' buildbot/buildbot_pnacl.sh mode-buildbot-arm-hw-opt', 'precise_64-newlib-arm_qemu-pnacl-dbg': bash + ' buildbot/buildbot_pnacl.sh mode-buildbot-arm-dbg', 'precise_64-newlib-arm_qemu-pnacl-opt': bash + ' buildbot/buildbot_pnacl.sh mode-buildbot-arm-opt', 'precise_64-newlib-x86_32-pnacl': python + ' buildbot/buildbot_pnacl.py opt 32 pnacl', 'precise_64-newlib-x86_64-pnacl': python + ' buildbot/buildbot_pnacl.py opt 64 pnacl', 'mac10.8-newlib-opt-pnacl': python + ' buildbot/buildbot_pnacl.py opt 32 pnacl', 'win7-64-newlib-opt-pnacl': python + ' buildbot/buildbot_pnacl.py opt 64 pnacl', 'precise_64-newlib-mips-pnacl': echo + ' "TODO(mseaborn): add mips"', # PNaCl Spec 'precise_64-newlib-arm_qemu-pnacl-buildonly-spec': bash + ' buildbot/buildbot_spec2k.sh pnacl-arm-buildonly', 'oneiric_32-newlib-arm_hw-pnacl-panda-spec': bash + ' buildbot/buildbot_spec2k.sh pnacl-arm-hw', 'lucid_64-newlib-x86_32-pnacl-spec': bash + ' buildbot/buildbot_spec2k.sh pnacl-x8632', 'lucid_64-newlib-x86_64-pnacl-spec': bash + ' buildbot/buildbot_spec2k.sh pnacl-x8664', # NaCl Spec 'lucid_64-newlib-x86_32-spec': bash + ' buildbot/buildbot_spec2k.sh nacl-x8632', 'lucid_64-newlib-x86_64-spec': bash + ' buildbot/buildbot_spec2k.sh nacl-x8664', # Valgrind bots. 'precise-64-newlib-dbg-valgrind': echo + ' "Valgrind bots are disabled: see ' 'https://code.google.com/p/nativeclient/issues/detail?id=3158"', 'precise-64-glibc-dbg-valgrind': echo + ' "Valgrind bots are disabled: see ' 'https://code.google.com/p/nativeclient/issues/detail?id=3158"', # Coverage. 'mac10.6-newlib-coverage': python + (' buildbot/buildbot_standard.py ' 'coverage 64 newlib --coverage'), 'precise-64-32-newlib-coverage': python + (' buildbot/buildbot_standard.py ' 'coverage 32 newlib --coverage'), 'precise-64-64-newlib-coverage': python + (' buildbot/buildbot_standard.py ' 'coverage 64 newlib --coverage'), 'xp-newlib-coverage': python + (' buildbot/buildbot_standard.py ' 'coverage 32 newlib --coverage'), ###################################################################### # Trybots. ###################################################################### 'nacl-precise64_validator_opt': python + ' buildbot/buildbot_standard.py opt 64 glibc --validator', 'nacl-precise64_newlib_dbg_valgrind': bash + ' buildbot/buildbot_valgrind.sh newlib', 'nacl-precise64_glibc_dbg_valgrind': bash + ' buildbot/buildbot_valgrind.sh glibc', # Coverage trybots. 'nacl-mac10.6-newlib-coverage': python + (' buildbot/buildbot_standard.py ' 'coverage 64 newlib --coverage'), 'nacl-precise-64-32-newlib-coverage': python + (' buildbot/buildbot_standard.py ' 'coverage 32 newlib --coverage'), 'nacl-precise-64-64-newlib-coverage': python + (' buildbot/buildbot_standard.py ' 'coverage 64 newlib --coverage'), 'nacl-win32-newlib-coverage': python + (' buildbot/buildbot_standard.py ' 'coverage 32 newlib --coverage'), # Clang trybots. 'nacl-precise_64-newlib-dbg-clang': python + ' buildbot/buildbot_standard.py dbg 64 newlib --clang', 'nacl-mac10.6-newlib-dbg-clang': python + ' buildbot/buildbot_standard.py dbg 32 newlib --clang', # Pnacl main trybots 'nacl-precise_64-newlib-arm_qemu-pnacl': bash + ' buildbot/buildbot_pnacl.sh mode-trybot-qemu', 'nacl-precise_64-newlib-x86_32-pnacl': python + ' buildbot/buildbot_pnacl.py opt 32 pnacl', 'nacl-precise_64-newlib-x86_64-pnacl': python + ' buildbot/buildbot_pnacl.py opt 64 pnacl', 'nacl-precise_64-newlib-mips-pnacl': echo + ' "TODO(mseaborn): add mips"', 'nacl-arm_opt_panda': bash + ' buildbot/buildbot_pnacl.sh mode-buildbot-arm-try', 'nacl-arm_hw_opt_panda': bash + ' buildbot/buildbot_pnacl.sh mode-buildbot-arm-hw-try', 'nacl-mac10.8_newlib_opt_pnacl': python + ' buildbot/buildbot_pnacl.py opt 32 pnacl', 'nacl-win7_64_newlib_opt_pnacl': python + ' buildbot/buildbot_pnacl.py opt 64 pnacl', # Pnacl spec2k trybots 'nacl-precise_64-newlib-x86_32-pnacl-spec': bash + ' buildbot/buildbot_spec2k.sh pnacl-trybot-x8632', 'nacl-precise_64-newlib-x86_64-pnacl-spec': bash + ' buildbot/buildbot_spec2k.sh pnacl-trybot-x8664', 'nacl-arm_perf_panda': bash + ' buildbot/buildbot_spec2k.sh pnacl-trybot-arm-buildonly', 'nacl-arm_hw_perf_panda': bash + ' buildbot/buildbot_spec2k.sh pnacl-trybot-arm-hw', # Toolchain glibc. 'precise64-glibc': bash + ' buildbot/buildbot_linux-glibc-makefile.sh', 'mac-glibc': bash + ' buildbot/buildbot_mac-glibc-makefile.sh', 'win7-glibc': 'buildbot\\buildbot_windows-glibc-makefile.bat', # Toolchain newlib x86. 'win7-toolchain_x86': 'buildbot\\buildbot_toolchain_win.bat', 'mac-toolchain_x86': bash + ' buildbot/buildbot_toolchain.sh mac', 'precise64-toolchain_x86': bash + ' buildbot/buildbot_toolchain.sh linux', # Toolchain newlib arm. 'win7-toolchain_arm': python + ' buildbot/buildbot_toolchain_build.py' ' toolchain_build' ' --buildbot', 'mac-toolchain_arm': python + ' buildbot/buildbot_toolchain_build.py' ' toolchain_build' ' --buildbot', 'precise64-toolchain_arm': python + ' buildbot/buildbot_toolchain_build.py' ' toolchain_build' ' --buildbot', # BIONIC toolchain builders. 'precise64-toolchain_bionic': python + ' buildbot/buildbot_toolchain_build.py' ' toolchain_build_bionic' ' --buildbot', # Pnacl toolchain builders. 'linux-armtools-x86_32': bash + ' buildbot/buildbot_toolchain_arm_trusted.sh', 'linux-pnacl-x86_32': python + ' buildbot/buildbot_pnacl_toolchain.py --buildbot', 'linux-pnacl-x86_64': python + ' buildbot/buildbot_pnacl_toolchain.py --buildbot', 'precise-pnacl-x86_32': python + ' buildbot/buildbot_pnacl_toolchain.py --buildbot', 'precise-pnacl-x86_64': python + ' buildbot/buildbot_pnacl_toolchain.py --buildbot', 'mac-pnacl-x86_32': python + ' buildbot/buildbot_pnacl_toolchain.py --buildbot', # TODO(robertm): Delete this once we are using win-pnacl-x86_64 'win-pnacl-x86_32': python + ' buildbot/buildbot_pnacl_toolchain.py --buildbot', # TODO(robertm): use this in favor or the misnamed win-pnacl-x86_32 'win-pnacl-x86_64': python + ' buildbot/buildbot_pnacl_toolchain.py --buildbot', # Pnacl toolchain testers 'linux-pnacl-x86_64-tests-x86_64': bash + ' buildbot/buildbot_pnacl_toolchain_tests.sh tc-test-bot x86-64', 'linux-pnacl-x86_64-tests-x86_32': bash + ' buildbot/buildbot_pnacl_toolchain_tests.sh tc-test-bot x86-32', 'linux-pnacl-x86_64-tests-arm': bash + ' buildbot/buildbot_pnacl_toolchain_tests.sh tc-test-bot arm', # MIPS toolchain buildbot. 'linux-pnacl-x86_32-tests-mips': bash + ' buildbot/buildbot_toolchain_mips_trusted.sh', # Toolchain trybots. 'nacl-toolchain-precise64-newlib': bash + ' buildbot/buildbot_toolchain.sh linux', 'nacl-toolchain-mac-newlib': bash + ' buildbot/buildbot_toolchain.sh mac', 'nacl-toolchain-win7-newlib': 'buildbot\\buildbot_toolchain_win.bat', 'nacl-toolchain-precise64-newlib-arm': python + ' buildbot/buildbot_toolchain_build.py' ' toolchain_build' ' --trybot', 'nacl-toolchain-mac-newlib-arm': python + ' buildbot/buildbot_toolchain_build.py' ' toolchain_build' ' --trybot', 'nacl-toolchain-win7-newlib-arm': python + ' buildbot/buildbot_toolchain_build.py' ' toolchain_build' ' --trybot', 'nacl-toolchain-precise64-glibc': bash + ' buildbot/buildbot_linux-glibc-makefile.sh', 'nacl-toolchain-mac-glibc': bash + ' buildbot/buildbot_mac-glibc-makefile.sh', 'nacl-toolchain-win7-glibc': 'buildbot\\buildbot_windows-glibc-makefile.bat', # Pnacl toolchain trybots. 'nacl-toolchain-linux-pnacl-x86_32': python + ' buildbot/buildbot_pnacl_toolchain.py --trybot', 'nacl-toolchain-linux-pnacl-x86_64': python + ' buildbot/buildbot_pnacl_toolchain.py --trybot', 'nacl-toolchain-linux-pnacl-mips': echo + ' "TODO(mseaborn)"', 'nacl-toolchain-precise-pnacl-x86_32': python + ' buildbot/buildbot_pnacl_toolchain.py --trybot', 'nacl-toolchain-precise-pnacl-x86_64': python + ' buildbot/buildbot_pnacl_toolchain.py --trybot', 'nacl-toolchain-precise-pnacl-mips': echo + ' "TODO(mseaborn)"', 'nacl-toolchain-mac-pnacl-x86_32': python + ' buildbot/buildbot_pnacl_toolchain.py --trybot', 'nacl-toolchain-win7-pnacl-x86_64': python + ' buildbot/buildbot_pnacl_toolchain.py --trybot', } special_for_arm = [ 'win7_64', 'win7-64', 'lucid-64', 'lucid64', 'precise-64', 'precise64' ] for platform in [ 'vista', 'win7', 'win8', 'win', 'mac10.6', 'mac10.7', 'mac10.8', 'lucid', 'precise'] + special_for_arm: if platform in special_for_arm: arch_variants = ['arm'] else: arch_variants = ['', '32', '64', 'arm'] for arch in arch_variants: arch_flags = '' real_arch = arch arch_part = '-' + arch # Disable GYP build for win32 bots and arm cross-builders. In this case # "win" means Windows XP, not Vista, Windows 7, etc. # # Building via GYP always builds all toolchains by default, but the win32 # XP pnacl builds are pathologically slow (e.g. ~38 seconds per compile on # the nacl-win32_glibc_opt trybot). There are other builders that test # Windows builds via gyp, so the reduced test coverage should be slight. if arch == 'arm' or (platform == 'win' and arch == '32'): arch_flags += ' --no-gyp' if arch == '': arch_part = '' real_arch = '32' # Test with Breakpad tools only on basic Linux builds. if sys.platform.startswith('linux'): arch_flags += ' --use-breakpad-tools' for mode in ['dbg', 'opt']: for libc in ['newlib', 'glibc']: # Buildbots. for bare in ['', '-bare']: name = platform + arch_part + bare + '-' + libc + '-' + mode assert name not in BOT_ASSIGNMENT, name BOT_ASSIGNMENT[name] = ( python + ' buildbot/buildbot_standard.py ' + mode + ' ' + real_arch + ' ' + libc + arch_flags) # Trybots for arch_sep in ['', '-', '_']: name = 'nacl-' + platform + arch_sep + arch + '_' + libc + '_' + mode assert name not in BOT_ASSIGNMENT, name BOT_ASSIGNMENT[name] = ( python + ' buildbot/buildbot_standard.py ' + mode + ' ' + real_arch + ' ' + libc + arch_flags) def EscapeJson(data): return '"' + json.dumps(data).replace('"', r'\"') + '"' def Main(): builder = os.environ.get('BUILDBOT_BUILDERNAME') build_number = os.environ.get('BUILDBOT_BUILDNUMBER') slave_type = os.environ.get('BUILDBOT_SLAVE_TYPE') cmd = BOT_ASSIGNMENT.get(builder) if not cmd: sys.stderr.write('ERROR - unset/invalid builder name\n') sys.exit(1) env = os.environ.copy() # Don't write out .pyc files because in cases in which files move around or # the PYTHONPATH / sys.path change, old .pyc files can be mistakenly used. # This avoids the need for admin changes on the bots in this case. env['PYTHONDONTWRITEBYTECODE'] = '1' # Use .boto file from home-dir instead of buildbot supplied one. if 'AWS_CREDENTIAL_FILE' in env: del env['AWS_CREDENTIAL_FILE'] env['BOTO_CONFIG'] = os.path.expanduser('~/.boto') env['GSUTIL'] = '/b/build/third_party/gsutil/gsutil' # When running from cygwin, we sometimes want to use a native python. # The native python will use the depot_tools version by invoking python.bat. if pynacl.platform.IsWindows(): env['NATIVE_PYTHON'] = 'python.bat' else: env['NATIVE_PYTHON'] = 'python' if sys.platform == 'win32': # If the temp directory is not on the same drive as the working directory, # there can be random failures when cleaning up temp directories, so use # a directory on the current drive. Use __file__ here instead of os.getcwd() # because toolchain_main picks its working directories relative to __file__ filedrive, _ = os.path.splitdrive(__file__) tempdrive, _ = os.path.splitdrive(env['TEMP']) if tempdrive != filedrive: env['TEMP'] = filedrive + '\\temp' env['TMP'] = env['TEMP'] if not os.path.exists(env['TEMP']): os.mkdir(env['TEMP']) # Run through runtest.py to get upload of perf data. build_properties = { 'buildername': builder, 'mastername': 'client.nacl', 'buildnumber': str(build_number), } factory_properties = { 'perf_id': builder, 'show_perf_results': True, 'step_name': 'naclperf', # Seems unused, but is required. 'test_name': 'naclperf', # Really "Test Suite" } # Locate the buildbot build directory by relative path, as it's absolute # location varies by platform and configuration. buildbot_build_dir = os.path.join(* [os.pardir] * 4) runtest = os.path.join(buildbot_build_dir, 'scripts', 'slave', 'runtest.py') # For builds with an actual build number, require that the script is present # (i.e. that we're run from an actual buildbot). if build_number is not None and not os.path.exists(runtest): raise Exception('runtest.py script not found at: %s\n' % runtest) cmd_exe = cmd.split(' ')[0] cmd_exe_ext = os.path.splitext(cmd_exe)[1] # Do not wrap these types of builds with runtest.py: # - tryjobs # - commands beginning with 'echo ' # - batch files # - debug builders if not (slave_type == 'Trybot' or cmd_exe == echo or cmd_exe_ext == '.bat' or '-dbg' in builder): # Perf dashboards are now generated by output scraping that occurs in the # script runtest.py, which lives in the buildbot repository. # Non-trybot builds should be run through runtest, allowing it to upload # perf data if relevant. cmd = ' '.join([ python, runtest, '--build-dir=src/out', '--results-url=https://chromeperf.appspot.com', '--annotate=graphing', '--no-xvfb', # We provide our own xvfb invocation. '--factory-properties', EscapeJson(factory_properties), '--build-properties', EscapeJson(build_properties), cmd, ]) print "%s runs: %s\n" % (builder, cmd) retcode = subprocess.call(cmd, env=env, shell=True) sys.exit(retcode) if __name__ == '__main__': Main()
wilsonianb/nacl_contracts
buildbot/buildbot_selector.py
Python
bsd-3-clause
16,846
[ 30522, 30524, 3120, 3642, 2003, 9950, 2011, 1037, 18667, 2094, 1011, 2806, 6105, 2008, 2064, 2022, 1001, 2179, 1999, 1996, 6105, 5371, 1012, 12324, 1046, 3385, 12324, 9808, 12324, 4942, 21572, 9623, 2015, 12324, 25353, 2015, 25353, 2015, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
using System.Collections; using System.Collections.Generic; using UnityEngine; public class SinglePlayerButton : MonoBehaviour { // Use this for initialization void Start () { } // Update is called once per frame void Update () { } }
Hegberg/AreaOfControl
Assets/Scripts/MainMenu/SinglePlayerButton.cs
C#
apache-2.0
253
[ 30522, 2478, 2291, 1012, 6407, 1025, 2478, 2291, 1012, 6407, 1012, 12391, 1025, 2478, 8499, 13159, 3170, 1025, 2270, 2465, 2309, 13068, 2121, 8569, 15474, 1024, 18847, 4783, 3270, 25500, 3126, 1063, 1013, 1013, 2224, 2023, 2005, 3988, 3989,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
'use strict'; /** * Module dependencies. */ var mongoose = require('mongoose'), CurrentModel = mongoose.model('Attendance'), Schedule = mongoose.model('Schedule'), Group = mongoose.model('Group'), _ = require('lodash'); exports.attendance = function(req, res, next, id) { CurrentModel.load(id, function(err, item) { if (err) return next(err); if (!item) return next(new Error('Failed to load item ' + id)); req.attendance = item; next(); }); }; exports.schedule = function(req, res, next, id) { Schedule.load(id, function(err, item) { if (err) return next(err); if (!item) return next(new Error('Failed to load item ' + id)); req.schedule = item; next(); }); }; exports.group = function(req, res, next, id) { Group.load(id, function(err, item) { if (err) return next(err); if (!item) return next(new Error('Failed to load item ' + id)); req.group = item; next(); }); }; exports.create = function(req, res) { var value = new CurrentModel(req.body); value.group = req.group; value.schedule = req.schedule; value.save(function(err) { if (err) { return res.send('users/signup', { errors: err.errors, object: value }); } else { res.jsonp(value); } }); }; exports.update = function(req, res) { var item = req.attendance; item = _.extend(item, req.body); item.save(function(err) { if (err) { return res.send('users/signup', { errors: err.errors, object: item }); } else { res.jsonp(item); } }); }; exports.destroy = function(req, res) { var item = req.attendance; item.remove(function(err) { if (err) { return res.send('users/signup', { errors: err.errors, object: item }); } else { res.jsonp(item); } }); }; exports.show = function(req, res) { res.jsonp(req.attendance); }; exports.all = function(req, res) { CurrentModel.find({ group: req.group, schedule: req.schedule }).populate('participant', 'name email').exec(function(err, items) { if (err) { res.render('error', { status: 500 }); } else { res.jsonp(items); } }); };
wolf-mtwo/attendance
packages/custom/groups/server/controllers/attendances.js
JavaScript
mit
2,206
[ 30522, 1005, 2224, 9384, 1005, 1025, 1013, 1008, 1008, 1008, 11336, 12530, 15266, 1012, 1008, 1013, 13075, 12256, 3995, 9232, 1027, 5478, 1006, 1005, 12256, 3995, 9232, 1005, 1007, 1010, 2783, 5302, 9247, 1027, 12256, 3995, 9232, 1012, 2944...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
import React, {Component, PropTypes} from 'react'; import * as actions from './ForumAction'; import ForumPage from './ForumPage'; class ForumContainer extends Component { constructor(props) { super(props); this.state = { questions: [] }; this.postQuestion = this.postQuestion.bind(this); } postQuestion(model) { actions.postQuestion(model).then(response => { const questions = this.state.questions.concat([response]); this.setState({questions}); }); } componentDidMount() { actions.getQuestions().then(response => { this.setState({questions: response}); }); } render() { return <ForumPage {...this.state} postQuestion={this.postQuestion}/>; } } export default ForumContainer;
JSVillage/military-families-backend
client/components/forum/ForumContainer.js
JavaScript
mit
830
[ 30522, 12324, 10509, 1010, 1063, 6922, 1010, 17678, 13874, 2015, 1065, 2013, 1005, 10509, 1005, 1025, 12324, 1008, 2004, 4506, 2013, 1005, 1012, 1013, 7057, 18908, 3258, 1005, 1025, 12324, 7057, 13704, 2013, 1005, 1012, 1013, 7057, 13704, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package treehou.se.habit.ui.util; import android.content.Context; import android.graphics.Color; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v7.widget.DefaultItemAnimator; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; import com.mikepenz.community_material_typeface_library.CommunityMaterial; import com.mikepenz.iconics.IconicsDrawable; import com.mikepenz.iconics.typeface.IIcon; import java.util.ArrayList; import java.util.List; import treehou.se.habit.R; import treehou.se.habit.util.Util; /** * Fragment for picking categories of icons. */ public class CategoryPickerFragment extends Fragment { private RecyclerView lstIcons; private CategoryAdapter adapter; private ViewGroup container; public static CategoryPickerFragment newInstance() { CategoryPickerFragment fragment = new CategoryPickerFragment(); Bundle args = new Bundle(); fragment.setArguments(args); return fragment; } public CategoryPickerFragment() { // Required empty public constructor } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_icon_picker, null); lstIcons = (RecyclerView) rootView.findViewById(R.id.lst_categories); lstIcons.setItemAnimator(new DefaultItemAnimator()); lstIcons.setLayoutManager(new LinearLayoutManager(getActivity())); // Hookup list of categories adapter = new CategoryAdapter(getActivity()); adapter.add(new CategoryPicker(CommunityMaterial.Icon.cmd_play, getString(R.string.media), Util.IconCategory.MEDIA)); adapter.add(new CategoryPicker(CommunityMaterial.Icon.cmd_alarm, getString(R.string.sensor), Util.IconCategory.SENSORS)); adapter.add(new CategoryPicker(CommunityMaterial.Icon.cmd_power, getString(R.string.command), Util.IconCategory.COMMANDS)); adapter.add(new CategoryPicker(CommunityMaterial.Icon.cmd_arrow_up, getString(R.string.arrows), Util.IconCategory.ARROWS)); adapter.add(new CategoryPicker(CommunityMaterial.Icon.cmd_view_module, getString(R.string.all), Util.IconCategory.ALL)); lstIcons.setAdapter(adapter); this.container = container; return rootView; } private class CategoryPicker { private IIcon icon; private String category; private Util.IconCategory id; public CategoryPicker(IIcon icon, String category, Util.IconCategory id) { this.icon = icon; this.category = category; this.id = id; } public String getCategory() { return category; } public void setCategory(String category) { this.category = category; } public IIcon getIcon() { return icon; } public void setIcon(IIcon icon) { this.icon = icon; } public Util.IconCategory getId() { return id; } public void setId(Util.IconCategory id) { this.id = id; } } private class CategoryAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { private Context context; private List<CategoryPicker> categories = new ArrayList<>(); class CategoryHolder extends RecyclerView.ViewHolder { public ImageView imgIcon; public TextView lblCategory; public CategoryHolder(View itemView) { super(itemView); imgIcon = (ImageView) itemView.findViewById(R.id.img_menu); lblCategory = (TextView) itemView.findViewById(R.id.lbl_label); } } public CategoryAdapter(Context context) { this.context = context; } public void add(CategoryPicker category){ categories.add(category); notifyDataSetChanged(); } @Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { LayoutInflater inflater = LayoutInflater.from(context); View itemView = inflater.inflate(R.layout.item_category, parent, false); return new CategoryHolder(itemView); } @Override public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) { final CategoryPicker item = categories.get(position); CategoryHolder catHolder = (CategoryHolder) holder; IconicsDrawable drawable = new IconicsDrawable(getActivity(), item.getIcon()).color(Color.BLACK).sizeDp(50); catHolder.imgIcon.setImageDrawable(drawable); catHolder.lblCategory.setText(item.getCategory()); holder.itemView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { getActivity().getSupportFragmentManager().beginTransaction() .replace(container.getId(), IconPickerFragment.newInstance(item.getId())) .addToBackStack(null) .commit(); } }); } @Override public int getItemCount() { return categories.size(); } } }
pravussum/3House
mobile/src/main/java/treehou/se/habit/ui/util/CategoryPickerFragment.java
Java
epl-1.0
5,601
[ 30522, 7427, 3392, 6806, 2226, 1012, 7367, 1012, 10427, 1012, 21318, 1012, 21183, 4014, 1025, 12324, 11924, 1012, 4180, 1012, 6123, 1025, 12324, 11924, 1012, 8389, 1012, 3609, 1025, 12324, 11924, 1012, 9808, 1012, 14012, 1025, 12324, 11924, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_151) on Fri Jun 22 04:34:22 MST 2018 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Uses of Interface org.wildfly.swarm.config.undertow.server.host.HTTPInvokerSettingSupplier (BOM: * : All 2.0.0.Final API)</title> <meta name="date" content="2018-06-22"> <link rel="stylesheet" type="text/css" href="../../../../../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Interface org.wildfly.swarm.config.undertow.server.host.HTTPInvokerSettingSupplier (BOM: * : All 2.0.0.Final API)"; } } catch(err) { } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../../../org/wildfly/swarm/config/undertow/server/host/HTTPInvokerSettingSupplier.html" title="interface in org.wildfly.swarm.config.undertow.server.host">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../../../../../../../../overview-tree.html">Tree</a></li> <li><a href="../../../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">Thorntail API, 2.0.0.Final</div> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../../../index.html?org/wildfly/swarm/config/undertow/server/host/class-use/HTTPInvokerSettingSupplier.html" target="_top">Frames</a></li> <li><a href="HTTPInvokerSettingSupplier.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Interface org.wildfly.swarm.config.undertow.server.host.HTTPInvokerSettingSupplier" class="title">Uses of Interface<br>org.wildfly.swarm.config.undertow.server.host.HTTPInvokerSettingSupplier</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../../../../../../../../org/wildfly/swarm/config/undertow/server/host/HTTPInvokerSettingSupplier.html" title="interface in org.wildfly.swarm.config.undertow.server.host">HTTPInvokerSettingSupplier</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="#org.wildfly.swarm.config.undertow.server">org.wildfly.swarm.config.undertow.server</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="org.wildfly.swarm.config.undertow.server"> <!-- --> </a> <h3>Uses of <a href="../../../../../../../../org/wildfly/swarm/config/undertow/server/host/HTTPInvokerSettingSupplier.html" title="interface in org.wildfly.swarm.config.undertow.server.host">HTTPInvokerSettingSupplier</a> in <a href="../../../../../../../../org/wildfly/swarm/config/undertow/server/package-summary.html">org.wildfly.swarm.config.undertow.server</a></h3> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../../../org/wildfly/swarm/config/undertow/server/package-summary.html">org.wildfly.swarm.config.undertow.server</a> with parameters of type <a href="../../../../../../../../org/wildfly/swarm/config/undertow/server/host/HTTPInvokerSettingSupplier.html" title="interface in org.wildfly.swarm.config.undertow.server.host">HTTPInvokerSettingSupplier</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../../../../org/wildfly/swarm/config/undertow/server/Host.html" title="type parameter in Host">T</a></code></td> <td class="colLast"><span class="typeNameLabel">Host.</span><code><span class="memberNameLink"><a href="../../../../../../../../org/wildfly/swarm/config/undertow/server/Host.html#httpInvokerSetting-org.wildfly.swarm.config.undertow.server.host.HTTPInvokerSettingSupplier-">httpInvokerSetting</a></span>(<a href="../../../../../../../../org/wildfly/swarm/config/undertow/server/host/HTTPInvokerSettingSupplier.html" title="interface in org.wildfly.swarm.config.undertow.server.host">HTTPInvokerSettingSupplier</a>&nbsp;supplier)</code> <div class="block">The HTTP invoker services that allows remote HTTP based invocation of services such as EJB and naming</div> </td> </tr> </tbody> </table> </li> </ul> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../../../org/wildfly/swarm/config/undertow/server/host/HTTPInvokerSettingSupplier.html" title="interface in org.wildfly.swarm.config.undertow.server.host">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../../../../../../../../overview-tree.html">Tree</a></li> <li><a href="../../../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">Thorntail API, 2.0.0.Final</div> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../../../index.html?org/wildfly/swarm/config/undertow/server/host/class-use/HTTPInvokerSettingSupplier.html" target="_top">Frames</a></li> <li><a href="HTTPInvokerSettingSupplier.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright &#169; 2018 <a href="http://www.jboss.org">JBoss by Red Hat</a>. All rights reserved.</small></p> </body> </html>
wildfly-swarm/wildfly-swarm-javadocs
2.0.0.Final/apidocs/org/wildfly/swarm/config/undertow/server/host/class-use/HTTPInvokerSettingSupplier.html
HTML
apache-2.0
8,180
[ 30522, 1026, 999, 9986, 13874, 16129, 2270, 1000, 1011, 1013, 1013, 1059, 2509, 2278, 1013, 1013, 26718, 2094, 16129, 1018, 1012, 5890, 17459, 1013, 1013, 4372, 1000, 1000, 8299, 1024, 1013, 1013, 7479, 1012, 1059, 2509, 1012, 8917, 1013, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#!/usr/pkg/bin/python import os, sys, time from reportlab.graphics.barcode.common import * from reportlab.graphics.barcode.code39 import * from reportlab.graphics.barcode.code93 import * from reportlab.graphics.barcode.code128 import * from reportlab.graphics.barcode.usps import * from reportlab.graphics.barcode.usps4s import USPS_4State from reportlab.platypus import Spacer, SimpleDocTemplate, Table, TableStyle, Preformatted, PageBreak from reportlab.lib.units import inch, cm from reportlab.lib import colors from reportlab.pdfgen.canvas import Canvas from reportlab.lib.styles import getSampleStyleSheet from reportlab.platypus.paragraph import Paragraph from reportlab.platypus.frames import Frame from reportlab.platypus.flowables import XBox, KeepTogether from reportlab.graphics.shapes import Drawing from reportlab.graphics.barcode import getCodes, getCodeNames, createBarcodeDrawing, createBarcodeImageInMemory def run(): styles = getSampleStyleSheet() styleN = styles['Normal'] styleH = styles['Heading1'] story = [] #for codeNames in code story.append(Paragraph('I2of5', styleN)) story.append(I2of5(1234, barWidth = inch*0.02, checksum=0)) story.append(Paragraph('MSI', styleN)) story.append(MSI(1234)) story.append(Paragraph('Codabar', styleN)) story.append(Codabar("A012345B", barWidth = inch*0.02)) story.append(Paragraph('Code 11', styleN)) story.append(Code11("01234545634563")) story.append(Paragraph('Code 39', styleN)) story.append(Standard39("A012345B%R")) story.append(Paragraph('Extended Code 39', styleN)) story.append(Extended39("A012345B}")) story.append(Paragraph('Code93', styleN)) story.append(Standard93("CODE 93")) story.append(Paragraph('Extended Code93', styleN)) story.append(Extended93("L@@K! Code 93 :-)")) #, barWidth=0.005 * inch)) story.append(Paragraph('Code 128', styleN)) c=Code128("AB-12345678") #, barWidth=0.005 * inch) #print 'WIDTH =', (c.width / inch), 'barWidth =', (c.barWidth / inch) #print 'LQ =', (c.lquiet / inch), 'RQ =', (c.rquiet / inch) story.append(c) story.append(Paragraph('USPS FIM', styleN)) story.append(FIM("A")) story.append(Paragraph('USPS POSTNET', styleN)) story.append(POSTNET('78247-1043')) story.append(Paragraph('USPS 4 State', styleN)) story.append(USPS_4State('01234567094987654321','01234567891')) from reportlab.graphics.barcode import createBarcodeDrawing story.append(Paragraph('EAN13', styleN)) bcd = createBarcodeDrawing('EAN13', value='123456789012') story.append(bcd) story.append(Paragraph('EAN8', styleN)) bcd = createBarcodeDrawing('EAN8', value='1234567') story.append(bcd) story.append(Paragraph('UPCA', styleN)) bcd = createBarcodeDrawing('UPCA', value='03600029145') story.append(bcd) story.append(Paragraph('USPS_4State', styleN)) bcd = createBarcodeDrawing('USPS_4State', value='01234567094987654321',routing='01234567891') story.append(bcd) story.append(Paragraph('Label Size', styleN)) story.append(XBox((2.0 + 5.0/8.0)*inch, 1 * inch, '1x2-5/8"')) story.append(Paragraph('Label Size', styleN)) story.append(XBox((1.75)*inch, .5 * inch, '1/2x1-3/4"')) c = Canvas('out.pdf') f = Frame(inch, inch, 6*inch, 9*inch, showBoundary=1) f.addFromList(story, c) c.save() print 'saved out.pdf' def fullTest(fileName="test_full.pdf"): """Creates large-ish test document with a variety of parameters""" story = [] styles = getSampleStyleSheet() styleN = styles['Normal'] styleH = styles['Heading1'] styleH2 = styles['Heading2'] story = [] story.append(Paragraph('ReportLab Barcode Test Suite - full output', styleH)) story.append(Paragraph('Generated on %s' % time.ctime(time.time()), styleN)) story.append(Paragraph('', styleN)) story.append(Paragraph('Repository information for this build:', styleN)) #see if we can figure out where it was built, if we're running in source if os.path.split(os.getcwd())[-1] == 'barcode' and os.path.isdir('.svn'): #runnning in a filesystem svn copy infoLines = os.popen('svn info').read() story.append(Preformatted(infoLines, styles["Code"])) story.append(Paragraph('About this document', styleH2)) story.append(Paragraph('History and Status', styleH2)) story.append(Paragraph(""" This is the test suite and docoumentation for the ReportLab open source barcode API, being re-released as part of the forthcoming ReportLab 2.0 release. """, styleN)) story.append(Paragraph(""" Several years ago Ty Sarna contributed a barcode module to the ReportLab community. Several of the codes were used by him in hiw work and to the best of our knowledge this was correct. These were written as flowable objects and were available in PDFs, but not in our graphics framework. However, we had no knowledge of barcodes ourselves and did not advertise or extend the package. """, styleN)) story.append(Paragraph(""" We "wrapped" the barcodes to be usable within our graphics framework; they are now available as Drawing objects which can be rendered to EPS files or bitmaps. For the last 2 years this has been available in our Diagra and Report Markup Language products. However, we did not charge separately and use was on an "as is" basis. """, styleN)) story.append(Paragraph(""" A major licensee of our technology has kindly agreed to part-fund proper productisation of this code on an open source basis in Q1 2006. This has involved addition of EAN codes as well as a proper testing program. Henceforth we intend to publicise the code more widely, gather feedback, accept contributions of code and treat it as "supported". """, styleN)) story.append(Paragraph(""" This involved making available both downloads and testing resources. This PDF document is the output of the current test suite. It contains codes you can scan (if you use a nice sharp laser printer!), and will be extended over coming weeks to include usage examples and notes on each barcode and how widely tested they are. This is being done through documentation strings in the barcode objects themselves so should always be up to date. """, styleN)) story.append(Paragraph('Usage examples', styleH2)) story.append(Paragraph(""" To be completed """, styleN)) story.append(Paragraph('The codes', styleH2)) story.append(Paragraph(""" Below we show a scannable code from each barcode, with and without human-readable text. These are magnified about 2x from the natural size done by the original author to aid inspection. This will be expanded to include several test cases per code, and to add explanations of checksums. Be aware that (a) if you enter numeric codes which are too short they may be prefixed for you (e.g. "123" for an 8-digit code becomes "00000123"), and that the scanned results and readable text will generally include extra checksums at the end. """, styleN)) codeNames = getCodeNames() from reportlab.lib.utils import flatten width = [float(x[8:]) for x in sys.argv if x.startswith('--width=')] height = [float(x[9:]) for x in sys.argv if x.startswith('--height=')] isoScale = [int(x[11:]) for x in sys.argv if x.startswith('--isoscale=')] options = {} if width: options['width'] = width[0] if height: options['height'] = height[0] if isoScale: options['isoScale'] = isoScale[0] scales = [x[8:].split(',') for x in sys.argv if x.startswith('--scale=')] scales = map(float,scales and flatten(scales) or [1]) scales = map(float,scales and flatten(scales) or [1]) for scale in scales: story.append(PageBreak()) story.append(Paragraph('Scale = %.1f'%scale, styleH2)) story.append(Spacer(36, 12)) for codeName in codeNames: s = [Paragraph('Code: ' + codeName, styleH2)] for hr in (0,1): s.append(Spacer(36, 12)) dr = createBarcodeDrawing(codeName, humanReadable=hr,**options) dr.renderScale = scale s.append(dr) s.append(Spacer(36, 12)) s.append(Paragraph('Barcode should say: ' + dr._bc.value, styleN)) story.append(KeepTogether(s)) SimpleDocTemplate(fileName).build(story) print 'created', fileName if __name__=='__main__': run() fullTest() def createSample(name,memory): f = open(name,'wb') f.write(memory) f.close() createSample('test_cbcim.png',createBarcodeImageInMemory('EAN13', value='123456789012')) createSample('test_cbcim.gif',createBarcodeImageInMemory('EAN8', value='1234567', format='gif')) createSample('test_cbcim.pdf',createBarcodeImageInMemory('UPCA', value='03600029145',format='pdf')) createSample('test_cbcim.tiff',createBarcodeImageInMemory('USPS_4State', value='01234567094987654321',routing='01234567891',format='tiff'))
TaskEvolution/Task-Coach-Evolution
taskcoach/taskcoachlib/thirdparty/src/reportlab/graphics/barcode/test.py
Python
gpl-3.0
9,268
[ 30522, 1001, 999, 1013, 2149, 2099, 1013, 1052, 2243, 2290, 1013, 8026, 1013, 18750, 12324, 9808, 1010, 25353, 2015, 1010, 2051, 2013, 3189, 20470, 1012, 8389, 1012, 3347, 16044, 1012, 2691, 12324, 1008, 2013, 3189, 20470, 1012, 8389, 1012,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package com.thebluealliance.androidclient.gcm.notifications; import android.app.Notification; import android.content.Context; import android.content.Intent; import android.content.res.Resources; import android.support.v4.app.NotificationCompat; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.widget.TextView; import com.google.gson.JsonArray; import com.google.gson.JsonObject; import com.google.gson.JsonParseException; import com.thebluealliance.androidclient.Constants; import com.thebluealliance.androidclient.R; import com.thebluealliance.androidclient.Utilities; import com.thebluealliance.androidclient.activities.ViewMatchActivity; import com.thebluealliance.androidclient.datafeed.JSONManager; import com.thebluealliance.androidclient.helpers.EventHelper; import com.thebluealliance.androidclient.helpers.MatchHelper; import com.thebluealliance.androidclient.helpers.MyTBAHelper; import com.thebluealliance.androidclient.listeners.GamedayTickerClickListener; import com.thebluealliance.androidclient.models.BasicModel; import com.thebluealliance.androidclient.models.Match; import com.thebluealliance.androidclient.models.StoredNotification; import com.thebluealliance.androidclient.views.MatchView; import java.util.ArrayList; import java.util.Calendar; import java.util.Date; /** * Created by Nathan on 7/24/2014. */ public class ScoreNotification extends BaseNotification { private String eventName, eventKey, matchKey; private Match match; public ScoreNotification(String messageData) { super("score", messageData); } @Override public void parseMessageData() throws JsonParseException { JsonObject jsonData = JSONManager.getasJsonObject(messageData); if (!jsonData.has("match")) { throw new JsonParseException("Notification data does not contain 'match"); } JsonObject match = jsonData.get("match").getAsJsonObject(); this.match = gson.fromJson(match, Match.class); try { this.matchKey = this.match.getKey(); } catch (BasicModel.FieldNotDefinedException e) { e.printStackTrace(); } this.eventKey = MatchHelper.getEventKeyFromMatchKey(matchKey); if (!jsonData.has("event_name")) { throw new JsonParseException("Notification data does not contain 'event_name"); } eventName = jsonData.get("event_name").getAsString(); } @Override public Notification buildNotification(Context context) { Resources r = context.getResources(); String matchKey; try { matchKey = match.getKey(); this.matchKey = matchKey; } catch (BasicModel.FieldNotDefinedException e) { Log.e(getLogTag(), "Incoming Match object does not have a key. Can't post score update"); e.printStackTrace(); return null; } String matchTitle = MatchHelper.getMatchTitleFromMatchKey(context, matchKey); String matchAbbrevTitle = MatchHelper.getAbbrevMatchTitleFromMatchKey(context, matchKey); JsonObject alliances; try { alliances = match.getAlliances(); } catch (BasicModel.FieldNotDefinedException e) { Log.e(getLogTag(), "Incoming match object does not contain alliance data. Can't post score update"); e.printStackTrace(); return null; } int redScore = Match.getRedScore(alliances); ArrayList<String> redTeamKeys = new ArrayList<>(); JsonArray redTeamsJson = Match.getRedTeams(alliances); for (int i = 0; i < redTeamsJson.size(); i++) { redTeamKeys.add(redTeamsJson.get(i).getAsString()); } int blueScore = Match.getBlueScore(alliances); ArrayList<String> blueTeamKeys = new ArrayList<>(); JsonArray blueTeamsJson = Match.getBlueTeams(alliances); for (int i = 0; i < blueTeamsJson.size(); i++) { blueTeamKeys.add(blueTeamsJson.get(i).getAsString()); } // TODO filter out teams that the user doesn't want notifications about // These arrays hold the numbers of teams that the user cares about ArrayList<String> redTeams = new ArrayList<>(); ArrayList<String> blueTeams = new ArrayList<>(); for (String key : redTeamKeys) { redTeams.add(key.replace("frc", "")); } for (String key : blueTeamKeys) { blueTeams.add(key.replace("frc", "")); } // Make sure the score string is formatted properly with the winning score first String scoreString; if (redScore > blueScore) { scoreString = redScore + "-" + blueScore; } else if (redScore < blueScore) { scoreString = blueScore + "-" + redScore; } else { scoreString = redScore + "-" + redScore; } String redTeamString = Utilities.stringifyListOfStrings(context, redTeams); String blueTeamString = Utilities.stringifyListOfStrings(context, blueTeams); boolean useSpecial2015Format; try { useSpecial2015Format = match.getYear() == 2015 && match.getType() != MatchHelper.TYPE.FINAL; } catch (BasicModel.FieldNotDefinedException e) { useSpecial2015Format = false; Log.w(Constants.LOG_TAG, "Couldn't determine if we should use 2015 score format. Defaulting to no"); } String eventShortName = EventHelper.shortName(eventName); String notificationString; if (redTeams.size() == 0 && blueTeams.size() == 0) { // We must have gotten this GCM message by mistake return null; } else if (useSpecial2015Format) { /* Only for 2015 non-finals matches. Ugh */ notificationString = context.getString(R.string.notification_score_2015_no_winner, eventShortName, matchTitle, redTeamString, redScore, blueTeamString, blueScore); } else if ((redTeams.size() > 0 && blueTeams.size() == 0)) { // The user only cares about some teams on the red alliance if (redScore > blueScore) { // Red won notificationString = context.getString(R.string.notification_score_teams_won, eventShortName, redTeamString, matchTitle, scoreString); } else if (redScore < blueScore) { // Red lost notificationString = context.getString(R.string.notification_score_teams_lost, eventShortName, redTeamString, matchTitle, scoreString); } else { // Red tied notificationString = context.getString(R.string.notification_score_teams_tied, eventShortName, redTeamString, matchTitle, scoreString); } } else if ((blueTeams.size() > 0 && redTeams.size() == 0)) { // The user only cares about some teams on the blue alliance if (blueScore > redScore) { // Blue won notificationString = context.getString(R.string.notification_score_teams_won, eventShortName, blueTeamString, matchTitle, scoreString); } else if (blueScore < redScore) { // Blue lost notificationString = context.getString(R.string.notification_score_teams_lost, eventShortName, blueTeamString, matchTitle, scoreString); } else { // Blue tied notificationString = context.getString(R.string.notification_score_teams_tied, eventShortName, blueTeamString, matchTitle, scoreString); } } else if ((blueTeams.size() > 0 && redTeams.size() > 0)) { // The user cares about teams on both alliances if (blueScore > redScore) { // Blue won notificationString = context.getString(R.string.notification_score_teams_beat_teams, eventShortName, blueTeamString, redTeamString, matchTitle, scoreString); } else if (blueScore < redScore) { // Blue lost notificationString = context.getString(R.string.notification_score_teams_beat_teams, eventShortName, redTeamString, blueTeamString, matchTitle, scoreString); } else { // Blue tied notificationString = context.getString(R.string.notification_score_teams_tied_with_teams, eventShortName, redTeamString, blueTeamString, matchTitle, scoreString); } } else { // We should never, ever get here but if we do... return null; } // We can finally build the notification! Intent instance = getIntent(context); stored = new StoredNotification(); stored.setType(getNotificationType()); String eventCode = EventHelper.getEventCode(matchKey); String notificationTitle = r.getString(R.string.notification_score_title, eventCode, matchAbbrevTitle); stored.setTitle(notificationTitle); stored.setBody(notificationString); stored.setIntent(MyTBAHelper.serializeIntent(instance)); stored.setTime(Calendar.getInstance().getTime()); NotificationCompat.Builder builder = getBaseBuilder(context, instance) .setContentTitle(notificationTitle) .setContentText(notificationString) .setLargeIcon(getLargeIconFormattedForPlatform(context, R.drawable.ic_info_outline_white_24dp)); NotificationCompat.BigTextStyle style = new NotificationCompat.BigTextStyle().bigText(notificationString); builder.setStyle(style); return builder.build(); } @Override public void updateDataLocally(Context c) { if (match != null) { match.write(c); } } @Override public Intent getIntent(Context c) { return ViewMatchActivity.newInstance(c, matchKey); } @Override public int getNotificationId() { return (new Date().getTime() + ":" + getNotificationType() + ":" + matchKey).hashCode(); } @Override public View getView(Context c, LayoutInflater inflater, View convertView) { ViewHolder holder; if (convertView == null || !(convertView.getTag() instanceof ViewHolder)) { convertView = inflater.inflate(R.layout.list_item_notification_score, null, false); holder = new ViewHolder(); holder.header = (TextView) convertView.findViewById(R.id.card_header); holder.title = (TextView) convertView.findViewById(R.id.title); holder.matchView = (MatchView) convertView.findViewById(R.id.match_details); holder.time = (TextView) convertView.findViewById(R.id.notification_time); holder.summaryContainer = convertView.findViewById(R.id.summary_container); convertView.setTag(holder); } else { holder = (ViewHolder) convertView.getTag(); } holder.header.setText(c.getString(R.string.gameday_ticker_event_title_format, EventHelper.shortName(eventName), EventHelper.getShortCodeForEventKey(eventKey).toUpperCase())); holder.title.setText(c.getString(R.string.notification_score_gameday_title, MatchHelper.getMatchTitleFromMatchKey(c, matchKey))); holder.time.setText(getNotificationTimeString(c)); holder.summaryContainer.setOnClickListener(new GamedayTickerClickListener(c, this)); match.render(false, false, false, true).getView(c, inflater, holder.matchView); return convertView; } private class ViewHolder { public TextView header; public TextView title; public MatchView matchView; public TextView time; private View summaryContainer; } }
Adam8234/the-blue-alliance-android
android/src/main/java/com/thebluealliance/androidclient/gcm/notifications/ScoreNotification.java
Java
mit
11,766
[ 30522, 7427, 4012, 1012, 1996, 16558, 5657, 8095, 28335, 1012, 11924, 20464, 11638, 1012, 1043, 27487, 1012, 26828, 2015, 30524, 11924, 1012, 4180, 1012, 6123, 1025, 12324, 11924, 1012, 4180, 1012, 7848, 1025, 12324, 11924, 1012, 4180, 1012, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
--- layout: portfolio --- ## Portfolio ![portfolioimg]({{ site.url }}/assets/images/kp_shoes.jpg) _Kit & Port Summer Sandals, 2017_ <br> <br> ![portfolioimg]({{ site.url }}/assets/images/sustainability.jpg) _Sustainability, 2015_ <br> <br> ![portfolioimg]({{ site.url }}/assets/images/rtex_logo.png) _Raleigh Texas Logo, 2014_ <br> <br> ![portfolioimg]({{ site.url }}/assets/images/surfer.JPG) _Surfer, 2010_ <br> <br> ![portfolioimg]({{ site.url }}/assets/images/man_walking.JPG) _Man Walking, 2010_ <br> <br> --- <!-- Text can be **bold**, _italic_, or ~~strikethrough~~. [Link to another page](another-page). There should be whitespace between paragraphs. There should be whitespace between paragraphs. We recommend including a README, or a file with information about your project. # [](#header-1)Header 1 This is a normal paragraph following a header. GitHub is a code hosting platform for version control and collaboration. It lets you and others work together on projects from anywhere. ## [](#header-2)Header 2 > This is a blockquote following a header. > > When something is important enough, you do it even if the odds are not in your favor. ### [](#header-3)Header 3 ```js // Javascript code with syntax highlighting. var fun = function lang(l) { dateformat.i18n = require('./lang/' + l) return true; } ``` ```ruby # Ruby code with syntax highlighting GitHubPages::Dependencies.gems.each do |gem, version| s.add_dependency(gem, "= #{version}") end ``` #### [](#header-4)Header 4 * This is an unordered list following a header. * This is an unordered list following a header. * This is an unordered list following a header. ##### [](#header-5)Header 5 1. This is an ordered list following a header. 2. This is an ordered list following a header. 3. This is an ordered list following a header. ###### [](#header-6)Header 6 | head1 | head two | three | |:-------------|:------------------|:------| | ok | good swedish fish | nice | | out of stock | good and plenty | nice | | ok | good `oreos` | hmm | | ok | good `zoute` drop | yumm | ### There's a horizontal rule below this. * * * ### Here is an unordered list: * Item foo * Item bar * Item baz * Item zip ### And an ordered list: 1. Item one 1. Item two 1. Item three 1. Item four ### And a nested list: - level 1 item - level 2 item - level 2 item - level 3 item - level 3 item - level 1 item - level 2 item - level 2 item - level 2 item - level 1 item - level 2 item - level 2 item - level 1 item ### Small image ![](https://assets-cdn.github.com/images/icons/emoji/octocat.png) ### Large image ![](https://guides.github.com/activities/hello-world/branching.png) ### Definition lists can be used with HTML syntax. <dl> <dt>Name</dt> <dd>Godzilla</dd> <dt>Born</dt> <dd>1952</dd> <dt>Birthplace</dt> <dd>Japan</dd> <dt>Color</dt> <dd>Green</dd> </dl> ``` Long, single-line code blocks should not wrap. They should horizontally scroll if they are too long. This line should be long enough to demonstrate this. ``` ``` The final element. ``` -->
iomegrahe/iomegrahe.github.io
portfolio.md
Markdown
cc0-1.0
3,163
[ 30522, 1011, 1011, 1011, 9621, 1024, 11103, 1011, 1011, 1011, 1001, 1001, 11103, 999, 1031, 11103, 5714, 2290, 1033, 1006, 1063, 1063, 2609, 1012, 24471, 2140, 1065, 1065, 1013, 7045, 1013, 4871, 1013, 1047, 2361, 1035, 6007, 1012, 16545, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# Potentilla anserina subsp. groenlandica Tratt. SUBSPECIES #### Status ACCEPTED #### According to GRIN Taxonomy for Plants #### Published in Rosac. monogr. 4:13. 1824 #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Rosales/Rosaceae/Potentilla/Potentilla anserina/Potentilla anserina groenlandica/README.md
Markdown
apache-2.0
213
[ 30522, 1001, 16834, 9386, 2019, 8043, 3981, 24807, 1012, 24665, 8913, 20554, 5685, 5555, 19817, 19321, 1012, 11056, 1001, 1001, 1001, 1001, 3570, 3970, 1001, 1001, 1001, 1001, 2429, 2000, 5861, 25274, 2005, 4264, 1001, 1001, 1001, 1001, 240...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
//////////////////////////////////////////////////////////////////////////////// /// DISCLAIMER /// /// Copyright 2014-2016 ArangoDB GmbH, Cologne, Germany /// Copyright 2004-2014 triAGENS GmbH, Cologne, Germany /// /// 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. /// /// Copyright holder is ArangoDB GmbH, Cologne, Germany /// /// @author Jan Steemann //////////////////////////////////////////////////////////////////////////////// #ifndef ARANGOD_VOC_BASE_SERVER_H #define ARANGOD_VOC_BASE_SERVER_H 1 #include "Basics/Common.h" #include "Basics/locks.h" #include "Basics/Mutex.h" #include "Basics/threads.h" #include "Basics/DataProtector.h" #include "VocBase/voc-types.h" #include "VocBase/vocbase-defaults.h" struct TRI_vocbase_t; namespace arangodb { namespace aql { class QueryRegistry; } namespace basics { class ThreadPool; } namespace rest { class ApplicationEndpointServer; } } //////////////////////////////////////////////////////////////////////////////// /// @brief server structure //////////////////////////////////////////////////////////////////////////////// struct DatabasesLists { std::unordered_map<std::string, TRI_vocbase_t*> _databases; std::unordered_map<std::string, TRI_vocbase_t*> _coordinatorDatabases; std::unordered_set<TRI_vocbase_t*> _droppedDatabases; }; struct TRI_server_t { TRI_server_t(); ~TRI_server_t(); std::atomic<DatabasesLists*> _databasesLists; // TODO: Make this again a template once everybody has gcc >= 4.9.2 // arangodb::basics::DataProtector<64> arangodb::basics::DataProtector _databasesProtector; arangodb::Mutex _databasesMutex; TRI_thread_t _databaseManager; bool _databaseManagerStarted; TRI_vocbase_defaults_t _defaults; arangodb::basics::ThreadPool* _indexPool; std::atomic<arangodb::aql::QueryRegistry*> _queryRegistry; char* _basePath; char* _databasePath; char* _lockFilename; char* _serverIdFilename; bool _disableReplicationAppliers; bool _disableCompactor; bool _iterateMarkersOnOpen; bool _hasCreatedSystemDatabase; bool _initialized; }; //////////////////////////////////////////////////////////////////////////////// /// @brief page size //////////////////////////////////////////////////////////////////////////////// extern size_t PageSize; //////////////////////////////////////////////////////////////////////////////// /// @brief initialize a server instance with configuration //////////////////////////////////////////////////////////////////////////////// int TRI_InitServer(TRI_server_t*, arangodb::basics::ThreadPool*, char const*, TRI_vocbase_defaults_t const*, bool, bool, bool); //////////////////////////////////////////////////////////////////////////////// /// @brief initialize globals //////////////////////////////////////////////////////////////////////////////// void TRI_InitServerGlobals(void); //////////////////////////////////////////////////////////////////////////////// /// @brief get the global server id //////////////////////////////////////////////////////////////////////////////// TRI_server_id_t TRI_GetIdServer(void); //////////////////////////////////////////////////////////////////////////////// /// @brief start the server //////////////////////////////////////////////////////////////////////////////// int TRI_StartServer(TRI_server_t*, bool checkVersion, bool performUpgrade); //////////////////////////////////////////////////////////////////////////////// /// @brief initializes all databases //////////////////////////////////////////////////////////////////////////////// int TRI_InitDatabasesServer(TRI_server_t*); //////////////////////////////////////////////////////////////////////////////// /// @brief stop the server //////////////////////////////////////////////////////////////////////////////// int TRI_StopServer(TRI_server_t*); //////////////////////////////////////////////////////////////////////////////// /// @brief stop the replication appliers //////////////////////////////////////////////////////////////////////////////// void TRI_StopReplicationAppliersServer(TRI_server_t*); //////////////////////////////////////////////////////////////////////////////// /// @brief create a new coordinator database //////////////////////////////////////////////////////////////////////////////// int TRI_CreateCoordinatorDatabaseServer(TRI_server_t*, TRI_voc_tick_t, char const*, TRI_vocbase_defaults_t const*, TRI_vocbase_t**); //////////////////////////////////////////////////////////////////////////////// /// @brief create a new database //////////////////////////////////////////////////////////////////////////////// int TRI_CreateDatabaseServer(TRI_server_t*, TRI_voc_tick_t, char const*, TRI_vocbase_defaults_t const*, TRI_vocbase_t**, bool); //////////////////////////////////////////////////////////////////////////////// /// @brief activates or deactivates deadlock detection in all existing /// databases //////////////////////////////////////////////////////////////////////////////// void TRI_EnableDeadlockDetectionDatabasesServer(TRI_server_t*); //////////////////////////////////////////////////////////////////////////////// /// @brief get the ids of all local coordinator databases //////////////////////////////////////////////////////////////////////////////// std::vector<TRI_voc_tick_t> TRI_GetIdsCoordinatorDatabaseServer(TRI_server_t*, bool includeSystem = false); //////////////////////////////////////////////////////////////////////////////// /// @brief drops an existing coordinator database //////////////////////////////////////////////////////////////////////////////// int TRI_DropByIdCoordinatorDatabaseServer(TRI_server_t*, TRI_voc_tick_t, bool); //////////////////////////////////////////////////////////////////////////////// /// @brief drops an existing database //////////////////////////////////////////////////////////////////////////////// int TRI_DropDatabaseServer(TRI_server_t*, char const*, bool, bool); //////////////////////////////////////////////////////////////////////////////// /// @brief drops an existing database //////////////////////////////////////////////////////////////////////////////// int TRI_DropByIdDatabaseServer(TRI_server_t*, TRI_voc_tick_t, bool, bool); //////////////////////////////////////////////////////////////////////////////// /// @brief get a coordinator database by its id /// this will increase the reference-counter for the database //////////////////////////////////////////////////////////////////////////////// TRI_vocbase_t* TRI_UseByIdCoordinatorDatabaseServer(TRI_server_t*, TRI_voc_tick_t); //////////////////////////////////////////////////////////////////////////////// /// @brief use a coordinator database by its name /// this will increase the reference-counter for the database //////////////////////////////////////////////////////////////////////////////// TRI_vocbase_t* TRI_UseCoordinatorDatabaseServer(TRI_server_t*, char const*); //////////////////////////////////////////////////////////////////////////////// /// @brief use a database by its name /// this will increase the reference-counter for the database //////////////////////////////////////////////////////////////////////////////// TRI_vocbase_t* TRI_UseDatabaseServer(TRI_server_t*, char const*); //////////////////////////////////////////////////////////////////////////////// /// @brief lookup a database by its name //////////////////////////////////////////////////////////////////////////////// TRI_vocbase_t* TRI_LookupDatabaseByNameServer(TRI_server_t*, char const*); //////////////////////////////////////////////////////////////////////////////// /// @brief use a database by its id /// this will increase the reference-counter for the database //////////////////////////////////////////////////////////////////////////////// TRI_vocbase_t* TRI_UseDatabaseByIdServer(TRI_server_t*, TRI_voc_tick_t); //////////////////////////////////////////////////////////////////////////////// /// @brief release a previously used database /// this will decrease the reference-counter for the database //////////////////////////////////////////////////////////////////////////////// void TRI_ReleaseDatabaseServer(TRI_server_t*, TRI_vocbase_t*); //////////////////////////////////////////////////////////////////////////////// /// @brief return the list of all databases a user can see //////////////////////////////////////////////////////////////////////////////// int TRI_GetUserDatabasesServer(TRI_server_t*, char const*, std::vector<std::string>&); //////////////////////////////////////////////////////////////////////////////// /// @brief return the list of all database names //////////////////////////////////////////////////////////////////////////////// int TRI_GetDatabaseNamesServer(TRI_server_t*, std::vector<std::string>&); //////////////////////////////////////////////////////////////////////////////// /// @brief copies the defaults into the target //////////////////////////////////////////////////////////////////////////////// void TRI_GetDatabaseDefaultsServer(TRI_server_t*, TRI_vocbase_defaults_t*); //////////////////////////////////////////////////////////////////////////////// /// @brief create a new tick //////////////////////////////////////////////////////////////////////////////// TRI_voc_tick_t TRI_NewTickServer(void); //////////////////////////////////////////////////////////////////////////////// /// @brief create a new tick, using a hybrid logical clock //////////////////////////////////////////////////////////////////////////////// TRI_voc_tick_t TRI_HybridLogicalClock(void); //////////////////////////////////////////////////////////////////////////////// /// @brief create a new tick, using a hybrid logical clock, this variant /// is supposed to be called when a time stamp is received in network /// communications. //////////////////////////////////////////////////////////////////////////////// TRI_voc_tick_t TRI_HybridLogicalClock(TRI_voc_tick_t received); //////////////////////////////////////////////////////////////////////////////// /// @brief updates the tick counter, with lock //////////////////////////////////////////////////////////////////////////////// void TRI_UpdateTickServer(TRI_voc_tick_t); //////////////////////////////////////////////////////////////////////////////// /// @brief returns the current tick counter //////////////////////////////////////////////////////////////////////////////// TRI_voc_tick_t TRI_CurrentTickServer(void); //////////////////////////////////////////////////////////////////////////////// /// @brief msyncs a memory block between begin (incl) and end (excl) //////////////////////////////////////////////////////////////////////////////// bool TRI_MSync(int, char const*, char const*); //////////////////////////////////////////////////////////////////////////////// /// @brief sets the current operation mode of the server //////////////////////////////////////////////////////////////////////////////// int TRI_ChangeOperationModeServer(TRI_vocbase_operationmode_e); //////////////////////////////////////////////////////////////////////////////// /// @brief returns the current operation mode of the server //////////////////////////////////////////////////////////////////////////////// TRI_vocbase_operationmode_e TRI_GetOperationModeServer(); #endif
m0ppers/arangodb
arangod/VocBase/server.h
C
apache-2.0
12,233
[ 30522, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 101...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"> <meta name="apple-mobile-web-app-capable" content="yes"> <title>OpenLayers OSM and Google Example</title> <link rel="stylesheet" href="../theme/default/style.css" type="text/css"> <link rel="stylesheet" href="../theme/default/google.css" type="text/css"> <link rel="stylesheet" href="style.css" type="text/css"> <script src="http://maps.google.com/maps/api/js?v=3&amp;sensor=false"></script> <script src="../lib/OpenLayers.js"></script> <script src="osm-google.js"></script> </head> <body onload="init()"> <h1 id="title">OSM and Google Together</h1> <p id="shortdesc"> Demonstrate use of an OSM layer and a Google layer as base layers. </p> <div id="tags"> openstreetmap google light </div> <div id="map" class="smallmap"></div> <div id="docs"> <p> The Google(v3) layer and the OSM are both in the same projection - spherical mercator - and can be used on a map together. See the <a href="osm-google.js" target="_blank"> osm-google.js source</a> to see how this is done. </p> </div> </body> </html>
jcuanm/Japan-Digital-Archive
web/js/lib/OpenLayers-2.12/examples/osm-google.html
HTML
mit
1,464
[ 30522, 1026, 999, 9986, 13874, 16129, 1028, 1026, 16129, 1028, 1026, 2132, 1028, 1026, 18804, 8299, 1011, 1041, 15549, 2615, 1027, 1000, 4180, 1011, 2828, 1000, 4180, 1027, 1000, 3793, 1013, 16129, 1025, 25869, 13462, 1027, 21183, 2546, 101...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * Copyright (C) 2011-2012 Freescale Semiconductor, Inc. All Rights Reserved. */ /* * Modifyed by: Edison Fernández <edison.fernandez@ridgerun.com> * Added support to use it with Nitrogen6x * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * */ #include <linux/module.h> #include <linux/init.h> #include <linux/slab.h> #include <linux/ctype.h> #include <linux/types.h> #include <linux/delay.h> #include <linux/device.h> #include <linux/clk.h> #include <linux/i2c.h> #include <linux/mfd/syscon.h> #include <linux/mfd/syscon/imx6q-iomuxc-gpr.h> #include <linux/of_gpio.h> #include <linux/regulator/consumer.h> #include <linux/fsl_devices.h> #include <linux/mutex.h> #include <linux/mipi_csi2.h> #include <linux/pwm.h> #include <media/v4l2-chip-ident.h> #include <media/v4l2-int-device.h> #include <sound/core.h> #include <sound/pcm.h> #include <sound/soc.h> #include <sound/jack.h> #include <sound/soc-dapm.h> #include <asm/mach-types.h> //#include <mach/audmux.h> #include <linux/slab.h> #include "mxc_v4l2_capture.h" #define CODEC_CLOCK 16500000 /* SSI clock sources */ #define IMX_SSP_SYS_CLK 0 #define TC358743_VOLTAGE_ANALOG 2800000 #define TC358743_VOLTAGE_DIGITAL_CORE 1500000 #define TC358743_VOLTAGE_DIGITAL_IO 1800000 #define MIN_FPS 30 #define MAX_FPS 60 #define DEFAULT_FPS 60 #define TC358743_XCLK_MIN 27000000 #define TC358743_XCLK_MAX 42000000 #define TC358743_CHIP_ID_HIGH_BYTE 0x0 #define TC358743_CHIP_ID_LOW_BYTE 0x0 #define TC3587430_HDMI_DETECT 0x0f //0x10 #define TC_VOLTAGE_ANALOG 2800000 #define TC_VOLTAGE_DIGITAL_CORE 1500000 #define TC_VOLTAGE_DIGITAL_IO 1800000 enum tc358743_mode { tc358743_mode_INIT, /*only for sensor init*/ tc358743_mode_INIT1, /*only for sensor init*/ tc358743_mode_480P_720_480, tc358743_mode_720P_60_1280_720, tc358743_mode_480P_640_480, tc358743_mode_1080P_1920_1080, tc358743_mode_INIT2, /*only for sensor init*/ tc358743_mode_INIT3, /*only for sensor init*/ tc358743_mode_INIT4, /*only for sensor init*/ tc358743_mode_INIT5, /*only for sensor init*/ tc358743_mode_INIT6, /*only for sensor init*/ tc358743_mode_720P_1280_720, tc358743_mode_MAX , }; enum tc358743_frame_rate { tc358743_60_fps, tc358743_30_fps, tc358743_max_fps }; struct reg_value { u16 u16RegAddr; u32 u32Val; u32 u32Mask; u8 u8Length; u32 u32Delay_ms; }; struct tc358743_mode_info { enum tc358743_mode mode; u32 width; u32 height; u32 vformat; u32 fps; u32 lanes; u32 freq; struct reg_value *init_data_ptr; u32 init_data_size; __u32 flags; }; static struct delayed_work det_work; static struct sensor_data tc358743_data; static int pwn_gpio, rst_gpio; static struct regulator *io_regulator; static struct regulator *core_regulator; static struct regulator *analog_regulator; static struct regulator *gpo_regulator; static u16 hpd_active = 1; #define DET_WORK_TIMEOUT_DEFAULT 100 #define DET_WORK_TIMEOUT_DEFERRED 2000 #define MAX_BOUNCE 5 static DEFINE_MUTEX(access_lock); static int det_work_disable = 0; static int det_work_timeout = DET_WORK_TIMEOUT_DEFAULT; static u32 hdmi_mode = 0, lock = 0, bounce = 0, fps = 0, audio = 2; static int tc358743_init_mode(enum tc358743_frame_rate frame_rate, enum tc358743_mode mode); static int tc358743_toggle_hpd(int active); static void tc_standby(s32 enable) { if (gpio_is_valid(pwn_gpio)) gpio_set_value(pwn_gpio, enable ? 1 : 0); pr_debug("tc_standby: powerdown=%x, power_gp=0x%x\n", enable, pwn_gpio); msleep(2); } static void tc_reset(void) { /* camera reset */ gpio_set_value(rst_gpio, 1); /* camera power dowmn */ if (gpio_is_valid(pwn_gpio)) { gpio_set_value(pwn_gpio, 1); msleep(5); gpio_set_value(pwn_gpio, 0); } msleep(5); gpio_set_value(rst_gpio, 0); msleep(1); gpio_set_value(rst_gpio, 1); msleep(20); if (gpio_is_valid(pwn_gpio)) gpio_set_value(pwn_gpio, 1); } static int tc_power_on(struct device *dev) { int ret = 0; io_regulator = devm_regulator_get(dev, "DOVDD"); if (!IS_ERR(io_regulator)) { regulator_set_voltage(io_regulator, TC_VOLTAGE_DIGITAL_IO, TC_VOLTAGE_DIGITAL_IO); ret = regulator_enable(io_regulator); if (ret) { pr_err("%s:io set voltage error\n", __func__); return ret; } else { dev_dbg(dev, "%s:io set voltage ok\n", __func__); } } else { pr_err("%s: cannot get io voltage error\n", __func__); io_regulator = NULL; } core_regulator = devm_regulator_get(dev, "DVDD"); if (!IS_ERR(core_regulator)) { regulator_set_voltage(core_regulator, TC_VOLTAGE_DIGITAL_CORE, TC_VOLTAGE_DIGITAL_CORE); ret = regulator_enable(core_regulator); if (ret) { pr_err("%s:core set voltage error\n", __func__); return ret; } else { dev_dbg(dev, "%s:core set voltage ok\n", __func__); } } else { core_regulator = NULL; pr_err("%s: cannot get core voltage error\n", __func__); } analog_regulator = devm_regulator_get(dev, "AVDD"); if (!IS_ERR(analog_regulator)) { regulator_set_voltage(analog_regulator, TC_VOLTAGE_ANALOG, TC_VOLTAGE_ANALOG); ret = regulator_enable(analog_regulator); if (ret) { pr_err("%s:analog set voltage error\n", __func__); return ret; } else { dev_dbg(dev, "%s:analog set voltage ok\n", __func__); } } else { analog_regulator = NULL; pr_err("%s: cannot get analog voltage error\n", __func__); } return ret; } static void det_work_enable(int i) { mutex_lock(&access_lock); if (i) { det_work_timeout = DET_WORK_TIMEOUT_DEFERRED; schedule_delayed_work(&(det_work), msecs_to_jiffies(det_work_timeout)); det_work_disable = 0; } else { det_work_disable = 1; det_work_timeout = DET_WORK_TIMEOUT_DEFERRED; } mutex_unlock(&access_lock); pr_debug("%s: %d %d\n", __func__, det_work_disable, det_work_timeout); } static u8 cHDMIEDID[256] = { /* FIXME! This is the edid that my ASUS HDMI monitor returns */ 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x04, 0x69, 0xf3, 0x24, 0xd6, 0x12, 0x00, 0x00, 0x16, 0x16, 0x01, 0x03, 0x80, 0x34, 0x1d, 0x78, 0x2a, 0xc7, 0x20, 0xa4, 0x55, 0x49, 0x99, 0x27, 0x13, 0x50, 0x54, 0xbf, 0xef, 0x00, 0x71, 0x4f, 0x81, 0x40, 0x81, 0x80, 0x95, 0x00, 0xb3, 0x00, 0xd1, 0xc0, 0x01, 0x01, 0x01, 0x01, 0x02, 0x3a, 0x80, 0x18, 0x71, 0x38, 0x2d, 0x40, 0x58, 0x2c, 0x45, 0x00, 0x09, 0x25, 0x21, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0xff, 0x00, 0x43, 0x36, 0x4c, 0x4d, 0x54, 0x46, 0x30, 0x30, 0x34, 0x38, 0x32, 0x32, 0x0a, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x37, 0x4b, 0x1e, 0x55, 0x10, 0x00, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x41, 0x53, 0x55, 0x53, 0x20, 0x56, 0x48, 0x32, 0x34, 0x32, 0x48, 0x0a, 0x20, 0x01, 0x78, 0x02, 0x03, 0x22, 0x71, 0x4f, 0x01, 0x02, 0x03, 0x11, 0x12, 0x13, 0x04, 0x14, 0x05, 0x0e, 0x0f, 0x1d, 0x1e, 0x1f, 0x10, 0x23, 0x09, 0x07, 0x01, 0x83, 0x01, 0x00, 0x00, 0x65, 0x03, 0x0c, 0x00, 0x10, 0x00, 0x8c, 0x0a, 0xd0, 0x8a, 0x20, 0xe0, 0x2d, 0x10, 0x10, 0x3e, 0x96, 0x00, 0x09, 0x25, 0x21, 0x00, 0x00, 0x18, 0x01, 0x1d, 0x00, 0x72, 0x51, 0xd0, 0x1e, 0x20, 0x6e, 0x28, 0x55, 0x00, 0x09, 0x25, 0x21, 0x00, 0x00, 0x1e, 0x01, 0x1d, 0x00, 0xbc, 0x52, 0xd0, 0x1e, 0x20, 0xb8, 0x28, 0x55, 0x40, 0x09, 0x25, 0x21, 0x00, 0x00, 0x1e, 0x8c, 0x0a, 0xd0, 0x90, 0x20, 0x40, 0x31, 0x20, 0x0c, 0x40, 0x55, 0x00, 0x09, 0x25, 0x21, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x73, }; /*! * Maintains the information on the current state of the sesor. */ static struct reg_value tc358743_setting_YUV422_2lane_30fps_720P_1280_720_125MHz[] = { {0x7080, 0x00000000, 0x00000000, 2, 0}, {0x0004, 0x00000004, 0x00000000, 2, 0}, {0x0002, 0x00000f00, 0x00000000, 2, 100}, {0x0002, 0x00000000, 0x00000000, 2, 1000}, {0x0006, 0x00000040, 0x00000000, 2, 0}, {0x0014, 0x00000000, 0x00000000, 2, 0}, {0x0016, 0x000005ff, 0x00000000, 2, 0}, // Program CSI Tx PLL {0x0020, 0x0000402d, 0x00000000, 2, 0}, {0x0022, 0x00000213, 0x00000000, 2, 0}, // CSI Tx PHY (32-bit Registers) {0x0140, 0x00000000, 0x00000000, 4, 0}, {0x0144, 0x00000000, 0x00000000, 4, 0}, {0x0148, 0x00000000, 0x00000000, 4, 0}, {0x014c, 0x00000000, 0x00000000, 4, 0}, {0x0150, 0x00000000, 0x00000000, 4, 0}, // CSI Tx PPI (32-bit Registers) {0x0210, 0x00000e00, 0x00000000, 4, 0}, {0x0214, 0x00000001, 0x00000000, 4, 0}, {0x0218, 0x00000801, 0x00000000, 4, 0}, {0x021c, 0x00000001, 0x00000000, 4, 0}, {0x0220, 0x00000001, 0x00000000, 4, 0}, {0x0224, 0x00004800, 0x00000000, 4, 0}, {0x0228, 0x00000005, 0x00000000, 4, 0}, {0x022c, 0x00000000, 0x00000000, 4, 0}, {0x0234, 0x0000001f, 0x00000000, 4, 0}, {0x0238, 0x00000001, 0x00000000, 4, 0}, //non-continuous clock {0x0204, 0x00000001, 0x00000000, 4, 0}, {0x0518, 0x00000001, 0x00000000, 4, 0}, {0x0500, 0xa300be82, 0x00000000, 4, 0}, // HDMI Interrupt Mask {0x8502, 0x00000001, 0x00000000, 1, 0}, {0x8512, 0x000000fe, 0x00000000, 1, 0}, {0x8514, 0x00000000, 0x00000000, 1, 0}, {0x8515, 0x00000000, 0x00000000, 1, 0}, {0x8516, 0x00000000, 0x00000000, 1, 0}, // HDMI Audio RefClk (26 MHz) {0x8531, 0x00000001, 0x00000000, 1, 0}, {0x8540, 0x0000008c, 0x00000000, 1, 0}, {0x8541, 0x0000000a, 0x00000000, 1, 0}, {0x8630, 0x000000b0, 0x00000000, 1, 0}, {0x8631, 0x0000001e, 0x00000000, 1, 0}, {0x8632, 0x00000004, 0x00000000, 1, 0}, {0x8670, 0x00000001, 0x00000000, 1, 0}, // HDMI PHY {0x8532, 0x00000080, 0x00000000, 1, 0}, {0x8536, 0x00000040, 0x00000000, 1, 0}, {0x853f, 0x0000000a, 0x00000000, 1, 0}, // EDID {0x85c7, 0x00000001, 0x00000000, 1, 0}, {0x85cb, 0x00000001, 0x00000000, 1, 0}, // HDMI System {0x8543, 0x00000032, 0x00000000, 1, 0}, // {0x8544, 0x00000000, 0x00000000, 1, 1000}, // {0x8544, 0x00000001, 0x00000000, 1, 100}, {0x8545, 0x00000031, 0x00000000, 1, 0}, {0x8546, 0x0000002d, 0x00000000, 1, 0}, // HDCP Setting {0x85d1, 0x00000001, 0x00000000, 1, 0}, {0x8560, 0x00000024, 0x00000000, 1, 0}, {0x8563, 0x00000011, 0x00000000, 1, 0}, {0x8564, 0x0000000f, 0x00000000, 1, 0}, // Video settings {0x8573, 0x00000081, 0x00000000, 1, 0}, {0x8571, 0x00000002, 0x00000000, 1, 0}, // HDMI Audio In Setting {0x8600, 0x00000000, 0x00000000, 1, 0}, {0x8602, 0x000000f3, 0x00000000, 1, 0}, {0x8603, 0x00000002, 0x00000000, 1, 0}, {0x8604, 0x0000000c, 0x00000000, 1, 0}, {0x8606, 0x00000005, 0x00000000, 1, 0}, {0x8607, 0x00000000, 0x00000000, 1, 0}, {0x8620, 0x00000022, 0x00000000, 1, 0}, {0x8640, 0x00000001, 0x00000000, 1, 0}, {0x8641, 0x00000065, 0x00000000, 1, 0}, {0x8642, 0x00000007, 0x00000000, 1, 0}, // {0x8651, 0x00000003, 0x00000000, 1, 0}, // Inverted LRCK polarity - (Sony) format {0x8652, 0x00000002, 0x00000000, 1, 0}, // Left-justified I2S (Phillips) format // {0x8652, 0x00000000, 0x00000000, 1, 0}, // Right-justified (Sony) format {0x8665, 0x00000010, 0x00000000, 1, 0}, // InfoFrame Extraction {0x8709, 0x000000ff, 0x00000000, 1, 0}, {0x870b, 0x0000002c, 0x00000000, 1, 0}, {0x870c, 0x00000053, 0x00000000, 1, 0}, {0x870d, 0x00000001, 0x00000000, 1, 0}, {0x870e, 0x00000030, 0x00000000, 1, 0}, {0x9007, 0x00000010, 0x00000000, 1, 0}, {0x854a, 0x00000001, 0x00000000, 1, 0}, // Output Control {0x0004, 0x00000cf7, 0x00000000, 2, 0}, }; static struct reg_value tc358743_setting_YUV422_4lane_720P_60fps_1280_720_133Mhz[] = { {0x7080, 0x00000000, 0x00000000, 2, 0}, {0x0004, 0x00000004, 0x00000000, 2, 0}, {0x0002, 0x00000f00, 0x00000000, 2, 100}, {0x0002, 0x00000000, 0x00000000, 2, 1000}, {0x0006, 0x00000000, 0x00000000, 2, 0}, {0x0014, 0x0000ffff, 0x00000000, 2, 0}, {0x0016, 0x000005ff, 0x00000000, 2, 0}, // Program CSI Tx PLL {0x0020, 0x00004062, 0x00000000, 2, 0}, {0x0022, 0x00000613, 0x00000000, 2, 0}, // CSI Tx PHY (32-bit Registers) {0x0140, 0x00000000, 0x00000000, 4, 0}, {0x0144, 0x00000000, 0x00000000, 4, 0}, {0x0148, 0x00000000, 0x00000000, 4, 0}, {0x014c, 0x00000000, 0x00000000, 4, 0}, {0x0150, 0x00000000, 0x00000000, 4, 0}, // CSI Tx PPI (32-bit Registers) {0x0210, 0x00000d00, 0x00000000, 4, 0}, {0x0214, 0x00000001, 0x00000000, 4, 0}, {0x0218, 0x00000701, 0x00000000, 4, 0}, {0x021c, 0x00000000, 0x00000000, 4, 0}, {0x0220, 0x00000001, 0x00000000, 4, 0}, {0x0224, 0x00004000, 0x00000000, 4, 0}, {0x0228, 0x00000005, 0x00000000, 4, 0}, {0x022c, 0x00000000, 0x00000000, 4, 0}, {0x0234, 0x0000001f, 0x00000000, 4, 0}, {0x0238, 0x00000001, 0x00000000, 4, 0}, {0x0204, 0x00000001, 0x00000000, 4, 0}, {0x0518, 0x00000001, 0x00000000, 4, 0}, {0x0500, 0xa300be86, 0x00000000, 4, 0}, // HDMI Interrupt Mask {0x8502, 0x00000001, 0x00000000, 1, 0}, {0x8512, 0x000000fe, 0x00000000, 1, 0}, {0x8514, 0x00000000, 0x00000000, 1, 0}, {0x8515, 0x00000000, 0x00000000, 1, 0}, {0x8516, 0x00000000, 0x00000000, 1, 0}, // HDMI Audio RefClk (26 MHz) {0x8531, 0x00000001, 0x00000000, 1, 0}, {0x8540, 0x00000a8c, 0x00000000, 1, 0}, {0x8630, 0x00041eb0, 0x00000000, 1, 0}, {0x8670, 0x00000001, 0x00000000, 1, 0}, // HDMI PHY {0x8532, 0x00000080, 0x00000000, 1, 0}, {0x8536, 0x00000040, 0x00000000, 1, 0}, {0x853f, 0x0000000a, 0x00000000, 1, 0}, // HDMI System {0x8543, 0x00000032, 0x00000000, 1, 0}, {0x8544, 0x00000000, 0x00000000, 1, 0}, {0x8545, 0x00000031, 0x00000000, 1, 0}, {0x8546, 0x0000002d, 0x00000000, 1, 0}, // EDID {0x85c7, 0x00000001, 0x00000000, 1, 0}, {0x85cb, 0x00000001, 0x00000000, 1, 0}, // HDCP Setting {0x85d1, 0x00000001, 0x00000000, 1, 0}, {0x8560, 0x00000024, 0x00000000, 1, 0}, {0x8563, 0x00000011, 0x00000000, 1, 0}, {0x8564, 0x0000000f, 0x00000000, 1, 0}, // RGB --> YUV Conversion // {0x8574, 0x00000000, 0x00000000, 1, 0}, {0x8573, 0x00000081, 0x00000000, 1, 0}, {0x8571, 0x00000002, 0x00000000, 1, 0}, // HDMI Audio In Setting {0x8600, 0x00000000, 0x00000000, 1, 0}, {0x8602, 0x000000f3, 0x00000000, 1, 0}, {0x8603, 0x00000002, 0x00000000, 1, 0}, {0x8604, 0x0000000c, 0x00000000, 1, 0}, {0x8606, 0x00000005, 0x00000000, 1, 0}, {0x8607, 0x00000000, 0x00000000, 1, 0}, {0x8620, 0x00000022, 0x00000000, 1, 0}, {0x8640, 0x00000001, 0x00000000, 1, 0}, {0x8641, 0x00000065, 0x00000000, 1, 0}, {0x8642, 0x00000007, 0x00000000, 1, 0}, {0x8652, 0x00000002, 0x00000000, 1, 0}, {0x8665, 0x00000010, 0x00000000, 1, 0}, // InfoFrame Extraction {0x8709, 0x000000ff, 0x00000000, 1, 0}, {0x870b, 0x0000002c, 0x00000000, 1, 0}, {0x870c, 0x00000053, 0x00000000, 1, 0}, {0x870d, 0x00000001, 0x00000000, 1, 0}, {0x870e, 0x00000030, 0x00000000, 1, 0}, {0x9007, 0x00000010, 0x00000000, 1, 0}, {0x854a, 0x00000001, 0x00000000, 1, 0}, // Output Control {0x0004, 0x00000cf7, 0x00000000, 2, 0}, }; static struct reg_value tc358743_setting_YUV422_2lane_color_bar_1280_720_125MHz[] = { {0x7080, 0x00000000, 0x00000000, 2, 0}, {0x0002, 0x00000f00, 0x00000000, 2, 100}, {0x0002, 0x00000000, 0x00000000, 2, 1000}, {0x0006, 0x00000000, 0x00000000, 2, 0}, {0x0004, 0x00000084, 0x00000000, 2, 0}, {0x0010, 0x0000001e, 0x00000000, 2, 0}, // Program CSI Tx PLL {0x0020, 0x0000405c, 0x00000000, 2, 0}, {0x0022, 0x00000613, 0x00000000, 2, 0}, // CSI Tx PHY (32-bit Registers) {0x0140, 0x00000000, 0x00000000, 4, 0}, {0x0144, 0x00000000, 0x00000000, 4, 0}, {0x0148, 0x00000000, 0x00000000, 4, 0}, {0x014c, 0x00000000, 0x00000000, 4, 0}, {0x0150, 0x00000000, 0x00000000, 4, 0}, // CSI Tx PPI (32-bit Registers) {0x0210, 0x00000e00, 0x00000000, 4, 0}, {0x0214, 0x00000001, 0x00000000, 4, 0}, {0x0218, 0x00000801, 0x00000000, 4, 0}, {0x021c, 0x00000000, 0x00000000, 4, 0}, {0x0220, 0x00000001, 0x00000000, 4, 0}, {0x0224, 0x00004000, 0x00000000, 4, 0}, {0x0228, 0x00000006, 0x00000000, 4, 0}, {0x022c, 0x00000000, 0x00000000, 4, 0}, {0x0234, 0x00000007, 0x00000000, 4, 0}, {0x0238, 0x00000001, 0x00000000, 4, 0}, //non-continuous clock {0x0204, 0x00000001, 0x00000000, 4, 0}, {0x0518, 0x00000001, 0x00000000, 4, 0}, {0x0500, 0xa30080a2, 0x00000000, 4, 0}, // 1280x720 colorbar {0x000a, 0x00000a00, 0x00000000, 2, 0}, {0x7080, 0x00000082, 0x00000000, 2, 0}, // 128 pixel black - repeat 128 times {0x7000, 0x0000007f, 0x00000000, 2, (1<<24)|(128<<16)}, // 128 pixel blue - repeat 64 times {0x7000, 0x000000ff, 0x00000000, 2, 0}, {0x7000, 0x00000000, 0x00000000, 2, (2<<24)|(64<<16)}, // 128 pixel red - repeat 64 times {0x7000, 0x00000000, 0x00000000, 2, 0}, {0x7000, 0x000000ff, 0x00000000, 2, (2<<24)|(64<<16)}, // 128 pixel pink - repeat 64 times {0x7000, 0x00007fff, 0x00000000, 2, 0}, {0x7000, 0x00007fff, 0x00000000, 2, (2<<24)|(64<<16)}, // 128 pixel green - repeat 64 times {0x7000, 0x00007f00, 0x00000000, 2, 0}, {0x7000, 0x00007f00, 0x00000000, 2, (2<<24)|(64<<16)}, // 128 pixel light blue - repeat 64 times {0x7000, 0x0000c0ff, 0x00000000, 2, 0}, {0x7000, 0x0000c000, 0x00000000, 2, (2<<24)|(64<<16)}, // 128 pixel yellow - repeat 64 times {0x7000, 0x0000ff00, 0x00000000, 2, 0}, {0x7000, 0x0000ffff, 0x00000000, 2, (2<<24)|(64<<16)}, // 128 pixel white - repeat 64 times {0x7000, 0x0000ff7f, 0x00000000, 2, 0}, {0x7000, 0x0000ff7f, 0x00000000, 2, (2<<24)|(64<<16)}, // 720 lines {0x7090, 0x000002cf, 0x00000000, 2, 0}, {0x7092, 0x00000580, 0x00000000, 2, 0}, {0x7094, 0x00000010, 0x00000000, 2, 0}, {0x7080, 0x00000083, 0x00000000, 2, 0}, }; static struct reg_value tc358743_setting_YUV422_4lane_color_bar_1280_720_125MHz[] = { {0x7080, 0x00000000, 0x00000000, 2, 0}, {0x0002, 0x00000f00, 0x00000000, 2, 100}, {0x0002, 0x00000000, 0x00000000, 2, 1000}, {0x0006, 0x00000000, 0x00000000, 2, 0}, {0x0004, 0x00000084, 0x00000000, 2, 0}, {0x0010, 0x0000001e, 0x00000000, 2, 0}, // Program CSI Tx PLL {0x0020, 0x0000405c, 0x00000000, 2, 0}, {0x0022, 0x00000613, 0x00000000, 2, 0}, // CSI Tx PHY (32-bit Registers) {0x0140, 0x00000000, 0x00000000, 4, 0}, {0x0144, 0x00000000, 0x00000000, 4, 0}, {0x0148, 0x00000000, 0x00000000, 4, 0}, {0x014c, 0x00000000, 0x00000000, 4, 0}, {0x0150, 0x00000000, 0x00000000, 4, 0}, // CSI Tx PPI (32-bit Registers) {0x0210, 0x00000e00, 0x00000000, 4, 0}, {0x0214, 0x00000001, 0x00000000, 4, 0}, {0x0218, 0x00000801, 0x00000000, 4, 0}, {0x021c, 0x00000000, 0x00000000, 4, 0}, {0x0220, 0x00000001, 0x00000000, 4, 0}, {0x0224, 0x00004000, 0x00000000, 4, 0}, {0x0228, 0x00000006, 0x00000000, 4, 0}, {0x022c, 0x00000000, 0x00000000, 4, 0}, {0x0234, 0x0000001F, 0x00000000, 4, 0}, //{0x0234, 0x00000007, 0x00000000, 4, 0}, {0x0238, 0x00000001, 0x00000000, 4, 0}, //non-continuous clock {0x0204, 0x00000001, 0x00000000, 4, 0}, {0x0518, 0x00000001, 0x00000000, 4, 0}, {0x0500, 0xa30080a6, 0x00000000, 4, 0}, //{0x0500, 0xa30080a2, 0x00000000, 4, 0}, // 1280x720 colorbar {0x000a, 0x00000a00, 0x00000000, 2, 0}, {0x7080, 0x00000082, 0x00000000, 2, 0}, // 128 pixel black - repeat 128 times {0x7000, 0x0000007f, 0x00000000, 2, (1<<24)|(128<<16)}, // 128 pixel blue - repeat 64 times {0x7000, 0x000000ff, 0x00000000, 2, 0}, {0x7000, 0x00000000, 0x00000000, 2, (2<<24)|(64<<16)}, // 128 pixel red - repeat 64 times {0x7000, 0x00000000, 0x00000000, 2, 0}, {0x7000, 0x000000ff, 0x00000000, 2, (2<<24)|(64<<16)}, // 128 pixel pink - repeat 64 times {0x7000, 0x00007fff, 0x00000000, 2, 0}, {0x7000, 0x00007fff, 0x00000000, 2, (2<<24)|(64<<16)}, // 128 pixel green - repeat 64 times {0x7000, 0x00007f00, 0x00000000, 2, 0}, {0x7000, 0x00007f00, 0x00000000, 2, (2<<24)|(64<<16)}, // 128 pixel light blue - repeat 64 times {0x7000, 0x0000c0ff, 0x00000000, 2, 0}, {0x7000, 0x0000c000, 0x00000000, 2, (2<<24)|(64<<16)}, // 128 pixel yellow - repeat 64 times {0x7000, 0x0000ff00, 0x00000000, 2, 0}, {0x7000, 0x0000ffff, 0x00000000, 2, (2<<24)|(64<<16)}, // 128 pixel white - repeat 64 times {0x7000, 0x0000ff7f, 0x00000000, 2, 0}, {0x7000, 0x0000ff7f, 0x00000000, 2, (2<<24)|(64<<16)}, // 720 lines {0x7090, 0x000002cf, 0x00000000, 2, 0}, {0x7092, 0x00000300, 0x00000000, 2, 0}, //{0x7092, 0x00000580, 0x00000000, 2, 0}, {0x7094, 0x00000010, 0x00000000, 2, 0}, {0x7080, 0x00000083, 0x00000000, 2, 0}, }; static struct reg_value tc358743_setting_YUV422_4lane_color_bar_1024_720_200MHz[] = { {0x7080, 0x00000000, 0x00000000, 2, 0}, {0x0002, 0x00000f00, 0x00000000, 2, 100}, {0x0002, 0x00000000, 0x00000000, 2, 1000}, {0x0006, 0x00000000, 0x00000000, 2, 0}, {0x0004, 0x00000084, 0x00000000, 2, 0}, {0x0010, 0x0000001e, 0x00000000, 2, 0}, // Program CSI Tx PLL {0x0020, 0x00004050, 0x00000000, 2, 0}, {0x0022, 0x00000213, 0x00000000, 2, 0}, // CSI Tx PHY (32-bit Registers) {0x0140, 0x00000000, 0x00000000, 4, 0}, {0x0144, 0x00000000, 0x00000000, 4, 0}, {0x0148, 0x00000000, 0x00000000, 4, 0}, {0x014c, 0x00000000, 0x00000000, 4, 0}, {0x0150, 0x00000000, 0x00000000, 4, 0}, // CSI Tx PPI (32-bit Registers) {0x0210, 0x00001800, 0x00000000, 4, 0}, {0x0214, 0x00000002, 0x00000000, 4, 0}, {0x0218, 0x00001102, 0x00000000, 4, 0}, {0x021c, 0x00000000, 0x00000000, 4, 0}, {0x0220, 0x00000003, 0x00000000, 4, 0}, {0x0224, 0x00004000, 0x00000000, 4, 0}, {0x0228, 0x00000007, 0x00000000, 4, 0}, {0x022c, 0x00000001, 0x00000000, 4, 0}, {0x0234, 0x0000001f, 0x00000000, 4, 0}, {0x0238, 0x00000001, 0x00000000, 4, 0}, //non-continuous clock {0x0204, 0x00000001, 0x00000000, 4, 0}, {0x0518, 0x00000001, 0x00000000, 4, 0}, {0x0500, 0xa30080a6, 0x00000000, 4, 0}, // 1280x720 colorbar {0x000a, 0x00000800, 0x00000000, 2, 0}, {0x7080, 0x00000082, 0x00000000, 2, 0}, // 128 pixel black - repeat 128 times {0x7000, 0x0000007f, 0x00000000, 2, (1<<24)|(128<<16)}, // 128 pixel blue - repeat 64 times {0x7000, 0x000000ff, 0x00000000, 2, 0}, {0x7000, 0x00000000, 0x00000000, 2, (2<<24)|(64<<16)}, // 128 pixel red - repeat 64 times {0x7000, 0x00000000, 0x00000000, 2, 0}, {0x7000, 0x000000ff, 0x00000000, 2, (2<<24)|(64<<16)}, // 128 pixel pink - repeat 64 times {0x7000, 0x00007fff, 0x00000000, 2, 0}, {0x7000, 0x00007fff, 0x00000000, 2, (2<<24)|(64<<16)}, // 128 pixel green - repeat 64 times {0x7000, 0x00007f00, 0x00000000, 2, 0}, {0x7000, 0x00007f00, 0x00000000, 2, (2<<24)|(64<<16)}, // 128 pixel light blue - repeat 64 times {0x7000, 0x0000c0ff, 0x00000000, 2, 0}, {0x7000, 0x0000c000, 0x00000000, 2, (2<<24)|(64<<16)}, // 128 pixel yellow - repeat 64 times {0x7000, 0x0000ff00, 0x00000000, 2, 0}, {0x7000, 0x0000ffff, 0x00000000, 2, (2<<24)|(64<<16)}, // 128 pixel white - repeat 64 times {0x7000, 0x0000ff7f, 0x00000000, 2, 0}, {0x7000, 0x0000ff7f, 0x00000000, 2, (2<<24)|(64<<16)}, // 720 lines {0x0020, 0x0000406f, 0x00000000, 2, 100}, {0x7090, 0x000002cf, 0x00000000, 2, 0}, {0x7092, 0x00000540, 0x00000000, 2, 0}, {0x7094, 0x00000010, 0x00000000, 2, 0}, {0x7080, 0x00000083, 0x00000000, 2, 0}, }; static struct reg_value tc358743_setting_YUV422_4lane_color_bar_1280_720_300MHz[] = { {0x7080, 0x00000000, 0x00000000, 2, 0}, {0x0002, 0x00000f00, 0x00000000, 2, 100}, {0x0002, 0x00000000, 0x00000000, 2, 1000}, {0x0006, 0x00000000, 0x00000000, 2, 0}, {0x0004, 0x00000084, 0x00000000, 2, 0}, {0x0010, 0x0000001e, 0x00000000, 2, 0}, // Program CSI Tx PLL {0x0020, 0x000080c7, 0x00000000, 2, 0}, {0x0022, 0x00000213, 0x00000000, 2, 0}, // CSI Tx PHY (32-bit Registers) {0x0140, 0x00000000, 0x00000000, 4, 0}, {0x0144, 0x00000000, 0x00000000, 4, 0}, {0x0148, 0x00000000, 0x00000000, 4, 0}, {0x014c, 0x00000000, 0x00000000, 4, 0}, {0x0150, 0x00000000, 0x00000000, 4, 0}, // CSI Tx PPI (32-bit Registers) {0x0210, 0x00001e00, 0x00000000, 4, 0}, {0x0214, 0x00000003, 0x00000000, 4, 0}, {0x0218, 0x00001402, 0x00000000, 4, 0}, {0x021c, 0x00000000, 0x00000000, 4, 0}, {0x0220, 0x00000003, 0x00000000, 4, 0}, {0x0224, 0x00004a00, 0x00000000, 4, 0}, {0x0228, 0x00000008, 0x00000000, 4, 0}, {0x022c, 0x00000002, 0x00000000, 4, 0}, {0x0234, 0x0000001f, 0x00000000, 4, 0}, {0x0238, 0x00000001, 0x00000000, 4, 0}, //non-continuous clock {0x0204, 0x00000001, 0x00000000, 4, 0}, {0x0518, 0x00000001, 0x00000000, 4, 0}, {0x0500, 0xa30080a6, 0x00000000, 4, 0}, // 1280x720 colorbar {0x000a, 0x00000a00, 0x00000000, 2, 0}, {0x7080, 0x00000082, 0x00000000, 2, 0}, // 128 pixel black - repeat 128 times {0x7000, 0x0000007f, 0x00000000, 2, (1<<24)|(128<<16)}, // 128 pixel blue - repeat 64 times {0x7000, 0x000000ff, 0x00000000, 2, 0}, {0x7000, 0x00000000, 0x00000000, 2, (2<<24)|(64<<16)}, // 128 pixel red - repeat 64 times {0x7000, 0x00000000, 0x00000000, 2, 0}, {0x7000, 0x000000ff, 0x00000000, 2, (2<<24)|(64<<16)}, // 128 pixel pink - repeat 64 times {0x7000, 0x00007fff, 0x00000000, 2, 0}, {0x7000, 0x00007fff, 0x00000000, 2, (2<<24)|(64<<16)}, // 128 pixel green - repeat 64 times {0x7000, 0x00007f00, 0x00000000, 2, 0}, {0x7000, 0x00007f00, 0x00000000, 2, (2<<24)|(64<<16)}, // 128 pixel light blue - repeat 64 times {0x7000, 0x0000c0ff, 0x00000000, 2, 0}, {0x7000, 0x0000c000, 0x00000000, 2, (2<<24)|(64<<16)}, // 128 pixel yellow - repeat 64 times {0x7000, 0x0000ff00, 0x00000000, 2, 0}, {0x7000, 0x0000ffff, 0x00000000, 2, (2<<24)|(64<<16)}, // 128 pixel white - repeat 64 times {0x7000, 0x0000ff7f, 0x00000000, 2, 0}, {0x7000, 0x0000ff7f, 0x00000000, 2, (2<<24)|(64<<16)}, // 720 lines {0x7090, 0x000002cf, 0x00000000, 2, 0}, {0x7092, 0x000006b8, 0x00000000, 2, 0}, {0x7094, 0x00000010, 0x00000000, 2, 0}, {0x7080, 0x00000083, 0x00000000, 2, 0}, }; static struct reg_value tc358743_setting_YUV422_4lane_color_bar_1920_1023_300MHz[] = { {0x7080, 0x00000000, 0x00000000, 2, 0}, {0x0002, 0x00000f00, 0x00000000, 2, 100}, {0x0002, 0x00000000, 0x00000000, 2, 1000}, {0x0006, 0x00000000, 0x00000000, 2, 0}, {0x0004, 0x00000084, 0x00000000, 2, 0}, {0x0010, 0x0000001e, 0x00000000, 2, 0}, // Program CSI Tx PLL {0x0020, 0x000080c7, 0x00000000, 2, 0}, {0x0022, 0x00000213, 0x00000000, 2, 0}, // CSI Tx PHY (32-bit Registers) {0x0140, 0x00000000, 0x00000000, 4, 0}, {0x0144, 0x00000000, 0x00000000, 4, 0}, {0x0148, 0x00000000, 0x00000000, 4, 0}, {0x014c, 0x00000000, 0x00000000, 4, 0}, {0x0150, 0x00000000, 0x00000000, 4, 0}, // CSI Tx PPI (32-bit Registers) {0x0210, 0x00001e00, 0x00000000, 4, 0}, {0x0214, 0x00000003, 0x00000000, 4, 0}, {0x0218, 0x00001402, 0x00000000, 4, 0}, {0x021c, 0x00000000, 0x00000000, 4, 0}, {0x0220, 0x00000003, 0x00000000, 4, 0}, {0x0224, 0x00004a00, 0x00000000, 4, 0}, {0x0228, 0x00000008, 0x00000000, 4, 0}, {0x022c, 0x00000002, 0x00000000, 4, 0}, {0x0234, 0x0000001f, 0x00000000, 4, 0}, {0x0238, 0x00000001, 0x00000000, 4, 0}, //non-continuous clock {0x0204, 0x00000001, 0x00000000, 4, 0}, {0x0518, 0x00000001, 0x00000000, 4, 0}, {0x0500, 0xa30080a6, 0x00000000, 4, 0}, // 1920x1023 colorbar {0x000a, 0x00000f00, 0x00000000, 2, 0}, {0x7080, 0x00000082, 0x00000000, 2, 0}, // 128 pixel black - repeat 128 times {0x7000, 0x0000007f, 0x00000000, 2, (1<<24)|(128<<16)}, // 128 pixel blue - repeat 64 times {0x7000, 0x000000ff, 0x00000000, 2, 0}, {0x7000, 0x00000000, 0x00000000, 2, (2<<24)|(64<<16)}, // 128 pixel red - repeat 64 times {0x7000, 0x00000000, 0x00000000, 2, 0}, {0x7000, 0x000000ff, 0x00000000, 2, (2<<24)|(64<<16)}, // 128 pixel pink - repeat 64 times {0x7000, 0x00007fff, 0x00000000, 2, 0}, {0x7000, 0x00007fff, 0x00000000, 2, (2<<24)|(64<<16)}, // 128 pixel green - repeat 64 times {0x7000, 0x00007f00, 0x00000000, 2, 0}, {0x7000, 0x00007f00, 0x00000000, 2, (2<<24)|(64<<16)}, // 128 pixel light blue - repeat 64 times {0x7000, 0x0000c0ff, 0x00000000, 2, 0}, {0x7000, 0x0000c000, 0x00000000, 2, (2<<24)|(64<<16)}, // 128 pixel yellow - repeat 64 times {0x7000, 0x0000ff00, 0x00000000, 2, 0}, {0x7000, 0x0000ffff, 0x00000000, 2, (2<<24)|(64<<16)}, // 128 pixel white - repeat 64 times {0x7000, 0x0000ff7f, 0x00000000, 2, 0}, {0x7000, 0x0000ff7f, 0x00000000, 2, (2<<24)|(64<<16)}, // 1023 lines {0x7090, 0x000003fe, 0x00000000, 2, 0}, {0x7092, 0x000004d8, 0x00000000, 2, 0}, {0x7094, 0x0000002d, 0x00000000, 2, 0}, {0x7080, 0x00000083, 0x00000000, 2, 0}, }; static struct reg_value tc358743_setting_YUV422_2lane_color_bar_640_480_174MHz[] = { {0x7080, 0x00000000, 0x00000000, 2, 0}, {0x0002, 0x00000f00, 0x00000000, 2, 100}, {0x0002, 0x00000000, 0x00000000, 2, 1000}, {0x0006, 0x00000000, 0x00000000, 2, 0}, {0x0004, 0x00000084, 0x00000000, 2, 0}, {0x0010, 0x0000001e, 0x00000000, 2, 0}, // Program CSI Tx PLL {0x0020, 0x00008073, 0x00000000, 2, 0}, {0x0022, 0x00000213, 0x00000000, 2, 0}, // CSI Tx PHY (32-bit Registers) {0x0140, 0x00000000, 0x00000000, 4, 0}, {0x0144, 0x00000000, 0x00000000, 4, 0}, {0x0148, 0x00000000, 0x00000000, 4, 0}, // {0x014c, 0x00000000, 0x00000000, 4, 0}, // {0x0150, 0x00000000, 0x00000000, 4, 0}, // CSI Tx PPI (32-bit Registers) {0x0210, 0x00001200, 0x00000000, 4, 0}, {0x0214, 0x00000002, 0x00000000, 4, 0}, {0x0218, 0x00000b02, 0x00000000, 4, 0}, {0x021c, 0x00000001, 0x00000000, 4, 0}, {0x0220, 0x00000103, 0x00000000, 4, 0}, {0x0224, 0x00004000, 0x00000000, 4, 0}, {0x0228, 0x00000008, 0x00000000, 4, 0}, {0x022c, 0x00000002, 0x00000000, 4, 0}, {0x0234, 0x0000001f, 0x00000000, 4, 0}, {0x0238, 0x00000000, 0x00000000, 4, 0}, {0x0204, 0x00000001, 0x00000000, 4, 0}, {0x0518, 0x00000001, 0x00000000, 4, 0}, {0x0500, 0xA3008082, 0x00000000, 4, 0}, // 640x480 colorbar {0x000a, 0x00000500, 0x00000000, 2, 0}, {0x7080, 0x00000082, 0x00000000, 2, 0}, // 80 pixel black - repeate 80 times {0x7000, 0x0000007f, 0x00000000, 2, (1<<24)|(80<<16)}, // 80 pixel blue - repeate 40 times {0x7000, 0x000000ff, 0x00000000, 2, 0}, {0x7000, 0x00000000, 0x00000000, 2, (2<<24)|(40<<16)}, // 80 pixel red - repeate 40 times {0x7000, 0x00000000, 0x00000000, 2, 0}, {0x7000, 0x000000ff, 0x00000000, 2, (2<<24)|(40<<16)}, // 80 pixel pink - repeate 40 times {0x7000, 0x00007fff, 0x00000000, 2, 0}, {0x7000, 0x00007fff, 0x00000000, 2, (2<<24)|(40<<16)}, // 80 pixel green - repeate 40 times {0x7000, 0x00007f00, 0x00000000, 2, 0}, {0x7000, 0x00007f00, 0x00000000, 2, (2<<24)|(40<<16)}, // 80 pixel light blue - repeate 40 times {0x7000, 0x0000c0ff, 0x00000000, 2, 0}, {0x7000, 0x0000c000, 0x00000000, 2, (2<<24)|(40<<16)}, // 80 pixel yellow - repeate 40 times {0x7000, 0x0000ff00, 0x00000000, 2, 0}, {0x7000, 0x0000ffff, 0x00000000, 2, (2<<24)|(40<<16)}, // 80 pixel white - repeate 40 times {0x7000, 0x0000ff7f, 0x00000000, 2, 0}, {0x7000, 0x0000ff7f, 0x00000000, 2, (2<<24)|(40<<16)}, // 480 lines {0x7090, 0x000001df, 0x00000000, 2, 0}, {0x7092, 0x00000898, 0x00000000, 2, 0}, {0x7094, 0x00000285, 0x00000000, 2, 0}, {0x7080, 0x00000083, 0x00000000, 2, 0}, }; static struct reg_value tc358743_setting_YUV422_2lane_color_bar_640_480_108MHz_cont[] = { {0x7080, 0x00000000, 0x00000000, 2, 0}, {0x0002, 0x00000f00, 0x00000000, 2, 100}, {0x0002, 0x00000000, 0x00000000, 2, 1000}, {0x0006, 0x00000000, 0x00000000, 2, 0}, {0x0004, 0x00000084, 0x00000000, 2, 0}, {0x0010, 0x0000001e, 0x00000000, 2, 0}, // Program CSI Tx PLL {0x0020, 0x0000404F, 0x00000000, 2, 0}, {0x0022, 0x00000613, 0x00000000, 2, 0}, // CSI Tx PHY (32-bit Registers) {0x0140, 0x00000000, 0x00000000, 4, 0}, {0x0144, 0x00000000, 0x00000000, 4, 0}, {0x0148, 0x00000000, 0x00000000, 4, 0}, {0x014c, 0x00000000, 0x00000000, 4, 0}, {0x0150, 0x00000000, 0x00000000, 4, 0}, // CSI Tx PPI (32-bit Registers) {0x0210, 0x00001800, 0x00000000, 4, 0}, {0x0214, 0x00000002, 0x00000000, 4, 0}, {0x0218, 0x00001102, 0x00000000, 4, 0}, {0x021c, 0x00000000, 0x00000000, 4, 0}, {0x0220, 0x00000003, 0x00000000, 4, 0}, {0x0224, 0x00004000, 0x00000000, 4, 0}, {0x0228, 0x00000007, 0x00000000, 4, 0}, {0x022c, 0x00000001, 0x00000000, 4, 0}, {0x0234, 0x0000001f, 0x00000000, 4, 0}, {0x0238, 0x00000001, 0x00000000, 4, 0}, {0x0204, 0x00000001, 0x00000000, 4, 0}, {0x0518, 0x00000001, 0x00000000, 4, 0}, {0x0500, 0xA30080A2, 0x00000000, 4, 0}, // 640x480 colorbar {0x000a, 0x00000500, 0x00000000, 2, 0}, {0x7080, 0x00000082, 0x00000000, 2, 0}, // 80 pixel black - repeate 80 times {0x7000, 0x0000007f, 0x00000000, 2, (1<<24)|(80<<16)}, // 80 pixel blue - repeate 40 times {0x7000, 0x000000ff, 0x00000000, 2, 0}, {0x7000, 0x00000000, 0x00000000, 2, (2<<24)|(40<<16)}, // 80 pixel red - repeate 40 times {0x7000, 0x00000000, 0x00000000, 2, 0}, {0x7000, 0x000000ff, 0x00000000, 2, (2<<24)|(40<<16)}, // 80 pixel pink - repeate 40 times {0x7000, 0x00007fff, 0x00000000, 2, 0}, {0x7000, 0x00007fff, 0x00000000, 2, (2<<24)|(40<<16)}, // 80 pixel green - repeate 40 times {0x7000, 0x00007f00, 0x00000000, 2, 0}, {0x7000, 0x00007f00, 0x00000000, 2, (2<<24)|(40<<16)}, // 80 pixel light blue - repeate 40 times {0x7000, 0x0000c0ff, 0x00000000, 2, 0}, {0x7000, 0x0000c000, 0x00000000, 2, (2<<24)|(40<<16)}, // 80 pixel yellow - repeate 40 times {0x7000, 0x0000ff00, 0x00000000, 2, 0}, {0x7000, 0x0000ffff, 0x00000000, 2, (2<<24)|(40<<16)}, // 80 pixel white - repeate 40 times {0x7000, 0x0000ff7f, 0x00000000, 2, 0}, {0x7000, 0x0000ff7f, 0x00000000, 2, (2<<24)|(40<<16)}, // 480 lines {0x7090, 0x000001df, 0x00000000, 2, 0}, {0x7092, 0x00000700, 0x00000000, 2, 0}, {0x7094, 0x00000010, 0x00000000, 2, 0}, {0x7080, 0x00000083, 0x00000000, 2, 0}, }; //480p RGB2YUV442 static struct reg_value tc358743_setting_YUV422_2lane_60fps_640_480_125Mhz[] = { {0x7080, 0x00000000, 0x00000000, 2, 0}, {0x0004, 0x00000004, 0x00000000, 2, 0}, {0x0002, 0x00000f00, 0x00000000, 2, 100}, {0x0002, 0x00000000, 0x00000000, 2, 1000}, {0x0006, 0x00000040, 0x00000000, 2, 0}, // {0x000a, 0x000005a0, 0x00000000, 2, 0}, // {0x0010, 0x0000001e, 0x00000000, 2, 0}, {0x0014, 0x00000000, 0x00000000, 2, 0}, {0x0016, 0x000005ff, 0x00000000, 2, 0}, // Program CSI Tx PLL {0x0020, 0x0000405c, 0x00000000, 2, 0}, {0x0022, 0x00000613, 0x00000000, 2, 0}, // CSI Tx PHY (32-bit Registers) {0x0140, 0x00000000, 0x00000000, 4, 0}, {0x0144, 0x00000000, 0x00000000, 4, 0}, {0x0148, 0x00000000, 0x00000000, 4, 0}, {0x014c, 0x00000000, 0x00000000, 4, 0}, {0x0150, 0x00000000, 0x00000000, 4, 0}, // CSI Tx PPI (32-bit Registers) {0x0210, 0x00000d00, 0x00000000, 4, 0}, {0x0214, 0x00000001, 0x00000000, 4, 0}, {0x0218, 0x00000701, 0x00000000, 4, 0}, {0x021c, 0x00000000, 0x00000000, 4, 0}, {0x0220, 0x00000001, 0x00000000, 4, 0}, {0x0224, 0x00004000, 0x00000000, 4, 0}, {0x0228, 0x00000005, 0x00000000, 4, 0}, {0x022c, 0x00000000, 0x00000000, 4, 0}, {0x0234, 0x0000001f, 0x00000000, 4, 0}, {0x0238, 0x00000001, 0x00000000, 4, 0}, {0x0204, 0x00000001, 0x00000000, 4, 0}, {0x0518, 0x00000001, 0x00000000, 4, 0}, {0x0500, 0xA30080A2, 0x00000000, 4, 0}, // HDMI Interrupt Mask {0x8502, 0x00000001, 0x00000000, 1, 0}, {0x8512, 0x000000fe, 0x00000000, 1, 0}, {0x8514, 0x00000000, 0x00000000, 1, 0}, {0x8515, 0x00000000, 0x00000000, 1, 0}, {0x8516, 0x00000000, 0x00000000, 1, 0}, // HDMI Audio RefClk (26 MHz) {0x8531, 0x00000001, 0x00000000, 1, 0}, {0x8540, 0x00000a8c, 0x00000000, 1, 0}, {0x8630, 0x00041eb0, 0x00000000, 1, 0}, {0x8670, 0x00000001, 0x00000000, 1, 0}, // HDMI PHY {0x8532, 0x00000080, 0x00000000, 1, 0}, {0x8536, 0x00000040, 0x00000000, 1, 0}, {0x853f, 0x0000000a, 0x00000000, 1, 0}, // HDMI System {0x8543, 0x00000032, 0x00000000, 1, 0}, {0x8544, 0x00000000, 0x00000000, 1, 100}, // {0x8544, 0x00000001, 0x00000000, 1, 100}, {0x8545, 0x00000031, 0x00000000, 1, 0}, {0x8546, 0x0000002d, 0x00000000, 1, 0}, // EDID {0x85c7, 0x00000001, 0x00000000, 1, 0}, {0x85cb, 0x00000001, 0x00000000, 1, 0}, // HDCP Setting {0x85d1, 0x00000001, 0x00000000, 1, 0}, {0x8560, 0x00000024, 0x00000000, 1, 0}, {0x8563, 0x00000011, 0x00000000, 1, 0}, {0x8564, 0x0000000f, 0x00000000, 1, 0}, // RGB --> YUV Conversion {0x8573, 0x00000081, 0x00000000, 1, 0}, {0x8571, 0x00000002, 0x00000000, 1, 0}, // HDMI Audio In Setting {0x8600, 0x00000000, 0x00000000, 1, 0}, {0x8602, 0x000000f3, 0x00000000, 1, 0}, {0x8603, 0x00000002, 0x00000000, 1, 0}, {0x8604, 0x0000000c, 0x00000000, 1, 0}, {0x8606, 0x00000005, 0x00000000, 1, 0}, {0x8607, 0x00000000, 0x00000000, 1, 0}, {0x8620, 0x00000022, 0x00000000, 1, 0}, {0x8640, 0x00000001, 0x00000000, 1, 0}, {0x8641, 0x00000065, 0x00000000, 1, 0}, {0x8642, 0x00000007, 0x00000000, 1, 0}, {0x8652, 0x00000002, 0x00000000, 1, 0}, {0x8665, 0x00000010, 0x00000000, 1, 0}, // InfoFrame Extraction {0x8709, 0x000000ff, 0x00000000, 1, 0}, {0x870b, 0x0000002c, 0x00000000, 1, 0}, {0x870c, 0x00000053, 0x00000000, 1, 0}, {0x870d, 0x00000001, 0x00000000, 1, 0}, {0x870e, 0x00000030, 0x00000000, 1, 0}, {0x9007, 0x00000010, 0x00000000, 1, 0}, {0x854a, 0x00000001, 0x00000000, 1, 0}, // Output Control {0x0004, 0x00000cf7, 0x00000000, 2, 0}, }; //480p RGB2YUV442 static struct reg_value tc358743_setting_YUV422_2lane_60fps_720_480_125Mhz[] = { {0x7080, 0x00000000, 0x00000000, 2, 0}, {0x0004, 0x00000004, 0x00000000, 2, 0}, {0x0002, 0x00000f00, 0x00000000, 2, 100}, {0x0002, 0x00000000, 0x00000000, 2, 1000}, {0x0006, 0x00000040, 0x00000000, 2, 0}, {0x000a, 0x000005a0, 0x00000000, 2, 0}, // {0x0010, 0x0000001e, 0x00000000, 2, 0}, {0x0014, 0x00000000, 0x00000000, 2, 0}, {0x0016, 0x000005ff, 0x00000000, 2, 0}, // Program CSI Tx PLL {0x0020, 0x0000405b, 0x00000000, 2, 0}, {0x0022, 0x00000613, 0x00000000, 2, 0}, // CSI Tx PHY (32-bit Registers) {0x0140, 0x00000000, 0x00000000, 4, 0}, {0x0144, 0x00000000, 0x00000000, 4, 0}, {0x0148, 0x00000000, 0x00000000, 4, 0}, {0x014c, 0x00000000, 0x00000000, 4, 0}, {0x0150, 0x00000000, 0x00000000, 4, 0}, // CSI Tx PPI (32-bit Registers) {0x0210, 0x00000d00, 0x00000000, 4, 0}, {0x0214, 0x00000001, 0x00000000, 4, 0}, {0x0218, 0x00000701, 0x00000000, 4, 0}, {0x021c, 0x00000000, 0x00000000, 4, 0}, {0x0220, 0x00000001, 0x00000000, 4, 0}, {0x0224, 0x00004000, 0x00000000, 4, 0}, {0x0228, 0x00000005, 0x00000000, 4, 0}, {0x022c, 0x00000000, 0x00000000, 4, 0}, {0x0234, 0x0000001f, 0x00000000, 4, 0}, {0x0238, 0x00000001, 0x00000000, 4, 0}, {0x0204, 0x00000001, 0x00000000, 4, 0}, {0x0518, 0x00000001, 0x00000000, 4, 0}, {0x0500, 0xA30080A2, 0x00000000, 4, 0}, // HDMI Interrupt Mask {0x8502, 0x00000001, 0x00000000, 1, 0}, {0x8512, 0x000000fe, 0x00000000, 1, 0}, {0x8514, 0x00000000, 0x00000000, 1, 0}, {0x8515, 0x00000000, 0x00000000, 1, 0}, {0x8516, 0x00000000, 0x00000000, 1, 0}, // HDMI Audio RefClk (27 MHz) {0x8531, 0x00000001, 0x00000000, 1, 0}, {0x8540, 0x00000a8c, 0x00000000, 1, 0}, {0x8630, 0x00041eb0, 0x00000000, 1, 0}, {0x8670, 0x00000001, 0x00000000, 1, 0}, // HDMI PHY {0x8532, 0x00000080, 0x00000000, 1, 0}, {0x8536, 0x00000040, 0x00000000, 1, 0}, {0x853f, 0x0000000a, 0x00000000, 1, 0}, // HDMI System {0x8543, 0x00000032, 0x00000000, 1, 0}, {0x8544, 0x00000000, 0x00000000, 1, 100}, // {0x8544, 0x00000001, 0x00000000, 1, 100}, {0x8545, 0x00000031, 0x00000000, 1, 0}, {0x8546, 0x0000002d, 0x00000000, 1, 0}, // EDID {0x85c7, 0x00000001, 0x00000000, 1, 0}, {0x85cb, 0x00000001, 0x00000000, 1, 0}, // HDCP Setting {0x85d1, 0x00000001, 0x00000000, 1, 0}, {0x8560, 0x00000024, 0x00000000, 1, 0}, {0x8563, 0x00000011, 0x00000000, 1, 0}, {0x8564, 0x0000000f, 0x00000000, 1, 0}, // RGB --> YUV Conversion {0x8573, 0x00000081, 0x00000000, 1, 0}, {0x8571, 0x00000002, 0x00000000, 1, 0}, // HDMI Audio In Setting {0x8600, 0x00000000, 0x00000000, 1, 0}, {0x8602, 0x000000f3, 0x00000000, 1, 0}, {0x8603, 0x00000002, 0x00000000, 1, 0}, {0x8604, 0x0000000c, 0x00000000, 1, 0}, {0x8606, 0x00000005, 0x00000000, 1, 0}, {0x8607, 0x00000000, 0x00000000, 1, 0}, {0x8620, 0x00000022, 0x00000000, 1, 0}, {0x8640, 0x00000001, 0x00000000, 1, 0}, {0x8641, 0x00000065, 0x00000000, 1, 0}, {0x8642, 0x00000007, 0x00000000, 1, 0}, {0x8652, 0x00000002, 0x00000000, 1, 0}, {0x8665, 0x00000010, 0x00000000, 1, 0}, // InfoFrame Extraction {0x8709, 0x000000ff, 0x00000000, 1, 0}, {0x870b, 0x0000002c, 0x00000000, 1, 0}, {0x870c, 0x00000053, 0x00000000, 1, 0}, {0x870d, 0x00000001, 0x00000000, 1, 0}, {0x870e, 0x00000030, 0x00000000, 1, 0}, {0x9007, 0x00000010, 0x00000000, 1, 0}, {0x854a, 0x00000001, 0x00000000, 1, 0}, // Output Control {0x0004, 0x00000cf7, 0x00000000, 2, 0}, }; static struct reg_value tc358743_setting_YUV422_4lane_1080P_60fps_1920_1080_300MHz[] = { {0x7080, 0x00000000, 0x00000000, 2, 0}, {0x0004, 0x00000084, 0x00000000, 2, 0}, {0x0002, 0x00000f00, 0x00000000, 2, 100},//0}, {0x0002, 0x00000000, 0x00000000, 2, 1000},//0}, {0x0006, 0x00000000, 0x00000000, 2, 0}, {0x0014, 0x00000000, 0x00000000, 2, 0}, {0x0016, 0x000005ff, 0x00000000, 2, 0}, // Program CSI Tx PLL {0x0020, 0x000080c7, 0x00000000, 2, 0}, {0x0022, 0x00000213, 0x00000000, 2, 0}, // CSI Tx PHY (32-bit Registers) {0x0140, 0x00000000, 0x00000000, 4, 0}, {0x0144, 0x00000000, 0x00000000, 4, 0}, {0x0148, 0x00000000, 0x00000000, 4, 0}, {0x014c, 0x00000000, 0x00000000, 4, 0}, {0x0150, 0x00000000, 0x00000000, 4, 0}, // CSI Tx PPI (32-bit Registers) {0x0210, 0x00001e00, 0x00000000, 4, 0}, {0x0214, 0x00000003, 0x00000000, 4, 0}, {0x0218, 0x00001402, 0x00000000, 4, 0}, {0x021c, 0x00000000, 0x00000000, 4, 0}, {0x0220, 0x00000003, 0x00000000, 4, 0}, {0x0224, 0x00004a00, 0x00000000, 4, 0}, {0x0228, 0x00000008, 0x00000000, 4, 0}, {0x022c, 0x00000002, 0x00000000, 4, 0}, {0x0234, 0x0000001f, 0x00000000, 4, 0}, {0x0238, 0x00000001, 0x00000000, 4, 0}, {0x0204, 0x00000001, 0x00000000, 4, 0}, {0x0518, 0x00000001, 0x00000000, 4, 0}, {0x0500, 0xa30080a6, 0x00000000, 4, 0}, // HDMI Interrupt Mask {0x8502, 0x00000001, 0x00000000, 1, 0}, {0x8512, 0x000000fe, 0x00000000, 1, 0}, {0x8514, 0x00000000, 0x00000000, 1, 0}, {0x8515, 0x00000000, 0x00000000, 1, 0}, {0x8516, 0x00000000, 0x00000000, 1, 0}, // HDMI Audio RefClk (27 MHz) {0x8531, 0x00000001, 0x00000000, 1, 0}, {0x8540, 0x00000a8c, 0x00000000, 1, 0}, {0x8630, 0x00041eb0, 0x00000000, 1, 0}, {0x8670, 0x00000001, 0x00000000, 1, 0}, // HDMI PHY {0x8532, 0x00000080, 0x00000000, 1, 0}, {0x8536, 0x00000040, 0x00000000, 1, 0}, {0x853f, 0x0000000a, 0x00000000, 1, 0}, // HDMI System {0x8543, 0x00000032, 0x00000000, 1, 0}, {0x8544, 0x00000010, 0x00000000, 1, 100}, {0x8545, 0x00000031, 0x00000000, 1, 0}, {0x8546, 0x0000002d, 0x00000000, 1, 0}, // EDID {0x85c7, 0x00000001, 0x00000000, 1, 0}, {0x85cb, 0x00000001, 0x00000000, 1, 0}, // HDCP Setting {0x85d1, 0x00000001, 0x00000000, 1, 0}, {0x8560, 0x00000024, 0x00000000, 1, 0}, {0x8563, 0x00000011, 0x00000000, 1, 0}, {0x8564, 0x0000000f, 0x00000000, 1, 0}, // RGB --> YUV Conversion {0x8571, 0x00000002, 0x00000000, 1, 0}, {0x8573, 0x00000081, 0x00000000, 1, 0}, {0x8576, 0x00000060, 0x00000000, 1, 0}, // HDMI Audio In Setting {0x8600, 0x00000000, 0x00000000, 1, 0}, {0x8602, 0x000000f3, 0x00000000, 1, 0}, {0x8603, 0x00000002, 0x00000000, 1, 0}, {0x8604, 0x0000000c, 0x00000000, 1, 0}, {0x8606, 0x00000005, 0x00000000, 1, 0}, {0x8607, 0x00000000, 0x00000000, 1, 0}, {0x8620, 0x00000022, 0x00000000, 1, 0}, {0x8640, 0x00000001, 0x00000000, 1, 0}, {0x8641, 0x00000065, 0x00000000, 1, 0}, {0x8642, 0x00000007, 0x00000000, 1, 0}, {0x8652, 0x00000002, 0x00000000, 1, 0}, {0x8665, 0x00000010, 0x00000000, 1, 0}, // InfoFrame Extraction {0x8709, 0x000000ff, 0x00000000, 1, 0}, {0x870b, 0x0000002c, 0x00000000, 1, 0}, {0x870c, 0x00000053, 0x00000000, 1, 0}, {0x870d, 0x00000001, 0x00000000, 1, 0}, {0x870e, 0x00000030, 0x00000000, 1, 0}, {0x9007, 0x00000010, 0x00000000, 1, 0}, {0x854a, 0x00000001, 0x00000000, 1, 0}, // Output Control {0x0004, 0x00000cf7, 0x00000000, 2, 0}, }; static struct reg_value tc358743_setting_YUV422_4lane_1080P_30fps_1920_1080_300MHz[] = { {0x7080, 0x00000000, 0x00000000, 2, 0}, // IR control resister {0x0004, 0x00000084, 0x00000000, 2, 0}, // Internal Generated output pattern,Do not send InfoFrame data out to CSI2,Audio output to CSI2-TX i/f,I2C address index increments on every data byte transfer, disable audio and video TX buffers {0x0002, 0x00000f00, 0x00000000, 2, 100},//0}, // Reset devices and set normal operatio (not sleep) {0x0002, 0x00000000, 0x00000000, 2, 1000},//0}, // Clear reset bits {0x0006, 0x000001f8, 0x00000000, 2, 0}, // FIFO level = 1f8 = 504 {0x0014, 0x00000000, 0x00000000, 2, 0}, // Clear interrupt status bits {0x0016, 0x000005ff, 0x00000000, 2, 0}, // Mask audio mute, CSI-TX, and the other interrups // Program CSI Tx PLL //{0x0020, 0x000080c7, 0x00000000, 2, 0}, // Input divider setting = 0x8 -> Division ratio = (PRD3..0) + 1 = 9, Feedback divider setting = 0xc7 -> Division ratio = (FBD8...0) + 1 = 200 {0x0020, 0x000080c7, 0x00000000, 2, 0}, // Input divider setting = 0x8 -> Division ratio = (PRD3..0) + 1 = 9, Feedback divider setting = 0xc7 -> Division ratio = (FBD8...0) + 1 = 200 {0x0022, 0x00000213, 0x00000000, 2, 0}, // HSCK frequency = 500MHz – 1GHz HSCK frequency, Loop bandwidth setting = 50% of maximum loop bandwidth (default), REFCLK toggling –> normal operation, REFCLK stops -> no oscillation, Bypass clock = normal operation, clocks switched off (output LOW), PLL Reset normal operation, PLL Enable = PLL on // CSI Tx PHY (32-bit Registers) {0x0140, 0x00000000, 0x00000000, 4, 0}, // Clock Lane DPHY Control: Bypass Lane Enable from PPI Layer enable. {0x0144, 0x00000000, 0x00000000, 4, 0}, // Data Lane 0 DPHY Control: Bypass Lane Enable from PPI Layer enable. {0x0148, 0x00000000, 0x00000000, 4, 0}, // Data Lane 1 DPHY Control: Bypass Lane Enable from PPI Layer enable. {0x014c, 0x00000000, 0x00000000, 4, 0}, // Data Lane 2 DPHY Control: Bypass Lane Enable from PPI Layer enable. {0x0150, 0x00000000, 0x00000000, 4, 0}, // Data Lane 3 DPHY Control: Bypass Lane Enable from PPI Layer enable. // CSI Tx PPI (32-bit Registers) {0x0210, 0x00001e00, 0x00000000, 4, 0}, // LINEINITCNT: Line Initialization Wait Counter = 0x1e00 = 7680 {0x0214, 0x00000003, 0x00000000, 4, 0}, // LPTXTIMECNT: SYSLPTX Timing Generation Counter = 3 {0x0218, 0x00001402, 0x00000000, 4, 0}, // TCLK_HEADERCNT: TCLK_ZERO Counter = 0x14 = 20, TCLK_PREPARE Counter = 0x02 = 2 {0x021c, 0x00000000, 0x00000000, 4, 0}, // TCLK_TRAILCNT: TCLK_TRAIL Counter = 0 {0x0220, 0x00000003, 0x00000000, 4, 0}, // THS_HEADERCNT: THS_ZERO Counter = 0, THS_PREPARE Counter = 3 {0x0224, 0x00004a00, 0x00000000, 4, 0}, // TWAKEUP: TWAKEUP Counter = 0x4a00 = 18944 {0x0228, 0x00000008, 0x00000000, 4, 0}, // TCLK_POSTCNT: TCLK_POST Counter = 8 {0x022c, 0x00000002, 0x00000000, 4, 0}, // THS_TRAILCNT: THS_TRAIL Counter = 2 {0x0234, 0x0000001f, 0x00000000, 4, 0}, // HSTXVREGEN: Enable voltage regulators for lanes and clk {0x0238, 0x00000001, 0x00000000, 4, 0}, // TXOPTIONCNTRL: Set Continuous Clock Mode {0x0204, 0x00000001, 0x00000000, 4, 0}, // PPI STARTCNTRL: start PPI function {0x0518, 0x00000001, 0x00000000, 4, 0}, // CSI_START: start {0x0500, 0xa30080a6, 0x00000000, 4, 0}, // CSI Configuration Register: set register 0x040C with data 0x80a6 (CSI MOde, Disables the HTX_TO timer, High-Speed data transfer is performed to Tx, DSCClk Stays in HS mode when Data Lane goes to LP, 4 Data Lanes,The EOT packet is automatically granted at the end of HS transfer then is transmitted) // HDMI Interrupt Mask {0x8502, 0x00000001, 0x00000000, 1, 0}, // SYSTEM INTERRUPT: clear DDC power change detection interrupt {0x8512, 0x000000fe, 0x00000000, 1, 0}, // SYS INTERRUPT MASK: DDC power change detection interrupt not masked {0x8514, 0x00000000, 0x00000000, 1, 0}, // PACKET INTERRUPT MASK: unmask all {0x8515, 0x00000000, 0x00000000, 1, 0}, // CBIT INTERRUPT MASK: unmask all {0x8516, 0x00000000, 0x00000000, 1, 0}, // AUDIO INTERRUPT MASK: unmask all // HDMI Audio RefClk (27 MHz) {0x8531, 0x00000001, 0x00000000, 1, 0}, // PHY CONTROL0: 27MHz, DDC5V detection operation. {0x8540, 0x00000a8c, 0x00000000, 1, 0}, // SYS FREQ0 Register: 27MHz {0x8630, 0x00041eb0, 0x00000000, 1, 0}, // Audio FS Lock Detect Control: for 27MHz {0x8670, 0x00000001, 0x00000000, 1, 0}, // AUDIO PLL Setting: For REFCLK = 27MHz // HDMI PHY {0x8532, 0x00000080, 0x00000000, 1, 0}, // {0x8536, 0x00000040, 0x00000000, 1, 0}, // {0x853f, 0x0000000a, 0x00000000, 1, 0}, // // HDMI System {0x8543, 0x00000032, 0x00000000, 1, 0}, // DDC CONTROL: DDC_ACK output terminal H active, DDC5V_active detect delay 200ms {0x8544, 0x00000010, 0x00000000, 1, 100}, // HPD Control Register: HOTPLUG output ON/OFF control mode = DDC5V detection interlock {0x8545, 0x00000031, 0x00000000, 1, 0}, // ANA CONTROL: PLL charge pump setting for Audio = normal, DAC/PLL power ON/OFF setting for Audio = ON {0x8546, 0x0000002d, 0x00000000, 1, 0}, // AVMUTE CONTROL: AVM_CTL = 0x2d // EDID {0x85c7, 0x00000001, 0x00000000, 1, 0}, // EDID MODE REGISTER: nternal EDID-RAM & DDC2B mode {0x85cb, 0x00000001, 0x00000000, 1, 0}, // EDID Length REGISTER 2: EDID data size stored in RAM (upper address bits) = 0x1 (Size = 0x100 = 256) // HDCP Setting {0x85d1, 0x00000001, 0x00000000, 1, 0}, // {0x8560, 0x00000024, 0x00000000, 1, 0}, // HDCP MODE: HDCP automatic reset when DVI⇔HDMI switched = on, HDCP Line Rekey timing switch = 7clk mode (Data island delay ON), Bcaps[5] KSVINFO_READY(0x8840[5]) auto clear mode = Auto clear using AKSV write {0x8563, 0x00000011, 0x00000000, 1, 0}, // {0x8564, 0x0000000f, 0x00000000, 1, 0}, // // RGB --> YUV Conversion {0x8571, 0x00000002, 0x00000000, 1, 0}, // {0x8573, 0x000000c1, 0x00000000, 1, 0}, // VOUT SET2 REGISTER: 422 fixed output, Video Output 422 conversion mode selection 000: During 444 input, 3tap filter; during 422 input, simple decimation, Enable RGB888 to YUV422 Conversion (Fixed Color output) {0x8574, 0x00000008, 0x00000000, 1, 0}, // VOUT SET3 REGISTER (VOUT_SET3): Follow register bit 0x8573[7] setting {0x8576, 0x00000060, 0x00000000, 1, 0}, // VOUT_COLOR: Output Color = 601 YCbCr Limited, Input Pixel Repetition judgment = automatic, Input Pixel Repetition HOST setting = no repetition // HDMI Audio In Setting {0x8600, 0x00000000, 0x00000000, 1, 0}, {0x8602, 0x000000f3, 0x00000000, 1, 0}, {0x8603, 0x00000002, 0x00000000, 1, 0}, {0x8604, 0x0000000c, 0x00000000, 1, 0}, {0x8606, 0x00000005, 0x00000000, 1, 0}, {0x8607, 0x00000000, 0x00000000, 1, 0}, {0x8620, 0x00000022, 0x00000000, 1, 0}, {0x8640, 0x00000001, 0x00000000, 1, 0}, {0x8641, 0x00000065, 0x00000000, 1, 0}, {0x8642, 0x00000007, 0x00000000, 1, 0}, {0x8652, 0x00000002, 0x00000000, 1, 0}, {0x8665, 0x00000010, 0x00000000, 1, 0}, // InfoFrame Extraction {0x8709, 0x000000ff, 0x00000000, 1, 0}, // PACKET INTERRUPT MODE: all enable {0x870b, 0x0000002c, 0x00000000, 1, 0}, // NO PACKET LIMIT: NO_ACP_LIMIT = 0x2, NO_AVI_LIMIT = 0xC {0x870c, 0x00000053, 0x00000000, 1, 0}, // When VS receive interrupt is detected, VS storage register automatic clear, When ACP receive interrupt is detected, ACP storage register automatic clear, When AVI receive interrupt occurs, judge input video signal with RGB and no Repetition, When AVI receive interrupt is detected, AVI storage register automatic clear. {0x870d, 0x00000001, 0x00000000, 1, 0}, // ERROR PACKET LIMIT: Packet continuing receive error occurrence detection threshold = 1 {0x870e, 0x00000030, 0x00000000, 1, 0}, // NO PACKET LIMIT: {0x9007, 0x00000010, 0x00000000, 1, 0}, // {0x854a, 0x00000001, 0x00000000, 1, 0}, // Initialization completed flag // Output Control {0x0004, 0x00000cf7, 0x00000000, 2, 0}, // Configuration Control Register: Power Island Normal, I2S/TDM clock are free running, Enable 2 Audio channels, Audio channel number Auto detect by HW, I2S/TDM Data no delay, Select YCbCr422 8-bit (HDMI YCbCr422 12-bit data format), Send InfoFrame data out to CSI2, Audio output to I2S i/f (valid for 2 channel only), I2C address index increments on every data byte transfer, Audio and Video tx buffres enable. }; /* list of image formats supported by TCM825X sensor */ static const struct v4l2_fmtdesc tc358743_formats[] = { { .description = "RGB888 (RGB24)", .pixelformat = V4L2_PIX_FMT_RGB24, /* 24 RGB-8-8-8 */ .flags = MIPI_DT_RGB888 // 0x24 }, { .description = "RAW12 (Y/CbCr 4:2:0)", .pixelformat = V4L2_PIX_FMT_UYVY, /* 12 Y/CbCr 4:2:0 */ .flags = MIPI_DT_RAW12 // 0x2c }, { .description = "YUV 4:2:2 8-bit", .pixelformat = V4L2_PIX_FMT_YUYV, /* 8 8-bit color */ .flags = MIPI_DT_YUV422 // 0x1e /* UYVY... */ }, }; static struct tc358743_mode_info tc358743_mode_info_data[2][tc358743_mode_MAX] = { [0][tc358743_mode_720P_60_1280_720] = {tc358743_mode_720P_60_1280_720, 1280, 720, 12, 0, 4, 133, tc358743_setting_YUV422_4lane_720P_60fps_1280_720_133Mhz, ARRAY_SIZE(tc358743_setting_YUV422_4lane_720P_60fps_1280_720_133Mhz), MIPI_DT_YUV422 }, [0][tc358743_mode_1080P_1920_1080] = {tc358743_mode_1080P_1920_1080, 1920, 1080, 15, 0x0b, 4, 300, tc358743_setting_YUV422_4lane_1080P_60fps_1920_1080_300MHz, ARRAY_SIZE(tc358743_setting_YUV422_4lane_1080P_60fps_1920_1080_300MHz), MIPI_DT_YUV422 }, [0][tc358743_mode_INIT1] = {tc358743_mode_INIT1, 1280, 720, 12, 0, 2, 125, tc358743_setting_YUV422_2lane_color_bar_1280_720_125MHz, ARRAY_SIZE(tc358743_setting_YUV422_2lane_color_bar_1280_720_125MHz), MIPI_DT_YUV422 }, [0][tc358743_mode_INIT2] = {tc358743_mode_INIT2, 1280, 720, 12, 0, 4, 125, tc358743_setting_YUV422_4lane_color_bar_1280_720_125MHz, ARRAY_SIZE(tc358743_setting_YUV422_4lane_color_bar_1280_720_125MHz), MIPI_DT_YUV422 }, [0][tc358743_mode_INIT] = {tc358743_mode_INIT, 640, 480, 6, 1, 2, 108, tc358743_setting_YUV422_2lane_color_bar_640_480_108MHz_cont, ARRAY_SIZE(tc358743_setting_YUV422_2lane_color_bar_640_480_108MHz_cont), MIPI_DT_YUV422 }, [0][tc358743_mode_INIT4] = {tc358743_mode_INIT4, 640, 480, 6, 1, 2, 174, tc358743_setting_YUV422_2lane_color_bar_640_480_174MHz, ARRAY_SIZE(tc358743_setting_YUV422_2lane_color_bar_640_480_174MHz), MIPI_DT_YUV422 }, [0][tc358743_mode_INIT3] = {tc358743_mode_INIT3, 1024, 720, 6, 1, 4, 300, tc358743_setting_YUV422_4lane_color_bar_1024_720_200MHz, ARRAY_SIZE(tc358743_setting_YUV422_4lane_color_bar_1024_720_200MHz), MIPI_DT_YUV422 }, [0][tc358743_mode_720P_1280_720] = {tc358743_mode_720P_1280_720, 1280, 720, 12, (0x3e)<<8|(0x3c), 2, 125, tc358743_setting_YUV422_2lane_30fps_720P_1280_720_125MHz, ARRAY_SIZE(tc358743_setting_YUV422_2lane_30fps_720P_1280_720_125MHz), MIPI_DT_YUV422, }, [0][tc358743_mode_480P_720_480] = {tc358743_mode_480P_720_480, 720, 480, 6, (0x02)<<8|(0x00), 2, 125, tc358743_setting_YUV422_2lane_60fps_720_480_125Mhz, ARRAY_SIZE(tc358743_setting_YUV422_2lane_60fps_720_480_125Mhz), MIPI_DT_YUV422, }, [0][tc358743_mode_480P_640_480] = {tc358743_mode_480P_640_480, 640, 480, 6, (0x02)<<8|(0x00), 2, 125, tc358743_setting_YUV422_2lane_60fps_640_480_125Mhz, ARRAY_SIZE(tc358743_setting_YUV422_2lane_60fps_640_480_125Mhz), MIPI_DT_YUV422, }, [0][tc358743_mode_INIT5] = {tc358743_mode_INIT5, 1280, 720, 12, 0, 4, 300, tc358743_setting_YUV422_4lane_color_bar_1280_720_300MHz, ARRAY_SIZE(tc358743_setting_YUV422_4lane_color_bar_1280_720_300MHz), MIPI_DT_YUV422 }, [0][tc358743_mode_INIT6] = {tc358743_mode_INIT6, 1920, 1023, 15, 0, 4, 300, tc358743_setting_YUV422_4lane_color_bar_1920_1023_300MHz, ARRAY_SIZE(tc358743_setting_YUV422_4lane_color_bar_1920_1023_300MHz), MIPI_DT_YUV422 }, [1][tc358743_mode_720P_60_1280_720] = {tc358743_mode_720P_60_1280_720, 1280, 720, 12, 0, 4, 133, tc358743_setting_YUV422_4lane_720P_60fps_1280_720_133Mhz, ARRAY_SIZE(tc358743_setting_YUV422_4lane_720P_60fps_1280_720_133Mhz), MIPI_DT_YUV422 }, [1][tc358743_mode_1080P_1920_1080] = {tc358743_mode_1080P_1920_1080, 1920, 1080, 15, 0xa, 4, 300, tc358743_setting_YUV422_4lane_1080P_30fps_1920_1080_300MHz, ARRAY_SIZE(tc358743_setting_YUV422_4lane_1080P_30fps_1920_1080_300MHz), MIPI_DT_YUV422 }, [1][tc358743_mode_INIT1] = {tc358743_mode_INIT1, 1280, 720, 12, 0, 2, 125, tc358743_setting_YUV422_2lane_color_bar_1280_720_125MHz, ARRAY_SIZE(tc358743_setting_YUV422_2lane_color_bar_1280_720_125MHz), MIPI_DT_YUV422 }, [1][tc358743_mode_INIT2] = {tc358743_mode_INIT2, 1280, 720, 12, 0, 4, 125, tc358743_setting_YUV422_4lane_color_bar_1280_720_125MHz, ARRAY_SIZE(tc358743_setting_YUV422_4lane_color_bar_1280_720_125MHz), MIPI_DT_YUV422 }, [1][tc358743_mode_INIT] = {tc358743_mode_INIT, 640, 480, 6, 1, 2, 108, tc358743_setting_YUV422_2lane_color_bar_640_480_108MHz_cont, ARRAY_SIZE(tc358743_setting_YUV422_2lane_color_bar_640_480_108MHz_cont), MIPI_DT_YUV422 }, [1][tc358743_mode_INIT4] = {tc358743_mode_INIT4, 640, 480, 6, 1, 2, 174, tc358743_setting_YUV422_2lane_color_bar_640_480_174MHz, ARRAY_SIZE(tc358743_setting_YUV422_2lane_color_bar_640_480_174MHz), MIPI_DT_YUV422 }, [1][tc358743_mode_INIT3] = {tc358743_mode_INIT3, 1024, 720, 6, 1, 4, 300, tc358743_setting_YUV422_4lane_color_bar_1024_720_200MHz, ARRAY_SIZE(tc358743_setting_YUV422_4lane_color_bar_1024_720_200MHz), MIPI_DT_YUV422 }, [1][tc358743_mode_720P_1280_720] = {tc358743_mode_720P_1280_720, 1280, 720, 12, (0x3e)<<8|(0x3c), 2, 125, tc358743_setting_YUV422_2lane_30fps_720P_1280_720_125MHz, ARRAY_SIZE(tc358743_setting_YUV422_2lane_30fps_720P_1280_720_125MHz), MIPI_DT_YUV422, }, [1][tc358743_mode_480P_720_480] = {tc358743_mode_480P_720_480, 720, 480, 6, (0x02)<<8|(0x00), 2, 125, tc358743_setting_YUV422_2lane_60fps_720_480_125Mhz, ARRAY_SIZE(tc358743_setting_YUV422_2lane_60fps_720_480_125Mhz), MIPI_DT_YUV422, }, [0][tc358743_mode_480P_640_480] = {tc358743_mode_480P_640_480, 640, 480, 1, (0x02)<<8|(0x00), 2, 125, tc358743_setting_YUV422_2lane_60fps_640_480_125Mhz, ARRAY_SIZE(tc358743_setting_YUV422_2lane_60fps_640_480_125Mhz), MIPI_DT_YUV422, }, [1][tc358743_mode_INIT5] = {tc358743_mode_INIT5, 1280, 720, 12, 0, 4, 300, tc358743_setting_YUV422_4lane_color_bar_1280_720_300MHz, ARRAY_SIZE(tc358743_setting_YUV422_4lane_color_bar_1280_720_300MHz), MIPI_DT_YUV422 }, [1][tc358743_mode_INIT6] = {tc358743_mode_INIT6, 1920, 1023, 15, 0, 4, 300, tc358743_setting_YUV422_4lane_color_bar_1920_1023_300MHz, ARRAY_SIZE(tc358743_setting_YUV422_4lane_color_bar_1920_1023_300MHz), MIPI_DT_YUV422 }, }; static int tc358743_probe(struct i2c_client *adapter, const struct i2c_device_id *device_id); static int tc358743_remove(struct i2c_client *client); static s32 tc358743_read_reg(u16 reg, u32 *val); static s32 tc358743_write_reg(u16 reg, u32 val, int len); static const struct i2c_device_id tc358743_id[] = { {"tc358743_mipi", 0}, {}, }; MODULE_DEVICE_TABLE(i2c, tc358743_id); static struct i2c_driver tc358743_i2c_driver = { .driver = { .owner = THIS_MODULE, .name = "tc358743_mipi", }, .probe = tc358743_probe, .remove = tc358743_remove, .id_table = tc358743_id, }; struct _reg_size { u16 startaddr, endaddr; int size; } tc358743_read_reg_size [] = { {0x0000, 0x005a, 2}, {0x0140, 0x0150, 4}, {0x0204, 0x0238, 4}, {0x040c, 0x0418, 4}, {0x044c, 0x0454, 4}, {0x0500, 0x0518, 4}, {0x0600, 0x06cc, 4}, {0x7000, 0x7100, 2}, {0x8500, 0x8bff, 1}, {0x8c00, 0x8fff, 4}, {0x9000, 0x90ff, 1}, {0x9100, 0x92ff, 1}, {0, 0, 0}, }; static s32 tc358743_write_reg(u16 reg, u32 val, int len) { int i = 0; u32 data = val; u8 au8Buf[6] = {0}; int size = 0; while (0 != tc358743_read_reg_size[i].startaddr || 0 != tc358743_read_reg_size[i].endaddr || 0 != tc358743_read_reg_size[i].size) { if (tc358743_read_reg_size[i].startaddr <= reg && tc358743_read_reg_size[i].endaddr >= reg) { size = tc358743_read_reg_size[i].size; break; } i++; } if (!size) { pr_err("%s:write reg error:reg=%x is not found\n",__func__, reg); return -1; } if (size == 3) { size = 2; } else if (size != len) { pr_err("%s:write reg len error:reg=%x %d instead of %d\n", __func__, reg, len, size); return 0; } while (len > 0) { i = 0; au8Buf[i++] = (reg >> 8) & 0xff; au8Buf[i++] = reg & 0xff; while (size-- > 0) { au8Buf[i++] = (u8)data; data >>= 8; } if (i2c_master_send(tc358743_data.i2c_client, au8Buf, i) < 0) { pr_err("%s:write reg error:reg=%x,val=%x\n", __func__, reg, val); return -1; } len -= (u8)size; reg += (u16)size; } return 0; } static s32 tc358743_read_reg(u16 reg, u32 *val) { u8 au8RegBuf[2] = {0}; u32 u32RdVal = 0; int i=0; int size = 0; while (0 != tc358743_read_reg_size[i].startaddr || 0 != tc358743_read_reg_size[i].endaddr || 0 != tc358743_read_reg_size[i].size) { if (tc358743_read_reg_size[i].startaddr <= reg && tc358743_read_reg_size[i].endaddr >= reg) { size = tc358743_read_reg_size[i].size; break; } i++; } if (!size) return -1; au8RegBuf[0] = reg >> 8; au8RegBuf[1] = reg & 0xff; if (2 != i2c_master_send(tc358743_data.i2c_client, au8RegBuf, 2)) { pr_err("%s:read reg error:reg=%x\n", __func__, reg); return -1; } if (size /*of(u32RdVal)*/ != i2c_master_recv(tc358743_data.i2c_client, (char *)&u32RdVal, size /*of(u32RdVal)*/)) { pr_err("%s:read reg error:reg=%x,val=%x\n", __func__, reg, u32RdVal); return -1; } *val = u32RdVal; return size; } static int tc358743_write_edid(u8 *edid, int len) { int i = 0, off = 0; u8 au8Buf[8+2] = {0}; int size = 0; u16 reg; reg = 0x8C00; off = 0; size = ARRAY_SIZE(au8Buf)-2; pr_debug("Write EDID: %d (%d)\n", len, size); while (len > 0) { i = 0; au8Buf[i++] = (reg >> 8) & 0xff; au8Buf[i++] = reg & 0xff; while (i < ARRAY_SIZE(au8Buf)) { au8Buf[i++] = edid[off++]; } if (i2c_master_send(tc358743_data.i2c_client, au8Buf, i) < 0) { pr_err("%s:write reg error:reg=%x,val=%x\n", __func__, reg, off); return -1; } len -= (u8)size; reg += (u16)size; } pr_debug("Activate EDID\n"); tc358743_write_reg(0x85c7, 0x01, 1); tc358743_write_reg(0x85ca, 0x00, 1); tc358743_write_reg(0x85cb, 0x01, 1); return 0; } static int tc358743_reset(struct sensor_data *sensor) { u32 tgt_fps; /* target frames per secound */ enum tc358743_frame_rate frame_rate = tc358743_60_fps; int ret = -1; det_work_enable(0); while (ret) { tc_standby(1); mdelay(100); tc_standby(0); mdelay(1000); tgt_fps = sensor->streamcap.timeperframe.denominator / sensor->streamcap.timeperframe.numerator; if (tgt_fps == 60) frame_rate = tc358743_60_fps; else if (tgt_fps == 30) frame_rate = tc358743_30_fps; pr_debug("%s: capture mode: %d extended mode: %d fps: %d\n", __func__,sensor->streamcap.capturemode, sensor->streamcap.extendedmode, tgt_fps); ret = tc358743_init_mode(frame_rate, sensor->streamcap.capturemode); if (ret) pr_err("%s: Fail to init tc35874! - retry\n", __func__); } det_work_enable(1); return ret; } void mipi_csi2_swreset(struct mipi_csi2_info *info); #include "../../../../mxc/mipi/mxc_mipi_csi2.h" static int tc358743_init_mode(enum tc358743_frame_rate frame_rate, enum tc358743_mode mode) { struct reg_value *pModeSetting = NULL; s32 i = 0; s32 iModeSettingArySize = 0; register u32 RepeateLines = 0; register int RepeateTimes = 0; register u32 Delay_ms = 0; register u16 RegAddr = 0; register u32 Mask = 0; register u32 Val = 0; u8 Length; u32 RegVal = 0; int retval = 0; void *mipi_csi2_info; u32 mipi_reg; u32 mipi_reg_test[10]; pr_debug("%s rate: %d mode: %d\n", __func__, frame_rate, mode); if ((mode > tc358743_mode_MAX || mode < 0) && (mode != tc358743_mode_INIT)) { pr_debug("%s Wrong tc358743 mode detected! %d. Set mode 0\n", __func__, mode); mode = 0; } mipi_csi2_info = mipi_csi2_get_info(); pr_debug("%s rate: %d mode: %d, info %p\n", __func__, frame_rate, mode, mipi_csi2_info); /* initial mipi dphy */ tc358743_toggle_hpd(!hpd_active); if (mipi_csi2_info) { pr_debug("%s: mipi_csi2_info:\n" "mipi_en: %d\n" "ipu_id: %d\n" "csi_id: %d\n" "v_channel: %d\n" "lanes: %d\n" "datatype: %d\n" "dphy_clk: %p\n" "pixel_clk: %p\n" "mipi_csi2_base:%p\n" "pdev: %p\n" , __func__, ((struct mipi_csi2_info *)mipi_csi2_info)->mipi_en, ((struct mipi_csi2_info *)mipi_csi2_info)->ipu_id, ((struct mipi_csi2_info *)mipi_csi2_info)->csi_id, ((struct mipi_csi2_info *)mipi_csi2_info)->v_channel, ((struct mipi_csi2_info *)mipi_csi2_info)->lanes, ((struct mipi_csi2_info *)mipi_csi2_info)->datatype, ((struct mipi_csi2_info *)mipi_csi2_info)->dphy_clk, ((struct mipi_csi2_info *)mipi_csi2_info)->pixel_clk, ((struct mipi_csi2_info *)mipi_csi2_info)->mipi_csi2_base, ((struct mipi_csi2_info *)mipi_csi2_info)->pdev ); if (!mipi_csi2_get_status(mipi_csi2_info)) mipi_csi2_enable(mipi_csi2_info); if (mipi_csi2_get_status(mipi_csi2_info)) { int ifmt; if (tc358743_mode_info_data[frame_rate][mode].lanes != 0) { pr_debug("%s Change lanes: from %d to %d\n", __func__, ((struct mipi_csi2_info *)mipi_csi2_info)->lanes, tc358743_mode_info_data[frame_rate][mode].lanes); ((struct mipi_csi2_info *)mipi_csi2_info)->lanes = tc358743_mode_info_data[frame_rate][mode].lanes; ((struct mipi_csi2_info *)mipi_csi2_info)->lanes = tc358743_mode_info_data[frame_rate][mode].lanes; } pr_debug("Now Using %d lanes\n",mipi_csi2_set_lanes(mipi_csi2_info)); /*Only reset MIPI CSI2 HW at sensor initialize*/ if (!hdmi_mode) // is this during reset mipi_csi2_reset(mipi_csi2_info); pr_debug("%s format: %x\n", __func__, tc358743_data.pix.pixelformat); for (ifmt = 0; ifmt < ARRAY_SIZE(tc358743_formats); ifmt++) if (tc358743_mode_info_data[frame_rate][mode].flags == tc358743_formats[ifmt].flags) { tc358743_data.pix.pixelformat = tc358743_formats[ifmt].pixelformat; pr_debug("%s: %s (%x, %x)\n", __func__, tc358743_formats[ifmt].description, tc358743_data.pix.pixelformat, tc358743_formats[ifmt].flags); mipi_csi2_set_datatype(mipi_csi2_info, tc358743_formats[ifmt].flags); break; } if (ifmt >= ARRAY_SIZE(tc358743_formats)) { pr_err("currently this sensor format (0x%x) can not be supported!\n", tc358743_data.pix.pixelformat); return -1; } } else { pr_err("Can not enable mipi csi2 driver!\n"); return -1; } } else { pr_err("Fail to get mipi_csi2_info!\n"); return -1; } { pModeSetting = tc358743_mode_info_data[frame_rate][mode].init_data_ptr; iModeSettingArySize = tc358743_mode_info_data[frame_rate][mode].init_data_size; tc358743_data.pix.width = tc358743_mode_info_data[frame_rate][mode].width; tc358743_data.pix.height = tc358743_mode_info_data[frame_rate][mode].height; pr_debug("%s: Set %d regs from %p for frs %d mode %d with width %d height %d\n", __func__, iModeSettingArySize, pModeSetting, frame_rate, mode, tc358743_data.pix.width, tc358743_data.pix.height); for (i = 0; i < iModeSettingArySize; ++i) { pModeSetting = tc358743_mode_info_data[frame_rate][mode].init_data_ptr + i; Delay_ms = pModeSetting->u32Delay_ms & (0xffff); RegAddr = pModeSetting->u16RegAddr; Val = pModeSetting->u32Val; Mask = pModeSetting->u32Mask; Length = pModeSetting->u8Length; if (Mask) { retval = tc358743_read_reg(RegAddr, &RegVal); if (retval < 0) break; RegVal &= ~(u8)Mask; Val &= Mask; Val |= RegVal; } retval = tc358743_write_reg(RegAddr, Val, Length); if (retval < 0) break; if (Delay_ms) msleep(Delay_ms); if (0 != ((pModeSetting->u32Delay_ms>>16) & (0xff))) { if (!RepeateTimes) { RepeateTimes = (pModeSetting->u32Delay_ms>>16) & (0xff); RepeateLines = (pModeSetting->u32Delay_ms>>24) & (0xff); } if (--RepeateTimes > 0) { i -= RepeateLines; } } } if (retval < 0) { pr_err("%s: Fail to write REGS to tc35874!\n", __func__); goto err; } } if (!hdmi_mode) // is this during reset if ((retval = tc358743_write_edid(cHDMIEDID, ARRAY_SIZE(cHDMIEDID)))) pr_err("%s: Fail to write EDID to tc35874!\n", __func__); tc358743_toggle_hpd(hpd_active); if (mipi_csi2_info) { unsigned int i = 0; /* wait for mipi sensor ready */ mipi_reg = mipi_csi2_dphy_status(mipi_csi2_info); while ((mipi_reg == 0x200) && (i < 10)) { mipi_reg_test[i] = mipi_reg; mipi_reg = mipi_csi2_dphy_status(mipi_csi2_info); i++; msleep(10); } if (i >= 10) { pr_err("mipi csi2 can not receive sensor clk!\n"); return -1; } { int j; for (j = 0; j < i; j++) { pr_debug("%d mipi csi2 dphy status %x\n", j, mipi_reg_test[j]); } } i = 0; /* wait for mipi stable */ mipi_reg = mipi_csi2_get_error1(mipi_csi2_info); while ((mipi_reg != 0x0) && (i < 10)) { mipi_reg_test[i] = mipi_reg; mipi_reg = mipi_csi2_get_error1(mipi_csi2_info); i++; msleep(10); } if (i >= 10) { pr_err("mipi csi2 can not reveive data correctly!\n"); return -1; } { int j; for (j = 0; j < i; j++) { pr_debug("%d mipi csi2 err1 %x\n", j, mipi_reg_test[j]); } } } err: return (retval>0)?0:retval; } /* --------------- IOCTL functions from v4l2_int_ioctl_desc --------------- */ static int ioctl_g_ifparm(struct v4l2_int_device *s, struct v4l2_ifparm *p) { pr_debug("%s\n", __func__); if (s == NULL) { pr_err(" ERROR!! no slave device set!\n"); return -1; } memset(p, 0, sizeof(*p)); p->u.bt656.clock_curr = TC358743_XCLK_MIN; //tc358743_data.mclk; pr_debug("%s: clock_curr=mclk=%d\n", __func__, tc358743_data.mclk); p->if_type = V4L2_IF_TYPE_BT656; p->u.bt656.mode = V4L2_IF_TYPE_BT656_MODE_NOBT_8BIT; p->u.bt656.clock_min = TC358743_XCLK_MIN; p->u.bt656.clock_max = TC358743_XCLK_MAX; p->u.bt656.bt_sync_correct = 1; /* Indicate external vsync */ return 0; } /*! * ioctl_s_power - V4L2 sensor interface handler for VIDIOC_S_POWER ioctl * @s: pointer to standard V4L2 device structure * @on: indicates power mode (on or off) * * Turns the power on or off, depending on the value of on and returns the * appropriate error code. */ static int ioctl_s_power(struct v4l2_int_device *s, int on) { struct sensor_data *sensor = s->priv; pr_debug("%s: %d\n", __func__, on); if (on && !sensor->on) { if (io_regulator) if (regulator_enable(io_regulator) != 0) return -EIO; if (core_regulator) if (regulator_enable(core_regulator) != 0) return -EIO; if (gpo_regulator) if (regulator_enable(gpo_regulator) != 0) return -EIO; if (analog_regulator) if (regulator_enable(analog_regulator) != 0) return -EIO; /* Make sure power on */ tc_standby(0); } else if (!on && sensor->on) { if (analog_regulator) regulator_disable(analog_regulator); if (core_regulator) regulator_disable(core_regulator); if (io_regulator) regulator_disable(io_regulator); if (gpo_regulator) regulator_disable(gpo_regulator); if (!hdmi_mode) tc358743_reset(sensor); } sensor->on = on; return 0; } /*! * ioctl_g_parm - V4L2 sensor interface handler for VIDIOC_G_PARM ioctl * @s: pointer to standard V4L2 device structure * @a: pointer to standard V4L2 VIDIOC_G_PARM ioctl structure * * Returns the sensor's video CAPTURE parameters. */ static int ioctl_g_parm(struct v4l2_int_device *s, struct v4l2_streamparm *a) { struct sensor_data *sensor = s->priv; struct v4l2_captureparm *cparm = &a->parm.capture; int ret = 0; pr_debug("%s type: %x\n", __func__, a->type); switch (a->type) { /* This is the only case currently handled. */ case V4L2_BUF_TYPE_VIDEO_CAPTURE: memset(a, 0, sizeof(*a)); a->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; cparm->capability = sensor->streamcap.capability; cparm->timeperframe = sensor->streamcap.timeperframe; cparm->capturemode = sensor->streamcap.capturemode; cparm->extendedmode = sensor->streamcap.extendedmode; ret = 0; break; /* These are all the possible cases. */ case V4L2_BUF_TYPE_VIDEO_OUTPUT: case V4L2_BUF_TYPE_VIDEO_OVERLAY: case V4L2_BUF_TYPE_VBI_CAPTURE: case V4L2_BUF_TYPE_VBI_OUTPUT: case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE: case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT: ret = -EINVAL; break; default: pr_debug(" type is unknown - %d\n", a->type); ret = -EINVAL; break; } det_work_enable(1); pr_debug("%s done %d\n", __func__, ret); return ret; } static int tc358743_toggle_hpd(int active) { int ret = 0; if (active) { ret += tc358743_write_reg(0x8544, 0x00, 1); mdelay(500); ret += tc358743_write_reg(0x8544, 0x10, 1); } else { ret += tc358743_write_reg(0x8544, 0x10, 1); mdelay(500); ret += tc358743_write_reg(0x8544, 0x00, 1); } return ret; } /*! * ioctl_s_parm - V4L2 sensor interface handler for VIDIOC_S_PARM ioctl * @s: pointer to standard V4L2 device structure * @a: pointer to standard V4L2 VIDIOC_S_PARM ioctl structure * * Configures the sensor to use the input parameters, if possible. If * not possible, reverts to the old parameters and returns the * appropriate error code. */ static int ioctl_s_parm(struct v4l2_int_device *s, struct v4l2_streamparm *a) { struct sensor_data *sensor = s->priv; struct v4l2_fract *timeperframe = &a->parm.capture.timeperframe; u32 tgt_fps; /* target frames per secound */ enum tc358743_frame_rate frame_rate = tc358743_60_fps, frame_rate_now = tc358743_60_fps; int ret = 0; pr_debug("%s\n", __func__); det_work_enable(0); /* Make sure power on */ tc_standby(0); switch (a->type) { /* This is the only case currently handled. */ case V4L2_BUF_TYPE_VIDEO_CAPTURE: /* Check that the new frame rate is allowed. */ if ((timeperframe->numerator == 0) || (timeperframe->denominator == 0)) { timeperframe->denominator = DEFAULT_FPS; timeperframe->numerator = 1; } tgt_fps = timeperframe->denominator / timeperframe->numerator; if (tgt_fps > MAX_FPS) { timeperframe->denominator = MAX_FPS; timeperframe->numerator = 1; } else if (tgt_fps < MIN_FPS) { timeperframe->denominator = MIN_FPS; timeperframe->numerator = 1; } /* Actual frame rate we use */ tgt_fps = timeperframe->denominator / timeperframe->numerator; if (tgt_fps == 60) frame_rate = tc358743_60_fps; else if (tgt_fps == 30) frame_rate = tc358743_30_fps; else { pr_err(" The camera frame rate is not supported!\n"); ret = -EINVAL; break; } if ((u32)a->parm.capture.capturemode > tc358743_mode_MAX) { a->parm.capture.capturemode = 0; pr_debug("%s: Forse extended mode: %d \n", __func__,(u32)a->parm.capture.capturemode); } tgt_fps = sensor->streamcap.timeperframe.denominator / sensor->streamcap.timeperframe.numerator; if (tgt_fps == 60) frame_rate_now = tc358743_60_fps; else if (tgt_fps == 30) frame_rate_now = tc358743_30_fps; if (frame_rate_now != frame_rate || sensor->streamcap.capturemode != (u32)a->parm.capture.capturemode || sensor->streamcap.extendedmode != (u32)a->parm.capture.extendedmode) { sensor->streamcap.timeperframe = *timeperframe; sensor->streamcap.capturemode = (u32)a->parm.capture.capturemode; sensor->streamcap.extendedmode = (u32)a->parm.capture.extendedmode; pr_debug("%s: capture mode: %d extended mode: %d \n", __func__,sensor->streamcap.capturemode, sensor->streamcap.extendedmode); ret = tc358743_init_mode(frame_rate, sensor->streamcap.capturemode); } else { pr_debug("%s: Keep current settings\n", __func__); } break; /* These are all the possible cases. */ case V4L2_BUF_TYPE_VIDEO_OUTPUT: case V4L2_BUF_TYPE_VIDEO_OVERLAY: case V4L2_BUF_TYPE_VBI_CAPTURE: case V4L2_BUF_TYPE_VBI_OUTPUT: case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE: case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT: pr_debug(" type is not " \ "V4L2_BUF_TYPE_VIDEO_CAPTURE but %d\n", a->type); ret = -EINVAL; break; default: pr_debug(" type is unknown - %d\n", a->type); ret = -EINVAL; break; } if (ret) det_work_enable(1); return ret; } /*! * ioctl_g_ctrl - V4L2 sensor interface handler for VIDIOC_G_CTRL ioctl * @s: pointer to standard V4L2 device structure * @vc: standard V4L2 VIDIOC_G_CTRL ioctl structure * * If the requested control is supported, returns the control's current * value from the video_control[] array. Otherwise, returns -EINVAL * if the control is not supported. */ static int ioctl_g_ctrl(struct v4l2_int_device *s, struct v4l2_control *vc) { int ret = 0; pr_debug("%s\n", __func__); switch (vc->id) { case V4L2_CID_BRIGHTNESS: vc->value = tc358743_data.brightness; break; case V4L2_CID_HUE: vc->value = tc358743_data.hue; break; case V4L2_CID_CONTRAST: vc->value = tc358743_data.contrast; break; case V4L2_CID_SATURATION: vc->value = tc358743_data.saturation; break; case V4L2_CID_RED_BALANCE: vc->value = tc358743_data.red; break; case V4L2_CID_BLUE_BALANCE: vc->value = tc358743_data.blue; break; case V4L2_CID_EXPOSURE: vc->value = tc358743_data.ae_mode; break; default: ret = -EINVAL; } return ret; } /*! * ioctl_s_ctrl - V4L2 sensor interface handler for VIDIOC_S_CTRL ioctl * @s: pointer to standard V4L2 device structure * @vc: standard V4L2 VIDIOC_S_CTRL ioctl structure * * If the requested control is supported, sets the control's current * value in HW (and updates the video_control[] array). Otherwise, * returns -EINVAL if the control is not supported. */ static int ioctl_s_ctrl(struct v4l2_int_device *s, struct v4l2_control *vc) { int retval = 0; pr_debug("In tc358743:ioctl_s_ctrl %d\n", vc->id); switch (vc->id) { case V4L2_CID_BRIGHTNESS: break; case V4L2_CID_CONTRAST: break; case V4L2_CID_SATURATION: break; case V4L2_CID_HUE: break; case V4L2_CID_AUTO_WHITE_BALANCE: break; case V4L2_CID_DO_WHITE_BALANCE: break; case V4L2_CID_RED_BALANCE: break; case V4L2_CID_BLUE_BALANCE: break; case V4L2_CID_GAMMA: break; case V4L2_CID_EXPOSURE: break; case V4L2_CID_AUTOGAIN: break; case V4L2_CID_GAIN: break; case V4L2_CID_HFLIP: break; case V4L2_CID_VFLIP: break; default: retval = -EPERM; break; } return retval; } int get_pixelformat(int index) { int ifmt; for (ifmt = 0; ifmt < ARRAY_SIZE(tc358743_formats); ifmt++) if (tc358743_mode_info_data[0][index].flags == tc358743_formats[ifmt].flags) break; if (ifmt == ARRAY_SIZE(tc358743_formats)) ifmt = 0; /* Default = RBG888 */ return ifmt; } /*! * ioctl_enum_framesizes - V4L2 sensor interface handler for * VIDIOC_ENUM_FRAMESIZES ioctl * @s: pointer to standard V4L2 device structure * @fsize: standard V4L2 VIDIOC_ENUM_FRAMESIZES ioctl structure * * Return 0 if successful, otherwise -EINVAL. */ static int ioctl_enum_framesizes(struct v4l2_int_device *s, struct v4l2_frmsizeenum *fsize) { pr_debug("%s, INDEX: %d\n", __func__,fsize->index); if (fsize->index > tc358743_mode_MAX) return -EINVAL; fsize->pixel_format = tc358743_formats[get_pixelformat(fsize->index)].pixelformat; fsize->discrete.width = tc358743_mode_info_data[0][fsize->index].width; fsize->discrete.height = tc358743_mode_info_data[0][fsize->index].height; pr_debug("%s %d:%d format: %x\n", __func__, fsize->discrete.width, fsize->discrete.height, fsize->pixel_format); return 0; } /*! * ioctl_g_chip_ident - V4L2 sensor interface handler for * VIDIOC_DBG_G_CHIP_IDENT ioctl * @s: pointer to standard V4L2 device structure * @id: pointer to int * * Return 0. */ static int ioctl_g_chip_ident(struct v4l2_int_device *s, int *id) { ((struct v4l2_dbg_chip_ident *)id)->match.type = V4L2_CHIP_MATCH_I2C_DRIVER; strcpy(((struct v4l2_dbg_chip_ident *)id)->match.name, "tc358743_mipi"); return 0; } /*! * ioctl_init - V4L2 sensor interface handler for VIDIOC_INT_INIT * @s: pointer to standard V4L2 device structure */ static int ioctl_init(struct v4l2_int_device *s) { pr_debug("%s\n", __func__); return 0; } /*! * ioctl_enum_fmt_cap - V4L2 sensor interface handler for VIDIOC_ENUM_FMT * @s: pointer to standard V4L2 device structure * @fmt: pointer to standard V4L2 fmt description structure * * Return 0. */ static int ioctl_enum_fmt_cap(struct v4l2_int_device *s, struct v4l2_fmtdesc *fmt) { pr_debug("%s\n", __func__); if (fmt->index > tc358743_mode_MAX) return -EINVAL; fmt->pixelformat = tc358743_formats[get_pixelformat(fmt->index)].pixelformat; pr_debug("%s: format: %x\n", __func__, fmt->pixelformat); return 0; } static int ioctl_try_fmt_cap(struct v4l2_int_device *s, struct v4l2_format *f) { struct sensor_data *sensor = s->priv; u32 tgt_fps; /* target frames per secound */ enum tc358743_frame_rate frame_rate; // enum image_size isize; int ifmt; struct v4l2_pix_format *pix = &f->fmt.pix; pr_debug("%s\n", __func__); tgt_fps = sensor->streamcap.timeperframe.denominator / sensor->streamcap.timeperframe.numerator; if (tgt_fps == 60) { frame_rate = tc358743_60_fps; } else if (tgt_fps == 30) { frame_rate = tc358743_30_fps; } else { pr_debug("%s: %d fps (%d,%d) is not supported\n", __func__, tgt_fps, sensor->streamcap.timeperframe.denominator,sensor->streamcap.timeperframe.numerator); return -EINVAL; } tc358743_data.pix.width = pix->width = tc358743_mode_info_data[frame_rate][sensor->streamcap.capturemode].width; tc358743_data.pix.height = pix->height = tc358743_mode_info_data[frame_rate][sensor->streamcap.capturemode].height; for (ifmt = 0; ifmt < ARRAY_SIZE(tc358743_formats); ifmt++) if (tc358743_mode_info_data[frame_rate][sensor->streamcap.capturemode].flags == tc358743_formats[ifmt].flags) break; if (ifmt == ARRAY_SIZE(tc358743_formats)) ifmt = 0; /* Default = RBG888 */ tc358743_data.pix.pixelformat = pix->pixelformat = tc358743_formats[ifmt].pixelformat; pix->field = V4L2_FIELD_NONE; pix->bytesperline = pix->width * 4; pix->sizeimage = pix->bytesperline * pix->height; pix->priv = 0; switch (pix->pixelformat) { case V4L2_PIX_FMT_UYVY: default: pix->colorspace = V4L2_COLORSPACE_SRGB; break; } { u32 u32val; int ret = tc358743_read_reg(0x8520,&u32val); pr_debug("SYS_STATUS: 0x%x, ret val: %d \n",u32val,ret); ret = tc358743_read_reg(0x8521,&u32val); pr_debug("VI_STATUS0: 0x%x, ret val: %d \n",u32val,ret); ret = tc358743_read_reg(0x8522,&u32val); pr_debug("VI_STATUS1: 0x%x, ret val: %d \n",u32val,ret); ret = tc358743_read_reg(0x8525,&u32val); pr_debug("VI_STATUS2: 0x%x, ret val: %d \n",u32val,ret); ret = tc358743_read_reg(0x8528,&u32val); pr_debug("VI_STATUS3: 0x%x, ret val: %d \n",u32val,ret); pr_debug("%s %d:%d format: %x\n", __func__, pix->width, pix->height, pix->pixelformat); } return 0; } /*! * ioctl_g_fmt_cap - V4L2 sensor interface handler for ioctl_g_fmt_cap * @s: pointer to standard V4L2 device structure * @f: pointer to standard V4L2 v4l2_format structure * * Returns the sensor's current pixel format in the v4l2_format * parameter. */ static int ioctl_g_fmt_cap(struct v4l2_int_device *s, struct v4l2_format *f) { pr_debug("%s\n", __func__); return ioctl_try_fmt_cap(s, f); } /*! * ioctl_dev_init - V4L2 sensor interface handler for vidioc_int_dev_init_num * @s: pointer to standard V4L2 device structure * * Initialise the device when slave attaches to the master. */ static int ioctl_dev_init(struct v4l2_int_device *s) { struct sensor_data *sensor = s->priv; u32 tgt_xclk; /* target xclk */ u32 tgt_fps; /* target frames per secound */ int ret = 0; enum tc358743_frame_rate frame_rate; void *mipi_csi2_info; pr_debug("%s\n", __func__); tc358743_data.on = true; /* mclk */ tgt_xclk = tc358743_data.mclk; tgt_xclk = min(tgt_xclk, (u32)TC358743_XCLK_MAX); tgt_xclk = max(tgt_xclk, (u32)TC358743_XCLK_MIN); tc358743_data.mclk = tgt_xclk; pr_debug("%s: Setting mclk to %d MHz\n", __func__, tc358743_data.mclk / 1000000); // set_mclk_rate(&tc358743_data.mclk, tc358743_data.mclk_source); // pr_debug("%s: After mclk to %d MHz\n", __func__, tc358743_data.mclk / 1000000); /* Default camera frame rate is set in probe */ tgt_fps = sensor->streamcap.timeperframe.denominator / sensor->streamcap.timeperframe.numerator; if (tgt_fps == 60) frame_rate = tc358743_60_fps; else if (tgt_fps == 30) frame_rate = tc358743_30_fps; else return -EINVAL; mipi_csi2_info = mipi_csi2_get_info(); /* enable mipi csi2 */ if (mipi_csi2_info) { mipi_csi2_enable(mipi_csi2_info); } else { pr_err("Fail to get mipi_csi2_info!\n"); return -EPERM; } pr_debug("%s done\n", __func__); return ret; } /*! * ioctl_dev_exit - V4L2 sensor interface handler for vidioc_int_dev_exit_num * @s: pointer to standard V4L2 device structure * * Delinitialise the device when slave detaches to the master. */ static int ioctl_dev_exit(struct v4l2_int_device *s) { void *mipi_csi2_info; mipi_csi2_info = mipi_csi2_get_info(); /* disable mipi csi2 */ if (mipi_csi2_info) if (mipi_csi2_get_status(mipi_csi2_info)) mipi_csi2_disable(mipi_csi2_info); return 0; } /*! * This structure defines all the ioctls for this module and links them to the * enumeration. */ static struct v4l2_int_ioctl_desc tc358743_ioctl_desc[] = { {vidioc_int_dev_init_num, (v4l2_int_ioctl_func*) ioctl_dev_init}, {vidioc_int_dev_exit_num, ioctl_dev_exit}, {vidioc_int_s_power_num, (v4l2_int_ioctl_func*) ioctl_s_power}, {vidioc_int_g_ifparm_num, (v4l2_int_ioctl_func*) ioctl_g_ifparm}, {vidioc_int_init_num, (v4l2_int_ioctl_func*) ioctl_init}, {vidioc_int_enum_fmt_cap_num, (v4l2_int_ioctl_func *) ioctl_enum_fmt_cap}, {vidioc_int_try_fmt_cap_num, (v4l2_int_ioctl_func *)ioctl_try_fmt_cap}, {vidioc_int_g_fmt_cap_num, (v4l2_int_ioctl_func *) ioctl_g_fmt_cap}, {vidioc_int_g_parm_num, (v4l2_int_ioctl_func *) ioctl_g_parm}, {vidioc_int_s_parm_num, (v4l2_int_ioctl_func *) ioctl_s_parm}, {vidioc_int_g_ctrl_num, (v4l2_int_ioctl_func *) ioctl_g_ctrl}, {vidioc_int_s_ctrl_num, (v4l2_int_ioctl_func *) ioctl_s_ctrl}, {vidioc_int_enum_framesizes_num, (v4l2_int_ioctl_func *) ioctl_enum_framesizes}, {vidioc_int_g_chip_ident_num, (v4l2_int_ioctl_func *) ioctl_g_chip_ident}, }; static struct v4l2_int_slave tc358743_slave = { .ioctls = tc358743_ioctl_desc, .num_ioctls = ARRAY_SIZE(tc358743_ioctl_desc), }; static struct v4l2_int_device tc358743_int_device = { .module = THIS_MODULE, .name = "tc358743", .type = v4l2_int_type_slave, .u = { .slave = &tc358743_slave, }, }; #ifdef AUDIO_ENABLE struct imx_ssi { struct platform_device *ac97_dev; struct snd_soc_dai *imx_ac97; struct clk *clk; void __iomem *base; int irq; int fiq_enable; unsigned int offset; unsigned int flags; void (*ac97_reset) (struct snd_ac97 *ac97); void (*ac97_warm_reset)(struct snd_ac97 *ac97); struct imx_pcm_dma_params dma_params_rx; struct imx_pcm_dma_params dma_params_tx; int enabled; struct platform_device *soc_platform_pdev; struct platform_device *soc_platform_pdev_fiq; }; #define SSI_SCR 0x10 #define SSI_SRCR 0x20 #define SSI_STCCR 0x24 #define SSI_SRCCR 0x28 #define SSI_SCR_I2S_MODE_NORM (0 << 5) #define SSI_SCR_I2S_MODE_MSTR (1 << 5) #define SSI_SCR_I2S_MODE_SLAVE (2 << 5) #define SSI_I2S_MODE_MASK (3 << 5) #define SSI_SCR_SYN (1 << 4) #define SSI_SRCR_RSHFD (1 << 4) #define SSI_SRCR_RSCKP (1 << 3) #define SSI_SRCR_RFSI (1 << 2) #define SSI_SRCR_REFS (1 << 0) #define SSI_STCCR_WL(x) ((((x) - 2) >> 1) << 13) #define SSI_STCCR_WL_MASK (0xf << 13) #define SSI_SRCCR_WL(x) ((((x) - 2) >> 1) << 13) #define SSI_SRCCR_WL_MASK (0xf << 13) /* Audio setup */ static int imxpac_tc358743_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) { struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_dai *codec_dai = rtd->codec_dai; struct snd_soc_dai *cpu_dai = rtd->cpu_dai; int ret; ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_IF | SND_SOC_DAIFMT_CBM_CFM); if (ret) { pr_err("%s: failed set cpu dai format\n", __func__); return ret; } ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM); if (ret) { pr_err("%s: failed set codec dai format\n", __func__); return ret; } ret = snd_soc_dai_set_sysclk(codec_dai, 0, CODEC_CLOCK, SND_SOC_CLOCK_OUT); if (ret) { pr_err("%s: failed setting codec sysclk\n", __func__); return ret; } snd_soc_dai_set_tdm_slot(cpu_dai, 0xffffffc, 0xffffffc, 2, 0); ret = snd_soc_dai_set_sysclk(cpu_dai, IMX_SSP_SYS_CLK, 0, SND_SOC_CLOCK_IN); if (ret) { pr_err("can't set CPU system clock IMX_SSP_SYS_CLK\n"); return ret; } #if 1 // clear SSI_SRCR_RXBIT0 and SSI_SRCR_RSHFD in order to push Right-justified MSB data fro { struct imx_ssi *ssi = snd_soc_dai_get_drvdata(cpu_dai); u32 scr = 0, srcr = 0, stccr = 0, srccr = 0; pr_debug("%s: base %p\n", __func__, (void *)ssi->base); scr = readl(ssi->base + SSI_SCR); pr_debug("%s: SSI_SCR before: %p\n", __func__, (void *)scr); writel(scr, ssi->base + SSI_SCR); pr_debug("%s: SSI_SCR after: %p\n", __func__, (void *)scr); srcr = readl(ssi->base + SSI_SRCR); pr_debug("%s: SSI_SRCR before: %p\n", __func__, (void *)srcr); writel(srcr, ssi->base + SSI_SRCR); pr_debug("%s: SSI_SRCR after: %p\n", __func__, (void *)srcr); stccr = readl(ssi->base + SSI_STCCR); pr_debug("%s: SSI_STCCR before: %p\n", __func__, (void *)stccr); stccr &= ~SSI_STCCR_WL_MASK; stccr |= SSI_STCCR_WL(16); writel(stccr, ssi->base + SSI_STCCR); pr_debug("%s: SSI_STCCR after: %p\n", __func__, (void *)stccr); srccr = readl(ssi->base + SSI_SRCCR); pr_debug("%s: SSI_SRCCR before: %p\n", __func__, (void *)srccr); srccr &= ~SSI_SRCCR_WL_MASK; srccr |= SSI_SRCCR_WL(16); writel(srccr, ssi->base + SSI_SRCCR); pr_debug("%s: SSI_SRCCR after: %p\n", __func__, (void *)srccr); } #endif return 0; } /* Headphones jack detection DAPM pins */ static struct snd_soc_jack_pin hs_jack_pins_a[] = { }; /* imx_3stack card dapm widgets */ static struct snd_soc_dapm_widget imx_3stack_dapm_widgets_a[] = { }; static struct snd_kcontrol_new tc358743_machine_controls_a[] = { }; /* imx_3stack machine connections to the codec pins */ static struct snd_soc_dapm_route audio_map_a[] = { }; static int imx_3stack_tc358743_init(struct snd_soc_pcm_runtime *rtd) { struct snd_soc_codec *codec = rtd->codec; int ret; struct snd_soc_jack *hs_jack; struct snd_soc_jack_pin *hs_jack_pins; int hs_jack_pins_size; struct snd_soc_dapm_widget *imx_3stack_dapm_widgets; int imx_3stack_dapm_widgets_size; struct snd_kcontrol_new *tc358743_machine_controls; int tc358743_machine_controls_size; struct snd_soc_dapm_route *audio_map; int audio_map_size; int gpio_num = -1; char *gpio_name; pr_debug("%s started\n", __func__); hs_jack_pins = hs_jack_pins_a; hs_jack_pins_size = ARRAY_SIZE(hs_jack_pins_a); imx_3stack_dapm_widgets = imx_3stack_dapm_widgets_a; imx_3stack_dapm_widgets_size = ARRAY_SIZE(imx_3stack_dapm_widgets_a); tc358743_machine_controls = tc358743_machine_controls_a; tc358743_machine_controls_size = ARRAY_SIZE(tc358743_machine_controls_a); audio_map = audio_map_a; audio_map_size = ARRAY_SIZE(audio_map_a); gpio_num = -1; //card_a_gpio_num; gpio_name = NULL; ret = snd_soc_add_controls(codec, tc358743_machine_controls, tc358743_machine_controls_size); if (ret) { pr_err("%s: snd_soc_add_controls failed. err = %d\n", __func__, ret); return ret; } /* Add imx_3stack specific widgets */ snd_soc_dapm_new_controls(&codec->dapm, imx_3stack_dapm_widgets, imx_3stack_dapm_widgets_size); /* Set up imx_3stack specific audio path audio_map */ snd_soc_dapm_add_routes(&codec->dapm, audio_map, audio_map_size); snd_soc_dapm_enable_pin(&codec->dapm, hs_jack_pins->pin); snd_soc_dapm_sync(&codec->dapm); hs_jack = kzalloc(sizeof(struct snd_soc_jack), GFP_KERNEL); ret = snd_soc_jack_new(codec, hs_jack_pins->pin, SND_JACK_HEADPHONE, hs_jack); if (ret) { pr_err("%s: snd_soc_jack_new failed. err = %d\n", __func__, ret); return ret; } ret = snd_soc_jack_add_pins(hs_jack,hs_jack_pins_size, hs_jack_pins); if (ret) { pr_err("%s: snd_soc_jack_add_pinsfailed. err = %d\n", __func__, ret); return ret; } return 0; } static struct snd_soc_ops imxpac_tc358743_snd_ops = { .hw_params = imxpac_tc358743_hw_params, }; static struct snd_soc_dai_link imxpac_tc358743_dai = { .name = "tc358743", .stream_name = "TC358743", .codec_dai_name = "tc358743-hifi", .platform_name = "imx-pcm-audio.2", .codec_name = "tc358743_mipi.1-000f", .cpu_dai_name = "imx-ssi.2", .init = imx_3stack_tc358743_init, .ops = &imxpac_tc358743_snd_ops, }; static struct snd_soc_card imxpac_tc358743 = { .name = "cpuimx-audio_hdmi_in", .dai_link = &imxpac_tc358743_dai, .num_links = 1, }; static struct platform_device *imxpac_tc358743_snd_device; static struct platform_device *imxpac_tc358743_snd_device; static int imx_audmux_config(int slave, int master) { unsigned int ptcr, pdcr; slave = slave - 1; master = master - 1; /* SSI0 mastered by port 5 */ ptcr = MXC_AUDMUX_V2_PTCR_SYN | MXC_AUDMUX_V2_PTCR_TFSDIR | MXC_AUDMUX_V2_PTCR_TFSEL(master | 0x8) | MXC_AUDMUX_V2_PTCR_TCLKDIR | MXC_AUDMUX_V2_PTCR_RFSDIR | MXC_AUDMUX_V2_PTCR_RFSEL(master | 0x8) | MXC_AUDMUX_V2_PTCR_RCLKDIR | MXC_AUDMUX_V2_PTCR_RCSEL(master | 0x8) | MXC_AUDMUX_V2_PTCR_TCSEL(master | 0x8); pdcr = MXC_AUDMUX_V2_PDCR_RXDSEL(master); mxc_audmux_v2_configure_port(slave, ptcr, pdcr); ptcr = MXC_AUDMUX_V2_PTCR_SYN; pdcr = MXC_AUDMUX_V2_PDCR_RXDSEL(master); mxc_audmux_v2_configure_port(master, ptcr, pdcr); return 0; } static int __devinit imx_tc358743_probe(struct platform_device *pdev) { struct mxc_audio_platform_data *plat = pdev->dev.platform_data; int ret = 0; imx_audmux_config(plat->src_port, plat->ext_port); ret = -EINVAL; if (plat->init && plat->init()) return ret; printk("%s %d %s\n",__func__,__LINE__,pdev->name); return 0; } static int imx_tc358743_remove(struct platform_device *pdev) { struct mxc_audio_platform_data *plat = pdev->dev.platform_data; if (plat->finit) plat->finit(); return 0; } static struct platform_driver imx_tc358743_audio1_driver = { .probe = imx_tc358743_probe, .remove = imx_tc358743_remove, .driver = { .name = "imx-tc358743", }, }; /* Codec setup */ static int tc358743_codec_probe(struct snd_soc_codec *codec) { return 0; } static int tc358743_codec_remove(struct snd_soc_codec *codec) { return 0; } static int tc358743_codec_suspend(struct snd_soc_codec *codec, pm_message_t state) { // tc358743_set_bias_level(codec, SND_SOC_BIAS_OFF); return 0; } static int tc358743_codec_resume(struct snd_soc_codec *codec) { // tc358743_set_bias_level(codec, SND_SOC_BIAS_STANDBY); return 0; } static int tc358743_set_bias_level(struct snd_soc_codec *codec, enum snd_soc_bias_level level) { return 0; } static const u8 tc358743_reg[0] = { }; static struct snd_soc_codec_driver soc_codec_dev_tc358743 = { .set_bias_level = tc358743_set_bias_level, .reg_cache_size = ARRAY_SIZE(tc358743_reg), .reg_word_size = sizeof(u8), .reg_cache_default = tc358743_reg, .probe = tc358743_codec_probe, .remove = tc358743_codec_remove, .suspend = tc358743_codec_suspend, .resume = tc358743_codec_resume, }; #define AIC3X_RATES SNDRV_PCM_RATE_8000_96000 #define AIC3X_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \ SNDRV_PCM_FMTBIT_S24_LE) static int tc358743_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) { return 0; } static int tc358743_mute(struct snd_soc_dai *dai, int mute) { return 0; } static int tc358743_set_dai_sysclk(struct snd_soc_dai *codec_dai, int clk_id, unsigned int freq, int dir) { return 0; } static int tc358743_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) { return 0; } static struct snd_soc_dai_ops tc358743_dai_ops = { .hw_params = tc358743_hw_params, .digital_mute = tc358743_mute, .set_sysclk = tc358743_set_dai_sysclk, .set_fmt = tc358743_set_dai_fmt, }; static struct snd_soc_dai_driver tc358743_dai = { .name = "tc358743-hifi", .capture = { .stream_name = "Capture", .channels_min = 1, .channels_max = 2, .rates = AIC3X_RATES, .formats = AIC3X_FORMATS,}, .ops = &tc358743_dai_ops, .symmetric_rates = 1, }; #endif static char tc358743_mode_list[16][12] = { "None", "VGA", "240p/480i", "288p/576i", "W240p/480i", "W288p/576i", "480p", "576p", "W480p", "W576p", "WW480p", "WW576p", "720p", "1035i", "1080i", "1080p" }; static char tc358743_fps_list[tc358743_max_fps+1] = { [tc358743_60_fps] = 60, [tc358743_30_fps] = 30, [tc358743_max_fps] = 0 }; static int tc358743_audio_list[16] = { 44100, 0, 48000, 32000, 22050, 384000, 24000, 352800, 88200, 768000, 96000, 705600, 176400, 0, 192000, 0 }; static char str_on[80]; static void report_netlink(void) { char *envp[2]; envp[0] = &str_on[0]; envp[1] = NULL; sprintf(envp[0], "HDMI RX: %d (%s) %d %d", (unsigned char)hdmi_mode & 0xf, tc358743_mode_list[(unsigned char)hdmi_mode & 0xf], tc358743_fps_list[fps], tc358743_audio_list[audio]); kobject_uevent_env(&(tc358743_data.i2c_client->dev.kobj), KOBJ_CHANGE, envp); det_work_timeout = DET_WORK_TIMEOUT_DEFAULT; pr_debug("%s: HDMI RX (%d) mode: %s fps: %d (%d, %d) audio: %d\n", __func__, (unsigned char)hdmi_mode, tc358743_mode_list[(unsigned char)hdmi_mode & 0xf], fps, bounce, det_work_timeout, tc358743_audio_list[audio]); } static void det_worker(struct work_struct *work) { u32 u32val; u16 reg; int ret; mutex_lock(&access_lock); if (!det_work_disable) { reg = 0x8621; ret = tc358743_read_reg(reg, &u32val); if (ret > 0) { if (audio != (((unsigned char)u32val) & 0x0f)) { audio = ((unsigned char)u32val) & 0x0f; report_netlink(); } } reg = 0x852f; ret = tc358743_read_reg(reg, &u32val); if (ret > 0) { while (1) { if (u32val & TC3587430_HDMI_DETECT) { lock = u32val & TC3587430_HDMI_DETECT; reg = 0x8521; ret = tc358743_read_reg(reg, &u32val); if (ret < 0) { pr_err("%s: Error reading mode\n", __func__); } } else { if (lock) { // check if it is realy un-plug lock = 0; u32val = 0x0; hdmi_mode = 0xF0; // fake mode to detect un-plug if mode was not detected before. } } if ((unsigned char)hdmi_mode != (unsigned char)u32val) { if (u32val) det_work_timeout = DET_WORK_TIMEOUT_DEFERRED; else det_work_timeout = DET_WORK_TIMEOUT_DEFAULT; bounce = MAX_BOUNCE; pr_debug("%s: HDMI RX (%d != %d) mode: %s fps: %d (%d, %d)\n", __func__, (unsigned char)hdmi_mode, (unsigned char)u32val, tc358743_mode_list[(unsigned char)hdmi_mode & 0xf], fps, bounce, det_work_timeout); hdmi_mode = u32val; } else if (bounce) { bounce--; det_work_timeout = DET_WORK_TIMEOUT_DEFAULT; } if (1 == bounce) { if (hdmi_mode >= 0xe) { reg = 0x852f; ret = tc358743_read_reg(reg, &u32val); if (ret > 0) fps = ((((unsigned char)u32val) & 0x0f) > 0xa)? tc358743_60_fps: tc358743_30_fps; } reg = 0x8621; ret = tc358743_read_reg(reg, &u32val); if (ret > 0) { audio = ((unsigned char)u32val) & 0x0f; report_netlink(); } } break; } } else { pr_err("%s: Error reading lock\n", __func__); } } else { det_work_timeout = DET_WORK_TIMEOUT_DEFERRED; } mutex_unlock(&access_lock); schedule_delayed_work(&(det_work), msecs_to_jiffies(det_work_timeout)); } static irqreturn_t tc358743_detect_handler(int irq, void *data) { pr_debug("%s: IRQ %d\n", __func__, tc358743_data.i2c_client->irq); schedule_delayed_work(&(det_work), msecs_to_jiffies(det_work_timeout)); return IRQ_HANDLED; } /*! * tc358743 I2C probe function * * @param adapter struct i2c_adapter * * @return Error code indicating success or failure */ #define DUMP_LENGTH 256 static u16 regoffs = 0; static ssize_t tc358743_show_regdump(struct device *dev, struct device_attribute *attr, char *buf) { int i, len = 0; int retval; u32 u32val; mutex_lock(&access_lock); for (i=0; i<DUMP_LENGTH; ) { retval = tc358743_read_reg(regoffs+i, &u32val); if (retval < 0) { u32val =0xff; retval = 1; } while (retval-- > 0) { if (0 == (i & 0xf)) len += sprintf(buf+len, "\n%04X:", regoffs+i); len += sprintf(buf+len, " %02X", u32val&0xff); u32val >>= 8; i++; } } mutex_unlock(&access_lock); len += sprintf(buf+len, "\n"); return len; } static DEVICE_ATTR(regdump, S_IRUGO, tc358743_show_regdump, NULL); static ssize_t tc358743_store_regoffs(struct device *device, struct device_attribute *attr, const char *buf, size_t count) { u32 val; int retval; retval = sscanf(buf, "%x", &val); if (1 == retval) regoffs = (u16)val; return count; } static ssize_t tc358743_show_regoffs(struct device *dev, struct device_attribute *attr, char *buf) { int len = 0; len += sprintf(buf+len, "0x%04X\n", regoffs); return len; } static DEVICE_ATTR(regoffs, S_IRUGO|S_IWUSR, tc358743_show_regoffs, tc358743_store_regoffs); static ssize_t tc358743_store_hpd(struct device *device, struct device_attribute *attr, const char *buf, size_t count) { u32 val; int retval; retval = sscanf(buf, "%d", &val); if (1 == retval) hpd_active = (u16)val; return count; } static ssize_t tc358743_show_hpd(struct device *dev, struct device_attribute *attr, char *buf) { int len = 0; len += sprintf(buf+len, "%d\n", hpd_active); return len; } static DEVICE_ATTR(hpd, S_IRUGO|S_IWUSR, tc358743_show_hpd, tc358743_store_hpd); static ssize_t tc358743_show_hdmirx(struct device *dev, struct device_attribute *attr, char *buf) { int len = 0; len += sprintf(buf+len, "%d\n", hdmi_mode); return len; } static DEVICE_ATTR(hdmirx, S_IRUGO, tc358743_show_hdmirx, NULL); static ssize_t tc358743_show_fps(struct device *dev, struct device_attribute *attr, char *buf) { int len = 0; len += sprintf(buf+len, "%d\n", tc358743_fps_list[fps]); return len; } static DEVICE_ATTR(fps, S_IRUGO, tc358743_show_fps, NULL); #ifdef AUDIO_ENABLE static ssize_t tc358743_show_audio(struct device *dev, struct device_attribute *attr, char *buf) { int len = 0; len += sprintf(buf+len, "%d\n", tc358743_audio_list[audio]); return len; } static DEVICE_ATTR(audio, S_IRUGO, tc358743_show_audio, NULL); #endif static int tc358743_probe(struct i2c_client *client, const struct i2c_device_id *id) { struct pwm_device *pwm; struct device *dev = &client->dev; int retval; struct regmap *gpr; struct sensor_data *sensor = &tc358743_data; u32 u32val; /* request power down pin */ pwn_gpio = of_get_named_gpio(dev->of_node, "pwn-gpios", 0); if (!gpio_is_valid(pwn_gpio)) { dev_warn(dev, "no sensor pwdn pin available"); } else { retval = devm_gpio_request_one(dev, pwn_gpio, GPIOF_OUT_INIT_HIGH, "tc_mipi_pwdn"); if (retval < 0) { dev_warn(dev, "request of pwn_gpio failed"); return retval; } } /* request reset pin */ rst_gpio = of_get_named_gpio(dev->of_node, "rst-gpios", 0); if (!gpio_is_valid(rst_gpio)) { dev_warn(dev, "no sensor reset pin available"); return -EINVAL; } retval = devm_gpio_request_one(dev, rst_gpio, GPIOF_OUT_INIT_HIGH, "tc_mipi_reset"); if (retval < 0) { dev_warn(dev, "request of tc_mipi_reset failed"); return retval; } /* Set initial values for the sensor struct. */ memset(sensor, 0, sizeof(*sensor)); sensor->sensor_clk = devm_clk_get(dev, "csi_mclk"); if (IS_ERR(sensor->sensor_clk)) { /* assuming clock enabled by default */ sensor->sensor_clk = NULL; dev_err(dev, "clock-frequency missing or invalid\n"); return PTR_ERR(sensor->sensor_clk); } retval = of_property_read_u32(dev->of_node, "mclk", &(sensor->mclk)); if (retval) { dev_err(dev, "mclk missing or invalid\n"); return retval; } retval = of_property_read_u32(dev->of_node, "mclk_source", (u32 *) &(sensor->mclk_source)); if (retval) { dev_err(dev, "mclk_source missing or invalid\n"); return retval; } retval = of_property_read_u32(dev->of_node, "ipu_id", &sensor->ipu_id); if (retval) { dev_err(dev, "ipu_id missing or invalid\n"); return retval; } retval = of_property_read_u32(dev->of_node, "csi_id", &(sensor->csi)); if (retval) { dev_err(dev, "csi id missing or invalid\n"); return retval; } if (((unsigned)sensor->ipu_id > 1) || ((unsigned)sensor->csi > 1)) { dev_err(dev, "invalid ipu/csi\n"); return -EINVAL; } clk_prepare_enable(sensor->sensor_clk); sensor->io_init = tc_reset; sensor->i2c_client = client; sensor->pix.pixelformat = tc358743_formats[0].pixelformat; sensor->streamcap.capability = V4L2_MODE_HIGHQUALITY | V4L2_CAP_TIMEPERFRAME; sensor->streamcap.capturemode = 0; sensor->streamcap.extendedmode = tc358743_mode_1080P_1920_1080; sensor->streamcap.timeperframe.denominator = DEFAULT_FPS; sensor->streamcap.timeperframe.numerator = 1; sensor->pix.width = tc358743_mode_info_data[0][sensor->streamcap.capturemode].width; sensor->pix.height = tc358743_mode_info_data[0][sensor->streamcap.capturemode].height; pr_debug("%s: format: %x, capture mode: %d extended mode: %d fps: %d width: %d height: %d\n",__func__, sensor->pix.pixelformat, sensor->streamcap.capturemode, sensor->streamcap.extendedmode, sensor->streamcap.timeperframe.denominator * sensor->streamcap.timeperframe.numerator, sensor->pix.width, sensor->pix.height); pwm = pwm_get(dev, NULL); if (!IS_ERR(pwm)) { dev_info(dev, "found pwm%d, period=%d\n", pwm->pwm, pwm->period); pwm_config(pwm, pwm->period >> 1, pwm->period); pwm_enable(pwm); } tc_power_on(dev); tc_reset(); tc_standby(0); retval = tc358743_read_reg(TC358743_CHIP_ID_HIGH_BYTE, &u32val); if (retval < 0) { pr_err("%s:cannot find camera\n", __func__); retval = -ENODEV; goto err4; } gpr = syscon_regmap_lookup_by_compatible("fsl,imx6q-iomuxc-gpr"); if (!IS_ERR(gpr)) { if (of_machine_is_compatible("fsl,imx6q")) { if (sensor->csi == sensor->ipu_id) { int mask = sensor->csi ? (1 << 20) : (1 << 19); regmap_update_bits(gpr, IOMUXC_GPR1, mask, 0); } } else if (of_machine_is_compatible("fsl,imx6dl")) { int mask = sensor->csi ? (7 << 3) : (7 << 0); int val = sensor->csi ? (3 << 3) : (0 << 0); if (sensor->ipu_id) { dev_err(dev, "invalid ipu\n"); return -EINVAL; } regmap_update_bits(gpr, IOMUXC_GPR13, mask, val); } } else { pr_err("%s: failed to find fsl,imx6q-iomux-gpr regmap\n", __func__); } tc358743_int_device.priv = sensor; //retval = device_create_file(&client->dev, &dev_attr_audio); retval = device_create_file(&client->dev, &dev_attr_fps); retval = device_create_file(&client->dev, &dev_attr_hdmirx); retval = device_create_file(&client->dev, &dev_attr_hpd); retval = device_create_file(&client->dev, &dev_attr_regoffs); retval = device_create_file(&client->dev, &dev_attr_regdump); if (retval) { pr_err("%s: create bin file failed, error=%d\n", __func__, retval); goto err4; } #ifdef AUDIO_ENABLE /* Audio setup */ retval = snd_soc_register_codec(&client->dev, &soc_codec_dev_tc358743, &tc358743_dai, 1); if (retval) { pr_err("%s: register failed, error=%d\n", __func__, retval); goto err4; } retval = platform_driver_register(&imx_tc358743_audio1_driver); if (retval) { pr_err("%s: Platform driver register failed, error=%d\n", __func__, retval); goto err4; } imxpac_tc358743_snd_device = platform_device_alloc("soc-audio", 5); if (!imxpac_tc358743_snd_device) { pr_err("%s: Platform device allocation failed, error=%d\n", __func__, retval); goto err4; } platform_set_drvdata(imxpac_tc358743_snd_device, &imxpac_tc358743); retval = platform_device_add(imxpac_tc358743_snd_device); if (retval) { pr_err("%s: Platform device add failed, error=%d\n", __func__, retval); platform_device_put(imxpac_tc358743_snd_device); goto err4; } #endif #if 1 INIT_DELAYED_WORK(&(det_work), det_worker); if (sensor->i2c_client->irq) { retval = request_irq(sensor->i2c_client->irq, tc358743_detect_handler, IRQF_SHARED | IRQF_TRIGGER_FALLING, "tc358743_det", sensor); if (retval < 0) dev_warn(&sensor->i2c_client->dev, "cound not request det irq %d\n", sensor->i2c_client->irq); } schedule_delayed_work(&(det_work), msecs_to_jiffies(det_work_timeout)); #endif retval = tc358743_reset(sensor); tc_standby(1); retval = v4l2_int_device_register(&tc358743_int_device); if (retval) { pr_err("%s: v4l2_int_device_register failed, error=%d\n", __func__, retval); goto err4; } pr_debug("%s: finished, error=%d\n", __func__, retval); return retval; err4: pr_err("%s: failed, error=%d\n", __func__, retval); return retval; } /*! * tc358743 I2C detach function * * @param client struct i2c_client * * @return Error code indicating success or failure */ static int tc358743_remove(struct i2c_client *client) { // Stop delayed work cancel_delayed_work_sync(&(det_work)); // Remove IRQ if (tc358743_data.i2c_client->irq) { free_irq(tc358743_data.i2c_client->irq, &tc358743_data); } /*Remove sysfs entries*/ device_remove_file(&client->dev, &dev_attr_fps); device_remove_file(&client->dev, &dev_attr_hdmirx); device_remove_file(&client->dev, &dev_attr_hpd); device_remove_file(&client->dev, &dev_attr_regoffs); device_remove_file(&client->dev, &dev_attr_regdump); v4l2_int_device_unregister(&tc358743_int_device); if (gpo_regulator) { regulator_disable(gpo_regulator); regulator_put(gpo_regulator); } if (analog_regulator) { regulator_disable(analog_regulator); regulator_put(analog_regulator); } if (core_regulator) { regulator_disable(core_regulator); regulator_put(core_regulator); } if (io_regulator) { regulator_disable(io_regulator); regulator_put(io_regulator); } return 0; } /*! * tc358743 init function * Called by insmod tc358743_camera.ko. * * @return Error code indicating success or failure */ static __init int tc358743_init(void) { int err; err = i2c_add_driver(&tc358743_i2c_driver); if (err != 0) pr_err("%s:driver registration failed, error=%d\n", __func__, err); return err; } /*! * tc358743 cleanup function * Called on rmmod tc358743_camera.ko * * @return Error code indicating success or failure */ static void __exit tc358743_clean(void) { i2c_del_driver(&tc358743_i2c_driver); } module_init(tc358743_init); module_exit(tc358743_clean); MODULE_AUTHOR("Panasonic Avionics Corp."); MODULE_DESCRIPTION("Toshiba TC358743 HDMI-to-CSI2 Bridge MIPI Input Driver"); MODULE_LICENSE("GPL"); MODULE_VERSION("1.0"); MODULE_ALIAS("CSI");
captivo/linux-captivo
drivers/media/platform/mxc/capture/tc358743_h2c.c
C
gpl-2.0
111,500
[ 30522, 1013, 1008, 1008, 9385, 1006, 1039, 1007, 2249, 1011, 2262, 2489, 15782, 2571, 20681, 1010, 4297, 1012, 2035, 2916, 9235, 1012, 1008, 1013, 1013, 1008, 1008, 19933, 2098, 2011, 1024, 17046, 12023, 1026, 17046, 1012, 12023, 1030, 5526...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
$DBversion = 'XXX'; # will be replaced by the RM if( CheckVersion( $DBversion ) ) { $dbh->do(" CREATE TABLE action_logs_cache ( action_id int(11) NOT NULL auto_increment, timestamp timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, user int(11) NOT NULL default 0, module text, action text, object int(11) default NULL, info text, interface VARCHAR(30) DEFAULT NULL, PRIMARY KEY (action_id), KEY timestamp_idx (timestamp), KEY user_idx (user), KEY module_idx (module(255)), KEY action_idx (action(255)), KEY object_idx (object), KEY info_idx (info(255)), KEY interface (interface) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; "); # Always end with this (adjust the bug info) SetVersion( $DBversion ); print "Upgrade to $DBversion done (KD 2990 - MongoDB datawarehouse for storing the logging data.)\n"; }
KohaSuomi/Koha
installer/data/mysql/atomicupdate/KD-2990-mongodb-datawarehouse-for-logging.perl
Perl
gpl-3.0
914
[ 30522, 1002, 16962, 27774, 1027, 1005, 22038, 2595, 1005, 1025, 1001, 2097, 2022, 2999, 2011, 1996, 28549, 2065, 1006, 4638, 27774, 1006, 1002, 16962, 27774, 1007, 1007, 1063, 1002, 16962, 2232, 1011, 1028, 2079, 1006, 1000, 3443, 2795, 289...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# -*- coding:utf-8 -*- from re import sub from itertools import islice ''' 如何调整字符串的文本格式 ''' # 将日志文件中的日期格式转变为美国日期格式mm/dd/yyyy # 使用正则表达式模块中的sub函数进行替换字符串 with open("./log.log","r") as f: for line in islice(f,0,None): #print sub("(\d{4})-(\d{2})-(\d{2})",r"\2/\3/\1",line) # 可以为每个匹配组起一个别名 print sub("(?P<year>\d{4})-(?P<month>\d{2})-(?P<day>\d{2})",r"\g<month>/\g<day>/\g<>",line)
liuhll/BlogAndArticle
Notes/Python/src/exercise/string_repalce_by_resub.py
Python
mit
537
[ 30522, 1001, 1011, 1008, 1011, 16861, 1024, 21183, 2546, 1011, 1022, 1011, 1008, 1011, 2013, 2128, 12324, 4942, 2013, 2009, 8743, 13669, 2015, 12324, 2003, 13231, 1005, 1005, 1005, 100, 100, 100, 100, 100, 100, 100, 1916, 1861, 1876, 100,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
suite('a11y', function() { test('dialog has role="dialog"', function() { var dialog = fixture('basic'); assert.equal(dialog.getAttribute('role'), 'dialog', 'has role="dialog"'); }); });
fuzzdota/chromeapp-native-messaging-sample
app/bower_components/paper-dialog/test/paper-dialog.html.0.js
JavaScript
bsd-3-clause
243
[ 30522, 7621, 1006, 1005, 17350, 2487, 2100, 1005, 1010, 3853, 1006, 1007, 1063, 3231, 1006, 1005, 13764, 8649, 2038, 2535, 1027, 1000, 13764, 8649, 1000, 1005, 1010, 3853, 1006, 1007, 1063, 13075, 13764, 8649, 1027, 15083, 1006, 1005, 3937,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package com.plutomc.power.common.blocks; import com.plutomc.core.common.blocks.BlockMetal; import com.plutomc.power.Power; import com.plutomc.power.common.tileentities.TileEntityCombustionEngine; import com.plutomc.power.init.BlockRegistry; import com.plutomc.power.init.GuiHandler; import net.minecraft.block.ITileEntityProvider; import net.minecraft.block.properties.PropertyDirection; import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.InventoryHelper; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumHand; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import javax.annotation.Nonnull; import javax.annotation.Nullable; /** * plutomc_power * Copyright (C) 2016 Kevin Boxhoorn * * plutomc_power is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * plutomc_power is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with plutomc_power. If not, see <http://www.gnu.org/licenses/>. */ public class BlockCombustionEngine extends BlockMetal implements ITileEntityProvider { public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); public BlockCombustionEngine() { super(BlockRegistry.Data.COMBUSTION_ENGINE); setDefaultState(blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH)); } @Nonnull @Override protected BlockStateContainer createBlockState() { return new BlockStateContainer(this, FACING); } @Nonnull @Override public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer, EnumHand hand) { return getDefaultState().withProperty(FACING, placer.getHorizontalFacing().getOpposite()); } @Nonnull @Override public IBlockState getStateFromMeta(int meta) { return getDefaultState().withProperty(FACING, EnumFacing.getFront(meta)); } @Override public int getMetaFromState(IBlockState state) { return state.getValue(FACING).getIndex(); } @Nullable @Override public TileEntity createNewTileEntity(World worldIn, int meta) { return new TileEntityCombustionEngine(); } @Override public void breakBlock(World worldIn, BlockPos pos, IBlockState state) { TileEntity tileEntity = worldIn.getTileEntity(pos); if (tileEntity instanceof TileEntityCombustionEngine) { InventoryHelper.dropInventoryItems(worldIn, pos, (TileEntityCombustionEngine) tileEntity); worldIn.updateComparatorOutputLevel(pos, this); } super.breakBlock(worldIn, pos, state); } @Override public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { if (!worldIn.isRemote) { playerIn.openGui(Power.instance(), GuiHandler.ENGINE_COMBUSTION, worldIn, pos.getX(), pos.getY(), pos.getZ()); } return true; } @Override public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) { TileEntity tileEntity = worldIn.getTileEntity(pos); if (tileEntity instanceof TileEntityCombustionEngine) { ((TileEntityCombustionEngine) tileEntity).setCustomName(stack.getDisplayName()); } } }
plutomc/power
src/main/java/com/plutomc/power/common/blocks/BlockCombustionEngine.java
Java
gpl-3.0
3,925
[ 30522, 7427, 4012, 1012, 26930, 12458, 1012, 2373, 1012, 2691, 1012, 5991, 1025, 12324, 4012, 1012, 26930, 12458, 1012, 30524, 1025, 12324, 4012, 1012, 26930, 12458, 1012, 2373, 1012, 1999, 4183, 1012, 3796, 2890, 24063, 2854, 1025, 12324, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Properties { $x = 1 $y = 2 } FormatTaskName "[{0}]" Task default -Depends Verify Task Verify -Description "This task verifies psake's variables" { Assert (Test-Path 'variable:\psake') "psake variable was not exported from module" Assert ($psake.ContainsKey("version")) "psake variable does not contain 'version'" Assert ($psake.ContainsKey("context")) "psake variable does not contain 'context'" Assert ($psake.ContainsKey("build_success")) "psake variable does not contain 'build_success'" Assert ($psake.ContainsKey("build_script_file")) "psake variable does not contain 'build_script_file'" Assert ($psake.ContainsKey("build_script_dir")) "psake variable does not contain 'build_script_dir'" Assert (![string]::IsNullOrEmpty($psake.version)) '$psake.version was null or empty' Assert ($psake.context -ne $null) '$psake.context was null' Assert (!$psake.build_success) '$psake.build_success should be $false' Assert ($psake.build_script_file -ne $null) '$psake.build_script_file was null' Assert ($psake.build_script_file.Name -eq "checkvariables.ps1") ("psake variable: {0} was not equal to 'checkvariables.ps1'" -f $psake.build_script_file.Name) Assert (![string]::IsNullOrEmpty($psake.build_script_dir)) '$psake.build_script_dir was null or empty' Assert ($psake.context.Peek().tasks.Count -ne 0) "psake context variable 'tasks' had length zero" Assert ($psake.context.Peek().properties.Count -ne 0) "psake context variable 'properties' had length zero" Assert ($psake.context.Peek().includes.Count -eq 0) "psake context variable 'includes' should have had length zero" Assert ($psake.context.Peek().config -ne $null) "psake context variable 'config' was null" Assert ($psake.context.Peek().currentTaskName -eq "Verify") 'psake variable: $currentTaskName was not set correctly' }
AMCN41R/Harness
tools/build_tools/pSake/examples/checkvariables.ps1
PowerShell
mit
1,868
[ 30522, 5144, 1063, 1002, 1060, 1027, 1015, 1002, 1061, 1027, 1016, 1065, 4289, 10230, 2243, 18442, 1000, 1031, 1063, 1014, 1065, 1033, 1000, 4708, 12398, 1011, 9041, 20410, 4708, 20410, 1011, 6412, 1000, 2023, 4708, 2310, 3089, 14213, 8827,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// Copyright 2015 Sergii Bogomolov. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. // Package dbhelper helps to interact with sql.DB by generating, preparing and // executing queries. It marshals Go structs to and from databases and uses // database/sql. // // Source code and project home: // https://github.com/bogomolovs/dbhelper // package dbhelper import ( "database/sql" "errors" "fmt" "reflect" ) // Contains prepared statement ready for execution. type Pstmt struct { dbHelper *DbHelper params []string stmt *sql.Stmt } // Returns a list of values for query parameters func (pstmt *Pstmt) getValues(params interface{}) ([]interface{}, error) { // number of parameters num := len(pstmt.params) // there are no parameters if params == nil { // if params = nil if num == 0 { // OK if query has no parameters return nil, nil } else { // error if query has parameters return nil, errors.New("dbhelper: values for all parameters are missing") } } // slice containing values values := make([]interface{}, num, num) // get value of params paramsValue := reflect.ValueOf(params) // get type of params paramsType := paramsValue.Type() if paramsType.Kind() == reflect.Map { // fill values in correct order for i, p := range pstmt.params { // value v := paramsValue.MapIndex(reflect.ValueOf(p)) if !v.IsValid() { return nil, errors.New(fmt.Sprintf("dbhelper: value for parameter '%s' is missing", p)) } values[i] = v.Interface() } } else { if num > 1 { return nil, errors.New("dbhelper: query has more than one parameter, params must be a map[string]interface{}") } if !checkFieldType(paramsType) { return nil, errors.New(fmt.Sprintf("dbhelper: wrong parameter type '%v'", paramsType)) } values[0] = paramsValue.Interface() } return values, nil } func (pstmt *Pstmt) exec(params interface{}) (sql.Result, error) { // get parameter values for query values, err := pstmt.getValues(params) if err != nil { return nil, err } // execute query var res sql.Result if values != nil { res, err = pstmt.stmt.Exec(values...) } else { res, err = pstmt.stmt.Exec() } if err != nil { return nil, wrapError(err) } return res, nil } // Executes prepared statement with provided parameter values. // If query has only one parameter, params can be the value of that parameter. // If query has more than one parameter, params must be a map[string]interface{}. // Returns number of affected rows or -1 if this number cannot be obtained. func (pstmt *Pstmt) Exec(params interface{}) (int64, error) { // execute query res, err := pstmt.exec(params) if err != nil { return 0, err } // get number of affected rows num, err := res.RowsAffected() if err != nil { return -1, nil } return num, nil } // Executes prepared query with provided parameter values. Returns number of processed rows. // If i is a pointer to slice of pointers - all rows are mapped. // If i is a pointer to structure - only the first matched row is mapped. // If i is a pointer to another supported data type - corresponding column value // of the first matched row is mapped. // If query has only one parameter, params can be the value of that parameter. // If query has more than one parameter, params must be a map[string]interface{}. func (pstmt *Pstmt) Query(i interface{}, params interface{}) (int64, error) { if i == nil { return 0, errorNil } var err error returnSlice := false returnStruct := false // get pointer to slice value slicePtrValue := reflect.ValueOf(i) slicePtrType := slicePtrValue.Type() if slicePtrType.Kind() != reflect.Ptr { return 0, errors.New("dbhelper: pointer expected") } // get slice value sliceValue := slicePtrValue.Elem() if !sliceValue.IsValid() { return 0, errors.New("dbhelper: cannot use pointer to nil") } // get slice type sliceType := sliceValue.Type() if sliceType.Kind() == reflect.Ptr { return 0, errors.New("dbhelper: cannot use pointer to pointer") } if sliceType.Kind() == reflect.Interface { return 0, errors.New("dbhelper: wrong type of i") } // get return pointer type var returnPtrType reflect.Type if sliceType.Kind() == reflect.Slice { // return slice of pointers to structs returnSlice = true returnPtrType = sliceType.Elem() if returnPtrType.Kind() != reflect.Ptr { return 0, errors.New("dbhelper: pointer to a slice of pointers expected") } } else { // return pointer returnPtrType = slicePtrType } // get return type returnType := returnPtrType.Elem() if returnType.Kind() == reflect.Struct { returnStruct = true } // get table var tbl *dbTable if returnStruct { tbl, err = pstmt.dbHelper.getTable(returnType) if err != nil { return 0, err } } // get parameter values for query values, err := pstmt.getValues(params) if err != nil { return 0, err } // perform query var rows *sql.Rows if values != nil { rows, err = pstmt.stmt.Query(values...) } else { rows, err = pstmt.stmt.Query() } if err != nil { return 0, wrapError(err) } // close rows on exit defer rows.Close() // create slice if returnSlice { sliceValue.Set(reflect.MakeSlice(sliceType, 0, 10)) } // get column names columns, err := rows.Columns() if err != nil { return 0, wrapError(err) } // read rows data to structures num := int64(0) for rows.Next() { // create new structure and get a pointer to it var returnPtrValue reflect.Value if returnSlice { returnPtrValue = reflect.New(returnType) } else { returnPtrValue = slicePtrValue } // get new structure value returnValue := returnPtrValue.Elem() if returnStruct { // slice containing pointers to corresponding fields of the structure fields := make([]interface{}, tbl.numField, tbl.numField) // fill slice with pointers for i, col := range columns { // get field in new structure v := returnValue.FieldByIndex(tbl.fields[col].index) // append pointer to field to slice fields[i] = v.Addr().Interface() } // scan row and assign values to struct fields err = rows.Scan(fields...) } else { // scan row and assign return value err = rows.Scan(returnValue.Addr().Interface()) } // check scan error if err != nil { return 0, wrapError(err) } num++ if returnSlice { // append pointer to slice sliceValue.Set(reflect.Append(sliceValue, returnPtrValue)) } else { break } } return num, nil }
bogoms/dbhelper
pstmt.go
GO
mit
6,550
[ 30522, 1013, 1013, 9385, 2325, 14262, 5856, 2072, 22132, 19506, 14301, 1012, 2035, 2916, 9235, 1012, 1013, 1013, 2224, 1997, 2023, 3120, 3642, 2003, 9950, 2011, 1037, 10210, 1011, 2806, 1013, 1013, 6105, 2008, 2064, 2022, 2179, 1999, 1996, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
=head1 NAME apt-cudf.conf - Configuration file for apt-cudf =head1 DESCRIPTION The configuration file allows one to define default optimization criterias for all solvers known by apt-cudf =head1 SYNTAX solver: <solver list> | '*' A comma-separated list of solvers. The character will make the optimization criteria as default for all solvers without a more specific definition. upgrade: <optimization criteria> dist-upgrade: <optimization criteria> install: <optimization criteria> remove: <optimization criteria> Default optimization criteria associated to apt-get actions. The optimization criteria is solver specific. Specifying a incorrect criteria will result in an error from the underlying cudf solver. Please refere to the solver man page for the correct syntax trendy: <optimization criteria> paranoid: <optimization criteria> <keyword>: <optimization criteria> Define a shortcut for an optimization criteria. The shortcut can then be used by apt-get to pass a specific optimization criteria for a cudf solver apt-get install gnome --solver aspcud -o "APT::Solver::aspcud::Preferences=trendy" =head1 EXAMPLE solver: mccs-cbc , mccs-lpsolve upgrade: -lex[-new,-removed,-notuptodate] dist-upgrade: -lex[-notuptodate,-new] install: -lex[-removed,-changed] remove: -lex[-removed,-changed] trendy: -lex[-removed,-notuptodate,-unsat_recommends,-new] paranoid: -lex[-removed,-changed] solver: * upgrade: -new,-removed,-notuptodate dist-upgrade: -notuptodate,-new install: -removed,-changed remove: -removed,-changed trendy: -removed,-notuptodate,-unsat_recommends,-new paranoid: -removed,-changed =head1 SEE ALSO apt-cudf(8), apt-get(8), update-cudf-solvers(8), L<README.cudf-solvers|file:///usr/share/doc/apt-cudf/README.cudf-solvers>, L<README.Debian|file:///usr/share/doc/apt-cudf/README.Debian> =head1 AUTHOR Copyright: (C) 2011 Pietro Abate <pietro.abate@pps.jussieu.fr> Copyright: (C) 2011 Stefano Zacchiroli <zack@debian.org> License: GNU Lesser General Public License (GPL), version 3 or above =cut
avsm/opam-ppa
src_ext/dose/doc/manpages/apt-cudf.conf.pod
Perl
gpl-3.0
2,077
[ 30522, 1027, 2132, 2487, 2171, 26794, 1011, 12731, 20952, 1012, 9530, 2546, 1011, 9563, 5371, 2005, 26794, 1011, 12731, 20952, 1027, 2132, 2487, 6412, 1996, 9563, 5371, 4473, 2028, 2000, 9375, 12398, 20600, 9181, 2015, 2005, 2035, 9611, 286...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
'use strict'; /* istanbul ignore next */ /* eslint-disable no-console */ /** * Handle failures in the application by terminating. * @param {Exception} err - Exception to handle. */ module.exports = (err) => { console.log(err); console.log(err.stack); process.exit(-1); };
steve-gray/swagger-codegen
src/failure-handler.js
JavaScript
mit
290
[ 30522, 1005, 2224, 9384, 1005, 1025, 1013, 1008, 9960, 8568, 2279, 1008, 1013, 1013, 1008, 9686, 4115, 2102, 1011, 4487, 19150, 2053, 1011, 10122, 1008, 1013, 1013, 1008, 1008, 1008, 5047, 15428, 1999, 1996, 4646, 2011, 23552, 1012, 1008, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>18 --> 19</title> <link href="./../../assets/style.css" rel="stylesheet"> </head> <body> <h2>You have to be fast</h2> <a href="./da6905b94eb6e0a60a6a43d6cea4ff3c89819676bcf9c4fdd9959a44264bcb78.html">Teleport</a> <hr> <a href="./../../about.md">About</a> (Spoilers! ) <script src="./../../assets/md5.js"></script> <script> window.currentLevel = 7; </script> <script src="./../../assets/script.js"></script> </body> </html>
simonmysun/praxis
TAIHAO2019/pub/SmallGame/AsFastAsYouCan2/55748a4544d92af5ad50707d01f0fe310b6fd400a42f3604499cfd26bcd9920f.html
HTML
mit
550
[ 30522, 1026, 999, 9986, 13874, 30524, 1000, 1028, 1026, 2132, 1028, 1026, 18804, 25869, 13462, 1027, 1000, 21183, 2546, 1011, 1022, 1000, 1028, 1026, 2516, 1028, 2324, 1011, 1011, 1028, 2539, 1026, 1013, 2516, 1028, 1026, 4957, 17850, 12879...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
var detector = (function () { function foodCollision(snake, food, ui) { var snakeHeadX = snake.parts[0].getPosition().x; var snakeHeadY = snake.parts[0].getPosition().y; var foodX = food.getPosition().x; var foodY = food.getPosition().y; if(snakeHeadX === foodX && snakeHeadY === foodY){ return true; } } function playFieldCollision(selector, snake, ui) { if(selector instanceof HTMLCanvasElement){ this.canvas = selector; } else if(typeof selector === 'String' || typeof selector === 'string'){ this.canvas = document.querySelector(selector); } var w = this.canvas.width; var h = this.canvas.height; if(snake.parts[0].x >= w){ snake.parts[0].x = 0; ui.updateCollision('Playfield'); ; } if(snake.parts[0].y >= h){ snake.parts[0].y = 0; ui.updateCollision('Playfield'); } if(snake.parts[0].x < 0){ snake.parts[0].x = w - 20; ui.updateCollision('Playfield'); } if(snake.parts[0].y < 0){ snake.parts[0].y = h - 20; ui.updateCollision('Playfield'); } } function tailCollision (snake, ui) { for (var i = 1; i < snake.parts.length; i++) { if(snake.parts[0].x === snake.parts[i].x && snake.parts[0].y === snake.parts[i].y){ snake.parts = snake.parts.slice(0,2); snake.parts[0].x = 0; snake.parts[0].y = 0; snake.direction = 1; ui.scoreValue = 0; ui.updateScore(0); ui.updateCollision('Tail'); console.log('Self Tail Collision') } } } function wallCollision(wallArray, snake, ui) { for (var i = 1; i < wallArray.length; i++) { if(snake.parts[0].x === wallArray[i].x && snake.parts[0].y === wallArray[i].y){ snake.parts = snake.parts.slice(0,2); snake.parts[0].x = 0; snake.parts[0].y = 0; snake.direction = 1; ui.updateCollision('Wall'); ui.scoreValue = 0; ui.updateScore(0); console.log('Wall Collision') } } } return { isFoodCollision: foodCollision, playFieldCollision: playFieldCollision, tailCollision: tailCollision, wallCollision: wallCollision } }());
kaizer04/Telerik-Academy-2013-2014
JS OOP/JS-OOP-Modules-and-Patterns-Homework/01-Snake/scripts/detector.js
JavaScript
mit
2,580
[ 30522, 13075, 19034, 1027, 1006, 3853, 1006, 1007, 1063, 3853, 2833, 26895, 19969, 1006, 7488, 1010, 2833, 1010, 21318, 1007, 1063, 13075, 7488, 4974, 2595, 1027, 7488, 1012, 3033, 1031, 1014, 1033, 1012, 2131, 26994, 1006, 1007, 1012, 1060...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/** * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * Copyright (C) 2010, 2011, 2012, 2013 Pyravlos Team * * http://www.strabon.di.uoa.gr/ */ package org.openrdf.sail.postgis.evaluation; import java.sql.Types; import org.openrdf.sail.generaldb.evaluation.GeneralDBQueryBuilderFactory; import org.openrdf.sail.generaldb.evaluation.GeneralDBSqlCastBuilder; import org.openrdf.sail.generaldb.evaluation.GeneralDBSqlExprBuilder; public class PostGISSqlCastBuilder extends PostGISSqlExprBuilder implements GeneralDBSqlCastBuilder { protected GeneralDBSqlExprBuilder where; protected int jdbcType; public PostGISSqlCastBuilder(GeneralDBSqlExprBuilder where, GeneralDBQueryBuilderFactory factory, int jdbcType) { super(factory); this.where = where; this.jdbcType = jdbcType; append(" CAST("); } public GeneralDBSqlExprBuilder close() { append(" AS "); append(getSqlType(jdbcType)); append(")"); where.append(toSql()); where.addParameters(getParameters()); return where; } protected CharSequence getSqlType(int type) { switch (type) { case Types.VARCHAR: return "VARCHAR"; default: throw new AssertionError(type); } } }
wx1988/strabon
postgis/src/main/java/org/openrdf/sail/postgis/evaluation/PostGISSqlCastBuilder.java
Java
mpl-2.0
1,330
[ 30522, 1013, 1008, 1008, 1008, 2023, 3120, 3642, 2433, 2003, 3395, 2000, 1996, 3408, 1997, 1996, 9587, 5831, 4571, 2270, 1008, 6105, 1010, 1058, 1012, 1016, 1012, 1014, 1012, 2065, 1037, 6100, 1997, 1996, 6131, 2140, 2001, 2025, 5500, 200...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#define FUNC __ieee754_asin #include <e_acos.c>
nslu2/glibc
sysdeps/m68k/fpu/e_asin.c
C
gpl-2.0
48
[ 30522, 1001, 9375, 4569, 2278, 1035, 1035, 15368, 23352, 2549, 1035, 2004, 2378, 1001, 2421, 1026, 1041, 1035, 9353, 2891, 1012, 1039, 1028, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# Mustang Lite * **Theme URI:** http://www.webmandesign.eu/mustang-lite/ * **Author:** WebMan * **Author URI:** http://www.webmandesign.eu/ * **License:** GNU General Public License v3 * **License URI:** http://www.gnu.org/licenses/gpl-3.0.html ## Description Mustang Lite WordPress Theme lets you create beautiful, professional responsive and HiDPI (Retina) ready websites. With this theme you can create also a single one-page websites with ease! Mustang Lite is suitable for creative portfolio, business and corporate website projects, personal presentations and much more. You can set a custom design with background images and colors for every section of the theme. As the theme is translation ready and supports right-to-left languages as well, you can localize it for your multilingual website. By default you get the basic blog design which can be extended to full power of the theme with WebMan Amplifier plugin activation. This theme is a free, lite version of premium Mustang Multipurpose WordPress Theme by WebMan. The differences from paid version can be found at http://www.webmandesign.eu/mustan-lite/. Check out themes by WebMan at www.webmandesign.eu. Thank you for using one of WebMan's themes! Follow WebMan on Twitter [https://twitter.com/webmandesigneu] or become a fan on Facebook [https://www.facebook.com/webmandesigneu]. Full theme demo website at [http://themedemos.webmandesign.eu/mustang/]. Theme user manual with demo data at [http://www.webmandesign.eu/manual/mustang/]. ## Demo http://themedemos.webmandesign.eu/mustang/ ## Changelog *See the `changelog.md` file.* ## Documentation User manual available at http://www.webmandesign.eu/manual/mustang/ ## Copyright **Mustang Lite WordPress Theme** Copyright 2014 WebMan [http://www.webmandesign.eu/] Distributed under the terms of the GNU GPL **Animate.css** Copyright (c) 2014 Daniel Eden Licensed under the MIT license - http://opensource.org/licenses/MIT http://daneden.me/animate **Normalize.css** Copyright (c) Nicolas Gallagher and Jonathan Neal Licensed under the MIT license - http://opensource.org/licenses/MIT git.io/normalize **imagesLoaded** Copyright (c) 2014 Tomas Sardyha (@Darsain) and David DeSandro (@desandro) Licensed under the MIT license - http://opensource.org/licenses/MIT https://github.com/desandro/imagesloaded **jquery.appear.js** Copyright (c) 2012 Andrey Sidorov Licensed under MIT https://github.com/morr/jquery.appear/ **jquery.prettyPhoto.js** Copyright, Stephane Caron Licensed under Creative Commons 2.5 [http://creativecommons.org/licenses/by/2.5/] or GPLV2 license [http://www.gnu.org/licenses/gpl-2.0.html] Please see assets/js/prettyphoto/README file for more info. http://www.no-margin-for-errors.com **jquery.viewport.js** Copyright (c) 2008-2009 Mika Tuupola Licensed under the MIT license http://www.appelsiini.net/projects/viewport **Fontello font icons** Please see assets/font/basic-icons/LICENCE.txt file for more info.
KJaddoe/CSCMRA-Project
wp-content/themes/mustang-lite/readme.md
Markdown
gpl-2.0
2,966
[ 30522, 1001, 18851, 5507, 2063, 1008, 1008, 1008, 4323, 24471, 2072, 1024, 1008, 1008, 8299, 1024, 1013, 1013, 7479, 1012, 4773, 2386, 6155, 23773, 1012, 7327, 1013, 18851, 1011, 5507, 2063, 1013, 1008, 1008, 1008, 3166, 1024, 1008, 1008, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
hr{margin:20px auto;} .wrap{margin: 40px 0 0 60px;padding:30px;} .choice{padding:10px 0;overflow:hidden;} .choice .span1{float:left;} .choice .span2{float:left;margin-top:10px;} .choice input[type=text]{width:300px;margin-left:70px;padding:8px 4px;} .choice textarea{width: 320px;height: 35px;} .choice_radio{margin-left:150px;} .submit{margin-top:20px;margin-right:10px;padding:0;float:left;} .submit input,.submit input:hover,.submit input:active{padding:6px 10px;border:none;border-radius:0;background:#299982;color:#fff;text-shadow:none;}
lanruyi/blog.lanruyi.net
wp-content/themes/forget/admin/admin.css
CSS
gpl-2.0
553
[ 30522, 17850, 1063, 7785, 1024, 2322, 2361, 2595, 8285, 1025, 1065, 1012, 10236, 1063, 7785, 1024, 2871, 2361, 2595, 1014, 1014, 3438, 2361, 2595, 1025, 11687, 4667, 1024, 2382, 2361, 2595, 1025, 1065, 1012, 3601, 1063, 11687, 4667, 1024, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
.polygon { display: flex; justify-content: center; align-items: center; color: gray; font-size: .9rem; }
openforis/sepal
modules/gui/src/app/home/body/process/recipe/mosaic/panels/aoi/polygonSection.module.css
CSS
mit
125
[ 30522, 1012, 26572, 7446, 1063, 4653, 1024, 23951, 1025, 16114, 1011, 4180, 1024, 2415, 1025, 25705, 1011, 5167, 1024, 2415, 1025, 3609, 1024, 3897, 1025, 15489, 1011, 2946, 1024, 1012, 1023, 28578, 1025, 1065, 102, 0, 0, 0, 0, 0, 0, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
uint8_t USBPutChar(uint8_t c); // press() adds the specified key (printing, non-printing, or modifier) // to the persistent key report and sends the report. Because of the way // USB HID works, the host acts like the key remains pressed until we // call release(), releaseAll(), or otherwise clear the report and resend. size_t Keyboard_::press(uint8_t k) { uint8_t i; if (k >= 136) { // it's a non-printing key (not a modifier) k = k - 136; } else if (k >= 128) { // it's a modifier key _keyReport.modifiers |= (1<<(k-128)); k = 0; } else { // it's a printing key k = pgm_read_byte(_asciimap + k); if (!k) { setWriteError(); return 0; } if (k & 0x80) { // it's a capital letter or other character reached with shift _keyReport.modifiers |= 0x02; // the left shift modifier k &= 0x7F; } } // Add k to the key report only if it's not already present // and if there is an empty slot. if (_keyReport.keys[0] != k && _keyReport.keys[1] != k && _keyReport.keys[2] != k && _keyReport.keys[3] != k && _keyReport.keys[4] != k && _keyReport.keys[5] != k) { for (i=0; i<6; i++) { if (_keyReport.keys[i] == 0x00) { _keyReport.keys[i] = k; break; } } if (i == 6) { setWriteError(); return 0; } } sendReport(&_keyReport); return 1; } // release() takes the specified key out of the persistent key report and // sends the report. This tells the OS the key is no longer pressed and that // it shouldn't be repeated any more. size_t Keyboard_::release(uint8_t k) { uint8_t i; if (k >= 136) { // it's a non-printing key (not a modifier) k = k - 136; } else if (k >= 128) { // it's a modifier key _keyReport.modifiers &= ~(1<<(k-128)); k = 0; } else { // it's a printing key k = pgm_read_byte(_asciimap + k); if (!k) { return 0; } if (k & 0x80) { // it's a capital letter or other character reached with shift _keyReport.modifiers &= ~(0x02); // the left shift modifier k &= 0x7F; } } // Test the key report to see if k is present. Clear it if it exists. // Check all positions in case the key is present more than once (which it shouldn't be) for (i=0; i<6; i++) { if (0 != k && _keyReport.keys[i] == k) { _keyReport.keys[i] = 0x00; } } sendReport(&_keyReport); return 1; } void Keyboard_::releaseAll(void) { _keyReport.keys[0] = 0; _keyReport.keys[1] = 0; _keyReport.keys[2] = 0; _keyReport.keys[3] = 0; _keyReport.keys[4] = 0; _keyReport.keys[5] = 0; _keyReport.modifiers = 0; sendReport(&_keyReport); } size_t Keyboard_::write(uint8_t c) { uint8_t p = press(c); // Keydown release(c); // Keyup return p; // just return the result of press() since release() almost always returns 1 } Keyboard_ Keyboard; #endif
Random1984/malduino_scripts
converter/src/Keyboard_end.cpp
C++
gpl-3.0
2,796
[ 30522, 21318, 3372, 2620, 1035, 1056, 18833, 18780, 7507, 2099, 1006, 21318, 3372, 2620, 1035, 1056, 1039, 1007, 1025, 1013, 1013, 2811, 1006, 1007, 9909, 1996, 9675, 3145, 1006, 8021, 1010, 2512, 1011, 8021, 1010, 2030, 16913, 18095, 1007,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#include <unistd.h> #include <sys/reboot.h> #include <stdlib.h> #include "platform/platform.h" #define ABORTMSG "hard-reboot: Aborted.\n" #define USAGE "Say \"hard-reboot (RESTART|HALT|POWER_OFF)\" if you really mean it.\n" void usage(void) { write(2, ABORTMSG, str_len(ABORTMSG)); write(2, USAGE, str_len(USAGE)); exit(1); } int main(int argc, char *argv[]) { if (argc!=2) usage(); sync(); sync(); sync(); if (strcmp(argv[1], "RESTART")==0) { reboot(RB_AUTOBOOT); } else if (strcmp(argv[1], "HALT")==0) { reboot(RB_HALT_SYSTEM); } else if (strcmp(argv[1], "POWER_OFF")==0) { reboot(RB_POWER_OFF); } else { usage(); } while(1) sleep(10); }
fargies/minit
hard-reboot.c
C
gpl-2.0
696
[ 30522, 1001, 2421, 1026, 4895, 2923, 2094, 1012, 1044, 1028, 1001, 2421, 1026, 25353, 2015, 1013, 2128, 27927, 1012, 1044, 1028, 1001, 2421, 1026, 2358, 19422, 12322, 1012, 1044, 1028, 1001, 2421, 1000, 4132, 1013, 4132, 1012, 1044, 1000, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php /** * @package Joomla.UnitTest * @subpackage Twitter * * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ /** * Test class for JTwitterLists. * * @package Joomla.UnitTest * @subpackage Twitter * * @since 3.1.4 */ class JTwitterListsTest extends TestCase { /** * @var JRegistry Options for the Twitter object. * @since 3.1.4 */ protected $options; /** * @var JHttp Mock client object. * @since 3.1.4 */ protected $client; /** * @var JInput The input object to use in retrieving GET/POST data. * @since 3.1.4 */ protected $input; /** * @var JTwitterLists Object under test. * @since 3.1.4 */ protected $object; /** * @var JTwitterOauth Authentication object for the Twitter object. * @since 3.1.4 */ protected $oauth; /** * @var string Sample JSON string. * @since 3.1.4 */ protected $sampleString = '{"a":1,"b":2,"c":3,"d":4,"e":5}'; /** * @var string Sample JSON error message. * @since 3.1.4 */ protected $errorString = '{"error":"Generic error"}'; /** * @var string Sample JSON string. * @since 3.1.4 */ protected $rateLimit = '{"resources": {"lists": { "/lists/list": {"remaining":15, "reset":"Mon Jun 25 17:20:53 +0000 2012"}, "/lists/statuses": {"remaining":15, "reset":"Mon Jun 25 17:20:53 +0000 2012"}, "/lists/subscribers": {"remaining":15, "reset":"Mon Jun 25 17:20:53 +0000 2012"}, "/lists/subscribers/create": {"remaining":15, "reset":"Mon Jun 25 17:20:53 +0000 2012"}, "/lists/members/show": {"remaining":15, "reset":"Mon Jun 25 17:20:53 +0000 2012"}, "/lists/subscribers/show": {"remaining":15, "reset":"Mon Jun 25 17:20:53 +0000 2012"}, "/lists/subscribers/destroy": {"remaining":15, "reset":"Mon Jun 25 17:20:53 +0000 2012"}, "/lists/members/create_all": {"remaining":15, "reset":"Mon Jun 25 17:20:53 +0000 2012"}, "/lists/members": {"remaining":15, "reset":"Mon Jun 25 17:20:53 +0000 2012"}, "/lists/show": {"remaining":15, "reset":"Mon Jun 25 17:20:53 +0000 2012"}, "/lists/subscriptions": {"remaining":15, "reset":"Mon Jun 25 17:20:53 +0000 2012"}, "/lists/update": {"remaining":15, "reset":"Mon Jun 25 17:20:53 +0000 2012"}, "/lists/create": {"remaining":15, "reset":"Mon Jun 25 17:20:53 +0000 2012"}, "/lists/destroy": {"remaining":15, "reset":"Mon Jun 25 17:20:53 +0000 2012"} }}}'; /** * Backup of the SERVER superglobal * * @var array * @since 3.6 */ protected $backupServer; /** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. * * @access protected * * @return void */ protected function setUp() { $this->backupServer = $_SERVER; $_SERVER['HTTP_HOST'] = 'example.com'; $_SERVER['HTTP_USER_AGENT'] = 'Mozilla/5.0'; $_SERVER['REQUEST_URI'] = '/index.php'; $_SERVER['SCRIPT_NAME'] = '/index.php'; $key = "app_key"; $secret = "app_secret"; $my_url = "http://127.0.0.1/gsoc/joomla-platform/twitter_test.php"; $access_token = array('key' => 'token_key', 'secret' => 'token_secret'); $this->options = new JRegistry; $this->input = new JInput; $this->client = $this->getMockBuilder('JHttp')->setMethods(array('get', 'post', 'delete', 'put'))->getMock(); $this->oauth = new JTwitterOAuth($this->options, $this->client, $this->input); $this->oauth->setToken($access_token); $this->object = new JTwitterLists($this->options, $this->client, $this->oauth); $this->options->set('consumer_key', $key); $this->options->set('consumer_secret', $secret); $this->options->set('callback', $my_url); $this->options->set('sendheaders', true); } /** * Tears down the fixture, for example, closes a network connection. * This method is called after a test is executed. * * @return void * * @see \PHPUnit\Framework\TestCase::tearDown() * @since 3.6 */ protected function tearDown() { $_SERVER = $this->backupServer; unset($this->backupServer, $this->options, $this->input, $this->client, $this->oauth, $this->object); } /** * Provides test data for request format detection. * * @return array * * @since 3.1.4 */ public function seedUser() { // User ID or screen name return array( array(234654235457), array('testUser'), array(null) ); } /** * Tests the getAllLists method * * @param mixed $user Either an integer containing the user ID or a string containing the screen name. * * @return void * * @since 3.1.4 * @dataProvider seedUser */ public function testGetLists($user) { $reverse = true; $returnData = new stdClass; $returnData->code = 200; $returnData->body = $this->rateLimit; $path = $this->object->fetchUrl('/application/rate_limit_status.json', array("resources" => "lists")); $this->client->expects($this->at(0)) ->method('get') ->with($path) ->will($this->returnValue($returnData)); $returnData = new stdClass; $returnData->code = 200; $returnData->body = $this->sampleString; // Set request parameters. if (is_numeric($user)) { $data['user_id'] = $user; } elseif (is_string($user)) { $data['screen_name'] = $user; } else { $this->setExpectedException('RuntimeException'); $this->object->getLists($user); } $data['reverse'] = true; $path = $this->object->fetchUrl('/lists/list.json', $data); $this->client->expects($this->at(1)) ->method('get') ->with($path) ->will($this->returnValue($returnData)); $this->assertThat( $this->object->getLists($user, $reverse), $this->equalTo(json_decode($this->sampleString)) ); } /** * Tests the getAllLists method - failure * * @param mixed $user Either an integer containing the user ID or a string containing the screen name. * * @return void * * @since 3.1.4 * @dataProvider seedUser * @expectedException DomainException */ public function testGetListsFailure($user) { $returnData = new stdClass; $returnData->code = 200; $returnData->body = $this->rateLimit; $path = $this->object->fetchUrl('/application/rate_limit_status.json', array("resources" => "lists")); $this->client->expects($this->at(0)) ->method('get') ->with($path) ->will($this->returnValue($returnData)); $returnData = new stdClass; $returnData->code = 500; $returnData->body = $this->errorString; // Set request parameters. if (is_numeric($user)) { $data['user_id'] = $user; } elseif (is_string($user)) { $data['screen_name'] = $user; } else { $this->setExpectedException('RuntimeException'); $this->object->getLists($user); } $path = $this->object->fetchUrl('/lists/list.json', $data); $this->client->expects($this->at(1)) ->method('get') ->with($path) ->will($this->returnValue($returnData)); $this->object->getLists($user); } /** * Provides test data for request format detection. * * @return array * * @since 3.1.4 */ public function seedListStatuses() { // List ID or slug and owner return array( array(234654235457, null), array('test-list', 'testUser'), array('test-list', 12345), array('test-list', null), array(null, null) ); } /** * Tests the getListStatuses method * * @param mixed $list Either an integer containing the list ID or a string containing the list slug. * @param mixed $owner Either an integer containing the user ID or a string containing the screen name. * * @return void * * @since 3.1.4 * @dataProvider seedListStatuses */ public function testGetStatuses($list, $owner) { $since_id = 12345; $max_id = 54321; $count = 10; $entities = true; $include_rts = true; $returnData = new stdClass; $returnData->code = 200; $returnData->body = $this->rateLimit; $path = $this->object->fetchUrl('/application/rate_limit_status.json', array("resources" => "lists")); $this->client->expects($this->at(0)) ->method('get') ->with($path) ->will($this->returnValue($returnData)); $returnData = new stdClass; $returnData->code = 200; $returnData->body = $this->sampleString; // Set request parameters. if (is_numeric($list)) { $data['list_id'] = $list; } elseif (is_string($list)) { $data['slug'] = $list; if (is_numeric($owner)) { $data['owner_id'] = $owner; } elseif (is_string($owner)) { $data['owner_screen_name'] = $owner; } else { // We don't have a valid entry $this->setExpectedException('RuntimeException'); $this->object->getStatuses($list, $owner); } } else { $this->setExpectedException('RuntimeException'); $this->object->getStatuses($list, $owner); } $data['since_id'] = $since_id; $data['max_id'] = $max_id; $data['count'] = $count; $data['include_entities'] = $entities; $data['include_rts'] = $include_rts; $path = $this->object->fetchUrl('/lists/statuses.json', $data); $this->client->expects($this->at(1)) ->method('get') ->with($path) ->will($this->returnValue($returnData)); $this->assertThat( $this->object->getStatuses($list, $owner, $since_id, $max_id, $count, $entities, $include_rts), $this->equalTo(json_decode($this->sampleString)) ); } /** * Tests the getListStatuses method - failure * * @param mixed $list Either an integer containing the list ID or a string containing the list slug. * @param mixed $owner Either an integer containing the user ID or a string containing the screen name. * * @return void * * @since 3.1.4 * @dataProvider seedListStatuses * @expectedException DomainException */ public function testGetStatusesFailure($list, $owner) { $returnData = new stdClass; $returnData->code = 200; $returnData->body = $this->rateLimit; $path = $this->object->fetchUrl('/application/rate_limit_status.json', array("resources" => "lists")); $this->client->expects($this->at(0)) ->method('get') ->with($path) ->will($this->returnValue($returnData)); $returnData = new stdClass; $returnData->code = 500; $returnData->body = $this->errorString; // Set request parameters. if (is_numeric($list)) { $data['list_id'] = $list; } elseif (is_string($list)) { $data['slug'] = $list; if (is_numeric($owner)) { $data['owner_id'] = $owner; } elseif (is_string($owner)) { $data['owner_screen_name'] = $owner; } else { // We don't have a valid entry $this->setExpectedException('RuntimeException'); $this->object->getStatuses($list, $owner); } } else { $this->setExpectedException('RuntimeException'); $this->object->getStatuses($list, $owner); } $path = $this->object->fetchUrl('/lists/statuses.json', $data); $this->client->expects($this->at(1)) ->method('get') ->with($path) ->will($this->returnValue($returnData)); $this->object->getStatuses($list, $owner); } /** * Tests the getListSubscribers method * * @param mixed $list Either an integer containing the list ID or a string containing the list slug. * @param mixed $owner Either an integer containing the user ID or a string containing the screen name. * * @return void * * @since 3.1.4 * @dataProvider seedListStatuses */ public function testGetSubscribers($list, $owner) { $cursor = 1234; $entities = true; $skip_status = true; $returnData = new stdClass; $returnData->code = 200; $returnData->body = $this->rateLimit; $path = $this->object->fetchUrl('/application/rate_limit_status.json', array("resources" => "lists")); $this->client->expects($this->at(0)) ->method('get') ->with($path) ->will($this->returnValue($returnData)); $returnData = new stdClass; $returnData->code = 200; $returnData->body = $this->sampleString; // Set request parameters. if (is_numeric($list)) { $data['list_id'] = $list; } elseif (is_string($list)) { $data['slug'] = $list; if (is_numeric($owner)) { $data['owner_id'] = $owner; } elseif (is_string($owner)) { $data['owner_screen_name'] = $owner; } else { // We don't have a valid entry $this->setExpectedException('RuntimeException'); $this->object->getSubscribers($list, $owner); } } else { $this->setExpectedException('RuntimeException'); $this->object->getSubscribers($list, $owner); } $data['cursor'] = $cursor; $data['include_entities'] = $entities; $data['skip_status'] = $skip_status; $path = $this->object->fetchUrl('/lists/subscribers.json', $data); $this->client->expects($this->at(1)) ->method('get') ->with($path) ->will($this->returnValue($returnData)); $this->assertThat( $this->object->getSubscribers($list, $owner, $cursor, $entities, $skip_status), $this->equalTo(json_decode($this->sampleString)) ); } /** * Tests the getListSubscribers method - failure * * @param mixed $list Either an integer containing the list ID or a string containing the list slug. * @param mixed $owner Either an integer containing the user ID or a string containing the screen name. * * @return void * * @since 3.1.4 * @dataProvider seedListStatuses * @expectedException DomainException */ public function testGetSubscribersFailure($list, $owner) { $cursor = 1234; $entities = true; $skip_status = true; $returnData = new stdClass; $returnData->code = 200; $returnData->body = $this->rateLimit; $path = $this->object->fetchUrl('/application/rate_limit_status.json', array("resources" => "lists")); $this->client->expects($this->at(0)) ->method('get') ->with($path) ->will($this->returnValue($returnData)); $returnData = new stdClass; $returnData->code = 500; $returnData->body = $this->errorString; // Set request parameters. if (is_numeric($list)) { $data['list_id'] = $list; } elseif (is_string($list)) { $data['slug'] = $list; if (is_numeric($owner)) { $data['owner_id'] = $owner; } elseif (is_string($owner)) { $data['owner_screen_name'] = $owner; } else { // We don't have a valid entry $this->setExpectedException('RuntimeException'); $this->object->getSubscribers($list, $owner); } } else { $this->setExpectedException('RuntimeException'); $this->object->getSubscribers($list, $owner); } $data['cursor'] = $cursor; $data['include_entities'] = $entities; $data['skip_status'] = $skip_status; $path = $this->object->fetchUrl('/lists/subscribers.json', $data); $this->client->expects($this->at(1)) ->method('get') ->with($path) ->will($this->returnValue($returnData)); $this->object->getSubscribers($list, $owner, $cursor, $entities, $skip_status); } /** * Provides test data for request format detection. * * @return array * * @since 3.1.4 */ public function seedMembers() { // List, User ID, screen name and owner. return array( array(234654235457, null, '234654235457', null), array('test-list', null, 'userTest', 'testUser'), array('test-list', '234654235457', null, '56165105642'), array('test-list', 'testUser', null, null), array('test-list', null, null, 'testUser'), array('test-list', 'testUser', '234654235457', 'userTest'), array(null, null, null, null) ); } /** * Tests the deleteListMembers method * * @param mixed $list Either an integer containing the list ID or a string containing the list slug. * @param string $user_id A comma separated list of user IDs, up to 100 are allowed in a single request. * @param string $screen_name A comma separated list of screen names, up to 100 are allowed in a single request. * @param mixed $owner Either an integer containing the user ID or a string containing the screen name of the owner. * * @return void * * @since 3.1.4 * @dataProvider seedMembers */ public function testDeleteMembers($list, $user_id, $screen_name, $owner) { $returnData = new stdClass; $returnData->code = 200; $returnData->body = $this->sampleString; // Set request parameters. if (is_numeric($list)) { $data['list_id'] = $list; } elseif (is_string($list)) { $data['slug'] = $list; if (is_numeric($owner)) { $data['owner_id'] = $owner; } elseif (is_string($owner)) { $data['owner_screen_name'] = $owner; } else { // We don't have a valid entry $this->setExpectedException('RuntimeException'); $this->object->deleteMembers($list, $user_id, $screen_name, $owner); } } else { $this->setExpectedException('RuntimeException'); $this->object->deleteMembers($list, $user_id, $screen_name, $owner); } if ($user_id) { $data['user_id'] = $user_id; } if ($screen_name) { $data['screen_name'] = $screen_name; } if ($user_id == null && $screen_name == null) { $this->setExpectedException('RuntimeException'); $this->object->deleteMembers($list, $user_id, $screen_name, $owner); } $path = $this->object->fetchUrl('/lists/members/destroy_all.json'); $this->client->expects($this->once()) ->method('post') ->with($path, $data) ->will($this->returnValue($returnData)); $this->assertThat( $this->object->deleteMembers($list, $user_id, $screen_name, $owner), $this->equalTo(json_decode($this->sampleString)) ); } /** * Tests the deleteListMembers method - failure * * @param mixed $list Either an integer containing the list ID or a string containing the list slug. * @param string $user_id A comma separated list of user IDs, up to 100 are allowed in a single request. * @param string $screen_name A comma separated list of screen names, up to 100 are allowed in a single request. * @param mixed $owner Either an integer containing the user ID or a string containing the screen name of the owner. * * @return void * * @since 3.1.4 * @dataProvider seedMembers * @expectedException DomainException */ public function testDeleteMembersFailure($list, $user_id, $screen_name, $owner) { $returnData = new stdClass; $returnData->code = 500; $returnData->body = $this->errorString; // Set request parameters. if (is_numeric($list)) { $data['list_id'] = $list; } elseif (is_string($list)) { $data['slug'] = $list; if (is_numeric($owner)) { $data['owner_id'] = $owner; } elseif (is_string($owner)) { $data['owner_screen_name'] = $owner; } else { // We don't have a valid entry $this->setExpectedException('RuntimeException'); $this->object->deleteMembers($list, $user_id, $screen_name, $owner); } } else { $this->setExpectedException('RuntimeException'); $this->object->deleteMembers($list, $user_id, $screen_name, $owner); } if ($user_id) { $data['user_id'] = $user_id; } if ($screen_name) { $data['screen_name'] = $screen_name; } if ($user_id == null && $screen_name == null) { $this->setExpectedException('RuntimeException'); $this->object->deleteMembers($list, $user_id, $screen_name, $owner); } $path = $this->object->fetchUrl('/lists/members/destroy_all.json'); $this->client->expects($this->once()) ->method('post') ->with($path, $data) ->will($this->returnValue($returnData)); $this->object->deleteMembers($list, $user_id, $screen_name, $owner); } /** * Tests the subscribe method * * @param mixed $list Either an integer containing the list ID or a string containing the list slug. * @param mixed $owner Either an integer containing the user ID or a string containing the screen name. * * @return void * * @since 3.1.4 * @dataProvider seedListStatuses */ public function testSubscribe($list, $owner) { $returnData = new stdClass; $returnData->code = 200; $returnData->body = $this->rateLimit; $path = $this->object->fetchUrl('/application/rate_limit_status.json', array("resources" => "lists")); $this->client->expects($this->at(0)) ->method('get') ->with($path) ->will($this->returnValue($returnData)); $returnData = new stdClass; $returnData->code = 200; $returnData->body = $this->sampleString; // Set request parameters. if (is_numeric($list)) { $data['list_id'] = $list; } elseif (is_string($list)) { $data['slug'] = $list; if (is_numeric($owner)) { $data['owner_id'] = $owner; } elseif (is_string($owner)) { $data['owner_screen_name'] = $owner; } else { // We don't have a valid entry $this->setExpectedException('RuntimeException'); $this->object->subscribe($list, $owner); } } else { $this->setExpectedException('RuntimeException'); $this->object->subscribe($list, $owner); } $path = $this->object->fetchUrl('/lists/subscribers/create.json'); $this->client->expects($this->at(1)) ->method('post') ->with($path, $data) ->will($this->returnValue($returnData)); $this->assertThat( $this->object->subscribe($list, $owner), $this->equalTo(json_decode($this->sampleString)) ); } /** * Tests the subscribe method - failure * * @param mixed $list Either an integer containing the list ID or a string containing the list slug. * @param mixed $owner Either an integer containing the user ID or a string containing the screen name. * * @return void * * @since 3.1.4 * @dataProvider seedListStatuses * @expectedException DomainException */ public function testSubscribeFailure($list, $owner) { $returnData = new stdClass; $returnData->code = 200; $returnData->body = $this->rateLimit; $path = $this->object->fetchUrl('/application/rate_limit_status.json', array("resources" => "lists")); $this->client->expects($this->at(0)) ->method('get') ->with($path) ->will($this->returnValue($returnData)); $returnData = new stdClass; $returnData->code = 500; $returnData->body = $this->errorString; // Set request parameters. if (is_numeric($list)) { $data['list_id'] = $list; } elseif (is_string($list)) { $data['slug'] = $list; if (is_numeric($owner)) { $data['owner_id'] = $owner; } elseif (is_string($owner)) { $data['owner_screen_name'] = $owner; } else { // We don't have a valid entry $this->setExpectedException('RuntimeException'); $this->object->subscribe($list, $owner); } } else { $this->setExpectedException('RuntimeException'); $this->object->subscribe($list, $owner); } $path = $this->object->fetchUrl('/lists/subscribers/create.json'); $this->client->expects($this->at(1)) ->method('post') ->with($path, $data) ->will($this->returnValue($returnData)); $this->object->subscribe($list, $owner); } /** * Provides test data for request format detection. * * @return array * * @since 3.1.4 */ public function seedListUserOwner() { // List, User and Owner. return array( array(234654235457, '234654235457', null), array('test-list', 'userTest', 'testUser'), array('test-list', '234654235457', '56165105642'), array('test-list', 'testUser', null), array('test-list', null, 'testUser'), array(null, null, null) ); } /** * Tests the isListMember method * * @param mixed $list Either an integer containing the list ID or a string containing the list slug. * @param mixed $user Either an integer containing the user ID or a string containing the screen name of the user to remove. * @param mixed $owner Either an integer containing the user ID or a string containing the screen name of the owner. * * @return void * * @since 3.1.4 * @dataProvider seedListUserOwner */ public function testIsMember($list, $user, $owner) { $entities = true; $skip_status = true; $returnData = new stdClass; $returnData->code = 200; $returnData->body = $this->rateLimit; $path = $this->object->fetchUrl('/application/rate_limit_status.json', array("resources" => "lists")); $this->client->expects($this->at(0)) ->method('get') ->with($path) ->will($this->returnValue($returnData)); $returnData = new stdClass; $returnData->code = 200; $returnData->body = $this->sampleString; // Set request parameters. if (is_numeric($list)) { $data['list_id'] = $list; } elseif (is_string($list)) { $data['slug'] = $list; if (is_numeric($owner)) { $data['owner_id'] = $owner; } elseif (is_string($owner)) { $data['owner_screen_name'] = $owner; } else { // We don't have a valid entry $this->setExpectedException('RuntimeException'); $this->object->isMember($list, $user, $owner); } } else { $this->setExpectedException('RuntimeException'); $this->object->isMember($list, $user, $owner); } if (is_numeric($user)) { $data['user_id'] = $user; } elseif (is_string($user)) { $data['screen_name'] = $user; } else { // We don't have a valid entry $this->setExpectedException('RuntimeException'); $this->object->isMember($list, $user, $owner); } $data['include_entities'] = $entities; $data['skip_status'] = $skip_status; $path = $this->object->fetchUrl('/lists/members/show.json', $data); $this->client->expects($this->at(1)) ->method('get') ->with($path) ->will($this->returnValue($returnData)); $this->assertThat( $this->object->isMember($list, $user, $owner, $entities, $skip_status), $this->equalTo(json_decode($this->sampleString)) ); } /** * Tests the isListMember method - failure * * @param mixed $list Either an integer containing the list ID or a string containing the list slug. * @param mixed $user Either an integer containing the user ID or a string containing the screen name of the user to remove. * @param mixed $owner Either an integer containing the user ID or a string containing the screen name of the owner. * * @return void * * @since 3.1.4 * @dataProvider seedListUserOwner * @expectedException DomainException */ public function testIsMemberFailure($list, $user, $owner) { $entities = true; $skip_status = true; $returnData = new stdClass; $returnData->code = 200; $returnData->body = $this->rateLimit; $path = $this->object->fetchUrl('/application/rate_limit_status.json', array("resources" => "lists")); $this->client->expects($this->at(0)) ->method('get') ->with($path) ->will($this->returnValue($returnData)); $returnData = new stdClass; $returnData->code = 500; $returnData->body = $this->errorString; // Set request parameters. if (is_numeric($list)) { $data['list_id'] = $list; } elseif (is_string($list)) { $data['slug'] = $list; if (is_numeric($owner)) { $data['owner_id'] = $owner; } elseif (is_string($owner)) { $data['owner_screen_name'] = $owner; } else { // We don't have a valid entry $this->setExpectedException('RuntimeException'); $this->object->isMember($list, $user, $owner); } } else { $this->setExpectedException('RuntimeException'); $this->object->isMember($list, $user, $owner); } if (is_numeric($user)) { $data['user_id'] = $user; } elseif (is_string($user)) { $data['screen_name'] = $user; } else { // We don't have a valid entry $this->setExpectedException('RuntimeException'); $this->object->isMember($list, $user, $owner); } $data['include_entities'] = $entities; $data['skip_status'] = $skip_status; $path = $this->object->fetchUrl('/lists/members/show.json', $data); $this->client->expects($this->at(1)) ->method('get') ->with($path) ->will($this->returnValue($returnData)); $this->object->isMember($list, $user, $owner, $entities, $skip_status); } /** * Tests the isListSubscriber method * * @param mixed $list Either an integer containing the list ID or a string containing the list slug. * @param mixed $user Either an integer containing the user ID or a string containing the screen name of the user to remove. * @param mixed $owner Either an integer containing the user ID or a string containing the screen name of the owner. * * @return void * * @since 3.1.4 * @dataProvider seedListUserOwner */ public function testIsSubscriber($list, $user, $owner) { $entities = true; $skip_status = true; $returnData = new stdClass; $returnData->code = 200; $returnData->body = $this->rateLimit; $path = $this->object->fetchUrl('/application/rate_limit_status.json', array("resources" => "lists")); $this->client->expects($this->at(0)) ->method('get') ->with($path) ->will($this->returnValue($returnData)); $returnData = new stdClass; $returnData->code = 200; $returnData->body = $this->sampleString; // Set request parameters. if (is_numeric($list)) { $data['list_id'] = $list; } elseif (is_string($list)) { $data['slug'] = $list; if (is_numeric($owner)) { $data['owner_id'] = $owner; } elseif (is_string($owner)) { $data['owner_screen_name'] = $owner; } else { // We don't have a valid entry $this->setExpectedException('RuntimeException'); $this->object->isSubscriber($list, $user, $owner); } } else { $this->setExpectedException('RuntimeException'); $this->object->isSubscriber($list, $user, $owner); } if (is_numeric($user)) { $data['user_id'] = $user; } elseif (is_string($user)) { $data['screen_name'] = $user; } else { // We don't have a valid entry $this->setExpectedException('RuntimeException'); $this->object->isSubscriber($list, $user, $owner); } $data['include_entities'] = $entities; $data['skip_status'] = $skip_status; $path = $this->object->fetchUrl('/lists/subscribers/show.json', $data); $this->client->expects($this->at(1)) ->method('get') ->with($path) ->will($this->returnValue($returnData)); $this->assertThat( $this->object->isSubscriber($list, $user, $owner, $entities, $skip_status), $this->equalTo(json_decode($this->sampleString)) ); } /** * Tests the isListSubscriber method - failure * * @param mixed $list Either an integer containing the list ID or a string containing the list slug. * @param mixed $user Either an integer containing the user ID or a string containing the screen name of the user to remove. * @param mixed $owner Either an integer containing the user ID or a string containing the screen name of the owner. * * @return void * * @since 3.1.4 * @dataProvider seedListUserOwner * @expectedException DomainException */ public function testIsSubscriberFailure($list, $user, $owner) { $entities = true; $skip_status = true; $returnData = new stdClass; $returnData->code = 200; $returnData->body = $this->rateLimit; $path = $this->object->fetchUrl('/application/rate_limit_status.json', array("resources" => "lists")); $this->client->expects($this->at(0)) ->method('get') ->with($path) ->will($this->returnValue($returnData)); $returnData = new stdClass; $returnData->code = 500; $returnData->body = $this->errorString; // Set request parameters. if (is_numeric($list)) { $data['list_id'] = $list; } elseif (is_string($list)) { $data['slug'] = $list; if (is_numeric($owner)) { $data['owner_id'] = $owner; } elseif (is_string($owner)) { $data['owner_screen_name'] = $owner; } else { // We don't have a valid entry $this->setExpectedException('RuntimeException'); $this->object->isSubscriber($list, $user, $owner); } } else { $this->setExpectedException('RuntimeException'); $this->object->isSubscriber($list, $user, $owner); } if (is_numeric($user)) { $data['user_id'] = $user; } elseif (is_string($user)) { $data['screen_name'] = $user; } else { // We don't have a valid entry $this->setExpectedException('RuntimeException'); $this->object->isSubscriber($list, $user, $owner); } $data['include_entities'] = $entities; $data['skip_status'] = $skip_status; $path = $this->object->fetchUrl('/lists/subscribers/show.json', $data); $this->client->expects($this->at(1)) ->method('get') ->with($path) ->will($this->returnValue($returnData)); $this->object->isSubscriber($list, $user, $owner, $entities, $skip_status); } /** * Tests the unsubscribe method * * @param mixed $list Either an integer containing the list ID or a string containing the list slug. * @param mixed $owner Either an integer containing the user ID or a string containing the screen name. * * @return void * * @since 3.1.4 * @dataProvider seedListStatuses */ public function testUnsubscribe($list, $owner) { $returnData = new stdClass; $returnData->code = 200; $returnData->body = $this->rateLimit; $path = $this->object->fetchUrl('/application/rate_limit_status.json', array("resources" => "lists")); $this->client->expects($this->at(0)) ->method('get') ->with($path) ->will($this->returnValue($returnData)); $returnData = new stdClass; $returnData->code = 200; $returnData->body = $this->sampleString; // Set request parameters. if (is_numeric($list)) { $data['list_id'] = $list; } elseif (is_string($list)) { $data['slug'] = $list; if (is_numeric($owner)) { $data['owner_id'] = $owner; } elseif (is_string($owner)) { $data['owner_screen_name'] = $owner; } else { // We don't have a valid entry $this->setExpectedException('RuntimeException'); $this->object->unsubscribe($list, $owner); } } else { $this->setExpectedException('RuntimeException'); $this->object->unsubscribe($list, $owner); } $path = $this->object->fetchUrl('/lists/subscribers/destroy.json'); $this->client->expects($this->at(1)) ->method('post') ->with($path, $data) ->will($this->returnValue($returnData)); $this->assertThat( $this->object->unsubscribe($list, $owner), $this->equalTo(json_decode($this->sampleString)) ); } /** * Tests the unsubscribe method - failure * * @param mixed $list Either an integer containing the list ID or a string containing the list slug. * @param mixed $owner Either an integer containing the user ID or a string containing the screen name. * * @return void * * @since 3.1.4 * @dataProvider seedListStatuses * @expectedException DomainException */ public function testUnsubscribeFailure($list, $owner) { $returnData = new stdClass; $returnData->code = 200; $returnData->body = $this->rateLimit; $path = $this->object->fetchUrl('/application/rate_limit_status.json', array("resources" => "lists")); $this->client->expects($this->at(0)) ->method('get') ->with($path) ->will($this->returnValue($returnData)); $returnData = new stdClass; $returnData->code = 500; $returnData->body = $this->errorString; // Set request parameters. if (is_numeric($list)) { $data['list_id'] = $list; } elseif (is_string($list)) { $data['slug'] = $list; if (is_numeric($owner)) { $data['owner_id'] = $owner; } elseif (is_string($owner)) { $data['owner_screen_name'] = $owner; } else { // We don't have a valid entry $this->setExpectedException('RuntimeException'); $this->object->unsubscribe($list, $owner); } } else { $this->setExpectedException('RuntimeException'); $this->object->unsubscribe($list, $owner); } $path = $this->object->fetchUrl('/lists/subscribers/destroy.json'); $this->client->expects($this->at(1)) ->method('post') ->with($path, $data) ->will($this->returnValue($returnData)); $this->object->unsubscribe($list, $owner); } /** * Tests the addListMembers method * * @param mixed $list Either an integer containing the list ID or a string containing the list slug. * @param string $user_id A comma separated list of user IDs, up to 100 are allowed in a single request. * @param string $screen_name A comma separated list of screen names, up to 100 are allowed in a single request. * @param mixed $owner Either an integer containing the user ID or a string containing the screen name. * * @return void * * @since 3.1.4 * @dataProvider seedMembers */ public function testAddMembers($list, $user_id, $screen_name, $owner) { $returnData = new stdClass; $returnData->code = 200; $returnData->body = $this->rateLimit; $path = $this->object->fetchUrl('/application/rate_limit_status.json', array("resources" => "lists")); $this->client->expects($this->at(0)) ->method('get') ->with($path) ->will($this->returnValue($returnData)); $returnData = new stdClass; $returnData->code = 200; $returnData->body = $this->sampleString; // Set request parameters. if (is_numeric($list)) { $data['list_id'] = $list; } elseif (is_string($list)) { $data['slug'] = $list; if (is_numeric($owner)) { $data['owner_id'] = $owner; } elseif (is_string($owner)) { $data['owner_screen_name'] = $owner; } else { // We don't have a valid entry $this->setExpectedException('RuntimeException'); $this->object->addMembers($list, $user_id, $screen_name, $owner); } } else { $this->setExpectedException('RuntimeException'); $this->object->addMembers($list, $user_id, $screen_name, $owner); } if ($user_id) { $data['user_id'] = $user_id; } if ($screen_name) { $data['screen_name'] = $screen_name; } if ($user_id == null && $screen_name == null) { $this->setExpectedException('RuntimeException'); $this->object->addMembers($list, $user_id, $screen_name, $owner); } $path = $this->object->fetchUrl('/lists/members/create_all.json'); $this->client->expects($this->at(1)) ->method('post') ->with($path, $data) ->will($this->returnValue($returnData)); $this->assertThat( $this->object->addMembers($list, $user_id, $screen_name, $owner), $this->equalTo(json_decode($this->sampleString)) ); } /** * Tests the addListMembers method - failure * * @param mixed $list Either an integer containing the list ID or a string containing the list slug. * @param string $user_id A comma separated list of user IDs, up to 100 are allowed in a single request. * @param string $screen_name A comma separated list of screen names, up to 100 are allowed in a single request. * @param mixed $owner Either an integer containing the user ID or a string containing the screen name. * * @return void * * @since 3.1.4 * @dataProvider seedMembers * @expectedException DomainException */ public function testAddMembersFailure($list, $user_id, $screen_name, $owner) { $returnData = new stdClass; $returnData->code = 200; $returnData->body = $this->rateLimit; $path = $this->object->fetchUrl('/application/rate_limit_status.json', array("resources" => "lists")); $this->client->expects($this->at(0)) ->method('get') ->with($path) ->will($this->returnValue($returnData)); $returnData = new stdClass; $returnData->code = 500; $returnData->body = $this->errorString; // Set request parameters. if (is_numeric($list)) { $data['list_id'] = $list; } elseif (is_string($list)) { $data['slug'] = $list; if (is_numeric($owner)) { $data['owner_id'] = $owner; } elseif (is_string($owner)) { $data['owner_screen_name'] = $owner; } else { // We don't have a valid entry $this->setExpectedException('RuntimeException'); $this->object->addMembers($list, $user_id, $screen_name, $owner); } } else { $this->setExpectedException('RuntimeException'); $this->object->addMembers($list, $user_id, $screen_name, $owner); } if ($user_id) { $data['user_id'] = $user_id; } if ($screen_name) { $data['screen_name'] = $screen_name; } if ($user_id == null && $screen_name == null) { $this->setExpectedException('RuntimeException'); $this->object->addMembers($list, $user_id, $screen_name, $owner); } $path = $this->object->fetchUrl('/lists/members/create_all.json'); $this->client->expects($this->at(1)) ->method('post') ->with($path, $data) ->will($this->returnValue($returnData)); $this->object->addMembers($list, $user_id, $screen_name, $owner); } /** * Tests the getListMembers method * * @param mixed $list Either an integer containing the list ID or a string containing the list slug. * @param mixed $owner Either an integer containing the user ID or a string containing the screen name. * * @return void * * @since 3.1.4 * @dataProvider seedListStatuses */ public function testGetMembers($list, $owner) { $entities = true; $skip_status = true; $returnData = new stdClass; $returnData->code = 200; $returnData->body = $this->rateLimit; $path = $this->object->fetchUrl('/application/rate_limit_status.json', array("resources" => "lists")); $this->client->expects($this->at(0)) ->method('get') ->with($path) ->will($this->returnValue($returnData)); $returnData = new stdClass; $returnData->code = 200; $returnData->body = $this->sampleString; // Set request parameters. if (is_numeric($list)) { $data['list_id'] = $list; } elseif (is_string($list)) { $data['slug'] = $list; if (is_numeric($owner)) { $data['owner_id'] = $owner; } elseif (is_string($owner)) { $data['owner_screen_name'] = $owner; } else { // We don't have a valid entry $this->setExpectedException('RuntimeException'); $this->object->getMembers($list, $owner); } } else { $this->setExpectedException('RuntimeException'); $this->object->getMembers($list, $owner); } $data['include_entities'] = $entities; $data['skip_status'] = $skip_status; $path = $this->object->fetchUrl('/lists/members.json', $data); $this->client->expects($this->at(1)) ->method('get') ->with($path) ->will($this->returnValue($returnData)); $this->assertThat( $this->object->getMembers($list, $owner, $entities, $skip_status), $this->equalTo(json_decode($this->sampleString)) ); } /** * Tests the getListMembers method - failure * * @param mixed $list Either an integer containing the list ID or a string containing the list slug. * @param mixed $owner Either an integer containing the user ID or a string containing the screen name. * * @return void * * @since 3.1.4 * @dataProvider seedListStatuses * @expectedException DomainException */ public function testGetMembersFailure($list, $owner) { $entities = true; $skip_status = true; $returnData = new stdClass; $returnData->code = 200; $returnData->body = $this->rateLimit; $path = $this->object->fetchUrl('/application/rate_limit_status.json', array("resources" => "lists")); $this->client->expects($this->at(0)) ->method('get') ->with($path) ->will($this->returnValue($returnData)); $returnData = new stdClass; $returnData->code = 500; $returnData->body = $this->errorString; // Set request parameters. if (is_numeric($list)) { $data['list_id'] = $list; } elseif (is_string($list)) { $data['slug'] = $list; if (is_numeric($owner)) { $data['owner_id'] = $owner; } elseif (is_string($owner)) { $data['owner_screen_name'] = $owner; } else { // We don't have a valid entry $this->setExpectedException('RuntimeException'); $this->object->getMembers($list, $owner); } } else { $this->setExpectedException('RuntimeException'); $this->object->getMembers($list, $owner); } $data['include_entities'] = $entities; $data['skip_status'] = $skip_status; $path = $this->object->fetchUrl('/lists/members.json', $data); $this->client->expects($this->at(1)) ->method('get') ->with($path) ->will($this->returnValue($returnData)); $this->object->getMembers($list, $owner, $entities, $skip_status); } /** * Tests the getListById method * * @param mixed $list Either an integer containing the list ID or a string containing the list slug. * @param mixed $owner Either an integer containing the user ID or a string containing the screen name. * * @return void * * @since 3.1.4 * @dataProvider seedListStatuses */ public function testGetListById($list, $owner) { $returnData = new stdClass; $returnData->code = 200; $returnData->body = $this->rateLimit; $path = $this->object->fetchUrl('/application/rate_limit_status.json', array("resources" => "lists")); $this->client->expects($this->at(0)) ->method('get') ->with($path) ->will($this->returnValue($returnData)); $returnData = new stdClass; $returnData->code = 200; $returnData->body = $this->sampleString; // Set request parameters. if (is_numeric($list)) { $data['list_id'] = $list; } elseif (is_string($list)) { $data['slug'] = $list; if (is_numeric($owner)) { $data['owner_id'] = $owner; } elseif (is_string($owner)) { $data['owner_screen_name'] = $owner; } else { // We don't have a valid entry $this->setExpectedException('RuntimeException'); $this->object->getListById($list, $owner); } } else { $this->setExpectedException('RuntimeException'); $this->object->getListById($list, $owner); } $path = $this->object->fetchUrl('/lists/show.json', $data); $this->client->expects($this->at(1)) ->method('get') ->with($path) ->will($this->returnValue($returnData)); $this->assertThat( $this->object->getListById($list, $owner), $this->equalTo(json_decode($this->sampleString)) ); } /** * Tests the getListById method - failure * * @param mixed $list Either an integer containing the list ID or a string containing the list slug. * @param mixed $owner Either an integer containing the user ID or a string containing the screen name. * * @return void * * @since 3.1.4 * @dataProvider seedListStatuses * @expectedException DomainException */ public function testGetListByIdFailure($list, $owner) { $returnData = new stdClass; $returnData->code = 200; $returnData->body = $this->rateLimit; $path = $this->object->fetchUrl('/application/rate_limit_status.json', array("resources" => "lists")); $this->client->expects($this->at(0)) ->method('get') ->with($path) ->will($this->returnValue($returnData)); $returnData = new stdClass; $returnData->code = 500; $returnData->body = $this->errorString; // Set request parameters. if (is_numeric($list)) { $data['list_id'] = $list; } elseif (is_string($list)) { $data['slug'] = $list; if (is_numeric($owner)) { $data['owner_id'] = $owner; } elseif (is_string($owner)) { $data['owner_screen_name'] = $owner; } else { // We don't have a valid entry $this->setExpectedException('RuntimeException'); $this->object->getListById($list, $owner); } } else { $this->setExpectedException('RuntimeException'); $this->object->getListById($list, $owner); } $path = $this->object->fetchUrl('/lists/show.json', $data); $this->client->expects($this->at(1)) ->method('get') ->with($path) ->will($this->returnValue($returnData)); $this->object->getListById($list, $owner); } /** * Tests the getSubscriptions method * * @param mixed $user Either an integer containing the user ID or a string containing the screen name. * * @return void * * @since 3.1.4 * @dataProvider seedUser */ public function testGetSubscriptions($user) { $count = 10; $cursor = 1234; $returnData = new stdClass; $returnData->code = 200; $returnData->body = $this->rateLimit; $path = $this->object->fetchUrl('/application/rate_limit_status.json', array("resources" => "lists")); $this->client->expects($this->at(0)) ->method('get') ->with($path) ->will($this->returnValue($returnData)); $returnData = new stdClass; $returnData->code = 200; $returnData->body = $this->sampleString; // Set request parameters. if (is_numeric($user)) { $data['user_id'] = $user; } elseif (is_string($user)) { $data['screen_name'] = $user; } else { $this->setExpectedException('RuntimeException'); $this->object->getSubscriptions($user); } $data['count'] = $count; $data['cursor'] = $cursor; $path = $this->object->fetchUrl('/lists/subscriptions.json', $data); $this->client->expects($this->at(1)) ->method('get') ->with($path) ->will($this->returnValue($returnData)); $this->assertThat( $this->object->getSubscriptions($user, $count, $cursor), $this->equalTo(json_decode($this->sampleString)) ); } /** * Tests the getSubscriptions method - failure * * @param mixed $user Either an integer containing the user ID or a string containing the screen name. * * @return void * * @since 3.1.4 * @dataProvider seedUser * @expectedException DomainException */ public function testGetSubscriptionsFailure($user) { $count = 10; $cursor = 1234; $returnData = new stdClass; $returnData->code = 200; $returnData->body = $this->rateLimit; $path = $this->object->fetchUrl('/application/rate_limit_status.json', array("resources" => "lists")); $this->client->expects($this->at(0)) ->method('get') ->with($path) ->will($this->returnValue($returnData)); $returnData = new stdClass; $returnData->code = 500; $returnData->body = $this->errorString; // Set request parameters. if (is_numeric($user)) { $data['user_id'] = $user; } elseif (is_string($user)) { $data['screen_name'] = $user; } else { $this->setExpectedException('RuntimeException'); $this->object->getSubscriptions($user); } $data['count'] = $count; $data['cursor'] = $cursor; $path = $this->object->fetchUrl('/lists/subscriptions.json', $data); $this->client->expects($this->at(1)) ->method('get') ->with($path) ->will($this->returnValue($returnData)); $this->object->getSubscriptions($user, $count, $cursor); } /** * Tests the updateList method * * @param mixed $list Either an integer containing the list ID or a string containing the list slug. * @param mixed $owner Either an integer containing the user ID or a string containing the screen name. * * @return void * * @since 3.1.4 * @dataProvider seedListStatuses */ public function testUpdate($list, $owner) { $name = 'test list'; $mode = 'private'; $description = 'this is a description'; $returnData = new stdClass; $returnData->code = 200; $returnData->body = $this->rateLimit; $path = $this->object->fetchUrl('/application/rate_limit_status.json', array("resources" => "lists")); $this->client->expects($this->at(0)) ->method('get') ->with($path) ->will($this->returnValue($returnData)); $returnData = new stdClass; $returnData->code = 200; $returnData->body = $this->sampleString; // Set request parameters. if (is_numeric($list)) { $data['list_id'] = $list; } elseif (is_string($list)) { $data['slug'] = $list; if (is_numeric($owner)) { $data['owner_id'] = $owner; } elseif (is_string($owner)) { $data['owner_screen_name'] = $owner; } else { // We don't have a valid entry $this->setExpectedException('RuntimeException'); $this->object->update($list, $owner); } } else { $this->setExpectedException('RuntimeException'); $this->object->update($list, $owner); } $data['name'] = $name; $data['mode'] = $mode; $data['description'] = $description; $path = $this->object->fetchUrl('/lists/update.json'); $this->client->expects($this->at(1)) ->method('post') ->with($path, $data) ->will($this->returnValue($returnData)); $this->assertThat( $this->object->update($list, $owner, $name, $mode, $description), $this->equalTo(json_decode($this->sampleString)) ); } /** * Tests the updateList method - failure * * @param mixed $list Either an integer containing the list ID or a string containing the list slug. * @param mixed $owner Either an integer containing the user ID or a string containing the screen name. * * @return void * * @since 3.1.4 * @dataProvider seedListStatuses * @expectedException DomainException */ public function testUpdateFailure($list, $owner) { $name = 'test list'; $mode = 'private'; $description = 'this is a description'; $returnData = new stdClass; $returnData->code = 200; $returnData->body = $this->rateLimit; $path = $this->object->fetchUrl('/application/rate_limit_status.json', array("resources" => "lists")); $this->client->expects($this->at(0)) ->method('get') ->with($path) ->will($this->returnValue($returnData)); $returnData = new stdClass; $returnData->code = 500; $returnData->body = $this->errorString; // Set request parameters. if (is_numeric($list)) { $data['list_id'] = $list; } elseif (is_string($list)) { $data['slug'] = $list; if (is_numeric($owner)) { $data['owner_id'] = $owner; } elseif (is_string($owner)) { $data['owner_screen_name'] = $owner; } else { // We don't have a valid entry $this->setExpectedException('RuntimeException'); $this->object->update($list, $owner); } } else { $this->setExpectedException('RuntimeException'); $this->object->update($list, $owner); } $data['name'] = $name; $data['mode'] = $mode; $data['description'] = $description; $path = $this->object->fetchUrl('/lists/update.json'); $this->client->expects($this->at(1)) ->method('post') ->with($path, $data) ->will($this->returnValue($returnData)); $this->object->update($list, $owner, $name, $mode, $description); } /** * Tests the createList method * * @return void * * @since 3.1.4 */ public function testCreate() { $name = 'test list'; $mode = 'private'; $description = 'this is a description'; $returnData = new stdClass; $returnData->code = 200; $returnData->body = $this->rateLimit; $path = $this->object->fetchUrl('/application/rate_limit_status.json', array("resources" => "lists")); $this->client->expects($this->at(0)) ->method('get') ->with($path) ->will($this->returnValue($returnData)); $returnData = new stdClass; $returnData->code = 200; $returnData->body = $this->sampleString; $data['name'] = $name; $data['mode'] = $mode; $data['description'] = $description; $path = $this->object->fetchUrl('/lists/create.json'); $this->client->expects($this->at(1)) ->method('post') ->with($path, $data) ->will($this->returnValue($returnData)); $this->assertThat( $this->object->create($name, $mode, $description), $this->equalTo(json_decode($this->sampleString)) ); } /** * Tests the createList method - failure * * @return void * * @since 3.1.4 * @expectedException DomainException */ public function testCreateFailure() { $name = 'test list'; $mode = 'private'; $description = 'this is a description'; $returnData = new stdClass; $returnData->code = 200; $returnData->body = $this->rateLimit; $path = $this->object->fetchUrl('/application/rate_limit_status.json', array("resources" => "lists")); $this->client->expects($this->at(0)) ->method('get') ->with($path) ->will($this->returnValue($returnData)); $returnData = new stdClass; $returnData->code = 500; $returnData->body = $this->errorString; $data['name'] = $name; $data['mode'] = $mode; $data['description'] = $description; $path = $this->object->fetchUrl('/lists/create.json'); $this->client->expects($this->at(1)) ->method('post') ->with($path, $data) ->will($this->returnValue($returnData)); $this->object->create($name, $mode, $description); } /** * Tests the deleteList method * * @param mixed $list Either an integer containing the list ID or a string containing the list slug. * @param mixed $owner Either an integer containing the user ID or a string containing the screen name. * * @return void * * @since 3.1.4 * @dataProvider seedListStatuses */ public function testDelete($list, $owner) { $returnData = new stdClass; $returnData->code = 200; $returnData->body = $this->rateLimit; $path = $this->object->fetchUrl('/application/rate_limit_status.json', array("resources" => "lists")); $this->client->expects($this->at(0)) ->method('get') ->with($path) ->will($this->returnValue($returnData)); $returnData = new stdClass; $returnData->code = 200; $returnData->body = $this->sampleString; // Set request parameters. if (is_numeric($list)) { $data['list_id'] = $list; } elseif (is_string($list)) { $data['slug'] = $list; if (is_numeric($owner)) { $data['owner_id'] = $owner; } elseif (is_string($owner)) { $data['owner_screen_name'] = $owner; } else { // We don't have a valid entry $this->setExpectedException('RuntimeException'); $this->object->delete($list, $owner); } } else { $this->setExpectedException('RuntimeException'); $this->object->delete($list, $owner); } $path = $this->object->fetchUrl('/lists/destroy.json'); $this->client->expects($this->at(1)) ->method('post') ->with($path, $data) ->will($this->returnValue($returnData)); $this->assertThat( $this->object->delete($list, $owner), $this->equalTo(json_decode($this->sampleString)) ); } /** * Tests the deleteList method - failure * * @param mixed $list Either an integer containing the list ID or a string containing the list slug. * @param mixed $owner Either an integer containing the user ID or a string containing the screen name. * * @return void * * @since 3.1.4 * @dataProvider seedListStatuses * @expectedException DomainException */ public function testDeleteFailure($list, $owner) { $returnData = new stdClass; $returnData->code = 200; $returnData->body = $this->rateLimit; $path = $this->object->fetchUrl('/application/rate_limit_status.json', array("resources" => "lists")); $this->client->expects($this->at(0)) ->method('get') ->with($path) ->will($this->returnValue($returnData)); $returnData = new stdClass; $returnData->code = 500; $returnData->body = $this->errorString; // Set request parameters. if (is_numeric($list)) { $data['list_id'] = $list; } elseif (is_string($list)) { $data['slug'] = $list; if (is_numeric($owner)) { $data['owner_id'] = $owner; } elseif (is_string($owner)) { $data['owner_screen_name'] = $owner; } else { // We don't have a valid entry $this->setExpectedException('RuntimeException'); $this->object->delete($list, $owner); } } else { $this->setExpectedException('RuntimeException'); $this->object->delete($list, $owner); } $path = $this->object->fetchUrl('/lists/destroy.json'); $this->client->expects($this->at(1)) ->method('post') ->with($path, $data) ->will($this->returnValue($returnData)); $this->object->delete($list, $owner); } }
IOC/joomla3
tests/unit/suites/libraries/joomla/twitter/JTwitterListsTest.php
PHP
gpl-2.0
59,472
[ 30522, 1026, 1029, 25718, 1013, 1008, 1008, 1008, 1030, 7427, 28576, 19968, 2050, 1012, 3131, 22199, 1008, 1030, 4942, 23947, 4270, 10474, 1008, 1008, 1030, 9385, 9385, 1006, 1039, 1007, 2384, 1011, 10476, 2330, 3120, 5609, 1010, 4297, 1012...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php /** * Zend Framework * * LICENSE * * This source file is subject to the new BSD license that is bundled * with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://framework.zend.com/license/new-bsd * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@zend.com so we can send you a copy immediately. * * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action_Helper * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ /** * @see Zend_Session */ require_once 'Zend/Session.php'; /** * @see Zend_Controller_Action_Helper_Abstract */ require_once 'Zend/Controller/Action/Helper/Abstract.php'; /** * Flash Messenger - implement session-based messages * * @uses Zend_Controller_Action_Helper_Abstract * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action_Helper * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id: FlashMessenger.php 23775 2011-03-01 17:25:24Z ralph $ */ class Zend_Controller_Action_Helper_FlashMessengerType extends Zend_Controller_Action_Helper_Abstract implements IteratorAggregate, Countable { /** * $_messages - Messages from previous request * * @var array */ static protected $_messages = array(); /** * $_session - Zend_Session storage object * * @var Zend_Session */ static protected $_session = null; /** * $_messageAdded - Wether a message has been previously added * * @var boolean */ static protected $_messageAdded = false; /** * $_namespace - Instance namespace, default is 'default' * * @var string */ protected $_namespace = 'default'; /** * __construct() - Instance constructor, needed to get iterators, etc * * @param string $namespace * @return void */ public function __construct() { if (!self::$_session instanceof Zend_Session_Namespace) { self::$_session = new Zend_Session_Namespace($this->getName()); foreach (self::$_session as $namespace => $messages) { self::$_messages[$namespace] = $messages; unset(self::$_session->{$namespace}); } } } /** * postDispatch() - runs after action is dispatched, in this * case, it is resetting the namespace in case we have forwarded to a different * action, Flashmessage will be 'clean' (default namespace) * * @return Zend_Controller_Action_Helper_FlashMessenger Provides a fluent interface */ public function postDispatch() { $this->resetNamespace(); return $this; } /** * setNamespace() - change the namespace messages are added to, useful for * per action controller messaging between requests * * @param string $namespace * @return Zend_Controller_Action_Helper_FlashMessenger Provides a fluent interface */ public function setNamespace($namespace = 'default') { $this->_namespace = $namespace; return $this; } /** * resetNamespace() - reset the namespace to the default * * @return Zend_Controller_Action_Helper_FlashMessenger Provides a fluent interface */ public function resetNamespace() { $this->setNamespace(); return $this; } /** * addMessage() - Add a message to flash message * * @param string $message * @return Zend_Controller_Action_Helper_FlashMessenger Provides a fluent interface */ public function addMessage($message) { if (self::$_messageAdded === false) { self::$_session->setExpirationHops(1, null, true); } if (!is_array(self::$_session->{$this->_namespace})) { self::$_session->{$this->_namespace} = array(); } self::$_session->{$this->_namespace}[] = $message; return $this; } /** * hasMessages() - Wether a specific namespace has messages * * @return boolean */ public function hasMessages() { return isset(self::$_messages[$this->_namespace]); } /** * getMessages() - Get messages from a specific namespace * * @return array */ public function getMessages() { if ($this->hasMessages()) { return self::$_messages[$this->_namespace]; } return array(); } /** * Clear all messages from the previous request & current namespace * * @return boolean True if messages were cleared, false if none existed */ public function clearMessages() { if ($this->hasMessages()) { unset(self::$_messages[$this->_namespace]); return true; } return false; } /** * hasCurrentMessages() - check to see if messages have been added to current * namespace within this request * * @return boolean */ public function hasCurrentMessages() { return isset(self::$_session->{$this->_namespace}); } /** * getCurrentMessages() - get messages that have been added to the current * namespace within this request * * @return array */ public function getCurrentMessages() { if ($this->hasCurrentMessages()) { return self::$_session->{$this->_namespace}; } return array(); } /** * clear messages from the current request & current namespace * * @return boolean */ public function clearCurrentMessages() { if ($this->hasCurrentMessages()) { unset(self::$_session->{$this->_namespace}); return true; } return false; } /** * getIterator() - complete the IteratorAggregate interface, for iterating * * @return ArrayObject */ public function getIterator() { if ($this->hasMessages()) { return new ArrayObject($this->getMessages()); } return new ArrayObject(); } /** * count() - Complete the countable interface * * @return int */ public function count() { if ($this->hasMessages()) { return count($this->getMessages()); } return 0; } /** * Strategy pattern: proxy to addMessage() * * @param string $message * @return void */ public function direct($message) { return $this->addMessage($message); } }
culturagovbr/portal-vale-cultura
projeto/library/Zend/Controller/Action/Helper/FlashMessengerType.php
PHP
gpl-3.0
6,914
[ 30522, 1026, 1029, 25718, 1013, 1008, 1008, 1008, 16729, 2094, 7705, 1008, 1008, 6105, 1008, 1008, 2023, 3120, 5371, 2003, 3395, 2000, 1996, 2047, 18667, 2094, 6105, 2008, 2003, 24378, 1008, 2007, 2023, 7427, 1999, 1996, 5371, 6105, 1012, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// Copyright 2015 The Bazel Authors. 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. package com.google.devtools.build.lib.profiler; import static com.google.common.truth.Truth.assertThat; import static java.nio.charset.StandardCharsets.ISO_8859_1; import static org.junit.Assert.fail; import com.google.devtools.build.lib.clock.BlazeClock; import com.google.devtools.build.lib.clock.Clock; import com.google.devtools.build.lib.profiler.Profiler.ProfiledTaskKinds; import com.google.devtools.build.lib.profiler.analysis.ProfileInfo; import com.google.devtools.build.lib.testutil.FoundationTestCase; import com.google.devtools.build.lib.testutil.ManualClock; import com.google.devtools.build.lib.testutil.Suite; import com.google.devtools.build.lib.testutil.TestSpec; import com.google.devtools.build.lib.vfs.FileSystemUtils; import com.google.devtools.build.lib.vfs.Path; import java.io.InputStream; import java.io.OutputStream; import java.util.Arrays; import java.util.concurrent.atomic.AtomicInteger; import java.util.zip.Deflater; import java.util.zip.DeflaterOutputStream; import java.util.zip.Inflater; import java.util.zip.InflaterInputStream; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; /** * Unit tests for the profiler. */ @TestSpec(size = Suite.MEDIUM_TESTS) // testConcurrentProfiling takes ~700ms, testProfiler 100ms. @RunWith(JUnit4.class) public class ProfilerTest extends FoundationTestCase { private Path cacheDir; private Profiler profiler = Profiler.instance(); private ManualClock clock; @Before public final void createCacheDirectory() throws Exception { cacheDir = scratch.dir("/tmp"); } @Before public final void setManualClock() { clock = new ManualClock(); BlazeClock.setClock(clock); } @Test public void testProfilerActivation() throws Exception { Path cacheFile = cacheDir.getRelative("profile1.dat"); assertThat(profiler.isActive()).isFalse(); profiler.start(ProfiledTaskKinds.ALL, cacheFile.getOutputStream(), "basic test", false, BlazeClock.instance(), BlazeClock.instance().nanoTime()); assertThat(profiler.isActive()).isTrue(); profiler.stop(); assertThat(profiler.isActive()).isFalse(); } @Test public void testTaskDetails() throws Exception { Path cacheFile = cacheDir.getRelative("profile1.dat"); profiler.start(ProfiledTaskKinds.ALL, cacheFile.getOutputStream(), "basic test", false, BlazeClock.instance(), BlazeClock.instance().nanoTime()); profiler.startTask(ProfilerTask.ACTION, "action task"); profiler.logEvent(ProfilerTask.TEST, "event"); profiler.completeTask(ProfilerTask.ACTION); profiler.stop(); ProfileInfo info = ProfileInfo.loadProfile(cacheFile); info.calculateStats(); ProfileInfo.Task task = info.allTasksById.get(0); assertThat(task.id).isEqualTo(1); assertThat(task.type).isEqualTo(ProfilerTask.ACTION); assertThat(task.getDescription()).isEqualTo("action task"); task = info.allTasksById.get(1); assertThat(task.id).isEqualTo(2); assertThat(task.type).isEqualTo(ProfilerTask.TEST); assertThat(task.getDescription()).isEqualTo("event"); } @Test public void testProfiler() throws Exception { Path cacheFile = cacheDir.getRelative("profile1.dat"); profiler.start(ProfiledTaskKinds.ALL, cacheFile.getOutputStream(), "basic test", false, BlazeClock.instance(), BlazeClock.instance().nanoTime()); profiler.logSimpleTask(BlazeClock.instance().nanoTime(), ProfilerTask.PHASE, "profiler start"); profiler.startTask(ProfilerTask.ACTION, "complex task"); profiler.logEvent(ProfilerTask.PHASE, "event1"); profiler.startTask(ProfilerTask.ACTION_CHECK, "complex subtask"); // next task takes less than 10 ms and should be only aggregated profiler.logSimpleTask(BlazeClock.instance().nanoTime(), ProfilerTask.VFS_STAT, "stat1"); long startTime = BlazeClock.instance().nanoTime(); clock.advanceMillis(20); // this one will take at least 20 ms and should be present profiler.logSimpleTask(startTime, ProfilerTask.VFS_STAT, "stat2"); profiler.completeTask(ProfilerTask.ACTION_CHECK); profiler.completeTask(ProfilerTask.ACTION); profiler.stop(); // all other calls to profiler should be ignored profiler.logEvent(ProfilerTask.PHASE, "should be ignored"); // normally this would cause an exception but it is ignored since profiler // is disabled profiler.completeTask(ProfilerTask.ACTION_EXECUTE); ProfileInfo info = ProfileInfo.loadProfile(cacheFile); info.calculateStats(); assertThat(info.allTasksById).hasSize(6); // only 5 tasks + finalization should be recorded ProfileInfo.Task task = info.allTasksById.get(0); assertThat(task.stats.isEmpty()).isTrue(); task = info.allTasksById.get(1); int count = 0; for (ProfileInfo.AggregateAttr attr : task.getStatAttrArray()) { if (attr != null) { count++; } } assertThat(count).isEqualTo(2); // only children are GENERIC and ACTION_CHECK assertThat(ProfilerTask.TASK_COUNT).isEqualTo(task.aggregatedStats.toArray().length); assertThat(task.aggregatedStats.getAttr(ProfilerTask.VFS_STAT).count).isEqualTo(2); task = info.allTasksById.get(2); assertThat(task.durationNanos).isEqualTo(0); task = info.allTasksById.get(3); assertThat(task.stats.getAttr(ProfilerTask.VFS_STAT).count).isEqualTo(2); assertThat(task.subtasks).hasLength(1); assertThat(task.subtasks[0].getDescription()).isEqualTo("stat2"); // assert that startTime grows with id long time = -1; for (ProfileInfo.Task t : info.allTasksById) { assertThat(t.startTime).isAtLeast(time); time = t.startTime; } } @Test public void testProfilerRecordingAllEvents() throws Exception { Path cacheFile = cacheDir.getRelative("profile1.dat"); profiler.start(ProfiledTaskKinds.ALL, cacheFile.getOutputStream(), "basic test", true, BlazeClock.instance(), BlazeClock.instance().nanoTime()); profiler.startTask(ProfilerTask.ACTION, "action task"); // Next task takes less than 10 ms but should be recorded anyway. clock.advanceMillis(1); profiler.logSimpleTask(BlazeClock.instance().nanoTime(), ProfilerTask.VFS_STAT, "stat1"); profiler.completeTask(ProfilerTask.ACTION); profiler.stop(); ProfileInfo info = ProfileInfo.loadProfile(cacheFile); info.calculateStats(); assertThat(info.allTasksById).hasSize(3); // 2 tasks + finalization should be recorded ProfileInfo.Task task = info.allTasksById.get(1); assertThat(task.type).isEqualTo(ProfilerTask.VFS_STAT); // Check that task would have been dropped if profiler was not configured to record everything. assertThat(task.durationNanos).isLessThan(ProfilerTask.VFS_STAT.minDuration); } @Test public void testProfilerRecordingOnlySlowestEvents() throws Exception { Path profileData = cacheDir.getRelative("foo"); profiler.start(ProfiledTaskKinds.SLOWEST, profileData.getOutputStream(), "test", true, BlazeClock.instance(), BlazeClock.instance().nanoTime()); profiler.logSimpleTask(10000, 20000, ProfilerTask.VFS_STAT, "stat"); profiler.logSimpleTask(20000, 30000, ProfilerTask.REMOTE_EXECUTION, "remote execution"); assertThat(profiler.isProfiling(ProfilerTask.VFS_STAT)).isTrue(); assertThat(profiler.isProfiling(ProfilerTask.REMOTE_EXECUTION)).isFalse(); profiler.stop(); ProfileInfo info = ProfileInfo.loadProfile(profileData); info.calculateStats(); assertThat(info.allTasksById).hasSize(1); // only VFS_STAT task should be recorded ProfileInfo.Task task = info.allTasksById.get(0); assertThat(task.type).isEqualTo(ProfilerTask.VFS_STAT); } @Test public void testProfilerRecordsNothing() throws Exception { Path profileData = cacheDir.getRelative("foo"); profiler.start(ProfiledTaskKinds.NONE, profileData.getOutputStream(), "test", true, BlazeClock.instance(), BlazeClock.instance().nanoTime()); profiler.logSimpleTask(10000, 20000, ProfilerTask.VFS_STAT, "stat"); assertThat(ProfilerTask.VFS_STAT.collectsSlowestInstances()).isTrue(); assertThat(profiler.isProfiling(ProfilerTask.VFS_STAT)).isFalse(); profiler.stop(); ProfileInfo info = ProfileInfo.loadProfile(profileData); info.calculateStats(); assertThat(info.allTasksById).isEmpty(); } @Test public void testInconsistentCompleteTask() throws Exception { Path cacheFile = cacheDir.getRelative("profile2.dat"); profiler.start(ProfiledTaskKinds.ALL, cacheFile.getOutputStream(), "task stack inconsistency test", false, BlazeClock.instance(), BlazeClock.instance().nanoTime()); profiler.startTask(ProfilerTask.PHASE, "some task"); try { profiler.completeTask(ProfilerTask.ACTION); fail(); } catch (IllegalStateException e) { // this is expected } profiler.stop(); } @Test public void testConcurrentProfiling() throws Exception { Path cacheFile = cacheDir.getRelative("profile3.dat"); profiler.start(ProfiledTaskKinds.ALL, cacheFile.getOutputStream(), "concurrent test", false, BlazeClock.instance(), BlazeClock.instance().nanoTime()); long id = Thread.currentThread().getId(); Thread thread1 = new Thread() { @Override public void run() { for (int i = 0; i < 10000; i++) { Profiler.instance().logEvent(ProfilerTask.TEST, "thread1"); } } }; long id1 = thread1.getId(); Thread thread2 = new Thread() { @Override public void run() { for (int i = 0; i < 10000; i++) { Profiler.instance().logEvent(ProfilerTask.TEST, "thread2"); } } }; long id2 = thread2.getId(); profiler.startTask(ProfilerTask.PHASE, "main task"); profiler.logEvent(ProfilerTask.TEST, "starting threads"); thread1.start(); thread2.start(); thread2.join(); thread1.join(); profiler.logEvent(ProfilerTask.TEST, "joined"); profiler.completeTask(ProfilerTask.PHASE); profiler.stop(); ProfileInfo info = ProfileInfo.loadProfile(cacheFile); info.calculateStats(); info.analyzeRelationships(); assertThat(info.allTasksById).hasSize(4 + 10000 + 10000); // total number of tasks assertThat(info.tasksByThread).hasSize(3); // total number of threads // while main thread had 3 tasks, 2 of them were nested, so tasksByThread // would contain only one "main task" task assertThat(info.tasksByThread.get(id)).hasLength(2); ProfileInfo.Task mainTask = info.tasksByThread.get(id)[0]; assertThat(mainTask.getDescription()).isEqualTo("main task"); assertThat(mainTask.subtasks).hasLength(2); // other threads had 10000 independent recorded tasks each assertThat(info.tasksByThread.get(id1)).hasLength(10000); assertThat(info.tasksByThread.get(id2)).hasLength(10000); int startId = mainTask.subtasks[0].id; // id of "starting threads" int endId = mainTask.subtasks[1].id; // id of "joining" assertThat(startId).isLessThan(info.tasksByThread.get(id1)[0].id); assertThat(startId).isLessThan(info.tasksByThread.get(id2)[0].id); assertThat(endId).isGreaterThan(info.tasksByThread.get(id1)[9999].id); assertThat(endId).isGreaterThan(info.tasksByThread.get(id2)[9999].id); } @Test public void testPhaseTasks() throws Exception { Path cacheFile = cacheDir.getRelative("profile4.dat"); profiler.start(ProfiledTaskKinds.ALL, cacheFile.getOutputStream(), "phase test", false, BlazeClock.instance(), BlazeClock.instance().nanoTime()); Thread thread1 = new Thread() { @Override public void run() { for (int i = 0; i < 100; i++) { Profiler.instance().logEvent(ProfilerTask.TEST, "thread1"); } } }; profiler.markPhase(ProfilePhase.INIT); // Empty phase. profiler.markPhase(ProfilePhase.LOAD); thread1.start(); thread1.join(); clock.advanceMillis(1); profiler.markPhase(ProfilePhase.ANALYZE); Thread thread2 = new Thread() { @Override public void run() { profiler.startTask(ProfilerTask.TEST, "complex task"); for (int i = 0; i < 100; i++) { Profiler.instance().logEvent(ProfilerTask.TEST, "thread2a"); } profiler.completeTask(ProfilerTask.TEST); profiler.markPhase(ProfilePhase.EXECUTE); for (int i = 0; i < 100; i++) { Profiler.instance().logEvent(ProfilerTask.TEST, "thread2b"); } } }; thread2.start(); thread2.join(); profiler.logEvent(ProfilerTask.TEST, "last task"); clock.advanceMillis(1); profiler.stop(); ProfileInfo info = ProfileInfo.loadProfile(cacheFile); info.calculateStats(); info.analyzeRelationships(); // number of tasks: INIT(1) + LOAD(1) + Thread1.TEST(100) + ANALYZE(1) // + Thread2a.TEST(100) + TEST(1) + EXECUTE(1) + Thread2b.TEST(100) + TEST(1) + INFO(1) assertThat(info.allTasksById).hasSize(1 + 1 + 100 + 1 + 100 + 1 + 1 + 100 + 1 + 1); assertThat(info.tasksByThread).hasSize(3); // total number of threads // Phase0 contains only itself ProfileInfo.Task p0 = info.getPhaseTask(ProfilePhase.INIT); assertThat(info.getTasksForPhase(p0)).hasSize(1); // Phase1 contains itself and 100 TEST "thread1" tasks ProfileInfo.Task p1 = info.getPhaseTask(ProfilePhase.LOAD); assertThat(info.getTasksForPhase(p1)).hasSize(101); // Phase2 contains itself and 1 "complex task" ProfileInfo.Task p2 = info.getPhaseTask(ProfilePhase.ANALYZE); assertThat(info.getTasksForPhase(p2)).hasSize(2); // Phase3 contains itself, 100 TEST "thread2b" tasks and "last task" ProfileInfo.Task p3 = info.getPhaseTask(ProfilePhase.EXECUTE); assertThat(info.getTasksForPhase(p3)).hasSize(103); } @Test public void testCorruptedFile() throws Exception { Path cacheFile = cacheDir.getRelative("profile5.dat"); profiler.start(ProfiledTaskKinds.ALL, cacheFile.getOutputStream(), "phase test", false, BlazeClock.instance(), BlazeClock.instance().nanoTime()); for (int i = 0; i < 100; i++) { profiler.startTask(ProfilerTask.TEST, "outer task " + i); clock.advanceMillis(1); profiler.logEvent(ProfilerTask.TEST, "inner task " + i); profiler.completeTask(ProfilerTask.TEST); } profiler.stop(); ProfileInfo info = ProfileInfo.loadProfile(cacheFile); info.calculateStats(); assertThat(info.isCorruptedOrIncomplete()).isFalse(); Path corruptedFile = cacheDir.getRelative("profile5bad.dat"); FileSystemUtils.writeContent( corruptedFile, Arrays.copyOf(FileSystemUtils.readContent(cacheFile), 2000)); info = ProfileInfo.loadProfile(corruptedFile); info.calculateStats(); assertThat(info.isCorruptedOrIncomplete()).isTrue(); // Since root tasks will appear after nested tasks in the profile file and // we have exactly one nested task for each root task, the following will always // be true for our corrupted file: // 0 <= number_of_all_tasks - 2*number_of_root_tasks <= 1 assertThat(info.allTasksById.size() / 2).isEqualTo(info.rootTasksById.size()); } @Test public void testUnsupportedProfilerRecord() throws Exception { Path dataFile = cacheDir.getRelative("profile5.dat"); profiler.start(ProfiledTaskKinds.ALL, dataFile.getOutputStream(), "phase test", false, BlazeClock.instance(), BlazeClock.instance().nanoTime()); profiler.startTask(ProfilerTask.TEST, "outer task"); profiler.logEvent(ProfilerTask.EXCEPTION, "inner task"); profiler.completeTask(ProfilerTask.TEST); profiler.startTask(ProfilerTask.SCANNER, "outer task 2"); profiler.logSimpleTask(Profiler.nanoTimeMaybe(), ProfilerTask.TEST, "inner task 2"); profiler.completeTask(ProfilerTask.SCANNER); profiler.stop(); // Validate our test profile. ProfileInfo info = ProfileInfo.loadProfile(dataFile); info.calculateStats(); assertThat(info.isCorruptedOrIncomplete()).isFalse(); assertThat(info.getStatsForType(ProfilerTask.TEST, info.rootTasksById).count).isEqualTo(2); assertThat(info.getStatsForType(ProfilerTask.UNKNOWN, info.rootTasksById).count).isEqualTo(0); // Now replace "TEST" type with something unsupported - e.g. "XXXX". InputStream in = new InflaterInputStream(dataFile.getInputStream(), new Inflater(false), 65536); byte[] buffer = new byte[60000]; int len = in.read(buffer); in.close(); assertThat(len).isLessThan(buffer.length); // Validate that file was completely decoded. String content = new String(buffer, ISO_8859_1); int infoIndex = content.indexOf("TEST"); assertThat(infoIndex).isGreaterThan(0); content = content.substring(0, infoIndex) + "XXXX" + content.substring(infoIndex + 4); OutputStream out = new DeflaterOutputStream(dataFile.getOutputStream(), new Deflater(Deflater.BEST_SPEED, false), 65536); out.write(content.getBytes(ISO_8859_1)); out.close(); // Validate that XXXX records were classified as UNKNOWN. info = ProfileInfo.loadProfile(dataFile); info.calculateStats(); assertThat(info.isCorruptedOrIncomplete()).isFalse(); assertThat(info.getStatsForType(ProfilerTask.TEST, info.rootTasksById).count).isEqualTo(0); assertThat(info.getStatsForType(ProfilerTask.SCANNER, info.rootTasksById).count).isEqualTo(1); assertThat(info.getStatsForType(ProfilerTask.EXCEPTION, info.rootTasksById).count).isEqualTo(1); assertThat(info.getStatsForType(ProfilerTask.UNKNOWN, info.rootTasksById).count).isEqualTo(2); } @Test public void testResilenceToNonDecreasingNanoTimes() throws Exception { final long initialNanoTime = BlazeClock.instance().nanoTime(); final AtomicInteger numNanoTimeCalls = new AtomicInteger(0); Clock badClock = new Clock() { @Override public long currentTimeMillis() { return BlazeClock.instance().currentTimeMillis(); } @Override public long nanoTime() { return initialNanoTime - numNanoTimeCalls.addAndGet(1); } }; Path cacheFile = cacheDir.getRelative("profile1.dat"); profiler.start(ProfiledTaskKinds.ALL, cacheFile.getOutputStream(), "testResilenceToNonDecreasingNanoTimes", false, badClock, initialNanoTime); profiler.logSimpleTask(badClock.nanoTime(), ProfilerTask.TEST, "some task"); profiler.stop(); } }
damienmg/bazel
src/test/java/com/google/devtools/build/lib/profiler/ProfilerTest.java
Java
apache-2.0
19,092
[ 30522, 1013, 1013, 9385, 2325, 1996, 8670, 12638, 6048, 1012, 2035, 2916, 9235, 1012, 1013, 1013, 1013, 1013, 7000, 2104, 1996, 15895, 6105, 1010, 2544, 1016, 1012, 1014, 1006, 1996, 1000, 6105, 1000, 1007, 1025, 1013, 1013, 2017, 2089, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/** * Copyright 2014 Daniel Furtlehner * * 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. */ describe('Conditionalgroup Provider', function() { var crossfilterUtils, groupData = { type: 'conditional', parameters: { init: { a: 0, b: 0, c: 0, d: 0 }, conditions: { isA: 'v.type === "A"', isB: 'v.type === "B"', isC: 'v.type === "C"' }, handlers: { add: { isA: { 'p.a': 'p.a + v.val' }, isB: { 'p.b': 'p.b + v.val' }, isC: { 'p.c': 'p.c + v.val', 'p.d': 'p.d + 1' } }, remove: { isA: { 'p.a': 'p.a - v.val' }, isB: { 'p.b': 'p.b - v.val' }, isC: { 'p.c': 'p.c - v.val', 'p.d': 'p.d - 1' } } } } }; var preGroupData = { type: 'conditional', parameters: { conditions: { aCheck: 'v.type === "C"' }, handlers: { add: { pre: { 'p.c': 'p.c * v.val' }, aCheck: { 'p.c': 'p.c + v.val' } }, remove: { pre: { 'p.c': 'p.c - v.val' }, aCheck: { 'p.c': 'p.c / v.val' } } } } }; var postGroupData = { type: 'conditional', parameters: { conditions: { aCheck: 'v.type === "C"' }, handlers: { add: { aCheck: { 'p.c': 'p.c + v.val' }, post: { 'p.c': 'p.c * v.val' } }, remove: { aCheck: { 'p.c': 'p.c / v.val' }, post: { 'p.c': 'p.c - v.val' } } } } }; beforeEach(function() { module('ngDashboard'); inject(function(_crossfilterUtils_) { crossfilterUtils = _crossfilterUtils_; }); }); it('Init function defined', function() { var groupFunctions = crossfilterUtils.groupFunctions(groupData); expect(groupFunctions.init).toBeDefined(); }); it('Add function defined', function() { var groupFunctions = crossfilterUtils.groupFunctions(groupData); expect(groupFunctions.add).toBeDefined(); }); it('Remove function defined', function() { var groupFunctions = crossfilterUtils.groupFunctions(groupData); expect(groupFunctions.remove).toBeDefined(); }); it('Init should return object', function() { var groupFunctions = crossfilterUtils.groupFunctions(groupData); expect(groupFunctions.init()).toEqual({ a: 0, b: 0, c: 0, d: 0 }); }); it('Add a should increment a', function() { var groupFunctions = crossfilterUtils.groupFunctions(groupData); var p = { a: 1, b: 10, c: 5, d: 0 }; var v = { val: 10, type: 'A' }; expect(groupFunctions.add(p, v)).toEqual({ a: 11, b: 10, c: 5, d: 0 }); }); it('Add b should increment b', function() { var groupFunctions = crossfilterUtils.groupFunctions(groupData); var p = { a: 1, b: 10, c: 5, d: 0 }; var v = { val: 5, type: 'B' }; expect(groupFunctions.add(p, v)).toEqual({ a: 1, b: 15, c: 5, d: 0 }); }); it('Add c should increment c and d', function() { var groupFunctions = crossfilterUtils.groupFunctions(groupData); var p = { a: 1, b: 10, c: 5, d: 0 }; var v = { val: 1, type: 'C' }; expect(groupFunctions.add(p, v)).toEqual({ a: 1, b: 10, c: 6, d: 1 }); }); it('Remove a should decrement a', function() { var groupFunctions = crossfilterUtils.groupFunctions(groupData); var p = { a: 5, b: 10, c: 5, d: 0 }; var v = { val: 3, type: 'A' }; expect(groupFunctions.remove(p, v)).toEqual({ a: 2, b: 10, c: 5, d: 0 }); }); it('Remove b should decrement b', function() { var groupFunctions = crossfilterUtils.groupFunctions(groupData); var p = { a: 1, b: 10, c: 5, d: 0 }; var v = { val: 5, type: 'B' }; expect(groupFunctions.remove(p, v)).toEqual({ a: 1, b: 5, c: 5, d: 0 }); }); it('Remove c should decrement c and d', function() { var groupFunctions = crossfilterUtils.groupFunctions(groupData); var p = { a: 1, b: 10, c: 5, d: 5 }; var v = { val: 1, type: 'C' }; expect(groupFunctions.remove(p, v)).toEqual({ a: 1, b: 10, c: 4, d: 4 }); }); it('Pre handlers should be called before others when adding', function() { var groupFunctions = crossfilterUtils.groupFunctions(preGroupData); var p = { a: 1, b: 10, c: 6, d: 5 }; var v = { val: 2, type: 'C' }; expect(groupFunctions.add(p, v)).toEqual({ a: 1, b: 10, c: 14, d: 5 }); }); it('Pre handlers should be called before others when removing', function() { var groupFunctions = crossfilterUtils.groupFunctions(preGroupData); var p = { a: 1, b: 10, c: 14, d: 5 }; var v = { val: 2, type: 'C' }; expect(groupFunctions.remove(p, v)).toEqual({ a: 1, b: 10, c: 6, d: 5 }); }); it('post handlers should be called after others when adding', function() { var groupFunctions = crossfilterUtils.groupFunctions(postGroupData); var p = { a: 1, b: 10, c: 5, d: 5 }; var v = { val: 3, type: 'C' }; expect(groupFunctions.add(p, v)).toEqual({ a: 1, b: 10, c: 24, d: 5 }); }); it('post handlers should be called after others when removing', function() { var groupFunctions = crossfilterUtils.groupFunctions(postGroupData); var p = { a: 1, b: 10, c: 24, d: 5 }; var v = { val: 3, type: 'C' }; expect(groupFunctions.remove(p, v)).toEqual({ a: 1, b: 10, c: 5, d: 5 }); }); });
furti/ng-dashboard
specs/conditionalGroupProvider.spec.js
JavaScript
apache-2.0
8,929
[ 30522, 1013, 1008, 1008, 1008, 9385, 2297, 30524, 1996, 6105, 2012, 1008, 1008, 8299, 1024, 1013, 1013, 7479, 1012, 15895, 1012, 8917, 1013, 15943, 1013, 6105, 1011, 1016, 1012, 1014, 1008, 1008, 4983, 3223, 2011, 12711, 2375, 2030, 3530, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include <aws/mediaconvert/model/DashIsoGroupSettings.h> #include <aws/core/utils/json/JsonSerializer.h> #include <utility> using namespace Aws::Utils::Json; using namespace Aws::Utils; namespace Aws { namespace MediaConvert { namespace Model { DashIsoGroupSettings::DashIsoGroupSettings() : m_additionalManifestsHasBeenSet(false), m_audioChannelConfigSchemeIdUri(DashIsoGroupAudioChannelConfigSchemeIdUri::NOT_SET), m_audioChannelConfigSchemeIdUriHasBeenSet(false), m_baseUrlHasBeenSet(false), m_destinationHasBeenSet(false), m_destinationSettingsHasBeenSet(false), m_encryptionHasBeenSet(false), m_fragmentLength(0), m_fragmentLengthHasBeenSet(false), m_hbbtvCompliance(DashIsoHbbtvCompliance::NOT_SET), m_hbbtvComplianceHasBeenSet(false), m_imageBasedTrickPlay(DashIsoImageBasedTrickPlay::NOT_SET), m_imageBasedTrickPlayHasBeenSet(false), m_imageBasedTrickPlaySettingsHasBeenSet(false), m_minBufferTime(0), m_minBufferTimeHasBeenSet(false), m_minFinalSegmentLength(0.0), m_minFinalSegmentLengthHasBeenSet(false), m_mpdProfile(DashIsoMpdProfile::NOT_SET), m_mpdProfileHasBeenSet(false), m_ptsOffsetHandlingForBFrames(DashIsoPtsOffsetHandlingForBFrames::NOT_SET), m_ptsOffsetHandlingForBFramesHasBeenSet(false), m_segmentControl(DashIsoSegmentControl::NOT_SET), m_segmentControlHasBeenSet(false), m_segmentLength(0), m_segmentLengthHasBeenSet(false), m_segmentLengthControl(DashIsoSegmentLengthControl::NOT_SET), m_segmentLengthControlHasBeenSet(false), m_writeSegmentTimelineInRepresentation(DashIsoWriteSegmentTimelineInRepresentation::NOT_SET), m_writeSegmentTimelineInRepresentationHasBeenSet(false) { } DashIsoGroupSettings::DashIsoGroupSettings(JsonView jsonValue) : m_additionalManifestsHasBeenSet(false), m_audioChannelConfigSchemeIdUri(DashIsoGroupAudioChannelConfigSchemeIdUri::NOT_SET), m_audioChannelConfigSchemeIdUriHasBeenSet(false), m_baseUrlHasBeenSet(false), m_destinationHasBeenSet(false), m_destinationSettingsHasBeenSet(false), m_encryptionHasBeenSet(false), m_fragmentLength(0), m_fragmentLengthHasBeenSet(false), m_hbbtvCompliance(DashIsoHbbtvCompliance::NOT_SET), m_hbbtvComplianceHasBeenSet(false), m_imageBasedTrickPlay(DashIsoImageBasedTrickPlay::NOT_SET), m_imageBasedTrickPlayHasBeenSet(false), m_imageBasedTrickPlaySettingsHasBeenSet(false), m_minBufferTime(0), m_minBufferTimeHasBeenSet(false), m_minFinalSegmentLength(0.0), m_minFinalSegmentLengthHasBeenSet(false), m_mpdProfile(DashIsoMpdProfile::NOT_SET), m_mpdProfileHasBeenSet(false), m_ptsOffsetHandlingForBFrames(DashIsoPtsOffsetHandlingForBFrames::NOT_SET), m_ptsOffsetHandlingForBFramesHasBeenSet(false), m_segmentControl(DashIsoSegmentControl::NOT_SET), m_segmentControlHasBeenSet(false), m_segmentLength(0), m_segmentLengthHasBeenSet(false), m_segmentLengthControl(DashIsoSegmentLengthControl::NOT_SET), m_segmentLengthControlHasBeenSet(false), m_writeSegmentTimelineInRepresentation(DashIsoWriteSegmentTimelineInRepresentation::NOT_SET), m_writeSegmentTimelineInRepresentationHasBeenSet(false) { *this = jsonValue; } DashIsoGroupSettings& DashIsoGroupSettings::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("additionalManifests")) { Array<JsonView> additionalManifestsJsonList = jsonValue.GetArray("additionalManifests"); for(unsigned additionalManifestsIndex = 0; additionalManifestsIndex < additionalManifestsJsonList.GetLength(); ++additionalManifestsIndex) { m_additionalManifests.push_back(additionalManifestsJsonList[additionalManifestsIndex].AsObject()); } m_additionalManifestsHasBeenSet = true; } if(jsonValue.ValueExists("audioChannelConfigSchemeIdUri")) { m_audioChannelConfigSchemeIdUri = DashIsoGroupAudioChannelConfigSchemeIdUriMapper::GetDashIsoGroupAudioChannelConfigSchemeIdUriForName(jsonValue.GetString("audioChannelConfigSchemeIdUri")); m_audioChannelConfigSchemeIdUriHasBeenSet = true; } if(jsonValue.ValueExists("baseUrl")) { m_baseUrl = jsonValue.GetString("baseUrl"); m_baseUrlHasBeenSet = true; } if(jsonValue.ValueExists("destination")) { m_destination = jsonValue.GetString("destination"); m_destinationHasBeenSet = true; } if(jsonValue.ValueExists("destinationSettings")) { m_destinationSettings = jsonValue.GetObject("destinationSettings"); m_destinationSettingsHasBeenSet = true; } if(jsonValue.ValueExists("encryption")) { m_encryption = jsonValue.GetObject("encryption"); m_encryptionHasBeenSet = true; } if(jsonValue.ValueExists("fragmentLength")) { m_fragmentLength = jsonValue.GetInteger("fragmentLength"); m_fragmentLengthHasBeenSet = true; } if(jsonValue.ValueExists("hbbtvCompliance")) { m_hbbtvCompliance = DashIsoHbbtvComplianceMapper::GetDashIsoHbbtvComplianceForName(jsonValue.GetString("hbbtvCompliance")); m_hbbtvComplianceHasBeenSet = true; } if(jsonValue.ValueExists("imageBasedTrickPlay")) { m_imageBasedTrickPlay = DashIsoImageBasedTrickPlayMapper::GetDashIsoImageBasedTrickPlayForName(jsonValue.GetString("imageBasedTrickPlay")); m_imageBasedTrickPlayHasBeenSet = true; } if(jsonValue.ValueExists("imageBasedTrickPlaySettings")) { m_imageBasedTrickPlaySettings = jsonValue.GetObject("imageBasedTrickPlaySettings"); m_imageBasedTrickPlaySettingsHasBeenSet = true; } if(jsonValue.ValueExists("minBufferTime")) { m_minBufferTime = jsonValue.GetInteger("minBufferTime"); m_minBufferTimeHasBeenSet = true; } if(jsonValue.ValueExists("minFinalSegmentLength")) { m_minFinalSegmentLength = jsonValue.GetDouble("minFinalSegmentLength"); m_minFinalSegmentLengthHasBeenSet = true; } if(jsonValue.ValueExists("mpdProfile")) { m_mpdProfile = DashIsoMpdProfileMapper::GetDashIsoMpdProfileForName(jsonValue.GetString("mpdProfile")); m_mpdProfileHasBeenSet = true; } if(jsonValue.ValueExists("ptsOffsetHandlingForBFrames")) { m_ptsOffsetHandlingForBFrames = DashIsoPtsOffsetHandlingForBFramesMapper::GetDashIsoPtsOffsetHandlingForBFramesForName(jsonValue.GetString("ptsOffsetHandlingForBFrames")); m_ptsOffsetHandlingForBFramesHasBeenSet = true; } if(jsonValue.ValueExists("segmentControl")) { m_segmentControl = DashIsoSegmentControlMapper::GetDashIsoSegmentControlForName(jsonValue.GetString("segmentControl")); m_segmentControlHasBeenSet = true; } if(jsonValue.ValueExists("segmentLength")) { m_segmentLength = jsonValue.GetInteger("segmentLength"); m_segmentLengthHasBeenSet = true; } if(jsonValue.ValueExists("segmentLengthControl")) { m_segmentLengthControl = DashIsoSegmentLengthControlMapper::GetDashIsoSegmentLengthControlForName(jsonValue.GetString("segmentLengthControl")); m_segmentLengthControlHasBeenSet = true; } if(jsonValue.ValueExists("writeSegmentTimelineInRepresentation")) { m_writeSegmentTimelineInRepresentation = DashIsoWriteSegmentTimelineInRepresentationMapper::GetDashIsoWriteSegmentTimelineInRepresentationForName(jsonValue.GetString("writeSegmentTimelineInRepresentation")); m_writeSegmentTimelineInRepresentationHasBeenSet = true; } return *this; } JsonValue DashIsoGroupSettings::Jsonize() const { JsonValue payload; if(m_additionalManifestsHasBeenSet) { Array<JsonValue> additionalManifestsJsonList(m_additionalManifests.size()); for(unsigned additionalManifestsIndex = 0; additionalManifestsIndex < additionalManifestsJsonList.GetLength(); ++additionalManifestsIndex) { additionalManifestsJsonList[additionalManifestsIndex].AsObject(m_additionalManifests[additionalManifestsIndex].Jsonize()); } payload.WithArray("additionalManifests", std::move(additionalManifestsJsonList)); } if(m_audioChannelConfigSchemeIdUriHasBeenSet) { payload.WithString("audioChannelConfigSchemeIdUri", DashIsoGroupAudioChannelConfigSchemeIdUriMapper::GetNameForDashIsoGroupAudioChannelConfigSchemeIdUri(m_audioChannelConfigSchemeIdUri)); } if(m_baseUrlHasBeenSet) { payload.WithString("baseUrl", m_baseUrl); } if(m_destinationHasBeenSet) { payload.WithString("destination", m_destination); } if(m_destinationSettingsHasBeenSet) { payload.WithObject("destinationSettings", m_destinationSettings.Jsonize()); } if(m_encryptionHasBeenSet) { payload.WithObject("encryption", m_encryption.Jsonize()); } if(m_fragmentLengthHasBeenSet) { payload.WithInteger("fragmentLength", m_fragmentLength); } if(m_hbbtvComplianceHasBeenSet) { payload.WithString("hbbtvCompliance", DashIsoHbbtvComplianceMapper::GetNameForDashIsoHbbtvCompliance(m_hbbtvCompliance)); } if(m_imageBasedTrickPlayHasBeenSet) { payload.WithString("imageBasedTrickPlay", DashIsoImageBasedTrickPlayMapper::GetNameForDashIsoImageBasedTrickPlay(m_imageBasedTrickPlay)); } if(m_imageBasedTrickPlaySettingsHasBeenSet) { payload.WithObject("imageBasedTrickPlaySettings", m_imageBasedTrickPlaySettings.Jsonize()); } if(m_minBufferTimeHasBeenSet) { payload.WithInteger("minBufferTime", m_minBufferTime); } if(m_minFinalSegmentLengthHasBeenSet) { payload.WithDouble("minFinalSegmentLength", m_minFinalSegmentLength); } if(m_mpdProfileHasBeenSet) { payload.WithString("mpdProfile", DashIsoMpdProfileMapper::GetNameForDashIsoMpdProfile(m_mpdProfile)); } if(m_ptsOffsetHandlingForBFramesHasBeenSet) { payload.WithString("ptsOffsetHandlingForBFrames", DashIsoPtsOffsetHandlingForBFramesMapper::GetNameForDashIsoPtsOffsetHandlingForBFrames(m_ptsOffsetHandlingForBFrames)); } if(m_segmentControlHasBeenSet) { payload.WithString("segmentControl", DashIsoSegmentControlMapper::GetNameForDashIsoSegmentControl(m_segmentControl)); } if(m_segmentLengthHasBeenSet) { payload.WithInteger("segmentLength", m_segmentLength); } if(m_segmentLengthControlHasBeenSet) { payload.WithString("segmentLengthControl", DashIsoSegmentLengthControlMapper::GetNameForDashIsoSegmentLengthControl(m_segmentLengthControl)); } if(m_writeSegmentTimelineInRepresentationHasBeenSet) { payload.WithString("writeSegmentTimelineInRepresentation", DashIsoWriteSegmentTimelineInRepresentationMapper::GetNameForDashIsoWriteSegmentTimelineInRepresentation(m_writeSegmentTimelineInRepresentation)); } return payload; } } // namespace Model } // namespace MediaConvert } // namespace Aws
aws/aws-sdk-cpp
aws-cpp-sdk-mediaconvert/source/model/DashIsoGroupSettings.cpp
C++
apache-2.0
10,732
[ 30522, 1013, 1008, 1008, 1008, 9385, 9733, 1012, 4012, 1010, 4297, 1012, 2030, 2049, 18460, 1012, 2035, 2916, 9235, 1012, 1008, 23772, 2595, 1011, 6105, 1011, 8909, 4765, 18095, 1024, 15895, 1011, 1016, 1012, 1014, 1012, 1008, 1013, 1001, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
class ApplicationJob < ActiveJob::Base include Job::SS::Core end
hotmix/shirasagi
app/jobs/application_job.rb
Ruby
mit
67
[ 30522, 2465, 4646, 5558, 2497, 1026, 3161, 5558, 2497, 1024, 1024, 2918, 2421, 3105, 1024, 1024, 7020, 1024, 1024, 4563, 2203, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
using System.Collections.Generic; using System.Threading.Tasks; using MongoDB.Bson; using MongoDB.Driver; using ShowFinder.Models; namespace ShowFinder.Repositories.Interfaces { public interface IMongoRepository { IMongoDatabase Database(string name); Task<BsonDocument> GetUserProfile(IMongoCollection<BsonDocument> userProfilesCollection, string hash); Task<bool> UpdateShows(IMongoCollection<BsonDocument> userProfilesCollection, string userHash, IEnumerable<string> showList); Task<bool> UpdateDownloadedEpisode(IMongoCollection<BsonDocument> userProfilesCollection, string profileId, string episodeId, string filteredShowName, DownloadedEpisode downloadedEpisodeData); Task<bool> DeleteDownloadedEpisode(IMongoCollection<BsonDocument> userProfilesCollection, string profileId, string episodeId, string filtereShowdName); Task<bool> UpdateTimeSpan(IMongoCollection<BsonDocument> userProfilesCollection, UserProfile profile); Task<BsonDocument> GetFromCache(IMongoCollection<BsonDocument> collection, string id); Task<bool> SetToCache(IMongoCollection<BsonDocument> collection, string id, BsonDocument doc, int daysToExpire); } }
YanivHaramati/ShowFinder
ShowFinder/Repositories/Interfaces/IMongoRepository.cs
C#
mit
1,257
[ 30522, 2478, 2291, 1012, 6407, 1012, 12391, 1025, 2478, 2291, 1012, 11689, 2075, 1012, 8518, 1025, 2478, 12256, 3995, 18939, 1012, 18667, 2239, 1025, 2478, 12256, 3995, 18939, 1012, 4062, 1025, 2478, 2265, 23695, 1012, 4275, 1025, 3415, 153...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
$(function() { function FirmwareUpdaterViewModel(parameters) { var self = this; self.settingsViewModel = parameters[0]; self.loginState = parameters[1]; self.connection = parameters[2]; self.printerState = parameters[3]; self.configPathAvrdude = ko.observable(); self.hexFileName = ko.observable(undefined); self.hexFileURL = ko.observable(undefined); self.alertMessage = ko.observable(""); self.alertType = ko.observable("alert-warning"); self.showAlert = ko.observable(false); self.missingParamToFlash = ko.observable(false); self.progressBarText = ko.observable(); self.isBusy = ko.observable(false); self.updateAvailable = ko.observable(false); self.pathBroken = ko.observable(false); self.pathOk = ko.observable(false); self.pathText = ko.observable(); self.pathHelpVisible = ko.computed(function() { return self.pathBroken() || self.pathOk(); }); self.inSettingsDialog = false; self.selectHexPath = $("#settings_firmwareupdater_selectHexPath"); self.configurationDialog = $("#settings_plugin_firmwareupdater_configurationdialog"); self.selectHexPath.fileupload({ dataType: "hex", maxNumberOfFiles: 1, autoUpload: false, add: function(e, data) { if (data.files.length == 0) { return false; } self.hexData = data; self.hexFileName(data.files[0].name); } }) self.startFlashFromFile = function() { if (!self.loginState.isAdmin()){ self.alertType("alert-warning") self.alertMessage(gettext("Administrator privileges are needed to flash firmware.")); self.showAlert(true); return false; } if (self.printerState.isPrinting() || self.printerState.isPaused()){ self.alertType("alert-warning") self.alertMessage(gettext("Printer is printing. Please wait for the print to be finished.")); self.showAlert(true); return false; } if (!self.settingsViewModel.settings.plugins.firmwareupdater.avrdude_path()) { self.alertType("alert-warning") self.alertMessage(gettext("AVRDUDE path not configured")); self.showAlert(true); return false; } if (!self.hexFileName()) { self.alertType("alert-warning") self.alertMessage(gettext("Hex file path not specified")); self.showAlert(true); return false; } if (!self.connection.selectedPort()) { self.alertType("alert-warning") self.alertMessage(gettext("Port not selected")); self.showAlert(true); return false; } self.progressBarText("Flashing firmware..."); self.isBusy(true); self.showAlert(false); var form = { selected_port: self.connection.selectedPort() }; self.hexData.formData = form; self.hexData.submit(); } self.startFlashFromURL = function() { if (!self.loginState.isAdmin()){ self.alertType("alert-warning") self.alertMessage(gettext("Administrator privileges are needed to flash firmware.")); self.showAlert(true); return false; } if (self.printerState.isPrinting() || self.printerState.isPaused()){ self.alertType("alert-warning") self.alertMessage(gettext("Printer is printing. Please wait for the print to be finished.")); self.showAlert(true); return false; } if (!self.settingsViewModel.settings.plugins.firmwareupdater.avrdude_path()) { self.alertType("alert-warning") self.alertMessage(gettext("AVRDUDE path not configured")); self.showAlert(true); return false; } if (!self.hexFileURL()) { self.alertType("alert-warning") self.alertMessage(gettext("Hex file URL not specified")); self.showAlert(true); return false; } if (!self.connection.selectedPort()) { self.alertType("alert-warning") self.alertMessage(gettext("Port not selected")); self.showAlert(true); return false; } self.isBusy(true); self.showAlert(false); self.progressBarText("Flashing firmware..."); $.ajax({ url: PLUGIN_BASEURL + "firmwareupdater/flashFirmwareWithURL", type: "POST", dataType: "json", data: JSON.stringify({ selected_port: self.connection.selectedPort(), hex_url: self.hexFileURL() }), contentType: "application/json; charset=UTF-8" }) } self.checkForUpdates = function() { if (self.printerState.isPrinting() || self.printerState.isPaused()){ self.alertType("alert-warning") self.alertMessage(gettext("Printer is printing. Please wait for the print to be finished.")); self.showAlert(true); return false; } if (!self.connection.selectedPort()) { self.alertType("alert-warning") self.alertMessage(gettext("Port not selected")); self.showAlert(true); return false; } self.isBusy(true); self.showAlert(false); $.ajax({ url: PLUGIN_BASEURL + "firmwareupdater/checkForUpdates", type: "POST", dataType: "json", data: JSON.stringify({ selected_port: self.connection.selectedPort(), }), contentType: "application/json; charset=UTF-8" }); } self.flashUpdate = function() { if (self.printerState.isPrinting() || self.printerState.isPaused()){ self.alertType("alert-warning") self.alertMessage(gettext("Printer is printing. Please wait for the print to be finished.")); self.showAlert(true); return false; } if (!self.settingsViewModel.settings.plugins.firmwareupdater.avrdude_path()) { self.alertType("alert-warning") self.alertMessage(gettext("AVRDUDE path not configured")); self.showAlert(true); return false; } if (!self.connection.selectedPort()) { self.alertType("alert-warning") self.alertMessage(gettext("Port not selected")); self.showAlert(true); return false; } self.isBusy(true); self.showAlert(false); self.progressBarText("Flashing firmware..."); console.log(AJAX_BASEURL + "system"); $.ajax({ url: PLUGIN_BASEURL + "firmwareupdater/flashUpdate", type: "POST", dataType: "json", data: JSON.stringify({ selected_port: self.connection.selectedPort() }), contentType: "application/json; charset=UTF-8" }); } self.onDataUpdaterPluginMessage = function(plugin, data) { if (plugin != "firmwareupdater") { return; } if (data.type == "status" && data.status_type == "check_update_status") { if (data.status_value == "progress") { self.progressBarText(data.status_description); return; } if (data.status_value == "update_available") { if (!self.inSettingsDialog) { self.showUpdateAvailablePopup(data.status_description); } self.updateAvailable(true); self.isBusy(false); return; } if (data.status_value == "up_to_date") { self.updateAvailable(false); self.isBusy(false); self.showAlert(false); if (self.inSettingsDialog) { self.alertType("alert-success"); self.alertMessage(data.status_description); self.showAlert(true); } return; } if (data.status_value == "error") { self.updateAvailable(false); self.isBusy(false); self.alertType("alert-danger"); self.alertMessage(data.status_description); self.showAlert(true); return; } } if (data.type == "status" && data.status_type == "flashing_status") { if (data.status_value == "starting_flash") { self.isBusy(true); } else if (data.status_value == "progress") { self.progressBarText(data.status_description); } else if (data.status_value == "info") { self.alertType("alert-info"); self.alertMessage(data.status_description); self.showAlert(true); } else if (data.status_value == "successful") { self.showPopup("success", "Flashing Successful", ""); self.isBusy(false); self.showAlert(false); self.hexFileName(undefined); self.hexFileURL(undefined); } else if (data.status_value == "error") { self.showPopup("error", "Flashing Failed", data.status_description); self.isBusy(false); self.showAlert(false); } } } self.showPluginConfig = function() { self.configPathAvrdude(self.settingsViewModel.settings.plugins.firmwareupdater.avrdude_path()); self.configurationDialog.modal(); } self.onConfigClose = function() { self._saveAvrdudePath(); self.configurationDialog.modal("hide"); self.onConfigHidden(); if (self.configPathAvrdude()) { self.showAlert(false); } } self._saveAvrdudePath = function() { var data = { plugins: { firmwareupdater: { avrdude_path: self.configPathAvrdude(), } } } self.settingsViewModel.saveData(data); } self.onConfigHidden = function() { self.pathBroken(false); self.pathOk(false); self.pathText(""); } self.testAvrdudePath = function() { $.ajax({ url: API_BASEURL + "util/test", type: "POST", dataType: "json", data: JSON.stringify({ command: "path", path: self.configPathAvrdude(), check_type: "file", check_access: "x" }), contentType: "application/json; charset=UTF-8", success: function(response) { if (!response.result) { if (!response.exists) { self.pathText(gettext("The path doesn't exist")); } else if (!response.typeok) { self.pathText(gettext("The path is not a file")); } else if (!response.access) { self.pathText(gettext("The path is not an executable")); } } else { self.pathText(gettext("The path is valid")); } self.pathOk(response.result); self.pathBroken(!response.result); } }) } self.isReadyToFlashFromFile = function() { if (self.printerState.isPrinting() || self.printerState.isPaused()){ return false; } if (!self.settingsViewModel.settings.plugins.firmwareupdater.avrdude_path()) { return false; } if (!self.connection.selectedPort()) { return false; } if (!self.hexFileName()) { return false; } self.showAlert(false); return true; } self.isReadyToFlashFromURL = function() { if (self.printerState.isPrinting() || self.printerState.isPaused()){ return false; } if (!self.settingsViewModel.settings.plugins.firmwareupdater.avrdude_path()) { return false; } if (!self.connection.selectedPort()) { return false; } if (!self.hexFileURL()) { return false; } self.showAlert(false); return true; } self.isReadyToCheck = function() { if (self.printerState.isPrinting() || self.printerState.isPaused()){ return false; } if (!self.connection.selectedPort()) { return false; } return true; } self.isReadyToUpdate = function() { if (self.printerState.isPrinting() || self.printerState.isPaused()){ return false; } if (!self.settingsViewModel.settings.plugins.firmwareupdater.avrdude_path()) { return false; } if (!self.connection.selectedPort() || self.connection.selectedPort() == "AUTO") { return false; } return true; } self.onSettingsShown = function() { self.inSettingsDialog = true; } self.onSettingsHidden = function() { self.inSettingsDialog = false; self.showAlert(false); } // Popup Messages self.showUpdateAvailablePopup = function(new_fw_version) { self.updateAvailablePopup = new PNotify({ title: gettext('Firmware Update Available'), text: gettext('Version ') + new_fw_version, icon: true, hide: false, type: 'success', buttons: { closer: true, sticker: false, }, history: { history: false } }); }; self.showPopup = function(message_type, title, text){ if (self.popup !== undefined){ self.closePopup(); } self.popup = new PNotify({ title: gettext(title), text: text, type: message_type, hide: false }); } self.closePopup = function() { if (self.popup !== undefined) { self.popup.remove(); } }; } OCTOPRINT_VIEWMODELS.push([ FirmwareUpdaterViewModel, ["settingsViewModel", "loginStateViewModel", "connectionViewModel", "printerStateViewModel"], [document.getElementById("settings_plugin_firmwareupdater")] ]); });
mcecchi/SuperOcto
OctoPrint-FirmwareUpdater/octoprint_firmwareupdater/static/js/firmwareupdater.js
JavaScript
agpl-3.0
16,233
[ 30522, 1002, 1006, 3853, 1006, 1007, 1063, 3853, 3813, 8059, 6279, 13701, 2099, 8584, 5302, 9247, 1006, 11709, 1007, 1063, 13075, 2969, 1027, 2023, 1025, 2969, 1012, 10906, 8584, 5302, 9247, 1027, 11709, 1031, 1014, 1033, 1025, 2969, 1012, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
--- layout: post title: A (brief) retrospective on transactional memory date: 2010-01-03 11:05:12.000000000 -08:00 categories: - Technology tags: [] status: publish type: post published: true meta: _wpas_done_all: '1' author: login: admin email: joeduffy@acm.org display_name: joeduffy first_name: '' last_name: '' --- Rewind the clock to mid-2004. Around this time awareness about the looming "concurrency sea change" was rapidly growing industry-wide, and indeed within Microsoft an increasing number of people -- myself included -- began to focus on how the .NET Framework, CLR, and Visual C++ environments could better accommodate first class concurrent programming. Of course, our colleagues in MSR and researchers in the industry more generally had many years' head start on us, in some cases dating back 3+decades. It is safe to say that there was no shortage of prior art to understand and learn from. One piece of prior art was particularly influential on our thoughts: software transactional memory. (STM, or, in short just TM.) In fact, right around that time, Tim Harris's TM work grew in notoriety (my first exposure arriving by way of OOPSLA'03's proceedings, which contained [the "Language Support for Lightweight Transactions" paper](http://research.microsoft.com/en-us/um/people/tharris/papers/2003-oopsla.pdf)). TM was immediately fascinating, and simultaneously promising. For a number of reasons: - TM hid sophisticated synchronization mechanisms under a simple veil. - It could be implemented using sophisticated (and scalable) techniques, again under a simple veil. - It built on decades of experience in building scalable and parallel transactional databases. - Among others. But most of all, it was a bright shiny light in a sea of complexity. - And how fortunate: Tim was a colleague in our neighboring MSR Cambridge offices (and still is). In a nutshell, TM offered declarative concurrency-safety. You declare what you'd like in as few simple words as possible, and you get what you want. In this case, those simple words are 'atomic { S; }'. Many people latched onto TM rapidly and simultaneously, both inside and outside of Microsoft. I hacked together a little prototype built atop SSCLI ("Rotor"), and another architect on our team built an even more feature-rich prototype using MSIL rewriting. We compared notes, began jointly exploring the design space, and talking more regularly with other colleagues like Tim in MSR. Soon thereafter we kicked off a small working group with about a dozen architects and researchers from around the company, aiming to articulate what a real productized TM might look like. Fun times. We were eventually given the OK for an official "incubation" project, and multiple years' of exploration and hard work ensued. In fact, the fruits of a team of many's labor recently got released in the form of [a Community Technology Preview](http://msdn.microsoft.com/en-us/devlabs/ee334183.aspx) -- a good conduit for experimentation, but with no commitment to add it to any of Microsoft's products. To be clear, I had only a small part to play in this ambitious project, and mostly towards the start. Partway through, I stepped away to do [PLINQ and Parallel Extensions to .NET](http://msdn.microsoft.com/concurrency/), both of which are now part of the .NET Framework 4.0. Dozens of amazing people played a significant role in the project over the years. But I am getting way ahead of myself… I've been away from the nitty-gritty day-to-day details of TM for about 3 years now, which feels sufficiently long to develop a healthy perspective on the project. So here it is. What follows is of course in no way Microsoft's "official position" on the technology, but rather my own personal one. I've interspersed generalizations with specific details because that's just how my brain thinks about TM. **Towards the North Star** A wondrous property of concurrent programming is the sheer number and diversity of programming models developed over the years. Actors, message-passing, data parallel, auto-vectorization, ...; the titles roll off the tongue, and yet none dominates and pervades. In fact, concurrent programming is a multi-dimensional space with a vast number of worthy points along its many axes. This rich history is simultaneously a blessing and a daunting curse. But in any case can make for some very interesting multi-year-long immersion. [My UW talk](http://norfolk.cs.washington.edu/htbin-post/unrestricted/colloq/details.cgi?id=768) from 1 1/2 years ago just barely touches on the sheer breadth. TM's greatest virtue is the first word in its name: transactional. It turns out that, no matter your concurrent programming model du jour, three fundamental concepts crop up again and again: isolation (of state), atomicity (of state transitions), and consistency (of those atomic transitions). We use locks in shared-memory programming, coarse grained messages in message-passing, and functional programming to achieve all of these things in different ways. Transactions are another such mechanism, sure, but more than that, transactions are an all-encompassing way of thinking about how programs behave at their most fundamental core. Transaction is a religion. Not everybody believes this, and of course why would they: it is an immensely subjective and qualitative statement. Some will claim that models like message passing entirely avoid the likes of "race conditions," and such, but this is clearly false: state transitions are made, complicated state invariants are erected amongst a sea of smaller isolated states, and care must be taken, just as in shared memory. Even Argus, a beautiful early incarnation of message-passing (via promises) demands that messages are atomic in nature. This property is not checked and, if done improperly, leads to "races in the large." Even Argus introduced the notion of transactions and persistence in the form of guardians. Of course, message passing helps push you in the right direction. It is not, however, a panacea. I was reading my ICFP proceedings recently and was reminded of research done in the context of Erlang that [supports this assertion](http://portal.acm.org/citation.cfm?id=1596550.1596574). In it, they apply [CHESS](http://research.microsoft.com/en-us/projects/chess/)-like techniques (with clever search space culling) to find race conditions. Indeed we use similar techniques very successfully for our message-passing programming models on my team here at Microsoft. Transactions are terrific because they are "automatic". You declare the boundaries, and the transactional machinery takes care of the rest. This is true of databases and also TM. Countless developers in the wild write massively concurrent programs by issuing operations against databases: they can do this so easily because they grok the simple façade that transactions provide. Numerous server-side state-based applications use transactions to shield programmers from the pitfalls of concurrency. Behold MSDTC. The bet we were making is that similar models would scale down just as well "in the small". The canonical syntactic footprint of TM is also beautiful and simple. You say: ``` atomic { ... concurrency-safe code goes here ... } ``` And everything in that block is magically concurrency-safe. (Well, you still need to ensure the consistency part, but isolation and atomicity are built-in. Mix this with Eiffel- or [Spec#](http://research.microsoft.com/en-us/projects/specsharp/)-style contracts and assertions like those in .NET 4.0, run at the end of each transaction, and you're well on your way to verified consistency also. The 'check E' work [in Haskell](http://research.microsoft.com/en-us/um/people/simonpj/Papers/stm/stm-invariants.pdf) was right along these lines.) You can read and write memory locations, call other methods, all without worrying about whether concurrency-safety will be at risk. For example, consider three transactions running concurrently: ``` int x = 0, y = 0, z = 0; atomic { atomic { atomic { x++; y++; z++; } x++; y++; } z++; } ``` No matter the order in which these run, the end result will be x == 3, y == 2, z == 1. Contrast this elegant simplicity with the many pitfalls of locks: - _Data races_. Like forgetting to hold a lock when accessing a certain piece of data. And other flavors of data races, such as holding the wrong lock when accessing a certain piece of data. Not only do these issues not exist, but the solution is not to add countless annotations associating locks with the data they protect; instead, you declare the scope of atomicity, and the rest is automatic. - _Reentrancy_. Locks don't compose. Reentrancy and true recursive acquires are blurred together. If a locked region expects reentrancy, usually due to planned recursion, life is good; if it doesn't, life is bad. This often manifests as virtual calls that reenter the calling subsystem while invariants remain broken due to a partial state transition. At that point, you're hosed. - _Performance_. The tension between fine-grained locking (better scalability) versus coarse-grained locking (simplicity and superior performance due to fewer lock acquire/release calls) is ever-present. This tension tugs on the cords of correctness, because if a lock is not held for long enough, other threads may be able to access data while invariants are still broken. Scalability pulls you to engage in a delicate tip-toe right up to the edge of the cliff. - _Deadlocks_. This one needs no explanation. In a nutshell, locks are not declarative. Not even close. They are not associated with the data protected by those locks, but rather the code that accesses said data. (For example: in the above code snippet, do we need three locks? Or one? Or …? Imagine we choose three: one for each variable, x, y, and z. What if we increment z, release its associated lock, and some other thread can now see the newly incremented z before the y and x get incremented. Whether this is acceptable depends on the program.) Sure, you can achieve atomicity and isolation, but only by intimately reasoning about your code by understanding the way they are implemented. And if you care about performance, you are also going to need to think about hardware esoterica such as CMPXCHG, spin waiting, cache contention, optimistic techniques with version counters and memory models, ABA, and so on. The contrast is stark. Atomic-block-style transactions provide automatic serializability of whole regions of code, no matter what that code does, and the TM infrastructure does the rest, choosing between: optimistic, pessimistic, coarse, fine, etc. The linearization point of a transaction is clear: the end of the atomic block. TM can even adjust strategies based on the surrounding environment: hardware, dynamic program behavior, etc. ("Policy".) In comparison to locks, TM is an order of magnitude simpler. There have even been studies whose conclusions [support this assertion](http://www.cs.uoregon.edu/events/icse2009/images/postConf/pankratius-TMStudy-Pankratius-ICSE2009.pdf). (Transactions unfortunately do not address one other issue, which turns out to be the most fundamental of all: sharing. Indeed, TM is insufficient -- indeed, even dangerous -- on its own because it makes it very easy to share data and access it from multiple threads; first class isolation is far more important to achieve than faux isolation. This is perhaps one major difference between client and server transactions. Most server sessions are naturally isolated, and so transactions only interfere around the edges. I'm showing my cards too early, and will return to this point much, much later in this essay.) TM also has the attractive quality of automatic rollback of partial state updates. (How did I get this far without discussing rollback?) Concurrency aside, this avoids needing to write backout code to run in the face of unhandled exceptions. In retrospect this capability alone is almost enough to justify TM in limited quantities. Reams of code "out there" contain brittle, untested, and, therefore, incorrect error handling code. We have seen such code lead to problems ranging in severity: reliability issues leading to data loss, security exploits, etc. Were we to replace all those try/catch/rethrow blocks of code with transactions, we could do away with this error prone spaghetti. We'd also eliminate try/filter exploits thanks to Windows/Win32 2-pass SEH. Sometimes I wish we focused on this simple step forward, forgot about concurrency-safety, and baby stepped our way forward. Likely it wouldn't have been enough, but I still wonder to this day. We also toyed with the ability to replace reliability-oriented CER blocks with transactions. As you go through a transaction, there is a log of forward progress and how to undo it. So no matter the kind of failure, including OOM, you can rollback the partial state updates with zero allocation required. At some point we began describing an 'atomic' block as though the program used a single global lock for all its concurrency operations. This would be grossly inefficient, of course, and fails to capture the precise isolation and rollback properties, but nevertheless conveys the basic idea. It also, as an aside, foreshadows a few of the difficult problems that lie ahead, namely strong vs. weak atomicity. Even though there is only one, if you forget to hold this one global lock while accessing shared data, you've still got a data race on your hands. This model won't save you. We will return to this later on. **Tough Decisions: Life as a Starving Artist** We faced some programming model decisions requiring artistic license early on. One that we quickly decided was whether to automatically roll back a transaction in response to an unhandled exception thrown from within. Such as with this code: ``` atomic { x++; if (p) { throw new Exception("Whoops"); } } ``` If p evaluates to true, and hence an unhandled exception thrown, should that x++ be rolled back? Most on the team said "Yes" as a gut reaction, whereas some argued we should require the programmer to catch-and-rollback by hand. We settled on the automatic approach because it seemed to do what you would expect in all the cases we looked at. Your transaction failed to complete normally and consistently. We also debated whether to support a unilateral "Transaction.Abort()" capability; while we agreed a "Transaction.Commit()" would be silly -- the only way to commit a transaction being to reach its end non-exceptionally -- the jury remained split on unilateral abort. We eventually found that, particularly when nesting is involved, the ability to detect a dire problem with the universe and bail unilaterally can be useful. And we also hit some tough snags early on. Some were trivial, like what happens when an exception is thrown out of an atomic block. Of course that exception was likely constructed within the atomic block ('throw new SomeException()' being the most common form of 'throw'), so we decided we probably need to smuggle at least some of that exception's state out of the transaction. Like its stack trace. And perhaps its message string. I wrote the initial incarnation of the CLR exception subsystem support, and stopped at shallow serialization across the boundary. But this was a slippery slope, and eventually the general problem was seen, leading to more generalized nesting models (which I shall describe briefly below). Another snag, which was quite non-trivial, was the impact to the debugging experience. Depending on various implementation choices -- like in-place versus buffered writes -- you may need to teach the debugger about TM intrinsically. And some of the challenges were fundamental to building a first class TM implementation. Clearly the GC needed to know about TM and its logging, because it needs to keep both the "before" and "after" state of the transaction alive, in case it needed to roll back. The JIT compiler was very quickly splayed open and on the surgery table. And so on. Throughout, it became abundantly clear that TM, much like generics, was a systemic and platform-wide technology shift. It didn't require type theory, but the road ahead sure wasn't going to be easy. So we knocked down many early snags, and kept plowing forward, eagerly and excitedly. None of these challenges were insurmountable. We remained hopeful and happy (perhaps even blissful) to continue exploring the space of possible solutions. More irksome snags lurked right around the corner, however. And little did we know that some decisions we were about to make would subject us to some of the biggest such snags. TM's greatest feature -- slap an atomic around a block of code and it just gets better -- would turn out to be its greatest challenge… but alas, I am again jumping ahead; more on that later. **Turtles, but How Far Down? Or, Bounded vs. Unbounded Transactions** Not all transactions are equal. There is a broad spectrum of TMs, ranging from those that are bounded to updating, say, 4 memory locations or cache lines, to those that are entirely unbounded. Indeed TM blurs together with other hardware-accelerated synchronization techniques, like speculative lock elision (SLE). The more constrained TM models are often hardware-hybrids, and the limitations imposed are typically due to physical hardware constraints. Models can be pulled along other axes, however, such as whether memory locations must be tagged in order to be used in a transaction or not, etc. Haskell requires this tagging (via TVars) so that side-effects are evident in the type system as with any other kind of monad. We quickly settled on unbounded transactions. Everything else looked like multi-word CAS and, although we knew multi-word CAS would be immensely useful for developing new lock-free algorithms, our aim was to build something radically new and with broader appeal. If we ended up with a hardware-hybrid, we would expect the software to pick up the slack; you'd get nice acceleration within the hardware constraints, and then "fall off the silent cliff" to software emulation thereafter. Thus the unbounded approach was chosen. In hindsight, this was a critical decision that had far-reaching implications. And to be honest, I now frequently doubt that it was the right call. We had our hearts in the right places, and the entire industry was trekking down the same path at the same time (with the notable exception of Haskell). But with the wisdom of age and hindsight, I do believe limited forms of TM could be wildly successful at particular tasks and yet would have avoided many of the biggest challenges with unbounded TM. And believe me: many such challenges arose in the ensuing months. An example of one challenge that didn't threaten the model of TM per se, but sure did make our lives more difficult, is the compilation strategy we were forced to adopt. Transactions cost something. To transact a read or write entails a non-trivial amount of extra work; we spent a lot of time optimizing away redundant work, and developing new optimizations that reduced the overhead of TM. But at the end of the day, the cost is not zero -- and in fact, the common case is far from it. Imagine you have an unbounded transaction model and are faced with compiling a particular method from MSIL to native code. A simple separate-module -based compiler (i.e. not whole-program) will not necessarily know whether this method will get called from a transaction, or from non-transactional code, such that in the worst case the method must be prepared for transactional access. There are a variety of techniques to use to produce code that supports both: the two extremes are (1) cloning, or (2) sharing w/ conditional dynamic checking. Neither extreme is particularly attractive, and this choice represents a classic space-time tradeoff that entails finding a reasonable middle ground. A JIT compiler can dynamically produce the version that is needed at the moment, but offline compilers -- like the CLR's NGEN -- do not have this luxury. And within Microsoft at least, and among shrink-wrap ISVs, offline compilation is of greater importance than JIT compilation. For better or for worse. The model of unbounded transactions is the hard part. You surround any arbitrary code with 'atomic { … }' and everything just works. It sounds beautiful. But just think about what can happen within a transaction: memory operations, calls to other methods, P/Invokes to Win32, COM Interop, allocation of finalizable objects, I/O calls (disk, network, databases, console, …), GUI operations, lock acquisitions, CAS operations, …, the list goes on and on. Versus bounded transactions, where we could say something like: if you do more than N things, the transaction will fail to run -- deterministically. Unbounded really was the golden nugget. But we should not be shy about what this decision implies. **Implementing the Idea** This leads me to a brief tangent on implementation. Given that we didn't implement TM with a single global lock, as the naïve mental model above suggests, you may wonder how we actually did do it. Three main approaches were seriously considered: - IL rewriting. Use a tool that passes over the IL post-compilation to inject transaction calls. - Hook the (JIT) compiler. The runtime itself would intrinsically know how to inject such calls. - Library-based. All transactional operations would be explicit calls into the TM infrastructure. Approaches #1 and #2 would look similar, but the latter would be quite different. Instead of: ``` atomic { x++; } ``` Or: ``` Atomic.Run(() => { x++; }); ``` You might say something like: ``` Atomic.Run(() => { Atomic.Write(Atomic.Read(ref x) + 1); }); ``` With enough language work, we could have tried to desugar the latter into the former, but when you start crossing method boundaries, everything gets more complicated. (Do you create transactional clones of every method, and rewrite calls from ordinary methods to the transactional clone? This is easy to do with a rewriter or compiler, but quite difficult with a pure library approach.) We also knew we'd need to do some very sophisticated compiler optimizations to get TM's performance to the point of acceptable. So we chose approach #2 for our "real" prototype, and never looked back. After this architectural approach was decided, a vast array of interesting implementation choices remained. We moved on to building the primitive library with all the TM APIs that the JIT would introduce calls into. We quickly settled an approach much like Harris's (and, at the time, pretty much the industry/research standard): optimistic reads, in-place pessimistic writes, and automatic retry. That means reads do not acquire locks of any sort, and instead, once the end of the transaction has been reached, all reads are validated; if any locations read have been modified concurrently (or an uncommitted value was read), the whole transaction is thrown away and reattempted from the start. Writes work like locks. This approach makes reads cheap: a single read consists of reading the value, and a version number whose address is at a statically known offset. No interlockeds. This is great since reads typically far outnumber writes. Down the line, we explored adding more sophisticated policy than this, which I will detail in brief below. So the compiler would inject hooks for the above code like so: ``` while (true) { TX tx = new TX(); try { // x++; tx.OpenReadOptimistic(ref x); int tmp = x; tx.OpenWritePessimistic(ref x); x = (tmp + 1); if (!tx.Validate()) { continue; } tx.Commit(); } catch { tx.Rollback(); throw; } } ``` Notice there are some obvious overheads in here: - The atomic block becomes a loop (to support automated retry). - A new transaction must be allocated and likely placed in TLS (if methods are called). - A try/catch block is used to initiate rollback on unhandled exceptions. - Each unique location read in a block requires at least one call to OpenReadOptimistic. - Each unique location written requires at least one call to OpenWritePessimistic. - Each location read must be validated (at Validate), and finally the transaction is committed (at Commit). Much of the work in the compiler was meant to reduce these overheads. For example, if the same location is read multiple times, there's no need to call OpenReadOptimistic more than once. If the compiler can statically detect this, it may elide some of the calls. If the same location is read and then written -- as in the above example -- only the write lock must be acquired. If no methods are called, the transaction object can be enregistered, and we needn't add it to TLS so long as the exception trap code knows how to move it from register to TLS on demand. Et cetera. There are other overheads that are not so obvious. Optimistic reads mandate that there is a version number for each location somewhere, and pessimistic writes mandate that there is a lock for each location somewhere. A straightforward technique is to use a hashing scheme to associate locations with this auxiliary data: each address is hashed to index into a table of version numbers and locks. This leads to false sharing, of course, but reduces space overhead and makes lookup fast. Unfortunately, in a garbage collected environment, addresses are not stable and therefore hashing becomes complicated. You can use object hash codes for this purpose, but .NET hash codes are overridable; and generating them is not nearly as cheap as using the memory location's address, which by definition is already in-hand. Other alternatives of course exist. You can associate version numbers and locks with the objects themselves, just like monitors and object headers/sync-blocks in the CLR: this provides object-granularity locking. Ahh, the age old tension of fine vs. coarse grained locking comes up again. We eventually realized we'd want both optimistic and pessimistic reads, the latter of which worked a lot like reader/writer locks. We crammed all these into a clever little word-sized data structure which worked a lot like Vista's SRWL data structure. Except that it also contained a version number. It was always surprising to me what strange things in the runtime we bumped up against. We realized a nice GC optimization: instead of keeping strong references to all intermediary states in a transaction log, we could keep weak references to all but the "before" and "after" state. This is important when transacting synthetic situations like this: ``` static BigHonkinFoo s_f; ... atomic { for (int i = 0; i < 1000000; i++) { s_f = new BigHonkinFoo(); } } ``` Of course you wouldn't write that code exactly. But there's no need to keep alive all but the s\_f that existed prior to entering the atomic block and the current one at any given time. But this leads to particularly hairy finalization issues. If a finalizable object is allocated within a transaction (say BigHonkinFoo), and is then reclaimed, its Finalize() method will be scheduled to run on a separate thread. Yet the transaction log may contain references to it. Thus there is a race between the transaction's final outcome and the invocation of the finalizer. We came up with a clever solution for this, but there were countless other clever solutions for various things not worth diving too deep into. Hacking is fun. However, it was not going to be what made or broke TM as a model. **Disillusionment Part I: the I/O Problem** It wasn't long before we realized another sizeable, and more fundamental, challenge with unbounded transactions. Finalizers touched on this. What do we do with atomic blocks that do not simply consist of pure memory reads and writes? (In other words, the majority of blocks of code written today.) This was not just a pesky question of how to compile a piece of code, but rather struck right at the heart of the TM model. You already saw the OpenReadOptimistic, OpenWritePessimistic, Validate, Commit, and Rollback pseudo-TM infrastructure calls, each of which operated on memory locations. But what about a read or write from a single block or entire file on the filesystem? Or output to the console? Or an entry in the Event Log? What about a web service call across the LAN? Allocation of some native memory? And so on. Ordinarily these kinds of operations will be composed with other memory operations, with some interesting invariant relationship holding between the disparate states. A transaction comprised of a mixture still ought to remain atomic and isolated. The answer seemed clear. At least in theory. The transaction literature, including [Reuter and Gray's classic](http://www.amazon.com/exec/obidos/ASIN/1558601902/bluebytesoftw-20), had a simple answer for such things: on-commit and on-rollback actions, to perform or compensate the logical action being performed, respectively. (Around this same time, the Haskell folks were creating just this capability in their STM, where 'onCommit' and 'onRollback' would take arbitrary lambdas to execute the said operation at the proper time.) Because we were working primarily in .NET -- with a side project targeting C++ -- we decided to use the new System.Transactions technology in 2.0 to hook into inherently transactional resources, like transacted NTFS, registry, and, of course, databases. (Digging through my blog, I found [this article](http://www.bluebytesoftware.com/blog/2006/06/20/AVolatileTransactionResourceManagerForMemoryAllocationdeallocation.aspx) written back in June 2006 about building a volatile resource manager for memory allocation/free operations, just as an example.) This worked, though we were quite obviously swimming upstream. Numerous challenges confronted us. A significant problem was that not all operations are inherently transactional, so in many cases we were faced with the need to add faux transactions on top of existing non-transactional services. (Already-transactional services were easy, like databases. Except that mixing fine-grain TM transactions with distributed DTC transactions makes my skin crawl.) For example, how would you undo a write to the console? Well, you can't, really. So we decided maybe the right default for Console.WriteLine was to use an on-commit action to perform the actual write only once the transaction had committed. But in even thinking this thought, we realized we were standing on shaky ground. What if the WriteLine was followed by something like a ReadLine, for example, where the program was meant to wait for the user to enter something into the console (likely in response to the prompt output by WriteLine)? (This example is a toy, of course, but represents a more fundamental pattern common in networked programs.) The basic problem was immediately clear. Adding isolation to an existing non-isolated operation is not always behavior-preserving, particularly when I/O is involved. Sometimes it is necessary to step outside of the isolation that would otherwise get poured on top by a simple transactional model. This particular problem isn't specific to traditional I/O per se. Foreign function interface calls through.NET's P/Invoke suffer from like problems. A call to CreateEvent may be compensatable (via an on-rollback action) with a call to CloseHandle. But this is flawed. Once that event's HANDLE is requested, and/or it is passed to other Win32 APIs like MsgWaitForMultipleObjects, then the isolation of the faux transaction is broken, and real state must be provided to the Win32 APIs. And if another thread were to look up that HANDLE -- perhaps through a name given to it in the call to CreateEvent -- it may be able to see and interact with that event before the enclosing transaction has been committed. The abstraction leaks. And even if the abstraction is perfect, it is obvious there's quite a bit of work to be had in order to transact all the touch points between .NET and Win32, of which there are many. And I mean many. Other issues wait just around the corner. For example, how would you treat a lock block that was called from within a transaction? (You might say "that's just not supported", but when adding TM to an existing, large ecosystem of software, you've got to draw the compatibility line somewhere. If you draw it too carelessly, large swaths of existing software will not work; and in this case, that often meant that we claimed to provide unbounded transactions, and yet we would be placing bounds on them such that a lot of existing software could not be composed with transactions. Not good.) A seemingly straightforward answer is to treat a lock block like an atomic block. So if you encounter: ``` atomic { lock (obj) { ... } } ``` it is logically transformed into: ``` atomic { atomic { ... } } ``` On the face of it, this looks okay. (Forget problems like freeform use of Monitor.Enter/Exit for now.) We're strengthening the atomicity and isolation, so what could go wrong? Well, it turns out that examples like this can also suffer from the "too much isolation" problem. Adding transactions to a lock-block extends the lifetime of the isolation of that particular block's effects, possibly leading to lack of forward progress. In fact, you don't need locks to illustrate the problem. Imagine a simple lock-free algorithm that communicates between threads using shared variables: ``` volatile int flag = 0; ... flag = 1; while (flag != 1) ; while (flag == 1) ; flag = 2; ``` If you invoke this code from within a transaction (on each thread), you're apt to lead to deadlock. Both transactions' effects will be isolated from the others', whereas we are quite obviously intending to publish the updates to the flag variable immediately. Anyway, the whole lock thing is a bit of a digression. The simple fact is that very little .NET code would actually run inside an atomic block but for things like collections and pure computations due to the I/O problem. You can develop one-off solutions for each problem that arises -- and indeed we did so for many of them -- and even hang those solutions underneath one general framework -- like System.Transactions -- but you cannot help but eventually become overwhelmed by the totality of the situation. The team experimented with static checking to turn these dynamic failures into static ones, but this only marginally improved matters. I could go on and on about the I/O problem, its various incarnations, and what we did about it. Instead I will sum it up: this problem was, and still is, the "elephant in the room" threatening unbounded TM's broader adoption. The question ultimately boils down to this: is the world going to be transactional, or is it not? Whether unbounded transactions foist unto the world will succeed, I think, depends intrinsically on the answer to this question. It sure looked like the answer was going to be "Yes" back when transactional NTFS and registry was added to Vista. But the momentum appears to have slowed dramatically. **Nesting** Let's get back to some fun, less depressing material. There are more surprises lurking ahead. I already mentioned a great virtue of transactions is their ability to nest. But I neglected to say how this works. And in fact when we began, we only recognized one form of nesting. You're in one atomic block and then enter into another one. What happens if that inner transaction commits or rolls back, before the fate of the outer transaction is known? Intuition guided us to the following answer: - If the inner transaction rolls back, the outer transaction does not necessarily do so. However, no matter what the outer transaction does, the effects of the inner will not be seen. - If the inner transaction commits, the effects remain isolated in the outer transaction. It "commits into" the outer transaction, we took to saying. Only if the outer transaction subsequently commits will the inner's effects be visible; if it rolls back, they are not. For example, consider this code: ``` void f() { void g() { atomic { // Tx0 atomic { // Tx1 x++; y++; try { if (p1) g(); throw new BarException(); } catch { } if (p0) } throw; } if (p2) throw new FooException(); } } ``` Imagine x = y = 0 at the start, and we invoke f. Many outcomes are possible. - If p1 is true, g will throw an exception, aborting Tx1's write to y. There are then two possibilities. (1)If p0 is true, the exception is repropagated and Tx0 will also abort, rolling back its write to x; this leaves x == y == 0. (2) If p0 is false, the exception is swallowed, and Tx0 proceeds to committing its write to x; this leaves x == 1, whereas y == 1. - If p1 is false, on the other hand, g will not throw anything. Tx1 will commit its write to y "into" the outer transaction Tx0. One of two outcomes will now occur depending on the value of p2. (1) If p2 is true, an exception is thrown out of f, and Tx0 rolls back both the inner transaction Tx1's effects and its own, leaving x == y == 0. (2) Else, f completes ordinarily, and Tx0 commits both Tx1's and its own effects, leading to x == y == 1. We expected most peoples' intuition to match this behavior. The canonical working example was a BankAccount class: ``` class BankAccount { decimal m_balance; public void Deposit(decimal delta) { atomic { m_balance += delta; } } public static void Transfer( BankAccount a, BankAccount b, decimal delta) { atomic { a.Deposit(-delta); b.Deposit(delta); } } } ``` This was an illustrative and beautiful example. It made beautiful slide-ware. We are composing the Deposit operations of two separate bank accounts into a single Transfer method. Of course doing the a.Deposit(-delta) and b.Deposit(delta) must be made atomic, else a failure could either lead to missing money, and/or someone could witness the world with the money in transit (and nowhere except for one a thread's stack) rather than having been transferred atomically. And building the same thing with locks is frustratingly difficult: using fine-grained per-account locks can lead to deadlock very quickly. Intuitively we walked down many variants of this mode of nesting. We reacquainted ourselves with Moss's [great dissertation on the topic](http://portal.acm.org/citation.cfm?id=3529), and remembered this intuitive nesting mode as closed nested transactions. And we shortly recognized the need for another mode: [open nested transactions](http://www.cs.utah.edu/wmpi/2006/final-version/wmpi-posters-1-Moss.pdf). To motivate the need for open nesting, imagine we've got a hashtable whose physical storage is independent from its logical storage. Resizing the table of buckets, for example, has little to do with whether a particular {key, value} pair exists within those buckets. The resizing operation, in fact, is logically idempotent and isolated: the same set of keys will exist within the table both before and after such an operation. So we can actually commit the physical effects of such an operation eagerly. With a naïve TM implementation, two independent keys hashing to the same bucket will conflict, and the reads and writes for such operations will live as long as the enclosing user-level transactions. Instead, we can serialize logical operations with respect to one another at a "higher level" than physically independent operations do, leading to greater concurrency. Two transactions will only conflict in long-running transactions if they truly operate on the same keys, rather than just happening to hash to the same bucket. Open nesting forced us to contemplate the sharing of state between outer and inner transactions more deliberately, and gave us some troubles syntactically. We had wanted to say: ``` atomic { // ordinary closed nesting. Foo f = new Foo(); atomic(open) { /// open nesting. ... f? ... } } ``` But is it really legal for the inner transaction here to access the 'f', which has been constructed and is presumably uncommitted in the outer transaction? With closed nested transactions there is lock compatibility between the outer and inner transactions. An inner closed nested transaction can of course read a memory location write-locked by the outer transaction, for example. However, the same must not true of open nesting, because an open nested transaction commits "to the world" rather than into its outer transaction. Allowing it to read and then potentially publish uncommitted state would violate serializability. It's possible that the inner open nested transaction will commit, whereas the outer will roll back. (The reverse situation is equally problematic.) And yet it's darn useful to pass state from an outer to an inner transaction -- and indeed, often impossible to do anything otherwise -- yet what if the key itself were a complicated object graph rather than value, and the key bleeds across transaction boundaries? Many issues like this arose. Our straightforward answer was that only pass-by-value worked across such a boundary. I don't think we ever found nirvana here. We developed other transaction modes also. As we added data parallel operations within a nested transaction, we realized that we'd need something a lot like closed nesting but with special accommodation for intra-transaction parallelism. This led us to [parallel nested transactions](http://www.cs.rochester.edu/meetings/TRANSACT07/papers/agrawal.pdf), enabling lock sharing from a parent to its many data parallel children. These children could not communicate with one another other than to "commit into" the parent, and subsequently reforking, thereby ensuring non-interference between them. Of course children could share read-locks amongst one another, just not write locks. And we continued to reject the temptation of adding weakened serializability modes a la relational databases (unrepeatable reads, etc). Although we expected this to arise out of necessity with time, it never did; the various nesting modes we provided seemed to satisfy the typical needs. **A Better Condition Variable** Here's a brief aside on one of TM's bonus features. Some TM variants also provide for "condition variable"-like facilities for coordination among threads. I think Haskell was the first such TM to provide a 'retry' and 'orElse' capability. When a 'retry' is encountered, the current transaction is rolled back, and restarted once the condition being sought becomes true. How does the TM subsystem know when that might be? This is an implementation detail, but one obvious choice is to monitor the reads that occurred leading up to the 'retry' -- those involved in the evaluation of the predicate -- and once any of them changes, to reschedule that transaction to run. Of course, it will reevaluate the predicate and, if it has become false, the transaction will 'retry' again. A simple blocking queue could be written this way. For example: ``` object TakeOne() { atomic { if (Count == 0) { retry; } return Pop(); } } ``` If, upon entering the atomic block, Count is witnessed as being zero, we issue a retry. The transaction subsystem notices we read Count with a particular version number, and then blocks the current transaction until Count's associated version number changes. The transaction is then rescheduled, and races to read Count once again. After Count is seen as non-zero, the Pop is attempted. The Pop, of course, may fail because of a race -- i.e. we read Count optimistically without blocking out writers -- but the usual transaction automatic-reattempt logic will kick in to mask the race in that case. The 'orElse' feature is a bit less obvious, though still rather useful. It enables choice among multiple transactions, each of which may end up issuing a 'retry'. I don't think I've seen it in any TMs except for ours and Haskell's. To illustrate, imagine we've got 3 blocking queues like the one above. Now imagine we'd like to take from the first of those three that becomes non-empty. 'orElse' makes this simple: ``` BlockingQueue bq1 = ..., bq2 = ..., bq3 = ...; atomic { object obj = orElse { bq1.TakeOne(), bq2.TakeOne(), bq3.TakeOne() }; } ``` While 'orElse' is perhaps an optional feature, you simply can't write certain kinds of multithreaded algorithms without 'retry'. Anything that requires cross-thread communication would need to use spin variables. **Deliberate Plans of Action: Policy** I waved my hands a bit above perhaps without you even knowing it. When I talk about optimistic, pessimistic, and automatic retry, I am baking in a whole lot of policy. It turns out there is a wide array of techniques. The simplest question we faced early on was, when an optimistic read fails to validate at the end of a transaction, when should we reattempt execution of that transaction? The naïve answer is "immediately". But obviously that would lead to livelock under some conditions. A more reasonable answer is "spin for N cycles and then retry". But this too can lead to livelock. A better answer is to either choose some random strategy, or to make an intelligent adaptive choice. We experimented with many such variants, including random backoff, sophisticated waiting and signaling based on the memory locations in question, among others. We even played games like giving transactions karma points for cooperatively acquiescing to other competing transactions, and allowing those transactions with the most karma points to make more forward progress before interrupting them. [A few good papers](http://lpd.epfl.ch/kapalka/files/robust-cm-scool05.pdf) supplied useful (and entertaining) reading material on the topic, but to be honest, nobody had a good answer at the time. Thankfully these are all implementation details. So we were free to experiment. Deadlock breaking also requires policy. Thankfully we can actually roll back the effects of transactions engaged in a deadly embrace with TM, so we merely need to know how often to run the deadlock detection algorithm. There was a similar problem when deciding to back off outer layers of nesting, and in fact this becomes more complicated when deadlocks are involved. Imagine: ``` atomic { atomic { x++; y++; atomic { atomic { y++; x++; } } } } ``` This deadlock-prone example is tricky because rolling back the inner-most transactions won't be sufficient to break the deadlock that may occur. Instead the TM policy manager needs to detect that multiple levels of nesting are involved and must be blown away in order to unstick forward progress. Another variant that went beyond deciding when to favor one transaction over another was to upgrade to pessimistic locking if optimistic let us down. The whole justification behind optimistic is that, …well, we're optimistic that conflicts won't happen. So it seems reasonable that, if they do occur, we fall back to something more, …well, pessimistic. There is a dial here too. Perhaps you only want to fall back to pessimistic after failing optimistically N times in a row, where N > 1. As I mentioned above, our single-word lock associated with each object supported both locking and versioning cheaply. **Disillusionment Part II: Weak or Strong Atomicity?** All along, we had this problem nipping at our heels. What happens if code accesses the same memory locations from inside and outside a transaction? We certainly expected this to happen over the life of a program: state surely transitions from public and shared among threads to private to a single thread regularly. But if some location were to be accessed transactionally and non-transactionally concurrently, at once, we'd (presumably) have a real mess on our hands. A supposedly atomic, isolated, etc. transaction would no longer be protected from the evils of racey code. For example: ``` atomic { // Tx0 x++; // No-Tx x++; } ``` Can we make any statements about the value of x after Tx0 commits (or rolls back)? Not really. It depends on the way the particular TM being used has been implemented. An in-place model that rolls back could not only roll back Tx0's but also the unprotected x++'s write. And so on. On one hand, this code is racey. So you could explain away the undefined behavior as being a race condition. On the other hand, it was also troublesome. All those problems with locks begin cropping up all over the place. It would have been ideal if we could notify developers that they made a mistake. Then we could have made the assertion that data races are simply not possible with TM. (Except for consistency-related ones, of course.) At the same time, many hardware models were being explored. And of course in hardware you've got the physical addresses that variables resolve to and needn't worry about aliasing. So it was actually possible to issue a fault if a location was used transactionally and non-transactionally at once. But given that our solution was software-based, we were uncomfortable betting the farm on hardware support. Another approach was static analysis. We could require transactional locations to be tagged, for example. This had the unfortunate consequence of making reusable data structures less, well, reusable. Collections for example presumably need to be usable from within and outside transactions alike. After-the-fact analysis could be applied without tagging, but false positives were common. We never really took a hard stance on this problem, but always assumed the combination of static analysis, tooling, and, perhaps someday, hardware detection would make this problem more diagnosable. But I think we generally resolved ourselves to the fact that our TM would suffer from weak atomicity problems. We thought this was explainable. Sadly it led to something that surely was not. **Disillusionment Part III: the Privatization Problem** I still remember the day like it was yesterday. A regular weekly team meeting, to discuss our project's status, future, hard problems, and the like. A summer intern on board from a university doing pioneering work in TM, sipping his coffee. Me, sipping my tea. Then that same intern's casual statement pointing out an Earth-shattering flaw that would threaten the kind of TM we (and most of the industry at the time) were building. We had been staring at the problem for over a year without having seen it. It is these kinds of moments that frighten me and make me a believer in formal computer science. Here it is in a nutshell: ``` bool itIsOwned = false; MyObj x = new MyObj(); ... atomic { // Tx0 atomic { // Tx1 // Claim the state for my use: if (!itIsOwned) itIsOwned = true; x.field += 42; } } int z = x.field; ... ``` The Tx0 transaction changes itIsOwned to true, and then commits. After it has committed, it proceeds to using whatever state was claimed (in this case an object referred to by variable x) outside of the purview of TM. Meanwhile, another transaction Tx1 has optimistically read itIsOwned as false, and has gone ahead to use x. An update in-place system will allow that transaction to freely change the state of x. Of course, it will roll back here, because isItOwned changed to true. But by then it is too late: the other thread using x outside of a transaction will see constantly changing state -- torn reads even -- and who knows what will happen from there. A known flaw in any weakly atomic, update in-place TM. If this example appears contrived, it's not. It shows up in many circumstances. The first one in which we noticed it was when one transaction removes a node from a linked list, while another transaction is traversing that same list. If the former thread believes it "owns" the removed element simply because it took it out of the list, someone's going to be disappointed when its state continues to change. This, we realized, is just part and parcel of an optimistic TM system that does in-place writes. I don't know that we ever fully recovered from this blow. It was a tough pill to swallow. After that meeting, everything changed: a somber mood was present and I think we all needed a drink. Nevertheless we plowed forward. We explored a number of alternatives. And so did the industry at large, because that intern in question published [a paper on the problem](http://portal.acm.org/citation.cfm?id=1281161). One obvious solution is to have a transaction that commits a change to a particular location wait until all transactions that have possibly read that location have completed -- a technique we called quiescence. We experimented with this approach, but it was extraordinarily complicated, for obvious reasons. We experimented with blends of pessimistic operations instead of optimistic, alternative commit protocols, like using a "commit ticket" approach that serializes transaction commits, each of which tended to sacrifice performance greatly. Eventually the team decided to do buffered writes instead of in-place writes, because any concurrent modifications in a transaction will simply not modify the actual memory being used outside of the transaction unless that transaction successfully commits. This, however, led to still other problems, like the granular loss of atomicity problem. Depending on the granularity of your buffered writes -- we chose object-level -- you can end up with false sharing of memory locations between transactional and non-transactional code. Imagine you update two separate fields of an object from within and outside a transaction, respectively, concurrently. Is this legal? Perhaps not. The transaction may bundle state updates to the whole object, rather than just one field. All these snags led to the realization that we direly needed a memory model for TM. **Disillusionment Part IV: Where is the Killer App?** Throughout all of this, we searched and searched for the killer TM app. It's unfair to pin this on TM, because the industry as a whole still searches for a killer concurrency app. But as we uncovered more successes in the latter, I became less and less convinced that the killer concurrency apps we will see broadly deployed in the next 5 years needed TM. Most enjoyed natural isolation, like embarrassingly parallel image processing apps. If you had sharing, you were doing something wrong. **In Conclusion** I eventually shifted focus to enforcing coarse-grained isolation through message-passing, and fine-grained isolation through type system support a la Haskell's state monad. This would help programmers to realize where they accidentally had sharing, I thought, rather than merely masking this sharing and making it all work (albeit inefficiently). I took this path not because I thought TM had no place in the concurrency ecosystem. But rather because I believed it did have a place, but that several steps would be needed before getting there. I suspected that, just like with Argus, you'd want transactions around the boundaries. And that you'd probably want something like open nesting for fine-grained scalable data structures, like shared caches. These are often choke points in a coarse-grained locking system, and often cannot be fully isolated, at least in the small. Ironically I am just now arriving there. In the system I work on I see these issues actually staring us in the face. This is just my own personal view on TM. You may also be interested in reading the current STM.NET team's views also, available on [their MSDN blog](http://blogs.msdn.com/stmteam/). For me the TM project was particularly enjoyable. And it was a great learning experience. I worked with some amazing people, and it was a privilege. You really had the sense that something big was right around the corner, and every day was a rush of enjoyment. Despite running as fast as we could, it seemed like we could just barely keep pace with the research community. Over time more and more researchers turned to TM, and I distinctly recall reading at least one new TM paper per week. This was also the first time I realized that Microsoft, at its core, really does operate like a collection of many startups. Our TM work was a grassroots movement, and there was no official sponsorship for our effort at the start. It was just a group of people independently getting together to discuss how TM might fit into the direction the industry was headed. Eventually TM started showing up on slide decks in presentations to management, followed by dedicated TM reviews, and even a BillG review. I will never forget, a couple years after that review -- during an overall concurrency review -- Bill standing up at the whiteboard, drawing the code "atomic { … }" and asking something to the effect: "Why can't you just use transactional memory for that?" I guess the idea stuck with him too. Who knows. Maybe in 10 years, the world will be transactional after all.
joeduffy/joeduffy.github.io
_posts/2010-01-03-a-brief-retrospective-on-transactional-memory.md
Markdown
mit
58,063
[ 30522, 1011, 1011, 1011, 9621, 1024, 2695, 2516, 1024, 1037, 1006, 4766, 1007, 15354, 2006, 12598, 2389, 3638, 3058, 1024, 2230, 1011, 5890, 1011, 6021, 2340, 1024, 5709, 1024, 2260, 1012, 2199, 8889, 8889, 8889, 1011, 5511, 1024, 4002, 7...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
module Puppet::Parser::Functions newfunction(:ip_in_cidr, :type => :rvalue, :doc => <<-'ENDHEREDOC' Checks if an ip address is contained within a CIDR address of the form 192.168.0.1/24 ENDHEREDOC ) do |args| require 'ipaddr' unless args.length == 2 then raise Puppet::ParseError, ("ip_in_cidr(): wrong number of arguments (#{args.length}; must be 2: ip and cidr)") end ip = args[0] unless ip.respond_to?('to_s') then raise Puppet::ParseError, ("#{ip.inspect} is not a string. It looks to be a #{ip.class}") end ip = ip.to_s cidr = args[1] unless cidr.respond_to?('to_s') then raise Puppet::ParseError, ("#{cidr.inspect} is not a string. It looks to be a #{cidr.class}") end cidr = cidr.to_s begin IPAddr.new(cidr).include? IPAddr.new(ip) rescue ArgumentError => e raise Puppet::ParseError, (e) end end end
apache/infrastructure-puppet
modules/customfact/lib/puppet/parser/functions/ip_in_cidr.rb
Ruby
apache-2.0
913
[ 30522, 11336, 13997, 1024, 1024, 11968, 8043, 1024, 1024, 4972, 2047, 11263, 27989, 1006, 1024, 12997, 1035, 1999, 1035, 28744, 2099, 1010, 1024, 2828, 1027, 1028, 1024, 27634, 2389, 5657, 1010, 1024, 9986, 1027, 1028, 1026, 1026, 1011, 100...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.debugger.settings; import com.intellij.debugger.DebuggerBundle; import com.intellij.debugger.impl.DebuggerUtilsEx; import com.intellij.debugger.ui.JavaDebuggerSupport; import com.intellij.debugger.ui.tree.render.ClassRenderer; import com.intellij.debugger.ui.tree.render.PrimitiveRenderer; import com.intellij.debugger.ui.tree.render.ToStringRenderer; import com.intellij.openapi.options.OptionsBundle; import com.intellij.openapi.options.SearchableConfigurable; import com.intellij.openapi.project.Project; import com.intellij.ui.IdeBorderFactory; import com.intellij.ui.StateRestoringCheckBox; import com.intellij.ui.classFilter.ClassFilterEditor; import com.intellij.util.ui.JBUI; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import javax.swing.*; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import java.awt.*; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import static java.awt.GridBagConstraints.*; /** * @author Eugene Belyaev */ public class DebuggerDataViewsConfigurable implements SearchableConfigurable { private JCheckBox myCbAutoscroll; private JCheckBox myCbShowSyntheticFields; private StateRestoringCheckBox myCbShowValFieldsAsLocalVariables; private JCheckBox myCbHideNullArrayElements; private JCheckBox myCbShowStatic; private JCheckBox myCbShowDeclaredType; private JCheckBox myCbShowFQNames; private JCheckBox myCbShowObjectId; private JCheckBox myCbShowStringsType; private JCheckBox myCbHexValue; private JCheckBox myCbPopulateThrowableStack; private StateRestoringCheckBox myCbShowStaticFinalFields; //private final ArrayRendererConfigurable myArrayRendererConfigurable; private JCheckBox myCbEnableAlternateViews; private JCheckBox myCbEnableToString; private JRadioButton myRbAllThatOverride; private JRadioButton myRbFromList; private ClassFilterEditor myToStringFilterEditor; private Project myProject; public DebuggerDataViewsConfigurable(@Nullable Project project) { myProject = project; //myArrayRendererConfigurable = new ArrayRendererConfigurable(NodeRendererSettings.getInstance().getArrayRenderer()); } @Override public void disposeUIResources() { //myArrayRendererConfigurable.disposeUIResources(); myToStringFilterEditor = null; myProject = null; } @Override public String getDisplayName() { return OptionsBundle.message("options.java.display.name"); } @Override public JComponent createComponent() { if (myProject == null) { myProject = JavaDebuggerSupport.getContextProjectForEditorFieldsInDebuggerConfigurables(); } final JPanel panel = new JPanel(new GridBagLayout()); myCbAutoscroll = new JCheckBox(DebuggerBundle.message("label.base.renderer.configurable.autoscroll")); myCbShowSyntheticFields = new JCheckBox(DebuggerBundle.message("label.base.renderer.configurable.show.synthetic.fields")); myCbShowValFieldsAsLocalVariables = new StateRestoringCheckBox(DebuggerBundle.message("label.base.renderer.configurable.show.val.fields.as.locals")); myCbHideNullArrayElements = new JCheckBox(DebuggerBundle.message("label.base.renderer.configurable.hide.null.array.elements")); myCbShowStatic = new JCheckBox(DebuggerBundle.message("label.base.renderer.configurable.show.static.fields")); myCbShowStaticFinalFields = new StateRestoringCheckBox(DebuggerBundle.message("label.base.renderer.configurable.show.static.final.fields")); myCbEnableAlternateViews = new JCheckBox(DebuggerBundle.message("label.base.renderer.configurable.alternate.view")); myCbShowStatic.addChangeListener(new ChangeListener(){ @Override public void stateChanged(ChangeEvent e) { if(myCbShowStatic.isSelected()) { myCbShowStaticFinalFields.makeSelectable(); } else { myCbShowStaticFinalFields.makeUnselectable(false); } } }); myCbShowSyntheticFields.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { if(myCbShowSyntheticFields.isSelected()) { myCbShowValFieldsAsLocalVariables.makeSelectable(); } else { myCbShowValFieldsAsLocalVariables.makeUnselectable(false); } } }); myCbShowDeclaredType = new JCheckBox(DebuggerBundle.message("label.base.renderer.configurable.show.declared.type")); myCbShowFQNames = new JCheckBox(DebuggerBundle.message("label.base.renderer.configurable.show.fq.names")); myCbShowObjectId = new JCheckBox(DebuggerBundle.message("label.base.renderer.configurable.show.object.id")); myCbHexValue = new JCheckBox(DebuggerBundle.message("label.base.renderer.configurable.show.hex.value")); myCbShowStringsType = new JCheckBox(DebuggerBundle.message("label.base.renderer.configurable.show.strings.type")); myCbPopulateThrowableStack = new JCheckBox(DebuggerBundle.message("label.base.renderer.configurable.populate.throwable.stack")); myCbEnableToString = new JCheckBox(DebuggerBundle.message("label.base.renderer.configurable.enable.toString")); myRbAllThatOverride = new JRadioButton(DebuggerBundle.message("label.base.renderer.configurable.all.overriding")); myRbFromList = new JRadioButton(DebuggerBundle.message("label.base.renderer.configurable.classes.from.list")); ButtonGroup group = new ButtonGroup(); group.add(myRbAllThatOverride); group.add(myRbFromList); myToStringFilterEditor = new ClassFilterEditor(myProject, null, "reference.viewBreakpoints.classFilters.newPattern"); myCbEnableToString.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { final boolean enabled = myCbEnableToString.isSelected(); myRbAllThatOverride.setEnabled(enabled); myRbFromList.setEnabled(enabled); myToStringFilterEditor.setEnabled(enabled && myRbFromList.isSelected()); } }); myRbFromList.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { myToStringFilterEditor.setEnabled(myCbEnableToString.isSelected() && myRbFromList.isSelected()); } }); panel.add(myCbAutoscroll, new GridBagConstraints(0, RELATIVE, 1, 1, 0.0, 0.0, WEST, NONE, JBUI.insetsTop(4), 0, 0)); final JPanel showPanel = new JPanel(new GridBagLayout()); showPanel.setBorder(IdeBorderFactory.createTitledBorder("Show", true)); showPanel.add(myCbShowDeclaredType, new GridBagConstraints(0, RELATIVE, 1, 1, 0.0, 0.0, WEST, NONE, JBUI.emptyInsets(), 0, 0)); showPanel.add(myCbShowObjectId, new GridBagConstraints(0, RELATIVE, 1, 1, 0.0, 0.0, WEST, NONE, JBUI.insetsTop(4), 0, 0)); showPanel.add(myCbShowSyntheticFields, new GridBagConstraints(1, RELATIVE, 1, 1, 0.0, 0.0, WEST, NONE, JBUI.insetsLeft(10), 0, 0)); showPanel.add(myCbShowStatic, new GridBagConstraints(1, RELATIVE, 1, 1, 0.0, 0.0, WEST, NONE, JBUI.insets(4, 10, 0, 0), 0, 0)); showPanel.add(myCbShowValFieldsAsLocalVariables, new GridBagConstraints(2, RELATIVE, 1, 1, 0.0, 0.0, WEST, NONE, JBUI.insets(4, 10, 0, 0), 0, 0)); showPanel.add(myCbShowStaticFinalFields, new GridBagConstraints(2, RELATIVE, 1, 1, 0.0, 0.0, WEST, NONE, JBUI.insets(4, 10, 0, 0), 0, 0)); showPanel.add(myCbShowFQNames, new GridBagConstraints(3, RELATIVE, 1, 1, 1.0, 0.0, WEST, NONE, JBUI.insetsLeft(10), 0, 0)); panel.add(showPanel, new GridBagConstraints(0, RELATIVE, 3, 1, 1.0, 0.0, WEST, HORIZONTAL, JBUI.insetsTop(4), 0, 0)); //final JPanel arraysPanel = new JPanel(new BorderLayout(0, UIUtil.DEFAULT_VGAP)); //final JComponent arraysComponent = myArrayRendererConfigurable.createComponent(); //assert arraysComponent != null; //arraysPanel.add(arraysComponent, BorderLayout.CENTER); //arraysPanel.add(myCbHideNullArrayElements, BorderLayout.SOUTH); //arraysPanel.setBorder(IdeBorderFactory.createTitledBorder("Arrays", true)); //panel.add(arraysPanel, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 3, 1, 1.0, 0.0, GridBagConstraints.NORTH, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); panel.add(myCbShowStringsType, new GridBagConstraints(0, RELATIVE, 3, 1, 1.0, 0.0, NORTH, HORIZONTAL, JBUI.emptyInsets(), 0, 0)); panel.add(myCbHexValue, new GridBagConstraints(0, RELATIVE, 3, 1, 1.0, 0.0, NORTH, HORIZONTAL, JBUI.insetsTop(4), 0, 0)); panel.add(myCbHideNullArrayElements, new GridBagConstraints(0, RELATIVE, 3, 1, 1.0, 0.0, NORTH, HORIZONTAL, JBUI.insetsTop(4), 0, 0)); panel.add(myCbPopulateThrowableStack, new GridBagConstraints(0, RELATIVE, 3, 1, 1.0, 0.0, NORTH, HORIZONTAL, JBUI.insetsTop(4), 0, 0)); panel.add(myCbEnableAlternateViews, new GridBagConstraints(0, RELATIVE, 1, 1, 0.0, 0.0, WEST, NONE, JBUI.insets(4, 0, 0, 10), 0, 0)); // starting 4-th row panel.add(myCbEnableToString, new GridBagConstraints(0, RELATIVE, 3, 1, 1.0, 0.0, WEST, NONE, JBUI.insetsTop(4), 0, 0)); panel.add(myRbAllThatOverride, new GridBagConstraints(0, RELATIVE, 3, 1, 1.0, 0.0, WEST, NONE, JBUI.insetsLeft(12), 0, 0)); panel.add(myRbFromList, new GridBagConstraints(0, RELATIVE, 3, 1, 1.0, 0.0, WEST, NONE, JBUI.insetsLeft(12), 0, 0)); myToStringFilterEditor.setMinimumSize(JBUI.size(50, 100)); panel.add(myToStringFilterEditor, new GridBagConstraints(0, RELATIVE, 3, 1, 1.0, 1.0, CENTER, BOTH, JBUI.insetsLeft(12), 0, 0)); return panel; } @Override public void apply() { final ViewsGeneralSettings generalSettings = ViewsGeneralSettings.getInstance(); final NodeRendererSettings rendererSettings = NodeRendererSettings.getInstance(); generalSettings.AUTOSCROLL_TO_NEW_LOCALS = myCbAutoscroll.isSelected(); rendererSettings.setAlternateCollectionViewsEnabled(myCbEnableAlternateViews.isSelected()); generalSettings.HIDE_NULL_ARRAY_ELEMENTS = myCbHideNullArrayElements.isSelected(); generalSettings.POPULATE_THROWABLE_STACKTRACE = myCbPopulateThrowableStack.isSelected(); final ClassRenderer classRenderer = rendererSettings.getClassRenderer(); classRenderer.SHOW_STATIC = myCbShowStatic.isSelected(); classRenderer.SHOW_STATIC_FINAL = myCbShowStaticFinalFields.isSelectedWhenSelectable(); classRenderer.SHOW_SYNTHETICS = myCbShowSyntheticFields.isSelected(); classRenderer.SHOW_VAL_FIELDS_AS_LOCAL_VARIABLES = myCbShowValFieldsAsLocalVariables.isSelectedWhenSelectable(); classRenderer.SHOW_DECLARED_TYPE = myCbShowDeclaredType.isSelected(); classRenderer.SHOW_FQ_TYPE_NAMES = myCbShowFQNames.isSelected(); classRenderer.SHOW_OBJECT_ID = myCbShowObjectId.isSelected(); classRenderer.SHOW_STRINGS_TYPE = myCbShowStringsType.isSelected(); final ToStringRenderer toStringRenderer = rendererSettings.getToStringRenderer(); toStringRenderer.setOnDemand(!myCbEnableToString.isSelected()); toStringRenderer.setUseClassFilters(myRbFromList.isSelected()); toStringRenderer.setClassFilters(myToStringFilterEditor.getFilters()); PrimitiveRenderer primitiveRenderer = rendererSettings.getPrimitiveRenderer(); primitiveRenderer.setShowHexValue(myCbHexValue.isSelected()); rendererSettings.fireRenderersChanged(); } @Override public void reset() { final ViewsGeneralSettings generalSettings = ViewsGeneralSettings.getInstance(); final NodeRendererSettings rendererSettings = NodeRendererSettings.getInstance(); myCbAutoscroll.setSelected(generalSettings.AUTOSCROLL_TO_NEW_LOCALS); myCbHideNullArrayElements.setSelected(generalSettings.HIDE_NULL_ARRAY_ELEMENTS); myCbEnableAlternateViews.setSelected(rendererSettings.areAlternateCollectionViewsEnabled()); myCbPopulateThrowableStack.setSelected(generalSettings.POPULATE_THROWABLE_STACKTRACE); ClassRenderer classRenderer = rendererSettings.getClassRenderer(); myCbShowSyntheticFields.setSelected(classRenderer.SHOW_SYNTHETICS); myCbShowValFieldsAsLocalVariables.setSelected(classRenderer.SHOW_VAL_FIELDS_AS_LOCAL_VARIABLES); if (!classRenderer.SHOW_SYNTHETICS) { myCbShowValFieldsAsLocalVariables.makeUnselectable(false); } myCbShowStatic.setSelected(classRenderer.SHOW_STATIC); myCbShowStaticFinalFields.setSelected(classRenderer.SHOW_STATIC_FINAL); if(!classRenderer.SHOW_STATIC) { myCbShowStaticFinalFields.makeUnselectable(false); } myCbShowDeclaredType.setSelected(classRenderer.SHOW_DECLARED_TYPE); myCbShowFQNames.setSelected(classRenderer.SHOW_FQ_TYPE_NAMES); myCbShowObjectId.setSelected(classRenderer.SHOW_OBJECT_ID); myCbShowStringsType.setSelected(classRenderer.SHOW_STRINGS_TYPE); final ToStringRenderer toStringRenderer = rendererSettings.getToStringRenderer(); final boolean toStringEnabled = !toStringRenderer.isOnDemand(); final boolean useClassFilters = toStringRenderer.isUseClassFilters(); myCbEnableToString.setSelected(toStringEnabled); myRbAllThatOverride.setSelected(!useClassFilters); myRbFromList.setSelected(useClassFilters); myToStringFilterEditor.setFilters(toStringRenderer.getClassFilters()); myToStringFilterEditor.setEnabled(toStringEnabled && useClassFilters); myRbFromList.setEnabled(toStringEnabled); myRbAllThatOverride.setEnabled(toStringEnabled); PrimitiveRenderer primitiveRenderer = rendererSettings.getPrimitiveRenderer(); myCbHexValue.setSelected(primitiveRenderer.isShowHexValue()); } @Override public boolean isModified() { return areGeneralSettingsModified() || areDefaultRenderersModified(); } private boolean areGeneralSettingsModified() { ViewsGeneralSettings generalSettings = ViewsGeneralSettings.getInstance(); return generalSettings.AUTOSCROLL_TO_NEW_LOCALS != myCbAutoscroll.isSelected() || generalSettings.HIDE_NULL_ARRAY_ELEMENTS != myCbHideNullArrayElements.isSelected() || generalSettings.POPULATE_THROWABLE_STACKTRACE != myCbPopulateThrowableStack.isSelected(); } private boolean areDefaultRenderersModified() { //if (myArrayRendererConfigurable.isModified()) { // return true; //} final NodeRendererSettings rendererSettings = NodeRendererSettings.getInstance(); final ClassRenderer classRenderer = rendererSettings.getClassRenderer(); final boolean isClassRendererModified= (classRenderer.SHOW_STATIC != myCbShowStatic.isSelected()) || (classRenderer.SHOW_STATIC_FINAL != myCbShowStaticFinalFields.isSelectedWhenSelectable()) || (classRenderer.SHOW_SYNTHETICS != myCbShowSyntheticFields.isSelected()) || (classRenderer.SHOW_VAL_FIELDS_AS_LOCAL_VARIABLES != myCbShowValFieldsAsLocalVariables.isSelectedWhenSelectable()) || (classRenderer.SHOW_DECLARED_TYPE != myCbShowDeclaredType.isSelected()) || (classRenderer.SHOW_FQ_TYPE_NAMES != myCbShowFQNames.isSelected()) || (classRenderer.SHOW_OBJECT_ID != myCbShowObjectId.isSelected()) || (classRenderer.SHOW_STRINGS_TYPE != myCbShowStringsType.isSelected()); if (isClassRendererModified) { return true; } final ToStringRenderer toStringRenderer = rendererSettings.getToStringRenderer(); final boolean isToStringRendererModified = (toStringRenderer.isOnDemand() == myCbEnableToString.isSelected()) || (toStringRenderer.isUseClassFilters() != myRbFromList.isSelected()) || (!DebuggerUtilsEx.filterEquals(toStringRenderer.getClassFilters(), myToStringFilterEditor.getFilters())); if (isToStringRendererModified) { return true; } if (rendererSettings.areAlternateCollectionViewsEnabled() != myCbEnableAlternateViews.isSelected()) { return true; } PrimitiveRenderer primitiveRenderer = rendererSettings.getPrimitiveRenderer(); if (primitiveRenderer.isShowHexValue() != myCbHexValue.isSelected()) { return true; } return false; } @SuppressWarnings("SpellCheckingInspection") @Override @NotNull public String getHelpTopic() { return "Debugger_Data_Views_Java"; } @Override @NotNull public String getId() { return getHelpTopic(); } }
ThiagoGarciaAlves/intellij-community
java/debugger/impl/src/com/intellij/debugger/settings/DebuggerDataViewsConfigurable.java
Java
apache-2.0
16,248
[ 30522, 1013, 1013, 9385, 2456, 1011, 2418, 6892, 10024, 7076, 1055, 1012, 1054, 1012, 1051, 1012, 2224, 1997, 2023, 3120, 3642, 2003, 9950, 2011, 1996, 15895, 1016, 1012, 1014, 6105, 2008, 2064, 2022, 2179, 1999, 1996, 6105, 5371, 1012, 7...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
import store from '../store' import { mapState } from 'vuex' import { Scroller, Example } from 'components' export default { name: 'Main', store, computed: mapState({ name: state => state.name }), render() { const { name } = this return ( <Scroller> <Example name={ name } /> </Scroller> ) } }
rabbitmu/vue-boilerplate
template/src/container/Main.js
JavaScript
mit
392
[ 30522, 12324, 3573, 2013, 1005, 1012, 1012, 1013, 3573, 1005, 12324, 1063, 7341, 12259, 1065, 2013, 1005, 24728, 10288, 1005, 12324, 1063, 17186, 2121, 1010, 2742, 1065, 30524, 1024, 1005, 2364, 1005, 1010, 3573, 1010, 24806, 1024, 7341, 12...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
import { Component } from '@angular/core'; @Component({ selector: 'app-shadows-sample', styleUrls: ['shadows.sample.css'], templateUrl: 'shadows.sample.html' }) export class ShadowsSampleComponent {}
Infragistics/zero-blocks
src/app/styleguide/shadows/shadows.sample.ts
TypeScript
mit
213
[ 30522, 12324, 1063, 6922, 1065, 2013, 1005, 1030, 16108, 1013, 4563, 1005, 1025, 1030, 6922, 1006, 1063, 27000, 1024, 1005, 10439, 1011, 6281, 1011, 7099, 1005, 1010, 2806, 3126, 4877, 1024, 1031, 1005, 6281, 1012, 7099, 1012, 20116, 2015, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php /** * Ce fichier est développé pour la gestion de la librairie Mélanie2 * Cette Librairie permet d'accèder aux données sans avoir à implémenter de couche SQL * Des objets génériques vont permettre d'accèder et de mettre à jour les données * * ORM M2 Copyright © 2017 PNE Annuaire et Messagerie/MEDDE * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ namespace LibMelanie\Ldap; /** * Singleton de connexion à l'annuaire * TODO: n'est plus utile, on la conserve en attendant que les applis passe à la nouvelle utilisation de l'appli ldap * * @author PNE Messagerie/Apitech * @package Librairie Mélanie2 * @subpackage LDAP * */ class LDAPMelanie { /** * Constructeur privé pour ne pas instancier la classe */ private function __construct() { } /** * Athentification sur le serveur LDAP * @param string $username * @param string $password * @return boolean */ public static function Authentification ($username, $password) { return Ldap::Authentification($username, $password); } /** * Return les boites partagées accessible pour un utilisateur depuis le LDAP * @param string $username * @return mixed cn mineqmelmailemission uid */ public static function GetInformations($username) { return Ldap::GetUserInfos($username); } /** * Return les informations sur un utilisateur depuis le LDAP * @param string $username * @return dn cn mail */ public static function GetBalp($username) { return Ldap::GetUserBalPartagees($username); } /** * Return les informations sur un utilisateur depuis le LDAP * @param string $username * @return dn cn mail */ public static function GetEmissionBal($username) { return Ldap::GetUserBalEmission($username); } /** * Return les informations sur un utilisateur depuis son adresse email depuis le LDAP * @param string $email * @return dn cn uid */ public static function GetInformationsFromMail ($email) { return Ldap::GetUserInfosFromEmail($email); } /** * Return l'uid de l'utilisateur depuis son adresse email depuis le LDAP * @param string $email * @return string $uid */ public static function GetUidFromMail($email) { $infos = Ldap::GetUserInfosFromEmail($email); if (is_null($infos)) return null; $ldap = Ldap::GetInstance(\LibMelanie\Config\Ldap::$SEARCH_LDAP); return isset($infos[$ldap->getMapping('uid')]) ? $infos[$ldap->getMapping('uid')][0] : null; } /** * Return l'email de l'utilisateur depuis son uid depuis le LDAP * @param string $uid * @return string $email */ public static function GetMailFromUid ($uid) { $infos = Ldap::GetUserInfos($uid); if (is_null($infos)) return null; $ldap = Ldap::GetInstance(\LibMelanie\Config\Ldap::$SEARCH_LDAP); return $infos[$ldap->getMapping('mail', 'mineqmelmailemission')][0]; } /** * Return le nom de l'utilisateur depuis son uid depuis le LDAP * @param string $uid * @return string $email */ public static function GetNameFromUid ($uid) { $infos = Ldap::GetUserInfos($uid); if (is_null($infos)) return null; $ldap = Ldap::GetInstance(\LibMelanie\Config\Ldap::$SEARCH_LDAP); return $infos[$ldap->getMapping('cn')][0]; } } ?>
messagerie-melanie2/ORM-M2
src/Ldap/LDAPMelanie.php
PHP
gpl-3.0
3,788
[ 30522, 1026, 1029, 25718, 1013, 1008, 1008, 1008, 8292, 10882, 5428, 2121, 9765, 4503, 5051, 10364, 2474, 16216, 16643, 2239, 2139, 2474, 5622, 10024, 15735, 2063, 13286, 2475, 1008, 8292, 4674, 5622, 10024, 15735, 2063, 2566, 11368, 1040, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
var doc = require('dynamodb-doc'); var dynamodb = new doc.DynamoDB(); exports.handler = function(event, context) { console.log(JSON.stringify(event, null, ' ')); var bname = event.name.replace(/\W/g, ''); bname = bname.charAt(0).toUpperCase() + bname.slice(1); dynamodb.updateItem({ "TableName": "baby-names", "Key" : { name : bname }, "UpdateExpression" : "SET votes = votes + :a", "ExpressionAttributeValues" : { ":a" : 1 } }, function(err, data) { if (err) { context.done('error putting item into dynamodb failed: '+err); } else { console.log('success: '+JSON.stringify(data, null, ' ')); context.done(); } }); };
ScreamingHawk/milk-server-baby
babyNameUpvote.js
JavaScript
mit
686
[ 30522, 13075, 9986, 1027, 5478, 1006, 1005, 17205, 18939, 1011, 9986, 1005, 1007, 1025, 13075, 17205, 18939, 1027, 2047, 9986, 1012, 17205, 18939, 1006, 1007, 1025, 14338, 1012, 28213, 1027, 3853, 1006, 2724, 1010, 6123, 1007, 1063, 10122, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package com.asayama.rps.simulator; public enum Hand { ROCK, PAPER, SCISSORS; }
kyoken74/rock-paper-scissors
src/main/java/com/asayama/rps/simulator/Hand.java
Java
mit
83
[ 30522, 7427, 4012, 1012, 17306, 11613, 1012, 1054, 4523, 1012, 25837, 1025, 2270, 4372, 2819, 2192, 1063, 2600, 1010, 3259, 1010, 25806, 1025, 1065, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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. from tempest.api.orchestration import base from tempest.common.utils import data_utils from tempest.openstack.common import log as logging from tempest.test import attr LOG = logging.getLogger(__name__) class StacksTestJSON(base.BaseOrchestrationTest): _interface = 'json' empty_template = "HeatTemplateFormatVersion: '2012-12-12'\n" @classmethod def setUpClass(cls): super(StacksTestJSON, cls).setUpClass() cls.client = cls.orchestration_client @attr(type='smoke') def test_stack_list_responds(self): resp, stacks = self.client.list_stacks() self.assertEqual('200', resp['status']) self.assertIsInstance(stacks, list) @attr(type='smoke') def test_stack_crud_no_resources(self): stack_name = data_utils.rand_name('heat') # create the stack stack_identifier = self.create_stack( stack_name, self.empty_template) stack_id = stack_identifier.split('/')[1] # wait for create complete (with no resources it should be instant) self.client.wait_for_stack_status(stack_identifier, 'CREATE_COMPLETE') # check for stack in list resp, stacks = self.client.list_stacks() list_ids = list([stack['id'] for stack in stacks]) self.assertIn(stack_id, list_ids) # fetch the stack resp, stack = self.client.get_stack(stack_identifier) self.assertEqual('CREATE_COMPLETE', stack['stack_status']) # fetch the stack by name resp, stack = self.client.get_stack(stack_name) self.assertEqual('CREATE_COMPLETE', stack['stack_status']) # fetch the stack by id resp, stack = self.client.get_stack(stack_id) self.assertEqual('CREATE_COMPLETE', stack['stack_status']) # delete the stack resp = self.client.delete_stack(stack_identifier) self.assertEqual('204', resp[0]['status'])
eltonkevani/tempest_el_env
tempest/api/orchestration/stacks/test_stacks.py
Python
apache-2.0
2,542
[ 30522, 1001, 6819, 2213, 1024, 21628, 16033, 2361, 1027, 1018, 5670, 9148, 11927, 2232, 1027, 1018, 3730, 2696, 5910, 14399, 1027, 1018, 1001, 7000, 2104, 1996, 15895, 6105, 1010, 2544, 1016, 1012, 1014, 1006, 1996, 1000, 6105, 1000, 1007, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
$(document).ready(function() { $('#btn-create-version').on('click', function(e) { e.preventDefault(); var newVersion = $('#new-version').val(); if (newVersion) { var assetId = $('#asset-id').val(); var assetType = $('#asset-type').val(); var path = caramel.url('/apis/asset/' + assetId + '/create-version?type=' + assetType); var assetPath = caramel.url('/assets/' + assetType + '/details/'); $('#btn-create-version').addClass('disabled'); $('#new-version-loading').removeClass('hide'); var alertMessage = $("#alertSection"); $.ajax({ url: path, data: JSON.stringify({ "attributes": { "overview_version": newVersion } }), type: 'POST', success: function(response) { messages.alertSuccess('Asset version created successfully!,You will be redirected to new asset details page in few seconds.....'); setTimeout(function() { var path = caramel.url('assets/' + assetType + '/details/' + response.data); window.location = path; }, 3000); }, error: function(error) { var errorText = JSON.parse(error.responseText).error; messages.alertError(errorText); $('#btn-create-version').removeClass('disabled'); $('#new-version-loading').addClass('hide'); } }); } }); $('#btn-cancel-version').on('click', function(e) { var assetId = $('#asset-id').val(); var assetType = $('#asset-type').val(); var path = caramel.url('/assets/' + assetType + '/details/' + assetId); $.ajax({ success: function(response) { window.location = path; } }); }); });
sameerak/carbon-store
apps/publisher/themes/default/js/copy-asset.js
JavaScript
apache-2.0
2,044
[ 30522, 1002, 1006, 6254, 1007, 1012, 3201, 1006, 3853, 1006, 1007, 1063, 1002, 1006, 1005, 1001, 18411, 2078, 1011, 3443, 1011, 2544, 1005, 1007, 1012, 2006, 1006, 1005, 11562, 1005, 1010, 3853, 1006, 1041, 1007, 1063, 1041, 1012, 4652, 3...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * Copyright 2014 Guidewire Software, Inc. */ package gw.plugin.ij.intentions; import com.intellij.codeInsight.CodeInsightUtilBase; import com.intellij.codeInspection.LocalQuickFixAndIntentionActionOnPsiElement; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.project.Project; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiFile; import com.intellij.psi.PsiWhiteSpace; import com.intellij.psi.util.PsiMatcherImpl; import gw.internal.gosu.parser.Expression; import gw.internal.gosu.parser.expressions.NumericLiteral; import gw.lang.parser.IStatement; import gw.lang.parser.statements.IAssignmentStatement; import gw.lang.parser.statements.IStatementList; import gw.lang.parser.statements.IWhileStatement; import gw.plugin.ij.lang.psi.api.statements.IGosuVariable; import gw.plugin.ij.lang.psi.impl.statements.GosuForEachStatementImpl; import gw.plugin.ij.lang.psi.impl.statements.GosuWhileStatementImpl; import gw.plugin.ij.lang.psi.util.GosuPsiParseUtil; import gw.plugin.ij.util.GosuBundle; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import static com.intellij.psi.util.PsiMatchers.hasClass; public class WhileToForFix extends LocalQuickFixAndIntentionActionOnPsiElement { String ident; Expression rhs; private IGosuVariable declarationEqualToZero; private IAssignmentStatement increment; public WhileToForFix(PsiElement whileStmt, String ident, Expression rhs, IGosuVariable declarationEqualToZero, IAssignmentStatement increment) { super(whileStmt); this.ident = ident; this.rhs = rhs; this.declarationEqualToZero = declarationEqualToZero; this.increment = increment; } @Override public void invoke(@NotNull Project project, @NotNull PsiFile file, @Nullable("is null when called from inspection") Editor editor, @NotNull PsiElement startElement, @NotNull PsiElement endElement) { if (!CodeInsightUtilBase.prepareFileForWrite(startElement.getContainingFile())) { return; } IWhileStatement parsedElement = ((GosuWhileStatementImpl) startElement).getParsedElement(); if (parsedElement == null) { return; } IStatement statement = parsedElement.getStatement(); IStatement[] statements = ((IStatementList) statement).getStatements(); StringBuilder forStmt = new StringBuilder(); forStmt.append("for ("); forStmt.append(ident); forStmt.append(" in 0.."); if(rhs instanceof NumericLiteral) { Object res = rhs.evaluate(); if(res instanceof Integer) { forStmt.append(((Integer)res)-1); } } else { forStmt.append("|" + rhs); } forStmt.append(") {\n"); String indent = getIndet(parsedElement, statements); for (IStatement statement1 : statements) { if (statement1 != increment) { forStmt.append(indent); forStmt.append(statement1.getLocation().getTextFromTokens()); forStmt.append("\n"); } } forStmt.append("}"); PsiElement stub = GosuPsiParseUtil.parseProgramm(forStmt.toString(), startElement, file.getManager(), null); PsiElement newForStmt = new PsiMatcherImpl(stub) .descendant(hasClass(GosuForEachStatementImpl.class)) .getElement(); if (newForStmt != null) { declarationEqualToZero.delete(); startElement.replace(newForStmt); } } private String getIndet(IWhileStatement parsedElement, IStatement[] statements) { int whileColum = parsedElement.getLocation().getColumn(); int column = statements[1].getLocation().getColumn() - whileColum; if(column < 0) { return " "; } StringBuilder out = new StringBuilder(); for(int i = 0; i <= column; i++) { out.append(" "); } return out.toString(); } private void removeVarDecl(PsiElement whileStmt, String ident) { PsiElement prev = whileStmt.getPrevSibling(); while (prev instanceof PsiWhiteSpace) { prev = prev.getPrevSibling(); } if (prev instanceof IGosuVariable && ((IGosuVariable) prev).getName().equals(ident)) { prev.delete(); } } @Override public boolean isAvailable(@NotNull Project project, @NotNull PsiFile file, @NotNull PsiElement startElement, @NotNull PsiElement endElement) { return startElement instanceof GosuWhileStatementImpl; } @NotNull @Override public String getText() { return GosuBundle.message("inspection.while.to.for"); } @NotNull @Override public String getFamilyName() { return GosuBundle.message("inspection.group.name.statement.issues"); } }
pdalbora/gosu-lang
idea-gosu-plugin/src/main/java/gw/plugin/ij/intentions/WhileToForFix.java
Java
apache-2.0
4,712
[ 30522, 1013, 1008, 1008, 9385, 2297, 5009, 20357, 4007, 1010, 4297, 1012, 1008, 1013, 7427, 1043, 2860, 1012, 13354, 2378, 1012, 1045, 3501, 1012, 11174, 1025, 12324, 4012, 1012, 13420, 3669, 3501, 1012, 3642, 30524, 7542, 2239, 4523, 9257,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# encoding: utf-8 ## # This file is auto-generated. DO NOT EDIT! # require 'protobuf/message' module Protobuf module Rpc module DynamicDiscovery ## # Enum Classes # class BeaconType < ::Protobuf::Enum define :HEARTBEAT, 0 define :FLATLINE, 1 end ## # Message Classes # class Server < ::Protobuf::Message; end class Beacon < ::Protobuf::Message; end ## # Message Fields # class Server optional :string, :uuid, 1 optional :string, :address, 2 optional :string, :port, 3 optional :int32, :ttl, 4 repeated :string, :services, 5 end class Beacon optional ::Protobuf::Rpc::DynamicDiscovery::BeaconType, :beacon_type, 1 optional ::Protobuf::Rpc::DynamicDiscovery::Server, :server, 2 end end end end
msaintemarie/msaintemarie.github.io
vendor/cache/ruby/2.6.0/gems/protobuf-3.6.12/lib/protobuf/rpc/dynamic_discovery.pb.rb
Ruby
mit
890
[ 30522, 1001, 17181, 1024, 21183, 2546, 1011, 1022, 1001, 1001, 1001, 2023, 5371, 2003, 8285, 1011, 7013, 1012, 2079, 2025, 10086, 999, 1001, 5478, 1005, 15053, 8569, 2546, 1013, 4471, 1005, 11336, 15053, 8569, 2546, 11336, 1054, 15042, 1133...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
\begin{table}[h!] \begin{center} \begin{tabular}{| l | c | c | c | c |}\hline & g. & p. & i. & h. \\\hline $chars$ & 547631 & 34238 & 98978 & 414415 \\\hline $chars_{\%}$ & 100.00 & 6.25 & 18.07 & 75.67 \\\hline $\frac{spaces}{chars}$ & 15.43 & 16.57 & 15.32 & 15.36 \\\hline $\frac{punct}{chars-spaces}$ & 4.69 & 8.48 & 6.92 & 3.85 \\\hline $\frac{digits}{chars-spaces}$ & 1.78 & 11.81 & 2.46 & 0.80 \\\hline $\frac{letters}{chars-spaces}$ & 91.61 & 77.61 & 88.88 & 93.40 \\\hline $\frac{vogals}{letters}$ & 37.19 & 33.70 & 35.75 & 37.75 \\\hline $\frac{uppercase}{letters}$ & 4.11 & 5.73 & 4.98 & 3.80 \\\hline \end{tabular} \caption{Characters in each Erd\"os sector ({{\bf p.}} for periphery, {{\bf i.}} for intermediary, {{\bf h.}} for hubs). TAG: 7} \end{center} \end{table}
ttm/artigoTextoNasRedes
tables/SI/charsInline7.tex
TeX
unlicense
810
[ 30522, 1032, 4088, 1063, 2795, 1065, 1031, 1044, 999, 1033, 1032, 4088, 1063, 2415, 1065, 1032, 4088, 1063, 21628, 7934, 1065, 1063, 1064, 1048, 1064, 1039, 1064, 1039, 1064, 1039, 1064, 1039, 1064, 1065, 1032, 1044, 4179, 1004, 1043, 101...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php /** * Copyright © 2016 Magento. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Setup\Module\Di\Compiler\Config; interface ModificationInterface { /** * Modifies input config * * @param array $config * @return array */ public function modify(array $config); }
rajmahesh/magento2-master
vendor/magento/magento2-base/setup/src/Magento/Setup/Module/Di/Compiler/Config/ModificationInterface.php
PHP
gpl-3.0
338
[ 30522, 1026, 1029, 25718, 1013, 1008, 1008, 1008, 9385, 1075, 2355, 17454, 13663, 1012, 2035, 2916, 9235, 1012, 1008, 2156, 24731, 1012, 19067, 2102, 2005, 6105, 4751, 1012, 1008, 1013, 3415, 15327, 17454, 13663, 1032, 16437, 1032, 11336, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
using ICSharpCode.SharpZipLib.Zip.Compression.Streams; using System; using System.Collections.Generic; using System.IO; using System.Text; using U3d = UnityEngine; namespace M2Image { /// <summary> /// WZL(与WZX配套)文件读取工具类 /// </summary> internal sealed class WZL : IDisposable { /// <summary> /// 图片数量 /// </summary> internal int ImageCount { get; private set; } /// <summary> /// 色深度 /// </summary> internal int ColorCount { get; private set; } /// <summary> /// 图片数据起始位置 /// </summary> private int[] OffsetList; /// <summary> /// 图片数据长度 /// </summary> private int[] LengthList; /// <summary> /// 图片描述对象 /// </summary> internal M2ImageInfo[] ImageInfos { get; private set; } /// <summary> /// WIL文件指针 /// </summary> private FileStream FS_wzl; /// <summary> /// 是否成功初始化 /// </summary> internal bool Loaded { get; private set; } /// <summary> /// 文件指针读取锁 /// </summary> private Object wzl_locker = new Object(); internal WZL(String wzlPath) { Loaded = false; ColorCount = 8; if (!File.Exists(Path.ChangeExtension(wzlPath, "wzx"))) return; FileStream fs_wzx = new FileStream(Path.ChangeExtension(wzlPath, "wzx"), FileMode.Open, FileAccess.Read); fs_wzx.Position += 44; // 跳过标题 using (BinaryReader rwzx = new BinaryReader(fs_wzx)) { ImageCount = rwzx.ReadInt32(); OffsetList = new int[ImageCount]; for (int i = 0; i < ImageCount; ++i) { // 读取数据偏移地址 OffsetList[i] = rwzx.ReadInt32(); } } //fs_wzx.Dispose(); FS_wzl = new FileStream(wzlPath, FileMode.Open, FileAccess.Read); using (BinaryReader rwzl = new BinaryReader(FS_wzl)) { ImageInfos = new M2ImageInfo[ImageCount]; LengthList = new int[ImageCount]; for (int i = 0; i < ImageCount; ++i) { // 读取图片信息和数据长度 M2ImageInfo ii = new M2ImageInfo(); FS_wzl.Position = OffsetList[i] + 4; // 跳过4字节未知数据 ii.Width = rwzl.ReadUInt16(); ii.Height = rwzl.ReadUInt16(); ii.OffsetX = rwzl.ReadInt16(); ii.OffsetY = rwzl.ReadInt16(); ImageInfos[i] = ii; LengthList[i] = rwzl.ReadInt32(); } } Loaded = true; } /// <summary> /// 获取某个索引的图片 /// </summary> /// <param name="index">图片索引,从0开始</param> /// <returns>对应图片数据</returns> internal U3d.Texture2D this[uint index] { get { M2ImageInfo ii = ImageInfos[index]; U3d.Texture2D result = new U3d.Texture2D(ii.Width, ii.Height); if (ii.Width == 0 && ii.Height == 0) return result; byte[] pixels = null; lock (wzl_locker) { FS_wzl.Position = OffsetList[index] + 16; using (BinaryReader rwzl = new BinaryReader(FS_wzl)) { pixels = unzip(rwzl.ReadBytes(LengthList[index])); } } int p_index = 0; for (int h = 0; h < ii.Height; ++h) for (int w = 0; w < ii.Width; ++w) { // 跳过填充字节 if (w == 0) p_index += Delphi.SkipBytes(8, ii.Width); float[] pallete = Delphi.PALLETE[pixels[p_index++] & 0xff]; result.SetPixel(w, ii.Height - h, new U3d.Color(pallete[1], pallete[2], pallete[3], pallete[0])); } result.Apply (); return result; } } private byte[] unzip(byte[] ziped) { InflaterInputStream iib = new InflaterInputStream(new MemoryStream(ziped)); MemoryStream o = new MemoryStream(); int i = 1024; byte[] buf = new byte[i]; while ((i = iib.Read(buf, 0, i)) > 0) { o.Write(buf, 0, i); } return o.ToArray(); } public void Dispose() { lock (wzl_locker) { OffsetList = null; ImageInfos = null; Loaded = false; if (FS_wzl != null) { FS_wzl.Dispose(); } } } } }
jootm2/m2client-u3d
Assets/Scripts/M2Image/WZL.cs
C#
mit
5,141
[ 30522, 2478, 24582, 7377, 14536, 16044, 1012, 4629, 5831, 24759, 12322, 1012, 14101, 1012, 13379, 1012, 9199, 1025, 2478, 2291, 1025, 2478, 2291, 1012, 6407, 1012, 12391, 1025, 2478, 2291, 1012, 22834, 1025, 2478, 2291, 1012, 3793, 1025, 24...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php /* * This file is part of the Sylius package. * * (c) Paweł Jędrzejewski * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ declare(strict_types=1); namespace Sylius\Bundle\CoreBundle\Command; use Sylius\Component\Core\Model\AdminUserInterface; use Sylius\Component\User\Repository\UserRepositoryInterface; use Symfony\Component\Console\Helper\QuestionHelper; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Question\Question; use Symfony\Component\Console\Style\SymfonyStyle; use Symfony\Component\Validator\Constraints\Email; use Symfony\Component\Validator\Constraints\NotBlank; use Symfony\Component\Validator\ConstraintViolationListInterface; use Webmozart\Assert\Assert; final class SetupCommand extends AbstractInstallCommand { /** * {@inheritdoc} */ protected function configure(): void { $this ->setName('sylius:install:setup') ->setDescription('Sylius configuration setup.') ->setHelp(<<<EOT The <info>%command.name%</info> command allows user to configure basic Sylius data. EOT ) ; } /** * {@inheritdoc} */ protected function execute(InputInterface $input, OutputInterface $output): void { $currency = $this->get('sylius.setup.currency')->setup($input, $output, $this->getHelper('question')); $locale = $this->get('sylius.setup.locale')->setup($input, $output); $this->get('sylius.setup.channel')->setup($locale, $currency); $this->setupAdministratorUser($input, $output, $locale->getCode()); } /** * @param InputInterface $input * @param OutputInterface $output * @param string $localeCode */ protected function setupAdministratorUser(InputInterface $input, OutputInterface $output, string $localeCode): void { $outputStyle = new SymfonyStyle($input, $output); $outputStyle->writeln('Create your administrator account.'); $userManager = $this->get('sylius.manager.admin_user'); $userFactory = $this->get('sylius.factory.admin_user'); try { $user = $this->configureNewUser($userFactory->createNew(), $input, $output); } catch (\InvalidArgumentException $exception) { return; } $user->setEnabled(true); $user->setLocaleCode($localeCode); $userManager->persist($user); $userManager->flush(); $outputStyle->writeln('<info>Administrator account successfully registered.</info>'); $outputStyle->newLine(); } /** * @param AdminUserInterface $user * @param InputInterface $input * @param OutputInterface $output * * @return AdminUserInterface */ private function configureNewUser( AdminUserInterface $user, InputInterface $input, OutputInterface $output ): AdminUserInterface { /** @var UserRepositoryInterface $userRepository */ $userRepository = $this->getAdminUserRepository(); if ($input->getOption('no-interaction')) { Assert::null($userRepository->findOneByEmail('sylius@example.com')); $user->setEmail('sylius@example.com'); $user->setUsername('sylius'); $user->setPlainPassword('sylius'); return $user; } $email = $this->getAdministratorEmail($input, $output); $user->setEmail($email); $user->setUsername($this->getAdministratorUsername($input, $output, $email)); $user->setPlainPassword($this->getAdministratorPassword($input, $output)); return $user; } /** * @return Question */ private function createEmailQuestion(): Question { return (new Question('E-mail: ')) ->setValidator(function ($value) { /** @var ConstraintViolationListInterface $errors */ $errors = $this->get('validator')->validate((string) $value, [new Email(), new NotBlank()]); foreach ($errors as $error) { throw new \DomainException($error->getMessage()); } return $value; }) ->setMaxAttempts(3) ; } /** * @param InputInterface $input * @param OutputInterface $output * * @return string */ private function getAdministratorEmail(InputInterface $input, OutputInterface $output): string { /** @var QuestionHelper $questionHelper */ $questionHelper = $this->getHelper('question'); /** @var UserRepositoryInterface $userRepository */ $userRepository = $this->getAdminUserRepository(); do { $question = $this->createEmailQuestion(); $email = $questionHelper->ask($input, $output, $question); $exists = null !== $userRepository->findOneByEmail($email); if ($exists) { $output->writeln('<error>E-Mail is already in use!</error>'); } } while ($exists); return $email; } /** * @param InputInterface $input * @param OutputInterface $output * @param string $email * * @return string */ private function getAdministratorUsername(InputInterface $input, OutputInterface $output, string $email): string { /** @var QuestionHelper $questionHelper */ $questionHelper = $this->getHelper('question'); /** @var UserRepositoryInterface $userRepository */ $userRepository = $this->getAdminUserRepository(); do { $question = new Question('Username (press enter to use email): ', $email); $username = $questionHelper->ask($input, $output, $question); $exists = null !== $userRepository->findOneBy(['username' => $username]); if ($exists) { $output->writeln('<error>Username is already in use!</error>'); } } while ($exists); return $username; } /** * @param InputInterface $input * @param OutputInterface $output * * @return mixed */ private function getAdministratorPassword(InputInterface $input, OutputInterface $output) { /** @var QuestionHelper $questionHelper */ $questionHelper = $this->getHelper('question'); $validator = $this->getPasswordQuestionValidator(); do { $passwordQuestion = $this->createPasswordQuestion('Choose password:', $validator); $confirmPasswordQuestion = $this->createPasswordQuestion('Confirm password:', $validator); $password = $questionHelper->ask($input, $output, $passwordQuestion); $repeatedPassword = $questionHelper->ask($input, $output, $confirmPasswordQuestion); if ($repeatedPassword !== $password) { $output->writeln('<error>Passwords do not match!</error>'); } } while ($repeatedPassword !== $password); return $password; } /** * @return \Closure */ private function getPasswordQuestionValidator(): \Closure { return function ($value) { /** @var ConstraintViolationListInterface $errors */ $errors = $this->get('validator')->validate($value, [new NotBlank()]); foreach ($errors as $error) { throw new \DomainException($error->getMessage()); } return $value; }; } /** * @param string $message * @param \Closure $validator * * @return Question */ private function createPasswordQuestion(string $message, \Closure $validator): Question { return (new Question($message)) ->setValidator($validator) ->setMaxAttempts(3) ->setHidden(true) ->setHiddenFallback(false) ; } /** * @return UserRepositoryInterface */ private function getAdminUserRepository(): UserRepositoryInterface { return $this->get('sylius.repository.admin_user'); } }
vihuvac/Sylius
src/Sylius/Bundle/CoreBundle/Command/SetupCommand.php
PHP
mit
8,226
[ 30522, 1026, 1029, 25718, 1013, 1008, 1008, 2023, 5371, 2003, 2112, 1997, 1996, 25353, 15513, 7427, 1012, 1008, 1008, 1006, 1039, 1007, 22195, 2063, 18818, 24401, 15378, 20518, 7974, 5488, 1008, 1008, 2005, 1996, 2440, 9385, 1998, 6105, 259...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#ifndef DIR_EXPLORER_H #define DIR_EXPLORER_H #include <glib.h> typedef struct dir_explorer_s { gint64 dir_count; gint64 dir_index; GSList *src_dir_list; GSList *src_dir_cursor; GDir* src_dir_ptr; } dir_explorer_t; /** * Callback function for dir_next_match * * @param path A complete file or directory path * @return True if path matches criteria, False otherwise */ typedef gboolean (*dir_explorer_match)(gchar *path, gpointer user_data); GError* dir_explore(gchar* current_path, dir_explorer_t *iter); gint dir_progress(dir_explorer_t *exp); gchar *dir_next_match(dir_explorer_t *exp, GPatternSpec *exclude_pattern, dir_explorer_match, gpointer user_data); gchar *dir_next_file(dir_explorer_t *exp, gchar *exclude_dir_pattern); void dir_explorer_clean(dir_explorer_t *exp); #endif
redcurrant/redcurrant
crawler/lib/dir_explorer.h
C
lgpl-3.0
800
[ 30522, 1001, 2065, 13629, 2546, 16101, 1035, 10566, 1035, 1044, 1001, 9375, 16101, 1035, 10566, 1035, 1044, 1001, 2421, 1026, 1043, 29521, 1012, 1044, 1028, 21189, 12879, 2358, 6820, 6593, 16101, 1035, 10566, 1035, 1055, 1063, 18353, 2102, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# ############################################################################ # OSIS stands for Open Student Information System. It's an application # designed to manage the core business of higher education institutions, # such as universities, faculties, institutes and professional schools. # The core business involves the administration of students, teachers, # courses, programs and so on. # # Copyright (C) 2015-2020 Université catholique de Louvain (http://www.uclouvain.be) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # A copy of this license - GNU General Public License - is available # at the root of the source code of this program. If not, # see http://www.gnu.org/licenses/. # ############################################################################ from unittest import mock from django.test import SimpleTestCase from program_management.ddd import command from program_management.ddd.domain.service.identity_search import ProgramTreeVersionIdentitySearch from program_management.ddd.repositories.program_tree_version import ProgramTreeVersionRepository from program_management.ddd.service.read import get_program_tree_version_from_node_service class TestGetProgramTreeVersionFromNodeService(SimpleTestCase): @mock.patch.object(ProgramTreeVersionIdentitySearch, 'get_from_node_identity') @mock.patch.object(ProgramTreeVersionRepository, 'get') def test_domain_service_is_called(self, mock_domain_service, mock_repository_get): cmd = command.GetProgramTreeVersionFromNodeCommand(code="LDROI1200", year=2018) get_program_tree_version_from_node_service.get_program_tree_version_from_node(cmd) self.assertTrue(mock_domain_service.called) self.assertTrue(mock_repository_get.called)
uclouvain/OSIS-Louvain
program_management/tests/ddd/service/read/test_get_program_tree_version_from_node_service.py
Python
agpl-3.0
2,219
[ 30522, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 100...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#!/usr/bin/env node process.chdir(__dirname) var crypto = require('crypto'), fs = require('fs'), config = require('../config.js') var newPasswordSha1 = crypto.createHash('sha1').update('').digest('hex') var content = '// auto-generated\n' + 'exports.port = ' + config.port + '\n' + 'exports.host = ' + JSON.stringify(config.host) + '\n' + 'exports.keySha1 = ' + JSON.stringify(newPasswordSha1) + '\n' fs.writeFileSync('../config.js', content) console.log('New key is an empty string')
aimnadze/audio-player-server
scripts/disable-key.js
JavaScript
agpl-3.0
515
[ 30522, 1001, 999, 1013, 2149, 2099, 1013, 8026, 1013, 4372, 2615, 13045, 2832, 1012, 10381, 4305, 2099, 1006, 1035, 1035, 16101, 18442, 1007, 13075, 19888, 2080, 1027, 5478, 1006, 1005, 19888, 2080, 1005, 1007, 1010, 1042, 2015, 1027, 5478,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package com.github.bordertech.wcomponents; import com.github.bordertech.wcomponents.WButton.ImagePosition; import com.github.bordertech.wcomponents.util.mock.MockRequest; import java.io.Serializable; import junit.framework.Assert; import org.junit.Test; /** * Unit tests for {@link WButton}. * * @author Ming Gao * @since 1.0.0 */ public class WButton_Test extends AbstractWComponentTestCase { private static final String SHARED_VALUE = "shared value"; private static final String USER_VALUE = "user value"; private static final String SHARED_TEXT = "shared text"; private static final String USER_TEXT = "user text"; private static final String BEAN_VALUE = "bean value"; @Test public void testConstructors() { final String text = "WButton_Test.testConstructors"; final char accessKey = 'W'; WButton button = new WButton(text); Assert.assertEquals("Incorrect button text", text, button.getText()); Assert.assertNull("Accesskey should not be set", button.getAccessKeyAsString()); button = new WButton(text, accessKey); Assert.assertEquals("Incorrect button text", text, button.getText()); Assert.assertEquals("Incorrect access key returned", accessKey, button.getAccessKey()); } @Test public void testAccessKeyHandling() { String buttonText = "ABCDE abcde"; WButton button = new WButton(buttonText); button.setAccessKey('E'); // reset shared button text. Access key should be automatically reset. button.setText("Test"); // override tool tip. String myToolTip = "My ToolTip"; button.setToolTip(myToolTip); Assert.assertEquals("Unexpected ToolTip text", myToolTip, button.getToolTip()); } @Test public void testSetPressed() { WButton button = new WButton("Test"); button.setLocked(true); setActiveContext(createUIContext()); button.setPressed(true, new MockRequest()); Assert.assertTrue("Button should be pressed", button.isPressed()); Assert.assertFalse("Button should not be in default state", button.isDefaultState()); button.setPressed(false, new MockRequest()); Assert.assertFalse("Button should be pressed", button.isPressed()); button.setDisabled(true); button.setPressed(true, new MockRequest()); Assert.assertTrue("Button should be disabled", button.isDisabled()); Assert.assertFalse("Button should be pressed when disabled", button.isPressed()); } @Test public void testActionSetPressed() { WButton button = new WButton("Test"); button.setLocked(true); UIContext uic = createUIContext(); setActiveContext(uic); uic.setUI(button); TestAction testAction = new TestAction(); testAction.reset(); button.setAction(testAction); button.setPressed(true, new MockRequest()); Assert.assertEquals("Button was not pressed", true, button.isPressed()); } @Test public void testSetActionCommand() { String text = "WButton_Test.text"; String sharedValue = "WButton_Test.sharedValue"; String value = "WButton_Test.value"; UIContext uic1 = new UIContextImpl(); WButton button = new WButton(text); button.setLocked(true); Assert.assertEquals("Default action command should be button text", text, button. getActionCommand()); button.setActionCommand(sharedValue); Assert.assertEquals("Incorrect shared action command returned", sharedValue, button. getActionCommand()); setActiveContext(uic1); button.setActionCommand(value); Assert.assertEquals("Uic 1 action command should be returned for uic 1", value, button. getActionCommand()); Assert. assertFalse("Button should not be in default state for uic1", button. isDefaultState()); resetContext(); Assert.assertEquals("Incorrect shared action command returned", sharedValue, button. getActionCommand()); } @Test public void testSetActionObject() { Serializable actionObject = "testSetActionObject.actionObject1"; WButton button = new WButton(); button.setLocked(true); setActiveContext(createUIContext()); button.setActionObject(actionObject); Assert.assertSame("Incorrect action object", actionObject, button.getActionObject()); resetContext(); Assert.assertNull("Action object should be null by default", button.getActionObject()); } @Test public void testSetImageUrl() { WButton button = new WButton(); button.setLocked(true); String imageUrl = "http://127.0.0.1/image.jpg"; setActiveContext(createUIContext()); button.setImageUrl(imageUrl); button.setLocked(true); Assert.assertEquals("Uic 1 image url should be returned for uic 1", imageUrl, button. getImageUrl()); Assert. assertFalse("Button should not be in default state for uic1", button. isDefaultState()); resetContext(); Assert.assertNull("Default image url should be null", button.getImageUrl()); } @Test public void testSetImagePosition() { WButton button = new WButton(); button.setLocked(true); setActiveContext(createUIContext()); button.setImagePosition(ImagePosition.EAST); button.setLocked(true); Assert.assertEquals("Uic 1 image position should be returned for uic 1", ImagePosition.EAST, button.getImagePosition()); Assert. assertFalse("Button should not be in default state for uic1", button. isDefaultState()); resetContext(); Assert.assertNull("Default image position should be null", button.getImagePosition()); } @Test public void testPopupTrigger() { WButton button = new WButton("Test"); button.setLocked(true); setActiveContext(createUIContext()); Assert.assertFalse("Should not be a popup trigger by default", button.isPopupTrigger()); button.setPopupTrigger(true); Assert.assertTrue("Button should be a popup trigger", button.isPopupTrigger()); resetContext(); Assert.assertFalse("Default popup trigger status should not have changed", button. isPopupTrigger()); } @Test public void testGetText() { Assert.assertNull("Incorrect text for button with nothing", getButtonText(false, false, false, false, false, false)); Assert.assertEquals("Incorrect text for button with Shared text", SHARED_TEXT, getButtonText(true, false, false, false, false, false)); Assert.assertEquals("Incorrect text for button with User text", USER_TEXT, getButtonText(false, true, false, false, false, false)); Assert.assertEquals("Incorrect text for button with User + shared text", USER_TEXT, getButtonText(true, true, false, false, false, false)); Assert.assertEquals("Incorrect text for button with Shared value only", SHARED_VALUE, getButtonText(false, false, true, false, false, false)); Assert.assertEquals("Incorrect text for button with Shared text, shared value", SHARED_TEXT, getButtonText(true, false, true, false, false, false)); Assert.assertEquals("Incorrect text for button with User text, shared value", USER_TEXT, getButtonText(false, true, true, false, false, false)); Assert.assertEquals("Incorrect text for button with Shared + user text, shared value", USER_TEXT, getButtonText(true, true, true, false, false, false)); Assert.assertEquals("Incorrect text for button with User value only", USER_VALUE, getButtonText(false, false, false, true, false, false)); Assert.assertEquals("Incorrect text for button with Shared text, user value", SHARED_TEXT, getButtonText(true, false, false, true, false, false)); Assert.assertEquals("Incorrect text for button with User text, user value", USER_TEXT, getButtonText(false, true, false, true, false, false)); Assert.assertEquals("Incorrect text for button with Shared + user text, user value", USER_TEXT, getButtonText(true, true, false, true, false, false)); Assert.assertEquals("Incorrect text for button with Shared + user value", USER_VALUE, getButtonText(false, false, true, true, false, false)); Assert.assertEquals("Incorrect text for button with Shared text, shared + user value", SHARED_TEXT, getButtonText(true, false, true, true, false, false)); Assert.assertEquals("Incorrect text for button with User text, shared + user value", USER_TEXT, getButtonText(false, true, true, true, false, false)); Assert. assertEquals( "Incorrect text for button with Shared + user text, shared + user value", USER_TEXT, getButtonText(true, true, true, true, false, false)); Assert.assertNull("Incorrect text for button with null bean only", getButtonText(false, false, false, false, true, true)); Assert.assertEquals("Incorrect text for button with null bean, Shared text", SHARED_TEXT, getButtonText(true, false, false, false, true, true)); Assert.assertEquals("Incorrect text for button with null bean, User text", USER_TEXT, getButtonText(false, true, false, false, true, true)); Assert.assertEquals("Incorrect text for button with null bean, User + shared text", USER_TEXT, getButtonText(true, true, false, false, true, true)); Assert.assertEquals("Incorrect text for button with null bean, Shared value only", SHARED_VALUE, getButtonText(false, false, true, false, true, true)); Assert.assertEquals("Incorrect text for button with null bean, Shared text, shared value", SHARED_TEXT, getButtonText(true, false, true, false, true, true)); Assert.assertEquals("Incorrect text for button with null bean, User text, shared value", USER_TEXT, getButtonText(false, true, true, false, true, true)); Assert.assertEquals( "Incorrect text for button with null bean, Shared + user text, shared value", USER_TEXT, getButtonText(true, true, true, false, true, true)); Assert.assertEquals("Incorrect text for button with null bean, User value only", USER_VALUE, getButtonText(false, false, false, true, true, true)); Assert.assertEquals("Incorrect text for button with null bean, Shared text, user value", SHARED_TEXT, getButtonText(true, false, false, true, true, true)); Assert.assertEquals("Incorrect text for button with null bean, User text, user value", USER_TEXT, getButtonText(false, true, false, true, true, true)); Assert.assertEquals( "Incorrect text for button with null bean, Shared + user text, user value", USER_TEXT, getButtonText(true, true, false, true, true, true)); Assert.assertEquals("Incorrect text for button with null bean, Shared + user value", USER_VALUE, getButtonText(false, false, true, true, true, true)); Assert.assertEquals( "Incorrect text for button with null bean, Shared text, shared + user value", SHARED_TEXT, getButtonText(true, false, true, true, true, true)); Assert.assertEquals( "Incorrect text for button with null bean, User text, shared + user value", USER_TEXT, getButtonText(false, true, true, true, true, true)); Assert.assertEquals( "Incorrect text for button with null bean, Shared + user text, shared + user value", USER_TEXT, getButtonText(true, true, true, true, true, true)); Assert.assertEquals("Incorrect text for button with Bean only", BEAN_VALUE, getButtonText(false, false, false, false, true, false)); Assert.assertEquals("Incorrect text for button with bean, Shared text", SHARED_TEXT, getButtonText(true, false, false, false, true, false)); Assert.assertEquals("Incorrect text for button with bean, User text", USER_TEXT, getButtonText(false, true, false, false, true, false)); Assert.assertEquals("Incorrect text for button with bean, User + shared text", USER_TEXT, getButtonText(true, true, false, false, true, false)); Assert.assertEquals("Incorrect text for button with bean, Shared value only", BEAN_VALUE, getButtonText(false, false, true, false, true, false)); Assert.assertEquals("Incorrect text for button with bean, Shared text, shared value", SHARED_TEXT, getButtonText(true, false, true, false, true, false)); Assert.assertEquals("Incorrect text for button with bean, User text, shared value", USER_TEXT, getButtonText(false, true, true, false, true, false)); Assert.assertEquals("Incorrect text for button with bean, Shared + user text, shared value", USER_TEXT, getButtonText(true, true, true, false, true, false)); Assert.assertEquals("Incorrect text for button with bean, User value only", USER_VALUE, getButtonText(false, false, false, true, true, false)); Assert.assertEquals("Incorrect text for button with bean, Shared text, user value", SHARED_TEXT, getButtonText(true, false, false, true, true, false)); Assert.assertEquals("Incorrect text for button with bean, User text, user value", USER_TEXT, getButtonText(false, true, false, true, true, false)); Assert.assertEquals("Incorrect text for button with bean, Shared + user text, user value", USER_TEXT, getButtonText(true, true, false, true, true, false)); Assert.assertEquals("Incorrect text for button with bean, Shared + user value", USER_VALUE, getButtonText(false, false, true, true, true, false)); Assert.assertEquals("Incorrect text for button with bean, Shared text, shared + user value", SHARED_TEXT, getButtonText(true, false, true, true, true, false)); Assert.assertEquals("Incorrect text for button with bean, User text, shared + user value", USER_TEXT, getButtonText(false, true, true, true, true, false)); Assert.assertEquals( "Incorrect text for button with bean, Shared + user text, shared + user value", USER_TEXT, getButtonText(true, true, true, true, true, false)); } @Test public void testGetValue() { Assert.assertEquals("Incorrect value for button with nothing", WButton.NO_VALUE, getButtonValue(false, false, false, false, false, false)); Assert.assertEquals("Incorrect value for button with Shared text", SHARED_TEXT, getButtonValue(true, false, false, false, false, false)); Assert.assertEquals("Incorrect value for button with User text", USER_TEXT, getButtonValue(false, true, false, false, false, false)); Assert.assertEquals("Incorrect value for button with User + shared text", USER_TEXT, getButtonValue(true, true, false, false, false, false)); Assert.assertEquals("Incorrect value for button with Shared value only", SHARED_VALUE, getButtonValue(false, false, true, false, false, false)); Assert.assertEquals("Incorrect value for button with Shared text, shared value", SHARED_VALUE, getButtonValue(true, false, true, false, false, false)); Assert.assertEquals("Incorrect value for button with User text, shared value", SHARED_VALUE, getButtonValue(false, true, true, false, false, false)); Assert.assertEquals("Incorrect value for button with Shared + user text, shared value", SHARED_VALUE, getButtonValue(true, true, true, false, false, false)); Assert.assertEquals("Incorrect value for button with User value only", USER_VALUE, getButtonValue(false, false, false, true, false, false)); Assert.assertEquals("Incorrect value for button with Shared text, user value", USER_VALUE, getButtonValue(true, false, false, true, false, false)); Assert.assertEquals("Incorrect value for button with User text, user value", USER_VALUE, getButtonValue(false, true, false, true, false, false)); Assert.assertEquals("Incorrect value for button with Shared + user text, user value", USER_VALUE, getButtonValue(true, true, false, true, false, false)); Assert.assertEquals("Incorrect value for button with Shared + user value", USER_VALUE, getButtonValue(false, false, true, true, false, false)); Assert.assertEquals("Incorrect value for button with Shared text, shared + user value", USER_VALUE, getButtonValue(true, false, true, true, false, false)); Assert.assertEquals("Incorrect value for button with User text, shared + user value", USER_VALUE, getButtonValue(false, true, true, true, false, false)); Assert.assertEquals( "Incorrect value for button with Shared + user text, shared + user value", USER_VALUE, getButtonValue(true, true, true, true, false, false)); Assert.assertEquals("Incorrect value for button with null bean only", WButton.NO_VALUE, getButtonValue(false, false, false, false, true, true)); Assert.assertEquals("Incorrect value for button with null bean, Shared text", SHARED_TEXT, getButtonValue(true, false, false, false, true, true)); Assert.assertEquals("Incorrect value for button with null bean, User text", USER_TEXT, getButtonValue(false, true, false, false, true, true)); Assert.assertEquals("Incorrect value for button with null bean, User + shared text", USER_TEXT, getButtonValue(true, true, false, false, true, true)); Assert.assertEquals("Incorrect value for button with null bean, Shared value only", SHARED_VALUE, getButtonValue(false, false, true, false, true, true)); Assert.assertEquals("Incorrect value for button with null bean, Shared text, shared value", SHARED_VALUE, getButtonValue(true, false, true, false, true, true)); Assert.assertEquals("Incorrect value for button with null bean, User text, shared value", SHARED_VALUE, getButtonValue(false, true, true, false, true, true)); Assert.assertEquals( "Incorrect value for button with null bean, Shared + user text, shared value", SHARED_VALUE, getButtonValue(true, true, true, false, true, true)); Assert.assertEquals("Incorrect value for button with null bean, User value only", USER_VALUE, getButtonValue(false, false, false, true, true, true)); Assert.assertEquals("Incorrect value for button with null bean, Shared text, user value", USER_VALUE, getButtonValue(true, false, false, true, true, true)); Assert.assertEquals("Incorrect value for button with null bean, User text, user value", USER_VALUE, getButtonValue(false, true, false, true, true, true)); Assert.assertEquals( "Incorrect value for button with null bean, Shared + user text, user value", USER_VALUE, getButtonValue(true, true, false, true, true, true)); Assert.assertEquals("Incorrect value for button with null bean, Shared + user value", USER_VALUE, getButtonValue(false, false, true, true, true, true)); Assert.assertEquals( "Incorrect value for button with null bean, Shared text, shared + user value", USER_VALUE, getButtonValue(true, false, true, true, true, true)); Assert.assertEquals( "Incorrect value for button with null bean, User text, shared + user value", USER_VALUE, getButtonValue(false, true, true, true, true, true)); Assert.assertEquals( "Incorrect value for button with null bean, Shared + user text, shared + user value", USER_VALUE, getButtonValue(true, true, true, true, true, true)); Assert.assertEquals("Incorrect value for button with Bean only", BEAN_VALUE, getButtonValue(false, false, false, false, true, false)); Assert.assertEquals("Incorrect value for button with bean, Shared text", BEAN_VALUE, getButtonValue(true, false, false, false, true, false)); Assert.assertEquals("Incorrect value for button with bean, User text", BEAN_VALUE, getButtonValue(false, true, false, false, true, false)); Assert.assertEquals("Incorrect value for button with bean, User + shared text", BEAN_VALUE, getButtonValue(true, true, false, false, true, false)); Assert.assertEquals("Incorrect value for button with bean, Shared value only", BEAN_VALUE, getButtonValue(false, false, true, false, true, false)); Assert.assertEquals("Incorrect value for button with bean, Shared text, shared value", BEAN_VALUE, getButtonValue(true, false, true, false, true, false)); Assert.assertEquals("Incorrect value for button with bean, User text, shared value", BEAN_VALUE, getButtonValue(false, true, true, false, true, false)); Assert. assertEquals( "Incorrect value for button with bean, Shared + user text, shared value", BEAN_VALUE, getButtonValue(true, true, true, false, true, false)); Assert.assertEquals("Incorrect value for button with bean, User value only", USER_VALUE, getButtonValue(false, false, false, true, true, false)); Assert.assertEquals("Incorrect value for button with bean, Shared text, user value", USER_VALUE, getButtonValue(true, false, false, true, true, false)); Assert.assertEquals("Incorrect value for button with bean, User text, user value", USER_VALUE, getButtonValue(false, true, false, true, true, false)); Assert.assertEquals("Incorrect value for button with bean, Shared + user text, user value", USER_VALUE, getButtonValue(true, true, false, true, true, false)); Assert.assertEquals("Incorrect value for button with bean, Shared + user value", USER_VALUE, getButtonValue(false, false, true, true, true, false)); Assert. assertEquals( "Incorrect value for button with bean, Shared text, shared + user value", USER_VALUE, getButtonValue(true, false, true, true, true, false)); Assert.assertEquals("Incorrect value for button with bean, User text, shared + user value", USER_VALUE, getButtonValue(false, true, true, true, true, false)); Assert.assertEquals( "Incorrect value for button with bean, Shared + user text, shared + user value", USER_VALUE, getButtonValue(true, true, true, true, true, false)); } @Test public void testClientCommandOnlyAccessors() { assertAccessorsCorrect(new WButton("client"), "clientCommandOnly", false, true, false); } /** * Returns the text for a button created with the given data. * * @param useSharedText true if the button should have shared text * @param useUserText true if the button should have user text * @param useSharedValue true if the button should have a shared value * @param useUserValue true if the button should have a user value * @param useBeanValue true if the button should have a bean provider * @param nullBean true if the provided bean should be null * * @return the button text that will be displayed to the user. */ private String getButtonText(final boolean useSharedText, final boolean useUserText, final boolean useSharedValue, final boolean useUserValue, final boolean useBeanValue, final boolean nullBean) { WButton button = createButton(useSharedText, useUserText, useSharedValue, useUserValue, useBeanValue, nullBean); setActiveContext(createUIContext()); try { button.preparePaintComponent(new MockRequest()); return button.getText(); } finally { UIContextHolder.reset(); } } /** * Returns the value for a button created with the given data. * * @param useSharedText true if the button should have shared text * @param useUserText true if the button should have user text * @param useSharedValue true if the button should have a shared value * @param useUserValue true if the button should have a user value * @param useBeanValue true if the button should have a bean provider * @param nullBean true if the provided bean should be null * * @return the button value will be used for a user. */ private String getButtonValue(final boolean useSharedText, final boolean useUserText, final boolean useSharedValue, final boolean useUserValue, final boolean useBeanValue, final boolean nullBean) { WButton button = createButton(useSharedText, useUserText, useSharedValue, useUserValue, useBeanValue, nullBean); setActiveContext(createUIContext()); try { button.preparePaintComponent(new MockRequest()); return button.getValue(); } finally { UIContextHolder.reset(); } } /** * Creates a button configured to have the given data. * * @param useSharedText true if the button should have shared text * @param useUserText true if the button should have user text * @param useSharedValue true if the button should have a shared value * @param useUserValue true if the button should have a user value * @param useBeanValue true if the button should have a bean provider * @param nullBean true if the provided bean should be null * * @return the button. */ private WButton createButton(final boolean useSharedText, final boolean useUserText, final boolean useSharedValue, final boolean useUserValue, final boolean useBeanValue, final boolean nullBean) { final WButton button = new WButton() { @Override protected void preparePaintComponent(final Request request) { if (!isInitialised()) { if (useUserValue) { setValue(USER_VALUE); } if (useUserText) { setText(USER_TEXT); } setInitialised(true); } super.preparePaintComponent(request); } }; if (useSharedText) { button.setText(SHARED_TEXT); } if (useSharedValue) { button.setValue(SHARED_VALUE); } if (useBeanValue) { button.setBeanProvider(new BeanProvider() { @Override public Object getBean(final BeanProviderBound beanProviderBound) { return nullBean ? null : BEAN_VALUE; } }); } return button; } }
marksreeves/wcomponents
wcomponents-core/src/test/java/com/github/bordertech/wcomponents/WButton_Test.java
Java
gpl-3.0
25,128
[ 30522, 7427, 4012, 1012, 21025, 2705, 12083, 1012, 3675, 15007, 1012, 15868, 25377, 5643, 7666, 1025, 12324, 4012, 1012, 21025, 2705, 12083, 1012, 3675, 15007, 1012, 15868, 25377, 5643, 7666, 1012, 25610, 4904, 2669, 1012, 3746, 26994, 1025, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php // Heading $_['heading_title'] = 'Áp dụng mã giảm giá'; // Text $_['text_coupon'] = 'Coupon(%s):'; $_['text_success'] = 'Thành công: Mã giảm giả của bạn đã được áp dụng!'; // Entry $_['entry_coupon'] = 'Nhập mã giảm giá ở đây:'; // Error $_['error_coupon'] = 'Lỗi: Mã giảm giá không tồn tại, quá hạn hay đã được sử dụng!'; ?>
rongandat/juss
catalog/language/vietnamese/total/coupon.php
PHP
gpl-3.0
401
[ 30522, 1026, 1029, 25718, 1013, 1013, 5825, 1002, 1035, 1031, 1005, 5825, 1035, 2516, 1005, 1033, 1027, 1005, 9706, 29328, 5003, 27699, 2213, 27699, 1005, 1025, 1013, 1013, 3793, 1002, 1035, 1031, 1005, 3793, 1035, 8648, 2239, 1005, 1033, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# Weinmannia intermedia f. tomentosa Pamp. FORM #### Status ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Oxalidales/Cunoniaceae/Weinmannia/Weinmannia intermedia/Weinmannia intermedia tomentosa/README.md
Markdown
apache-2.0
187
[ 30522, 1001, 11417, 2078, 5804, 2401, 6970, 16969, 1042, 1012, 21269, 13663, 3736, 14089, 2361, 1012, 2433, 1001, 1001, 1001, 1001, 3570, 3970, 1001, 1001, 1001, 1001, 2429, 2000, 2248, 3269, 3415, 5950, 1001, 1001, 1001, 1001, 2405, 1999, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
using System; using System.IO; using System.Text; using Public.Common.Lib.Extensions; using Public.Common.Lib.IO.Serialization; namespace Eshunna.Lib.SIFT { public class SiftBinarySerializer : IFileSerializer<SiftFile> { private const int HeaderIntCount = 5; #region Static private static readonly int HeaderByteCount = SiftBinarySerializer.HeaderIntCount * sizeof(Int32); public static SiftFile Deserialize(string filePath) { using (FileStream fStream = new FileStream(filePath, FileMode.Open)) { SiftHeader header = SiftBinarySerializer.DeserializeHeader(fStream); SiftFeature[] features = SiftBinarySerializer.DeserializeFeatures(fStream, header); SiftDescriptor[] descriptors = SiftBinarySerializer.DeserializeDescriptors(fStream, header); byte endByte = SiftBinarySerializer.DerserializeEofMarker(fStream); SiftFile output = new SiftFile(header, features, descriptors) { EndByte = endByte }; return output; } } private static byte DerserializeEofMarker(FileStream fileStream) { int nBytes = 4; byte[] bytes = new byte[nBytes]; fileStream.Read(bytes, 0, nBytes); string eofStr = Encoding.Default.GetString(bytes); string eofMarker = eofStr.Substring(1); if(SiftFile.EndOfFileMarker != eofMarker) { string message = $@"Invalid end-of-file marker found. Expected: {SiftFile.EndOfFileMarker}, found: {eofMarker}"; throw new InvalidDataException(message); } byte output = bytes[0]; return output; } private static void SerializeEofMarker(FileStream fileStream, byte endByte) { byte[] eofBytes = Encoding.Default.GetBytes(SiftFile.EndOfFileMarker); int nBytes = sizeof(Int32); byte[] bytes = new byte[nBytes]; Array.Copy(eofBytes, 0, bytes, 1, eofBytes.Length); // Leave the first byte blank. bytes[0] = endByte; fileStream.Write(bytes, 0, nBytes); } private static SiftDescriptor[] DeserializeDescriptors(FileStream fStream, SiftHeader header) { // Read bytes. int nFeatures = header.NumberOfFeaturePoints; int nDescriptorComponents = header.NumberOfDescriptorComponents; int nBytes = nFeatures * nDescriptorComponents; byte[] bytes = new byte[nBytes]; fStream.Read(bytes, 0, nBytes); // Parse bytes. SiftDescriptor[] output = new SiftDescriptor[nFeatures]; int nDescriptorBytes = nDescriptorComponents * sizeof(byte); for (int iFeature = 0; iFeature < nFeatures; iFeature++) { byte[] components = new byte[nDescriptorComponents]; Array.Copy(bytes, iFeature * nDescriptorBytes, components, 0, nDescriptorBytes); SiftDescriptor descriptor = new SiftDescriptor(components); output[iFeature] = descriptor; } return output; } private static void SerializeDescriptors(FileStream fStream, SiftDescriptor[] descriptors) { foreach (var descriptor in descriptors) { fStream.Write(descriptor.Components, 0, descriptor.Components.Length); } } private static SiftFeature[] DeserializeFeatures(FileStream fStream, SiftHeader header) { // Read bytes. int nFeatures = header.NumberOfFeaturePoints; int valueSize = sizeof(float); int nBytes = nFeatures * header.NumberOfFeatureProperties * valueSize; byte[] bytes = new byte[nBytes]; fStream.Read(bytes, 0, nBytes); // Parse bytes. int xOffset = 0 * valueSize; int yOffset = 1 * valueSize; int colorOffset = 2 * valueSize; int scaleOffset = 3 * valueSize; int orientationOffset = 4 * valueSize; SiftFeature[] output = new SiftFeature[nFeatures]; int iByte = 0; for (int iFeature = 0; iFeature < nFeatures; iFeature++, iByte += 5 * valueSize) { float x = BitConverter.ToSingle(bytes, iByte + xOffset); float y = BitConverter.ToSingle(bytes, iByte + yOffset); byte red = bytes[iByte + colorOffset + 0]; byte green = bytes[iByte + colorOffset + 1]; byte blue = bytes[iByte + colorOffset + 2]; byte alpha = bytes[iByte + colorOffset + 3]; ColorAlpha color = new ColorAlpha(red, green, blue, alpha); float scale = BitConverter.ToSingle(bytes, iByte + scaleOffset); float orientation = BitConverter.ToSingle(bytes, iByte + orientationOffset); SiftFeature feature = new SiftFeature(x, y, scale, orientation, color); output[iFeature] = feature; } return output; } private static void SerializeSiftFeatures(FileStream fStream, SiftFeature[] features) { int valueSize = sizeof(float); int nBytes = SiftFile.HeaderPropertyNumber * valueSize; byte[] bytes = new byte[nBytes]; int xOffset = 0 * valueSize; int yOffset = 1 * valueSize; int colorOffset = 2 * valueSize; int scaleOffset = 3 * valueSize; int orientationOffset = 4 * valueSize; foreach(var feature in features) { byte[] xBytes = BitConverter.GetBytes(feature.X); Array.Copy(xBytes, 0, bytes, xOffset, valueSize); byte[] yBytes = BitConverter.GetBytes(feature.Y); Array.Copy(yBytes, 0, bytes, yOffset, valueSize); byte[] colorBytes = new byte[] { feature.Color.Red, feature.Color.Green, feature.Color.Blue, feature.Color.Alpha }; Array.Copy(colorBytes, 0, bytes, colorOffset, valueSize); byte[] scaleBytes = BitConverter.GetBytes(feature.Scale); Array.Copy(scaleBytes, 0, bytes, scaleOffset, valueSize); byte[] orientationBytes = BitConverter.GetBytes(feature.Orientation); Array.Copy(orientationBytes, 0, bytes, orientationOffset, valueSize); fStream.Write(bytes, 0, nBytes); } } private static SiftHeader DeserializeHeader(FileStream fStream) { // Read bytes. byte[] bytes = new byte[SiftBinarySerializer.HeaderByteCount]; fStream.Read(bytes, 0, SiftBinarySerializer.HeaderByteCount); // Parse bytes. string siftFileMarker = Encoding.Default.GetString(bytes, 0, sizeof(Int32)); if(SiftFile.SiftFileMarker != siftFileMarker) // Check that we have a SIFT file. { string message = $@"Invalid SIFT file marker: expected: {SiftFile.SiftFileMarker}, found: {siftFileMarker}."; throw new InvalidDataException(message); } string vVersionStr = Encoding.Default.GetString(bytes, sizeof(Int32), sizeof(Int32)); string vStr = vVersionStr.Substring(0, 1); if(SiftFile.VersionMarker != vStr) // Check that the version string begins with V. { string message = $@"Invalid file version marker: expected {SiftFile.VersionMarker}, found: {vStr}"; throw new InvalidDataException(message); } string versionStr = vVersionStr.Substring(1); // Remove the V prefix. Version version = Version.Parse(versionStr); int nPoints = BitConverter.ToInt32(bytes, 2 * sizeof(Int32)); int nFeatureProperties = BitConverter.ToInt32(bytes, 3 * sizeof(Int32)); int nDescriptorComponents = BitConverter.ToInt32(bytes, 4 * sizeof(Int32)); SiftHeader output = new SiftHeader(siftFileMarker, version, nPoints, nFeatureProperties, nDescriptorComponents); return output; } private static void SerializeHeader(FileStream fStream, SiftHeader header) { byte[][] bytes = new byte[SiftFile.HeaderPropertyNumber][]; byte[] nameBytes = Encoding.Default.GetBytes(header.Name); bytes[0] = nameBytes; string versionStr = $@"V{header.Version.ToString()}"; byte[] versionBytes = Encoding.Default.GetBytes(versionStr); bytes[1] = versionBytes; byte[] nPointsBytes = BitConverter.GetBytes(header.NumberOfFeaturePoints); bytes[2] = nPointsBytes; byte[] nFeaturePropertyBytes = BitConverter.GetBytes(SiftFile.HeaderPropertyNumber); bytes[3] = nFeaturePropertyBytes; byte[] nDescriptorComponentBytes = BitConverter.GetBytes(header.NumberOfDescriptorComponents); bytes[4] = nDescriptorComponentBytes; byte[] bytesToWrite = bytes.Flatten(); fStream.Write(bytesToWrite, 0, bytesToWrite.Length); } public static void Serialize(string filePath, SiftFile siftFile, bool overwrite = true) { FileMode fileMode = FileMode.Create; if (!overwrite) { fileMode = FileMode.CreateNew; } using (FileStream fStream = new FileStream(filePath, fileMode)) // Will allow the familiar error to percolate upwards if no overwriting. { SiftBinarySerializer.SerializeHeader(fStream, siftFile.Header); SiftBinarySerializer.SerializeSiftFeatures(fStream, siftFile.Features); SiftBinarySerializer.SerializeDescriptors(fStream, siftFile.Descriptors); SiftBinarySerializer.SerializeEofMarker(fStream, siftFile.EndByte); } } #endregion public SiftFile this[string filePath, bool overwrite = true] { get { var output = SiftBinarySerializer.Deserialize(filePath); return output; } set { SiftBinarySerializer.Serialize(filePath, value, overwrite); } } } }
MinexAutomation/Public
Source/Malachite/Scripts/Eshunna/Eshunna.Lib/Code/SIFT/SiftBinarySerializer.cs
C#
mit
10,814
[ 30522, 2478, 2291, 1025, 2478, 2291, 1012, 22834, 1025, 2478, 2291, 1012, 3793, 1025, 2478, 2270, 1012, 2691, 1012, 5622, 2497, 1012, 14305, 1025, 2478, 2270, 1012, 2691, 1012, 5622, 2497, 1012, 22834, 1012, 7642, 3989, 1025, 3415, 15327, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
.icon-start { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe800;&nbsp;'); } .icon-stop { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe801;&nbsp;'); } .icon-step-next { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe803;&nbsp;'); } .icon-step-prev { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe804;&nbsp;'); }
OneraHub/XDSMjs
fontello/css/fontello-ie7-codes.css
CSS
apache-2.0
423
[ 30522, 1012, 12696, 1011, 2707, 1063, 1008, 24095, 1024, 3670, 1006, 2023, 1012, 2448, 7292, 21756, 2571, 1031, 1005, 24095, 1005, 1033, 1027, 1005, 1015, 1005, 1010, 2023, 1012, 5110, 11039, 19968, 1027, 1005, 1004, 1001, 1060, 2063, 17914...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
require 'vcr' VCR.configure do |c| c.cassette_library_dir = 'spec/fixtures/vcr_cassettes' c.hook_into :webmock c.configure_rspec_metadata! end
imacchiato/bloom_net_central_client-ruby
spec/support/vcr.rb
Ruby
mit
150
[ 30522, 5478, 1005, 18315, 2099, 1005, 18315, 2099, 1012, 9530, 8873, 27390, 2063, 2079, 1064, 1039, 1064, 1039, 1012, 13903, 1035, 3075, 1035, 16101, 1027, 1005, 28699, 1013, 17407, 1013, 18315, 2099, 1035, 13903, 2015, 1005, 1039, 1012, 81...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * Copyright (C) 2020 Niek Linnenbank * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef __LIB_LIBRUNTIME_CORECLIENT_H #define __LIB_LIBRUNTIME_CORECLIENT_H #include <FreeNOS/API/ProcessID.h> #include <Types.h> #include "Core.h" struct CoreMessage; /** * @addtogroup lib * @{ * * @addtogroup libruntime * @{ */ /** * CoreClient provides a simple interface to a CoreServer. * * @see CoreServer */ class CoreClient { public: /** * Class constructor function. * * @param pid Optional ProcessID of the CoreServer. */ CoreClient(const ProcessID pid = CORESRV_PID); /** * Get number of processor cores in the system. * * @param numCores On output, contains the number of processor cores. * * @return Result code */ Core::Result getCoreCount(Size &numCores) const; /** * Create a new process on a different core. * * @param coreId Specifies the core on which the process will be created. * @param programAddr Virtual address of the loaded program to start. * @param programSize Size of the loaded program in bytes. * @param programCmd Command-line string for starting the program. * * @return Result code */ Core::Result createProcess(const Size coreId, const Address programAddr, const Size programSize, const char *programCmd) const; private: /** * Send an IPC request to the CoreServer * * @param msg Reference to the CoreMessage to send * * @return Result code */ Core::Result request(CoreMessage &msg) const; private: /** ProcessID of the CoreServer */ const ProcessID m_pid; }; /** * @} * @} */ #endif /* __LIB_LIBRUNTIME_CORECLIENT_H */
nieklinnenbank/FreeNOS
lib/libruntime/CoreClient.h
C
gpl-3.0
2,441
[ 30522, 1013, 1008, 1008, 9385, 1006, 1039, 1007, 12609, 9152, 5937, 11409, 10224, 9299, 1008, 1008, 2023, 2565, 2003, 2489, 4007, 1024, 2017, 2064, 2417, 2923, 3089, 8569, 2618, 2009, 1998, 1013, 2030, 19933, 1008, 2009, 2104, 1996, 3408, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
"""Test Home Assistant json utility functions.""" from json import JSONEncoder import os import sys from tempfile import mkdtemp import unittest from unittest.mock import Mock import pytest from homeassistant.exceptions import HomeAssistantError from homeassistant.util.json import SerializationError, load_json, save_json # Test data that can be saved as JSON TEST_JSON_A = {"a": 1, "B": "two"} TEST_JSON_B = {"a": "one", "B": 2} # Test data that can not be saved as JSON (keys must be strings) TEST_BAD_OBJECT = {("A",): 1} # Test data that can not be loaded as JSON TEST_BAD_SERIALIED = "THIS IS NOT JSON\n" TMP_DIR = None def setup(): """Set up for tests.""" global TMP_DIR TMP_DIR = mkdtemp() def teardown(): """Clean up after tests.""" for fname in os.listdir(TMP_DIR): os.remove(os.path.join(TMP_DIR, fname)) os.rmdir(TMP_DIR) def _path_for(leaf_name): return os.path.join(TMP_DIR, leaf_name + ".json") def test_save_and_load(): """Test saving and loading back.""" fname = _path_for("test1") save_json(fname, TEST_JSON_A) data = load_json(fname) assert data == TEST_JSON_A # Skipped on Windows @unittest.skipIf( sys.platform.startswith("win"), "private permissions not supported on Windows" ) def test_save_and_load_private(): """Test we can load private files and that they are protected.""" fname = _path_for("test2") save_json(fname, TEST_JSON_A, private=True) data = load_json(fname) assert data == TEST_JSON_A stats = os.stat(fname) assert stats.st_mode & 0o77 == 0 def test_overwrite_and_reload(): """Test that we can overwrite an existing file and read back.""" fname = _path_for("test3") save_json(fname, TEST_JSON_A) save_json(fname, TEST_JSON_B) data = load_json(fname) assert data == TEST_JSON_B def test_save_bad_data(): """Test error from trying to save unserialisable data.""" fname = _path_for("test4") with pytest.raises(SerializationError): save_json(fname, TEST_BAD_OBJECT) def test_load_bad_data(): """Test error from trying to load unserialisable data.""" fname = _path_for("test5") with open(fname, "w") as fh: fh.write(TEST_BAD_SERIALIED) with pytest.raises(HomeAssistantError): load_json(fname) def test_custom_encoder(): """Test serializing with a custom encoder.""" class MockJSONEncoder(JSONEncoder): """Mock JSON encoder.""" def default(self, o): """Mock JSON encode method.""" return "9" fname = _path_for("test6") save_json(fname, Mock(), encoder=MockJSONEncoder) data = load_json(fname) assert data == "9"
leppa/home-assistant
tests/util/test_json.py
Python
apache-2.0
2,695
[ 30522, 1000, 1000, 1000, 3231, 2188, 3353, 1046, 3385, 9710, 4972, 1012, 1000, 1000, 1000, 2013, 1046, 3385, 12324, 1046, 3385, 2368, 16044, 2099, 12324, 9808, 12324, 25353, 2015, 2013, 8915, 8737, 8873, 2571, 12324, 12395, 11927, 6633, 236...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# frozen_string_literal: true # This class is used to reprensent an entry within a {SearchResponse}. It can describe either an anime or a manga. # # @example # require 'myanimelist_client' # # client = MyanimelistClient.new 'username', 'password' # # client.search_anime('anime name').each do |entry| # # entry is a SearchResponse. # # # It exposes all its attributes: # entry.id # => String or nil # entry.title # => String or nil # entry.english # => String or nil # entry.synonyms # => String or nil # entry.episodes # => Fixnum or nil # entry.chapters # => Fixnum or nil # entry.volumes # => Fixnum or nil # entry.score # => Float or nil # entry.type # => String or nil # entry.status # => String or nil # entry.start_date # => String or nil # entry.end_date # => String or nil # entry.synopsis # => String or nil # entry.image # => String or nil # # # It provides some useful predicates: # entry.manga? # => true or false # entry.anime? # => true or false # entry.upcoming? # => true or false # entry.ongoing? # => true or false # entry.finished? # => true or false # # # It can be converted to a hash: # entry.to_h # => Hash # end # # @attr [String, nil] id Returns the ID. # @attr [String, nil] title Returns the title. # @attr [String, nil] english Returns the english title. # @attr [String, nil] synonyms Returns the synonyms. # @attr [Fixnum, nil] episodes Returns the number of episodes (+nil+ when the entry describes a manga). # @attr [Fixnum, nil] chapters Returns the number of chapters (+nil+ when the entry describes an anime). # @attr [Fixnum, nil] volumes Returns the number of volumes (+nil+ when the entry describes an anime). # @attr [Float, nil] score Returns the score. # @attr [String, nil] type Returns the type. # @attr [String, nil] status Returns the status. # @attr [String, nil] start_date Returns the start date. # @attr [String, nil] end_date Returns the end date. # @attr [String, nil] synopsis Returns the synopsis. # @attr [String, nil] image Returns the image's URL. # class MyanimelistClient::SearchEntry # The list of attributes defining the entry for internal usage. ATTRIBUTES = %w( id title english synonyms episodes chapters volumes score type status start_date end_date synopsis image ) # attr_reader *ATTRIBUTES # this line cause a warning in yard send :attr_reader, *ATTRIBUTES # this line doesn't... :/ # @param [Hash] options A hash used to hydrate the object. def initialize options={} ATTRIBUTES.each do |attribute| instance_variable_set "@#{attribute}", options[attribute] || options[attribute.to_sym] end end # Creates a hash representing the entry. # @return [Hash] def to_h values = ATTRIBUTES.map{ |attribute| send attribute } Hash[ATTRIBUTES.zip values] end # Performs a loose equality based on the value of the attributes (see {ATTRIBUTES}). def == other ATTRIBUTES.each do |attribute| if !other.respond_to?(attribute) || send(attribute) != other.send(attribute) return false end end true end # Returns +true+ when the entry describes an anime. def anime? @episodes.to_i > 0 end # Returns +true+ when the entry describes a manga. def manga? @chapters.to_i > 0 || @volumes.to_i > 0 end # Returns +true+ when the anime is not yet aired / when the manga is not yet published. def upcoming? !!(/not\s+yet/i =~ @status) end # Returns +true+ when the anime is currently airing / when the manga is currently publishing. def ongoing? !!(/currently|publishing/i =~ @status) end # Returns +true+ when the anime or manga is finished. def finished? !!(/finished/i =~ @status) end end
Oli4242/myanimelist_client
lib/myanimelist_client/search_entry.rb
Ruby
mit
4,096
[ 30522, 1001, 7708, 1035, 5164, 1035, 18204, 1024, 2995, 1001, 2023, 2465, 2003, 2109, 2000, 16360, 7389, 5054, 2102, 2019, 4443, 2306, 1037, 1063, 3945, 6072, 26029, 3366, 1065, 1012, 2009, 2064, 6235, 2593, 2019, 8750, 2030, 1037, 8952, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
import React, { Component, ComponentType } from 'react' import { getBoundsForNode, TComputedBounds, TGetBoundsForNodeArgs } from './utils' import { TSelectableItemState, TSelectableItemProps } from './Selectable.types' import { SelectableGroupContext } from './SelectableGroup.context' type TAddedProps = Partial<Pick<TSelectableItemProps, 'isSelected'>> export const createSelectable = <T extends any>( WrappedComponent: ComponentType<TSelectableItemProps & T> ): ComponentType<T & TAddedProps> => class SelectableItem extends Component<T & TAddedProps, TSelectableItemState> { static contextType = SelectableGroupContext static defaultProps = { isSelected: false, } state = { isSelected: this.props.isSelected, isSelecting: false, } node: HTMLElement | null = null bounds: TComputedBounds[] | null = null componentDidMount() { this.updateBounds() this.context.selectable.register(this) } componentWillUnmount() { this.context.selectable.unregister(this) } updateBounds = (containerScroll?: TGetBoundsForNodeArgs) => { this.bounds = getBoundsForNode(this.node!, containerScroll) } getSelectableRef = (ref: HTMLElement | null) => { this.node = ref } render() { return ( <WrappedComponent {...this.props} {...this.state} selectableRef={this.getSelectableRef} /> ) } }
valerybugakov/react-selectable-fast
src/CreateSelectable.tsx
TypeScript
mit
1,421
[ 30522, 12324, 10509, 1010, 1063, 6922, 1010, 6922, 13874, 1065, 2013, 1005, 10509, 1005, 12324, 1063, 2131, 15494, 22747, 26295, 3207, 1010, 22975, 25377, 12926, 15494, 2015, 1010, 1056, 18150, 15494, 22747, 26295, 3207, 2906, 5620, 1065, 201...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/** * Copyright (C) 2005-2013, Stefan Strömberg <stefangs@nethome.nu> * * This file is part of OpenNetHome (http://www.nethome.nu) * * OpenNetHome is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * OpenNetHome is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package nu.nethome.home.items.nexa; import nu.nethome.home.item.HomeItem; import nu.nethome.home.item.HomeItemType; import nu.nethome.home.items.RemapButton; import nu.nethome.home.system.Event; import nu.nethome.util.plugin.Plugin; /** * @author Stefan */ @SuppressWarnings("UnusedDeclaration") @Plugin @HomeItemType(value = "Controls", creationEvents = "Nexa_Message") public class NexaRemapButton extends RemapButton implements HomeItem { private static final String MODEL = ("<?xml version = \"1.0\"?> \n" + "<HomeItem Class=\"NexaRemapButton\" Category=\"Controls\" >" + " <Attribute Name=\"State\" Type=\"String\" Get=\"getState\" Init=\"setState\" Default=\"true\" />" + " <Attribute Name=\"HouseCode\" Type=\"StringList\" Get=\"getHouseCode\" Set=\"setHouseCode\" >" + " <item>A</item> <item>B</item> <item>C</item> <item>D</item> <item>E</item> <item>F</item> <item>G</item> <item>H</item> </Attribute>" + " <Attribute Name=\"Button\" Type=\"StringList\" Get=\"getButton\" Set=\"setButton\" >" + " <item>1</item> <item>2</item> <item>3</item> <item>4</item> <item>5</item> <item>6</item> <item>7</item> <item>8</item> </Attribute>" + " <Attribute Name=\"OnCommand\" Type=\"Command\" Get=\"getOnCommand\" Set=\"setOnCommand\" />" + " <Attribute Name=\"OffCommand\" Type=\"Command\" Get=\"getOffCommand\" Set=\"setOffCommand\" />" + " <Attribute Name=\"HoldOffTime\" Type=\"StringList\" Get=\"getHoldOffTime\" Set=\"setHoldOffTime\" >" + " <item>0</item> <item>100</item> <item>150</item> <item>200</item> <item>300</item> <item>400</item> </Attribute>" + " <Action Name=\"on\" Method=\"on\" />" + " <Action Name=\"off\" Method=\"off\" />" + " <Action Name=\"enable\" Method=\"enable\" />" + " <Action Name=\"disable\" Method=\"disable\" />" + "</HomeItem> "); // Public attributes private int buttonHouseCode = 0; private int buttonNumber = 1; public NexaRemapButton() { } public boolean receiveEvent(Event event) { // Check the event and see if they affect our current state. if (event.getAttribute(Event.EVENT_TYPE_ATTRIBUTE).equals("Nexa_Message") && event.getAttribute("Direction").equals("In") && (event.getAttributeInt("Nexa.HouseCode") == buttonHouseCode) && (event.getAttributeInt("Nexa.Button") == buttonNumber)) { processEvent(event); return true; } else { return handleInit(event); } } @Override protected boolean initAttributes(Event event) { buttonHouseCode = event.getAttributeInt("Nexa.HouseCode"); buttonNumber = event.getAttributeInt("Nexa.Button"); return true; } @Override protected void actOnEvent(Event event) { if (event.getAttribute("Nexa.Command").equals("1")) { this.on(); } else { this.off(); } } public String getModel() { return MODEL; } /** * @return Returns the deviceCode. */ @SuppressWarnings("UnusedDeclaration") public String getButton() { return Integer.toString(buttonNumber); } /** * @param deviceCode The deviceCode to set. */ @SuppressWarnings("UnusedDeclaration") public void setButton(String deviceCode) { try { int result = Integer.parseInt(deviceCode); if ((result > 0) && (result <= 8)) { buttonNumber = result; } } catch (NumberFormatException e) { // Ignore } } /** * @return Returns the houseCode. */ @SuppressWarnings("UnusedDeclaration") public String getHouseCode() { if ((buttonHouseCode >= 0) && (buttonHouseCode <= 7)) { return Character.toString("ABCDEFGH".charAt(buttonHouseCode)); } return "A"; } /** * @param houseCode The HouseCode to set. */ @SuppressWarnings("UnusedDeclaration") public void setHouseCode(String houseCode) { String hc = houseCode.toUpperCase(); if ((hc.length() == 1) && (hc.compareTo("A") >= 0) && (hc.compareTo("H") <= 0)) { buttonHouseCode = (int) hc.charAt(0) - (int) 'A'; } } }
SourceCodeSourcerer/NetHomeServer
home-items/rf-items/src/main/java/nu/nethome/home/items/nexa/NexaRemapButton.java
Java
gpl-3.0
5,234
[ 30522, 1013, 1008, 1008, 1008, 9385, 1006, 1039, 1007, 2384, 1011, 2286, 1010, 8852, 2358, 21716, 4059, 1026, 8852, 5620, 1030, 5658, 23393, 2063, 1012, 16371, 1028, 1008, 1008, 2023, 5371, 2003, 2112, 1997, 2330, 7159, 23393, 2063, 1006, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// Copyright 2012 Room77, Inc. // Author: Uygar Oztekin #include "base/common.h" // intercept memory allocation failures and force a stack trace struct InitNewHandler { static void NewHandler () { cout << "\n*** Memory allocation Failed! About to segfault ***" << endl; // Cause a segfault. void* ptr = nullptr; // Create a var to get around enabled compiler warning. *static_cast<int*>(ptr) = 0; } InitNewHandler() { set_new_handler(InitNewHandler::NewHandler); } } auto_init_new_handler;
room77/77up
public/util/memory/new_handler.cc
C++
mit
514
[ 30522, 1013, 1013, 9385, 2262, 2282, 2581, 2581, 1010, 4297, 1012, 1013, 1013, 3166, 1024, 1057, 2100, 6843, 11472, 23125, 2378, 1001, 2421, 1000, 2918, 1013, 2691, 1012, 1044, 1000, 1013, 1013, 19115, 3638, 16169, 15428, 1998, 2486, 1037, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * Copyright (c) 2014 - present Adobe Systems Incorporated. All rights reserved. * * 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. * */ /*jslint regexp: true */ /*global describe, it, expect, beforeFirst, afterLast, beforeEach, afterEach, waits, waitsFor, waitsForDone, runs, spyOn */ define(function (require, exports, module) { "use strict"; var Commands = require("command/Commands"), KeyEvent = require("utils/KeyEvent"), SpecRunnerUtils = require("spec/SpecRunnerUtils"), FileSystemError = require("filesystem/FileSystemError"), FileUtils = require("file/FileUtils"), FindUtils = require("search/FindUtils"), Async = require("utils/Async"), LanguageManager = require("language/LanguageManager"), StringUtils = require("utils/StringUtils"), Strings = require("strings"), _ = require("thirdparty/lodash"); var PreferencesManager; var promisify = Async.promisify; // for convenience describe("FindInFiles", function () { this.category = "integration"; var defaultSourcePath = SpecRunnerUtils.getTestPath("/spec/FindReplace-test-files"), testPath, nextFolderIndex = 1, searchResults, CommandManager, DocumentManager, MainViewManager, EditorManager, FileFilters, FileSystem, File, FindInFiles, FindInFilesUI, ProjectManager, testWindow, $; beforeFirst(function () { SpecRunnerUtils.createTempDirectory(); // Create a new window that will be shared by ALL tests in this spec. SpecRunnerUtils.createTestWindowAndRun(this, function (w) { testWindow = w; // Load module instances from brackets.test CommandManager = testWindow.brackets.test.CommandManager; DocumentManager = testWindow.brackets.test.DocumentManager; EditorManager = testWindow.brackets.test.EditorManager; FileFilters = testWindow.brackets.test.FileFilters; FileSystem = testWindow.brackets.test.FileSystem; File = testWindow.brackets.test.File; FindInFiles = testWindow.brackets.test.FindInFiles; FindInFilesUI = testWindow.brackets.test.FindInFilesUI; ProjectManager = testWindow.brackets.test.ProjectManager; MainViewManager = testWindow.brackets.test.MainViewManager; $ = testWindow.$; PreferencesManager = testWindow.brackets.test.PreferencesManager; PreferencesManager.set("findInFiles.nodeSearch", false); PreferencesManager.set("findInFiles.instantSearch", false); }); }); afterLast(function () { CommandManager = null; DocumentManager = null; EditorManager = null; FileSystem = null; File = null; FindInFiles = null; FindInFilesUI = null; ProjectManager = null; MainViewManager = null; $ = null; testWindow = null; PreferencesManager = null; SpecRunnerUtils.closeTestWindow(); SpecRunnerUtils.removeTempDirectory(); }); function openProject(sourcePath) { testPath = sourcePath; SpecRunnerUtils.loadProjectInTestWindow(testPath); } // Note: these utilities can be called without wrapping in a runs() block, because all their top-level // statements are calls to runs() or waitsFor() (or other functions that make the same guarantee). But after // calling one of these, calls to other Jasmine APIs (e.g. such as expects()) *must* be wrapped in runs(). function waitForSearchBarClose() { // Make sure search bar from previous test has animated out fully waitsFor(function () { return $(".modal-bar").length === 0; }, "search bar close"); } function openSearchBar(scope, showReplace) { runs(function () { FindInFiles._searchDone = false; FindInFilesUI._showFindBar(scope, showReplace); }); waitsFor(function () { return $(".modal-bar").length === 1; }, "search bar open"); runs(function () { // Reset the regexp and case-sensitivity toggles. ["#find-regexp", "#find-case-sensitive"].forEach(function (button) { if ($(button).is(".active")) { $(button).click(); expect($(button).is(".active")).toBe(false); } }); }); } function closeSearchBar() { runs(function () { FindInFilesUI._closeFindBar(); }); waitForSearchBarClose(); } function executeSearch(searchString) { runs(function () { var $searchField = $("#find-what"); $searchField.val(searchString).trigger("input"); SpecRunnerUtils.simulateKeyEvent(KeyEvent.DOM_VK_RETURN, "keydown", $searchField[0]); }); waitsFor(function () { return FindInFiles._searchDone; }, "Find in Files done"); } function numMatches(results) { return _.reduce(_.pluck(results, "matches"), function (sum, matches) { return sum + matches.length; }, 0); } function doSearch(options) { runs(function () { FindInFiles.doSearchInScope(options.queryInfo, null, null, options.replaceText).done(function (results) { searchResults = results; }); }); waitsFor(function () { return searchResults; }, 1000, "search completed"); runs(function () { expect(numMatches(searchResults)).toBe(options.numMatches); }); } // The functions below are *not* safe to call without wrapping in runs(), if there were any async steps previously // (including calls to any of the utilities above) function doReplace(options) { return FindInFiles.doReplace(searchResults, options.replaceText, { forceFilesOpen: options.forceFilesOpen, isRegexp: options.queryInfo.isRegexp }); } /** * Helper function that calls the given asynchronous processor once on each file in the given subtree * and returns a promise that's resolved when all files are processed. * @param {string} rootPath The root of the subtree to search. * @param {function(string, string): $.Promise} processor The function that processes each file. Args are: * contents: the contents of the file * fullPath: the full path to the file on disk * @return {$.Promise} A promise that is resolved when all files are processed, or rejected if there was * an error reading one of the files or one of the process steps was rejected. */ function visitAndProcessFiles(rootPath, processor) { var rootEntry = FileSystem.getDirectoryForPath(rootPath), files = []; function visitor(file) { if (!file.isDirectory) { // Skip binary files, since we don't care about them for these purposes and we can't read them // to get their contents. if (!LanguageManager.getLanguageForPath(file.fullPath).isBinary()) { files.push(file); } } return true; } return promisify(rootEntry, "visit", visitor).then(function () { return Async.doInParallel(files, function (file) { return promisify(file, "read").then(function (contents) { return processor(contents, file.fullPath); }); }); }); } function ensureParentExists(file) { var parentDir = FileSystem.getDirectoryForPath(file.parentPath); return promisify(parentDir, "exists").then(function (exists) { if (!exists) { return promisify(parentDir, "create"); } return null; }); } function copyWithLineEndings(src, dest, lineEndings) { function copyOneFileWithLineEndings(contents, srcPath) { var destPath = dest + srcPath.slice(src.length), destFile = FileSystem.getFileForPath(destPath), newContents = FileUtils.translateLineEndings(contents, lineEndings); return ensureParentExists(destFile).then(function () { return promisify(destFile, "write", newContents); }); } return promisify(FileSystem.getDirectoryForPath(dest), "create").then(function () { return visitAndProcessFiles(src, copyOneFileWithLineEndings); }); } // Creates a clean copy of the test project before each test. We don't delete the old // folders as we go along (to avoid problems with deleting the project out from under the // open test window); we just delete the whole temp folder at the end. function openTestProjectCopy(sourcePath, lineEndings) { testPath = SpecRunnerUtils.getTempDirectory() + "/find-in-files-test-" + (nextFolderIndex++); runs(function () { if (lineEndings) { waitsForDone(copyWithLineEndings(sourcePath, testPath, lineEndings), "copy test files with line endings"); } else { // Note that we don't skip image files in this case, but it doesn't matter since we'll // only compare files that have an associated file in the known goods folder. waitsForDone(SpecRunnerUtils.copy(sourcePath, testPath), "copy test files"); } }); SpecRunnerUtils.loadProjectInTestWindow(testPath); } beforeEach(function () { searchResults = null; }); describe("Find", function () { beforeEach(function () { openProject(defaultSourcePath); }); afterEach(closeSearchBar); it("should find all occurences in project", function () { openSearchBar(); executeSearch("foo"); runs(function () { var fileResults = FindInFiles.searchModel.results[testPath + "/bar.txt"]; expect(fileResults).toBeFalsy(); fileResults = FindInFiles.searchModel.results[testPath + "/foo.html"]; expect(fileResults).toBeTruthy(); expect(fileResults.matches.length).toBe(7); fileResults = FindInFiles.searchModel.results[testPath + "/foo.js"]; expect(fileResults).toBeTruthy(); expect(fileResults.matches.length).toBe(4); fileResults = FindInFiles.searchModel.results[testPath + "/css/foo.css"]; expect(fileResults).toBeTruthy(); expect(fileResults.matches.length).toBe(3); }); }); it("should ignore known binary file types", function () { var $dlg, actualMessage, expectedMessage, exists = false, done = false, imageDirPath = testPath + "/images"; runs(function () { // Set project to have only images SpecRunnerUtils.loadProjectInTestWindow(imageDirPath); // Verify an image exists in folder var file = FileSystem.getFileForPath(testPath + "/images/icon_twitter.png"); file.exists(function (fileError, fileExists) { exists = fileExists; done = true; }); }); waitsFor(function () { return done; }, "file.exists"); runs(function () { expect(exists).toBe(true); openSearchBar(); }); runs(function () { // Launch filter editor FileFilters.editFilter({ name: "", patterns: [] }, -1); // Dialog should state there are 0 files in project $dlg = $(".modal"); expectedMessage = StringUtils.format(Strings.FILTER_FILE_COUNT_ALL, 0, Strings.FIND_IN_FILES_NO_SCOPE); }); // Message loads asynchronously, but dialog should eventually state: "Allows all 0 files in project" waitsFor(function () { actualMessage = $dlg.find(".exclusions-filecount").text(); return (actualMessage === expectedMessage); }, "display file count"); runs(function () { // Dismiss filter dialog (OK button is disabled, have to click on Cancel) $dlg.find(".dialog-button[data-button-id='cancel']").click(); // Close search bar var $searchField = $(".modal-bar #find-group input"); SpecRunnerUtils.simulateKeyEvent(KeyEvent.DOM_VK_ESCAPE, "keydown", $searchField[0]); }); runs(function () { // Set project back to main test folder SpecRunnerUtils.loadProjectInTestWindow(testPath); }); }); it("should ignore unreadable files", function () { // Add a nonexistent file to the ProjectManager.getAllFiles() result, which will force a file IO error // when we try to read the file later. Similar errors may arise in real-world for non-UTF files, etc. SpecRunnerUtils.injectIntoGetAllFiles(testWindow, testPath + "/doesNotExist.txt"); openSearchBar(); executeSearch("foo"); runs(function () { expect(Object.keys(FindInFiles.searchModel.results).length).toBe(3); }); }); it("should find all occurences in folder", function () { var dirEntry = FileSystem.getDirectoryForPath(testPath + "/css/"); openSearchBar(dirEntry); executeSearch("foo"); runs(function () { var fileResults = FindInFiles.searchModel.results[testPath + "/bar.txt"]; expect(fileResults).toBeFalsy(); fileResults = FindInFiles.searchModel.results[testPath + "/foo.html"]; expect(fileResults).toBeFalsy(); fileResults = FindInFiles.searchModel.results[testPath + "/foo.js"]; expect(fileResults).toBeFalsy(); fileResults = FindInFiles.searchModel.results[testPath + "/css/foo.css"]; expect(fileResults).toBeTruthy(); expect(fileResults.matches.length).toBe(3); }); }); it("should find all occurences in single file", function () { var fileEntry = FileSystem.getFileForPath(testPath + "/foo.js"); openSearchBar(fileEntry); executeSearch("foo"); runs(function () { var fileResults = FindInFiles.searchModel.results[testPath + "/bar.txt"]; expect(fileResults).toBeFalsy(); fileResults = FindInFiles.searchModel.results[testPath + "/foo.html"]; expect(fileResults).toBeFalsy(); fileResults = FindInFiles.searchModel.results[testPath + "/foo.js"]; expect(fileResults).toBeTruthy(); expect(fileResults.matches.length).toBe(4); fileResults = FindInFiles.searchModel.results[testPath + "/css/foo.css"]; expect(fileResults).toBeFalsy(); }); }); it("should find start and end positions", function () { var filePath = testPath + "/foo.js", fileEntry = FileSystem.getFileForPath(filePath); openSearchBar(fileEntry); executeSearch("callFoo"); runs(function () { var fileResults = FindInFiles.searchModel.results[filePath]; expect(fileResults).toBeTruthy(); expect(fileResults.matches.length).toBe(1); var match = fileResults.matches[0]; expect(match.start.ch).toBe(13); expect(match.start.line).toBe(6); expect(match.end.ch).toBe(20); expect(match.end.line).toBe(6); }); }); it("should keep dialog and show panel when there are results", function () { var filePath = testPath + "/foo.js", fileEntry = FileSystem.getFileForPath(filePath); openSearchBar(fileEntry); executeSearch("callFoo"); // With instant search, the Search Bar should not close on a search runs(function () { var fileResults = FindInFiles.searchModel.results[filePath]; expect(fileResults).toBeTruthy(); expect($("#find-in-files-results").is(":visible")).toBeTruthy(); expect($(".modal-bar").length).toBe(1); }); }); it("should keep dialog and not show panel when there are no results", function () { var filePath = testPath + "/bar.txt", fileEntry = FileSystem.getFileForPath(filePath); openSearchBar(fileEntry); executeSearch("abcdefghi"); waitsFor(function () { return (FindInFiles._searchDone); }, "search complete"); runs(function () { var result, resultFound = false; // verify searchModel.results Object is empty for (result in FindInFiles.searchModel.results) { if (FindInFiles.searchModel.results.hasOwnProperty(result)) { resultFound = true; } } expect(resultFound).toBe(false); expect($("#find-in-files-results").is(":visible")).toBeFalsy(); expect($(".modal-bar").length).toBe(1); // Close search bar var $searchField = $(".modal-bar #find-group input"); SpecRunnerUtils.simulateKeyEvent(KeyEvent.DOM_VK_ESCAPE, "keydown", $searchField[0]); }); }); it("should open file in editor and select text when a result is clicked", function () { var filePath = testPath + "/foo.html", fileEntry = FileSystem.getFileForPath(filePath); openSearchBar(fileEntry); executeSearch("foo"); runs(function () { // Verify no current document var editor = EditorManager.getActiveEditor(); expect(editor).toBeFalsy(); // Get panel var $searchResults = $("#find-in-files-results"); expect($searchResults.is(":visible")).toBeTruthy(); // Get list in panel var $panelResults = $searchResults.find("table.bottom-panel-table tr"); expect($panelResults.length).toBe(8); // 7 hits + 1 file section // First item in list is file section expect($($panelResults[0]).hasClass("file-section")).toBeTruthy(); // Click second item which is first hit var $firstHit = $($panelResults[1]); expect($firstHit.hasClass("file-section")).toBeFalsy(); $firstHit.click(); setTimeout(function () { // Verify current document editor = EditorManager.getActiveEditor(); expect(editor.document.file.fullPath).toEqual(filePath); // Verify selection expect(editor.getSelectedText().toLowerCase() === "foo"); waitsForDone(CommandManager.execute(Commands.FILE_CLOSE_ALL), "closing all files"); }, 500); }); }); it("should open file in working set when a result is double-clicked", function () { var filePath = testPath + "/foo.js", fileEntry = FileSystem.getFileForPath(filePath); openSearchBar(fileEntry); executeSearch("foo"); runs(function () { // Verify document is not yet in working set expect(MainViewManager.findInWorkingSet(MainViewManager.ALL_PANES, filePath)).toBe(-1); // Get list in panel var $panelResults = $("#find-in-files-results table.bottom-panel-table tr"); expect($panelResults.length).toBe(5); // 4 hits + 1 file section // Double-click second item which is first hit var $firstHit = $($panelResults[1]); expect($firstHit.hasClass("file-section")).toBeFalsy(); $firstHit.dblclick(); // Verify document is now in working set expect(MainViewManager.findInWorkingSet(MainViewManager.ALL_PANES, filePath)).not.toBe(-1); waitsForDone(CommandManager.execute(Commands.FILE_CLOSE_ALL), "closing all files"); }); }); it("should update results when a result in a file is edited", function () { var filePath = testPath + "/foo.html", fileEntry = FileSystem.getFileForPath(filePath), panelListLen = 8, // 7 hits + 1 file section $panelResults; openSearchBar(fileEntry); executeSearch("foo"); runs(function () { // Verify document is not yet in working set expect(MainViewManager.findInWorkingSet(MainViewManager.ALL_PANES, filePath)).toBe(-1); // Get list in panel $panelResults = $("#find-in-files-results table.bottom-panel-table tr"); expect($panelResults.length).toBe(panelListLen); // Click second item which is first hit var $firstHit = $($panelResults[1]); expect($firstHit.hasClass("file-section")).toBeFalsy(); $firstHit.click(); }); // Wait for file to open if not already open waitsFor(function () { var editor = EditorManager.getActiveEditor(); return (editor.document.file.fullPath === filePath); }, 1000, "file open"); // Wait for selection to change (this happens asynchronously after file opens) waitsFor(function () { var editor = EditorManager.getActiveEditor(), sel = editor.getSelection(); return (sel.start.line === 4 && sel.start.ch === 7); }, 1000, "selection change"); runs(function () { // Verify current selection var editor = EditorManager.getActiveEditor(); expect(editor.getSelectedText().toLowerCase()).toBe("foo"); // Edit text to remove hit from file var sel = editor.getSelection(); editor.document.replaceRange("Bar", sel.start, sel.end); }); // Panel is updated asynchronously waitsFor(function () { $panelResults = $("#find-in-files-results table.bottom-panel-table tr"); return ($panelResults.length < panelListLen); }, "Results panel updated"); runs(function () { // Verify list automatically updated expect($panelResults.length).toBe(panelListLen - 1); waitsForDone(CommandManager.execute(Commands.FILE_CLOSE, { _forceClose: true }), "closing file"); }); }); it("should not clear the model until next search is actually committed", function () { var filePath = testPath + "/foo.js", fileEntry = FileSystem.getFileForPath(filePath); openSearchBar(fileEntry); executeSearch("foo"); runs(function () { expect(Object.keys(FindInFiles.searchModel.results).length).not.toBe(0); }); closeSearchBar(); openSearchBar(fileEntry); runs(function () { // Search model shouldn't be cleared from merely reopening search bar expect(Object.keys(FindInFiles.searchModel.results).length).not.toBe(0); }); closeSearchBar(); runs(function () { // Search model shouldn't be cleared after search bar closed without running a search expect(Object.keys(FindInFiles.searchModel.results).length).not.toBe(0); }); }); }); describe("Find results paging", function () { var expectedPages = [ { totalResults: 500, totalFiles: 2, overallFirstIndex: 1, overallLastIndex: 100, matchRanges: [{file: 0, filename: "manyhits-1.txt", first: 0, firstLine: 1, last: 99, lastLine: 100, pattern: /i'm going to\s+find this\s+now/}], firstPageEnabled: false, lastPageEnabled: true, prevPageEnabled: false, nextPageEnabled: true }, { totalResults: 500, totalFiles: 2, overallFirstIndex: 101, overallLastIndex: 200, matchRanges: [{file: 0, filename: "manyhits-1.txt", first: 0, firstLine: 101, last: 99, lastLine: 200, pattern: /i'm going to\s+find this\s+now/}], firstPageEnabled: true, lastPageEnabled: true, prevPageEnabled: true, nextPageEnabled: true }, { totalResults: 500, totalFiles: 2, overallFirstIndex: 201, overallLastIndex: 300, matchRanges: [ {file: 0, filename: "manyhits-1.txt", first: 0, firstLine: 201, last: 49, lastLine: 250, pattern: /i'm going to\s+find this\s+now/}, {file: 1, filename: "manyhits-2.txt", first: 0, firstLine: 1, last: 49, lastLine: 50, pattern: /you're going to\s+find this\s+now/} ], firstPageEnabled: true, lastPageEnabled: true, prevPageEnabled: true, nextPageEnabled: true }, { totalResults: 500, totalFiles: 2, overallFirstIndex: 301, overallLastIndex: 400, matchRanges: [{file: 0, filename: "manyhits-2.txt", first: 0, firstLine: 51, last: 99, lastLine: 150, pattern: /you're going to\s+find this\s+now/}], firstPageEnabled: true, lastPageEnabled: true, prevPageEnabled: true, nextPageEnabled: true }, { totalResults: 500, totalFiles: 2, overallFirstIndex: 401, overallLastIndex: 500, matchRanges: [{file: 0, filename: "manyhits-2.txt", first: 0, firstLine: 151, last: 99, lastLine: 250, pattern: /you're going to\s+find this\s+now/}], firstPageEnabled: true, lastPageEnabled: false, prevPageEnabled: true, nextPageEnabled: false } ]; function expectPageDisplay(options) { // Check the title expect($("#find-in-files-results .title").text().match("\\b" + options.totalResults + "\\b")).toBeTruthy(); expect($("#find-in-files-results .title").text().match("\\b" + options.totalFiles + "\\b")).toBeTruthy(); var paginationInfo = $("#find-in-files-results .pagination-col").text(); expect(paginationInfo.match("\\b" + options.overallFirstIndex + "\\b")).toBeTruthy(); expect(paginationInfo.match("\\b" + options.overallLastIndex + "\\b")).toBeTruthy(); // Check for presence of file and first/last item rows within each file options.matchRanges.forEach(function (range) { var $fileRow = $("#find-in-files-results tr.file-section[data-file-index='" + range.file + "']"); expect($fileRow.length).toBe(1); expect($fileRow.find(".dialog-filename").text()).toEqual(range.filename); var $firstMatchRow = $("#find-in-files-results tr[data-file-index='" + range.file + "'][data-item-index='" + range.first + "']"); expect($firstMatchRow.length).toBe(1); expect($firstMatchRow.find(".line-number").text().match("\\b" + range.firstLine + "\\b")).toBeTruthy(); expect($firstMatchRow.find(".line-text").text().match(range.pattern)).toBeTruthy(); var $lastMatchRow = $("#find-in-files-results tr[data-file-index='" + range.file + "'][data-item-index='" + range.last + "']"); expect($lastMatchRow.length).toBe(1); expect($lastMatchRow.find(".line-number").text().match("\\b" + range.lastLine + "\\b")).toBeTruthy(); expect($lastMatchRow.find(".line-text").text().match(range.pattern)).toBeTruthy(); }); // Check enablement of buttons expect($("#find-in-files-results .first-page").hasClass("disabled")).toBe(!options.firstPageEnabled); expect($("#find-in-files-results .last-page").hasClass("disabled")).toBe(!options.lastPageEnabled); expect($("#find-in-files-results .prev-page").hasClass("disabled")).toBe(!options.prevPageEnabled); expect($("#find-in-files-results .next-page").hasClass("disabled")).toBe(!options.nextPageEnabled); } it("should page forward, then jump back to first page, displaying correct contents at each step", function () { openProject(SpecRunnerUtils.getTestPath("/spec/FindReplace-test-files-manyhits")); openSearchBar(); // This search will find 500 hits in 2 files. Since there are 100 hits per page, there should // be five pages, and the third page should have 50 results from the first file and 50 results // from the second file. executeSearch("find this"); runs(function () { var i; for (i = 0; i < 5; i++) { if (i > 0) { $("#find-in-files-results .next-page").click(); } expectPageDisplay(expectedPages[i]); } $("#find-in-files-results .first-page").click(); expectPageDisplay(expectedPages[0]); }); }); it("should jump to last page, then page backward, displaying correct contents at each step", function () { openProject(SpecRunnerUtils.getTestPath("/spec/FindReplace-test-files-manyhits")); executeSearch("find this"); runs(function () { var i; $("#find-in-files-results .last-page").click(); for (i = 4; i >= 0; i--) { if (i < 4) { $("#find-in-files-results .prev-page").click(); } expectPageDisplay(expectedPages[i]); } }); }); }); describe("SearchModel update on change events", function () { var oldResults, gotChange, wasQuickChange; function fullTestPath(path) { return testPath + "/" + path; } function expectUnchangedExcept(paths) { Object.keys(FindInFiles.searchModel.results).forEach(function (path) { if (paths.indexOf(path) === -1) { expect(FindInFiles.searchModel.results[path]).toEqual(oldResults[path]); } }); } beforeEach(function () { gotChange = false; oldResults = null; wasQuickChange = false; FindInFiles.searchModel.on("change.FindInFilesTest", function (event, quickChange) { gotChange = true; wasQuickChange = quickChange; }); openTestProjectCopy(defaultSourcePath); doSearch({ queryInfo: {query: "foo"}, numMatches: 14 }); runs(function () { oldResults = _.cloneDeep(FindInFiles.searchModel.results); }); }); afterEach(function () { FindInFiles.searchModel.off(".FindInFilesTest"); waitsForDone(CommandManager.execute(Commands.FILE_CLOSE_ALL, { _forceClose: true }), "close all files"); }); describe("when filename changes", function () { it("should handle a filename change", function () { runs(function () { FindInFiles._fileNameChangeHandler(null, fullTestPath("foo.html"), fullTestPath("newfoo.html")); }); waitsFor(function () { return gotChange; }, "model change event"); runs(function () { expectUnchangedExcept([fullTestPath("foo.html"), fullTestPath("newfoo.html")]); expect(FindInFiles.searchModel.results[fullTestPath("foo.html")]).toBeUndefined(); expect(FindInFiles.searchModel.results[fullTestPath("newfoo.html")]).toEqual(oldResults[fullTestPath("foo.html")]); expect(FindInFiles.searchModel.countFilesMatches()).toEqual({files: 3, matches: 14}); expect(wasQuickChange).toBeFalsy(); }); }); it("should handle a folder change", function () { runs(function () { FindInFiles._fileNameChangeHandler(null, fullTestPath("css"), fullTestPath("newcss")); }); waitsFor(function () { return gotChange; }, "model change event"); runs(function () { expectUnchangedExcept([fullTestPath("css/foo.css"), fullTestPath("newcss/foo.css")]); expect(FindInFiles.searchModel.results[fullTestPath("css/foo.css")]).toBeUndefined(); expect(FindInFiles.searchModel.results[fullTestPath("newcss/foo.css")]).toEqual(oldResults[fullTestPath("css/foo.css")]); expect(FindInFiles.searchModel.countFilesMatches()).toEqual({files: 3, matches: 14}); expect(wasQuickChange).toBeFalsy(); }); }); }); describe("when in-memory document changes", function () { it("should update the results when a matching line is added, updating line numbers and adding the match", function () { runs(function () { waitsForDone(CommandManager.execute(Commands.CMD_ADD_TO_WORKINGSET_AND_OPEN, { fullPath: fullTestPath("foo.html") })); }); runs(function () { var doc = DocumentManager.getOpenDocumentForPath(fullTestPath("foo.html")), i; expect(doc).toBeTruthy(); // Insert another line containing "foo" immediately above the second "foo" match. doc.replaceRange("this is a foo instance\n", {line: 5, ch: 0}); // This should update synchronously. expect(gotChange).toBe(true); var oldFileResults = oldResults[fullTestPath("foo.html")], newFileResults = FindInFiles.searchModel.results[fullTestPath("foo.html")]; // First match should be unchanged. expect(newFileResults.matches[0]).toEqual(oldFileResults.matches[0]); // Next match should be the new match. We just check the offsets here, not everything in the match record. expect(newFileResults.matches[1].start).toEqual({line: 5, ch: 10}); expect(newFileResults.matches[1].end).toEqual({line: 5, ch: 13}); // Rest of the matches should have had their lines adjusted. for (i = 2; i < newFileResults.matches.length; i++) { var newMatch = newFileResults.matches[i], oldMatch = oldFileResults.matches[i - 1]; expect(newMatch.start).toEqual({line: oldMatch.start.line + 1, ch: oldMatch.start.ch}); expect(newMatch.end).toEqual({line: oldMatch.end.line + 1, ch: oldMatch.end.ch}); } // There should be one new match. expect(FindInFiles.searchModel.countFilesMatches()).toEqual({files: 3, matches: 15}); // Make sure the model is adding the flag that will make the view debounce changes. expect(wasQuickChange).toBeTruthy(); }); }); it("should update the results when a matching line is deleted, updating line numbers and removing the match", function () { runs(function () { waitsForDone(CommandManager.execute(Commands.CMD_ADD_TO_WORKINGSET_AND_OPEN, { fullPath: fullTestPath("foo.html") })); }); runs(function () { var doc = DocumentManager.getOpenDocumentForPath(fullTestPath("foo.html")), i; expect(doc).toBeTruthy(); // Remove the second "foo" match. doc.replaceRange("", {line: 5, ch: 0}, {line: 6, ch: 0}); // This should update synchronously. expect(gotChange).toBe(true); var oldFileResults = oldResults[fullTestPath("foo.html")], newFileResults = FindInFiles.searchModel.results[fullTestPath("foo.html")]; // First match should be unchanged. expect(newFileResults.matches[0]).toEqual(oldFileResults.matches[0]); // Second match should be deleted. The rest of the matches should have their lines adjusted. for (i = 1; i < newFileResults.matches.length; i++) { var newMatch = newFileResults.matches[i], oldMatch = oldFileResults.matches[i + 1]; expect(newMatch.start).toEqual({line: oldMatch.start.line - 1, ch: oldMatch.start.ch}); expect(newMatch.end).toEqual({line: oldMatch.end.line - 1, ch: oldMatch.end.ch}); } // There should be one fewer match. expect(FindInFiles.searchModel.countFilesMatches()).toEqual({files: 3, matches: 13}); // Make sure the model is adding the flag that will make the view debounce changes. expect(wasQuickChange).toBeTruthy(); }); }); it("should replace matches in a portion of the document that was edited to include a new match", function () { runs(function () { waitsForDone(CommandManager.execute(Commands.CMD_ADD_TO_WORKINGSET_AND_OPEN, { fullPath: fullTestPath("foo.html") })); }); runs(function () { var doc = DocumentManager.getOpenDocumentForPath(fullTestPath("foo.html")), i; expect(doc).toBeTruthy(); // Replace the second and third foo matches (on two adjacent lines) with a single foo match on a single line. doc.replaceRange("this is a new foo match\n", {line: 5, ch: 0}, {line: 7, ch: 0}); // This should update synchronously. expect(gotChange).toBe(true); var oldFileResults = oldResults[fullTestPath("foo.html")], newFileResults = FindInFiles.searchModel.results[fullTestPath("foo.html")]; // First match should be unchanged. expect(newFileResults.matches[0]).toEqual(oldFileResults.matches[0]); // Second match should be changed to reflect the new position. expect(newFileResults.matches[1].start).toEqual({line: 5, ch: 14}); expect(newFileResults.matches[1].end).toEqual({line: 5, ch: 17}); // Third match should be deleted. The rest of the matches should have their lines adjusted. for (i = 2; i < newFileResults.matches.length; i++) { var newMatch = newFileResults.matches[i], oldMatch = oldFileResults.matches[i + 1]; expect(newMatch.start).toEqual({line: oldMatch.start.line - 1, ch: oldMatch.start.ch}); expect(newMatch.end).toEqual({line: oldMatch.end.line - 1, ch: oldMatch.end.ch}); } // There should be one fewer match. expect(FindInFiles.searchModel.countFilesMatches()).toEqual({files: 3, matches: 13}); // Make sure the model is adding the flag that will make the view debounce changes. expect(wasQuickChange).toBeTruthy(); }); }); it("should completely remove the document from the results list if all matches in the document are deleted", function () { runs(function () { waitsForDone(CommandManager.execute(Commands.CMD_ADD_TO_WORKINGSET_AND_OPEN, { fullPath: fullTestPath("foo.html") })); }); runs(function () { var doc = DocumentManager.getOpenDocumentForPath(fullTestPath("foo.html")); expect(doc).toBeTruthy(); // Replace all matches and check that the entire file was removed from the results list. doc.replaceRange("this will not match", {line: 4, ch: 0}, {line: 18, ch: 0}); // This should update synchronously. expect(gotChange).toBe(true); expect(FindInFiles.searchModel.results[fullTestPath("foo.html")]).toBeUndefined(); // There should be one fewer file and the matches for that file should be gone. expect(FindInFiles.searchModel.countFilesMatches()).toEqual({files: 2, matches: 7}); // Make sure the model is adding the flag that will make the view debounce changes. expect(wasQuickChange).toBeTruthy(); }); }); }); // Unfortunately, we can't easily mock file changes, so we just do them in a copy of the project. // This set of tests isn't as thorough as it could be, because it's difficult to perform file // ops that will exercise all possible scenarios of change events (e.g. change events with // both added and removed files), and conversely it's difficult to mock all the filesystem stuff // without doing a bunch of work. So this is really just a set of basic sanity tests to make // sure that stuff being refactored between the change handler and the model doesn't break // basic update functionality. describe("when on-disk file or folder changes", function () { it("should add matches for a new file", function () { var newFilePath; runs(function () { newFilePath = fullTestPath("newfoo.html"); expect(FindInFiles.searchModel.results[newFilePath]).toBeFalsy(); waitsForDone(promisify(FileSystem.getFileForPath(newFilePath), "write", "this is a new foo match\n"), "add new file"); }); waitsFor(function () { return gotChange; }, "model change event"); runs(function () { var newFileResults = FindInFiles.searchModel.results[newFilePath]; expect(newFileResults).toBeTruthy(); expect(newFileResults.matches.length).toBe(1); expect(newFileResults.matches[0].start).toEqual({line: 0, ch: 14}); expect(newFileResults.matches[0].end).toEqual({line: 0, ch: 17}); // There should be one new file and match. expect(FindInFiles.searchModel.countFilesMatches()).toEqual({files: 4, matches: 15}); }); }); it("should remove matches for a deleted file", function () { runs(function () { expect(FindInFiles.searchModel.results[fullTestPath("foo.html")]).toBeTruthy(); waitsForDone(promisify(FileSystem.getFileForPath(fullTestPath("foo.html")), "unlink"), "delete file"); }); waitsFor(function () { return gotChange; }, "model change event"); runs(function () { expect(FindInFiles.searchModel.results[fullTestPath("foo.html")]).toBeFalsy(); // There should be one fewer file and the matches should be removed. expect(FindInFiles.searchModel.countFilesMatches()).toEqual({files: 2, matches: 7}); }); }); it("should remove matches for a deleted folder", function () { runs(function () { expect(FindInFiles.searchModel.results[fullTestPath("css/foo.css")]).toBeTruthy(); waitsForDone(promisify(FileSystem.getFileForPath(fullTestPath("css")), "unlink"), "delete folder"); }); waitsFor(function () { return gotChange; }, "model change event"); runs(function () { expect(FindInFiles.searchModel.results[fullTestPath("css/foo.css")]).toBeFalsy(); // There should be one fewer file and the matches should be removed. expect(FindInFiles.searchModel.countFilesMatches()).toEqual({files: 2, matches: 11}); }); }); }); }); describe("Replace", function () { function expectProjectToMatchKnownGood(kgFolder, lineEndings, filesToSkip) { runs(function () { var testRootPath = ProjectManager.getProjectRoot().fullPath, kgRootPath = SpecRunnerUtils.getTestPath("/spec/FindReplace-known-goods/" + kgFolder + "/"); function compareKnownGoodToTestFile(kgContents, kgFilePath) { var testFilePath = testRootPath + kgFilePath.slice(kgRootPath.length); if (!filesToSkip || filesToSkip.indexOf(testFilePath) === -1) { return promisify(FileSystem.getFileForPath(testFilePath), "read").then(function (testContents) { if (lineEndings) { kgContents = FileUtils.translateLineEndings(kgContents, lineEndings); } expect(testContents).toEqual(kgContents); }); } } waitsForDone(visitAndProcessFiles(kgRootPath, compareKnownGoodToTestFile), "project comparison done"); }); } // Does a standard test for files on disk: search, replace, and check that files on disk match. // Options: // knownGoodFolder: name of folder containing known goods to match to project files on disk // lineEndings: optional, one of the FileUtils.LINE_ENDINGS_* constants // - if specified, files on disk are expected to have these line endings // uncheckMatches: optional array of {file: string, index: number} items to uncheck; if // index unspecified, will uncheck all matches in file function doBasicTest(options) { doSearch(options); runs(function () { if (options.uncheckMatches) { options.uncheckMatches.forEach(function (matchToUncheck) { var matches = searchResults[testPath + matchToUncheck.file].matches; if (matchToUncheck.index) { matches[matchToUncheck.index].isChecked = false; } else { matches.forEach(function (match) { match.isChecked = false; }); } }); } waitsForDone(doReplace(options), "finish replacement"); }); expectProjectToMatchKnownGood(options.knownGoodFolder, options.lineEndings); } // Like doBasicTest, but expects some files to have specific errors. // Options: same as doBasicTest, plus: // test: optional function (which must contain one or more runs blocks) to run between // search and replace // errors: array of errors expected to occur (in the same format as performReplacement() returns) function doTestWithErrors(options) { var done = false; doSearch(options); if (options.test) { // The test function *must* contain one or more runs blocks. options.test(); } runs(function () { doReplace(options) .then(function () { expect("should fail due to error").toBe(true); done = true; }, function (errors) { expect(errors).toEqual(options.errors); done = true; }); }); waitsFor(function () { return done; }, 1000, "finish replacement"); expectProjectToMatchKnownGood(options.knownGoodFolder, options.lineEndings); } function expectInMemoryFiles(options) { runs(function () { waitsForDone(Async.doInParallel(options.inMemoryFiles, function (filePath) { var fullPath; // If this is a full file path (as would be the case for an external file), handle it specially. if (typeof filePath === "object" && filePath.fullPath) { fullPath = filePath.fullPath; filePath = "/" + FileUtils.getBaseName(fullPath); } else { fullPath = testPath + filePath; } // Check that the document open in memory was changed and matches the expected replaced version of that file. var doc = DocumentManager.getOpenDocumentForPath(fullPath); expect(doc).toBeTruthy(); expect(doc.isDirty).toBe(true); var kgPath = SpecRunnerUtils.getTestPath("/spec/FindReplace-known-goods/" + options.inMemoryKGFolder + filePath), kgFile = FileSystem.getFileForPath(kgPath); return promisify(kgFile, "read").then(function (contents) { expect(doc.getText(true)).toEqual(contents); }); }), "check in memory file contents"); }); } // Like doBasicTest, but expects one or more files to be open in memory and the replacements to happen there. // Options: same as doBasicTest, plus: // inMemoryFiles: array of project-relative paths (each starting with "/") to files that should be open in memory // inMemoryKGFolder: folder containing known goods to compare each of the inMemoryFiles to function doInMemoryTest(options) { // Like the basic test, we expect everything on disk to match the kgFolder (which means the file open in memory // should *not* have changed on disk yet). doBasicTest(options); expectInMemoryFiles(options); } afterEach(function () { runs(function () { waitsForDone(CommandManager.execute(Commands.FILE_CLOSE_ALL, { _forceClose: true }), "close all files"); }); }); describe("Engine", function () { it("should replace all instances of a simple string in a project on disk case-insensitively", function () { openTestProjectCopy(defaultSourcePath); doBasicTest({ queryInfo: {query: "foo"}, numMatches: 14, replaceText: "bar", knownGoodFolder: "simple-case-insensitive" }); }); it("should replace all instances of a simple string in a project on disk case-sensitively", function () { openTestProjectCopy(defaultSourcePath); doBasicTest({ queryInfo: {query: "foo", isCaseSensitive: true}, numMatches: 9, replaceText: "bar", knownGoodFolder: "simple-case-sensitive" }); }); it("should replace all instances of a regexp in a project on disk case-insensitively with a simple replace string", function () { openTestProjectCopy(defaultSourcePath); doBasicTest({ queryInfo: {query: "\\b[a-z]{3}\\b", isRegexp: true}, numMatches: 33, replaceText: "CHANGED", knownGoodFolder: "regexp-case-insensitive" }); }); it("should replace all instances of a regexp that spans multiple lines in a project on disk", function () { openTestProjectCopy(defaultSourcePath); // This query should find each rule in the CSS file (but not in the JS file since there's more than one line // between each pair of braces). doBasicTest({ queryInfo: {query: "\\{\\n[^\\n]*\\n\\}", isRegexp: true}, numMatches: 4, replaceText: "CHANGED", knownGoodFolder: "regexp-replace-multiline" }); }); it("should replace all instances of a regexp that spans multiple lines in a project in memory", function () { openTestProjectCopy(defaultSourcePath); // This query should find each rule in the CSS file (but not in the JS file since there's more than one line // between each pair of braces). doInMemoryTest({ queryInfo: {query: "\\{\\n[^\\n]*\\n\\}", isRegexp: true}, numMatches: 4, replaceText: "CHANGED", knownGoodFolder: "unchanged", forceFilesOpen: true, inMemoryFiles: ["/css/foo.css"], inMemoryKGFolder: "regexp-replace-multiline" }); }); it("should replace all instances of a regexp that spans multiple lines in a project on disk when the last line is a partial match", function () { openTestProjectCopy(defaultSourcePath); // This query should match from the open brace through to (and including) the first colon of each rule in the // CSS file. doBasicTest({ queryInfo: {query: "\\{\\n[^:]+:", isRegexp: true}, numMatches: 4, replaceText: "CHANGED", knownGoodFolder: "regexp-replace-multiline-partial" }); }); it("should replace all instances of a regexp that spans multiple lines in a project in memory when the last line is a partial match", function () { openTestProjectCopy(defaultSourcePath); // This query should match from the open brace through to (and including) the first colon of each rule in the // CSS file. doInMemoryTest({ queryInfo: {query: "\\{\\n[^:]+:", isRegexp: true}, numMatches: 4, replaceText: "CHANGED", knownGoodFolder: "unchanged", forceFilesOpen: true, inMemoryFiles: ["/css/foo.css"], inMemoryKGFolder: "regexp-replace-multiline-partial" }); }); it("should replace all instances of a regexp in a project on disk case-sensitively with a simple replace string", function () { openTestProjectCopy(defaultSourcePath); doBasicTest({ queryInfo: {query: "\\b[a-z]{3}\\b", isRegexp: true, isCaseSensitive: true}, numMatches: 25, replaceText: "CHANGED", knownGoodFolder: "regexp-case-sensitive" }); }); it("should replace instances of a regexp with a $-substitution on disk", function () { openTestProjectCopy(defaultSourcePath); doBasicTest({ queryInfo: {query: "\\b([a-z]{3})\\b", isRegexp: true}, numMatches: 33, replaceText: "[$1]", knownGoodFolder: "regexp-dollar-replace" }); }); it("should replace instances of a regexp with a $-substitution in in-memory files", function () { // This test case is necessary because the in-memory case goes through a separate code path before it deals with // the replace text. openTestProjectCopy(defaultSourcePath); doInMemoryTest({ queryInfo: {query: "\\b([a-z]{3})\\b", isRegexp: true}, numMatches: 33, replaceText: "[$1]", knownGoodFolder: "unchanged", forceFilesOpen: true, inMemoryFiles: ["/css/foo.css", "/foo.html", "/foo.js"], inMemoryKGFolder: "regexp-dollar-replace" }); }); it("should replace instances of regexp with 0-length matches on disk", function () { openTestProjectCopy(defaultSourcePath); doBasicTest({ queryInfo: {query: "^", isRegexp: true}, numMatches: 55, replaceText: "CHANGED", knownGoodFolder: "regexp-zero-length" }); }); it("should replace instances of regexp with 0-length matches in memory", function () { openTestProjectCopy(defaultSourcePath); doInMemoryTest({ queryInfo: {query: "^", isRegexp: true}, numMatches: 55, replaceText: "CHANGED", knownGoodFolder: "unchanged", forceFilesOpen: true, inMemoryFiles: ["/css/foo.css", "/foo.html", "/foo.js"], inMemoryKGFolder: "regexp-zero-length" }); }); it("should replace instances of a string in a project respecting CRLF line endings", function () { openTestProjectCopy(defaultSourcePath, FileUtils.LINE_ENDINGS_CRLF); doBasicTest({ queryInfo: {query: "foo"}, numMatches: 14, replaceText: "bar", knownGoodFolder: "simple-case-insensitive", lineEndings: FileUtils.LINE_ENDINGS_CRLF }); }); it("should replace instances of a string in a project respecting LF line endings", function () { openTestProjectCopy(defaultSourcePath, FileUtils.LINE_ENDINGS_LF); doBasicTest({ queryInfo: {query: "foo"}, numMatches: 14, replaceText: "bar", knownGoodFolder: "simple-case-insensitive", lineEndings: FileUtils.LINE_ENDINGS_LF }); }); it("should not replace unchecked matches on disk", function () { openTestProjectCopy(defaultSourcePath); doBasicTest({ queryInfo: {query: "foo"}, numMatches: 14, uncheckMatches: [{file: "/css/foo.css"}], replaceText: "bar", knownGoodFolder: "simple-case-insensitive-except-foo.css" }); }); it("should do all in-memory replacements synchronously, so user can't accidentally edit document after start of replace process", function () { openTestProjectCopy(defaultSourcePath); // Open two of the documents we want to replace in memory. runs(function () { waitsForDone(CommandManager.execute(Commands.CMD_ADD_TO_WORKINGSET_AND_OPEN, { fullPath: testPath + "/css/foo.css" }), "opening document"); }); runs(function () { waitsForDone(CommandManager.execute(Commands.CMD_ADD_TO_WORKINGSET_AND_OPEN, { fullPath: testPath + "/foo.js" }), "opening document"); }); // We can't use expectInMemoryFiles(), since this test requires everything to happen fully synchronously // (no file reads) once the replace has started. So we read the files here. var kgFileContents = {}; runs(function () { var kgPath = SpecRunnerUtils.getTestPath("/spec/FindReplace-known-goods/simple-case-insensitive"); waitsForDone(visitAndProcessFiles(kgPath, function (contents, fullPath) { // Translate line endings to in-memory document style (always LF) kgFileContents[fullPath.slice(kgPath.length)] = FileUtils.translateLineEndings(contents, FileUtils.LINE_ENDINGS_LF); }), "reading known good"); }); doSearch({ queryInfo: {query: "foo"}, numMatches: 14, replaceText: "bar" }); runs(function () { // Start the replace, but don't wait for it to complete. Since the in-memory replacements should occur // synchronously, the in-memory documents should have already been changed. This means we don't have to // worry about detecting changes in documents once the replace starts. (If the user had changed // the document after the search but before the replace started, we would have already closed the panel, // preventing the user from doing a replace.) var promise = FindInFiles.doReplace(searchResults, "bar"); // Check the in-memory contents against the known goods. ["/css/foo.css", "/foo.js"].forEach(function (filename) { var fullPath = testPath + filename, doc = DocumentManager.getOpenDocumentForPath(fullPath); expect(doc).toBeTruthy(); expect(doc.isDirty).toBe(true); expect(doc.getText()).toEqual(kgFileContents[filename]); }); // Finish the replace operation, which should go ahead and do the file on disk. waitsForDone(promise); }); runs(function () { // Now the file on disk should have been replaced too. waitsForDone(promisify(FileSystem.getFileForPath(testPath + "/foo.html"), "read").then(function (contents) { expect(FileUtils.translateLineEndings(contents, FileUtils.LINE_ENDINGS_LF)).toEqual(kgFileContents["/foo.html"]); }), "checking known good"); }); }); it("should return an error and not do the replacement in files that have changed on disk since the search", function () { openTestProjectCopy(defaultSourcePath); doTestWithErrors({ queryInfo: {query: "foo"}, numMatches: 14, replaceText: "bar", knownGoodFolder: "changed-file", test: function () { // Wait for one second to make sure that the changed file gets an updated timestamp. // TODO: this seems like a FileSystem issue - we don't get timestamp changes with a resolution // of less than one second. waits(1000); runs(function () { // Clone the results so we don't use the version that's auto-updated by FindInFiles when we modify the file // on disk. This case might not usually come up in the real UI if we always guarantee that the results list will // be auto-updated, but we want to make sure there's no edge case where we missed an update and still clobber the // file on disk anyway. searchResults = _.cloneDeep(searchResults); waitsForDone(promisify(FileSystem.getFileForPath(testPath + "/css/foo.css"), "write", "/* changed content */"), "modify file"); }); }, errors: [{item: testPath + "/css/foo.css", error: FindUtils.ERROR_FILE_CHANGED}] }); }); it("should return an error if a write fails", function () { openTestProjectCopy(defaultSourcePath); // Return a fake error when we try to write to the CSS file. (Note that this is spying on the test window's File module.) var writeSpy = spyOn(File.prototype, "write").andCallFake(function (data, options, callback) { if (typeof options === "function") { callback = options; } else { callback = callback || function () {}; } if (this.fullPath === testPath + "/css/foo.css") { callback(FileSystemError.NOT_WRITABLE); } else { return writeSpy.originalValue.apply(this, arguments); } }); doTestWithErrors({ queryInfo: {query: "foo"}, numMatches: 14, replaceText: "bar", knownGoodFolder: "simple-case-insensitive-except-foo.css", errors: [{item: testPath + "/css/foo.css", error: FileSystemError.NOT_WRITABLE}] }); }); it("should return an error if a match timestamp doesn't match an in-memory document timestamp", function () { openTestProjectCopy(defaultSourcePath); runs(function () { waitsForDone(CommandManager.execute(Commands.CMD_ADD_TO_WORKINGSET_AND_OPEN, { fullPath: testPath + "/css/foo.css" }), "opening document"); }); doTestWithErrors({ queryInfo: {query: "foo"}, numMatches: 14, replaceText: "bar", knownGoodFolder: "simple-case-insensitive-except-foo.css", test: function () { runs(function () { // Clone the results so we don't use the version that's auto-updated by FindInFiles when we modify the file // on disk. This case might not usually come up in the real UI if we always guarantee that the results list will // be auto-updated, but we want to make sure there's no edge case where we missed an update and still clobber the // file on disk anyway. searchResults = _.cloneDeep(searchResults); var oldTimestamp = searchResults[testPath + "/css/foo.css"].timestamp; searchResults[testPath + "/css/foo.css"].timestamp = new Date(oldTimestamp.getTime() - 5000); }); }, errors: [{item: testPath + "/css/foo.css", error: FindUtils.ERROR_FILE_CHANGED}] }); }); it("should do the replacement in memory for a file open in an Editor in the working set", function () { openTestProjectCopy(defaultSourcePath); runs(function () { waitsForDone(CommandManager.execute(Commands.CMD_ADD_TO_WORKINGSET_AND_OPEN, {fullPath: testPath + "/css/foo.css"}), "add file to working set"); }); doInMemoryTest({ queryInfo: {query: "foo"}, numMatches: 14, replaceText: "bar", knownGoodFolder: "simple-case-insensitive-except-foo.css", inMemoryFiles: ["/css/foo.css"], inMemoryKGFolder: "simple-case-insensitive" }); }); it("should do the search/replace in the current document content for a dirty in-memory document", function () { openTestProjectCopy(defaultSourcePath); var options = { queryInfo: {query: "foo"}, numMatches: 15, replaceText: "bar", inMemoryFiles: ["/css/foo.css"], inMemoryKGFolder: "simple-case-insensitive-modified" }; runs(function () { waitsForDone(CommandManager.execute(Commands.CMD_ADD_TO_WORKINGSET_AND_OPEN, {fullPath: testPath + "/css/foo.css"}), "add file to working set"); }); runs(function () { var doc = DocumentManager.getOpenDocumentForPath(testPath + "/css/foo.css"); expect(doc).toBeTruthy(); doc.replaceRange("/* added a foo line */\n", {line: 0, ch: 0}); }); doSearch(options); runs(function () { waitsForDone(doReplace(options), "replace done"); }); expectInMemoryFiles(options); expectProjectToMatchKnownGood("simple-case-insensitive-modified", null, [testPath + "/css/foo.css"]); }); it("should do the replacement in memory for a file open in an Editor that's not in the working set", function () { openTestProjectCopy(defaultSourcePath); runs(function () { waitsForDone(CommandManager.execute(Commands.FILE_OPEN, {fullPath: testPath + "/css/foo.css"}), "open file"); }); doInMemoryTest({ queryInfo: {query: "foo"}, numMatches: 14, replaceText: "bar", knownGoodFolder: "simple-case-insensitive-except-foo.css", inMemoryFiles: ["/css/foo.css"], inMemoryKGFolder: "simple-case-insensitive" }); }); it("should do the replacement in memory for a file that's in the working set but not yet open in an editor", function () { openTestProjectCopy(defaultSourcePath); runs(function () { MainViewManager.addToWorkingSet(MainViewManager.ACTIVE_PANE, FileSystem.getFileForPath(testPath + "/css/foo.css")); }); doInMemoryTest({ queryInfo: {query: "foo"}, numMatches: 14, replaceText: "bar", knownGoodFolder: "simple-case-insensitive-except-foo.css", inMemoryFiles: ["/css/foo.css"], inMemoryKGFolder: "simple-case-insensitive" }); }); it("should open the document in an editor and do the replacement there if the document is open but not in an Editor", function () { var doc, openFilePath; openTestProjectCopy(defaultSourcePath); runs(function () { openFilePath = testPath + "/css/foo.css"; waitsForDone(DocumentManager.getDocumentForPath(openFilePath).done(function (d) { doc = d; doc.addRef(); }), "get document"); }); doInMemoryTest({ queryInfo: {query: "foo"}, numMatches: 14, replaceText: "bar", knownGoodFolder: "simple-case-insensitive-except-foo.css", inMemoryFiles: ["/css/foo.css"], inMemoryKGFolder: "simple-case-insensitive" }); runs(function () { var workingSet = MainViewManager.getWorkingSet(MainViewManager.ALL_PANES); expect(workingSet.some(function (file) { return file.fullPath === openFilePath; })).toBe(true); doc.releaseRef(); }); }); it("should open files and do all replacements in memory if forceFilesOpen is true", function () { openTestProjectCopy(defaultSourcePath); doInMemoryTest({ queryInfo: {query: "foo"}, numMatches: 14, replaceText: "bar", knownGoodFolder: "unchanged", forceFilesOpen: true, inMemoryFiles: ["/css/foo.css", "/foo.html", "/foo.js"], inMemoryKGFolder: "simple-case-insensitive" }); }); it("should not perform unchecked matches in memory", function () { openTestProjectCopy(defaultSourcePath); doInMemoryTest({ queryInfo: {query: "foo"}, numMatches: 14, uncheckMatches: [{file: "/css/foo.css", index: 1}, {file: "/foo.html", index: 3}], replaceText: "bar", knownGoodFolder: "unchanged", forceFilesOpen: true, inMemoryFiles: ["/css/foo.css", "/foo.html", "/foo.js"], inMemoryKGFolder: "simple-case-insensitive-unchecked" }); }); it("should not perform unchecked matches on disk", function () { openTestProjectCopy(defaultSourcePath); doBasicTest({ queryInfo: {query: "foo"}, numMatches: 14, uncheckMatches: [{file: "/css/foo.css", index: 1}, {file: "/foo.html", index: 3}], replaceText: "bar", knownGoodFolder: "simple-case-insensitive-unchecked" }); }); it("should select the first modified file in the working set if replacements are done in memory and current editor wasn't affected", function () { openTestProjectCopy(defaultSourcePath); runs(function () { waitsForDone(CommandManager.execute(Commands.CMD_ADD_TO_WORKINGSET_AND_OPEN, {fullPath: testPath + "/bar.txt"}), "open file"); }); doInMemoryTest({ queryInfo: {query: "foo"}, numMatches: 14, replaceText: "bar", knownGoodFolder: "unchanged", forceFilesOpen: true, inMemoryFiles: ["/css/foo.css", "/foo.html", "/foo.js"], inMemoryKGFolder: "simple-case-insensitive" }); runs(function () { var expectedFile = testPath + "/foo.html"; expect(DocumentManager.getCurrentDocument().file.fullPath).toBe(expectedFile); expect(MainViewManager.findInWorkingSet(MainViewManager.ACTIVE_PANE, expectedFile)).not.toBe(-1); }); }); it("should select the first modified file in the working set if replacements are done in memory and no editor was open", function () { openTestProjectCopy(defaultSourcePath); var testFiles = ["/css/foo.css", "/foo.html", "/foo.js"]; doInMemoryTest({ queryInfo: {query: "foo"}, numMatches: 14, replaceText: "bar", knownGoodFolder: "unchanged", forceFilesOpen: true, inMemoryFiles: testFiles, inMemoryKGFolder: "simple-case-insensitive" }); runs(function () { // since nothing was opened prior to doing the // replacements then the first file modified will be opened. // This may not be the first item in the array above // since the files are sorted differently in performReplacements // and the replace is performed asynchronously. // So, just ensure that *something* was opened expect(DocumentManager.getCurrentDocument().file.fullPath).toBeTruthy(); testFiles.forEach(function (relPath) { expect(MainViewManager.findInWorkingSet(MainViewManager.ACTIVE_PANE, testPath + relPath)).not.toBe(-1); }); }); }); it("should select the first modified file in the working set if replacements are done in memory and there were no matches checked for current editor", function () { openTestProjectCopy(defaultSourcePath); runs(function () { waitsForDone(CommandManager.execute(Commands.CMD_ADD_TO_WORKINGSET_AND_OPEN, {fullPath: testPath + "/css/foo.css"}), "open file"); }); doInMemoryTest({ queryInfo: {query: "foo"}, numMatches: 14, uncheckMatches: [{file: "/css/foo.css"}], replaceText: "bar", knownGoodFolder: "unchanged", forceFilesOpen: true, inMemoryFiles: ["/foo.html", "/foo.js"], inMemoryKGFolder: "simple-case-insensitive-except-foo.css" }); runs(function () { expect(DocumentManager.getCurrentDocument().file.fullPath).toEqual(testPath + "/foo.html"); }); }); }); describe("UI", function () { function executeReplace(findText, replaceText, fromKeyboard) { runs(function () { FindInFiles._searchDone = false; FindInFiles._replaceDone = false; $("#find-what").val(findText).trigger("input"); $("#replace-with").val(replaceText).trigger("input"); if (fromKeyboard) { SpecRunnerUtils.simulateKeyEvent(KeyEvent.DOM_VK_RETURN, "keydown", $("#replace-with").get(0)); } else { $("#replace-all").click(); } }); } function showSearchResults(findText, replaceText, fromKeyboard) { openTestProjectCopy(defaultSourcePath); openSearchBar(null, true); executeReplace(findText, replaceText, fromKeyboard); waitsFor(function () { return FindInFiles._searchDone; }, "search finished"); } afterEach(function () { closeSearchBar(); }); describe("Replace in Files Bar", function () { it("should only show a Replace All button", function () { openTestProjectCopy(defaultSourcePath); openSearchBar(null, true); runs(function () { expect($("#replace-yes").length).toBe(0); expect($("#replace-all").length).toBe(1); }); }); it("should disable the Replace button if query is empty", function () { openTestProjectCopy(defaultSourcePath); openSearchBar(null, true); runs(function () { $("#find-what").val("").trigger("input"); expect($("#replace-all").is(":disabled")).toBe(true); }); }); it("should enable the Replace button if the query is a non-empty string", function () { openTestProjectCopy(defaultSourcePath); openSearchBar(null, true); runs(function () { $("#find-what").val("my query").trigger("input"); expect($("#replace-all").is(":disabled")).toBe(false); }); }); it("should disable the Replace button if query is an invalid regexp", function () { openTestProjectCopy(defaultSourcePath); openSearchBar(null, true); runs(function () { $("#find-regexp").click(); $("#find-what").val("[invalid").trigger("input"); expect($("#replace-all").is(":disabled")).toBe(true); }); }); it("should enable the Replace button if query is a valid regexp", function () { openTestProjectCopy(defaultSourcePath); openSearchBar(null, true); runs(function () { $("#find-regexp").click(); $("#find-what").val("[valid]").trigger("input"); expect($("#replace-all").is(":disabled")).toBe(false); }); }); it("should start with focus in Find, and set focus to the Replace field when the user hits enter in the Find field", function () { openTestProjectCopy(defaultSourcePath); openSearchBar(null, true); runs(function () { // For some reason using $().is(":focus") here is flaky. expect(testWindow.document.activeElement).toBe($("#find-what").get(0)); SpecRunnerUtils.simulateKeyEvent(KeyEvent.DOM_VK_RETURN, "keydown", $("#find-what").get(0)); expect(testWindow.document.activeElement).toBe($("#replace-with").get(0)); }); }); }); describe("Full workflow", function () { it("should prepopulate the find bar with selected text", function () { var doc, editor; openTestProjectCopy(defaultSourcePath); runs(function () { waitsForDone(CommandManager.execute(Commands.CMD_ADD_TO_WORKINGSET_AND_OPEN, { fullPath: testPath + "/foo.html" }), "open file"); }); runs(function () { doc = DocumentManager.getOpenDocumentForPath(testPath + "/foo.html"); expect(doc).toBeTruthy(); MainViewManager._edit(MainViewManager.ACTIVE_PANE, doc); editor = doc._masterEditor; expect(editor).toBeTruthy(); editor.setSelection({line: 4, ch: 7}, {line: 4, ch: 10}); }); openSearchBar(null); runs(function () { expect($("#find-what").val()).toBe("Foo"); }); waitsForDone(CommandManager.execute(Commands.FILE_CLOSE_ALL), "closing all files"); }); it("should prepopulate the find bar with only first line of selected text", function () { var doc, editor; openTestProjectCopy(defaultSourcePath); runs(function () { waitsForDone(CommandManager.execute(Commands.CMD_ADD_TO_WORKINGSET_AND_OPEN, { fullPath: testPath + "/foo.html" }), "open file"); }); runs(function () { doc = DocumentManager.getOpenDocumentForPath(testPath + "/foo.html"); expect(doc).toBeTruthy(); MainViewManager._edit(MainViewManager.ACTIVE_PANE, doc); editor = doc._masterEditor; expect(editor).toBeTruthy(); editor.setSelection({line: 4, ch: 7}, {line: 6, ch: 10}); }); openSearchBar(null); runs(function () { expect($("#find-what").val()).toBe("Foo</title>"); }); waitsForDone(CommandManager.execute(Commands.FILE_CLOSE_ALL), "closing all files"); }); it("should show results from the search with all checkboxes checked", function () { showSearchResults("foo", "bar"); runs(function () { expect($("#find-in-files-results").length).toBe(1); expect($("#find-in-files-results .check-one").length).toBe(14); expect($("#find-in-files-results .check-one:checked").length).toBe(14); }); }); it("should do a simple search/replace all from find bar, opening results in memory, when user clicks on Replace... button", function () { showSearchResults("foo", "bar"); // Click the "Replace" button in the search panel - this should kick off the replace runs(function () { $(".replace-checked").click(); }); waitsFor(function () { return FindInFiles._replaceDone; }, "replace finished"); expectInMemoryFiles({ inMemoryFiles: ["/css/foo.css", "/foo.html", "/foo.js"], inMemoryKGFolder: "simple-case-insensitive" }); }); it("should do a simple search/replace all from find bar, opening results in memory, when user hits Enter in Replace field", function () { showSearchResults("foo", "bar"); // Click the "Replace" button in the search panel - this should kick off the replace runs(function () { $(".replace-checked").click(); }); waitsFor(function () { return FindInFiles._replaceDone; }, "replace finished"); expectInMemoryFiles({ inMemoryFiles: ["/css/foo.css", "/foo.html", "/foo.js"], inMemoryKGFolder: "simple-case-insensitive" }); }); it("should do a search in folder, replace all from find bar", function () { openTestProjectCopy(defaultSourcePath); var dirEntry = FileSystem.getDirectoryForPath(testPath + "/css/"); openSearchBar(dirEntry, true); executeReplace("foo", "bar", true); waitsFor(function () { return FindInFiles._searchDone; }, "search finished"); // Click the "Replace" button in the search panel - this should kick off the replace runs(function () { $(".replace-checked").click(); }); waitsFor(function () { return FindInFiles._replaceDone; }, "replace finished"); expectInMemoryFiles({ inMemoryFiles: ["/css/foo.css"], inMemoryKGFolder: "simple-case-insensitive-only-foo.css" }); }); it("should do a search in file, replace all from find bar", function () { openTestProjectCopy(defaultSourcePath); var fileEntry = FileSystem.getFileForPath(testPath + "/css/foo.css"); openSearchBar(fileEntry, true); executeReplace("foo", "bar", true); waitsFor(function () { return FindInFiles._searchDone; }, "search finished"); // Click the "Replace" button in the search panel - this should kick off the replace runs(function () { $(".replace-checked").click(); }); waitsFor(function () { return FindInFiles._replaceDone; }, "replace finished"); expectInMemoryFiles({ inMemoryFiles: ["/css/foo.css"], inMemoryKGFolder: "simple-case-insensitive-only-foo.css" }); }); it("should do a regexp search/replace from find bar", function () { openTestProjectCopy(defaultSourcePath); openSearchBar(null, true); runs(function () { $("#find-regexp").click(); }); executeReplace("\\b([a-z]{3})\\b", "[$1]", true); waitsFor(function () { return FindInFiles._searchDone; }, "search finished"); // Click the "Replace" button in the search panel - this should kick off the replace runs(function () { $(".replace-checked").click(); }); waitsFor(function () { return FindInFiles._replaceDone; }, "replace finished"); expectInMemoryFiles({ inMemoryFiles: ["/css/foo.css", "/foo.html", "/foo.js"], inMemoryKGFolder: "regexp-dollar-replace" }); }); it("should do a case-sensitive search/replace from find bar", function () { openTestProjectCopy(defaultSourcePath); openSearchBar(null, true); runs(function () { $("#find-case-sensitive").click(); }); executeReplace("foo", "bar", true); waitsFor(function () { return FindInFiles._searchDone; }, "search finished"); // Click the "Replace" button in the search panel - this should kick off the replace runs(function () { $(".replace-checked").click(); }); waitsFor(function () { return FindInFiles._replaceDone; }, "replace finished"); expectInMemoryFiles({ inMemoryFiles: ["/css/foo.css", "/foo.html", "/foo.js"], inMemoryKGFolder: "simple-case-sensitive" }); }); it("should warn and do changes on disk if there are changes in >20 files", function () { openTestProjectCopy(SpecRunnerUtils.getTestPath("/spec/FindReplace-test-files-large")); openSearchBar(null, true); executeReplace("foo", "bar"); waitsFor(function () { return FindInFiles._searchDone; }, "search finished"); // Click the "Replace" button in the search panel - this should cause the dialog to appear runs(function () { $(".replace-checked").click(); }); runs(function () { expect(FindInFiles._replaceDone).toBeFalsy(); }); var $okButton; waitsFor(function () { $okButton = $(".dialog-button[data-button-id='ok']"); return !!$okButton.length; }, "dialog appearing"); runs(function () { expect($okButton.length).toBe(1); expect($okButton.text()).toBe(Strings.BUTTON_REPLACE_WITHOUT_UNDO); $okButton.click(); }); waitsFor(function () { return FindInFiles._replaceDone; }, "replace finished"); expectProjectToMatchKnownGood("simple-case-insensitive-large"); }); it("should not do changes on disk if Cancel is clicked in 'too many files' dialog", function () { spyOn(FindInFiles, "doReplace").andCallThrough(); openTestProjectCopy(SpecRunnerUtils.getTestPath("/spec/FindReplace-test-files-large")); openSearchBar(null, true); executeReplace("foo", "bar"); waitsFor(function () { return FindInFiles._searchDone; }, "search finished"); // Click the "Replace" button in the search panel - this should cause the dialog to appear runs(function () { $(".replace-checked").click(); }); runs(function () { expect(FindInFiles._replaceDone).toBeFalsy(); }); var $cancelButton; waitsFor(function () { $cancelButton = $(".dialog-button[data-button-id='cancel']"); return !!$cancelButton.length; }); runs(function () { expect($cancelButton.length).toBe(1); $cancelButton.click(); }); waitsFor(function () { return $(".dialog-button[data-button-id='cancel']").length === 0; }, "dialog dismissed"); runs(function () { expect(FindInFiles.doReplace).not.toHaveBeenCalled(); // Panel should be left open. expect($("#find-in-files-results").is(":visible")).toBeTruthy(); }); }); it("should do single-file Replace All in an open file in the project", function () { openTestProjectCopy(defaultSourcePath); runs(function () { waitsForDone(CommandManager.execute(Commands.CMD_ADD_TO_WORKINGSET_AND_OPEN, { fullPath: testPath + "/foo.js" }), "open file"); }); runs(function () { waitsForDone(CommandManager.execute(Commands.CMD_REPLACE), "open single-file replace bar"); }); waitsFor(function () { return $(".modal-bar").length === 1; }, "search bar open"); executeReplace("foo", "bar"); waitsFor(function () { return FindInFiles._searchDone; }, "search finished"); // Click the "Replace" button in the search panel - this should kick off the replace runs(function () { $(".replace-checked").click(); }); waitsFor(function () { return FindInFiles._replaceDone; }, "replace finished"); expectInMemoryFiles({ inMemoryFiles: ["/foo.js"], inMemoryKGFolder: "simple-case-insensitive" }); }); it("should do single-file Replace All in a non-project file", function () { // Open an empty project. var blankProject = SpecRunnerUtils.getTempDirectory() + "/blank-project", externalFilePath = defaultSourcePath + "/foo.js"; runs(function () { var dirEntry = FileSystem.getDirectoryForPath(blankProject); waitsForDone(promisify(dirEntry, "create")); }); SpecRunnerUtils.loadProjectInTestWindow(blankProject); runs(function () { waitsForDone(CommandManager.execute(Commands.CMD_ADD_TO_WORKINGSET_AND_OPEN, { fullPath: externalFilePath }), "open external file"); }); runs(function () { waitsForDone(CommandManager.execute(Commands.CMD_REPLACE), "open single-file replace bar"); }); waitsFor(function () { return $(".modal-bar").length === 1; }, "search bar open"); executeReplace("foo", "bar"); waitsFor(function () { return FindInFiles._searchDone; }, "search finished"); // Click the "Replace" button in the search panel - this should kick off the replace runs(function () { $(".replace-checked").click(); }); waitsFor(function () { return FindInFiles._replaceDone; }, "replace finished"); expectInMemoryFiles({ inMemoryFiles: [{fullPath: externalFilePath}], // pass a full file path since this is an external file inMemoryKGFolder: "simple-case-insensitive" }); }); it("should show an error dialog if errors occurred during the replacement", function () { showSearchResults("foo", "bar"); runs(function () { spyOn(FindInFiles, "doReplace").andCallFake(function () { return new $.Deferred().reject([ {item: testPath + "/css/foo.css", error: FindUtils.ERROR_FILE_CHANGED}, {item: testPath + "/foo.html", error: FileSystemError.NOT_WRITABLE} ]); }); }); runs(function () { // This will call our mock doReplace $(".replace-checked").click(); }); var $dlg; waitsFor(function () { $dlg = $(".error-dialog"); return !!$dlg.length; }, "dialog appearing"); runs(function () { expect($dlg.length).toBe(1); // Both files should be mentioned in the dialog. var text = $dlg.find(".dialog-message").text(); // Have to check this in a funny way because breakableUrl() adds a special character after the slash. expect(text.match(/css\/.*foo.css/)).not.toBe(-1); expect(text.indexOf(StringUtils.breakableUrl("foo.html"))).not.toBe(-1); $dlg.find(".dialog-button[data-button-id='ok']").click(); expect($(".error-dialog").length).toBe(0); }); }); }); // TODO: these could be split out into unit tests, but would need to be able to instantiate // a SearchResultsView in the test runner window. describe("Checkbox interactions", function () { it("should uncheck all checkboxes and update model when Check All is clicked while checked", function () { showSearchResults("foo", "bar"); runs(function () { expect($(".check-all").is(":checked")).toBeTruthy(); $(".check-all").click(); expect($(".check-all").is(":checked")).toBeFalsy(); expect($(".check-one:checked").length).toBe(0); expect(_.find(FindInFiles.searchModel.results, function (result) { return _.find(result.matches, function (match) { return match.isChecked; }); })).toBeFalsy(); }); }); it("should uncheck one checkbox and update model, unchecking the Check All checkbox", function () { showSearchResults("foo", "bar"); runs(function () { $(".check-one").eq(1).click(); expect($(".check-one").eq(1).is(":checked")).toBeFalsy(); expect($(".check-all").is(":checked")).toBeFalsy(); // In the sorting, this item should be the second match in the first file, which is foo.html var uncheckedMatch = FindInFiles.searchModel.results[testPath + "/foo.html"].matches[1]; expect(uncheckedMatch.isChecked).toBe(false); // Check that all items in the model besides the unchecked one to be checked. expect(_.every(FindInFiles.searchModel.results, function (result) { return _.every(result.matches, function (match) { if (match === uncheckedMatch) { // This one is already expected to be unchecked. return true; } return match.isChecked; }); })).toBeTruthy(); }); }); it("should re-check unchecked checkbox and update model after clicking Check All again", function () { showSearchResults("foo", "bar"); runs(function () { $(".check-one").eq(1).click(); expect($(".check-one").eq(1).is(":checked")).toBeFalsy(); expect($(".check-all").is(":checked")).toBeFalsy(); $(".check-all").click(); expect($(".check-all").is(":checked")).toBeTruthy(); expect($(".check-one:checked").length).toEqual($(".check-one").length); expect(_.every(FindInFiles.searchModel.results, function (result) { return _.every(result.matches, function (match) { return match.isChecked; }); })).toBeTruthy(); }); }); // TODO: checkboxes with paging }); // Untitled documents are covered in the "Search -> Replace All in untitled document" cases above. describe("Panel closure on changes", function () { it("should close the panel and detach listeners if a file is modified on disk", function () { showSearchResults("foo", "bar"); runs(function () { expect($("#find-in-files-results").is(":visible")).toBe(true); waitsForDone(promisify(FileSystem.getFileForPath(testPath + "/foo.html"), "write", "changed content")); }); runs(function () { expect($("#find-in-files-results").is(":visible")).toBe(false); }); }); it("should close the panel if a file is modified in memory", function () { openTestProjectCopy(defaultSourcePath); runs(function () { waitsForDone(CommandManager.execute(Commands.CMD_ADD_TO_WORKINGSET_AND_OPEN, { fullPath: testPath + "/foo.html" }), "open file"); }); openSearchBar(null, true); executeReplace("foo", "bar"); waitsFor(function () { return FindInFiles._searchDone; }, "search finished"); runs(function () { expect($("#find-in-files-results").is(":visible")).toBe(true); var doc = DocumentManager.getOpenDocumentForPath(testPath + "/foo.html"); expect(doc).toBeTruthy(); doc.replaceRange("", {line: 0, ch: 0}, {line: 1, ch: 0}); expect($("#find-in-files-results").is(":visible")).toBe(false); }); }); it("should close the panel if a document was open and modified before the search, but then the file was closed and changes dropped", function () { var doc; openTestProjectCopy(defaultSourcePath); runs(function () { waitsForDone(CommandManager.execute(Commands.CMD_ADD_TO_WORKINGSET_AND_OPEN, { fullPath: testPath + "/foo.html" }), "open file"); }); runs(function () { doc = DocumentManager.getOpenDocumentForPath(testPath + "/foo.html"); expect(doc).toBeTruthy(); doc.replaceRange("", {line: 0, ch: 0}, {line: 1, ch: 0}); }); openSearchBar(null, true); executeReplace("foo", "bar"); waitsFor(function () { return FindInFiles._searchDone; }, "search finished"); runs(function () { expect($("#find-in-files-results").is(":visible")).toBe(true); // We have to go through the dialog workflow for closing the file without saving changes, // because the "revert" behavior only happens in that workflow (it doesn't happen if you // do forceClose, since that's only intended as a shortcut for the end of a unit test). var closePromise = CommandManager.execute(Commands.FILE_CLOSE, { file: doc.file }), $dontSaveButton = $(".dialog-button[data-button-id='dontsave']"); expect($dontSaveButton.length).toBe(1); $dontSaveButton.click(); waitsForDone(closePromise); }); runs(function () { expect($("#find-in-files-results").is(":visible")).toBe(false); }); }); }); describe("Disclosure Arrows", function () { it("should expand/collapse items when clicked", function () { showSearchResults("foo", "bar"); runs(function () { $(".disclosure-triangle").click(); expect($(".disclosure-triangle").hasClass("expanded")).toBeFalsy(); // Check that all results are hidden expect($(".bottom-panel-table tr[data-file-index=0][data-match-index]:hidden").length).toEqual(7); expect($(".bottom-panel-table tr[data-file-index=1][data-match-index]:hidden").length).toEqual(4); $(".disclosure-triangle").click(); expect($(".disclosure-triangle").hasClass("expanded")).toBeTruthy(); expect($(".bottom-panel-table tr[data-file-index=0][data-match-index]:visible").length).toEqual(7); expect($(".bottom-panel-table tr[data-file-index=1][data-match-index]:visible").length).toEqual(4); }); }); }); }); }); }); });
busykai/brackets
test/spec/FindInFiles-test.js
JavaScript
mit
119,508
[ 30522, 1013, 1008, 1008, 9385, 1006, 1039, 1007, 2297, 1011, 2556, 18106, 3001, 5100, 1012, 2035, 2916, 9235, 1012, 1008, 1008, 6656, 2003, 2182, 3762, 4379, 1010, 2489, 1997, 3715, 1010, 2000, 2151, 2711, 11381, 1037, 1008, 6100, 1997, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * Copyright 2007 The Android Open Source Project * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SkBitmapProcState_DEFINED #define SkBitmapProcState_DEFINED #include "SkBitmap.h" #include "SkMatrix.h" #define FractionalInt_IS_64BIT #ifdef FractionalInt_IS_64BIT typedef SkFixed48 SkFractionalInt; #define SkScalarToFractionalInt(x) SkScalarToFixed48(x) #define SkFractionalIntToFixed(x) SkFixed48ToFixed(x) #define SkFixedToFractionalInt(x) SkFixedToFixed48(x) #define SkFractionalIntToInt(x) SkFixed48ToInt(x) #else typedef SkFixed SkFractionalInt; #define SkScalarToFractionalInt(x) SkScalarToFixed(x) #define SkFractionalIntToFixed(x) (x) #define SkFixedToFractionalInt(x) (x) #define SkFractionalIntToInt(x) ((x) >> 16) #endif class SkPaint; struct SkBitmapProcState { typedef void (*ShaderProc32)(const SkBitmapProcState&, int x, int y, SkPMColor[], int count); typedef void (*ShaderProc16)(const SkBitmapProcState&, int x, int y, uint16_t[], int count); typedef void (*MatrixProc)(const SkBitmapProcState&, uint32_t bitmapXY[], int count, int x, int y); typedef void (*SampleProc32)(const SkBitmapProcState&, const uint32_t[], int count, SkPMColor colors[]); typedef void (*SampleProc16)(const SkBitmapProcState&, const uint32_t[], int count, uint16_t colors[]); typedef U16CPU (*FixedTileProc)(SkFixed); // returns 0..0xFFFF typedef U16CPU (*FixedTileLowBitsProc)(SkFixed, int); // returns 0..0xF typedef U16CPU (*IntTileProc)(int value, int count); // returns 0..count-1 const SkBitmap* fBitmap; // chooseProcs - orig or mip const SkMatrix* fInvMatrix; // chooseProcs SkMatrix::MapXYProc fInvProc; // chooseProcs SkFractionalInt fInvSxFractionalInt; SkFractionalInt fInvKyFractionalInt; FixedTileProc fTileProcX; // chooseProcs FixedTileProc fTileProcY; // chooseProcs FixedTileLowBitsProc fTileLowBitsProcX; // chooseProcs FixedTileLowBitsProc fTileLowBitsProcY; // chooseProcs IntTileProc fIntTileProcY; // chooseProcs SkFixed fFilterOneX; SkFixed fFilterOneY; SkPMColor fPaintPMColor; // chooseProcs - A8 config SkFixed fInvSx; // chooseProcs SkFixed fInvKy; // chooseProcs uint16_t fAlphaScale; // chooseProcs uint8_t fInvType; // chooseProcs uint8_t fTileModeX; // CONSTRUCTOR uint8_t fTileModeY; // CONSTRUCTOR SkBool8 fDoFilter; // chooseProcs /** Platforms implement this, and can optionally overwrite only the following fields: fShaderProc32 fShaderProc16 fMatrixProc fSampleProc32 fSampleProc32 They will already have valid function pointers, so a platform that does not have an accelerated version can just leave that field as is. A valid implementation can do nothing (see SkBitmapProcState_opts_none.cpp) */ void platformProcs(); /** Given the byte size of the index buffer to be passed to the matrix proc, return the maximum number of resulting pixels that can be computed (i.e. the number of SkPMColor values to be written by the sample proc). This routine takes into account that filtering and scale-vs-affine affect the amount of buffer space needed. Only valid to call after chooseProcs (setContext) has been called. It is safe to call this inside the shader's shadeSpan() method. */ int maxCountForBufferSize(size_t bufferSize) const; // If a shader proc is present, then the corresponding matrix/sample procs // are ignored ShaderProc32 getShaderProc32() const { return fShaderProc32; } ShaderProc16 getShaderProc16() const { return fShaderProc16; } #ifdef SK_DEBUG MatrixProc getMatrixProc() const; #else MatrixProc getMatrixProc() const { return fMatrixProc; } #endif SampleProc32 getSampleProc32() const { return fSampleProc32; } SampleProc16 getSampleProc16() const { return fSampleProc16; } private: friend class SkBitmapProcShader; ShaderProc32 fShaderProc32; // chooseProcs ShaderProc16 fShaderProc16; // chooseProcs // These are used if the shaderproc is NULL MatrixProc fMatrixProc; // chooseProcs SampleProc32 fSampleProc32; // chooseProcs SampleProc16 fSampleProc16; // chooseProcs SkMatrix fUnitInvMatrix; // chooseProcs SkBitmap fOrigBitmap; // CONSTRUCTOR SkBitmap fMipBitmap; MatrixProc chooseMatrixProc(bool trivial_matrix); bool chooseProcs(const SkMatrix& inv, const SkPaint&); #ifdef SK_DEBUG static void DebugMatrixProc(const SkBitmapProcState&, uint32_t[], int count, int x, int y); #endif }; /* Macros for packing and unpacking pairs of 16bit values in a 32bit uint. Used to allow access to a stream of uint16_t either one at a time, or 2 at a time by unpacking a uint32_t */ #ifdef SK_CPU_BENDIAN #define PACK_TWO_SHORTS(pri, sec) ((pri) << 16 | (sec)) #define UNPACK_PRIMARY_SHORT(packed) ((uint32_t)(packed) >> 16) #define UNPACK_SECONDARY_SHORT(packed) ((packed) & 0xFFFF) #else #define PACK_TWO_SHORTS(pri, sec) ((pri) | ((sec) << 16)) #define UNPACK_PRIMARY_SHORT(packed) ((packed) & 0xFFFF) #define UNPACK_SECONDARY_SHORT(packed) ((uint32_t)(packed) >> 16) #endif #ifdef SK_DEBUG static inline uint32_t pack_two_shorts(U16CPU pri, U16CPU sec) { SkASSERT((uint16_t)pri == pri); SkASSERT((uint16_t)sec == sec); return PACK_TWO_SHORTS(pri, sec); } #else #define pack_two_shorts(pri, sec) PACK_TWO_SHORTS(pri, sec) #endif // These functions are generated via macros, but are exposed here so that // platformProcs may test for them by name. void S32_opaque_D32_filter_DX(const SkBitmapProcState& s, const uint32_t xy[], int count, SkPMColor colors[]); void S32_alpha_D32_filter_DX(const SkBitmapProcState& s, const uint32_t xy[], int count, SkPMColor colors[]); void S32_opaque_D32_filter_DXDY(const SkBitmapProcState& s, const uint32_t xy[], int count, SkPMColor colors[]); void S32_alpha_D32_filter_DXDY(const SkBitmapProcState& s, const uint32_t xy[], int count, SkPMColor colors[]); void ClampX_ClampY_filter_scale(const SkBitmapProcState& s, uint32_t xy[], int count, int x, int y); void ClampX_ClampY_nofilter_scale(const SkBitmapProcState& s, uint32_t xy[], int count, int x, int y); void ClampX_ClampY_filter_affine(const SkBitmapProcState& s, uint32_t xy[], int count, int x, int y); void ClampX_ClampY_nofilter_affine(const SkBitmapProcState& s, uint32_t xy[], int count, int x, int y); #endif
JoKaWare/WTL-DUI
third_party/skia/src/core/SkBitmapProcState.h
C
bsd-3-clause
7,700
[ 30522, 1013, 1008, 1008, 9385, 2289, 1996, 11924, 2330, 3120, 2622, 1008, 1008, 2224, 1997, 2023, 3120, 3642, 2003, 9950, 2011, 1037, 18667, 2094, 1011, 2806, 6105, 2008, 2064, 2022, 1008, 2179, 1999, 1996, 6105, 5371, 1012, 1008, 1013, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
class CreateCheckInSurveys < ActiveRecord::Migration def change create_table :check_in_surveys do |t| t.string :title t.text :description t.string :version, index: true t.text :question_1 t.text :question_2 t.text :question_3 t.text :question_4 t.timestamps end end end
ccfapprn/network
db/migrate/20150204085338_create_check_in_surveys.rb
Ruby
mit
331
[ 30522, 2465, 3443, 5403, 18009, 3619, 3126, 12417, 2015, 1026, 3161, 2890, 27108, 2094, 1024, 1024, 9230, 13366, 2689, 3443, 1035, 2795, 1024, 4638, 1035, 1999, 1035, 12265, 2079, 1064, 1056, 1064, 1056, 1012, 5164, 1024, 2516, 1056, 1012, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#!/bin/bash set -x sh run_zero.sh sh run_Bspline.sh sh run_decay.sh sh run_Gaussian.sh
andmax/gpufilter
scripts/run_all.sh
Shell
mit
92
[ 30522, 1001, 999, 1013, 8026, 1013, 24234, 2275, 1011, 1060, 14021, 2448, 1035, 5717, 1012, 14021, 14021, 2448, 1035, 18667, 28296, 2063, 1012, 14021, 14021, 2448, 1035, 13121, 1012, 14021, 14021, 2448, 1035, 11721, 17854, 2937, 1012, 14021, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
'use strict'; var _ = require('lodash'); var helpers = require('./helpers'); var responseParser = require('./responseparser'); var request = require('./request'); // A resource on the API, instances of this are used as the prototype of // instances of each API resource. This constructor will build up a method // for each action that can be performed on the resource. // // - @param {Object} options // - @param {Object} schema // // The `options` argument should have the following properties: // // - `resourceDefinition` - the definition of the resource and its actions from // the schema definition. // - `consumerkey` - the oauth consumerkey // - `consumersecret` the oauth consumersecret // - `schema` - the schema defintion // - `format` - the desired response format // - `logger` - for logging output function Resource(options, schema) { this.logger = options.logger; this.resourceName = options.resourceDefinition.resource; this.host = options.resourceDefinition.host || schema.host; this.sslHost = options.resourceDefinition.sslHost || schema.sslHost; this.port = options.resourceDefinition.port || schema.port; this.prefix = options.resourceDefinition.prefix || schema.prefix; this.consumerkey = options.consumerkey; this.consumersecret = options.consumersecret; if(this.logger.silly) { this.logger.silly('Creating constructor for resource: ' + this.resourceName); } _.each(options.resourceDefinition.actions, function processAction(action) { this.createAction(action, options.userManagement); }, this); } // Figure out the appropriate method name for an action on a resource on // the API // // - @param {Mixed} - actionDefinition - Either a string if the action method // name is the same as the action path component on the underlying API call // or a hash if they differ. // - @return {String} Resource.prototype.chooseMethodName = function (actionDefinition) { var fnName; // Default the action name to getXXX if we only have the URL slug as the // action definition. if (_.isString(actionDefinition)) { fnName = 'get' + helpers.capitalize(actionDefinition); } else { fnName = actionDefinition.methodName; } return fnName; }; // Utility method for creating the necessary methods on the Resource for // dispatching the request to the 7digital API. // // - @param {Mixed} actionDefinition - Either a string if the action method // name is the same as the action path component on the underlying API call // or a hash if they differ. Resource.prototype.createAction = function (actionDefinition, isManaged) { var url; var fnName = this.chooseMethodName(actionDefinition); var action = typeof actionDefinition.apiCall === 'undefined' ? actionDefinition : actionDefinition.apiCall; var httpMethod = (actionDefinition.method || 'GET').toUpperCase(); var host = actionDefinition.host || this.host; var sslHost = actionDefinition.sslHost || this.sslHost; var port = actionDefinition.port || this.port; var prefix = actionDefinition.prefix || this.prefix; var authType = (actionDefinition.oauth && actionDefinition.oauth === '3-legged' && isManaged) ? '2-legged' : actionDefinition.oauth; if(this.logger.silly) { this.logger.silly( 'Creating method: ' + fnName + ' for ' + action + ' action with ' + httpMethod + ' HTTP verb'); } /*jshint validthis: true */ function invokeAction(requestData, callback) { var self = this; var endpointInfo = { host: invokeAction.host, sslHost: invokeAction.sslHost || sslHost, port: invokeAction.port, prefix: invokeAction.prefix, authtype: authType, url: helpers.formatPath(invokeAction.prefix, this.resourceName, action) }; var credentials = { consumerkey: this.consumerkey, consumersecret: this.consumersecret }; if (_.isFunction(requestData)) { callback = requestData; requestData = {}; } function checkAndParse(err, data, response) { if (err) { return callback(err); } return responseParser.parse(data, { format: self.format, logger: self.logger, url: endpointInfo.url, params: requestData, contentType: response.headers['content-type'] }, getLocationForRedirectsAndCallback); function getLocationForRedirectsAndCallback(err, parsed) { if (err) { return callback(err); } if (response && response.headers['location']) { parsed.location = response.headers['location']; } return callback(null, parsed); } } _.defaults(requestData, this.defaultParams); if (httpMethod === 'GET') { // Add the default parameters to the request data return request.get(endpointInfo, requestData, this.headers, credentials, this.logger, checkAndParse); } if (httpMethod === 'POST' || httpMethod === 'PUT') { return request.postOrPut(httpMethod, endpointInfo, requestData, this.headers, credentials, this.logger, checkAndParse); } return callback(new Error('Unsupported HTTP verb: ' + httpMethod)); } invokeAction.action = action; invokeAction.authtype = authType; invokeAction.host = host; invokeAction.sslHost = sslHost; invokeAction.port = port; invokeAction.prefix = prefix; this[fnName] = invokeAction; }; module.exports = Resource;
raoulmillais/7digital-api
lib/resource.js
JavaScript
isc
5,206
[ 30522, 1005, 2224, 9384, 1005, 1025, 13075, 1035, 1027, 5478, 1006, 1005, 8840, 8883, 2232, 1005, 1007, 1025, 13075, 2393, 2545, 1027, 5478, 1006, 1005, 1012, 1013, 2393, 2545, 1005, 1007, 1025, 13075, 3433, 19362, 8043, 1027, 5478, 1006, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
import * as React from "react"; import { CarbonIconProps } from "../../"; declare const FlowData20: React.ForwardRefExoticComponent< CarbonIconProps & React.RefAttributes<SVGSVGElement> >; export default FlowData20;
mcliment/DefinitelyTyped
types/carbon__icons-react/lib/flow--data/20.d.ts
TypeScript
mit
218
[ 30522, 12324, 1008, 2004, 10509, 2013, 1000, 10509, 1000, 1025, 12324, 1063, 6351, 28524, 21572, 4523, 1065, 2013, 1000, 1012, 1012, 1013, 1012, 1012, 1013, 1000, 1025, 13520, 9530, 3367, 4834, 2850, 2696, 11387, 1024, 10509, 1012, 2830, 28...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# AcceDe Web - overlay WAI-ARIA overlay plugin without dependencies. This plugin is written in ES2015 and available either in uncompiled form in the `/lib` folder or compiled for ES5 in the `/dist` folder. If your project uses babel with Webpack or Rollup, you should change the exclusion so this plugin gets compiled or force Webpack or Rollup to fetch the compiled version by using the `main` entry of the `package.json` file instead of the `module` entry. ```js // .babelrc file or configuration within webpack or rollup { "plugins": [...], "exclude": "node_modules/!(@accede-web)/**", } ``` ## Installation ```bash $ npm install @accede-web/overlay ``` ## Methods | Name | Description | |-----------------------|-------------| | `show()` | Switch the `aria-hidden` attribute to `false` and disable the rest of the document (if the `modal` parameter is not set to `false`) | | `close( returnValue )` | Switch the `aria-hidden` attribute to `true` and enable the rest of the document if needed. Dispatch `close` event on the overlay. Also available on the root element of the overlay. The `returnValue` property can be sent invoking this method | | `addEventListener(eventName, callback)` | Shortcut to listen to the `close` or `cancel` events | | `removeEventListener(eventName, callback)` | Shortcut to stop listening to the `close` or `cancel` events | ## Properties | Name | Description | |-----------------------|-------------| | `el` | The HTML root element of the overlay | | `returnValue` | Also available on the HTML root element. Allows you to pass data between the overlay and the document | ## Static properties Contrary to the instance's properties, the static properties are available on the constructor. | Name | Description | |-----------------------|-------------| | `stack` | Pending overlay stack. Array of all the overlays currently open | ## Events | Name | Description | |-----------------------|-------------| | `close` | Triggered when the method `.close()` is called | | `cancel` | Triggered when the parameter `closeOnCancel` is `true` and an escape key keydown or a click outside the overlay is happening. Can be prevented with `event.preventDefault()`. Triggers a `close` event when not prevented | ## Inserting an element in an overlay ### HTML ```html <!-- content to be insterted in an overlay --> <section class="overlay"> <header class="layer-header"> <button class="button-close"> <span>Close</span> </button> <h2 class="layer-title">Modal window</h2> </header> <div class="layer-content"> <p>…</p> </div> </section> ``` ### JavaScript ```js // the content property can be an HTMLElement var overlay = new Overlay({ content: document.querySelector( '.overlay' ) }); // … or an HTML string var overlay = new Overlay({ content: '<div><p>Hello</p></div>' }); overlay.addEventListener( 'close', e => { // the value returned by the overlay console.log( e.target.returnValue ); }); // Display the overlay overlay.show(); // Close the overlay and pass the return value overlay.close( 'returnValueData' ); ``` ### Parameters #### Mandatory parameters | Name | Type | Description | |-----------------|-------------------------------|-------------| | `content` | `HTMLElement` or `String` | Content to insert in the overlay. | #### Optional parameters | Name | Type | Description | |-----------------|---------------|-------------| | `className` | `String` | HTML classes to add to the overlay (space separated) | | `closeOnCancel` | `Boolean` | Allow the Escape key or a click outside the overlay to close it. Defaults to `true` | | `closeSelector` | `String` | CSS selector to match any element that will close the overlay when clicked | | `modal` | `Boolean` | Should the overlay be modal (disable anything but the overlay on the page). Defaults to `true` | | `opener` | `HTMLElement` | HTML element that will receive the focus once the overlay is closed. Defaults to the current active element | | `tagName` | `String` | Change the tag name of the overlay. Defaults to `<div>` | | `role` | `String` | Specify the role attribute of the overlay. Can be `dialog` or `alertdialog` | | `titleSelector` | `String` | Mandatory when using a `role` attribute and no `label` property, a CSS selector matching the title the overlay should have. Defaults to `[data-label]` | | `label` | `String` | Mandatory when using a `role` attribute and there's no title displayed in the overlay to specify the title of the overlay | ## Passing the formated overlay In this case the overlay is a valid and accessible HTML structure passed to the script. The script is used to handle the events and to disable the document. ### HTML ```html <!-- valid overlay structure example --> <div role="alertdialog" class="layer" aria-hidden="true" aria-labelledby="layerTitle" aria-describedby="layerDesc"> <section class="layer"> <header class="layer-header"> <button class="button-close"> <span>Close</span> </button> <h2 class="layer-title" id="layerTitle">Warning</h2> </header> <div class="layer-content"> <p id="layerDesc">Your confirmation number is required before continuing.</p> </div> </section> </div> ``` ### JavaScript ```js var overlay = new Overlay( document.querySelector( '.layer' ), { closeOnCancel: false, opener: document.querySelector( 'button' ), closeSelector, '.button-close' modal: false }); // Display the overlay overlay.show(); // Close the overlay overlay.close(); ``` ### Optional parameters | Name | Type | Description | |-----------------|---------------|-------------| | `closeOnCancel` | `Boolean` | Allow the Escape key or a click outside the overlay to close it. Defaults to `true` | | `closeSelector` | `String` | CSS selector to match any element that will close the overlay when clicked | | `modal` | `Boolean` | Should the overlay be modal (disable anything but the overlay on the page). Defaults to `true` | | `opener` | `HTMLElement` | HTML element that will receive the focus once the overlay is closed. Defaults to the current active element | ## Keyboard Interaction * `Tab`: Moves focus to the next tabbable element inside the overlay. * `Shift + Tab`: Moves focus to the previous tabbable element inside the overlay. * `Escape`: Closes the overlay. ## Polyfill In order to dispatch the `close` and `cancel` event, the script uses the `CustomEvent` constructor. A polyfill for `CustomEvent` is mandatory when the support of Internet Explorer is required. You can find one on the [MDN website](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent#Polyfill). ## Compatibilty This plugin is tested against the following browsers: * Internet Explorer 11 and higher * Microsoft Edge * Chrome * Firefox * Safari ## Testing Install the project dependencies: ```bash $ npm install ``` Run the automated test cases: ```bash $ npm test ```
Switch-Company/modal
README.md
Markdown
isc
7,330
[ 30522, 1001, 16222, 14728, 4773, 1011, 2058, 8485, 23701, 1011, 9342, 2058, 8485, 13354, 2378, 2302, 12530, 15266, 1012, 2023, 13354, 2378, 2003, 2517, 1999, 9686, 11387, 16068, 1998, 2800, 2593, 1999, 4895, 9006, 22090, 2094, 2433, 1999, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- **************************************************************** --> <!-- * PLEASE KEEP COMPLICATED EXPRESSIONS OUT OF THESE TEMPLATES, * --> <!-- * i.e. only iterate & print data where possible. Thanks, Jez. * --> <!-- **************************************************************** --> <html> <head> <!-- Generated by groovydoc (2.3.3) on Tue Jul 01 09:50:55 CEST 2014 --> <title>ComponentResult (Gradle API 2.0)</title> <meta name="date" content="2014-07-01"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link href="../../../../../groovy.ico" type="image/x-icon" rel="shortcut icon"> <link href="../../../../../groovy.ico" type="image/x-icon" rel="icon"> <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> <body class="center"> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="ComponentResult (Gradle API 2.0)"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <div> <ul class="navList"> <li><a href="../../../../../index.html?org/gradle/api/artifacts/result/ComponentResult" target="_top">Frames</a></li> <li><a href="ComponentResult.html" target="_top">No Frames</a></li> </ul> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> Nested&nbsp;&nbsp;&nbsp;Field&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<li><a href="#method_summary">Method</a></li>&nbsp;&nbsp;&nbsp; </ul> <ul class="subNavList"> <li>&nbsp;|&nbsp;Detail:&nbsp;</li> Field&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<li><a href="#method_detail">Method</a></li>&nbsp;&nbsp;&nbsp; </ul> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">Package: <strong>org.gradle.api.artifacts.result</strong></div> <h2 title="[Java] Interface ComponentResult" class="title">[Java] Interface ComponentResult</h2> </div> <div class="contentContainer"> <ul class="inheritance"> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <p> The result of resolving a component. <DL><DT><B>Since:</B></DT><DD>2.0</DD></DL></p> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- =========== NESTED CLASS SUMMARY =========== --> <!-- =========== ENUM CONSTANT SUMMARY =========== --> <!-- =========== FIELD SUMMARY =========== --> <!-- =========== PROPERTY SUMMARY =========== --> <!-- =========== ELEMENT SUMMARY =========== --> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method_summary"><!-- --></a> <h3>Methods Summary</h3> <ul class="blockList"> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Methods Summary table"> <caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Type</th> <th class="colLast" scope="col">Name and description</th> </tr> <tr class="altColor"> <td class="colFirst"><code><a href='../../../../../org/gradle/api/artifacts/component/ComponentIdentifier.html'>ComponentIdentifier</a></strong></code></td> <td class="colLast"><code><strong><a href="#getId()">getId</a></strong>()</code><br>Returns the ID of the requested component.</td> </tr> </table> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- =========== METHOD DETAIL =========== --> <ul class="blockList"> <li class="blockList"><a name="method_detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="getId()"><!-- --></a> <ul class="blockListLast"> <li class="blockList"> <h4>public&nbsp;<a href='../../../../../org/gradle/api/artifacts/component/ComponentIdentifier.html'>ComponentIdentifier</a> <strong>getId</strong>()</h4> <p> Returns the ID of the requested component. </p> </li> </ul> </li> </ul> </li> </ul> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <div> <ul class="navList"> <li><a href="../../../../../index.html?org/gradle/api/artifacts/result/ComponentResult" target="_top">Frames</a></li> <li><a href="ComponentResult.html" target="_top">No Frames</a></li> </ul> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> Nested&nbsp;&nbsp;&nbsp;Field&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<li><a href="#method_summary">Method</a></li>&nbsp;&nbsp;&nbsp; </ul> <ul class="subNavList"> <li>&nbsp;|&nbsp;Detail:&nbsp;</li> Field&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<li><a href="#method_detail">Method</a></li>&nbsp;&nbsp;&nbsp; </ul> </div> <p>Gradle API 2.0</p> <a name="skip-navbar_bottom"> <!-- --> </a> </div> </div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
VolitionEos/DungFactory
.gradlew/wrapper/dists/gradle-2.0-all/7rd4e4rcg4riqi0j6j508m2lbk/gradle-2.0/docs/groovydoc/org/gradle/api/artifacts/result/ComponentResult.html
HTML
gpl-3.0
7,713
[ 30522, 1026, 999, 9986, 13874, 16129, 2270, 1000, 1011, 1013, 1013, 1059, 2509, 2278, 1013, 1013, 26718, 2094, 16129, 1018, 1012, 5890, 17459, 1013, 1013, 4372, 1000, 1000, 8299, 1024, 1013, 1013, 7479, 1012, 1059, 2509, 1012, 8917, 1013, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* STB6100 Silicon Tuner Copyright (C) Manu Abraham (abraham.manu@gmail.com) Copyright (C) ST Microelectronics This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef __STB_6100_REG_H #define __STB_6100_REG_H #include <linux/dvb/frontend.h> #include "dvb_frontend.h" #define STB6100_LD 0x00 #define STB6100_LD_LOCK (1 << 0) #define STB6100_VCO 0x01 #define STB6100_VCO_OSCH (0x01 << 7) #define STB6100_VCO_OSCH_SHIFT 7 #define STB6100_VCO_OCK (0x03 << 5) #define STB6100_VCO_OCK_SHIFT 5 #define STB6100_VCO_ODIV (0x01 << 4) #define STB6100_VCO_ODIV_SHIFT 4 #define STB6100_VCO_OSM (0x0f << 0) #define STB6100_NI 0x02 #define STB6100_NF_LSB 0x03 #define STB6100_K 0x04 #define STB6100_K_PSD2 (0x01 << 2) #define STB6100_K_PSD2_SHIFT 2 #define STB6100_K_NF_MSB (0x03 << 0) #define STB6100_G 0x05 #define STB6100_G_G (0x0f << 0) #define STB6100_G_GCT (0x07 << 5) #define STB6100_F 0x06 #define STB6100_F_F (0x1f << 0) #define STB6100_DLB 0x07 #define STB6100_TEST1 0x08 #define STB6100_FCCK 0x09 #define STB6100_FCCK_FCCK (0x01 << 6) #define STB6100_LPEN 0x0a #define STB6100_LPEN_LPEN (0x01 << 4) #define STB6100_LPEN_SYNP (0x01 << 5) #define STB6100_LPEN_OSCP (0x01 << 6) #define STB6100_LPEN_BEN (0x01 << 7) #define STB6100_TEST3 0x0b #define STB6100_NUMREGS 0x0c #define INRANGE(val, x, y) (((x <= val) && (val <= y)) || \ ((y <= val) && (val <= x)) ? 1 : 0) #define CHKRANGE(val, x, y) (((val >= x) && (val < y)) ? 1 : 0) struct stb6100_config { u8 tuner_address; u32 refclock; }; struct stb6100_state { struct i2c_adapter *i2c; const struct stb6100_config *config; struct dvb_tuner_ops ops; struct dvb_frontend *frontend; struct tuner_state status; u32 frequency; u32 srate; u32 bandwidth; u32 reference; }; #if defined(CONFIG_DVB_STB6100) || (defined(CONFIG_DVB_STB6100_MODULE) && defined(MODULE)) extern struct dvb_frontend *stb6100_attach(struct dvb_frontend *fe, const struct stb6100_config *config, struct i2c_adapter *i2c); #else static inline struct dvb_frontend *stb6100_attach(struct dvb_frontend *fe, const struct stb6100_config *config, struct i2c_adapter *i2c) { printk(KERN_WARNING "%s: Driver disabled by Kconfig\n", __func__); return NULL; } #endif // #endif
holyangel/LGE_G3
drivers/media/dvb/frontends/stb6100.h
C
gpl-2.0
2,986
[ 30522, 1013, 1008, 2358, 2497, 2575, 18613, 13773, 8694, 2099, 9385, 1006, 1039, 1007, 2158, 2226, 8181, 1006, 8181, 1012, 2158, 2226, 1030, 20917, 4014, 1012, 4012, 1007, 9385, 1006, 1039, 1007, 2358, 12702, 12260, 6593, 4948, 6558, 2023, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.6.0_18) on Thu Dec 18 17:18:33 PST 2014 --> <title>Uses of Class java.io.OptionalDataException (Java Platform SE 7 )</title> <meta name="date" content="2014-12-18"> <link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class java.io.OptionalDataException (Java Platform SE 7 )"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../java/io/OptionalDataException.html" title="class in java.io">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../index-files/index-1.html">Index</a></li> <li><a href="../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage"><em><strong>Java&trade;&nbsp;Platform<br>Standard&nbsp;Ed.&nbsp;7</strong></em></div> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../index.html?java/io/class-use/OptionalDataException.html" target="_top">Frames</a></li> <li><a href="OptionalDataException.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Class java.io.OptionalDataException" class="title">Uses of Class<br>java.io.OptionalDataException</h2> </div> <div class="classUseContainer">No usage of java.io.OptionalDataException</div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../java/io/OptionalDataException.html" title="class in java.io">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../index-files/index-1.html">Index</a></li> <li><a href="../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage"><em><strong>Java&trade;&nbsp;Platform<br>Standard&nbsp;Ed.&nbsp;7</strong></em></div> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../index.html?java/io/class-use/OptionalDataException.html" target="_top">Frames</a></li> <li><a href="OptionalDataException.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small><font size="-1"> <a href="http://bugreport.sun.com/bugreport/">Submit a bug or feature</a> <br>For further API reference and developer documentation, see <a href="http://docs.oracle.com/javase/7/docs/index.html" target="_blank">Java SE Documentation</a>. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.<br> <a href="../../../../legal/cpyr.html">Copyright</a> &#x00a9; 1993, 2015, Oracle and/or its affiliates. All rights reserved. </font></small></p> </body> </html>
fbiville/annotation-processing-ftw
doc/java/jdk7/java/io/class-use/OptionalDataException.html
HTML
mit
4,841
[ 30522, 1026, 999, 9986, 13874, 16129, 2270, 1000, 1011, 1013, 1013, 1059, 2509, 2278, 1013, 1013, 26718, 2094, 16129, 1018, 1012, 5890, 17459, 1013, 1013, 4372, 1000, 1000, 8299, 1024, 1013, 1013, 7479, 1012, 1059, 2509, 1012, 8917, 1013, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# # Copyright (c) 2005, 2007, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License version 2 only, as # published by the Free Software Foundation. # # This code is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # version 2 for more details (a copy is included in the LICENSE file that # accompanied this code). # # You should have received a copy of the GNU General Public License version # 2 along with this work; if not, write to the Free Software Foundation, # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. # # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA # or visit www.oracle.com if you need additional information or have any # questions. # # @test # @bug 6287579 # @summary SubClasses of ListResourceBundle should fix getContents() # # @run shell ImmutableResourceTest.sh # Beginning of subroutines: status=1 #Call this from anywhere to fail the test with an error message # usage: fail "reason why the test failed" fail() { echo "The test failed :-(" echo "$*" 1>&2 echo "exit status was $status" exit $status } #end of fail() #Call this from anywhere to pass the test with a message # usage: pass "reason why the test passed if applicable" pass() { echo "The test passed!!!" echo "$*" 1>&2 exit 0 } #end of pass() # end of subroutines # The beginning of the script proper OS=`uname -s` case "$OS" in SunOS | Linux | Darwin ) PATHSEP=":" ;; Windows* | CYGWIN*) PATHSEP=";" ;; # catch all other OSs * ) echo "Unrecognized system! $OS" fail "Unrecognized system! $OS" ;; esac TARGETCLASS="ImmutableResourceTest" if [ -z "${TESTJAVA}" ] ; then # TESTJAVA is not set, so the test is running stand-alone. # TESTJAVA holds the path to the root directory of the build of the JDK # to be tested. That is, any java files run explicitly in this shell # should use TESTJAVA in the path to the java interpreter. # So, we'll set this to the JDK spec'd on the command line. If none # is given on the command line, tell the user that and use a default. # THIS IS THE JDK BEING TESTED. if [ -n "$1" ] ; then TESTJAVA=$1 else TESTJAVA=$JAVA_HOME fi TESTSRC=. TESTCLASSES=. #Deal with .class files: fi # echo "JDK under test is: $TESTJAVA" # CP="-classpath ${TESTCLASSES}${PATHSEP}${TESTJAVA}/lib/jconsole.jar" # Compile the test class using the classpath we need: # env # set -vx # #Compile. jconsole.jar is required on the classpath. ${TESTJAVA}/bin/javac -d "${TESTCLASSES}" ${CP} -g \ "${TESTSRC}"/"${TARGETCLASS}".java # #Run the test class, again with the classpath we need: ${TESTJAVA}/bin/java ${CP} ${TARGETCLASS} status=$? echo "test status was: $status" if [ $status -eq "0" ]; then pass "" else fail "unspecified test failure" fi
openjdk-mirror/jdk7u-jdk
test/sun/tools/jconsole/ImmutableResourceTest.sh
Shell
gpl-2.0
3,219
[ 30522, 1001, 1001, 9385, 1006, 1039, 1007, 2384, 1010, 2289, 1010, 14721, 1998, 1013, 2030, 2049, 18460, 1012, 2035, 2916, 9235, 1012, 1001, 2079, 30524, 2030, 2023, 5371, 20346, 1012, 1001, 1001, 2023, 3642, 2003, 2489, 4007, 1025, 2017, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package org.ibase4j.service; import org.ibase4j.model.SysDept; import top.ibase4j.core.base.BaseService; /** * @author ShenHuaJie * @since 2018年4月24日 上午10:59:30 */ public interface SysDeptService extends BaseService<SysDept> { }
iBase4J/iBase4J
iBase4J-SYS-Facade/src/main/java/org/ibase4j/service/SysDeptService.java
Java
apache-2.0
259
[ 30522, 7427, 8917, 1012, 21307, 11022, 2549, 3501, 1012, 2326, 1025, 12324, 8917, 1012, 21307, 11022, 2549, 3501, 1012, 2944, 1012, 25353, 16150, 23606, 1025, 12324, 2327, 1012, 21307, 11022, 2549, 3501, 1012, 4563, 1012, 2918, 1012, 7888, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...