/*
* Copyright 2015 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/

#ifndef SkTableColorFilter_DEFINED
#define SkTableColorFilter_DEFINED

#include "include/core/SkColorFilter.h"

class SK_API SkTableColorFilter {
public:
    /**
     *  Create a table colorfilter, copying the table into the filter, and
     *  applying it to all 4 components.
     *      a' = table[a];
     *      r' = table[r];
     *      g' = table[g];
     *      b' = table[b];
     *  Compoents are operated on in unpremultiplied space. If the incomming
     *  colors are premultiplied, they are temporarily unpremultiplied, then
     *  the table is applied, and then the result is remultiplied.
     */
    static sk_sp<SkColorFilter> Make(const uint8_t table[256]);

    /**
     *  Create a table colorfilter, with a different table for each
     *  component [A, R, G, B]. If a given table is NULL, then it is
     *  treated as identity, with the component left unchanged. If a table
     *  is not null, then its contents are copied into the filter.
     */
    static sk_sp<SkColorFilter> MakeARGB(const uint8_t tableA[256],
                                         const uint8_t tableR[256],
                                         const uint8_t tableG[256],
                                         const uint8_t tableB[256]);

    static void RegisterFlattenables();
};

#endif


� 28 46 105 22
Ĵʡ ̶ 28 54 105 26
Ĵʡ  28 53 105 27
Ĵʡ  28 46 104 37
Ĵʡ ɳ 29 25 103 33
Ĵʡ ͨ 29 24 103 49
Ĵʡ  29 34 103 46
Ĵʡ ں 29 15 103 5
Ĵʡ  30 3 103 50
Ĵʡ  29 59 102 60
Ĵʡ ׽ 30 53 104 14
Ĵʡ ¶ 30 50 104 9
Ĵʡ Ȫ 30 34 104 16
Ĵʡ ɻ 30 40 104 6
Ĵʡ  30 40 104 5
Ĵʡ ţ 30 42 104 3
Ĵʡ  30 41 104 3
Ĵʡ  30 39 104 3
Ĵʡ ½ 30 42 103 50
Ĵʡ  31 8 104 23
Ĵʡ ɽ 30 31 105 34
Ĵʡ  30 21 105 27
Ĵʡ  31 51 106 46
Ĵʡ ͨ 31 13 107 29
Ĵʡ  30 46 106 3
Ĵʡ ƺ 30 46 106 6
Ĵʡ ˳ 30 47 106 5
Ĵʡ  32 39 105 53
Ĵʡ  32 26 105 50
Ĵʡ Ԫ 32 19 105 58
Ĵʡ  31 28 104 45
Ĵʡ  31 28 104 44
Ĵʡ  26 36 101 36
Ĵʡ ʺ 26 30 101 44
Ĵʡ  26 33 101 42
Ĵʡ  27 54 102 16
Ĵʡ  31 47 104 45
Ĵʡ Դ 32 4 108 2
Ĵʡ  30 23 106 46
Ĵʡ  31 33 105 60
Ĵʡ  30 24 104 33
Ĵʡ  31 21 104 12
Ĵʡ ʲ 31 8 104 10
Ĵʡ  31 0 103 37
Ĵʡ  30 25 103 28
Ĵʡ  30 38 103 40
Ĵʡ  30 59 103 56
Ĵʡ 㺺 30 59 104 17
Ĵʡ üɽ 29 36 103 29
Ĵʡ ɽ 28 50 104 20
Ĵʡ ന 32 35 105 14
Ĵʡ  28 43 99 17
Ĵʡ Դ 27 26 101 30
Ĵʡ α 26 42 101 51
Ĵʡ  26 40 102 15
Ĵʡ ᶫ 26 38 102 35
Ĵʡ  27 4 102 46
Ĵʡ ո 27 23 102 32
Ĵʡ ² 27 24 102 11
Ĵʡ  26 53 102 7
Ĵʡ  27 43 102 49
Ĵʡ Ѿ 28 1 102 51
Ĵʡ ϲ 28 19 102 25
Ĵʡ Խ 28 39 102 31
Ĵʡ  28 33 102 10
Ĵʡ  29 0 101 30
Ĵʡ ľ 27 56 101 17
Ĵʡ  29 2 100 18
Ĵʡ  29 60 100 16
Ĵʡ Ž 30 2 101 1
Ĵʡ  30 3 101 58
Ĵʡ ʯ 29 14 102 22
Ĵʡ  28 58 102 46
Ĵʡ Դ 29 21 102 39
Ĵʡ ȫ 30 4 102 45
Ĵʡ  29 48 102 51
Ĵʡ «ɽ 30 9 102 55
Ĵʡ  29 55 102 14
Ĵʡ  30 53 101 53
Ĵʡ С 31 0 102 22
Ĵʡ  30 22 102 49
Ĵʡ  31 29 102 4
Ĵʡ  30 59 101 7
Ĵʡ  30 57 100 19
Ĵʡ ¯ 31 24 100 41
Ĵʡ  31 37 99 59
Ĵʡ ¸ 31 49 98 35
Ĵʡ  31 13 98 50
Ĵʡ  30 0 99 6
Ĵʡ  28 56 99 48
Ĵʡ ʯ 32 59 98 6
Ĵʡ  33 35 102 57
Ĵʡ  32 54 101 42
Ĵʡ ɫ 32 16 100 20
Ĵʡ  32 16 100 59
Ĵʡ ԭ 32 48 102 33
Ĵʡ


utheast
keys[2][1][2].southeast, keys[2][1][2].northwest = keys[2][1][2].northwest, keys[2][1][2].southeast

-- Swap the M and ',' keys
keys[3][10][1], keys[4][8][1] = keys[4][8][1], keys[3][10][1] -- M <> ;
keys[3][10][2], keys[4][8][2] = keys[4][8][2], keys[3][10][2] -- m <> ,
-- And as M/m is now near the right border, swap its popup east swipes to be west swipes
keys[3][10][1].northwest, keys[3][10][1].northeast = keys[3][10][1].northeast, nil
keys[3][10][2].northwest, keys[3][10][2].northeast = keys[3][10][2].northeast, nil
keys[3][10][1].west, keys[3][10][1].east = keys[3][10][1].east, nil
keys[3][10][2].west, keys[3][10][2].east = keys[3][10][2].east, nil

-- Remove the "space" string
keys[5][4].label = ""
-- Or, if we'd rather have it in french:
-- keys[5][4].label = "espace"

return fr_keyboard


            second_field as usize,
            Some(*field.field_char == 'G'),
        );
        // strip trailing zeroes
        match f_sci.post_decimal.clone() {
            Some(ref post_dec) => {
                let mut i = post_dec.len();
                {
                    let mut it = post_dec.chars();
                    while let Some(c) = it.next_back() {
                        if c != '0' {
                            break;
                        }
                        i -= 1;
                    }
                }
                if i != post_dec.len() {
                    f_sci.post_decimal = Some(String::from(&post_dec[0..i]));
                }
            }
            None => {}
        }
        let f_fl = get_primitive_dec(
            inprefix,
            &str_in[inprefix.offset..],
            &analysis,
            second_field as usize,
            None,
        );
        Some(if get_len_fprim(&f_fl) >= get_len_fprim(&f_sci) {
            f_sci
        } else {
            f_fl
        })
    }
    fn primitive_to_str(&self, prim: &FormatPrimitive, field: FormatField) -> String {
        primitive_to_str_common(prim, &field)
    }
}
<filename>2018/rust/src/12a.rs
fn main() {
    println!("Hello, 12a!");
}
// Licensed under the MIT license.

use pyo3::prelude::*;

#[pyfunction]
fn hello_n_times(times: u32) {
    (0..times).for_each(|_| println!("hello!"))
}

/// Not a real module.  I mean, it is, but it doesn't do anything useful, so it isn't.
#[pymodule]
fn angry_dragon_fire(_py: Python, m: &PyModule) -> PyResult<()> {
    m.add_function(wrap_pyfunction!(hello_n_times, m)?)?;
    Ok(())
}

#[cfg(test)]
mod tests {}
/*
 * Dynamic type creation and names for built in types.
 */

use crate::function::PyFuncArgs;
use crate::obj::objtype;
use crate::pyobject::{PyContext, PyObjectRef, PyResult, TypeProtocol};
use crate::VirtualMachine;

fn types_new_class(vm: &mut VirtualMachine, args: PyFuncArgs) -> PyResult {
    arg_check!(
        vm,
        args,
        required = [(name, Some(vm.ctx.str_type()))],
        optional = [(bases, None), (_kwds, None), (_exec_body, None)]
    );

    let ref type_type = vm.ctx.type_type();
    let bases: PyObjectRef = match bases {
        Some(bases) => bases.clone(),
        None => vm.ctx.new_tuple(vec![]),
    };
    let dict = vm.ctx.new_dict();
    objtype::type_new_class(vm, &type_type, name, &bases, &dict)
}

pub fn make_module(ctx: &PyContext) -> PyObjectRef {
    py_module!(ctx, "types", {
        "new_class" => ctx.new_rustfunc(types_new_class),
        "FunctionType" => ctx.function_type(),
        "LambdaType" => ctx.function_type(),
        "CodeType" => ctx.code_type(),
        "FrameType" => ctx.frame_type()
    })
}
use crate::{
    canvas::{Drawable, Frame, Layer},
    Primitive,
};

use iced_native::Size;
use std::{cell::RefCell, marker::PhantomData, sync::Arc};

/// A simple cache that stores generated geometry to avoid recomputation.
///
/// A [`Cache`] will not redraw its geometry unless the dimensions of its layer
/// ch


! test_replace_self {
    ($rep:ty, $left:ty, $right:ty) => {
        let mut left: Type = syn::parse_quote! { $left };
        let rep: Type = syn::parse_quote! { $rep };
        left.replace(&rep);
        let right: Type = syn::parse_quote! { $right };
        assert_eq_tt!(left, right);
    };
}

#[cfg(test)]
mod replace_self {
    use super::*;

    // Note: the tests here deliberately do not test everything. The goal here
    // is to ensure it works in the most simple situation.
    //
    // Anyway, most of the ReplaceSelf implementation is macro-generated, so
    // it should not contain much errors.

    #[test]
    fn simple() {
        test_replace_self! { Foo, Self, Foo };
        test_replace_self! { Bar<Foo>, Self, Bar<Foo> };
    }

    #[test]
    fn generic() {
        test_replace_self! { Foo, Vec<Self>, Vec<Foo> };
        test_replace_self! { Foo, Vec<Vec<Self>>, Vec<Vec<Foo>> };
    }

    #[test]
    fn impl_trait() {
        test_replace_self! { Foo, impl AsRef<Self>, impl AsRef<Foo> };
    }

    #[test]
    fn tuple() {
        test_replace_self! { Foo, (Self, usize), (Foo, usize) };
    }
}

#[cfg(test)]
macro_rules! test_create_type_signature {
    ($left:item, $right:path) => {
        let tmp: DeriveInput = syn::parse_quote! { $left };
        let left = create_type_signature(&tmp);
        let right: Type = syn::parse_quote! { $right };
        assert_eq_tt!(left, right);
    };
}

#[cfg(test)]
mod create_type_signature {
    use super::*;

    #[test]
    fn test() {
        test_create_type_signature!(struct Foo<A, B>;, Foo<A, B>);
        test_create_type_signature!(struct Foo<'a, A: 'a, B: ToOwned>;, Foo<'a, A, B>);
        test_create_type_signature!(struct Vec<T: Clone>;, Vec<T>);
    }
}

// Note: here it is needed to break the left-right conversion because the
// matching rule $($_:tt)+ eats the whole remaining input, including $right.
#[cfg(test)]
macro_rules! test_generic_param {
    (None, $($left:tt)+ $(,)?) => {
        let tmp: GenericParam = parse_quote! { $($left)+ };
        assert!(generic_param(tmp).is_none());
    };

    ($right:tt, $($left:tt)+ $(,)?) => {
        let input: GenericParam = syn::parse_quote! { $($left)+ };
        let left = generic_param(input);
        let right: Option<GenericArgument> = Some(syn::parse_quote! { $right });
        assert_eq_tt!(left, right);
    };
}

#[cfg(test)]
mod generic_param {
    use super::*;

    use syn::parse_quote;

    #[test]
    fn handles_type() {
        test_generic_param!(T, T);
        test_generic_param!(T, T: AsRef<str> + 'a);
    }

    #[test]
    fn handles_lifetimes() {
        test_generic_param!('a, 'a);


    /// <summary>
        ///     RemoteSigned execution policy. Scripts can be run only if they are signed by a trusted publisher
        ///     or if they were written on the local computer.
        /// </summary>
        RemoteSigned,

        /// <summary>
        ///     Unrestricted execution policy. No restrictions; all Windows PowerShell scripts can be run.
        /// </summary>
        Unrestricted,

        /// <summary>
        ///     Bypass execution policy. Nothing is blocked and there are no warnings or prompts.
        /// </summary>
        Bypass
    }
}


ov	r0,#3
bl	setTime
b	end
notOcto:

@check if gyorg
ldr	r2,=#0x800
cmp	r4,r2
bne	notGyorg
cmp	r5,#0x7B
bne	notGyorg
@set gyorg time
mov	r0,#4
bl	setTime
b	end
notGyorg:

@check if blue chu
ldr	r2,=#0x740
cmp	r4,r2
bne	notBlue
cmp	r5,#0x48
bne	notBlue
@set vaati2 time
mov	r0,#5
bl	setTime
b	end
notBlue:

@chack if vaati3
cmp	r4,#0
bne	notVaati3
cmp	r5,#0x51
bne	notVaati3
@set vaati3 time
mov	r0,#7
bl	setTime
b	end
notVaati3:

end:
pop	{r4-r7,pc}

setTime:
lsl	r0,#2
ldr	r1,offset
ldr	r2,[r1,r0]
cmp	r2,#0
bne	end
ldr	r2,=#0x203FFF0
ldr	r2,[r2]
str	r2,[r1,r0]
b	end

.align
.ltorg
offset:


ckServerRequestTimeoutMillis = 5000L
package io.sentry.android.replay

import io.sentry.Breadcrumb
import io.sentry.SentryLevel
import io.sentry.SpanDataConvention
import io.sentry.rrweb.RRWebBreadcrumbEvent
import io.sentry.rrweb.RRWebSpanEvent
import java.util.Date
import junit.framework.TestCase.assertEquals
import kotlin.test.Test
import kotlin.test.assertNull

class DefaultReplayBreadcrumbConverterTest {
  class Fixture {
    fun getSut(): DefaultReplayBreadcrumbConverter = DefaultReplayBreadcrumbConverter()
  }

