置均已经配置进入 [.golangci.yaml](../.golangci.yaml) 中

并且你可以在本地使用或者手动运行：

```sh
make check
```

进行格式检查。

## 命名约定

变量/结构体命名遵循简洁，清晰的原则。言简意赅的表述其具体用途。

### 包命名

### 文件命名

对于 go 文件，文件命名**必须**使用完全小写。多个单词文件名时**建议**不分割(条件编译除外)，接受以"-"或"\_"分隔。

```txt
// 推荐
httpbackend.go
filebackend.go
ftpbackend.go
```

一个包内若包含多个文件的，**建议**将主要的文件与包名称相同。方便读者快速阅读。

```txt
backend
├── file.go
├── http.go
├── ftp.go
└── backend.go // 主文件
```

### 变量命名

- **禁止**无意义的缩写，拼音，模糊不清。
- **必须**使用 `camalCase` 风格命名.

```go
var dns string // 众所周知的缩写
var wordCount int // 表意明确
var i int // 常用于loop 变量
```

```go
var a1 int // 无意义
var count int // 不明确
var pinyin int // 拼音
var jkxl int // 不知名缩写
```

包内的变量/结构名称前/后缀**建议**不与该包名相同，若语义上相同时应当去掉前/后缀以保持简洁。

```go
package backend

// 正确
// use as: backend.File
type File struct {
    Name string
}

// 错误
// use as: backend.BackendFile, backend.Backend 重复表意
type BackendFile struct {
    FileName string // File前缀冗余
}
// 错误
// use as: backend.FileBackend，backend.Backend 重复表意
type FileBackend struct {}
```

## 准则

### 结构体 tag

对于需要被序列化/反序列化进行传递的结构：

- **必须**增加 tag。
- tag 名称**必须**使用 `lowerCamelCase` 方式进行命名。
- 对于固有缩写例如 ID,HTTP,JSON 等，若其为第一个单词则该词全部小写，否则保持原有格式。

```go
// 正确
type Foo struct {
 ID      string `json:"id,omitempty"`
 BarHTTP string `json:"barHTTP,omitempty"`
}
// 错误
type Bar struct {
 ID      string `json:"ID,omitempty"`
 BarHTTP string `json:"barHttp,omitempty"`
}
```

### 错误消息

