text stringlengths 184 4.48M |
|---|
const {
takeNotifications,
createNotifications,
getPostNotification,
getOwnerCommentPostNotification,
getFriendRequestNotification,
getUserById,
getAcceptFriendRequest,
getPageNotification,
addMoreNotification,
} = require('../repository/index')
const moment = require('moment/moment')
// const { v4: ... |
import { useId } from "@radix-ui/react-id";
import * as Label from "@radix-ui/react-label";
import * as PrimitiveSwitch from "@radix-ui/react-switch";
import React from "react";
import classNames from "@calcom/lib/classNames";
const Switch = (
props: React.ComponentProps<typeof PrimitiveSwitch.Root> & {
label?:... |
<template>
<v-container>
<v-row>
<v-col cols="6">
<VDataTable
v-model:expanded="expanded"
:items-per-page="5"
:headers="headers"
:items="requests"
item-value="id"
class="elevation-1"
show-expand
:loading="loading"
>
<template... |
import React, { useState } from "react";
import { useSelector } from "react-redux";
import Hero from "../components/Hero";
import ReportForm from "../components/ReportForm";
import SavedReports from "../components/SavedReports";
import icon from "../assets/icon-img.png";
import SectionTextImgContent from "../sections/S... |
<script>
import axios from 'axios'
import reservation from '../../components/reservations/reservation.vue'
import _ from "lodash";
import viewModalVue from '../../components/reservations/viewModal.vue';
export default {
components: {
"dm-reservation": reservation,
"view-modal": viewModalVue,
},... |
<?php
/*
* This code is an addon for GOsa² (https://gosa.gonicus.de)
* Copyright (C) 2022 Daniel Teichmann
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the Licens... |
// SPDX-License-Identifier: BUSL-1.1
//
// Copyright (C) 2023, Berachain Foundation. All rights reserved.
// Use of this software is govered by the Business Source License included
// in the LICENSE file of this repository and at www.mariadb.com/bsl11.
//
// ANY USE OF THE LICENSED WORK IN VIOLATION OF THIS LICENSE WIL... |
package repository_test
import (
"AvoxiCodingChallenge/repository"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"testing"
)
var repo = repository.New()
func Test_GetNetworks(t *testing.T) {
t.Run("GetNetworks by country name", func(t *testing.T) {
countryName := "United States"
... |
Output Status :
Runtime: 8 ms, faster than 31.50% of C++ online submissions for Binary Tree Right Side View.
Memory Usage: 11.9 MB, less than 66.66% of C++ online submissions for Binary Tree Right Side View.
// Iterative Sol :: Time : O(N) :: Aux_Space : O(N)
/**
* Definition for a binary tree node.
* struct ... |
package org.lntu.online.ui.activity;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.view.animation.LinearInterpolator;
import android.widget.ExpandableListView;
import an... |
import { createSlice, createAsyncThunk } from "@reduxjs/toolkit";
import { updateThemeVariables } from "@/helpers/updateThemeVariables";
const setLocalStorageTheme = (newTheme: string) => {
localStorage.setItem("currentTheme", newTheme);
};
const getLocalStorageTheme = () => {
return localStorage.getItem("current... |
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<!-- For Responsive -->
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" href="{{ asset('css/template.css', 'mix') }}" ... |
#-------------------------------------------------------------------------
# AUTHOR: Jessica Ortega
# FILENAME: title of the source file
# SPECIFICATION: description of the program
# FOR: CS 4210- Assignment #5
# TIME SPENT: how long it took you to complete the assignment
#----------------------------------------------... |
import React, { useState } from "react";
import { StaticImageData } from 'next/image';
import Image from "next/image";
export interface Technology {
icon: string | StaticImageData;
color: string;
}
export interface Image {
src: string | StaticImageData;
}
export interface Project {
id: str... |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="/Users/nguyenducanh/Documents/GitHub/HTMLAndCSS/CSSLayout/f... |
// adapted from: https://www.npmjs.com/package/intrinsic-scale
import { Fiber } from "../types";
import { calculateDistance } from "@coszio/react-measurements";
/**
*
* @param contains Type of fitting: object-contain = `true`, object-cover = `false`
* @param image HTML image reference
* @returns The real fitted d... |
import Control.Monad (replicateM)
main :: IO ()
main = do
t <- readLn :: IO Int
inputs <- replicateM t $ do
line <- getLine
let [a, b] = read <$> words line
return (a, b)
mapM_ (uncurry printFormat) (zip [1..] inputs)
printFormat :: Int -> (Int, Int) -> IO ()
printFormat idx (a, b) = putStrLn $
"... |
// Copyright (C) 2024 owoDra
#pragma once
#include "Engine/CancellableAsyncAction.h"
#include "Type/OnlineServiceResultTypes.h"
#include "Type/OnlineLobbyAttributeTypes.h"
#include "AsyncAction_ModifyLobbyAttributes.generated.h"
class UOnlineLobbySubsystem;
class ULobbyResult;
class APlayerController;
/**
* De... |
var levens = 2;
var kolommenMetBom = [];
var spelActief = true;
//var levens geeft het aantal levens aan (begin is 2 levens), kolommenMetBom is een lijst waar de kollomen in staan waar een bom zich op de x waarde bevind, spelActief is om te bepalen of het spel actief is of niet
class Raster {
constructor(r,k) {
... |
import { Editor, TLFrameShape, TLShapeId, TLSvgOptions } from '@tldraw/editor'
import { exportToBlob } from './export'
/** @public */
export type TLExportType = 'svg' | 'png' | 'jpeg' | 'webp' | 'json'
/**
* Export the given shapes as files.
*
* @param editor - The editor instance.
* @param ids - The ids of the s... |
MIT Department of Biology
7.014 Introductory Biology, Spring 2005
7.014 Quiz II Handout
**This will be a closed book exam**
Question 1
Shown below is a representation of an origin of replication.
template 1
CAAGG
A
GGAAC
C
template 3
3'
5'
5'
3'
B
CAAGG
template 2
fork 1
ORI
fork 2 ... |
import { createAction } from './helper';
import { apiUrl, ApiService } from '../services/ApiService';
import {
PokemonsListActions,
PokemonActions,
PokemonAbilityActions,
} from '../constants/actionTypes';
export const getPokemonList = () => {
const loadStart = createAction(PokemonsListActions.POKEMONS_LIST_LO... |
import React from "react";
import Typed from "typed.js";
export function TypedTextPrompt({ text }) {
// Create reference to store the DOM element containing the animation
const el = React.useRef(null);
React.useEffect(() => {
const typed = new Typed(el.current, {
strings: [text],
typeSpeed: 50,
... |
<p align="center">
<img src="./docs/he-full-2000x564.png" width="100%" alt="react-json-editor"><br />
<img src="./docs/title-react-700x76.png" width="350px" alt="react-json-editor">
</p>
> Simple and extensible React component capable of using JSON Schema to declaratively build and customize user forms.
<p align=... |
<?php
namespace Database\Seeders;
use App\Models\User;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\Hash;
class DatabaseSeeder extends Seeder
{
/**
* Seed the application's database.
*/
public function run(): void
{
User::create([
'full_name' =>... |
import { useEffect, useState } from "react";
import { useDispatch, useSelector } from "react-redux";
import { useParams } from "react-router-dom";
import {
Dialog,
DialogHeader,
DialogBody,
IconButton,
} from "@material-tailwind/react";
import { XMarkIcon } from "@heroicons/react/24/solid";
import EditProfileF... |
<?php
/**
* Portfolio Meta Box Options
* @param array $args
* @return array
* @since 1.0.7
*/
function themify_theme_portfolio_meta_box( $args = array() ) {
extract( $args );
return array(
// Content Width
array(
'name'=> 'content_width',
'title' => __('Content Width', 'themify'),
'description' => '... |
package br.ba.carlosrogerio.siscobrapi4.util;
import java.util.Properties;
import org.hibernate.SessionFactory;
import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.Environment;
import org.hibernate.service.ServiceRegistry;
import br.ba.c... |
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
<title>Get started with SceneView - Create a 3D map</title>
<style>
html, body, #viewDiv {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
}
</style>
<link rel="... |
import { describe } from "@ardenthq/sdk-test";
import { IoC, Signatories } from "@ardenthq/sdk";
import { identity } from "../test/fixtures/identity";
import { createService } from "../test/mocking";
import { BindingType } from "./constants";
import { AddressService } from "./address.service.js";
import { AddressFacto... |
import {
Form,
FormError,
FieldError,
Label,
TextField,
NumberField,
Submit,
} from '@redwoodjs/forms'
const SubredditForm = (props) => {
const onSubmit = (data) => {
props.onSave(data, props?.subreddit?.id)
}
return (
<div className="rw-form-wrapper">
<Form onSubmit={onSubmit} error... |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Modifica</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-KK94CHFLLe+nY2... |
using System.Text;
using Microsoft.Extensions.Logging;
using ZLogger;
namespace Mobsub.SubtitleParse.AssTypes;
public class AssData(ILogger? logger = null)
{
public bool CarriageReturn = false;
public Encoding CharEncoding = Utils.EncodingRefOS();
public HashSet<AssSection> Sections = [];
public AssSc... |
import { Dispatch, FormEvent, SetStateAction } from "react"
import { islandCreateSchema } from "../db/schema/island.schema";
import { shortToast } from "../helpers/shorter-function";
type SetIsLoading = Dispatch<SetStateAction<boolean>>
/**
* Creates an array of objects with id and name
*
* @param countriesString... |
import React, { useState } from "react";
import Deadline from "./Deadline";
import { AddDeadline } from "./AddDeadline";
import Tooltip from "@mui/material/Tooltip";
import type { TDeadline } from "../types";
import Fab from "@mui/material/Fab";
import AddIcon from "@mui/icons-material/Add";
import MuiList from "@mui... |
package dev.robocode.tankroyale.server.score
import dev.robocode.tankroyale.server.dev.robocode.tankroyale.server.model.ParticipantId
import dev.robocode.tankroyale.server.rules.RAM_DAMAGE
/** Bot record that tracks damage and survival of a bot, and can calculate score. */
class ScoreAndDamage {
private val bull... |
import { errorDefinition } from "@/lib/constants"
import { db } from "@/server/db"
import { Staff } from "@/server/db/schema"
import { toStaffResponse } from "@/server/models/responses/staff"
import { useAuth } from "@/server/security/auth"
import { defineHandler } from "@/server/web/handler"
import { bindJson } from "... |
d<-data.frame(year=c(2009:2020),
dissimilarity=runif(12, 0.5, 1),
centroid_distance=runif(12, 0.5, 1),
volume_change=runif(12, 0.5, 1),
SST=runif(12, 0, 1),
SSS=runif(12, 0, 1),
red_tides=runif(12, 0, 1),
abundance=runif(12, 0, 1),
... |
---
title: "Hogares"
author: "Cesar Poggi"
date: "29/1/2022"
output: html_document
---
***DATA 2019***
A) Cargar la Data
DESCARGAR Y DESCOMPRIMIR ARCHIVO enaho2019.dta para poder leerlo
```{r}
library(haven)
data1=read_dta("enaho2019.dta")
```
B) Agrupar los casos por departamento en una nueva variable. Es decir, po... |
import React, { useState, useEffect } from "react";
import axios from "axios";
import RepoUser from "../repouser/RepoUser";
import "./UserInfo.css"
export default function UserInfo({ setUserInfoVisible }) {
const [username, setUsername] = useState("");
const [userInfo, setUserInfo] = useState(null);
const [butto... |
import 'package:dinesh_s_application42/core/app_export.dart';
import 'package:dinesh_s_application42/widgets/app_bar/appbar_image.dart';
import 'package:dinesh_s_application42/widgets/app_bar/appbar_image_1.dart';
import 'package:dinesh_s_application42/widgets/app_bar/appbar_subtitle_1.dart';
import 'package:dinesh_s_a... |
import React, { useState, useContext } from "react";
import NavigateNextIcon from "@mui/icons-material/NavigateNext";
import NavigateBeforeIcon from "@mui/icons-material/NavigateBefore";
import { CarouselData } from "../CarouselData";
import { AppContext } from "../context/AppContext";
import { Modal } from "./Modal";... |
using AutoFixture;
using Core.Tests;
using Core.Tests.Attributes;
using FluentValidation;
using Users.Application.Handlers.Queries.GetUser;
using Xunit.Abstractions;
namespace Users.UnitTests.Tests.Queries.GetUser;
public class GetUserQueryValidatorTests : ValidatorTestBase<GetUserQuery>
{
public GetUserQueryVali... |
import { FiArrowUp, FiMessageSquare } from "react-icons/fi";
import { FormEvent, useEffect, useState } from "react";
import { GetServerSideProps, NextPage } from "next";
import {
IUserHunter,
IUserProvisioner,
THunterBlogPost,
TProvBlogPost,
} from "@/lib/types";
import {
MdArrowBack,
MdCheckCircle,
MdComment,
... |
import {FC, useEffect, useState} from "react";
import {Navbar} from "../application/Navbar";
import {Footer} from "../application/Footer";
import axios, {AxiosResponse} from "axios";
import {CarDetailsStateType, CarReservationType, CarType} from "../../types/cars/cars.types";
import {useLocation} from "react-router";
i... |
import { useEffect, useState } from "react";
import useFetchPackages from "../../hooks/useFetchPackage";
import {
PackageContainer,
SortingBarContainer,
SortingBarInput,
SortingBarDropdown,
SortingBarDropdownContainer,
SortingBarDropdownItems,
NoMatchMessage,
ClearSortBarButton,
} from "./Packages.style... |
import {Injectable} from '@angular/core';
import {Subject} from 'rxjs';
import Web3 from 'web3';
import {Employee} from "../../model/employee";
import {BalanceService} from "./balance.service";
import {EmployeeService} from "../backend/employee.service";
declare let window: any;
@Injectable({
providedIn: 'root'
})
... |
import { includes } from 'lodash'
import React, { Component } from 'react'
import styles from './DraggableModalContainer.module.css'
type Props = React.PropsWithChildren<{
draggableTarget: string;
}>
type State = {
isDragging: boolean;
currentPosition: {
x: number;
y: number;
};
m... |
<script setup>
import { reactive, ref } from "vue";
import NavBar from "./components/navbar.vue";
import FeatureCard from "./components/card.vue";
const features = reactive([
{
image: "icon-access-anywhere.svg",
title: "Access your files, anywhere",
details:
"The ability to use a ... |
import os
import time
import datetime
import argparse
from download import Download
from extract import Extract
from utils import wet_paths
parser = argparse.ArgumentParser()
parser.add_argument(
"--path",
required = True,
type = str,
help = "Directory storing the wet path indexes"
)
# parser.add_arg... |
[.white_bg]
== Icons and Images
image::angele-kamp-bDuh4oK_MCU-unsplash.jpg[background]
[.white_bg]
=== Background images
image::angele-kamp-bDuh4oK_MCU-unsplash.jpg[background]
[source,asciidoc]
----
[.white_bg]
=== Background images
image::angele-kamp-bDuh4oK_MCU-unsplash.jpg[background]
----
[.columns.is-vcente... |
<div id="Chart-<?=$id?>" class="mb"></div>
<script>
let ChartOptions<?=$id?> = {
series: [
<?php if (is_array($metric)): ?>
<?php foreach ($metric as $index => $currentMetric): ?>
{
name: '<?php if (is_array($name)): ?><?=$name[$index]?><?php else: ?><?=$name?><?php endif; ?>',
<?php if (is_array($color))... |
export function createStore(rootReducer, initialState = {}) {
let state = rootReducer({ ...initialState }, { type: "__INIT__" });
let listeners = [];
return {
subscribe(fn) {
listeners.push(fn);
return {
unsubscribe() {
listeners = listeners.filter((l) => l !== fn);
},
... |
package com.health.service;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import co... |
package com.pb.nikolaenko.hw14;
import java.io.*;
import java.net.Socket;
import java.text.SimpleDateFormat;
import java.util.Date;
class ClientWork {
// Объявляем рабочие переменные
private Socket socket;
private BufferedReader in; // поток чтения из сокета
private BufferedWriter out; // поток чтени... |
package com.avs.habithero.ui.fragments
import android.os.Bundle
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import com.avs.habithero.R
import com.avs.habithero.databinding.FragmentStatsBinding
import com.avs.hab... |
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:wazzaf/styles/colors/colors.dart';
ThemeData lightTheme = ThemeData(
primarySwatch: Colors.amber,
scaffoldBackgroundColor: Colors.yellow[50],
appBarTheme: AppBarTheme(
... |
/*
create EventTarget class with methods
//addEventListener
//input: name of event as string, callback function to be called when event is dispatched to target
//target should be able to have multiple event listeneres for same event
eg. target.addEventListener('click', onClick)
target.addEventListener('clic... |
/*******************************************************************************
* PSHDL is a library and (trans-)compiler for PSHDL input. It generates
* output suitable for implementation or simulation of it.
*
* Copyright (C) 2014 Karsten Becker (feedback (at) pshdl (dot) org)
*
* This program is f... |
<script setup lang="ts">
import { ref } from 'vue'
import HelloWorld from '@/components/Parent.vue'
import useFetch from '@/hooks/useFetcher'
import { computed } from 'vue'
// Custom hook
const { data, isPending, isSuccess, isError, error } = useFetch('queryKey', {
url: '/api/search',
params: {
part: '... |
import 'dart:async';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:equatable/equatable.dart';
import 'package:twitter_clone_client/twitter_clone_client.dart';
import '../../repositories/post_repository.dart';
part 'feed_event.dart';
part 'feed_state.dart';
class FeedBloc extends Bloc<FeedEvent, F... |
import { useForm } from "react-hook-form";
import { useNavigate } from "react-router-dom";
import { useRegisterUserMutation } from "../redux/features/auth/authApiSlice";
import { useEffect } from "react";
import { toast } from "react-toastify";
const RegisterTwo = () => {
const navigate = useNavigate();
const { r... |
import React, {useState, useRef} from 'react';
import {
View,
TextInput,
TouchableOpacity,
Text,
StyleSheet,
SafeAreaView,
} from 'react-native';
import {useSelector, useDispatch} from 'react-redux';
import {Formik} from 'formik';
import * as Yup from 'yup';
import Colors from '../styles/Colors';
import Met... |
<div>
<div *ngIf="isEdit">
<div class="header"><span>{{'add.title' | translate}}</span></div>
<div class="container">
<div nz-row [nzGutter]="{ xs: 8, sm: 16, md: 24, lg: 24 }" class="main-content">
<div nz-col nzXs="24" nzSm="24" nzMd="24" nzLg="24">
<form nz... |
#pragma once
#include <ctime>
#include <string>
#include <boost/bind.hpp>
#include <boost/asio.hpp>
#include <boost/thread/thread.hpp>
#include <iostream>
#include "PersonInRoom.h"
namespace clientServer {
using tcp = boost::asio::ip::tcp; // from <boost/asio/ip/tcp.hpp>
class server
{
public:
... |
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class DateService {
formatDate(date: Date) {
return this.formatDateFromNumber(date.getFullYear(), date.getMonth(), date.getDate());
}
formatDateUTC(date: Date) {
return this.formatDateFromNumber(date.getUTCFullYear(... |
#%%
# reverseString the idea is to swap the letters that are symmetric
# wrt the middle of the string
# use two index, one at the begining and one at the end
# swap letters of these two index
# then move the left index one position to right and
# right index one position to left
# swap letters of these two index
# ... |
# Plot cell-types in UMAP
setwd("../../")
library(Seurat)
library(ggplot2)
library(ggrepel)
library(scales)
library(gridExtra)
library(reshape2)
source("scripts/ggplot_raster.R")
source("scripts/color_pal.R")
source("scripts/get_enr_mat.R")
# Functions
create_dir <- function(p){
dir.create(p, showWarnings=F... |
import { ReactElement } from "react";
import { Box, Button } from "@mui/material";
import { actionsButtons, buttonStyle } from "./modalStyles";
import CancelIcon from "@mui/icons-material/Cancel";
const ActionsButtons = (props: {
cancel: () => void;
submit: () => void;
submitText: string;
submitIcon: ReactElem... |
package ru.nlct.mylovelyplace.presentation.ui.home.utils
import android.graphics.Bitmap
import android.util.LruCache
/**
* LruCache for caching background bitmaps for [DecodeBitmapTask].
*/
internal class BackgroundBitmapCache {
private val maxMemory = (Runtime.getRuntime().maxMemory() / 1024).toInt() / 5
... |
transform middleright:
xalign 0.7
ypos 0.06
define flash = Fade(.25, 0.0, .75, color="#fff")
screen quest_menu(id_tavern,quests,label,label_retour):
frame:
background Solid("#000000ae")
vbox:
spacing 5
... |
# 文件类型识别
## `文本文件`识别
对于一个文件是否是`文本文件`,并没有完全行之有效的识别方案。只能通过尝试去理解内容,这是有一定误差的。
可行的方案有:`文件名后缀匹配`、`magic number 过滤`等,虽然会有一定误差,但在比较稳定的环境下,这也是有效的。
对文本内容全量解码,这在文本较小的时候非常行之有效。若环境中出现图片、压缩文件等,这会有极大的性能损耗。
这里提供一种思路,即对文本内容主动进行多个位置的截取解码,以较小的性能开销来对文本文件进行识别。
### 命令
```
hlvdump istext xxx.md
> YES, This Is Text File.(or "NO, This... |
/*
RawSpeed - RAW file decoder.
Copyright (C) 2009-2014 Klaus Post
Copyright (C) 2017 Roman Lebedev
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version ... |
use time::{OffsetDateTime};
use serde::{Deserialize, Serialize};
use crate::ids::{RecipientId, BankAccountId};
use crate::resources::{CreateBankAccount, BankAccount};
use crate::params::{Page, unpack_contained};
use crate::{Client, Response};
use crate::build_map;
#[derive(Clone, Debug, Default, Serialize)]
pub struct... |
using Asp.Versioning;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.OutputCaching;
using ProsperityPartners.Application.Features.BatchFeatures.Queries;
using ProsperityPartners.Application.Features.CompanyFeatures.Commands;
using ProsperityPartners.Applicati... |
#ifndef __HID_H
#define __HID_H
/*
* Copyright (c) 1999 Andreas Gal
* Copyright (c) 2000-2001 Vojtech Pavlik
* Copyright (c) 2006-2007 Jiri Kosina
*/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free So... |
# Summary MVVM
## MVVM Architecture
- Merupakan singkatan dari Model-View ViewModel
- Memisahkan logic dengan tampilan (view) ke dalam View Model
### Keuntungan
1. Reusability
> jika ada beberapa tampilan yang memerlukan alur logic yang sama, mereka bisa menggunakan ViewModel yang sama
2. Maintainabillity
> M... |
import { Router } from 'express';
import ProductManager from '../clases/productManager.js';
const products = Router();
export const PERSISTENT_PRODUCTS = new ProductManager('src/data/products.json');
products.get('/', async (req,res) => {
try {
const limit = req.query.limit;
const products = aw... |
//
// ProfileHeader.swift
// TwitterClone
//
// Created by Saleh Masum on 5/7/2022.
//
import UIKit
class ProfileTableViewHeader: UIView {
private let joinedDateLabel: UILabel = {
let label = UILabel()
label.translatesAutoresizingMaskIntoConstraints = false
label.text = "Joined Oct... |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Type Ahead 👀</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<form class="search-form">
<input type="text" class="search" placeholder="City or State">
<ul class="suggestions">
<li>Filter for a city</li>
<... |
from fastapi import APIRouter,status,Depends
from fastapi.exceptions import HTTPException
from database import Session,engine
from schemas import SignUpModel,LoginModel
from models import User
from fastapi.exceptions import HTTPException
from werkzeug.security import generate_password_hash , check_password_hash
from fa... |
<?php
/**
* @file
* Module file for Teamleader CRM.
*
* Provides support for Teamleader's Contact/Company API.
*
* @see http://apidocs.teamleader.be/crm.php
*/
define('TEAMLEADER_CRM_CONTACT_OPERATION_LINK', 'link');
define('TEAMLEADER_CRM_CONTACT_OPERATION_UNLINK', 'unlink');
/**
* Create a new contact in th... |
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Float</title>
<style>
body {
background-color: #222;
}
.c1 {
background-color: red;
float: right;
}
.c2 {
background-color: green;
clear: right; ... |
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
import QtQuick 2.4
/* This is a manual test for the dummy context described here:
http://blog.qt.io/blog/2011/07/28/mockup-data-for-the-qml-designer
The dummy context that defines ... |
;quiz01_1.asm
;unsigned char num1 = 250; //data type: 8 bits
;unsigned char num2 = 200; //data type: 8 bits
;unsigned char num3 = 120; //data type: 8 bits
;unsigned short sum = 0 //data type: 16 bits
;unsigned int product = 0; //data type: 32 bits
;sum = short(num1 + num2);
;product = sum * short(num3);
sec... |
<?php
class Daemon {
/** @var $TTY the console to output to/from */
public $TTY;
/** @var $interface the interface to connect with */
public $interface = NULL;
/** @var $interfaceSettingName the interface name */
public $interfaceSettingName = NULL;
/** @var $DaemonName the name of the Daemon */
public $DaemonN... |
Overview
========
CMSIS-Driver defines generic peripheral driver interfaces for middleware making it reusable across a wide
range of supported microcontroller devices. The API connects microcontroller peripherals with middleware
that implements for example communication stacks, file systems, or graphic user interface... |
import { Todo, Params } from '@/store/todo/types'
import { TodoClientInterface } from './types'
export class TodoClient implements TodoClientInterface {
async getAll() {
await new Promise((resolve) => setTimeout(resolve, 3000))
return Promise.resolve(
Object.keys(localStorage)
.filter((key) => ... |
# MIT License
#
# Copyright (c) 2022 Mathieu Imfeld
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify... |
import React, { useState } from "react";
import "./FilesTab.css"; // Import your CSS file for styling
function FilesTab({
files,
activeFile,
setActiveFile,
DEFAULT_CODE,
setFiles,
}) {
const [fileNameInput, setFileNameInput] = useState("");
const [inputVisible, setInputVisible] = useState(false);
con... |
<?php
session_start();
require_once "pdo.php";
require_once "util.php";
if (!isset($_SESSION['name'])) {
die('Not logged in');
}
if (isset($_POST['first_name']) &&
isset($_POST['last_name']) &&
isset($_POST['email']) &&
isset($_POST['headline']) &&
isset($_POST['summary'])) {
if (strlen(... |
<?php
namespace App\Livewire;
use Livewire\Component;
use App\Models\Product as Prd;
use App\Http\Requests\ProductRequest;
class Product extends Component
{
public $products, $name, $price, $qty, $id,$searchTerm = '';
public $isOpen = 0;
public function render()
{
$this->products = Prd:... |
package main
import (
"fmt"
"strings"
)
// as a function parameters
func customMessage(fn func(m string), msg string) {
msg = strings.ToUpper(msg)
fn(msg)
}
func surround() func(msg string) {
return func(msg string) {
fmt.Printf("%.*s\n", len(msg), "-------------")
fmt.Println(msg)
fmt.Printf("%.*s\n", le... |
import { StringUtils, getStringInfo, toUpperCase } from '../app/Utils'
describe('Utils test suit', () => {
// oops test
describe('StringUtils tests', () => {
let sut: StringUtils;
beforeEach(() => {
sut = new StringUtils();
console.log('Setup');
})
afterEach(() => {
console.l... |
package com.dbc.trabalhovemser.controller;
import com.dbc.trabalhovemser.dto.UsuarioCreateDTO;
import com.dbc.trabalhovemser.dto.UsuarioDTO;
import com.dbc.trabalhovemser.exceptions.RegraDeNegocioException;
import com.dbc.trabalhovemser.service.UsuarioService;
import io.swagger.annotations.ApiOperation;
import io.swagg... |
import React, { useEffect, useState } from "react";
import { useNavigate } from "react-router-dom";
// Service
import { createProduct } from "../../../services/productService"
// Helper
import { fieldEmptyValidation } from "../../../helpers/fieldEmptyValidation";
// Component
import Input from "../../../components/I... |
library(tidyverse)
library(lubridate)
source(here::here("R", "src", "utils_cohorts.R"), encoding = "utf8")
# TEST UTILS --------------------------------------------------------------
# Cohortes por mes de cumpleaños ------------------------------------------
res_fun <- simul_births_deaths(N = 10000,
... |
import React, { Component } from "react";
import Downshift, { resetIdCounter } from "downshift";
import Router from "next/router";
import { ApolloConsumer } from "react-apollo";
import gql from "graphql-tag";
import debounce from "lodash.debounce";
import { DropDownItem, DropDown, SearchStyles } from "./styles/DropDown... |
import React from 'react';
import {
TouchableOpacity,
Text,
StyleSheet,
TouchableOpacityProps,
StyleProp,
TextStyle,
} from 'react-native';
import useTheme from '../core/theme';
import TextTopography from '../core/textTopography';
import {
responsiveHeight,
responsiveRadius,
responsiveWidth,
} from '.... |
import { createRouter, createWebHistory } from "vue-router";
import { useStore } from "vuex";
import TheMain from "@/components/layout/TheMain";
import LoginForm from "@/auth/LoginForm.vue";
import resource from "@/helper/resource";
import HomePage from "@/views/HomePage.vue";
import AssetOverview from "@/views/overvie... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.