  private val fixture = Fixture()

  @Test
  fun `returns null when no category`() {
    val converter = fixture.getSut()

    val breadcrumb = Breadcrumb(Date(123L)).apply { message = "message" }

    val rrwebEvent = converter.convert(breadcrumb)

    assertNull(rrwebEvent)
  }

  @Test
  fun `convert RRWebSpanEvent`() {
    val converter = fixture.getSut()

    val breadcrumb =
      Breadcrumb(Date(123L)).apply {
        category = "http"
        data["url"] = "http://example.com"
        data["status_code"] = 404
        data["method"] = "GET"
        data[SpanDataConvention.HTTP_START_TIMESTAMP] = 1234L
        data[SpanDataConvention.HTTP_END_TIMESTAMP] = 2234L
        data["http.response_content_length"] = 300
        data["http.request_content_length"] = 400
      }

    val rrwebEvent = converter.convert(breadcrumb)

    check(rrwebEvent is RRWebSpanEvent)
    assertEquals("resource.http", rrwebEvent.op)
    assertEquals("http://example.com", rrwebEvent.description)
    assertEquals(123L, rrwebEvent.timestamp)
    assertEquals(1.234, rrwebEvent.startTimestamp)
    assertEquals(2.234, rrwebEvent.endTimestamp)
    assertEquals(404, rrwebEvent.data!!["statusCode"])
    assertEquals("GET", rrwebEvent.data!!["method"])
    assertEquals(300, rrwebEvent.data!!["responseBodySize"])
    assertEquals(400, rrwebEvent.data!!["requestBodySize"])
  }

  @Test
  fun `convert RRWebSpanEvent works with floating timestamps`() {
    val converter = fixture.getSut()

    val breadcrumb =
      Breadcrumb(Date(123L)).apply {
        category = "http"
        data["url"] = "http://example.com"
        data["status_code"] = 404
        data["method"] = "GET"
        data[SpanDataConvention.HTTP_START_TIMESTAMP] = 1234.0
        data[SpanDataConvention.HTTP_END_TIMESTAMP] = 2234.0
        data["http.response_content_length"] = 300
        data["http.request_content_length"] = 400
      }

    val rrwebEvent = converter.convert(breadcrumb)

    check(rrwebEvent is RRWebSpanEvent)
    assertEquals(1.234, rrwebEvent.startTimestamp)
    assertEquals(2.234, rrwebEvent.endTimestamp)
  }

  @Test
  fun `returns null if not eligible for RRWebSpanEvent`() {
    val converter = fixture.getSut()

    val breadcrumb =
      Breadcrumb(Date(123L)).apply {
        category = "http"
        data["status_code"] = 404
        data["method"] = "GET"
        data[SpanDataConvention.HTTP_START_TIMESTAMP] = 1234L
        data[SpanDataConvention.HTTP_END_TIMESTAMP] = 2234L
        data["http.response_content_length"] = 300
        data["http.request_content_length"] = 400
      }

    val rrwebEvent = converter.convert(breadcrumb)

    assertNull(rrwebEvent)
  }