- 错误消息封装时应当避免无意义的文字，例如 "failed to","error:" .
- 错误消息封装时应当使用 `%w` 而非 `%v`,[Working with Errors in Go 1.13](https://go.dev/blog/go1.13-errors)
- 避免使用 `github.com/pkg/errors.Wrap`

```go
// 正确
fmt.Errorf("create file:%v",err)// errors.Error() -> "process: create file: file exists"
// 错误
fmt.Errorf("failed to create:%v",err)// errors.Error() ->


is_favorited": false,
  },
  {
    "image": "https://images.unsplash.com/photo-1598928506311-c55ded91a20c?ixid=MXwxMjA3fDB8MHxzZWFyY2h8NHx8Zm9vZHxlbnwwfHwwfA%3D%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=60",
    "name": "Convertible Studio",
    "price": "\$150k",
    "location": "Phnom Penh",
    "is_favorited": false,
  },
  {
    "image": "https://images.unsplash.com/photo-1576941089067-2de3c901e126?ixid=MXwxMjA3fDB8MHxzZWFyY2h8NHx8Zm9vZHxlbnwwfHwwfA%3D%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=60",
    "name": "Double Villa",
    "price": "\$180k",
    "location": "Phnom Penh",
    "is_favorited": false,
  },
];

List categories = [
  {
    "name" : "All",
    "icon" :  FontAwesomeIcons.boxes
  },
  {
    "name" : "Villa",
    "icon" :  FontAwesomeIcons.university
  },
  {
    "name" : "Shop",
    "icon" :  FontAwesomeIcons.storeAlt
  },
  {
    "name" : "Building",
    "icon" :  FontAwesomeIcons.building
  },
  {
    "name" : "House",
    "icon" :  FontAwesomeIcons.home
  },
];

var brokers = [
    {
    "image": "https://images.unsplash.com/photo-1544005313-94ddf0286df2?ixid=MXwxMjA3fDB8MHxzZWFyY2h8MjV8fHByb2ZpbGV8ZW58MHx8MHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=60",
    "name": "John Siphron",
    "type": "Broker",
    "description": "Lorem ipsum is a placeholder text commonly used to demonstrate the visual form of a document",
    "rate": 4,
  },
  {
    "image":"https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?ixid=MXwxMjA3fDB8MHxzZWFyY2h8MTF8fHByb2ZpbGV8ZW58MHx8MHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=60",
    "name" : "Corey Aminoff",
    "type": "Broker",
    "description": "Lorem ipsum is a placeholder text commonly used to demonstrate the visual form of a document",
    "rate": 4,
  },
  {
    "image" : "https://images.unsplash.com/photo-1617069470302-9b5592c80f66?ixid=MnwxMjA3fDB8MHxzZWFyY2h8NHx8Z2lybHxlbnwwfHwwfHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=60",
    "name": "Siriya Aminoff",
    "type": "Broker",
    "description": "Lorem ipsum is a placeholder text commonly used to demonstrate the visual form of a document",
    "rate": 4,
  },
  {
    "image" : "https://images.unsplash.com/photo-1545167622-3a6ac756afa4?ixid=MXwxMjA3fDB8MHxzZWFyY2h8M


Of(e,h.prototype),e}function h(t,e,r){if("number"===typeof t){if("string"===typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return y(t)}return d(t,e,r)}function d(t,e,r){if("string"===typeof t)return function(t,e){"string"===typeof e&&""!==e||(e="utf8");if(!h.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|_(t,e),n=f(r),o=n.write(t,e);o!==r&&(n=n.slice(0,o));return n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(tt(t,Uint8Array)){var e=new Uint8Array(t);return b(e.buffer,e.byteOffset,e.byteLength)}return m(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(tt(t,ArrayBuffer)||t&&tt(t.buffer,ArrayBuffer))return b(t,e,r);if("undefined"!==typeof SharedArrayBuffer&&(tt(t,SharedArrayBuffer)||t&&tt(t.buffer,SharedArrayBuffer)))return b(t,e,r);if("number"===typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return h.from(n,e,r);var o=function(t){if(h.isBuffer(t)){var e=0|v(t.length),r=f(e);return 0===r.length||t.copy(r,0,0,e),r}if(void 0!==t.length)return"number"!==typeof t.length||et(t.length)?f(0):m(t);if("Buffer"===t.type&&Array.isArray(t.data))return m(t.data)}(t);if(o)return o;if("undefined"!==typeof Symbol&&null!=Symbol.toPrimitive&&"function"===typeof t[Symbol.toPrimitive])return h.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function g(t){if("number"!==typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function y(t){return g(t),f(t<0?0:0|v(t))}function m(t){for(var e=t.length<0?0:0|v(t.length),r=f(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}function b(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,h.prototype),n}function v(t){if(t>=


ecentlyScreen({Key? key}) : super(key: key);

  @override
  _AdminViewedRecentlyScreenState createState() =>
      _AdminViewedRecentlyScreenState();
}

class _AdminViewedRecentlyScreenState extends State<AdminViewedRecentlyScreen> {
  bool check = true;
  @override
  Widget build(BuildContext context) {
    Color color = Utils(context).color;

    // Size size = Utils(context).getScreenSize;
    final viewedMangaProvider = Provider.of<ViewedMangaProvider>(context);
    final viewedMangatemsList = viewedMangaProvider
        .getViewedMangasListItems.values
        .toList()
        .reversed
        .toList();
    if (viewedMangatemsList.isEmpty) {
      return EmptyScreen(
        title: 'Tu historial está vacío',
        subtitle: 'No hay mangas vistos!',
        buttonText: 'Ver ahora',
        imagePath: 'images/ver-la-television.png',
      );
    } else {
      return Scaffold(
        appBar: AppBar(
          centerTitle: true,
          leading: BackWidget(),
          automaticallyImplyLeading: false,
          elevation: 0,
          actions: [
            IconButton(
              onPressed: () {
                GlobalMethods.warningDialog(
                    title: 'Borrar tu historial?',
                    subtitle: '¿Estás seguro?',
                    fct: () {},
                    context: context);
              },
              icon: Icon(
                IconlyBroken.delete,
                color: color,
              ),
            )
          ],
          title: TextosWidget(
            text: 'Historial',
            color: color,
            textSize: 24.0,
          ),
          backgroundColor:
              Theme.of(context).scaffoldBackgroundColor.withOpacity(0.9),
        ),
        body: MasonryGridView.count(
          itemCount: viewedMangatemsList.length,
          crossAxisCount: 2,
          // mainAxisSpacing: 16,
          // crossAxisSpacing: 20,
          itemBuilder: (context, index) {
            return ChangeNotifierProvider.value(
                value: viewedMangatemsList[index],
                child: const ViewedRecentlyWidget());
          },
        ),
      );
    }
  }
}
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

import '../providers/dark_theme_provider.dart';

class Utils {
  BuildContext context;
  Utils(this.context);

  bool get getTheme => Provider.of<DarkThemeProvider>(context).getDarkTheme;
  Color get color => getTheme ? Colors.white : Colors.black;
  Size get getScreenSize => MediaQuery.of(context).size;
}
const defaultPadding = 10.0;
import 'package:flutter/material.dart';
import 'package:aplicacion_manga_admin_panel/inner_screens/LoginScreen.dart';
import 'package:aplicacion_manga_admin_panel/responsive.dart';
import 'package:aplicacion_manga_admin_panel/screens/dashboard_screen_admin.dart';
import 'package:aplicacion_manga_admin_panel/widgets/side_menu.dart';

class MainScreenAdmin extends StatelessWidget {
  final bool isAuthenticated;

  MainScreenAdmin({Key? key, required this.isAuthenticated}) : super(key: key) {
    print('MainScreen constructor - isAuthenticated: $isAuthenticated');
  }

  @override
  Widget build(BuildContext context) {
    print('MainScreen build - isAuthenticated: $isAuthenticated');
    return Responsive(
      mobile: Scaffold(
        //drawer: const SideMenu(),
        body: SafeArea(
          child: isAuthenticated ? DashboarScreenAdmin() : LoginScreen(),
        ),
      ),
      desktop: Scaffold(
        drawer: const SideMenu(),
        body: SafeArea(
          child: Row(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              /*Expanded(
                child: SideMenu(),
              ),*/
              Expanded(
                flex: 5,
                child: isAuthenticated ? DashboarScreenAdmin() : LoginScreen(),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
import 'package:aplicacion_manga_admin_panel/services/theme.dart';
import 'package:flutter/material


ices/preloading_service.dart';
import '../services/download_service.dart';
import '../services/windows_media_service.dart';
import '../services/youtube_fallback_service.dart';
import '../services/song_history_service.dart';

class MusicPlayerController extends ChangeNotifier {
  static final MusicPlayerController _instance = MusicPlayerController._internal();
  factory MusicPlayerController() => _instance;
  MusicPlayerController._internal() {
    print('🎵 Initializing MusicPlayerController');
  _setupAudioPlayer();
  // Background audio handler is now lazily initialized via _ensureAudioHandler()
    _initDownloadService();
    _initWindowsMediaService();

    // Make sure we get onAudioComplete callbacks
    _audioPlayer.playbackEventStream.listen((event) {
      print('🎵 Playback event: $event');
    }, onError: (Object e, StackTrace st) {
      print('❌ Error in playbackEventStream: $e');
    });
  }

  final AudioPlayer _audioPlayer = AudioPlayer();
  AudioHandler? _audioHandler;
  Future<AudioHandler?>? _audioHandlerInit; // Guards concurrent init calls

  MusicTrack? _currentTrack;
  List<MusicTrack> _queue = [];
  int _currentIndex = -1;
  bool _isPlaying = false;
  bool _isLoading = false;
  String _loadingMessage = '';
  Duration _duration = Duration.zero;
  Duration _position = Duration.zero;
  String? _errorMessage;
  Function(String)? _onAutoAdvance; // Callback for auto-advance notifications
  bool _isHandlingCompletion = false; // Flag to prevent duplicate completion handling
  String? _lastRecommendationTrackId; // Track the last track for which recommendations were loaded
  String? _pendingTrackId; // Track ID of the song that should be played next (for quick clicks)
  Timer? _windowsSmtcTimer; // Timer to periodically refresh Windows SMTC

  // Getters
  MusicTrack? get currentTrack => _currentTrack;
  List<MusicTrack> get queue => List.unmodifiable(_queue);
  int get currentIndex => _currentIndex;
  bool get hasNext => _currentIndex < _queue.length - 1;
  bool get hasPrevious => _currentIndex > 0;
  bool get isPlaying => _isPlaying;
  bool get isLoading => _isLoading;
  String get loadingMessage => _loadingMessage;
  Duration get duration => _duration;
  Duration get position => _position;
  String? get errorMessage => _errorMessage;
  bool get hasTrack => _currentTrack != null;
  bool get canControl => _currentTrack != null && !_isLoading;

  // Set a callback for auto-advance notifications
  void setAutoAdvanceCallback(Function(String)? callback) {
    _onAutoAdvance = callback;
  }

  Future<AudioHandler?> _ensureAudioHandler() async {
    // If already created, return immediately
    if (_audioHandler != null) return _audioHandler;
    // If an initialization is in-flight, await it
    if (_audioHandlerInit != null) return _audioHandlerInit;
    // Start a single initialization future
    _audioHandlerInit = _initBackgroundAudio().then((_) => _audioHandler);
    return _audioHandlerInit;
  }

  // Handle track completion, auto-advance if possible
  void _handleTrackCompletion() {
    print('🎵 Handling track completion');

    // Prevent duplicate completion handling
    if (_isHandlingCompletion) {
      print('🔄 Already handling completion, skipping duplicate call');
      return;
    }

    _isHandlingCompletion = true;
    _isPlaying = false;
    _position = Duration.zero;

    // Debug queue status before deciding what to


onList = destinationList;
        DestinationDropType = destinationDropType;
        _onDestinationObjectChanged.OnNext(Unit.Default);
    }

    public void OnDragEnd()
    {
        if (SourceObject == null || DestinationObject == null || SourceObject.Equals(DestinationObject))
        {
            ResetState();
            _onDestinationObjectChanged.OnNext(Unit.Default);
            return;
        }

        var dropData = new DropData(SourceObject, SourceList, SourceDropType, DestinationObject, DestinationList, DestinationDropType);
        ResetState();
        _onDroppedItem.OnNext(dropData);
        _onDestinationObjectChanged.OnNext(Unit.Default);
    }

    public void ResetState()
    {
        SourceObject = null;
        SourceList = null;
        SourceDropType = string.Empty;
        DestinationObject = null;
        DestinationList = null;
        DestinationDropType = string.Empty;
    }

    public void Dispose()
    {
        _onDroppedItem.Dispose();
        _onDestinationObjectChanged.Dispose();
    }

    public bool IsSourceObject(object comparisonObject)
    { return SourceObject?.Equals(comparisonObject) ?? false; }

    public bool IsDestinationObject(object comparisonObject)
    { return DestinationObject?.Equals(comparisonObject) ?? false; }
}


Name("jLabel77"); // NOI18N
        FormInput.add(jLabel77);
        jLabel77.setBounds(0, 530, 170, 23);

        jLabel81.setText("Status :");
        jLabel81.setName("jLabel81"); // NOI18N
        FormInput.add(jLabel81);
        jLabel81.setBounds(675, 530, 50, 23);

        UsiaKawin1.setFocusTraversalPolicyProvider(true);
        UsiaKawin1.setName("UsiaKawin1"); // NOI18N
        UsiaKawin1.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                UsiaKawin1KeyPressed(evt);
            }
        });
        FormInput.add(UsiaKawin1);
        UsiaKawin1.setBounds(589, 530, 60, 23);

        jLabel82.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        jLabel82.setText("pembalut");
        jLabel82.setName("jLabel82"); // NOI18N
        FormInput.add(jLabel82);
        jLabel82.setBounds(538, 450, 50, 23);

        KetSiklus2.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Tidak Ada Masalah", "Dismenorhea", "Spotting", "Menorhagia", "PMS" }));
        KetSiklus2.setName("KetSiklus2"); // NOI18N
        KetSiklus2.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                KetSiklus2KeyPressed(evt);
            }
        });
        FormInput.add(KetSiklus2);
        KetSiklus2.setBounds(679, 480, 175, 23);

        jLabel83.setText("Usia Perkawinan Ke 1 :");
        jLabel83.setName("jLabel83"); // NOI18N
        FormInput.add(jLabel83);
        jLabel83.setBounds(455, 530, 130, 23);

        jLabel84.setText("Usia Perkawinan Ke 3 :");
        jLabel84.setName("jLabel84"); // NOI18N
        FormInput.add(jLabel84);
        jLabel84.setBounds(455, 560, 130, 23);

        UsiaKawin3.setFocusTraversalPolicyProvider(true);
        UsiaKawin3.setName("UsiaKawin3"); // NOI18N
        UsiaKawin3.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                UsiaKawin3KeyPressed(evt);
            }
        });
        FormInput.add(UsiaKawin3);
        UsiaKawin3.setBounds(589, 560, 60, 23);

        jLabel85.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        jLabel85.setText("tahun,");
        jLabel85.setName("jLabel85"); // NOI18N
        FormInput.add(jLabel85);
        jLabel85.setBounds(652, 560, 45, 23);

        jLabel86.setText("Status :");
        jLabel86.setName("jLabel86"); // NOI18N
        FormInput.add(jLabel86);
        jLabel86.setBounds(675, 560, 50, 23);

        StatusKawin3.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "-", "Masih Menikah", "Cerai", "Meninggal" }));
        StatusKawin3.setName("StatusKawin3"); // NOI18N
        StatusKawin3.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.a


geProperties.IsArchived;

            IsInSitemap = pageProperties.IsInSitemap;

            LayoutId = pageProperties.Layout != null ? pageProperties.Layout.Id : (Guid?)null;
            MasterPageId = pageProperties.MasterPage != null ? pageProperties.MasterPage.Id : (Guid?)null;

            Categories = pageProperties.Categories != null ? pageProperties.Categories.Select(c => c.Id).ToList() : new List<Guid>();

            MainImageId = pageProperties.Image != null ? pageProperties.Image.Id : (Guid?)null;
            SecondaryImageId = pageProperties.SecondaryImage != null ? pageProperties.SecondaryImage.Id : (Guid?)null;
            FeaturedImageId = pageProperties.FeaturedImage != null ? pageProperties.FeaturedImage.Id : (Guid?)null;
        }

        public string PageUrl { get; private set; }
        public string PageUrlHash { get; private set; }
        public string Title { get; private set; }
        public string Description { get; set; }
        public string CustomCss { get; set; }
        public string CustomJS { get; set; }
        public string MetaTitle { get; private set; }
        public string MetaKeywords { get; set; }
        public string MetaDescription { get; set; }

        public PageStatus Status { get; private set; }
        public DateTime? PublishedOn { get; private set; }

        public bool HasSEO { get; private set; }
        public bool UseCanonicalUrl { get; private set; }
        public bool UseNoFollow { get; private set; }
        public bool UseNoIndex { get; private set; }
        public bool IsMasterPage { get; private set; }
        public bool IsArchived { get; private set; }

        public bool IsInSitemap { get; private set; }

        public Guid? LayoutId { get; private set; }
        public Guid? MasterPageId { get; private set; }
        public IList<Guid> Categories { get; private set; }
        public Guid? MainImageId { get; private set; }
        public Guid? SecondaryImageId { get; private set; }
        public Guid? FeaturedImageId { get; private set; }

        public override string ToString()
        {
            return string.Format(
                "{0}, Title: {1}, Url: {2}, Status: {3}, HasSEO: {4}, LayoutId: {5}, MasterPageId: {6}",
                base.ToString(),
                Title,
                PageUrl,
                Status,
                HasSEO,
                LayoutId,
                MasterPageId);
        }
    }
}


rom_bytes_with_nul_unchecked(b"VK_KHR_shared_presentable_image\0") })
        }
        if self.khr_external_fence {
            v.push(unsafe { CStr::from_bytes_with_nul_unchecked(b"VK_KHR_external_fence\0") })
        }
        if self.khr_external_fence_win32 {
            v.push(unsafe { CStr::from_bytes_with_nul_unchecked(b"VK_KHR_external_fence_win32\0") })
        }
        if self.khr_external_fence_fd {
            v.push(unsafe { CStr::from_bytes_with_nul_unchecked(b"VK_KHR_external_fence_fd\0") })
        }
        if self.khr_performance_query {
            v.push(unsafe { CStr::from_bytes_with_nul_unchecked(b"VK_KHR_performance_query\0") })
        }
        if self.khr_maintenance2 {
            v.push(unsafe { CStr::from_bytes_with_nul_unchecked(b"VK_KHR_maintenance2\0") })
        }
        if self.khr_variable_pointers {
            v.push(unsafe { CStr::from_bytes_with_nul_unchecked(b"VK_KHR_variable_pointers\0") })
        }
        if self.ext_external_memory_dma_buf {
            v.push(unsafe { CStr::from_bytes_with_nul_unchecked(b"VK_EXT_external_memory_dma_buf\0") })
        }
        if self.ext_queue_family_foreign {
            v.push(unsafe { CStr::from_bytes_with_nul_unchecked(b"VK_EXT_queue_family_foreign\0") })
        }
        if self.khr_dedicated_allocation {
            v.push(unsafe { CStr::from_bytes_with_nul_unchecked(b"VK_KHR_dedicated_allocation\0") })
        }
        if self.android_external_memory_android_hardware_buffer {
            v.push(unsafe {
                CStr::from_bytes_with_nul_unchecked(b"VK_ANDROID_external_memory_android_hardware_buffer\0")
            })
        }
        if self.ext_sampler_filter_minmax {
            v.push(unsafe { CStr::from_bytes_with_nul_unchecked(b"VK_EXT_sampler_filter_minmax\0") })
        }
        if self.khr_storage_buffer_storage_class {
            v.push(unsafe { CStr::from_bytes_with_nul_unchecked(b"VK_KHR_storage_buffer_storage_class\0") })
        }
        if self.amd_gpu_shader_int16 {
            v.push(unsafe { CStr::from_bytes_with_nul_unchecked(b"VK_AMD_gpu_shader_int16\0") })
        }
        if self.amd_mixed_attachment_samples {
            v.push(unsafe { CStr::from_bytes_with_nul_unchecked(b"VK_AMD_mixed_attachment_samples\0") })
        }
        if self.amd_shader_fragment_mask {
            v.push(unsafe { CStr::from_bytes_with_nul_unchecked(b"VK_AMD_shader_fragment_mask\0") })
        }
        if self.ext_inline_uniform_block {
            v.push(unsafe { CStr::from_bytes_with_nul_unchecked(b"VK_EXT_inline_uniform_block\0") })
        }
        if self.ext_shader_stencil_export {
            v.push(unsafe { CStr::from_bytes_with_nul_unchecked(b"VK_


oc_info.memoryTypeIndex = ImGui_ImplVulkan_MemoryType(VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT, req.memoryTypeBits);
    err = vkAllocateMemory(v->Device, &alloc_info, v->Allocator, &buffer_memory);
    check_vk_result(err);

    err = vkBindBufferMemory(v->Device, buffer, buffer_memory, 0);
    check_vk_result(err);
    buffer_size = buffer_size_aligned;
}

static void ImGui_ImplVulkan_SetupRenderState(ImDrawData* draw_data, VkPipeline pipeline, VkCommandBuffer command_buffer, ImGui_ImplVulkan_FrameRenderBuffers* rb, int fb_width, int fb_height)
{
    ImGui_ImplVulkan_Data* bd = ImGui_ImplVulkan_GetBackendData();

    // Bind pipeline:
    {
        vkCmdBindPipeline(command_buffer, VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline);
    }

    // Bind Vertex And Index Buffer:
    if (draw_data->TotalVtxCount > 0)
    {
        VkBuffer vertex_buffers[1] = { rb->VertexBuffer };
        VkDeviceSize vertex_offset[1] = { 0 };
        vkCmdBindVertexBuffers(command_buffer, 0, 1, vertex_buffers, vertex_offset);
        vkCmdBindIndexBuffer(command_buffer, rb->IndexBuffer, 0, sizeof(ImDrawIdx) == 2 ? VK_INDEX_TYPE_UINT16 : VK_INDEX_TYPE_UINT32);
    }

    // Setup viewport:
    {
        VkViewport viewport;
        viewport.x = 0;
        viewport.y = 0;
        viewport.width = (float)fb_width;
        viewport.height = (float)fb_height;
        viewport.minDepth = 0.0f;
        viewport.maxDepth = 1.0f;
        vkCmdSetViewport(command_buffer, 0, 1, &viewport);
    }

    // Setup scale and translation:
    // Our visible imgui space lies from draw_data->DisplayPps (top left) to draw_data->DisplayPos+data_data->DisplaySize (bottom right). DisplayPos is (0,0) for single viewport apps.
    {
        float scale[2];
        scale[0] = 2.0f / draw_data->DisplaySize.x;
        scale[1] = 2.0f / draw_data->DisplaySize.y;
        float translate[2];
        translate[0] = -1.0f - draw_data->DisplayPos.x * scale[0];
        translate[1] = -1.0f - draw_data->DisplayPos.y * scale[1];
        vkCmdPushConstants(command_buffer, bd->PipelineLayout, VK_SHADER_STAGE_VERTEX_BIT, sizeof(float) * 0, sizeof(float) * 2, scale);
        vkCmdPushConstants(command_buffer, bd->PipelineLayout, VK_SHADER_STAGE_VERTEX_BIT, sizeof(float) * 2, sizeof(float) * 2, translate);
    }
}

// Render function
void ImGui_ImplVulkan_RenderDrawData(ImDrawData* draw_data, VkCommandBuffer command_buffer, VkPipeline pipeline)
{
    // Avoid rendering when minimized, scale coordinates for retina displays (screen coordinates != framebuffer coordinates)
    int fb_width = (int)(draw_data->DisplaySize.x * draw_data->FramebufferScale.x);
    int fb_height = (int)(draw_data->DisplaySize.y * draw_data->FramebufferScale.y);
    if (fb_width <= 0 || fb_height <= 0)
        return;

    ImGui_ImplVulkan_Data* bd = ImGui_ImplVulkan_GetBackendData();
    ImGui_ImplVulkan_InitInfo* v = &bd->VulkanInitInfo;
    if (pipeline == VK_NULL_HANDLE)
        pipeline = bd->Pipeline;

    // Allocate array to store enough vertex/index buffers. Each unique viewport gets its own storage.
    ImGui_ImplVulkan


::TyI64 => ~"TyI64"
            };
            let e_ity = cx.expr_ident(sp, id_ext(s_ity));

            let e_i64 = cx.expr_lit(sp, ast::LitInt(i, ast::TyI64));

            return cx.expr_call_ident(sp,
                                      id_ext("LIT_INT"),
                                      ~[e_i64, e_ity]);
        }

        LIT_UINT(u, uty) => {
            let s_uty = match uty {
                ast::TyU => ~"TyU",
                ast::TyU8 => ~"TyU8",
                ast::TyU16 => ~"TyU16",
                ast::TyU32 => ~"TyU32",
                ast::TyU64 => ~"TyU64"
            };
            let e_uty = cx.expr_ident(sp, id_ext(s_uty));

            let e_u64 = cx.expr_lit(sp, ast::LitUint(u, ast::TyU64));

            return cx.expr_call_ident(sp,
                                      id_ext("LIT_UINT"),
                                      ~[e_u64, e_uty]);
        }

        LIT_INT_UNSUFFIXED(i) => {
            let e_i64 = cx.expr_lit(sp, ast::LitInt(i, ast::TyI64));

            return cx.expr_call_ident(sp,
                                      id_ext("LIT_INT_UNSUFFIXED"),
                                      ~[e_i64]);
        }

        LIT_FLOAT(fident, fty) => {
            let s_fty = match fty {
                ast::TyF32 => ~"TyF32",
                ast::TyF64 => ~"TyF64"
            };
            let e_fty = cx.expr_ident(sp, id_ext(s_fty));

            let e_fident = mk_ident(cx, sp, fident);

            return cx.expr_call_ident(sp,
                                      id_ext("LIT_FLOAT"),
                                      ~[e_fident, e_fty]);
        }

        LIT_STR(ident) => {
            return cx.expr_call_ident(sp,
                                      id_ext("LIT_STR"),
                                      ~[mk_ident(cx, sp, ident)]);
        }

        LIT_STR_RAW(ident, n) => {
            return cx.expr_call_ident(sp,
                                      id_ext("LIT_STR_RAW"),
                                      ~[mk_ident(cx, sp, ident),
                                        cx.expr_uint(sp, n)]);
        }

        IDENT(ident, b) => {
            return cx.expr_call_ident(sp,
                                      id_ext("IDENT"),
                                      ~[mk_ident(cx, sp, ident),
                                        cx.expr_bool(sp, b)]);
        }

        LIFETIME(ident) => {
            return cx.expr_call_ident(sp,
                                      id_ext("LIFETIME"),
                                      ~[mk_ident(cx, sp, ident)]);
        }

        DOC_COMMENT(ident) => {
            return cx.expr_call_ident(sp,
                                      id_ext("DOC_COMMENT"),
                                      ~[mk_ident(cx, sp, ident)]);
        }

        INTERPOLATED(_) => fail!("quote! with interpolated token"),

        _ => ()
    }

    let name = match *tok {
        EQ => "EQ",
        LT => "LT",
        LE => "LE",
        EQEQ => "EQEQ",
        NE => "NE",
        GE => "GE",
        GT => "GT",
        ANDAND => "ANDAND",
        OROR => "OROR",
        NOT =>


		; il nous faut revalider le nombre et la taille
			; des blocs logiques du support requis...

			bra.s	.retry
			*illegal
.out
		****
		sf	$43e.w
		****

		unlk	a6
		rts
.bad
		moveq	#E_UNDEV,d0	'unknown device'
		bra.s	.out

		********
_gsJumpTab:
		dc.w	GetScsi-_gsJumpTab
		dc.w	GetScsi-_gsJumpTab
		dc.w	GetScsi-_gsJumpTab
		dc.w	GetScsi-_gsJumpTab
		dc.w	GetScsi-_gsJumpTab
		dc.w	GetScsi-_gsJumpTab
		dc.w	GetScsi-_gsJumpTab
		dc.w	GetScsi-_gsJumpTab

		dc.w	GetIde-_gsJumpTab
		dc.w	GetIde-_gsJumpTab

		********
		TEXT
		********

		; routine gnrale d'criture de
		; secteur(s) physique(s).

		; paramtres:
		; WORD: device ID (8-15=scsi/16-17=ide)
		; LONG: numro de secteur
		; LONG: nb de secteurs (512 bytes)
		; LONG: pointeur source

		********

		rsset	8
_PS_addr		rs.l	1
_PS_count		rs.l	1
_PS_num		rs.l	1
_PS_id		rs.w	1

		********
PutSector:
		link	a6,#0

		****
		sync	$43e.w
		****
.retry
		move.w	_PS_id(a6),d0
		subq.w	#8,d0
		bmi.s	.bad

		lea	_psJumpTab(pc),a0
		add.w	(a0,d0.w*2),a0
		jsr	(a0)

		move.w	_PS_id(a6),d1
		lea	(SleepCounters-16.w,pc,d1.w*2),a0
		move.w	(SleepDelay-16.w,pc,d1.w*2),(a0)
.end
		cmp.l	#E_CHNG,d0
		beq.s	.retry
.out
		****
		sf	$43e.w
		****

		unlk	a6
		rts
.bad
		moveq	#E_UNDEV,d0	'unknown device'
		bra.s	.out

		********
_psJumpTab:
		dc.w	PutScsi-_psJumpTab
		dc.w	PutScsi-_psJumpTab
		dc.w	PutScsi-_psJumpTab
		dc.w	PutScsi-_psJumpTab
		dc.w	PutScsi-_psJumpTab
		dc.w	PutScsi-_psJumpTab
		dc.w	PutScsi-_psJumpTab
		dc.w	PutScsi-_psJumpTab

		dc.w	PutIde-_psJumpTab
		dc.w	PutIde-_psJumpTab

		********
		********

********************************************************************


local datetime = os.date("  %Y-%b-%d   %H:%M:%S", os.time())
local version = vim.version()
local version_info = ""
if version ~= nil then
  version_info = "v" .. version.major .. "." .. version.minor .. "." .. version.patch
end

local stats = require("lazy").stats()
local vinfo = "Neovim " .. version_info
local lazystats = "  loaded " .. stats.count .. " plugins "
if vim.o.filetype == "lazy" then
  vim.cmd.close()
end

local theme_switch = "Telescope colorscheme"
if settings.enable_telescope_themes then
  theme_switch = "Telescope themes"
end
local settings = {
  header = {
    type = "text",
    oldfiles_directory = false,
    align = "center",
    fold_section = false,
    title = "Header",
    margin = 5,
    content = {
      "  _                                            ",
      " | |                                           ",
      " | |  __,   __         _  _  _    __,   _  _   ",
      " |/  /  |  / / _|   | / |/ |/ |  /  |  / |/ |  ",
      " |__/\\_/|_/ /_/  \\_/|/  |  |  |_/\\_/|_/  |  |_/",
      "             /|    /|                          ",
      "             \\|    \\|                          ",
    },
    highlight = "Statement",
    default_color = "",
    oldfiles_amount = 0,
  },
  body = {
    type = "mapping",
    oldfiles_directory = false,
    align = "center",
    fold_section = false,
    title = "Lazyman Commands",
    margin = 5,
    content = {
      { " New File",          "lua require'startup'.new_file()",        "n" },
      { " Find File",         "Telescope find_files",                   "f" },
      { " Find Word",         "Telescope live_grep",                    "w" },
      { " Recent Files",      "Te


42\u4eba\u7269\u800c\u4e14\u5bf9\u5de5\u4eba\u5bf9\u5b66\u751f\u5747\u987b\u7279\u522b\u6ce8\u610f\u56e0\u4e3a\u5728\u5206\u6563\u7684\u5de5\u4eba\u53ca\u6587\u5316\u7cfb\u7edf\u4e2d\u53cd\u9769\u547d\u5206\u5b50\u9690\u85cf\u8f83\u591a\u800c\u5b66\u751f\u7684\u7236\u5144\u662f\u53cd\u9769\u547d\u5206\u5b50\u88ab\u5904\u51b3\u8005\u5176\u6570\u5b57\u4ea6\u4e0d\u5c11\u636e\u5ddd\u5927\u7edf\u8ba12000\u4f59\u5b66\u751f\u6709\u4e00\u767e\u4e94\u516d\u5341\u4e2a\u5b66\u751f\u7684\u7236\u5144\u88ab\u6740\u60c5\u7eea\u4e0d\u5b89\u4e14\u5f71\u54cd\u4ed6\u4eba\u6545\u5c24\u987b\u8fdb\u884c\u5ba3\u4f20\u6559\u80b2\u6211\u4eec\u5728\u4eba\u4ee3\u4f1a\u540e\u7d27\u63a5\u7740\u5206\u522b\u53ec\u5f00\u5de5\u4eba\u9752\u5e74\u4ee3\u8868\u4f1a\u505a\u4e13\u95e8\u7684\u5ba3\u4f20\u5de5\u4f5c\u4ee5\u4e0a\u6570\u70b9\u5747\u5728\u4eba\u4ee3\u4f1a\u540e\u53ec\u5f00\u5404\u53bf\u59d4\u4e66\u8bb0\u4f1a\u8bae\u4e0a\u5ba3\u4f20\u5e03\u7f6e\u6267\u884c\u3002", "type": "paragraph"}, {"text": "\u00a0\u674e\u4e95\u6cc94\u670821\u65e5", "type": "paragraph"}]}
  </script>

    [返回索引页面]

   关于镇反的步骤和方法的报告及西南局的电示

   日期：1951-4-27 作者：[待确定]

    西南局4月27日电，井泉同志及川西区党委并告各地报中央：

   21日电悉，你们提出的镇反步骤和注意事项都是对的，特别是宣传工作要抓紧指导、


/*
 * This is the source code of Telegram for iOS v. 1.1
 * It is licensed under GNU GPL v. 2 or later.
 * You should have received a copy of the license in this archive (see LICENSE).
 *
 * Copyright Peter Iakovlev, 2013.
 */

#import <UIKit/UIKit.h>

@protocol TGLegacyCameraControllerDelegate <NSObject>

@optional

- (void)legacyCameraControllerCapturedVideoWithTempFilePath:(NSString *)tempVideoFilePath fileSize:(int32_t)fileSize previewImage:(UIImage *)previewImage duration:(NSTimeInterval)duration dimensions:(CGSize)dimenstions assetUrl:(NSString *)assetUrl;
- (void)legacyCameraControllerCompletedWithExistingMedia:(id)media;
- (void)legacyCameraControllerCompletedWithNoResult;
- (void)legacyCameraControllerCompletedWithDocument:(NSURL *)fileUrl fileName:(NSString *)fileName mimeType:(NSString *)mimeType;

@end

@interface TGLegacyCameraController : UIImagePickerController

@property (nonatomic, weak) id<TGLegacyCameraControllerDelegate> completionDelegate;
@property (nonatomic) bool storeCapturedAssets;
@property (nonatomic) bool isInDocumentMode;
@property (nonatomic) bool avatarMode;

@end


verflow_mid_generate() {
        let mut message_ids = HashSet::new();
        let mut aid_generator = AIDGenerator::new();
        let mut mid_generator = aid_generator.generate();

        // Track all message ids in the first block
        for _ in 0..(super::MESSAGE_ID_PREALLOC_LEN) {
            let message_id = mid_generator.generate().message_id();

            assert!(!message_ids.contains(&message_id));

            message_ids.insert(message_id);
        }

        // Modify private variables to overflow back to first block
        mid_generator.next_alloc = super::MAX_MESSAGE_ID;
        mid_generator.curr_index = super::MESSAGE_ID_PREALLOC_LEN;

        // Check all message ids in the block (should be first block)
        for _ in 0..(super::MESSAGE_ID_PREALLOC_LEN) {
            let message_id = mid_generator.generate().message_id();

            assert!(message_ids.remove(&message_id));
        }

        assert!(message_ids.is_empty());
    }

    #[test]
    fn positive_overflow_tid_generate() {
        let mut transaction_ids = HashSet::new();
        let mut aid_generator = AIDGenerator::new();

        // Track all transaction ids in the first block
        for _ in 0..(super::ACTION_ID_PREALLOC_LEN) {
            let mut mid_generator = aid_generator.generate();

            for _ in 0..(super::MESSAGE_ID_PREALLOC_LEN) {
                let transaction_id = mid_generator.generate();

                assert!(!transaction_ids.contains(&transaction_id));

                transaction_ids.insert(transaction_id);
            }
        }

        // Modify private variables to overflow back to first block
        aid_generator.next_alloc = super::MAX_ACTION_ID;
        aid_generator.curr_index = super::ACTION_ID_PREALLOC_LEN;

        // Check all transaction ids in the block (should be first block)
        for _ in 0..(super::ACTION_ID_PREALLOC_LEN) {
            let mut mid_generator = aid_generator.generate();

            for _ in 0..(super::MESSAGE_ID_PREALLOC_LEN) {
                let transaction_id = mid_generator.generate();

                assert!(transaction_ids.remove(&transaction_id));
            }
        }

        assert!(transaction_ids.is_empty());
    }
}
#![feature(append)]
#[macro_use] extern crate libeuler;

use libeuler::traits::DigitsHelper;
use std::collections::HashSet;

/// Take the number 192 and multiply it by each of 1, 2, and 3:
///
///     192 × 1 = 192
///     192 × 2 = 384
///     192 × 3 = 576
///
/// By concatenating each product we get the 1 to 9 pandigital, 192384576. We will call 192384576
/// the concatenated product of 192 and (1,2,3)
///
/// The same can be achieved by starting with 9 and multiplying by 1, 2, 3, 4, and 5,
/// giving the pandigital, 918273645, which is the concatenated product of 9 and
/// (1,2,3,4,5).
///
/// What is the largest 1 to 9 pandigital 9-digit number that can be formed as the concatenated
/// product of an integer with (1,2, ... , n) where n > 1?
fn main() {
    solutions! {
        sol naive {
            let mut max = 0;
            for i in 0..10_000 {
                let v = get_pandigital_concat(i).unwrap_or(0);
                if v > max {
                    max = v;
                }
            }

            max
        }
    }
}

fn get_pandigital_concat(num: i64) -> Option<i64> {
    if num <= 0 { return None }

    let mut i = 0;
    let mut udigits = HashSet::new();
    let mut adigits = Vec::new();

    while udigits.len() == adigits.len() && adigits.len


notifyJobInfo.hasSuccessInternalFlg()) {
				info.setSuccessInternalFlg(notifyJobInfo.getSuccessInternalFlg());
			}
			if (notifyJobInfo.hasFailureInternalFlg()) {
				info.setFailureInternalFlg(notifyJobInfo.getFailureInternalFlg());
			}
			info.setJoblinkSendSettingId(notifyJobInfo.getJoblinkSendSettingId());

		}

		return info;
	}
	/**
	 * 通知詳細情報(環境構築)の情報をXMLからDTOのBeanに変換する。
	 *
	 * @param notifyID 通知ID
	 * @param notifyInfraInfo 環境構築通知定義 XML Bean
	 * @return ジョブ通知定義 Hinemos Bean(DTO)
	 * @throws HinemosUnknown
	 * @throws InvalidSetting
	 */
	private static InfraNotifyDetailInfoResponse convXml2DtoInfra(com.clustercontrol.utility.settings.platform.xml.NotifyInfraInfo notifyInfraInfo) throws InvalidSetting, HinemosUnknown {
		//具象クラスとして、
		InfraNotifyDetailInfoResponse info = new InfraNotifyDetailInfoResponse();

		info.setInfoValidFlg(notifyInfraInfo.getInfoValidFlg());
		info.setWarnValidFlg(notifyInfraInfo.getWarnValidFlg());
		info.setCriticalValidFlg(notifyInfraInfo.getCriticalValidFlg());
		info.setUnknownValidFlg(notifyInfraInfo.getUnknownValidFlg());

		info.setInfoInfraId(notifyInfraInfo.getInfoInfraId());
		info.setWarnInfraId(notifyInfraInfo.getWarnInfraId());
		info.setCriticalInfraId(notifyInfraInfo.getCriticalInfraId());
		info.setUnknownInfraId(notifyInfraInfo.getUnknownInfraId());

		InfoInfraFailurePriorityEnum infoInfraFailurePriorityEnum =
				OpenApiEnumConverter.integerToEnum(notifyInfraInfo.getInfoInfraFailurePriority(),InfoInfraFailurePriorityEnum.class);
		info.setInfoInfraFailurePriority(infoInfraFailurePriorityEnum);

		WarnInfraFailurePriorityEnum warnInfraFailurePriorityEnum =
				OpenApiEnumConverter.integerToEnum(notifyInfraInfo.getWarnInfraFailurePriority(),WarnInfraFailurePriorityEnum.class);
		info.setWarnInfraFailurePriority(warnInfraFailurePriorityEnum);

		CriticalInfraFailurePriorityEnum criticalInfraFailurePriority =
				OpenApiEnumConverter.integerToEnum(notifyInfraInfo.getCriticalInfraFailurePriority(),CriticalInfraFailurePriorityEnum.class);
		info.setCriticalInfraFailurePriority(criticalInfraFailurePriority);

		UnknownInfraFailurePriorityEnum unknownInfraFailurePriorityEnum =
				OpenApiEnumConverter.integerToEnum(notifyInfraInfo.getUnknownInfraFailurePriority(),UnknownInfraFailurePriorityEnum.class);
		info.setUnknownInfraFailurePriority(unknownInfraFailurePriorityEnum);

		InfraExecFacilityFlgEnum infraExecFacilityFlgEnum =
				OpenApiEnumConverter.integerToEnum(notifyInfraInfo.getInfraExecFacilityFlg(),InfraExecFacilityFlgEnum.class);
		info.setInfraExecFacilityFlg(infraExecFacilityFlgEnum);

		// 環境構築通知でのジョブ実行対象を、「イベントが発生したノード」に設定している場合、
		// 実行対象のファシリティIDをnullにセットする
		if (info.getInfraExecFacilityFlg() == InfraExecFacilityFlgEnum.GENERATION) {
			info.setInfraExecFacilityId(null);
		} else {
			info.setInfraExecFacilityId(notifyInfraInfo.getInfraExecFacility());
		}

		info.setInfraExecScope(notifyInfraInfo.getInfraExecScope());

		return info;
	}

	/**
	 * 通知詳細情報(ログエスカレート)の情報をXMLからDTOのBeanに変換する。
	 *
	 * @param notifyID 通知ID
	 * @param notifyLogInfo


, '10': 'key'},
    const {'1': 'value', '3': 2, '4': 1, '5': 3, '10': 'value'},
  ],
  '7': const {'7': true},
};

@$core.Deprecated('Use testMapLiteDescriptor instead')
const TestMapLite_MapUint32Uint32Entry$json = const {
  '1': 'MapUint32Uint32Entry',
  '2': const [
    const {'1': 'key', '3': 1, '4': 1, '5': 13, '10': 'key'},
    const {'1': 'value', '3': 2, '4': 1, '5': 13, '10': 'value'},
  ],
  '7': const {'7': true},
};

@$core.Deprecated('Use testMapLiteDescriptor instead')
const TestMapLite_MapUint64Uint64Entry$json = const {
  '1': 'MapUint64Uint64Entry',
  '2': const [
    const {'1': 'key', '3': 1, '4': 1, '5': 4, '10': 'key'},
    const {'1': 'value', '3': 2, '4': 1, '5': 4, '10': 'value'},
  ],
  '7': const {'7': true},
};

@$core.Deprecated('Use testMapLiteDescriptor instead')
const TestMapLite_MapSint32Sint32Entry$json = const {
  '1': 'MapSint32Sint32Entry',
  '2': const [
    const {'1': 'key', '3': 1, '4': 1, '5': 17, '10': 'key'},
    const {'1': 'value', '3': 2, '4': 1, '5': 17, '10': 'value'},
  ],
  '7': const {'7': true},
};

@$core.Deprecated('Use testMapLiteDescriptor instead')
const TestMapLite_MapSint64Sint64Entry$json = const {
  '1': 'MapSint64Sint64Entry',
  '2': const [
    const {'1': 'key', '3': 1, '4': 1, '5': 18, '10': 'key'},
    const {'1': 'value', '3': 2, '4': 1, '5': 18, '10': 'value'},
  ],
  '7': const {'7': true},
};

@$core.Deprecated('Use testMapLiteDescriptor instead')
const TestMapLite_MapFixed32Fixed32Entry$json = const {
  '1': 'MapFixed32Fixed32Entry',
  '2': const [
    const {'1': 'key', '3': 1, '4': 1, '5': 7, '10': 'key'},
    const {'1': 'value', '3': 2, '4': 1, '5': 7, '10': 'value'},
  ],
  '7': const {'7': true},
};

@$core.Deprecated('Use testMapLiteDescriptor instead')
const TestMapLite_MapFixed64Fixed64Entry$json = const {
  '1': 'MapFixed64Fixed64Entry',
  '2': const [
    const {'1': 'key', '3': 1, '4': 1, '5': 6, '10': 'key'},
    const {'1': 'value', '3': 2, '4': 1, '5': 6, '10': 'value'},
  ],
  '7': const {'7': true},
};

@$core.Deprecated('Use testMapLiteDescriptor instead')
const TestMapLite_MapSfixed32Sfixed32Entry$json = const {
  '1': 'MapSfixed32Sfixed32Entry',
  '2': const [
    const {'1': 'key', '3': 1, '4': 1, '5': 15, '10': 'key'},
    const {'1': 'value', '3': 2, '4': 1, '5': 15, '10': 'value'},
  ],
  '7': const {'7': true},
};

@$core.Deprecated('Use testMapLiteDescriptor instead')
const TestMapLite_MapSfixed64Sfixed64Ent


from typing import Tuple, List, Iterable
from numbers import Number
import copy

type State = Tuple[List, int, int]
type StepCost = Number

def initial_state() -> State:
    return ([[7, 2, 4], [5, 0, 6], [8, 3, 1]], 1, 1)

def is_goal(s: State) -> bool:
    return s[0] == [[1, 2, 3], [4, 5, 6], [7, 8, 0]]

def successors(s: State) -> Iterable[Tuple[State, StepCost]]:
    _, r, c = s
    for new_r, new_c in [(r-1, c), (r+1, c), (r, c-1), (r, c+1)]:
        if is_valid(new_r, new_c):
            yield move_blank(s, new_r, new_c), 1

def is_valid(r: int, c: int) -> bool:
    return 0 <= r <= 2 and 0 <= c <= 2

def move_blank(s: State, new_r: int, new_c: int) -> State:
    board, r, c = s
    new_board = copy.deepcopy(board)
    new_board[r][c] = new_board[new_r][new_c]
    new_board[new_r][new_c] = 0
    return (new_board, new_r, new_c)


= true

    --handle preset
    if (preset and type(preset) == "table") then
        frame.options.horizontal_border_size_offset = preset.horizontal_border_size_offset
        frame.options.titlebar_height = preset.titlebar_height
        applyPreset(frame, preset)
    else
        applyPreset(frame, defaultPreset)
        preset = defaultPreset
    end

    if (preset.tab_side) then
        if (preset.tab_side == "top") then
            --hide the bottom textures of the rounded corner, the top and middle textures will be used to fill the tab
            frame.BottomHorizontalEdge:Hide()
            frame.BottomLeft:Hide()
            frame.BottomRight:Hide()

            local point1, relativeTo, point2, x, y = frame.CornerTextures["TopLeft"]:GetPoint(1)
            frame.CornerTextures["TopLeft"]:SetPoint(point1, relativeTo, point2, x, math.abs(preset.roundness -16))

            point1, relativeTo, point2, x, y = frame.CornerTextures["TopRight"]:GetPoint(1)
            frame.CornerTextures["TopRight"]:SetPoint(point1, relativeTo, point2, x, math.abs(preset.roundness -16))

            if (frame.BorderCornerTextures["TopLeft"]) then
                point1, relativeTo, point2, x, y = frame.BorderCornerTextures["TopLeft"]:GetPoint(1)
                frame.BorderCornerTextures["TopLeft"]:SetPoint(point1, relativeTo, point2, x, math.abs(preset.roundness -16))

                point1, relativeTo, point2, x, y = frame.BorderCornerTextures["TopRight"]:GetPoint(1)
                frame.BorderCornerTextures["TopRight"]:SetPoint(point1, relativeTo, point2, x, math.abs(preset.roundness -16))

                point1, relativeTo, point2, x, y = frame.TopEdgeBorder:GetPoint(1)
                frame.TopEdgeBorder:SetPoint(point1, relativeTo, point2, x, math.abs(preset.roundness -16))

                frame.BottomEdgeBorder:Hide()

                frame.t


nline UBool isValidTrail(int32_t prev, uint8_t t, int32_t i, int32_t length) {
        // The first trail byte after a 3- or 4-byte lead byte
        // needs to be validated together with its lead byte.
        if (length <= 2 || i > 1) {
            return U8_IS_TRAIL(t);
        } else if (length == 3) {
            return U8_IS_VALID_LEAD3_AND_T1(prev, t);
        } else {  // length == 4
            return U8_IS_VALID_LEAD4_AND_T1(prev, t);
        }
    }
};

U_NAMESPACE_END

#endif  // __cplusplus

#endif


0, 0x00, 0xff, 0xff, 0xff, 0xff]);
     *
     * console.log(buf.readBigUInt64LE(0));
     * // Prints: 18446744069414584320n
     * ```
     * @since v12.0.0, v10.20.0
     * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`.
     */
    fun readBigUInt64LE(offset: Number = definedExternally): js.core.BigInt

    /**
     * @alias Buffer.readBigUInt64LE
     * @since v14.10.0, v12.19.0
     */
    fun readBigUint64LE(offset: Number = definedExternally): js.core.BigInt

    /**
     * Reads a signed, big-endian 64-bit integer from `buf` at the specified `offset`.
     *
     * Integers read from a `Buffer` are interpreted as two's complement signed
     * values.
     * @since v12.0.0, v10.20.0
     * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`.
     */
    fun readBigInt64BE(offset: Number = definedExternally): js.core.BigInt

    /**
     * Reads a signed, little-endian 64-bit integer from `buf` at the specified`offset`.
     *
     * Integers read from a `Buffer` are interpreted as two's complement signed
     * values.
     * @since v12.0.0, v10.20.0
     * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`.
     */
    fun readBigInt64LE(offset: Number = definedExternally): js.core.BigInt

    /**
     * Reads `byteLength` number of bytes from `buf` at the specified `offset` and interprets the result as an unsigned, little-endian integer supporting
     * up to 48 bits of accuracy.
     *
     * This function is also available under the `readUintLE` alias.
     *
     * ```js
     * import { Buffer } from 'node:buffer';
     *
     * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
     *
     * console.log(buf.readUIntLE(0, 6).toString(16));
     * // Prints: ab9078563412
     * ```
     * @since v0.11.15
     * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`.
     * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`.
     */
    fun readUIntLE(
        offset: Number,
        byteLength: Number,
    ): Double

    /**
     * @alias Buffer.readUIntLE
     * @since v14.9.0, v12.19.0
     */
    fun readUintLE(
        offset: Number,
        byteLength: Number,
    ): Double

    /**
     * Reads `byteLength` number of bytes from `buf` at the specified `offset` and interprets the result as an unsigned big-endian integer supporting
     * up to 48 bits of accuracy.
     *
     * This function is also available under the `readUintBE` alias.
     *
     * ```js
     * import { Buffer } from 'node:buffer';
     *
     * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
     *
     * console.log(buf.readUIntBE(0, 6).toString(16));
     * // Prints: 1234567890ab
     * console.log(buf.readUIntBE(1, 6).toString(16));
     * // Throws ERR_OUT_OF_RANGE.
     * ```
     * @since v0.11.15
     * @param offset Number of bytes to skip before starting to read. Must


files/3363295)

JourneyMap 1.16.5-5.7.2beta14 for Minecraft 1.16.5

Requirements:

* Java 8
* Minecraft 1.16.5
* Forge 1.16.5-36.1.32

General Information:

* See [http://journeymap.info/](http://journeymap.info/) for information about how to install and use this mod, rules about inclusion in modpacks, translation, etc.
* See [http://journeymap.info/Support](http://journeymap.info/Support) for information on getting technical support.
* Implements [JourneyMap API v1.16.5-1.7-SNAPSHOT](https://github.com/TeamJM/journeymap-api)

CHANGELOG (2021-06-24-10:02:31):

New in 1.16.5-5.7.2beta14

Beta 14

* Added: Waypoint Manager option to open in current dim -> enable in waypoint options.
* Changed: Webmap settings are synced with Fullscreen settings.
* Fixed: Waypoint Manager margins changing when cycling through dims.

Betas 1-13

* Added: Mouse over fullscreen map in multiplayer worlds now has biome and region. (Server Admins can disable)
* Added: Custom minimap location, in minimap options, enable preview, set to custom location then press CTRL and drag or arrow keys.
* Added: When minimap in default(top-right) effect icons are now moved to the left of the minimap.
* Added: Scaling slider for Icon and Dot sizing.
* Added: Ability to hide OP users when Expanded Radar is enabled.
* Added: Fullscreen map option to disable player position and block position of the mouse pointer.
* Added: Client option under Advanced to hide spectators.
* Added: Server option to hide spectators when expanded radar is enabled(overrides client setting).
* Added: Time Context to Game Time Real.
* Changed: Font Scale and Waypoint label Font Scale are now separate.
* Changed: Font scaling is now a float instead of an integer to allow for fine tuning of scales.
* Changed: Server Admin screen revamp to match Journeymap's Options screen.
* Changed: Version naming for better user visibility and comparing on the server.
* Changed: Waypoint command set OP level 2 so command blocks can use it.
* Changed: Return display is now a stack, should provide smoother transitions between screens.
* Changed: ProjectVibrantJourney's ground decor no longer clutters the map.
* Changed: Setting Journeymap's surface or cave render distance to 0, uses minecraft's render distance setting.
* Removed: Icon and Dot size selections.
* Updated: Migrated to Mojang Maps
* Fixed: Migration of Minecraft dim id change handled. Your old world data will load correctly now.
* Fixed: Option Category tooltips.
* Fixed: Minimap throwing errors when the game get minimized is certain situations.
* Fixed: Several state handling issues when switching between single and multiplayer.
* Fixed: Hotkeys can conflict with other gui screens.
* Fixed: Color Palette does not reset if set to permanent, resetting it just adds new blocks.
* Fixed: Rescaling the minimap would sometimes cause the cross-hair to deform.
* Fixed: API not working correctly due to 1.16.5 port.
* Fixed: Disabling animals on radar also disables players.
* Fixed: Waypoint Teleport issues for mod dims
* Fixed: Realms server naming. Realms server data will n


*/
    saturationShadows: number;

    /**
     * Color curve saturationMidtones value
     */
    saturationMidtones: number;

    /**
     * Color curve saturationHighlights value
     */
    saturationHighlights: number;

    /**
     * Color curve exposureGlobal value
     */
    exposureGlobal: number;

    /**
     * Color curve exposureShadows value
     */
    exposureShadows: number;

    /**
     * Color curve exposureMidtones value
     */
    exposureMidtones: number;

    /**
     * Color curve exposureHighlights value
     */
    exposureHighlights: number;
}
import {Component, OnInit} from '@angular/core';

