code
stringlengths
3
1.01M
repo_name
stringlengths
5
116
path
stringlengths
3
311
language
stringclasses
30 values
license
stringclasses
15 values
size
int64
3
1.01M
package catalogue_browser_dao; import catalogue.Catalogue; import soap.UploadCatalogueFileImpl.ReserveLevel; public interface IForcedCatalogueDAO { public boolean forceEditing(Catalogue catalogue, String username, ReserveLevel editLevel); public ReserveLevel getEditingLevel(Catalogue catalogue, String username); public boolean removeForceEditing(Catalogue catalogue); }
openefsa/CatalogueBrowser
src/catalogue_browser_dao/IForcedCatalogueDAO.java
Java
lgpl-3.0
378
// <file> // <copyright see="prj:///doc/copyright.txt"/> // <license see="prj:///doc/license.txt"/> // <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/> // <version>$Revision$</version> // </file> using System; using System.Drawing; using System.Reflection; using System.Windows.Forms; using ICSharpCode.Core; namespace ICSharpCode.UnitTesting { public enum TestTreeViewImageListIndex { TestNotRun = 0, TestPassed = 1, TestFailed = 2, TestIgnored = 3 } public class TestTreeViewImageList { static ImageList imageList; TestTreeViewImageList() { } public static ImageList ImageList { get { if (imageList == null) { GetImageList(); } return imageList; } } static void GetImageList() { imageList = new ImageList(); imageList.ColorDepth = ColorDepth.Depth32Bit; AddBitmap("Grey.png"); AddBitmap("Green.png"); AddBitmap("Red.png"); AddBitmap("Yellow.png"); } static void AddBitmap(string name) { string resourceName = String.Concat("ICSharpCode.UnitTesting.Resources.", name); Assembly assembly = typeof(TestTreeViewImageList).Assembly; imageList.Images.Add(new Bitmap(assembly.GetManifestResourceStream(resourceName))); } } }
kingjiang/SharpDevelopLite
src/AddIns/Misc/UnitTesting/Src/TestTreeViewImageList.cs
C#
lgpl-3.0
1,276
/* * Copyright (C) 2008-2015 by Holger Arndt * * This file is part of the Universal Java Matrix Package (UJMP). * See the NOTICE file distributed with this work for additional * information regarding copyright ownership and licensing. * * UJMP 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 2 * of the License, or (at your option) any later version. * * UJMP is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with UJMP; if not, write to the * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA */ package org.ujmp.ojalgo.calculation; import org.ojalgo.matrix.decomposition.LUDecomposition; import org.ojalgo.matrix.store.MatrixStore; import org.ujmp.core.Matrix; import org.ujmp.ojalgo.OjalgoDenseDoubleMatrix2D; public class Inv implements org.ujmp.core.doublematrix.calculation.general.decomposition.Inv<Matrix> { public static Inv INSTANCE = new Inv(); public Matrix calc(Matrix source) { MatrixStore<Double> matrix = null; if (source instanceof OjalgoDenseDoubleMatrix2D) { matrix = ((OjalgoDenseDoubleMatrix2D) source).getWrappedObject(); } else { matrix = new OjalgoDenseDoubleMatrix2D(source).getWrappedObject(); } org.ojalgo.matrix.decomposition.LU<Double> lu = LUDecomposition.makePrimitive(); lu.compute(matrix); return new OjalgoDenseDoubleMatrix2D(lu.getInverse()); } }
ujmp/universal-java-matrix-package
ujmp-ojalgo/src/main/java/org/ujmp/ojalgo/calculation/Inv.java
Java
lgpl-3.0
1,821
/* * Copyright (C) 2011-2013 Karlsruhe Institute of Technology * * This file is part of Ufo. * * 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 3 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see <http://www.gnu.org/licenses/>. */ #include "config.h" #include <string.h> #include <stdio.h> #include <json-glib/json-glib.h> #include "ufo-task-graph.h" #include "ufo-task-node.h" #include "ufo-input-task.h" #include "ufo-dummy-task.h" #include "ufo-priv.h" /** * SECTION:ufo-task-graph * @Short_description: Hold task nodes * @Title: UfoTaskGraph * * The task graph is the central data structure that connects #UfoTaskNode * objects to form computational pipelines and graphs. To execute a task graph, * it has to be passed to a #UfoBaseScheduler. */ G_DEFINE_TYPE (UfoTaskGraph, ufo_task_graph, UFO_TYPE_GRAPH) #define UFO_TASK_GRAPH_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), UFO_TYPE_TASK_GRAPH, UfoTaskGraphPrivate)) struct _UfoTaskGraphPrivate { UfoPluginManager *manager; GHashTable *json_nodes; guint index; guint total; }; typedef enum { JSON_FILE, JSON_DATA } JsonLocation; typedef struct { UfoPluginManager *manager; UfoTaskNode *task; GError **error; } JsonSetPropertyInfo; static void add_nodes_from_json (UfoTaskGraph *self, JsonNode *, GError **); static void handle_json_task_edge (JsonArray *, guint, JsonNode *, gpointer); static void add_task_node_to_json_array (UfoTaskNode *, JsonArray *); static JsonObject *json_object_from_ufo_node (UfoNode *node); static JsonNode *get_json_representation (UfoTaskGraph *, GError **); static UfoTaskNode *create_node_from_json (JsonNode *json_node,UfoPluginManager *manager, GError **error); /* * ChangeLog: * - 1.1: Add "index" and "total" keys to the root object * - 2.0: Add "index" and "total" keys to the root object */ static const gchar *JSON_API_VERSION = "2.0"; /** * UfoTaskGraphError: * @UFO_TASK_GRAPH_ERROR_JSON_KEY: Key is not found in JSON * @UFO_TASK_GRAPH_ERROR_BAD_INPUTS: Inputs of a task do not play well with each * other. * * Task graph errors */ GQuark ufo_task_graph_error_quark (void) { return g_quark_from_static_string ("ufo-task-graph-error-quark"); } /** * ufo_task_graph_new: * * Create a new task graph without any nodes. * * Returns: A #UfoGraph that can be upcast to a #UfoTaskGraph. */ UfoGraph * ufo_task_graph_new (void) { UfoTaskGraph *graph; graph = UFO_TASK_GRAPH (g_object_new (UFO_TYPE_TASK_GRAPH, NULL)); return UFO_GRAPH (graph); } static void read_json (UfoTaskGraph *graph, UfoPluginManager *manager, JsonLocation location, const gchar *data, GError **error) { JsonParser *json_parser; JsonNode *json_root; JsonObject *object; GError *tmp_error = NULL; json_parser = json_parser_new (); switch (location) { case JSON_FILE: json_parser_load_from_file (json_parser, data, &tmp_error); break; case JSON_DATA: json_parser_load_from_data (json_parser, data, (gssize) strlen (data), &tmp_error); break; } if (tmp_error != NULL) { g_propagate_prefixed_error (error, tmp_error, "Parsing JSON: "); g_object_unref (json_parser); return; } graph->priv->manager = manager; g_object_ref (manager); json_root = json_parser_get_root (json_parser); object = json_node_get_object (json_root); if (json_object_has_member (object, "index") && json_object_has_member (object, "total")) { guint index = (guint) json_object_get_int_member (object, "index"); guint total = (guint) json_object_get_int_member (object, "total"); ufo_task_graph_set_partition (graph, index, total); } add_nodes_from_json (graph, json_root, error); g_object_unref (json_parser); } /** * ufo_task_graph_read_from_file: * @graph: A #UfoTaskGraph. * @manager: A #UfoPluginManager used to load the filters * @filename: Path and filename to the JSON file * @error: Indicates error in case of failed file loading or parsing * * Read a JSON configuration file to fill the structure of @graph. */ void ufo_task_graph_read_from_file (UfoTaskGraph *graph, UfoPluginManager *manager, const gchar *filename, GError **error) { g_return_if_fail (UFO_IS_TASK_GRAPH (graph) && UFO_IS_PLUGIN_MANAGER (manager) && (filename != NULL)); read_json (graph, manager, JSON_FILE, filename, error); } /** * ufo_task_graph_read_from_data: * @graph: A #UfoTaskGraph. * @manager: A #UfoPluginManager used to load the filters * @json: %NULL-terminated string with JSON data * @error: Indicates error in case of failed file loading or parsing * * Read a JSON configuration file to fill the structure of @graph. */ void ufo_task_graph_read_from_data (UfoTaskGraph *graph, UfoPluginManager *manager, const gchar *json, GError **error) { g_return_if_fail (UFO_IS_TASK_GRAPH (graph) && UFO_IS_PLUGIN_MANAGER (manager) && (json != NULL)); read_json (graph, manager, JSON_DATA, json, error); } static JsonNode * get_json_representation (UfoTaskGraph *graph, GError **error) { GList *task_nodes; GList *it; JsonNode *root_node = json_node_new (JSON_NODE_OBJECT); JsonObject *root_object = json_object_new (); JsonArray *nodes = json_array_new (); JsonArray *edges = json_array_new (); task_nodes = ufo_graph_get_nodes (UFO_GRAPH (graph)); g_list_foreach (task_nodes, (GFunc) add_task_node_to_json_array, nodes); g_list_for (task_nodes, it) { UfoNode *from; GList *successors; GList *jt; from = UFO_NODE (it->data); successors = ufo_graph_get_successors (UFO_GRAPH (graph), from); g_list_for (successors, jt) { UfoNode *to; gint port; JsonObject *to_object; JsonObject *from_object; JsonObject *edge_object; to = UFO_NODE (jt->data); port = GPOINTER_TO_INT (ufo_graph_get_edge_label (UFO_GRAPH (graph), from, to)); to_object = json_object_from_ufo_node (to); from_object = json_object_from_ufo_node (from); edge_object = json_object_new (); json_object_set_int_member (to_object, "input", port); json_object_set_object_member (edge_object, "to", to_object); json_object_set_object_member (edge_object, "from", from_object); json_array_add_object_element (edges, edge_object); } g_list_free (successors); } json_object_set_string_member (root_object, "version", JSON_API_VERSION); json_object_set_array_member (root_object, "nodes", nodes); json_object_set_array_member (root_object, "edges", edges); json_object_set_int_member (root_object, "index", graph->priv->index); json_object_set_int_member (root_object, "total", graph->priv->total); json_node_set_object (root_node, root_object); g_list_free (task_nodes); return root_node; } static JsonGenerator * task_graph_to_generator (UfoTaskGraph *graph, GError **error) { JsonNode *root_node; JsonGenerator *generator; root_node = get_json_representation (graph, error); if (error != NULL && *error != NULL) return NULL; generator = json_generator_new (); json_generator_set_root (generator, root_node); json_node_free (root_node); return generator; } /** * ufo_task_graph_save_to_json: * @graph: A #UfoTaskGraph * @filename: Path and filename to the JSON file * @error: Indicates error in case of failed file saving * * Save a JSON configuration file with the filter structure of @graph. */ void ufo_task_graph_save_to_json (UfoTaskGraph *graph, const gchar *filename, GError **error) { JsonGenerator *generator; generator = task_graph_to_generator (graph, error); if (generator != NULL) { json_generator_to_file (generator, filename, error); g_object_unref (generator); } } /** * ufo_task_graph_get_json_data: * @graph: A #UfoTaskGraph * @error: Indicates error in case of failed serialization * * Serialize @graph to a JSON string. * * Returns: (transfer full): A JSON string describing @graph */ gchar * ufo_task_graph_get_json_data (UfoTaskGraph *graph, GError **error) { JsonGenerator *generator; gchar *json = NULL; generator = task_graph_to_generator (graph, error); if (generator != NULL) { json = json_generator_to_data (generator, NULL); g_object_unref (generator); } return json; } static gboolean is_gpu_task (UfoTask *task, gpointer user_data) { return ufo_task_uses_gpu (task); } static GList * nodes_with_common_ancestries (UfoTaskGraph *graph, GList *path) { GList *result = NULL; GList *it; g_list_for (path, it) { if (ufo_graph_get_num_predecessors (UFO_GRAPH (graph), UFO_NODE (it->data)) > 1) result = g_list_append (result, it->data); } return result; } /** * ufo_task_graph_expand: * @graph: A #UfoTaskGraph * @resources: A #UfoResources objects * @n_gpus: Number of GPUs to expand the graph for * @error: error to pass on * * Expands @graph in a way that most of the resources in @graph can be occupied. * In the simple pipeline case, the longest possible GPU paths are duplicated as * much as there are GPUs in @arch_graph. */ void ufo_task_graph_expand (UfoTaskGraph *graph, UfoResources *resources, guint n_gpus, GError **error) { GList *path; GList *common; GError *tmp_error = NULL; g_return_if_fail (UFO_IS_TASK_GRAPH (graph)); path = ufo_graph_find_longest_path (UFO_GRAPH (graph), (UfoFilterPredicate) is_gpu_task, NULL); common = nodes_with_common_ancestries (graph, path); if (g_list_length (common) > 1) { g_debug ("WARN More than one nodes have multiple inputs, not going to expand"); g_list_free (common); g_list_free (path); return; } if (g_list_length (common) == 1) { GList *it; g_debug ("INFO Found node with multiple inputs, going to prune it"); it = g_list_first (path); while (it->data != common->data) { GList *jt = g_list_next (it); path = g_list_remove_link (path, it); it = jt; } /* remove the common node as well */ path = g_list_remove_link (path, it); g_list_free (common); } if (path != NULL && g_list_length (path) > 0) { GList *predecessors; GList *successors; /* Add predecessor and successor nodes to path */ predecessors = ufo_graph_get_predecessors (UFO_GRAPH (graph), UFO_NODE (g_list_first (path)->data)); successors = ufo_graph_get_successors (UFO_GRAPH (graph), UFO_NODE (g_list_last (path)->data)); if (predecessors != NULL) path = g_list_prepend (path, g_list_first (predecessors)->data); if (successors != NULL) path = g_list_append (path, g_list_first (successors)->data); g_list_free (predecessors); g_list_free (successors); g_debug ("INFO Expand for %i GPU nodes", n_gpus); for (guint i = 1; i < n_gpus; i++) { ufo_graph_expand (UFO_GRAPH (graph), path, &tmp_error); if (tmp_error != NULL) { g_propagate_error (error, tmp_error); break; } } } g_list_free (path); } /** * ufo_task_graph_fuse: * @graph: A #UfoTaskGraph * * Fuses task nodes to increase data locality. * * Note: This is not implemented and a no-op right now. */ void ufo_task_graph_fuse (UfoTaskGraph *graph) { } static void map_proc_node (UfoGraph *graph, UfoNode *node, guint proc_index, GList *gpu_nodes) { UfoNode *proc_node; GList *successors; GList *it; guint n_gpus; proc_node = UFO_NODE (g_list_nth_data (gpu_nodes, proc_index)); if ((ufo_task_uses_gpu (UFO_TASK (node)) || UFO_IS_INPUT_TASK (node)) && (!ufo_task_node_get_proc_node (UFO_TASK_NODE (node)))) { g_debug ("MAP UfoGpuNode-%p -> %s", (gpointer) proc_node, ufo_task_node_get_identifier (UFO_TASK_NODE (node))); ufo_task_node_set_proc_node (UFO_TASK_NODE (node), proc_node); } n_gpus = g_list_length (gpu_nodes); successors = ufo_graph_get_successors (graph, node); g_list_for (successors, it) { map_proc_node (graph, UFO_NODE (it->data), proc_index, gpu_nodes); proc_index = n_gpus > 0 ? (proc_index + 1) % n_gpus : 0; } g_list_free (successors); } /** * ufo_task_graph_is_alright: * @graph: A #UfoTaskGraph * @error: Location for a GError or %NULL * * Check if nodes int the task graph are properly connected. * * Returns: %TRUE if everything is alright, %FALSE else. */ gboolean ufo_task_graph_is_alright (UfoTaskGraph *graph, GError **error) { GList *nodes; GList *it; gboolean alright = TRUE; nodes = ufo_graph_get_nodes (UFO_GRAPH (graph)); /* Check that nodes don't receive input from reductors and processors */ g_list_for (nodes, it) { GList *predecessors; predecessors = ufo_graph_get_predecessors (UFO_GRAPH (graph), UFO_NODE (it->data)); if (g_list_length (predecessors) > 1) { GList *jt; UfoTaskMode combined_modes = UFO_TASK_MODE_INVALID; g_list_for (predecessors, jt) combined_modes |= ufo_task_get_mode (UFO_TASK (jt->data)); if ((combined_modes & UFO_TASK_MODE_PROCESSOR) && (combined_modes & UFO_TASK_MODE_REDUCTOR)) { g_debug ("`%s' receives both processor and reductor inputs which may deadlock.", ufo_task_node_get_plugin_name (UFO_TASK_NODE (it->data))); } } g_list_free (predecessors); } g_list_free (nodes); /* Check leaves are sinks */ nodes = ufo_graph_get_leaves (UFO_GRAPH (graph)); g_list_for (nodes, it) { if ((ufo_task_get_mode (UFO_TASK (it->data)) & UFO_TASK_MODE_TYPE_MASK) != UFO_TASK_MODE_SINK) { alright = FALSE; g_set_error (error, UFO_TASK_GRAPH_ERROR, UFO_TASK_GRAPH_ERROR_BAD_INPUTS, "`%s' is a leaf node but not a sink task", ufo_task_node_get_plugin_name (UFO_TASK_NODE (it->data))); break; } } g_list_free (nodes); return alright; } /** * ufo_task_graph_map: * @graph: A #UfoTaskGraph * @gpu_nodes: (transfer none) (element-type Ufo.GpuNode): List of #UfoGpuNode objects * * Map task nodes of @graph to the list of @gpu_nodes. */ void ufo_task_graph_map (UfoTaskGraph *graph, GList *gpu_nodes) { GList *roots; GList *it; roots = ufo_graph_get_roots (UFO_GRAPH (graph)); g_list_for (roots, it) { map_proc_node (UFO_GRAPH (graph), UFO_NODE (it->data), 0, gpu_nodes); } g_list_free (roots); } /** * ufo_task_graph_connect_nodes: * @graph: A #UfoTaskGraph * @n1: A source node * @n2: A destination node * * Connect @n1 with @n2 using @n2's default input port. To specify any other * port, use ufo_task_graph_connect_nodes_full(). */ void ufo_task_graph_connect_nodes (UfoTaskGraph *graph, UfoTaskNode *n1, UfoTaskNode *n2) { ufo_task_graph_connect_nodes_full (graph, n1, n2, 0); } /** * ufo_task_graph_connect_nodes_full: * @graph: A #UfoTaskGraph * @n1: A source node * @n2: A destination node * @input: Input port of @n2 * * Connect @n1 with @n2 using @n2's @input port. */ void ufo_task_graph_connect_nodes_full (UfoTaskGraph *graph, UfoTaskNode *n1, UfoTaskNode *n2, guint input) { g_debug ("CONN %s -> %s [input=%i]", ufo_task_node_get_identifier (n1), ufo_task_node_get_identifier (n2), input); ufo_graph_connect_nodes (UFO_GRAPH (graph), UFO_NODE (n1), UFO_NODE (n2), GINT_TO_POINTER (input)); } /** * ufo_task_graph_set_partition: * @graph: A #UfoTaskGraph * @index: index of @total partitions - 1 * @total: total number of partitions * * Set the partition of this task graph. */ void ufo_task_graph_set_partition (UfoTaskGraph *graph, guint index, guint total) { g_return_if_fail (UFO_IS_TASK_GRAPH (graph)); g_assert (index < total); graph->priv->index = index; graph->priv->total = total; } /** * ufo_task_graph_get_partition: * @graph: A #UfoTaskGraph * @index: Location to store index * @total: Location to store the total number of partitions * * Get the partition structure of @graph. */ void ufo_task_graph_get_partition (UfoTaskGraph *graph, guint *index, guint *total) { g_return_if_fail (UFO_IS_TASK_GRAPH (graph)); *index = graph->priv->index; *total = graph->priv->total; } static void add_nodes_from_json (UfoTaskGraph *self, JsonNode *root, GError **error) { UfoTaskGraphPrivate *priv = UFO_TASK_GRAPH_GET_PRIVATE(self); JsonObject *root_object = json_node_get_object (root); if (json_object_has_member (root_object, "nodes")) { JsonArray *nodes = json_object_get_array_member (root_object, "nodes"); GList *elements = json_array_get_elements (nodes); GList *it; g_list_for (elements, it) { UfoTaskNode *new_node = create_node_from_json (it->data, priv->manager, error); if (new_node != NULL) { const char *name = ufo_task_node_get_identifier (new_node); if (g_hash_table_lookup (priv->json_nodes, name) != NULL) { g_object_unref (new_node); g_set_error (error, UFO_TASK_GRAPH_ERROR, UFO_TASK_GRAPH_ERROR_JSON_KEY, "Duplicate name `%s' found", name); return; } g_hash_table_insert (priv->json_nodes, g_strdup (name), new_node); } else { g_list_free (elements); return; } } g_list_free (elements); /* * We only check edges if we have nodes, anything else doesn't make much * sense. */ if (json_object_has_member (root_object, "edges")) { JsonArray *edges = json_object_get_array_member (root_object, "edges"); json_array_foreach_element (edges, handle_json_task_edge, self); } } } static void set_property_from_json (JsonObject *object, const gchar *name, JsonNode *node, JsonSetPropertyInfo *info) { GParamSpec *pspec; /* If error is already set before we just return and skip this node. */ if (info->error && *info->error) return; pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (info->task), name); if (pspec == NULL) { g_set_error (info->error, UFO_TASK_GRAPH_ERROR, UFO_TASK_GRAPH_ERROR_JSON_KEY, "Property `%s' does not exist", name); return; } if (JSON_NODE_HOLDS_VALUE (node)) { GValue val = {0,}; json_node_get_value (node, &val); g_object_set_property (G_OBJECT (info->task), name, &val); g_value_unset (&val); } else if (JSON_NODE_HOLDS_ARRAY (node)) { GParamSpecValueArray *vapspec; JsonArray *json_array; GValueArray *value_array; GList *values; GList *it; GValue value_array_val = {0, }; pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (info->task), name); if (pspec->value_type != G_TYPE_VALUE_ARRAY) { g_set_error (info->error, UFO_TASK_GRAPH_ERROR, UFO_TASK_GRAPH_ERROR_JSON_KEY, "`%s' is not an array", name); return; } vapspec = (GParamSpecValueArray *) pspec; json_array = json_node_get_array (node); values = json_array_get_elements (json_array); value_array = g_value_array_new (g_list_length (values)); g_list_for (values, it) { GValue val = {0, }; GValue target_val = {0, }; json_node_get_value ((JsonNode *) it->data, &val); /* * We explicitly transform the value unconditionally to the * target type because the type system is pretty strict and it * is not possible to set a float property with a double value. */ g_value_init (&target_val, vapspec->element_spec->value_type); g_value_transform (&val, &target_val); g_value_array_append (value_array, &target_val); g_value_unset (&target_val); g_value_unset (&val); } g_value_init (&value_array_val, G_TYPE_VALUE_ARRAY); g_value_set_boxed (&value_array_val, value_array); g_object_set_property (G_OBJECT (info->task), name, &value_array_val); g_value_unset (&value_array_val); g_list_free (values); g_value_array_free (value_array); } else if (JSON_NODE_HOLDS_OBJECT (node)) { JsonObject *node_object = json_node_get_object (node); if (json_object_has_member (node_object, "plugin")) { UfoTaskNode *inner_node = create_node_from_json (node, info->manager, info->error); g_object_force_floating (G_OBJECT (inner_node)); g_object_set (G_OBJECT (info->task), name, inner_node, NULL); } else { ufo_task_set_json_object_property (UFO_TASK (node), name, node_object); } } else { g_warning ("`%s' is neither a primitive value, array or object", name); } } static UfoTaskNode * create_node_from_json (JsonNode *json_node, UfoPluginManager *manager, GError **error) { UfoTaskNode *ret_node = NULL; JsonObject *json_object; GError *tmp_error = NULL; const gchar *plugin_name; const gchar *task_name; json_object = json_node_get_object (json_node); if (!json_object_has_member (json_object, "plugin") || !json_object_has_member (json_object, "name")) { g_set_error (error, UFO_TASK_GRAPH_ERROR, UFO_TASK_GRAPH_ERROR_JSON_KEY, "Node does not have `plugin' or `name' key"); return NULL; } plugin_name = json_object_get_string_member (json_object, "plugin"); if (json_object_has_member (json_object, "package")) { const gchar *package_name = json_object_get_string_member (json_object, "package"); ret_node = ufo_plugin_manager_get_task_from_package (manager, package_name, plugin_name, &tmp_error); } else { ret_node = ufo_plugin_manager_get_task (manager, plugin_name, &tmp_error); } ufo_task_node_set_plugin_name (ret_node, plugin_name); if (tmp_error != NULL) { g_propagate_error (error, tmp_error); return NULL; } task_name = json_object_get_string_member (json_object, "name"); ufo_task_node_set_identifier (ret_node, task_name); if (json_object_has_member (json_object, "properties")) { JsonObject *prop_object; JsonSetPropertyInfo info = { .task = ret_node, .manager = manager, .error = error }; prop_object = json_object_get_object_member (json_object, "properties"); json_object_foreach_member (prop_object, (JsonObjectForeach) set_property_from_json, &info); } return ret_node; } static void handle_json_task_edge (JsonArray *array, guint index, JsonNode *element, gpointer user) { UfoTaskGraph *graph = user; UfoTaskGraphPrivate *priv = graph->priv; JsonObject *edge; UfoTaskNode *from_node, *to_node; JsonObject *from_object, *to_object; guint to_port; const gchar *from_name; const gchar *to_name; GError *error = NULL; edge = json_node_get_object (element); if (!json_object_has_member (edge, "from") || !json_object_has_member (edge, "to")) { g_error ("Edge does not have `from' or `to' key"); return; } /* Get from details */ from_object = json_object_get_object_member (edge, "from"); if (!json_object_has_member (from_object, "name")) { g_error ("From node does not have `name' key"); return; } from_name = json_object_get_string_member (from_object, "name"); /* Get to details */ to_object = json_object_get_object_member (edge, "to"); if (!json_object_has_member (to_object, "name")) { g_error ("To node does not have `name' key"); return; } to_name = json_object_get_string_member (to_object, "name"); to_port = 0; if (json_object_has_member (to_object, "input")) to_port = (guint) json_object_get_int_member (to_object, "input"); /* Get actual filters and connect them */ from_node = g_hash_table_lookup (priv->json_nodes, from_name); to_node = g_hash_table_lookup (priv->json_nodes, to_name); if (from_node == NULL) g_error ("No filter `%s' defined", from_name); if (to_node == NULL) g_error ("No filter `%s' defined", to_name); ufo_task_graph_connect_nodes_full (graph, from_node, to_node, to_port); if (error != NULL) g_warning ("%s", error->message); } static JsonObject * create_full_json_from_task_node (UfoTaskNode *task_node) { JsonObject *node_object; JsonNode *prop_node; JsonObject *prop_object; GParamSpec **pspecs; guint n_pspecs; const gchar *plugin_name; const gchar *package_name; const gchar *name; node_object = json_object_new (); plugin_name = ufo_task_node_get_plugin_name (task_node); if (plugin_name == NULL) return NULL; json_object_set_string_member (node_object, "plugin", plugin_name); package_name = ufo_task_node_get_package_name (task_node); if (package_name != NULL) json_object_set_string_member (node_object, "package", package_name); name = ufo_task_node_get_identifier (task_node); g_assert (name != NULL); json_object_set_string_member (node_object, "name", name); prop_node = json_gobject_serialize (G_OBJECT (task_node)); /* Remove num-processed which is a read-only property */ json_object_remove_member (json_node_get_object (prop_node), "num-processed"); prop_object = json_node_get_object (prop_node); pspecs = g_object_class_list_properties (G_OBJECT_GET_CLASS (task_node), &n_pspecs); for (guint i = 0; i < n_pspecs; i++) { GParamSpec *pspec = pspecs[i]; GValue value = { 0, }; /* read only what we can */ if (!(pspec->flags & G_PARAM_READABLE)) continue; /* Process only task node type properties */ if (!UFO_IS_TASK_NODE_CLASS (&(pspec->value_type))) continue; g_value_init (&value, G_PARAM_SPEC_VALUE_TYPE (pspec)); g_object_get_property (G_OBJECT (task_node), pspec->name, &value); /* skip if the value is the default for the property */ if (!g_param_value_defaults (pspec, &value)) { JsonObject *subtask_json_object = create_full_json_from_task_node (g_value_get_object (&value)); json_object_set_object_member (prop_object, pspec->name, subtask_json_object); } g_value_unset (&value); } g_free (pspecs); json_object_set_member (node_object, "properties", prop_node); return node_object; } static void add_task_node_to_json_array (UfoTaskNode *node, JsonArray *array) { json_array_add_object_element (array, create_full_json_from_task_node (node)); } static JsonObject * json_object_from_ufo_node (UfoNode *node) { JsonObject *object; object = json_object_new (); const gchar *unique_name = ufo_task_node_get_identifier (UFO_TASK_NODE (node)); json_object_set_string_member (object, "name", unique_name); return object; } static void ufo_task_graph_dispose (GObject *object) { UfoTaskGraphPrivate *priv; GList *nodes; priv = UFO_TASK_GRAPH_GET_PRIVATE (object); if (priv->manager != NULL) { g_object_unref (priv->manager); priv->manager = NULL; } nodes = g_hash_table_get_values (priv->json_nodes); g_list_foreach (nodes, (GFunc) g_object_unref, NULL); g_list_free (nodes); G_OBJECT_CLASS (ufo_task_graph_parent_class)->dispose (object); } static void ufo_task_graph_finalize (GObject *object) { UfoTaskGraphPrivate *priv; priv = UFO_TASK_GRAPH_GET_PRIVATE (object); g_hash_table_destroy (priv->json_nodes); G_OBJECT_CLASS (ufo_task_graph_parent_class)->finalize (object); } static void ufo_task_graph_class_init (UfoTaskGraphClass *klass) { GObjectClass *oclass; oclass = G_OBJECT_CLASS (klass); oclass->dispose = ufo_task_graph_dispose; oclass->finalize = ufo_task_graph_finalize; g_type_class_add_private(klass, sizeof(UfoTaskGraphPrivate)); } static void ufo_task_graph_init (UfoTaskGraph *self) { UfoTaskGraphPrivate *priv; self->priv = priv = UFO_TASK_GRAPH_GET_PRIVATE (self); priv->manager = NULL; priv->json_nodes = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); priv->index = 0; priv->total = 1; }
ufo-kit/ufo-core
ufo/ufo-task-graph.c
C
lgpl-3.0
30,615
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace _05_Fibonacci_Numbers { class Program { static void Main() { int n = int.Parse(Console.ReadLine()); Console.WriteLine(Fib(n)); } static int Fib(int n) { if (n == 0) { return 1; } else if (n == 1) { return 1; } int oldSum = 1; int newSum = 1; int fibNum = 0; for (int i = 2; i <= n; i++) { fibNum = oldSum + newSum; oldSum = newSum; newSum = fibNum; } return fibNum; } } }
GoldenR1618/SoftUni-Exercises-and-Exams
03.Programming_Fundamentals/03_Methods_Debugging_TC/Exercises/05_Fibonacci_Numbers/Program.cs
C#
unlicense
828
package com.garg.projects.stats.impl.safe.periodic; import java.util.concurrent.atomic.AtomicInteger; import com.garg.projects.stats.MergeableStatistics; import com.garg.projects.stats.ReusableStatistics; import com.garg.projects.stats.Statistics; import com.garg.projects.stats.impl.SimpleMergeableStatistics; import com.garg.projects.stats.impl.SimpleReusableStatistics; import com.garg.projects.stats.impl.safe.SynchronizedStatistics; /** * A thread safe implementation of <code>Statistics</code> that increases * support for concurrent writers by striping the contention on writes. The * event domain is split into <code>STRIPES</code> stripes each guarded by its * lock. * <p> * At any point the stats may be lagging by X ( = INCONSISTENCY_WINDOW) data * points. A window of zero means the stripes are merged on every read. * <p> * Increasing X increases performance at the cost of accuracy (staleness). * <p> * Useful if the data source emits fairly random samples as to cause even * distribution amongst the stripes. * * @author bgarg */ public class StripedLockedStatistics implements Statistics { /** * At any point the stats may be lagging by these many data points. A window * of zero means the stripes are merged on every read. */ public static int INCONSISTENCY_WINDOW = 1000; public final int stripeCount; /** * The global snapshot of the statistics. All reads are performed off this * instance. */ private final MergeableStatistics global = new SynchronizedStatistics.Mergeable( new SimpleMergeableStatistics()); /** * Local stats that are reset after being merged into the global snapshot of * the statistics object. Each of these is guarded by a separate lock. */ private final ReusableStatistics[] stripes; /** * How many writes have happened since last sync to global stats. */ private final AtomicInteger dirtyCount = new AtomicInteger(0); public StripedLockedStatistics(int s) { this.stripeCount = s; this.stripes = new ReusableStatistics[stripeCount]; for (int i = 0; i < stripeCount; i++) { stripes[i] = new SimpleReusableStatistics(); } } /** * {@inheritDoc} */ @Override public void event(int value) { ReusableStatistics stat = stripes[value % stripeCount]; synchronized (stat) { stat.event(value); } dirtyCount.incrementAndGet(); } /** * {@inheritDoc} * <p> * Returns <code>Integer.MAX_VALUE</code> in case no values have been added. */ @Override public int minimum() { syncStripes(); return global.minimum(); } /** * {@inheritDoc} * <p> * Returns <code>Integer.MIN_VALUE</code> in case no values have been added. */ @Override public int maximum() { syncStripes(); return global.maximum(); } /** * {@inheritDoc} * <p> * Returns <code>Float.NaN</code> in case no values have been added. */ @Override public float mean() { syncStripes(); return global.mean(); } /** * {@inheritDoc} * <p> * Returns <code>Float.NaN</code> in case no values have been added. */ @Override public float variance() { syncStripes(); return global.variance(); } private void syncStripes() { if (setIfGreater(dirtyCount, INCONSISTENCY_WINDOW, 0)) { for (int i = 0; i < stripeCount; i++) { ReusableStatistics s = stripes[i]; synchronized (s) { global.merge(s); s.reset(); } } } } /** * The atomic * * <pre> * if (ai.intValue() > comp) { * ai.setVaue(newValue) } * </pre> * * Returns true if set was successful */ private static boolean setIfGreater(AtomicInteger a, int comp, int newValue) { while (true) { int old = a.intValue(); if (old > comp) { if (a.compareAndSet(old, newValue)) { return true; } // Hit a race, retry } else { return false; } } } }
baskin/practice
src/java/com/garg/projects/stats/impl/safe/periodic/StripedLockedStatistics.java
Java
unlicense
4,403
package com.garg.websites.codeeval; import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; /** * http://www.codeeval.com/open_challenges/1/ */ public class cycle_detection { public static void main(String[] args) throws IOException { String file = args[0]; BufferedReader fr = null; try { fr = new BufferedReader(new FileReader(file)); String line = null; while ((line = fr.readLine()) != null) { cycle(line.split(" ")); System.out.println(); } } finally { if (fr != null) { fr.close(); } } } // 2 0 6 3 1 ... 6 3 1.. // 0 -> 6 . // 1 -> 6 . // 2 -> 0 . // 3 -> 1 . // 4 -> 4 // 5 -> 5 // 6 -> 3 . private static void cycle(String[] str) { if (str == null || str.length < 2) { return; } int[] dataset = new int[100]; for (int i = 0; i < 100; i++) { dataset[i] = -1; } int prev = Integer.parseInt(str[0]); int startCycleIndex = -1; for (int i = 1; i < str.length; i++) { int cur = Integer.parseInt(str[i]); if (dataset[prev] != -1 && startCycleIndex == -1) { startCycleIndex = prev; } dataset[prev] = cur; prev = cur; } if (startCycleIndex != -1) { // already visited. cycle detected. printCycle(dataset, startCycleIndex); } } private static void printCycle(int[] set, int startIndex) { System.out.print(startIndex + " "); int cur = set[startIndex]; while (cur != startIndex) { System.out.print(cur + " "); cur = set[cur]; } } }
baskin/practice
src/java/com/garg/websites/codeeval/cycle_detection.java
Java
unlicense
1,577
package mx.liba.vault.config; import java.util.Properties; import javax.sql.DataSource; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.data.jpa.repository.config.EnableJpaRepositories; import org.springframework.orm.hibernate4.HibernateTransactionManager; import org.springframework.orm.hibernate4.LocalSessionFactoryBean; import org.springframework.transaction.annotation.EnableTransactionManagement; /** * Clase de configuracion a base de datos. * @author carlos herrera */ @Configuration @EnableTransactionManagement @EnableJpaRepositories public class DatabaseConfig { @Value("${db.driver}") private String DB_DRIVER; @Value("${db.password}") private String DB_PASSWORD; @Value("${db.url}") private String DB_URL; @Value("${db.username}") private String DB_USERNAME; @Value("${hibernate.dialect}") private String HIBERNATE_DIALECT; @Value("${hibernate.show_sql}") private String HIBERNATE_SHOW_SQL; @Value("${hibernate.hbm2ddl.auto}") private String HIBERNATE_HBM2DDL_AUTO; @Value("${entitymanager.packagesToScan}") private String ENTITYMANAGER_PACKAGES_TO_SCAN; @Value("${hibernate.maxActive}") private Integer MAX_ACTIVE; @Value("${hibernate.maxIdle}") private Integer MAX_IDLE; @Value("${hibernate.minIdle}") private Integer MIN_IDLE; @Value("${hibernate.initialSize}") private Integer INITIAL_SIZE; @Bean(name = "dataSource", destroyMethod="close") public DataSource dataSource() { org.apache.tomcat.jdbc.pool.DataSource dataSource = new org.apache.tomcat.jdbc.pool.DataSource(); dataSource.setDriverClassName(DB_DRIVER); dataSource.setUrl(DB_URL); dataSource.setUsername(DB_USERNAME); dataSource.setPassword(DB_PASSWORD); dataSource.setInitialSize(INITIAL_SIZE); dataSource.setMaxActive(MAX_ACTIVE); dataSource.setMaxIdle(MAX_IDLE); dataSource.setMinIdle(MIN_IDLE); dataSource.setSuspectTimeout(60); dataSource.setTimeBetweenEvictionRunsMillis(10000); dataSource.setMinEvictableIdleTimeMillis(10000); dataSource.setTestOnBorrow(true); dataSource.setValidationQuery("SELECT 1"); return dataSource; } @Bean(name = "sessionFactory") public LocalSessionFactoryBean sessionFactory() { LocalSessionFactoryBean sessionFactoryBean = new LocalSessionFactoryBean(); sessionFactoryBean.setDataSource(dataSource()); sessionFactoryBean.setPackagesToScan(ENTITYMANAGER_PACKAGES_TO_SCAN); Properties hibernateProperties = new Properties(); hibernateProperties.put("hibernate.dialect", HIBERNATE_DIALECT); hibernateProperties.put("hibernate.show_sql", HIBERNATE_SHOW_SQL); hibernateProperties.put("hibernate.hbm2ddl.auto", HIBERNATE_HBM2DDL_AUTO); sessionFactoryBean.setHibernateProperties(hibernateProperties); return sessionFactoryBean; } @Bean(name = "transactionManager") public HibernateTransactionManager transactionManager() { HibernateTransactionManager transactionManager = new HibernateTransactionManager(); transactionManager.setSessionFactory(sessionFactory().getObject()); return transactionManager; } }
LIBAMX/Vault
src/main/java/mx/liba/vault/config/DatabaseConfig.java
Java
unlicense
3,178
package com.lysum.service.file.exception; import org.apache.commons.fileupload.FileUploadException; /** * 文件类型和扩展名不匹配异常 * * @author zhangQ * @create date: 2014-12-1 */ public class MismatchExtensionException extends FileUploadException { private static final long serialVersionUID = -2036086476886786243L; private String contentType; private String extension; private String filename; public MismatchExtensionException(String contentType, String extension, String filename) { super("filename : [" + filename + "], extension : [" + extension + "], File Content-Type and extensions do not match : [" +contentType+ "]"); this.contentType = contentType; this.extension = extension; this.filename = filename; } public String getExtension() { return extension; } public String getFilename() { return filename; } public String getContentType() { return contentType; } }
linfengsoftware/sourcecode
lysum/src/main/java/com/lysum/service/file/exception/MismatchExtensionException.java
Java
unlicense
992
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title>New Project</title> <!-- magic meta tag --> <meta name="viewport" content="width=device-width,initial-scale=1.0"> <!-- favicon --> <link rel="shortcut icon" href="favicon.ico"> <!-- stylesheets --> <link href="http://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet" type="text/css" /> <link href="css/qs.min.css" rel="stylesheet"/> <!-- jquery --> <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <!-- jquery older versions <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script> <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> --> <!-- scripts <script type="text/javascript" src="js/" ></script> --> <!-- dont forget IE :( --> <!--[if lte IE 7]> <link rel="stylesheet" href="css/ie.css" /> <![endif]--> <!--[if lt IE 9]> <script src="js/html5shiv.js"></script> <![endif]--> </head> <body> <!-- contents --> <div class="grid"> <div class="row"> </div> </div> </body> </html>
achavazza/qs
index.html
HTML
unlicense
1,376
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>AndroidPackageParams - FAKE - F# Make</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="description" content=""> <meta name="author" content="Steffen Forkmann, Mauricio Scheffer, Colin Bull"> <script src="https://code.jquery.com/jquery-1.8.0.js"></script> <script src="https://code.jquery.com/ui/1.8.23/jquery-ui.js"></script> <script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/js/bootstrap.min.js"></script> <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script> <link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet"> <link type="text/css" rel="stylesheet" href="http://fsharp.github.io/FAKE/content/style.css" /> <script type="text/javascript" src="http://fsharp.github.io/FAKE/content/tips.js"></script> <!-- HTML5 shim, for IE6-8 support of HTML5 elements --> <!--[if lt IE 9]> <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="masthead"> <ul class="nav nav-pills pull-right"> <li><a href="http://fsharp.org">fsharp.org</a></li> <li><a href="http://github.com/fsharp/fake">github page</a></li> </ul> <h3 class="muted"><a href="http://fsharp.github.io/FAKE/index.html">FAKE - F# Make</a></h3> </div> <hr /> <div class="row"> <div class="span9" id="main"> <h1>AndroidPackageParams</h1> <div class="xmldoc"> <p>The Android packaging parameter type</p> </div> <h3>Record Fields</h3> <table class="table table-bordered member-list"> <thead> <tr><td>Record Field</td><td>Description</td></tr> </thead> <tbody> <tr> <td class="member-name"> <code onmouseout="hideTip(event, '1832', 1832)" onmouseover="showTip(event, '1832', 1832)"> Configuration </code> <div class="tip" id="1832"> <strong>Signature:</strong> string<br /> </div> </td> <td class="xmldoc"> <a href="https://github.com/fsharp/FAKE/blob/master/src/app/FakeLib/XamarinHelper.fs#L77-77" class="github-link"> <img src="../content/img/github.png" class="normal" /> <img src="../content/img/github-blue.png" class="hover" /> </a> <p>Build configuration, defaults to 'Release'</p> </td> </tr> <tr> <td class="member-name"> <code onmouseout="hideTip(event, '1833', 1833)" onmouseover="showTip(event, '1833', 1833)"> OutputPath </code> <div class="tip" id="1833"> <strong>Signature:</strong> string<br /> </div> </td> <td class="xmldoc"> <a href="https://github.com/fsharp/FAKE/blob/master/src/app/FakeLib/XamarinHelper.fs#L79-79" class="github-link"> <img src="../content/img/github.png" class="normal" /> <img src="../content/img/github-blue.png" class="hover" /> </a> <p>Output path for build, defaults to 'bin/Release'</p> </td> </tr> <tr> <td class="member-name"> <code onmouseout="hideTip(event, '1834', 1834)" onmouseover="showTip(event, '1834', 1834)"> ProjectPath </code> <div class="tip" id="1834"> <strong>Signature:</strong> string<br /> </div> </td> <td class="xmldoc"> <a href="https://github.com/fsharp/FAKE/blob/master/src/app/FakeLib/XamarinHelper.fs#L75-75" class="github-link"> <img src="../content/img/github.png" class="normal" /> <img src="../content/img/github-blue.png" class="hover" /> </a> <p>(Required) Path to the Android project file (not the solution file!)</p> </td> </tr> </tbody> </table> </div> <div class="span3"> <a href="http://fsharp.github.io/FAKE/index.html"> <img src="http://fsharp.github.io/FAKE/pics/logo.png" style="width:140px;height:140px;margin:10px 0px 0px 35px;border-style:none;" /> </a> <ul class="nav nav-list" id="menu"> <li class="nav-header">FAKE - F# Make</li> <li class="divider"></li> <li><a href="http://fsharp.github.io/FAKE/index.html">Home page</a></li> <li class="divider"></li> <li><a href="https://www.nuget.org/packages/FAKE">Get FAKE - F# Make via NuGet</a></li> <li><a href="http://github.com/fsharp/fake">Source Code on GitHub</a></li> <li><a href="http://github.com/fsharp/fake/blob/master/License.txt">License (Apache 2)</a></li> <li><a href="http://fsharp.github.io/FAKE/RELEASE_NOTES.html">Release Notes</a></li> <li><a href="http://fsharp.github.io/FAKE//contributing.html">Contributing to FAKE - F# Make</a></li> <li><a href="http://fsharp.github.io/FAKE/users.html">Who is using FAKE?</a></li> <li><a href="http://stackoverflow.com/questions/tagged/f%23-fake">Ask a question</a></li> <li class="nav-header">Tutorials</li> <li><a href="http://fsharp.github.io/FAKE/gettingstarted.html">Getting started</a></li> <li class="divider"></li> <li><a href="http://fsharp.github.io/FAKE/nuget.html">NuGet package restore</a></li> <li><a href="http://fsharp.github.io/FAKE/fxcop.html">Using FxCop in a build</a></li> <li><a href="http://fsharp.github.io/FAKE/assemblyinfo.html">Generating AssemblyInfo</a></li> <li><a href="http://fsharp.github.io/FAKE/create-nuget-package.html">Create NuGet packages</a></li> <li><a href="http://fsharp.github.io/FAKE/specifictargets.html">Running specific targets</a></li> <li><a href="http://fsharp.github.io/FAKE/commandline.html">Running FAKE from command line</a></li> <li><a href="http://fsharp.github.io/FAKE/parallel-build.html">Running targets in parallel</a></li> <li><a href="http://fsharp.github.io/FAKE/fsc.html">Using the F# compiler from FAKE</a></li> <li><a href="http://fsharp.github.io/FAKE/customtasks.html">Creating custom tasks</a></li> <li><a href="http://fsharp.github.io/FAKE/teamcity.html">TeamCity integration</a></li> <li><a href="http://fsharp.github.io/FAKE/canopy.html">Running canopy tests</a></li> <li><a href="http://fsharp.github.io/FAKE/octopusdeploy.html">Octopus Deploy</a></li> <li><a href="http://fsharp.github.io/FAKE/typescript.html">TypeScript support</a></li> <li><a href="http://fsharp.github.io/FAKE/azurewebjobs.html">Azure WebJobs support</a></li> <li><a href="http://fsharp.github.io/FAKE/azurecloudservices.html">Azure Cloud Services support</a></li> <li><a href="http://fsharp.github.io/FAKE/androidpublisher.html">Android publisher</a></li> <li><a href="http://fsharp.github.io/FAKE/watch.html">File Watcher</a></li> <li class="divider"></li> <li><a href="http://fsharp.github.io/FAKE/deploy.html">Fake.Deploy</a></li> <li class="nav-header">Reference</li> <li><a href="http://fsharp.github.io/FAKE/apidocs/index.html">API Reference</a></li> </ul> </div> </div> </div> <a href="http://github.com/fsharp/fake"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png" alt="Fork me on GitHub"></a> </body> </html>
Slesa/Poseidon
src/packages/FAKE/docs/apidocs/fake-xamarinhelper-androidpackageparams.html
HTML
unlicense
7,918
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.17626 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ namespace TwitchStatusDev.Resources { using System; /// <summary> /// A strongly-typed resource class, for looking up localized strings, etc. /// </summary> // This class was auto-generated by the StronglyTypedResourceBuilder // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] public class AppResources { private static global::System.Resources.ResourceManager resourceMan; private static global::System.Globalization.CultureInfo resourceCulture; [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal AppResources() { } /// <summary> /// Returns the cached ResourceManager instance used by this class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] public static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("TwitchStatusDev.Resources.AppResources", typeof(AppResources).Assembly); resourceMan = temp; } return resourceMan; } } /// <summary> /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] public static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } /// <summary> /// Looks up a localized string similar to LeftToRight. /// </summary> public static string ResourceFlowDirection { get { return ResourceManager.GetString("ResourceFlowDirection", resourceCulture); } } /// <summary> /// Looks up a localized string similar to us-EN. /// </summary> public static string ResourceLanguage { get { return ResourceManager.GetString("ResourceLanguage", resourceCulture); } } /// <summary> /// Looks up a localized string similar to MY APPLICATION. /// </summary> public static string ApplicationTitle { get { return ResourceManager.GetString("ApplicationTitle", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Sample Runtime Property Value. /// </summary> public static string SampleProperty { get { return ResourceManager.GetString("SampleProperty", resourceCulture); } } /// <summary> /// Looks up a localized string similar to button text. /// </summary> public static string AppBarButtonText { get { return ResourceManager.GetString("AppBarButtonText", resourceCulture); } } /// <summary> /// Looks up a localized string similar to menu item. /// </summary> public static string AppBarMenuItemText { get { return ResourceManager.GetString("AppBarMenuItemText", resourceCulture); } } } }
pmiguel/twitchstatus
TwitchStatus/TwitchStatusDev/Resources/AppResources.Designer.cs
C#
unlicense
4,707
call compile tree call compile tercursor call compile rock_1 call compile popcan call compile army call compile bench
jeffrey-io/wall-of-shame
2000/AntColony/AntColonyPre/static_models/source/makeall.bat
Batchfile
unlicense
122
using System.CodeDom.Compiler; using System.ComponentModel; using System.Diagnostics; using System.Drawing; using System.Globalization; using System.Resources; using System.Runtime.CompilerServices; namespace SemtechLib.Devices.SX1231.Properties { [DebuggerNonUserCode] [GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [CompilerGenerated] internal class Resources { private static ResourceManager resourceMan; private static CultureInfo resourceCulture; [EditorBrowsable(EditorBrowsableState.Advanced)] internal static ResourceManager ResourceManager { get { if (object.ReferenceEquals((object)Resources.resourceMan, (object)null)) Resources.resourceMan = new ResourceManager("SemtechLib.Devices.SX1231.Properties.Resources", typeof(Resources).Assembly); return Resources.resourceMan; } } [EditorBrowsable(EditorBrowsableState.Advanced)] internal static CultureInfo Culture { get { return Resources.resourceCulture; } set { Resources.resourceCulture = value; } } internal static Bitmap _109_AllAnnotations_Default_16x16_72 { get { return (Bitmap)Resources.ResourceManager.GetObject("_109_AllAnnotations_Default_16x16_72", Resources.resourceCulture); } } internal Resources() { } } }
x893/RFM6X-TOOL
HopeRFLib.Devices.RFM6X/Properties/Resources.cs
C#
unlicense
1,322
#include "image.h" struct Bitmap* bitmap_create(int res[]) { struct Bitmap* B = malloc(sizeof(struct Bitmap)); B->width = res[0]; B->height = res[1]; B->pixels = malloc(sizeof(struct Pixel)*res[0]*res[1]); return B; } struct Pixel* bitmap_get_pixel(struct Bitmap* bitmap, size_t x, size_t y) { return bitmap->pixels + bitmap->width*y + x; } void bitmap_set_pixel(struct Bitmap* bitmap, size_t x, size_t y, uint8_t color[]) { struct Pixel* pixel = bitmap_get_pixel(bitmap, x, bitmap->height-y-1); pixel->red = color[0]; pixel->green = color[1]; pixel->blue = color[2]; } bool bitmap_save_png(struct Bitmap *bitmap, char* png_file_path) { FILE* f_png; png_structp png_ptr = NULL; png_infop info_ptr = NULL; size_t x, y; png_byte** row_pointers = NULL; f_png = fopen(png_file_path, "wb"); png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); info_ptr = png_create_info_struct(png_ptr); if (!png_ptr) { fprintf(stderr, "image: 'png_create_write_struct' failed!\n"); } if (!info_ptr) { fprintf(stderr, "image: 'png_create_info_struct' failed!\n"); } if (f_png == NULL) { fprintf(stderr, "image: failed to open file '%s' for output.\n", png_file_path); return false; } /* set image attributes */ png_set_IHDR(png_ptr, info_ptr, bitmap->width, bitmap->height, PNG_BIT_DEPTH, PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); /* initialize rows of PNG */ row_pointers = png_malloc(png_ptr, bitmap->height * sizeof(png_byte *)); for (y = 0; y < bitmap->height; y++) { png_byte *row = png_malloc(png_ptr, sizeof(uint8_t)*bitmap->width*PIXEL_SIZE); row_pointers[y] = row; for (x = 0; x < bitmap->width; x++) { struct Pixel* pixel = bitmap_get_pixel(bitmap, x, y); *row++ = pixel->red; *row++ = pixel->green; *row++ = pixel->blue; } } /* write the image data to file */ png_init_io(png_ptr, f_png); png_set_rows(png_ptr, info_ptr, row_pointers); png_write_png(png_ptr, info_ptr, PNG_TRANSFORM_IDENTITY, NULL); printf("image: bitmap written to '%s'.\n", png_file_path); for (y = 0; y < bitmap->height; y++) { png_free(png_ptr, row_pointers[y]); } png_free(png_ptr, row_pointers); fclose(f_png); return true; } void bitmap_free(struct Bitmap* bitmap) { free(bitmap->pixels); free(bitmap); }
hellux/3d-projection
common/image.c
C
unlicense
2,697
class ImmutableList { private ImmutableNode[] list; ImmutableList(int length) { // we create an array filled with 0 // where every Node points to the next // last Node points to null list = new ImmutableNode[length]; list[length-1] = new ImmutableNode(0, null); for(int i = length-2; i>=0; i--) { list[i] = new ImmutableNode(0, list[i+1]); } } int get(int idx) throws ArrayIndexOutOfBoundsException { if (idx>=list.length) { throw new ArrayIndexOutOfBoundsException(); } else { return list[idx].getVal(); } } void append(int newElement) { // create a new array of size n+1 into list // and copy everything into it ImmutableNode[] temp = new ImmutableNode[list.length]; System.arraycopy(list, 0, temp, 0, list.length); ImmutableNode[] list = new ImmutableNode[temp.length+1]; System.arraycopy(temp, 0, list, 0, temp.length); ImmutableNode newImmutableNode = new ImmutableNode(newElement, null); list[list.length-2] = new ImmutableNode(list[list.length-2].getVal(), newImmutableNode); list[list.length-1] = newImmutableNode; } public String toString() { String s = "{ "; for (int i=0; i<list.length-1; i++) { s += list[i].toString() + ",\n"; } s += list[list.length-1].toString() + " }"; return s; } }
gforien/Java-Work
perso/immutabilite/ImmutableList.java
Java
unlicense
1,490
-- | To represent a "package-name.cabal" file. -- We only care about the dependencies, but we also need to preserve -- everything else (including the whitespace!) because we will write the file -- back to disk and we don't want to obliterate the user's indentation style. module CabalFile.Types where import Data.Either import Distribution.Package import Distribution.Version -- The Cabal library already has the type Distribution.PackageDescription, and -- it already has a parser and a pretty-printer. However, we cannot use that -- representation because we need to keep the whitespace information intact. type Cabal = [Either String Dependency] dependencies :: Cabal -> [Dependency] dependencies = rights packages :: Cabal -> [PackageName] packages = map package . dependencies where package :: Dependency -> PackageName package (Dependency p _) = p -- Replace the given dependencies (//) :: Cabal -> [(PackageName, VersionRange)] -> Cabal [] // _ = [] (Left s:xs) // ds = Left s : (xs // ds) (Right (Dependency p v):xs) // ds = case lookup p ds of Nothing -> Right (Dependency p v) : (xs // ds) Just v' -> Right (Dependency p v') : (xs // ds)
gelisam/cabal-rangefinder
src/CabalFile/Types.hs
Haskell
unlicense
1,179
# uncompyle6 version 2.9.10 # Python bytecode 2.7 (62211) # Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10) # [GCC 6.2.0 20161005] # Embedded file name: stats.py """Statistics analyzer for HotShot.""" import profile import pstats import hotshot.log from hotshot.log import ENTER, EXIT def load(filename): return StatsLoader(filename).load() class StatsLoader: def __init__(self, logfn): self._logfn = logfn self._code = {} self._stack = [] self.pop_frame = self._stack.pop def load(self): p = Profile() p.get_time = _brokentimer log = hotshot.log.LogReader(self._logfn) taccum = 0 for event in log: what, (filename, lineno, funcname), tdelta = event if tdelta > 0: taccum += tdelta if what == ENTER: frame = self.new_frame(filename, lineno, funcname) p.trace_dispatch_call(frame, taccum * 1e-06) taccum = 0 elif what == EXIT: frame = self.pop_frame() p.trace_dispatch_return(frame, taccum * 1e-06) taccum = 0 return pstats.Stats(p) def new_frame(self, *args): try: code = self._code[args] except KeyError: code = FakeCode(*args) self._code[args] = code if self._stack: back = self._stack[-1] else: back = None frame = FakeFrame(code, back) self._stack.append(frame) return frame class Profile(profile.Profile): def simulate_cmd_complete(self): pass class FakeCode: def __init__(self, filename, firstlineno, funcname): self.co_filename = filename self.co_firstlineno = firstlineno self.co_name = self.__name__ = funcname class FakeFrame: def __init__(self, code, back): self.f_back = back self.f_code = code def _brokentimer(): raise RuntimeError, 'this timer should not be called'
DarthMaulware/EquationGroupLeaks
Leak #5 - Lost In Translation/windows/Resources/Python/Core/Lib/hotshot/stats.py
Python
unlicense
2,053
<!DOCTYPE html> <html> <head> <title>SIMPaten Sumbawa Barat</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="shortcut icon" href="<?php echo base_url(); ?>assets/img/ksb.png"/> <!--page level css --> <link href="<?php echo base_url(); ?>assets/css/bootstrap.min.css" rel="stylesheet"> <link href="<?php echo base_url(); ?>assets/vendors/iCheck/css/all.css" rel="stylesheet"> <link href="<?php echo base_url(); ?>assets/vendors/bootstrapvalidator/css/bootstrapValidator.min.css" rel="stylesheet"/> <link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>assets/vendors/sweetalert2/css/sweetalert2.min.css"/> <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Tangerine"> <link href="<?php echo base_url(); ?>assets/css/pages/login_register.css" rel="stylesheet"> <!--end of page level css--> <style type="text/css"> body { background-image: url('<?php echo base_url(); ?>assets/img/backgrounds/1.jpg'); background-color: #cccccc; } .signin-form{ background-image: url('<?php echo base_url(); ?>assets/img/backgrounds/hello.jpg'); background-color: transparent; } </style> </head> <body > <div class="container"> <div class="row"> <div class="col-md-4 col-md-offset-4 col-sm-6 col-sm-offset-3 col-xs-10 col-xs-offset-1 signin-form" style="opacity: 0.8" > <div class="panel-header"> <div class="row"> <div class="col-md-12"> <h2 class="text-center page-name" style="font-family: ; font-size: 30px;"> <div class="row">SIMPaten</div> <div class="row">Sumbawa Barat</div> </h2> </div> </div> </div> <div class="panel-body"> <div class="row"> <div class="col-md-12"> <span class="active page-name">Masuk</span> </div> </div> <div class="row"> <form role="form" action="" method="post" class="login-form"> <div class="col-md-12"> <div class="form-group"> <label for="email"> Nama Pengguna</label> <input type="text" class="form-control form-control-lg" id="form-username" name="form-username" placeholder="Nama Pengguna"> </div> </div> <div class="col-md-12"> <div class="form-group"> <label for="password">Kata Sandi</label> <input type="password" class="form-control form-control-lg" id="form-password" name="form-password" placeholder="Kata Sandi"> <input type="hidden" id="mask" name="mask" /> </div> </div> <div class="col-md-12"> &nbsp; </div> <div class="col-md-12"> <div class="form-group"> <button type="button" class="btn btn-primary" id="masuk">Masuk !</button> </div> </div> <div class="col-md-12"> <hr class="separator"> </div> <div class="col-md-12 text-center"> &nbsp; </div> </form> </div> </div> </div> </div> </div> <!-- begining of page level js --> <script src="<?php echo base_url(); ?>assets/js/jquery.min.js" type="text/javascript"></script> <script src="<?php echo base_url(); ?>assets/js/bootstrap.min.js" type="text/javascript"></script> <script src="<?php echo base_url(); ?>assets/js/jquery-1.11.1.min.js"></script> <script src="<?php echo base_url(); ?>assets/js/jquery.backstretch.min.js"></script> <script src="<?php echo base_url(); ?>assets/vendors/iCheck/js/icheck.js"></script> <script src="<?php echo base_url(); ?>assets/vendors/bootstrapvalidator/js/bootstrapValidator.min.js" type="text/javascript"></script> <script src="<?php echo base_url(); ?>assets/js/pages/login_register.js"></script> <script type="text/javascript" src="<?php echo base_url(); ?>assets/vendors/sweetalert2/js/sweetalert2.min.js"></script> <script type="text/javascript" src="<?php echo base_url(); ?>assets/js/pages/alerts.js"></script> <script src="<?php echo base_url(); ?>assets/js/jquery.md5.js"></script> <script type="text/javascript"> $(document).ready(function(){ $('#masuk').on('click', function () { $("#mask").val($.md5($("#form-password").val())); $("#form-password").val(''); var username = $("#form-username").val(); var mask = $("#mask").val(); var data = 'username='+ username + '&mask='+ mask; $.ajax({ url : '<?php echo site_url("login/ceklogin") ?>', type : 'post', dataType : 'json', data : data, success : function(hasil){ if(hasil.error == false && hasil.level == 1) { swal({ title: 'Login Berhasil', text: 'Anda Login Sebagai Operator Kecamatan', type: 'success', buttonsStyling: false, confirmButtonClass: 'btn btn-primary' }); window.location.href = '<?php echo site_url("admin"); ?>'; }else if(hasil.error == false && hasil.level == 2){ swal({ title: 'Login Berhasil', text: 'Anda Login Sebagai Admin Kabupaten', type: 'success', buttonsStyling: false, confirmButtonClass: 'btn btn-primary' }); window.location.href = '<?php echo site_url("kabupaten"); ?>'; }else if(hasil.error == false && hasil.level == 3){ swal({ title: 'Login Berhasil', text: 'Anda Login Sebagai Super Admin', type: 'success', buttonsStyling: false, confirmButtonClass: 'btn btn-primary' }); window.location.href = '<?php echo site_url("super_admin"); ?>'; }else if(hasil.error == false && hasil.level == 4){ swal({ title: 'Login Berhasil', text: 'Anda Login Sebagai Petugas Verifikasi Kecamatan', type: 'success', buttonsStyling: false, confirmButtonClass: 'btn btn-primary' }); window.location.href = '<?php echo site_url("app_kecamatan"); ?>'; }else if(hasil.error == false && hasil.level == 5){ swal({ title: 'Login Berhasil', text: 'Anda Login Sebagai Admin Kecamatan', type: 'success', buttonsStyling: false, confirmButtonClass: 'btn btn-primary' }); window.location.href = '<?php echo site_url("operator_kecamatan"); ?>'; } else { swal({ buttonsStyling: false, confirmButtonClass: 'btn btn-danger', title: 'Login Gagal', text: 'Kombinasi Username Dan Password Anda Salah', type: 'error' } ) } } }); }); }); </script> <!-- end of page level js --> </body> </html>
NizarHafizulllah/simpatenksb
application/modules/login/views/login_view.php
PHP
unlicense
10,543
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_07) on Fri Oct 31 18:27:06 CET 2008 --> <TITLE> Uses of Package org.springframework.ui.context (Spring Framework API 2.5) </TITLE> <META NAME="date" CONTENT="2008-10-31"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Package org.springframework.ui.context (Spring Framework API 2.5)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html?org/springframework/ui/context/package-use.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="package-use.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <CENTER> <H2> <B>Uses of Package<br>org.springframework.ui.context</B></H2> </CENTER> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Packages that use <A HREF="../../../../org/springframework/ui/context/package-summary.html">org.springframework.ui.context</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#org.springframework.ui.context"><B>org.springframework.ui.context</B></A></TD> <TD>Contains classes defining the application context subinterface for UI applications.&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#org.springframework.ui.context.support"><B>org.springframework.ui.context.support</B></A></TD> <TD>Classes supporting the org.springframework.ui.context package.&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#org.springframework.web.context.support"><B>org.springframework.web.context.support</B></A></TD> <TD>Classes supporting the <code>org.springframework.web.context</code> package, such as WebApplicationContext implementations and various utility classes.&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#org.springframework.web.servlet"><B>org.springframework.web.servlet</B></A></TD> <TD>Provides servlets that integrate with the application context infrastructure, and the core interfaces and classes for the Spring web MVC framework.&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#org.springframework.web.servlet.support"><B>org.springframework.web.servlet.support</B></A></TD> <TD>Support classes for Spring's web MVC framework.&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <A NAME="org.springframework.ui.context"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Classes in <A HREF="../../../../org/springframework/ui/context/package-summary.html">org.springframework.ui.context</A> used by <A HREF="../../../../org/springframework/ui/context/package-summary.html">org.springframework.ui.context</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><B><A HREF="../../../../org/springframework/ui/context/class-use/Theme.html#org.springframework.ui.context"><B>Theme</B></A></B> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A Theme can resolve theme-specific messages, codes, file paths, etcetera (e&#46;g&#46; CSS and image files in a web environment).</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><B><A HREF="../../../../org/springframework/ui/context/class-use/ThemeSource.html#org.springframework.ui.context"><B>ThemeSource</B></A></B> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Interface to be implemented by objects that can resolve <A HREF="../../../../org/springframework/ui/context/Theme.html" title="interface in org.springframework.ui.context"><CODE>Themes</CODE></A>.</TD> </TR> </TABLE> &nbsp; <P> <A NAME="org.springframework.ui.context.support"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Classes in <A HREF="../../../../org/springframework/ui/context/package-summary.html">org.springframework.ui.context</A> used by <A HREF="../../../../org/springframework/ui/context/support/package-summary.html">org.springframework.ui.context.support</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><B><A HREF="../../../../org/springframework/ui/context/class-use/HierarchicalThemeSource.html#org.springframework.ui.context.support"><B>HierarchicalThemeSource</B></A></B> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sub-interface of ThemeSource to be implemented by objects that can resolve theme messages hierarchically.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><B><A HREF="../../../../org/springframework/ui/context/class-use/Theme.html#org.springframework.ui.context.support"><B>Theme</B></A></B> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A Theme can resolve theme-specific messages, codes, file paths, etcetera (e&#46;g&#46; CSS and image files in a web environment).</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><B><A HREF="../../../../org/springframework/ui/context/class-use/ThemeSource.html#org.springframework.ui.context.support"><B>ThemeSource</B></A></B> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Interface to be implemented by objects that can resolve <A HREF="../../../../org/springframework/ui/context/Theme.html" title="interface in org.springframework.ui.context"><CODE>Themes</CODE></A>.</TD> </TR> </TABLE> &nbsp; <P> <A NAME="org.springframework.web.context.support"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Classes in <A HREF="../../../../org/springframework/ui/context/package-summary.html">org.springframework.ui.context</A> used by <A HREF="../../../../org/springframework/web/context/support/package-summary.html">org.springframework.web.context.support</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><B><A HREF="../../../../org/springframework/ui/context/class-use/Theme.html#org.springframework.web.context.support"><B>Theme</B></A></B> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A Theme can resolve theme-specific messages, codes, file paths, etcetera (e&#46;g&#46; CSS and image files in a web environment).</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><B><A HREF="../../../../org/springframework/ui/context/class-use/ThemeSource.html#org.springframework.web.context.support"><B>ThemeSource</B></A></B> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Interface to be implemented by objects that can resolve <A HREF="../../../../org/springframework/ui/context/Theme.html" title="interface in org.springframework.ui.context"><CODE>Themes</CODE></A>.</TD> </TR> </TABLE> &nbsp; <P> <A NAME="org.springframework.web.servlet"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Classes in <A HREF="../../../../org/springframework/ui/context/package-summary.html">org.springframework.ui.context</A> used by <A HREF="../../../../org/springframework/web/servlet/package-summary.html">org.springframework.web.servlet</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><B><A HREF="../../../../org/springframework/ui/context/class-use/ThemeSource.html#org.springframework.web.servlet"><B>ThemeSource</B></A></B> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Interface to be implemented by objects that can resolve <A HREF="../../../../org/springframework/ui/context/Theme.html" title="interface in org.springframework.ui.context"><CODE>Themes</CODE></A>.</TD> </TR> </TABLE> &nbsp; <P> <A NAME="org.springframework.web.servlet.support"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Classes in <A HREF="../../../../org/springframework/ui/context/package-summary.html">org.springframework.ui.context</A> used by <A HREF="../../../../org/springframework/web/servlet/support/package-summary.html">org.springframework.web.servlet.support</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><B><A HREF="../../../../org/springframework/ui/context/class-use/Theme.html#org.springframework.web.servlet.support"><B>Theme</B></A></B> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A Theme can resolve theme-specific messages, codes, file paths, etcetera (e&#46;g&#46; CSS and image files in a web environment).</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><B><A HREF="../../../../org/springframework/ui/context/class-use/ThemeSource.html#org.springframework.web.servlet.support"><B>ThemeSource</B></A></B> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Interface to be implemented by objects that can resolve <A HREF="../../../../org/springframework/ui/context/Theme.html" title="interface in org.springframework.ui.context"><CODE>Themes</CODE></A>.</TD> </TR> </TABLE> &nbsp; <P> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html?org/springframework/ui/context/package-use.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="package-use.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> <i>Copyright &copy; 2002-2008 <a href=http://www.springframework.org/ target=_top>The Spring Framework</a>.</i> <!-- Begin LoopFuse code --> <script src=http://loopfuse.net/webrecorder/js/listen.js type=text/javascript> </script> <script type=text/javascript> _lf_cid = LF_48be82fa; _lf_remora(); </script> <!-- End LoopFuse code --> </BODY> </HTML>
codeApeFromChina/resource
frame_packages/java_libs/spring-2.5.6-src/docs/api/org/springframework/ui/context/package-use.html
HTML
unlicense
14,756
const unsigned char imageRLE[341]={ 0x01,0x00,0x01,0x3d,0x23,0x00,0x01,0x0e,0x80,0x80,0x00,0x82,0x80,0x83,0x00,0x83, 0x00,0x82,0x00,0x82,0x80,0x00,0x82,0x80,0x00,0x01,0x0f,0x86,0x80,0x00,0x80,0x01, 0x02,0x00,0x81,0x5c,0x81,0x00,0x86,0x00,0x00,0x84,0x83,0x00,0x01,0x0f,0x85,0x00, 0x00,0x85,0x00,0x84,0x00,0x85,0x00,0x84,0x00,0x84,0x80,0x00,0x80,0x85,0x00,0x01, 0x84,0x82,0x80,0x01,0x05,0x83,0x00,0x82,0x80,0x80,0x83,0x00,0x01,0x04,0x82,0x80, 0x01,0x06,0x83,0x00,0x01,0x04,0x81,0x8d,0x01,0x05,0x84,0x83,0x81,0x8d,0x8d,0x81, 0x00,0x01,0x04,0x81,0x8d,0x01,0x06,0x81,0x00,0x01,0x04,0x81,0x8d,0x8d,0x82,0x80, 0x83,0x8d,0x8d,0x81,0x81,0x8d,0x8d,0x81,0x00,0x01,0x04,0x81,0x8d,0x8d,0x82,0x80, 0x01,0x03,0x85,0x00,0x01,0x04,0x81,0x8d,0x8d,0x84,0x80,0x85,0x8d,0x8d,0x81,0x81, 0x8d,0x8d,0x81,0x00,0x01,0x04,0x81,0x8d,0x8d,0x84,0x80,0x01,0x02,0x83,0x00,0x01, 0x05,0x81,0x8d,0x01,0x06,0x81,0x81,0x8d,0x8d,0x81,0x00,0x01,0x04,0x81,0x8d,0x8d, 0x94,0x01,0x03,0x81,0x00,0x01,0x05,0x81,0x8d,0x8d,0x8b,0x8d,0x8d,0x8e,0x82,0x85, 0x81,0x8d,0x8d,0x81,0x00,0x01,0x04,0x81,0x8d,0x8d,0x82,0x80,0x01,0x02,0x85,0x00, 0x01,0x05,0x81,0x8d,0x8d,0x82,0x83,0x8d,0x8d,0x84,0x83,0x81,0x8d,0x8d,0x84,0x80, 0x01,0x03,0x83,0x81,0x8d,0x8d,0x84,0x80,0x01,0x03,0x83,0x00,0x01,0x04,0x81,0x8d, 0x8d,0x81,0x84,0x83,0x8d,0x8d,0x81,0x81,0x8d,0x01,0x06,0x81,0x81,0x8d,0x01,0x06, 0x81,0x00,0x01,0x04,0x84,0x80,0x80,0x85,0x00,0x84,0x80,0x80,0x85,0x84,0x80,0x01, 0x06,0x85,0x84,0x80,0x01,0x06,0x85,0x00,0x01,0x07,0x52,0x55,0x4e,0x00,0x00,0x2d, 0x2d,0x00,0x4c,0x45,0x4e,0x47,0x54,0x48,0x00,0x00,0x45,0x4e,0x43,0x4f,0x44,0x49, 0x4e,0x47,0x00,0x01,0x26,0xeb,0xef,0xe4,0xe9,0xf2,0xef,0xf7,0xe1,0xee,0xe9,0xe5, 0x00,0x00,0xe4,0xec,0xe9,0xee,0x00,0x00,0xf3,0xe5,0xf2,0xe9,0xea,0x00,0x01,0xfe, 0x00,0x01,0x63,0x01,0x00 };
NaruTrey/FaNES-Example-5-RLE
imageRLE.h
C
unlicense
1,789
package uk.org.mikea.whitby; import java.util.Comparator; import java.util.List; import org.apache.poi.xwpf.usermodel.XWPFParagraph; import org.joda.time.LocalTime; public interface Event { public boolean tbc(); public LocalTime startTime(); public LocalTime endTime(); public String displayTime(); public String location(); public List<Team> teams(); public void writeDetail(XWPFParagraph paragraph, Team team); public static class EventComparator implements Comparator<Event> { @Override public int compare(Event o1, Event o2) { if (o1.tbc() && o2.tbc()) { return 0; } else if (o1.tbc() && !o2.tbc()) { return 1; } else if (!o1.tbc() && o2.tbc()) { return -1; } int startComparison = o1.startTime().compareTo(o2.startTime()); if (startComparison == 0) { if ((o1.endTime() != null) && (o2.endTime() != null)) { return o1.endTime().compareTo(o2.endTime()); } else if (o1.endTime() != null) { return -1; } return 1; } return startComparison; } } }
mike-tr-adamson/whitby-teams
src/main/java/uk/org/mikea/whitby/Event.java
Java
unlicense
1,029
// Header file CandyBox.h in project Ex9_02 #pragma once #include "Box.h" class CCandyBox: public CBox { public: char* m_Contents; CCandyBox(char* str = "Candy") // Constructor { m_Contents = new char[ strlen(str) + 1 ]; strcpy_s(m_Contents, strlen(str) + 1, str); } ~CCandyBox() // Destructor { delete[] m_Contents; }; };
hyller/CodeLibrary
Ivor_Horton_Beginning_Visual_C++_2010/Ch09/Ex9_02/CandyBox.h
C
unlicense
426
// Generated by typings // Source: https://raw.githubusercontent.com/typed-typings/npm-assertion-error/105841317bd2bdd5d110bfb763e49e482a77230d/main.d.ts declare module '~chai~assertion-error' { // Type definitions for assertion-error 1.0.0 // Project: https://github.com/chaijs/assertion-error // Definitions by: Bart van der Schoor <https://github.com/Bartvds> // Definitions: https://github.com/borisyankov/DefinitelyTyped export class AssertionError implements Error { constructor(message: string, props?: any, ssf?: Function); public name: string; public message: string; public showDiff: boolean; public stack: string; /** * Allow errors to be converted to JSON for static transfer. * * @param {Boolean} include stack (default: `true`) * @return {Object} object that can be `JSON.stringify` */ public toJSON(stack: boolean): Object; } } // Generated by typings // Source: https://raw.githubusercontent.com/typed-typings/npm-chai/0b70226aa4ea9c3b37fe1c709db0423f11ed30d8/lib/Assert.d.ts declare module '~chai/lib/Assert' { export interface AssertStatic extends Assert { } export interface Assert { /** * @param expression Expression to test for truthiness. * @param message Message to display on error. */ (expression: any, message?: string): void; (expression: any, messageCallback: () => string): void; fail(actual?: any, expected?: any, msg?: string, operator?: string): void; ok(val: any, msg?: string): void; isOk(val: any, msg?: string): void; notOk(val: any, msg?: string): void; isNotOk(val: any, msg?: string): void; equal(act: any, exp: any, msg?: string): void; notEqual(act: any, exp: any, msg?: string): void; strictEqual(act: any, exp: any, msg?: string): void; notStrictEqual(act: any, exp: any, msg?: string): void; deepEqual(act: any, exp: any, msg?: string): void; notDeepEqual(act: any, exp: any, msg?: string): void; isTrue(val: any, msg?: string): void; isFalse(val: any, msg?: string): void; isNotTrue(val: any, msg?: string): void; isNotFalse(val: any, msg?: string): void; isNull(val: any, msg?: string): void; isNotNull(val: any, msg?: string): void; isUndefined(val: any, msg?: string): void; isDefined(val: any, msg?: string): void; isNaN(val: any, msg?: string): void; isNotNaN(val: any, msg?: string): void; isAbove(val: number, abv: number, msg?: string): void; isBelow(val: number, blw: number, msg?: string): void; isAtLeast(val: number, atlst: number, msg?: string): void; isAtMost(val: number, atmst: number, msg?: string): void; isFunction(val: any, msg?: string): void; isNotFunction(val: any, msg?: string): void; isObject(val: any, msg?: string): void; isNotObject(val: any, msg?: string): void; isArray(val: any, msg?: string): void; isNotArray(val: any, msg?: string): void; isString(val: any, msg?: string): void; isNotString(val: any, msg?: string): void; isNumber(val: any, msg?: string): void; isNotNumber(val: any, msg?: string): void; isBoolean(val: any, msg?: string): void; isNotBoolean(val: any, msg?: string): void; typeOf(val: any, type: string, msg?: string): void; notTypeOf(val: any, type: string, msg?: string): void; instanceOf(val: any, type: Function, msg?: string): void; notInstanceOf(val: any, type: Function, msg?: string): void; include(exp: string, inc: any, msg?: string): void; include(exp: any[], inc: any, msg?: string): void; include(exp: Object, inc: Object, msg?: string): void; notInclude(exp: string, inc: any, msg?: string): void; notInclude(exp: any[], inc: any, msg?: string): void; match(exp: any, re: RegExp, msg?: string): void; notMatch(exp: any, re: RegExp, msg?: string): void; property(obj: Object, prop: string, msg?: string): void; notProperty(obj: Object, prop: string, msg?: string): void; deepProperty(obj: Object, prop: string, msg?: string): void; notDeepProperty(obj: Object, prop: string, msg?: string): void; propertyVal(obj: Object, prop: string, val: any, msg?: string): void; propertyNotVal(obj: Object, prop: string, val: any, msg?: string): void; deepPropertyVal(obj: Object, prop: string, val: any, msg?: string): void; deepPropertyNotVal(obj: Object, prop: string, val: any, msg?: string): void; lengthOf(exp: any, len: number, msg?: string): void; //alias frenzy throw(fn: Function, msg?: string): void; throw(fn: Function, regExp: RegExp): void; throw(fn: Function, errType: Function, msg?: string): void; throw(fn: Function, errType: Function, regExp: RegExp): void; throws(fn: Function, msg?: string): void; throws(fn: Function, regExp: RegExp): void; throws(fn: Function, errType: Function, msg?: string): void; throws(fn: Function, errType: Function, regExp: RegExp): void; Throw(fn: Function, msg?: string): void; Throw(fn: Function, regExp: RegExp): void; Throw(fn: Function, errType: Function, msg?: string): void; Throw(fn: Function, errType: Function, regExp: RegExp): void; doesNotThrow(fn: Function, msg?: string): void; doesNotThrow(fn: Function, regExp: RegExp): void; doesNotThrow(fn: Function, errType: Function, msg?: string): void; doesNotThrow(fn: Function, errType: Function, regExp: RegExp): void; operator(val: any, operator: string, val2: any, msg?: string): void; closeTo(act: number, exp: number, delta: number, msg?: string): void; approximately(act: number, exp: number, delta: number, msg?: string): void; sameMembers(set1: any[], set2: any[], msg?: string): void; sameDeepMembers(set1: any[], set2: any[], msg?: string): void; includeMembers(superset: any[], subset: any[], msg?: string): void; includeDeepMembers(superset: any[], subset: any[], msg?: string): void; ifError(val: any, msg?: string): void; isExtensible(obj: {}, msg?: string): void; extensible(obj: {}, msg?: string): void; isNotExtensible(obj: {}, msg?: string): void; notExtensible(obj: {}, msg?: string): void; isSealed(obj: {}, msg?: string): void; sealed(obj: {}, msg?: string): void; isNotSealed(obj: {}, msg?: string): void; notSealed(obj: {}, msg?: string): void; isFrozen(obj: Object, msg?: string): void; frozen(obj: Object, msg?: string): void; isNotFrozen(obj: Object, msg?: string): void; notFrozen(obj: Object, msg?: string): void; oneOf(inList: any, list: any[], msg?: string): void; changes(fn: Function, obj: {}, property: string): void; doesNotChange(fn: Function, obj: {}, property: string): void; increases(fn: Function, obj: {}, property: string): void; doesNotIncrease(fn: Function, obj: {}, property: string): void; decreases(fn: Function, obj: {}, property: string): void; doesNotDecrease(fn: Function, obj: {}, property: string): void; } } declare module 'chai/lib/Assert' { export * from '~chai/lib/Assert'; } // Generated by typings // Source: https://raw.githubusercontent.com/typed-typings/npm-chai/0b70226aa4ea9c3b37fe1c709db0423f11ed30d8/lib/Assertion.d.ts declare module '~chai/lib/Assertion' { export interface AssertionStatic { (target?: any, message?: string, stack?: Function): Assertion; new (target?: any, message?: string, stack?: Function): Assertion; } export interface Assertion extends LanguageChains, NumericComparison, TypeComparison { not: Assertion; deep: Deep; any: KeyFilter; all: KeyFilter; a: TypeComparison; an: TypeComparison; include: Include; includes: Include; contain: Include; contains: Include; ok: Assertion; true: Assertion; false: Assertion; null: Assertion; undefined: Assertion; NaN: Assertion; exist: Assertion; empty: Assertion; arguments: Assertion; Arguments: Assertion; equal: Equal; equals: Equal; eq: Equal; eql: Equal; eqls: Equal; property: Property; ownProperty: OwnProperty; haveOwnProperty: OwnProperty; ownPropertyDescriptor: OwnPropertyDescriptor; haveOwnPropertyDescriptor: OwnPropertyDescriptor; length: Length; lengthOf: Length; match: Match; matches: Match; string(str: string, message?: string): Assertion; keys: Keys; key(str: string): Assertion; throw: Throw; throws: Throw; Throw: Throw; respondTo: RespondTo; respondsTo: RespondTo; itself: Assertion; satisfy: Satisfy; satisfies: Satisfy; closeTo: CloseTo; approximately: CloseTo; members: Members; increase: PropertyChange; increases: PropertyChange; decrease: PropertyChange; decreases: PropertyChange; change: PropertyChange; changes: PropertyChange; extensible: Assertion; sealed: Assertion; frozen: Assertion; oneOf(list: any[], message?: string): Assertion; } export interface LanguageChains { to: Assertion; be: Assertion; been: Assertion; is: Assertion; that: Assertion; which: Assertion; and: Assertion; has: Assertion; have: Assertion; with: Assertion; at: Assertion; of: Assertion; same: Assertion; } export interface NumericComparison { above: NumberComparer; gt: NumberComparer; greaterThan: NumberComparer; least: NumberComparer; gte: NumberComparer; below: NumberComparer; lt: NumberComparer; lessThan: NumberComparer; most: NumberComparer; lte: NumberComparer; within(start: number, finish: number, message?: string): Assertion; } export interface NumberComparer { (value: number, message?: string): Assertion; } export interface TypeComparison { (type: string, message?: string): Assertion; instanceof: InstanceOf; instanceOf: InstanceOf; } export interface InstanceOf { (constructor: Object, message?: string): Assertion; } export interface CloseTo { (expected: number, delta: number, message?: string): Assertion; } export interface Deep { equal: Equal; equals: Equal; eq: Equal; include: Include; property: Property; members: Members; } export interface KeyFilter { keys: Keys; } export interface Equal { (value: any, message?: string): Assertion; } export interface Property { (name: string, value?: any, message?: string): Assertion; } export interface OwnProperty { (name: string, message?: string): Assertion; } export interface OwnPropertyDescriptor { (name: string, descriptor: PropertyDescriptor, message?: string): Assertion; (name: string, message?: string): Assertion; } export interface Length extends LanguageChains, NumericComparison { (length: number, message?: string): Assertion; } export interface Include { (value: Object, message?: string): Assertion; (value: string, message?: string): Assertion; (value: number, message?: string): Assertion; string(value: string, message?: string): Assertion; keys: Keys; members: Members; any: KeyFilter; all: KeyFilter; } export interface Match { (regexp: RegExp | string, message?: string): Assertion; } export interface Keys { (...keys: any[]): Assertion; (keys: any[]): Assertion; (keys: Object): Assertion; } export interface Throw { (): Assertion; (expected: string, message?: string): Assertion; (expected: RegExp, message?: string): Assertion; (constructor: Error, expected?: string, message?: string): Assertion; (constructor: Error, expected?: RegExp, message?: string): Assertion; (constructor: Function, expected?: string, message?: string): Assertion; (constructor: Function, expected?: RegExp, message?: string): Assertion; } export interface RespondTo { (method: string, message?: string): Assertion; } export interface Satisfy { (matcher: Function, message?: string): Assertion; } export interface Members { (set: any[], message?: string): Assertion; } export interface PropertyChange { (object: Object, prop: string, msg?: string): Assertion; } } declare module 'chai/lib/Assertion' { export * from '~chai/lib/Assertion'; } // Generated by typings // Source: https://raw.githubusercontent.com/typed-typings/npm-chai/0b70226aa4ea9c3b37fe1c709db0423f11ed30d8/lib/Expect.d.ts declare module '~chai/lib/Expect' { import {AssertionStatic} from '~chai/lib/Assertion'; export interface ExpectStatic extends AssertionStatic { fail(actual?: any, expected?: any, message?: string, operator?: string): void; } } declare module 'chai/lib/Expect' { export * from '~chai/lib/Expect'; } // Generated by typings // Source: https://raw.githubusercontent.com/typed-typings/npm-chai/0b70226aa4ea9c3b37fe1c709db0423f11ed30d8/lib/Should.d.ts declare module '~chai/lib/Should' { export interface Should extends ShouldAssertion { not: ShouldAssertion; fail(actual: any, expected: any, message?: string, operator?: string): void; } export interface ShouldAssertion { Throw: ShouldThrow; throw: ShouldThrow; equal(value1: any, value2: any, message?: string): void; exist(value: any, message?: string): void; } export interface ShouldThrow { (actual: Function): void; (actual: Function, expected: string | RegExp, message?: string): void; (actual: Function, constructor: Error | Function, expected?: string | RegExp, message?: string): void; } } declare module 'chai/lib/Should' { export * from '~chai/lib/Should'; } // Generated by typings // Source: https://raw.githubusercontent.com/typed-typings/npm-chai/0b70226aa4ea9c3b37fe1c709db0423f11ed30d8/lib/Config.d.ts declare module '~chai/lib/Config' { export interface Config { includeStack: boolean; truncateThreshold: number; } } declare module 'chai/lib/Config' { export * from '~chai/lib/Config'; } // Generated by typings // Source: https://raw.githubusercontent.com/typed-typings/npm-chai/0b70226aa4ea9c3b37fe1c709db0423f11ed30d8/lib/Utils.d.ts declare module '~chai/lib/Utils' { import {Assertion} from '~chai/lib/Assertion'; export interface Utils { addChainableMethod(ctx: any, name: string, chainingBehavior: (value: any) => void); addMethod(ctx: any, name: string, method: (value: any) => void); addProperty(ctx: any, name: string, getter: () => void); expectTypes(obj: Object, types: string[]); flag(obj: Object, key: string, value?: any); getActual(obj: Object, actual?: any); getEnumerableProperties(obj: Object); getMessage(obj: Object, params: any[]); getMessage(obj: Object, message: string, negateMessage: string); getName(func: Function); getPathInfo(path: string, obj: Object); getPathValue(path: string, obj: Object); getProperties(obj: Object); hasProperty(obj: Object, name: string); transferFlags(assertion: Assertion | any, obj: Object, includeAll?: boolean); inspect(obj: any); } } declare module 'chai/lib/Utils' { export * from '~chai/lib/Utils'; } // Generated by typings // Source: https://raw.githubusercontent.com/typed-typings/npm-chai/0b70226aa4ea9c3b37fe1c709db0423f11ed30d8/lib/Chai.d.ts declare module '~chai/lib/Chai' { import * as AE from '~chai~assertion-error'; import * as Assert from '~chai/lib/Assert'; import * as A from '~chai/lib/Assertion'; import * as Expect from '~chai/lib/Expect'; import * as Should from '~chai/lib/Should'; import * as Config from '~chai/lib/Config'; import * as Utils from '~chai/lib/Utils'; namespace chai { export interface AssertionStatic extends A.AssertionStatic {} export class AssertionError extends AE.AssertionError {} export var Assertion: A.AssertionStatic; export var expect: Expect.ExpectStatic; export var assert: Assert.AssertStatic; export var config: Config.Config; export var util: Utils.Utils; export function should(): Should.Should; export function Should(): Should.Should; /** * Provides a way to extend the internals of Chai */ export function use(fn: (chai: any, utils: Utils.Utils) => void): typeof chai; } export = chai; global { interface Object { should: A.Assertion; } } } declare module 'chai/lib/Chai' { import main = require('~chai/lib/Chai'); export = main; } // Generated by typings // Source: https://raw.githubusercontent.com/typed-typings/npm-chai/0b70226aa4ea9c3b37fe1c709db0423f11ed30d8/index.d.ts declare module 'chai' { // Type definitions for chai 3.4.0 // Project: http://chaijs.com/ // Original Definitions by: Jed Mao <https://github.com/jedmao/>, // Bart van der Schoor <https://github.com/Bartvds>, // Andrew Brown <https://github.com/AGBrown>, // Olivier Chevet <https://github.com/olivr70>, // Matt Wistrand <https://github.com/mwistrand> import chai = require('~chai/lib/Chai'); export = chai; }
janaagaard75/framework-investigations
old-or-not-typescript/learn-redux/todomvc-redux-react-typescript-master/typings/modules/chai/index.d.ts
TypeScript
unlicense
16,524
# uncompyle6 version 2.9.10 # Python bytecode 2.7 (62211) # Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10) # [GCC 6.2.0 20161005] # Embedded file name: charset.py __all__ = [ 'Charset', 'add_alias', 'add_charset', 'add_codec'] import codecs import email.base64mime import email.quoprimime from email import errors from email.encoders import encode_7or8bit QP = 1 BASE64 = 2 SHORTEST = 3 MISC_LEN = 7 DEFAULT_CHARSET = 'us-ascii' CHARSETS = {'iso-8859-1': ( QP, QP, None), 'iso-8859-2': ( QP, QP, None), 'iso-8859-3': ( QP, QP, None), 'iso-8859-4': ( QP, QP, None), 'iso-8859-9': ( QP, QP, None), 'iso-8859-10': ( QP, QP, None), 'iso-8859-13': ( QP, QP, None), 'iso-8859-14': ( QP, QP, None), 'iso-8859-15': ( QP, QP, None), 'iso-8859-16': ( QP, QP, None), 'windows-1252': ( QP, QP, None), 'viscii': ( QP, QP, None), 'us-ascii': (None, None, None), 'big5': ( BASE64, BASE64, None), 'gb2312': ( BASE64, BASE64, None), 'euc-jp': ( BASE64, None, 'iso-2022-jp'), 'shift_jis': ( BASE64, None, 'iso-2022-jp'), 'iso-2022-jp': ( BASE64, None, None), 'koi8-r': ( BASE64, BASE64, None), 'utf-8': ( SHORTEST, BASE64, 'utf-8'), '8bit': ( None, BASE64, 'utf-8') } ALIASES = {'latin_1': 'iso-8859-1', 'latin-1': 'iso-8859-1', 'latin_2': 'iso-8859-2', 'latin-2': 'iso-8859-2', 'latin_3': 'iso-8859-3', 'latin-3': 'iso-8859-3', 'latin_4': 'iso-8859-4', 'latin-4': 'iso-8859-4', 'latin_5': 'iso-8859-9', 'latin-5': 'iso-8859-9', 'latin_6': 'iso-8859-10', 'latin-6': 'iso-8859-10', 'latin_7': 'iso-8859-13', 'latin-7': 'iso-8859-13', 'latin_8': 'iso-8859-14', 'latin-8': 'iso-8859-14', 'latin_9': 'iso-8859-15', 'latin-9': 'iso-8859-15', 'latin_10': 'iso-8859-16', 'latin-10': 'iso-8859-16', 'cp949': 'ks_c_5601-1987', 'euc_jp': 'euc-jp', 'euc_kr': 'euc-kr', 'ascii': 'us-ascii' } CODEC_MAP = {'gb2312': 'eucgb2312_cn', 'big5': 'big5_tw', 'us-ascii': None } def add_charset(charset, header_enc=None, body_enc=None, output_charset=None): """Add character set properties to the global registry. charset is the input character set, and must be the canonical name of a character set. Optional header_enc and body_enc is either Charset.QP for quoted-printable, Charset.BASE64 for base64 encoding, Charset.SHORTEST for the shortest of qp or base64 encoding, or None for no encoding. SHORTEST is only valid for header_enc. It describes how message headers and message bodies in the input charset are to be encoded. Default is no encoding. Optional output_charset is the character set that the output should be in. Conversions will proceed from input charset, to Unicode, to the output charset when the method Charset.convert() is called. The default is to output in the same character set as the input. Both input_charset and output_charset must have Unicode codec entries in the module's charset-to-codec mapping; use add_codec(charset, codecname) to add codecs the module does not know about. See the codecs module's documentation for more information. """ if body_enc == SHORTEST: raise ValueError('SHORTEST not allowed for body_enc') CHARSETS[charset] = ( header_enc, body_enc, output_charset) def add_alias(alias, canonical): """Add a character set alias. alias is the alias name, e.g. latin-1 canonical is the character set's canonical name, e.g. iso-8859-1 """ ALIASES[alias] = canonical def add_codec(charset, codecname): """Add a codec that map characters in the given charset to/from Unicode. charset is the canonical name of a character set. codecname is the name of a Python codec, as appropriate for the second argument to the unicode() built-in, or to the encode() method of a Unicode string. """ CODEC_MAP[charset] = codecname class Charset: """Map character sets to their email properties. This class provides information about the requirements imposed on email for a specific character set. It also provides convenience routines for converting between character sets, given the availability of the applicable codecs. Given a character set, it will do its best to provide information on how to use that character set in an email in an RFC-compliant way. Certain character sets must be encoded with quoted-printable or base64 when used in email headers or bodies. Certain character sets must be converted outright, and are not allowed in email. Instances of this module expose the following information about a character set: input_charset: The initial character set specified. Common aliases are converted to their `official' email names (e.g. latin_1 is converted to iso-8859-1). Defaults to 7-bit us-ascii. header_encoding: If the character set must be encoded before it can be used in an email header, this attribute will be set to Charset.QP (for quoted-printable), Charset.BASE64 (for base64 encoding), or Charset.SHORTEST for the shortest of QP or BASE64 encoding. Otherwise, it will be None. body_encoding: Same as header_encoding, but describes the encoding for the mail message's body, which indeed may be different than the header encoding. Charset.SHORTEST is not allowed for body_encoding. output_charset: Some character sets must be converted before the can be used in email headers or bodies. If the input_charset is one of them, this attribute will contain the name of the charset output will be converted to. Otherwise, it will be None. input_codec: The name of the Python codec used to convert the input_charset to Unicode. If no conversion codec is necessary, this attribute will be None. output_codec: The name of the Python codec used to convert Unicode to the output_charset. If no conversion codec is necessary, this attribute will have the same value as the input_codec. """ def __init__(self, input_charset=DEFAULT_CHARSET): try: if isinstance(input_charset, unicode): input_charset.encode('ascii') else: input_charset = unicode(input_charset, 'ascii') except UnicodeError: raise errors.CharsetError(input_charset) input_charset = input_charset.lower().encode('ascii') if not (input_charset in ALIASES or input_charset in CHARSETS): try: input_charset = codecs.lookup(input_charset).name except LookupError: pass self.input_charset = ALIASES.get(input_charset, input_charset) henc, benc, conv = CHARSETS.get(self.input_charset, ( SHORTEST, BASE64, None)) if not conv: conv = self.input_charset self.header_encoding = henc self.body_encoding = benc self.output_charset = ALIASES.get(conv, conv) self.input_codec = CODEC_MAP.get(self.input_charset, self.input_charset) self.output_codec = CODEC_MAP.get(self.output_charset, self.output_charset) return def __str__(self): return self.input_charset.lower() __repr__ = __str__ def __eq__(self, other): return str(self) == str(other).lower() def __ne__(self, other): return not self.__eq__(other) def get_body_encoding(self): """Return the content-transfer-encoding used for body encoding. This is either the string `quoted-printable' or `base64' depending on the encoding used, or it is a function in which case you should call the function with a single argument, the Message object being encoded. The function should then set the Content-Transfer-Encoding header itself to whatever is appropriate. Returns "quoted-printable" if self.body_encoding is QP. Returns "base64" if self.body_encoding is BASE64. Returns "7bit" otherwise. """ if self.body_encoding == QP: return 'quoted-printable' else: if self.body_encoding == BASE64: return 'base64' return encode_7or8bit def convert(self, s): """Convert a string from the input_codec to the output_codec.""" if self.input_codec != self.output_codec: return unicode(s, self.input_codec).encode(self.output_codec) else: return s def to_splittable(self, s): """Convert a possibly multibyte string to a safely splittable format. Uses the input_codec to try and convert the string to Unicode, so it can be safely split on character boundaries (even for multibyte characters). Returns the string as-is if it isn't known how to convert it to Unicode with the input_charset. Characters that could not be converted to Unicode will be replaced with the Unicode replacement character U+FFFD. """ if isinstance(s, unicode) or self.input_codec is None: return s else: try: return unicode(s, self.input_codec, 'replace') except LookupError: return s return def from_splittable(self, ustr, to_output=True): """Convert a splittable string back into an encoded string. Uses the proper codec to try and convert the string from Unicode back into an encoded format. Return the string as-is if it is not Unicode, or if it could not be converted from Unicode. Characters that could not be converted from Unicode will be replaced with an appropriate character (usually '?'). If to_output is True (the default), uses output_codec to convert to an encoded format. If to_output is False, uses input_codec. """ if to_output: codec = self.output_codec else: codec = self.input_codec if not isinstance(ustr, unicode) or codec is None: return ustr else: try: return ustr.encode(codec, 'replace') except LookupError: return ustr return def get_output_charset(self): """Return the output character set. This is self.output_charset if that is not None, otherwise it is self.input_charset. """ return self.output_charset or self.input_charset def encoded_header_len(self, s): """Return the length of the encoded header string.""" cset = self.get_output_charset() if self.header_encoding == BASE64: return email.base64mime.base64_len(s) + len(cset) + MISC_LEN else: if self.header_encoding == QP: return email.quoprimime.header_quopri_len(s) + len(cset) + MISC_LEN if self.header_encoding == SHORTEST: lenb64 = email.base64mime.base64_len(s) lenqp = email.quoprimime.header_quopri_len(s) return min(lenb64, lenqp) + len(cset) + MISC_LEN return len(s) def header_encode(self, s, convert=False): """Header-encode a string, optionally converting it to output_charset. If convert is True, the string will be converted from the input charset to the output charset automatically. This is not useful for multibyte character sets, which have line length issues (multibyte characters must be split on a character, not a byte boundary); use the high-level Header class to deal with these issues. convert defaults to False. The type of encoding (base64 or quoted-printable) will be based on self.header_encoding. """ cset = self.get_output_charset() if convert: s = self.convert(s) if self.header_encoding == BASE64: return email.base64mime.header_encode(s, cset) else: if self.header_encoding == QP: return email.quoprimime.header_encode(s, cset, maxlinelen=None) if self.header_encoding == SHORTEST: lenb64 = email.base64mime.base64_len(s) lenqp = email.quoprimime.header_quopri_len(s) if lenb64 < lenqp: return email.base64mime.header_encode(s, cset) else: return email.quoprimime.header_encode(s, cset, maxlinelen=None) else: return s return None def body_encode(self, s, convert=True): """Body-encode a string and convert it to output_charset. If convert is True (the default), the string will be converted from the input charset to output charset automatically. Unlike header_encode(), there are no issues with byte boundaries and multibyte charsets in email bodies, so this is usually pretty safe. The type of encoding (base64 or quoted-printable) will be based on self.body_encoding. """ if convert: s = self.convert(s) if self.body_encoding is BASE64: return email.base64mime.body_encode(s) else: if self.body_encoding is QP: return email.quoprimime.body_encode(s) return s
DarthMaulware/EquationGroupLeaks
Leak #5 - Lost In Translation/windows/Resources/Python/Core/Lib/email/charset.py
Python
unlicense
14,131
package android.support.v4.content; import android.content.ComponentName; import android.content.Intent; abstract interface IntentCompat$IntentCompatImpl { public abstract Intent makeMainActivity(ComponentName paramComponentName); public abstract Intent makeMainSelectorActivity(String paramString1, String paramString2); public abstract Intent makeRestartActivityTask(ComponentName paramComponentName); } /* Location: E:\Progs\Dev\Android\Decompile\apktool\zssq\zssq-dex2jar.jar * Qualified Name: android.support.v4.content.IntentCompat.IntentCompatImpl * JD-Core Version: 0.6.0 */
clilystudio/NetBook
allsrc/android/support/v4/content/IntentCompat$IntentCompatImpl.java
Java
unlicense
613
--- layout: post title: "changed status of \"High Resolution Time\" from CR to PR" date: 2012-10-23 tags: [ hr-time ] --- changed status of "[High Resolution Time](/spec/hr-time)" from CR to PR
dret/HTML5-overview
_posts/2012-10-23-update.md
Markdown
unlicense
201
import {ArrayBinarySearch} from '../alg/binarysearch/ArrayBinarySearch'; describe('ArrayBinarySearch', () => { let binsearch = new ArrayBinarySearch(); describe('#search()', () => { it("should return valid min index for test1 case", () => { let test1array = [1,2,4,6, 10, 20, 30, 40]; // 0 1 2 3 let givenValue = 2; let index = binsearch.search(test1array, givenValue, (a, b) => a - b); expect(index).toBe(1); console.log(`Search iterations: ${binsearch.debugSearchIterations}`); }); }); });
dzharii/algorithms-n-data-structures-ts
src/spec/alg_binarysearcharray_binarysearch_spec.ts
TypeScript
unlicense
681
CSS only form element replacement for `checkbox` and `radio` `input` types. Note that the `label` is immediately after the `input` as a sibling. The `label` must use a `for` attribute, and the `input` requires an `id`. This is better for accessibility anyways, and speaking of which, consider adding `aria-labelledby` to the `input` and an `id` to the `label`.
nathansh/library
modules/form-check/form-check.md
Markdown
unlicense
362
Acelerometro-e-CameraCaptureTask ================================ Este é um projeto feito em aula com os alunos da cadeira de Linguagem Comercial
MayconCardoso/Acelerometro-e-CameraCaptureTask
README.md
Markdown
unlicense
148
/****************************************************************************** * $Id: cpl_conv.h 32217 2015-12-18 11:15:13Z rouault $ * * Project: CPL - Common Portability Library * Purpose: Convenience functions declarations. * This is intended to remain light weight. * Author: Frank Warmerdam, warmerdam@pobox.com * ****************************************************************************** * Copyright (c) 1998, Frank Warmerdam * Copyright (c) 2007-2013, Even Rouault <even dot rouault at mines-paris dot org> * * 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, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. ****************************************************************************/ #ifndef CPL_CONV_H_INCLUDED #define CPL_CONV_H_INCLUDED #include "cpl_port.h" #include "cpl_vsi.h" #include "cpl_error.h" /** * \file cpl_conv.h * * Various convenience functions for CPL. * */ /* -------------------------------------------------------------------- */ /* Runtime check of various configuration items. */ /* -------------------------------------------------------------------- */ CPL_C_START void CPL_DLL CPLVerifyConfiguration(void); const char CPL_DLL * CPL_STDCALL CPLGetConfigOption( const char *, const char * ) CPL_WARN_UNUSED_RESULT; const char CPL_DLL * CPL_STDCALL CPLGetThreadLocalConfigOption( const char *, const char * ) CPL_WARN_UNUSED_RESULT; void CPL_DLL CPL_STDCALL CPLSetConfigOption( const char *, const char * ); void CPL_DLL CPL_STDCALL CPLSetThreadLocalConfigOption( const char *pszKey, const char *pszValue ); void CPL_DLL CPL_STDCALL CPLFreeConfig(void); /* -------------------------------------------------------------------- */ /* Safe malloc() API. Thin cover over VSI functions with fatal */ /* error reporting if memory allocation fails. */ /* -------------------------------------------------------------------- */ void CPL_DLL *CPLMalloc( size_t ) CPL_WARN_UNUSED_RESULT; void CPL_DLL *CPLCalloc( size_t, size_t ) CPL_WARN_UNUSED_RESULT; void CPL_DLL *CPLRealloc( void *, size_t ) CPL_WARN_UNUSED_RESULT; char CPL_DLL *CPLStrdup( const char * ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL; char CPL_DLL *CPLStrlwr( char *); #define CPLFree VSIFree /* -------------------------------------------------------------------- */ /* Read a line from a text file, and strip of CR/LF. */ /* -------------------------------------------------------------------- */ char CPL_DLL *CPLFGets( char *, int, FILE *); const char CPL_DLL *CPLReadLine( FILE * ); const char CPL_DLL *CPLReadLineL( VSILFILE * ); const char CPL_DLL *CPLReadLine2L( VSILFILE * , int nMaxCols, char** papszOptions); /* -------------------------------------------------------------------- */ /* Convert ASCII string to floating point number */ /* (THESE FUNCTIONS ARE NOT LOCALE AWARE!). */ /* -------------------------------------------------------------------- */ double CPL_DLL CPLAtof(const char *); double CPL_DLL CPLAtofDelim(const char *, char); double CPL_DLL CPLStrtod(const char *, char **); double CPL_DLL CPLStrtodDelim(const char *, char **, char); float CPL_DLL CPLStrtof(const char *, char **); float CPL_DLL CPLStrtofDelim(const char *, char **, char); /* -------------------------------------------------------------------- */ /* Convert number to string. This function is locale agnostic */ /* (i.e. it will support "," or "." regardless of current locale) */ /* -------------------------------------------------------------------- */ double CPL_DLL CPLAtofM(const char *); /* -------------------------------------------------------------------- */ /* Read a numeric value from an ASCII character string. */ /* -------------------------------------------------------------------- */ char CPL_DLL *CPLScanString( const char *, int, int, int ); double CPL_DLL CPLScanDouble( const char *, int ); long CPL_DLL CPLScanLong( const char *, int ); unsigned long CPL_DLL CPLScanULong( const char *, int ); GUIntBig CPL_DLL CPLScanUIntBig( const char *, int ); GIntBig CPL_DLL CPLAtoGIntBig( const char* pszString ); GIntBig CPL_DLL CPLAtoGIntBigEx( const char* pszString, int bWarn, int *pbOverflow ); void CPL_DLL *CPLScanPointer( const char *, int ); /* -------------------------------------------------------------------- */ /* Print a value to an ASCII character string. */ /* -------------------------------------------------------------------- */ int CPL_DLL CPLPrintString( char *, const char *, int ); int CPL_DLL CPLPrintStringFill( char *, const char *, int ); int CPL_DLL CPLPrintInt32( char *, GInt32 , int ); int CPL_DLL CPLPrintUIntBig( char *, GUIntBig , int ); int CPL_DLL CPLPrintDouble( char *, const char *, double, const char * ); int CPL_DLL CPLPrintTime( char *, int , const char *, const struct tm *, const char * ); int CPL_DLL CPLPrintPointer( char *, void *, int ); /* -------------------------------------------------------------------- */ /* Fetch a function from DLL / so. */ /* -------------------------------------------------------------------- */ void CPL_DLL *CPLGetSymbol( const char *, const char * ); /* -------------------------------------------------------------------- */ /* Fetch executable path. */ /* -------------------------------------------------------------------- */ int CPL_DLL CPLGetExecPath( char *pszPathBuf, int nMaxLength ); /* -------------------------------------------------------------------- */ /* Filename handling functions. */ /* -------------------------------------------------------------------- */ const char CPL_DLL *CPLGetPath( const char * ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL; const char CPL_DLL *CPLGetDirname( const char * ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL; const char CPL_DLL *CPLGetFilename( const char * ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL; const char CPL_DLL *CPLGetBasename( const char * ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL; const char CPL_DLL *CPLGetExtension( const char * ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL; char CPL_DLL *CPLGetCurrentDir(void); const char CPL_DLL *CPLFormFilename( const char *pszPath, const char *pszBasename, const char *pszExtension ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL; const char CPL_DLL *CPLFormCIFilename( const char *pszPath, const char *pszBasename, const char *pszExtension ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL; const char CPL_DLL *CPLResetExtension( const char *, const char * ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL; const char CPL_DLL *CPLProjectRelativeFilename( const char *pszProjectDir, const char *pszSecondaryFilename ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL; int CPL_DLL CPLIsFilenameRelative( const char *pszFilename ); const char CPL_DLL *CPLExtractRelativePath(const char *, const char *, int *) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL; const char CPL_DLL *CPLCleanTrailingSlash( const char * ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL; char CPL_DLL **CPLCorrespondingPaths( const char *pszOldFilename, const char *pszNewFilename, char **papszFileList ) CPL_WARN_UNUSED_RESULT; int CPL_DLL CPLCheckForFile( char *pszFilename, char **papszSiblingList ); const char CPL_DLL *CPLGenerateTempFilename( const char *pszStem ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL; /* -------------------------------------------------------------------- */ /* Find File Function */ /* -------------------------------------------------------------------- */ typedef const char *(*CPLFileFinder)(const char *, const char *); const char CPL_DLL *CPLFindFile(const char *pszClass, const char *pszBasename); const char CPL_DLL *CPLDefaultFindFile(const char *pszClass, const char *pszBasename); void CPL_DLL CPLPushFileFinder( CPLFileFinder pfnFinder ); CPLFileFinder CPL_DLL CPLPopFileFinder(void); void CPL_DLL CPLPushFinderLocation( const char * ); void CPL_DLL CPLPopFinderLocation(void); void CPL_DLL CPLFinderClean(void); /* -------------------------------------------------------------------- */ /* Safe version of stat() that works properly on stuff like "C:". */ /* -------------------------------------------------------------------- */ int CPL_DLL CPLStat( const char *, VSIStatBuf * ) CPL_WARN_UNUSED_RESULT; /* -------------------------------------------------------------------- */ /* Reference counted file handle manager. Makes sharing file */ /* handles more practical. */ /* -------------------------------------------------------------------- */ typedef struct { FILE *fp; int nRefCount; int bLarge; char *pszFilename; char *pszAccess; } CPLSharedFileInfo; FILE CPL_DLL *CPLOpenShared( const char *, const char *, int ); void CPL_DLL CPLCloseShared( FILE * ); CPLSharedFileInfo CPL_DLL *CPLGetSharedList( int * ); void CPL_DLL CPLDumpSharedList( FILE * ); void CPL_DLL CPLCleanupSharedFileMutex( void ); /* -------------------------------------------------------------------- */ /* DMS to Dec to DMS conversion. */ /* -------------------------------------------------------------------- */ double CPL_DLL CPLDMSToDec( const char *is ); const char CPL_DLL *CPLDecToDMS( double dfAngle, const char * pszAxis, int nPrecision ); double CPL_DLL CPLPackedDMSToDec( double ); double CPL_DLL CPLDecToPackedDMS( double dfDec ); void CPL_DLL CPLStringToComplex( const char *pszString, double *pdfReal, double *pdfImag ); /* -------------------------------------------------------------------- */ /* Misc other functions. */ /* -------------------------------------------------------------------- */ int CPL_DLL CPLUnlinkTree( const char * ); int CPL_DLL CPLCopyFile( const char *pszNewPath, const char *pszOldPath ); int CPL_DLL CPLCopyTree( const char *pszNewPath, const char *pszOldPath ); int CPL_DLL CPLMoveFile( const char *pszNewPath, const char *pszOldPath ); int CPL_DLL CPLSymlink( const char* pszOldPath, const char* pszNewPath, char** papszOptions ); /* -------------------------------------------------------------------- */ /* ZIP Creation. */ /* -------------------------------------------------------------------- */ #define CPL_ZIP_API_OFFERED void CPL_DLL *CPLCreateZip( const char *pszZipFilename, char **papszOptions ); CPLErr CPL_DLL CPLCreateFileInZip( void *hZip, const char *pszFilename, char **papszOptions ); CPLErr CPL_DLL CPLWriteFileInZip( void *hZip, const void *pBuffer, int nBufferSize ); CPLErr CPL_DLL CPLCloseFileInZip( void *hZip ); CPLErr CPL_DLL CPLCloseZip( void *hZip ); /* -------------------------------------------------------------------- */ /* ZLib compression */ /* -------------------------------------------------------------------- */ void CPL_DLL *CPLZLibDeflate( const void* ptr, size_t nBytes, int nLevel, void* outptr, size_t nOutAvailableBytes, size_t* pnOutBytes ); void CPL_DLL *CPLZLibInflate( const void* ptr, size_t nBytes, void* outptr, size_t nOutAvailableBytes, size_t* pnOutBytes ); /* -------------------------------------------------------------------- */ /* XML validation. */ /* -------------------------------------------------------------------- */ int CPL_DLL CPLValidateXML(const char* pszXMLFilename, const char* pszXSDFilename, char** papszOptions); /* -------------------------------------------------------------------- */ /* Locale handling. Prevents parallel executions of setlocale(). */ /* -------------------------------------------------------------------- */ char* CPLsetlocale (int category, const char* locale); void CPLCleanupSetlocaleMutex(void); CPL_C_END /* -------------------------------------------------------------------- */ /* C++ object for temporarily forcing a LC_NUMERIC locale to "C". */ /* -------------------------------------------------------------------- */ #if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS) class CPL_DLL CPLLocaleC { public: CPLLocaleC(); ~CPLLocaleC(); private: char *pszOldLocale; /* Make it non-copyable */ CPLLocaleC(const CPLLocaleC&); CPLLocaleC& operator=(const CPLLocaleC&); }; // Does the same as CPLLocaleC except that, when available, it tries to // only affect the current thread. But code that would be dependent of // setlocale(LC_NUMERIC, NULL) returning "C", such as current proj.4 versions, // will not work depending on the actual implementation class CPL_DLL CPLThreadLocaleC { public: CPLThreadLocaleC(); ~CPLThreadLocaleC(); private: #ifdef HAVE_USELOCALE locale_t nNewLocale; locale_t nOldLocale; #else #if defined(_MSC_VER) int nOldValConfigThreadLocale; #endif char *pszOldLocale; #endif /* Make it non-copyable */ CPLThreadLocaleC(const CPLThreadLocaleC&); CPLThreadLocaleC& operator=(const CPLThreadLocaleC&); }; #endif /* def __cplusplus */ #endif /* ndef CPL_CONV_H_INCLUDED */
Hemofektik/Druckwelle
3rdparty/GDAL/include/cpl_conv.h
C
unlicense
15,152
set -o nounset if (( ${BASH_VERSINFO[0]} != 4 )) then errexit 'bash version 4 is required.' fi declare -i debug=0 # declare -ar nodes=(8098 8099 8100) # NB: devrel declare -ar nodes=(10018 10028 10038) declare -i num_procs=4 # 24 declare -i sleep_seconds=120 # NB: not less than 5 seconds to ensure delete_mode seconds exceeded. declare -i object_count=1000 # 2500 function now { date '+%Y-%m-%d %H:%M:%S' } function pdebug { if (( debug > 0 )) then echo "$(now):[debug]:$@" fi } function pinfo { echo "$(now):[info]:$@" } function perr { echo "$(now):[error]:$@" 1>&2 } function pwarn { echo "$(now):[warning]:$@" } function curl_host { local -i idx=$(( RANDOM % 3 )) local -i port=${nodes[$idx]} echo "localhost:$port" } function curl_exec { local id="$1" shift local -i retry_count=0 local -i curl_exit=0 curl_output=$(curl --silent --output /dev/null --write-out "%{http_code}" "$@") curl_exit=$? while [[ $curl_output != 20[0-9] ]] && (( retry_count < 5 )) do # if [[ $curl_output == '000' || $curl_output == '300' ]] || (( curl_exit != 0 )) if [[ $curl_output == 30[0-9] || $curl_output == 40[0-9] ]] then break else pwarn "$id:$@:$curl_output:$curl_exit" sleep 1 curl_output=$(curl --silent --output /dev/null --write-out "%{http_code}" "$@") curl_exit=$? (( ++retry_count )) fi done if [[ $curl_output != 20[0-9] ]] || (( curl_exit != 0 )) then perr "$id:$@:$curl_output:$curl_exit" return 1 fi return 0 } function object_deleter_no_retry { local -i deleter_id=$1 pinfo "starting deleter with id: $deleter_id" local -i j=0 for ((j=0; j < object_count; ++j)) do local host="$(curl_host)" # PW: curl --silent --output /dev/null -XDELETE "$host/buckets/bucket-$deleter_id/keys/$j?pw=3" # NO PW: curl --silent --output /dev/null -XDELETE "$host/buckets/bucket-$deleter_id/keys/$j" curl --silent --output /dev/null -XDELETE "$host/buckets/bucket-$deleter_id/keys/$j" done pinfo "done - deleter with id: $deleter_id" } function nuke_all_objects { declare -i i=0 for ((i=0; i < num_procs; ++i)) do object_deleter_no_retry $i & done wait pinfo 'nuke done' }
lukebakken/riak-tests
bash/common.bash
Shell
unlicense
2,239
<!doctype html> <html> <title>npm-version</title> <meta http-equiv="content-type" value="text/html;utf-8"> <link rel="stylesheet" type="text/css" href="../../static/style.css"> <body> <div id="wrapper"> <h1><a href="../api/npm-version.html">npm-version</a></h1> <p>Bump a package version</p> <h2 id="SYNOPSIS">SYNOPSIS</h2> <pre><code>npm.commands.version(newversion, callback)</code></pre> <h2 id="DESCRIPTION">DESCRIPTION</h2> <p>Run this in a package directory to bump the version and write the new data back to the package.json file.</p> <p>If run in a git repo, it will also create a version commit and tag, and fail if the repo is not clean.</p> <p>Like all other commands, this function takes a string array as its first parameter. The difference, however, is this function will fail if it does not have exactly one element. The only element should be a version number.</p> </div> <p id="footer">npm-version &mdash; npm@1.3.8</p> <script> ;(function () { var wrapper = document.getElementById("wrapper") var els = Array.prototype.slice.call(wrapper.getElementsByTagName("*"), 0) .filter(function (el) { return el.parentNode === wrapper && el.tagName.match(/H[1-6]/) && el.id }) var l = 2 , toc = document.createElement("ul") toc.innerHTML = els.map(function (el) { var i = el.tagName.charAt(1) , out = "" while (i > l) { out += "<ul>" l ++ } while (i < l) { out += "</ul>" l -- } out += "<li><a href='#" + el.id + "'>" + ( el.innerText || el.text || el.innerHTML) + "</a>" return out }).join("\n") toc.id = "toc" document.body.appendChild(toc) })() </script>
caplin/qa-browsers
nodejs/node_modules/npm/html/doc/api/npm-version.html
HTML
unlicense
1,711
/* * NOTE: This copyright does *not* cover user programs that use HQ * program services by normal system calls through the application * program interfaces provided as part of the Hyperic Plug-in Development * Kit or the Hyperic Client Development Kit - this is merely considered * normal use of the program, and does *not* fall under the heading of * "derived work". * * Copyright (C) [2004, 2005, 2006], Hyperic, Inc. * This file is part of HQ. * * HQ is free software; you can redistribute it and/or modify * it under the terms version 2 of the GNU General Public License as * published by the Free Software Foundation. This program is distributed * in the hope that it will be useful, but WITHOUT ANY WARRANTY; without * even the implied warranty of MERCHANTABILITY or FITNESS FOR A * PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA. */ package org.hyperic.hq.bizapp.shared.uibeans; /** * Declares constants used by bizapp beans. */ public class UIConstants { /** * Identifies a <code>ResourceTypeDisplaySummary</code> * representing two or more resources of like resource type. */ public static final int SUMMARY_TYPE_AUTOGROUP = 1; /** * Identifies a <code>ResourceTypeDisplaySummary</code> * representing a cluster of resources. */ public static final int SUMMARY_TYPE_CLUSTER = 2; /** * Identifies a <code>ResourceTypeDisplaySummary</code> * representing a single resource. */ public static final int SUMMARY_TYPE_SINGLETON = 3; }
cc14514/hq6
hq-server/src/main/java/org/hyperic/hq/bizapp/shared/uibeans/UIConstants.java
Java
unlicense
1,779
html {overflow-y:scroll;} body { color:#222; font-size:16px; margin:0; background-color: #efebdb; background-image:url(../img/ricepaper.png); } /* HEADERS */ h1 { position:relative; font-family:BrandonGrotesque-Bold, Futura, Verdana, serif; font-size:50px; text-transform:uppercase; height:80px; margin:1px; margin-top:20px; padding-bottom: 30px 0; border-bottom:1px solid #CCC; } h2 { position:relative; top:10px; font-size:22px; text-align:center; padding-top:10px; padding-bottom:20px; border-bottom:1px solid #CCC; margin:1px; margin-bottom:20px; } h3 { font-family:BrandonGrotesque-Bold, Futura, Verdana, serif; font-size:20px; text-transform:uppercase; margin:0; padding:0; } h4 { font-family:BrandonGrotesque-Bold, Futura, Verdana, serif; font-size:16px; text-transform:uppercase; margin:0; padding:0; line-height:22px; } h5 { font-family:BrandonGrotesque-Bold, Futura, Verdana, serif; font-size:48px; text-transform:uppercase; margin:0; margin-bottom:-8px; padding:0; } h6 { font-family:BrandonGrotesque-Light, Futura, Verdana, serif; font-size:26px; text-transform:uppercase; margin:0; padding:0; color:#999; } h2, h3, h4, h5, h6 {font-weight:normal;} /* TOP */ .top { position:relative; width:100%; margin:0 auto; text-align:center; top:60px; padding-bottom: 40px; } /* LINKS */ #links{ position:relative; width:70%; margin:0 auto; text-align:center; } #links ul { display: inline; list-style: none; } #links li { float:left; margin-top:10px; } #links li.last {margin-right:0;} .image { max-height: 100px; } /* FOOTER */ footer { width:100%; float:left; text-align:center; margin-top:60px; margin-bottom:20px; } footer small { font-size:12px; font-family:"Lucida Grande"; color:#ccc; }
tdaribeiro/taina-ribeiro-dot-com
css/style.css
CSS
unlicense
1,824
// // RSAPubKey.h // // Version 1.0.0 // // Created by yangtu222 on 2016.06.30. // Copyright (C) 2016, andlisoft.com. // // Distributed under the permissive zlib License // Get the latest version from here: // // https://github.com/yangtu222/RSAPublicKey // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it // freely, subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; you must not // claim that you wrote the original software. If you use this software // in a product, an acknowledgment in the product documentation would be // appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, and must not be // misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // #import <Foundation/Foundation.h> #import <Security/Security.h> @interface RSAPubKey : NSObject + (SecKeyRef) stringToRSAPubKey: (NSString*) modulus andExponent:(NSString*) exponent; //m and e is base64 encoded. + (SecKeyRef) dataRSAPubKey: (NSData*) modulus andExponent:(NSData*) exponent; @end
stefli/react-native-rsa-jiuye
ios/RSAUtils/RSAPubKey.h
C
unlicense
1,438
<!DOCTYPE html> <html > <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>RcppのためのC++入門</title> <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"> <meta name="description" content="Rcppを使うために最低限必要なC++の知識"> <meta name="generator" content="bookdown 0.3 and GitBook 2.6.7"> <meta property="og:title" content="RcppのためのC++入門" /> <meta property="og:type" content="book" /> <meta property="og:description" content="Rcppを使うために最低限必要なC++の知識" /> <meta name="twitter:card" content="summary" /> <meta name="twitter:title" content="RcppのためのC++入門" /> <meta name="twitter:description" content="Rcppを使うために最低限必要なC++の知識" /> <meta name="author" content="Masaki Tsuda"> <meta name="date" content="2017-03-25"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <link rel="next" href="section-1.html"> <script src="libs/jquery-2.2.3/jquery.min.js"></script> <link href="libs/gitbook-2.6.7/css/style.css" rel="stylesheet" /> <link href="libs/gitbook-2.6.7/css/plugin-bookdown.css" rel="stylesheet" /> <link href="libs/gitbook-2.6.7/css/plugin-highlight.css" rel="stylesheet" /> <link href="libs/gitbook-2.6.7/css/plugin-search.css" rel="stylesheet" /> <link href="libs/gitbook-2.6.7/css/plugin-fontsettings.css" rel="stylesheet" /> </head> <body> <div class="book without-animation with-summary font-size-2 font-family-1" data-basepath="."> <div class="book-summary"> <nav role="navigation"> <ul class="summary"> <li class="chapter" data-level="" data-path="index.html"><a href="index.html"><i class="fa fa-check"></i>はじめに</a></li> <li class="chapter" data-level="1" data-path="section-1.html"><a href="section-1.html"><i class="fa fa-check"></i><b>1</b> 章のタイトルをここに入力</a></li> </ul> </nav> </div> <div class="book-body"> <div class="body-inner"> <div class="book-header" role="navigation"> <h1> <i class="fa fa-circle-o-notch fa-spin"></i><a href="./">RcppのためのC++入門</a> </h1> </div> <div class="page-wrapper" tabindex="-1" role="main"> <div class="page-inner"> <section class="normal" id="section-"> <div id="header"> <h1 class="title">RcppのためのC++入門</h1> <h4 class="author"><em>Masaki Tsuda</em></h4> <h4 class="date"><em>2017-03-25</em></h4> </div> <div id="e381afe38198e38281e381ab" class="section level1 unnumbered"> <h1>はじめに</h1> <p>このサイトは Rcpp を使うために最低限必要な C++ の知識を紹介することを目的としています。</p> <p>Rcppの解説については <a href="https://www.gitbook.com/book/teuder/introduction-to-rcpp/details/ja">Introduction to Rcpp(日本語)</a> を参照してみてください。</p> <ul> <li><p>関数と変数</p></li> <li><p>変数</p> <ul> <li><p>変数の宣言</p></li> <li><p>変数の型</p> <ul> <li><p>基本型</p></li> <li><p>ユーザー定義型</p></li> <li><p>参照型</p> <p>→関数の引数</p></li> <li><p>配列型(優先度低)</p> <p>→STL</p></li> <li><p>ポインタ型(優先度低)</p> <p>→イテレータ</p></li> </ul></li> <li><p>変数の初期化</p></li> <li><p>修飾子</p></li> <li><p>変数のスコープ</p></li> </ul></li> <li><p>関数</p> <ul> <li><p>関数の定義</p></li> <li><p>引数</p> <ul> <li>値渡し</li> <li>参照渡し</li> <li>ポインタ渡し</li> </ul></li> <li><p>関数の多重定義</p></li> <li><p>関数テンプレート</p></li> </ul></li> <li><p>列挙型</p></li> <li><p>構造体とクラス</p> <ul> <li><p>メンバ変数</p></li> <li><p>メンバ関数</p></li> <li><p>静的メンバ変数・関数</p></li> <li><p>コンストラクタ</p></li> <li><p>デストラクタ</p></li> <li><p>継承</p></li> <li><p>クラステンプレート</p></li> </ul></li> <li><p>データ構造とアルゴリズム(STL)</p> <ul> <li><p>データ構造</p></li> <li><p>イテレータ</p></li> <li><p>アルゴリズム</p></li> </ul></li> <li><p>名前空間</p></li> </ul> </div> </section> </div> </div> </div> <a href="section-1.html" class="navigation navigation-next navigation-unique" aria-label="Next page""><i class="fa fa-angle-right"></i></a> <script src="libs/gitbook-2.6.7/js/app.min.js"></script> <script src="libs/gitbook-2.6.7/js/lunr.js"></script> <script src="libs/gitbook-2.6.7/js/plugin-search.js"></script> <script src="libs/gitbook-2.6.7/js/plugin-sharing.js"></script> <script src="libs/gitbook-2.6.7/js/plugin-fontsettings.js"></script> <script src="libs/gitbook-2.6.7/js/plugin-bookdown.js"></script> <script src="libs/gitbook-2.6.7/js/jquery.highlight.js"></script> <script> require(["gitbook"], function(gitbook) { gitbook.start({ "sharing": { "github": false, "facebook": true, "twitter": true, "google": false, "weibo": false, "instapper": false, "vk": false, "all": ["facebook", "google", "twitter", "weibo", "instapaper"] }, "fontsettings": { "theme": "white", "family": "sans", "size": 2 }, "edit": { "link": null, "text": null }, "download": null, "toc": { "collapse": "subsection" } }); }); </script> </body> </html>
teuder/cpp4rcpp
md/_book/index.html
HTML
unlicense
5,507
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ShinePhoto.ConsoleOut { class Program { static void Main(string[] args) { var flag = System.Text.RegularExpressions.Regex.IsMatch("{pack://application:,,,/ShinePhoto.Icons;Component/light/appbar.quill.png}", @"light"); Console.WriteLine(flag); var result = System.Text.RegularExpressions.Regex.Replace("{pack://application:,,,/ShinePhoto.Icons;Component/light/appbar.quill.png}", "light", "dark"); Console.WriteLine(result); Console.ReadKey(true); } } }
changweihua/ShinePhoto
ShinePhoto.ConsoleOut/Program.cs
C#
unlicense
654
package com.nostra13.universalimageloader.core; class LoadAndDisplayImageTask$TaskCancelledException extends Exception { LoadAndDisplayImageTask$TaskCancelledException(LoadAndDisplayImageTask paramLoadAndDisplayImageTask) { } } /* Location: E:\Progs\Dev\Android\Decompile\apktool\zssq\zssq-dex2jar.jar * Qualified Name: com.nostra13.universalimageloader.core.LoadAndDisplayImageTask.TaskCancelledException * JD-Core Version: 0.6.0 */
clilystudio/NetBook
allsrc/com/nostra13/universalimageloader/core/LoadAndDisplayImageTask$TaskCancelledException.java
Java
unlicense
461
#pragma once #include "maths.h" #include "utils.h" #include <map> using namespace maths; using namespace utils; struct Camera { Camera(); void update(std::map<int, Transform>& transforms); bool follow_vehicle; bool target_changed; int last_target_index; int current_target_index; float target_distance; float field_of_view; float aspect_ratio; vec2 resolution; vec2 depth_range_ortho; vec2 depth_range_persp; vec3 position_start; vec3 position_current; vec3 position_target; vec3 orientation_up; vec3 old_position; vec3 old_target; mat4 matrix_view; mat4 matrix_projection_persp; mat4 matrix_projection_ortho; float height; int index_list_position_current; std::vector<vec3> list_position_current; };
OllieReynolds/GL_VEHICLES
include/camera.h
C
unlicense
740
#ifndef FILERWKIT_H #define FILERWKIT_H #include <QObject> #include <QVector> #include <QFile> #include <QXmlStreamReader> #include <QXmlStreamWriter> #include <QString> #include <QStringList> #include <QDebug> #include <QDir> #include <QDateTime> #include <QtMath> class QFileIO : public QObject { Q_OBJECT public: explicit QFileIO(QObject *parent = 0); QVector< QVector<double> > ReadCSV(QString filename); private: signals: public slots: }; #endif // FILERWKIT_H
alanbithell/QFileIO
filerwkit.h
C
unlicense
499
#ifdef HAVE_CONFIG_H # include <config.h> #endif #include <stdlib.h> #include <stdio.h> #include <errno.h> #include <math.h> #ifdef __SUNPRO_C # include <ieeefp.h> #endif #ifdef HAVE_ISFINITE # define ECORE_FINITE(t) isfinite(t) #else # ifdef _MSC_VER # define ECORE_FINITE(t) _finite(t) # else # define ECORE_FINITE(t) finite(t) # endif #endif #define FIX_HZ 1 #ifdef FIX_HZ # ifndef _MSC_VER # include <sys/param.h> # endif # ifndef HZ # define HZ 100 # endif #endif #ifdef HAVE_EVIL # include <Evil.h> #endif #ifdef HAVE_ESCAPE # include <Escape.h> #endif #ifdef HAVE_EXOTIC # include <Exotic.h> #endif /* * On Windows, pipe() is implemented with sockets. * Contrary to Linux, Windows uses different functions * for sockets and fd's: write() is for fd's and send * is for sockets. So I need to put some win32 code * here. I can't think of a solution where the win32 * code is in Evil and not here. */ #define PIPE_FD_INVALID -1 #ifdef _WIN32 # include <winsock2.h> # define pipe_write(fd, buffer, size) send((fd), (char *)(buffer), size, 0) # define pipe_read(fd, buffer, size) recv((fd), (char *)(buffer), size, 0) # define pipe_close(fd) closesocket(fd) # define PIPE_FD_ERROR SOCKET_ERROR #else # include <unistd.h> # include <fcntl.h> # define pipe_write(fd, buffer, size) write((fd), buffer, size) # define pipe_read(fd, buffer, size) read((fd), buffer, size) # define pipe_close(fd) close(fd) # define PIPE_FD_ERROR -1 #endif /* ! _WIN32 */ #include "Ecore.h" #include "ecore_private.h" /* How of then we should retry to write to the pipe */ #define ECORE_PIPE_WRITE_RETRY 6 struct _Ecore_Pipe { ECORE_MAGIC; int fd_read; int fd_write; Ecore_Fd_Handler *fd_handler; const void *data; Ecore_Pipe_Cb handler; unsigned int len; int handling; size_t already_read; void *passed_data; int message; Eina_Bool delete_me : 1; }; GENERIC_ALLOC_SIZE_DECLARE(Ecore_Pipe); static Eina_Bool _ecore_pipe_read(void *data, Ecore_Fd_Handler *fd_handler); /** * @addtogroup Ecore_Pipe_Group * * @{ */ /** * Create two file descriptors (sockets on Windows). Add * a callback that will be called when the file descriptor that * is listened receives data. An event is also put in the event * queue when data is received. * * @param handler The handler called when data is received. * @param data Data to pass to @p handler when it is called. * @return A newly created Ecore_Pipe object if successful. * @c NULL otherwise. */ EAPI Ecore_Pipe * ecore_pipe_add(Ecore_Pipe_Cb handler, const void *data) { Ecore_Pipe *p; _ecore_lock(); p = _ecore_pipe_add(handler, data); _ecore_unlock(); return p; } /** * Free an Ecore_Pipe object created with ecore_pipe_add(). * * @param p The Ecore_Pipe object to be freed. * @return The pointer to the private data */ EAPI void * ecore_pipe_del(Ecore_Pipe *p) { void *r; if (!p) return NULL; EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL); _ecore_lock(); r = _ecore_pipe_del(p); _ecore_unlock(); return r; } /** * Close the read end of an Ecore_Pipe object created with ecore_pipe_add(). * * @param p The Ecore_Pipe object. */ EAPI void ecore_pipe_read_close(Ecore_Pipe *p) { EINA_MAIN_LOOP_CHECK_RETURN; _ecore_lock(); if (!ECORE_MAGIC_CHECK(p, ECORE_MAGIC_PIPE)) { ECORE_MAGIC_FAIL(p, ECORE_MAGIC_PIPE, "ecore_pipe_read_close"); goto out; } if (p->fd_handler) { _ecore_main_fd_handler_del(p->fd_handler); p->fd_handler = NULL; } if (p->fd_read != PIPE_FD_INVALID) { pipe_close(p->fd_read); p->fd_read = PIPE_FD_INVALID; } out: _ecore_unlock(); } EAPI int ecore_pipe_read_fd(Ecore_Pipe *p) { EINA_MAIN_LOOP_CHECK_RETURN_VAL(PIPE_FD_INVALID); return p->fd_read; } /** * Stop monitoring if necessary the pipe for reading. See ecore_pipe_thaw() * for monitoring it again. * * @param p The Ecore_Pipe object. * @since 1.1 */ EAPI void ecore_pipe_freeze(Ecore_Pipe *p) { EINA_MAIN_LOOP_CHECK_RETURN; _ecore_lock(); if (!ECORE_MAGIC_CHECK(p, ECORE_MAGIC_PIPE)) { ECORE_MAGIC_FAIL(p, ECORE_MAGIC_PIPE, "ecore_pipe_read_freeze"); goto out; } if (p->fd_handler) { _ecore_main_fd_handler_del(p->fd_handler); p->fd_handler = NULL; } out: _ecore_unlock(); } /** * Start monitoring again the pipe for reading. See ecore_pipe_freeze() for * stopping the monitoring activity. This will not work if * ecore_pipe_read_close() was previously called on the same pipe. * * @param p The Ecore_Pipe object. * @since 1.1 */ EAPI void ecore_pipe_thaw(Ecore_Pipe *p) { EINA_MAIN_LOOP_CHECK_RETURN; _ecore_lock(); if (!ECORE_MAGIC_CHECK(p, ECORE_MAGIC_PIPE)) { ECORE_MAGIC_FAIL(p, ECORE_MAGIC_PIPE, "ecore_pipe_read_thaw"); goto out; } if (!p->fd_handler && p->fd_read != PIPE_FD_INVALID) { p->fd_handler = ecore_main_fd_handler_add(p->fd_read, ECORE_FD_READ, _ecore_pipe_read, p, NULL, NULL); } out: _ecore_unlock(); } /** * @brief Wait from another thread on the read side of a pipe. * * @param p The pipe to watch on. * @param message_count The minimal number of message to wait before exiting. * @param wait The amount of time in second to wait before exiting. * @return the number of message catched during that wait call. * @since 1.1 * * Negative value for @p wait means infite wait. */ EAPI int ecore_pipe_wait(Ecore_Pipe *p, int message_count, double wait) { int r; _ecore_lock(); r = _ecore_pipe_wait(p, message_count, wait); _ecore_unlock(); return r; } /** * Close the write end of an Ecore_Pipe object created with ecore_pipe_add(). * * @param p The Ecore_Pipe object. */ EAPI void ecore_pipe_write_close(Ecore_Pipe *p) { _ecore_lock(); if (!ECORE_MAGIC_CHECK(p, ECORE_MAGIC_PIPE)) { ECORE_MAGIC_FAIL(p, ECORE_MAGIC_PIPE, "ecore_pipe_write_close"); goto out; } if (p->fd_write != PIPE_FD_INVALID) { pipe_close(p->fd_write); p->fd_write = PIPE_FD_INVALID; } out: _ecore_unlock(); } EAPI int ecore_pipe_write_fd(Ecore_Pipe *p) { EINA_MAIN_LOOP_CHECK_RETURN_VAL(PIPE_FD_INVALID); return p->fd_write; } /** * Write on the file descriptor the data passed as parameter. * * @param p The Ecore_Pipe object. * @param buffer The data to write into the pipe. * @param nbytes The size of the @p buffer in bytes * @return @c EINA_TRUE on a successful write, @c EINA_FALSE on error. */ EAPI Eina_Bool ecore_pipe_write(Ecore_Pipe *p, const void *buffer, unsigned int nbytes) { ssize_t ret; size_t already_written = 0; int retry = ECORE_PIPE_WRITE_RETRY; Eina_Bool ok = EINA_FALSE; _ecore_lock(); if (!ECORE_MAGIC_CHECK(p, ECORE_MAGIC_PIPE)) { ECORE_MAGIC_FAIL(p, ECORE_MAGIC_PIPE, "ecore_pipe_write"); goto out; } if (p->delete_me) goto out; if (p->fd_write == PIPE_FD_INVALID) goto out; /* First write the len into the pipe */ do { ret = pipe_write(p->fd_write, &nbytes, sizeof(nbytes)); if (ret == sizeof(nbytes)) { retry = ECORE_PIPE_WRITE_RETRY; break; } else if (ret > 0) { /* XXX What should we do here? */ ERR("The length of the data was not written complete" " to the pipe"); goto out; } else if (ret == PIPE_FD_ERROR && errno == EPIPE) { pipe_close(p->fd_write); p->fd_write = PIPE_FD_INVALID; goto out; } else if (ret == PIPE_FD_ERROR && errno == EINTR) /* try it again */ ; else { ERR("An unhandled error (ret: %zd errno: %d)" "occurred while writing to the pipe the length", ret, errno); } } while (retry--); if (retry != ECORE_PIPE_WRITE_RETRY) goto out; /* and now pass the data to the pipe */ do { ret = pipe_write(p->fd_write, ((unsigned char *)buffer) + already_written, nbytes - already_written); if (ret == (ssize_t)(nbytes - already_written)) { ok = EINA_TRUE; goto out; } else if (ret >= 0) { already_written -= ret; continue; } else if (ret == PIPE_FD_ERROR && errno == EPIPE) { pipe_close(p->fd_write); p->fd_write = PIPE_FD_INVALID; goto out; } else if (ret == PIPE_FD_ERROR && errno == EINTR) /* try it again */ ; else { ERR("An unhandled error (ret: %zd errno: %d)" "occurred while writing to the pipe the length", ret, errno); } } while (retry--); out: _ecore_unlock(); return ok; } EAPI Ecore_Pipe * ecore_pipe_full_add(Ecore_Pipe_Cb handler, const void *data, int fd_read, int fd_write, Eina_Bool read_survive_fork, Eina_Bool write_survive_fork) { Ecore_Pipe *p = NULL; int fds[2]; EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL); if (!handler) return NULL; p = ecore_pipe_calloc(1); if (!p) return NULL; if (fd_read == -1 && fd_write == -1) { if (pipe(fds)) { ecore_pipe_mp_free(p); return NULL; } fd_read = fds[0]; fd_write = fds[1]; } else { fd_read = fd_read == -1 ? PIPE_FD_INVALID : fd_read; fd_write = fd_write == -1 ? PIPE_FD_INVALID : fd_write; } ECORE_MAGIC_SET(p, ECORE_MAGIC_PIPE); p->fd_read = fd_read; p->fd_write = fd_write; p->handler = handler; p->data = data; if (!read_survive_fork) _ecore_fd_close_on_exec(fd_read); if (!write_survive_fork) _ecore_fd_close_on_exec(fd_write); fcntl(p->fd_read, F_SETFL, O_NONBLOCK); p->fd_handler = ecore_main_fd_handler_add(p->fd_read, ECORE_FD_READ, _ecore_pipe_read, p, NULL, NULL); return p; } /** * @} */ /* Private functions */ Ecore_Pipe * _ecore_pipe_add(Ecore_Pipe_Cb handler, const void *data) { return ecore_pipe_full_add(handler, data, -1, -1, EINA_FALSE, EINA_FALSE); } void * _ecore_pipe_del(Ecore_Pipe *p) { void *data = NULL; if (!ECORE_MAGIC_CHECK(p, ECORE_MAGIC_PIPE)) { ECORE_MAGIC_FAIL(p, ECORE_MAGIC_PIPE, "ecore_pipe_del"); return NULL; } p->delete_me = EINA_TRUE; if (p->handling > 0) return (void *)p->data; if (p->fd_handler) _ecore_main_fd_handler_del(p->fd_handler); if (p->fd_read != PIPE_FD_INVALID) pipe_close(p->fd_read); if (p->fd_write != PIPE_FD_INVALID) pipe_close(p->fd_write); data = (void *)p->data; ecore_pipe_mp_free(p); return data; } int _ecore_pipe_wait(Ecore_Pipe *p, int message_count, double wait) { struct timeval tv, *t; fd_set rset; double end = 0.0; double timeout; int ret; int total = 0; EINA_MAIN_LOOP_CHECK_RETURN_VAL(-1); if (p->fd_read == PIPE_FD_INVALID) return -1; FD_ZERO(&rset); FD_SET(p->fd_read, &rset); if (wait >= 0.0) end = ecore_loop_time_get() + wait; timeout = wait; while (message_count > 0 && (timeout > 0.0 || wait <= 0.0)) { if (wait >= 0.0) { /* finite() tests for NaN, too big, too small, and infinity. */ if ((!ECORE_FINITE(timeout)) || (timeout == 0.0)) { tv.tv_sec = 0; tv.tv_usec = 0; } else if (timeout > 0.0) { int sec, usec; #ifdef FIX_HZ timeout += (0.5 / HZ); sec = (int)timeout; usec = (int)((timeout - (double)sec) * 1000000); #else sec = (int)timeout; usec = (int)((timeout - (double)sec) * 1000000); #endif tv.tv_sec = sec; tv.tv_usec = usec; } t = &tv; } else { t = NULL; } ret = main_loop_select(p->fd_read + 1, &rset, NULL, NULL, t); if (ret > 0) { _ecore_pipe_read(p, NULL); message_count -= p->message; total += p->message; p->message = 0; } else if (ret == 0) { break; } else if (errno != EINTR) { close(p->fd_read); p->fd_read = PIPE_FD_INVALID; break; } if (wait >= 0.0) timeout = end - ecore_loop_time_get(); } return total; } static void _ecore_pipe_unhandle(Ecore_Pipe *p) { p->handling--; if (p->delete_me) { _ecore_pipe_del(p); } } static void _ecore_pipe_handler_call(Ecore_Pipe *p, unsigned char *buf, size_t len) { void *data = (void*) p->data; if (!p->delete_me) { _ecore_unlock(); p->handler(data, buf, len); _ecore_lock(); } } static Eina_Bool _ecore_pipe_read(void *data, Ecore_Fd_Handler *fd_handler EINA_UNUSED) { Ecore_Pipe *p = (Ecore_Pipe *)data; int i; p->handling++; for (i = 0; i < 16; i++) { ssize_t ret; /* if we already have read some data we don't need to read the len * but to finish the already started job */ if (p->len == 0) { /* read the len of the passed data */ ret = pipe_read(p->fd_read, &p->len, sizeof(p->len)); /* catch the non error case first */ /* read amount ok - nothing more to do */ if (ret == sizeof(p->len)) ; else if (ret > 0) { /* we got more data than we asked for - definite error */ ERR("Only read %i bytes from the pipe, although" " we need to read %i bytes.", (int)ret, (int)sizeof(p->len)); _ecore_pipe_unhandle(p); return ECORE_CALLBACK_CANCEL; } else if (ret == 0) { /* we got no data */ if (i == 0) { /* no data on first try through means an error */ _ecore_pipe_handler_call(p, NULL, 0); if (p->passed_data) free(p->passed_data); p->passed_data = NULL; p->already_read = 0; p->len = 0; p->message++; pipe_close(p->fd_read); p->fd_read = PIPE_FD_INVALID; p->fd_handler = NULL; _ecore_pipe_unhandle(p); return ECORE_CALLBACK_CANCEL; } else { /* no data after first loop try is ok */ _ecore_pipe_unhandle(p); return ECORE_CALLBACK_RENEW; } } #ifndef _WIN32 else if ((ret == PIPE_FD_ERROR) && ((errno == EINTR) || (errno == EAGAIN))) { _ecore_pipe_unhandle(p); return ECORE_CALLBACK_RENEW; } else { ERR("An unhandled error (ret: %i errno: %i [%s])" "occurred while reading from the pipe the length", (int)ret, errno, strerror(errno)); _ecore_pipe_unhandle(p); return ECORE_CALLBACK_RENEW; } #else else /* ret == PIPE_FD_ERROR is the only other case on Windows */ { if (WSAGetLastError() != WSAEWOULDBLOCK) { _ecore_pipe_handler_call(p, NULL, 0); if (p->passed_data) free(p->passed_data); p->passed_data = NULL; p->already_read = 0; p->len = 0; p->message++; pipe_close(p->fd_read); p->fd_read = PIPE_FD_INVALID; p->fd_handler = NULL; _ecore_pipe_unhandle(p); return ECORE_CALLBACK_CANCEL; } } #endif } /* if somehow we got less than or equal to 0 we got an errnoneous * messages so call callback with null and len we got. this case should * never happen */ if (p->len == 0) { _ecore_pipe_handler_call(p, NULL, 0); /* reset all values to 0 */ if (p->passed_data) free(p->passed_data); p->passed_data = NULL; p->already_read = 0; p->len = 0; p->message++; _ecore_pipe_unhandle(p); return ECORE_CALLBACK_RENEW; } /* we dont have a buffer to hold the data, so alloc it */ if (!p->passed_data) { p->passed_data = malloc(p->len); /* alloc failed - error case */ if (!p->passed_data) { _ecore_pipe_handler_call(p, NULL, 0); /* close the pipe */ p->already_read = 0; p->len = 0; p->message++; pipe_close(p->fd_read); p->fd_read = PIPE_FD_INVALID; p->fd_handler = NULL; _ecore_pipe_unhandle(p); return ECORE_CALLBACK_CANCEL; } } /* and read the passed data */ ret = pipe_read(p->fd_read, ((unsigned char *)p->passed_data) + p->already_read, p->len - p->already_read); /* catch the non error case first */ /* if we read enough data to finish the message/buffer */ if (ret == (ssize_t)(p->len - p->already_read)) { _ecore_pipe_handler_call(p, p->passed_data, p->len); free(p->passed_data); /* reset all values to 0 */ p->passed_data = NULL; p->already_read = 0; p->len = 0; p->message++; } else if (ret > 0) { /* more data left to read */ p->already_read += ret; _ecore_pipe_unhandle(p); return ECORE_CALLBACK_RENEW; } else if (ret == 0) { /* 0 bytes to read - could be more to read next select wake up */ _ecore_pipe_unhandle(p); return ECORE_CALLBACK_RENEW; } #ifndef _WIN32 else if ((ret == PIPE_FD_ERROR) && ((errno == EINTR) || (errno == EAGAIN))) { _ecore_pipe_unhandle(p); return ECORE_CALLBACK_RENEW; } else { ERR("An unhandled error (ret: %zd errno: %d)" "occurred while reading from the pipe the data", ret, errno); _ecore_pipe_unhandle(p); return ECORE_CALLBACK_RENEW; } #else else /* ret == PIPE_FD_ERROR is the only other case on Windows */ { if (WSAGetLastError() != WSAEWOULDBLOCK) { _ecore_pipe_handler_call(p, NULL, 0); if (p->passed_data) free(p->passed_data); p->passed_data = NULL; p->already_read = 0; p->len = 0; p->message++; pipe_close(p->fd_read); p->fd_read = PIPE_FD_INVALID; p->fd_handler = NULL; _ecore_pipe_unhandle(p); return ECORE_CALLBACK_CANCEL; } else break; } #endif } _ecore_pipe_unhandle(p); return ECORE_CALLBACK_RENEW; }
maikodaraine/EnlightenmentUbuntu
core/efl/src/lib/ecore/ecore_pipe.c
C
unlicense
21,324
# ------------------------------------------------------------------------------ # This extension adds support for Jinja templates. # ------------------------------------------------------------------------------ import sys from ivy import hooks, site, templates try: import jinja2 except ImportError: jinja2 = None # Stores an initialized Jinja environment instance. env = None # The jinja2 package is an optional dependency. if jinja2: # Initialize our Jinja environment on the 'init' event hook. @hooks.register('init') def init(): # Initialize a template loader. settings = { 'loader': jinja2.FileSystemLoader(site.theme('templates')) } # Check the site's config file for any custom settings. settings.update(site.config.get('jinja', {})) # Initialize an Environment instance. global env env = jinja2.Environment(**settings) # Register our template engine callback for files with a .jinja extension. @templates.register('jinja') def callback(page, filename): try: template = env.get_template(filename) return template.render(page) except jinja2.TemplateError as err: msg = "------------------------\n" msg += " Jinja Template Error \n" msg += "------------------------\n\n" msg += " Template: %s\n" % filename msg += " Page: %s\n\n" % page['filepath'] msg += " %s: %s" % (err.__class__.__name__, err) if err.__context__: cause = err.__context__ msg += "\n\n The following cause was reported:\n\n" msg += " %s: %s" % (cause.__class__.__name__, cause) sys.exit(msg)
dmulholland/ivy
ivy/ext/ivy_jinja.py
Python
unlicense
1,779
package com.ushaqi.zhuishushenqi.ui.ugcbook; import android.content.DialogInterface; import android.content.DialogInterface.OnClickListener; import android.support.design.widget.am; import com.handmark.pulltorefresh.library.PullToRefreshListView; import com.ushaqi.zhuishushenqi.model.Account; import com.ushaqi.zhuishushenqi.model.UGCBookListRoot.UGCBook; import com.ushaqi.zhuishushenqi.ui.BaseActivity; final class g implements DialogInterface.OnClickListener { g(FavUGCListFragment paramFavUGCListFragment, UGCBookListRoot.UGCBook paramUGCBook) { } public final void onClick(DialogInterface paramDialogInterface, int paramInt) { Account localAccount = am.a((BaseActivity)this.b.getActivity()); if (localAccount != null) { FavUGCListFragment.a(this.b).setRefreshing(); h localh = new h(this.b, 0); String[] arrayOfString = new String[2]; arrayOfString[0] = localAccount.getToken(); arrayOfString[1] = this.a.get_id(); localh.b(arrayOfString); } } } /* Location: E:\Progs\Dev\Android\Decompile\apktool\zssq\zssq-dex2jar.jar * Qualified Name: com.ushaqi.zhuishushenqi.ui.ugcbook.g * JD-Core Version: 0.6.0 */
clilystudio/NetBook
allsrc/com/ushaqi/zhuishushenqi/ui/ugcbook/g(1).java
Java
unlicense
1,199
using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.IO; using System.Linq; using System.Net.Http; using System.Net.Http.Formatting; using System.Net.Http.Headers; using System.Web.Http.Description; using System.Xml.Linq; using Newtonsoft.Json; namespace GtfsService.Areas.HelpPage { /// <summary> /// This class will generate the samples for the help page. /// </summary> public class HelpPageSampleGenerator { /// <summary> /// Initializes a new instance of the <see cref="HelpPageSampleGenerator"/> class. /// </summary> public HelpPageSampleGenerator() { ActualHttpMessageTypes = new Dictionary<HelpPageSampleKey, Type>(); ActionSamples = new Dictionary<HelpPageSampleKey, object>(); SampleObjects = new Dictionary<Type, object>(); SampleObjectFactories = new List<Func<HelpPageSampleGenerator, Type, object>> { DefaultSampleObjectFactory, }; } /// <summary> /// Gets CLR types that are used as the content of <see cref="HttpRequestMessage"/> or <see cref="HttpResponseMessage"/>. /// </summary> public IDictionary<HelpPageSampleKey, Type> ActualHttpMessageTypes { get; internal set; } /// <summary> /// Gets the objects that are used directly as samples for certain actions. /// </summary> public IDictionary<HelpPageSampleKey, object> ActionSamples { get; internal set; } /// <summary> /// Gets the objects that are serialized as samples by the supported formatters. /// </summary> public IDictionary<Type, object> SampleObjects { get; internal set; } /// <summary> /// Gets factories for the objects that the supported formatters will serialize as samples. Processed in order, /// stopping when the factory successfully returns a non-<see langref="null"/> object. /// </summary> /// <remarks> /// Collection includes just <see cref="ObjectGenerator.GenerateObject(Type)"/> initially. Use /// <code>SampleObjectFactories.Insert(0, func)</code> to provide an override and /// <code>SampleObjectFactories.Add(func)</code> to provide a fallback.</remarks> [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", Justification = "This is an appropriate nesting of generic types")] public IList<Func<HelpPageSampleGenerator, Type, object>> SampleObjectFactories { get; private set; } /// <summary> /// Gets the request body samples for a given <see cref="ApiDescription"/>. /// </summary> /// <param name="api">The <see cref="ApiDescription"/>.</param> /// <returns>The samples keyed by media type.</returns> public IDictionary<MediaTypeHeaderValue, object> GetSampleRequests(ApiDescription api) { return GetSample(api, SampleDirection.Request); } /// <summary> /// Gets the response body samples for a given <see cref="ApiDescription"/>. /// </summary> /// <param name="api">The <see cref="ApiDescription"/>.</param> /// <returns>The samples keyed by media type.</returns> public IDictionary<MediaTypeHeaderValue, object> GetSampleResponses(ApiDescription api) { return GetSample(api, SampleDirection.Response); } /// <summary> /// Gets the request or response body samples. /// </summary> /// <param name="api">The <see cref="ApiDescription"/>.</param> /// <param name="sampleDirection">The value indicating whether the sample is for a request or for a response.</param> /// <returns>The samples keyed by media type.</returns> public virtual IDictionary<MediaTypeHeaderValue, object> GetSample(ApiDescription api, SampleDirection sampleDirection) { if (api == null) { throw new ArgumentNullException("api"); } string controllerName = api.ActionDescriptor.ControllerDescriptor.ControllerName; string actionName = api.ActionDescriptor.ActionName; IEnumerable<string> parameterNames = api.ParameterDescriptions.Select(p => p.Name); Collection<MediaTypeFormatter> formatters; Type type = ResolveType(api, controllerName, actionName, parameterNames, sampleDirection, out formatters); var samples = new Dictionary<MediaTypeHeaderValue, object>(); // Use the samples provided directly for actions var actionSamples = GetAllActionSamples(controllerName, actionName, parameterNames, sampleDirection); foreach (var actionSample in actionSamples) { samples.Add(actionSample.Key.MediaType, WrapSampleIfString(actionSample.Value)); } // Do the sample generation based on formatters only if an action doesn't return an HttpResponseMessage. // Here we cannot rely on formatters because we don't know what's in the HttpResponseMessage, it might not even use formatters. if (type != null && !typeof(HttpResponseMessage).IsAssignableFrom(type)) { object sampleObject = GetSampleObject(type); foreach (var formatter in formatters) { foreach (MediaTypeHeaderValue mediaType in formatter.SupportedMediaTypes) { if (!samples.ContainsKey(mediaType)) { object sample = GetActionSample(controllerName, actionName, parameterNames, type, formatter, mediaType, sampleDirection); // If no sample found, try generate sample using formatter and sample object if (sample == null && sampleObject != null) { sample = WriteSampleObjectUsingFormatter(formatter, sampleObject, type, mediaType); } samples.Add(mediaType, WrapSampleIfString(sample)); } } } } return samples; } /// <summary> /// Search for samples that are provided directly through <see cref="ActionSamples"/>. /// </summary> /// <param name="controllerName">Name of the controller.</param> /// <param name="actionName">Name of the action.</param> /// <param name="parameterNames">The parameter names.</param> /// <param name="type">The CLR type.</param> /// <param name="formatter">The formatter.</param> /// <param name="mediaType">The media type.</param> /// <param name="sampleDirection">The value indicating whether the sample is for a request or for a response.</param> /// <returns>The sample that matches the parameters.</returns> public virtual object GetActionSample(string controllerName, string actionName, IEnumerable<string> parameterNames, Type type, MediaTypeFormatter formatter, MediaTypeHeaderValue mediaType, SampleDirection sampleDirection) { object sample; // First, try to get the sample provided for the specified mediaType, sampleDirection, controllerName, actionName and parameterNames. // If not found, try to get the sample provided for the specified mediaType, sampleDirection, controllerName and actionName regardless of the parameterNames. // If still not found, try to get the sample provided for the specified mediaType and type. // Finally, try to get the sample provided for the specified mediaType. if (ActionSamples.TryGetValue(new HelpPageSampleKey(mediaType, sampleDirection, controllerName, actionName, parameterNames), out sample) || ActionSamples.TryGetValue(new HelpPageSampleKey(mediaType, sampleDirection, controllerName, actionName, new[] { "*" }), out sample) || ActionSamples.TryGetValue(new HelpPageSampleKey(mediaType, type), out sample) || ActionSamples.TryGetValue(new HelpPageSampleKey(mediaType), out sample)) { return sample; } return null; } /// <summary> /// Gets the sample object that will be serialized by the formatters. /// First, it will look at the <see cref="SampleObjects"/>. If no sample object is found, it will try to create /// one using <see cref="DefaultSampleObjectFactory"/> (which wraps an <see cref="ObjectGenerator"/>) and other /// factories in <see cref="SampleObjectFactories"/>. /// </summary> /// <param name="type">The type.</param> /// <returns>The sample object.</returns> [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Even if all items in SampleObjectFactories throw, problem will be visible as missing sample.")] public virtual object GetSampleObject(Type type) { object sampleObject; if (!SampleObjects.TryGetValue(type, out sampleObject)) { // No specific object available, try our factories. foreach (Func<HelpPageSampleGenerator, Type, object> factory in SampleObjectFactories) { if (factory == null) { continue; } try { sampleObject = factory(this, type); if (sampleObject != null) { break; } } catch { // Ignore any problems encountered in the factory; go on to the next one (if any). } } } return sampleObject; } /// <summary> /// Resolves the actual type of <see cref="System.Net.Http.ObjectContent{T}"/> passed to the <see cref="System.Net.Http.HttpRequestMessage"/> in an action. /// </summary> /// <param name="api">The <see cref="ApiDescription"/>.</param> /// <returns>The type.</returns> public virtual Type ResolveHttpRequestMessageType(ApiDescription api) { string controllerName = api.ActionDescriptor.ControllerDescriptor.ControllerName; string actionName = api.ActionDescriptor.ActionName; IEnumerable<string> parameterNames = api.ParameterDescriptions.Select(p => p.Name); Collection<MediaTypeFormatter> formatters; return ResolveType(api, controllerName, actionName, parameterNames, SampleDirection.Request, out formatters); } /// <summary> /// Resolves the type of the action parameter or return value when <see cref="HttpRequestMessage"/> or <see cref="HttpResponseMessage"/> is used. /// </summary> /// <param name="api">The <see cref="ApiDescription"/>.</param> /// <param name="controllerName">Name of the controller.</param> /// <param name="actionName">Name of the action.</param> /// <param name="parameterNames">The parameter names.</param> /// <param name="sampleDirection">The value indicating whether the sample is for a request or a response.</param> /// <param name="formatters">The formatters.</param> [SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", Justification = "This is only used in advanced scenarios.")] public virtual Type ResolveType(ApiDescription api, string controllerName, string actionName, IEnumerable<string> parameterNames, SampleDirection sampleDirection, out Collection<MediaTypeFormatter> formatters) { if (!Enum.IsDefined(typeof(SampleDirection), sampleDirection)) { throw new InvalidEnumArgumentException("sampleDirection", (int)sampleDirection, typeof(SampleDirection)); } if (api == null) { throw new ArgumentNullException("api"); } Type type; if (ActualHttpMessageTypes.TryGetValue(new HelpPageSampleKey(sampleDirection, controllerName, actionName, parameterNames), out type) || ActualHttpMessageTypes.TryGetValue(new HelpPageSampleKey(sampleDirection, controllerName, actionName, new[] { "*" }), out type)) { // Re-compute the supported formatters based on type Collection<MediaTypeFormatter> newFormatters = new Collection<MediaTypeFormatter>(); foreach (var formatter in api.ActionDescriptor.Configuration.Formatters) { if (IsFormatSupported(sampleDirection, formatter, type)) { newFormatters.Add(formatter); } } formatters = newFormatters; } else { switch (sampleDirection) { case SampleDirection.Request: ApiParameterDescription requestBodyParameter = api.ParameterDescriptions.FirstOrDefault(p => p.Source == ApiParameterSource.FromBody); type = requestBodyParameter == null ? null : requestBodyParameter.ParameterDescriptor.ParameterType; formatters = api.SupportedRequestBodyFormatters; break; case SampleDirection.Response: default: type = api.ResponseDescription.ResponseType ?? api.ResponseDescription.DeclaredType; formatters = api.SupportedResponseFormatters; break; } } return type; } /// <summary> /// Writes the sample object using formatter. /// </summary> /// <param name="formatter">The formatter.</param> /// <param name="value">The value.</param> /// <param name="type">The type.</param> /// <param name="mediaType">Type of the media.</param> /// <returns></returns> [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "The exception is recorded as InvalidSample.")] public virtual object WriteSampleObjectUsingFormatter(MediaTypeFormatter formatter, object value, Type type, MediaTypeHeaderValue mediaType) { if (formatter == null) { throw new ArgumentNullException("formatter"); } if (mediaType == null) { throw new ArgumentNullException("mediaType"); } object sample = String.Empty; MemoryStream ms = null; HttpContent content = null; try { if (formatter.CanWriteType(type)) { ms = new MemoryStream(); content = new ObjectContent(type, value, formatter, mediaType); formatter.WriteToStreamAsync(type, value, ms, content, null).Wait(); ms.Position = 0; StreamReader reader = new StreamReader(ms); string serializedSampleString = reader.ReadToEnd(); if (mediaType.MediaType.ToUpperInvariant().Contains("XML")) { serializedSampleString = TryFormatXml(serializedSampleString); } else if (mediaType.MediaType.ToUpperInvariant().Contains("JSON")) { serializedSampleString = TryFormatJson(serializedSampleString); } sample = new TextSample(serializedSampleString); } else { sample = new InvalidSample(String.Format( CultureInfo.CurrentCulture, "Failed to generate the sample for media type '{0}'. Cannot use formatter '{1}' to write type '{2}'.", mediaType, formatter.GetType().Name, type.Name)); } } catch (Exception e) { sample = new InvalidSample(String.Format( CultureInfo.CurrentCulture, "An exception has occurred while using the formatter '{0}' to generate sample for media type '{1}'. Exception message: {2}", formatter.GetType().Name, mediaType.MediaType, UnwrapException(e).Message)); } finally { if (ms != null) { ms.Dispose(); } if (content != null) { content.Dispose(); } } return sample; } internal static Exception UnwrapException(Exception exception) { AggregateException aggregateException = exception as AggregateException; if (aggregateException != null) { return aggregateException.Flatten().InnerException; } return exception; } // Default factory for sample objects private static object DefaultSampleObjectFactory(HelpPageSampleGenerator sampleGenerator, Type type) { // Try to create a default sample object ObjectGenerator objectGenerator = new ObjectGenerator(); return objectGenerator.GenerateObject(type); } [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Handling the failure by returning the original string.")] private static string TryFormatJson(string str) { try { object parsedJson = JsonConvert.DeserializeObject(str); return JsonConvert.SerializeObject(parsedJson, Formatting.Indented); } catch { // can't parse JSON, return the original string return str; } } [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Handling the failure by returning the original string.")] private static string TryFormatXml(string str) { try { XDocument xml = XDocument.Parse(str); return xml.ToString(); } catch { // can't parse XML, return the original string return str; } } private static bool IsFormatSupported(SampleDirection sampleDirection, MediaTypeFormatter formatter, Type type) { switch (sampleDirection) { case SampleDirection.Request: return formatter.CanReadType(type); case SampleDirection.Response: return formatter.CanWriteType(type); } return false; } private IEnumerable<KeyValuePair<HelpPageSampleKey, object>> GetAllActionSamples(string controllerName, string actionName, IEnumerable<string> parameterNames, SampleDirection sampleDirection) { HashSet<string> parameterNamesSet = new HashSet<string>(parameterNames, StringComparer.OrdinalIgnoreCase); foreach (var sample in ActionSamples) { HelpPageSampleKey sampleKey = sample.Key; if (String.Equals(controllerName, sampleKey.ControllerName, StringComparison.OrdinalIgnoreCase) && String.Equals(actionName, sampleKey.ActionName, StringComparison.OrdinalIgnoreCase) && (sampleKey.ParameterNames.SetEquals(new[] { "*" }) || parameterNamesSet.SetEquals(sampleKey.ParameterNames)) && sampleDirection == sampleKey.SampleDirection) { yield return sample; } } } private static object WrapSampleIfString(object sample) { string stringSample = sample as string; if (stringSample != null) { return new TextSample(stringSample); } return sample; } } }
WSDOT-GIS/GTFS-Service
GtfsService/Areas/HelpPage/SampleGeneration/HelpPageSampleGenerator.cs
C#
unlicense
20,961
-- base16-nvim (https://github.com/wincent/base16-nvim) -- by Greg Hurrell (https://github.com/wincent) -- based on -- base16-vim (https://github.com/chriskempson/base16-vim) -- by Chris Kempson (http://chriskempson.com) -- iA Light scheme by iA Inc. (modified by aramisgithub) local gui00 = "f6f6f6" local gui01 = "dedede" local gui02 = "bde5f2" local gui03 = "898989" local gui04 = "767676" local gui05 = "181818" local gui06 = "e8e8e8" local gui07 = "f8f8f8" local gui08 = "9c5a02" local gui09 = "c43e18" local gui0A = "c48218" local gui0B = "38781c" local gui0C = "2d6bb1" local gui0D = "48bac2" local gui0E = "a94598" local gui0F = "8b6c37" local cterm00 = "00" local cterm03 = "08" local cterm05 = "07" local cterm07 = "15" local cterm08 = "01" local cterm0A = "03" local cterm0B = "02" local cterm0C = "06" local cterm0D = "04" local cterm0E = "05" local cterm01 = "10" local cterm02 = "11" local cterm04 = "12" local cterm06 = "13" local cterm09 = "09" local cterm0F = "14" vim.cmd [[ highlight clear syntax reset ]] vim.g.colors_name = "base16-ia-light" local highlight = function(group, guifg, guibg, ctermfg, ctermbg, attr, guisp) attr = attr or "" guisp = guisp or "" local command = "" if guifg ~= "" then command = command .. " guifg=#" .. guifg end if guibg ~= "" then command = command .. " guibg=#" .. guibg end if ctermfg ~= "" then command = command .. " ctermfg=" .. ctermfg end if ctermbg ~= "" then command = command .. " ctermbg=" .. ctermbg end if attr ~= "" then command = command .. " gui=" .. attr .. " cterm=" .. attr end if guisp ~= "" then command = command .. " guisp=#" .. guisp end if command ~= "" then vim.cmd("highlight " .. group .. command) end end -- Vim editor colors highlight("Normal", gui05, gui00, cterm05, cterm00, "", "") highlight("Bold", "", "", "", "", "bold", "") highlight("Debug", gui08, "", cterm08, "", "", "") highlight("Directory", gui0D, "", cterm0D, "", "", "") highlight("Error", gui00, gui08, cterm00, cterm08, "", "") highlight("ErrorMsg", gui08, gui00, cterm08, cterm00, "", "") highlight("Exception", gui08, "", cterm08, "", "", "") highlight("FoldColumn", gui0C, gui01, cterm0C, cterm01, "", "") highlight("Folded", gui03, gui01, cterm03, cterm01, "", "") highlight("IncSearch", gui01, gui09, cterm01, cterm09, "none", "") highlight("Italic", "", "", "", "", "none", "") highlight("Macro", gui08, "", cterm08, "", "", "") highlight("MatchParen", "", gui03, "", cterm03, "", "") highlight("ModeMsg", gui0B, "", cterm0B, "", "", "") highlight("MoreMsg", gui0B, "", cterm0B, "", "", "") highlight("Question", gui0D, "", cterm0D, "", "", "") highlight("Search", gui01, gui0A, cterm01, cterm0A, "", "") highlight("Substitute", gui01, gui0A, cterm01, cterm0A, "none", "") highlight("SpecialKey", gui03, "", cterm03, "", "", "") highlight("TooLong", gui08, "", cterm08, "", "", "") highlight("Underlined", gui08, "", cterm08, "", "", "") highlight("Visual", "", gui02, "", cterm02, "", "") highlight("VisualNOS", gui08, "", cterm08, "", "", "") highlight("WarningMsg", gui08, "", cterm08, "", "", "") highlight("WildMenu", gui08, gui0A, cterm08, "", "", "") highlight("Title", gui0D, "", cterm0D, "", "none", "") highlight("Conceal", gui0D, gui00, cterm0D, cterm00, "", "") highlight("Cursor", gui00, gui05, cterm00, cterm05, "", "") highlight("NonText", gui03, "", cterm03, "", "", "") highlight("LineNr", gui03, gui01, cterm03, cterm01, "", "") highlight("SignColumn", gui03, gui01, cterm03, cterm01, "", "") highlight("StatusLine", gui04, gui02, cterm04, cterm02, "none", "") highlight("StatusLineNC", gui03, gui01, cterm03, cterm01, "none", "") highlight("VertSplit", gui02, gui02, cterm02, cterm02, "none", "") highlight("ColorColumn", "", gui01, "", cterm01, "none", "") highlight("CursorColumn", "", gui01, "", cterm01, "none", "") highlight("CursorLine", "", gui01, "", cterm01, "none", "") highlight("CursorLineNr", gui04, gui01, cterm04, cterm01, "", "") highlight("QuickFixLine", "", gui01, "", cterm01, "none", "") highlight("PMenu", gui05, gui01, cterm05, cterm01, "none", "") highlight("PMenuSel", gui01, gui05, cterm01, cterm05, "", "") highlight("TabLine", gui03, gui01, cterm03, cterm01, "none", "") highlight("TabLineFill", gui03, gui01, cterm03, cterm01, "none", "") highlight("TabLineSel", gui0B, gui01, cterm0B, cterm01, "none", "") -- Standard syntax highlighting highlight("Boolean", gui09, "", cterm09, "", "", "") highlight("Character", gui08, "", cterm08, "", "", "") highlight("Comment", gui03, "", cterm03, "", "", "") highlight("Conditional", gui0E, "", cterm0E, "", "", "") highlight("Constant", gui09, "", cterm09, "", "", "") highlight("Define", gui0E, "", cterm0E, "", "none", "") highlight("Delimiter", gui0F, "", cterm0F, "", "", "") highlight("Float", gui09, "", cterm09, "", "", "") highlight("Function", gui0D, "", cterm0D, "", "", "") highlight("Identifier", gui08, "", cterm08, "", "none", "") highlight("Include", gui0D, "", cterm0D, "", "", "") highlight("Keyword", gui0E, "", cterm0E, "", "", "") highlight("Label", gui0A, "", cterm0A, "", "", "") highlight("Number", gui09, "", cterm09, "", "", "") highlight("Operator", gui05, "", cterm05, "", "none", "") highlight("PreProc", gui0A, "", cterm0A, "", "", "") highlight("Repeat", gui0A, "", cterm0A, "", "", "") highlight("Special", gui0C, "", cterm0C, "", "", "") highlight("SpecialChar", gui0F, "", cterm0F, "", "", "") highlight("Statement", gui08, "", cterm08, "", "", "") highlight("StorageClass", gui0A, "", cterm0A, "", "", "") highlight("String", gui0B, "", cterm0B, "", "", "") highlight("Structure", gui0E, "", cterm0E, "", "", "") highlight("Tag", gui0A, "", cterm0A, "", "", "") highlight("Todo", gui0A, gui01, cterm0A, cterm01, "", "") highlight("Type", gui0A, "", cterm0A, "", "none", "") highlight("Typedef", gui0A, "", cterm0A, "", "", "") -- C highlighting highlight("cOperator", gui0C, "", cterm0C, "", "", "") highlight("cPreCondit", gui0E, "", cterm0E, "", "", "") -- C# highlighting highlight("csClass", gui0A, "", cterm0A, "", "", "") highlight("csAttribute", gui0A, "", cterm0A, "", "", "") highlight("csModifier", gui0E, "", cterm0E, "", "", "") highlight("csType", gui08, "", cterm08, "", "", "") highlight("csUnspecifiedStatement", gui0D, "", cterm0D, "", "", "") highlight("csContextualStatement", gui0E, "", cterm0E, "", "", "") highlight("csNewDecleration", gui08, "", cterm08, "", "", "") -- CSS highlighting highlight("cssBraces", gui05, "", cterm05, "", "", "") highlight("cssClassName", gui0E, "", cterm0E, "", "", "") highlight("cssColor", gui0C, "", cterm0C, "", "", "") -- Diff highlighting highlight("DiffAdd", gui0B, gui01, cterm0B, cterm01, "", "") highlight("DiffChange", gui03, gui01, cterm03, cterm01, "", "") highlight("DiffDelete", gui08, gui01, cterm08, cterm01, "", "") highlight("DiffText", gui0D, gui01, cterm0D, cterm01, "", "") highlight("DiffAdded", gui0B, gui00, cterm0B, cterm00, "", "") highlight("DiffFile", gui08, gui00, cterm08, cterm00, "", "") highlight("DiffNewFile", gui0B, gui00, cterm0B, cterm00, "", "") highlight("DiffLine", gui0D, gui00, cterm0D, cterm00, "", "") highlight("DiffRemoved", gui08, gui00, cterm08, cterm00, "", "") -- Git highlighting highlight("gitcommitOverflow", gui08, "", cterm08, "", "", "") highlight("gitcommitSummary", gui0B, "", cterm0B, "", "", "") highlight("gitcommitComment", gui03, "", cterm03, "", "", "") highlight("gitcommitUntracked", gui03, "", cterm03, "", "", "") highlight("gitcommitDiscarded", gui03, "", cterm03, "", "", "") highlight("gitcommitSelected", gui03, "", cterm03, "", "", "") highlight("gitcommitHeader", gui0E, "", cterm0E, "", "", "") highlight("gitcommitSelectedType", gui0D, "", cterm0D, "", "", "") highlight("gitcommitUnmergedType", gui0D, "", cterm0D, "", "", "") highlight("gitcommitDiscardedType", gui0D, "", cterm0D, "", "", "") highlight("gitcommitBranch", gui09, "", cterm09, "", "bold", "") highlight("gitcommitUntrackedFile", gui0A, "", cterm0A, "", "", "") highlight("gitcommitUnmergedFile", gui08, "", cterm08, "", "bold", "") highlight("gitcommitDiscardedFile", gui08, "", cterm08, "", "bold", "") highlight("gitcommitSelectedFile", gui0B, "", cterm0B, "", "bold", "") -- GitGutter highlighting highlight("GitGutterAdd", gui0B, gui01, cterm0B, cterm01, "", "") highlight("GitGutterChange", gui0D, gui01, cterm0D, cterm01, "", "") highlight("GitGutterDelete", gui08, gui01, cterm08, cterm01, "", "") highlight("GitGutterChangeDelete", gui0E, gui01, cterm0E, cterm01, "", "") -- HTML highlighting highlight("htmlBold", gui0A, "", cterm0A, "", "", "") highlight("htmlItalic", gui0E, "", cterm0E, "", "", "") highlight("htmlEndTag", gui05, "", cterm05, "", "", "") highlight("htmlTag", gui05, "", cterm05, "", "", "") -- JavaScript highlighting highlight("javaScript", gui05, "", cterm05, "", "", "") highlight("javaScriptBraces", gui05, "", cterm05, "", "", "") highlight("javaScriptNumber", gui09, "", cterm09, "", "", "") -- pangloss/vim-javascript highlighting highlight("jsOperator", gui0D, "", cterm0D, "", "", "") highlight("jsStatement", gui0E, "", cterm0E, "", "", "") highlight("jsReturn", gui0E, "", cterm0E, "", "", "") highlight("jsThis", gui08, "", cterm08, "", "", "") highlight("jsClassDefinition", gui0A, "", cterm0A, "", "", "") highlight("jsFunction", gui0E, "", cterm0E, "", "", "") highlight("jsFuncName", gui0D, "", cterm0D, "", "", "") highlight("jsFuncCall", gui0D, "", cterm0D, "", "", "") highlight("jsClassFuncName", gui0D, "", cterm0D, "", "", "") highlight("jsClassMethodType", gui0E, "", cterm0E, "", "", "") highlight("jsRegexpString", gui0C, "", cterm0C, "", "", "") highlight("jsGlobalObjects", gui0A, "", cterm0A, "", "", "") highlight("jsGlobalNodeObjects", gui0A, "", cterm0A, "", "", "") highlight("jsExceptions", gui0A, "", cterm0A, "", "", "") highlight("jsBuiltins", gui0A, "", cterm0A, "", "", "") -- Mail highlighting highlight("mailQuoted1", gui0A, "", cterm0A, "", "", "") highlight("mailQuoted2", gui0B, "", cterm0B, "", "", "") highlight("mailQuoted3", gui0E, "", cterm0E, "", "", "") highlight("mailQuoted4", gui0C, "", cterm0C, "", "", "") highlight("mailQuoted5", gui0D, "", cterm0D, "", "", "") highlight("mailQuoted6", gui0A, "", cterm0A, "", "", "") highlight("mailURL", gui0D, "", cterm0D, "", "", "") highlight("mailEmail", gui0D, "", cterm0D, "", "", "") -- Markdown highlighting highlight("markdownCode", gui0B, "", cterm0B, "", "", "") highlight("markdownError", gui05, gui00, cterm05, cterm00, "", "") highlight("markdownCodeBlock", gui0B, "", cterm0B, "", "", "") highlight("markdownHeadingDelimiter", gui0D, "", cterm0D, "", "", "") -- NERDTree highlighting highlight("NERDTreeDirSlash", gui0D, "", cterm0D, "", "", "") highlight("NERDTreeExecFile", gui05, "", cterm05, "", "", "") -- PHP highlighting highlight("phpMemberSelector", gui05, "", cterm05, "", "", "") highlight("phpComparison", gui05, "", cterm05, "", "", "") highlight("phpParent", gui05, "", cterm05, "", "", "") highlight("phpMethodsVar", gui0C, "", cterm0C, "", "", "") -- Python highlighting highlight("pythonOperator", gui0E, "", cterm0E, "", "", "") highlight("pythonRepeat", gui0E, "", cterm0E, "", "", "") highlight("pythonInclude", gui0E, "", cterm0E, "", "", "") highlight("pythonStatement", gui0E, "", cterm0E, "", "", "") -- Ruby highlighting highlight("rubyAttribute", gui0D, "", cterm0D, "", "", "") highlight("rubyConstant", gui0A, "", cterm0A, "", "", "") highlight("rubyInterpolationDelimiter", gui0F, "", cterm0F, "", "", "") highlight("rubyRegexp", gui0C, "", cterm0C, "", "", "") highlight("rubySymbol", gui0B, "", cterm0B, "", "", "") highlight("rubyStringDelimiter", gui0B, "", cterm0B, "", "", "") -- SASS highlighting highlight("sassidChar", gui08, "", cterm08, "", "", "") highlight("sassClassChar", gui09, "", cterm09, "", "", "") highlight("sassInclude", gui0E, "", cterm0E, "", "", "") highlight("sassMixing", gui0E, "", cterm0E, "", "", "") highlight("sassMixinName", gui0D, "", cterm0D, "", "", "") -- Signify highlighting highlight("SignifySignAdd", gui0B, gui01, cterm0B, cterm01, "", "") highlight("SignifySignChange", gui0D, gui01, cterm0D, cterm01, "", "") highlight("SignifySignDelete", gui08, gui01, cterm08, cterm01, "", "") -- Spelling highlighting highlight("SpellBad", "", "", "", "", "undercurl", gui08) highlight("SpellLocal", "", "", "", "", "undercurl", gui0C) highlight("SpellCap", "", "", "", "", "undercurl", gui0D) highlight("SpellRare", "", "", "", "", "undercurl", gui0E) -- Startify highlighting highlight("StartifyBracket", gui03, "", cterm03, "", "", "") highlight("StartifyFile", gui07, "", cterm07, "", "", "") highlight("StartifyFooter", gui03, "", cterm03, "", "", "") highlight("StartifyHeader", gui0B, "", cterm0B, "", "", "") highlight("StartifyNumber", gui09, "", cterm09, "", "", "") highlight("StartifyPath", gui03, "", cterm03, "", "", "") highlight("StartifySection", gui0E, "", cterm0E, "", "", "") highlight("StartifySelect", gui0C, "", cterm0C, "", "", "") highlight("StartifySlash", gui03, "", cterm03, "", "", "") highlight("StartifySpecial", gui03, "", cterm03, "", "", "") -- Java highlighting highlight("javaOperator", gui0D, "", cterm0D, "", "", "") -- vim: filetype=lua
wincent/wincent
aspects/nvim/files/.config/nvim/colors/base16-ia-light.lua
Lua
unlicense
14,102
<!doctype html> <html> <head> <script src="https://cdnjs.cloudflare.com/ajax/libs/d3/4.2.8/d3.min.js" type="text/JavaScript"></script> <style> </style> </head> <body> <div id="viz"> <svg style="width:600px;height:600px;" ></svg> </div> <script> d3.json("../data/tweets.json", viz); function viz(data) { var depthScale = d3.scaleOrdinal() .range(["#5EAFC6", "#FE9922", "#93c464", "#75739F"]); var nestedTweets = d3.nest() .key(d => d.user) .entries(data.tweets); var packableTweets = {id: "All Tweets", values: nestedTweets}; var root = d3.hierarchy(packableTweets, d => d.values) .sum(d => d.retweets ? d.retweets.length + d.favorites.length + 1 : undefined); var treemapLayout = d3.treemap() .size([500,500]) .padding(d => d.depth * 5 + 5); treemapLayout(root); d3.select("svg") .selectAll("rect") .data(root.descendants(), d => d.data.content || d.data.user || d.data.key) .enter() .append("rect") .attr("x", d => d.x0) .attr("y", d => d.y0) .attr("width", d => d.x1 - d.x0) .attr("height", d => d.y1 - d.y0) .style("fill", d => depthScale(d.depth)) .style("stroke", "black"); } </script> </body> </html>
emeeks/d3_in_action_2
chapter6/6_23.html
HTML
unlicense
1,476
using System.Collections.Generic; namespace SixtenLabs.Spawn.Generator.CSharp { /// <summary> /// Use this class to define an output. /// </summary> public class OutputDefinition : IOutputDefinition { public OutputDefinition() { } /// <summary> /// Add the names of the dlls to use to create using statements for this output /// </summary> /// <param name="names"></param> public void AddStandardUsingDirective(string dllName) { var usingDefinition = new UsingDirectiveDefinition() { SpecName = dllName }; Usings.Add(usingDefinition); } /// <summary> /// Add the names of the dlls to use to create using statements for this output /// </summary> /// <param name="names"></param> public void AddStaticUsingDirective(string dllName) { var usingDefinition = new UsingDirectiveDefinition() { SpecName = dllName, IsStatic = true }; Usings.Add(usingDefinition); } /// <summary> /// Add the names of the dlls to use to create using statements for this output /// </summary> /// <param name="names"></param> public void AddAliasedUsingDirective(string dllName, string alias) { var usingDefinition = new UsingDirectiveDefinition() { SpecName = dllName, Alias = alias, UseAlias = true }; Usings.Add(usingDefinition); } public void AddNamespace(string @namespace) { Namespace = new NamespaceDefinition() { SpecName = @namespace }; } /// <summary> /// The names of the dlls to use to create using statements for this output /// </summary> public IList<UsingDirectiveDefinition> Usings { get; } = new List<UsingDirectiveDefinition>(); /// <summary> /// The namesapce of the output. /// </summary> public NamespaceDefinition Namespace { get; set; } public string TargetSolution { get; set; } public string FileName { get; set; } public IList<string> CommentLines { get; } = new List<string>(); public string OutputDirectory { get; set; } } ///// <summary> ///// Use this class to define an output. ///// </summary> //public class OutputDefinition : Definition //{ // public OutputDefinition(string name) // : base(name) // { // } // /// <summary> // /// Add the names of the dlls to use to create using statements for this output // /// </summary> // /// <param name="names"></param> // public void AddStandardUsingDirective(string dllName) // { // var usingDefinition = new UsingDirectiveDefinition(dllName); // Usings.Add(usingDefinition); // } // /// <summary> // /// Add the names of the dlls to use to create using statements for this output // /// </summary> // /// <param name="names"></param> // public void AddStaticUsingDirective(string dllName) // { // var usingDefinition = new UsingDirectiveDefinition(dllName, true); // Usings.Add(usingDefinition); // } // /// <summary> // /// Add the names of the dlls to use to create using statements for this output // /// </summary> // /// <param name="names"></param> // public void AddAliasedUsingDirective(string dllName, string alias) // { // var usingDefinition = new UsingDirectiveDefinition(dllName, alias); // Usings.Add(usingDefinition); // } // public void AddNamespace(string @namespace) // { // Namespace = new NamespaceDefinition(@namespace); // } // /// <summary> // /// The names of the dlls to use to create using statements for this output // /// </summary> // public IList<UsingDirectiveDefinition> Usings { get; } = new List<UsingDirectiveDefinition>(); // /// <summary> // /// The namesapce of the output. // /// </summary> // public NamespaceDefinition Namespace { get; private set; } //} }
SixtenLabs/Spawn
src/SixtenLabs.Spawn.Generator.CSharp/Definitions/OutputDefinition.cs
C#
unlicense
3,637
/* * Character entity support code for Mini-XML, a small XML file parsing library. * * Copyright 2003-2017 by Michael R Sweet. * * These coded instructions, statements, and computer programs are the * property of Michael R Sweet and are protected by Federal copyright * law. Distribution and use rights are outlined in the file "COPYING" * which should have been included with this file. If this file is * missing or damaged, see the license at: * * https://michaelrsweet.github.io/mxml */ /* * Include necessary headers... */ #include "mxml-private.h" /* * 'mxmlEntityAddCallback()' - Add a callback to convert entities to Unicode. */ int /* O - 0 on success, -1 on failure */ mxmlEntityAddCallback( mxml_entity_cb_t cb) /* I - Callback function to add */ { _mxml_global_t *global = _mxml_global(); /* Global data */ if (global->num_entity_cbs < (int)(sizeof(global->entity_cbs) / sizeof(global->entity_cbs[0]))) { global->entity_cbs[global->num_entity_cbs] = cb; global->num_entity_cbs ++; return (0); } else { mxml_error("Unable to add entity callback!"); return (-1); } } /* * 'mxmlEntityGetName()' - Get the name that corresponds to the character value. * * If val does not need to be represented by a named entity, @code NULL@ is returned. */ const char * /* O - Entity name or @code NULL@ */ mxmlEntityGetName(int val) /* I - Character value */ { switch (val) { case '&' : return ("amp"); case '<' : return ("lt"); case '>' : return ("gt"); case '\"' : return ("quot"); default : return (NULL); } } /* * 'mxmlEntityGetValue()' - Get the character corresponding to a named entity. * * The entity name can also be a numeric constant. -1 is returned if the * name is not known. */ int /* O - Character value or -1 on error */ mxmlEntityGetValue(const char *name) /* I - Entity name */ { int i; /* Looping var */ int ch; /* Character value */ _mxml_global_t *global = _mxml_global(); /* Global data */ for (i = 0; i < global->num_entity_cbs; i ++) if ((ch = (global->entity_cbs[i])(name)) >= 0) return (ch); return (-1); } /* * 'mxmlEntityRemoveCallback()' - Remove a callback. */ void mxmlEntityRemoveCallback( mxml_entity_cb_t cb) /* I - Callback function to remove */ { int i; /* Looping var */ _mxml_global_t *global = _mxml_global(); /* Global data */ for (i = 0; i < global->num_entity_cbs; i ++) if (cb == global->entity_cbs[i]) { /* * Remove the callback... */ global->num_entity_cbs --; if (i < global->num_entity_cbs) memmove(global->entity_cbs + i, global->entity_cbs + i + 1, (global->num_entity_cbs - i) * sizeof(global->entity_cbs[0])); return; } } /* * '_mxml_entity_cb()' - Lookup standard (X)HTML entities. */ int /* O - Unicode value or -1 */ _mxml_entity_cb(const char *name) /* I - Entity name */ { int diff, /* Difference between names */ current, /* Current entity in search */ first, /* First entity in search */ last; /* Last entity in search */ static const struct { const char *name; /* Entity name */ int val; /* Character value */ } entities[] = { { "AElig", 198 }, { "Aacute", 193 }, { "Acirc", 194 }, { "Agrave", 192 }, { "Alpha", 913 }, { "Aring", 197 }, { "Atilde", 195 }, { "Auml", 196 }, { "Beta", 914 }, { "Ccedil", 199 }, { "Chi", 935 }, { "Dagger", 8225 }, { "Delta", 916 }, { "Dstrok", 208 }, { "ETH", 208 }, { "Eacute", 201 }, { "Ecirc", 202 }, { "Egrave", 200 }, { "Epsilon", 917 }, { "Eta", 919 }, { "Euml", 203 }, { "Gamma", 915 }, { "Iacute", 205 }, { "Icirc", 206 }, { "Igrave", 204 }, { "Iota", 921 }, { "Iuml", 207 }, { "Kappa", 922 }, { "Lambda", 923 }, { "Mu", 924 }, { "Ntilde", 209 }, { "Nu", 925 }, { "OElig", 338 }, { "Oacute", 211 }, { "Ocirc", 212 }, { "Ograve", 210 }, { "Omega", 937 }, { "Omicron", 927 }, { "Oslash", 216 }, { "Otilde", 213 }, { "Ouml", 214 }, { "Phi", 934 }, { "Pi", 928 }, { "Prime", 8243 }, { "Psi", 936 }, { "Rho", 929 }, { "Scaron", 352 }, { "Sigma", 931 }, { "THORN", 222 }, { "Tau", 932 }, { "Theta", 920 }, { "Uacute", 218 }, { "Ucirc", 219 }, { "Ugrave", 217 }, { "Upsilon", 933 }, { "Uuml", 220 }, { "Xi", 926 }, { "Yacute", 221 }, { "Yuml", 376 }, { "Zeta", 918 }, { "aacute", 225 }, { "acirc", 226 }, { "acute", 180 }, { "aelig", 230 }, { "agrave", 224 }, { "alefsym", 8501 }, { "alpha", 945 }, { "amp", '&' }, { "and", 8743 }, { "ang", 8736 }, { "apos", '\'' }, { "aring", 229 }, { "asymp", 8776 }, { "atilde", 227 }, { "auml", 228 }, { "bdquo", 8222 }, { "beta", 946 }, { "brkbar", 166 }, { "brvbar", 166 }, { "bull", 8226 }, { "cap", 8745 }, { "ccedil", 231 }, { "cedil", 184 }, { "cent", 162 }, { "chi", 967 }, { "circ", 710 }, { "clubs", 9827 }, { "cong", 8773 }, { "copy", 169 }, { "crarr", 8629 }, { "cup", 8746 }, { "curren", 164 }, { "dArr", 8659 }, { "dagger", 8224 }, { "darr", 8595 }, { "deg", 176 }, { "delta", 948 }, { "diams", 9830 }, { "die", 168 }, { "divide", 247 }, { "eacute", 233 }, { "ecirc", 234 }, { "egrave", 232 }, { "empty", 8709 }, { "emsp", 8195 }, { "ensp", 8194 }, { "epsilon", 949 }, { "equiv", 8801 }, { "eta", 951 }, { "eth", 240 }, { "euml", 235 }, { "euro", 8364 }, { "exist", 8707 }, { "fnof", 402 }, { "forall", 8704 }, { "frac12", 189 }, { "frac14", 188 }, { "frac34", 190 }, { "frasl", 8260 }, { "gamma", 947 }, { "ge", 8805 }, { "gt", '>' }, { "hArr", 8660 }, { "harr", 8596 }, { "hearts", 9829 }, { "hellip", 8230 }, { "hibar", 175 }, { "iacute", 237 }, { "icirc", 238 }, { "iexcl", 161 }, { "igrave", 236 }, { "image", 8465 }, { "infin", 8734 }, { "int", 8747 }, { "iota", 953 }, { "iquest", 191 }, { "isin", 8712 }, { "iuml", 239 }, { "kappa", 954 }, { "lArr", 8656 }, { "lambda", 955 }, { "lang", 9001 }, { "laquo", 171 }, { "larr", 8592 }, { "lceil", 8968 }, { "ldquo", 8220 }, { "le", 8804 }, { "lfloor", 8970 }, { "lowast", 8727 }, { "loz", 9674 }, { "lrm", 8206 }, { "lsaquo", 8249 }, { "lsquo", 8216 }, { "lt", '<' }, { "macr", 175 }, { "mdash", 8212 }, { "micro", 181 }, { "middot", 183 }, { "minus", 8722 }, { "mu", 956 }, { "nabla", 8711 }, { "nbsp", 160 }, { "ndash", 8211 }, { "ne", 8800 }, { "ni", 8715 }, { "not", 172 }, { "notin", 8713 }, { "nsub", 8836 }, { "ntilde", 241 }, { "nu", 957 }, { "oacute", 243 }, { "ocirc", 244 }, { "oelig", 339 }, { "ograve", 242 }, { "oline", 8254 }, { "omega", 969 }, { "omicron", 959 }, { "oplus", 8853 }, { "or", 8744 }, { "ordf", 170 }, { "ordm", 186 }, { "oslash", 248 }, { "otilde", 245 }, { "otimes", 8855 }, { "ouml", 246 }, { "para", 182 }, { "part", 8706 }, { "permil", 8240 }, { "perp", 8869 }, { "phi", 966 }, { "pi", 960 }, { "piv", 982 }, { "plusmn", 177 }, { "pound", 163 }, { "prime", 8242 }, { "prod", 8719 }, { "prop", 8733 }, { "psi", 968 }, { "quot", '\"' }, { "rArr", 8658 }, { "radic", 8730 }, { "rang", 9002 }, { "raquo", 187 }, { "rarr", 8594 }, { "rceil", 8969 }, { "rdquo", 8221 }, { "real", 8476 }, { "reg", 174 }, { "rfloor", 8971 }, { "rho", 961 }, { "rlm", 8207 }, { "rsaquo", 8250 }, { "rsquo", 8217 }, { "sbquo", 8218 }, { "scaron", 353 }, { "sdot", 8901 }, { "sect", 167 }, { "shy", 173 }, { "sigma", 963 }, { "sigmaf", 962 }, { "sim", 8764 }, { "spades", 9824 }, { "sub", 8834 }, { "sube", 8838 }, { "sum", 8721 }, { "sup", 8835 }, { "sup1", 185 }, { "sup2", 178 }, { "sup3", 179 }, { "supe", 8839 }, { "szlig", 223 }, { "tau", 964 }, { "there4", 8756 }, { "theta", 952 }, { "thetasym", 977 }, { "thinsp", 8201 }, { "thorn", 254 }, { "tilde", 732 }, { "times", 215 }, { "trade", 8482 }, { "uArr", 8657 }, { "uacute", 250 }, { "uarr", 8593 }, { "ucirc", 251 }, { "ugrave", 249 }, { "uml", 168 }, { "upsih", 978 }, { "upsilon", 965 }, { "uuml", 252 }, { "weierp", 8472 }, { "xi", 958 }, { "yacute", 253 }, { "yen", 165 }, { "yuml", 255 }, { "zeta", 950 }, { "zwj", 8205 }, { "zwnj", 8204 } }; /* * Do a binary search for the named entity... */ first = 0; last = (int)(sizeof(entities) / sizeof(entities[0]) - 1); while ((last - first) > 1) { current = (first + last) / 2; if ((diff = strcmp(name, entities[current].name)) == 0) return (entities[current].val); else if (diff < 0) last = current; else first = current; } /* * If we get here, there is a small chance that there is still * a match; check first and last... */ if (!strcmp(name, entities[first].name)) return (entities[first].val); else if (!strcmp(name, entities[last].name)) return (entities[last].val); else return (-1); }
jrodatus/xp4mx
mxml/mxml-entity.c
C
unlicense
9,913
package katas.java.sort.visual; import org.junit.Test; import static org.hamcrest.CoreMatchers.equalTo; import static org.junit.Assert.assertThat; /** * User: dima * Date: Nov 1, 2010 */ public class BubbleSorterTest { @Test public void selectionSort() { assertThat(createSorter().sort(new int[]{}), equalTo(new int[]{})); assertThat(createSorter().sort(new int[]{1}), equalTo(new int[]{1})); assertThat(createSorter().sort(new int[]{2, 1}), equalTo(new int[]{1, 2})); assertThat(createSorter().sort(new int[]{2, 3, 1}), equalTo(new int[]{1, 2, 3})); assertThat(createSorter().sort(new int[]{1, 3, 1}), equalTo(new int[]{1, 1, 3})); assertThat(createSorter().sort(new int[]{1, 2, 3}), equalTo(new int[]{1, 2, 3})); } private static SortAlgorithm createSorter() { BubbleSorter sorter = new BubbleSorter(); sorter.setChangeListener(SelectionSorterTest.DUMMY_CHANGE_LISTENER); return sorter; } }
dkandalov/katas
java/src/main/java/katas/java/sort/visual/BubbleSorterTest.java
Java
unlicense
994
package glureau.kdp.creational.singleton.java; public class Demo { public static void main(String[] args){ System.out.println("***Demo: singleton pattern"); System.out.println("Getting: reference to Singleton instance"); Singleton singleton = Singleton.getInstance(); singleton.greet(); System.out.println("Getting: another reference to Singleton instance"); Singleton anotherSingleton = Singleton.getInstance(); anotherSingleton.greet(); System.out.println("Checking: the two references point to the same object"); if(singleton == anotherSingleton){ System.out.println("True"); } else{ System.out.println("False"); } System.out.println(""); System.out.println("***Demo: monostate pattern"); System.out.println("Creating: first monostate"); Monostate monostate1 = new Monostate(); System.out.println("Creating: second monostate"); Monostate monostate2 = new Monostate(); System.out.println("Checking: state of first monostate"); monostate1.greet(); System.out.println("Checking: state of second monostate"); monostate2.greet(); System.out.println("Checking: the two references point to the same object"); if(monostate1 == monostate2){ System.out.println("True"); } else{ System.out.println("False"); } System.out.println("Changing: state of monostate to stateABC"); monostate1.setState("ABC"); System.out.println("Checking: state of first monostate"); monostate1.greet(); System.out.println("Checking: state of second monostate"); monostate2.greet(); } }
glureau/kotlin-design-patterns
src/glureau/kdp/creational/singleton/java/Demo.java
Java
unlicense
1,550
/* This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. For more information, please refer to <http://unlicense.org> */ #pragma once #include "../config.hpp" #if defined(NX_OPENGL_ES) #include "renderdevice.hpp" #include <atomic> // OpenGL implementation of RenderDevice class RenderDeviceGLES2 : public RenderDevice { public: bool initialize(); void initStates(); void resetStates(); bool commitStates(uint32_t filter = 0xFFFFFFFFu); // Drawcalls and clears void clear(uint32_t flags, const float* color, float depth); void draw(PrimType primType, uint32_t firstVert, uint32_t vertCount); void drawIndexed(PrimType primType, uint32_t firstIndex, uint32_t indexCount); void beginRendering(); void finishRendering(); // Vertex layouts uint32_t registerVertexLayout(uint8_t numAttribs, const VertexLayoutAttrib* attribs); // Vertex buffers VertexBuffer* newVertexBuffer(); uint32_t usedVertexBufferMemory() const; void bind(VertexBuffer* buffer, uint8_t slot, uint32_t offset); // Index buffers IndexBuffer* newIndexBuffer(); uint32_t usedIndexBufferMemory() const; void bind(IndexBuffer* buffer); // Textures Texture* newTexture(); void bind(const Texture* texture, uint8_t slot); uint32_t usedTextureMemory() const; // Shaders Shader* newShader(); void bind(Shader* shader); const std::string& getShaderLog(); const char* getDefaultVSCode(); const char* getDefaultFSCode(); Shader* getCurrentShader() const; // Renderbuffers RenderBuffer* newRenderBuffer(); void bind(RenderBuffer* buffer); // GL States void setViewport(int x, int y, int width, int height); void setScissorRect(int x, int y, int width, int height); void setVertexLayout(uint32_t vlObj); // Render states void setColorWriteMask(bool enabled); bool getColorWriteMask() const; void setFillMode(FillMode fillMode); FillMode getFillMode() const; void setCullMode(CullMode cullMode); CullMode getCullMode() const; void setScissorTest(bool enabled); bool getScissorTest() const; void setMultisampling(bool enabled); bool getMultisampling() const; void setAlphaToCoverage(bool enabled); bool getAlphaToCoverage() const; void setBlendMode(bool enabled, BlendFunc src = Zero, BlendFunc dst = Zero); bool getBlendMode(BlendFunc& src, BlendFunc& dst) const; void setDepthMask(bool enabled); bool getDepthMask() const; void setDepthTest(bool enabled); bool getDepthTest() const; void setDepthFunc(DepthFunc depthFunc); DepthFunc getDepthFunc() const; void sync(); // Capabilities void getCapabilities(uint32_t* maxTexUnits, uint32_t* maxTexSize, uint32_t* maxCubTexSize, uint32_t* maxColBufs, bool* dxt, bool* pvrtci, bool* etc1, bool* texFloat, bool* texDepth, bool* texSS, bool* tex3d, bool* texNPOT, bool* texSRGB, bool* rtms, bool* occQuery, bool* timerQuery, bool* multithreading) const; private: constexpr static uint32_t MaxNumVertexLayouts = 16; struct RDIInputLayout { bool valid; int8_t attribIndices[16]; }; struct RDIVertBufSlot { VertexBuffer* vbObj; uint32_t offset; }; struct RDIRasterState { union { uint32_t hash; struct { uint8_t fillMode : 1; uint8_t cullMode : 2; uint8_t scissorEnable : 1; uint8_t multisampleEnable : 1; uint8_t renderTargetWriteMask : 1; }; }; }; struct RDIBlendState { union { uint32_t hash; struct { uint8_t alphaToCoverageEnable : 1; uint8_t blendEnable : 1; uint8_t srcBlendFunc : 4; uint8_t dstBlendFunc : 4; }; }; }; struct RDIDepthStencilState { union { uint32_t hash; struct { uint8_t depthWriteMask : 1; uint8_t depthEnable : 1; uint8_t depthFunc : 4; }; }; }; class ShaderGLES2 : public Shader { public: ShaderGLES2(RenderDeviceGLES2* device); ~ShaderGLES2(); bool load(const char* vertexShader, const char* fragmentShader); void setUniform(int location, uint8_t type, float* data, uint32_t count = 1); void setSampler(int location, uint8_t unit); int uniformLocation(const char* name) const; int samplerLocation(const char* name) const; private: friend class RenderDeviceGLES2; RenderDeviceGLES2* mDevice; uint32_t mHandle {0u}; RDIInputLayout mInputLayouts[MaxNumVertexLayouts]; }; class VertexBufferGLES2 : public VertexBuffer { public: VertexBufferGLES2(RenderDeviceGLES2* device); ~VertexBufferGLES2(); bool load(void* data, uint32_t size, uint32_t stride); bool update(void* data, uint32_t size, uint32_t offset); uint32_t size() const; uint32_t stride() const; private: friend class RenderDeviceGLES2; void release(); RenderDeviceGLES2* mDevice; uint32_t mHandle {0u}; uint32_t mSize {0u}; uint32_t mStride {0u}; }; class IndexBufferGLES2 : public IndexBuffer { public: IndexBufferGLES2(RenderDeviceGLES2* device); ~IndexBufferGLES2(); bool load(void* data, uint32_t size, Format format); bool update(void* data, uint32_t size, uint32_t offset); uint32_t size() const; Format format() const; private: friend class RenderDeviceGLES2; void release(); RenderDeviceGLES2* mDevice; uint32_t mHandle {0u}; uint32_t mSize {0u}; Format mFormat {_16}; }; class RenderBufferGLES2; class TextureGLES2 : Texture { public: TextureGLES2(RenderDeviceGLES2* device); ~TextureGLES2(); bool create(Type type, Format format, uint16_t width, uint16_t height, bool hasMips, bool mipMaps, bool srgb); void setData(const void* buffer, uint8_t slice, uint8_t level); void setSubData(const void* buffer, uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint8_t slice, uint8_t level); bool data(void* buffer, uint8_t slice, uint8_t level) const; uint32_t bufferSize() const; uint16_t width() const; uint16_t height() const; void setFilter(Filter filter); void setAnisotropyLevel(Anisotropy aniso); void setRepeating(uint32_t repeating); void setLessOrEqual(bool enable); Filter filter() const; Anisotropy anisotropyLevel() const; uint32_t repeating() const; bool lessOrEqual() const; bool flipCoords() const; Type type() const; Format format() const; private: friend class RenderDeviceGLES2; friend class RenderBufferGLES2; void release(); void applyState() const; RenderDeviceGLES2* mDevice; uint32_t mHandle {0u}; uint32_t mGlFormat {0u}; uint32_t mGlType {0u}; Type mType {_2D}; Format mFormat {Unknown}; uint16_t mWidth {0u}; uint16_t mHeight {0u}; bool mSrgb {false}; bool mHasMips {true}; bool mMipMaps {true}; uint32_t mState {0u}; uint32_t mMemSize {0u}; RenderBufferGLES2* mRenderBuffer {nullptr}; }; struct TextureSlot { const TextureGLES2* texture {nullptr}; uint32_t state {0u}; }; class RenderBufferGLES2 : public RenderBuffer { public: RenderBufferGLES2(RenderDeviceGLES2* device); ~RenderBufferGLES2(); bool create(Texture::Format format, uint16_t width, uint16_t height, bool depth, uint8_t colBufCount, uint8_t samples); Texture* texture(uint8_t index); uint16_t width() const; uint16_t height() const; Texture::Format format() const; static constexpr uint32_t MaxColorAttachmentCount = 4; private: friend class RenderDeviceGLES2; void resolve(); void release(); RenderDeviceGLES2* mDevice; uint32_t mFbo {0u}; uint32_t mFboMS {0u}; uint16_t mWidth {0u}; uint16_t mHeight {0u}; uint8_t mSamples {0u}; Texture::Format mFormat; std::shared_ptr<TextureGLES2> mDepthTex; std::shared_ptr<TextureGLES2> mColTexs[MaxColorAttachmentCount]; uint32_t mDepthBuf {0u}; uint32_t mDepthBufMS {0u}; uint32_t mColBufs[MaxColorAttachmentCount]; }; private: bool applyVertexLayout(); void applyRenderStates(); private: uint32_t mDepthFormat; int mVpX {0}, mVpY {0}, mVpWidth {1}, mVpHeight {1}; int mScX {0}, mScY {0}, mScWidth {1}, mScHeight {1}; std::atomic<uint32_t> mVertexBufferMemory {0u}; std::atomic<uint32_t> mIndexBufferMemory {0u}; std::atomic<uint32_t> mTextureMemory {0u}; RenderBufferGLES2* mCurRenderBuffer {nullptr}; int mDefaultFBO {0}; int mFbWidth {0}; int mFbHeight {0}; int mOutputBufferIndex {0}; std::atomic<uint32_t> mNumVertexLayouts {0u}; VertexLayout mVertexLayouts[MaxNumVertexLayouts]; RDIVertBufSlot mVertBufSlots[16]; TextureSlot mTexSlots[16]; RDIRasterState mCurRasterState, mNewRasterState; RDIBlendState mCurBlendState, mNewBlendState; RDIDepthStencilState mCurDepthStencilState, mNewDepthStencilState; Shader *mPrevShader {nullptr}, *mCurShader {nullptr}; IndexBuffer *mCurIndexBuffer {nullptr}, *mNewIndexBuffer {nullptr}; uint32_t mCurVertexLayout {0u}, mNewVertexLayout {0u}; uint32_t mIndexFormat {0u}; uint32_t mActiveVertexAttribsMask {0u}; uint32_t mPendingMask {0u}; bool mVertexBufUpdated {true}; int mMaxTextureUnits {0}; int mMaxTextureSize {0}; int mMaxCubeTextureSize {0}; int mMaxColBuffers {0}; bool mDXTSupported {false}; bool mPVRTCISupported {false}; bool mTexETC1Supported {false}; bool mTexFloatSupported {false}; bool mTexDepthSupported {false}; bool mTexShadowSamplers {false}; bool mTex3DSupported {false}; bool mTexNPOTSupported {false}; bool mTexSRGBSupported {false}; bool mRTMultiSampling {false}; bool mOccQuerySupported {false}; bool mTimerQuerySupported {false}; }; #endif
dermoumi/m2n
src/graphics/renderdevicegles2.hpp
C++
unlicense
12,155
<!DOCTYPE HTML> <html > <head> <meta charset="UTF-8"> <title>Tag: 截断文字 | One Night in Mok&#39;s Studio</title> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=3, minimum-scale=1"> <meta name="author" content="Moky"> <meta name="description" content="念念不忘,必有回响。"> <link rel="alternate" href="/atom.xml" title="One Night in Mok&#39;s Studio" type="application/atom+xml"> <link rel="icon" href="/img/favicon.ico"> <link rel="apple-touch-icon" href="/img/pacman.jpg"> <link rel="apple-touch-icon-precomposed" href="/img/pacman.jpg"> <link rel="stylesheet" href="/css/style.css" type="text/css"> </head> <body> <header> <div> <div id="imglogo"> <a href="/"><img src="/img/logo.svg" alt="One Night in Mok&#39;s Studio" title="One Night in Mok&#39;s Studio"/></a> </div> <div id="textlogo"> <h1 class="site-name"><a href="/" title="One Night in Mok&#39;s Studio">One Night in Mok&#39;s Studio</a></h1> <h2 class="blog-motto">Life is a beautiful struggle.</h2> </div> <div class="navbar"><a class="navbutton navmobile" href="#" title="Menu"> </a></div> <nav class="animated"> <ul> <li><a href="/">Home</a></li> <li><a href="/archives">Archives</a></li> <li> <form class="search" action="//google.com/search" method="get" accept-charset="utf-8"> <label>Search</label> <input type="text" id="search" name="q" autocomplete="off" maxlength="20" placeholder="Search" /> <input type="hidden" name="q" value="site:moky.cc"> </form> </li> </ul> </nav> </div> </header> <div id="container"> <div class="archive-title" > <h2 class="tag-icon">截断文字</h2> </div> <div id="main" class="archive-part clearfix"> <div id="archive-page"> <section class="post" itemscope itemprop="blogPost"> <a href="/2015/05/16/Qt字符串显示不全显示省略号的实现/" title="Qt字符串显示不全显示省略号的实现" itemprop="url"> <h1 itemprop="name">Qt字符串显示不全显示省略号的实现</h1> <time datetime="2015-05-16T08:22:06.000Z" itemprop="datePublished">May 16 2015</time> </a> </section> </div> </div> </div> <footer><div id="footer"> <div class="line"> <span></span> <div class="author"></div> </div> <section class="info"> <p> Hi, I&#39;m Moky. <br/> I wanna share all my stuffs with u ~</p> </section> <div class="social-font clearfix"> <a href="http://weibo.com/218889128" target="_blank" title="weibo"></a> <a href="https://github.com/mokyue" target="_blank" title="github"></a> <a href="https://www.linkedin.com/pub/matthew-mok/69/9a3/641" target="_blank" title="linkedin"></a> </div> <p class="copyright">Powered by <a href="http://hexo.io" target="_blank" title="Hexo">Hexo</a> and themed by <a href="https://github.com/A-limon/pacman" target="_blank" title="Pacman">Pacman</a> © 2015 <a href="http://moky.cc" target="_blank" title="Moky">Moky</a> <br> <a class="icp" href="http://www.miitbeian.gov.cn/" target="_blank" title="粤ICP备15013592号">粤ICP备15013592号</a> <a href="http://www.miitbeian.gov.cn/" target="_blank" title="中华人民共和国工业和信息化部"> <img src="/img/copy_right.png" alt="中华人民共和国工业和信息化部"/> </a> </p> </div> </footer> <script src="/js/jquery-2.1.0.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $('.navbar').click(function(){ $('header nav').toggleClass('shownav'); }); var myWidth = 0; function getSize(){ if( typeof( window.innerWidth ) == 'number' ) { myWidth = window.innerWidth; } else if( document.documentElement && document.documentElement.clientWidth) { myWidth = document.documentElement.clientWidth; }; }; var m = $('#main'), a = $('#asidepart'), c = $('.closeaside'), o = $('.openaside'); $(window).resize(function(){ getSize(); if (myWidth >= 1024) { $('header nav').removeClass('shownav'); }else { m.removeClass('moveMain'); a.css('display', 'block').removeClass('fadeOut'); o.css('display', 'none'); } }); c.click(function(){ a.addClass('fadeOut').css('display', 'none'); o.css('display', 'block').addClass('fadeIn'); m.addClass('moveMain'); }); o.click(function(){ o.css('display', 'none').removeClass('beforeFadeIn'); a.css('display', 'block').removeClass('fadeOut').addClass('fadeIn'); m.removeClass('moveMain'); }); $(window).scroll(function(){ o.css("top",Math.max(80,260-$(this).scrollTop())); }); }); </script> <div id="to_top" style="position: fixed; bottom: 80px; right: 7.5%; cursor: pointer;"> <a title="返回顶部" style="display: block; line-height: 25px !important; text-align: center; box-shadow: 2px 4px 5px rgba(3, 3, 3, 0.2); width: 28px; height: 28px; border-radius: 50%; font: normal 28px 'FontAwesome'; background-color: #ea6753; color: #ffffff"></a> </div> <script src="/js/to_top.js"></script> </body> </html>
mokyue/mokyue.github.io
tags/截断文字/index.html
HTML
unlicense
5,537
// // UIScrollView+EmptyDataSet.h // // Created by 余洪江 on 16/03/01. // Copyright © MRJ. All rights reserved. // #import <UIKit/UIKit.h> @protocol DZNEmptyDataSetSource; @protocol DZNEmptyDataSetDelegate; /** A drop-in UITableView/UICollectionView superclass category for showing empty datasets whenever the view has no content to display. @discussion It will work automatically, by just conforming to DZNEmptyDataSetSource, and returning the data you want to show. */ @interface UIScrollView (EmptyDataSet) /** The empty datasets data source. */ @property (nonatomic, weak) IBOutlet id <DZNEmptyDataSetSource> emptyDataSetSource; /** The empty datasets delegate. */ @property (nonatomic, weak) IBOutlet id <DZNEmptyDataSetDelegate> emptyDataSetDelegate; /** YES if any empty dataset is visible. */ @property (nonatomic, readonly, getter = isEmptyDataSetVisible) BOOL emptyDataSetVisible; /** Reloads the empty dataset content receiver. @discussion Call this method to force all the data to refresh. Calling -reloadData is similar, but this forces only the empty dataset to reload, not the entire table view or collection view. */ - (void)reloadEmptyDataSet; @end /** The object that acts as the data source of the empty datasets. @discussion The data source must adopt the DZNEmptyDataSetSource protocol. The data source is not retained. All data source methods are optional. */ @protocol DZNEmptyDataSetSource <NSObject> @optional /** Asks the data source for the title of the dataset. The dataset uses a fixed font style by default, if no attributes are set. If you want a different font style, return a attributed string. @param scrollView A scrollView subclass informing the data source. @return An attributed string for the dataset title, combining font, text color, text pararaph style, etc. */ - (NSAttributedString *)titleForEmptyDataSet:(UIScrollView *)scrollView; /** Asks the data source for the description of the dataset. The dataset uses a fixed font style by default, if no attributes are set. If you want a different font style, return a attributed string. @param scrollView A scrollView subclass informing the data source. @return An attributed string for the dataset description text, combining font, text color, text pararaph style, etc. */ - (NSAttributedString *)descriptionForEmptyDataSet:(UIScrollView *)scrollView; /** Asks the data source for the image of the dataset. @param scrollView A scrollView subclass informing the data source. @return An image for the dataset. */ - (UIImage *)imageForEmptyDataSet:(UIScrollView *)scrollView; /** Asks the data source for a tint color of the image dataset. Default is nil. @param scrollView A scrollView subclass object informing the data source. @return A color to tint the image of the dataset. */ - (UIColor *)imageTintColorForEmptyDataSet:(UIScrollView *)scrollView; /** * Asks the data source for the image animation of the dataset. * * @param scrollView A scrollView subclass object informing the delegate. * * @return image animation */ - (CAAnimation *) imageAnimationForEmptyDataSet:(UIScrollView *) scrollView; /** Asks the data source for the title to be used for the specified button state. The dataset uses a fixed font style by default, if no attributes are set. If you want a different font style, return a attributed string. @param scrollView A scrollView subclass object informing the data source. @param state The state that uses the specified title. The possible values are described in UIControlState. @return An attributed string for the dataset button title, combining font, text color, text pararaph style, etc. */ - (NSAttributedString *)buttonTitleForEmptyDataSet:(UIScrollView *)scrollView forState:(UIControlState)state; /** Asks the data source for the image to be used for the specified button state. This method will override buttonTitleForEmptyDataSet:forState: and present the image only without any text. @param scrollView A scrollView subclass object informing the data source. @param state The state that uses the specified title. The possible values are described in UIControlState. @return An image for the dataset button imageview. */ - (UIImage *)buttonImageForEmptyDataSet:(UIScrollView *)scrollView forState:(UIControlState)state; /** Asks the data source for a background image to be used for the specified button state. There is no default style for this call. @param scrollView A scrollView subclass informing the data source. @param state The state that uses the specified image. The values are described in UIControlState. @return An attributed string for the dataset button title, combining font, text color, text pararaph style, etc. */ - (UIImage *)buttonBackgroundImageForEmptyDataSet:(UIScrollView *)scrollView forState:(UIControlState)state; /** Asks the data source for the background color of the dataset. Default is clear color. @param scrollView A scrollView subclass object informing the data source. @return A color to be applied to the dataset background view. */ - (UIColor *)backgroundColorForEmptyDataSet:(UIScrollView *)scrollView; /** Asks the data source for a custom view to be displayed instead of the default views such as labels, imageview and button. Default is nil. Use this method to show an activity view indicator for loading feedback, or for complete custom empty data set. Returning a custom view will ignore -offsetForEmptyDataSet and -spaceHeightForEmptyDataSet configurations. @param scrollView A scrollView subclass object informing the delegate. @return The custom view. */ - (UIView *)customViewForEmptyDataSet:(UIScrollView *)scrollView; /** Asks the data source for a offset for vertical and horizontal alignment of the content. Default is CGPointZero. @param scrollView A scrollView subclass object informing the delegate. @return The offset for vertical and horizontal alignment. */ - (CGPoint)offsetForEmptyDataSet:(UIScrollView *)scrollView DEPRECATED_MSG_ATTRIBUTE("Use -verticalOffsetForEmptyDataSet:"); - (CGFloat)verticalOffsetForEmptyDataSet:(UIScrollView *)scrollView; /** Asks the data source for a vertical space between elements. Default is 11 pts. @param scrollView A scrollView subclass object informing the delegate. @return The space height between elements. */ - (CGFloat)spaceHeightForEmptyDataSet:(UIScrollView *)scrollView; @end /** The object that acts as the delegate of the empty datasets. @discussion The delegate can adopt the DZNEmptyDataSetDelegate protocol. The delegate is not retained. All delegate methods are optional. @discussion All delegate methods are optional. Use this delegate for receiving action callbacks. */ @protocol DZNEmptyDataSetDelegate <NSObject> @optional /** Asks the delegate to know if the empty dataset should fade in when displayed. Default is YES. @param scrollView A scrollView subclass object informing the delegate. @return YES if the empty dataset should fade in. */ - (BOOL)emptyDataSetShouldFadeIn:(UIScrollView *)scrollView; /** Asks the delegate to know if the empty dataset should be rendered and displayed. Default is YES. @param scrollView A scrollView subclass object informing the delegate. @return YES if the empty dataset should show. */ - (BOOL)emptyDataSetShouldDisplay:(UIScrollView *)scrollView; /** Asks the delegate for touch permission. Default is YES. @param scrollView A scrollView subclass object informing the delegate. @return YES if the empty dataset receives touch gestures. */ - (BOOL)emptyDataSetShouldAllowTouch:(UIScrollView *)scrollView; /** Asks the delegate for scroll permission. Default is NO. @param scrollView A scrollView subclass object informing the delegate. @return YES if the empty dataset is allowed to be scrollable. */ - (BOOL)emptyDataSetShouldAllowScroll:(UIScrollView *)scrollView; /** Asks the delegate for image view animation permission. Default is NO. Make sure to return a valid CAAnimation object from imageAnimationForEmptyDataSet: @param scrollView A scrollView subclass object informing the delegate. @return YES if the empty dataset is allowed to animate */ - (BOOL)emptyDataSetShouldAnimateImageView:(UIScrollView *)scrollView; /** Tells the delegate that the empty dataset view was tapped. Use this method either to resignFirstResponder of a textfield or searchBar. @param scrollView A scrollView subclass informing the delegate. */ - (void)emptyDataSetDidTapView:(UIScrollView *)scrollView DEPRECATED_MSG_ATTRIBUTE("Use emptyDataSet:didTapView:"); /** Tells the delegate that the action button was tapped. @param scrollView A scrollView subclass informing the delegate. */ - (void)emptyDataSetDidTapButton:(UIScrollView *)scrollView DEPRECATED_MSG_ATTRIBUTE("Use emptyDataSet:didTapButton:"); /** Tells the delegate that the empty dataset view was tapped. Use this method either to resignFirstResponder of a textfield or searchBar. @param scrollView A scrollView subclass informing the delegate. @param view the view tapped by the user */ - (void)emptyDataSet:(UIScrollView *)scrollView didTapView:(UIView *)view; /** Tells the delegate that the action button was tapped. @param scrollView A scrollView subclass informing the delegate. @param button the button tapped by the user */ - (void)emptyDataSet:(UIScrollView *)scrollView didTapButton:(UIButton *)button; /** Tells the delegate that the empty data set will appear. @param scrollView A scrollView subclass informing the delegate. */ - (void)emptyDataSetWillAppear:(UIScrollView *)scrollView; /** Tells the delegate that the empty data set did appear. @param scrollView A scrollView subclass informing the delegate. */ - (void)emptyDataSetDidAppear:(UIScrollView *)scrollView; /** Tells the delegate that the empty data set will disappear. @param scrollView A scrollView subclass informing the delegate. */ - (void)emptyDataSetWillDisappear:(UIScrollView *)scrollView; /** Tells the delegate that the empty data set did disappear. @param scrollView A scrollView subclass informing the delegate. */ - (void)emptyDataSetDidDisappear:(UIScrollView *)scrollView; @end
mrjlovetian/OC-Category
OC-Category/Classes/UIKit/UIScrollView/UIScrollView+EmptyDataSet.h
C
unlicense
10,213
html, body{ margin: 0; } html, body, canvas{ display: block; background: #0000FF; }
Legitnews/Legitnews.github.io
Games/Civilizationesque/style.css
CSS
unlicense
87
playa-mansa ===========
amarco63/playa-mansa
README.md
Markdown
unlicense
24
import random # CoRe def turn(board, symbol): while 1: x = random.choice(range(8)) y = random.choice(range(8)) if getboard(board,x,y) == '#': return (x,y)
ac1235/core
ai_templates/crazy.py
Python
unlicense
164
Rails.application.config.session_store :cookie_store, key: '_megahal-server_session'
jasonhutchens/megahal-server
config/initializers/session_store.rb
Ruby
unlicense
85
keydown-playground ================== A test presentation made using keydown
ottuzzi/keydown-playground
README.md
Markdown
unlicense
78
Weenix `Prev <weenie.html>`__  W  `Next <well-behaved.html>`__ -------------- **Weenix**: /wee´niks/, n. 1. [ITS] A derogatory term for `*Unix* <../U/Unix.html>`__, derived from `*Unix weenie* <../U/Unix-weenie.html>`__. According to one noted ex-ITSer, it is “the operating system preferred by Unix Weenies: typified by poor modularity, poor reliability, hard file deletion, no file version numbers, case sensitivity everywhere, and users who believe that these are all advantages”. (Some ITS fans behave as though they believe Unix stole a future that rightfully belonged to them. See `*ITS* <../I/ITS.html>`__, sense 2.) 2. [Brown University] A Unix-like OS developed for tutorial purposes at Brown University. See `http://www.cs.brown.edu/courses/cs167/weenix.html <http://www.cs.brown.edu/courses/cs167/weenix.html>`__. Named independently of the ITS usage. -------------- +---------------------------+----------------------------+---------------------------------+ | `Prev <weenie.html>`__  | `Up <../W.html>`__ |  `Next <well-behaved.html>`__ | +---------------------------+----------------------------+---------------------------------+ | weenie  | `Home <../index.html>`__ |  well-behaved | +---------------------------+----------------------------+---------------------------------+
ghoulmann/rest-jargon-file
jargon-4.4.7-working/html/W/Weenix.html
HTML
unlicense
1,364
/* ----------------------------------------------------------------------------------------------------------------------------- * NQueens2.java: Determines the position n queens can be placed on an nXn chessboard without ever attacking one another. * Utilizes the backtracking programming technique. Prints total number of possible move combinations. * * Author: Kevin Richardson <kevin@magically.us> * Date: 24-Feb-2011 * ----------------------------------------------------------------------------------------------------------------------------*/ public class NQueens2 { // size of the board. also tracks number of queens to place. private int size; //track positions of the queen in every column. ex: queen in row 2 of column 1: positions[1] = 2; private int[] positions; // track whether or not a row is already occupied by a queen (true if it's occupied) private boolean[] row; // track whether or not the diagonals are occupied by a queen (true if it's occupied) private boolean[] diagLeft; private boolean[] diagRight; // number of solutions found. private int count = 0; public NQueens2(int size) { this.size = size; this.positions = new int[size]; this.row = new boolean[size]; this.diagLeft = new boolean[size * 2 - 1]; this.diagRight = new boolean[size * 2 -1]; } public static void main(String[] args) { for(int i = 3; i <= 12; i++){ doGame(i); } } // creates a new game with board size nxn and prints out the number of solutions public static void doGame(int size) { NQueens2 game = new NQueens2(size); // find solution, starting at column 0 game.tryNextMove(); // tell results System.out.println("There are " + game.getCount() + " solutions for a " + size + "x" + size + " grid."); } // overload tryNextMove public void tryNextMove() { this.tryNextMove(0); } // attempts to place a piece in (each row of) column c. // Counts each solution as it's found. public void tryNextMove(int column) { // initialize selection of moves and run through each row. for(int row = 0; row < this.size; row++){ // only work on this path if this move is acceptable if(this.isAcceptable(column, row)){ // add a queen this.recordMove(column, row); // the board is full: we've reached a solution! if(column == size - 1){ this.count++; } // try the next move because there are more columns to fill. else{ this.tryNextMove(column + 1); } // remove this queen so the loop can keep on going to find all solutions. this.eraseMove(column, row); } } } // erases a queen placement public void eraseMove(int column, int row) { this.setPositions(column, 0); this.setRow(row, false); this.setDiagLeft(column, row, false); this.setDiagRight(column, row, false); } // records a queen placement public void recordMove(int column, int row) { this.setPositions(column, row); this.setRow(row, true); this.setDiagLeft(column, row, true); this.setDiagRight(column, row, true); } // returns true if queen placement in column c, row r is acceptable and false if it is not. public boolean isAcceptable(int c, int r) { return (!this.getRow(r)) && (!this.getDiagLeft(c, r)) && (!this.getDiagRight(c, r)); } public int getPositions(int column) { return positions[column]; } public void setPositions(int column, int row) { positions[column] = row; } // returns true if the row is occupied. false if it is not. public boolean getRow(int row) { return this.row[row]; } public void setRow(int row, boolean bool) { this.row[row] = bool; } // returns true if the left-facing diagonal based on column, row is occupied. false if it is not. public boolean getDiagLeft(int column, int row) { return this.diagLeft[column + row]; } public void setDiagLeft(int column, int row, boolean bool) { this.diagLeft[column + row] = bool; } // returns true if the right-facing diagonal based on column, row is occupied. false if it is not. public boolean getDiagRight(int column, int row) { return this.diagRight[row - column + (size - 1)]; } public void setDiagRight(int column, int row, boolean bool) { this.diagRight[row - column + (size - 1)] = bool; } public int getCount() { return this.count; } public void setCount(int count) { this.count = count; } // prints out the positions of the queens on the grid. public void printGrid() { System.out.print("Col: "); for(int i = 0; i < this.positions.length; i++) { System.out.print(i + " "); } System.out.println(); System.out.print("Row: "); for(int i = 0; i < this.positions.length; i++) { System.out.print(this.getPositions(i) + " "); } System.out.println("\n"); } }
kfr2/java-algorithms
algorithms_1/NQueens2.java
Java
unlicense
4,965
<div class="header" id="home"> <div class="container"> <div class="logo"> <h1><a href="index.html"><i><img src="images/logo.png" alt="" /></i>Real Property</a></h1> </div> <div class="header-left"> <nav class="navbar navbar-default"> <!-- Brand and toggle get grouped for better mobile display --> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> </div> <!-- Collect the nav links, forms, and other content for toggling --> <div class="collapse navbar-collapse nav-wil" id="bs-example-navbar-collapse-1"> <div class="header-right-search"> <form action="#blogs" method="post"> <input type="search" ng-model="formData.desc" placeholder="Search" required="" /> <input type="submit" value=" " ng-click="sub()"> </form> </div> <nav class="link-effect-9" id="link-effect-9"> <ul class="nav navbar-nav"> <li class="active"><a class="hvr-overline-from-center scroll" href="index.html">Home</a></li> <li><a href="#about" class="hvr-overline-from-center scroll">About Us</a></li> <li><a href="#team" class="hvr-overline-from-center scroll">Our Team</a></li> <li><a href="#blogs" class="hvr-overline-from-center scroll">Blogs</a></li> <li><a href="#properties" class="hvr-overline-from-center scroll">Properties</a></li> <li><a href="#contact" class="hvr-overline-from-center scroll">Contact Us</a></li> </ul> </nav> </div> <!-- /.navbar-collapse --> </nav> </div> </div> </div> <!-- //header -->
Apeksha14/AngularAppExample
.history/public/templates/header_20170501165831.html
HTML
unlicense
1,879
// DyBMPMovieView.cpp : implementation of the CDyBMPMovieView class // #include "stdafx.h" #include "DyBMPMovie.h" #include "DyBMPMovieDoc.h" #include "DyBMPMovieView.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CDyBMPMovieView IMPLEMENT_DYNCREATE(CDyBMPMovieView, CView) BEGIN_MESSAGE_MAP(CDyBMPMovieView, CView) //{{AFX_MSG_MAP(CDyBMPMovieView) ON_WM_CREATE() ON_WM_TIMER() ON_WM_ERASEBKGND() ON_WM_SIZE() ON_WM_DESTROY() //}}AFX_MSG_MAP // Standard printing commands ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint) ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint) ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview) END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CDyBMPMovieView construction/destruction CDyBMPMovieView::CDyBMPMovieView() { // TODO: add construction code here //´´½¨ËùÐèµÄ±³¾°Ë¢×Ó CBitmap* pBitmap = new CBitmap; ASSERT(pBitmap); pBitmap->LoadBitmap(IDB_BACKGROUND);//¼ÓÔØÎ»Í¼ m_BKBrush.CreatePatternBrush(pBitmap);//´´½¨±³¾°Ë¢ delete pBitmap;//ÊÍ·ÅÄÚ´æ } CDyBMPMovieView::~CDyBMPMovieView() { } BOOL CDyBMPMovieView::PreCreateWindow(CREATESTRUCT& cs) { // TODO: Modify the Window class or styles here by modifying // the CREATESTRUCT cs return CView::PreCreateWindow(cs); } ///////////////////////////////////////////////////////////////////////////// // CDyBMPMovieView drawing void CDyBMPMovieView::OnDraw(CDC* pDC) { CDyBMPMovieDoc* pDoc = GetDocument(); ASSERT_VALID(pDoc); // TODO: add draw code for native data here } ///////////////////////////////////////////////////////////////////////////// // CDyBMPMovieView printing BOOL CDyBMPMovieView::OnPreparePrinting(CPrintInfo* pInfo) { // default preparation return DoPreparePrinting(pInfo); } void CDyBMPMovieView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/) { // TODO: add extra initialization before printing } void CDyBMPMovieView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/) { // TODO: add cleanup after printing } ///////////////////////////////////////////////////////////////////////////// // CDyBMPMovieView diagnostics #ifdef _DEBUG void CDyBMPMovieView::AssertValid() const { CView::AssertValid(); } void CDyBMPMovieView::Dump(CDumpContext& dc) const { CView::Dump(dc); } CDyBMPMovieDoc* CDyBMPMovieView::GetDocument() // non-debug version is inline { ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CDyBMPMovieDoc))); return (CDyBMPMovieDoc*)m_pDocument; } #endif //_DEBUG ///////////////////////////////////////////////////////////////////////////// // CDyBMPMovieView message handlers int CDyBMPMovieView::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CView::OnCreate(lpCreateStruct) == -1) return -1; // TODO: Add your specialized creation code here for (int i=0; i<6; ++i)//×°ÔØÎ»Í¼Í¼Ïó m_Bitmap[i].LoadBitmap(IDB_BITMAP1+i); BITMAP bm;//BITMAP½á¹¹ m_Bitmap[0].GetBitmap(&bm); m_nFrameWidth = bm.bmWidth;//»ñµÃͼÏóµÄ¿í¶È m_nFrameHeight = bm.bmHeight;//»ñµÃͼÏóµÄ¸ß¶È //ÉèÖÃˮƽºÍ´¹Ö±·½ÏòµÄ²½½øÁ¿ m_nStepX = 20; m_nStepY = 15; m_ptCurPos = CPoint(0, 0);//µ±Ç°µÄÏÔʾλÖà m_nCurFrameNo = 0; //¿ªÊ¼ÏÔʾµÄͼÏó±àºÅ SetTimer(1, 150, NULL);//É趨¶¨Ê±Æ÷ return 0; } void CDyBMPMovieView::OnTimer(UINT nIDEvent) { // TODO: Add your message handler code here and/or call default //»ñµÃÉÏÒ»´ÎÏÔʾµÄͼÏóµÄ¾ØÐÎÇø´óС CRect rect(m_ptCurPos.x, m_ptCurPos.y, m_ptCurPos.x+m_nFrameWidth, m_ptCurPos.y+m_nFrameHeight); InvalidateRect(&rect);//ʹÕâ¸ö¾ØÐÎÇøÓòÎÞЧ UpdateWindow();//¸üд°¿ÚÏÔʾ //»ñÈ¡¿Í»§Çø¾ØÐδóС CRect ClientRect; GetClientRect(&ClientRect); //¼ÆËãеÄÏÔʾλÖà if (m_ptCurPos.x+m_nFrameWidth+m_nStepX >= ClientRect.right || m_ptCurPos.x+m_nStepX <= ClientRect.left)//³¬³ö×óÓұ߽ç m_nStepX = -m_nStepX; if (m_ptCurPos.y+m_nFrameHeight+m_nStepY >= ClientRect.bottom || m_ptCurPos.y+m_nStepY <= ClientRect.top)//³¬³öÉÏϱ߽ç m_nStepY = -m_nStepY; m_ptCurPos.x += m_nStepX; m_ptCurPos.y += m_nStepY; //ÏÂÃæ¿ªÊ¼ÏÔʾһ¸±Í¼Ïñ CClientDC dc(this);//»ñÈ¡DC CDC MemDC; if (! MemDC.CreateCompatibleDC(&dc))//´´½¨¼æÈÝDC return; CBitmap *pOldBitmap = (CBitmap *)MemDC.SelectObject(&m_Bitmap[m_nCurFrameNo]); dc.BitBlt(m_ptCurPos.x, m_ptCurPos.y, m_nFrameWidth, m_nFrameHeight, &MemDC, 0, 0, SRCCOPY); MemDC.SelectObject(pOldBitmap); m_nCurFrameNo++; if (m_nCurFrameNo >=6) m_nCurFrameNo = 0; CView::OnTimer(nIDEvent); } BOOL CDyBMPMovieView::OnEraseBkgnd(CDC* pDC) { // TODO: Add your message handler code here and/or call default // ±£´æÔ­À´µÄͼÏóË¢×Ó CBrush* pOldBrush = pDC->SelectObject(&m_BKBrush); //»ñµÃÐèÒª¸üеļô²ÃÇø¾ØÐÎ CRect rect; pDC->GetClipBox(&rect); pDC->PatBlt(rect.left, rect.top, rect.Width(), rect.Height(),PATCOPY); pDC->SelectObject(pOldBrush); return TRUE; // return CView::OnEraseBkgnd(pDC); } void CDyBMPMovieView::OnSize(UINT nType, int cx, int cy) { CView::OnSize(nType, cx, cy); // TODO: Add your message handler code here m_ptCurPos = CPoint(0, 0); m_nCurFrameNo = 0; } void CDyBMPMovieView::OnDestroy() { CView::OnDestroy(); // TODO: Add your message handler code here //Çå³ý¶¨Ê±Æ÷ KillTimer(1); }
hyller/CodeLibrary
Visual C++ Example/第17章 多媒体开发/实例391——实现“动态”的位图动画/DyBMPMovie/DyBMPMovieView.cpp
C++
unlicense
5,491
# encoding: utf-8 import re import json import xml.etree.ElementTree from .common import InfoExtractor from ..utils import ( ExtractorError, find_xpath_attr, unified_strdate, determine_ext, get_element_by_id, compat_str, ) # There are different sources of video in arte.tv, the extraction process # is different for each one. The videos usually expire in 7 days, so we can't # add tests. class ArteTvIE(InfoExtractor): _VIDEOS_URL = r'(?:http://)?videos.arte.tv/(?P<lang>fr|de)/.*-(?P<id>.*?).html' _LIVEWEB_URL = r'(?:http://)?liveweb.arte.tv/(?P<lang>fr|de)/(?P<subpage>.+?)/(?P<name>.+)' _LIVE_URL = r'index-[0-9]+\.html$' IE_NAME = u'arte.tv' @classmethod def suitable(cls, url): return any(re.match(regex, url) for regex in (cls._VIDEOS_URL, cls._LIVEWEB_URL)) # TODO implement Live Stream # from ..utils import compat_urllib_parse # def extractLiveStream(self, url): # video_lang = url.split('/')[-4] # info = self.grep_webpage( # url, # r'src="(.*?/videothek_js.*?\.js)', # 0, # [ # (1, 'url', u'Invalid URL: %s' % url) # ] # ) # http_host = url.split('/')[2] # next_url = 'http://%s%s' % (http_host, compat_urllib_parse.unquote(info.get('url'))) # info = self.grep_webpage( # next_url, # r'(s_artestras_scst_geoFRDE_' + video_lang + '.*?)\'.*?' + # '(http://.*?\.swf).*?' + # '(rtmp://.*?)\'', # re.DOTALL, # [ # (1, 'path', u'could not extract video path: %s' % url), # (2, 'player', u'could not extract video player: %s' % url), # (3, 'url', u'could not extract video url: %s' % url) # ] # ) # video_url = u'%s/%s' % (info.get('url'), info.get('path')) def _real_extract(self, url): mobj = re.match(self._VIDEOS_URL, url) if mobj is not None: id = mobj.group('id') lang = mobj.group('lang') return self._extract_video(url, id, lang) mobj = re.match(self._LIVEWEB_URL, url) if mobj is not None: name = mobj.group('name') lang = mobj.group('lang') return self._extract_liveweb(url, name, lang) if re.search(self._LIVE_URL, url) is not None: raise ExtractorError(u'Arte live streams are not yet supported, sorry') # self.extractLiveStream(url) # return def _extract_video(self, url, video_id, lang): """Extract from videos.arte.tv""" ref_xml_url = url.replace('/videos/', '/do_delegate/videos/') ref_xml_url = ref_xml_url.replace('.html', ',view,asPlayerXml.xml') ref_xml = self._download_webpage(ref_xml_url, video_id, note=u'Downloading metadata') ref_xml_doc = xml.etree.ElementTree.fromstring(ref_xml) config_node = find_xpath_attr(ref_xml_doc, './/video', 'lang', lang) config_xml_url = config_node.attrib['ref'] config_xml = self._download_webpage(config_xml_url, video_id, note=u'Downloading configuration') video_urls = list(re.finditer(r'<url quality="(?P<quality>.*?)">(?P<url>.*?)</url>', config_xml)) def _key(m): quality = m.group('quality') if quality == 'hd': return 2 else: return 1 # We pick the best quality video_urls = sorted(video_urls, key=_key) video_url = list(video_urls)[-1].group('url') title = self._html_search_regex(r'<name>(.*?)</name>', config_xml, 'title') thumbnail = self._html_search_regex(r'<firstThumbnailUrl>(.*?)</firstThumbnailUrl>', config_xml, 'thumbnail') return {'id': video_id, 'title': title, 'thumbnail': thumbnail, 'url': video_url, 'ext': 'flv', } def _extract_liveweb(self, url, name, lang): """Extract form http://liveweb.arte.tv/""" webpage = self._download_webpage(url, name) video_id = self._search_regex(r'eventId=(\d+?)("|&)', webpage, u'event id') config_xml = self._download_webpage('http://download.liveweb.arte.tv/o21/liveweb/events/event-%s.xml' % video_id, video_id, u'Downloading information') config_doc = xml.etree.ElementTree.fromstring(config_xml.encode('utf-8')) event_doc = config_doc.find('event') url_node = event_doc.find('video').find('urlHd') if url_node is None: url_node = event_doc.find('urlSd') return {'id': video_id, 'title': event_doc.find('name%s' % lang.capitalize()).text, 'url': url_node.text.replace('MP4', 'mp4'), 'ext': 'flv', 'thumbnail': self._og_search_thumbnail(webpage), } class ArteTVPlus7IE(InfoExtractor): IE_NAME = u'arte.tv:+7' _VALID_URL = r'https?://www\.arte.tv/guide/(?P<lang>fr|de)/(?:(?:sendungen|emissions)/)?(?P<id>.*?)/(?P<name>.*?)(\?.*)?' @classmethod def _extract_url_info(cls, url): mobj = re.match(cls._VALID_URL, url) lang = mobj.group('lang') # This is not a real id, it can be for example AJT for the news # http://www.arte.tv/guide/fr/emissions/AJT/arte-journal video_id = mobj.group('id') return video_id, lang def _real_extract(self, url): video_id, lang = self._extract_url_info(url) webpage = self._download_webpage(url, video_id) return self._extract_from_webpage(webpage, video_id, lang) def _extract_from_webpage(self, webpage, video_id, lang): json_url = self._html_search_regex(r'arte_vp_url="(.*?)"', webpage, 'json url') json_info = self._download_webpage(json_url, video_id, 'Downloading info json') self.report_extraction(video_id) info = json.loads(json_info) player_info = info['videoJsonPlayer'] info_dict = { 'id': player_info['VID'], 'title': player_info['VTI'], 'description': player_info.get('VDE'), 'upload_date': unified_strdate(player_info.get('VDA', '').split(' ')[0]), 'thumbnail': player_info.get('programImage') or player_info.get('VTU', {}).get('IUR'), } all_formats = player_info['VSR'].values() # Some formats use the m3u8 protocol all_formats = list(filter(lambda f: f.get('videoFormat') != 'M3U8', all_formats)) def _match_lang(f): if f.get('versionCode') is None: return True # Return true if that format is in the language of the url if lang == 'fr': l = 'F' elif lang == 'de': l = 'A' regexes = [r'VO?%s' % l, r'VO?.-ST%s' % l] return any(re.match(r, f['versionCode']) for r in regexes) # Some formats may not be in the same language as the url formats = filter(_match_lang, all_formats) formats = list(formats) # in python3 filter returns an iterator if not formats: # Some videos are only available in the 'Originalversion' # they aren't tagged as being in French or German if all(f['versionCode'] == 'VO' for f in all_formats): formats = all_formats else: raise ExtractorError(u'The formats list is empty') if re.match(r'[A-Z]Q', formats[0]['quality']) is not None: def sort_key(f): return ['HQ', 'MQ', 'EQ', 'SQ'].index(f['quality']) else: def sort_key(f): return ( # Sort first by quality int(f.get('height',-1)), int(f.get('bitrate',-1)), # The original version with subtitles has lower relevance re.match(r'VO-ST(F|A)', f.get('versionCode', '')) is None, # The version with sourds/mal subtitles has also lower relevance re.match(r'VO?(F|A)-STM\1', f.get('versionCode', '')) is None, ) formats = sorted(formats, key=sort_key) def _format(format_info): quality = '' height = format_info.get('height') if height is not None: quality = compat_str(height) bitrate = format_info.get('bitrate') if bitrate is not None: quality += '-%d' % bitrate if format_info.get('versionCode') is not None: format_id = u'%s-%s' % (quality, format_info['versionCode']) else: format_id = quality info = { 'format_id': format_id, 'format_note': format_info.get('versionLibelle'), 'width': format_info.get('width'), 'height': height, } if format_info['mediaType'] == u'rtmp': info['url'] = format_info['streamer'] info['play_path'] = 'mp4:' + format_info['url'] info['ext'] = 'flv' else: info['url'] = format_info['url'] info['ext'] = determine_ext(info['url']) return info info_dict['formats'] = [_format(f) for f in formats] return info_dict # It also uses the arte_vp_url url from the webpage to extract the information class ArteTVCreativeIE(ArteTVPlus7IE): IE_NAME = u'arte.tv:creative' _VALID_URL = r'https?://creative\.arte\.tv/(?P<lang>fr|de)/magazine?/(?P<id>.+)' _TEST = { u'url': u'http://creative.arte.tv/de/magazin/agentur-amateur-corporate-design', u'file': u'050489-002.mp4', u'info_dict': { u'title': u'Agentur Amateur / Agence Amateur #2 : Corporate Design', }, } class ArteTVFutureIE(ArteTVPlus7IE): IE_NAME = u'arte.tv:future' _VALID_URL = r'https?://future\.arte\.tv/(?P<lang>fr|de)/(thema|sujet)/.*?#article-anchor-(?P<id>\d+)' _TEST = { u'url': u'http://future.arte.tv/fr/sujet/info-sciences#article-anchor-7081', u'file': u'050940-003.mp4', u'info_dict': { u'title': u'Les champignons au secours de la planète', }, } def _real_extract(self, url): anchor_id, lang = self._extract_url_info(url) webpage = self._download_webpage(url, anchor_id) row = get_element_by_id(anchor_id, webpage) return self._extract_from_webpage(row, anchor_id, lang)
ashutosh-mishra/youtube-dl
youtube_dl/extractor/arte.py
Python
unlicense
10,732
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><!-- STOCK BOOK DETAIL HTML --><head> <title>Wakatobi People - Wakatobi 2008-09-17 18-54-19</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link href="assets/css/global.css" rel="stylesheet" type="text/css"> <meta name="description" localizable="true" content="Created by Apple Aperture"> </head> <body class="detail"> <div id="header"> <h1 localizable="true">Wakatobi 2008 – People</h1> <ul id="nav"><!-- The list items below need to be smashed together for IE on Windows --> <li class="index"><a href="index5.html" localizable="true">Index</a></li><li class="previous"> <a href="large-39.html"><em class="previous_text" localizable="true">Previous</em> </a> </li><li class="pageNumber">40 of 110</li><li class="next"> <a href="large-41.html"><em class="next_text" localizable="true">Next</em> </a> </li></ul> <div style="clear: both;"></div> </div> <table><tbody><tr><td class="sideinfo"> <h2></h2> <ul id="metadata"><li>Rating: 1 </li><li>Aperture: ƒ/2.8 </li><li>Shutter Speed: 1/60 </li><li>Exposure Bias: 0 ev </li><li>Focal Length: 5.8mm </li><li>Caption: Jetty Bar </li><li>Keywords: Wakatobi </li><li>Name: Wakatobi 2008-09-17 18-54-19 </li><li>Date: 9/19/08 12:54:19 AM GMT+08:00 </li><li>ISO: ISO 233 </li><li>File Size: 2.29 MB </li><li>Project Path: Wakatobi 2008 </li></ul> </td><td style="width:100%;"> <div id="photo"><table startoffset="39"><tr><td><img name="img" src="pictures/picture-40.jpg" width="600" height="450" alt=""></td></tr></table></div> </td></tr></tbody></table> <div id="footer"> <p localizable="true">Copyright 2008, Gregg Kellogg. All rights reserved.</p> </div> </body></html>
gkellogg/gkellogg.github.io
galleries/Wakatobi People/large-40.html
HTML
unlicense
1,876
{% extends "header.html" %} {% block content %} <head> <style> table { font-family: arial, sans-serif; border-collapse: collapse; width: 100%; } td, th { border: 1px solid #dddddd; text-align: left; padding: 8px; } tr:nth-child(even) { background-color: #dddddd; } </style> </head> <body> <div class="container"> <table id="usersTable" class="table"> <thead> <tr> <th></th> <th>User Name</th> <th>First Name</th> <th>Surname</th> <th>E-mail</th> </tr> </thead> <tbody> {%if users%} {% for user in users %} <tr> <td><img src="/static/images/avatar.png" class="img-circle" alt="foodiconset" width="50" height="50"> <td class="UsersModelItem">{{user.userName}}</td> <td class="UsersModelItem">{{user.userFirstName}}</td> <td class="UsersModelItem">{{user.userSurname}}</td> <td class="UsersModelItem">{{user.userEmail}}</td> <td><form action="/user/updateDirect" method="POST">{% csrf_token %}<p data-placement="top" data-toggle="tooltip" title="Edit"><input type="hidden" name="userName" value="{{user.userName}}"><button class="btn btn-primary btn-xs" type="submit" data-title="Edit" data-toggle="modal" ><span class="glyphicon glyphicon-pencil"></span></button></p></form></td> <td><form action="/user/delete" method="POST">{% csrf_token %}<p data-placement="top" data-toggle="tooltip" title="Delete"><input type="hidden" name="userName" value="{{user.userName}}"><button class="btn btn-danger btn-xs" type="submit" data-title="Delete" data-toggle="modal" ><span class="glyphicon glyphicon-trash"></span></button></p></form></td> </tr> {% endfor %} {% endif %} </tbody> </table> <form action="/user/addUser"> <button type="submit" id="btn_sign" class="btn btn-default">Add User</button> </form> </div> <!-- /container --> </body> {% endblock %}
CriminalProject/Project2
templates/users.html
HTML
unlicense
1,975
<?php class ControllerCommonNouvelles extends Controller { public function index() { $this->document->setTitle($this->config->get('config_meta_title')); $this->document->setDescription($this->config->get('config_meta_description')); $this->document->setKeywords($this->config->get('config_meta_keyword')); if (isset($this->request->get['route'])) { $this->document->addLink($this->config->get('config_url'), 'canonical'); } $data['column_left'] = $this->load->controller('common/column_left'); $data['column_right'] = $this->load->controller('common/column_right'); $data['content_top'] = $this->load->controller('common/content_top'); $data['content_bottom'] = $this->load->controller('common/content_bottom'); $data['footer'] = $this->load->controller('common/footer'); $data['header'] = $this->load->controller('common/header'); $this->response->setOutput($this->load->view('common/nouvelles', $data)); } }
Tyurinam/ArtBoutiqueLvovna
OpenCartLocalMarina/upload/catalog/controller/common/nouvelles.php
PHP
unlicense
963
#ifdef WIN32 // window #include <windows.h> #include <gl/gl.h> #include <gl/glut.h> #else // mac #include <OpenGL/OpenGL.h> #include <GLUT/GLUT.h> #endif #include <math.h> void init(int argc, char **argv) { // ^{\it 윈도우 생성, 버퍼 설정}^ glutInit(&argc, argv); glutInitDisplayMode(GLUT_DOUBLE|GLUT_RGBA|GLUT_DEPTH); glutInitWindowPosition(0,0); glutInitWindowSize(512,512); glutCreateWindow("Translations"); glClearColor(0.8, 0.8, 0.8, 1.0); // ^{\it 카메라 투영 특성 설정 (glPerspective 사용). 이때는 GL\_PROJECTION 행렬모드여야 한다.}^ glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(60, 1.0, 0.1, 100.0); } void drawAxes() { glLineWidth(5.0); glBegin(GL_LINES); glColor3f(1.0, 0.0, 0.0); glVertex3f(0.0, 0.0, 0.0); glVertex3f(1.0, 0.0, 0.0); glColor3f(0.0, 1.0, 0.0); glVertex3f(0.0, 0.0, 0.0); glVertex3f(0.0, 1.0, 0.0); glColor3f(0.0, 0.0, 1.0); glVertex3f(0.0, 0.0, 0.0); glVertex3f(0.0, 0.0, 1.0); glEnd(); glLineWidth(1.0); } void draw() { glutWireSphere(0.5, 30, 30); // ^{it 반지름 0.5의 구를 원점을 중심으로 그림}^ } void display() { // The location of camera glMatrixMode(GL_MODELVIEW); glLoadIdentity(); gluLookAt(0, 0, 5, 0, 0, 0, 0, 1, 0); glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); drawAxes(); // ^{\it 축을 그림}^ glColor3f(1, 1, 0); draw(); // ^{\아무런 변환 없이 원점에 구를 그림}^ glTranslatef(1.0, 0.0, 0.0); //^{\it $(1,0,0)$ 벡터만큼 이동을 함}^ glColor3f(0, 1, 1); draw(); //^{\적용된 변환을 이용하여 구를 그림}^ glTranslatef(-0.5, 1.0, 0.0); //^{\it $(-0.5,1,0)$ 벡터만큼 이동을 함}^ glColor3f(1, 0, 0); draw(); //^{\적용된 변환을 이용하여 옮겨진 구름 그림}^ glutSwapBuffers(); } int main (int argc, char **argv) { init(argc, argv); glutDisplayFunc(display); glutIdleFunc(display); glutMainLoop(); }
dknife/GraphicsExCode
P01Xform_01Translate/chapXform_01_Translate/main.cpp
C++
unlicense
2,055
package com.squareup.okhttp.internal.http; import com.squareup.okhttp.internal.b; import com.squareup.okhttp.m; import java.net.Socket; import okio.i; import okio.y; import okio.z; abstract class e implements y { protected boolean a; private okio.l b = new okio.l(d.b(this.c).a()); private e(d paramd) { } public final z a() { return this.b; } protected final void a(boolean paramBoolean) { if (d.c(this.c) != 5) throw new IllegalStateException("state: " + d.c(this.c)); d.a(this.c, this.b); d.a(this.c, 0); if ((paramBoolean) && (d.d(this.c) == 1)) { d.b(this.c, 0); b.b.a(d.e(this.c), d.f(this.c)); } do return; while (d.d(this.c) != 2); d.a(this.c, 6); d.f(this.c).c().close(); } protected final void b() { com.squareup.okhttp.internal.l.a(d.f(this.c).c()); d.a(this.c, 6); } } /* Location: E:\Progs\Dev\Android\Decompile\apktool\zssq\zssq-dex2jar.jar * Qualified Name: com.squareup.okhttp.internal.http.e * JD-Core Version: 0.6.0 */
clilystudio/NetBook
allsrc/com/squareup/okhttp/internal/http/e.java
Java
unlicense
1,069
projeto ======= projeto para testar
Mateusb5/projeto
README.md
Markdown
unlicense
37
<script type="application/ld+json"> { "@context": "https://schema.org", "@type": "SportsTeam", "name": "Seattle Seahawks", "sport": "American Football", "memberOf": [ { "@type": "SportsOrganization", "name": "National Football League" },{ "@type": "SportsOrganization", "name": "National Football Conference" },{ "@type": "SportsOrganization", "name": "NFC West Division" } ], "coach": { "@type": "Person", "name": "Pete Carroll" }, "athlete": [ { "@type": "Person", "name": "Russell Wilson" },{ "@type": "Person", "name": "Marshawn Lynch" } ] } </script>
structured-data/linter
schema.org/eg-0430-jsonld.html
HTML
unlicense
672
<?php require_once(__DIR__ . '/BridgeInterface.php'); abstract class BridgeAbstract implements BridgeInterface { const NAME = 'Unnamed bridge'; const URI = ''; const DESCRIPTION = 'No description provided'; const MAINTAINER = 'No maintainer'; const PARAMETERS = array(); public $useProxy = true; protected $cache; protected $items = array(); protected $inputs = array(); protected $queriedContext = ''; protected function returnError($message, $code){ throw new \HttpException($message, $code); } protected function returnClientError($message){ $this->returnError($message, 400); } protected function returnServerError($message){ $this->returnError($message, 500); } /** * Return items stored in the bridge * @return mixed */ public function getItems(){ return $this->items; } protected function validateTextValue($value, $pattern = null){ if(!is_null($pattern)){ $filteredValue = filter_var($value , FILTER_VALIDATE_REGEXP , array('options' => array( 'regexp' => '/^' . $pattern . '$/' )) ); } else { $filteredValue = filter_var($value); } if($filteredValue === false) return null; return $filteredValue; } protected function validateNumberValue($value){ $filteredValue = filter_var($value, FILTER_VALIDATE_INT); if($filteredValue === false && !empty($value)) return null; return $filteredValue; } protected function validateCheckboxValue($value){ $filteredValue = filter_var($value, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE); if(is_null($filteredValue)) return null; return $filteredValue; } protected function validateListValue($value, $expectedValues){ $filteredValue = filter_var($value); if($filteredValue === false) return null; if(!in_array($filteredValue, $expectedValues)){ // Check sub-values? foreach($expectedValues as $subName => $subValue){ if(is_array($subValue) && in_array($filteredValue, $subValue)) return $filteredValue; } return null; } return $filteredValue; } protected function validateData(&$data){ if(!is_array($data)) return false; foreach($data as $name => $value){ $registered = false; foreach(static::PARAMETERS as $context => $set){ if(array_key_exists($name, $set)){ $registered = true; if(!isset($set[$name]['type'])){ $set[$name]['type'] = 'text'; } switch($set[$name]['type']){ case 'number': $data[$name] = $this->validateNumberValue($value); break; case 'checkbox': $data[$name] = $this->validateCheckboxValue($value); break; case 'list': $data[$name] = $this->validateListValue($value, $set[$name]['values']); break; default: case 'text': if(isset($set[$name]['pattern'])){ $data[$name] = $this->validateTextValue($value, $set[$name]['pattern']); } else { $data[$name] = $this->validateTextValue($value); } break; } if(is_null($data[$name])){ echo 'Parameter \'' . $name . '\' is invalid!' . PHP_EOL; return false; } } } if(!$registered) return false; } return true; } protected function setInputs(array $inputs, $queriedContext){ // Import and assign all inputs to their context foreach($inputs as $name => $value){ foreach(static::PARAMETERS as $context => $set){ if(array_key_exists($name, static::PARAMETERS[$context])){ $this->inputs[$context][$name]['value'] = $value; } } } // Apply default values to missing data $contexts = array($queriedContext); if(array_key_exists('global', static::PARAMETERS)){ $contexts[] = 'global'; } foreach($contexts as $context){ foreach(static::PARAMETERS[$context] as $name => $properties){ if(isset($this->inputs[$context][$name]['value'])){ continue; } $type = isset($properties['type']) ? $properties['type'] : 'text'; switch($type){ case 'checkbox': if(!isset($properties['defaultValue'])){ $this->inputs[$context][$name]['value'] = false; } else { $this->inputs[$context][$name]['value'] = $properties['defaultValue']; } break; case 'list': if(!isset($properties['defaultValue'])){ $firstItem = reset($properties['values']); if(is_array($firstItem)){ $firstItem = reset($firstItem); } $this->inputs[$context][$name]['value'] = $firstItem; } else { $this->inputs[$context][$name]['value'] = $properties['defaultValue']; } break; default: if(isset($properties['defaultValue'])){ $this->inputs[$context][$name]['value'] = $properties['defaultValue']; } break; } } } // Copy global parameter values to the guessed context if(array_key_exists('global', static::PARAMETERS)){ foreach(static::PARAMETERS['global'] as $name => $properties){ if(isset($inputs[$name])){ $value = $inputs[$name]; } elseif (isset($properties['value'])){ $value = $properties['value']; } else { continue; } $this->inputs[$queriedContext][$name]['value'] = $value; } } // Only keep guessed context parameters values if(isset($this->inputs[$queriedContext])){ $this->inputs = array($queriedContext => $this->inputs[$queriedContext]); } else { $this->inputs = array(); } } protected function getQueriedContext(array $inputs){ $queriedContexts = array(); foreach(static::PARAMETERS as $context => $set){ $queriedContexts[$context] = null; foreach($set as $id => $properties){ if(isset($inputs[$id]) && !empty($inputs[$id])){ $queriedContexts[$context] = true; } elseif(isset($properties['required']) && $properties['required'] === true){ $queriedContexts[$context] = false; break; } } } if(array_key_exists('global', static::PARAMETERS) && $queriedContexts['global'] === false){ return null; } unset($queriedContexts['global']); switch(array_sum($queriedContexts)){ case 0: foreach($queriedContexts as $context => $queried){ if (is_null($queried)){ return $context; } } return null; case 1: return array_search(true, $queriedContexts); default: return false; } } /** * Defined datas with parameters depending choose bridge * Note : you can define a cache with "setCache" * @param array array with expected bridge paramters */ public function setDatas(array $inputs){ if(!is_null($this->cache)){ $this->cache->prepare($inputs); $time = $this->cache->getTime(); if($time !== false && (time() - $this->getCacheDuration() < $time)){ $this->items = $this->cache->loadData(); return; } } if(empty(static::PARAMETERS)){ if(!empty($inputs)){ $this->returnClientError('Invalid parameters value(s)'); } $this->collectData(); if(!is_null($this->cache)){ $this->cache->saveData($this->getItems()); } return; } if(!$this->validateData($inputs)){ $this->returnClientError('Invalid parameters value(s)'); } // Guess the paramter context from input data $this->queriedContext = $this->getQueriedContext($inputs); if(is_null($this->queriedContext)){ $this->returnClientError('Required parameter(s) missing'); } elseif($this->queriedContext === false){ $this->returnClientError('Mixed context parameters'); } $this->setInputs($inputs, $this->queriedContext); $this->collectData(); if(!is_null($this->cache)){ $this->cache->saveData($this->getItems()); } } function getInput($input){ if(!isset($this->inputs[$this->queriedContext][$input]['value'])){ return null; } return $this->inputs[$this->queriedContext][$input]['value']; } public function getName(){ return static::NAME; } public function getURI(){ return static::URI; } public function getCacheDuration(){ return 3600; } public function setCache(\CacheAbstract $cache){ $this->cache = $cache; } public function debugMessage($text){ if(!file_exists('DEBUG')) { return; } $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 3); $calling = $backtrace[2]; $message = $calling['file'] . ':' . $calling['line'] . ' class ' . get_class($this) . '->' . $calling['function'] . ' - ' . $text; error_log($message); } protected function getContents($url , $use_include_path = false , $context = null , $offset = 0 , $maxlen = null){ $contextOptions = array( 'http' => array( 'user_agent' => ini_get('user_agent') ) ); if(defined('PROXY_URL') && $this->useProxy){ $contextOptions['http']['proxy'] = PROXY_URL; $contextOptions['http']['request_fulluri'] = true; if(is_null($context)){ $context = stream_context_create($contextOptions); } else { $prevContext = $context; if(!stream_context_set_option($context, $contextOptions)){ $context = $prevContext; } } } if(is_null($maxlen)){ $content = @file_get_contents($url, $use_include_path, $context, $offset); } else { $content = @file_get_contents($url, $use_include_path, $context, $offset, $maxlen); } if($content === false) $this->debugMessage('Cant\'t download ' . $url); return $content; } protected function getSimpleHTMLDOM($url , $use_include_path = false , $context = null , $offset = 0 , $maxLen = null , $lowercase = true , $forceTagsClosed = true , $target_charset = DEFAULT_TARGET_CHARSET , $stripRN = true , $defaultBRText = DEFAULT_BR_TEXT , $defaultSpanText = DEFAULT_SPAN_TEXT){ $content = $this->getContents($url, $use_include_path, $context, $offset, $maxLen); return str_get_html($content , $lowercase , $forceTagsClosed , $target_charset , $stripRN , $defaultBRText , $defaultSpanText); } /** * Maintain locally cached versions of pages to avoid multiple downloads. * @param url url to cache * @param duration duration of the cache file in seconds (default: 24h/86400s) * @return content of the file as string */ public function getSimpleHTMLDOMCached($url , $duration = 86400 , $use_include_path = false , $context = null , $offset = 0 , $maxLen = null , $lowercase = true , $forceTagsClosed = true , $target_charset = DEFAULT_TARGET_CHARSET , $stripRN = true , $defaultBRText = DEFAULT_BR_TEXT , $defaultSpanText = DEFAULT_SPAN_TEXT){ $this->debugMessage('Caching url ' . $url . ', duration ' . $duration); $filepath = __DIR__ . '/../cache/pages/' . sha1($url) . '.cache'; $this->debugMessage('Cache file ' . $filepath); if(file_exists($filepath) && filectime($filepath) < time() - $duration){ unlink ($filepath); $this->debugMessage('Cached file deleted: ' . $filepath); } if(file_exists($filepath)){ $this->debugMessage('Loading cached file ' . $filepath); touch($filepath); $content = file_get_contents($filepath); } else { $this->debugMessage('Caching ' . $url . ' to ' . $filepath); $dir = substr($filepath, 0, strrpos($filepath, '/')); if(!is_dir($dir)){ $this->debugMessage('Creating directory ' . $dir); mkdir($dir, 0777, true); } $content = $this->getContents($url, $use_include_path, $context, $offset, $maxLen); if($content !== false){ file_put_contents($filepath, $content); } } return str_get_html($content , $lowercase , $forceTagsClosed , $target_charset , $stripRN , $defaultBRText , $defaultSpanText); } }
polo2ro/rss-bridge
lib/BridgeAbstract.php
PHP
unlicense
11,363
using System.IO; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace Gateways { [TestClass] public class check_settings { [TestMethod] public void check() { var gate = new Gateways.EfawateerGateway(); gate.Initialize(File.ReadAllText("initialize.xml")); var result = gate.CheckSettings(); var b = result == "OK"; Assert.IsTrue(b); } } }
maxole/experiments
gateway/efawateer/tests/check_settings.cs
C#
unlicense
462
using System; using System.Windows; using System.Windows.Threading; using Microsoft.Extensions.DependencyInjection; using Retrospector.Utilities.Interfaces; using Retrospector.Utilities.Models; namespace Retrospector.Setup { public partial class App { private readonly IServiceProvider _provider; private readonly Startup _startup; public App() { var services = new ServiceCollection(); _startup = new Startup(new ConfigurationLoader().LoadConfig<Configuration>()); _provider = _startup.ConfigureServices(services).BuildServiceProvider(); } private void OnStartup(object sender, StartupEventArgs e) { _startup.Configure(_provider); } private void UnhandledExceptionCatcher(object sender, DispatcherUnhandledExceptionEventArgs args) { var logger = _provider.GetService<ILogger>(); logger.Log(Severity.Fatal, args.Exception); } } }
NonlinearFruit/Retrospector
Retrospector/Setup/App.xaml.cs
C#
unlicense
1,007
/* * Copyright 2002-2007 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.beans.factory.support; import java.util.Set; import junit.framework.TestCase; /** * @author Rick Evans * @author Juergen Hoeller */ public class ManagedSetTests extends TestCase { public void testMergeSunnyDay() { ManagedSet parent = new ManagedSet(); parent.add("one"); parent.add("two"); ManagedSet child = new ManagedSet(); child.add("three"); child.setMergeEnabled(true); Set mergedSet = (Set) child.merge(parent); assertEquals("merge() obviously did not work.", 3, mergedSet.size()); } public void testMergeWithNullParent() { ManagedSet child = new ManagedSet(); child.add("one"); child.setMergeEnabled(true); assertSame(child, child.merge(null)); } public void testMergeNotAllowedWhenMergeNotEnabled() { ManagedSet child = new ManagedSet(); try { child.merge(null); fail("Must have failed by this point (cannot merge() when the mergeEnabled property is false."); } catch (IllegalStateException expected) { } } public void testMergeWithNonCompatibleParentType() { ManagedSet child = new ManagedSet(); child.add("one"); child.setMergeEnabled(true); try { child.merge("hello"); fail("Must have failed by this point."); } catch (IllegalArgumentException expected) { } } public void testMergeEmptyChild() { ManagedSet parent = new ManagedSet(); parent.add("one"); parent.add("two"); ManagedSet child = new ManagedSet(); child.setMergeEnabled(true); Set mergedSet = (Set) child.merge(parent); assertEquals("merge() obviously did not work.", 2, mergedSet.size()); } public void testMergeChildValuesOverrideTheParents() { // asserts that the set contract is not violated during a merge() operation... ManagedSet parent = new ManagedSet(); parent.add("one"); parent.add("two"); ManagedSet child = new ManagedSet(); child.add("one"); child.setMergeEnabled(true); Set mergedSet = (Set) child.merge(parent); assertEquals("merge() obviously did not work.", 2, mergedSet.size()); } }
codeApeFromChina/resource
frame_packages/java_libs/spring-2.5.6-src/test/org/springframework/beans/factory/support/ManagedSetTests.java
Java
unlicense
2,734
cask 'apple-hewlett-packard-printer-drivers' do version '5.1' sha256 '788e26e8afbfcf03d36f45e8563b1cd24183d6a8772b995914072189a714bd22' url "https://support.apple.com/downloads/DL1888/en_US/HewlettPackardPrinterDrivers#{version}.dmg" appcast 'https://support.apple.com/downloads/hewlett%2520packard' name 'HP Printer Drivers' homepage 'https://support.apple.com/kb/DL1888' depends_on macos: '<= :high_sierra' pkg 'HewlettPackardPrinterDrivers.pkg' uninstall quit: [ 'com.hp.HP-Scanner', 'com.hp.HPAiOScan', 'com.hp.HPAiOTulip', 'com.hp.HPDOT4Scan', 'com.hp.HPM1210_1130.HP_LaserJet_Professional_Utility', 'com.hp.HPSOAPScan', 'com.hp.HP_LaserJet_Professional_Utility', 'com.hp.LEDMScan', 'com.hp.ScanService', 'com.hp.aio.faxarchive', 'com.hp.customer.uploader', 'com.hp.devicemodel.hpdot4d', 'com.hp.devicemonitor.*', 'com.hp.dm.hpdot4d', 'com.hp.event.status.handler.generic', 'com.hp.events.*', 'com.hp.hpalerts.plugin.*', 'com.hp.printerutility.*', 'com.hp.productresearch.*', 'com.hp.scan.*', 'com.hp.scanModule.*', ], signal: ['TERM', 'com.hp.printerutility'], kext: 'com.hp.kext.io.enabler.compound', pkgutil: [ 'com.apple.pkg.HewlettPackardPrinterDrivers', 'com.apple.pkg.HewlettPackardPrinterDriversPreInstall', ], delete: [ '/Library/Extensions/hp_io_enabler_compound.kext', '/Library/Printers/hp/hpio', ], rmdir: '/Library/Printers/hp' zap trash: [ '~/Library/Application Support/HP/Product Improvement Study', '~/Library/Logs/hp/HP Product Research.log', '~/Library/Preferences/com.hp.HP-Scanner.plist', '~/Library/Preferences/com.hp.printerutility.plist', '~/Library/Preferences/com.hp.scanModule.plist', '~/Library/Preferences/com.hp.scanModule3.plist', '~/Library/Saved Application State/com.hp.printerutility.savedState', ], rmdir: [ '~/Library/Application Support/HP', '~/Library/Logs/hp', ] caveats do reboot end end
caskroom/homebrew-drivers
Casks/apple-hewlett-packard-printer-drivers.rb
Ruby
unlicense
2,744
package battleships.backend; import java.util.List; import game.api.GameState; import game.impl.Board; import game.impl.DieRollFactory; import game.impl.Move; import game.impl.Player; import battleships.backend.GameActionsHandler; import battleships.backend.State; public class BattleShipsGameState implements GameState { private State state; private GameActionsHandler handler; public BattleShipsGameState() { state = new State(); handler = new GameActionsHandler(state); } @Override public Board getBoard() { return state.getBoard(); } @Override public DieRollFactory getDieRollFactory() { return null; } @Override public Player getLastPlayer() { return state.getLastPlayer(); } @Override public String getMessage() { return state.getMessage(); } @Override public Player getPlayerInTurn() { return state.getPlayerInTurn(); } @Override public List<Player> getPlayers() { return state.getPlayers(); } @Override public Player getWinner() { return handler.calculateWinner(); } @Override public Boolean hasEnded() { return handler.hasEndedCheck(); } @Override public Boolean proposeMove(Move move) { if(!handler.validateMove(move)) return false; handler.executeMove(move); return true; } @Override public void reset() { handler.reset(); } public boolean getIsDeployMode() { return state.isDeployMode(); } public int getDeployMovesRemaining() { return handler.getDeployMovesRemaining(); } }
Grupp2/GameBoard-API-Games
src/battleships/backend/BattleShipsGameState.java
Java
unlicense
1,674
<!DOCTYPE html> <html lang="en-US"> <head> <base href="http://localhost/wordpress" /> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Rousseau-1782 The Confessions of Jean-Jacques Rousseau | Communicating with Prisoners</title> <link rel='stylesheet' id='ortext-fonts-css' href='//fonts.googleapis.com/css?family=Lato%3A300%2C400%2C700%2C900%2C300italic%2C400italic%2C700italic' type='text/css' media='all' /> <link rel='stylesheet' id='ortext-style-css' href='http://cwpc.github.io/wp-content/themes/ortext/style.css?ver=4.1' type='text/css' media='all' /> <link rel='stylesheet' id='ortext-layout-style-css' href='http://cwpc.github.io/wp-content/themes/ortext/layouts/content.css?ver=4.1' type='text/css' media='all' /> <link rel='stylesheet' id='ortext_fontawesome-css' href='http://cwpc.github.io/wp-content/themes/ortext/fonts/font-awesome/css/font-awesome.min.css?ver=4.1' type='text/css' media='all' /> <link rel='stylesheet' id='tablepress-default-css' href='http://cwpc.github.io/wp-content/plugins/tablepress/css/default.min.css?ver=1.5.1' type='text/css' media='all' /> <style id='tablepress-default-inline-css' type='text/css'> .tablepress{width:auto;border:2px solid;margin:0 auto 1em}.tablepress td,.tablepress thead th{text-align:center}.tablepress .column-1{text-align:left}.tablepress-table-name{font-weight:900;text-align:center;font-size:20px;line-height:1.3em}.tablepress tfoot th{font-size:14px}.tablepress-table-description{font-weight:900;text-align:center} </style> <script type='text/javascript' src='http://cwpc.github.io/wp-includes/js/jquery/jquery.js?ver=1.11.1'></script> <script type='text/javascript' src='http://cwpc.github.io/wp-includes/js/jquery/jquery-migrate.min.js?ver=1.2.1'></script> <link rel='next' title='Rublack-1999 The crimes of women in early modern Germany' href='http://cwpc.github.io/refs/rublack-1999-the-crimes-of-women-in-early-modern-germany/' /> <link rel='canonical' href='http://cwpc.github.io/refs/rousseau-1782-the-confessions-of-jean-jacques-rousseau/' /> <link rel='shortlink' href='http://cwpc.github.io/?p=30890' /> </head> <body class="single single-refs postid-30890 custom-background"> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-56314084-1', 'auto'); ga('send', 'pageview'); </script><div id="page" class="hfeed site"> <a class="skip-link screen-reader-text" href="#content">Skip to content</a> <header id="masthead" class="site-header" role="banner"> <div class="site-branding"> <div class="title-box"> <h1 class="site-title"><a href="http://cwpc.github.io/" rel="home">Communicating with Prisoners</a></h1> <h2 class="site-description">Public Interest Analysis</h2> </div> </div> <div id="scroller-anchor"></div> <nav id="site-navigation" class="main-navigation clear" role="navigation"> <span class="menu-toggle"><a href="#">menu</a></span> <div class="menu-left-nav-container"><ul id="menu-left-nav" class="menu"><li id="menu-item-10830" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-10830"><a title="outline of sections" href="http://cwpc.github.io/outline-post/">Outline</a></li> <li id="menu-item-11571" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-11571"><a title="context-sensitive notes link" href="http://cwpc.github.io/outline-notes/">Notes</a></li> <li id="menu-item-11570" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-11570"><a title="context-sensitive data link" href="http://cwpc.github.io/list-datasets/">Data</a></li> </ul></div> <div id="rng"> <div id="menu-secondary" class="menu-secondary"><ul id="menu-secondary-items" class="menu-items"><li id="menu-item-10840" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-10840"><a title="about this ortext" href="http://cwpc.github.io/about/">About</a></li> </ul></div> <div class="search-toggle"> <span class="fa fa-search"></span> <a href="#search-container" class="screen-reader-text">search</a> </div> </div> </nav><!-- #site-navigation --> <div id="header-search-container" class="search-box-wrapper clear hide"> <div class="search-box clear"> <form role="search" method="get" class="search-form" action="http://cwpc.github.io/"> <label> <span class="screen-reader-text">Search for:</span> <input type="search" class="search-field" placeholder="Search &hellip;" value="" name="s" title="Search for:" /> </label> <input type="submit" class="search-submit" value="Search" /> </form> </div> </div> </header><!-- #masthead --> <div id="content" class="site-content"> <div id="primary" class="content-area"> <main id="main" class="site-main" role="main"> <div class="section-label"></div> <article id="post-30890" class="post-30890 refs type-refs status-publish hentry"> <header class="entry-header"> <h1 class="entry-title">Rousseau-1782 The Confessions of Jean-Jacques Rousseau</h1> </header><!-- .entry-header --> <div class="entry-content"> <img class="aligncenter otx-face" alt="face of a prisoner" src="http://cwpc.github.io/wp-content/uploads/faces/prisoner-316.jpg"></br><p>reference-type: Book <br />author: Rousseau, Jean-Jacques <br />year: 1782 <br />title: The Confessions of Jean-Jacques Rousseau <br />translator: Mallory, W. Conyngham <br />otx-key: Rousseau-1782 </p> <p>Full text: <a href="http://ebooks.adelaide.edu.au/r/rousseau/jean_jacques/r864c/">http://ebooks.adelaide.edu.au/r/rousseau/jean_jacques/r864c/</a></p> </div><!-- .entry-content --> <footer class="entry-footer"> <div class="tags-footer"> </div> </footer><!-- .entry-footer --> </article><!-- #post-## --> <nav class="navigation post-navigation" role="navigation"> <h1 class="screen-reader-text">Post navigation</h1> <div class="nav-links-nd"><div class="nav-nd-title">In Series of References</div><div class="nav-previous"><a href="http://cwpc.github.io/refs/fs-2009-felony-sentences-in-state-courts-2006-statistical/" rel="prev">FS-2009 Felony Sentences in State Courts, 2006 &#8211; Statistical</a></div><div class="nav-next"><a href="http://cwpc.github.io/refs/rublack-1999-the-crimes-of-women-in-early-modern-germany/" rel="next">Rublack-1999 The crimes of women in early modern Germany</a></div> </div><!-- .nav-links --> </nav><!-- .navigation --> </main><!-- #main --> </div><!-- #primary --> </div><!-- #content --> <footer id="colophon" class="site-footer" role="contentinfo"> <div class="site-info"> <nav id="site-navigation" class="main-navigation clear" role="navigation"> <span class="menu-toggle"><a href="#">menu</a></span> <div class="menu-left-nav-container"><ul id="menu-left-nav-1" class="menu"><li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-10830"><a title="outline of sections" href="http://cwpc.github.io/outline-post/">Outline</a></li> <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-11571"><a title="context-sensitive notes link" href="http://cwpc.github.io/outline-notes/">Notes</a></li> <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-11570"><a title="context-sensitive data link" href="http://cwpc.github.io/list-datasets/">Data</a></li> </ul></div> <div id="rng"> <div id="menu-secondary" class="menu-secondary"><ul id="menu-secondary-items" class="menu-items"><li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-10840"><a title="about this ortext" href="http://cwpc.github.io/about/">About</a></li> </ul></div> <div class="search-toggle-bottom"> <span class="fa fa-search"></span> <a href="#search-container" class="screen-reader-text">search</a> </div> </div> <div id="header-search-container" class="search-box-wrapper-bottom clear hide"> <div class="search-box clear"> <form role="search" method="get" class="search-form" action="http://cwpc.github.io/"> <label> <span class="screen-reader-text">Search for:</span> <input type="search" class="search-field" placeholder="Search &hellip;" value="" name="s" title="Search for:" /> </label> <input type="submit" class="search-submit" value="Search" /> </form> </div> </div> <div id="footer-tagline"> <a href="http://cwpc.github.io/">Communicating with Prisoners</a> </div> </nav><!-- #site-navigation --> </div><!-- .site-info --> </footer><!-- #colophon --> </div><!-- #page --> <script type='text/javascript' src='http://cwpc.github.io/wp-content/themes/ortext/js/superfish.min.js?ver=1.7.4'></script> <script type='text/javascript' src='http://cwpc.github.io/wp-content/themes/ortext/js/superfish-settings.js?ver=1.7.4'></script> <script type='text/javascript' src='http://cwpc.github.io/wp-content/themes/ortext/js/navigation.js?ver=20120206'></script> <script type='text/javascript' src='http://cwpc.github.io/wp-content/themes/ortext/js/skip-link-focus-fix.js?ver=20130115'></script> <script type='text/javascript' src='http://cwpc.github.io/wp-content/themes/ortext/js/hide-search.js?ver=20120206'></script> <script type='text/javascript' src='http://cwpc.github.io/wp-content/themes/ortext/js/show-hide-comments.js?ver=1.0'></script> </body> </html> <!-- Dynamic page generated in 0.215 seconds. --> <!-- Cached page generated by WP-Super-Cache on 2015-01-27 23:53:41 --> <!-- super cache -->
cwpc/cwpc.github.io
refs/rousseau-1782-the-confessions-of-jean-jacques-rousseau/index.html
HTML
unlicense
9,848
\chapter{Bevezetés} \section*{rövid ismertető} Ez nincs benne a tartalom jegyzékbe. \section{szekció} Ez egy fejezet \subsection{Alfejezet} \paragraph{bekezdés címe}\mbox{} \\ %új sor Hello Word! \noindent %nincs behúzás új bekezdés ez is %van behúzás \newpage \section{Felsorolások} \subsection{Kötőjelek} \begin{description} \item[Kicsi:] - \item[Nagy:] -- \item[Gondolatjel:] --- \item[Mínusz:] $-$ \end{description} \subsection{itemize} \begin{itemize} \item felsorolás \item ez is\dots \end{itemize} \section{Betűk} \subsection{text\dots} \begin{enumerate} \item \textbf{vastag} \item \textit{dőlt} \item \textsf{ezmiez} \item \textsc{kiskapitális} \item \texttt{írógép} \end{enumerate} \subsection{egyéb} {\tiny pici} {\large nagyobb} {\Large mégnagyobb} {\huge nagyonnagy} {\Huge legnagyobb}
varpeti/Suli
Bevszám/Latex/bevezeti.tex
TeX
unlicense
982
#include <iostream> #include "Card.h" using namespace std; ostream& operator<<(ostream& ostr,const Card& c) { // const char *pCTxt[] = {"?", "\5", "\6", "\4", "\3"}; const char *pCTxt[] = {"?", "\5", "\4", "\3", "\6" }; const char *pVTxt[] = {"?", "?", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A"}; ostr << pVTxt[c.value] << pCTxt[c.color]; return ostr; }
chrascher/cpp-poker
PokerEins/Card.cpp
C++
unlicense
454
Number In Words Kata with Javascript =================================== ## Problem Description It occurs now and then in real life that people want to write about money, especially about a certain amount of money. If it comes to cheques or contracts for example some nations have laws that state that you should write out the amount in words additionally to the amount in numbers to avoid fraud and mistakes. So if you want to transfer 745 $ to someone via cheque you have to fill out two fields: 745.00 $ (amount in numbers) seven hundred and fourty five dollars (amount in words) Write a program that converts a number into words. ## Setup Install the required dependencies with npm: ```bash $ npm install ``` ## Run the tests ```bash $ make test-w ``` ## Instructions Write the code in NumberConverter.js. Everytime the file is saved, the tests will run and show you the results.
uris77/number-in-words-kata-js
README.md
Markdown
unlicense
896
Imports System.Web Imports System.Web.Mvc Public Module FilterConfig Public Sub RegisterGlobalFilters(ByVal filters As GlobalFilterCollection) filters.Add(New HandleErrorAttribute()) End Sub End Module
aaroncampf/InventoryForNoobs
Backend/Backend/Backend/App_Start/FilterConfig.vb
Visual Basic
unlicense
209
import compose from 'koa-compose'; import webpack from 'webpack'; import { devMiddleware, hotMiddleware } from 'koa-webpack-middleware'; // Need to mock these files for development, because our Pug template // will be looking for them, but they're actually all bundled up into one // file during development with webpack and hot reloading export function mockProductionStaticFiles() { return async(ctx, next) => { if (ctx.path === '/dist/vendor.bundle.js' || ctx.path === '/dist/styles.css') { ctx.body = "/*Mocked files for development " + "(not using separate bundle files for vendor" + " and app code in development mode or separate" + " files for styles either)*/"; } else { await next(); } }; } export function webpackMiddleware() { console.log("Development environment, starting HMR"); const devConfig = require('../../../webpack.config.client'); const compile = webpack(devConfig); return compose([ devMiddleware(compile, { noInfo: true, publicPath: devConfig.output.publicPath, }), hotMiddleware(compile), ]); }
lostpebble/koa-mobx-react-starter
src/server/middleware/developmentMiddleware.js
JavaScript
unlicense
1,119
<!DOCTYPE HTML> <html lang="en"> <head> <title>grid</title> <link href='../src/grid.css' rel='stylesheet' /> <style> html{ height: 100%; } body{ font-family: sans-serif; height: 100%; margin: 0; padding: 0; } .page{ padding: 20px; overflow: hidden; position: absolute; top: 0; left: 0; right: 0; bottom: 0; height: auto; width: auto; } h1{ padding: 0; margin: 0; margin-bottom: 20px; } #grid{ position: relative; width: 99%; height: 70%; border: 1px solid #333; } </style> <script src='../node_modules/requirejs/require.js'></script> <script> requirejs.config({ baseUrl:'.', paths:{ grid:'../src', declare: '../node_modules/declare/src/declare', dom: '../node_modules/dom/src/dom', on: '../node_modules/on/src/on', EventTree: '../node_modules/EventTree/src/EventTree' } }); </script> </head> <body> <div class='page'> <h1>grid</h1> <div id='grid'></div> <script> // Sort // Pagination // Editable (double click) // Draggable columns require(['./TestGrid'], function(TestGrid){ var options = { start: 0, count: 10, sort: 'firstName', dir: 'desc' //filter:'firstName,lastName,birthday' }, grid = new TestGrid(options, 'grid'); if(grid.on){ grid.on('data', function(data){ console.log('data', data); //console.table(data); }); grid.on('render', function(grid){ console.log('grid', grid); }); grid.on('select-row', function(event){ console.log('select-row', event); }); grid.on('header-click', function(event){ console.log('header-click', event); }); } }); </script> </div> </body> </html>
clubajax/BYODG
tests/index.html
HTML
unlicense
1,776
# menonsamir.github.io My blog/personal website.
menonsamir/menonsamir.github.io
README.md
Markdown
unlicense
49
package com.led.weatherdemo.util; import android.content.Context; public class DensityUtil { /** * 根据手机的分辨率从 dp 的单位 转成为 px(像素) */ public static int dip2px(Context context, float dpValue) { final float scale = context.getResources().getDisplayMetrics().density; return (int) (dpValue * scale + 0.5f); } /** * 根据手机的分辨率从 px(像素) 的单位 转成为 dp */ public static int px2dip(Context context, float pxValue) { final float scale = context.getResources().getDisplayMetrics().density; return (int) (pxValue / scale + 0.5f); } }
heibai01/bts_work
WeatherDemo/src/com/led/weatherdemo/util/DensityUtil.java
Java
unlicense
707
using System; using System.Collections.Generic; using System.Linq; namespace NetGore.Stats { /// <summary> /// Keeps track of which stats have changed in an <see cref="IStatCollection{T}"/>. /// </summary> /// <typeparam name="T">The type of stat.</typeparam> public class ChangedStatsTracker<T> where T : struct, IComparable, IConvertible, IFormattable { /// <summary> /// Empty enumerable of <see cref="Stat{TStatType}"/>s. /// </summary> static readonly IEnumerable<Stat<T>> _emptyStats = Enumerable.Empty<Stat<T>>(); /// <summary> /// The <see cref="Func{T,U}"/> used to cast from <typeparamref name="T"/> to <see cref="Int32"/>. /// </summary> static readonly Func<T, int> _enumToInt; /// <summary> /// The size we will need to make the <see cref="_lastValues"/> array. /// </summary> static readonly int _valuesArraySize; /// <summary> /// Stores the last stat values so we can compare them to the current values. /// </summary> readonly StatValueType[] _lastValues; /// <summary> /// The <see cref="IStatCollection{T}"/> we are comparing against. /// </summary> readonly IStatCollection<T> _statCollection; /// <summary> /// Initializes the <see cref="ChangedStatsTracker{T}"/> class. /// </summary> static ChangedStatsTracker() { _enumToInt = EnumHelper<T>.GetToIntFunc(); _valuesArraySize = EnumHelper<T>.MaxValue + 1; } /// <summary> /// Initializes a new instance of the <see cref="ChangedStatsTracker{T}"/> class. /// </summary> /// <param name="statCollection">The stat collection to track for changes.</param> public ChangedStatsTracker(IStatCollection<T> statCollection) { _statCollection = statCollection; _lastValues = new StatValueType[_valuesArraySize]; // Populate the last values array with the current values foreach (var stat in statCollection) { this[stat.StatType] = stat.Value.GetRawValue(); } } /// <summary> /// Gets or sets the last value for the given <paramref name="key"/>. /// </summary> /// <param name="key">The key.</param> protected int this[T key] { get { return _lastValues[ToArrayIndex(key)].GetRawValue(); } set { _lastValues[ToArrayIndex(key)] = (StatValueType)value; } } /// <summary> /// Gets or sets the last value for the given <paramref name="key"/>. /// </summary> /// <param name="key">The key.</param> protected int this[Stat<T> key] { get { return this[key.StatType]; } set { this[key.StatType] = value; } } /// <summary> /// Gets the <see cref="Stat{T}"/>s that have changed since the last call to this method. /// </summary> /// <returns>The <see cref="Stat{T}"/>s that have changed since the last call to this method.</returns> public IEnumerable<Stat<T>> GetChangedStats() { List<Stat<T>> ret = null; foreach (var stat in _statCollection) { var index = ToArrayIndex(stat.StatType); var currentValue = stat.Value; if (_lastValues[index] != currentValue) { if (ret == null) ret = new List<Stat<T>>(); _lastValues[index] = currentValue; ret.Add(stat); } } if (ret == null) return _emptyStats; else return ret; } /// <summary> /// Gets the array index for a <typeparamref name="T"/>. /// </summary> /// <param name="value">The key to get the array index of.</param> /// <returns>The array index for the <paramref name="value"/>.</returns> static int ToArrayIndex(T value) { return _enumToInt(value); } } }
LAGIdiot/NetGore
NetGore/Stats/ChangedStatsTracker.cs
C#
unlicense
4,236
#!/usr/bin/env python import sys line = sys.stdin.readline() # skip the header line = sys.stdin.readline() all = {} while line: v = line.split() if v[0] not in all: all[v[0]] = set() all[v[0]].add(v[1]) line = sys.stdin.readline() s = [k for (_, k) in sorted([(len(v), k) for (k,v) in all.items()])] print ' '.join(reversed(s)) for i in s: print i, for j in reversed(s): print len(all[i].intersection(all[j])), print
razvanm/fs-expedition
heatmap.py
Python
unlicense
464
package es.uniovi.asw.persistence.impl; import es.uniovi.asw.persistence.CircunscripcionDao; import es.uniovi.asw.persistence.ColegioElectoralDao; import es.uniovi.asw.persistence.ComunidadAutonomaDao; import es.uniovi.asw.persistence.OpcionDao; import es.uniovi.asw.persistence.PersistenceFactory; import es.uniovi.asw.persistence.UsuarioDao; import es.uniovi.asw.persistence.VotacionDao; import es.uniovi.asw.persistence.VotadoDao; import es.uniovi.asw.persistence.VotoDao; /** * Implementacion de la factoria que devuelve implementaci??????n de la capa * de persistencia con Jdbc * * @author Enrique * */ public class SimplePersistenceFactory implements PersistenceFactory { public UsuarioDao createUsuarioDao() { return new UsuarioJdbcDao(); } public CircunscripcionDao createCircunscripcionDao() { return new CircunscripcionJdbcDao(); } public ColegioElectoralDao createColegioElectoralDao() { return new ColegioElectoralJdbcDao(); } public ComunidadAutonomaDao createComunidadAutonomaDao() { return new ComunidadAutonomaJdbcDao(); } public OpcionDao createOpcionDao() { return new OpcionJdbcDao(); } public VotacionDao createVotacionDao() { return new VotacionJdbcDao(); } public VotadoDao createVotadoDao() { return new VotadoJdbcDao(); } public VotoDao createVotoDao() { return new VotoJdbcDao(); } }
ferraobox/ASWuo213306Julio
src/main/java/es/uniovi/asw/persistence/impl/SimplePersistenceFactory.java
Java
unlicense
1,413
package org.webonise.multihostpoc.daoimpl; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.testng.Assert; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; import org.webonise.multihostpoc.dao.GenericDao; import org.webonise.multihostpoc.models.Person; import org.webonise.multihostpoc.session.SessionFactoryBuilder; import java.math.BigInteger; import java.security.SecureRandom; import java.util.Date; import java.util.List; import java.util.Random; /** * Created by webonise on 30/7/15. */ public class PersonDAOImplTests { private static final Logger LOG = LoggerFactory.getLogger(PersonDAOImplTests.class); private final SessionFactoryBuilder builder = new SessionFactoryBuilder(); private final GenericDao<Person> personDaoImpl = new PersonDaoImpl(Person.class,builder.getSessionFactory()); @Test public void testSessionFactoryCreationSucceeds(){ Assert.assertNotNull(builder.getSessionFactory()); } @Test public void testSaveData(){ LOG.info("running the save data"); Person p = getFixture(); personDaoImpl.save(p); } @Test public void testReadData(){ LOG.info("running the read data"); List<Person> result = personDaoImpl.readAll(); Assert.assertNotNull(result); LOG.info("Population is "+result.size()); for(Person p : result){ LOG.info(p.toString()); } } private Person getFixture() { Person person = new Person(); SecureRandom random = new SecureRandom(); person.setName("John"); person.setSurname("Doe"); person.setAddress("Timbuktoo"); person.setNationality("Timbuktooin"); person.setOccupation("Forager"); person.setSocialId(new BigInteger(130, random).toString(32)); //just generating a fancy random string return person; } /*TODO: Mock out the prepSessionMethod to set the connection.readOnly to true and call the save method */ }
ameyawebonise/hibernate-multi-host-poc
src/test/java/org/webonise/multihostpoc/daoimpl/PersonDAOImplTests.java
Java
unlicense
2,047
# uncompyle6 version 2.9.10 # Python bytecode 2.7 (62211) # Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10) # [GCC 6.2.0 20161005] # Embedded file name: suite.py """TestSuite""" import sys from . import case from . import util __unittest = True def _call_if_exists(parent, attr): func = getattr(parent, attr, lambda : None) func() class BaseTestSuite(object): """A simple test suite that doesn't provide class or module shared fixtures. """ def __init__(self, tests=()): self._tests = [] self.addTests(tests) def __repr__(self): return '<%s tests=%s>' % (util.strclass(self.__class__), list(self)) def __eq__(self, other): if not isinstance(other, self.__class__): return NotImplemented return list(self) == list(other) def __ne__(self, other): return not self == other __hash__ = None def __iter__(self): return iter(self._tests) def countTestCases(self): cases = 0 for test in self: cases += test.countTestCases() return cases def addTest(self, test): if not hasattr(test, '__call__'): raise TypeError('{} is not callable'.format(repr(test))) if isinstance(test, type) and issubclass(test, ( case.TestCase, TestSuite)): raise TypeError('TestCases and TestSuites must be instantiated before passing them to addTest()') self._tests.append(test) def addTests(self, tests): if isinstance(tests, basestring): raise TypeError('tests must be an iterable of tests, not a string') for test in tests: self.addTest(test) def run(self, result): for test in self: if result.shouldStop: break test(result) return result def __call__(self, *args, **kwds): return self.run(*args, **kwds) def debug(self): """Run the tests without collecting errors in a TestResult""" for test in self: test.debug() class TestSuite(BaseTestSuite): """A test suite is a composite test consisting of a number of TestCases. For use, create an instance of TestSuite, then add test case instances. When all tests have been added, the suite can be passed to a test runner, such as TextTestRunner. It will run the individual test cases in the order in which they were added, aggregating the results. When subclassing, do not forget to call the base class constructor. """ def run(self, result, debug=False): topLevel = False if getattr(result, '_testRunEntered', False) is False: result._testRunEntered = topLevel = True for test in self: if result.shouldStop: break if _isnotsuite(test): self._tearDownPreviousClass(test, result) self._handleModuleFixture(test, result) self._handleClassSetUp(test, result) result._previousTestClass = test.__class__ if getattr(test.__class__, '_classSetupFailed', False) or getattr(result, '_moduleSetUpFailed', False): continue if not debug: test(result) else: test.debug() if topLevel: self._tearDownPreviousClass(None, result) self._handleModuleTearDown(result) result._testRunEntered = False return result def debug(self): """Run the tests without collecting errors in a TestResult""" debug = _DebugResult() self.run(debug, True) def _handleClassSetUp(self, test, result): previousClass = getattr(result, '_previousTestClass', None) currentClass = test.__class__ if currentClass == previousClass: return else: if result._moduleSetUpFailed: return if getattr(currentClass, '__unittest_skip__', False): return try: currentClass._classSetupFailed = False except TypeError: pass setUpClass = getattr(currentClass, 'setUpClass', None) if setUpClass is not None: _call_if_exists(result, '_setupStdout') try: try: setUpClass() except Exception as e: if isinstance(result, _DebugResult): raise currentClass._classSetupFailed = True className = util.strclass(currentClass) errorName = 'setUpClass (%s)' % className self._addClassOrModuleLevelException(result, e, errorName) finally: _call_if_exists(result, '_restoreStdout') return def _get_previous_module(self, result): previousModule = None previousClass = getattr(result, '_previousTestClass', None) if previousClass is not None: previousModule = previousClass.__module__ return previousModule def _handleModuleFixture(self, test, result): previousModule = self._get_previous_module(result) currentModule = test.__class__.__module__ if currentModule == previousModule: return else: self._handleModuleTearDown(result) result._moduleSetUpFailed = False try: module = sys.modules[currentModule] except KeyError: return setUpModule = getattr(module, 'setUpModule', None) if setUpModule is not None: _call_if_exists(result, '_setupStdout') try: try: setUpModule() except Exception as e: if isinstance(result, _DebugResult): raise result._moduleSetUpFailed = True errorName = 'setUpModule (%s)' % currentModule self._addClassOrModuleLevelException(result, e, errorName) finally: _call_if_exists(result, '_restoreStdout') return def _addClassOrModuleLevelException(self, result, exception, errorName): error = _ErrorHolder(errorName) addSkip = getattr(result, 'addSkip', None) if addSkip is not None and isinstance(exception, case.SkipTest): addSkip(error, str(exception)) else: result.addError(error, sys.exc_info()) return def _handleModuleTearDown(self, result): previousModule = self._get_previous_module(result) if previousModule is None: return else: if result._moduleSetUpFailed: return try: module = sys.modules[previousModule] except KeyError: return tearDownModule = getattr(module, 'tearDownModule', None) if tearDownModule is not None: _call_if_exists(result, '_setupStdout') try: try: tearDownModule() except Exception as e: if isinstance(result, _DebugResult): raise errorName = 'tearDownModule (%s)' % previousModule self._addClassOrModuleLevelException(result, e, errorName) finally: _call_if_exists(result, '_restoreStdout') return def _tearDownPreviousClass(self, test, result): previousClass = getattr(result, '_previousTestClass', None) currentClass = test.__class__ if currentClass == previousClass: return else: if getattr(previousClass, '_classSetupFailed', False): return if getattr(result, '_moduleSetUpFailed', False): return if getattr(previousClass, '__unittest_skip__', False): return tearDownClass = getattr(previousClass, 'tearDownClass', None) if tearDownClass is not None: _call_if_exists(result, '_setupStdout') try: try: tearDownClass() except Exception as e: if isinstance(result, _DebugResult): raise className = util.strclass(previousClass) errorName = 'tearDownClass (%s)' % className self._addClassOrModuleLevelException(result, e, errorName) finally: _call_if_exists(result, '_restoreStdout') return class _ErrorHolder(object): """ Placeholder for a TestCase inside a result. As far as a TestResult is concerned, this looks exactly like a unit test. Used to insert arbitrary errors into a test suite run. """ failureException = None def __init__(self, description): self.description = description def id(self): return self.description def shortDescription(self): return None def __repr__(self): return '<ErrorHolder description=%r>' % (self.description,) def __str__(self): return self.id() def run(self, result): pass def __call__(self, result): return self.run(result) def countTestCases(self): return 0 def _isnotsuite(test): """A crude way to tell apart testcases and suites with duck-typing""" try: iter(test) except TypeError: return True return False class _DebugResult(object): """Used by the TestSuite to hold previous class when running in debug.""" _previousTestClass = None _moduleSetUpFailed = False shouldStop = False
DarthMaulware/EquationGroupLeaks
Leak #5 - Lost In Translation/windows/Resources/Python/Core/Lib/unittest/suite.py
Python
unlicense
10,084
{% extends 'base.html' %} {% load static from staticfiles %} {% block title %}Record an item{% endblock %} {% block body %} {% if messages or form.errors %} <ul class="messages{% if not form.errors %} messages--success{% endif %}" id="messages"> {% for message in messages %} <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li> {% endfor %} {% for field in form %} {% if field.errors %} <li>{{ field.label }}: {{ field.errors }} {% endif %}</li> {% endfor %} </ul> {% endif %} <h1>Intake</h1> <form action="{{ request.get_full_path }}" method="post" class="django-form {% if advanced_form %}js__hide{% endif %}" id="record-form"> {% csrf_token %} {{ form.as_p }} <input class="btn" type="submit" value="Save" /> </form> {% if advanced_form %} <div id="advanced-form-target"></div> <script type="html/template" id="advanced-form"> <form> <div data-ct-ui-stage="1"> <h2>When?</h2> <div data-ct-ui-hide-then> <p><button class="btn" type="button" data-ct-ui-stage-change="click" data-ct-data-date="now">Now</button></p> <p><button class="btn" type="button" data-ct-ui-show-target="then">Then</button></p> </div> <div data-ct-ui-show-then class="ui--removed"> <p> <label><span class="ui--hidden">Time of day</span> <select data-ct-data-date="time"> <option>--Select time of day--</option> <option class="default" value="07:00">Breakfast</option> <option value="10:00">Morning</option> <option value="13:00">Lunch</option> <option value="16:00">Afternoon</option> <option value="19:00">Dinner</option> <option value="21:00">Evening</option> </select> </label> </p> <p data-ct-ui-checked-hide-when> <label>Today <input type="radio" data-ct-ui-stage-change="checked" data-ct-data-date="today"/></label> <label>Another day <input type="radio" data-ct-ui-show-checked="when"/></label> </p> <div data-ct-ui-checked-show-when class="ui--removed"> <p> <label>Date <input type="date" placeholder="yyyy-mm-dd" data-ct-ui-stage-change="complete" data-ct-form-default="today" data-ct-data-date="date"/> </label> <button class="btn" type="button">OK</button> </p> </div> </div> </div> <div data-ct-ui-stage="2" class="ui--removed"> <h2>What?</h2> <div data-ct-ui-hide-item> {% if recent %} <p> <label><span class="ui--hidden">Recent</span> <select data-ct-ui-stage-change="change" data-ct-data-item="options"> <option>--Select recent--</option> {% for r in recent %} <option value="{{ r.item.description }}" data-ct-data-value="{{ r.item.caffeine }}">{{ r.item.description }}</option> {% endfor %} </select> </label> </p> {% endif %} <p><button class="btn" type="button" data-ct-ui-show-target="item">{% if recent %}Other{% else %}New item{% endif %}</button></p> </div> <div data-ct-ui-show-item data-ct-data-new-item class="ui--removed"> <p>Enter new item.</p> <p> <label>Name <input list="items" id="new_item" type="text" data-ct-datalist-value/></label> <datalist id="items" data-ct-value-target="absolute"> {% for item in items %} <option value="{{ item.description }}" data-ct-data-value="{{ item.caffeine }}"/> {% endfor %} </datalist> </p> <p data-ct-ui-new-item-mode="absolute"> <label>Caffeine content (mg) <input type="number" min="0" id="absolute" data-ct-data-new-item-input data-ct-value-target-absolute/> </label> </p> <p data-ct-ui-new-item-mode="espresso"> <label>Number of shots of espresso <input type="number" min="0" data-ct-data-new-item-input/> </label> </p> <p data-ct-ui-new-item-mode="teabag"> <label>Number of tea bags <input type="number" min="0" data-ct-data-new-item-input/> </label </p> <div data-ct-ui-new-item-mode="concentration"> <fieldset> <legend>Caffeine concentration</legend> <label>mg <input type="number" min="0" data-ct-data-new-item-input/> </label> per <label>ml <input type="number" min="0" data-ct-data-new-item-input/> </label> </fieldset> <label>Quantity <input type="number" min="0" data-ct-data-new-item-input/> </label> <fieldset> <legend>Measure</legend> <label>ml <input type="radio" name="measure" value="ml" data-ct-data-new-item-input/> </label> <label>cl <input type="radio" name="measure" value="cl" data-ct-data-new-item-input/> </label> <label>l <input type="radio" name="measure" value="l" data-ct-data-new-item-input/> </label> </fieldset> </div> <p><button class="btn" type="button" data-ct-ui-data-new-item-save>Save</button></p> </div> </div> <div data-ct-ui-stage="3" class="ui--removed" data-ct-ui-result="true"> <p>Saving...</p> </div> <div data-ct-ui-abort> <hr/> <p><input class="btn" type="reset" data-ct-ui-restart value="Abort"/></p> </div> </form> </script> <div class="js__hide--loading"> Loading... </div> {% endif %} {% endblock %}
decadecity/ct
caffeine_tracker/apps/record/templates/record/edit_record.html
HTML
unlicense
5,811
var esprima = require('esprima'); return esprima.parse( "function foo(x, y) {\n" + " var z = x + y;\n" + " z++;\n" + " return z;\n" + "}\n" );
dfcreative/esdom
test/fixture/simpleFunction.js
JavaScript
unlicense
166
#include "factory.h" #include "implementation1.h" #include "implementation2.h" #include "implementation3.h" #include <string> using std::string; base_class *factory::GetImplementation(const string &className) { if ("implementation1" == className) { return new implementation1(); } else if ("implementation2" == className) { return new implementation2(); } else if ("implementation3" == className) { return new implementation3(); } return NULL; }
sczzq/symmetrical-spoon
practise/object-orient-design/factory.cpp
C++
unlicense
468
<?php namespace App\Libs\Models; use Illuminate\Database\Eloquent\Model; class ApiRequestModel extends Model { protected $table = 'api_call_request'; public function getApiCallConfig() { } }
andreffonseca/itmon
src/app/Libs/Models/ApiRequestModel.php
PHP
unlicense
221
package ayrat.salavatovich.gmail.com.day_108.servicekillserver; import android.os.Build; public class Log { static { VERBOSE = android.util.Log.VERBOSE; DEBUG = android.util.Log.DEBUG; INFO = android.util.Log.INFO; WARN = android.util.Log.WARN; ERROR = android.util.Log.ERROR; ASSERT = android.util.Log.ASSERT; } public static final String EMPTY = ""; public static int v(String tag, String msg) { return android.util.Log.v(tag, msg); } public static int v(String tag, String msg, Throwable tr) { return android.util.Log.v(tag, msg, tr); } public static int d(String tag, String msg) { return android.util.Log.d(tag, msg); } public static int d(String tag, String msg, Throwable tr) { return android.util.Log.d(tag, msg, tr); } public static int i(String tag, String msg) { return android.util.Log.i(tag, msg); } public static int i(String tag, String msg, Throwable tr) { return android.util.Log.i(tag, msg, tr); } public static int w(String tag, String msg) { return android.util.Log.w(tag, msg); } public static int w(String tag, String msg, Throwable tr) { return android.util.Log.w(tag, msg, tr); } public static boolean isLoggable(String tag, int level) { return android.util.Log.isLoggable(tag, level); } public static int e(String tag, String msg) { return android.util.Log.e(tag, msg); } public static int e(String tag, String msg, Throwable tr) { return android.util.Log.e(tag, msg, tr); } public static int wtf(String tag, String msg) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.FROYO) { return android.util.Log.wtf(tag, msg, null); } else { return android.util.Log.e(tag, msg); } } public static int wtf(String tag, Throwable tr) { return wtf(tag, tr.getMessage(), tr); } public static int wtf(String tag, Object msg, Throwable tr) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.FROYO) { return android.util.Log.wtf(tag, EMPTY + msg, tr); } else { return android.util.Log.e(tag, EMPTY + msg, tr); } } public static final int VERBOSE; public static final int DEBUG; public static final int INFO; public static final int WARN; public static final int ERROR; public static final int ASSERT; }
Ayrat-Salavatovich/Learn_Android_Programming
Day 108/ServiceKillServer/src/ayrat/salavatovich/gmail/com/day_108/servicekillserver/Log.java
Java
unlicense
2,235
#******************************************************************************* # # License: # This software and/or related materials was developed at the National Institute # of Standards and Technology (NIST) by employees of the Federal Government # in the course of their official duties. Pursuant to title 17 Section 105 # of the United States Code, this software is not subject to copyright # protection and is in the public domain. # # This software and/or related materials have been determined to be not subject # to the EAR (see Part 734.3 of the EAR for exact details) because it is # a publicly available technology and software, and is freely distributed # to any interested party with no licensing requirements. Therefore, it is # permissible to distribute this software as a free download from the internet. # # Disclaimer: # This software and/or related materials was developed to promote biometric # standards and biometric technology testing for the Federal Government # in accordance with the USA PATRIOT Act and the Enhanced Border Security # and Visa Entry Reform Act. Specific hardware and software products identified # in this software were used in order to perform the software development. # In no case does such identification imply recommendation or endorsement # by the National Institute of Standards and Technology, nor does it imply that # the products and equipment identified are necessarily the best available # for the purpose. # # This software and/or related materials are provided "AS-IS" without warranty # of any kind including NO WARRANTY OF PERFORMANCE, MERCHANTABILITY, # NO WARRANTY OF NON-INFRINGEMENT OF ANY 3RD PARTY INTELLECTUAL PROPERTY # or FITNESS FOR A PARTICULAR PURPOSE or for any purpose whatsoever, for the # licensed product, however used. In no event shall NIST be liable for any # damages and/or costs, including but not limited to incidental or consequential # damages of any kind, including economic damage or injury to property and lost # profits, regardless of whether NIST shall be advised, have reason to know, # or in fact shall know of the possibility. # # By using this software, you agree to bear all risk relating to quality, # use and performance of the software and/or related materials. You agree # to hold the Government harmless from any claim arising from your use # of the software. # #******************************************************************************* # Project: NIST Fingerprint Software # SubTree: /NBIS/Main/openjpeg # Filename: Makefile # Integrators: Kenneth Ko # Organization: NIST/ITL # Host System: GNU GCC/GMAKE GENERIC (UNIX) # Date Created: 11/16/2007 # # ****************************************************************************** # # Top-level Makefile for package "openjpeg". # # ****************************************************************************** include ./p_rules.mak include $(DIR_ROOT_BUILDUTIL)/package.mak
mike10004/nbis-upstream
openjpeg/Makefile
Makefile
unlicense
3,010
#import <UIKit/UIKit.h> #import "_DDDecimalFunctions.h" #import "_DDFunctionEvaluator.h" #import "_DDFunctionExpression.h" #import "_DDFunctionTerm.h" #import "_DDGroupTerm.h" #import "_DDNumberExpression.h" #import "_DDNumberTerm.h" #import "_DDOperatorTerm.h" #import "_DDParserTerm.h" #import "_DDPrecisionFunctionEvaluator.h" #import "_DDRewriteRule.h" #import "_DDVariableExpression.h" #import "_DDVariableTerm.h" #import "DDExpression.h" #import "DDExpressionRewriter.h" #import "DDMathEvaluator+Private.h" #import "DDMathEvaluator.h" #import "DDMathOperator.h" #import "DDMathOperator_Internal.h" #import "DDMathParser.h" #import "DDMathParserMacros.h" #import "DDMathStringToken.h" #import "DDMathStringTokenizer.h" #import "DDParser.h" #import "DDParserTypes.h" #import "DDTypes.h" #import "NSString+HYPMathParsing.h" FOUNDATION_EXPORT double HYPMathParserVersionNumber; FOUNDATION_EXPORT const unsigned char HYPMathParserVersionString[];
uzegonemad/hyperoslo-form-uibutton-issues
form-uibutton-issues/Pods/Target Support Files/Pods-HYPMathParser/Pods-HYPMathParser-umbrella.h
C
unlicense
951
/** * This class contains class (static) methods * that will help you test the Picture class * methods. Uncomment the methods and the code * in the main to test. * * @author Barbara Ericson */ public class PictureTester { /** Method to test zeroBlue */ public static void testZeroBlue() { Picture beach = new Picture("beach.jpg"); beach.explore(); beach.zeroBlue(); beach.explore(); } /** Method to test mirrorVertical */ public static void testMirrorVertical() { Picture caterpillar = new Picture("caterpillar.jpg"); caterpillar.explore(); caterpillar.mirrorVertical(); caterpillar.explore(); } /** Method to test mirrorTemple */ public static void testMirrorTemple() { Picture temple = new Picture("temple.jpg"); temple.explore(); temple.mirrorTemple(); temple.explore(); } /** Method to test the collage method */ public static void testCollage() { Picture canvas = new Picture("640x480.jpg"); canvas.createCollage(); canvas.explore(); } /** Method to test edgeDetection */ public static void testEdgeDetection() { Picture swan = new Picture("swan.jpg"); swan.edgeDetection(10); swan.explore(); } /** Main method for testing. Every class can have a main * method in Java */ public static void main(String[] args) { // uncomment a call here to run a test // and comment out the ones you don't want // to run //testZeroBlue(); //testKeepOnlyBlue(); //testKeepOnlyRed(); //testKeepOnlyGreen(); //testNegate(); //This one looks really creepy. o_o //testGrayscale(); //testFixUnderwater(); //testMirrorVertical(); //testMirrorTemple(); //testMirrorArms(); //testMirrorGull(); //testMirrorDiagonal(); //testCollage(); //testCopy(); //testEdgeDetection(); //testEdgeDetection2(); //testChromakey(); //testEncodeAndDecode(); //testGetCountRedOverValue(250); //testSetRedToHalfValueInTopHalf(); //testClearBlueOverValue(200); //testGetAverageForColumn(0); testMirrorVerticalRightToLeft(); testMirrorHorizontal(); testMirrorHorizontalBottomToTop(); //testMyCollage(); //testSuperEdgeDetection(); } public static void testKeepOnlyBlue() { // TODO Auto-generated method stub Picture splat = new Picture("splatoon.jpg"); splat.keepOnlyBlue(); splat.explore(); } public static void testNegate(){ Picture splat = new Picture("splatoon.jpg"); splat.negate(); splat.explore(); } public static void testGrayscale(){ Picture splat = new Picture("splatoon.jpg"); splat.grayscale(); splat.explore(); } public static void testMirrorVerticalRightToLeft(){ Picture splat = new Picture("splatoon.jpg"); splat.mirrorVerticalRightToLeft(); splat.explore(); } public static void testMirrorHorizontal(){ Picture splat = new Picture("splatoon.jpg"); splat.mirrorHorizontal(); splat.explore(); } public static void testMirrorHorizontalBottomToTop(){ Picture splat = new Picture("splatoon.jpg"); splat.mirrorHorizontalBottomToTop(); splat.explore(); } public static void testCopy2(){ Picture splat = new Picture("splatoon.jpg"); Picture swan = new Picture("beach.jpg"); splat.copy(swan, 0, 0, 300, 300); splat.explore(); } public static void testMyCollage(){ Picture splat = new Picture("splatoon.jpg"); splat.myCollage(); splat.explore(); } public static void testSuperEdgeDetection(){ Picture splat = new Picture("splatoon.jpg"); Picture splat2 = new Picture("splatoon.jpg"); splat.superEdgeDetection(10); splat.explore(); } }
WesleyRogers/AP-CompSci
Wk28-PixelLab/pixLab/classes/PictureTester.java
Java
unlicense
3,952
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>Aria: Class Members - Variables</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> $(document).ready(initResizable); </script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">Aria &#160;<span id="projectnumber">2.9.1</span> </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.1 --> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="pages.html"><span>Related&#160;Pages</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li><a href="examples.html"><span>Examples</span></a></li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class&#160;List</span></a></li> <li><a href="classes.html"><span>Class&#160;Index</span></a></li> <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li> <li class="current"><a href="functions.html"><span>Class&#160;Members</span></a></li> </ul> </div> <div id="navrow3" class="tabs2"> <ul class="tablist"> <li><a href="functions.html"><span>All</span></a></li> <li><a href="functions_func.html"><span>Functions</span></a></li> <li class="current"><a href="functions_vars.html"><span>Variables</span></a></li> <li><a href="functions_type.html"><span>Typedefs</span></a></li> <li><a href="functions_enum.html"><span>Enumerations</span></a></li> <li><a href="functions_eval.html"><span>Enumerator</span></a></li> <li><a href="functions_rela.html"><span>Related&#160;Functions</span></a></li> </ul> </div> <div id="navrow4" class="tabs3"> <ul class="tablist"> <li><a href="functions_vars.html#index_c"><span>c</span></a></li> <li><a href="functions_vars_0x64.html#index_d"><span>d</span></a></li> <li><a href="functions_vars_0x66.html#index_f"><span>f</span></a></li> <li class="current"><a href="functions_vars_0x67.html#index_g"><span>g</span></a></li> <li><a href="functions_vars_0x69.html#index_i"><span>i</span></a></li> <li><a href="functions_vars_0x6c.html#index_l"><span>l</span></a></li> <li><a href="functions_vars_0x6d.html#index_m"><span>m</span></a></li> <li><a href="functions_vars_0x6e.html#index_n"><span>n</span></a></li> <li><a href="functions_vars_0x6f.html#index_o"><span>o</span></a></li> <li><a href="functions_vars_0x70.html#index_p"><span>p</span></a></li> <li><a href="functions_vars_0x72.html#index_r"><span>r</span></a></li> <li><a href="functions_vars_0x73.html#index_s"><span>s</span></a></li> <li><a href="functions_vars_0x74.html#index_t"><span>t</span></a></li> </ul> </div> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> $(document).ready(function(){initNavTree('functions_vars_0x67.html','');}); </script> <div id="doc-content"> <div class="contents"> &#160; <h3><a class="anchor" id="index_g"></a>- g -</h3><ul> <li>GET_CAMERA_DATA : <a class="el" href="classArCameraCommands.html#aafce83a8e187656fe7309fac2b67f5dd">ArCameraCommands</a> </li> <li>GET_CAMERA_DATA_INT : <a class="el" href="classArCameraCommands.html#a8fadac548f658e156ce09fd9b923f481">ArCameraCommands</a> </li> <li>GET_CAMERA_INFO : <a class="el" href="classArCameraCommands.html#a05a88bf890aa4ebc3a271af3b4c52843">ArCameraCommands</a> </li> <li>GET_CAMERA_INFO_INT : <a class="el" href="classArCameraCommands.html#a97b857e8ae657bc191092719eb19052d">ArCameraCommands</a> </li> <li>GET_CAMERA_MODE_LIST : <a class="el" href="classArCameraCommands.html#a4ffa289dd51b1b8086aa6b5c15d05282">ArCameraCommands</a> </li> <li>GET_DISPLAY : <a class="el" href="classArCameraCommands.html#aa158a07734092504733131cd0842e33b">ArCameraCommands</a> </li> <li>GET_PICTURE : <a class="el" href="classArCameraCommands.html#acf12225bbcaed71ea4c106d3a7a25273">ArCameraCommands</a> </li> <li>GET_PICTURE_OPTIM : <a class="el" href="classArCameraCommands.html#a780ce827c893ee8cadc2adf546106461">ArCameraCommands</a> </li> <li>GET_SNAPSHOT : <a class="el" href="classArCameraCommands.html#a79fad5a855b447f2550500f5a4babb6d">ArCameraCommands</a> </li> <li>GET_SNAPSHOT_PLAIN : <a class="el" href="classArCameraCommands.html#a1ad55b6642f770758c066b990168c7bd">ArCameraCommands</a> </li> <li>GET_VIDEO : <a class="el" href="classArCameraCommands.html#a04c498007b828e3f5a02f14eb73c1878">ArCameraCommands</a> </li> </ul> </div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="footer">Generated on Wed Oct 19 2016 11:57:49 for Aria by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.1 </li> </ul> </div> </body> </html>
Some-T/Some-T.github.io
aria/functions_vars_0x67.html
HTML
unlicense
6,141