  @Test
  fun `converts app lifecycle breadcrumbs`() {
    val converter = fixture.getSut()


using System;
using Server.Mobiles;

namespace Server.Mobiles
{
	[CorpseName( "a bear corpse" )]
	public class BrownBear : BaseCreature
	{
		[Constructable]
		public BrownBear() : base( AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
		{
			Name = "a brown bear";
			Body = 167;
			BaseSoundID = 0xA3;

			SetStr( 76, 100 );
			SetDex( 26, 45 );
			SetInt( 23, 47 );

			SetHits( 46, 60 );
			SetMana( 0 );

			SetDamage( 6, 12 );

			SetDamageType( ResistanceType.Physical, 100 );

			SetResistance( ResistanceType.Physical, 20, 30 );
			SetResistance( ResistanceType.Cold, 15, 20 );
			SetResistance( ResistanceType.Poison, 10, 15 );

			SetSkill( SkillName.MagicResist, 25.1, 35.0 );
			SetSkill( SkillName.Tactics, 40.1, 60.0 );
			SetSkill( SkillNa


target.radius) {
        if (agent.direction == DIRECTION.LEFT) {
          if (agent.coordinate.x >= target.coordinate.x) {
            agent.actionList.push(ACTION.SHOOT);
          } else {
            agent.actionList.push(ACTION.TURN_LEFT);
          }
          end = true;
        }
      }
      if (end) return;
      const random = Math.random();
      if (random < 0.4) {
        agent.actionList.push(randomChooseFrom(ACTIONS));
        agent.actionList.concat([
          ACTION.SHOOT,
          ACTION.SHOOT,
          ACTION.SHOOT,
          ACTION.SHOOT,
          ACTION.DO_NOTHING,
          ACTION.DO_NOTHING,
          ACTION.DO_NOTHING,
          ACTION.SHOOT,
        ]);
      } else if (random < 0.7) {
        if (Math.floor(random * 100) % 2 === 0) {
          if (agent.coordinate.x < target.coordinate.x) {
            agent.actionList.push(ACTION.MOVE_RIGHT);
          } else {
            agent.actionList.push(ACTION.MOVE_LEFT);
          }
        } else {
          if (agent.coordinate.y < target.coordinate.y) {
            agent.actionList.push(ACTION.MOVE_DOWN);
          } else {
            agent.actionList.push(ACTION.MOVE_UP);
          }
        }
        agent.actionList.concat([ACTION.SHOOT, ACTION.SHOOT]);
      } else if (random < 0.75) {
        agent.actionList.concat([
          ACTION.MOVE_UP,
          ACTION.DO_NOTHING,
          ACTION.SHOOT,
          ACTION.DO_NOTHING,
          ACTION.SHOOT,
        ]);
      } else if (random < 0.8) {
        agent.actionList.concat([
          ACTION.MOVE_LEFT,
          ACTION.DO_NOTHING,
          ACTION.SHOOT,
          ACTION.DO_NOTHING,
          ACTION.SHOOT,
        ]);
      } else if (random < 0.85) {
        agent.actionList.concat([
          ACTION.MOVE_RIGHT,
          ACTION.DO_NOTHING,
          ACTION.SHOOT,
          ACTION.DO_NOTHING,
          ACTION.SHOOT,
        ]);
      } else if (random < 0.9) {
        agent.actionList.concat([
          ACTION.MOVE_DOWN,
          ACTION.DO_NOTHING,
          ACTION.SHOOT,
          ACTION.DO_NOTHING,
          ACTION.SHOOT,
        ]);
      } else {
        agent.actionList.push(ACTION.SHOOT);
      }
      break;
  }
}

export { AI };
const storage = require("@/utils/appStorage");

/* ------------------------------------------------------------------------------------------------
 * HELPER FUNCTIONS
 * ------------------------------------------------------------------------------------------------
 */

function computeAverage(arr: number[]): number {
  return arr.reduce((a, b) => a + b, 0) / arr.length;
}

function formatTime(value: number): string {
  let seconds = `${Math.floor(value / 1000)}`;
  let minutes = `${Math.floor(value / 60000)}`;
  let msValue = Math.floor(
    value - Number(minutes) * 60000 - Number(seconds) * 1000
  );
  let milliseconds = `${msValue}`;

  if (minutes.length < 2) minutes = "0" + minutes;
  if (seconds.length < 2) seconds = "0" + seconds;

  return `${minutes}:${seconds}.${milliseconds.substr(0, 2)}`;
}

function formatDate(date: Date): string {
  let day = date.getUTCDate();
  let month = date.getUTCMonth() + 1;
  let year = date.getUTCFullYear();


ProjectFile
import wizard.ProjectInfo

class AndroidManifest(info: ProjectInfo) : ProjectFile {
    override val path = "androidApp/src/main/AndroidManifest.xml"
    override val content = """
        <?xml version="1.0" encoding="utf-8"?>
        <manifest xmlns:android="http://schemas.android.com/apk/res/android">

            <application
                android:icon="@mipmap/ic_launcher"
                android:label="${info.name}"
                android:theme="@android:style/Theme.Material.NoActionBar">
                <activity
                    android:name=".AppActivity"
                    android:configChanges="orientation|screenSize|screenLayout|keyboardHidden"
                    android:launchMode="singleInstance"
                    android:windowSoftInputMode="adjustPan"
                    android:exported="true">
                    <intent-filter>
                        <action android:name="android.intent.action.MAIN" />
                        <category android:name="android.intent.category.LAUNCHER" />
                    </intent-filter>
                </activity>
            </application>

        </manifest>
    """.trimIndent()
}
package wizard.files.composeApp.webApp

import wizard.ProjectFile
import wizard.ProjectInfo

class WebIndexHtml(info: ProjectInfo) : ProjectFile {
    override val path = "webApp/src/commonMain/resources/index.html"
    override val content = buildString {
        appendLine("""<!doctype html>""")
        appendLine("""<html lang="en">""")
        appendLine("""    <head>""")
        appendLine("""        <meta charset="UTF-8">""")
        appendLine("""        <meta name="viewport" content="width=device-width, initial-scale=1.0">""")
        appendLine("""        <link rel="apple-touch-icon" sizes="180x180" href="./apple-touch-icon.png">""")
        appendLine("""        <link rel="icon" type="image/png" sizes="32x32" href="./favicon-32x32.png">""")
        appendLine("""        <link rel="icon" type="image/png" sizes="16x16" href="./favicon-16x16.png">""")
        appendLine("""        <link rel="manifest" href="./manifest.json">""")
        appendLine("""        <title>${info.name}</title>""")
        appendLine("""        <style>""")
        appendLine("""            html,""")
        appendLine("""            body {""")
        appendLine("""                width: 100%;""")
        appendLine("""                height: 100%;""")
        appendLine("""                margin: 0;""")
        appendLine("""                padding: 0;""")
        appendLine("""                overflow: hidden;""")
        appendLine("""            }""")
        appendLine("""        </style>""")
        appendLine("""    </head>""")
        appendLine("""    <body style="text-align: center; align-content: center">""")
        appendLine("""    <svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 50 50" role="presentation">""")
        appendLine("""        <circle cx="25" cy="25" r="20" stroke="#ccc" stroke-width="4" fill="none"/>""")
        appendLine("""        <circle cx="25" cy="25" r="20" stroke="#333" stroke-width="4" fill="none" stroke-linecap="round" stroke-dasharray="90 125">""")
        appendLine("""            <animateTransform attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="1s" repeatCount="indefinite"/>""")
        appendLine("""        </circle>""")
        appendLine("""    </svg>""")
        appendLine("""    </body>""")
        appendLine("""    <script src="webApp.js"></script>""")


ards.transformMatrix'
    ? string | undefined
    : T extends 'cards.depth'
    ? DepthTuple | undefined
    : Record<string, Variant> | undefined;
}
import Tuple from './Tuple';

export interface Settable<A, B> {
  set(key: A, value: B): this;
}

export interface Gettable<A, B> {
  get(key: A): B | undefined;
}

export interface GenericMap<A, B> extends GetSettable<A, B> {
  has(key: A): boolean;
}

export type GetSettable<A, B> = Settable<A, B> & Gettable<A, B>;

export type Primitive = boolean | undefined | null | number | string | symbol;

export interface Tuple0 extends Tuple<never> {
  readonly length: 0;
}
/** Singleton */
export interface Tuple1<A> extends Tuple<A> {
  readonly 0: A;
  readonly length: 1;
}
/** Pair */
export interface Tuple2<A, B> extends Tuple<A | B> {
  readonly 0: A;
  readonly 1: B;
  readonly length: 2;
}
/** Triple */
export interface Tuple3<A, B, C> extends Tuple<A | B | C> {
  readonly 0: A;
  readonly 1: B;
  readonly 2: C;
  readonly length: 3;
}
/** Quadruple */
export interface Tuple4<A, B, C, D> extends Tuple<A | B | C | D> {
  readonly 0: A;
  readonly 1: B;
  readonly 2: C;
  readonly 3: D;
  readonly length: 4;
}
/** Quintuple */
export interface Tuple5<A, B, C, D, E> extends Tuple<A | B | C | D | E> {
  readonly 0: A;
  readonly 1: B;
  readonly 2: C;
  readonly 3: D;
  readonly 4: E;
  readonly length: 5;
}
/** Sextuple */
export interface Tuple6<A, B, C, D, E, F> extends Tuple<A | B | C | D | E | F> {
  readonly 0: A;
  readonly 1: B;
  readonly 2: C;
  readonly 3: D;
  readonly 4: E;
  readonly 5: F;
  readonly length: 6;
}
/** Septuple */
export interface Tuple7<A, B, C, D, E, F, G> extends Tuple<A | B | C | D | E | F | G> {
  readonly 0: A;
  readonly 1: B;
  readonly 2: C;
  readonly 3: D;
  readonly 4: E;
  readonly 5: F;
  readonly 6: G;
  readonly length: 7;
}
/** Octuple */
export interface Tuple8<A, B, C, D, E, F, G, H> extends Tuple<A | B | C | D | E | F | G | H> {
  readonly 0: A;
  readonly 1: B;
  readonly 2: C;
  readonly 3: D;
  readonly 4: E;
  readonly 5: F;
  readonly 6: G;
  readonly 7: H;
  readonly length: 8;
}

export type CompositeSymbol<T> = {
  t: T;
} & symbol;
// tslint:disable-next-line: variable-name
export const CompositeSymbol0: CompositeSymbol<[never]> = Symbol('CompositeSymbol0') as any;
export type CompositeSymbol1<A> = CompositeSymbol<[A]>;
export type CompositeSymbol2<A, B> = CompositeSymbol<[A, B]>;
export type CompositeSymbol3<A, B, C> = CompositeSymbol<[A, B, C]>;
export type CompositeSymbol4<A, B, C, D> = CompositeSymbol<[A, B, C, D]>;
export type CompositeSymbol5<A, B, C, D, E> = CompositeSymbol<[A, B, C, D, E]>;
export type CompositeSymbol6<A, B, C, D, E, F> = CompositeSymbol<[A, B, C, D, E, F]>;
export type CompositeSymbol7<A, B, C, D, E, F, G> = CompositeSymbol<[A, B, C, D, E, F, G]>;
export type CompositeSymbol8<A, B, C, D, E,


        local notExisted = "Delivery has failed to these recipients: #"..to..". Number does not exist."
            mysql:query_insert_free("INSERT INTO `phone_sms` SET `from`='"..to.."', `to`='"..from.."', `content`='"..exports.global:toSQL(notExisted).."' ")
            triggerEvent("phone:fetchOneSMSThread", source, from, to, true)

            exports['logs']:dbLog(source, 30, loggedElements, content)
            return false
        end

        if t_powerOn == 0 then
            alertUser = false
        end
    end

    local found, target = searchForPhone(to)
    if found and target then
        triggerEvent("phone:fetchOneSMSThread", target, to, from)
        table.insert(loggedElements, target)
        if alertUser then
            triggerClientEvent(target, "newSMSReceived", resourceRoot, from, to, content)
        end
    end
    triggerEvent("phone:fetchOneSMSThread", source, from, to, true)

    exports['logs']:dbLog(source, 30, loggedElements, content)
end
addEvent("phone:sendSMS", true)
addEventHandler("phone:sendSMS", root, sendSMS)

for i = 1, 20 do
    addCommandHandler( "sms" .. tostring( i == 1 and "" or i ), function(thePlayer, theCommand, to, ...)
        if getElementData(thePlayer, "loggedin") ~= 1 then return end

        -- find the item with the matching id
        -- /sms is the first phone, /sms2 the second phone etc.
        to = tonumber(to)
        if to and ... then
            local count = 0
            local items = exports['item-system']:getItems(thePlayer)
            for _, v in ipairs(items) do
                if v[1] == 2 then -- it's a phone
                    count = count + 1
                    if count == i then
                        local from = v[2]
                        local message = table.concat({...}, " ")
                        local power = getPhoneSettings(from,  true)
                        if power and power ~= 0 then
                            triggerEvent("phone:sendSMS", thePlayer, from, to, message, 0, true)
                            return
                        else
                            outputChatBox("Your phone needs to be powered on to be able to SMS.", thePlayer, 255, 0, 0)
                        end
                    end
                end
            end
        else
            outputChatBox("SYNTAX: /" .. theCommand .. " [Phone Number] [Message]", thePlayer, 255, 194, 14)
        end
    end)
end

function startRingingSMS(fromPhone, smsTone, volume)
    local phoneSettings = {getPhoneSettings(fromPhone, true)}
    turnedOn = phoneSettings[1]
    smsTone = phoneSettings[8]
    volume = phoneSettings[9]

    if turnedOn ~= 0 then
        for _,nearbyPlayer in ipairs(exports.global:getNearbyElements(source, "player"), 10) do
            triggerClientEvent(nearbyPlayer, "startRinging", source, 2, smsTone, volume)
        end
        if smsTone > 1 then
            triggerEvent('sendAme', source, "'s cellphone starts to ring.")
        end
        outputChatBox("Your phone #"..fromPhone.." has received a new text message.", source)
    end
end
addEvent("phone:startRingingSMS", true)
addEventHandler("phone:startRingingSMS", root, startRingingSMS)

function updateSMSViewedState(fromPhone, threadIndex)
    if mysql:query_free("UPDATE `phone_sms` SET `viewed`=1 WHERE `from`='"..threadIndex.."' AND `to`='"..fromPhone.."' ") then
        triggerEvent("phone:fetchOneSMSThread", source,


zeYppFt6BnrofrTYFHeLfXqcZYibGDia9MicjMMphXcuniceRib9DaKU8S7HRmiatXzqI8oLmicUIPKl7jxJLYw/640?wx_fmt=jpeg "")

上图是对Windows内核地址泄漏的总结（来自GitHub），表格中包含截止目前泄漏内核对象的各种技巧。下面也是拿两个demo来阐述内核对象泄露的细节：
- Demo1，通过GdiSharedHandleTable去泄露bitmap对象：

在R3通过CreateBitmap创建位图成功后会得到一个hBitmap,如果要在R3去泄露该对象在内核中的地址可以通过GdiSharedHandleTable获取。GdiSharedHandleTable位于PEB+0x94的位置。

![](https://mmbiz.qpic.cn/sz_mmbiz_jpg/xkA3iaCzeYppFt6BnrofrTYFHeLfXqcZYTnwJIAiaS4FibWXryvZKxVM2gI9exv2ZWbb7mEf22xChJDhZQgJ698jg/640?wx_fmt=jpeg "")

GdiSharedHandleTable的本质是一个指向GDICELL结构体数组的指针。

![](https://mmbiz.qpic.cn/sz_mmbiz_jpg/xkA3iaCzeYppFt6BnrofrTYFHeLfXqcZYKfPnnRib0P5ZlVjz9gM8georibHVh4pHoL9AicxeibBQ2LoJJgkuiadoSag/640?wx_fmt=jpeg "")

同 CreateFile 类似，其实Windows 都用句柄（Handle）来标识用户态对内核对象的引用。这个句柄低 16 位其实是数组索引。

![](https://mmbiz.qpic.cn/sz_mmbiz_jpg/xkA3iaCzeYppFt6BnrofrTYFHeLfXqcZYP5k8ckans1wCTFWjlV58I4TQ2gicEXc6dxZqzdiahA6oTYsK4lsNj8gQ/640?wx_fmt=jpeg "")

通过上文，就可以计算出bitmap在内核中的地址。

![](https://mmbiz.qpic.cn/sz_mmbiz_jpg/xkA3iaCzeYppFt6BnrofrTYFHeLfXqcZY69nJkmqxQyg4oUv5IhRLTxSgSD68zI4ynVP50ASHSFKeNndI1Uoe3A/640?wx_fmt=jpeg "")
- Demo2，通过HMValidateHandle函数泄漏内核对象：

HMValidateHandle是微软未公开的一个函数，凭借此函数可以通过传入句柄获取对于内核对象的地址（win32k对象）。HMAllocObject创建了桌面堆类型句柄后，会把tagWND对象放入到内核模式到用户模式内存映射地址里。为了验


in user");return i&&(d._trust_audio_stream_added_state_=!0,d._audio_added_=!0),n&&(d._trust_video_stream_added_state_=!0,d._video_added_=!0),l}catch(t){throw SN.error("[".concat(this._clientId,"] presub user ").concat(e," error"),t),t}finally{r()}}async _subscribeDataChannel(e,t){var i;if(XA(t,"channelId",0,65535,!0),!this._joinInfo)throw new wN(KA.INVALID_OPERATION,"Can't subscribe datachannel, not joined");if("CONNECTED"!==this.connectionState&&"RECONNECTING"!==this.connectionState)throw new wN(KA.INVALID_OPERATION,"Can't subscribe datachannel in ".concat(this.connectionState," state"));const n=this._users.find((t=>t===e));if(!n)throw SN.error("[".concat(this._clientId,"] can not subscribe ").concat(e.uid,", this user is not in the channel")),new wN(KA.INVALID_REMOTE_USER,"user is not in the channel");if(!e.hasAudio&&!e.hasVideo&&0===e._dataChannels.length)throw SN.error("[".concat(this._clientId,"] can not subscribe ").concat(e.uid,", user is not published")),new wN(KA.INVALID_REMOTE_USER,"user is not published");const r=null===(i=e._dataChannels)||void 0===i?void 0:i.find((e=>e.id===t));if(!r)throw SN.error("[".concat(this._clientId,"] can not subscribe ").concat(e.uid," with mediaType datachannel, remote datachannel is not published")),new wN(KA.REMOTE_USER_IS_NOT_PUBLISHED);const o=await this._subscribeMutex.lock();SN.info("[".concat(this._clientId,"] subscribe user ").concat(e.uid,", mediaType: datachannel"));try{const i=await this._p2pChannel.subscribeDataChannel(e,[r]);if(i&&wn(i).call(i,r.id))try{var s;if("number"!=typeof r._originDataChannelId)throw SN.error("[".concat(this._clientId,"] can not subscribe ").concat(e.uid," with mediaType datachannel, cannot get RTCDatachannel")),new wN(KA.CREATE_DATACHANNEL_ERROR);const t={id:r.id,datachannelId:r._originDataChannelId,ordered:r.ordered,maxRetransmits:r.maxRetransmits,metadata:null!==(s=r.metadata)&&void 0!==s?s:""};await this._gateway.subscribeDataChannel(e.uid,t,!0),await r._waitTillOpen()}catch(t){if((null==t?void 0:t.code)!==KA.WS_ABORT)throw await this._p2pChannel.unsubscribeDataChannel(e,[r]),t;await this._p2pChannel.unsubscribeDataChannel(e,[r]),this._p2pChannel.setPendingRemoteDataChannel(e,r.id)}return SN.info("[".concat(this._clientId,"] subscribe success user ").concat(e.uid,", mediaType: datachannel")),r}finally{o()}}async _p2pSubscribe(e,t,i){if(zA(t,"mediaType",["audio","video"]),!this._joinInfo)throw new wN(KA.INVALID_OPERATION,"Can't subscribe stream, not joined");if("CONNECTED"!==this.connectionState&&"RECONNECTING"!==this.connectionState)throw new wN(KA.INVALID_OPERATION,"Can't subscribe stream in ".concat(this.connectionState," state"));const n=this


) == 4 => {
                        let ipv4 = NetworkAddress::IPv4(Ipv4Addr::new(s[0], s[1], s[2], s[3]));
                        Ok((rem, ObjectSyntax::IpAddress(ipv4)))
                    }
                    _ => Err(Err::Error(BerError::InvalidTag)),
                }
            }
            1..=3 => {
                // -- this wraps
                // Counter32 ::=
                //     [APPLICATION 1]
                //         IMPLICIT INTEGER (0..4294967295)
                //
                // -- this doesn't wrap
                // Gauge32 ::=
                //     [APPLICATION 2]
                //         IMPLICIT INTEGER (0..4294967295)
                //
                // -- an unsigned 32-bit quantity
                // -- indistinguishable from Gauge32
                // Unsigned32 ::=
                //     [APPLICATION 2]
                //         IMPLICIT INTEGER (0..4294967295)
                //
                // -- hundredths of seconds since an epoch
                // TimeTicks ::=
                //     [APPLICATION 3]
                //         IMPLICIT INTEGER (0..4294967295)
                let (rem, content) = ber_read_element_content_as(
                    rem,
                    BerTag::Integer,
                    hdr.len,
                    hdr.is_constructed(),
                    0,
                )?;
                let x = content.as_u32()?;
                let obj = match hdr.tag.0 {
                    1 => ObjectSyntax::Counter32(x),
                    2 => ObjectSyntax::Gauge32(x),
                    3 => ObjectSyntax::TimeTicks(x),
                    _ => unreachable!(),
                };
                Ok((rem, obj))
            }
            4 => {
                let len = hdr.len.primitive()?;
                map(take(len), ObjectSyntax::Opaque)(rem)
            }
            5 => {
                let len = hdr.len.primitive()?;
                map(take(len), ObjectSyntax::NsapAddress)(rem)
            }
            6 => {
                let (rem, content) = ber_read_element_content_as(
                    rem,
                    BerTag::Integer,
                    hdr.len,
                    hdr.is_constructed(),
                    0,
                )?;
                let value = content.as_u64()?;
                Ok((rem, ObjectSyntax::Counter64(value)))
            }
            7 => {
                let (rem, content) = ber_read_element_content_as(
                    rem,
                    BerTag::Integer,
                    hdr.len,
                    hdr.is_constructed(),
                    0,
                )?;
                let value = content.as_u32()?;
                Ok((rem, ObjectSyntax::UInteger32(value)))
            }
            _ => {
                let len = hdr.len.primitive()?;
                map(take(len), |x| {
                    ObjectSyntax::UnknownApplication(hdr.tag.0, x)
                })(rem)
            }
        }
    } else {
        // SimpleSyntax ::=
        //     CHOICE {
        //         -- INTEGERs with a more restrictive range
        //         -- may also be used
        //         integer-value               -- includes Integer32
        //             INTEGER (-


	ret

	.globl	_splhigh
_splhigh:
	movl	$IRHIGH, %eax	/* set new priority level with interrupts off */
	cli
	COMMON_SPL

	.globl	_splclock
_splclock:
	movl	_cpl, %eax
	orb	$IRQ0, %al	/* set new priority level with interrupts off */
	cli
	COMMON_SPL

	.globl	_spltty
_spltty:
	movl	_cpl, %eax
	orw	_ttymask, %ax
	cli				# disable interrupts
	COMMON_SPL

	.globl	_splimp, __splimp
_splimp:
__splimp:
	cli				# disable interrupts
	DISFAILSAFE
	movl	_cpl, %eax
	orw	_netmask, %ax
	COMMON_SPL

	.globl	_splbio
_splbio:
	cli				# disable interrupts
	DISFAILSAFE
	movl	_cpl, %eax
	orw	_biomask, %ax
	COMMON_SPL

	.globl	_splsoftclock
_splsoftclock:
	PROC_ENTRY
	cli
	pushl	_cpl			/* save old priority */
	movw	_imen, %ax		/* mask off those not enabled yet */
	outb	%al, $IO_ICU1+1		/* update icu's */
	NOP
	movb	%ah, %al
	outb	%al, $IO_ICU2+1
	WRPOST			 /* write post before restoring interrupts */

#ifdef nope
	pushl	%ebx
9:
	xorl	%ebx, %ebx
	xchgl	%ebx, _netisr
	movl	$IRNET|IRSCLK, _cpl	# set new priority level

	testl	%ebx, %ebx
	je	2f

	sti
#ifdef nope
#ifdef INET
	DONET(NETISR_IP, _ipintr)
#endif
#ifdef IMP
	DONET(NETISR_IMP, _impintr)
#endif
#ifdef NS
	DONET(NETISR_NS, _nsintr)
#endif
#else
	DONETS(%ebx, %eax)
#endif
	cli
	jmp 9b
2:
#endif
	movl	$IRSCLK, _cpl		/* set new priority level */
	sti
	/* popl	%ebx */
	popl	%eax			/* return old priority */
	PROC_EXIT
	ret

	.globl	_splnet
_splnet:
	cli
	movl	$IRNET|IRSCLK, %eax
	COMMON_SPL

	.globl _splnone
_splnone:
	PROC_ENTRY
	cli
	pushl	_cpl			/* save old priority */
	movw	_imen, %ax		/* mask off those not enabled yet */
	outb	%al, $IO_ICU1+1		/* update icu's */
	NOP
	movb	%ah, %al
	outb	%al, $IO_ICU2+1
	WRPOST			 /* write post before restoring interrupts */
	/* save */
	pushl	%ebx

9:	xorl	%ebx, %ebx
	xchgl	%ebx, _netisr
	movl	$IRNET|IRSCLK, _cpl	# set new priority level

	testl	%ebx, %ebx
	je	5f

	sti
#ifdef	nope
#ifdef INET
	DONET(NETISR_IP, _ipintr)
#endif
#ifdef IMP
	DONET(NETISR_IMP, _impintr)
#endif
#ifdef NS
	DONET(NETISR_NS, _nsintr)
#endif
#else
	DONETS(%ebx, %


.playerGenerator
    if gen then
        local v = gen * PLAYER_GENERATOR_PERSISTANCE
        if (v < 0.0001) and (v > -0.0001) then
            chunk.playerGenerator = nil
        else
            chunk.playerGenerator = v
        end
    end
end

function ChunkPropertyUtils.addPlayerGenerator(chunk, playerMaxGenerator)
    local value = chunk.playerGenerator
    if value then
        chunk.playerGenerator = mMin(
            value + PLAYER_PHEROMONE_GENERATOR_AMOUNT,
            playerMaxGenerator
        )
    else
        chunk.playerGenerator = PLAYER_PHEROMONE_GENERATOR_AMOUNT
    end
end

function ChunkPropertyUtils.getPlayerGenerator(chunk)
    return chunk.playerGenerator or 0
end

function ChunkPropertyUtils.getPlayerBaseGenerator(chunk)
    return chunk.playerBaseGenerator or 0
end

function ChunkPropertyUtils.addSquadToChunk(chunk, squad)
    if (chunk ~= -1)
        and (
            (squad.chunk == -1)
            or (squad.chunk.id ~= chunk.id)
        )
    then
        ChunkPropertyUtils.removeSquadFromChunk(squad)
        local squads = chunk.squads
        if not squads then
            squads = {}
            chunk.squads = squads
        end
        squads[squad.groupNumber] = squad
        squad.chunk = chunk
    end
end

function ChunkPropertyUtils.removeSquadFromChunk(squad)
    local chunk = squad.chunk
    if (chunk ~= -1) then
        local squads = chunk.squads
        if squads then
            squads[squad.groupNumber] = nil
            if (tableSize(squads) == 0) then
                chunk.squads = nil
            end
        end
    end
end

function ChunkPropertyUtils.setPlayerBaseGenerator(chunk, playerBaseGenerator)
    if (playerBaseGenerator <= 0) then
        chunk.playerBaseGenerator = nil
        return 0
    else
        chunk.playerBaseGenerator = playerBaseGenerator
        return playerBaseGenerator
    end
end

function ChunkPropertyUtils.addPlayerBaseGenerator(chunk, playerBaseGenerator)
    local amount = (chunk.playerBaseGenerator or 0) + playerBaseGenerator
    if amount <= 0 then
        chunk.playerBaseGenerator = nil
        return 0
    else
        chunk.playerBaseGenerator = amount
        return amount
    end
end

function ChunkPropertyUtils.findNearbyBase(chunk)
    local foundBase = chunk.base
    if foundBase then
        return foundBase
    end

    return ChunkPropertyUtils.findNearbyBaseByPosition(
        chunk.map,
        chunk.x,
        chunk.y
    )
end

function ChunkPropertyUtils.findNearbyBaseByPosition(map, x, y)
    local foundBase

    local closest = MAGIC_MAXIMUM_NUMBER
    for _, base in pairs(map.bases) do
        local distance = euclideanDistancePoints(base.x, base.y, x, y)
        if (distance <= base.dista


-cobalt .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgba(255, 255, 255, 0.15)}.ace-cobalt .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.35)}.ace-cobalt .ace_gutter-active-line {background-color: rgba(0, 0, 0, 0.35)}.ace-cobalt .ace_marker-layer .ace_selected-word {border: 1px solid rgba(179, 101, 57, 0.75)}.ace-cobalt .ace_invisible {color: rgba(255, 255, 255, 0.15)}.ace-cobalt .ace_keyword,.ace-cobalt .ace_meta {color: #FF9D00}.ace-cobalt .ace_constant,.ace-cobalt .ace_constant.ace_character,.ace-cobalt .ace_constant.ace_character.ace_escape,.ace-cobalt .ace_constant.ace_other {color: #FF628C}.ace-cobalt .ace_invalid {color: #F8F8F8;background-color: #800F00}.ace-cobalt .ace_support {color: #80FFBB}.ace-cobalt .ace_support.ace_constant {color: #EB939A}.ace-cobalt .ace_fold {background-color: #FF9D00;border-color: #FFFFFF}.ace-cobalt .ace_support.ace_function {color: #FFB054}.ace-cobalt .ace_storage {color: #FFEE80}.ace-cobalt .ace_entity {color: #FFDD00}.ace-cobalt .ace_string {color: #3AD900}.ace-cobalt .ace_string.ace_regexp {color: #80FFC2}.ace-cobalt .ace_comment {font-style: italic;color: #0088FF}.ace-cobalt .ace_heading,.ace-cobalt .ace_markup.ace_heading {color: #C8E4FD;background-color: #001221}.ace-cobalt .ace_list,.ace-cobalt .ace_markup.ace_list {background-color: #130D26}.ace-cobalt .ace_variable {color: #CCCCCC}.ace-cobalt .ace_variable.ace_language {color: #FF80E1}.ace-cobalt .ace_meta.ace_tag {color: #9EFFFF}.ace-cobalt .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYHCLSvkPAAP3AgSDTRd4AAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)});                (function() {
                    ace.require(["ace/theme/cobalt"], function(m) {
                        if (typeof module == "object" && typeof exports == "object" && module) {
                            module.exports = m;
                        }
                    });
                })();
            ace.define("ace/theme/katzenmilch",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-katzenmilch",t.cssText=".ace-katzenmilch .ace_gutter,.ace-katzenmilch .ace_gutter {background: #e8e8e8;color: #333}.ace-katzenmilch .ace_print-margin {width: 1px;background: #e8e8e8}.ace-katzenmilch {background-color: #f3f2f3;color: rgba(15, 0, 9, 1.0)}.ace-katzenmilch .ace_cursor {border-left: 2px solid #100011}.ace-katzenmilch .ace_overwrite-cursors


加文件夹失败: $e'),
            backgroundColor: Theme.of(context).colorScheme.error,
          ),
        );
      }
    } finally {
      if (mounted) {
        setState(() {
          _isScanning = false;
        });
      }
    }
  }