@Component({
  selector: 'app-support',
  templateUrl: './support.component.html',
  styleUrls: ['./support.component.scss']
})
export class SupportComponent implements OnInit {

  constructor() { }

  ngOnInit(): void {
  }

  /**
   * obsługuje zmianę kierunku strzałki przy pytaniu
   * @param event zdarzenie kliknięcia
   */
  toggleQuestionArrow(event: Event): void {
    let clickedElement: Element = (event.target as Element);

    if (clickedElement.classList.contains('fa-arrow-up')) {
      this.resetOtherArrowsDirectionToUp(clickedElement.id);
      this.toggleArrowIcon(clickedElement.id);
    } else {

      const children: Element[] = Array.from(clickedElement.children);
      children.forEach(child => {
        if (child.classList.contains('fa-arrow-up')) {
          this.resetOtherArrowsDirectionToUp(child.id);
          this.toggleArrowIcon(child.id);
        }
      });
    }
  }

  /**
   * @description funckja odpowiada za ustawienie kierunku strzałek do góry oprócz ikony
   * z podanym id jako argument wejściowy
   * @param arrowIdToOmit id ikony, która ma być pominęta w zmianie kierunku
   */
  resetOtherArrowsDirectionToUp(arrowIdToOmit: string): void {
    const foundIcons: Element[] = Array.from(document.getElementsByClassName('fa-arrow-up'));
    if (foundIcons && foundIcons.length > 0) {
      foundIcons.filter( icon => icon.id !== arrowIdToOmit ).forEach(foundIcon => {
        const iconId = foundIcon.id;
        this.changeArrowIconDirection(iconId, true);
      });
    }
  }

