Skip to content

Instantly share code, notes, and snippets.

/*
* This code is also a solution to the problem at the following URL.
* http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_9_D
*/
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
import Promise from 'bluebird';
import { Mutex } from 'await-semaphore';
const mutex = new Mutex();
mutex.use(() => {
// write process you want to control exclusively
// example shows below
const promise = new Promise((resolve) => {
Promise.props({ // see. http://bluebirdjs.com/docs/api/promise.props.html
import React, { useState, useEffect } from 'react';
import { Text } from 'react-native';
import { Appearance, useColorScheme } from 'react-native-appearance';
Appearance.getColorScheme();
const SomeComponent = (props) => {
const [colorScheme, setColorScheme] = useState('light');
const cs = useColorScheme();
package config
import (
"log"
"os"
"gopkg.in/ini.v1"
)
type configList struct {
[api]
api_key = XXXXXXXXXXXXXXXXX
api_secret = YYYYYYYYYYYYYYYYYYYYYYYYYYYY
[app]
log_file = app.log
default_run_mode = view
Shop shop = null;
List<Shop> shops = new List<Shop>();
/* Shop A */
shop = new Shop();
shop.name = 'A shop';
shop.address = 'Minato-ku, Tokyo, Japan';
shop.proceeds = 100000;
shop.category = 'sweets';
shops.add(shop);
Shop shop = null;
List<Shop> shops = new List<Shop>();
/* Shop A */
shop = new Shop();
shop.name = 'A shop';
shop.address = 'Minato-ku, Tokyo, Japan';
shop.proceeds = 100000;
shop.category = 'sweets';
shops.add(shop);
import React from 'react';
import {
Button,
Icon,
} from 'native-base';
import { inject, observer } from 'mobx-react';
import withCommonProps from './withCommonProps'; // HOC ( Higher Order Component )
@inject('dataStore')
import React, { useEffect } from 'react';
import {
Button,
Icon,
} from 'native-base';
import { inject, useObserver } from 'mobx-react';
import withCommonProps from './withCommonProps'; // HOC ( Higher Order Component )
const SomeComponent = ({
import * as Functions from "firebase-functions";
import * as Admin from "firebase-admin";
import * as CORS from "cors";
import * as ua from "universal-analytics";
Admin.initializeApp(Functions.config().firebase);
const someProcess = async (request: Functions.Request, response: Functions.Response) => {
let visitor = ua('UA-XXXXXXXX-X'); // set your Google Analytics account ID
visitor.pageview({dp: "/someprocess", dt: "SomeProcessExecuted"}).send();