  Future<void> _rescanAllFolders(MusicProvider musicProvider) async {
    setState(() {
      _isScanning = true;
    });

    try {
      await musicProvider.rescanAllFolders();
      if (mounted) {
        ScaffoldMessenger.of(context).showSnackBar(
          const SnackBar(
            content: Text('文件夹扫描完成'),
            backgroundColor: Colors.green,
          ),
        );
      }
    } catch (e) {
      if (mounted) {
        ScaffoldMessenger.of(context).showSnackBar(
          SnackBar(
            content: Text('扫描失败: $e'),
            backgroundColor: Theme.of(context).colorScheme.error,
          ),
        );
      }
    } finally {
      if (mounted) {
        setState(() {
          _isScanning = false;
        });
      }
    }
  }

  Future<void> _smartScan(MusicProvider musicProvider) async {
    setState(() {
      _isScanning = true;
    });

    try {
      await musicProvider.smartScan();
      if (mounted) {
        ScaffoldMessenger.of(context).showSnackBar(
          const SnackBar(
            content: Text('智能扫描完成'),
            backgroundColor: Colors.green,
          ),
        );
      }
    } catch (e) {
      if (mounted) {
        ScaffoldMessenger.of(context).showSnackBar(
          SnackBar(
            content: Text('智能扫描失败: $e'),
            backgroundColor: Theme.of(context).colorScheme.error,
          ),
        );
      }
    } finally {
      if (mounted) {
        setState(() {
          _isScanning = false;
        });
      }
    }
  }