  /**
   * odpowiada za zmianę kierunku ikony strzałki rzy pytaniu
   * @param elementId id ikony
   */
  toggleArrowIcon(elementId: string): void {
    const arrowIcon: HTMLElement = document.getElementById(elementId);

    if (arrowIcon) {
      if (arrowIcon.classList.contains('rotate-question-arrow-show')){
        this.changeArrowIconDirection(arrowIcon.id, true);
      } else {
        this.changeArrowIconDirection(arrowIcon.id, false);
      }
    }
  }

  changeArrowIconDirection(elementId: string, directToUp: boolean) {
    const element: HTMLElement = document.getElementById(elementId);
    if (element) {
      if (directToUp) {
        element.classList.remove('rotate-question-arrow-show');
        element.classList.add('rotate-question-arrow-hide');
      } else {
        element.classList.remove('rotate-question-arrow-hide');
        element.classList.add('rotate-question-arrow-show');
      }
    }
  }
}
import { calculateBmi } from "./bmiCalculator";


 String _isUrlRegEx =
    r"^((((H|h)(T|t)|(F|f))(T|t)(P|p)((S|s)?))\://)?(www.|[a-zA-Z0-9].)[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,6}(\:[0-9]{1,5})*(/($|[a-zA-Z0-9\.\,\;\?\'\\\+&%\$#\=~_\-]+))*$";
