This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package config | |
import ( | |
"log" | |
"os" | |
"gopkg.in/ini.v1" | |
) | |
type configList struct { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[api] | |
api_key = XXXXXXXXXXXXXXXXX | |
api_secret = YYYYYYYYYYYYYYYYYYYYYYYYYYYY | |
[app] | |
log_file = app.log | |
default_run_mode = view |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = ({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
NewerOlder