  Future<void> _handleFolderAction(String action, MusicFolder folder, MusicProvider musicProvider) async {
    switch (action) {
      case 'scan':
        setState(() {
          _isScanning = true;
        });
        try {
          await musicProvider.scanFolderForMusic(folder);
          if (mounted) {
            ScaffoldMessenger.of(context).showSnackBar(
              SnackBar(
                content: Text('${folder.name} 扫描完成'),
                backgroundColor: Colors.green,
              ),
            );
          }
        } catch (e) {
          if (mounted) {
            ScaffoldMessenger.of(context).showSnackBar(
              SnackBar(
                content: Text('扫描失败: $e'),
                backgroundColor: Theme.of(context).colorScheme.error,
              ),
            );
          }
        } finally {
          if (mounted) {
            setState(() {
              _isScanning = false;
            });
          }
        }
        break;
      case 'toggle_auto_scan':
        try {
          await musicProvider.toggleFolderAutoScan(folder.id);
          if (mounted) {
            ScaffoldMessenger.of(context).showSnackBar(
              SnackBar(
                content: Text(folder.isAutoScan ? '已禁用自动扫描' : '已启用自动扫描'),
                backgroundColor: Colors.green,
              ),
            );
          }
        } catch (e) {
          if (mounted) {
            ScaffoldMessenger.of(context).showSnackBar(
              SnackBar(
                content: Text('操作失败: $e'),
                backgroundColor: Theme.of(context).colorScheme.error,
              ),
            );
          }
        }
        break;
      case 'set_interval':
        await _showScanIntervalDialog(folder, musicProvider);
        break;
      case 'remove':
        final confirmed = await showDialog<bool>(
          context: context,
          builder: (context) => AlertDialog(
            title: const Text


 U+62b5, U+62b9, U+62bc-62bd, U+62c2, U+62c7-62c9, U+62cc-62cd, U+62cf-62d0, U+62d2-62d4, U+62d6-62d9, U+62db-62dc, U+62ec-62ef, U+62f1, U+62f3, U+62f7, U+62fe-62ff, U+6301, U+6307, U+6309, U+6311, U+632b, U+632f, U+633a-633b, U+633d-633e, U+6349, U+634c, U+634f-6350, U+6355, U+6367-6368, U+636e, U+6372, U+6377, U+637a-637b, U+637f, U+6383, U+6388-6389, U+638c;
}
/* [66] cn */
@font-face {
  font-family: 'MinSans';
  font-style: normal;
  font-weight: 100;
  font-display: swap;
  src: url('../fonts/static/dynamic-subset/MinSans-Thin_66.woff2') format('woff2');
  unicode-range: U+5f11, U+5f13-5f15, U+5f17-5f18, U+5f1b, U+5f1f, U+5f26-5f27, U+5f29, U+5f31, U+5f35, U+5f3a, U+5f3c, U+5f48, U+5f4a, U+5f4c, U+5f4e, U+5f56-5f57, U+5f59, U+5f5b, U+5f62, U+5f66-5f67, U+5f69-5f6d, U+5f70-5f71, U+5f77, U+5f79, U+5f7c, U+5f7f-5f81, U+5f85, U+5f87, U+5f8a-5f8b, U+5f90-5f92, U+5f98-5f99, U+5f9e, U+5fa0-5fa1, U+5fa8-5faa, U+5fae, U+5fb5, U+5fb9, U+5fbd, U+5fc5, U+5fcc-5fcd, U+5fd6-5fd9, U+5fe0, U+5feb, U+5ff5, U+5ffd, U+5fff, U+600f, U+6012, U+6016, U+601c, U+6020-6021, U+6025, U+6028, U+602a, U+602f, U+6041-6043, U+604d, U+6050, U+6052, U+6055, U+6059, U+605d, U+6062-6065, U+6068-606a, U+606c-606d, U+606f-6070, U+6085, U+6089, U+608c-608d, U+6094, U+6096, U+609a-609b, U+609f-60a0, U+60a3-60a4, U+60a7, U+60b0, U+60b2-60b4, U+60b6, U+60b8, U+60bc-60bd, U+60c7, U+60d1, U+60da, U+60dc, U+60df-60e1, U+60f0-60f1, U+60f6, U+60f9-60fb, U+6101, U+6106, U+6108-6109, U+610d-610e, U+6115, U+611a, U+6127, U+6130, U+6134, U+6137, U+613c, U+613e-613f, U+6142, U+6144


category}:")
                for key, value in category_stats.items():
                    logger.info(f"{key}: {value}")

            # Log category completion
            logger.info(f"\nCompleted processing {category} images")
            logger.info("Category Statistics:")
            for key, value in category_stats.items():
                logger.info(f"{key}: {value}")
                total_stats[key] += value

    except KeyboardInterrupt:
        logger.info("\nProcessing interrupted by user. Saving final statistics...")
    except Exception as e:
        logger.error(f"Critical error in main processing loop: {str(e)}")

    finally:
        # Log final statistics
        logger.info("\nFinal Processing Statistics:")
        for key, value in total_stats.items():
            logger.info(f"{key}: {value}")

        # Final cleanup
        force_cleanup()

if __name__ == "__main__":
    main()


& clip) {
        return Vec3d(clip.x(), clip.y(), clip.z()) / clip.w();
    }

    static Vec2d ndc_to_ss(const Vec3d& ndc, const std::array<int, 4>& viewport) {
        const double half_w = 0.5 * double(viewport[2]);
        const double half_h = 0.5 * double(viewport[3]);
        return { half_w * ndc.x() + double(viewport[0]) + half_w, half_h * ndc.y() + double(viewport[1]) + half_h };
    };

    static Vec4d model_to_clip(const Vec3d& model, const Transform3d& world_matrix, const Matrix4d& projection_view_matrix) {
        return world_to_clip(model_to_world(model, world_matrix), projection_view_matrix);
    }

    static Vec3d model_to_ndc(const Vec3d& model, const Transform3d& world_matrix, const Matrix4d& projection_view_matrix) {
        return clip_to_ndc(world_to_clip(model_to_world(model, world_matrix), projection_view_matrix));
    }

    static Vec2d model_to_ss(const Vec3d& model, const Transform3d& world_matrix, const Matrix4d& projection_view_matrix, const std::array<int, 4>& viewport) {
        return ndc_to_ss(clip_to_ndc(world_to_clip(model_to_world(model, world_matrix), projection_view_matrix)), viewport);
    }

    static Vec2d world_to_ss(const Vec3d& world, const Matrix4d& projection_view_matrix, const std::array<int, 4>& viewport) {
        return ndc_to_ss(clip_to_ndc(world_to_clip(world, projection_view_matrix)), viewport);
    }

    static const Matrix4d& ndc_to_ss_matrix(const std::array<int, 4>& viewport) {
        update(viewport);
        return s_cache.ndc_to_ss_matrix;
    }

    static const Transform3d ndc_to_ss_matrix_inverse(const std::array<int, 4>& viewport) {
        update(viewport);
        return s_cache.ndc_to_ss_matrix_inverse;
    }

private:
    static void update(const std::array<int, 4>& viewport) {
        if (s_cache.viewport == viewport)
            return;

        const double half_w = 0.5 * double(viewport[2]);
        const double half_h = 0.5 * double(viewport[3]);
        s_cache.ndc_to_ss_matrix << half_w, 0.0, 0.0, double(viewport[0]) + half_w,
            0.0, half_h, 0.0, double(viewport[1]) + half_h,
            0.0, 0.0, 1.0, 0.0,
            0.0, 0.0, 0.0, 1.0;

        s_cache.ndc_to_ss_matrix_inverse = s_cache.ndc_to_ss_matrix.inverse();
        s_cache.viewport = viewport;
    }
};

TransformHelper::Cache TransformHelper::s_cache = { { 0, 0, 0, 0 }, Matrix4d::Identity(), Transform3d::Identity() };

GLGizmoMeasure::GLGizmoMeasure(GLCanvas3D& parent, const std::string& icon_filename, unsigned int sprite_id)
: GLGizmoBase(parent, icon_filename, sprite_id)
{
    GLModel::Geometry sphere_geometry = smooth_sphere(16, 7.5f);
    m_sphere.mesh_raycaster = std::make_unique<MeshRaycaster>(std::make_shared<const TriangleMesh>(sphere_geometry.get_as_indexed_triangle_set()));
    m_sphere.model.init_from(std::move(sphere_geometry));

    GLModel::Geometry cylinder_geometry = smooth_cylinder(16, 5.0f, 1.0f);
    m_cylinder.mesh_raycaster = std::make_unique<MeshRaycaster>(std::make_shared<const TriangleMesh>(cylinder_geometry.get_as_indexed_triangle_set()));
    m_cylinder.model.init_from(std::move(cylinder_geometry));
}

bool GLGizmoMeasure::on_mouse(const wxMouseEvent &mouse_event)
{
    m_mouse_pos = { double(mouse_event.GetX()), double(mouse_event.GetY())


      __ mtctr(R5_ARG3);
      __ bind(l_3);
      __ lwz(R0, -4, R3_ARG1);
      __ stw(R0, -4, R4_ARG2);
      __ addi(R3_ARG1, R3_ARG1, -4);
      __ addi(R4_ARG2, R4_ARG2, -4);
      __ bdnz(l_3);

      __ bind(l_6);
    }
  }

  // Generate stub for conjoint int copy.  If "aligned" is true, the
  // "from" and "to" addresses are assumed to be heapword aligned.
  //
  // Arguments for generated stub:
  //      from:  R3_ARG1
  //      to:    R4_ARG2
  //      count: R5_ARG3 treated as signed
  //
  address generate_conjoint_int_copy(bool aligned, const char * name) {
    StubCodeMark mark(this, "StubRoutines", name);
    address start = __ function_entry();

#if defined(ABI_ELFv2)
    address nooverlap_target = aligned ?
      StubRoutines::arrayof_jint_disjoint_arraycopy() :
      StubRoutines::jint_disjoint_arraycopy();
#else
    address nooverlap_target = aligned ?
      ((FunctionDescriptor*)StubRoutines::arrayof_jint_disjoint_arraycopy())->entry() :
      ((FunctionDescriptor*)StubRoutines::jint_disjoint_arraycopy())->entry();
#endif

    array_overlap_test(nooverlap_target, 2);

    generate_conjoint_int_copy_core(aligned);

    __ blr();

    return start;
  }

  // Generate core code for disjoint long copy (and oop copy on
  // 64-bit).  If "aligned" is true, the "from" and "to" addresses
  // are assumed to be heapword aligned.
  //
  // Arguments:
  //      from:  R3_ARG1
  //      to:    R4_ARG2
  //      count: R5_ARG3 treated as signed
  //
  void generate_disjoint_long_copy_core(bool aligned) {
    Register tmp1 = R6_ARG4;
    Register tmp2 = R7_ARG5;
    Register tmp3 = R8_ARG6;
    Register tmp4 = R0;

    Label l_1, l_2, l_3, l_4, l_5;

    VectorSRegister tmp_vsr1  = VSR1;
    VectorSRegister tmp_vsr2  = VSR2;

    { // FasterArrayCopy
      __ cmpwi(CCR0, R5_ARG3, 3);
      __ ble(CCR0, l_3); // copy 1 at a time if less than 4 elements remain

      __ srdi(tmp1, R5_ARG3, 2);
      __ andi_(R5_ARG3, R5_ARG3, 3);
      __ mtctr(tmp1);

    if (!VM_Version::has_vsx()) {
      __ bind(l_4);
      // Use unrolled version for mass copying (copy 4 elements a time).
      // Load feeding store gets zero latency on Power6, however not on Power5.
      // Therefore, the following sequence is made for the good of both.
      __ ld(tmp1, 0, R3_ARG1);
      __ ld(tmp2, 8, R3_ARG1);
      __ ld(tmp3, 16, R3_ARG1);
      __ ld(tmp4, 24, R3_ARG1);
      __ std(tmp1, 0, R4_ARG2);
      __ std(tmp2, 8, R4_ARG2);
      __ std(tmp3, 16, R4_ARG2);
      __ std(tmp4, 24, R4_ARG2);
      __ addi(R3_ARG1, R3_ARG1, 32);
      __ addi(R4_ARG2, R4_ARG2, 32);
      __ bdnz(l_4);

    } else { //


tree_map,ascending_QMARK_));
});

cljs.core.PersistentTreeSet.prototype.cljs$core$ISorted$_sorted_seq_from$arity$3 = (function (coll,k,ascending_QMARK_){
var self__ = this;
var coll__$1 = this;
return cljs.core.map.cljs$core$IFn$_invoke$arity$2(cljs.core.key,cljs.core._sorted_seq_from(self__.tree_map,k,ascending_QMARK_));
});

cljs.core.PersistentTreeSet.prototype.cljs$core$ISorted$_entry_key$arity$2 = (function (coll,entry){
var self__ = this;
var coll__$1 = this;
return entry;
});

cljs.core.PersistentTreeSet.prototype.cljs$core$ISorted$_comparator$arity$1 = (function (coll){
var self__ = this;
var coll__$1 = this;
return cljs.core._comparator(self__.tree_map);
});

cljs.core.PersistentTreeSet.getBasis = (function (){
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"meta","meta",-1154898805,null),new cljs.core.Symbol(null,"tree-map","tree-map",1373073049,null),cljs.core.with_meta(new cljs.core.Symbol(null,"__hash","__hash",-1328796629,null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"mutable","mutable",875778266),true], null))], null);
});

cljs.core.PersistentTreeSet.cljs$lang$type = true;

cljs.core.PersistentTreeSet.cljs$lang$ctorStr = "cljs.core/PersistentTreeSet";

cljs.core.PersistentTreeSet.cljs$lang$ctorPrWriter = (function (this__7998__auto__,writer__7999__auto__,opt__8000__auto__){
return cljs.core._write(writer__7999__auto__,"cljs.core/PersistentTreeSet");
});

cljs.core.__GT_PersistentTreeSet = (function cljs$core$__GT_PersistentTreeSet(meta,tree_map,__hash){
return (new cljs.core.PersistentTreeSet(meta,tree_map,__hash));
});