part of 'gcwizard_scipt_test.dart';

// ignore: unused_element
List<Map<String, Object?>> _inputsStringToExpected = [
  {'code' : 'print STR(10)', 'expectedOutput' : '10'},
  {'code' : 'print VAL(10)', 'expectedOutput' : '10', },
  {'code' : 'print VAL("10")', 'expectedOutput' : '10.0'},
  {'code' : 'print LEN(10)', 'expectedOutput' : '0', 'error': 'gcwizard_script_syntax_error'},
  {'code' : 'print LEN("10")', 'expectedOutput' : '2'},
  {'code' : 'print CHAR(10)', 'expectedOutput' : ''},
  {'code' : 'print ASC(10)', 'expectedOutput' : '-1', 'error': 'gcwizard_script_syntax_error'},
  {'code' : 'print ASC("A")', 'expectedOutput' : '65'},
  {'code' : 'print ASC(A)', 'expectedOutput' : '-1', 'error': 'gcwizard_script_syntax_error'},
  {'code' : 'print LEFT(10)', 'expectedOutput' : '', 'error': 'gcwizard_script_syntax_error'},
  {'code' : 'print RIGHT(10)', 'expectedOutput' : '', 'error': 'gcwizard_script_syntax_error'},
  {'code' : 'print MID(10)', 'expectedOutput' : '', 'error': 'gcwizard_script_syntax_error'},
  {'code' : 'print MID(10, 5)', 'expectedOutput' : '', 'error': 'gcwizard_script_syntax_error'},
  {'code' : 'print MID("MIDTEST", 4, 4)', 'expectedOutput' : 'TEST'},
  {'code' : 'print SUBST("MIDTEST", "E", "OA", 0)', 'expectedOutput' : 'MIDTOAST'},
  {'code' : 'print PADLEFT("PADTEST-L", "-", 12)', 'expectedOutput' : '---PADTEST-L'},
  {'code' : 'print PADRIGHT("PADTEST-R", "-", 12)', 'expectedOutput' : 'PADTEST-R---'},
  {'code' : 'print PADCENTER("PADTEST-C", "-", 12)', 'expectedOutput' : '--PADTEST-C-'},

];part of 'gcwizard_scipt_test.dart';

String _convertTo_3 = '''SETLAT(52.345678)
SETLON(13.456789)
PRINT CONVERTTO(3)''';

String _convertTo_11 = '''SETLAT(52.345678)
SETLON(13.456789)
PRINT CONVERTTO(11)''';

String _convertFrom_3 = '''DIM C
LISTADD(C, 33)
LISTADD(C, "U")
LISTADD(C, 394878.89897400007)
LISTADD(C, 5800607.559253929)
CONVERTFROM(3, C)
PRINT GETLAT()
PRINT GETLON()''';

String _convertFrom_11 = '''DIM C
LISTADD(C, "JO62RI42TX51MB52")
CONVERTFROM(11, C)
PRINT GETLAT()
PRINT GETLON()''';

// ignore: unused_element
List<Map<String, Object?>> _inputsCoordinatesToExpected = [

  {'code' : 'print BEARING(x, 13.678, 52.123, 11.534)', 'expectedOutput' : '358.3236011961208'},
  {'code' : 'print BEARING(54.123, 52.123, 11.534)', 'expectedOutput' : '', 'error': 'gcwizard_script_syntax_error'},


sert.equal(
        "testReviewer4",
        reviewersForGo.assignNextReviewer([
          "testReviewer1",
          "testReviewer2",
          "testReviewer3",
          "testReviewer4",
        ])
      );
      assert.equal(
        "testReviewer2",
        reviewersForGo.assignNextReviewer([
          "testReviewer1",
          "testReviewer2",
          "testReviewer3",
          "testReviewer4",
        ])
      );
      assert.equal(
        "testReviewer3",
        reviewersForGo.assignNextReviewer([
          "testReviewer1",
          "testReviewer2",
          "testReviewer3",
          "testReviewer4",
        ])
      );
      assert.equal(
        "testReviewer1",
        reviewersForGo.assignNextReviewer([
          "testReviewer1",
          "testReviewer2",
          "testReviewer3",
          "testReviewer4",
        ])
      );
    });

    it("should assign a reviewer who hasnt reviewed before", function () {
      const dateOfLastReviewAssignment = {
        testReviewer1: 1,
        testReviewer2: 2,
        testReviewer3: 3,
        testReviewer4: 4,
      };
      let reviewersForGo = new ReviewersForLabel("Go", {
        dateOfLastReviewAssignment: dateOfLastReviewAssignment,
      });

      assert.equal(
        "testReviewer5",
        reviewersForGo.assignNextReviewer([
          "testReviewer1",
          "testReviewer2",
          "testReviewer3",
          "testReviewer4",
          "testReviewer5",
        ])
      );
    });

    it("should only assign reviewers in the availableReviewers list", function () {
      const dateOfLastReviewAssignment = {
        testReviewer1: 1,
        testReviewer2: 2,
        testReviewer3: 3,
        testReviewer4: 4,
      };
      let reviewersForGo = new ReviewersForLabel("Go", {
        dateOfLastReviewAssignment: dateOfLastReviewAssignment,
      });

      assert.equal(
        "testReviewer2",
        reviewersForGo.assignNextReviewer(["testReviewer4", "testReviewer2"])
      );
    });

    it("should throw if no reviewer available", function () {
      const dateOfLastReviewAssignment = {
        testReviewer1: 1,
        testReviewer2: 2,
        testReviewer3: 3,
        testReviewer4: 4,
      };
      let reviewersForGo = new ReviewersForLabel("Go", {
        dateOfLastReviewAssignment: dateOfLastReviewAssignment,
      });

      assert.throws(() => reviewersForGo.assignNextReviewer([]));
    });
  });
});
import { Request } from "express";
import { Dbs } from "../db";

let lastTick: number = 0;
let lastHotCalcTick: number = Date.now() / 1000;
const hits: string[] = [];
const saveGap = 30; // 正式上线，应该是10*60，十分钟

