Dataset Preview
Duplicate
The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
The dataset generation failed
Error code:   DatasetGenerationError
Exception:    ArrowInvalid
Message:      JSON parse error: Missing a closing quotation mark in string. in row 263
Traceback:    Traceback (most recent call last):
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py", line 145, in _generate_tables
                  dataset = json.load(f)
                File "/usr/local/lib/python3.9/json/__init__.py", line 293, in load
                  return loads(fp.read(),
                File "/usr/local/lib/python3.9/json/__init__.py", line 346, in loads
                  return _default_decoder.decode(s)
                File "/usr/local/lib/python3.9/json/decoder.py", line 340, in decode
                  raise JSONDecodeError("Extra data", s, end)
              json.decoder.JSONDecodeError: Extra data: line 2 column 1 (char 1197)
              
              During handling of the above exception, another exception occurred:
              
              Traceback (most recent call last):
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1995, in _prepare_split_single
                  for _, table in generator:
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py", line 148, in _generate_tables
                  raise e
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py", line 122, in _generate_tables
                  pa_table = paj.read_json(
                File "pyarrow/_json.pyx", line 308, in pyarrow._json.read_json
                File "pyarrow/error.pxi", line 154, in pyarrow.lib.pyarrow_internal_check_status
                File "pyarrow/error.pxi", line 91, in pyarrow.lib.check_status
              pyarrow.lib.ArrowInvalid: JSON parse error: Missing a closing quotation mark in string. in row 263
              
              The above exception was the direct cause of the following exception:
              
              Traceback (most recent call last):
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1529, in compute_config_parquet_and_info_response
                  parquet_operations = convert_to_parquet(builder)
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1154, in convert_to_parquet
                  builder.download_and_prepare(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1027, in download_and_prepare
                  self._download_and_prepare(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1122, in _download_and_prepare
                  self._prepare_split(split_generator, **prepare_split_kwargs)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1882, in _prepare_split
                  for job_id, done, content in self._prepare_split_single(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 2038, in _prepare_split_single
                  raise DatasetGenerationError("An error occurred while generating the dataset") from e
              datasets.exceptions.DatasetGenerationError: An error occurred while generating the dataset

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

text
string
meta
dict
title: Set up Passport localeTitle: Configurar Passaporte --- ## Configurar Passaporte Este é um esboço. [Ajude nossa comunidade a expandi-lo](https://github.com/freecodecamp/guides/tree/master/src/pages/certifications/information-security-and-quality-assurance/advanced-node-and-express/set-up-passport/index.md) . [Este guia de estilo rápido ajudará a garantir que sua solicitação de recebimento seja aceita](https://github.com/freecodecamp/guides/blob/master/README.md) .
{ "content_hash": "439de17714075873a9ddff6e117ec171", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 228, "avg_line_length": 59.5, "alnum_prop": 0.8067226890756303, "repo_name": "pahosler/freecodecamp", "id": "34a51f020a92b041844101810002c7809c3b312b", "size": "486", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "guide/portuguese/certifications/information-security-and-quality-assurance/advanced-node-and-express/set-up-passport/index.md", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "35491" }, { "name": "HTML", "bytes": "17600" }, { "name": "JavaScript", "bytes": "777274" } ] }
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE127_Buffer_Underread__char_alloca_memmove_54d.c Label Definition File: CWE127_Buffer_Underread.stack.label.xml Template File: sources-sink-54d.tmpl.c */ /* * @description * CWE: 127 Buffer Under-read * BadSource: Set data pointer to before the allocated memory buffer * GoodSource: Set data pointer to the allocated memory buffer * Sink: memmove * BadSink : Copy data to string using memmove * Flow Variant: 54 Data flow: data passed as an argument from one function through three others to a fifth; all five functions are in different source files * * */ #include "std_testcase.h" #include <wchar.h> /* all the sinks are the same, we just want to know where the hit originated if a tool flags one */ #ifndef OMITBAD /* bad function declaration */ void CWE127_Buffer_Underread__char_alloca_memmove_54e_badSink(char * data); void CWE127_Buffer_Underread__char_alloca_memmove_54d_badSink(char * data) { CWE127_Buffer_Underread__char_alloca_memmove_54e_badSink(data); } #endif /* OMITBAD */ #ifndef OMITGOOD /* good function declaration */ void CWE127_Buffer_Underread__char_alloca_memmove_54e_goodG2BSink(char * data); /* goodG2B uses the GoodSource with the BadSink */ void CWE127_Buffer_Underread__char_alloca_memmove_54d_goodG2BSink(char * data) { CWE127_Buffer_Underread__char_alloca_memmove_54e_goodG2BSink(data); } #endif /* OMITGOOD */
{ "content_hash": "1fd48376cbedbbacaa22aea0dcba5807", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 157, "avg_line_length": 31.91304347826087, "alnum_prop": 0.7268392370572208, "repo_name": "JianpingZeng/xcc", "id": "418ca45d6f97e09de0bf3fba2d23dc2be7d22370", "size": "1468", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "xcc/test/juliet/testcases/CWE127_Buffer_Underread/s01/CWE127_Buffer_Underread__char_alloca_memmove_54d.c", "mode": "33188", "license": "bsd-3-clause", "language": [] }
#include "../sys/socket.h" #include "../sys/errno.h" #include "../sys/time.h" #include "../sys/kernel.h" #include "../net/if.h" #include "../net/route.h" #include "in.h" #include "in_systm.h" #include "ip.h" #include "in_var.h" #include "ip_var.h" #include "../sys/protosw.h" /*#include "ip_icmp.h"*/ /*#include "in_pcb.h"*/ /*#include <sys/param.h>*/ /*#include <sys/systm.h>*/ /*#include <sys/malloc.h>*/ /*#include <sys/mbuf.h>*/ /*#include <sys/domain.h>*/ /*#include <sys/protosw.h>*/ /*#include <sys/socket.h>*/ /*#include <sys/errno.h>*/ /*#include <sys/time.h>*/ /*#include <sys/kernel.h>*/ /*#include <net/if.h>*/ /*#include <net/route.h>*/ /*#include <netinet/in.h>*/ /*#include <netinet/in_systm.h>*/ /*#include <netinet/ip.h>*/ /*#include <netinet/in_pcb.h>*/ /*#include <netinet/in_var.h>*/ /*#include <netinet/ip_var.h>*/ /*#include <netinet/ip_icmp.h>*/ #ifndef IPFORWARDING #ifdef GATEWAY #define IPFORWARDING 1 /* forward IP packets not for us */ #else /* GATEWAY */ #define IPFORWARDING 0 /* don't forward IP packets not for us */ #endif /* GATEWAY */ #endif /* IPFORWARDING */ #ifndef IPSENDREDIRECTS #define IPSENDREDIRECTS 1 #endif int ipforwarding = IPFORWARDING; int ipsendredirects = IPSENDREDIRECTS; int ip_defttl = IPDEFTTL; #ifdef DIAGNOSTIC int ipprintfs = 0; #endif extern struct domain inetdomain; extern struct protosw inetsw[]; u_char ip_protox[IPPROTO_MAX]; int ipqmaxlen = IFQ_MAXLEN; struct in_ifaddr *in_ifaddr; /* first inet address */ struct ifqueue ipintrq; /* * We need to save the IP options in case a protocol wants to respond * to an incoming packet over the same route if the packet got here * using IP source routing. This allows connection establishment and * maintenance when the remote end is on a network that is not known * to us. */ int ip_nhops = 0; static struct ip_srcrt { struct in_addr dst; /* final destination */ char nop; /* one NOP to align */ char srcopt[IPOPT_OFFSET + 1]; /* OPTVAL, OLEN and OFFSET */ struct in_addr route[MAX_IPOPTLEN/sizeof(struct in_addr)]; } ip_srcrt; #ifdef GATEWAY extern int if_index; u_long *ip_ifmatrix; #endif static void save_rte __P((u_char *, struct in_addr)); /* * IP initialization: fill in IP protocol switch table. * All protocols not implemented in kernel go to raw IP protocol handler. */ void ip_init() { } struct sockaddr_in ipaddr = { sizeof(ipaddr), AF_INET }; struct route ipforward_rt; /* * Ip input routine. Checksum and byte swap header. If fragmented * try to reassemble. Process options. Pass to next level. */ void ipintr() { } /* * Take incoming datagram fragment and try to * reassemble it into whole datagram. If a chain for * reassembly of this datagram already exists, then it * is given as fp; otherwise have to make a chain. */ struct ip * ip_reass(ip, fp) register struct ipasfrag *ip; register struct ipq *fp; { return NULL; } /* * Free a fragment reassembly header and all * associated datagrams. */ void ip_freef(fp) struct ipq *fp; { } /* * Put an ip fragment on a reassembly chain. * Like insque, but pointers in middle of structure. */ void ip_enq(p, prev) register struct ipasfrag *p, *prev; { } /* * To ip_enq as remque is to insque. */ void ip_deq(p) register struct ipasfrag *p; { } /* * IP timer processing; * if a timer expires on a reassembly * queue, discard it. */ void ip_slowtimo() { } /* * Drain off all datagram fragments. */ void ip_drain() { } /* * Do option processing on a datagram, * possibly discarding it if bad options are encountered, * or forwarding it if source-routed. * Returns 1 if packet has been forwarded/freed, * 0 if the packet should be processed further. */ int ip_dooptions(m) struct mbuf *m; { return 0; } /* * Given address of next destination (final or next hop), * return internet address info of interface to be used to get there. */ struct in_ifaddr * ip_rtaddr(dst) struct in_addr dst; { struct in_ifaddr *p = NULL; return p; } /* * Save incoming source route for use in replies, * to be picked up later by ip_srcroute if the receiver is interested. */ void save_rte(option, dst) u_char *option; struct in_addr dst; { } /* * Retrieve incoming source route for use in replies, * in the same form used by setsockopt. * The first hop is placed before the options, will be removed later. */ struct mbuf * ip_srcroute() { struct mbuf *m = NULL; return m; } /* * Strip out IP options, at higher * level protocol in the kernel. * Second argument is buffer to which options * will be moved, and return value is their length. * XXX should be deleted; last arg currently ignored. */ void ip_stripoptions(m, mopt) register struct mbuf *m; struct mbuf *mopt; { ; } u_char inetctlerrmap[PRC_NCMDS] = { 0, 0, 0, 0, 0, EMSGSIZE, EHOSTDOWN, EHOSTUNREACH, EHOSTUNREACH, EHOSTUNREACH, ECONNREFUSED, ECONNREFUSED, EMSGSIZE, EHOSTUNREACH, 0, 0, 0, 0, 0, 0, ENOPROTOOPT }; /* * Forward a packet. If some error occurs return the sender * an icmp packet. Note we can't always generate a meaningful * icmp message because icmp doesn't have a large enough repertoire * of codes and types. * * If not forwarding, just drop the packet. This could be confusing * if ipforwarding was zero but some routing protocol was advancing * us as a gateway to somewhere. However, we must let the routing * protocol deal with that. * * The srcrt parameter indicates whether the packet is being forwarded * via a source route. */ void ip_forward(m, srcrt) struct mbuf *m; int srcrt; { ; } int ip_sysctl(name, namelen, oldp, oldlenp, newp, newlen) int *name; u_int namelen; void *oldp; size_t *oldlenp; void *newp; size_t newlen; { return 0; }
{ "content_hash": "12ca5550fd4fb43b47a7cfe9b3e1f71d", "timestamp": "", "source": "github", "line_count": 277, "max_line_length": 73, "avg_line_length": 20.779783393501805, "alnum_prop": 0.685371785962474, "repo_name": "priseup/tcp_imple", "id": "83ecc5c9e37e16361f436699e0884f9468156c07", "size": "5756", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "netinet/ip_input.c", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "359892" }, { "name": "C++", "bytes": "1189" } ] }
======= Credits ======= Development Lead ---------------- * Dave Pretty <david@launchlab.com.au> Contributors ------------ None yet. Why not be the first?
{ "content_hash": "9777b313126a0afcc42278c524ef3b71", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 38, "avg_line_length": 12.23076923076923, "alnum_prop": 0.5408805031446541, "repo_name": "LaunchlabAU/launchlab-django-utils", "id": "5c372e033b45ce9132f41be9c098a71177e65c03", "size": "159", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "AUTHORS.rst", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "661" }, { "name": "Makefile", "bytes": "1618" }, { "name": "Python", "bytes": "11406" } ] }
package com.stylo.fashion.util; /** * Created by goman on 16/11/14. */ import android.content.Context; import android.graphics.Typeface; import android.view.LayoutInflater; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; public class StyleHelper { public static LayoutInflater getGlobalLayoutInflater(Context context){ return (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); } public static void applyTypeFace(Context context, int FontType, View ... view){ if (FontType < 0 || FontType > 21 )return; else{ Typeface tf = StyleHelper.Font.getFont(context, FontType); for (View view2 : view) { if (view != null){ if (view2 instanceof TextView){ ((TextView) view2).setTypeface(tf); } else if (view2 instanceof Button){ ((Button) view2).setTypeface(tf); } else if (view2 instanceof EditText ){ ((EditText) view2).setTypeface(tf); } } } } } public static final class Font{ public static final class FontType{ private static final String [] AssetLocation = new String[]{ "fonts/Roboto-Light.ttf", "fonts/Roboto-Black.ttf", "fonts/Roboto-Bold.ttf", "fonts/Roboto-Italic.ttf", "fonts/Roboto-Medium.ttf", "fonts/Roboto-Regular.ttf", "fonts/Lucida-Grande.ttf", "fonts/HelveticaNeue.ttf", "fonts/Montserrat-Regular.ttf", "fonts/Fenix-Regular.ttf", "fonts/Gotham-Light.otf", "fonts/Gotham-Medium.otf", "fonts/RobotoSlab-Bold.ttf", "fonts/RobotoSlab-Light.ttf", "fonts/RobotoSlab-Regular.ttf", "fonts/RobotoSlab-Thin.ttf", "fonts/OpenSans-Bold.ttf", "fonts/OpenSans-Light.ttf", "fonts/OpenSans-Regular.ttf", "fonts/OpenSans-Semibold.ttf", "fonts/SamsungImaginationCondensedRegular.otf", "fonts/Pacifico.ttf", "fonts/Proxima Nova Thin.otf", "fonts/Proxima Nova Light.otf", "fonts/Proxima Nova Regular.otf" }; public static final int RobotoLight = 0; public static final int RobotoBlack = 1; public static final int RobotoBold = 2; public static final int RobotoItalic = 3; public static final int RobotoMedium = 4; public static final int RobotoRegular = 5; public static final int LucidaGrande = 6; public static final int HelveticaNeue = 7; public static final int MontserratRegular = 8; public static final int FenixRegular = 9; public static final int GothamLight = 10; public static final int GothamMedium = 11; public static final int RobotoSlabBold = 12; public static final int RobotoSlabLight = 13; public static final int RobotoSlabRegular = 14; public static final int RobotoSlabThin = 15; public static final int OpenSansBold = 16; public static final int OpenSansLight = 17; public static final int OpenSansRegular = 18; public static final int OpenSansSemiBold = 19; public static final int SamsungImagination = 20; public static final int Pacifico = 21; public static final int ProximaNovaThin = 22; public static final int ProximaNovaLight = 23; public static final int ProximaNovaRegular = 24; } public static Typeface getFont(Context context, int typeFont){ if (typeFont > 0 && typeFont < FontType.AssetLocation.length ){ return Typeface.createFromAsset(context.getAssets(), FontType.AssetLocation[typeFont] ); } else{ return Typeface.createFromAsset(context.getAssets(), FontType.AssetLocation[0] ); } } } }
{ "content_hash": "9f9b58eecf5f55e9626927e5e21924a2", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 104, "avg_line_length": 36.20161290322581, "alnum_prop": 0.5544664736021385, "repo_name": "linggom/Stylo", "id": "8bf9ad72cbbab594e3cc7af128d31a4f8e123b07", "size": "4489", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Stylo/app/src/main/java/com/stylo/fashion/util/StyleHelper.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "142781" }, { "name": "Java", "bytes": "1440831" }, { "name": "JavaScript", "bytes": "137883" }, { "name": "PHP", "bytes": "615" }, { "name": "Ruby", "bytes": "900" } ] }
/* ****************************************************************** *********************************** *** Natural: A remote desktop for embed systems. *** By Alejandro Linarez Rangel. *** Client core. *********************************** ****************************************************************** */ /*************************************************************************** Copyright 2016 Alejandro Linarez Rangel 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. ***************************************************************************/ var NaturalSocket = io.connect(window.location.origin); // Socket hacia el servidor var NaturalLoadingIndex = 1; // Indice de carga, nada más para actualizar la imagen y // poseer registro del índice actual. var NaturalToken = ""; // Token de seguridad var NaturalError = []; // Errores al inicializar var NaturalOnLoadevent = function(){}; // Para los manejadores de escritorio var NaturalExports = {}; // Datos de un modulo o aplicacion despues de ser importado var NaturalSocketEvents = []; // Los eventos para respuestas del socket, // recuerda los resultados var NaturalImportedMods = []; // Arreglo que contiene los modulos importados. // Mapa clave-valor para el NaturalIconSet var NaturalIconSetMap = { "bars": "a", "openquote": "b", "closequote": "c", "dir": "d", "times": "e", "iconify": "f", "deiconify": "g", "cube": "h", "dash": "i", "minus": "j", "plus": "k", "maximize": "l", "bareright": "m", "bareleft": "n", "baretop": "ñ", "barebottom": "o", "alert-triangle": "p", "load-3-4": "q", "load-2-4": "r", "load-1-4": "s", "loadboard-dotted": "t", "loadboard-arrowed": "u", "loadboard-dotted-up": "v", "loadboard-arrowed-up": "w", "stackeable": "x", "stackeable-up": "y", "stackeable-down": "z", "natural-logicon": "A", "natural-syslog": "B", "natural-logicon-up": "C", "natural-syslog-up": "D", "star": "E", "git": "F", "picture": "G", "message": "H", "message-dotted": "I", "messages": "J", "loadboard": "K", "pencil": "L", "writing": "M", "joining": "N", "book": "Ñ", "spliting": "O", "expand": "P", "contract": "Q", "dots-void-h": "R", "dots-void-v": "S", "dots-h": "T", "dots-v": "U", "triangle-right": "V", "double-bars-v": "W", "rectangle": "X", "circle": "Y", "pentagon": "Z", "eye": "0", "deny": "1", "info": "2", "unchecked-box": "3", "checked-box": "4", "gear-void": "5", "gear": "6", "infocircle": "7", "trash": "8", "trash-mini": "9", "book-mini": "." }; // Funcion de depuracion function NaturalLog(msg) { console.log(msg); } function NaturalLogErr(msg) { console.error(msg); } // Se llama cuando ya se cargo el sistema por completo. function NaturalOnLoaded() { $("#intro").fadeOut(); NaturalSocket.on("response", function(data) { var task = data.task || ""; var pid = data.pid || ""; var ev = NaturalCallTaskfromQueue(task, pid, true); if(ev !== null) ev.handler(null, data); else NaturalLogErr("Unexpected response at " + JSON.stringify(data)); }); NaturalSocket.on("error-response", function(data) { var task = data.task || ""; var pid = data.pid || ""; var ev = NaturalCallTaskfromQueue(task, pid, true); if(ev !== null) ev.handler(data, null); else NaturalLogErr("Unexpected error at " + JSON.stringify(data)); }); NaturalOnLoadevent(); } // Agrega un evento a la cola de eventos. // Las comunicaciones con el servidor utilizan los mismo canales, y para // distiguir entre una respuesta y otra es necesario utilizar PIDs y tasknames function NaturalAddTaskToQueue(taskname, pid, callback) { NaturalSocketEvents.push({task: taskname, pid: pid, handler: callback}); } // Borra un elemento de la cola de eventos function NaturalRemoveTaskfromQueue(taskname, pid) { var i = 0; var j = NaturalSocketEvents.length; for(i = (j - 1); i >= 0; i--) { var cev = NaturalSocketEvents[i]; if((cev.task == taskname) && (cev.pid == pid)) { NaturalSocketEvents.splice(i, 1); return true; } } return false; } // Llama a un elemento de la pila de eventos // Lo borra si del es true function NaturalCallTaskfromQueue(taskname, pid, del) { var i = 0; var j = NaturalSocketEvents.length; for(i = (j - 1); i >= 0; i--) { var cev = NaturalSocketEvents[i]; if((cev.task == taskname) && (cev.pid == pid)) { if(del) return NaturalSocketEvents.splice(i, 1)[0]; else return cev; } } return null; } // Importa algun recurso del sistema, esta funcion es para importar recursos del filesystem // Llama al callback con dos argumentos: el error (si hay) y el contenido del archivo. Es asincrono // para evitar bloqueos por archivos grandes // path es de la forma: // /ruta/absoluta/a/algo // pid es el Process ID del programa en el lado cliente. // SOLO FUNCIONA PARA ARCHIVOS DE TEXTO function NaturalImport(path, pid, callback) { if(path.length == 0) { callback(new Error("The path is null")); return; } /* if(path.charAt(0) != "/") { callback(new Error("the path is not absolute")); return; } */ NaturalAddTaskToQueue("import", pid, function(err, data) { if(err) { callback(err); return; } callback(null, data.response); }); NaturalSocket.emit("import", { cwd: path, pid: pid, token: NaturalToken, }); } // Lee todos los archivos y directorios en una ruta especifica (ls o dir) // Callback es de la forma: // callback(err, files => array) function NaturalListDir(path, pid, callback) { if(path.length == 0) { callback(new Error("The path is null")); return; } /* if(path.charAt(0) != "/") { callback(new Error("the path is not absolute")); return; } */ NaturalAddTaskToQueue("ls", pid, function(err, data) { if(err) { callback(err); return; } callback(null, data.files); }); NaturalSocket.emit("ls", { cwd: path, pid: pid, token: NaturalToken, }); } // Carga los programas ubicados en natural/bin/ // Por cada programa cargado, llama a each(program name, manifest) function NaturalLoadPrograms(each, end) { NaturalListDir("$NATURAL/bin/", 0, function(err, files) { if(err) { NaturalError.push("loadprograms"); console.error(err); return; } var i = 0; var j = files.length; for(i = 0; i < j; i++) { var file = files[i]; if(!file.isDirectory) { var scriptTag = document.createElement("script"); scriptTag.src = "/filesystem/application?file=" + encodeURIComponent(file.filename) + "&token=" + encodeURIComponent(NaturalToken); scriptTag.addEventListener("load", function() { var manifest = JSON.parse(JSON.stringify(NaturalExports)); NaturalLog("Loaded manifest from " + $(this).attr("src") + ": the appname is " + manifest.appname); each(manifest.appname, manifest); }); document.body.appendChild(scriptTag); } } end(); }); } // Importa un archivo JS en el directorio actual de manera asincrona function NaturalRequireJS(modname, path, onloaded) { var i = 0; var j = NaturalImportedMods.length; for(i = 0; i < j; i++) { if(NaturalImportedMods[i] == modname) { onloaded(true); return; } } var scriptTag = document.createElement("script"); scriptTag.src = "/filesystem/module?file=" + encodeURIComponent(path) + "&token=" + encodeURIComponent(NaturalToken); scriptTag.async = true; scriptTag.addEventListener("load", function() { onloaded(false); }); document.body.appendChild(scriptTag); NaturalImportedMods.push(modname); } // Actualiza la imagen e incrementa el indice de carga function NaturalLoadNext() { $("#main_load").attr("src", "/images/misc/load-" + NaturalLoadingIndex + ".svg"); NaturalLoadingIndex += 1; NaturalLog("Reached " + NaturalLoadingIndex); if(NaturalLoadingIndex >= 6) { NaturalLog("On loaded"); NaturalOnLoaded(); } } // Llama a una funcion de sockets con los datos especificados function NaturalHighLevelSocketCall(task, pid, data, callback) { data["pid"] = pid; data["token"] = NaturalToken; NaturalAddTaskToQueue(task, pid, callback); NaturalSocket.emit(task, data); } // Importa un **modulo** javascript de manera asincrona function NaturalImportJS(pid, path, onloaded) { if(path.charAt(path.length - 1) == "/") path = path.substr(0, path.length - 2); NaturalLog("Importing " + path + ":$NATURAL/" + path + "/natural.json"); NaturalHighLevelSocketCall("api.file.readAll", pid, { "path": "$NATURAL/" + path + "/natural.json", "readAs": "stringUTF8" }, function(err, data) { NaturalLog("Loaded?"); if(err) { NaturalLog("No " + err); return onloaded(err); } NaturalLog("Yes " + data.filecontent); var obj = JSON.parse(data.filecontent); if(obj.type !== "module") { NaturalLog("But isnt a module"); return onloaded( new Error("NaturalImportJS Error: The imported resource is NOT a natural module") ); } NaturalRequireJS(obj.name, path + "/" + obj.name + ".js", function(imported) { NaturalLog("Imported done"); onloaded(null, imported); }) }) } NaturalSocket.on("ready", function(data) // Cuando el servidor pueda manejar nuestras solicitudes: { NaturalLog("loaded socket"); NaturalLoadNext(); $.get("/token", {}, function(data, status, xhr) // Obtén el socket por AJAX { if((status == "success") && (data != "none")) { data = new DOMParser().parseFromString(data, "text/html").getElementsByTagName("token")[0].firstChild.nodeValue; NaturalToken = data; NaturalLog("Loaded data " + data); NaturalLoadNext(); NaturalSocket.on("authenticated", function(data) // E intenta autenticar { var valid = data.valid || false; NaturalLog("Is valid: " + valid); if(valid) { NaturalLog("hello server?"); NaturalSocket.emit("hello", {}); NaturalSocket.on("world", function(data) { NaturalLoadNext(); NaturalLog("Hello World"); }); } else { NaturalError.push("authentication"); } }); NaturalSocket.emit("authenticate", {token: NaturalToken}); } else { NaturalLogErr("error on get token " + data); } }, "text"); }); window.addEventListener("load", function() // Cuando el DOM carge { NaturalLog("loaded DOM"); NaturalLoadNext(); });
{ "content_hash": "0ebc5dde20f9092d97d49827e7090103", "timestamp": "", "source": "github", "line_count": 420, "max_line_length": 135, "avg_line_length": 25.32857142857143, "alnum_prop": 0.6340477533370934, "repo_name": "alinarezrangel/node-natural", "id": "66e8dd46682e37719b9ebf7d670c815caf6e7b5a", "size": "10643", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "private/natural.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "45398" }, { "name": "HTML", "bytes": "89691" }, { "name": "JavaScript", "bytes": "244365" } ] }
/* * Host Resources MIB implementation for bsnmpd. */ #include <paths.h> #include <stdlib.h> #include <string.h> #include <syslog.h> #include <unistd.h> #include "hostres_snmp.h" #include "hostres_oid.h" #include "hostres_tree.h" /* Internal id got after we'll register this module with the agent */ static u_int host_registration_id = 0; /* This our hostres module */ static struct lmodule *hostres_module; /* See the generated file hostres_oid.h */ static const struct asn_oid oid_host = OIDX_host; /* descriptor to access kernel memory */ kvm_t *hr_kd; /* * HOST RESOURCES mib module finalization hook. * Returns 0 on success, < 0 on error */ static int hostres_fini(void) { if (hr_kd != NULL) (void)kvm_close(hr_kd); fini_storage_tbl(); fini_fs_tbl(); fini_processor_tbl(); fini_disk_storage_tbl(); fini_device_tbl(); fini_partition_tbl(); fini_network_tbl(); fini_printer_tbl(); fini_swrun_tbl(); fini_swins_tbl(); fini_scalars(); if (host_registration_id > 0) or_unregister(host_registration_id); HRDBG("done."); return (0); } /* * HOST RESOURCES mib module initialization hook. * Returns 0 on success, < 0 on error */ static int hostres_init(struct lmodule *mod, int argc __unused, char *argv[] __unused) { hostres_module = mod; /* * NOTE: order of these calls is important here! */ if ((hr_kd = kvm_open(NULL, _PATH_DEVNULL, NULL, O_RDONLY, "kvm_open")) == NULL) { syslog(LOG_ERR, "kvm_open failed: %m "); return (-1); } /* * The order is relevant here, because some table depend on each other. */ init_device_tbl(); /* populates partition table too */ if (init_disk_storage_tbl()) { hostres_fini(); return (-1); } init_processor_tbl(); init_printer_tbl(); /* * populate storage and FS tables. Must be done after device * initialisation because the FS refresh code calls into the * partition refresh code. */ init_storage_tbl(); /* also the hrSWRunPerfTable's support is initialized here */ init_swrun_tbl(); init_swins_tbl(); HRDBG("done."); return (0); } /* * HOST RESOURCES mib module start operation * returns nothing */ static void hostres_start(void) { host_registration_id = or_register(&oid_host, "The MIB module for Host Resource MIB (RFC 2790).", hostres_module); start_device_tbl(hostres_module); start_processor_tbl(hostres_module); start_network_tbl(); HRDBG("done."); } /* this identifies the HOST RESOURCES mib module */ const struct snmp_module config = { "This module implements the host resource mib (rfc 2790)", hostres_init, hostres_fini, NULL, /* idle function, do not use it */ NULL, NULL, hostres_start, NULL, /* proxy a PDU */ hostres_ctree, /* see the generated hostres_tree.h */ hostres_CTREE_SIZE, /* see the generated hostres_tree.h */ NULL }; /** * Make an SNMP DateAndTime from a struct tm. This should be in the library. */ int make_date_time(u_char *str, const struct tm *tm, u_int decisecs) { str[0] = (u_char)((tm->tm_year + 1900) >> 8); str[1] = (u_char)(tm->tm_year + 1900); str[2] = tm->tm_mon + 1; str[3] = tm->tm_mday; str[4] = tm->tm_hour; str[5] = tm->tm_min; str[6] = tm->tm_sec; str[7] = decisecs; if (tm->tm_gmtoff < 0) str[8] = '-'; else str[8] = '+'; str[9] = (u_char)(labs(tm->tm_gmtoff) / 3600); str[10] = (u_char)((labs(tm->tm_gmtoff) % 3600) / 60); return (11); }
{ "content_hash": "2376586d23dbe3d0217dd3ef0fb60b0f", "timestamp": "", "source": "github", "line_count": 168, "max_line_length": 76, "avg_line_length": 20.345238095238095, "alnum_prop": 0.6454066705675834, "repo_name": "jrobhoward/SCADAbase", "id": "26bd9192076cc7915c7435c38c630161cbb4d551", "size": "5525", "binary": false, "copies": "3", "ref": "refs/heads/SCADAbase", "path": "usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "AGS Script", "bytes": "62471" }, { "name": "Assembly", "bytes": "4615704" }, { "name": "Awk", "bytes": "273794" }, { "name": "Batchfile", "bytes": "20333" }, { "name": "C", "bytes": "457666547" }, { "name": "C++", "bytes": "91495356" }, { "name": "CMake", "bytes": "17632" }, { "name": "CSS", "bytes": "104220" }, { "name": "ChucK", "bytes": "39" }, { "name": "D", "bytes": "6321" }, { "name": "DIGITAL Command Language", "bytes": "10638" }, { "name": "DTrace", "bytes": "1904158" }, { "name": "Emacs Lisp", "bytes": "32010" }, { "name": "EmberScript", "bytes": "286" }, { "name": "Forth", "bytes": "204603" }, { "name": "GAP", "bytes": "72078" }, { "name": "Groff", "bytes": "32376243" }, { "name": "HTML", "bytes": "5776268" }, { "name": "Haskell", "bytes": "2458" }, { "name": "IGOR Pro", "bytes": "6510" }, { "name": "Java", "bytes": "112547" }, { "name": "KRL", "bytes": "4950" }, { "name": "Lex", "bytes": "425858" }, { "name": "Limbo", "bytes": "4037" }, { "name": "Logos", "bytes": "179088" }, { "name": "Makefile", "bytes": "12750766" }, { "name": "Mathematica", "bytes": "21782" }, { "name": "Max", "bytes": "4105" }, { "name": "Module Management System", "bytes": "816" }, { "name": "Objective-C", "bytes": "1571960" }, { "name": "PHP", "bytes": "2471" }, { "name": "PLSQL", "bytes": "96552" }, { "name": "PLpgSQL", "bytes": "2212" }, { "name": "Perl", "bytes": "3947402" }, { "name": "Perl6", "bytes": "122803" }, { "name": "PostScript", "bytes": "152255" }, { "name": "Prolog", "bytes": "42792" }, { "name": "Protocol Buffer", "bytes": "54964" }, { "name": "Python", "bytes": "381066" }, { "name": "R", "bytes": "764" }, { "name": "Rebol", "bytes": "738" }, { "name": "Ruby", "bytes": "67015" }, { "name": "Scheme", "bytes": "5087" }, { "name": "Scilab", "bytes": "196" }, { "name": "Shell", "bytes": "10963470" }, { "name": "SourcePawn", "bytes": "2293" }, { "name": "SuperCollider", "bytes": "80208" }, { "name": "Tcl", "bytes": "7102" }, { "name": "TeX", "bytes": "720582" }, { "name": "VimL", "bytes": "19597" }, { "name": "XS", "bytes": "17496" }, { "name": "XSLT", "bytes": "4564" }, { "name": "Yacc", "bytes": "1881915" } ] }
<?php namespace WillFarrell\AlfredPkgMan; require_once('Cache.php'); require_once('Repo.php'); class Stpm extends Repo { protected $id = 'stpm'; protected $url = 'https://packagecontrol.io'; protected $search_url = 'https://packagecontrol.io/search/'; public function search($query) { if (!$this->hasMinQueryLength($query)) { return $this->xml(); } $data = $this->cache->get_query_regex( $this->id, $query, "{$this->search_url}{$query}", '/<ul class="packages results">([\s\S]*?)<\/ul>/i' ); $this->pkgs = explode('<li class="package">', $data[0]); array_shift($this->pkgs); foreach($this->pkgs as $pkg) { // make params preg_match('/<h3>([\s\S]*?)<\/h3>/i', $pkg, $matches); $title = trim(strip_tags($matches[1])); preg_match( '/<div class="description">([\s\S]*?)<\/div>/i', $pkg, $matches ); $description = html_entity_decode(trim(strip_tags($matches[1]))); preg_match('/<span class="author">([\s\S]*?)<\/span>/i', $pkg, $matches); $author = trim(strip_tags($matches[1])); // $version = trim(strip_tags($matches[1])); $this->cache->w->result( $title, $this->makeArg($title, "{$this->url}/packages/{$title}"), "{$title} ~ {$author}", // "v{$version}" $description, "icon-cache/{$this->id}.png" ); // only search till max return reached if ( count ( $this->cache->w->results() ) == $this->max_return ) { break; } } $this->noResults($query, "{$this->search_url}{$query}"); return $this->xml(); } } // Test code, uncomment to debug this script from the command-line // $repo = new Atom(); // echo $repo->search('q');
{ "content_hash": "3b88882e303dac3eb79cdf9dcbd058ec", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 76, "avg_line_length": 24.470588235294116, "alnum_prop": 0.5763221153846154, "repo_name": "karamfil/saphe", "id": "fe478359669547fee4d80ac54fcf733a2b97812e", "size": "1664", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "alfred/Alfred.alfredpreferences/workflows/user.workflow.A22B2EFC-621D-4524-B0D3-586DF3B2EA09/code/Stpm.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "21708" }, { "name": "Hack", "bytes": "4650" }, { "name": "JavaScript", "bytes": "3596" }, { "name": "Lua", "bytes": "20152" }, { "name": "PHP", "bytes": "289254" }, { "name": "Python", "bytes": "743663" }, { "name": "Shell", "bytes": "11438" } ] }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>squiggle-eq: Not compatible</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / extra-dev</a></li> <li class="active"><a href="">8.11.dev / squiggle-eq - 1.0.4</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> squiggle-eq <small> 1.0.4 <span class="label label-info">Not compatible</span> </small> </h1> <p><em><script>document.write(moment("2020-02-20 10:20:10 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2020-02-20 10:20:10 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-threads base base-unix base conf-findutils 1 Virtual package relying on findutils conf-m4 1 Virtual package relying on m4 coq 8.11.dev Formal proof management system num 1.3 The legacy Num library for arbitrary-precision integer and rational arithmetic ocaml 4.09.0 The OCaml compiler (virtual package) ocaml-base-compiler 4.09.0 Official release 4.09.0 ocaml-config 1 OCaml Switch Configuration ocamlfind 1.8.1 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;abhishek.anand.iitg@gmail.com&quot; homepage: &quot;https://github.com/aa755/SquiggleEq&quot; dev-repo: &quot;git+https://github.com/aa755/SquiggleEq&quot; authors: [&quot;Abhishek Anand&quot; &quot;Vincent Rahli&quot;] bug-reports: &quot;https://github.com/aa755/SquiggleEq/issues&quot; license: &quot;MIT&quot; build: [ [make &quot;-j%{jobs}%&quot;] ] install: [ [make &quot;install&quot;] ] remove: [&quot;rm&quot; &quot;-R&quot; &quot;%{lib}%/coq/user-contrib/SquiggleEq&quot;] depends: [ &quot;ocaml&quot; &quot;coq&quot; {&gt;= &quot;8.8&quot; &amp; &lt; &quot;8.9~&quot;} &quot;coq-ext-lib&quot; ] synopsis: &quot;An abstract formalization of variable bindings (both named and de-bruijn),&quot; description: &quot;&quot;&quot; based on ideas in the following paper: Howe, Douglas J. “Equality in Lazy Computation Systems.” In LICS, 198–203, 1989.&quot;&quot;&quot; flags: light-uninstall url { src: &quot;https://github.com/aa755/SquiggleEq/archive/v1.0.4.tar.gz&quot; checksum: &quot;md5=c0378498110aa30ea89d4f9df1ca3b77&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-squiggle-eq.1.0.4 coq.8.11.dev</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.11.dev). The following dependencies couldn&#39;t be met: - coq-squiggle-eq -&gt; coq &lt; 8.9~ -&gt; ocaml &lt; 4.06.0 base of this switch (use `--unlock-base&#39; to force) Your request can&#39;t be satisfied: - No available version of coq satisfies the constraints No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-squiggle-eq.1.0.4</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> <small>Sources are on <a href="https://github.com/coq-bench">GitHub</a>. © Guillaume Claret.</small> </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
{ "content_hash": "f85938eb2b462b9f164a3ff8c388b744", "timestamp": "", "source": "github", "line_count": 170, "max_line_length": 157, "avg_line_length": 40.088235294117645, "alnum_prop": 0.5386647101980925, "repo_name": "coq-bench/coq-bench.github.io", "id": "3f7dd9cef702e6cc27a1e12fc99fea7a7bd3ff4f", "size": "6823", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clean/Linux-x86_64-4.09.0-2.0.5/extra-dev/8.11.dev/squiggle-eq/1.0.4.html", "mode": "33188", "license": "mit", "language": [] }
/* * Do not modify this file. This file is generated from the iot-data-2015-05-28.normal.json service model. */ using System; using System.Collections.Generic; using System.Xml.Serialization; using System.Text; using System.IO; using Amazon.Runtime; using Amazon.Runtime.Internal; namespace Amazon.IotData.Model { /// <summary> /// Container for the parameters to the GetThingShadow operation. /// Gets the thing shadow for the specified thing. /// /// /// <para> /// For more information, see <a href="http://docs.aws.amazon.com/iot/latest/developerguide/API_GetThingShadow.html">GetThingShadow</a> /// in the <i>AWS IoT Developer Guide</i>. /// </para> /// </summary> public partial class GetThingShadowRequest : AmazonIotDataRequest { private string _thingName; /// <summary> /// Gets and sets the property ThingName. /// <para> /// The name of the thing. /// </para> /// </summary> public string ThingName { get { return this._thingName; } set { this._thingName = value; } } // Check to see if ThingName property is set internal bool IsSetThingName() { return this._thingName != null; } } }
{ "content_hash": "a3f634998f3e3410863b29ab5cc1071a", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 139, "avg_line_length": 26.14, "alnum_prop": 0.6052027543993879, "repo_name": "rafd123/aws-sdk-net", "id": "417e0d1a75304a63487dd1ba61e067b9ecf7f5b7", "size": "1894", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "sdk/src/Services/IotData/Generated/Model/GetThingShadowRequest.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C#", "bytes": "85386370" }, { "name": "CSS", "bytes": "18119" }, { "name": "HTML", "bytes": "24352" }, { "name": "JavaScript", "bytes": "6576" }, { "name": "PowerShell", "bytes": "12753" }, { "name": "XSLT", "bytes": "7010" } ] }
package org.jtwig.integration.issues; import com.google.common.collect.ImmutableMap; import org.jtwig.JtwigModel; import org.jtwig.JtwigTemplate; import org.junit.Test; import java.util.Map; import static org.hamcrest.core.Is.is; import static org.jtwig.environment.EnvironmentConfigurationBuilder.configuration; import static org.junit.Assert.assertThat; public class Issue303Test { @Test public void retrievingUsingGenericGetMethod() throws Exception { JtwigModel model = JtwigModel.newModel().with("bean", new TestBean( ImmutableMap.<String, String>builder() .put("a", "Hi") .build() )); String result = JtwigTemplate.inlineTemplate("{{ bean.a }}", configuration() .build()) .render(model); assertThat(result, is("Hi")); } public static class TestBean { private final Map<String, String> values; public TestBean(Map<String, String> values) { this.values = values; } public String get (String key) { return values.get(key); } } }
{ "content_hash": "866975363588ebc7ed7b6faa28d0f6ee", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 84, "avg_line_length": 28.121951219512194, "alnum_prop": 0.6253252385082394, "repo_name": "lyncodev/jtwig-core", "id": "1ce25fd3592ab60356f0297df27a09bf2bca0add", "size": "1153", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/test/java/org/jtwig/integration/issues/Issue303Test.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "1255" }, { "name": "Java", "bytes": "1169046" } ] }
package org.wso2.siddhi.core.util.extension.holder; import org.wso2.siddhi.core.config.ExecutionPlanContext; import org.wso2.siddhi.core.executor.function.FunctionExecutor; import org.wso2.siddhi.core.query.selector.attribute.aggregator.AttributeAggregator; import java.util.concurrent.ConcurrentHashMap; public class AttributeAggregatorExtensionHolder extends AbstractExtensionHolder { private static Class clazz =AttributeAggregator.class; private AttributeAggregatorExtensionHolder(ExecutionPlanContext executionPlanContext) { super(clazz, executionPlanContext); } public static AttributeAggregatorExtensionHolder getInstance(ExecutionPlanContext executionPlanContext) { ConcurrentHashMap<Class, AbstractExtensionHolder> extensionHolderMap = executionPlanContext.getSiddhiContext().getExtensionHolderMap(); AbstractExtensionHolder abstractExtensionHolder = extensionHolderMap.get(clazz); if (abstractExtensionHolder == null) { abstractExtensionHolder = new AttributeAggregatorExtensionHolder(executionPlanContext); extensionHolderMap.putIfAbsent(clazz, abstractExtensionHolder); } return (AttributeAggregatorExtensionHolder) extensionHolderMap.get(clazz); } }
{ "content_hash": "239c5614c50294fd9e0340423ece95dd", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 143, "avg_line_length": 48.5, "alnum_prop": 0.8057097541633624, "repo_name": "rajeev3001/siddhi", "id": "3d72ff33f2fa805299372d02088a5a22f405cbee", "size": "1934", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "modules/siddhi-core/src/main/java/org/wso2/siddhi/core/util/extension/holder/AttributeAggregatorExtensionHolder.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ANTLR", "bytes": "8961" }, { "name": "CSS", "bytes": "2652" }, { "name": "GAP", "bytes": "42178" }, { "name": "Java", "bytes": "2501687" } ] }
<!DOCTYPE html> <!--[if IE]><![endif]--> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <title>Class CSharpHostingBuilderExtensions </title> <meta name="viewport" content="width=device-width"> <meta name="title" content="Class CSharpHostingBuilderExtensions "> <meta name="generator" content="docfx 2.56.6.0"> <link rel="shortcut icon" href="../favicon.ico"> <link rel="stylesheet" href="../styles/docfx.vendor.css"> <link rel="stylesheet" href="../styles/docfx.css"> <link rel="stylesheet" href="../styles/main.css"> <meta property="docfx:navrel" content="../toc.html"> <meta property="docfx:tocrel" content="toc.html"> </head> <body data-spy="scroll" data-target="#affix" data-offset="120"> <div id="wrapper"> <header> <nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="../index.html"> <img id="logo" class="svg" src="../logo.svg" alt=""> </a> </div> <div class="collapse navbar-collapse" id="navbar"> <form class="navbar-form navbar-right" role="search" id="search"> <div class="form-group"> <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off"> </div> </form> </div> </div> </nav> <div class="subnav navbar navbar-default"> <div class="container hide-when-search" id="breadcrumb"> <ul class="breadcrumb"> <li></li> </ul> </div> </div> </header> <div role="main" class="container body-content hide-when-search"> <div class="sidenav hide-when-search"> <a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a> <div class="sidetoggle collapse" id="sidetoggle"> <div id="sidetoc"></div> </div> </div> <div class="article row grid-right"> <div class="col-md-10"> <article class="content wrap" id="_content" data-uid="ZptSharp.CSharpHostingBuilderExtensions"> <h1 id="ZptSharp_CSharpHostingBuilderExtensions" data-uid="ZptSharp.CSharpHostingBuilderExtensions" class="text-break">Class CSharpHostingBuilderExtensions </h1> <div class="markdown level0 summary"><p>Extension methods related to the use of ZPT Python expressions.</p> </div> <div class="markdown level0 conceptual"></div> <div class="inheritance"> <h5>Inheritance</h5> <div class="level0"><span class="xref">System.Object</span></div> <div class="level1"><span class="xref">CSharpHostingBuilderExtensions</span></div> </div> <div class="inheritedMembers"> <h5>Inherited Members</h5> <div> <span class="xref">System.Object.Equals(System.Object)</span> </div> <div> <span class="xref">System.Object.Equals(System.Object, System.Object)</span> </div> <div> <span class="xref">System.Object.GetHashCode()</span> </div> <div> <span class="xref">System.Object.GetType()</span> </div> <div> <span class="xref">System.Object.MemberwiseClone()</span> </div> <div> <span class="xref">System.Object.ReferenceEquals(System.Object, System.Object)</span> </div> <div> <span class="xref">System.Object.ToString()</span> </div> </div> <h6><strong>Namespace</strong>: <a class="xref" href="ZptSharp.html">ZptSharp</a></h6> <h6><strong>Assembly</strong>: ZptSharp.CSharpExpressions.dll</h6> <h5 id="ZptSharp_CSharpHostingBuilderExtensions_syntax">Syntax</h5> <div class="codewrapper"> <pre><code class="lang-csharp hljs">public static class CSharpHostingBuilderExtensions</code></pre> </div> <h3 id="methods">Methods </h3> <span class="small pull-right mobile-hide"> <span class="divider">|</span> <a href="https://github.com/csf-dev/ZPT-Sharp/new/master/apiSpec/new?filename=ZptSharp_CSharpHostingBuilderExtensions_AddZptCSharpExpressions_ZptSharp_Hosting_IBuildsHostingEnvironment_System_Action_ZptSharp_Expressions_CSharpExpressions_IConfiguresCSharpExpressionGlobals__.md&amp;value=---%0Auid%3A%20ZptSharp.CSharpHostingBuilderExtensions.AddZptCSharpExpressions(ZptSharp.Hosting.IBuildsHostingEnvironment%2CSystem.Action%7BZptSharp.Expressions.CSharpExpressions.IConfiguresCSharpExpressionGlobals%7D)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a> </span> <span class="small pull-right mobile-hide"> <a href="https://github.com/csf-dev/ZPT-Sharp/blob/master/Evaluators/ZptSharp.CSharpExpressions/CSharpHostingBuilderExtensions.cs/#L46">View Source</a> </span> <a id="ZptSharp_CSharpHostingBuilderExtensions_AddZptCSharpExpressions_" data-uid="ZptSharp.CSharpHostingBuilderExtensions.AddZptCSharpExpressions*"></a> <h4 id="ZptSharp_CSharpHostingBuilderExtensions_AddZptCSharpExpressions_ZptSharp_Hosting_IBuildsHostingEnvironment_System_Action_ZptSharp_Expressions_CSharpExpressions_IConfiguresCSharpExpressionGlobals__" data-uid="ZptSharp.CSharpHostingBuilderExtensions.AddZptCSharpExpressions(ZptSharp.Hosting.IBuildsHostingEnvironment,System.Action{ZptSharp.Expressions.CSharpExpressions.IConfiguresCSharpExpressionGlobals})">AddZptCSharpExpressions(IBuildsHostingEnvironment, Action&lt;IConfiguresCSharpExpressionGlobals&gt;)</h4> <div class="markdown level1 summary"><p>Adds service registrations to the <code data-dev-comment-type="paramref" class="paramref">builder</code> in order to enable the use of ZPT &quot;csharp&quot; expressions.</p> </div> <div class="markdown level1 conceptual"></div> <h5 class="decalaration">Declaration</h5> <div class="codewrapper"> <pre><code class="lang-csharp hljs">public static IBuildsHostingEnvironment AddZptCSharpExpressions(this IBuildsHostingEnvironment builder, Action&lt;IConfiguresCSharpExpressionGlobals&gt; configAction = null)</code></pre> </div> <h5 class="parameters">Parameters</h5> <table class="table table-bordered table-striped table-condensed"> <thead> <tr> <th>Type</th> <th>Name</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><a class="xref" href="ZptSharp.Hosting.IBuildsHostingEnvironment.html">IBuildsHostingEnvironment</a></td> <td><span class="parametername">builder</span></td> <td><p>The self-hosting builder.</p> </td> </tr> <tr> <td><span class="xref">System.Action</span>&lt;<a class="xref" href="ZptSharp.Expressions.CSharpExpressions.IConfiguresCSharpExpressionGlobals.html">IConfiguresCSharpExpressionGlobals</a>&gt;</td> <td><span class="parametername">configAction</span></td> <td><p>An optional action permitting some global configuration of the C# expression evaluation.</p> </td> </tr> </tbody> </table> <h5 class="returns">Returns</h5> <table class="table table-bordered table-striped table-condensed"> <thead> <tr> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><a class="xref" href="ZptSharp.Hosting.IBuildsHostingEnvironment.html">IBuildsHostingEnvironment</a></td> <td><p>The self-hosting builder instance, after setting it up.</p> </td> </tr> </tbody> </table> <h5 id="ZptSharp_CSharpHostingBuilderExtensions_AddZptCSharpExpressions_ZptSharp_Hosting_IBuildsHostingEnvironment_System_Action_ZptSharp_Expressions_CSharpExpressions_IConfiguresCSharpExpressionGlobals___remarks">Remarks</h5> <div class="markdown level1 remarks"><p> As well as the primary &quot;csharp&quot; expression, there are three other expression types which are activated by this method. In total, the expression evaluators registered by this type are: </p> <ul><li><a class="xref" href="ZptSharp.Expressions.CSharpExpressions.AssemblyReferenceEvaluator.html">AssemblyReferenceEvaluator</a> using the prefix <code>assemblyref</code></li><li><a class="xref" href="ZptSharp.Expressions.CSharpExpressions.UsingNamespaceEvaluator.html">UsingNamespaceEvaluator</a> using the prefix <code>using</code></li><li><a class="xref" href="ZptSharp.Expressions.CSharpExpressions.VariableTypeEvaluator.html">VariableTypeEvaluator</a> using the prefix <code>type</code></li><li><a class="xref" href="ZptSharp.Expressions.CSharpExpressions.CSharpExpressionEvaluator.html">CSharpExpressionEvaluator</a> using the prefix <code>csharp</code></li></ul> <p> Additionally, an optional configuration action/callback may be supplied. If used, the <a class="xref" href="ZptSharp.Expressions.CSharpExpressions.IConfiguresCSharpExpressionGlobals.html">IConfiguresCSharpExpressionGlobals</a> may be used to add-to the lists of assembly references and &apos;using&apos; namespaces which are available to all &quot;csharp&quot; expressions, whether they have been added explicitly via &quot;assemblyref&quot; or &quot;using&quot; expressions or not. </p> </div> </article> </div> <div class="hidden-sm col-md-2" role="complementary"> <div class="sideaffix"> <div class="contribution"> <ul class="nav"> <li> <a href="https://github.com/csf-dev/ZPT-Sharp/new/master/apiSpec/new?filename=ZptSharp_CSharpHostingBuilderExtensions.md&amp;value=---%0Auid%3A%20ZptSharp.CSharpHostingBuilderExtensions%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A" class="contribution-link">Improve this Doc</a> </li> <li> <a href="https://github.com/csf-dev/ZPT-Sharp/blob/master/Evaluators/ZptSharp.CSharpExpressions/CSharpHostingBuilderExtensions.cs/#L11" class="contribution-link">View Source</a> </li> </ul> </div> <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix"> <h5>In This Article</h5> <div></div> </nav> </div> </div> </div> </div> <footer> <div class="grad-bottom"></div> <div class="footer"> <div class="container"> <span class="pull-right"> <a href="#top">Back to top</a> </span> <span>Generated by <strong>DocFX</strong></span> </div> </div> </footer> </div> <script type="text/javascript" src="../styles/docfx.vendor.js"></script> <script type="text/javascript" src="../styles/docfx.js"></script> <script type="text/javascript" src="../styles/main.js"></script> </body> </html>
{ "content_hash": "d764b08ca1ca39684f1303e0bbd336fe", "timestamp": "", "source": "github", "line_count": 228, "max_line_length": 721, "avg_line_length": 51.026315789473685, "alnum_prop": 0.6667526216262678, "repo_name": "csf-dev/ZPT-Sharp", "id": "c1d895e0009634c6abba579a49a7ac5d82bee3f0", "size": "11636", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/_vnext/api/ZptSharp.CSharpHostingBuilderExtensions.html", "mode": "33188", "license": "mit", "language": [ { "name": "AMPL", "bytes": "4949" }, { "name": "Batchfile", "bytes": "3142" }, { "name": "C#", "bytes": "1670750" }, { "name": "HTML", "bytes": "146448" }, { "name": "PowerShell", "bytes": "2416" } ] }
package org.projectfloodlight.openflow.protocol.action; import org.projectfloodlight.openflow.protocol.*; import org.projectfloodlight.openflow.protocol.action.*; import org.projectfloodlight.openflow.protocol.actionid.*; import org.projectfloodlight.openflow.protocol.bsntlv.*; import org.projectfloodlight.openflow.protocol.errormsg.*; import org.projectfloodlight.openflow.protocol.meterband.*; import org.projectfloodlight.openflow.protocol.instruction.*; import org.projectfloodlight.openflow.protocol.instructionid.*; import org.projectfloodlight.openflow.protocol.match.*; import org.projectfloodlight.openflow.protocol.stat.*; import org.projectfloodlight.openflow.protocol.oxm.*; import org.projectfloodlight.openflow.protocol.oxs.*; import org.projectfloodlight.openflow.protocol.queueprop.*; import org.projectfloodlight.openflow.types.*; import org.projectfloodlight.openflow.util.*; import org.projectfloodlight.openflow.exceptions.*; import java.util.Set; import io.netty.buffer.ByteBuf; public interface OFActionSetNwTos extends OFObject, OFAction { OFActionType getType(); short getNwTos(); OFVersion getVersion(); void writeTo(ByteBuf channelBuffer); Builder createBuilder(); public interface Builder extends OFAction.Builder { OFActionSetNwTos build(); OFActionType getType(); short getNwTos(); Builder setNwTos(short nwTos); OFVersion getVersion(); } }
{ "content_hash": "40726ffac987330f2da366466bf0f9b3", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 63, "avg_line_length": 39.027027027027025, "alnum_prop": 0.7901662049861495, "repo_name": "floodlight/loxigen-artifacts", "id": "669cc6bd9216c72f3658c724135083035321fd72", "size": "1866", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "openflowj/gen-src/main/java/org/projectfloodlight/openflow/protocol/action/OFActionSetNwTos.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "35578218" }, { "name": "Java", "bytes": "38904773" }, { "name": "Lua", "bytes": "4231428" }, { "name": "Makefile", "bytes": "478" }, { "name": "Python", "bytes": "12126309" } ] }
module Superenv extend T::Sig class << self undef bin # @private def bin return unless DevelopmentTools.installed? (HOMEBREW_SHIMS_PATH/"mac/super").realpath end end alias x11? x11 undef homebrew_extra_paths, homebrew_extra_pkg_config_paths, homebrew_extra_aclocal_paths, homebrew_extra_isystem_paths, homebrew_extra_library_paths, homebrew_extra_cmake_include_paths, homebrew_extra_cmake_library_paths, homebrew_extra_cmake_frameworks_paths, determine_cccfg, set_x11_env_if_installed def homebrew_extra_paths paths = [] paths << MacOS::XQuartz.bin.to_s if x11? paths end # @private def homebrew_extra_pkg_config_paths paths = \ ["/usr/lib/pkgconfig", "#{HOMEBREW_LIBRARY}/Homebrew/os/mac/pkgconfig/#{MacOS.version}"] paths << "#{MacOS::XQuartz.lib}/pkgconfig" << "#{MacOS::XQuartz.share}/pkgconfig" if x11? paths end def homebrew_extra_aclocal_paths paths = [] paths << "#{MacOS::XQuartz.share}/aclocal" if x11? paths end # @private sig { returns(T::Boolean) } def libxml2_include_needed? return false if deps.any? { |d| d.name == "libxml2" } return false if Pathname("#{self["HOMEBREW_SDKROOT"]}/usr/include/libxml").directory? true end def homebrew_extra_isystem_paths paths = [] paths << "#{self["HOMEBREW_SDKROOT"]}/usr/include/libxml2" if libxml2_include_needed? paths << "#{self["HOMEBREW_SDKROOT"]}/usr/include/apache2" if MacOS::Xcode.without_clt? paths << MacOS::XQuartz.include.to_s << "#{MacOS::XQuartz.include}/freetype2" if x11? paths << "#{self["HOMEBREW_SDKROOT"]}/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers" paths end def homebrew_extra_library_paths paths = [] if compiler == :llvm_clang paths << "#{self["HOMEBREW_SDKROOT"]}/usr/lib" paths << Formula["llvm"].opt_lib.to_s end paths << MacOS::XQuartz.lib.to_s if x11? paths << "#{self["HOMEBREW_SDKROOT"]}/System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries" paths end def homebrew_extra_cmake_include_paths paths = [] paths << "#{self["HOMEBREW_SDKROOT"]}/usr/include/libxml2" if libxml2_include_needed? paths << "#{self["HOMEBREW_SDKROOT"]}/usr/include/apache2" if MacOS::Xcode.without_clt? paths << MacOS::XQuartz.include.to_s << "#{MacOS::XQuartz.include}/freetype2" if x11? paths << "#{self["HOMEBREW_SDKROOT"]}/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers" paths end def homebrew_extra_cmake_library_paths paths = [] paths << MacOS::XQuartz.lib.to_s if x11? paths << "#{self["HOMEBREW_SDKROOT"]}/System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries" paths end def homebrew_extra_cmake_frameworks_paths paths = [] paths << "#{self["HOMEBREW_SDKROOT"]}/System/Library/Frameworks" if MacOS::Xcode.without_clt? paths end def determine_cccfg s = +"" # Fix issue with sed barfing on unicode characters on Mountain Lion s << "s" # Fix issue with >= Mountain Lion apr-1-config having broken paths s << "a" s.freeze end def set_x11_env_if_installed ENV.x11 = MacOS::XQuartz.installed? end # @private def setup_build_environment(**options) formula = options[:formula] sdk = formula ? MacOS.sdk_for_formula(formula) : MacOS.sdk if MacOS.sdk_root_needed? || sdk&.source == :xcode Homebrew::Diagnostic.checks(:fatal_setup_build_environment_checks) self["HOMEBREW_SDKROOT"] = sdk.path self["HOMEBREW_DEVELOPER_DIR"] = if sdk.source == :xcode MacOS::Xcode.prefix else MacOS::CLT::PKG_PATH end else self["HOMEBREW_SDKROOT"] = nil self["HOMEBREW_DEVELOPER_DIR"] = nil end generic_setup_build_environment(**options) # Filter out symbols known not to be defined since GNU Autotools can't # reliably figure this out with Xcode 8 and above. if MacOS.version == "10.12" && MacOS::Xcode.version >= "9.0" %w[fmemopen futimens open_memstream utimensat].each do |s| ENV["ac_cv_func_#{s}"] = "no" end elsif MacOS.version == "10.11" && MacOS::Xcode.version >= "8.0" %w[basename_r clock_getres clock_gettime clock_settime dirname_r getentropy mkostemp mkostemps timingsafe_bcmp].each do |s| ENV["ac_cv_func_#{s}"] = "no" end ENV["ac_cv_search_clock_gettime"] = "no" # works around libev.m4 unsetting ac_cv_func_clock_gettime ENV["ac_have_clock_syscall"] = "no" end # The tools in /usr/bin proxy to the active developer directory. # This means we can use them for any combination of CLT and Xcode. self["HOMEBREW_PREFER_CLT_PROXIES"] = "1" end def no_weak_imports append_to_cccfg "w" if no_weak_imports_support? end end
{ "content_hash": "a4b1d66c45d62d43b71ab9008a28fc1f", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 112, "avg_line_length": 31.792207792207794, "alnum_prop": 0.6568627450980392, "repo_name": "reitermarkus/brew", "id": "4e541a2be95bc26f7230333fdd5987d3d678e2c3", "size": "4942", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Library/Homebrew/extend/os/mac/extend/ENV/super.rb", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "Dockerfile", "bytes": "1698" }, { "name": "HTML", "bytes": "4747" }, { "name": "PostScript", "bytes": "485" }, { "name": "Roff", "bytes": "86161" }, { "name": "Ruby", "bytes": "4278673" }, { "name": "Shell", "bytes": "129814" }, { "name": "Swift", "bytes": "1788" } ] }
class Chef module Rbenv module RecipeHelpers def build_upgrade_strategy(strategy) if strategy.nil? || strategy == false 'none' else strategy end end def mac_with_no_homebrew node['platform'] == 'mac_os_x' && Chef::Platform.find_provider_for_node(node, :package) != Chef::Provider::Package::Homebrew end def install_rbenv_pkg_prereqs return if mac_with_no_homebrew package node['rbenv']['install_pkgs'] end def install_or_upgrade_rbenv(opts = {}) git_deploy_rbenv opts initialize_rbenv opts add_rbenv_to_path end private def git_deploy_rbenv(opts) if opts[:upgrade_strategy] == 'none' git_exec_action = :checkout else git_exec_action = :sync end git opts[:rbenv_prefix] do repository opts[:git_url] reference opts[:git_ref] user opts[:user] if opts[:user] group opts[:group] if opts[:group] action git_exec_action end directory "#{opts[:rbenv_prefix]}/plugins" do owner opts[:user].nil? ? 'root' : opts[:user] mode '0755' end Array(opts[:rbenv_plugins]).each do |plugin| revision = plugin['revision'].nil? ? 'master' : plugin['revision'] plugin_path = "#{opts[:rbenv_prefix]}/plugins/#{plugin['name']}" git "Install rbenv plugin - #{plugin['name']}" do repository plugin['git_url'] destination plugin_path reference revision user opts[:user] if opts[:user] group opts[:group] if opts[:group] action :sync end log "Installed rbenv plugin - #{plugin['name']}" end end def initialize_rbenv(opts) prefix = opts[:rbenv_prefix] if opts[:user] init_env = { 'USER' => opts[:user], 'HOME' => opts[:home_dir] } else init_env = {} end bash "Initialize rbenv (#{opts[:user] || 'system'})" do code %(PATH="#{prefix}/bin:$PATH" rbenv init -) environment({ 'RBENV_ROOT' => prefix }.merge(init_env)) user opts[:user] if opts[:user] group opts[:group] if opts[:group] end log "rbenv-post-init-#{opts[:user] || 'system'}" end def add_rbenv_to_path ruby_block 'Add rbenv to PATH' do block do rbenv_root = node['rbenv']['root_path'] ENV['PATH'] = "#{rbenv_root}/shims:#{rbenv_root}/bin:#{ENV['PATH']}" end end end end end end
{ "content_hash": "2c61b722b90229a05a79ae75f9219fbb", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 80, "avg_line_length": 27.79381443298969, "alnum_prop": 0.526706231454006, "repo_name": "pollosp/ruby_rbenv", "id": "99b557a43d70e00b5fc458a2c938d9024f539ad8", "size": "3404", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "libraries/chef_rbenv_recipe_helpers.rb", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "441" }, { "name": "Ruby", "bytes": "56076" }, { "name": "Shell", "bytes": "2139" } ] }
<?xml version="1.0" encoding="utf-8"?> <resources> <dimen name="tool_bar_top_padding">24dp</dimen> <dimen name="tool_bar_top_padding_inv">-26dp</dimen> <dimen name="tool_bar_top_padding_inv_inv">0dp</dimen> </resources>
{ "content_hash": "55fa3034a092d77df5cba591cd013681", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 58, "avg_line_length": 33.142857142857146, "alnum_prop": 0.6681034482758621, "repo_name": "LinkofHyrule89/Play-", "id": "c02a68b49c7b773b647fdb5ad6009e92b3b71915", "size": "232", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "build_android/res/values-v21/dimens.xml", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "Assembly", "bytes": "224" }, { "name": "Batchfile", "bytes": "321" }, { "name": "C", "bytes": "8945" }, { "name": "C++", "bytes": "2093399" }, { "name": "FLUX", "bytes": "1596" }, { "name": "HTML", "bytes": "15288" }, { "name": "Java", "bytes": "95555" }, { "name": "Makefile", "bytes": "7581" }, { "name": "NSIS", "bytes": "9305" }, { "name": "Objective-C", "bytes": "3584" }, { "name": "Objective-C++", "bytes": "18269" }, { "name": "Shell", "bytes": "541" } ] }
[![NPM version](https://img.shields.io/npm/v/clean-css.svg?style=flat)](https://www.npmjs.com/package/clean-css) [![Linux Build Status](https://img.shields.io/travis/jakubpawlowicz/clean-css/master.svg?style=flat&label=Linux%20build)](https://travis-ci.org/jakubpawlowicz/clean-css) [![Windows Build status](https://img.shields.io/appveyor/ci/jakubpawlowicz/clean-css/master.svg?style=flat&label=Windows%20build)](https://ci.appveyor.com/project/jakubpawlowicz/clean-css/branch/master) [![Dependency Status](https://img.shields.io/david/jakubpawlowicz/clean-css.svg?style=flat)](https://david-dm.org/jakubpawlowicz/clean-css) [![devDependency Status](https://img.shields.io/david/dev/jakubpawlowicz/clean-css.svg?style=flat)](https://david-dm.org/jakubpawlowicz/clean-css#info=devDependencies) ## What is clean-css? Clean-css is a fast and efficient [Node.js](http://nodejs.org/) library for minifying CSS files. According to [tests](http://goalsmashers.github.io/css-minification-benchmark/) it is one of the best available. ## Usage ### What are the requirements? ``` Node.js 4.0+ (tested on CentOS, Ubuntu, OS X, and Windows) ``` ### How to install clean-css? ``` npm install clean-css ``` ### How to use clean-css CLI? Clean-css accepts the following command line arguments (please make sure you use `<source-file>` as the very last argument to avoid potential issues): ``` cleancss [options] source-file, [source-file, ...] -h, --help output usage information -v, --version output the version number -b, --keep-line-breaks Keep line breaks -c, --compatibility [ie7|ie8] Force compatibility mode (see Readme for advanced examples) -d, --debug Shows debug information (minification time & compression efficiency) -o, --output [output-file] Use [output-file] as output instead of STDOUT -r, --root [root-path] Set a root path to which resolve absolute @import rules -s, --skip-import Disable @import processing -t, --timeout [seconds] Per connection timeout when fetching remote @imports (defaults to 5 seconds) --rounding-precision [n] Rounds to `N` decimal places. Defaults to 2. -1 disables rounding --s0 Remove all special comments, i.e. /*! comment */ --s1 Remove all special comments but the first one --semantic-merging Enables unsafe mode by assuming BEM-like semantic stylesheets (warning, this may break your styling!) --skip-advanced Disable advanced optimizations - ruleset reordering & merging --skip-aggressive-merging Disable properties merging based on their order --skip-import-from [rules] Disable @import processing for specified rules --skip-media-merging Disable @media merging --skip-rebase Disable URLs rebasing --skip-restructuring Disable restructuring optimizations --skip-shorthand-compacting Disable shorthand compacting --source-map Enables building input's source map --source-map-inline-sources Enables inlining sources inside source maps ``` #### Examples: To minify a **public.css** file into **public-min.css** do: ``` cleancss -o public-min.css public.css ``` To minify the same **public.css** into the standard output skip the `-o` parameter: ``` cleancss public.css ``` More likely you would like to concatenate a couple of files. If you are on a Unix-like system: ```bash cat one.css two.css three.css | cleancss -o merged-and-minified.css ``` On Windows: ```bat type one.css two.css three.css | cleancss -o merged-and-minified.css ``` Or even gzip the result at once: ```bash cat one.css two.css three.css | cleancss | gzip -9 -c > merged-minified-and-gzipped.css.gz ``` ### How to use clean-css API? ```js var CleanCSS = require('clean-css'); var source = 'a{font-weight:bold;}'; var minified = new CleanCSS().minify(source).styles; ``` CleanCSS constructor accepts a hash as a parameter, i.e., `new CleanCSS(options)` with the following options available: * `advanced` - set to false to disable advanced optimizations - selector & property merging, reduction, etc. * `aggressiveMerging` - set to false to disable aggressive merging of properties. * `benchmark` - turns on benchmarking mode measuring time spent on cleaning up (run `npm run bench` to see example) * `compatibility` - enables compatibility mode, see [below for more examples](#how-to-set-compatibility-mode) * `debug` - set to true to get minification statistics under `stats` property (see `test/custom-test.js` for examples) * `inliner` - a hash of options for `@import` inliner, see [test/protocol-imports-test.js](https://github.com/jakubpawlowicz/clean-css/blob/master/test/protocol-imports-test.js#L372) for examples, or [this comment](https://github.com/jakubpawlowicz/clean-css/issues/612#issuecomment-119594185) for a proxy use case. * `keepBreaks` - whether to keep line breaks (default is false) * `keepSpecialComments` - `*` for keeping all (default), `1` for keeping first one only, `0` for removing all * `mediaMerging` - whether to merge `@media` at-rules (default is true) * `processImport` - whether to process `@import` rules * `processImportFrom` - a list of `@import` rules, can be `['all']` (default), `['local']`, `['remote']`, or a blacklisted path e.g. `['!fonts.googleapis.com']` * `rebase` - set to false to skip URL rebasing * `relativeTo` - path to **resolve** relative `@import` rules and URLs * `restructuring` - set to false to disable restructuring in advanced optimizations * `root` - path to **resolve** absolute `@import` rules and **rebase** relative URLs * `roundingPrecision` - rounding precision; defaults to `2`; `-1` disables rounding * `semanticMerging` - set to true to enable semantic merging mode which assumes BEM-like content (default is false as it's highly likely this will break your stylesheets - **use with caution**!) * `shorthandCompacting` - set to false to skip shorthand compacting (default is true unless sourceMap is set when it's false) * `sourceMap` - exposes source map under `sourceMap` property, e.g. `new CleanCSS().minify(source).sourceMap` (default is false) If input styles are a product of CSS preprocessor (Less, Sass) an input source map can be passed as a string. * `sourceMapInlineSources` - set to true to inline sources inside a source map's `sourcesContent` field (defaults to false) It is also required to process inlined sources from input source maps. * `target` - path to a folder or an output file to which **rebase** all URLs The output of `minify` method (or the 2nd argument to passed callback) is a hash containing the following fields: * `styles` - optimized output CSS as a string * `sourceMap` - output source map (if requested with `sourceMap` option) * `errors` - a list of errors raised * `warnings` - a list of warnings raised * `stats` - a hash of statistic information (if requested with `debug` option): * `originalSize` - original content size (after import inlining) * `minifiedSize` - optimized content size * `timeSpent` - time spent on optimizations * `efficiency` - a ratio of output size to input size (e.g. 25% if content was reduced from 100 bytes to 75 bytes) #### How to make sure remote `@import`s are processed correctly? In order to inline remote `@import` statements you need to provide a callback to minify method, e.g.: ```js var CleanCSS = require('clean-css'); var source = '@import url(http://path/to/remote/styles);'; new CleanCSS().minify(source, function (error, minified) { // minified.styles }); ``` This is due to a fact, that, while local files can be read synchronously, remote resources can only be processed asynchronously. If you don't provide a callback, then remote `@import`s will be left intact. ### How to use clean-css with build tools? * [Broccoli](https://github.com/broccolijs/broccoli#broccoli): [broccoli-clean-css](https://github.com/shinnn/broccoli-clean-css) * [Brunch](http://brunch.io/): [clean-css-brunch](https://github.com/brunch/clean-css-brunch) * [Grunt](http://gruntjs.com): [grunt-contrib-cssmin](https://github.com/gruntjs/grunt-contrib-cssmin) * [Gulp](http://gulpjs.com/): [gulp-minify-css](https://github.com/jonathanepollack/gulp-minify-css) * [Gulp](http://gulpjs.com/): [using vinyl-map as a wrapper - courtesy of @sogko](https://github.com/jakubpawlowicz/clean-css/issues/342) * [component-builder2](https://github.com/component/builder2.js): [builder-clean-css](https://github.com/poying/builder-clean-css) * [Metalsmith](http://metalsmith.io): [metalsmith-clean-css](https://github.com/aymericbeaumet/metalsmith-clean-css) * [Lasso](https://github.com/lasso-js/lasso): [lasso-clean-css](https://github.com/yomed/lasso-clean-css) ### What are the clean-css' dev commands? First clone the source, then run: * `npm run bench` for clean-css benchmarks (see [test/bench.js](https://github.com/jakubpawlowicz/clean-css/blob/master/test/bench.js) for details) * `npm run browserify` to create the browser-ready clean-css version * `npm run check` to check JS sources with [JSHint](https://github.com/jshint/jshint/) * `npm test` for the test suite ## How to contribute to clean-css? See [CONTRIBUTING.md](https://github.com/jakubpawlowicz/clean-css/blob/master/CONTRIBUTING.md). ## Tips & Tricks ### How to preserve a comment block? Use the `/*!` notation instead of the standard one `/*`: ```css /*! Important comments included in minified output. */ ``` ### How to rebase relative image URLs? Clean-css will handle it automatically for you (since version 1.1) in the following cases: * When using the CLI: 1. Use an output path via `-o`/`--output` to rebase URLs as relative to the output file. 2. Use a root path via `-r`/`--root` to rebase URLs as absolute from the given root path. 3. If you specify both then `-r`/`--root` takes precedence. * When using clean-css as a library: 1. Use a combination of `relativeTo` and `target` options for relative rebase (same as 1 in CLI). 2. Use a combination of `relativeTo` and `root` options for absolute rebase (same as 2 in CLI). 3. `root` takes precedence over `target` as in CLI. ### How to generate source maps? Source maps are supported since version 3.0. Additionally to mapping original CSS files, clean-css also supports input source maps, so minified styles can be mapped into their [Less](http://lesscss.org/) or [Sass](http://sass-lang.com/) sources directly. Source maps are generated using [source-map](https://github.com/mozilla/source-map/) module from Mozilla. #### Using CLI To generate a source map, use `--source-map` switch, e.g.: ``` cleancss --source-map --output styles.min.css styles.css ``` Name of the output file is required, so a map file, named by adding `.map` suffix to output file name, can be created (styles.min.css.map in this case). #### Using API To generate a source map, use `sourceMap: true` option, e.g.: ```js new CleanCSS({ sourceMap: true, target: pathToOutputDirectory }) .minify(source, function (error, minified) { // access minified.sourceMap for SourceMapGenerator object // see https://github.com/mozilla/source-map/#sourcemapgenerator for more details // see https://github.com/jakubpawlowicz/clean-css/blob/master/bin/cleancss#L114 on how it's used in clean-css' CLI }); ``` Using API you can also pass an input source map directly: ```js new CleanCSS({ sourceMap: inputSourceMapAsString, target: pathToOutputDirectory }) .minify(source, function (error, minified) { // access minified.sourceMap to access SourceMapGenerator object // see https://github.com/mozilla/source-map/#sourcemapgenerator for more details // see https://github.com/jakubpawlowicz/clean-css/blob/master/bin/cleancss#L114 on how it's used in clean-css' CLI }); ``` Or even multiple input source maps at once (available since version 3.1): ```js new CleanCSS({ sourceMap: true, target: pathToOutputDirectory }).minify({ 'path/to/source/1': { styles: '...styles...', sourceMap: '...source-map...' }, 'path/to/source/2': { styles: '...styles...', sourceMap: '...source-map...' } }, function (error, minified) { // access minified.sourceMap as above }); ``` ### How to minify multiple files with API? #### Passing an array ```js new CleanCSS().minify(['path/to/file/one', 'path/to/file/two']); ``` #### Passing a hash ```js new CleanCSS().minify({ 'path/to/file/one': { styles: 'contents of file one' }, 'path/to/file/two': { styles: 'contents of file two' } }); ``` ### How to set a compatibility mode? Compatibility settings are controlled by `--compatibility` switch (CLI) and `compatibility` option (library mode). In both modes the following values are allowed: * `'ie7'` - Internet Explorer 7 compatibility mode * `'ie8'` - Internet Explorer 8 compatibility mode * `''` or `'*'` (default) - Internet Explorer 9+ compatibility mode Since clean-css 3 a fine grained control is available over [those settings](https://github.com/jakubpawlowicz/clean-css/blob/master/lib/utils/compatibility.js), with the following options available: * `'[+-]colors.opacity'` - - turn on (+) / off (-) `rgba()` / `hsla()` declarations removal * `'[+-]properties.backgroundClipMerging'` - turn on / off background-clip merging into shorthand * `'[+-]properties.backgroundOriginMerging'` - turn on / off background-origin merging into shorthand * `'[+-]properties.backgroundSizeMerging'` - turn on / off background-size merging into shorthand * `'[+-]properties.colors'` - turn on / off any color optimizations * `'[+-]properties.ieBangHack'` - turn on / off IE bang hack removal * `'[+-]properties.iePrefixHack'` - turn on / off IE prefix hack removal * `'[+-]properties.ieSuffixHack'` - turn on / off IE suffix hack removal * `'[+-]properties.merging'` - turn on / off property merging based on understandability * `'[+-]properties.shorterLengthUnits'` - turn on / off shortening pixel units into `pc`, `pt`, or `in` units * `'[+-]properties.spaceAfterClosingBrace'` - turn on / off removing space after closing brace - `url() no-repeat` into `url()no-repeat` * `'[+-]properties.urlQuotes'` - turn on / off `url()` quoting * `'[+-]properties.zeroUnits'` - turn on / off units removal after a `0` value * `'[+-]selectors.adjacentSpace'` - turn on / off extra space before `nav` element * `'[+-]selectors.ie7Hack'` - turn on / off IE7 selector hack removal (`*+html...`) * `'[+-]selectors.special'` - a regular expression with all special, unmergeable selectors (leave it empty unless you know what you are doing) * `'[+-]units.ch'` - turn on / off treating `ch` as a proper unit * `'[+-]units.in'` - turn on / off treating `in` as a proper unit * `'[+-]units.pc'` - turn on / off treating `pc` as a proper unit * `'[+-]units.pt'` - turn on / off treating `pt` as a proper unit * `'[+-]units.rem'` - turn on / off treating `rem` as a proper unit * `'[+-]units.vh'` - turn on / off treating `vh` as a proper unit * `'[+-]units.vm'` - turn on / off treating `vm` as a proper unit * `'[+-]units.vmax'` - turn on / off treating `vmax` as a proper unit * `'[+-]units.vmin'` - turn on / off treating `vmin` as a proper unit For example, using `--compatibility 'ie8,+units.rem'` will ensure IE8 compatibility while enabling `rem` units so the following style `margin:0px 0rem` can be shortened to `margin:0`, while in pure IE8 mode it can't be. To pass a single off (-) switch in CLI please use the following syntax `--compatibility *,-units.rem`. In library mode you can also pass `compatibility` as a hash of options. ### What advanced optimizations are applied? All advanced optimizations are dispatched [here](https://github.com/jakubpawlowicz/clean-css/blob/master/lib/selectors/advanced.js#L59), and this is what they do: * `recursivelyOptimizeBlocks` - does all the following operations on a block (think `@media` or `@keyframe` at-rules); * `recursivelyOptimizeProperties` - optimizes properties in rulesets and "flat at-rules" (like @font-face) by splitting them into components (e.g. `margin` into `margin-(*)`), optimizing, and rebuilding them back. You may want to use `shorthandCompacting` option to control whether you want to turn multiple (long-hand) properties into a shorthand ones; * `removeDuplicates` - gets rid of duplicate rulesets with exactly the same set of properties (think of including the same Sass / Less partial twice for no good reason); * `mergeAdjacent` - merges adjacent rulesets with the same selector or rules; * `reduceNonAdjacent` - identifies which properties are overridden in same-selector non-adjacent rulesets, and removes them; * `mergeNonAdjacentBySelector` - identifies same-selector non-adjacent rulesets which can be moved (!) to be merged, requires all intermediate rulesets to not redefine the moved properties, or if redefined to be either more coarse grained (e.g. `margin` vs `margin-top`) or have the same value; * `mergeNonAdjacentByBody` - same as the one above but for same-rules non-adjacent rulesets; * `restructure` - tries to reorganize different-selector different-rules rulesets so they take less space, e.g. `.one{padding:0}.two{margin:0}.one{margin-bottom:3px}` into `.two{margin:0}.one{padding:0;margin-bottom:3px}`; * `removeDuplicateMediaQueries` - removes duplicated `@media` at-rules; * `mergeMediaQueries` - merges non-adjacent `@media` at-rules by same rules as `mergeNonAdjacentBy*` above; ## Acknowledgments (sorted alphabetically) * Anthony Barre ([@abarre](https://github.com/abarre)) for improvements to `@import` processing, namely introducing the `--skip-import` / `processImport` options. * Simon Altschuler ([@altschuler](https://github.com/altschuler)) for fixing `@import` processing inside comments. * Isaac ([@facelessuser](https://github.com/facelessuser)) for pointing out a flaw in clean-css' stateless mode. * Jan Michael Alonzo ([@jmalonzo](https://github.com/jmalonzo)) for a patch removing node.js' old `sys` package. * Luke Page ([@lukeapage](https://github.com/lukeapage)) for suggestions and testing the source maps feature. Plus everyone else involved in [#125](https://github.com/jakubpawlowicz/clean-css/issues/125) for pushing it forward. * Timur Kristóf ([@Venemo](https://github.com/Venemo)) for an outstanding contribution of advanced property optimizer for 2.2 release. * Vincent Voyer ([@vvo](https://github.com/vvo)) for a patch with better empty element regex and for inspiring us to do many performance improvements in 0.4 release. * [@XhmikosR](https://github.com/XhmikosR) for suggesting new features (option to remove special comments and strip out URLs quotation) and pointing out numerous improvements (JSHint, media queries). ## License Clean-css is released under the [MIT License](https://github.com/jakubpawlowicz/clean-css/blob/master/LICENSE).
{ "content_hash": "91ccfab7fa67a9a95c428ca9972fbed6", "timestamp": "", "source": "github", "line_count": 369, "max_line_length": 353, "avg_line_length": 51.28726287262872, "alnum_prop": 0.7205284015852047, "repo_name": "GerHobbelt/clean-css", "id": "4811b72fe6be83c4f0837ea72ff0328fe3014b02", "size": "18926", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "748793" } ] }
require File.dirname(__FILE__) + '/../test_helper' context "Url Filters" do fixtures :sites, :sections, :contents include CoreFilters, UrlFilters def setup @context = mock_context 'site' => sites(:first).to_liquid, 'section' => sections(:about).to_liquid end specify "should generate archive url" do assert_equal "/archives", archive_url(sections(:home).to_liquid) assert_equal "/archives/foo/bar", archive_url(sections(:home).to_liquid, 'foo', 'bar') end specify "should generate monthly url from date" do assert_equal "/archives/2006/1", monthly_url(sections(:home).to_liquid, Date.new(2006, 1)) assert_equal "/about/archives/2006/1", monthly_url(sections(:about).to_liquid, Date.new(2006, 1)) end specify "should generate monthly url from time" do assert_equal "/archives/2006/1", monthly_url(sections(:home).to_liquid, Time.utc(2006, 1)) assert_equal "/about/archives/2006/1", monthly_url(sections(:about).to_liquid, Time.utc(2006, 1)) end specify "should generate monthly url from string" do assert_equal "/archives/2006/1", monthly_url(sections(:home).to_liquid, '2006-1') assert_equal "/about/archives/2006/1", monthly_url(sections(:about).to_liquid, '2006-1-4') end specify "should generate monthly link" do assert_equal "<a href=\"/archives/2006/1\">January 2006</a>", link_to_month(sections(:home).to_liquid, '2006-1') end specify "should generate paged url" do assert_equal "/about", page_url(contents(:welcome).to_liquid(:page => true)) assert_equal "/about/welcome-to-mephisto", page_url(contents(:welcome).to_liquid) assert_equal "/about/about-this-page", page_url(contents(:about).to_liquid) end specify "should generate paged url when site has paged home section" do @context = mock_context 'site' => sites(:hostess).to_liquid, 'section' => sections(:cupcake_home).to_liquid assert_equal "/", page_url(contents(:cupcake_welcome).to_liquid(:page => true)) assert_equal "/welcome-to-cupcake", page_url(contents(:cupcake_welcome).to_liquid) end specify "should generate paged url for home section" do assert_equal "/", page_url(contents(:welcome).to_liquid(:page => true), sections(:home).to_liquid) assert_equal "/welcome-to-mephisto", page_url(contents(:welcome).to_liquid, sections(:home).to_liquid) end specify "should generate section links" do other_section = link_to_section(sections(:home).to_liquid) home_section = link_to_section(sections(:about).to_liquid) assert_match %r(href="/"), other_section assert_match %r(href="/about"), home_section assert_match %r(class="selected"), home_section assert_no_match %r(class="selected"), other_section end specify "should generate paged url for home section" do assert_equal "/", page_url(contents(:welcome).to_liquid(:page => true), sections(:home).to_liquid) assert_equal "/welcome-to-mephisto", page_url(contents(:welcome).to_liquid, sections(:home).to_liquid) end specify "should generate asset urls" do assert_equal "/javascripts/foo.js", javascript_url('foo.js') assert_equal "/stylesheets/foo.css", stylesheet_url('foo.css') assert_equal "/images/foo.gif", asset_url('foo.gif') end specify "should include javascript tag" do script = javascript('foo') assert_match /^<script/, script assert_match %r(src="/javascripts/foo.js"), script end specify "should link stylesheet tag" do css = stylesheet('foo') assert_match /^<link/, css assert_match %r(href="/stylesheets/foo.css"), css end specify "should create image tag" do img = img_tag('foo.gif') assert_match /^<img/, img assert_match %r(src="/images/foo.gif"), img assert_match %r(alt="foo"), img end specify "should generate tag urls" do assert_equal "/tags", tag_url assert_equal "/tags/foo", tag_url('foo') assert_equal "/tags/foo/bar", tag_url('foo', 'bar') end specify "should generate tag links" do assert_equal "<a href=\"/tags/foo\" rel=\"tag\">foo</a>", link_to_tag('foo') end specify "should generate search urls" do assert_equal '/search?q=abc', search_url('abc') assert_equal '/search?q=abc&page=2', search_url('abc', 2) end specify "should generate atom auto discovery tag" do content = atom_feed('/feed/foo') assert_match /^<link /, content assert_match /rel="alternate"/, content assert_match /type="application\/atom\+xml"/, content assert_match /href="\/feed\/foo"/, content assert_no_match /title/, content end specify "should generate atom auto discovery tag with title" do content = atom_feed('foo', 'bar') assert_match /title="bar"/, content end specify "should show all comments feed" do content = all_comments_feed assert_match /href="\/feed\/all_comments.xml"/, content assert_match /title="All Comments"/, content end specify "should show all comments feed with custom title" do content = all_comments_feed "All Lame Comments" assert_match /title="All Lame Comments"/, content end specify "should show section comments feed" do content = comments_feed(sections(:home).to_liquid) assert_match /href="\/feed\/comments.xml"/, content assert_match /title="Comments for Home"/, content end specify "should show section comments feed with custom title" do content = comments_feed(sections(:about).to_liquid, "About Comments") assert_match /href="\/feed\/about\/comments.xml"/, content assert_match /title="About Comments"/, content end specify "should show section articles feed" do content = articles_feed(sections(:home).to_liquid) assert_match /href="\/feed\/atom.xml"/, content assert_match /title="Articles for Home"/, content end specify "should show section articles feed with custom title" do content = articles_feed(sections(:about).to_liquid, "About Articles") assert_match /href="\/feed\/about\/atom.xml"/, content assert_match /title="About Articles"/, content end specify "should html encode anchor text" do unencoded = 'Tom & Jerry' contents(:welcome).title = unencoded @article = contents(:welcome).to_liquid @article.context = @context @context['section'].instance_variable_get(:@liquid)['name'] = unencoded assert_match %r{>Tom &amp; Jerry<\/a>}, link_to_article(@article) assert_match %r{>Tom &amp; Jerry<\/a>}, link_to_page(@article) assert_match %r{>Tom &amp; Jerry<\/a>}, link_to_section(@context['section']) assert_match %r{>Tom &amp; Jerry<\/a>}, link_to_tag(unencoded) end specify "should link to search result with article link" do @article = contents(:welcome).to_liquid @article.context = @context @context['section'] = nil assert_match /href="\/\d{4}\/\d+\/\d+\/welcome-to-mephisto"/, link_to_search_result(@article) end specify "should link to search result with page link" do @article = contents(:welcome).to_liquid(:page => true) @article.context = @context @article2 = contents(:another).to_liquid @article2.context = @context assert_match /href="\/about"/, link_to_search_result(@article) assert_match /href="\/about\/another-welcome-to-mephisto"/, link_to_search_result(@article2) end end context "Article Url Filters" do fixtures :sites, :sections, :contents include CoreFilters, UrlFilters def setup @context = mock_context 'site' => sites(:first).to_liquid @article = contents(:welcome).to_liquid @article.context = @context @permalink = @article.url end specify "should show article comments feed" do content = comments_feed(@article) assert_match /href="#{@permalink}\/comments\.xml"/, content assert_match /title="Comments for Welcome to Mephisto"/, content end specify "should show article comments feed with custom title" do content = comments_feed(@article, "Welcome Comments") assert_match /title="Welcome Comments"/, content end specify "should show article changes feed" do content = changes_feed(@article) assert_match /href="#{@permalink}\/changes\.xml"/, content assert_match /title="Changes for Welcome to Mephisto"/, content end specify "should show article changes feed with custom title" do content = changes_feed(@article, "Welcome Changes") assert_match /title="Welcome Changes"/, content end end
{ "content_hash": "37fdb1addc6bdbeeefb3a3a79001922a", "timestamp": "", "source": "github", "line_count": 216, "max_line_length": 121, "avg_line_length": 39.625, "alnum_prop": 0.673676831405538, "repo_name": "vaudoc/jk", "id": "c2c38c938f4d14f91988a3c9bf18a284a02206c2", "size": "8559", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/unit/url_filters_test.rb", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "41217" }, { "name": "Ruby", "bytes": "438076" } ] }
package com.amazonaws.services.workdocs.model.transform; import javax.annotation.Generated; import com.amazonaws.SdkClientException; import com.amazonaws.services.workdocs.model.*; import com.amazonaws.protocol.*; import com.amazonaws.annotation.SdkInternalApi; /** * DescribeNotificationSubscriptionsRequestMarshaller */ @Generated("com.amazonaws:aws-java-sdk-code-generator") @SdkInternalApi public class DescribeNotificationSubscriptionsRequestMarshaller { private static final MarshallingInfo<String> ORGANIZATIONID_BINDING = MarshallingInfo.builder(MarshallingType.STRING) .marshallLocation(MarshallLocation.PATH).marshallLocationName("OrganizationId").build(); private static final MarshallingInfo<String> MARKER_BINDING = MarshallingInfo.builder(MarshallingType.STRING) .marshallLocation(MarshallLocation.QUERY_PARAM).marshallLocationName("marker").build(); private static final MarshallingInfo<Integer> LIMIT_BINDING = MarshallingInfo.builder(MarshallingType.INTEGER) .marshallLocation(MarshallLocation.QUERY_PARAM).marshallLocationName("limit").build(); private static final DescribeNotificationSubscriptionsRequestMarshaller instance = new DescribeNotificationSubscriptionsRequestMarshaller(); public static DescribeNotificationSubscriptionsRequestMarshaller getInstance() { return instance; } /** * Marshall the given parameter object. */ public void marshall(DescribeNotificationSubscriptionsRequest describeNotificationSubscriptionsRequest, ProtocolMarshaller protocolMarshaller) { if (describeNotificationSubscriptionsRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(describeNotificationSubscriptionsRequest.getOrganizationId(), ORGANIZATIONID_BINDING); protocolMarshaller.marshall(describeNotificationSubscriptionsRequest.getMarker(), MARKER_BINDING); protocolMarshaller.marshall(describeNotificationSubscriptionsRequest.getLimit(), LIMIT_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
{ "content_hash": "b25e83fe8eaf95e4418fcef52d3548d6", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 148, "avg_line_length": 45.36, "alnum_prop": 0.7724867724867724, "repo_name": "aws/aws-sdk-java", "id": "8165d8034a54e763b12ce806a4e079c6565a8dfa", "size": "2848", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "aws-java-sdk-workdocs/src/main/java/com/amazonaws/services/workdocs/model/transform/DescribeNotificationSubscriptionsRequestMarshaller.java", "mode": "33188", "license": "apache-2.0", "language": [] }
using System; using System.Collections.Generic; using System.Linq; using System.Web; using Orchard.ContentManagement.Drivers; using Datwendo.ClientConnector.Models; using Orchard.Localization; using Orchard.Logging; using Orchard.UI.Notify; using Orchard.Settings; using Orchard.Environment.Extensions; using Orchard; using System.Globalization; using Orchard.Security; using Orchard.ContentManagement; namespace Datwendo.ClientConnector.Drivers { [OrchardFeature("Datwendo.ClientConnector")] public class ClientConnectorAdminSettingsPartDriver : ContentPartDriver<ClientConnectorAdminSettingsPart> { public IOrchardServices Services { get; set; } private readonly Lazy<CultureInfo> _cultureInfo; private readonly INotifier _notifier; private readonly IAuthenticationService _authenticationService; private readonly IAuthorizationService _authorizationService; public ClientConnectorAdminSettingsPartDriver(IOrchardServices services , IAuthenticationService authenticationService , IAuthorizationService authorizationService , INotifier notifier) { Services = services; _authenticationService = authenticationService; _authorizationService = authorizationService; T = NullLocalizer.Instance; _cultureInfo = new Lazy<CultureInfo>(() => CultureInfo.GetCultureInfo(Services.WorkContext.CurrentCulture)); _notifier = notifier; } public Localizer T { get; set; } public ILogger Logger { get; set; } protected override string Prefix { get { return "ClientConnectorAdminSettings"; } } private const string TemplateName = "Parts/ClientConnectorAdminSettings"; protected override DriverResult Editor(ClientConnectorAdminSettingsPart part, dynamic shapeHelper) { return ContentShape("Parts_ClientConnectorAdminSettings", () => shapeHelper.EditorTemplate( TemplateName: TemplateName, Model: part, Prefix: Prefix)).OnGroup("ClientConnectorSettings"); ; } protected override DriverResult Editor(ClientConnectorAdminSettingsPart part, IUpdateModel updater, dynamic shapeHelper) { if (!_authorizationService.TryCheckAccess(StandardPermissions.SiteOwner, _authenticationService.GetAuthenticatedUser(), part)) return null; if (updater.TryUpdateModel(part, Prefix, null, null)) { // _notifier.Information(T("ClientConnector settings updated successfully")); } else { _notifier.Error(T("ClientConnector settings update error!")); } return Editor(part, shapeHelper); } } }
{ "content_hash": "099ec2da8fafa7e380f74684f12c1476", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 138, "avg_line_length": 40.56164383561644, "alnum_prop": 0.6599121918270855, "repo_name": "Datwendo/Orchard-ClientConnector", "id": "8109c2875d605a4a9a428dac3351265c0f767ce8", "size": "2963", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Drivers/ClientConnectorAdminSettingsPartDriver.cs", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C#", "bytes": "39614" }, { "name": "CSS", "bytes": "304" } ] }
package com.rhc.insurance; import java.util.ArrayList; import java.util.Collection; import com.rhc.drools.reference.DroolsRequest; public class MemberRequest implements DroolsRequest { private Collection<Object> facts = new ArrayList<Object>(); public void addFacts(Collection<?> objs) { facts.addAll(objs); } @Override public Collection<Object> getAllFacts() { return facts; } @Override public String getProcessId() { // TODO Auto-generated method stub return null; } }
{ "content_hash": "59e3415a1fb2b222710b2cc53e14df37", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 60, "avg_line_length": 18.96153846153846, "alnum_prop": 0.7505070993914807, "repo_name": "sklenkar/java-helloword", "id": "f3dc2a6c4fbbcab6d726a3bb7e590f3492538e73", "size": "493", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "drools-reference-implementation/examples/insurance/src/main/java/com/rhc/insurance/MemberRequest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "69988" } ] }
<!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_22) on Wed Sep 14 22:21:33 CEST 2011 --> <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <TITLE> Uses of Class net.sourceforge.pmd.ast.ASTCatchStatement (PMD 4.2.6 API) </TITLE> <META NAME="date" CONTENT="2011-09-14"> <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 Class net.sourceforge.pmd.ast.ASTCatchStatement (PMD 4.2.6 API)"; } } </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"> <A HREF="../../../../../net/sourceforge/pmd/ast/ASTCatchStatement.html" title="class in net.sourceforge.pmd.ast"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&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-all.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?net/sourceforge/pmd/ast//class-useASTCatchStatement.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="ASTCatchStatement.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 Class<br>net.sourceforge.pmd.ast.ASTCatchStatement</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="../../../../../net/sourceforge/pmd/ast/ASTCatchStatement.html" title="class in net.sourceforge.pmd.ast">ASTCatchStatement</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#net.sourceforge.pmd"><B>net.sourceforge.pmd</B></A></TD> <TD>This is the PMD programming mistake detector.&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#net.sourceforge.pmd.ast"><B>net.sourceforge.pmd.ast</B></A></TD> <TD>&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#net.sourceforge.pmd.rules"><B>net.sourceforge.pmd.rules</B></A></TD> <TD>&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#net.sourceforge.pmd.rules.codesize"><B>net.sourceforge.pmd.rules.codesize</B></A></TD> <TD>&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#net.sourceforge.pmd.rules.design"><B>net.sourceforge.pmd.rules.design</B></A></TD> <TD>&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#net.sourceforge.pmd.rules.strictexception"><B>net.sourceforge.pmd.rules.strictexception</B></A></TD> <TD>&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#net.sourceforge.pmd.symboltable"><B>net.sourceforge.pmd.symboltable</B></A></TD> <TD>&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <A NAME="net.sourceforge.pmd"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Uses of <A HREF="../../../../../net/sourceforge/pmd/ast/ASTCatchStatement.html" title="class in net.sourceforge.pmd.ast">ASTCatchStatement</A> in <A HREF="../../../../../net/sourceforge/pmd/package-summary.html">net.sourceforge.pmd</A></FONT></TH> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../../net/sourceforge/pmd/package-summary.html">net.sourceforge.pmd</A> with parameters of type <A HREF="../../../../../net/sourceforge/pmd/ast/ASTCatchStatement.html" title="class in net.sourceforge.pmd.ast">ASTCatchStatement</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;java.lang.Object</CODE></FONT></TD> <TD><CODE><B>AbstractJavaRule.</B><B><A HREF="../../../../../net/sourceforge/pmd/AbstractJavaRule.html#visit(net.sourceforge.pmd.ast.ASTCatchStatement, java.lang.Object)">visit</A></B>(<A HREF="../../../../../net/sourceforge/pmd/ast/ASTCatchStatement.html" title="class in net.sourceforge.pmd.ast">ASTCatchStatement</A>&nbsp;node, java.lang.Object&nbsp;data)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <A NAME="net.sourceforge.pmd.ast"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Uses of <A HREF="../../../../../net/sourceforge/pmd/ast/ASTCatchStatement.html" title="class in net.sourceforge.pmd.ast">ASTCatchStatement</A> in <A HREF="../../../../../net/sourceforge/pmd/ast/package-summary.html">net.sourceforge.pmd.ast</A></FONT></TH> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../../net/sourceforge/pmd/ast/package-summary.html">net.sourceforge.pmd.ast</A> with parameters of type <A HREF="../../../../../net/sourceforge/pmd/ast/ASTCatchStatement.html" title="class in net.sourceforge.pmd.ast">ASTCatchStatement</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;java.lang.Object</CODE></FONT></TD> <TD><CODE><B>JavaParserVisitor.</B><B><A HREF="../../../../../net/sourceforge/pmd/ast/JavaParserVisitor.html#visit(net.sourceforge.pmd.ast.ASTCatchStatement, java.lang.Object)">visit</A></B>(<A HREF="../../../../../net/sourceforge/pmd/ast/ASTCatchStatement.html" title="class in net.sourceforge.pmd.ast">ASTCatchStatement</A>&nbsp;node, java.lang.Object&nbsp;data)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;java.lang.Object</CODE></FONT></TD> <TD><CODE><B>JavaParserVisitorAdapter.</B><B><A HREF="../../../../../net/sourceforge/pmd/ast/JavaParserVisitorAdapter.html#visit(net.sourceforge.pmd.ast.ASTCatchStatement, java.lang.Object)">visit</A></B>(<A HREF="../../../../../net/sourceforge/pmd/ast/ASTCatchStatement.html" title="class in net.sourceforge.pmd.ast">ASTCatchStatement</A>&nbsp;node, java.lang.Object&nbsp;data)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <A NAME="net.sourceforge.pmd.rules"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Uses of <A HREF="../../../../../net/sourceforge/pmd/ast/ASTCatchStatement.html" title="class in net.sourceforge.pmd.ast">ASTCatchStatement</A> in <A HREF="../../../../../net/sourceforge/pmd/rules/package-summary.html">net.sourceforge.pmd.rules</A></FONT></TH> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../../net/sourceforge/pmd/rules/package-summary.html">net.sourceforge.pmd.rules</A> with parameters of type <A HREF="../../../../../net/sourceforge/pmd/ast/ASTCatchStatement.html" title="class in net.sourceforge.pmd.ast">ASTCatchStatement</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;java.lang.Object</CODE></FONT></TD> <TD><CODE><B>CyclomaticComplexity.</B><B><A HREF="../../../../../net/sourceforge/pmd/rules/CyclomaticComplexity.html#visit(net.sourceforge.pmd.ast.ASTCatchStatement, java.lang.Object)">visit</A></B>(<A HREF="../../../../../net/sourceforge/pmd/ast/ASTCatchStatement.html" title="class in net.sourceforge.pmd.ast">ASTCatchStatement</A>&nbsp;node, java.lang.Object&nbsp;data)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <A NAME="net.sourceforge.pmd.rules.codesize"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Uses of <A HREF="../../../../../net/sourceforge/pmd/ast/ASTCatchStatement.html" title="class in net.sourceforge.pmd.ast">ASTCatchStatement</A> in <A HREF="../../../../../net/sourceforge/pmd/rules/codesize/package-summary.html">net.sourceforge.pmd.rules.codesize</A></FONT></TH> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../../net/sourceforge/pmd/rules/codesize/package-summary.html">net.sourceforge.pmd.rules.codesize</A> with parameters of type <A HREF="../../../../../net/sourceforge/pmd/ast/ASTCatchStatement.html" title="class in net.sourceforge.pmd.ast">ASTCatchStatement</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;java.lang.Object</CODE></FONT></TD> <TD><CODE><B>AbstractNcssCount.</B><B><A HREF="../../../../../net/sourceforge/pmd/rules/codesize/AbstractNcssCount.html#visit(net.sourceforge.pmd.ast.ASTCatchStatement, java.lang.Object)">visit</A></B>(<A HREF="../../../../../net/sourceforge/pmd/ast/ASTCatchStatement.html" title="class in net.sourceforge.pmd.ast">ASTCatchStatement</A>&nbsp;node, java.lang.Object&nbsp;data)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <A NAME="net.sourceforge.pmd.rules.design"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Uses of <A HREF="../../../../../net/sourceforge/pmd/ast/ASTCatchStatement.html" title="class in net.sourceforge.pmd.ast">ASTCatchStatement</A> in <A HREF="../../../../../net/sourceforge/pmd/rules/design/package-summary.html">net.sourceforge.pmd.rules.design</A></FONT></TH> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../../net/sourceforge/pmd/rules/design/package-summary.html">net.sourceforge.pmd.rules.design</A> with parameters of type <A HREF="../../../../../net/sourceforge/pmd/ast/ASTCatchStatement.html" title="class in net.sourceforge.pmd.ast">ASTCatchStatement</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;java.lang.Object</CODE></FONT></TD> <TD><CODE><B>PreserveStackTrace.</B><B><A HREF="../../../../../net/sourceforge/pmd/rules/design/PreserveStackTrace.html#visit(net.sourceforge.pmd.ast.ASTCatchStatement, java.lang.Object)">visit</A></B>(<A HREF="../../../../../net/sourceforge/pmd/ast/ASTCatchStatement.html" title="class in net.sourceforge.pmd.ast">ASTCatchStatement</A>&nbsp;catchStmt, java.lang.Object&nbsp;data)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <A NAME="net.sourceforge.pmd.rules.strictexception"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Uses of <A HREF="../../../../../net/sourceforge/pmd/ast/ASTCatchStatement.html" title="class in net.sourceforge.pmd.ast">ASTCatchStatement</A> in <A HREF="../../../../../net/sourceforge/pmd/rules/strictexception/package-summary.html">net.sourceforge.pmd.rules.strictexception</A></FONT></TH> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../../net/sourceforge/pmd/rules/strictexception/package-summary.html">net.sourceforge.pmd.rules.strictexception</A> with parameters of type <A HREF="../../../../../net/sourceforge/pmd/ast/ASTCatchStatement.html" title="class in net.sourceforge.pmd.ast">ASTCatchStatement</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;java.lang.Object</CODE></FONT></TD> <TD><CODE><B>AvoidCatchingThrowable.</B><B><A HREF="../../../../../net/sourceforge/pmd/rules/strictexception/AvoidCatchingThrowable.html#visit(net.sourceforge.pmd.ast.ASTCatchStatement, java.lang.Object)">visit</A></B>(<A HREF="../../../../../net/sourceforge/pmd/ast/ASTCatchStatement.html" title="class in net.sourceforge.pmd.ast">ASTCatchStatement</A>&nbsp;node, java.lang.Object&nbsp;data)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <A NAME="net.sourceforge.pmd.symboltable"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Uses of <A HREF="../../../../../net/sourceforge/pmd/ast/ASTCatchStatement.html" title="class in net.sourceforge.pmd.ast">ASTCatchStatement</A> in <A HREF="../../../../../net/sourceforge/pmd/symboltable/package-summary.html">net.sourceforge.pmd.symboltable</A></FONT></TH> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../../net/sourceforge/pmd/symboltable/package-summary.html">net.sourceforge.pmd.symboltable</A> with parameters of type <A HREF="../../../../../net/sourceforge/pmd/ast/ASTCatchStatement.html" title="class in net.sourceforge.pmd.ast">ASTCatchStatement</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;java.lang.Object</CODE></FONT></TD> <TD><CODE><B>ScopeAndDeclarationFinder.</B><B><A HREF="../../../../../net/sourceforge/pmd/symboltable/ScopeAndDeclarationFinder.html#visit(net.sourceforge.pmd.ast.ASTCatchStatement, java.lang.Object)">visit</A></B>(<A HREF="../../../../../net/sourceforge/pmd/ast/ASTCatchStatement.html" title="class in net.sourceforge.pmd.ast">ASTCatchStatement</A>&nbsp;node, java.lang.Object&nbsp;data)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</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"> <A HREF="../../../../../net/sourceforge/pmd/ast/ASTCatchStatement.html" title="class in net.sourceforge.pmd.ast"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&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-all.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?net/sourceforge/pmd/ast//class-useASTCatchStatement.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="ASTCatchStatement.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> Copyright &copy; 2002-2011 InfoEther. All Rights Reserved. </BODY> </HTML>
{ "content_hash": "7bf9469e4cb0b2f68b09425a25dec1f2", "timestamp": "", "source": "github", "line_count": 371, "max_line_length": 364, "avg_line_length": 52.62533692722372, "alnum_prop": 0.6615959844294202, "repo_name": "pscadiz/pmd-4.2.6-gds", "id": "5156a81e2b57f3f3a2039fdd1c20dcc8b534893b", "size": "19524", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "docs/apidocs/net/sourceforge/pmd/ast/class-use/ASTCatchStatement.html", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Batchfile", "bytes": "3336" }, { "name": "CSS", "bytes": "1241" }, { "name": "HTML", "bytes": "440" }, { "name": "Java", "bytes": "2602537" }, { "name": "JavaScript", "bytes": "7987" }, { "name": "Ruby", "bytes": "845" }, { "name": "Shell", "bytes": "19634" }, { "name": "XSLT", "bytes": "60577" } ] }
from dos import config class RoleCollection: pass class Policy: def __init__(self, **kwargs): self.cfg = {} for k, v in kwargs.items(): self.cfg[k] = v def policy_setup(self): pass def apply(self): """ return a RoleCollection """ pass
{ "content_hash": "4da99cd14d6a59a1861f2ffbfd99069c", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 35, "avg_line_length": 14.217391304347826, "alnum_prop": 0.4984709480122324, "repo_name": "meantheory/dotfiles", "id": "588f22b37243ea5cccc44e28a9abab231fe09f33", "size": "327", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "dos/src/dos/policies/policy.py", "mode": "33188", "license": "mit", "language": [ { "name": "Python", "bytes": "19704" }, { "name": "Shell", "bytes": "2487" } ] }
using __gnu_test::copy_tracker; using __gnu_test::tracker_allocator_counter; using __gnu_test::tracker_allocator; using __gnu_test::copy_constructor; using __gnu_test::assignment_operator; using __gnu_test::object_counter; using __gnu_test::destructor; typedef std::deque<object_counter> gdeque; bool test __attribute__((unused)) = true; // 23.2.1 required types // // A missing required type will cause a compile failure. // void requiredTypesCheck() { typedef int T; typedef std::deque<T> X; typedef X::reference reference; typedef X::const_reference const_reference; typedef X::iterator iterator; typedef X::const_iterator const_iterator; typedef X::size_type size_type; typedef X::difference_type difference_type; typedef X::value_type value_type; typedef X::allocator_type allocator_type; typedef X::pointer pointer; typedef X::const_pointer const_pointer; typedef X::reverse_iterator reverse_iterator; typedef X::const_reverse_iterator const_reverse_iterator; } // @fn defaultConstructorCheck // Explicitly checks the default deque constructor and destructor for both // trivial and non-trivial types. In addition, the size() and empty() // member functions are explicitly checked here since it should be their // first use. Checking those functions means checking the begin() and // end() and their const brethren functions as well. // // @verbatim // 23.2.1.1 default ctor/dtor // effects: // 23.2.1.1 constructs an empty deque using the specified allocator // postconditions: // 23.1 table 65 u.size() == 0 // throws: // complexity: // 23.1 table 65 constant // // 23.2.1.2 bool empty() const // semantics: // 23.1 table 65 a.size() == 0 // 23.1 (7) a.begin() == a.end() // throws: // complexity: // 23.1 table 65 constant // // 23.2.1.2 size_type size() const // semantics: // 23.1 table 65 a.end() - a.begin() // throws: // complexity: // 23.1 table 65(A) should be constant // // 23.2.1 iterator begin() // const_iterator begin() const // iterator end() // const_iterator end() const // throws: // 23.1 (10) pt. 4 does not throw // complexity: // 23.1 table 65 constant // @endverbatim void defaultConstructorCheckPOD() { // setup typedef int T; typedef std::deque<T> X; // run test X u; // assert postconditions VERIFY(u.empty()); VERIFY(0 == u.size()); VERIFY(u.begin() == u.end()); VERIFY(0 == std::distance(u.begin(), u.end())); // teardown } void defaultConstructorCheck() { // setup typedef copy_tracker T; typedef std::deque<T> X; copy_tracker::reset(); // run test const X u; // assert postconditions VERIFY(u.empty()); VERIFY(0 == u.size()); VERIFY(u.begin() == u.end()); VERIFY(0 == std::distance(u.begin(), u.end())); // teardown } // @fn copyConstructorCheck() // Explicitly checks the deque copy constructor. Continues verificaton of // ancillary member functions documented under defaultConstructorCheck(). // // This check also tests the push_back() member function. // // @verbatim // 23.2.1 copy constructor // effects: // postconditions: // 22.1.1 table 65 a == X(a) // u == a // throws: // complexity: // 22.1.1 table 65 linear // @endverbatim void copyConstructorCheck() { // setup typedef copy_tracker T; typedef std::deque<T> X; const std::size_t copyBaseSize = 17; // arbitrary X a; for (std::size_t i = 0; i < copyBaseSize; ++i) a.push_back(i); copy_tracker::reset(); // assert preconditions VERIFY(!a.empty()); VERIFY(copyBaseSize == a.size()); VERIFY(a.begin() != a.end()); VERIFY( copyBaseSize == static_cast<std::size_t>(std::distance(a.begin(), a.end())) ); // run test X u = a; // assert postconditions VERIFY(u == a); VERIFY(copyBaseSize == copy_constructor::count()); // teardown } // @fn fillConstructorCheck() // This test explicitly verifies the basic fill constructor. Like the default // constructor, later tests depend on the fill constructor working correctly. // That means this explicit test should preceed the later tests so the error // message given on assertion failure can be more helpful n tracking the // problem. // // 23.2.1.1 fill constructor // complexity: // 23.2.1.1 linear in N void fillConstructorCheck() { // setup typedef copy_tracker T; typedef std::deque<T> X; const X::size_type n(23); const X::value_type t(111); copy_tracker::reset(); // run test X a(n, t); // assert postconditions VERIFY(n == a.size()); VERIFY(n == copy_constructor::count()); // teardown } // @fn fillConstructorCheck2() // Explicit check for fill constructors masqueraded as range constructors as // elucidated in clause 23.1.1 paragraph 9 of the standard. // // 23.1.1 (9) fill constructor looking like a range constructor void fillConstructorCheck2() { typedef copy_tracker T; typedef std::deque<T> X; const std::size_t f = 23; const std::size_t l = 111; copy_tracker::reset(); X a(f, l); VERIFY(f == a.size()); VERIFY(f == copy_constructor::count()); } // @fn rangeConstructorCheckForwardIterator() // This test copies from one deque to another to force the copy // constructor for T to be used because the compiler will kindly // elide copies if the default constructor can be used with // type conversions. Trust me. // // 23.2.1.1 range constructor, forward iterators void rangeConstructorCheckForwardIterator() { // setup typedef copy_tracker T; typedef std::deque<T> X; const X::size_type n(726); const X::value_type t(307); X source(n, t); X::iterator i = source.begin(); X::iterator j = source.end(); X::size_type rangeSize = std::distance(i, j); copy_tracker::reset(); // test X a(i, j); // assert postconditions VERIFY(rangeSize == a.size()); VERIFY(copy_constructor::count() <= rangeSize); } // @fn rangeConstructorCheckInputIterator() // An explicit check for range construction on an input iterator // range, which the standard expounds upon as having a different // complexity than forward iterators. // // 23.2.1.1 range constructor, input iterators void rangeConstructorCheckInputIterator() { typedef copy_tracker T; typedef std::deque<T> X; std::istringstream ibuf("1234567890123456789"); const X::size_type rangeSize = ibuf.str().size(); std::istream_iterator<char> i(ibuf); std::istream_iterator<char> j; copy_tracker::reset(); X a(i, j); VERIFY(rangeSize == a.size()); VERIFY(copy_constructor::count() <= (2 * rangeSize)); } // 23.2.1 copy assignment void copyAssignmentCheck() { typedef copy_tracker T; typedef std::deque<T> X; const X::size_type n(18); const X::value_type t(1023); X a(n, t); X r; copy_tracker::reset(); r = a; VERIFY(r == a); VERIFY(n == copy_constructor::count()); } // 23.2.1.1 fill assignment // // The complexity check must check dtors+copyAssign and // copyCtor+copyAssign because that's the way the SGI implementation // works. Dunno if it's true standard compliant (which specifies fill // assignment in terms of erase and insert only), but it should work // as (most) users expect and is more efficient. void fillAssignmentCheck() { typedef copy_tracker T; typedef std::deque<T> X; const X::size_type starting_size(10); const X::value_type starting_value(66); const X::size_type n(23); const X::value_type t(111); X a(starting_size, starting_value); copy_tracker::reset(); // preconditions VERIFY(starting_size == a.size()); // test a.assign(n, t); // postconditions VERIFY(n == a.size()); VERIFY(n == (copy_constructor::count() + assignment_operator::count())); VERIFY(starting_size == (destructor::count() + assignment_operator::count())); } // @verbatim // 23.2.1 range assignment // 23.2.1.1 deque constructors, copy, and assignment // effects: // Constructs a deque equal to the range [first, last), using the // specified allocator. // // template<typename InputIterator> // assign(InputIterator first, InputIterator last); // // is equivalent to // // erase(begin(), end()); // insert(begin(), first, last); // // postconditions: // throws: // complexity: // forward iterators: N calls to the copy constructor, 0 reallocations // input iterators: 2N calls to the copy constructor, log(N) reallocations // @endverbatim void rangeAssignmentCheck() { typedef copy_tracker T; typedef std::deque<T> X; const X::size_type source_size(726); const X::value_type source_value(307); const X::size_type starting_size(10); const X::value_type starting_value(66); X source(source_size, source_value); X::iterator i = source.begin(); X::iterator j = source.end(); X::size_type rangeSize = std::distance(i, j); X a(starting_size, starting_value); VERIFY(starting_size == a.size()); copy_tracker::reset(); a.assign(i, j); VERIFY(source == a); VERIFY(rangeSize == (copy_constructor::count() + assignment_operator::count())); VERIFY(starting_size == (destructor::count() + assignment_operator::count())); } // 23.1 (10) range assignment // 23.2.1.3 with exception void rangeAssignmentCheckWithException() { // setup typedef copy_tracker T; typedef std::deque<T> X; // test // What does "no effects" mean? } // 23.1.1 (9) fill assignment looking like a range assignment void fillAssignmentCheck2() { // setup typedef copy_tracker T; typedef std::deque<T> X; // test // What does "no effects" mean? } // Verify that the default deque constructor offers the basic exception // guarantee. void test_default_ctor_exception_safety() { // setup typedef copy_tracker T; typedef std::deque<T, tracker_allocator<T> > X; T::reset(); copy_constructor::throw_on(3); tracker_allocator_counter::reset(); // test try { T ref; X a(7, ref); VERIFY( false ); } catch (...) { } // assert postconditions VERIFY(tracker_allocator_counter::get_allocation_count() == tracker_allocator_counter::get_deallocation_count()); // teardown } // Verify that the copy constructor offers the basic exception guarantee. void test_copy_ctor_exception_safety() { // setup typedef copy_tracker T; typedef std::deque<T, tracker_allocator<T> > X; tracker_allocator_counter::reset(); { X a(7); T::reset(); copy_constructor::throw_on(3); // test try { X u(a); VERIFY(false); } catch (...) { } } // assert postconditions VERIFY(tracker_allocator_counter::get_allocation_count() == tracker_allocator_counter::get_deallocation_count()); // teardown } int main() { // basic functionality and standard conformance checks requiredTypesCheck(); defaultConstructorCheckPOD(); defaultConstructorCheck(); test_default_ctor_exception_safety(); copyConstructorCheck(); test_copy_ctor_exception_safety(); fillConstructorCheck(); fillConstructorCheck2(); rangeConstructorCheckInputIterator(); rangeConstructorCheckForwardIterator(); copyAssignmentCheck(); fillAssignmentCheck(); fillAssignmentCheck2(); rangeAssignmentCheck(); rangeAssignmentCheckWithException(); return 0; }
{ "content_hash": "b186df899f784c2d23d4385a1ff0f45e", "timestamp": "", "source": "github", "line_count": 494, "max_line_length": 115, "avg_line_length": 23.261133603238868, "alnum_prop": 0.6540771038203812, "repo_name": "the-linix-project/linix-kernel-source", "id": "4df44f8eb72e62e6db827a0ebb02f7238006c589", "size": "12481", "binary": false, "copies": "30", "ref": "refs/heads/master", "path": "gccsrc/gcc-4.7.2/libstdc++-v3/testsuite/23_containers/deque/cons/2.cc", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "Ada", "bytes": "38139979" }, { "name": "Assembly", "bytes": "3723477" }, { "name": "Awk", "bytes": "83739" }, { "name": "C", "bytes": "103607293" }, { "name": "C#", "bytes": "55726" }, { "name": "C++", "bytes": "38577421" }, { "name": "CLIPS", "bytes": "6933" }, { "name": "CSS", "bytes": "32588" }, { "name": "Emacs Lisp", "bytes": "13451" }, { "name": "FORTRAN", "bytes": "4294984" }, { "name": "GAP", "bytes": "13089" }, { "name": "Go", "bytes": "11277335" }, { "name": "Haskell", "bytes": "2415" }, { "name": "Java", "bytes": "45298678" }, { "name": "JavaScript", "bytes": "6265" }, { "name": "Matlab", "bytes": "56" }, { "name": "OCaml", "bytes": "148372" }, { "name": "Objective-C", "bytes": "995127" }, { "name": "Objective-C++", "bytes": "436045" }, { "name": "PHP", "bytes": "12361" }, { "name": "Pascal", "bytes": "40318" }, { "name": "Perl", "bytes": "358808" }, { "name": "Python", "bytes": "60178" }, { "name": "SAS", "bytes": "1711" }, { "name": "Scilab", "bytes": "258457" }, { "name": "Shell", "bytes": "2610907" }, { "name": "Tcl", "bytes": "17983" }, { "name": "TeX", "bytes": "1455571" }, { "name": "XSLT", "bytes": "156419" } ] }
(function () { "use strict"; /** * Used to desplay animations with spritesheets. * @class HYPER.Graphics.Animation * @param {object} e Object of passed info. * @param {object} e.spriteSheet Sprite sheet to be animated. * @param {number} e.currentFrame=0 The current frame number of the animation. * @param {function} e.onLoopEnd Function to call when the animation finishes, called every loop. * @param {function} e.onFrame Function called every frame change. */ HYPER.Graphics.Animation = function (e) { /** * @property {object} spriteSheet - The spritesheet to be used for the animation. */ this.spriteSheet = e.spriteSheet || {}; /** * @property {string} _ID - The specific ID for this object. */ this._ID = "animation " + Math.random() + "" + Math.random(); /** * @property {string} type - The type of object it is. */ this.type = "animation"; /** * @property {number} width - The width of the animation. */ this.width = e.width || this.spriteSheet.width || 0; /** * @property {number} height - The height of the animation. */ this.height = e.height || this.spriteSheet.height || 0; /** * @property {number} currentFrame - The current frame of the animation. */ this.currentFrame = e.currentFrame || 0; /** * @property {boolean} paused - If the animation is paused or not. */ this.paused = true; /** * @property {object} currentAnimation - The current animation to play. */ this.currentAnimation = false; /** * @property {function} onLoopEnd - What to do at the end of every loop. */ this.onLoopEnd = e.onLoopEnd || no0p; /** * @property {function} onLoopEnd - What to do at the end of every frame. First parameter is the frame ID. */ this.onFrame = e.onFrame || no0p; /** * @property {number} FPS - The FPS of the animation. */ this.FPS = 30; /** * @private * @property {number} _now - Current time. */ this._now; /** * @private * @property {number} _then - Previous time. */ this._then = HYPER.CURRENT_DATE; /** * @private * @property {number} _interval - How much time you want to pass between loops. */ this._interval = 1000 / this.FPS; /** * @private * @property {number} _delta - Diffrence in time between loops. */ this._delta; /** * @property {function} update - Called every tick. */ this.update = e.update || no0p; /** * @property {function} update - Called every frame. */ this.render = e.render || no0p; }; HYPER.Graphics.Animation.prototype = { /** * Function to play animations. * @method HYPER.Graphics.Animation.play * @param {string} animationName the name of the animation you want to play. * @param {number} frameNumber The frame that you want to start playing at. */ play: function (animationName, frameNumber) { this.currentAnimation = this.spriteSheet.animations[animationName]; this.FPS = this.spriteSheet.animations[animationName].fps; this._interval = 1000 / this.FPS; this.currentFrame = frameNumber || this.currentFrame || 0; this.paused = false; }, /** * Function to pause animations. * @method HYPER.Graphics.Animation.pause */ pause: function () { this.paused = true; }, /** * Function to start animations. It always re-starts the animation. * @param {string} animationName the name of the animation you want to play. * @param {number} frameNumber The frame that you want to start playing at. * @method HYPER.Graphics.Animation.start */ start: function (animationName, frameNumber) { this.currentFrame = frameNumber || 0; this.currentAnimation = this.spriteSheet.animations[animationName]; this.FPS = this.spriteSheet.animations[animationName].fps; this._interval = 1000 / this.FPS; this.paused = false; }, /** * Function to stop animations. This function re-sets the animation frame. * @method HYPER.Graphics.Animation.stop */ stop: function () { this.paused = true; this.currentFrame = 0; }, /** * Function called every tick. * @method HYPER.Graphics.Animation._update */ _update: function (a) { this._now = HYPER.CURRENT_DATE; this._delta = this._now - this._then; if (this._delta > this._interval) { this._then = this._now - (this._delta % this._interval); // Game Code if (!this.paused && this.currentAnimation) { this.currentFrame += 1; this.onFrame(this.currentFrame); this.currentAnimation.onFrame(this.currentFrame); if (this.currentFrame >= this.currentAnimation.frames.length) { this.currentAnimation.onLoop(); this.currentFrame = 0; if (!this.currentAnimation.loop) { this.paused = true; } if (this.currentAnimation.next != this.currentAnimation.name) { this.start(this.currentAnimation.next); } } } else { } // End Game Code } }, /** * Function called every frame. * @method HYPER.Graphics.Animation._render */ _render: function (a, x, y, width, height, angle, rotX, rotY, scaleX, scaleY) { if (this.currentAnimation) { x = x || 0; y = y || 0; width = width || 0; height = height || 0; angle = angle || 0; rotX = rotX || 0; rotY = rotY || 0; scaleX = scaleX || 1; scaleY = scaleY || 1; var flipped = ""; if (scaleX < 0) { flipped = "x"; } if (scaleY < 0) { flipped = "y"; } if (scaleX < 0 && scaleY < 0) { flipped = "xy"; } scaleX = Math.abs(scaleX); scaleY = Math.abs(scaleY); if (flipped === "x") { HYPER.Graphics.Draw(a.ctx).bitmap(this.spriteSheet.flippedX.bitmap, x, y, width, height, -this.spriteSheet.frameINFO[this.currentAnimation.frames[this.currentFrame]].x + this.spriteSheet.flippedX.bitmap.width, this.spriteSheet.frameINFO[this.currentAnimation.frames[this.currentFrame]].y, -this.spriteSheet.frameINFO[this.currentAnimation.frames[this.currentFrame]].width, this.spriteSheet.frameINFO[this.currentAnimation.frames[this.currentFrame]].height, angle, rotX, rotY, scaleX, scaleY); } else if (flipped === "xy") { HYPER.Graphics.Draw(a.ctx).bitmap(this.spriteSheet.flippedXY.bitmap, x, y, width, height, -this.spriteSheet.frameINFO[this.currentAnimation.frames[this.currentFrame]].x + this.spriteSheet.flippedX.bitmap.width, -this.spriteSheet.frameINFO[this.currentAnimation.frames[this.currentFrame]].y + this.spriteSheet.flippedX.bitmap.height, -this.spriteSheet.frameINFO[this.currentAnimation.frames[this.currentFrame]].width, -this.spriteSheet.frameINFO[this.currentAnimation.frames[this.currentFrame]].height, angle, rotX, rotY, scaleX, scaleY); } else if (flipped === "y") { HYPER.Graphics.Draw(a.ctx).bitmap(this.spriteSheet.flippedY.bitmap, x, y, width, height, this.spriteSheet.frameINFO[this.currentAnimation.frames[this.currentFrame]].x, -this.spriteSheet.frameINFO[this.currentAnimation.frames[this.currentFrame]].y + this.spriteSheet.flippedX.bitmap.height, this.spriteSheet.frameINFO[this.currentAnimation.frames[this.currentFrame]].width, -this.spriteSheet.frameINFO[this.currentAnimation.frames[this.currentFrame]].height, angle, rotX, rotY, scaleX, scaleY); } else { HYPER.Graphics.Draw(a.ctx).bitmap(this.spriteSheet.bitmap, x, y, width, height, this.spriteSheet.frameINFO[this.currentAnimation.frames[this.currentFrame]].x, this.spriteSheet.frameINFO[this.currentAnimation.frames[this.currentFrame]].y, this.spriteSheet.frameINFO[this.currentAnimation.frames[this.currentFrame]].width, this.spriteSheet.frameINFO[this.currentAnimation.frames[this.currentFrame]].height, angle, rotX, rotY, scaleX, scaleY); }; } }, }; })();
{ "content_hash": "f32c673bff66bddb73f583bef1ab7f90", "timestamp": "", "source": "github", "line_count": 303, "max_line_length": 443, "avg_line_length": 34.227722772277225, "alnum_prop": 0.49696268440844665, "repo_name": "Firenibbler/HYPERJS", "id": "27401e8f6c7207d5dcd0d19865bb3b494c635f87", "size": "10371", "binary": false, "copies": "1", "ref": "refs/heads/Master", "path": "src/Graphics/animation.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "722081" } ] }
// Copyright 2016 Google Inc. All Rights Reserved. // // 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 admanager.axis.v202205.proposalservice; import static com.google.api.ads.common.lib.utils.Builder.DEFAULT_CONFIGURATION_FILENAME; import com.beust.jcommander.Parameter; import com.google.api.ads.admanager.axis.factory.AdManagerServices; import com.google.api.ads.admanager.axis.utils.v202205.StatementBuilder; import com.google.api.ads.admanager.axis.v202205.ApiError; import com.google.api.ads.admanager.axis.v202205.ApiException; import com.google.api.ads.admanager.axis.v202205.Proposal; import com.google.api.ads.admanager.axis.v202205.ProposalPage; import com.google.api.ads.admanager.axis.v202205.ProposalServiceInterface; import com.google.api.ads.admanager.axis.v202205.UpdateResult; import com.google.api.ads.admanager.lib.client.AdManagerSession; import com.google.api.ads.admanager.lib.utils.examples.ArgumentNames; import com.google.api.ads.common.lib.auth.OfflineCredentials; import com.google.api.ads.common.lib.auth.OfflineCredentials.Api; import com.google.api.ads.common.lib.conf.ConfigurationLoadException; import com.google.api.ads.common.lib.exception.OAuthException; import com.google.api.ads.common.lib.exception.ValidationException; import com.google.api.ads.common.lib.utils.examples.CodeSampleParams; import com.google.api.client.auth.oauth2.Credential; import java.rmi.RemoteException; /** * This example sends programmatic proposals to Marketplace to request buyer acceptance. * * <p>Credentials and properties in {@code fromFile()} are pulled from the "ads.properties" file. * See README for more info. */ public class RequestBuyerAcceptance { private static class RequestBuyerAcceptanceParams extends CodeSampleParams { @Parameter(names = ArgumentNames.PROPOSAL_ID, required = true) private Long proposalId; } /** * Runs the example. * * @param adManagerServices the services factory. * @param session the session. * @param proposalId the proposal ID to send. * @throws ApiException if the API request failed with one or more service errors. * @throws RemoteException if the API request failed due to other errors. */ public static void runExample( AdManagerServices adManagerServices, AdManagerSession session, long proposalId) throws RemoteException { // Get the ProposalService. ProposalServiceInterface proposalService = adManagerServices.get(session, ProposalServiceInterface.class); // Create a statement to only select a single proposal by ID. StatementBuilder statementBuilder = new StatementBuilder() .where("WHERE id = :id") .orderBy("id ASC") .limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) .withBindVariableValue("id", proposalId); // Retrieve a small amount of proposals at a time, paging through until all // proposals have been retrieved. int totalResultSetSize = 0; do { ProposalPage page = proposalService.getProposalsByStatement(statementBuilder.toStatement()); if (page.getResults() != null) { // Print out some information for each proposal. totalResultSetSize = page.getTotalResultSetSize(); int i = page.getStartIndex(); for (Proposal proposal : page.getResults()) { System.out.printf( "%d) Proposal with ID %d and name '%s' will be sent to Marketplace for buyer " + "acceptance.%n", i++, proposal.getId(), proposal.getName()); } } statementBuilder.increaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); } while (statementBuilder.getOffset() < totalResultSetSize); System.out.printf( "Number of proposals to be sent to Marketplace for buyer acceptance: %d%n", totalResultSetSize); if (totalResultSetSize > 0) { // Remove limit and offset from statement. statementBuilder.removeLimitAndOffset(); // Create action. com.google.api.ads.admanager.axis.v202205.RequestBuyerAcceptance action = new com.google.api.ads.admanager.axis.v202205.RequestBuyerAcceptance(); // Perform action. UpdateResult result = proposalService.performProposalAction(action, statementBuilder.toStatement()); if (result != null && result.getNumChanges() > 0) { System.out.printf( "Number of proposals that were sent to Marketplace for buyer acceptance: %d%n", result.getNumChanges()); } else { System.out.println("No proposals were sent to Marketplace for buyer acceptance."); } } } public static void main(String[] args) { AdManagerSession session; try { // Generate a refreshable OAuth2 credential. Credential oAuth2Credential = new OfflineCredentials.Builder() .forApi(Api.AD_MANAGER) .fromFile() .build() .generateCredential(); // Construct a AdManagerSession. session = new AdManagerSession.Builder().fromFile().withOAuth2Credential(oAuth2Credential).build(); } catch (ConfigurationLoadException cle) { System.err.printf( "Failed to load configuration from the %s file. Exception: %s%n", DEFAULT_CONFIGURATION_FILENAME, cle); return; } catch (ValidationException ve) { System.err.printf( "Invalid configuration in the %s file. Exception: %s%n", DEFAULT_CONFIGURATION_FILENAME, ve); return; } catch (OAuthException oe) { System.err.printf( "Failed to create OAuth credentials. Check OAuth settings in the %s file. " + "Exception: %s%n", DEFAULT_CONFIGURATION_FILENAME, oe); return; } AdManagerServices adManagerServices = new AdManagerServices(); RequestBuyerAcceptanceParams params = new RequestBuyerAcceptanceParams(); if (!params.parseArguments(args)) { // Either pass the required parameters for this example on the command line, or insert them // into the code here. See the parameter class definition above for descriptions. params.proposalId = Long.parseLong("INSERT_PROPOSAL_ID_HERE"); } try { runExample(adManagerServices, session, params.proposalId); } catch (ApiException apiException) { // ApiException is the base class for most exceptions thrown by an API request. Instances // of this exception have a message and a collection of ApiErrors that indicate the // type and underlying cause of the exception. Every exception object in the admanager.axis // packages will return a meaningful value from toString // // ApiException extends RemoteException, so this catch block must appear before the // catch block for RemoteException. System.err.println("Request failed due to ApiException. Underlying ApiErrors:"); if (apiException.getErrors() != null) { int i = 0; for (ApiError apiError : apiException.getErrors()) { System.err.printf(" Error %d: %s%n", i++, apiError); } } } catch (RemoteException re) { System.err.printf("Request failed unexpectedly due to RemoteException: %s%n", re); } } }
{ "content_hash": "b37fccae958b891fc599bfadc0ef122a", "timestamp": "", "source": "github", "line_count": 184, "max_line_length": 99, "avg_line_length": 42.30434782608695, "alnum_prop": 0.7034943473792394, "repo_name": "googleads/googleads-java-lib", "id": "48d5bf5bd6d3382f0bed285dbea9492e5b0b9791", "size": "7784", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "examples/admanager_axis/src/main/java/admanager/axis/v202205/proposalservice/RequestBuyerAcceptance.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "81068791" } ] }
/* * 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.gbif.checklistbank.nub.validation; import org.gbif.api.vocabulary.Kingdom; import org.gbif.api.vocabulary.Rank; import org.gbif.checklistbank.neo.Labels; import org.gbif.checklistbank.neo.NeoProperties; import org.gbif.checklistbank.neo.traverse.Traversals; import org.gbif.checklistbank.nub.NubDb; import java.util.Map; import org.neo4j.graphdb.Node; import org.neo4j.graphdb.Result; import org.neo4j.graphdb.Transaction; import org.neo4j.helpers.collection.Iterators; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Does some basic verifications on the neo4j nub tree * This does not rely on name usages or metrics to exist yet! */ public class NubTreeValidation implements NubValidation { private static final Logger LOG = LoggerFactory.getLogger(NubTreeValidation.class); private final NubDb db; private boolean valid = true; public NubTreeValidation(NubDb db) { this.db = db; } private Result query(String cypher) { LOG.debug("Execute: {}", cypher); return db.dao().getNeo().execute(cypher); } private void notExists(String errorMessage, String cypher) { try (Transaction tx = db.beginTx()) { Result res = query(cypher); if (res.hasNext()) { valid = false; Map<String, Object> row = res.next(); LOG.error(errorMessage, row); } } } private void assertCount(String errorMessage, String cypher, long expected) { try (Transaction tx = db.beginTx()) { Result res = query(cypher); Map<String, Object> row = res.next(); long count = (long) row.values().iterator().next(); if (expected != count) { valid = false; LOG.error(errorMessage, count); } } } @Override public boolean validate() { // no self loops whatsoever notExists("Self loops in {}", "MATCH (n:TAXON) WHERE (n)--(n) RETURN n LIMIT 1"); // no parent_of rels in different directions on a given node notExists("Contradicting parent relations in {}", "MATCH (n:TAXON) WHERE (n)-[:PARENT_OF*..6]->(n) RETURN n LIMIT 1"); // just kingdom roots assertCount("Too many roots {}", "MATCH (n:ROOT) RETURN count(n)", Kingdom.values().length); // no basionyms without basionym relation notExists("Basionym without basionym relation {}", "MATCH (b:BASIONYM) WHERE not (b)-[:BASIONYM_OF]->() RETURN b LIMIT 1"); // no basionym exists without an accepted or parent node notExists("Orphaned basionym found {}", "MATCH (b:BASIONYM) WHERE not (b)-[:SYNONYM_OF]->() and not (b)<-[:PARENT_OF]-() RETURN b LIMIT 1"); // no synonyms without synonym relation notExists("Synonym without synonym relation {}", "MATCH (s:SYNONYM) WHERE not (s)-[:SYNONYM_OF]->() RETURN s LIMIT 1"); // verify accepted tree has ranks in proper order validateRanks(); return valid; } private void validateRanks() { try (Transaction tx = db.beginTx()) { for (Node c : Iterators.loop(db.dao().getNeo().findNodes(Labels.ROOT))) { traverse(c, NeoProperties.getRank(c, null)); } } } private void traverse(Node p, Rank pr) { for (Node c : Traversals.CHILDREN.traverse(p).nodes()) { Rank cr = NeoProperties.getRank(c, null); if (cr == null) { LOG.error("Missing rank: {}", NeoProperties.getScientificName(c)); valid = false; } else if (!pr.higherThan(cr)) { LOG.error("Rank mismatch: {} {} CHILD OF {} {}", cr, NeoProperties.getScientificName(c), pr, NeoProperties.getScientificName(p)); valid = false; } traverse(c, cr); } } }
{ "content_hash": "7a74924ee5fc103a6a7475d6b094ae6a", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 144, "avg_line_length": 33.54032258064516, "alnum_prop": 0.6722769896609762, "repo_name": "gbif/checklistbank", "id": "3d16d853974f97c7a2c22111bbfd223b11dabf85", "size": "4159", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "checklistbank-cli/src/main/java/org/gbif/checklistbank/nub/validation/NubTreeValidation.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "FreeMarker", "bytes": "257" }, { "name": "Java", "bytes": "2040900" }, { "name": "Makefile", "bytes": "846" }, { "name": "PLpgSQL", "bytes": "17258" }, { "name": "Shell", "bytes": "2004" } ] }
module Azure::Network::Mgmt::V2019_02_01 module Models # # Describes the HTTP header. # class HTTPHeader include MsRestAzure # @return [String] The name in HTTP header. attr_accessor :name # @return [String] The value in HTTP header. attr_accessor :value # # Mapper for HTTPHeader class as Ruby Hash. # This will be used for serialization/deserialization. # def self.mapper() { client_side_validation: true, required: false, serialized_name: 'HTTPHeader', type: { name: 'Composite', class_name: 'HTTPHeader', model_properties: { name: { client_side_validation: true, required: false, serialized_name: 'name', type: { name: 'String' } }, value: { client_side_validation: true, required: false, serialized_name: 'value', type: { name: 'String' } } } } } end end end end
{ "content_hash": "e94c2c0a9c52ac2d6859a867d738e80a", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 60, "avg_line_length": 23.634615384615383, "alnum_prop": 0.45402766476810413, "repo_name": "Azure/azure-sdk-for-ruby", "id": "8775e38c0d9896a5b3f72cac588b1b1f2e66c42b", "size": "1393", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "management/azure_mgmt_network/lib/2019-02-01/generated/azure_mgmt_network/models/httpheader.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "345216400" }, { "name": "Shell", "bytes": "305" } ] }
ACCEPTED #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
{ "content_hash": "06f0ada3e80c6ee2c868ba2529c5d942", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 10.307692307692308, "alnum_prop": 0.6940298507462687, "repo_name": "mdoering/backbone", "id": "3f2384daf011cde2563a53970d04405706cccb83", "size": "202", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Myrtales/Melastomataceae/Calvoa/Calvoa monticola/README.md", "mode": "33188", "license": "apache-2.0", "language": [] }
/** * @author jdiaz5513 */ import initTrace from "debug"; import { ListElementSize } from "../list-element-size"; import { _ListCtor, List } from "./list"; import { getContent } from "./pointer"; const trace = initTrace("capnp:list:composite"); trace("load"); export class Float32List extends List<number> { static readonly _capnp: _ListCtor = { displayName: "List<Float32>" as string, size: ListElementSize.BYTE_4 }; get(index: number): number { const c = getContent(this); return c.segment.getFloat32(c.byteOffset + index * 4); } set(index: number, value: number): void { const c = getContent(this); c.segment.setFloat32(c.byteOffset + index * 4, value); } toString(): string { return `Float32_${super.toString()}`; } }
{ "content_hash": "2df71dcef4fb9c2eb1bfbdebbd534311", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 58, "avg_line_length": 22.2, "alnum_prop": 0.6537966537966537, "repo_name": "jdiaz5513/capnp-ts", "id": "7de7f99c35c15ee5063202b49bd66d00a6166706", "size": "777", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "packages/capnp-ts/src/serialization/pointers/float32-list.ts", "mode": "33188", "license": "mit", "language": [ { "name": "Cap'n Proto", "bytes": "35091" }, { "name": "HTML", "bytes": "7944" }, { "name": "JavaScript", "bytes": "6514" }, { "name": "Makefile", "bytes": "2398" }, { "name": "Shell", "bytes": "1395" }, { "name": "TypeScript", "bytes": "386500" } ] }
module HolderRails module Helpers def holder_tag(size, text='', theme=nil, html_options={}) size = "#{size}x#{size}" unless size =~ /\A\d+[%p]?x\d+\z/ text = text.to_s.empty? ? size : text options = {:src => '', :data => {:src => "holder.js/#{size}?text=#{text}&theme=#{theme}"}} options = options.merge(html_options) tag :img, options end end end
{ "content_hash": "73e40679ec05449bafe4d2a82e48c1bd", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 96, "avg_line_length": 32.583333333333336, "alnum_prop": 0.5652173913043478, "repo_name": "matsu911/holder_rails", "id": "12c114db1d0a7dc7527dda17ed43f855d92452a1", "size": "391", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/holder_rails/helpers.rb", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "Ruby", "bytes": "2816" } ] }
import frappe from frappe.model.document import Document class CustomDocPerm(Document): def on_update(self): frappe.clear_cache(doctype = self.parent)
{ "content_hash": "6beb31bef7d79cfdcbb512200912c2c6", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 43, "avg_line_length": 25.833333333333332, "alnum_prop": 0.7935483870967742, "repo_name": "almeidapaulopt/frappe", "id": "1790344776a686175e8b46d7c0f42ab4410c5a59", "size": "267", "binary": false, "copies": "2", "ref": "refs/heads/develop", "path": "frappe/core/doctype/custom_docperm/custom_docperm.py", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "67734" }, { "name": "HTML", "bytes": "245760" }, { "name": "JavaScript", "bytes": "2345089" }, { "name": "Less", "bytes": "25489" }, { "name": "Makefile", "bytes": "99" }, { "name": "Python", "bytes": "3436599" }, { "name": "SCSS", "bytes": "248606" }, { "name": "Shell", "bytes": "3505" }, { "name": "Vue", "bytes": "96912" } ] }
package org.efaps.esjp.common.pushmsg; import java.util.ArrayList; import java.util.List; import java.util.UUID; import org.apache.wicket.protocol.ws.api.IWebSocketConnection; import org.efaps.admin.event.Parameter; import org.efaps.admin.event.Return; import org.efaps.admin.program.esjp.EFapsApplication; import org.efaps.admin.program.esjp.EFapsUUID; import org.efaps.admin.user.AbstractUserObject; import org.efaps.admin.user.Group; import org.efaps.admin.user.Person; import org.efaps.admin.user.Role; import org.efaps.ci.CIAdminUser; import org.efaps.db.MultiPrintQuery; import org.efaps.db.QueryBuilder; import org.efaps.esjp.common.AbstractCommon; import org.efaps.ui.wicket.connectionregistry.RegistryManager; import org.efaps.ui.wicket.models.PushMsg; import org.efaps.util.EFapsException; /** * TODO comment! * * @author The eFaps Team */ @EFapsUUID("d2c27870-19cc-411f-95db-8db817fae956") @EFapsApplication("eFaps-WebApp") public abstract class MessageSender_Base extends AbstractCommon { /** * Send a TextMessage to a user, group or role. * @param _parameter Parameter as passed by the eFaps API * @return new Return * @throws EFapsException on error */ public Return sendTextMessage(final Parameter _parameter) throws EFapsException { String reciever = getProperty(_parameter, "Reciever"); String message = getProperty(_parameter, "Message"); if (reciever == null) { reciever = _parameter.getParameterValue("Reciever"); } if (message == null) { message = _parameter.getParameterValue("Message"); } if (reciever != null && !reciever.isEmpty()) { final List<Person> persons = new ArrayList<>(); AbstractUserObject user; if (isUUID(reciever)) { user = AbstractUserObject.getUserObject(UUID.fromString(reciever)); } else { user = AbstractUserObject.getUserObject(reciever); } if (user instanceof Role || user instanceof Group) { final QueryBuilder queryBldr = new QueryBuilder(user instanceof Role ? CIAdminUser.Person2Role : CIAdminUser.Person2Group); queryBldr.addWhereAttrEqValue(CIAdminUser._Abstract2Abstract.UserToAbstractLink, user.getId()); final MultiPrintQuery multi = queryBldr.getPrint(); multi.addAttribute(CIAdminUser._Abstract2Abstract.UserFromAbstractLink); multi.executeWithoutAccessCheck(); while (multi.next()) { final Long personid = multi.<Long>getAttribute(CIAdminUser._Abstract2Abstract.UserFromAbstractLink); persons.add(Person.get(personid)); } } for (final Person person : persons) { final List<IWebSocketConnection> conns = RegistryManager.getConnections4User(person.getName()); for (final IWebSocketConnection conn : conns) { conn.sendMessage(new PushMsg(message)); } } } return new Return(); } }
{ "content_hash": "ad5128c0843121c297c8c8e28ca35c15", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 120, "avg_line_length": 37.50588235294118, "alnum_prop": 0.6543287327478042, "repo_name": "eFaps/eFaps-WebApp-Install", "id": "341292e7ef49cbc54e24b815f086739677efb547", "size": "3798", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/efaps/ESJP/org/efaps/esjp/common/pushmsg/MessageSender_Base.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "145812" }, { "name": "HTML", "bytes": "21291" }, { "name": "Java", "bytes": "429306" }, { "name": "JavaScript", "bytes": "17528" }, { "name": "XSLT", "bytes": "5893" } ] }
- How to compare numbers and strings with relational operators (`<`, `>`, `>=`, `<=`) - Equality checks with strict equals (`===`) and not strict equals (`!==`) ### Conditionals How to write if-statements - `if(){}` - `if(){} else{}` - `if(){} else if(){} else{}` ## Out of Scope - Details about loose equality `==` and truthy/falsy (can be taught later when the student learn more about type coercion) - Shallow/deep comparison of objects - Ternary operator `x ? y : z` (will be taught later to avoid overloading this early exercise) - `switch`, `for` ## Concepts The Concepts this exercise unlocks are: - `comparison` - `conditionals` ## Prerequisites - `booleans` because they are the result of the comparison and used in the conditions - `numbers` because they are used to practice comparison - `strings` also because they are used to practice comparison ## Analyzer This exercise could benefit from the following rules in the [analyzer][analyzer]: - Verify that `needsLicense` does not include an unnecessary if-statement where the student returns `true`/`false`. - Verify that in `chooseVehicle` the string `' is clearly the better choice'` only appears once. - Verify that in `chooseVehicle` and `calculateResellPrice` the student actually practiced if/else and did not use early returns. E.g., show a comment like this ``` Nice. That's an _early return_. For the purpose of the Concept that this exercise aims to teach, try solving this using an `else` statement. ``` ## Notes The exercise is inspired by [Vehicle Purchase Exercise in the Julia track][julia-vehicle-purchase] but the original exercise included more concepts and the tasks were more difficult to transfer into code. To keep the concept exercise rather trivial as it should be, the tasks were extremely simplified or replaced. [analyzer]: https://github.com/exercism/javascript-analyzer [julia-vehicle-purchase]: https://github.com/exercism/julia/blob/main/exercises/concept/vehicle-purchase/.docs/instructions.md
{ "content_hash": "1c7e26e271cddbd02a6b74dc0b58f7ca", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 204, "avg_line_length": 39.470588235294116, "alnum_prop": 0.7426726279185295, "repo_name": "exercism/xecmascript", "id": "f5964f250099b64231f6fc94c58e7be2acbf8029", "size": "2063", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "exercises/concept/vehicle-purchase/.meta/design.md", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "232133" }, { "name": "Makefile", "bytes": "1352" }, { "name": "Shell", "bytes": "1140" } ] }
<div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title">Create View</h4> </div> <div class="modal-body"> <table> <colgroup> <col width="50"> <col width="100"> </colgroup> <tr> <td>Type</td> <td> <select id="type" class="input-selectbox" title="select view type"> <option value="network">Network</option> <option value="binding">Genome Browser</option> <option value="expression">Expression Matrix</option> </select> </td> </tr> </table> </div> <div class="modal-footer"> <button class="btn btn-default" data-dismiss="modal">Close</button> <button id="btn-next" class="btn btn-primary">Next</button> </div>
{ "content_hash": "a20ec93145cb73177e935e432c0532c4", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 75, "avg_line_length": 29.96153846153846, "alnum_prop": 0.6033376123234917, "repo_name": "ViDA-NYU/genotet", "id": "f1e237c759fa5ba5f5d0af90fb741db149e4b299", "size": "779", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "templates/create-view.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "12306" }, { "name": "HTML", "bytes": "35552" }, { "name": "JavaScript", "bytes": "459711" }, { "name": "PHP", "bytes": "631" }, { "name": "Python", "bytes": "2222" }, { "name": "Shell", "bytes": "1326" } ] }
using System.Collections.Generic; using System.Net; using System.Net.Http; using System.Reflection; using System.Text; using System.Web; using System.Web.Http; using System.Web.Http.Description; using System.Web.Http.Results; using Apinterest.Contracts; using Apinterest.Resources; using Apinterest.Samples; using Apinterest.Security; using Apinterest.Time; using Apinterest.Validation; using log4net; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Serialization; namespace Apinterest { [LocalhostOnly] [ApiExplorerSettings(IgnoreApi = true)] public class ContentController : ApiController { private static readonly JsonSerializerSettings JsonSerializerSettings = new JsonSerializerSettings() { ContractResolver = new CamelCasePropertyNamesContractResolver(), Converters = new JsonConverter[] { new StringEnumConverter() } }; private readonly IRouteExplorerService _routeExplorerService; private readonly IResourceLookup _resourceLookup; private readonly TokenStrategyResolver _tokenStrategyResolver; public ContentController() { var validatorFactory = new ValidatorFactory(); var timeMachine = new TimeMachine(); var logger = LogManager.GetLogger("Apinterest"); var sampleFactory = new SampleFactory(validatorFactory, timeMachine, logger); _routeExplorerService = new RouteExplorerService(GlobalConfiguration.Configuration.Services.GetApiExplorer(), sampleFactory); _resourceLookup = new ResourceLookup(Assembly.GetExecutingAssembly()); _tokenStrategyResolver = new TokenStrategyResolver(); } [HttpGet] [Route("apinterest")] public HttpResponseMessage GetIndex() { return CreateStringResponse("index.html"); } [HttpGet] [Route("apinterest/token-strategy")] public JsonResult<TokenStrategy> GetTokenStrategy() { return Json(_tokenStrategyResolver.Resolve(), JsonSerializerSettings); } [HttpGet] [Route("apinterest/content/{*file}")] public HttpResponseMessage GetFile(string file) { return CreateStringResponse(file); } [HttpGet] [Route("apinterest/route-descriptions")] public JsonResult<IEnumerable<RouteDescriptionContract>> GetRouteDescriptions() { return Json(_routeExplorerService.GetRouteDescriptions(), JsonSerializerSettings); } private HttpResponseMessage CreateStringResponse(string file) { return new HttpResponseMessage(HttpStatusCode.OK) { Content = new StringContent(_resourceLookup.GetString(file), Encoding.UTF8, MimeMapping.GetMimeMapping(file)) }; } } }
{ "content_hash": "e3821acde80995a79c3f67cfa1f8a297", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 137, "avg_line_length": 35.082352941176474, "alnum_prop": 0.6649899396378269, "repo_name": "erikbarke/apinterest", "id": "8c489afad2285db6c7283bc2a56cc940b8e7ce81", "size": "2984", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/server/webapi/Apinterest/ContentController.cs", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "116" }, { "name": "C#", "bytes": "111173" }, { "name": "CSS", "bytes": "10344" }, { "name": "HTML", "bytes": "20282" }, { "name": "JavaScript", "bytes": "203451" }, { "name": "Smalltalk", "bytes": "320" } ] }
export const environment = { production: true, version: require('../../package.json').version, jsonPort: 3000, websocketPort: 3000, websocketPath: '/ws', };
{ "content_hash": "2d51b3c58e0c6c2d803fa559d742acb9", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 49, "avg_line_length": 23.857142857142858, "alnum_prop": 0.6706586826347305, "repo_name": "Andreas-Kreuz/ak-lua-skripte-fuer-eep", "id": "3c99bfb4c84a6492fc7ed3d1baaaf534507d363b", "size": "167", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "web-app/src/environments/environment.prod.ts", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "13442" }, { "name": "HTML", "bytes": "28937" }, { "name": "Lua", "bytes": "155167" }, { "name": "Ruby", "bytes": "73" } ] }
End of preview.

No dataset card yet

Downloads last month
5