Skip to content

Instantly share code, notes, and snippets.

/**
* Deterministic finite automata for recognising language of strings with
* following conditions:
*
* 1. It must contain only :, ), (, and _ characters.
* 2. :has to be followed by ) or (.
* 3. Has to have at least one smiley :) or sad :( face.
* 4. If string has more than one face, then all of them have to be separated by at least one _ character.
* 5. Each string can start and end with zero or more _ characters.
*
import java.util.*;
/**
* Nondeterministic finite automaton for recognising language of {aa, aab}*{b}
*
* @see http://www.dennis-grinch.co.uk/tutorial/nfa
* @author Dennis Grinch
*/
public class NFA {
import java.util.*;
/**
* Nondeterministic finite automaton (ε-NFA) for recognising language of (ab ∪ a)*.
*
* @see http://www.dennis-grinch.co.uk/tutorial/enfa
* @author Dennis Grinch
*/
public class eNFA {
/**
* This is meeting storage service. Users will use this service for creating,
* deleting and updating their meetings.
*/
public interface MeetingService extends Remote {
List<Meeting> getMeetings() throws SQLException, RemoteException;
void createMeeting(Meeting meeting) throws SQLException, RemoteException;
-- build_scripts/ # Contains scripts related with server
-- build.js # Build files for production
-- devServer.js # Start development server
-- prodServer.js # Start production server
-- config/ # Contains scripts for Webpack configuration
-- webpack.common.js # Common configuration for production and development
-- webpack.dev.js # Development configuration
-- webpack.prod.js # Production configuration
+- docs/ # Output folder for production
+- elm-stuff/ # Elm dependencies
/**
* Script for Elm application development which includes hot reloading.
* Note that bundled webpack files fill be served from the memory.
*/
import path from 'path';
import open from 'opn';
import chalk from 'chalk';
import express from 'express';
import webpack from 'webpack';
import webpackDevMiddleware from 'webpack-dev-middleware';
// This is single page application, therefore we route all the requests to the index.html
app.get('*', (req, res) => {
res.sendFile(path.join(__dirname, '../src/index.html'));
});
/**
* Common webpack configuration used by development and production.
*/
import HtmlWebpackPlugin from 'html-webpack-plugin';
export default {
target: 'web',
output: { filename: '[name].js', },
module: {
noParse: /\.elm$/, // we don't need to parse elm files
/**
* Webpack configuration for development.
*/
import Webpack from 'webpack';
import merge from 'webpack-merge';
import common from './webpack.common';
import AppConfig from '../app.confg';
export default merge.smart(common, {
devtool: 'inline-source-map',
/**
* Webpack configuration for production
*/
import UglifyJsWebpackPlugin from 'uglifyjs-webpack-plugin';
import ExtractTextWebpackPlugin from 'extract-text-webpack-plugin';
import CleanWebpackPlugin from 'clean-webpack-plugin';
import Webpack from 'webpack';
import merge from 'webpack-merge';
import common from './webpack.common';
import AppConfig from '../app.confg';