cljs.core.PersistentTreeSet.EMPTY = (new cljs.core.PersistentTreeSet(null,cljs.core.PersistentTreeMap.EMPTY,cljs.core.empty_unordered_hash));
var G__11650_11653 = cljs.core.PersistentTreeSet.prototype;
var G__11651_11654 = cljs.core.ITER_SYMBOL;
var G__11652_11655 = ((function (G__11650_11653,G__11651_11654){
return (function (){
var this__8422__auto__ = this;
return cljs.core.es6_iterator(this__8422__auto__);
});})(G__11650_11653,G__11651_11654))
;
goog.object.set(G__11650_11653,G__11651_11654,G__11652_11655);
cljs.core.set_from_indexed_seq = (function cljs$core$set_from_indexed_seq(iseq){
var arr = iseq.arr;
var ret = (function (){var a__8313__auto__ = arr;
var l__8314__auto__ = a__8313__auto__.length;
var i = (0);
var res = cljs.core._as_transient(cljs.core.PersistentHashSet.EMPTY);
while(true){
if((i < l__8314__auto__)){
var G_


The _area_ of a region is simply the number of garden plots the region contains. The above map's type `A`, `B`, and `C` plants are each in a region of area `4`. The type `E` plants are in a region of area `3`; the type `D` plants are in a region of area `1`.

Each garden plot is a square and so has _four sides_. The _perimeter_ of a region is the number of sides of garden plots in the region that do not touch another garden plot in the same region. The type `A` and `C` plants are each in a region with perimeter `10`. The type `B` and `E` plants are each in a region with perimeter `8`. The lone `D` plot forms its own region with perimeter `4`.

Visually indicating the sides of plots in each region that contribute to the perimeter using `-` and `|`, the above map's regions' perimeters are measured as follows:

```
+-+-+-+-+
|A A A A|
+-+-+-+-+     +-+
              |D|
+-+-+   +-+   +-+
|B B|   |C|
+   +   + +-+
|B B|   |C C|
+-+-+   +-+ +
          |C|
+-+-+-+   +-+
|E E E|
+-+-+-+
```

Plants of the same type can appear in multiple separate regions, and regions can even appear within other regions. For example:

```
OOOOO
OXOXO
OOOOO
OXOXO
OOOOO
```

The above map contains _five_ regions, one containing all of the `O` garden plots, and the other four each containing a single `X` plot.

The four `X` regions each have area `1` and perimeter `4`. The region containing `21` type `O` plants is more complicated; in addition to its outer edge contributing a perimeter of `20`, its boundary with each `X` region contributes an additional `4` to its perimeter, for a total perimeter of `36`.

Due to "modern" business practices, the _price_ of fence required for a region is found by _multiplying_ that region's area by its perimeter. The _total price_ of fencing all regions on a map is found by adding together the price of fence for every region on the map.

In the first example, region `A` has price `4 * 10 = 40`, region `B` has price `4 * 8 = 32`, region `C` has price `4 * 10 = 40`, region `D` has price `1 * 4 = 4`, and region `E` has price `3 * 8 = 24`. So, the total price for the first example is `_140_`.

In the second example, the region with all of the `O` plants has price `21 * 36 = 756`, and each of the four smaller `X` regions has price `1 * 4 = 4`, for a total price of `_772_` (`756 + 4 + 4 + 4 + 4`).

Here's a larger example:

```
RRRRIICCFF
RRRRIICCCF
VVRRRCCFFF
VVRCCCJFFF
VVVVCJJCFE
VVIVCCJJEE
VVIIICJJEE
MIIIIIJJEE
MIIISIJEEE
MMMISSJEEE
```

It contains:

-   A region of `R` plants with price `12 * 18 = 216`.
-   A region of `I` plants with price `4 * 8 = 32`.
-   A region of `C` plants with price `14 * 28 = 392`.
-   A region of `F` plants with price `10 * 18 = 180`.
-   A region of `V` plants with price `13 * 20 = 260`.
-   A region of `J` plants with price `11 * 20 = 220`.
-   A region of `C` plants with price `1 * 4 = 4`.
-   A region of `E` plants with price `13 * 18 = 234`.
-   A region of `I` plants with price `14 * 22 = 308`.
-   A region of `M` plants with price `5 * 12 = 60`.
-   A region of `S` plants with price `3 *


ulate_input_text('123')

    expect.eq(read_rendered_text(text_area), text .. '123_')

    simulate_input_keys('CUSTOM_CTRL_A')
    simulate_input_keys('CUSTOM_CTRL_X')

    expect.eq(read_rendered_text(text_area), '_')

    simulate_input_keys('CUSTOM_CTRL_Z')

    expect.eq(read_rendered_text(text_area), text .. '123_')

    simulate_input_keys('CUSTOM_CTRL_Y')

    expect.eq(read_rendered_text(text_area), '_')

    -- undo paste feature
    reset_text()

    simulate_input_keys('CUSTOM_CTRL_V')

    expect.eq(read_rendered_text(text_area), text .. text .. '123_')

    simulate_input_keys('CUSTOM_CTRL_Z')

    expect.eq(read_rendered_text(text_area), text .. '_')

    simulate_input_keys('CUSTOM_CTRL_Y')

    expect.eq(read_rendered_text(text_area), text .. text .. '123_')

    -- undo enter
    reset_text()

    simulate_input_keys('SELECT')

    expect.eq(read_rendered_text(text_area), text .. '\n_')

    simulate_input_keys('CUSTOM_CTRL_Z')

    expect.eq(read_rendered_text(text_area), text .. '_')

    simulate_input_keys('CUSTOM_CTRL_Y')

    expect.eq(read_rendered_text(text_area), text .. '\n_')

    -- undo backspace
    reset_text()

    simulate_input_keys('STRING_A000')

    expect.eq(read_rendered_text(text_area), text:sub(1, #text - 1) .. '_')

    simulate_input_keys('CUSTOM_CTRL_Z')

    expect.eq(read_rendered_text(text_area), text .. '_')

    simulate_input_keys('CUSTOM_CTRL_Y')

    expect.eq(read_rendered_text(text_area), text:sub(1, #text - 1) .. '_')

    -- undo line delete
    reset_text()

    simulate_input_keys('CUSTOM_CTRL_U')

    expect.eq(read_rendered_text(text_area), '_')

    simulate_input_keys('CUSTOM_CTRL_Z')

    expect.eq(read_rendered_text(text_area), text .. '_')

    simulate_input_keys('CUSTOM_CTRL_Y')

    expect.eq(read_rendered_text(text_area), '_')

    -- undo delete rest of line
    reset_text()

    text_area:setCursor(5)
    local expected_text = text:sub(1, 4) .. '_' .. text:sub(6, #text)
    expect.eq(read_rendered_text(text_area), expected_text)

    simulate_input_keys('CUSTOM_CTRL_K')

    expect.eq(read_rendered_text(text_area), text:sub(1, 4) .. '_')

    simulate_input_keys('CUSTOM_CTRL_Z')

    expect.eq(read_rendered_text(text_area), expected_text)

    simulate_input_keys('CUSTOM_CTRL_Y')

    expect.eq(read_rendered_text(text_area), text:sub(1, 4) .. '_')

    -- undo delete char
    reset_text()

    text_area:setCursor(5)
    expect.eq(read_rendered_text(text_area), expected_text)

    simulate_input_keys('CUSTOM_DELETE')

    expect.eq(
        read_rendered_text(text_area),
        text:sub(1, 4) .. '_' .. text:sub(7, #text)
    )

    simulate_input_keys('CUSTOM_CTRL_Z')

    expect.eq(read_rendered_text(text_area), expected_text)

    simulate_input_keys('CUSTOM_CTRL_Y')

    expect.eq(
        read_rendered_t


objectif (trop ressemblant  notre forum du DH). A-bone, le webmaster, a donc rinstall une autre version du phpbb du forum, suite  un torp grand nombre de bug persistant note sur la dernire verison du forum phpbb. Dans le mme temps, Nocte a conu la section Dfi o, chaque semaine, est propose un problme sous forme de dfi, avec une orientation scurit, cela afin d'amliorer ses connaissances personnelles.

   Malheureusement, notre ex-site officiel, http://dealerhack-ifrance.com, a t kik pendant prs d'une semaine. Finalement, aprs nos demande insistantes d'explications, ifrance a finalement rouvert le compte avec, pour toute explication, le fait que certains serveurs de ifrance avait subi des problmes technique (sic!).

  L'un des coups le plus dur se produisit le vendredi 21 fvrier, quand notre forum DHS Online fut victime d'une attaque du style [CENSURE]alert:bidon[/CENSURE]. Le forum tait alors  son apoge est avait eu une croissance de visiteurs phnomnales en quelques jours (80 nouveaux inscrit en 10 jours). Cette attaque a crash le serveur. Une seconde attaque par SQL injection a provoqu une dfaillance dans la page phpmyadmin ce qui aura pour but de dtruire la base de donne du forum, base dj bien avance (85 membres et plus de 300 messages en 10 jours pile). Pendant 3 heures, de 22 heures  minuit, la totalit de la base de donnes du forum tait accessible par n'importe qui sur le Net, avec une simple url...

  Sans se dmonter du tout, le lendemain, A-bone reprend la construction du forum.

  Nous allions sortir TDC Mag n2 quand un incident  totalement boulevers l'avenir de
notre Team. A-bone, enfreignant les rgles du DHS, a effectu des defacage sur des sites perso du FAI de Free. Oubliant de supprimer les logs, il s'est fait remont et, quelques jours plus tard, les forces de l'ordre dbarquent chez lui accompagn d'agent du FAI. Fort heureusement pour lui, ses
proches ont calm les calm les choses... il a frl la prison... Par cet acte
irrespectueux envers notre thique et immoral, A-bone est ject de la Team. Le jour suivant, Stigmata roote un box et frle lui aussi la catastrophe : il dtruit les logs au moment mme ou l'admin, en mme temps sur
le rseau, les consulte. Par chance, Stigmata jecte l'admin et s'en sort
d'extrme justesse. C'est le coup d'pe final : notre Team, le TDC, est
dissoute et tous les membres l'abandonne immdiatement. Stigmata quitte la
scne. Nocte rcupre le site, et fonde, avec A-bone, la DHS Team : Dealer
Hack Security Team, mais A-bone n'en est plus l'admin. Il quitte la scne en se
promettant de revenir :  l'heure actuelle, il n'est toujours pas l.

Le site http://dealerhacksecurity.free.fr
est appel  devenir trs connu, voire une rfrence, en matire de scurit.
A partir de l, la DHS remonte lentement la


/* $Id: polygon.h,v 1.1 1996/09/13 01:38:16 brianp Exp $ */

/*
 * Mesa 3-D graphics library
 * Version:  2.0
 * Copyright (C) 1995-1996  Brian Paul
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library 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
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the Free
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

/*
 * $Log: polygon.h,v $
 * Revision 1.1  1996/09/13 01:38:16  brianp
 * Initial revision
 *
 */

#ifndef POLYGON_H
#define POLYGON_H

#include "types.h"

extern void gl_CullFace( GLcontext *ctx, GLenum mode );

extern void gl_FrontFace( GLcontext *ctx, GLenum mode );

extern void gl_PolygonMode( GLcontext *ctx, GLenum face, GLenum mode );

extern void gl_PolygonOffset( GLcontext *ctx,
                              GLfloat factor, GLfloat units );

extern void gl_PolygonStipple( GLcontext *ctx, const GLubyte *mask );

extern void gl_GetPolygonStipple( GLcontext *ctx, GLubyte *mask );

#endif


请填写你的Slack用户名、Github用户名和技术水平:
- 好：至少是另一种编码语言的专家，并能使用pine script文档
- 一般：会修改pine script，并能做小的改动
- 起始：刚开始学代码

| Slack Name | Github Name | Skill Level |
|----------|:-------------:|------:|
| @Toby Zhou - 数据攻城狮 | lisangzhou  | good |
| XXX |    YYY   |   ZZZ |

# FUTU

>PC和MOB区别：由于手机查看的时候线条太多，MOB方案去掉了SMA线。建议使用文件的方式。

富途可以通过两种方式自定义指标;

- 自行添加代码;
   1. 复制过去需要自行添加变量：P1,P2,P3,P4;
   2. 需要添加P1...P4的最大值，不然Win平台会有bug（仅影响修改，不影响显示，version:10.8.7958.08071518）;
   3. 注意软件的提示。

- 文件导入;
   1. 下载自定义的指标文件（链接见下方）;
   2. 导入自定义的指标文件即可;

## 参数设置（均线）
> 如何你会一点编程建议使用变量的形式来替代数字（5,20,60,120）

| 参数名| 默认值 | 最大值 | 最小值 |
| --- | --- | --- | --- |
| P1 | 5 | 1000 | 0 |
| P2 | 20 | 1000 | 0 |
| P3 | 60 | 1000 | 0 |
| P4 | 120 | 1000 | 0 |

## 文件导入
- [双均线抵扣价 和 乖离率20](futu.zip)
- [双均线抵扣价](LC.ftindex)
- [乖离率](GL20.ftindex)

## GLL 乖离率
```text
CS:(CLOSE-MA(CLOSE,20))/MA(CLOSE,20)*100,LINETHICK1,COLORFF8D1E;
SM:(MA(CLOSE,20)-MA(CLOSE,60))/MA(CLOSE,P2)*100,LINETHICK1,COLOR0CAEE6;
ML:(MA(CLOSE,60)-MA(CLOSE,120))/MA(CLOSE,P3)*100,COLORSTICK;
```

## 双均线
```text
W1:=REF(CLOSE,20);
W2:=REF(CLOSE,60);
W3:=REF(CLOSE,120);

{K线颜色 5 20 60 120}
{价在线上，线向上；价在线下，线向下。所见即所得。FROM: HTTPS://YOUTU.BE/PE04VSHLE1G?T=337}
STICKLINE(C<W1,H,L,0.71,0),COLORLIGRAY;
STICKLINE(C<W2,H,L,0.71,0),COLORGRAY;
STICKLINE(C>W1,O,C,0.71,0),COLORGREEN;

{黄色点 5 20 60 120}
DRAWICON(CURRBARSCOUNT=5+1,L,41);
DRAWICON(CURRBARSCOUNT=20+1,L,41);
DRAWICON(CURRBARSCOUNT=60+1,L,41);
DRAWICON(CURRBARSCOUNT=120+1,L,41);

{SMA 20 60 120}
MA2:MA(CLOSE,20), COLORB6B1B1, DOTLINE;
MA3:MA(CLOSE,60), COLORD751A8, DOTLINE;
MA4:MA(CLOSE,120), COLOR94B8C4, DOTLINE;

{EMA 5 20 60 120}
EMA1:EMA(CLOSE,5), COLORRED;
EMA2:EMA(CLOSE,20), COLOR69F6EB;
EMA3:EMA(CLOSE,60), COLORFFAEC9;
EMA4:EMA(CLOSE,120), COLORBLUE;
```

![PC](PC.jpg)
 LoneCapital Chat

## 双均线、抵扣价

```text
//@version=4
study("MA+EMA",overlay=true)
e1=ema(close,20)
c1=sma(close,20)
e2


RealDouble();
				pixelFaces[0] += pixelA | pixelB | pixelC | pixelD;
			}
		});

		LongStream.of(traverser.x0, traverser.x1).forEach(x -> {
			RandomAccessibleInterval<B> sliceRai =  Views.hyperSlice(traverser.rai, 0, x);
			sliceRai = Views.expandZero(sliceRai, 1, 0);
			final long w = sliceRai.dimension(0);

			Cursor<B> cursorA = Views.flatIterable(sliceRai).cursor();
			Cursor<B> cursorB = Views.flatIterable(sliceRai).cursor();
			Cursor<B> cursorC = Views.flatIterable(sliceRai).cursor();
			Cursor<B> cursorD = Views.flatIterable(sliceRai).cursor();

			cursorA.jumpFwd(w + 1);
			cursorB.jumpFwd(w);
			cursorC.jumpFwd(1);
			cursorD.jumpFwd(0);

			while (cursorA.hasNext()) {
				final int pixelA = (int) cursorA.next().getRealDouble();
				final int pixelB = (int) cursorB.next().getRealDouble();
				final int pixelC = (int) cursorC.next().getRealDouble();
				final int pixelD = (int) cursorD.next().getRealDouble();
				pixelFaces[0] += pixelA | pixelB | pixelC | pixelD;
			}
		});

		LongStream.of(traverser.y0, traverser.y1).forEach(y -> {
			RandomAccessibleInterval<B> sliceRai =  Views.hyperSlice(traverser.rai, 1, y);
			final long w = sliceRai.dimension(0);

			Cursor<B> cursorA = Views.flatIterable(sliceRai).localizingCursor();
			Cursor<B> cursorB = Views.flatIterable(sliceRai).cursor();
			Cursor<B> cursorC = Views.flatIterable(sliceRai).cursor();
			Cursor<B> cursorD = Views.flatIterable(sliceRai).cursor();

			cursorA.jumpFwd(w + 1);
			cursorB.jumpFwd(w);
			cursorC.jumpFwd(1);
			cursorD.jumpFwd(0);

			while (cursorA.hasNext()) {
				final int pixelA = (int) cursorA.next().getRealDouble();
				final int pixelB = (int) cursorB.next().getRealDouble();
				final int pixelC = (int) cursorC.next().getRealDouble();
				final int pixelD = (int) cursorD.next().getRealDouble();
				if (cursorA.getLongPosition(0) == 0)
					continue;
				pixelFaces[0] += pixelA | pixelB | pixelC | pixelD;
			}
		});
		return pixelFaces[0];
	}

	//region -- Helper methods --
	private static <B extends BooleanType<B>> int getAtLocation(final Traverser<B> traverser, final long x,
		final long y, final long z) {
		traverser.access.setPosition(x, 0);
		traverser.access.setPosition(y, 1);
		traverser.access.setPosition(z, 2);
		final double realDouble = traverser.access.get().getRealDouble();

		return (int) realDouble;
	}
	//endregion

	/** A convenience class for passing parameters */
	public static class Traverser<B extends BooleanType<B>> {
		public final long x0 = 0;
		public final long y0 = 0;
		public final long z0 = 0;
		public final long x1;
		public final long y1;
		public final long z1;
		public final long xSize;
		public final long ySize;
		public final long zSize;
		public final RandomAccess<B> access;
		public final RandomAccessibleInterval<B> rai;

		public Traverser(RandomAccessibleInterval<B>


adcxq   %rdx, %rdx
        adoxq   %rcx, %rdx
        movq    %rdx, 8(z)

        .set I,  1
.rep 14
        movq    8*I(x), %rdx
        mulxq   %rdx, %rax, %rcx

        movq    8*(2*I)(z), %rdx
        adcxq   %rdx, %rdx
        adoxq   %rax, %rdx
        movq    %rdx, 8*(2*I)(z)

        movq    8*(2*I+1)(z), %rdx
        adcxq   %rdx, %rdx
        adoxq   %rcx, %rdx
        movq    %rdx, 8*(2*I+1)(z)
        .set I,  (I+1)
.endr

        movq    8*I(x), %rdx
        mulxq   %rdx, %rax, %rcx

        movq    8*(2*I)(z), %rdx
        adcx


#ifndef SAFEHERON_MULTI_PARTY_ECDSA_GG20_SIGN_ONCE_T_PARTY_H
#define SAFEHERON_MULTI_PARTY_ECDSA_GG20_SIGN_ONCE_T_PARTY_H

#include "crypto-suites/crypto-sss/vsss.h"
#include "crypto-suites/crypto-bn/bn.h"
#include "crypto-suites/crypto-paillier/pail.h"
#include "crypto-suites/crypto-curve/curve.h"
#include "crypto-suites/crypto-zkp/zkp.h"
#include "multi-party-sig/mpc-flow/mpc-parallel-v2/mpc_context.h"
#include "multi-party-sig/multi-party-ecdsa/gg20/sign/proto_gen/sign.pb.switch.h"

namespace safeheron {
namespace multi_party_ecdsa{
namespace gg20{
namespace sign{

class LocalTParty {
public:
    // for phase 1
    safeheron::bignum::BN lambda_;
    std::vector<safeheron::bignum::BN> l_arr_;
    safeheron::bignum::BN gamma_;
    safeheron::bignum::BN k_;
    safeheron::bignum::BN w_;
    safeheron::curve::CurvePoint Gamma_;
    safeheron::bignum::BN com_Gamma_; // Commitment for Gamma = g^gamma
    safeheron::bignum::BN com_Gamma_blinding_factor_; // blinding factor
    // - Mta(k, gamma)/ Mta(k, w) - step 1, construct message a. note that message_a in MTA(k, gamma) is the same as in MTA(k, w)
    safeheron::bignum::BN message_a_;
    safeheron::bignum::BN r_for_pail_for_mta_msg_a_;

    // for phase 2
    safeheron::bignum::BN sigma_;

    // for phase 3
    safeheron::bignum::BN delta_;
    safeheron::curve::CurvePoint H_;
    safeheron::curve::CurvePoint T_;
    safeheron::zkp::pedersen_proof::PedersenProof pedersen_proof_;

    // for phase 4

    // for phase 5
    safeheron::curve::CurvePoint Ri_; // Ri = R^ki
    safeheron::zkp::pail::PailEncGroupEleRangeProof pail_enc_group_ele_range_proof_;

    // for phase 6
    safeheron::curve::CurvePoint S_; // Si = R^sigma
    safeheron::bignum::BN l_;
    safeheron::zkp::heg::HEGProof_V3 heg_proof_;

    // for phase 7
    safeheron::bignum::BN sig_share_;

    LocalTParty() {}
};

class RemoteTParty {
public:
    // phase 1
    safeheron::bignum::BN lambda_;
    safeheron::bignum::BN com_Gamma_; // Commitment for Gamma = g^gamma
    safeheron::zkp::pail::PailEncRangeProof_V1 alice_proof_; // ZK proof

    // phase 2
    // Receive message A of MTA
    safeheron::bignum::BN receive_message_a_;
    // - Mta(k, gamma) - step 2, construct message b
    safeheron::bignum::BN message_b_for_k_gamma_;
    safeheron::bignum::BN beta_tag_for_mta_k_gamma_msg_b_;
    safeheron::bignum::BN r_for_pail_for_mta_k_gamma_msg_b_;
    // - Mta(k, w) - step 2, construct message b
    safeheron::bignum::BN message_b_for_k_w_;
    safeheron::bignum::BN beta_tag_for_mta_k_w_msg_b_;
    safeheron::bignum::BN r_for_pail_for_mta_k_w_msg_b_;
    // - Mta(k, gamma) - step 3
    safeheron::bignum::BN beta_for_k_gamma_;
    safeheron::bignum::BN alpha_for_k_gamma_;
    // - Mta(k, w) - step 3
    safeheron::bignum::BN beta_for_k_w_;
    safeheron::bignum::BN alpha_for_k_w_;
    // - bob proof for MTA(k, gamma) and MTA(k, w)
    safeheron::zkp::pail::PailAffRangeProof bob_proof_1_;
    safeheron::zkp::pail::PailAffGroupEleRangeProof_V1 bob_proof_2_;

    // for phase 3
    safeheron::bignum::BN delta_;
    safeheron::curve::CurvePoint H_;
    safeheron::curve::CurvePoint T_;

    // for phase 4
    safeheron::bignum::BN com_Gamma_blinding_factor_; // blinding factor
    safeheron::curve::CurvePoint Gamma_;

    // for phase 5
    safeheron::curve::CurvePoint Ri_; // Ri = R^ki
    safeheron::zkp::pail::PailEncGroupEleRangeProof pail_enc_group_ele_range_proof_;

    // for phase 6
    safeheron::curve::CurvePoint S_; // Si = R^sigma

    RemoteTParty() {}
};

}
}
}
}

#endif //SAFEHERON_MULTI_PARTY_ECDSA_GG20_SIGN_ONCE_T_PARTY_H


INF = int(1e9)
n,m,x = map(int,input().split())
graph = {i: [] for i in range(1, n + 1)}
reverse_graph = {i: [] for i in range(1, n + 1)}
for _ in range(m):
    a,b,c = map(int,input().split())
    graph[a].append((b,c))
    reverse_graph[b].append((a, c))   # 반대 방향

'''
접근
각학생이 x로 이동해야됨
-> x기준 각학생에게 가는 최소 비용 계산 + 학생에서 x에게 가는 최소비용 계산
-> 비용 계산 한것 중 최솟값 추출
'''

# 초기화
import heapq

def dijkstra(start, g):
    distance = [INF] * (n + 1)
    distance[start] = 0
    heap = [(0, start)]

    while heap:
        dist, node = heapq.heappop(heap)

        if distance[node] < dist:
            continue

        for neighbor, cost in g[node]:
            new_cost = dist + cost
            if new_cost < distance[neighbor]:
                distance[neighbor] = new_cost
                heapq.heappush(heap, (new_cost, neighbor))
    return distance

# x → i
go = dijkstra(x, graph)
# i → x
back = dijkstra(x, reverse_graph)

# 왕복 거리의 최댓값
result = 0
for i in range(1, n + 1):
    total = go[i] + back[i]
    result = max(result, total)

print(result)


ets the third corners vertex id.
        /// </summary>
        public int P2
        {
            get { return this.vertices[2]; }
        }

        /// <summary>
        /// Gets the specified corners vertex.
        /// </summary>
        public Vertex GetVertex(int index)
        {
            return null; // TODO: throw NotSupportedException?
        }

        public bool SupportsNeighbors
        {
            get { return false; }
        }

        public int N0
        {
            get { return -1; }
        }

        public int N1
        {
            get { return -1; }
        }

        public int N2
        {
            get { return -1; }
        }

        public ITriangle GetNeighbor(int index)
        {
            return null;
        }

        public ISegment GetSegment(int index)
        {
            return null;
        }

        /// <summary>
        /// Gets the triangle area constraint.
        /// </summary>
        public double Area
        {
            get { return area; }
            set { area = value; }
        }

        /// <summary>
        /// Region ID the triangle belongs to.
        /// </summary>
        public int Region
        {
            get { return region; }
            set { region = value; }
        }

        #endregion
    }
}


 be optional, allowing memory/process dump parsing, thanks @ko1n (as well as patience for very long time to merge PR!): https://github.com/m4b/goblin/pull/188

## [0.3.2] - 2021-1-29
### Fixed
- elf: overflow panic when note name is 0, thanks @glandium: https://github.com/m4b/goblin/pull/256

## [0.3.1] - 2021-1-18
### Added
- mach: add rpaths, thanks @keith: https://github.com/m4b/goblin/pull/248
### Fixed
- elf: fix regression parsing binaries like busybox (https://github.com/m4b/bingrep/issues/28), thanks @jan-auer: https://github.com/m4b/goblin/pull/249

## [0.3.0] - 2020-11-26
### BREAKING
- mach: add missing load commands, and fixup minversion enum and api, thanks @woodruffw !: https://github.com/m4b/goblin/pull/240
### Fixed
- elf: prevent overflow in bad section sizes, thanks @jackcmay: https://github.com/m4b/goblin/pull/243
- `Object::parse` no longer needs `std`! thanks @Evian-Zhang: https://github.com/m4b/goblin/pull/235
-  test: remove hardcoded CommandLineTools path in macos test, thanks @quake: https://github.com/m4b/goblin/pull/238
- build: Resolve clippy lints, thanks @connorkuehl: https://github.com/m4b/goblin/pull/225
### Added
- elf: add the x86-64 unwind processor specific section header type https://github.com/m4b/goblin/pull/224
- elf: Add ability to get archive members by index https://github.com/m4b/goblin/pull/225

## [0.2.3] - 2020-5-10
### Fixed
- pe: remove unwrap on coffheader strtab parsing, thanks @ExPixel: https://github.com/m4b/goblin/pull/222
### Added
- pe: add more machine constants, thanks @ExPixel: https://github.com/m4b/goblin/pull/223

## [0.2.2] - 2020-5-08
### Fixed
- elf: protect against out of memory when parsing, thanks @jackcmay: https://github.com/m4b/goblin/pull/219
- pe: fix panic when parsing unwind info, thanks @jan-auer: https://github.com/m4b/goblin/pull/218

## [0.2.1] - 2020-3-14
### Added
- elf: add more robust debug printing to various elf data structures, thanks @connorkuehl, e.g.: https://github.com/m4b/goblin/pull/211
- elf: derive PartialEq for DynamicInfo, thanks @connorkuehl: https://github.com/m4b/goblin/pull/209

## [0.2.0] - 2020-1-20
### Changed
- BREAKING: Changes in `elf::gnu_hash::GnuHash`:
  + `new(*const u32, usize, &[sym::Sym]) -> Self`
    to `from_raw_table(&[u8], &[Sym]) -> Result<Self, &str>`
  + `find(&self, &str, u32, &Strtab) -> Option<&Sym>`
    to `find(&self, &str, &Strtab) -> Option<&Sym>`.
- BREAKING: mach: fix generic relocation constants, @philipc: https://github.com/m4b/goblin/pull/204/files
### Added
- elf: add more elf note values, thanks @xcoldhandsx: https://github.com/m4b/goblin/pull/201
- Finally rustfmt'd entire repo :D

## [0.1.3] - 2019-12-28
### Removed
- alloc feature, stabilized in 1.36 @philipc https://github.com/m4b/goblin/pull/196
### Ad


", "Hernandez", "Moore", "Martin", "Jackson",
        "Thompson", "White", "Lopez", "Lee", "Gonzalez", "Harris", "Clark",
        "Lewis", "Robinson", "Walker", "Perez", "Hall", "Young", "Allen"],
    CTITLE: ["春","集","丈","木","研","班","普","导","顿","睡","展","跳","获","艺","六","波","察","群","皇","段","急","庭","创","区","奥","器","谢","弟","店","否","害","草","排","背","止","组","州","朝","封","睛","板","角","况","曲","馆","育","忙","质","河","续","哥","呼","若","推","境","遇","雨","标","姐","充","围","案","伦","护","冷","警","贝","著","雪","索","剧","啊","船","险","烟","依","斗","值","帮","汉","慢","佛","肯","闻","唱","沙","局","伯","族","低","玩","资","屋","击","速","顾","泪","洲","团","圣","旁","堂","兵","七","露","园","牛","哭","旅","街","劳","型","烈","姑","陈","莫","鱼","异","抱","宝","权","鲁","简","态","级","票","怪","寻","杀","律","胜","份","汽","右","洋","范","床","舞","秘","午","登","楼","贵","吸","责","例","追","较","职","属","渐","左","录","丝","牙","党","继","托","赶","章","智","冲","叶","胡","吉","卖","坚","喝","肉","遗","救","修","松","临","藏","担","戏","善","卫","药","悲","敢","靠","伊","村","戴","词","森","耳","差","短","祖","云","规","窗","散","迷","油","旧","适","乡","架","恩","投","弹","铁","博","雷","府","压","超","负","勒","杂","醒","洗","采","毫","嘴","毕","九","冰","既","状","乱","景","席","珍","童","顶","派","素","脱","农","疑","练","野","按","犯","拍","征","坏","骨","余","承","置", "彩","灯","巨","琴","免","环","姆","暗","换","技","翻","束","增","忍","餐","洛","塞","缺","忆","判","欧","层","付","阵","玛","批","岛","项","狗","休","懂","武","革","良","恶","恋","委","拥","娜","妙","探","呀","营","退","摇","弄","桌","熟","诺","宣","银","势","奖","宫","忽","套","康","供","优","课","鸟","喊","降","夏","困","刘","罪","亡","鞋","健","模","败","伴","守","挥","鲜","财","孤","枪","禁","恐","伙","杰","迹","妹","遍","盖","副","坦","牌","江","顺","秋","萨","菜","划","授","归","浪","听","凡","预","奶","雄","升","编","典","袋","莱","含","盛","济","蒙","棋","端","腿","招","释","介","烧"],
    EMAIL : function() {
        return getRandomData('@LETTER_LOWER')
            + '.'
            + getRandomData('@LAST_NAME').toLowerCase()
            + '@'
            + getRandomData('@LAST_NAME').toLowerCase()
            + '.com';
    },
    DATE_YYYY : function() {
        var yyyy = random


 * @function Hist_and_Backproj
 * @brief Callback to Trackbar
 */
void Hist_and_Backproj(int, void* )
{
  MatND hist;
  int histSize = MAX( bins, 2 );
  float hue_range[] = { 0, 180 };
  const float* ranges = { hue_range };

  /// Get the Histogram and normalize it
  calcHist( &hue, 1, 0, Mat(), hist, 1, &histSize, &ranges, true, false );
  normalize( hist, hist, 0, 255, NORM_MINMAX, -1, Mat() );

  /// Get Backprojection
  MatND backproj;
  calcBackProject( &hue, 1, 0, hist, backproj, &ranges, 1, true );

  /// Draw the backproj
  imshow( "BackProj", backproj );

  /// Draw the histogram
  int w = 400; int h = 400;
  int bin_w = cvRound( (double) w / histSize );
  Mat histImg = Mat::zeros( w, h, CV_8UC3 );

  for( int i = 0; i < bins; i ++ )
     { rectangle( histImg, Point( i*bin_w, h ), Point( (i+1)*bin_w, h - cvRound( hist.at<float>(i)*h/255.0 ) ), Scalar( 0, 0, 255 ), -1 ); }

  imshow( "Histogram", histImg );

}
/**
 * @function generalContours_demo2.cpp
 * @brief Demo code to obtain ellipses and rotated rectangles that contain detected contours
 * @author OpenCV team
 */

#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include <iostream>
#include <stdio.h>
#include <stdlib.h>

using namespace cv;
using namespace std;

Mat src; Mat src_gray;
int thresh = 100;
int max_thresh = 255;
RNG rng(12345);

/// Function header
void thresh_callback(int, void* );

/**
 * @function main
 */
int main( int, char** argv )
{
  /// Load source image and convert it to gray
  src = imread( argv[1], 1 );

  /// Convert image to gray and blur it
  cvtColor( src, src_gray, CV_BGR2GRAY );
  blur( src_gray, src_gray, Size(3,3) );

  /// Create Window
  const char* source_window = "Source";
  namedWindow( source_window, CV_WINDOW_AUTOSIZE );
  imshow( source_window, src );

  createTrackbar( " Threshold:", "Source", &thresh, max_thresh, thresh_callback );
  thresh_callback( 0, 0 );

  waitKey(0);
  return(0);
}

/**
 * @function thresh_callback
 */
void thresh_callback(int, void* )
{
  Mat threshold_output;
  vector<vector<Point> > contours;
  vector<Vec4i> hierarchy;

  /// Detect edges using Threshold
  threshold( src_gray, threshold_output, thresh, 255, THRESH_BINARY );
  /// Find contours
  findContours( threshold_output, contours, hierarchy, CV_RETR_TREE, CV_CHAIN_APPROX_SIMPLE, Point(0, 0) );

  /// Find the rotated rectangles and ellipses for each contour
  vector<RotatedRect> minRect( contours.size() );
  vector<RotatedRect> minEllipse( contours.size() );

  for( size_t i = 0; i < contours.size(); i++ )
     { minRect[i] = minAreaRect( Mat(contours[i]) );
       if( contours[i].size() > 5 )
         { minEllipse[i] = fitEllipse( Mat(contours[i]) ); }
     }

  /// Draw contours + rotated rects + ellipses
  Mat drawing = Mat::zeros( threshold_output.size(), CV_8UC3 );
  for(


ct.ahsl.hue        = h == qreal(-1.0) ? USHRT_MAX : qRound(h * 36000);
    ct.ahsl.saturation = qRound(s * USHRT_MAX);
    ct.ahsl.lightness  = qRound(l * USHRT_MAX);
    ct.ahsl.pad        = 0;
}

/*!
    \since 4.6

    Sets a HSL color value; \a h is the hue, \a s is the saturation, \a l is
    the lightness and \a a is the alpha component of the HSL color.

    The saturation, value and alpha-channel values must be in the range 0-255,
    and the hue value must be greater than -1.

    \sa getHsl(), setHslF()
*/
void QColor::setHsl(int h, int s, int l, int a)
{
    if (h < -1 || (uint)s > 255 || (uint)l > 255 || (uint)a > 255) {
        qWarning("QColor::setHsv: HSV parameters out of range");
        invalidate();
        return;
    }

    cspec = Hsl;
    ct.ahsl.alpha      = a * 0x101;
    ct.ahsl.hue        = h == -1 ? USHRT_MAX : (h % 360) * 100;
    ct.ahsl.saturation = s * 0x101;
    ct.ahsl.lightness  = l * 0x101;
    ct.ahsl.pad        = 0;
}

/*!
    Sets the contents pointed to by \a r, \a g, \a b, and \a a, to the red,
    green, blue, and alpha-channel (transparency) components of the color's
    RGB value.

    These components can be retrieved individually using the redF(), greenF(),
    blueF() and alphaF() functions.

    \sa rgb(), setRgb()
*/
void QColor::getRgbF(qreal *r, qreal *g, qreal *b, qreal *a) const
{
    if (!r || !g || !b)
        return;

    if (cspec != Invalid && cspec != Rgb) {
        toRgb().getRgbF(r, g, b, a);
        return;
    }

    *r = ct.argb.red   / qreal(USHRT_MAX);
    *g = ct.argb.green / qreal(USHRT_MAX);
    *b = ct.argb.blue  / qreal(USHRT_MAX);

    if (a)
        *a = ct.argb.alpha / qreal(USHRT_MAX);

}

/*!
    Sets the contents pointed to by \a r, \a g, \a b, and \a a, to the red,
    green, blue, and alpha-channel (transparency) components of the color's
    RGB value.

    These components can be retrieved individually using the red(), green(),
    blue() and alpha() functions.

    \sa rgb(), setRgb()
*/
void QColor::getRgb(int *r, int *g, int *b, int *a) const
{
    if (!r || !g || !b)
        return;

    if (cspec != Invalid && cspec != Rgb) {
        toRgb().getRgb(r, g, b, a);
        return;
    }

    *r = ct.argb.red   >> 8;
    *g = ct.argb.green >> 8;
    *b = ct.argb.blue  >> 8;

    if (a)
        *a = ct.argb.alpha >> 8;
}

/*!
    \obsolete
    \fn void QColor::getRgba(int *r, int *g, int *b, int *a) const

    Use getRgb() instead.
*/

/*!
    \fn void QColor::setRgbF(qreal r, qreal g, qreal b, qreal a


  /// let function = module.add_function("do_nothing", fn_type, None);
    ///
    /// let basic_block1 = context.append_basic_block(function, "entry");
    /// let basic_block2 = context.append_basic_block(function, "next");
    ///
    /// basic_block2.move_before(basic_block1);
    ///
    /// assert!(basic_block1.get_next_basic_block().is_none());
    /// assert_eq!(basic_block2.get_next_basic_block().unwrap(), basic_block1);
    /// ```
    // REVIEW: What happens if blocks are from different scopes?
    pub fn move_before(self, basic_block: BasicBlock<'ctx>) -> Result<(), ()> {
        // This method is UB if the parent no longer exists, so we must check for parent (or encode into type system)
        if self.get_parent().is_none() || basic_block.get_parent().is_none() {
            return Err(());
        }

        unsafe { LLVMMoveBasicBlockBefore(self.basic_block, basic_block.basic_block) }

        Ok(())
    }

    /// Appends one `BasicBlock` after another.
    /// It returns `Err(())` when either `BasicBlock` has no parent, as LLVM assumes they both have parents.
    ///
    /// # Example
    /// ```no_run
    /// use inkwell::context::Context;
    /// use inkwell::module::Module;
    /// use inkwell::builder::Builder;
    ///
    /// let context = Context::create();
    /// let module = context.create_module("my_module");
    /// let void_type = context.void_type();
    /// let fn_type = void_type.fn_type(&[], false);
    /// let function = module.add_function("do_nothing", fn_type, None);
    ///
    /// let basic_block1 = context.append_basic_block(function, "entry");
    /// let basic_block2 = context.append_basic_block(function, "next");
    ///
    /// basic_block1.move_after(basic_block2);
    ///
    /// assert!(basic_block1.get_next_basic_block().is_none());
    /// assert_eq!(basic_block2.get_next_basic_block().unwrap(), basic_block1);
    /// ```
    // REVIEW: What happens if blocks are from different scopes?
    pub fn move_after(self, basic_block: BasicBlock<'ctx>) -> Result<(), ()> {
        // This method is UB if the parent no longer exists, so we must check for parent (or encode into type system)
        if self.get_parent().is_none() || basic_block.get_parent().is_none() {
            return Err(());
        }

        unsafe { LLVMMoveBasicBlockAfter(self.basic_block, basic_block.basic_block) }

        Ok(())
    }

    /// Obtains the first `InstructionValue` in this `BasicBlock`, if any.
    ///
    /// # Example
    /// ```no_run
    /// use inkwell::context::Context;
    /// use inkwell::module::Module;
    /// use inkwell::builder::Builder;
    /// use inkwell::values::InstructionOpcode;
    ///
    /// let context = Context::create();
    /// let builder = context.create_builder();
    /// let module = context.create_module("my_module");
    /// let void_type = context.void_type();
    /// let fn_type = void_type.fn_type(&[], false);
    /// let function = module.add_function("do_nothing", fn_type, None);
    /// let basic_block = context.append_basic_block(function, "entry");
    ///
    /// builder.position_at_end(basic_block);
    /// builder.build_return(None);
    ///
    /// assert_eq!(basic_block.get_first_instruction().unwrap().


(SELECT 1 FROM t1 WHERE a=1 UNION SELECT 2 FROM t1 WHERE b=0)
    ]], {
        -- <tkt1473-3.3>
        true
        -- </tkt1473-3.3>
    })

test:do_execsql_test(
    "tkt1473-3.4",
    [[
        SELECT EXISTS
          (SELECT 1 FROM t1 WHERE a=1 UNION ALL SELECT 2 FROM t1 WHERE b=4)
    ]], {
        -- <tkt1473-3.4>
        true
        -- </tkt1473-3.4>
    })

test:do_execsql_test(
    "tkt1473-3.5",
    [[
        SELECT EXISTS
          (SELECT 1 FROM t1 WHERE a=1 UNION SELECT 2 FROM t1 WHERE b=4)
    ]], {
        -- <tkt1473-3.5>
        true
        -- </tkt1473-3.5>
    })

test:do_execsql_test(
    "tkt1473-3.6",
    [[
        SELECT EXISTS
          (SELECT 1 FROM t1 WHERE a=0 UNION ALL SELECT 2 FROM t1 WHERE b=4)
    ]], {
        -- <tkt1473-3.6>
        true
        -- </tkt1473-3.6>
    })

test:do_execsql_test(
    "tkt1473-3.7",
    [[
        SELECT EXISTS
          (SELECT 1 FROM t1 WHERE a=0 UNION SELECT 2 FROM t1 WHERE b=4)
    ]], {
        -- <tkt1473-3.7>
        true
        -- </tkt1473-3.7>
    })

test:do_execsql_test(
    "tkt1473-3.8",
    [[
        SELECT EXISTS
          (SELECT 1 FROM t1 WHERE a=0 UNION ALL SELECT 2 FROM t1 WHERE b=0)
    ]], {
        -- <tkt1473-3.8>
        false
        -- </tkt1473-3.8>
    })

test:do_execsql_test(
    "tkt1473-3.9",
    [[
        SELECT EXISTS
          (SELECT 1 FROM t1 WHERE a=0 UNION SELECT 2 FROM t1 WHERE b=0)
    ]], {
        -- <tkt1473-3.9>
        false
        -- </tkt1473-3.9>
    })

test:do_execsql_test(
    "tkt1473-4.1",
    [[
        CREATE TABLE t2(x INT primary key,y INT);
        INSERT INTO t2 VALUES(1,2);
        INSERT INTO t2 SELECT x+2, y+2 FROM t2;
        INSERT INTO t2 SELECT x+4, y+4 FROM t2;
        INSERT INTO t2 SELECT x+8, y+8 FROM t2;
        INSERT INTO t2 SELECT x+16, y+16 FROM t2;
        INSERT INTO t2 SELECT x+32, y+32 FROM t2;
        INSERT INTO t2 SELECT x+64, y+64 FROM t2;
        SELECT COUNT(*), SUM(x), SUM(y) FROM t2;
    ]], {
        -- <tkt1473-4.1>
        64, 4096, 4160
        -- </tkt1473-4.1>
    })

test:do_execsql_test(
    "tkt1473-4.2",
    [[
        SELECT 1 FROM t2 WHERE x=0
        UNION ALL
        SELECT 2 FROM t2 WHERE x=1
        UNION ALL
        SELECT 3 FROM t2 WHERE x=2
        UNION ALL
        SELECT 4 FROM t2 WHERE x=3
        UNION ALL
        SELECT 5 FROM t2 WHERE x=4
        UNION ALL
        SELECT 6 FROM t2 WHERE y=0
        UNION ALL
        SELECT 7 FROM t2 WHERE y=1
        UNION ALL
        SELECT 8 FROM t2 WHERE y=2
        UNION ALL
        SELECT 9 FROM t2 WHERE y=3
        UNION ALL
        SELECT 10 FROM t2 WHERE y=4
    ]], {
        -- <tkt1473-4.2>
        2, 4, 8, 10
        -- </tkt1473-4.2>
    })

test:do_catchsql_test(
    "tkt1473-4.3",
    [[
        SELECT (
          SELECT 1 FROM t2 WHERE x=0
          UNION ALL
          SELECT 2 FROM t2 WHERE x=1
          UNION ALL
          SELECT 3


EIGHTH:
        currentCueBuilder.append('\u215B');
        break;
      case CHARACTER_THREE_EIGHTHS:
        currentCueBuilder.append('\u215C');
        break;
      case CHARACTER_FIVE_EIGHTHS:
        currentCueBuilder.append('\u215D');
        break;
      case CHARACTER_SEVEN_EIGHTHS:
        currentCueBuilder.append('\u215E');
        break;
      case CHARACTER_VERTICAL_BORDER:
        currentCueBuilder.append('\u2502');
        break;
      case CHARACTER_UPPER_RIGHT_BORDER:
        currentCueBuilder.append('\u2510');
        break;
      case CHARACTER_LOWER_LEFT_BORDER:
        currentCueBuilder.append('\u2514');
        break;
      case CHARACTER_HORIZONTAL_BORDER:
        currentCueBuilder.append('\u2500');
        break;
      case CHARACTER_LOWER_RIGHT_BORDER:
        currentCueBuilder.append('\u2518');
        break;
      case CHARACTER_UPPER_LEFT_BORDER:
        currentCueBuilder.append('\u250C');
        break;
      default:
        Log.w(TAG, "Invalid G2 character: " + characterCode);
        // The CEA-708 specification doesn't specify what to do in the case of an unexpected
        // value in the G2 character range, so we ignore it.
    }
  }

  private void handleG3Character(int characterCode) {
    if (characterCode == 0xA0) {
      currentCueBuilder.append('\u33C4');
    } else {
      Log.w(TAG, "Invalid G3 character: " + characterCode);
      // Substitute any unsupported G3 character with an underscore as per CEA-708 specification.
      currentCueBuilder.append('_');
    }
  }

  private void handleSetPenAttributes() {
    // the SetPenAttributes command contains 2 bytes of data
    // first byte
    int textTag = serviceBlockPacket.readBits(4);
    int offset = serviceBlockPacket.readBits(2);
    int penSize = serviceBlockPacket.readBits(2);
    // second byte
    boolean italicsToggle = serviceBlockPacket.readBit();
    boolean underlineToggle = serviceBlockPacket.readBit();
    int edgeType = serviceBlockPacket.readBits(3);
    int fontStyle = serviceBlockPacket.readBits(3);

    currentCueBuilder.setPenAttributes(textTag, offset, penSize, italicsToggle, underlineToggle,
        edgeType, fontStyle);
  }

  private void handleSetPenColor() {
    // the SetPenColor command contains 3 bytes of data
    // first byte
    int foregroundO = serviceBlockPacket.readBits(2);
    int foregroundR = serviceBlockPacket.readBits(2);
    int foregroundG = serviceBlockPacket.readBits(2);
    int foregroundB = serviceBlockPacket.readBits(2);
    int foregroundColor = CueBuilder.getArgbColorFromCeaColor(foregroundR, foregroundG, foregroundB,
        foregroundO);
    // second byte
    int backgroundO = serviceBlockPacket.readBits(2);
    int backgroundR = serviceBlockPacket.readBits(2);
    int backgroundG = serviceBlockPacket.readBits(2);
    int backgroundB = serviceBlockPacket.readBits(2);
    int backgroundColor = CueBuilder.getArgbColorFromCeaColor(backgroundR, backgroundG, backgroundB,
        backgroundO);
    // third byte
    serviceBlockPacket.skipBits(2); // null padding
    int edgeR = serviceBlockPacket.readBits(2);
    int edgeG = serviceBlockPacket.readBits(2);
    int edgeB = serviceBlockPacket.readBits(2);
    int edgeColor = CueBuilder.getArgbColorFromCeaColor(edgeR, edgeG, edgeB