export async function ipHit(req: Request, post: number | string) {
    try {
        let ip


buttons-1-XhYDHM .flag-1kqFt7GH,.withAction-1y86Ymm9 .buttons-1-XhYDHM .button-22Ex8G2W{display:flex;opacity:1}.series-12hzsxbp.disabled-3P6bUcMx .flag-1kqFt7GH .buttonIcon-2lrp9MHZ{visibility:hidden}.selected-2qw9PFUJ.series-12hzsxbp.disabled-3P6bUcMx .flag-1kqFt7GH .buttonIcon-2lrp9MHZ,.series-12hzsxbp.disabled-3P6bUcMx.flagged-3lOrkL__ .flag-1kqFt7GH .buttonIcon-2lrp9MHZ,.withAction-1y86Ymm9.series-12hzsxbp.disabled-3P6bUcMx .flag-1kqFt7GH .buttonIcon-2lrp9MHZ{visibility:visible}.sourcesWrapper-2JcXD9TK{display:flex;position:relative;margin:0 8px;align-items:flex-start;min-height:26px}.newCollapser-1F6pNRDi .sourcesWrapper-2JcXD9TK{flex-direction:column-reverse;margin:0 4px;min-height:auto}.sources-6Hp4M7li{display:flex;flex-direction:column;flex:1 1 auto;width:100%}.toggler-_SUZ7r_5{display:flex;position:relative;margin:2px 2px 0 0;flex:0 0 auto;align-items:center}@media (any-hover:hover),(min--moz-device-pixel-ratio:0){.toggler-_SUZ7r_5:hover:after{z-index:0}}@media (any-hover:hover),(min--moz-device-pixel-ratio:0){.toggler-_SUZ7r_5:hover .counter-1hG1zy7A,.toggler-_SUZ7r_5:hover .iconArrow-3q7vxxnz,.toggler-_SUZ7r_5:hover .objectTree-2tLil0dm{color:#000}}.toggler-_SUZ7r_5 .counter-1hG1zy7A{display:none;padding-right:6px;font-size:13px;line-height:16px;color:inherit}.toggler-_SUZ7r_5 .iconArrow-3q7vxxnz{display:flex;transition:transform .1s cubic-bezier(.06,.52,1,.54)}.toggler-_SUZ7r_5 .objectTree-2tLil0dm{display:none}.toggler-_SUZ7r_5 .iconArrow-3q7vxxnz,.toggler-_SUZ7r_5 .objectTree-2tLil0dm{width:19px;height:19px;justify-content:center;align-items:center}.toggler-_SUZ7r_5 .counter-1hG1zy7A,.toggler-_SUZ7r_5 .iconArrow-3q7vxxnz,.toggler-_SUZ7r_5 .objectTree-2tLil0dm{position:relative;color:#131722;z-index:1}.newCollapser-1F6pNRDi .toggler-_SUZ7r_5{margin:2px 0 0 5px}.newCollapser-1F6pNRDi .toggler-_SUZ7r_5 .counter-1hG1zy7A{padding-right:4px}.newCollapser-1F6pNRDi .toggler-_SUZ7r_5 .iconArrow-3q7vxxnz{width:27px;transform:rotate(-180deg)}.newColla


 violate single Rust's single ownership property.
            &HuffmanTree::InternalNode { left_c: ref lc, right_c: ref rc, .. } => (lc, rc),
        };
        // Return user preference.
        match left_c {
            true => Some(children.0),
            false => Some(children.1),
        }
    }
}

impl<T> GetChild<HuffmanTree<T>> for Box<HuffmanTree<T>>
    where T: Clone + Hash + Ord
{
    fn child(&self, left_c: bool) -> Option<&HuffmanTree<T>> {
        let children = match **self {
            HuffmanTree::LeafSymbol { .. } => return None,
            // Cannot copy pointer as it would violate single Rust's single ownership property.
            HuffmanTree::InternalNode { left_c: ref lc, right_c: ref rc, .. } => (lc, rc),
        };
        // Return user preference.
        match left_c {
            true => Some(children.0),
            false => Some(children.1),
        }
    }
}

/// Helper method that creates a `HuffmanTree` internal node.
///
/// We must specify internal node's children which aligns nice with the `huffman` procedure i.e.
/// we do not require an internal node to have only one child at some point in time.
fn new_int_node<T>(f: usize, lc: HuffmanTree<T>, rc: HuffmanTree<T>) -> HuffmanTree<T>
    where T: Clone + Hash + Ord
{
    HuffmanTree::InternalNode {
        freq: f,
        left_c: Box::new(lc),
        right_c: Box::new(rc),
    }
}

/// DFS---the meat of the [get_codes()][3] function.
///
/// [3]: enum.HuffmanTree.html#method.get_codes
fn dfs<T>(huffman_tree: &Box<HuffmanTree<T>>,
          path: &mut BitArrayList,
          huffman_codes: &mut HashMap<T, BitArrayList>)
    where T: Clone + Hash + Ord
{
    match **huffman_tree {
        HuffmanTree::LeafSymbol { symbol: ref s, .. } => {
            huffman_codes.insert(s.clone(), path.clone());
        }
        HuffmanTree::InternalNode { left_c: ref lc, right_c: ref rc, .. } => {
            // Go down left child first.
            path.push(0);
            dfs(lc, path, huffman_codes);
            // Update path for left child return.
            path.pop();
            // Then go down right child.
            path.push(1);
            dfs(rc, path, huffman_codes);
            // Update path for right child return.
            path.pop();
        }
    }
}

#[cfg(test)]
mod tests {
    use HuffmanTree;
    use GetChild;

    #[test]
    fn freq_helper() {
        let (leaf1, leaf2) = setup_leafs();

        assert_eq!(leaf1.freq(), 13);
        assert_eq!(leaf2.freq(), 5);

        let internal_node = super::new_int_node(leaf1.freq() + leaf2.freq(), leaf2, leaf1);

        assert_eq!(internal_node.freq(), 18);
    }

    #[test]
    fn new_int_node_helper() {
        let (leaf1, leaf2) = setup_leafs();

        let internal_node = super::new_int_node(leaf2.freq() + leaf1.freq(), leaf2, leaf1);

        assert_eq!(internal_node.freq(), 18);
        assert_eq!(internal_node.child(true).unwrap(),
                   &HuffmanTree::LeafSymbol {
                        symbol: 'b',
                        freq: 5,
                    });
        assert_eq!(internal_node.child(false).unwrap(),
                   &HuffmanTree::Lea


#pragma once

#include <QString>

namespace geometrize
{

/**
 * @brief The RecentItem class models an item that was recently interacted with.
 */
class RecentItem
{
public:
    RecentItem(const QString& key, const QString& displayName, const long long int timeStamp);

    enum class Type
    {
        LOCAL_IMAGE,
        LOCAL_CHAISCRIPT,
        REMOTE_RESOURCE,
        UNKNOWN
    };

    /**
     * @brief getTypeForKey Gets the recent item type for the given recent item key.
     * @param key The recent item key.
     * @return The recent item type.
     */
    static RecentItem::Type getTypeForKey(const QString& key);

    QString getKey() const;
    QString getDisplayName() const;
    long long int getTimeStamp() const;

private:
    QString m_key; ///< Key, path, URL or other unique identifier for the item.
    QString m_displayName; ///< Display name of the item, suitable for showing to the user.
    long long int m_timeStamp; ///< Timestamp, millis since epoch, typically when the item was last accessed or used.
};

}


 a file to the local system.
///
/// Usage: `download [url] [path]`.
///
/// Defaults the the end of the URL without path option
pub async fn handle(cmd_args: &mut CommandArgs, logger: &Logger) -> Result<String, Box<dyn Error>> {
    let client = Client::new();
    // Get URL as the first arg
    let url: String  = cmd_args.nth(0).unwrap_or_else(|| "".to_string());
    // Get path as the 2nd arg or the last part of the URL
    let path: String = cmd_args.nth(0).unwrap_or_else(|| url.split("/").last().unwrap().to_string());
    logger.debug(format!("Downloading from {url} to {path}"));
    let r = client.get(url).send().await?;
    if r.status().is_success() {
        if let Ok(mut out_file) = File::create(&path) {
            match copy(&mut r.bytes().await?.as_ref(), &mut out_file) {
                Ok(b)  => { return notion_out!("File written to ", &path);},
                Err(_) => { return notion_out!("Could not write file"); }
            }
        } else {
            return notion_out!("Could not write file");
        }
    }
    Ok(r.text().await?)
}extern crate core;

use self::core::exec::call::Call;
use self::core::exec::fd_info::CallInfo;
use self::core::generator::arg::Arg;

use common::table::*;

extern crate api;
use self::api::leafs::deref_leaf::*;

type TClose = unsafe extern "system" fn(
    fd: i32,
    );
lazy_static! {
    static ref CLOSE: TClose = unsafe{ std::mem::transmute::<_, TClose>(generic::load_api("./uow", "close_")) };
}

pub trait CloseExec {
	fn close() -> Call;
}
impl CloseExec for Call {
	fn close() -> Call {
		Call::new(
			CallIds::close.into(),
			"close",
			vec![
				Arg::primitive_arg(
					Box::new(DeRef::new(FD_SIZE))),
			], |args| {

        if let [sock] = &mut args[..] {
          unsafe { CLOSE(*sock.data_const_unsafe()) }
        }

        CallInfo::succ(0)
      })
	}
}
<reponame>mlwilkerson/lumen
test_stdout!(without_exported_function_returns_false, "false\n");
test_stdout!(with_exported_function_return_true, "true\n");
use crate::models::series::serieses_query::FetchActionSerieses;
use crate::models::series::serieses_query::FetchSerieses;
use crate::models::series::serieses_query::SeriesesRequest;
use crate::models::series::serieses_query::SeriesesRequestBody;
use crate::models::series::serieses_query::Variables;
use crate::models::series::Series;

pagination_component! {
    SeriesesComponent,
    Series,
    serieses,
    series_count,
    SeriesesRequest,
    FetchActionSerieses,
    FetchSerieses,
    SeriesesRequestBody,
    Variables,
    SEARCH_SERIESES,
    PAGINATION_COUNT_SERIESES,
    vec!["ID".to_string(), "Series".to_string(), "SeriesType".to_string(), "ISSNPrint".to_string(), "ISSNDigital".to_string()]
}
use std;
use std::ffi::{OsStr, OsString};
use std::io;
use std::os::windows::ffi::{OsStrExt, OsStringExt};
use std::path::{Path, PathBuf};
use std::ptr::null_mut;
use winapi::shared::minwindef::{DWORD, FALSE};
use winapi::um::dbghelp::{
    SymCleanup, SymFromNameW, SymInitializeW, SymLoadModuleExW, SymUnloadModule64,


Prefs

/**
 * 键盘显示管理类
 */
class KeyboardManager {
    enum class KeyboardType {
        T9, QWERTY, LX17, QWERTYABC, NUMBER, SYMBOL, SETTINGS, HANDWRITING, CANDIDATES, ClipBoard, TEXTEDIT
    }
    private lateinit var mInputView: InputView
    private lateinit var mKeyboardRootView: InputViewParent
    private val keyboards = HashMap<KeyboardType, BaseContainer?>()
    private lateinit var mCurrentKeyboardName: KeyboardType
    var currentContainer: BaseContainer? = null
        private set

    fun setData(keyboardRootView: InputViewParent, inputView: InputView) {
        keyboards.clear() // TODO 清空缓存界面，发现调用 PinyinService.onCreateInputView时，原输入界面全部会失效。
        mKeyboardRootView = keyboardRootView
        mInputView = inputView
    }

    fun clearKeyboard() {
        keyboards.clear()
        if (::mInputView.isInitialized) mInputView.initView(mInputView.context)
    }

    fun switchKeyboard(layout: Int = InputModeSwitcherManager.skbLayout) {
        val keyboardName = when (layout) {
            0x1000 -> KeyboardType.QWERTY
            0x4000 -> KeyboardType.QWERTYABC
            0x3000 -> KeyboardType.HANDWRITING
            0x5000 -> KeyboardType.NUMBER
            0x6000 -> KeyboardType.LX17
            0x8000 -> KeyboardType.TEXTEDIT
            else -> KeyboardType.T9
        }
        switchKeyboard(keyboardName)
        if (::mInputView.isInitialized)mInputView.updateCandidateBar()
    }

    fun switchKeyboard(keyboardName: KeyboardType) {
        if (!::mKeyboardRootView.isInitialized) return
        var container = keyboards[keyboardName]
        if (container == null) {
            container = when (keyboardName) {
                KeyboardType.CANDIDATES ->  CandidatesContainer(Launcher.instance.context, mInputView)
                KeyboardType.HANDWRITING -> HandwritingContainer(Launcher.instance.context, mInputView)
                KeyboardType.NUMBER -> NumberContainer(Launcher.instance.context, mInputView)
                KeyboardType.QWERTY -> QwertyContainer(Launcher.instance.context, mInputView, InputModeSwitcherManager.MASK_SKB_LAYOUT_QWERTY_PINYIN)
                KeyboardType.SETTINGS -> SettingsContainer(Launcher.instance.context, mInputView)
                KeyboardType.SYMBOL -> SymbolContainer(Launcher.instance.context, mInputView)
                KeyboardType.QWERTYABC -> QwertyContainer(Launcher.instance.context, mInputView, InputModeSwitcherManager.MASK_SKB_LAYOUT_QWERTY_ABC)
                KeyboardType.LX17 -> T9TextContainer(Launcher.instance.context, mInputView, InputModeSwitcherManager.MASK_SKB_LAYOUT_LX17)
                KeyboardType.ClipBoard -> ClipBoardContainer(Launcher.instance.context, mInputView)
                KeyboardType.TEXTEDIT -> QwertyContainer(Launcher.instance.context, mInputView, InputModeSwitcherManager.MASK_SKB_LAYOUT_TEXTEDIT)
                else ->  T9TextContainer(Launcher.instance.context, mInputView, AppPrefs.getInstance().internal.inputDefaultMode.getValue() and InputModeSwitcherManager.MASK_SKB_LAYOUT)
            }
            container.updateSkbLayout()
            keyboards[keyboardName] = container
        }
        mKeyboardRootView.showView(container)
        mCurrentKeyboardName = keyboardName
        currentContainer = container
    }

    val isInputKeyboard: Boolean
        get() = currentContainer is InputBaseConta


#!/usr/bin/env python
# Script to parse a serial port data dump
#
# Copyright (C) 2016  Kevin O'Connor <kevin@koconnor.net>
#
# This file may be distributed under the terms of the GNU GPLv3 license.
import os, sys, logging
import msgproto

def read_dictionary(filename):
    dfile = open(filename, 'rb')
    dictionary = dfile.read()
    dfile.close()
    return dictionary

def main():
    dict_filename, data_filename = sys.argv[1:]

    dictionary = read_dictionary(dict_filename)

    mp = msgproto.MessageParser()
    mp.process_identify(dictionary, decompress=False)

    f = open(data_filename, 'rb')
    fd = f.fileno()
    data = bytearray()
    while 1:
        newdata = os.read(fd, 4096)
        if not newdata:
            break
        data += bytearray(newdata)
        while 1:
            l = mp.check_packet(data)
            if l == 0:
                break
            if l < 0:
                logging.error("Invalid data")
                data = data[-l:]
                continue
            msgs = mp.dump(data[:l])
            sys.stdout.write('\n'.join(msgs[1:]) + '\n')
            data = data[l:]

if __name__ == '__main__':
    main()


�
        if ((i * sizeof(DWORD)) == checksumOffset ||
            (i * sizeof(DWORD)) == checksumOffset + sizeof(DWORD) - 1) {
            continue;
        }
        sum += ptr[i];
        // 处理溢出
        if (sum < ptr[i]) {
            sum++;
        }
    }

    // 完成计算
    sum = (sum & 0xFFFF) + (sum >> 16);
    sum = (sum & 0xFFFF) + (sum >> 16);
    sum = sum + static_cast<DWORD>(size);

    return sum;
}

// 按区段对齐大小进行对齐
DWORD Sandbox::AlignToSectionAlignment(size_t size, DWORD alignment) {
    return static_cast<DWORD>(((size + alignment - 1) / alignment) * alignment);
}

// 更新代码基址和代码大小
void Sandbox::UpdateBaseOfCode(PIMAGE_SECTION_HEADER sectionHeader,
                               PIMAGE_NT_HEADERS ntHeaders,
                               WORD numberOfSections, DWORD entryPoint) {
    if (sectionHeader == nullptr || ntHeaders == nullptr ||
        numberOfSections == 0) {
        return;
    }

    DWORD baseOfCode = 0;
    DWORD sizeOfCode = 0;
    bool foundSection = false;

    // 寻找包含入口点的区段
    for (WORD i = 0; i < numberOfSections; i++) {
        auto& section = sectionHeader[i];
        if (entryPoint >= section.VirtualAddress &&
            entryPoint < (section.VirtualAddress + section.Misc.VirtualSize)) {
            baseOfCode = section.VirtualAddress;
            sizeOfCode = section.Misc.VirtualSize;
            foundSection = true;
            break;
        }
    }

    // 如果没有找到包含入口点的区段，使用第一个可执行区段
    if (!foundSection) {
        for (WORD i = 0; i < numberOfSections; i++) {
            auto& section = sectionHeader[i];
            if (section.Characteristics & IMAGE_SCN_MEM_EXECUTE) {
                baseOfCode = section.VirtualAddress;
                sizeOfCode = section.Misc.VirtualSize;
                foundSection = true;
                break;
            }
        }
    }

    // 更新NT头部信息
    if (foundSection) {
        if (ntHeaders->FileHeader.Machine == IMAGE_FILE_MACHINE_AMD64) {
            // 64位PE
            auto* optHeader64 =
                &reinterpret_cast<PIMAGE_NT_HEADERS64>(ntHeaders)
                     ->OptionalHeader;
            optHeader64->BaseOfCode = baseOfCode;
        } else {
            // 32位PE
            auto* optHeader32 =
                &reinterpret_cast<PIMAGE_NT_HEADERS32>(ntHeaders)
                     ->OptionalHeader;
            optHeader32->BaseOfCode = baseOfCode;
            optHeader32->SizeOfCode = sizeOfCode;
        }
    }
}

auto Sandbox::InitializeLdrData() -> void {
    if (m_peInfo->isX64 && m_peb64.Ldr == 0) {
        // 为LDR_DATA分配内存
        uint64_t ldrDataAddress = m_pebBase + sizeof(X64PEB);
        m_pebEnd = ldrDataAddress + sizeof(X64_PEB_LDR_DATA);
        m_peb64.Ldr = ldrDataAddress;

        // 映射LDR数据内存
        uc_mem_map(m_ucEngine, ldrDataAddress, sizeof(X64_PEB_LDR_DATA),
                   UC_PROT_ALL);

        // 初始化LDR_DATA结构
        X64_PEB_LDR_DATA ldrData = {0};
        ldrData.Length = sizeof(X64_PEB_LDR_DATA);
        l


MarkMsg
WriteMsg	dc.b ">> Write() error <<"
WriteSize=*-MarkMsg
TooMuchMsg	dc.b ">> Blurp... Indigestion!! <<"
TooMuchSize=*-TooMuchMsg
DupLockMsg	dc.b ">> DupLock() error <<"
DupLockSize=*-DupLockMsg
CreateDirMsg	dc.b ">> CreateDir() error <<"
CreateDirSize=*-CreateDirMsg
PowerMsg	dc.b ">> ppLoadData() error <<"
PowerSize=*-PowerMsg
CDMsg		dc.b ">> No path selected <<"
CDSize=*-CDMsg

* Tous les messages d'informations
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
WaitMsg		dc.b "- TMC is ready for your next choice -"
WaitSize=*-WaitMsg
PrefsMsg	dc.b "Reading preferences file..."
PrefsSize=*-PrefsMsg
StartMsg	dc.b "Select a module..."
StartSize=*-StartMsg
LoadMsg		dc.b "Reading file..."
LoadMsgSize=*-LoadMsg
ConvertMsg	dc.b "Converting patterns..."
ConvertSize=*-ConvertMsg
ResetMsg	dc.b "!! Warning : Restart zero'ed !!"
ResetSize=*-ResetMsg
WarningMsg	dc.b "!! Warning : Unimplemented function found !!"
WarningMsgSize=*-WarningMsg
PackMsg		dc.b "Packing patterns..."
PackSize=*-PackMsg
SaveMsg		dc.b "Saving module..."
SaveSize=*-SaveMsg
AboutMsg0	dc.b "-----------------------"
AboutMsg0Size=*-AboutMsg0
AboutMsg1	dc.b "The Module Converter v4.5"
AboutMsg1Size=*-AboutMsg1
AboutMsg2	dc.b "Copyright 1993-1994 Sync/DreamDealers"
AboutMsg2Size=*-AboutMsg2
CDSelectMsg	dc.b "select a path..."
CDSelectSize=*-CDSelectMsg

ReqSelect	dc.b "Select A Module",0
ReqDir		dc.b "Select A New Directory",0

Banner		dc.b 10
		dc.b "***************************************************************************",10
		dc.b "* Source-Song Generated With  TMC v4.5  (c)1993-1994 Sync of DreamDealers *",10
		dc.b "* From Module : "
NamePatch	dc.b "                                                          *",10
		dc.b "* SongName    : "
SongPatch	dc.b "                                                          *",10
		dc.b "***************************************************************************",10
		dc.b 10
		dc.b 10
BannerSize=*-Banner

WarningImp	dc.b "******************************************************************************",10
		dc.b "* WARNING : UNIMPLEMENTED FUNCTION FOUND IN PATTERN $00"
Warning_patch1	dc.b " POSITION $00"
Warning_patch2	dc.b " VOICE 0"
Warning_patch3	dc.b " *",10
		dc.b "******************************************************************************",10
		dc.b 10
WarningImpSize=*-WarningImp

Restart		dc.b 9,9,"*****************************************************",10
		dc.b 9,9,"* THIS SECTION CAN BE EITHER IN FAST OR CHIP MEMORY *",10
		dc.b 9,9,"*****************************************************",10
		dc.b 9,"CNOP 0,4",10
		dc.b "mt_global_volume",10
		dc.b 9,"dc.w $00"
VolumePatch	dc.b ",$0",10,"mt_restart",10
		dc.b 9,"dc.l mt_pos+4*$00"
RestartPatch	dc.b


MENU_ANCHOR_TOPLEFT
	// Specifies how a menu will be anchored for non-RTL languages. The opposite
	// position will be used for RTL languages.
	MenuAnchorTopright MenuAnchorPosition = 1 // CEF_MENU_ANCHOR_TOPRIGHT
	// Specifies how a menu will be anchored for non-RTL languages. The opposite
	// position will be used for RTL languages.
	MenuAnchorBottomcenter MenuAnchorPosition = 2 // CEF_MENU_ANCHOR_BOTTOMCENTER
)

// MenuColorType (cef_menu_color_type_t from include/internal/cef_types.h)
// Supported color types for menu items.
type MenuColorType int

// Possible values for MenuColorType
const (
	// Supported color types for menu items.
	MenuColorText MenuColorType = 0 // CEF_MENU_COLOR_TEXT
	// Supported color types for menu items.
	MenuColorTextHovered MenuColorType = 1 // CEF_MENU_COLOR_TEXT_HOVERED
	// Supported color types for menu items.
	MenuColorTextAccelerator MenuColorType = 2 // CEF_MENU_COLOR_TEXT_ACCELERATOR
	// Supported color types for menu items.
	MenuColorTextAcceleratorHovered MenuColorType = 3 // CEF_MENU_COLOR_TEXT_ACCELERATOR_HOVERED
	// Supported color types for menu items.
	MenuColorBackground MenuColorType = 4 // CEF_MENU_COLOR_BACKGROUND
	// Supported color types for menu items.
	MenuColorBackgroundHovered MenuColorType = 5 // CEF_MENU_COLOR_BACKGROUND_HOVERED
	// Supported color types for menu items.
	MenuColorCount MenuColorType = 6 // CEF_MENU_COLOR_COUNT
)

// MenuID (cef_menu_id_t from include/internal/cef_types.h)
// Supported menu IDs. Non-English translations can be provided for the
// IDS_MENU_* strings in CefResourceBundleHandler::GetLocalizedString().
type MenuID int

// Possible values for MenuID
const (
	// Navigation.
	MenuIDBack          MenuID = 100 // MENU_ID_BACK
	MenuIDForward       MenuID = 101 // MENU_ID_FORWARD
	MenuIDReload        MenuID = 102 // MENU_ID_RELOAD
	MenuIDReloadNocache MenuID = 103 // MENU_ID_RELOAD_NOCACHE
	MenuIDStopload      MenuID = 104 // MENU_ID_STOPLOAD
	// Editing.
	MenuIDUndo      MenuID = 110 // MENU_ID_UNDO
	MenuIDRedo      MenuID = 111 // MENU_ID_REDO
	MenuIDCut       MenuID = 112 // MENU_ID_CUT
	MenuIDCopy      MenuID = 113 // MENU_ID_COPY
	MenuIDPaste     MenuID = 114 // MENU_ID_PASTE
	MenuIDDelete    MenuID = 115 // MENU_ID_DELETE
	MenuIDSelectAll MenuID = 116 // MENU_ID_SELECT_ALL
	// Miscellaneous.
	MenuIDFind       MenuID = 130 // MENU_ID_FIND
	MenuIDPrint      MenuID = 131 // MENU_ID_PRINT
	MenuIDViewSource MenuID = 132 // MENU_ID_VIEW_SOURCE
	// Spell checking word correction suggestions.
	MenuIDSpellcheckSuggestion0    MenuID = 200 // MENU_ID_SPELLCHECK_SUGGESTION_0
	MenuIDSpellcheckSuggestion1    MenuID = 201 // MENU_ID_SPELLCHECK_SUGGESTION_1
	MenuIDSpellcheckSuggestion2    MenuID = 202 // MENU_ID_SPELLCHECK_SUGGESTION_2
	MenuIDSpellcheckSuggestion3    MenuID = 203 // MENU_ID_SPELLCHECK_SUGGESTION_3
	MenuIDSpellcheckSuggestion4    MenuID = 204 // MENU_ID_SPELLCHECK_SUGGESTION_4
	MenuIDSpellcheckSuggestionLast MenuID = 204 // MENU_ID_SPELLCHECK_SUGGESTION_LAST
	MenuIDNoSpellingSuggestions    MenuID = 205 // MENU_ID_NO_SPE


一样
        3. 散列冲突的概率要很小
        4. 对于长字符串也能很快的得到结果，效率要高
    * 应用
        1. 安全加密比如MD5和SHA DES AES
            1. MD5有2^128个哈希值，冲突的概率小于1/2^128
        2. 唯一标识，图片唯一识别，可以将图片byte转化hash
        3. 数据校验，如BT中种子信息保存个个节点下载的内容是否被修改过
        4. 散列函数
        5. 复杂均衡
        6. 数据分片
            1. mapReduce方式任务分配到同一个服务上
            2. 巨量数据分片，比如1亿张图片如何分开索引
                1. 如果我们用hash表来存储，就是需要将文件摘要hash后存储
                2. MD5 128位 16字节，文件路径最大256字节 平均128字节 我们用指针保存数据指针占8个字节一个数据的总
                占用量是128+16+8=152，假如一个服务器的内存是2G,hash表的装载因子是0.75，所以单台机器最大存储图片数量
                2G*0.75/152约等于1000万，所以一个亿的图片大于需要10台左右这样的机器。
        7. 分布式存储：一致性哈希，将数据整个哈希分成m个小区间，k台机器上每台机器维护m/k个区间的数据，m远大于k，当有新
        机器加入时只要将小部分区间的数据迁移到新的机器便可以，不用改变哈希规则实现扩容。

* 二叉树
    * 树是非线性数据结构，之前的数组，链表，栈都是线性数据结构
    * 树的相关定义
        * 节点高度，只当前节点到根节点的最长要经过几个节点
        * 节点层级，从1开始
        * 节点深度，从0开始
    * 最常用的数是二叉树，树只有两个子节点：一个左节点和一个右节点
    * 二叉树的类型：
        * 满二叉树：最后一层是满的就是满二叉树
        * 完全二叉树：倒数第二层是满的，并且最后一层的节点都靠左侧
            * 为什么要是完全二叉树，因为内存存储是连续的地址空间，如果用内存存树完全二叉树是最节省内存的方式。
    * 二叉树的遍历方式
        * 前序：先遍历节点本身
        * 中序：中


[]byte, err error)
	// Width returns the value of the width option and whether it has been set.
	// The unit is Unicode code points.
	// Width 返回宽度选项的值，并判断它是否被设置。其单元为Unicode码点。
	Width() (wid int, ok bool)
	// Because ReadRune is implemented by the interface, Read should never be
	// called by the scanning routines and a valid implementation of
	// ScanState may choose always to return an error from Read.
	//
	// 由于 ReadRune 被此接口实现，因此 Read 不应当被扫描功能调用，而 ScanState
	// 的有效实现可选择总是从 Read 中返回错误。
	Read(buf []byte) (n int, err error)
}

// Scanner is implemented by any value that has a Scan method, which scans
// the input for the representation of a value and stores the result in the
// receiver, which must be a pointer to be useful. The Scan method is called
// for any argument to Scan, Scanf, or Scanln that implements it.

// Scanner 由任何拥有 Scan 方法的值实现，它将输入扫描成值的表示，并将其结果存储到接收者中，
// 该接收者必须为可用的指针。Scan 方法会被 Scan、Scanf 或 Scanln 的任何实现了它的实参所调用。
type Scanner interface {
	Scan(state ScanState, verb rune) error
}

// Scan scans text read from standard input, storing successive
// space-separated values into successive arguments. Newlines count
// as space. It returns the number of items successfully scanned.
// If that is less than the number of arguments, err will report why.

// Scan 扫描从标准输入中读取的文本，并将连续由空格分隔的值存储为连续的实参。
// 换行符计为空格。它返回成功扫描的条目数。若它少于实参数，err 就会报告原因。
func Scan(a ...interface{}) (n int, err error) {
	return Fscan(os.Stdin, a...)
}

// Scanln is similar to Scan, but stops scanning at a newline and
// after the final item there must be a newline or EOF.

// Scanln 类似于 Scan，但它在换行符处停止扫描，且最后的条目之后必须为换行符或 EOF。
func Scanln(a ...interface{}) (n int, err error) {
	return Fscanln(os.Stdin, a...)
}

// Scanf scans text read from standard input, storing successive
// space-separated values into successive arguments as determined by
// the format. It returns the number of items successfully scanned.
// If that is less than the number of arguments, err will report why.
// Newlines in the input must match newlines in the format.
// The one exception: the verb %c always scans the next rune in the
// input, even if it is a space (or tab etc.) or newline.

// Scanf 扫描从标准输入中读取的文本，并将连续由空格分隔的值存储为连续的实参，
// 其格式由 format 决定。它返回成功扫描的条目数。若返回的条目数小于实参数，
// 则会报告错误原因 err。输入中的换行符必须与 format 中的相匹配，除了一种例外：
// %c 占位符总是扫描输入中的下一个符文，即便它是空格


fet", "bdybe", "be26u", "beqzq", "b7mx7", "bg4ss", "b6zkr", "b7gb0", "be7hr", "bew8j", "bsm06", "bkq5r", "b6d4g", "bd9cv", "bkqk6", "bkncu", "bg2rf", "b6wtd", "bfcjp", "be22m", "bdkqb", "bg3qv", "bd83q", "bse8u", "b6d5g", "be22h", "bswbp", "b7rx4", "bkjc2", "bdew0", "bfqxb", "bfdjs", "bd8rm", "b6qeq", "bd5p7", "bg16t", "b7mxe", "beg9s", "bs5mm", "b7n53", "b3ypb", "bd6c4", "be4wx", "b798y", "b6yn0", "bu0gh", "bdtn2", "be5hz", "be2nj", "bu1bq", "bg3tx", "b3sqp", "be2f5", "b7vzk", "bsh0g", "bdxqv", "bkw0v", "bdukr", "b3u3w", "b6ex8", "b6qns", "b741r", "beqw4", "be197", "bdzx2", "bgfr2", "bk71r", "bkrj6", "beey7", "b33nu", "bs5fm", "bs714", "b77u8", "bgdjw", "b3dzp", "b7zrx", "b6yp0", "b6sb0", "bsj9z", "bet1h", "bgc9v", "c420b", "bg45w", "bg5q5", "bdy8d", "b6vb7", "bdt5g", "bsx39", "b6wh1", "bfqq8", "b7muu", "b7rqn", "bdst5", "bg94d", "bd759", "b74t8", "b3e5h", "b9che", "bu06d", "b3d4j", "bsd4h", "bd91f", "b3yq9", "be5dx", "b745j", "bg1vm", "b1rsb", "c40fm", "b7epm", "becv8", "bsqrn", "bepxk", "bdg03", "bs1b5", "b32m9", "bedw3", "b3g0y", "bdu5j", "bet00", "bg9b7", "b77t6", "b7vu0", "bfs6m", "bdfv0", "b7gch", "betwx", "b7wy0", "b6pne", "bu2ys", "c1cmu", "bd6v2", "bskew", "bdgcz", "becrd", "bsr3f", "b3zws", "bg9yd", "bk4qy", "bss9x", "bd6jr", "c425t", "bfbhs", "bsjtm", "bffzm", "b79s0", "bsee6", "bes7v", "c4043", "b7vwx", "b7n60", "bkkcd", "bs4cm", "bfqpf", "bdcmb", "c1cux", "bewc4", "b6x2k", "bs1p2", "c41bm", "b39gf", "bewkq", "beywd", "beku7", "b7c2b", "bu1rb", "bdv2x", "b7j6j", "bewz1", "bkrkc", "b7z15", "b3u30", "bg02w", "berjh", "bu5dg", "bspgn", "b38ff", "bd6sz", "b6tb9", "bepem", "bg2kf", "bspyr", "c1bp7",


s)
```

```
##            x     y tmin1
## [1,] -6.4167 49.92   4.2
## [2,] -6.2500 49.92   4.2
## [3,] -5.2500 49.92   2.4
## [4,]  0.5833 49.92   1.0
## [5,]  0.7500 49.92   1.0
## [6,]  0.9167 49.92   1.0
```

And also, the `click` function will get values from particular locations in the map

```r
plot(tmin1.c)
click(tmin1.c, n = 3)  # click n times in the map to get values
```

<br>

### Rasterize points, lines or polygons <a name="rasterize"></a>

```r
locs2ras <- rasterize(locs.gb, tmin1, field = rep(1, nrow(locs.gb)))
locs2ras
```

```
## class       : RasterLayer
## dimensions  : 900, 2160, 1944000  (nrow, ncol, ncell)
## resolution  : 0.1667, 0.1667  (x, y)
## extent      : -180, 180, -60, 90  (xmin, xmax, ymin, ymax)
## coord. ref. : +proj=longlat +ellps=WGS84 +datum=WGS84 +towgs84=0,0,0
## data source : in memory
## names       : layer
## values      : 1, 1  (min, max)
```

```r
plot(locs2ras, xlim = c(-10, 10), ylim = c(45, 60), legend = F)
data(wrld_simpl)
plot(wrld_simpl, add = T)
```

![plot of chunk unnamed-chunk-50](figure/unnamed-chunk-50.png)

<br>

### Changing raster resolution <a name="resolution"></a>

Use `aggregate` function:

```r
tmin1.lowres <- aggregate(tmin1.c, fact = 2, fun = mean)
tmin1.lowres
```

```
## class       : RasterLayer
## dimensions  : 60, 60, 3600  (nrow, ncol, ncell)
## resolution  : 0.3333, 0.3333  (x, y)
## extent      : -10, 10, 30, 50  (xmin, xmax, ymin, ymax)
## coord. ref. : +proj=longlat +ellps=WGS84 +datum=WGS84 +towgs84=0,0,0
## data source : in memory
## names       : tmin1
## values      : -10.57, 10.1  (min, max)
```

```r
tmin1.c  # compare
```

```
## class       : RasterLayer
## dimensions  : 120, 120, 14400  (nrow, ncol, ncell)
## resolution  : 0.1667, 0.1667  (x, y)
## extent      : -10, 10, 30, 50  (xmin, xmax, ymin, ymax)
## coord. ref. : +proj=longlat +ellps=WGS84 +datum=WGS84 +towgs84=0,0,0
## data source : in memory
## names       : tmin1
## values      : -12.3, 10.3  (min, max)
```

```r
par(mfcol = c(1, 2))
plot(tmin1.c, main = "original")
plot(tmin1.lowres, main = "low resolution")
```

![plot of chunk unnamed-chunk-51](figure/unnamed-chunk-51.png)

### Spline interpolation <a name="interpolation"></a>

```r
xy <- data.frame(xyFromCell(tmin1.lowres, 1:ncell(tmin1.lowres)))  # get raster cell coordinates
head(xy)
```

```
##        x     y
## 1 -9.833


 "## New workbook\n---\n\nWelcome to your new workbook."
        },
        "name" : "text - 2"
      }
    ],
    "styleSettings" : {},
    "$schema" : "https://github.com/Microsoft/Application-Insights-Workbooks/blob/master/schema/workbook.json"
  })

  localized = jsonencode({
    "en-US" : [
      {
        "galleries" : [
          {
            "name" : "test2",
            "category" : "workbook",
            "type" : "workbook",
            "resourceType" : "Azure Monitor",
            "order" : 200
          }
        ],
        "templateData" : {
          "version" : "Notebook/1.0",
          "items" : [
            {
              "type" : 2,
              "content" : {
                "json" : "## New workbook\n---\n\nWelcome to your new workbook."
              },
              "name" : "text - 2"
            }
          ],
          "styleSettings" : {},
          "$schema" : "https://github.com/Microsoft/Application-Insights-Workbooks/blob/master/schema/workbook.json"
        },
      }
    ]
  })

  tags = {
    key = "value2"
  }
}
`, template, data.RandomInteger, data.Locations.Primary)
}
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package applicationinsights_test

import (
	"context"
	"fmt"
	"testing"

	"github.com/hashicorp/go-azure-helpers/lang/pointer"
	smartdetection "github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2015-05-01/componentproactivedetectionapis"
	"github.com/hashicorp/terraform-provider-azurerm/internal/acceptance"
	"github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check"
	"github.com/hashicorp/terraform-provider-azurerm/internal/clients"
	"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
)

type AppInsightsSmartDetectionRule struct{}

func TestAccApplicationInsightsSmartDetectionRule_basic(t *testing.T) {
	data := acceptance.BuildTestData(t, "azurerm_application_insights_smart_detection_rule", "test")
	r := AppInsightsSmartDetectionRule{}

	data.ResourceTest(t, r, []acceptance.TestStep{
		{
			Config: r.basic(data),
			Check: acceptance.ComposeTestCheckFunc(
				check.That(data.ResourceName).ExistsInAzure(r),
			),
		},
		data.ImportStep(),
	})
}

func TestAccApplicationInsightsSmartDetectionRule_update(t *testing.T) {
	data := acceptance.BuildTestData(t, "azurerm_application_insights_smart_detection_rule", "test")
	r := AppInsightsSmartDetectionRule{}

	data.ResourceTest(t, r, []acceptance.TestStep{
		{
			Config: r.basic(data),
			Check: acceptance.ComposeTestCheckFunc(
				check.That(data.ResourceName).ExistsInAzure(r),
			),
		},
		{
			Config: r.update(data),
			Check: acceptance.ComposeTestCheckFunc(
				check.That(data.ResourceName).ExistsInAzure(r),
			),
		},
		{
			Config: r.basic(data),
			Check: acceptance.ComposeTestCheckFunc(
				check.That(data.ResourceName).ExistsInAzure(r),
			),
		},
	})
}

func TestAccApplicationInsightsSmartDetectionRule_multiple(t *testing.T) {
	data := acceptance.BuildTestData(t, "azurerm_application_insights_smart_detection_rule", "test")
	r := AppInsightsSmartDetectionRule{}

	data.ResourceTest(t, r, []acceptan


materials.Material;
import org.rajawali3d.materials.methods.DiffuseMethod;
import org.rajawali3d.materials.textures.ATexture;
import org.rajawali3d.materials.textures.StreamingTexture;
import org.rajawali3d.materials.textures.Texture;
import org.rajawali3d.math.Matrix4;
import org.rajawali3d.math.Quaternion;
import org.rajawali3d.math.vector.Vector3;
import org.rajawali3d.primitives.Cube;
import org.rajawali3d.primitives.Line3D;
import org.rajawali3d.primitives.ScreenQuad;
import org.rajawali3d.renderer.Renderer;

import java.util.Stack;
import javax.microedition.khronos.opengles.GL10;

/**
 * Very simple example augmented reality renderer which displays a cube fixed in place.
 * The position of the cube in the OpenGL world is updated using the {@code updateObjectPose}
 * method.
 */
public class PlaneFittingRenderer extends Renderer {
    private static final String TAG = PlaneFittingRenderer.class.getSimpleName();
    private static final float CUBE_SIDE_LENGTH = 0.5f;
    private static final float AXIS_THICKNESS = 20.0f;

    private static final Matrix4 DEPTH_T_OPENGL = new Matrix4(new float[] {
            1.0f,  0.0f, 0.0f, 0.0f,
            0.0f,  0.0f, 1.0f, 0.0f,
            0.0f, -1.0f, 0.0f, 0.0f,
            0.0f,  0.0f, 0.0f, 1.0f
    });

    private float[] textureCoords0 = new float[]{0.0F, 1.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F, 0.0F};

    // Augmented Reality related fields.
    private ATexture mTangoCameraTexture;
    private boolean mSceneCameraConfigured;

    private Object3D mObject;
    private Matrix4 mObjectTransform;
    private boolean mObjectPoseUpdated = false;

    private ScreenQuad mBackgroundQuad;

    public PlaneFittingRenderer(Context context) {
        super(context);
    }

    @Override
    protected void initScene() {
        // Create a quad covering the whole background and assign a texture to it where the
        // Tango color camera contents will be rendered.
        if (mBackgroundQuad == null) {
            mBackgroundQuad = new ScreenQuad();
            mBackgroundQuad.getGeometry().setTextureCoords(textureCoords0);
        }
        Material tangoCameraMaterial = new Material();
        tangoCameraMaterial.setColorInfluence(0);
        // We need to use Rajawali's {@code StreamingTexture} since it sets up the texture
        // for GL_TEXTURE_EXTERNAL_OES rendering.
        mTangoCameraTexture =
                new StreamingTexture("camera", (StreamingTexture.ISurfaceListener) null);
        try {
            tangoCameraMaterial.addTexture(mTangoCameraTexture);
            mBackgroundQuad.setMaterial(tangoCameraMaterial);
        } catch (ATexture.TextureException e) {
            Log.e(TAG, "Exception creating texture for RGB camera contents", e);
        }
        getCurrentScene().addChildAt(mBackgroundQuad, 0);

        // Add a directional light in an arbitrary direction.
        DirectionalLight light = new DirectionalLight(1, 0.2, -1);
        light.setColor(1, 1, 1);
        light.setPower(0.8f);
        light.setPosition(3, 2, 4);
        getCurrentScene().addLight(light);

        // Build a Axis and a cube to represent plane's transformation.

        Cube cube = new Cube(CUBE_SIDE_LENGTH);
        Material cubeMaterial = new Material();
        cubeMaterial.setColor(0xff009900);


#ifndef _CONSTANTS_OFFSETS_PROCESS_H_
#define _CONSTANTS_OFFSETS_PROCESS_H_

#include "constants/macros.h"

u64 __attribute__((always_inline)) get_pid_level_offset() {
    u64 pid_level_offset;
    LOAD_CONSTANT("pid_level_offset", pid_level_offset);
    return pid_level_offset;
}

u64 __attribute__((always_inline)) get_pid_numbers_offset() {
    u64 pid_numbers_offset;
    LOAD_CONSTANT("pid_numbers_offset", pid_numbers_offset);
    return pid_numbers_offset;
}

u64 __attribute__((always_inline)) get_sizeof_upid() {
    u64 sizeof_upid;
    LOAD_CONSTANT("sizeof_upid", sizeof_upid);
    return sizeof_upid;
}

u64 __attribute__((always_inline)) get_task_struct_pid_offset() {
    u64 kernel_has_pid_link_struct;
    LOAD_CONSTANT("kernel_has_pid_link_struct", kernel_has_pid_link_struct);

    u64 task_struct_pid_offset;
    if (kernel_has_pid_link_struct) { // kernels < 4.19
        u64 task_struct_pid_link_offset;
        LOAD_CONSTANT("task_struct_pid_link_offset", task_struct_pid_link_offset);
        u64 pid_link_pid_offset;
        LOAD_CONSTANT("pid_link_pid_offset", pid_link_pid_offset);
        task_struct_pid_offset = task_struct_pid_link_offset + pid_link_pid_offset;
    } else {
        LOAD_CONSTANT("task_struct_pid_offset", task_struct_pid_offset);
    }

    return task_struct_pid_offset;
}

#endif