code stringlengths 4 991k | repo_name stringlengths 6 116 | path stringlengths 4 249 | language stringclasses 30 values | license stringclasses 15 values | size int64 4 991k | input_ids listlengths 502 502 | token_type_ids listlengths 502 502 | attention_mask listlengths 502 502 | labels listlengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|
// Copyright 2017 CoreOS, Inc.
//
// 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 local
import (
"github.com/coreos/go-omaha/omaha"
)
// OmahaWrapper wraps the omaha trivial server to log any errors returned by destroy
// and doesn't return anything instead
type OmahaWrapper struct {
*omaha.TrivialServer
}
func (o OmahaWrapper) Destroy() {
if err := o.TrivialServer.Destroy(); err != nil {
plog.Errorf("Error destroying omaha server: %v", err)
}
}
| dm0-/mantle | platform/local/omaha.go | GO | apache-2.0 | 975 | [
30522,
1013,
1013,
9385,
2418,
4563,
2891,
1010,
4297,
1012,
1013,
1013,
1013,
1013,
7000,
2104,
1996,
15895,
6105,
1010,
2544,
1016,
1012,
1014,
1006,
1996,
1000,
6105,
1000,
1007,
1025,
1013,
1013,
2017,
2089,
2025,
2224,
2023,
5371,
32... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/* vim: set shiftwidth=2 tabstop=8 autoindent cindent expandtab: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/*
* a list of all CSS property aliases with data about them, for preprocessing
*/
/******
This file contains the list of all CSS properties that are just
aliases for other properties (e.g., for when we temporarily continue
to support a prefixed property after adding support for its unprefixed
form). It is designed to be used as inline input through the magic of
C preprocessing. All entries must be enclosed in the appropriate
CSS_PROP_ALIAS macro which will have cruel and unusual things done to
it.
The arguments to CSS_PROP_ALIAS are:
-. 'aliasname' entries represent a CSS property name and *must* use
only lowercase characters.
-. 'id' should be the same as the 'id' field in nsCSSPropList.h for
the property that 'aliasname' is being aliased to.
-. 'method' is the CSS2Properties property name. Unlike
nsCSSPropList.h, prefixes should just be included in this file (rather
than needing the CSS_PROP_DOMPROP_PREFIXED(prop) macro).
-. 'pref' is the name of a pref that controls whether the property
is enabled. The property is enabled if 'pref' is an empty string,
or if the boolean property whose name is 'pref' is set to true.
******/
CSS_PROP_ALIAS(-moz-transform-origin,
transform_origin,
MozTransformOrigin,
"layout.css.prefixes.transforms")
CSS_PROP_ALIAS(-moz-perspective-origin,
perspective_origin,
MozPerspectiveOrigin,
"layout.css.prefixes.transforms")
CSS_PROP_ALIAS(-moz-perspective,
perspective,
MozPerspective,
"layout.css.prefixes.transforms")
CSS_PROP_ALIAS(-moz-transform-style,
transform_style,
MozTransformStyle,
"layout.css.prefixes.transforms")
CSS_PROP_ALIAS(-moz-backface-visibility,
backface_visibility,
MozBackfaceVisibility,
"layout.css.prefixes.transforms")
CSS_PROP_ALIAS(-moz-border-image,
border_image,
MozBorderImage,
"layout.css.prefixes.border-image")
CSS_PROP_ALIAS(-moz-transition,
transition,
MozTransition,
"layout.css.prefixes.transitions")
CSS_PROP_ALIAS(-moz-transition-delay,
transition_delay,
MozTransitionDelay,
"layout.css.prefixes.transitions")
CSS_PROP_ALIAS(-moz-transition-duration,
transition_duration,
MozTransitionDuration,
"layout.css.prefixes.transitions")
CSS_PROP_ALIAS(-moz-transition-property,
transition_property,
MozTransitionProperty,
"layout.css.prefixes.transitions")
CSS_PROP_ALIAS(-moz-transition-timing-function,
transition_timing_function,
MozTransitionTimingFunction,
"layout.css.prefixes.transitions")
CSS_PROP_ALIAS(-moz-animation,
animation,
MozAnimation,
"layout.css.prefixes.animations")
CSS_PROP_ALIAS(-moz-animation-delay,
animation_delay,
MozAnimationDelay,
"layout.css.prefixes.animations")
CSS_PROP_ALIAS(-moz-animation-direction,
animation_direction,
MozAnimationDirection,
"layout.css.prefixes.animations")
CSS_PROP_ALIAS(-moz-animation-duration,
animation_duration,
MozAnimationDuration,
"layout.css.prefixes.animations")
CSS_PROP_ALIAS(-moz-animation-fill-mode,
animation_fill_mode,
MozAnimationFillMode,
"layout.css.prefixes.animations")
CSS_PROP_ALIAS(-moz-animation-iteration-count,
animation_iteration_count,
MozAnimationIterationCount,
"layout.css.prefixes.animations")
CSS_PROP_ALIAS(-moz-animation-name,
animation_name,
MozAnimationName,
"layout.css.prefixes.animations")
CSS_PROP_ALIAS(-moz-animation-play-state,
animation_play_state,
MozAnimationPlayState,
"layout.css.prefixes.animations")
CSS_PROP_ALIAS(-moz-animation-timing-function,
animation_timing_function,
MozAnimationTimingFunction,
"layout.css.prefixes.animations")
CSS_PROP_ALIAS(-moz-box-sizing,
box_sizing,
MozBoxSizing,
"layout.css.prefixes.box-sizing")
CSS_PROP_ALIAS(-moz-font-feature-settings,
font_feature_settings,
MozFontFeatureSettings,
"layout.css.prefixes.font-features")
CSS_PROP_ALIAS(-moz-font-language-override,
font_language_override,
MozFontLanguageOverride,
"layout.css.prefixes.font-features")
CSS_PROP_ALIAS(padding-inline-end,
padding_end,
PaddingInlineEnd,
"layout.css.vertical-text.enabled")
CSS_PROP_ALIAS(padding-inline-start,
padding_start,
PaddingInlineStart,
"layout.css.vertical-text.enabled")
CSS_PROP_ALIAS(margin-inline-end,
margin_end,
MarginInlineEnd,
"layout.css.vertical-text.enabled")
CSS_PROP_ALIAS(margin-inline-start,
margin_start,
MarginInlineStart,
"layout.css.vertical-text.enabled")
CSS_PROP_ALIAS(border-inline-end,
border_end,
BorderInlineEnd,
"layout.css.vertical-text.enabled")
CSS_PROP_ALIAS(border-inline-end-color,
border_end_color,
BorderInlineEndColor,
"layout.css.vertical-text.enabled")
CSS_PROP_ALIAS(border-inline-end-style,
border_end_style,
BorderInlineEndStyle,
"layout.css.vertical-text.enabled")
CSS_PROP_ALIAS(border-inline-end-width,
border_end_width,
BorderInlineEndWidth,
"layout.css.vertical-text.enabled")
CSS_PROP_ALIAS(border-inline-start,
border_start,
BorderInlineStart,
"layout.css.vertical-text.enabled")
CSS_PROP_ALIAS(border-inline-start-color,
border_start_color,
BorderInlineStartColor,
"layout.css.vertical-text.enabled")
CSS_PROP_ALIAS(border-inline-start-style,
border_start_style,
BorderInlineStartStyle,
"layout.css.vertical-text.enabled")
CSS_PROP_ALIAS(border-inline-start-width,
border_start_width,
BorderInlineStartWidth,
"layout.css.vertical-text.enabled")
| andrasigneczi/TravelOptimizer | DataCollector/mozilla/xulrunner-sdk/include/nsCSSPropAliasList.h | C | apache-2.0 | 7,006 | [
30522,
1013,
1008,
6819,
2213,
1024,
2275,
5670,
9148,
11927,
2232,
1027,
1016,
21628,
16033,
2361,
1027,
1022,
8285,
22254,
4765,
25022,
25915,
2102,
7818,
2696,
2497,
1024,
1008,
1013,
1013,
1008,
2023,
3120,
3642,
2433,
2003,
3395,
2000,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* Copyright 2012-2013 eBay Software Foundation and ios-driver committers
*
* 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.uiautomation.ios;
import com.google.common.collect.ImmutableList;
import org.libimobiledevice.ios.driver.binding.exceptions.SDKException;
import org.libimobiledevice.ios.driver.binding.model.ApplicationInfo;
import org.libimobiledevice.ios.driver.binding.model.DeviceInfo;
import org.libimobiledevice.ios.driver.binding.services.DeviceCallBack;
import org.libimobiledevice.ios.driver.binding.services.DeviceService;
import org.libimobiledevice.ios.driver.binding.services.IOSDevice;
import org.libimobiledevice.ios.driver.binding.services.ImageMountingService;
import org.libimobiledevice.ios.driver.binding.services.InformationService;
import org.libimobiledevice.ios.driver.binding.services.InstallerService;
import org.openqa.selenium.WebDriverException;
import org.uiautomation.ios.application.IPAShellApplication;
import org.uiautomation.ios.utils.DDILocator;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.logging.Logger;
public class DeviceStore extends DeviceCallBack {
private static final Logger log = Logger.getLogger(DeviceStore.class.getName());
private final List<RealDevice> reals = new CopyOnWriteArrayList<RealDevice>();
private final List<SimulatorDevice> sims = new CopyOnWriteArrayList<SimulatorDevice>();
private final ApplicationStore apps;
private final Set<String> uuidWhitelist;
public DeviceStore(ApplicationStore apps, Set<String> uuidWhitelist) {
super();
this.apps = apps;
this.uuidWhitelist = uuidWhitelist;
}
/**
* @return immutable copy of the currently available devices.
*/
public List<Device> getDevices() {
List<Device> all = new ArrayList<Device>();
all.addAll(reals);
all.addAll(sims);
return ImmutableList.copyOf(all);
}
public List<RealDevice> getRealDevices() {
return reals;
}
public List<SimulatorDevice> getSimulatorDevices() {
return sims;
}
public void add(SimulatorDevice simulatorDevice) {
sims.add(simulatorDevice);
}
@Override
protected void onDeviceAdded(String uuid) {
if (!uuidWhitelist.isEmpty() && !uuidWhitelist.contains(uuid)) {
log.info("device detected but not whitelisted");
return;
}
RealDevice d = null;
try {
IOSDevice device = DeviceService.get(uuid);
DeviceInfo info = new DeviceInfo(uuid);
d = new RealDevice(info);
log.info("new device detected (" + uuid + ") " + info.getDeviceName());
reals.add(d);
InstallerService s = new InstallerService(device);
String id = "com.apple.mobilesafari";
ApplicationInfo safari = s.getApplication(id);
String v = (String) safari.getProperty("CFBundleVersion");
log.info("device " + info.getDeviceName() + " = safari " + v);
IPAShellApplication ipa = new IPAShellApplication(id, v, safari);
apps.add(ipa);
InformationService i = new InformationService(device);
if (!i.isDevModeEnabled()) {
log.warning(
"The device " + uuid + " is not set to dev mode. It can't be used for testing.");
File ddi = DDILocator.locateDDI(device);
mount(device, ddi);
log.info("DDI mounted.Device now in dev mode.");
}
} catch (SDKException | WebDriverException e) {
if (d != null) {
reals.remove(d);
}
}
}
private void mount(IOSDevice device, File ddi) throws SDKException {
ImageMountingService service = null;
try {
service = new ImageMountingService(device);
service.mount(ddi);
} finally {
if (service != null) {
service.free();
}
}
}
@Override
protected void onDeviceRemoved(String uuid) {
if (!uuidWhitelist.isEmpty() && !uuidWhitelist.contains(uuid)) {
log.info("device removed but not whitelisted");
return;
}
for (RealDevice d : reals) {
if (d.getUuid().equals(uuid)) {
log.info("Removing " + uuid + " for the devices pool");
boolean ok = reals.remove(d);
if (!ok) {
log.warning("device " + uuid + " has been unplugged, but was never there ?");
}
}
}
}
}
| darraghgrace/ios-driver | server/src/main/java/org/uiautomation/ios/DeviceStore.java | Java | apache-2.0 | 4,836 | [
30522,
1013,
1008,
1008,
9385,
2262,
1011,
2286,
1041,
15907,
4007,
3192,
1998,
16380,
1011,
4062,
10797,
7747,
1008,
1008,
7000,
2104,
1996,
15895,
6105,
1010,
2544,
1016,
1012,
1014,
1006,
1996,
1000,
6105,
1000,
1007,
1025,
2017,
2089,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*----------------------------------------------------------------------------/
/ Petit FatFs - FAT file system module R0.02a (C)ChaN, 2010
/-----------------------------------------------------------------------------/
/ Petit FatFs module is an open source software to implement FAT file system to
/ small embedded systems. This is a free software and is opened for education,
/ research and commercial developments under license policy of following trems.
/
/ Copyright (C) 2010, ChaN, all right reserved.
/
/ * The Petit FatFs module is a free software and there is NO WARRANTY.
/ * No restriction on use. You can use, modify and redistribute it for
/ personal, non-profit or commercial use UNDER YOUR RESPONSIBILITY.
/ * Redistributions of source code must retain the above copyright notice.
/
/-----------------------------------------------------------------------------/
/ Jun 15,'09 R0.01a First release. (Branched from FatFs R0.07b.)
/
/ Dec 14,'09 R0.02 Added multiple code page support.
/ Added write funciton.
/ Changed stream read mode interface.
/ Dec 07,'10 R0.02a Added some configuration options.
/ Fixed fails to open objects with DBCS character.
/----------------------------------------------------------------------------*/
#include "pff.h" /* Petit FatFs configurations and declarations */
#include "diskio.h" /* Declarations of low level disk I/O functions */
/*--------------------------------------------------------------------------
Module Private Definitions
---------------------------------------------------------------------------*/
#if _FS_FAT32
#define LD_CLUST(dir) (((DWORD)LD_WORD(dir+DIR_FstClusHI)<<16) | LD_WORD(dir+DIR_FstClusLO))
#else
#define LD_CLUST(dir) LD_WORD(dir+DIR_FstClusLO)
#endif
/*--------------------------------------------------------*/
/* DBCS code ranges and SBCS extend char conversion table */
#if _CODE_PAGE == 932 /* Japanese Shift-JIS */
#define _DF1S 0x81 /* DBC 1st byte range 1 start */
#define _DF1E 0x9F /* DBC 1st byte range 1 end */
#define _DF2S 0xE0 /* DBC 1st byte range 2 start */
#define _DF2E 0xFC /* DBC 1st byte range 2 end */
#define _DS1S 0x40 /* DBC 2nd byte range 1 start */
#define _DS1E 0x7E /* DBC 2nd byte range 1 end */
#define _DS2S 0x80 /* DBC 2nd byte range 2 start */
#define _DS2E 0xFC /* DBC 2nd byte range 2 end */
#elif _CODE_PAGE == 936 /* Simplified Chinese GBK */
#define _DF1S 0x81
#define _DF1E 0xFE
#define _DS1S 0x40
#define _DS1E 0x7E
#define _DS2S 0x80
#define _DS2E 0xFE
#elif _CODE_PAGE == 949 /* Korean */
#define _DF1S 0x81
#define _DF1E 0xFE
#define _DS1S 0x41
#define _DS1E 0x5A
#define _DS2S 0x61
#define _DS2E 0x7A
#define _DS3S 0x81
#define _DS3E 0xFE
#elif _CODE_PAGE == 950 /* Traditional Chinese Big5 */
#define _DF1S 0x81
#define _DF1E 0xFE
#define _DS1S 0x40
#define _DS1E 0x7E
#define _DS2S 0xA1
#define _DS2E 0xFE
#elif _CODE_PAGE == 437 /* U.S. (OEM) */
#define _DF1S 0
#define _EXCVT {0x80,0x9A,0x90,0x41,0x8E,0x41,0x8F,0x80,0x45,0x45,0x45,0x49,0x49,0x49,0x8E,0x8F,0x90,0x92,0x92,0x4F,0x99,0x4F,0x55,0x55,0x59,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \
0x41,0x49,0x4F,0x55,0xA5,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0x21,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
#elif _CODE_PAGE == 720 /* Arabic (OEM) */
#define _DF1S 0
#define _EXCVT {0x80,0x81,0x45,0x41,0x84,0x41,0x86,0x43,0x45,0x45,0x45,0x49,0x49,0x8D,0x8E,0x8F,0x90,0x92,0x92,0x93,0x94,0x95,0x49,0x49,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \
0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
#elif _CODE_PAGE == 737 /* Greek (OEM) */
#define _DF1S 0
#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x92,0x92,0x93,0x94,0x95,0x96,0x97,0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87, \
0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0xAA,0x92,0x93,0x94,0x95,0x96,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
0x97,0xEA,0xEB,0xEC,0xE4,0xED,0xEE,0xE7,0xE8,0xF1,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
#elif _CODE_PAGE == 775 /* Baltic (OEM) */
#define _DF1S 0
#define _EXCVT {0x80,0x9A,0x91,0xA0,0x8E,0x95,0x8F,0x80,0xAD,0xED,0x8A,0x8A,0xA1,0x8D,0x8E,0x8F,0x90,0x92,0x92,0xE2,0x99,0x95,0x96,0x97,0x97,0x99,0x9A,0x9D,0x9C,0x9D,0x9E,0x9F, \
0xA0,0xA1,0xE0,0xA3,0xA3,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xB5,0xB6,0xB7,0xB8,0xBD,0xBE,0xC6,0xC7,0xA5,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
0xE0,0xE1,0xE2,0xE3,0xE5,0xE5,0xE6,0xE3,0xE8,0xE8,0xEA,0xEA,0xEE,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
#elif _CODE_PAGE == 850 /* Multilingual Latin 1 (OEM) */
#define _DF1S 0
#define _EXCVT {0x80,0x9A,0x90,0xB6,0x8E,0xB7,0x8F,0x80,0xD2,0xD3,0xD4,0xD8,0xD7,0xDE,0x8E,0x8F,0x90,0x92,0x92,0xE2,0x99,0xE3,0xEA,0xEB,0x59,0x99,0x9A,0x9D,0x9C,0x9D,0x9E,0x9F, \
0xB5,0xD6,0xE0,0xE9,0xA5,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0x21,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC7,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
0xE0,0xE1,0xE2,0xE3,0xE5,0xE5,0xE6,0xE7,0xE7,0xE9,0xEA,0xEB,0xED,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
#elif _CODE_PAGE == 852 /* Latin 2 (OEM) */
#define _DF1S 0
#define _EXCVT {0x80,0x9A,0x90,0xB6,0x8E,0xDE,0x8F,0x80,0x9D,0xD3,0x8A,0x8A,0xD7,0x8D,0x8E,0x8F,0x90,0x91,0x91,0xE2,0x99,0x95,0x95,0x97,0x97,0x99,0x9A,0x9B,0x9B,0x9D,0x9E,0x9F, \
0xB5,0xD6,0xE0,0xE9,0xA4,0xA4,0xA6,0xA6,0xA8,0xA8,0xAA,0x8D,0xAC,0xB8,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBD,0xBF, \
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC6,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD1,0xD1,0xD2,0xD3,0xD2,0xD5,0xD6,0xD7,0xB7,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
0xE0,0xE1,0xE2,0xE3,0xE3,0xD5,0xE6,0xE6,0xE8,0xE9,0xE8,0xEB,0xED,0xED,0xDD,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xEB,0xFC,0xFC,0xFE,0xFF}
#elif _CODE_PAGE == 855 /* Cyrillic (OEM) */
#define _DF1S 0
#define _EXCVT {0x81,0x81,0x83,0x83,0x85,0x85,0x87,0x87,0x89,0x89,0x8B,0x8B,0x8D,0x8D,0x8F,0x8F,0x91,0x91,0x93,0x93,0x95,0x95,0x97,0x97,0x99,0x99,0x9B,0x9B,0x9D,0x9D,0x9F,0x9F, \
0xA1,0xA1,0xA3,0xA3,0xA5,0xA5,0xA7,0xA7,0xA9,0xA9,0xAB,0xAB,0xAD,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB6,0xB6,0xB8,0xB8,0xB9,0xBA,0xBB,0xBC,0xBE,0xBE,0xBF, \
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC7,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD1,0xD1,0xD3,0xD3,0xD5,0xD5,0xD7,0xD7,0xDD,0xD9,0xDA,0xDB,0xDC,0xDD,0xE0,0xDF, \
0xE0,0xE2,0xE2,0xE4,0xE4,0xE6,0xE6,0xE8,0xE8,0xEA,0xEA,0xEC,0xEC,0xEE,0xEE,0xEF,0xF0,0xF2,0xF2,0xF4,0xF4,0xF6,0xF6,0xF8,0xF8,0xFA,0xFA,0xFC,0xFC,0xFD,0xFE,0xFF}
#elif _CODE_PAGE == 857 /* Turkish (OEM) */
#define _DF1S 0
#define _EXCVT {0x80,0x9A,0x90,0xB6,0x8E,0xB7,0x8F,0x80,0xD2,0xD3,0xD4,0xD8,0xD7,0x98,0x8E,0x8F,0x90,0x92,0x92,0xE2,0x99,0xE3,0xEA,0xEB,0x98,0x99,0x9A,0x9D,0x9C,0x9D,0x9E,0x9E, \
0xB5,0xD6,0xE0,0xE9,0xA5,0xA5,0xA6,0xA6,0xA8,0xA9,0xAA,0xAB,0xAC,0x21,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC7,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
0xE0,0xE1,0xE2,0xE3,0xE5,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xDE,0x59,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
#elif _CODE_PAGE == 858 /* Multilingual Latin 1 + Euro (OEM) */
#define _DF1S 0
#define _EXCVT {0x80,0x9A,0x90,0xB6,0x8E,0xB7,0x8F,0x80,0xD2,0xD3,0xD4,0xD8,0xD7,0xDE,0x8E,0x8F,0x90,0x92,0x92,0xE2,0x99,0xE3,0xEA,0xEB,0x59,0x99,0x9A,0x9D,0x9C,0x9D,0x9E,0x9F, \
0xB5,0xD6,0xE0,0xE9,0xA5,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0x21,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC7,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD1,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
0xE0,0xE1,0xE2,0xE3,0xE5,0xE5,0xE6,0xE7,0xE7,0xE9,0xEA,0xEB,0xED,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
#elif _CODE_PAGE == 862 /* Hebrew (OEM) */
#define _DF1S 0
#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \
0x41,0x49,0x4F,0x55,0xA5,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0x21,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
#elif _CODE_PAGE == 866 /* Russian (OEM) */
#define _DF1S 0
#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \
0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
0x90,0x91,0x92,0x93,0x9d,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,0xF0,0xF0,0xF2,0xF2,0xF4,0xF4,0xF6,0xF6,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
#elif _CODE_PAGE == 874 /* Thai (OEM, Windows) */
#define _DF1S 0
#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \
0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
#elif _CODE_PAGE == 1250 /* Central Europe (Windows) */
#define _DF1S 0
#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x8A,0x9B,0x8C,0x8D,0x8E,0x8F, \
0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xA3,0xB4,0xB5,0xB6,0xB7,0xB8,0xA5,0xAA,0xBB,0xBC,0xBD,0xBC,0xAF, \
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF}
#elif _CODE_PAGE == 1251 /* Cyrillic (Windows) */
#define _DF1S 0
#define _EXCVT {0x80,0x81,0x82,0x82,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x80,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x8A,0x9B,0x8C,0x8D,0x8E,0x8F, \
0xA0,0xA2,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB2,0xA5,0xB5,0xB6,0xB7,0xA8,0xB9,0xAA,0xBB,0xA3,0xBD,0xBD,0xAF, \
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF}
#elif _CODE_PAGE == 1252 /* Latin 1 (Windows) */
#define _DF1S 0
#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0xAd,0x9B,0x8C,0x9D,0xAE,0x9F, \
0xA0,0x21,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0x9F}
#elif _CODE_PAGE == 1253 /* Greek (Windows) */
#define _DF1S 0
#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \
0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xA2,0xB8,0xB9,0xBA, \
0xE0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xF2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xFB,0xBC,0xFD,0xBF,0xFF}
#elif _CODE_PAGE == 1254 /* Turkish (Windows) */
#define _DF1S 0
#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x8A,0x9B,0x8C,0x9D,0x9E,0x9F, \
0xA0,0x21,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0x9F}
#elif _CODE_PAGE == 1255 /* Hebrew (Windows) */
#define _DF1S 0
#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \
0xA0,0x21,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
#elif _CODE_PAGE == 1256 /* Arabic (Windows) */
#define _DF1S 0
#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x8C,0x9D,0x9E,0x9F, \
0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
0x41,0xE1,0x41,0xE3,0xE4,0xE5,0xE6,0x43,0x45,0x45,0x45,0x45,0xEC,0xED,0x49,0x49,0xF0,0xF1,0xF2,0xF3,0x4F,0xF5,0xF6,0xF7,0xF8,0x55,0xFA,0x55,0x55,0xFD,0xFE,0xFF}
#elif _CODE_PAGE == 1257 /* Baltic (Windows) */
#define _DF1S 0
#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \
0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xA8,0xB9,0xAA,0xBB,0xBC,0xBD,0xBE,0xAF, \
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF}
#elif _CODE_PAGE == 1258 /* Vietnam (OEM, Windows) */
#define _DF1S 0
#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0xAC,0x9D,0x9E,0x9F, \
0xA0,0x21,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xEC,0xCD,0xCE,0xCF,0xD0,0xD1,0xF2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xFE,0x9F}
#elif _CODE_PAGE == 1 /* ASCII (for only non-LFN cfg) */
#define _DF1S 0
#else
#error Unknown code page
#endif
/* Character code support macros */
#define IsUpper(c) (((c)>='A')&&((c)<='Z'))
#define IsLower(c) (((c)>='a')&&((c)<='z'))
#define IsDigit(c) (((c)>='0')&&((c)<='9'))
#if _DF1S /* DBCS configuration */
#ifdef _DF2S /* Two 1st byte areas */
#define IsDBCS1(c) (((BYTE)(c) >= _DF1S && (BYTE)(c) <= _DF1E) || ((BYTE)(c) >= _DF2S && (BYTE)(c) <= _DF2E))
#else /* One 1st byte area */
#define IsDBCS1(c) ((BYTE)(c) >= _DF1S && (BYTE)(c) <= _DF1E)
#endif
#ifdef _DS3S /* Three 2nd byte areas */
#define IsDBCS2(c) (((BYTE)(c) >= _DS1S && (BYTE)(c) <= _DS1E) || ((BYTE)(c) >= _DS2S && (BYTE)(c) <= _DS2E) || ((BYTE)(c) >= _DS3S && (BYTE)(c) <= _DS3E))
#else /* Two 2nd byte areas */
#define IsDBCS2(c) (((BYTE)(c) >= _DS1S && (BYTE)(c) <= _DS1E) || ((BYTE)(c) >= _DS2S && (BYTE)(c) <= _DS2E))
#endif
#else /* SBCS configuration */
#define IsDBCS1(c) 0
#define IsDBCS2(c) 0
#endif /* _DF1S */
/* FatFs refers the members in the FAT structures with byte offset instead
/ of structure member because there are incompatibility of the packing option
/ between various compilers. */
#define BS_jmpBoot 0
#define BS_OEMName 3
#define BPB_BytsPerSec 11
#define BPB_SecPerClus 13
#define BPB_RsvdSecCnt 14
#define BPB_NumFATs 16
#define BPB_RootEntCnt 17
#define BPB_TotSec16 19
#define BPB_Media 21
#define BPB_FATSz16 22
#define BPB_SecPerTrk 24
#define BPB_NumHeads 26
#define BPB_HiddSec 28
#define BPB_TotSec32 32
#define BS_55AA 510
#define BS_DrvNum 36
#define BS_BootSig 38
#define BS_VolID 39
#define BS_VolLab 43
#define BS_FilSysType 54
#define BPB_FATSz32 36
#define BPB_ExtFlags 40
#define BPB_FSVer 42
#define BPB_RootClus 44
#define BPB_FSInfo 48
#define BPB_BkBootSec 50
#define BS_DrvNum32 64
#define BS_BootSig32 66
#define BS_VolID32 67
#define BS_VolLab32 71
#define BS_FilSysType32 82
#define MBR_Table 446
#define DIR_Name 0
#define DIR_Attr 11
#define DIR_NTres 12
#define DIR_CrtTime 14
#define DIR_CrtDate 16
#define DIR_FstClusHI 20
#define DIR_WrtTime 22
#define DIR_WrtDate 24
#define DIR_FstClusLO 26
#define DIR_FileSize 28
/*--------------------------------------------------------------------------
Private Functions
---------------------------------------------------------------------------*/
static
FATFS *FatFs; /* Pointer to the file system object (logical drive) */
/* Fill memory */
static
void mem_set (void* dst, int val, int cnt) {
char *d = (char*)dst;
while (cnt--) *d++ = (char)val;
}
/* Compare memory to memory */
static
int mem_cmp (const void* dst, const void* src, int cnt) {
const char *d = (const char *)dst, *s = (const char *)src;
int r = 0;
while (cnt-- && (r = *d++ - *s++) == 0) ;
return r;
}
/*-----------------------------------------------------------------------*/
/* FAT access - Read value of a FAT entry */
/*-----------------------------------------------------------------------*/
static
CLUST get_fat ( /* 1:IO error, Else:Cluster status */
CLUST clst /* Cluster# to get the link information */
)
{
#if _FS_FAT12
WORD wc, bc, ofs;
#endif
BYTE buf[4];
FATFS *fs = FatFs;
if (clst < 2 || clst >= fs->n_fatent) /* Range check */
return 1;
switch (fs->fs_type) {
#if _FS_FAT12
case FS_FAT12 :
bc = (WORD)clst; bc += bc / 2;
ofs = bc % 512; bc /= 512;
if (ofs != 511) {
if (disk_readp(buf, fs->fatbase + bc, ofs, 2)) break;
} else {
if (disk_readp(buf, fs->fatbase + bc, 511, 1)) break;
if (disk_readp(buf+1, fs->fatbase + bc + 1, 0, 1)) break;
}
wc = LD_WORD(buf);
return (clst & 1) ? (wc >> 4) : (wc & 0xFFF);
#endif
case FS_FAT16 :
if (disk_readp(buf, fs->fatbase + clst / 256, (WORD)(((WORD)clst % 256) * 2), 2)) break;
return LD_WORD(buf);
#if _FS_FAT32
case FS_FAT32 :
if (disk_readp(buf, fs->fatbase + clst / 128, (WORD)(((WORD)clst % 128) * 4), 4)) break;
return LD_DWORD(buf) & 0x0FFFFFFF;//(((DWORD)buf[3]<<24)|((DWORD)buf[2]<<16)|((DWORD)buf[1]<<8)|((DWORD)buf[0])) & 0x0FFFFFFF;//LD_DWORD(buf) & 0x0FFFFFFF;
#endif
}
return 1; /* An error occured at the disk I/O layer */
}
/*-----------------------------------------------------------------------*/
/* Get sector# from cluster# */
/*-----------------------------------------------------------------------*/
static
DWORD clust2sect ( /* !=0: Sector number, 0: Failed - invalid cluster# */
CLUST clst /* Cluster# to be converted */
)
{
FATFS *fs = FatFs;
clst -= 2;
if (clst >= (fs->n_fatent - 2)) return 0; /* Invalid cluster# */
return (DWORD)clst * fs->csize + fs->database;
}
/*-----------------------------------------------------------------------*/
/* Directory handling - Rewind directory index */
/*-----------------------------------------------------------------------*/
static
FRESULT dir_rewind (
DIR *dj /* Pointer to directory object */
)
{
CLUST clst;
FATFS *fs = FatFs;
dj->index = 0;
clst = dj->sclust;
if (clst == 1 || clst >= fs->n_fatent) /* Check start cluster range */
return FR_DISK_ERR;
if (_FS_FAT32 && !clst && fs->fs_type == FS_FAT32) /* Replace cluster# 0 with root cluster# if in FAT32 */
clst = (CLUST)fs->dirbase;
dj->clust = clst; /* Current cluster */
dj->sect = clst ? clust2sect(clst) : fs->dirbase; /* Current sector */
return FR_OK; /* Seek succeeded */
}
/*-----------------------------------------------------------------------*/
/* Directory handling - Move directory index next */
/*-----------------------------------------------------------------------*/
static
FRESULT dir_next ( /* FR_OK:Succeeded, FR_NO_FILE:End of table */
DIR *dj /* Pointer to directory object */
)
{
CLUST clst;
WORD i;
FATFS *fs = FatFs;
i = dj->index + 1;
if (!i || !dj->sect) /* Report EOT when index has reached 65535 */
return FR_NO_FILE;
if (!(i % 16)) { /* Sector changed? */
dj->sect++; /* Next sector */
if (dj->clust == 0) { /* Static table */
if (i >= fs->n_rootdir) /* Report EOT when end of table */
return FR_NO_FILE;
}
else { /* Dynamic table */
if (((i / 16) & (fs->csize-1)) == 0) { /* Cluster changed? */
clst = get_fat(dj->clust); /* Get next cluster */
if (clst <= 1) return FR_DISK_ERR;
if (clst >= fs->n_fatent) /* When it reached end of dynamic table */
return FR_NO_FILE; /* Report EOT */
dj->clust = clst; /* Initialize data for new cluster */
dj->sect = clust2sect(clst);
}
}
}
dj->index = i;
return FR_OK;
}
/*-----------------------------------------------------------------------*/
/* Directory handling - Find an object in the directory */
/*-----------------------------------------------------------------------*/
static
FRESULT dir_find (
DIR *dj, /* Pointer to the directory object linked to the file name */
BYTE *dir /* 32-byte working buffer */
)
{
FRESULT res;
BYTE c;
res = dir_rewind(dj); /* Rewind directory object */
if (res != FR_OK) return res;
do {
res = disk_readp(dir, dj->sect, (WORD)((dj->index % 16) * 32), 32) /* Read an entry */
? FR_DISK_ERR : FR_OK;
if (res != FR_OK) break;
c = dir[DIR_Name]; /* First character */
if (c == 0) { res = FR_NO_FILE; break; } /* Reached to end of table */
if (!(dir[DIR_Attr] & AM_VOL) && !mem_cmp(dir, dj->fn, 11)) /* Is it a valid entry? */
break;
res = dir_next(dj); /* Next entry */
} while (res == FR_OK);
return res;
}
/*-----------------------------------------------------------------------*/
/* Read an object from the directory */
/*-----------------------------------------------------------------------*/
#if _USE_DIR
static
FRESULT dir_read (
DIR *dj, /* Pointer to the directory object to store read object name */
BYTE *dir /* 32-byte working buffer */
)
{
FRESULT res;
BYTE a, c;
res = FR_NO_FILE;
while (dj->sect) {
res = disk_readp(dir, dj->sect, (WORD)((dj->index % 16) * 32), 32) /* Read an entry */
? FR_DISK_ERR : FR_OK;
if (res != FR_OK) break;
c = dir[DIR_Name];
if (c == 0) { res = FR_NO_FILE; break; } /* Reached to end of table */
a = dir[DIR_Attr] & AM_MASK;
if (c != 0xE5 && c != '.' && !(a & AM_VOL)) /* Is it a valid entry? */
break;
res = dir_next(dj); /* Next entry */
if (res != FR_OK) break;
}
if (res != FR_OK) dj->sect = 0;
return res;
}
#endif
/*-----------------------------------------------------------------------*/
/* Pick a segment and create the object name in directory form */
/*-----------------------------------------------------------------------*/
#ifdef _EXCVT
static const BYTE cvt[] = _EXCVT;
#endif
static
FRESULT create_name (
DIR *dj, /* Pointer to the directory object */
const char **path /* Pointer to pointer to the segment in the path string */
)
{
BYTE c, d, ni, si, i, *sfn;
const char *p;
/* Create file name in directory form */
sfn = dj->fn;
mem_set(sfn, ' ', 11);
si = i = 0; ni = 8;
p = *path;
for (;;) {
c = p[si++];
if (c <= ' ' || c == '/') break; /* Break on end of segment */
if (c == '.' || i >= ni) {
if (ni != 8 || c != '.') break;
i = 8; ni = 11;
continue;
}
#ifdef _EXCVT
if (c >= 0x80) /* To upper extended char (SBCS) */
c = cvt[c - 0x80];
#endif
if (IsDBCS1(c) && i < ni - 1) { /* DBC 1st byte? */
d = p[si++]; /* Get 2nd byte */
sfn[i++] = c;
sfn[i++] = d;
} else { /* Single byte code */
if (IsLower(c)) c -= 0x20; /* toupper */
sfn[i++] = c;
}
}
*path = &p[si]; /* Rerurn pointer to the next segment */
sfn[11] = (c <= ' ') ? 1 : 0; /* Set last segment flag if end of path */
return FR_OK;
}
/*-----------------------------------------------------------------------*/
/* Get file information from directory entry */
/*-----------------------------------------------------------------------*/
#if _USE_DIR
static
void get_fileinfo ( /* No return code */
DIR *dj, /* Pointer to the directory object */
BYTE *dir, /* 32-byte working buffer */
FILINFO *fno /* Pointer to store the file information */
)
{
BYTE i, c;
char *p;
p = fno->fname;
if (dj->sect) {
for (i = 0; i < 8; i++) { /* Copy file name body */
c = dir[i];
if (c == ' ') break;
if (c == 0x05) c = 0xE5;
*p++ = c;
}
if (dir[8] != ' ') { /* Copy file name extension */
*p++ = '.';
for (i = 8; i < 11; i++) {
c = dir[i];
if (c == ' ') break;
*p++ = c;
}
}
fno->fattrib = dir[DIR_Attr]; /* Attribute */
fno->fsize = LD_DWORD(dir+DIR_FileSize); /* Size */
fno->fdate = LD_WORD(dir+DIR_WrtDate); /* Date */
fno->ftime = LD_WORD(dir+DIR_WrtTime); /* Time */
}
*p = 0;
}
#endif /* _USE_DIR */
/*-----------------------------------------------------------------------*/
/* Follow a file path */
/*-----------------------------------------------------------------------*/
static
FRESULT follow_path ( /* FR_OK(0): successful, !=0: error code */
DIR *dj, /* Directory object to return last directory and found object */
BYTE *dir, /* 32-byte working buffer */
const char *path /* Full-path string to find a file or directory */
)
{
FRESULT res;
while (*path == ' ') path++; /* Skip leading spaces */
if (*path == '/') path++; /* Strip heading separator */
dj->sclust = 0; /* Set start directory (always root dir) */
if ((BYTE)*path <= ' ') { /* Null path means the root directory */
res = dir_rewind(dj);
dir[0] = 0;
} else { /* Follow path */
for (;;) {
res = create_name(dj, &path); /* Get a segment */
if (res != FR_OK) break;
res = dir_find(dj, dir); /* Find it */
if (res != FR_OK) { /* Could not find the object */
if (res == FR_NO_FILE && !*(dj->fn+11))
res = FR_NO_PATH;
break;
}
if (*(dj->fn+11)) break; /* Last segment match. Function completed. */
if (!(dir[DIR_Attr] & AM_DIR)) { /* Cannot follow because it is a file */
res = FR_NO_PATH; break;
}
dj->sclust = LD_CLUST(dir);
}
}
return res;
}
/*-----------------------------------------------------------------------*/
/* Check a sector if it is an FAT boot record */
/*-----------------------------------------------------------------------*/
static
BYTE check_fs ( /* 0:The FAT boot record, 1:Valid boot record but not an FAT, 2:Not a boot record, 3:Error */
BYTE *buf, /* Working buffer */
DWORD sect /* Sector# (lba) to check if it is an FAT boot record or not */
)
{
if (disk_readp(buf, sect, 510, 2)) /* Read the boot sector */
return 3;
if (LD_WORD(buf) != 0xAA55) /* Check record signature */
return 2;
if (!disk_readp(buf, sect, BS_FilSysType, 2) && LD_WORD(buf) == 0x4146) /* Check FAT12/16 */
return 0;
if (_FS_FAT32 && !disk_readp(buf, sect, BS_FilSysType32, 2) && LD_WORD(buf) == 0x4146) /* Check FAT32 */
return 0;
return 1;
}
/*--------------------------------------------------------------------------
Public Functions
--------------------------------------------------------------------------*/
/*-----------------------------------------------------------------------*/
/* Mount/Unmount a Locical Drive */
/*-----------------------------------------------------------------------*/
FRESULT pf_mount (
FATFS *fs /* Pointer to new file system object (NULL: Unmount) */
)
{
BYTE fmt, buf[36];
DWORD bsect, fsize, tsect, mclst;
BYTE resTest;
FatFs = 0;
if (!fs) return FR_OK; /* Unregister fs object */
resTest = disk_initialize() ;
if (resTest& STA_NOINIT) /* Check if the drive is ready or not */
return FR_NOT_READY;
/* Search FAT partition on the drive */
bsect = 0;
fmt = check_fs(buf, bsect); /* Check sector 0 as an SFD format */
if (fmt == 1) { /* Not an FAT boot record, it may be FDISK format */
/* Check a partition listed in top of the partition table */
if (disk_readp(buf, bsect, MBR_Table, 16)) { /* 1st partition entry */
fmt = 3;
} else {
if (buf[4]) { /* Is the partition existing? */
bsect = LD_DWORD(&buf[8]); /* Partition offset in LBA */
fmt = check_fs(buf, bsect); /* Check the partition */
}
}
}
if (fmt == 3) return FR_DISK_ERR;
if (fmt) return FR_NO_FILESYSTEM; /* No valid FAT patition is found */
/* Initialize the file system object */
if (disk_readp(buf, bsect, 13, sizeof(buf))) return FR_DISK_ERR;
fsize = LD_WORD(buf+BPB_FATSz16-13); /* Number of sectors per FAT */
if (!fsize) fsize = LD_DWORD(buf+BPB_FATSz32-13);
fsize *= buf[BPB_NumFATs-13]; /* Number of sectors in FAT area */
fs->fatbase = bsect + LD_WORD(buf+BPB_RsvdSecCnt-13); /* FAT start sector (lba) */
fs->csize = buf[BPB_SecPerClus-13]; /* Number of sectors per cluster */
fs->n_rootdir = LD_WORD(buf+BPB_RootEntCnt-13); /* Nmuber of root directory entries */
tsect = LD_WORD(buf+BPB_TotSec16-13); /* Number of sectors on the file system */
if (!tsect) tsect = LD_DWORD(buf+BPB_TotSec32-13);
mclst = (tsect /* Last cluster# + 1 */
- LD_WORD(buf+BPB_RsvdSecCnt-13) - fsize - fs->n_rootdir / 16
) / fs->csize + 2;
fs->n_fatent = (CLUST)mclst;
fmt = FS_FAT16; /* Determine the FAT sub type */
if (mclst < 0xFF7) /* Number of clusters < 0xFF5 */
#if _FS_FAT12
fmt = FS_FAT12;
#else
return FR_NO_FILESYSTEM;
#endif
if (mclst >= 0xFFF7) /* Number of clusters >= 0xFFF5 */
#if _FS_FAT32
fmt = FS_FAT32;
#else
return FR_NO_FILESYSTEM;
#endif
fs->fs_type = fmt; /* FAT sub-type */
if (_FS_FAT32 && fmt == FS_FAT32)
fs->dirbase = LD_DWORD(buf+(BPB_RootClus-13)); /* Root directory start cluster */
else
fs->dirbase = fs->fatbase + fsize; /* Root directory start sector (lba) */
fs->database = fs->fatbase + fsize + fs->n_rootdir / 16; /* Data start sector (lba) */
fs->flag = 0;
FatFs = fs;
return FR_OK;
}
/*-----------------------------------------------------------------------*/
/* Open or Create a File */
/*-----------------------------------------------------------------------*/
FRESULT pf_open (
const char *path /* Pointer to the file name */
)
{
FRESULT res;
DIR dj;
BYTE sp[12], dir[32];
FATFS *fs = FatFs;
if (!fs) /* Check file system */
return FR_NOT_ENABLED;
fs->flag = 0;
dj.fn = sp;
res = follow_path(&dj, dir, path); /* Follow the file path */
if (res != FR_OK) return res; /* Follow failed */
if (!dir[0] || (dir[DIR_Attr] & AM_DIR)) /* It is a directory */
return FR_NO_FILE;
fs->org_clust = LD_CLUST(dir); /* File start cluster */
fs->fsize = LD_DWORD(dir+DIR_FileSize); /* File size */
fs->fptr = 0; /* File pointer */
fs->flag = FA_OPENED;
return FR_OK;
}
/*-----------------------------------------------------------------------*/
/* Read File */
/*-----------------------------------------------------------------------*/
#if _USE_READ
FRESULT pf_read (
void* buff, /* Pointer to the read buffer (NULL:Forward data to the stream)*/
WORD btr, /* Number of bytes to read */
WORD* br /* Pointer to number of bytes read */
)
{
DRESULT dr;
CLUST clst;
DWORD sect, remain;
WORD rcnt;
BYTE cs, *rbuff = buff;
FATFS *fs = FatFs;
*br = 0;
if (!fs) return FR_NOT_ENABLED; /* Check file system */
if (!(fs->flag & FA_OPENED)) /* Check if opened */
return FR_NOT_OPENED;
remain = fs->fsize - fs->fptr;
if (btr > remain) btr = (WORD)remain; /* Truncate btr by remaining bytes */
while (btr) { /* Repeat until all data transferred */
if ((fs->fptr % 512) == 0) { /* On the sector boundary? */
cs = (BYTE)(fs->fptr / 512 & (fs->csize - 1)); /* Sector offset in the cluster */
if (!cs) { /* On the cluster boundary? */
clst = (fs->fptr == 0) ? /* On the top of the file? */
fs->org_clust : get_fat(fs->curr_clust);
if (clst <= 1) goto fr_abort;
fs->curr_clust = clst; /* Update current cluster */
}
sect = clust2sect(fs->curr_clust); /* Get current sector */
if (!sect) goto fr_abort;
fs->dsect = sect + cs;
}
rcnt = (WORD)(512 - (fs->fptr % 512)); /* Get partial sector data from sector buffer */
if (rcnt > btr) rcnt = btr;
dr = disk_readp(!buff ? 0 : rbuff, fs->dsect, (WORD)(fs->fptr % 512), rcnt);
if (dr) goto fr_abort;
fs->fptr += rcnt; rbuff += rcnt; /* Update pointers and counters */
btr -= rcnt; *br += rcnt;
}
return FR_OK;
fr_abort:
fs->flag = 0;
return FR_DISK_ERR;
}
#endif
/*-----------------------------------------------------------------------*/
/* Write File */
/*-----------------------------------------------------------------------*/
#if _USE_WRITE
FRESULT pf_write (
const void* buff, /* Pointer to the data to be written */
WORD btw, /* Number of bytes to write (0:Finalize the current write operation) */
WORD* bw /* Pointer to number of bytes written */
)
{
CLUST clst;
DWORD sect, remain;
const BYTE *p = buff;
BYTE cs;
WORD wcnt;
FATFS *fs = FatFs;
*bw = 0;
if (!fs) return FR_NOT_ENABLED; /* Check file system */
if (!(fs->flag & FA_OPENED)) /* Check if opened */
return FR_NOT_OPENED;
if (!btw) { /* Finalize request */
if ((fs->flag & FA__WIP) && disk_writep(0, 0)) goto fw_abort;
fs->flag &= ~FA__WIP;
return FR_OK;
} else { /* Write data request */
if (!(fs->flag & FA__WIP)) /* Round-down fptr to the sector boundary */
fs->fptr &= 0xFFFFFE00;
}
remain = fs->fsize - fs->fptr;
if (btw > remain) btw = (WORD)remain; /* Truncate btw by remaining bytes */
while (btw) { /* Repeat until all data transferred */
if (((WORD)fs->fptr % 512) == 0) { /* On the sector boundary? */
cs = (BYTE)(fs->fptr / 512 & (fs->csize - 1)); /* Sector offset in the cluster */
if (!cs) { /* On the cluster boundary? */
clst = (fs->fptr == 0) ? /* On the top of the file? */
fs->org_clust : get_fat(fs->curr_clust);
if (clst <= 1) goto fw_abort;
fs->curr_clust = clst; /* Update current cluster */
}
sect = clust2sect(fs->curr_clust); /* Get current sector */
if (!sect) goto fw_abort;
fs->dsect = sect + cs;
if (disk_writep(0, fs->dsect)) goto fw_abort; /* Initiate a sector write operation */
fs->flag |= FA__WIP;
}
wcnt = 512 - ((WORD)fs->fptr % 512); /* Number of bytes to write to the sector */
if (wcnt > btw) wcnt = btw;
if (disk_writep(p, wcnt)) goto fw_abort; /* Send data to the sector */
fs->fptr += wcnt; p += wcnt; /* Update pointers and counters */
btw -= wcnt; *bw += wcnt;
if (((WORD)fs->fptr % 512) == 0) {
if (disk_writep(0, 0)) goto fw_abort; /* Finalize the currtent secter write operation */
fs->flag &= ~FA__WIP;
}
}
return FR_OK;
fw_abort:
fs->flag = 0;
return FR_DISK_ERR;
}
#endif
/*-----------------------------------------------------------------------*/
/* Seek File R/W Pointer */
/*-----------------------------------------------------------------------*/
#if _USE_LSEEK
FRESULT pf_lseek (
DWORD ofs /* File pointer from top of file */
)
{
CLUST clst;
DWORD bcs, sect, ifptr;
FATFS *fs = FatFs;
if (!fs) return FR_NOT_ENABLED; /* Check file system */
if (!(fs->flag & FA_OPENED)) /* Check if opened */
return FR_NOT_OPENED;
if (ofs > fs->fsize) ofs = fs->fsize; /* Clip offset with the file size */
ifptr = fs->fptr;
fs->fptr = 0;
if (ofs > 0) {
bcs = (DWORD)fs->csize * 512; /* Cluster size (byte) */
if (ifptr > 0 &&
(ofs - 1) / bcs >= (ifptr - 1) / bcs) { /* When seek to same or following cluster, */
fs->fptr = (ifptr - 1) & ~(bcs - 1); /* start from the current cluster */
ofs -= fs->fptr;
clst = fs->curr_clust;
} else { /* When seek to back cluster, */
clst = fs->org_clust; /* start from the first cluster */
fs->curr_clust = clst;
}
while (ofs > bcs) { /* Cluster following loop */
clst = get_fat(clst); /* Follow cluster chain */
if (clst <= 1 || clst >= fs->n_fatent) goto fe_abort;
fs->curr_clust = clst;
fs->fptr += bcs;
ofs -= bcs;
}
fs->fptr += ofs;
sect = clust2sect(clst); /* Current sector */
if (!sect) goto fe_abort;
fs->dsect = sect + (fs->fptr / 512 & (fs->csize - 1));
}
return FR_OK;
fe_abort:
fs->flag = 0;
return FR_DISK_ERR;
}
#endif
/*-----------------------------------------------------------------------*/
/* Create a Directory Object */
/*-----------------------------------------------------------------------*/
#if _USE_DIR
FRESULT pf_opendir (
DIR *dj, /* Pointer to directory object to create */
const char *path /* Pointer to the directory path */
)
{
FRESULT res;
BYTE sp[12], dir[32];
FATFS *fs = FatFs;
if (!fs) { /* Check file system */
res = FR_NOT_ENABLED;
} else {
dj->fn = sp;
res = follow_path(dj, dir, path); /* Follow the path to the directory */
if (res == FR_OK) { /* Follow completed */
if (dir[0]) { /* It is not the root dir */
if (dir[DIR_Attr] & AM_DIR) /* The object is a directory */
dj->sclust = LD_CLUST(dir);
else /* The object is not a directory */
res = FR_NO_PATH;
}
if (res == FR_OK)
res = dir_rewind(dj); /* Rewind dir */
}
if (res == FR_NO_FILE) res = FR_NO_PATH;
}
return res;
}
/*-----------------------------------------------------------------------*/
/* Read Directory Entry in Sequense */
/*-----------------------------------------------------------------------*/
FRESULT pf_readdir (
DIR *dj, /* Pointer to the open directory object */
FILINFO *fno /* Pointer to file information to return */
)
{
FRESULT res;
BYTE sp[12], dir[32]; //32
FATFS *fs = FatFs;
if (!fs) { /* Check file system */
res = FR_NOT_ENABLED;
} else {
dj->fn = sp;
if (!fno) {
res = dir_rewind(dj);
} else {
res = dir_read(dj, dir);
if (res == FR_NO_FILE) {
dj->sect = 0;
res = FR_OK;
}
if (res == FR_OK) { /* A valid entry is found */
get_fileinfo(dj, dir, fno); /* Get the object information */
res = dir_next(dj); /* Increment index for next */
if (res == FR_NO_FILE) {
dj->sect = 0;
res = FR_OK;
}
}
}
}
return res;
}
#endif /* _USE_DIR */
#if _USE_STRFUNC
/*-----------------------------------------------------------------------*/
/* Get a string from the file */
/*-----------------------------------------------------------------------*/
#if _USE_READ
CHAR* pf_gets (
CHAR* buff, /* Pointer to the string buffer to read */
WORD len /* Size of string buffer (characters) */
//FIL* fil /* Pointer to the file object */
)
{
int n = 0;
CHAR c, *p = buff;
BYTE s[2];
WORD rc;
while (n < len - 1) { /* Read bytes until buffer gets filled */
pf_read(s, 1, &rc);
if (rc != 1) break; /* Break on EOF or error */
c = s[0];
#if _USE_STRFUNC >= 2
if (c == '\r') continue; /* Strip '\r' */
#endif
*p++ = c;
n++;
if (c == '\n') break; /* Break on EOL */
}
*p = 0;
return n ? buff : 0; /* When no data read (eof or error), return with error. */
}
#endif
#if _USE_WRITE
//#include <stdarg.h>
/*-----------------------------------------------------------------------*/
/* Put a character to the file */
/*-----------------------------------------------------------------------*/
int pf_putc (
CHAR c /* A character to be output */
//FIL* fil /* Pointer to the file object */
)
{
WORD bw;//, btw;
//BYTE s[3];
//char chr;
#if _USE_STRFUNC >= 2
// UINT res = 0;
if (c == '\n') pf_putc ('\r'); /* LF -> CRLF conversion */
// {
// res = pf_putc ('\r'); /* LF -> CRLF conversion */
// if (res == 0) return EOF;
// }
#endif
//c = (BYTE)c;
//pf_write(s, btw, &bw); /* Write the char to the file */
pf_write(&c, 1, &bw);
// if(bw == 1){ return (bw + res);
// //if(res == 0) return 1;
// //else return 2;
// }
// else return EOF;
return (bw == 1) ? 1 : EOF; /* Return the result */
}
/*-----------------------------------------------------------------------*/
/* Put a string to the file */
/*-----------------------------------------------------------------------*/
int pf_puts (
const CHAR* str /* Pointer to the string to be output */
//FIL* fil /* Pointer to the file object */
)
{
int n;
for (n = 0; *str; str++, n++) {
if (pf_putc(*str) == EOF) return EOF;
}
return n;
}
#endif /* _USE_WRITE */
#endif /* _USE_STRFUNC */ | jgvinholi/Amas | classes.old/PFatFs/utility/pff.c | C | gpl-3.0 | 46,633 | [
30522,
1013,
1008,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
#include <compiler.h>
#if defined(CPUCORE_IA32) && defined(SUPPORT_MEMDBG32)
#include <common/strres.h>
#include <cpucore.h>
#include <pccore.h>
#include <io/iocore.h>
#include <generic/memdbg32.h>
#define MEMDBG32_MAXMEM 16
#define MEMDBG32_DATAPERLINE 128
#define MEMDBG32_LEFTMARGIN 8
typedef struct {
UINT mode;
int width;
int height;
int bpp;
CMNPAL pal[MEMDBG32_PALS];
} MEMDBG32;
static MEMDBG32 memdbg32;
static const char _mode0[] = "Real Mode";
static const char _mode1[] = "Protected Mode";
static const char _mode2[] = "Virtual86";
static const char *modestr[3] = {_mode0, _mode1, _mode2};
static const RGB32 md32pal[MEMDBG32_PALS] = {
RGB32D(0x33, 0x33, 0x33),
RGB32D(0x00, 0x00, 0x00),
RGB32D(0xff, 0xaa, 0x00),
RGB32D(0xff, 0x00, 0x00),
RGB32D(0x11, 0x88, 0x11),
RGB32D(0x00, 0xff, 0x00),
RGB32D(0xff, 0xff, 0xff)};
void memdbg32_initialize(void) {
ZeroMemory(&memdbg32, sizeof(memdbg32));
memdbg32.width = (MEMDBG32_BLOCKW * MEMDBG32_DATAPERLINE) + MEMDBG32_LEFTMARGIN;
memdbg32.height = (MEMDBG32_BLOCKH * 2 * MEMDBG32_MAXMEM) + 8;
}
void memdbg32_getsize(int *width, int *height) {
if (width) {
*width = memdbg32.width;
}
if (height) {
*height = memdbg32.height;
}
}
REG8 memdbg32_process(void) {
return(MEMDBG32_FLAGDRAW);
}
BOOL memdbg32_paint(CMNVRAM *vram, CMNPALCNV cnv, BOOL redraw) {
UINT mode;
UINT8 use[MEMDBG32_MAXMEM*MEMDBG32_DATAPERLINE*2 + 256];
UINT32 pd[1024];
UINT pdmax;
UINT i, j;
UINT32 pde;
UINT32 pdea;
UINT32 pte;
char str[4];
mode = 0;
if (CPU_STAT_PM) {
mode = 1;
}
if (CPU_STAT_VM86) {
mode = 2;
}
if (memdbg32.mode != mode) {
memdbg32.mode = mode;
redraw = TRUE;
}
if ((!redraw) && (!CPU_STAT_PAGING)) {
return(FALSE);
}
if (vram == NULL) {
return(FALSE);
}
if ((memdbg32.bpp != vram->bpp) || (redraw)) {
if (cnv == NULL) {
return(FALSE);
}
(*cnv)(memdbg32.pal, md32pal, MEMDBG32_PALS, vram->bpp);
memdbg32.bpp = vram->bpp;
}
cmndraw_fill(vram, 0, 0, memdbg32.width, memdbg32.height,
memdbg32.pal[MEMDBG32_PALBDR]);
ZeroMemory(use, sizeof(use));
if (CPU_STAT_PAGING) {
pdmax = 0;
for (i=0; i<1024; i++) {
pde = cpu_memoryread_d(CPU_STAT_PDE_BASE + (i * 4));
if (pde & CPU_PDE_PRESENT) {
for (j=0; j<pdmax; j++) {
if (!((pde ^ pd[j]) & CPU_PDE_BASEADDR_MASK)) {
break;
}
}
if (j < pdmax) {
pd[j] |= pde & CPU_PDE_ACCESS;
}
else {
pd[pdmax++] = pde;
}
}
}
for (i=0; i<pdmax; i++) {
pde = pd[i];
pdea = pde & CPU_PDE_BASEADDR_MASK;
for (j=0; j<1024; j++) {
pte = cpu_memoryread_d(pdea + (j * 4));
if ((pte & CPU_PTE_PRESENT) && (pte < 0x1000000/16*MEMDBG32_MAXMEM/128*MEMDBG32_DATAPERLINE)) {
if ((pde & CPU_PDE_ACCESS) && (pte & CPU_PTE_ACCESS)) {
use[pte >> 12] = MEMDBG32_PALPAGE1;
}
else if (!use[pte >> 12]) {
use[pte >> 12] = MEMDBG32_PALPAGE0;
}
}
}
}
}
else {
FillMemory(use, 256, MEMDBG32_PALREAL);
FillMemory(use + (0xfa0000 >> 12), (0x60000 >> 12), MEMDBG32_PALREAL);
if ((CPU_STAT_PM) && (pccore.extmem)) {
FillMemory(use + 256, MIN(MEMDBG32_DATAPERLINE * 2 * pccore.extmem, sizeof(use) - 256), MEMDBG32_PALPM);
}
}
for (i=0; i<MEMDBG32_MAXMEM*2; i++) {
for (j=0; j<MEMDBG32_DATAPERLINE; j++) {
cmndraw_fill(vram, MEMDBG32_LEFTMARGIN + j * MEMDBG32_BLOCKW, i * MEMDBG32_BLOCKH,
MEMDBG32_BLOCKW - 1, MEMDBG32_BLOCKH - 1,
memdbg32.pal[use[(i * MEMDBG32_DATAPERLINE) + j]]);
}
}
for (i=0; i<MEMDBG32_MAXMEM; i++) {
SPRINTF(str, "%x", i);
cmddraw_text8(vram, 0, i * MEMDBG32_BLOCKH * 2, str,
memdbg32.pal[MEMDBG32_PALTXT]);
}
cmddraw_text8(vram, 0, memdbg32.height - 8, modestr[mode],
memdbg32.pal[MEMDBG32_PALTXT]);
return(TRUE);
}
#endif
| AZO234/NP2kai | generic/memdbg32.c | C | mit | 3,962 | [
30522,
1001,
2421,
1026,
21624,
1012,
1044,
1028,
1001,
2065,
4225,
1006,
17368,
17345,
1035,
24264,
16703,
1007,
1004,
1004,
4225,
1006,
2490,
1035,
2033,
26876,
2497,
2290,
16703,
1007,
1001,
2421,
1026,
2691,
1013,
2358,
14343,
2015,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta content="Craig McClellan" name="author">
<title>Craig McClellan - T223790026553700353 </title>
<link href="/assets/css/style.css" rel="stylesheet">
<link href="/assets/css/highlight.css" rel="stylesheet">
<link rel="stylesheet" href="/custom.css">
<link rel="shortcut icon" href="https://micro.blog/craigmcclellan/favicon.png" type="image/x-icon" />
<link rel="alternate" type="application/rss+xml" title="Craig McClellan" href="http://craigmcclellan.com/feed.xml" />
<link rel="alternate" type="application/json" title="Craig McClellan" href="http://craigmcclellan.com/feed.json" />
<link rel="EditURI" type="application/rsd+xml" href="/rsd.xml" />
<link rel="me" href="https://micro.blog/craigmcclellan" />
<link rel="me" href="https://twitter.com/craigmcclellan" />
<link rel="me" href="https://github.com/craigwmcclellan" />
<link rel="authorization_endpoint" href="https://micro.blog/indieauth/auth" />
<link rel="token_endpoint" href="https://micro.blog/indieauth/token" />
<link rel="micropub" href="https://micro.blog/micropub" />
<link rel="webmention" href="https://micro.blog/webmention" />
<link rel="subscribe" href="https://micro.blog/users/follow" />
</head>
<body>
<nav class="main-nav">
<a class="normal" href="/"> <span class="arrow">←</span> Home</a>
<a href="/archive/">Archive</a>
<a href="/about/">About</a>
<a href="/tools-of-choice/">Tools of Choice</a>
<a class="cta" href="https://micro.blog/craigmcclellan" rel="me">Also on Micro.blog</a>
</nav>
<section id="wrapper">
<article class="h-entry post">
<header>
<h2 class="headline">
<time class="dt-published" datetime="2012-07-13 09:44:34 -0500">
<a class="u-url dates" href="/2012/07/13/t223790026553700353.html">July 13, 2012</a>
</time>
</h2>
</header>
<section class="e-content post-body">
<p>Week 3 of 5 is done! Now headed back to Nashville with @ericvinson to see our Lauras.</p>
</section>
</article>
<section id="post-meta" class="clearfix">
<a href="/">
<img class="u-photo avatar" src="https://micro.blog/craigmcclellan/avatar.jpg">
<div>
<span class="p-author h-card dark">Craig McClellan</span>
<span><a href="https://micro.blog/craigmcclellan">@craigmcclellan</a></span>
</div>
</a>
</section>
</section>
<footer id="footer">
<section id="wrapper">
<ul>
<li><a href="/feed.xml">RSS</a></li>
<li><a href="/feed.json">JSON Feed</a></li>
<li><a href="https://micro.blog/craigmcclellan" rel="me">Micro.blog</a></li>
<!-- <li><a class="u-email" href="mailto:" rel="me">Email</a></li> -->
</ul>
<form method="get" id="search" action="https://duckduckgo.com/">
<input type="hidden" name="sites" value="http://craigmcclellan.com"/>
<input type="hidden" name="k8" value="#444444"/>
<input type="hidden" name="k9" value="#ee4792"/>
<input type="hidden" name="kt" value="h"/>
<input class="field" type="text" name="q" maxlength="255" placeholder="To search, type and hit Enter…"/>
<input type="submit" value="Search" style="display: none;" />
</form>
</section>
</footer>
</body>
</html>
| craigwmcclellan/craigwmcclellan.github.io | _site/2012/07/13/t223790026553700353.html | HTML | mit | 4,844 | [
30522,
1026,
999,
9986,
13874,
16129,
1028,
1026,
16129,
11374,
1027,
1000,
4372,
1000,
1028,
1026,
2132,
1028,
1026,
18804,
25869,
13462,
1027,
1000,
21183,
2546,
1011,
1022,
1000,
1028,
1026,
18804,
8299,
1011,
1041,
15549,
2615,
1027,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>The source code</title>
<link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="../resources/prettify/prettify.js"></script>
<style type="text/css">
.highlight { display: block; background-color: #ddd; }
</style>
<script type="text/javascript">
function highlight() {
document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
}
</script>
</head>
<body onload="prettyPrint(); highlight();">
<pre class="prettyprint lang-js"><span id='Ext-form-Labelable'>/**
</span> * A mixin which allows a component to be configured and decorated with a label and/or error message as is
* common for form fields. This is used by e.g. Ext.form.field.Base and Ext.form.FieldContainer
* to let them be managed by the Field layout.
*
* NOTE: This mixin is mainly for internal library use and most users should not need to use it directly. It
* is more likely you will want to use one of the component classes that import this mixin, such as
* Ext.form.field.Base or Ext.form.FieldContainer.
*
* Use of this mixin does not make a component a field in the logical sense, meaning it does not provide any
* logic or state related to values or validation; that is handled by the related Ext.form.field.Field
* mixin. These two mixins may be used separately (for example Ext.form.FieldContainer is Labelable but not a
* Field), or in combination (for example Ext.form.field.Base implements both and has logic for connecting the
* two.)
*
* Component classes which use this mixin should use the Field layout
* or a derivation thereof to properly size and position the label and message according to the component config.
* They must also call the {@link #initLabelable} method during component initialization to ensure the mixin gets
* set up correctly.
*
* @docauthor Jason Johnston <jason@sencha.com>
*/
Ext.define("Ext.form.Labelable", {
requires: ['Ext.XTemplate'],
<span id='Ext-form-Labelable-property-autoEl'> autoEl: {
</span> tag: 'table',
cellpadding: 0
},
<span id='Ext-form-Labelable-property-childEls'> childEls: [
</span><span id='Ext-form-Labelable-property-labelCell'> /**
</span> * @property {Ext.Element} labelCell
* The `<TD>` Element which contains the label Element for this component. Only available after the component has been rendered.
*/
'labelCell',
<span id='Ext-form-Labelable-property-labelEl'> /**
</span> * @property {Ext.Element} labelEl
* The label Element for this component. Only available after the component has been rendered.
*/
'labelEl',
<span id='Ext-form-Labelable-property-bodyEl'> /**
</span> * @property {Ext.Element} bodyEl
* The div Element wrapping the component's contents. Only available after the component has been rendered.
*/
'bodyEl',
// private - the TD which contains the msgTarget: 'side' error icon
'sideErrorCell',
<span id='Ext-form-Labelable-property-errorEl'> /**
</span> * @property {Ext.Element} errorEl
* The div Element that will contain the component's error message(s). Note that depending on the configured
* {@link #msgTarget}, this element may be hidden in favor of some other form of presentation, but will always
* be present in the DOM for use by assistive technologies.
*/
'errorEl',
'inputRow'
],
<span id='Ext-form-Labelable-cfg-labelableRenderTpl'> /**
</span> * @cfg {String/String[]/Ext.XTemplate} labelableRenderTpl
* The rendering template for the field decorations. Component classes using this mixin
* should include logic to use this as their {@link Ext.AbstractComponent#renderTpl renderTpl},
* and implement the {@link #getSubTplMarkup} method to generate the field body content.
*
* The structure of a field is a table as follows:
*
* If `labelAlign: 'left', `msgTarget: 'side'`
*
* +----------------------+----------------------+-------------+
* | Label: | InputField | sideErrorEl |
* +----------------------+----------------------+-------------+
*
* If `labelAlign: 'left', `msgTarget: 'under'`
*
* +----------------------+------------------------------------+
* | Label: | InputField (colspan=2) |
* | | underErrorEl |
* +----------------------+------------------------------------+
*
* If `labelAlign: 'top', `msgTarget: 'side'`
*
* +---------------------------------------------+-------------+
* | label | |
* | InputField | sideErrorEl |
* +---------------------------------------------+-------------+
*
* If `labelAlign: 'top', `msgTarget: 'under'`
*
* +-----------------------------------------------------------+
* | label |
* | InputField (colspan=2) |
* | underErrorEl |
* +-----------------------------------------------------------+
*
* The total columns always the same for fields with each setting of {@link #labelAlign} because when
* rendered into a {@link Ext.layout.container.Form} layout, just the `TR` of the table
* will be placed into the form's main `TABLE`, and the columns of all the siblings
* must match so that they all line up. In a {@link Ext.layout.container.Form} layout, different
* settings of {@link #labelAlign} are not supported because of the incompatible column structure.
*
* When the triggerCell or side error cell are hidden or shown, the input cell's colspan
* is recalculated to maintain the correct 3 visible column count.
* @private
*/
labelableRenderTpl: [
// body row. If a heighted Field (eg TextArea, HtmlEditor, this must greedily consume height.
'<tr id="{id}-inputRow" <tpl if="inFormLayout">id="{id}"</tpl>>',
// Label cell
'<tpl if="labelOnLeft">',
'<td id="{id}-labelCell" style="{labelCellStyle}" {labelCellAttrs}>',
'{beforeLabelTpl}',
'<label id="{id}-labelEl" {labelAttrTpl}<tpl if="inputId"> for="{inputId}"</tpl> class="{labelCls}"',
'<tpl if="labelStyle"> style="{labelStyle}"</tpl>',
// Required for Opera
' unselectable="on"',
'>',
'{beforeLabelTextTpl}',
'<tpl if="fieldLabel">{fieldLabel}{labelSeparator}</tpl>',
'{afterLabelTextTpl}',
'</label>',
'{afterLabelTpl}',
'</td>',
'</tpl>',
// Body of the input. That will be an input element, or, from a TriggerField, a table containing an input cell and trigger cell(s)
'<td class="{baseBodyCls} {fieldBodyCls}" id="{id}-bodyEl" colspan="{bodyColspan}" role="presentation">',
'{beforeBodyEl}',
// Label just sits on top of the input field if labelAlign === 'top'
'<tpl if="labelAlign==\'top\'">',
'{beforeLabelTpl}',
'<div id="{id}-labelCell" style="{labelCellStyle}">',
'<label id="{id}-labelEl" {labelAttrTpl}<tpl if="inputId"> for="{inputId}"</tpl> class="{labelCls}"',
'<tpl if="labelStyle"> style="{labelStyle}"</tpl>',
// Required for Opera
' unselectable="on"',
'>',
'{beforeLabelTextTpl}',
'<tpl if="fieldLabel">{fieldLabel}{labelSeparator}</tpl>',
'{afterLabelTextTpl}',
'</label>',
'</div>',
'{afterLabelTpl}',
'</tpl>',
'{beforeSubTpl}',
'{[values.$comp.getSubTplMarkup(values)]}',
'{afterSubTpl}',
// Final TD. It's a side error element unless there's a floating external one
'<tpl if="msgTarget===\'side\'">',
'{afterBodyEl}',
'</td>',
'<td id="{id}-sideErrorCell" vAlign="{[values.labelAlign===\'top\' && !values.hideLabel ? \'bottom\' : \'middle\']}" style="{[values.autoFitErrors ? \'display:none\' : \'\']}" width="{errorIconWidth}">',
'<div id="{id}-errorEl" class="{errorMsgCls}" style="display:none"></div>',
'</td>',
'<tpl elseif="msgTarget==\'under\'">',
'<div id="{id}-errorEl" class="{errorMsgClass}" colspan="2" style="display:none"></div>',
'{afterBodyEl}',
'</td>',
'</tpl>',
'</tr>',
{
disableFormats: true
}
],
<span id='Ext-form-Labelable-cfg-activeErrorsTpl'> /**
</span> * @cfg {String/String[]/Ext.XTemplate} activeErrorsTpl
* The template used to format the Array of error messages passed to {@link #setActiveErrors} into a single HTML
* string. if the {@link #msgTarget} is title, it defaults to a list separated by new lines. Otherwise, it
* renders each message as an item in an unordered list.
*/
activeErrorsTpl: undefined,
<span id='Ext-form-Labelable-property-htmlActiveErrorsTpl'> htmlActiveErrorsTpl: [
</span> '<tpl if="errors && errors.length">',
'<ul class="{listCls}"><tpl for="errors"><li>{.}</li></tpl></ul>',
'</tpl>'
],
<span id='Ext-form-Labelable-property-plaintextActiveErrorsTpl'> plaintextActiveErrorsTpl: [
</span> '<tpl if="errors && errors.length">',
'<tpl for="errors"><tpl if="xindex &gt; 1">\n</tpl>{.}</tpl>',
'</tpl>'
],
<span id='Ext-form-Labelable-property-isFieldLabelable'> /**
</span> * @property {Boolean} isFieldLabelable
* Flag denoting that this object is labelable as a field. Always true.
*/
isFieldLabelable: true,
<span id='Ext-form-Labelable-cfg-formItemCls'> /**
</span> * @cfg {String} formItemCls
* A CSS class to be applied to the outermost element to denote that it is participating in the form field layout.
*/
formItemCls: Ext.baseCSSPrefix + 'form-item',
<span id='Ext-form-Labelable-cfg-labelCls'> /**
</span> * @cfg {String} labelCls
* The CSS class to be applied to the label element. This (single) CSS class is used to formulate the renderSelector
* and drives the field layout where it is concatenated with a hyphen ('-') and {@link #labelAlign}. To add
* additional classes, use {@link #labelClsExtra}.
*/
labelCls: Ext.baseCSSPrefix + 'form-item-label',
<span id='Ext-form-Labelable-cfg-labelClsExtra'> /**
</span> * @cfg {String} labelClsExtra
* An optional string of one or more additional CSS classes to add to the label element. Defaults to empty.
*/
<span id='Ext-form-Labelable-cfg-errorMsgCls'> /**
</span> * @cfg {String} errorMsgCls
* The CSS class to be applied to the error message element.
*/
errorMsgCls: Ext.baseCSSPrefix + 'form-error-msg',
<span id='Ext-form-Labelable-cfg-baseBodyCls'> /**
</span> * @cfg {String} baseBodyCls
* The CSS class to be applied to the body content element.
*/
baseBodyCls: Ext.baseCSSPrefix + 'form-item-body',
<span id='Ext-form-Labelable-cfg-fieldBodyCls'> /**
</span> * @cfg {String} fieldBodyCls
* An extra CSS class to be applied to the body content element in addition to {@link #baseBodyCls}.
*/
fieldBodyCls: '',
<span id='Ext-form-Labelable-cfg-clearCls'> /**
</span> * @cfg {String} clearCls
* The CSS class to be applied to the special clearing div rendered directly after the field contents wrapper to
* provide field clearing.
*/
clearCls: Ext.baseCSSPrefix + 'clear',
<span id='Ext-form-Labelable-cfg-invalidCls'> /**
</span> * @cfg {String} invalidCls
* The CSS class to use when marking the component invalid.
*/
invalidCls : Ext.baseCSSPrefix + 'form-invalid',
<span id='Ext-form-Labelable-cfg-fieldLabel'> /**
</span> * @cfg {String} fieldLabel
* The label for the field. It gets appended with the {@link #labelSeparator}, and its position and sizing is
* determined by the {@link #labelAlign}, {@link #labelWidth}, and {@link #labelPad} configs.
*/
fieldLabel: undefined,
<span id='Ext-form-Labelable-cfg-labelAlign'> /**
</span> * @cfg {String} labelAlign
* Controls the position and alignment of the {@link #fieldLabel}. Valid values are:
*
* - "left" (the default) - The label is positioned to the left of the field, with its text aligned to the left.
* Its width is determined by the {@link #labelWidth} config.
* - "top" - The label is positioned above the field.
* - "right" - The label is positioned to the left of the field, with its text aligned to the right.
* Its width is determined by the {@link #labelWidth} config.
*/
labelAlign : 'left',
<span id='Ext-form-Labelable-cfg-labelWidth'> /**
</span> * @cfg {Number} labelWidth
* The width of the {@link #fieldLabel} in pixels. Only applicable if the {@link #labelAlign} is set to "left" or
* "right".
*/
labelWidth: 100,
<span id='Ext-form-Labelable-cfg-labelPad'> /**
</span> * @cfg {Number} labelPad
* The amount of space in pixels between the {@link #fieldLabel} and the input field.
*/
labelPad : 5,
//<locale>
<span id='Ext-form-Labelable-cfg-labelSeparator'> /**
</span> * @cfg {String} labelSeparator
* Character(s) to be inserted at the end of the {@link #fieldLabel label text}.
*
* Set to empty string to hide the separator completely.
*/
labelSeparator : ':',
//</locale>
<span id='Ext-form-Labelable-cfg-labelStyle'> /**
</span> * @cfg {String} labelStyle
* A CSS style specification string to apply directly to this field's label.
*/
<span id='Ext-form-Labelable-cfg-hideLabel'> /**
</span> * @cfg {Boolean} hideLabel
* Set to true to completely hide the label element ({@link #fieldLabel} and {@link #labelSeparator}). Also see
* {@link #hideEmptyLabel}, which controls whether space will be reserved for an empty fieldLabel.
*/
hideLabel: false,
<span id='Ext-form-Labelable-cfg-hideEmptyLabel'> /**
</span> * @cfg {Boolean} hideEmptyLabel
* When set to true, the label element ({@link #fieldLabel} and {@link #labelSeparator}) will be automatically
* hidden if the {@link #fieldLabel} is empty. Setting this to false will cause the empty label element to be
* rendered and space to be reserved for it; this is useful if you want a field without a label to line up with
* other labeled fields in the same form.
*
* If you wish to unconditionall hide the label even if a non-empty fieldLabel is configured, then set the
* {@link #hideLabel} config to true.
*/
hideEmptyLabel: true,
<span id='Ext-form-Labelable-cfg-preventMark'> /**
</span> * @cfg {Boolean} preventMark
* true to disable displaying any {@link #setActiveError error message} set on this object.
*/
preventMark: false,
<span id='Ext-form-Labelable-cfg-autoFitErrors'> /**
</span> * @cfg {Boolean} autoFitErrors
* Whether to adjust the component's body area to make room for 'side' or 'under' {@link #msgTarget error messages}.
*/
autoFitErrors: true,
<span id='Ext-form-Labelable-cfg-msgTarget'> /**
</span> * @cfg {String} msgTarget
* The location where the error message text should display. Must be one of the following values:
*
* - `qtip` Display a quick tip containing the message when the user hovers over the field.
* This is the default.
*
* **{@link Ext.tip.QuickTipManager#init} must have been called for this setting to work.**
*
* - `title` Display the message in a default browser title attribute popup.
* - `under` Add a block div beneath the field containing the error message.
* - `side` Add an error icon to the right of the field, displaying the message in a popup on hover.
* - `none` Don't display any error message. This might be useful if you are implementing custom error display.
* - `[element id]` Add the error message directly to the innerHTML of the specified element.
*/
msgTarget: 'qtip',
<span id='Ext-form-Labelable-cfg-activeError'> /**
</span> * @cfg {String} activeError
* If specified, then the component will be displayed with this value as its active error when first rendered. Use
* {@link #setActiveError} or {@link #unsetActiveError} to change it after component creation.
*/
<span id='Ext-form-Labelable-property-noWrap'> /**
</span> * @private
* Tells the layout system that the height can be measured immediately because the width does not need setting.
*/
noWrap: true,
<span id='Ext-form-Labelable-property-labelableInsertions'> labelableInsertions: [
</span>
<span id='Ext-form-Labelable-cfg-beforeBodyEl'> /**
</span> * @cfg {String/Array/Ext.XTemplate} beforeBodyEl
* An optional string or `XTemplate` configuration to insert in the field markup
* at the beginning of the input containing element. If an `XTemplate` is used, the component's {@link Ext.AbstractComponent#renderData render data}
* serves as the context.
*/
'beforeBodyEl',
<span id='Ext-form-Labelable-cfg-afterBodyEl'> /**
</span> * @cfg {String/Array/Ext.XTemplate} afterBodyEl
* An optional string or `XTemplate` configuration to insert in the field markup
* at the end of the input containing element. If an `XTemplate` is used, the component's {@link Ext.AbstractComponent#renderData render data}
* serves as the context.
*/
'afterBodyEl',
<span id='Ext-form-Labelable-cfg-beforeLabelTpl'> /**
</span> * @cfg {String/Array/Ext.XTemplate} beforeLabelTpl
* An optional string or `XTemplate` configuration to insert in the field markup
* before the label element. If an `XTemplate` is used, the component's {@link Ext.AbstractComponent#renderData render data}
* serves as the context.
*/
'beforeLabelTpl',
<span id='Ext-form-Labelable-cfg-afterLabelTpl'> /**
</span> * @cfg {String/Array/Ext.XTemplate} afterLabelTpl
* An optional string or `XTemplate` configuration to insert in the field markup
* after the label element. If an `XTemplate` is used, the component's {@link Ext.AbstractComponent#renderData render data}
* serves as the context.
*/
'afterLabelTpl',
<span id='Ext-form-Labelable-cfg-beforeSubTpl'> /**
</span> * @cfg {String/Array/Ext.XTemplate} beforeSubTpl
* An optional string or `XTemplate` configuration to insert in the field markup
* before the {@link #getSubTplMarkup subTpl markup}. If an `XTemplate` is used, the
* component's {@link Ext.AbstractComponent#renderData render data} serves as the context.
*/
'beforeSubTpl',
<span id='Ext-form-Labelable-cfg-afterSubTpl'> /**
</span> * @cfg {String/Array/Ext.XTemplate} afterSubTpl
* An optional string or `XTemplate` configuration to insert in the field markup
* after the {@link #getSubTplMarkup subTpl markup}. If an `XTemplate` is used, the
* component's {@link Ext.AbstractComponent#renderData render data} serves as the context.
*/
'afterSubTpl',
<span id='Ext-form-Labelable-cfg-beforeLabelTextTpl'> /**
</span> * @cfg {String/Array/Ext.XTemplate} beforeLabelTextTpl
* An optional string or `XTemplate` configuration to insert in the field markup
* before the label text. If an `XTemplate` is used, the component's {@link Ext.AbstractComponent#renderData render data}
* serves as the context.
*/
'beforeLabelTextTpl',
<span id='Ext-form-Labelable-cfg-afterLabelTextTpl'> /**
</span> * @cfg {String/Array/Ext.XTemplate} afterLabelTextTpl
* An optional string or `XTemplate` configuration to insert in the field markup
* after the label text. If an `XTemplate` is used, the component's {@link Ext.AbstractComponent#renderData render data}
* serves as the context.
*/
'afterLabelTextTpl',
<span id='Ext-form-Labelable-cfg-labelAttrTpl'> /**
</span> * @cfg {String/Array/Ext.XTemplate} labelAttrTpl
* An optional string or `XTemplate` configuration to insert in the field markup
* inside the label element (as attributes). If an `XTemplate` is used, the component's
* {@link Ext.AbstractComponent#renderData render data} serves as the context.
*/
'labelAttrTpl'
],
<span id='Ext-form-Labelable-property-labelableRenderProps'> // This is an array to avoid a split on every call to Ext.copyTo
</span> labelableRenderProps: [ 'allowBlank', 'id', 'labelAlign', 'fieldBodyCls', 'baseBodyCls',
'clearCls', 'labelSeparator', 'msgTarget' ],
<span id='Ext-form-Labelable-method-initLabelable'> /**
</span> * Performs initialization of this mixin. Component classes using this mixin should call this method during their
* own initialization.
*/
initLabelable: function() {
var me = this,
padding = me.padding;
// This Component is rendered as a table. Padding doesn't work on tables
// Before padding can be applied to the encapsulating table element, copy the padding into
// an extraMargins property which is to be added to all computed margins post render :(
if (padding) {
me.padding = undefined;
me.extraMargins = Ext.Element.parseBox(padding);
}
if (!me.activeErrorsTpl) {
if (me.msgTarget == 'title') {
me.activeErrorsTpl = me.plaintextActiveErrorsTpl;
} else {
me.activeErrorsTpl = me.htmlActiveErrorsTpl;
}
}
me.addCls(Ext.plainTableCls);
me.addCls(me.formItemCls);
// Prevent first render of active error, at Field render time from signalling a change from undefined to "
me.lastActiveError = '';
me.addEvents(
<span id='Ext-form-Labelable-event-errorchange'> /**
</span> * @event errorchange
* Fires when the active error message is changed via {@link #setActiveError}.
* @param {Ext.form.Labelable} this
* @param {String} error The active error message
*/
'errorchange'
);
// bubbleEvents on the prototype of a mixin won't work, so call enableBubble
me.enableBubble('errorchange');
},
<span id='Ext-form-Labelable-method-trimLabelSeparator'> /**
</span> * Returns the trimmed label by slicing off the label separator character. Can be overridden.
* @return {String} The trimmed field label, or empty string if not defined
*/
trimLabelSeparator: function() {
var me = this,
separator = me.labelSeparator,
label = me.fieldLabel || '',
lastChar = label.substr(label.length - 1);
// if the last char is the same as the label separator then slice it off otherwise just return label value
return lastChar === separator ? label.slice(0, -1) : label;
},
<span id='Ext-form-Labelable-method-getFieldLabel'> /**
</span> * Returns the label for the field. Defaults to simply returning the {@link #fieldLabel} config. Can be overridden
* to provide a custom generated label.
* @template
* @return {String} The configured field label, or empty string if not defined
*/
getFieldLabel: function() {
return this.trimLabelSeparator();
},
<span id='Ext-form-Labelable-method-setFieldLabel'> /**
</span> * Set the label of this field.
* @param {String} label The new label. The {@link #labelSeparator} will be automatically appended to the label
* string.
*/
setFieldLabel: function(label){
label = label || '';
var me = this,
separator = me.labelSeparator,
labelEl = me.labelEl;
me.fieldLabel = label;
if (me.rendered) {
if (Ext.isEmpty(label) && me.hideEmptyLabel) {
labelEl.parent().setDisplayed('none');
} else {
if (separator) {
label = me.trimLabelSeparator() + separator;
}
labelEl.update(label);
labelEl.parent().setDisplayed('');
}
me.updateLayout();
}
},
<span id='Ext-form-Labelable-method-getInsertionRenderData'> getInsertionRenderData: function (data, names) {
</span> var i = names.length,
name, value;
while (i--) {
name = names[i];
value = this[name];
if (value) {
if (typeof value != 'string') {
if (!value.isTemplate) {
value = Ext.XTemplate.getTpl(this, name);
}
value = value.apply(data);
}
}
data[name] = value || '';
}
return data;
},
<span id='Ext-form-Labelable-method-getLabelableRenderData'> /**
</span> * Generates the arguments for the field decorations {@link #labelableRenderTpl rendering template}.
* @return {Object} The template arguments
* @protected
*/
getLabelableRenderData: function() {
var me = this,
data,
tempEl,
topLabel = me.labelAlign === 'top';
if (!Ext.form.Labelable.errorIconWidth) {
tempEl = Ext.getBody().createChild({style: 'position:absolute', cls: Ext.baseCSSPrefix + 'form-invalid-icon'});
Ext.form.Labelable.errorIconWidth = tempEl.getWidth() + tempEl.getMargin('l');
tempEl.remove();
}
data = Ext.copyTo({
inFormLayout : me.ownerLayout && me.ownerLayout.type === 'form',
inputId : me.getInputId(),
labelOnLeft : !topLabel,
hideLabel : !me.hasVisibleLabel(),
fieldLabel : me.getFieldLabel(),
labelCellStyle : me.getLabelCellStyle(),
labelCellAttrs : me.getLabelCellAttrs(),
labelCls : me.getLabelCls(),
labelStyle : me.getLabelStyle(),
bodyColspan : me.getBodyColspan(),
externalError : !me.autoFitErrors,
errorMsgCls : me.getErrorMsgCls(),
errorIconWidth : Ext.form.Labelable.errorIconWidth
},
me, me.labelableRenderProps, true);
me.getInsertionRenderData(data, me.labelableInsertions);
return data;
},
<span id='Ext-form-Labelable-property-xhooks'> xhooks: {
</span> beforeRender: function() {
var me = this;
me.setFieldDefaults(me.getHierarchyState().fieldDefaults);
if (me.ownerLayout) {
me.addCls(Ext.baseCSSPrefix + me.ownerLayout.type + '-form-item');
}
},
onRender: function() {
var me = this,
margins,
side,
style = {};
if (me.extraMargins) {
margins = me.el.getMargin();
for (side in margins) {
if (margins.hasOwnProperty(side)) {
style['margin-' + side] = (margins[side] + me.extraMargins[side]) + 'px';
}
}
me.el.setStyle(style);
}
}
},
<span id='Ext-form-Labelable-method-hasVisibleLabel'> /**
</span> * Checks if the field has a visible label
* @return {Boolean} True if the field has a visible label
*/
hasVisibleLabel: function(){
if (this.hideLabel) {
return false;
}
return !(this.hideEmptyLabel && !this.getFieldLabel());
},
<span id='Ext-form-Labelable-method-getLabelWidth'> /**
</span> * Gets the width of the label (if visible)
* @return {Number} The label width
*/
getLabelWidth: function(){
var me = this;
if (!me.hasVisibleLabel()) {
return 0;
}
return me.labelWidth + me.labelPad;
},
<span id='Ext-form-Labelable-method-getBodyColspan'> /**
</span> * @private
* Calculates the colspan value for the body cell - the cell which contains the input field.
*
* The field table structure contains 4 columns:
*/
getBodyColspan: function() {
var me = this,
result;
if (me.msgTarget === 'side' && (!me.autoFitErrors || me.hasActiveError())) {
result = 1;
} else {
result = 2;
}
if (me.labelAlign !== 'top' && !me.hasVisibleLabel()) {
result++;
}
return result;
},
<span id='Ext-form-Labelable-method-getLabelCls'> getLabelCls: function() {
</span> var labelCls = this.labelCls + ' ' + Ext.dom.Element.unselectableCls,
labelClsExtra = this.labelClsExtra;
return labelClsExtra ? labelCls + ' ' + labelClsExtra : labelCls;
},
<span id='Ext-form-Labelable-method-getLabelCellStyle'> getLabelCellStyle: function() {
</span> var me = this,
hideLabelCell = me.hideLabel || (!me.fieldLabel && me.hideEmptyLabel);
return hideLabelCell ? 'display:none;' : '';
},
<span id='Ext-form-Labelable-method-getErrorMsgCls'> getErrorMsgCls: function() {
</span> var me = this,
hideLabelCell = (me.hideLabel || (!me.fieldLabel && me.hideEmptyLabel));
return me.errorMsgCls + (!hideLabelCell && me.labelAlign === 'top' ? ' ' + Ext.baseCSSPrefix + 'lbl-top-err-icon' : '');
},
<span id='Ext-form-Labelable-method-getLabelCellAttrs'> getLabelCellAttrs: function() {
</span> var me = this,
labelAlign = me.labelAlign,
result = '';
if (labelAlign !== 'top') {
result = 'valign="top" halign="' + labelAlign + '" width="' + (me.labelWidth + me.labelPad) + '"';
}
return result + ' class="' + Ext.baseCSSPrefix + 'field-label-cell"';
},
<span id='Ext-form-Labelable-method-getLabelStyle'> /**
</span> * Gets any label styling for the labelEl
* @private
* @return {String} The label styling
*/
getLabelStyle: function(){
var me = this,
labelPad = me.labelPad,
labelStyle = '';
// Calculate label styles up front rather than in the Field layout for speed; this
// is safe because label alignment/width/pad are not expected to change.
if (me.labelAlign !== 'top') {
if (me.labelWidth) {
labelStyle = 'width:' + me.labelWidth + 'px;';
}
if (labelPad) {
labelStyle += 'margin-right:' + labelPad + 'px;';
}
}
return labelStyle + (me.labelStyle || '');
},
<span id='Ext-form-Labelable-method-getSubTplMarkup'> /**
</span> * Gets the markup to be inserted into the outer template's bodyEl. Defaults to empty string, should be implemented
* by classes including this mixin as needed.
* @return {String} The markup to be inserted
* @protected
*/
getSubTplMarkup: function() {
return '';
},
<span id='Ext-form-Labelable-method-getInputId'> /**
</span> * Get the input id, if any, for this component. This is used as the "for" attribute on the label element.
* Implementing subclasses may also use this as e.g. the id for their own input element.
* @return {String} The input id
*/
getInputId: function() {
return '';
},
<span id='Ext-form-Labelable-method-getActiveError'> /**
</span> * Gets the active error message for this component, if any. This does not trigger validation on its own, it merely
* returns any message that the component may already hold.
* @return {String} The active error message on the component; if there is no error, an empty string is returned.
*/
getActiveError : function() {
return this.activeError || '';
},
<span id='Ext-form-Labelable-method-hasActiveError'> /**
</span> * Tells whether the field currently has an active error message. This does not trigger validation on its own, it
* merely looks for any message that the component may already hold.
* @return {Boolean}
*/
hasActiveError: function() {
return !!this.getActiveError();
},
<span id='Ext-form-Labelable-method-setActiveError'> /**
</span> * Sets the active error message to the given string. This replaces the entire error message contents with the given
* string. Also see {@link #setActiveErrors} which accepts an Array of messages and formats them according to the
* {@link #activeErrorsTpl}. Note that this only updates the error message element's text and attributes, you'll
* have to call doComponentLayout to actually update the field's layout to match. If the field extends {@link
* Ext.form.field.Base} you should call {@link Ext.form.field.Base#markInvalid markInvalid} instead.
* @param {String} msg The error message
*/
setActiveError: function(msg) {
this.setActiveErrors(msg);
},
<span id='Ext-form-Labelable-method-getActiveErrors'> /**
</span> * Gets an Array of any active error messages currently applied to the field. This does not trigger validation on
* its own, it merely returns any messages that the component may already hold.
* @return {String[]} The active error messages on the component; if there are no errors, an empty Array is
* returned.
*/
getActiveErrors: function() {
return this.activeErrors || [];
},
<span id='Ext-form-Labelable-method-setActiveErrors'> /**
</span> * Set the active error message to an Array of error messages. The messages are formatted into a single message
* string using the {@link #activeErrorsTpl}. Also see {@link #setActiveError} which allows setting the entire error
* contents with a single string. Note that this only updates the error message element's text and attributes,
* you'll have to call doComponentLayout to actually update the field's layout to match. If the field extends
* {@link Ext.form.field.Base} you should call {@link Ext.form.field.Base#markInvalid markInvalid} instead.
* @param {String[]} errors The error messages
*/
setActiveErrors: function(errors) {
errors = Ext.Array.from(errors);
this.activeError = errors[0];
this.activeErrors = errors;
this.activeError = this.getTpl('activeErrorsTpl').apply({
errors: errors,
listCls: Ext.plainListCls
});
this.renderActiveError();
},
<span id='Ext-form-Labelable-method-unsetActiveError'> /**
</span> * Clears the active error message(s). Note that this only clears the error message element's text and attributes,
* you'll have to call doComponentLayout to actually update the field's layout to match. If the field extends {@link
* Ext.form.field.Base} you should call {@link Ext.form.field.Base#clearInvalid clearInvalid} instead.
*/
unsetActiveError: function() {
delete this.activeError;
delete this.activeErrors;
this.renderActiveError();
},
<span id='Ext-form-Labelable-method-renderActiveError'> /**
</span> * @private
* Updates the rendered DOM to match the current activeError. This only updates the content and
* attributes, you'll have to call doComponentLayout to actually update the display.
*/
renderActiveError: function() {
var me = this,
activeError = me.getActiveError(),
hasError = !!activeError;
if (activeError !== me.lastActiveError) {
me.fireEvent('errorchange', me, activeError);
me.lastActiveError = activeError;
}
if (me.rendered && !me.isDestroyed && !me.preventMark) {
// Add/remove invalid class
me.el[hasError ? 'addCls' : 'removeCls'](me.invalidCls);
// Update the aria-invalid attribute
me.getActionEl().dom.setAttribute('aria-invalid', hasError);
// Update the errorEl (There will only be one if msgTarget is 'side' or 'under') with the error message text
if (me.errorEl) {
me.errorEl.dom.innerHTML = activeError;
}
}
},
<span id='Ext-form-Labelable-method-setFieldDefaults'> /**
</span> * Applies a set of default configuration values to this Labelable instance. For each of the properties in the given
* object, check if this component hasOwnProperty that config; if not then it's inheriting a default value from its
* prototype and we should apply the default value.
* @param {Object} defaults The defaults to apply to the object.
*/
setFieldDefaults: function(defaults) {
var key;
for (key in defaults) {
if (!this.hasOwnProperty(key)) {
this[key] = defaults[key];
}
}
}
});
</pre>
</body>
</html>
| cassioozarias/zfextjs | public/extjs/docs/source/Labelable.html | HTML | bsd-3-clause | 39,513 | [
30522,
1026,
999,
9986,
13874,
16129,
1028,
1026,
16129,
1028,
1026,
2132,
1028,
1026,
18804,
8299,
1011,
1041,
15549,
2615,
1027,
1000,
4180,
1011,
2828,
1000,
4180,
1027,
1000,
3793,
1013,
16129,
1025,
25869,
13462,
1027,
21183,
2546,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
namespace DeviceHive.Data.EF.Migrations
{
using System.Data.Entity.Migrations;
public partial class _91 : DbMigration
{
public override void Up()
{
CreateTable(
"OAuthClient",
c => new
{
ID = c.Int(nullable: false, identity: true),
Name = c.String(nullable: false, maxLength: 128),
Domain = c.String(nullable: false, maxLength: 128),
Subnet = c.String(maxLength: 128),
RedirectUri = c.String(nullable: false, maxLength: 128),
OAuthID = c.String(nullable: false, maxLength: 32),
OAuthSecret = c.String(nullable: false, maxLength: 32),
})
.PrimaryKey(t => t.ID)
.Index(t => t.OAuthID, unique: true);
CreateTable(
"OAuthGrant",
c => new
{
ID = c.Int(nullable: false, identity: true),
Timestamp = c.DateTime(nullable: false, storeType: "datetime2"),
AuthCode = c.Guid(),
ClientID = c.Int(nullable: false),
UserID = c.Int(nullable: false),
AccessKeyID = c.Int(nullable: false),
Type = c.Int(nullable: false),
AccessType = c.Int(nullable: false),
RedirectUri = c.String(maxLength: 128),
Scope = c.String(nullable: false, maxLength: 256),
NetworkList = c.String(maxLength: 128),
})
.PrimaryKey(t => t.ID)
.ForeignKey("OAuthClient", t => t.ClientID, cascadeDelete: true)
.ForeignKey("User", t => t.UserID, cascadeDelete: true)
.ForeignKey("AccessKey", t => t.AccessKeyID, cascadeDelete: false)
.Index(t => t.ClientID)
.Index(t => t.UserID)
.Index(t => t.AccessKeyID);
Sql("CREATE UNIQUE NONCLUSTERED INDEX [IX_AuthCode] ON [OAuthGrant] ( [AuthCode] ASC ) WHERE [AuthCode] IS NOT NULL");
}
public override void Down()
{
DropIndex("OAuthGrant", new[] { "AccessKeyID" });
DropIndex("OAuthGrant", new[] { "UserID" });
DropIndex("OAuthGrant", new[] { "ClientID" });
DropIndex("OAuthGrant", new[] { "AuthCode" });
DropForeignKey("OAuthGrant", "AccessKeyID", "AccessKey");
DropForeignKey("OAuthGrant", "UserID", "User");
DropForeignKey("OAuthGrant", "ClientID", "OAuthClient");
DropTable("OAuthGrant");
DropIndex("OAuthClient", new[] { "OAuthID" });
DropTable("OAuthClient");
}
}
}
| deus42/devicehive-.net | src/Server/DeviceHive.Data.EF/Migrations/201310111016567_9.1.cs | C# | mit | 2,823 | [
30522,
3415,
15327,
5080,
4048,
3726,
1012,
2951,
1012,
1041,
2546,
1012,
9230,
2015,
1063,
2478,
2291,
1012,
2951,
1012,
9178,
1012,
9230,
2015,
1025,
2270,
7704,
2465,
1035,
6205,
1024,
16962,
4328,
29397,
1063,
2270,
2058,
15637,
11675,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
var path = require("path");
var fs = require("fs");
var wt = require("./walk-tree");
function createEvent(dirs, event, dir, fileName) {
var fullPath = path.join(dir, fileName);
var exists = dirs.some(function (d) { return d === fullPath; });
var statObj;
function stat() {
if (statObj) { return statObj; }
if (!fullPath) {
statObj = { isDirectory: function () { return false; } };
} else {
try {
statObj = fs.statSync(fullPath);
} catch (e) {
statObj = {
isDirectory: function () { return false; },
deleted: true
};
}
}
return statObj;
}
return {
name: fullPath,
isDirectory: function () {
return stat().isDirectory();
},
isMkdir: function () {
return this.isDirectory() && !exists;
},
isDelete: function () {
return !!stat().deleted;
},
isModify: function () {
return !this.isDelete() && !this.isMkdir();
}
};
}
var addWatch;
function watch(state, dir, options, callback) {
return fs.watch(dir, function (event, fileName) {
var e = createEvent(state.dirs, event, dir, fileName);
if (e.isDirectory() && e.isMkdir()) {
addWatch(state, e.name, options, callback);
}
if (!wt.isExcluded(e.name, options.exclude) &&
typeof callback === "function") {
callback(e);
}
});
}
function addWatch(state, dir, options, callback) {
state.dirs = state.dirs || [];
state.dirs.push(dir);
state.watches = state.watches || [];
state.watches.push(watch(state, dir, options, callback));
}
function watchTree(dir, options, callback) {
var opt = options, cb = callback;
if (arguments.length === 2 && typeof opt === "function") {
cb = opt;
opt = {};
}
var state = {};
opt = opt || {};
opt.exclude = wt.excludeRegExes(opt.exclude);
addWatch(state, dir, opt, cb);
wt.walkTree(dir, opt, function (err, dir) {
if (err) { return; }
addWatch(state, dir, opt, cb);
});
return {
end: function () {
state.watches.forEach(function (w) { w.close(); });
}
};
}
exports.watchTree = watchTree;
| busterjs/fs-watch-tree | lib/watch-tree-unix.js | JavaScript | bsd-3-clause | 2,405 | [
30522,
13075,
4130,
1027,
5478,
1006,
1000,
4130,
1000,
1007,
1025,
13075,
1042,
2015,
1027,
5478,
1006,
1000,
1042,
2015,
1000,
1007,
1025,
13075,
1059,
2102,
1027,
5478,
1006,
1000,
1012,
1013,
3328,
1011,
3392,
1000,
1007,
1025,
3853,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/**
* Autogenerated by Thrift Compiler (0.9.3)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package com.facebook.buck.distributed.thrift;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
import org.apache.thrift.scheme.TupleScheme;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.TException;
import org.apache.thrift.async.AsyncMethodCallback;
import org.apache.thrift.server.AbstractNonblockingServer.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.EnumMap;
import java.util.Set;
import java.util.HashSet;
import java.util.EnumSet;
import java.util.Collections;
import java.util.BitSet;
import java.nio.ByteBuffer;
import java.util.Arrays;
import javax.annotation.Generated;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2017-09-22")
public class SetBuckDotFilePathsRequest implements org.apache.thrift.TBase<SetBuckDotFilePathsRequest, SetBuckDotFilePathsRequest._Fields>, java.io.Serializable, Cloneable, Comparable<SetBuckDotFilePathsRequest> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SetBuckDotFilePathsRequest");
private static final org.apache.thrift.protocol.TField STAMPEDE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("stampedeId", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final org.apache.thrift.protocol.TField DOT_FILES_FIELD_DESC = new org.apache.thrift.protocol.TField("dotFiles", org.apache.thrift.protocol.TType.LIST, (short)2);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new SetBuckDotFilePathsRequestStandardSchemeFactory());
schemes.put(TupleScheme.class, new SetBuckDotFilePathsRequestTupleSchemeFactory());
}
public StampedeId stampedeId; // optional
public List<PathInfo> dotFiles; // optional
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
STAMPEDE_ID((short)1, "stampedeId"),
DOT_FILES((short)2, "dotFiles");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // STAMPEDE_ID
return STAMPEDE_ID;
case 2: // DOT_FILES
return DOT_FILES;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final _Fields optionals[] = {_Fields.STAMPEDE_ID,_Fields.DOT_FILES};
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.STAMPEDE_ID, new org.apache.thrift.meta_data.FieldMetaData("stampedeId", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, StampedeId.class)));
tmpMap.put(_Fields.DOT_FILES, new org.apache.thrift.meta_data.FieldMetaData("dotFiles", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, PathInfo.class))));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SetBuckDotFilePathsRequest.class, metaDataMap);
}
public SetBuckDotFilePathsRequest() {
}
/**
* Performs a deep copy on <i>other</i>.
*/
public SetBuckDotFilePathsRequest(SetBuckDotFilePathsRequest other) {
if (other.isSetStampedeId()) {
this.stampedeId = new StampedeId(other.stampedeId);
}
if (other.isSetDotFiles()) {
List<PathInfo> __this__dotFiles = new ArrayList<PathInfo>(other.dotFiles.size());
for (PathInfo other_element : other.dotFiles) {
__this__dotFiles.add(new PathInfo(other_element));
}
this.dotFiles = __this__dotFiles;
}
}
public SetBuckDotFilePathsRequest deepCopy() {
return new SetBuckDotFilePathsRequest(this);
}
@Override
public void clear() {
this.stampedeId = null;
this.dotFiles = null;
}
public StampedeId getStampedeId() {
return this.stampedeId;
}
public SetBuckDotFilePathsRequest setStampedeId(StampedeId stampedeId) {
this.stampedeId = stampedeId;
return this;
}
public void unsetStampedeId() {
this.stampedeId = null;
}
/** Returns true if field stampedeId is set (has been assigned a value) and false otherwise */
public boolean isSetStampedeId() {
return this.stampedeId != null;
}
public void setStampedeIdIsSet(boolean value) {
if (!value) {
this.stampedeId = null;
}
}
public int getDotFilesSize() {
return (this.dotFiles == null) ? 0 : this.dotFiles.size();
}
public java.util.Iterator<PathInfo> getDotFilesIterator() {
return (this.dotFiles == null) ? null : this.dotFiles.iterator();
}
public void addToDotFiles(PathInfo elem) {
if (this.dotFiles == null) {
this.dotFiles = new ArrayList<PathInfo>();
}
this.dotFiles.add(elem);
}
public List<PathInfo> getDotFiles() {
return this.dotFiles;
}
public SetBuckDotFilePathsRequest setDotFiles(List<PathInfo> dotFiles) {
this.dotFiles = dotFiles;
return this;
}
public void unsetDotFiles() {
this.dotFiles = null;
}
/** Returns true if field dotFiles is set (has been assigned a value) and false otherwise */
public boolean isSetDotFiles() {
return this.dotFiles != null;
}
public void setDotFilesIsSet(boolean value) {
if (!value) {
this.dotFiles = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case STAMPEDE_ID:
if (value == null) {
unsetStampedeId();
} else {
setStampedeId((StampedeId)value);
}
break;
case DOT_FILES:
if (value == null) {
unsetDotFiles();
} else {
setDotFiles((List<PathInfo>)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case STAMPEDE_ID:
return getStampedeId();
case DOT_FILES:
return getDotFiles();
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case STAMPEDE_ID:
return isSetStampedeId();
case DOT_FILES:
return isSetDotFiles();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof SetBuckDotFilePathsRequest)
return this.equals((SetBuckDotFilePathsRequest)that);
return false;
}
public boolean equals(SetBuckDotFilePathsRequest that) {
if (that == null)
return false;
boolean this_present_stampedeId = true && this.isSetStampedeId();
boolean that_present_stampedeId = true && that.isSetStampedeId();
if (this_present_stampedeId || that_present_stampedeId) {
if (!(this_present_stampedeId && that_present_stampedeId))
return false;
if (!this.stampedeId.equals(that.stampedeId))
return false;
}
boolean this_present_dotFiles = true && this.isSetDotFiles();
boolean that_present_dotFiles = true && that.isSetDotFiles();
if (this_present_dotFiles || that_present_dotFiles) {
if (!(this_present_dotFiles && that_present_dotFiles))
return false;
if (!this.dotFiles.equals(that.dotFiles))
return false;
}
return true;
}
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
boolean present_stampedeId = true && (isSetStampedeId());
list.add(present_stampedeId);
if (present_stampedeId)
list.add(stampedeId);
boolean present_dotFiles = true && (isSetDotFiles());
list.add(present_dotFiles);
if (present_dotFiles)
list.add(dotFiles);
return list.hashCode();
}
@Override
public int compareTo(SetBuckDotFilePathsRequest other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetStampedeId()).compareTo(other.isSetStampedeId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetStampedeId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stampedeId, other.stampedeId);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetDotFiles()).compareTo(other.isSetDotFiles());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetDotFiles()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dotFiles, other.dotFiles);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("SetBuckDotFilePathsRequest(");
boolean first = true;
if (isSetStampedeId()) {
sb.append("stampedeId:");
if (this.stampedeId == null) {
sb.append("null");
} else {
sb.append(this.stampedeId);
}
first = false;
}
if (isSetDotFiles()) {
if (!first) sb.append(", ");
sb.append("dotFiles:");
if (this.dotFiles == null) {
sb.append("null");
} else {
sb.append(this.dotFiles);
}
first = false;
}
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
if (stampedeId != null) {
stampedeId.validate();
}
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class SetBuckDotFilePathsRequestStandardSchemeFactory implements SchemeFactory {
public SetBuckDotFilePathsRequestStandardScheme getScheme() {
return new SetBuckDotFilePathsRequestStandardScheme();
}
}
private static class SetBuckDotFilePathsRequestStandardScheme extends StandardScheme<SetBuckDotFilePathsRequest> {
public void read(org.apache.thrift.protocol.TProtocol iprot, SetBuckDotFilePathsRequest struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // STAMPEDE_ID
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.stampedeId = new StampedeId();
struct.stampedeId.read(iprot);
struct.setStampedeIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // DOT_FILES
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
org.apache.thrift.protocol.TList _list98 = iprot.readListBegin();
struct.dotFiles = new ArrayList<PathInfo>(_list98.size);
PathInfo _elem99;
for (int _i100 = 0; _i100 < _list98.size; ++_i100)
{
_elem99 = new PathInfo();
_elem99.read(iprot);
struct.dotFiles.add(_elem99);
}
iprot.readListEnd();
}
struct.setDotFilesIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, SetBuckDotFilePathsRequest struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.stampedeId != null) {
if (struct.isSetStampedeId()) {
oprot.writeFieldBegin(STAMPEDE_ID_FIELD_DESC);
struct.stampedeId.write(oprot);
oprot.writeFieldEnd();
}
}
if (struct.dotFiles != null) {
if (struct.isSetDotFiles()) {
oprot.writeFieldBegin(DOT_FILES_FIELD_DESC);
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.dotFiles.size()));
for (PathInfo _iter101 : struct.dotFiles)
{
_iter101.write(oprot);
}
oprot.writeListEnd();
}
oprot.writeFieldEnd();
}
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class SetBuckDotFilePathsRequestTupleSchemeFactory implements SchemeFactory {
public SetBuckDotFilePathsRequestTupleScheme getScheme() {
return new SetBuckDotFilePathsRequestTupleScheme();
}
}
private static class SetBuckDotFilePathsRequestTupleScheme extends TupleScheme<SetBuckDotFilePathsRequest> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, SetBuckDotFilePathsRequest struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetStampedeId()) {
optionals.set(0);
}
if (struct.isSetDotFiles()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetStampedeId()) {
struct.stampedeId.write(oprot);
}
if (struct.isSetDotFiles()) {
{
oprot.writeI32(struct.dotFiles.size());
for (PathInfo _iter102 : struct.dotFiles)
{
_iter102.write(oprot);
}
}
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, SetBuckDotFilePathsRequest struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
struct.stampedeId = new StampedeId();
struct.stampedeId.read(iprot);
struct.setStampedeIdIsSet(true);
}
if (incoming.get(1)) {
{
org.apache.thrift.protocol.TList _list103 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
struct.dotFiles = new ArrayList<PathInfo>(_list103.size);
PathInfo _elem104;
for (int _i105 = 0; _i105 < _list103.size; ++_i105)
{
_elem104 = new PathInfo();
_elem104.read(iprot);
struct.dotFiles.add(_elem104);
}
}
struct.setDotFilesIsSet(true);
}
}
}
}
| shybovycha/buck | src-gen/com/facebook/buck/distributed/thrift/SetBuckDotFilePathsRequest.java | Java | apache-2.0 | 18,218 | [
30522,
1013,
1008,
1008,
1008,
8285,
6914,
16848,
2011,
16215,
16338,
21624,
1006,
1014,
1012,
1023,
1012,
1017,
1007,
1008,
1008,
2079,
2025,
10086,
4983,
2017,
2024,
2469,
2008,
2017,
2113,
2054,
2017,
2024,
2725,
1008,
1030,
7013,
1008,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
/**
* Created by PhpStorm.
* User: kuibo
* Date: 2017/8/30
* Time: 9:17
*/
abstract class GP_Entity {
protected function _save( $table, $data, $data_format ) {
$retval = false;
global $wpdb;
// Update.
if ( ! empty( $this->id ) ) {
$result = $wpdb->update( $table, $data, array( 'id' => $this->id ), $data_format, array( '%d' ) );
// Set the notification ID if successful.
if ( ! empty( $result ) && ! is_wp_error( $result ) ) {
$retval = $this->id;
}
// Insert.
} else {
$result = $wpdb->insert( $table, $data, $data_format );
// Set the notification ID if successful.
if ( ! empty( $result ) && ! is_wp_error( $result ) ) {
$this->id = $wpdb->insert_id;
$retval = $wpdb->insert_id;
}
}
// Return the result.
return $retval;
}
} | kuibobo/GamPress | wp-content/plugins/gampress/includes/core/classes/class-gp-entity.php | PHP | gpl-2.0 | 977 | [
30522,
1026,
1029,
25718,
1013,
1008,
1008,
1008,
2580,
2011,
25718,
19718,
1012,
1008,
5310,
1024,
13970,
12322,
2080,
1008,
3058,
1024,
2418,
1013,
1022,
1013,
2382,
1008,
2051,
1024,
1023,
1024,
2459,
1008,
1013,
10061,
2465,
14246,
1035... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/// <reference path="../../includes.ts"/>
/// <reference path="kubernetesHelpers.ts"/>
/// <reference path="kubernetesPlugin.ts"/>
module Kubernetes {
export var ServiceController = controller("ServiceController",
["$scope", "KubernetesModel", "KubernetesState", "$templateCache", "$location", "$routeParams", "$http", "$timeout", "KubernetesApiURL",
($scope, KubernetesModel: Kubernetes.KubernetesModelService, KubernetesState,
$templateCache:ng.ITemplateCacheService, $location:ng.ILocationService, $routeParams, $http, $timeout, KubernetesApiURL) => {
$scope.kubernetes = KubernetesState;
$scope.model = KubernetesModel;
$scope.rawModel = null;
Kubernetes.initShared($scope, $location, $http, $timeout, $routeParams, KubernetesModel, KubernetesState, KubernetesApiURL);
$scope.itemConfig = {
properties: {
'^\\/labels$': {
template: $templateCache.get('labelTemplate.html')
}
}
};
$scope.$on('kubernetesModelUpdated', function () {
updateData();
});
$scope.$watch('model.services', (newValue, oldValue) => {
updateData();
}, true);
$scope.$on('$routeUpdate', ($event) => {
updateData();
});
$scope.flipRaw = () => {
$scope.rawMode = !$scope.rawMode;
Core.$apply($scope);
};
updateData();
function updateData() {
$scope.id = $routeParams["id"];
$scope.namespace = $routeParams["namespace"] || KubernetesState.selectedNamespace;
$scope.item = $scope.model.getService($scope.namespace, $scope.id);
if ($scope.item) {
$scope.rawModel = toRawYaml($scope.item);
}
Core.$apply($scope);
}
}]);
}
| hawtio/hawtio-kubernetes | plugins/kubernetes/ts/service.ts | TypeScript | apache-2.0 | 1,703 | [
30522,
1013,
1013,
1013,
1026,
4431,
4130,
1027,
1000,
1012,
1012,
1013,
1012,
1012,
1013,
2950,
1012,
24529,
1000,
1013,
1028,
1013,
1013,
1013,
1026,
4431,
4130,
1027,
1000,
13970,
5677,
7159,
9953,
2884,
7347,
1012,
24529,
1000,
1013,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
/**
* Copyright © OXID eSales AG. All rights reserved.
* See LICENSE file for license details.
*/
declare(strict_types=1);
namespace OxidEsales\EshopCommunity\Internal\Domain\Admin\Exception;
use function sprintf;
class InvalidEmailException extends \Exception
{
public function __construct(string $email)
{
parent::__construct(sprintf('Provided email string %s is not a valid email.', $email));
}
}
| michaelkeiluweit/oxideshop_ce | source/Internal/Domain/Admin/Exception/InvalidEmailException.php | PHP | gpl-3.0 | 435 | [
30522,
1026,
1029,
25718,
1013,
1008,
1008,
1008,
9385,
1075,
23060,
3593,
28776,
4244,
12943,
1012,
2035,
2916,
9235,
1012,
1008,
2156,
6105,
5371,
2005,
6105,
4751,
1012,
1008,
1013,
13520,
1006,
9384,
1035,
4127,
1027,
1015,
1007,
1025,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>tactician-stdlib: 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 / released</a></li>
<li class="active"><a href="">8.8.0 / tactician-stdlib - 1.0~beta1+8.13</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
tactician-stdlib
<small>
1.0~beta1+8.13
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-02-28 15:52:49 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-02-28 15:52:49 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-num base Num library distributed with the OCaml compiler
base-threads base
base-unix base
camlp5 7.14 Preprocessor-pretty-printer of OCaml
conf-findutils 1 Virtual package relying on findutils
conf-perl 2 Virtual package relying on perl
coq 8.8.0 Formal proof management system
num 0 The Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.03.0 The OCaml compiler (virtual package)
ocaml-base-compiler 4.03.0 Official 4.03.0 release
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.3 A library manager for OCaml
# opam file:
opam-version: "2.0"
name: "coq-tactician-stdlib"
synopsis: "Recompiles Coq's standard libary with Tactician's instrumentation loaded"
description: """
*** WARNING *** This package will overwrite Coq's standard library files.
This package recompiles Coq's standard library with Tactician's (`coq-tactician`)
instrumentation loaded such that Tactician can learn from the library. When you
install this package, the current `.vo` files of the standard library are backed
in the folder `user-contrib/Tactician/stdlib-backup`. Then exactly the same `.vo`
files are installed, except that they also contain Tactician's tactic databases.
Upon removal of this package, the original files will be placed back.
"""
homepage: "https://coq-tactician.github.io"
dev-repo: "git+https://github.com/coq-tactician/coq-tactician-stdlib"
bug-reports: "https://github.com/coq-tactician/coq-tactician-stdlib/issues"
maintainer: "Lasse Blaauwbroek <lasse@blaauwbroek.eu>"
authors: "Lasse Blaauwbroek <lasse@blaauwbroek.eu"
messages: [
"*** WARNING ***"
"This package will overwrite Coq's standard library files."
"A backup of the original files will be placed under Coq's"
"library directory at user-contrib/tactician-stdlib-backup/"
"and they will be restored when you remove this package"
]
post-messages: ["
--- The standard library was successfully recompiled ---
In order to finish the process, you should run
tactician recompile
" {success}]
depends: [
"coq" {>= "8.13" & < "8.14~"}
"coq-tactician"
]
build: [
[make "-j%{jobs}%"]
]
install: [
[make "install"]
]
remove: [
[make "restore"]
]
url {
src: "https://github.com/coq-tactician/coq-tactician-stdlib/archive/1.0-beta1-8.13.tar.gz"
}
tags: [
"keyword:tactic-learning"
"keyword:machine-learning"
"keyword:automation"
"keyword:proof-synthesis"
"category:Miscellaneous/Coq Extensions"
"logpath:Tactician"
]
</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-tactician-stdlib.1.0~beta1+8.13 coq.8.8.0</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.8.0).
The following dependencies couldn't be met:
- coq-tactician-stdlib -> coq-tactician -> ocaml >= 4.08
base of this switch (use `--unlock-base' to force)
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-tactician-stdlib.1.0~beta1+8.13</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">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</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>
| coq-bench/coq-bench.github.io | clean/Linux-x86_64-4.03.0-2.0.5/released/8.8.0/tactician-stdlib/1.0~beta1+8.13.html | HTML | mit | 8,094 | [
30522,
1026,
999,
9986,
13874,
16129,
1028,
1026,
16129,
11374,
1027,
1000,
4372,
1000,
1028,
1026,
2132,
1028,
1026,
18804,
25869,
13462,
1027,
1000,
21183,
2546,
1011,
1022,
1000,
1028,
1026,
18804,
2171,
1027,
1000,
3193,
6442,
1000,
418... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
DELETE FROM scripted_areatrigger WHERE entry=1966;
INSERT INTO scripted_areatrigger VALUES (1966,'at_murkdeep');
| mangosArchives/serverOneRel18 | src/scripts/sql/updates/0.6/r2541_mangos.sql | SQL | gpl-2.0 | 113 | [
30522,
3972,
12870,
2013,
22892,
1035,
2181,
18886,
13327,
2073,
4443,
1027,
3547,
1025,
19274,
2046,
22892,
1035,
2181,
18886,
13327,
5300,
1006,
3547,
1010,
1005,
2012,
1035,
14163,
8024,
26095,
2361,
1005,
1007,
1025,
102,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* Copyright © 2012-2015 VMware, 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.
*/
#include "includes.h"
VMAF_CFG_API_GLOBALS gVmAfCfgApiGlobals = {0};
PVMAF_CFG_API_GLOBALS gpVmAfCfgApiGlobals = &gVmAfCfgApiGlobals;
| schatt/lightwave | vmafd/vmafcfg/api/globals.c | C | apache-2.0 | 765 | [
30522,
1013,
1008,
1008,
9385,
1075,
2262,
1011,
2325,
1058,
2213,
8059,
1010,
4297,
1012,
2035,
2916,
9235,
1012,
1008,
1008,
7000,
2104,
1996,
15895,
6105,
1010,
2544,
1016,
1012,
1014,
1006,
1996,
1523,
6105,
1524,
1007,
1025,
2017,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package com.actelion.research.orbit.imageAnalysis.components.icons;
import java.awt.*;
import java.awt.geom.*;
import java.awt.image.BufferedImage;
import java.io.*;
import java.lang.ref.WeakReference;
import java.util.Base64;
import java.util.Stack;
import javax.imageio.ImageIO;
import javax.swing.SwingUtilities;
import javax.swing.plaf.UIResource;
import org.pushingpixels.neon.api.icon.ResizableIcon;
import org.pushingpixels.neon.api.icon.ResizableIconUIResource;
/**
* This class has been automatically generated using <a
* href="https://github.com/kirill-grouchnikov/radiance">Photon SVG transcoder</a>.
*/
public class toggle_markup implements ResizableIcon {
private Shape shape = null;
private GeneralPath generalPath = null;
private Paint paint = null;
private Stroke stroke = null;
private Shape clip = null;
private Stack<AffineTransform> transformsStack = new Stack<>();
private void _paint0(Graphics2D g,float origAlpha) {
transformsStack.push(g.getTransform());
//
g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha));
transformsStack.push(g.getTransform());
g.transform(new AffineTransform(1.0666667222976685f, 0.0f, 0.0f, 1.0666667222976685f, -0.0f, -0.0f));
// _0
g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha));
transformsStack.push(g.getTransform());
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, -343.7007751464844f));
// _0_0
g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha));
transformsStack.push(g.getTransform());
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_0
paint = new Color(255, 0, 255, 255);
stroke = new BasicStroke(25.0f,0,0,4.0f,null,0.0f);
shape = new Rectangle2D.Double(86.42857360839844, 424.5050964355469, 187.14285278320312, 205.0);
g.setPaint(paint);
g.setStroke(stroke);
g.draw(shape);
g.setTransform(transformsStack.pop());
g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha));
transformsStack.push(g.getTransform());
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_1
paint = new Color(0, 255, 255, 255);
stroke = new BasicStroke(25.0f,0,0,4.0f,null,0.0f);
if (generalPath == null) {
generalPath = new GeneralPath();
} else {
generalPath.reset();
}
generalPath.moveTo(450.7143f, 462.36224f);
generalPath.lineTo(425.0f, 703.7908f);
generalPath.lineTo(236.42857f, 766.6479f);
generalPath.lineTo(96.42857f, 826.6479f);
generalPath.lineTo(84.28571f, 947.3622f);
generalPath.lineTo(412.85715f, 1023.0765f);
generalPath.lineTo(482.85715f, 902.3622f);
generalPath.lineTo(620.0f, 989.5051f);
generalPath.lineTo(637.8571f, 420.93365f);
generalPath.closePath();
shape = generalPath;
g.setPaint(paint);
g.setStroke(stroke);
g.draw(shape);
g.setTransform(transformsStack.pop());
g.setTransform(transformsStack.pop());
g.setTransform(transformsStack.pop());
g.setTransform(transformsStack.pop());
}
@SuppressWarnings("unused")
private void innerPaint(Graphics2D g) {
float origAlpha = 1.0f;
Composite origComposite = g.getComposite();
if (origComposite instanceof AlphaComposite) {
AlphaComposite origAlphaComposite =
(AlphaComposite)origComposite;
if (origAlphaComposite.getRule() == AlphaComposite.SRC_OVER) {
origAlpha = origAlphaComposite.getAlpha();
}
}
_paint0(g, origAlpha);
shape = null;
generalPath = null;
paint = null;
stroke = null;
clip = null;
transformsStack.clear();
}
/**
* Returns the X of the bounding box of the original SVG image.
*
* @return The X of the bounding box of the original SVG image.
*/
public static double getOrigX() {
return 75.46253967285156;
}
/**
* Returns the Y of the bounding box of the original SVG image.
*
* @return The Y of the bounding box of the original SVG image.
*/
public static double getOrigY() {
return 65.65621185302734;
}
/**
* Returns the width of the bounding box of the original SVG image.
*
* @return The width of the bounding box of the original SVG image.
*/
public static double getOrigWidth() {
return 618.7836303710938;
}
/**
* Returns the height of the bounding box of the original SVG image.
*
* @return The height of the bounding box of the original SVG image.
*/
public static double getOrigHeight() {
return 674.2141723632812;
}
/** The current width of this resizable icon. */
private int width;
/** The current height of this resizable icon. */
private int height;
/**
* Creates a new transcoded SVG image. This is marked as private to indicate that app
* code should be using the {@link #of(int, int)} method to obtain a pre-configured instance.
*/
private toggle_markup() {
this.width = (int) getOrigWidth();
this.height = (int) getOrigHeight();
}
@Override
public int getIconHeight() {
return height;
}
@Override
public int getIconWidth() {
return width;
}
@Override
public synchronized void setDimension(Dimension newDimension) {
this.width = newDimension.width;
this.height = newDimension.height;
}
@Override
public synchronized void paintIcon(Component c, Graphics g, int x, int y) {
Graphics2D g2d = (Graphics2D) g.create();
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
RenderingHints.VALUE_INTERPOLATION_BICUBIC);
g2d.translate(x, y);
double coef1 = (double) this.width / getOrigWidth();
double coef2 = (double) this.height / getOrigHeight();
double coef = Math.min(coef1, coef2);
g2d.clipRect(0, 0, this.width, this.height);
g2d.scale(coef, coef);
g2d.translate(-getOrigX(), -getOrigY());
if (coef1 != coef2) {
if (coef1 < coef2) {
int extraDy = (int) ((getOrigWidth() - getOrigHeight()) / 2.0);
g2d.translate(0, extraDy);
} else {
int extraDx = (int) ((getOrigHeight() - getOrigWidth()) / 2.0);
g2d.translate(extraDx, 0);
}
}
Graphics2D g2ForInner = (Graphics2D) g2d.create();
innerPaint(g2ForInner);
g2ForInner.dispose();
g2d.dispose();
}
/**
* Returns a new instance of this icon with specified dimensions.
*
* @param width Required width of the icon
* @param height Required height of the icon
* @return A new instance of this icon with specified dimensions.
*/
public static ResizableIcon of(int width, int height) {
toggle_markup base = new toggle_markup();
base.width = width;
base.height = height;
return base;
}
/**
* Returns a new {@link UIResource} instance of this icon with specified dimensions.
*
* @param width Required width of the icon
* @param height Required height of the icon
* @return A new {@link UIResource} instance of this icon with specified dimensions.
*/
public static ResizableIconUIResource uiResourceOf(int width, int height) {
toggle_markup base = new toggle_markup();
base.width = width;
base.height = height;
return new ResizableIconUIResource(base);
}
/**
* Returns a factory that returns instances of this icon on demand.
*
* @return Factory that returns instances of this icon on demand.
*/
public static Factory factory() {
return toggle_markup::new;
}
}
| mstritt/orbit-image-analysis | src/main/java/com/actelion/research/orbit/imageAnalysis/components/icons/toggle_markup.java | Java | gpl-3.0 | 7,640 | [
30522,
7427,
4012,
1012,
2552,
20806,
2239,
1012,
2470,
1012,
8753,
1012,
3746,
25902,
1012,
6177,
1012,
18407,
1025,
12324,
9262,
1012,
22091,
2102,
1012,
1008,
1025,
12324,
9262,
1012,
22091,
2102,
1012,
20248,
2213,
1012,
1008,
1025,
123... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package sun.bob.mcalendarview;
import android.content.Context;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.drawable.ShapeDrawable;
import android.graphics.drawable.shapes.RectShape;
import android.support.v4.app.FragmentActivity;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.view.View;
import sun.bob.mcalendarview.adapters.CalendarViewAdapter;
import sun.bob.mcalendarview.listeners.OnDateClickListener;
import sun.bob.mcalendarview.listeners.OnMonthChangeListener;
import sun.bob.mcalendarview.utils.CalendarUtil;
import sun.bob.mcalendarview.utils.CurrentCalendar;
import sun.bob.mcalendarview.views.BaseCellView;
import sun.bob.mcalendarview.vo.DateData;
import sun.bob.mcalendarview.vo.MarkedDates;
/**
* Created by bob.sun on 15/8/27.
*/
public class mCalendarView extends ViewPager {
private int dateCellViewResId = -1;
private View dateCellView = null;
private int markedStyle = -1;
private int markedCellResId = -1;
private View markedCellView = null;
private boolean initted = false;
private DateData currentDate;
private CalendarViewAdapter adapter;
private int width, height;
public mCalendarView(Context context) {
super(context);
if (context instanceof FragmentActivity){
init((FragmentActivity) context);
}
}
public mCalendarView(Context context, AttributeSet attrs) {
super(context, attrs);
if (context instanceof FragmentActivity){
init((FragmentActivity) context);
}
}
public void init(FragmentActivity activity){
if (initted){
return;
}
initted = true;
if (currentDate == null){
currentDate = CurrentCalendar.getCurrentDateData();
}
// TODO: 15/8/28 Will this cause trouble when achieved?
if (this.getId() == View.NO_ID){
this.setId(R.id.calendarViewPager);
}
adapter = new CalendarViewAdapter(activity.getSupportFragmentManager()).setDate(currentDate);
this.setAdapter(adapter);
this.setCurrentItem(500);
addBackground();
}
private void addBackground(){
ShapeDrawable drawable = new ShapeDrawable(new RectShape());
drawable.getPaint().setColor(Color.LTGRAY);
drawable.getPaint().setStyle(Paint.Style.STROKE);
this.setBackground(drawable);
}
//// TODO: 15/8/28 May cause trouble when invoked after inited
public mCalendarView travelTo(DateData dateData){
this.currentDate = dateData;
CalendarUtil.date = dateData;
this.initted = false;
init((FragmentActivity) getContext());
return this;
}
public mCalendarView markDate(int year, int month, int day){
MarkedDates.getInstance().add(new DateData(year, month, day));
return this;
}
public mCalendarView unMarkDate(int year, int month, int day){
MarkedDates.getInstance().remove(new DateData(year, month, day));
return this;
}
public mCalendarView markDate(DateData date){
MarkedDates.getInstance().add(date);
return this;
}
public mCalendarView unMarkDate(DateData date){
MarkedDates.getInstance().remove(date);
return this;
}
public MarkedDates getMarkedDates(){
return MarkedDates.getInstance();
}
public mCalendarView setDateCell(int resId){
adapter.setDateCellId(resId);
return this;
}
// public mCalendarView setDateCellView(BaseCellView view){
// adapter.setDateCell(view);
// return this;
// }
public mCalendarView setMarkedStyle(int style, int color){
MarkStyle.current = style;
MarkStyle.color = color;
return this;
}
public mCalendarView setMarkedStyle(int style){
MarkStyle.current = style;
return this;
}
public mCalendarView setMarkedCell(int resId){
adapter.setMarkCellId(resId);
return this;
}
// public mCalendarView setMarkedCellView(BaseCellView view){
// adapter.setDateCell(view);
// return this;
// }
public mCalendarView setOnMonthChangeListener(OnMonthChangeListener listener){
this.addOnPageChangeListener(listener);
return this;
}
public mCalendarView setOnDateClickListener(OnDateClickListener onDateClickListener){
OnDateClickListener.instance = onDateClickListener;
return this;
}
@Override
protected void onMeasure(int measureWidthSpec,int measureHeightSpec){
super.onMeasure(measureWidthSpec, measureHeightSpec);
width = measureWidth(measureWidthSpec);
height = measureHeight(measureHeightSpec);
this.setMeasuredDimension(width, height);
}
private int measureWidth(int measureSpec) {
int specMode = MeasureSpec.getMode(measureSpec);
int specSize = MeasureSpec.getSize(measureSpec);
int result = 0;
if (specMode == MeasureSpec.AT_MOST) {
result = (int) (CellConfig.cellWidth * 7 * getContext().getResources().getSystem().getDisplayMetrics().density);
} else if (specMode == MeasureSpec.EXACTLY) {
result = specSize;
} else {
result = CellConfig.cellHeight;
}
return result;
}
private int measureHeight(int measureSpec) {
int specMode = MeasureSpec.getMode(measureSpec);
int specSize = MeasureSpec.getSize(measureSpec);
int result = 0;
if (specMode == MeasureSpec.AT_MOST) {
result = (int) (CellConfig.cellWidth * 7 * getContext().getResources().getSystem().getDisplayMetrics().density);
} else if (specMode == MeasureSpec.EXACTLY) {
result = specSize;
} else {
result = CellConfig.cellHeight;
}
return result;
}
}
| rakawestu/mCalendarView | mcalendarview/src/main/java/sun/bob/mcalendarview/mCalendarView.java | Java | apache-2.0 | 5,945 | [
30522,
7427,
3103,
1012,
3960,
1012,
22432,
7770,
7662,
8584,
1025,
12324,
11924,
1012,
4180,
1012,
6123,
1025,
12324,
11924,
1012,
8389,
1012,
3609,
1025,
12324,
11924,
1012,
8389,
1012,
6773,
1025,
12324,
11924,
1012,
8389,
1012,
4009,
30... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* USI wm-bn-bm-01-5(bcm4329) sdio wifi power management API
* evb gpio define
* A10 gpio define:
* usi_bm01a_wl_pwr = port:PH12<1><default><default><0>
* usi_bm01a_wlbt_regon = port:PI11<1><default><default><0>
* usi_bm01a_wl_rst = port:PI10<1><default><default><0>
* usi_bm01a_wl_wake = port:PI12<1><default><default><0>
* usi_bm01a_bt_rst = port:PB05<1><default><default><0>
* usi_bm01a_bt_wake = port:PI20<1><default><default><0>
* usi_bm01a_bt_hostwake = port:PI21<0><default><default><0>
* -----------------------------------------------------------
* A12 gpio define:
* usi_bm01a_wl_pwr = LDO3
* usi_bm01a_wl_wake = port:PA01<1><default><default><0>
* usi_bm01a_wlbt_regon = port:PA02<1><default><default><0>
* usi_bm01a_wl_rst = port:PA03<1><default><default><0>
* usi_bm01a_bt_rst = port:PA04<1><default><default><0>
* usi_bm01a_bt_wake = port:PA05<1><default><default><0>
* usi_bm01a_bt_hostwake =
*/
#include <linux/kernel.h>
#include <linux/module.h>
#include <mach/sys_config.h>
#include "mmc_pm.h"
#define usi_msg(...) do {printk("[usi_bm01a]: "__VA_ARGS__);} while(0)
static int usi_bm01a_wl_on = 0;
static int usi_bm01a_bt_on = 0;
#if CONFIG_CHIP_ID==1125
#include <linux/regulator/consumer.h>
static int usi_bm01a_power_onoff(int onoff)
{
struct regulator* wifi_ldo = NULL;
static int first = 1;
#ifndef CONFIG_AW_AXP
usi_msg("AXP driver is disabled, pls check !!\n");
return 0;
#endif
usi_msg("usi_bm01a_power_onoff\n");
wifi_ldo = regulator_get(NULL, "axp20_pll");
if (!wifi_ldo)
usi_msg("Get power regulator failed\n");
if (first) {
usi_msg("first time\n");
regulator_force_disable(wifi_ldo);
first = 0;
}
if (onoff) {
usi_msg("regulator on\n");
regulator_set_voltage(wifi_ldo, 3300000, 3300000);
regulator_enable(wifi_ldo);
} else {
usi_msg("regulator off\n");
regulator_disable(wifi_ldo);
}
return 0;
}
#endif
static int usi_bm01a_gpio_ctrl(char* name, int level)
{
struct mmc_pm_ops *ops = &mmc_card_pm_ops;
char* gpio_cmd[6] = {"usi_bm01a_wl_regon", "usi_bm01a_bt_regon", "usi_bm01a_wl_rst",
"usi_bm01a_wl_wake", "usi_bm01a_bt_rst", "usi_bm01a_bt_wake"};
int i = 0;
int ret = 0;
for (i=0; i<6; i++) {
if (strcmp(name, gpio_cmd[i])==0)
break;
}
if (i==6) {
usi_msg("No gpio %s for USI-BM01A module\n", name);
return -1;
}
// usi_msg("Set GPIO %s to %d !\n", name, level);
if (strcmp(name, "usi_bm01a_wl_regon") == 0) {
if (level) {
if (usi_bm01a_bt_on) {
usi_msg("USI-BM01A is already powered up by bluetooth\n");
goto change_state;
} else {
usi_msg("USI-BM01A is powered up by wifi\n");
goto power_change;
}
} else {
if (usi_bm01a_bt_on) {
usi_msg("USI-BM01A should stay on because of bluetooth\n");
goto change_state;
} else {
usi_msg("USI-BM01A is powered off by wifi\n");
goto power_change;
}
}
}
if (strcmp(name, "usi_bm01a_bt_regon") == 0) {
if (level) {
if (usi_bm01a_wl_on) {
usi_msg("USI-BM01A is already powered up by wifi\n");
goto change_state;
} else {
usi_msg("USI-BM01A is powered up by bt\n");
goto power_change;
}
} else {
if (usi_bm01a_wl_on) {
usi_msg("USI-BM01A should stay on because of wifi\n");
goto change_state;
} else {
usi_msg("USI-BM01A is powered off by bt\n");
goto power_change;
}
}
}
ret = gpio_write_one_pin_value(ops->pio_hdle, level, name);
if (ret) {
usi_msg("Failed to set gpio %s to %d !\n", name, level);
return -1;
}
return 0;
power_change:
#if CONFIG_CHIP_ID==1123
ret = gpio_write_one_pin_value(ops->pio_hdle, level, "usi_bm01a_wl_pwr");
#elif CONFIG_CHIP_ID==1125
ret = usi_bm01a_power_onoff(level);
#else
#error "Found wrong chip id in wifi onoff\n"
#endif
if (ret) {
usi_msg("Failed to power off USI-BM01A module!\n");
return -1;
}
ret = gpio_write_one_pin_value(ops->pio_hdle, level, "usi_bm01a_wlbt_regon");
if (ret) {
usi_msg("Failed to regon off for USI-BM01A module!\n");
return -1;
}
change_state:
if (strcmp(name, "usi_bm01a_wl_regon")==0)
usi_bm01a_wl_on = level;
if (strcmp(name, "usi_bm01a_bt_regon")==0)
usi_bm01a_bt_on = level;
usi_msg("USI-BM01A power state change: wifi %d, bt %d !!\n", usi_bm01a_wl_on, usi_bm01a_bt_on);
return 0;
}
static int usi_bm01a_get_gpio_value(char* name)
{
struct mmc_pm_ops *ops = &mmc_card_pm_ops;
char* bt_hostwake = "usi_bm01a_bt_hostwake";
if (strcmp(name, bt_hostwake)) {
usi_msg("No gpio %s for USI-BM01A\n", name);
return -1;
}
return gpio_read_one_pin_value(ops->pio_hdle, name);
}
void usi_bm01a_gpio_init(void)
{
struct mmc_pm_ops *ops = &mmc_card_pm_ops;
usi_bm01a_wl_on = 0;
usi_bm01a_bt_on = 0;
ops->gpio_ctrl = usi_bm01a_gpio_ctrl;
ops->get_io_val = usi_bm01a_get_gpio_value;
}
| sdugit/linux-3.0_7025 | drivers/mmc/mmc-pm/mmc_pm_usi_bm01a.c | C | gpl-2.0 | 5,469 | [
30522,
1013,
1008,
1008,
2149,
2072,
1059,
2213,
1011,
24869,
1011,
1038,
2213,
1011,
5890,
1011,
1019,
1006,
4647,
2213,
23777,
24594,
1007,
17371,
3695,
15536,
8873,
2373,
2968,
17928,
1008,
23408,
2497,
14246,
3695,
9375,
1008,
17350,
26... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
*
* Servo.c
*
* Created: April 30 2016
* Authors: Yuqi (Mark) Zhao and Claire Chen
*/
#include "Servo.h"
/*
* Configure ports PTD0 and PTD2 as the GPIO output pins for both servos.
*/
void servo_init(void){
//Enable power to port D
SIM->SCGC5 |= SIM_SCGC5_PORTD_MASK;
//Set up each pin as GPIO output
PORTD->PCR[SERVO1] |= PORT_PCR_MUX(001);
PTD->PDDR |= (1 << SERVO1);
PTD->PDOR &= ~(1 << SERVO1); //Initialize pin to 0
PORTD->PCR[SERVO1] &= ~(1 << PORT_PCR_SRE_SHIFT); //Configure fast slew rate
PORTD->PCR[SERVO2] |= PORT_PCR_MUX(001);
PTD->PDDR |= (1 << SERVO2);
PTD->PDOR &= ~(1 << SERVO2); //Initialize pin to 0
PORTD->PCR[SERVO2] &= ~(1 << PORT_PCR_SRE_SHIFT); //Configure fast slew rate
}
/*
* This function sets up PIT0 and PIT1, which will be used for setting the
* Correct periods to control the servo positions!
*/
void servo_setup_timers(void){
int default_position1;
int default_position2;
servo1_angle = SERVO1_NEUTRAL; //Initialize the start angle to 90
servo2_angle = SERVO2_NEUTRAL;
SIM->SCGC6 |= SIM_SCGC6_PIT_MASK; // Enable Clock to PIT
PIT->MCR = 0x0; // Enables PIT timer, allows running in debug mode
default_position1 = servo_get_high(servo1_angle); // Sets both servos to 90 degrees
default_position2 = servo_get_high(servo2_angle);
// Set up PIT0 and PIT1
PIT->CHANNEL[0].LDVAL = default_position1;
PIT->CHANNEL[0].TCTRL = 3;
PIT->CHANNEL[1].LDVAL = default_position2;
PIT->CHANNEL[1].TCTRL = 3;
//Enable interrupts on PIT0 and PIT1
NVIC_EnableIRQ(PIT0_IRQn);
NVIC_EnableIRQ(PIT1_IRQn);
}
/*
* Takes in angle between 0 and 180 degrees
* Returns integer corresponding to appropriate high load value between 1ms and 2ms
*/
int servo_get_high(int angle){
float angle_range = (float)(MAX_ANGLE - MIN_ANGLE);
float angle_distance = angle/angle_range;
int load_val = (int) (MILLISECOND + MILLISECOND * (angle_distance));
return load_val;
}
/*
* Takes in load value of high pulse
* Returns integer corresponding to appropriate low load value
*/
int servo_get_low(int angle){
int high_load_val = servo_get_high(angle);
int low_load_val = PERIOD - high_load_val;
return low_load_val;
}
/*
* Signals servo to hit, depending on the servo_num
*/
void servo_hit(int servo_num){
if(servo_num == 1){
tap_dat_1 = 1;
//Set servo angle to hit
servo1_angle = SERVO1_HIT;
/*
if(intflag == 0){
intflag = 1;
LEDGrn_On();
}
else{
intflag = 0;
LEDGrn_Off();
}
*/
}
else if(servo_num == 2){
tap_dat_2 = 1;
servo2_angle = SERVO2_HIT;
/*
if(intflag2 == 0){
intflag2 = 1;
LEDRed_On();
}
else{
intflag2 = 0;
LEDRed_Off();
}
*/
}
}
| markz114/Drumroll-Bot | Servo.c | C | mit | 2,686 | [
30522,
1013,
1008,
1008,
1008,
14262,
6767,
1012,
1039,
1008,
1008,
2580,
1024,
2258,
2382,
2355,
1008,
6048,
1024,
9805,
14702,
1006,
2928,
1007,
15634,
1998,
6249,
8802,
1008,
1013,
1001,
2421,
1000,
14262,
6767,
1012,
1044,
1000,
1013,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_65) on Tue Feb 23 15:34:55 CET 2016 -->
<title>Uses of Class com.peterverzijl.softwaresystems.qwirkle.networking.Protocol.Client</title>
<meta name="date" content="2016-02-23">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class com.peterverzijl.softwaresystems.qwirkle.networking.Protocol.Client";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../com/peterverzijl/softwaresystems/qwirkle/networking/Protocol.Client.html" title="class in com.peterverzijl.softwaresystems.qwirkle.networking">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?com/peterverzijl/softwaresystems/qwirkle/networking/class-use/Protocol.Client.html" target="_top">Frames</a></li>
<li><a href="Protocol.Client.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 title="Uses of Class com.peterverzijl.softwaresystems.qwirkle.networking.Protocol.Client" class="title">Uses of Class<br>com.peterverzijl.softwaresystems.qwirkle.networking.Protocol.Client</h2>
</div>
<div class="classUseContainer">No usage of com.peterverzijl.softwaresystems.qwirkle.networking.Protocol.Client</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../com/peterverzijl/softwaresystems/qwirkle/networking/Protocol.Client.html" title="class in com.peterverzijl.softwaresystems.qwirkle.networking">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?com/peterverzijl/softwaresystems/qwirkle/networking/class-use/Protocol.Client.html" target="_top">Frames</a></li>
<li><a href="Protocol.Client.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
| PeterVerzijl/Qwirkle | doc/com/peterverzijl/softwaresystems/qwirkle/networking/class-use/Protocol.Client.html | HTML | mit | 4,765 | [
30522,
1026,
999,
9986,
13874,
16129,
2270,
1000,
1011,
1013,
1013,
1059,
2509,
2278,
1013,
1013,
26718,
2094,
16129,
1018,
1012,
5890,
17459,
1013,
1013,
4372,
1000,
1000,
8299,
1024,
1013,
1013,
7479,
1012,
1059,
2509,
1012,
8917,
1013,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
// ==========================================================================
// snd_app
// ==========================================================================
// Copyright (c) 2006-2012, Knut Reinert, FU Berlin
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// * Neither the name of Knut Reinert or the FU Berlin nor the names of
// its contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL KNUT REINERT OR THE FU BERLIN BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
// DAMAGE.
//
// ==========================================================================
// Author: Your Name <your.email@example.net>
// ==========================================================================
#include <seqan/basic.h>
#include <seqan/sequence.h>
#include <seqan/arg_parse.h>
// ==========================================================================
// Classes
// ==========================================================================
// --------------------------------------------------------------------------
// Class AppOptions
// --------------------------------------------------------------------------
// This struct stores the options from the command line.
//
// You might want to rename this to reflect the name of your app.
struct AppOptions
{
// Verbosity level. 0 -- quiet, 1 -- normal, 2 -- verbose, 3 -- very verbose.
int verbosity;
// The first (and only) argument of the program is stored here.
seqan::CharString text;
AppOptions() :
verbosity(1)
{}
};
// ==========================================================================
// Functions
// ==========================================================================
// --------------------------------------------------------------------------
// Function parseCommandLine()
// --------------------------------------------------------------------------
seqan::ArgumentParser::ParseResult
parseCommandLine(AppOptions & options, int argc, char const ** argv)
{
// Setup ArgumentParser.
seqan::ArgumentParser parser("snd_app");
// Set short description, version, and date.
setShortDescription(parser, "Put a Short Description Here");
setVersion(parser, "0.1");
setDate(parser, "July 2012");
// Define usage line and long description.
addUsageLine(parser, "[\\fIOPTIONS\\fP] \"\\fITEXT\\fP\"");
addDescription(parser, "This is the application skelleton and you should modify this string.");
// We require one argument.
addArgument(parser, seqan::ArgParseArgument(seqan::ArgParseArgument::STRING, "TEXT"));
addOption(parser, seqan::ArgParseOption("q", "quiet", "Set verbosity to a minimum."));
addOption(parser, seqan::ArgParseOption("v", "verbose", "Enable verbose output."));
addOption(parser, seqan::ArgParseOption("vv", "very-verbose", "Enable very verbose output."));
// Add Examples Section.
addTextSection(parser, "Examples");
addListItem(parser, "\\fBsnd_app\\fP \\fB-v\\fP \\fItext\\fP",
"Call with \\fITEXT\\fP set to \"text\" with verbose output.");
// Parse command line.
seqan::ArgumentParser::ParseResult res = seqan::parse(parser, argc, argv);
// Only extract options if the program will continue after parseCommandLine()
if (res != seqan::ArgumentParser::PARSE_OK)
return res;
// Extract option values.
if (isSet(parser, "quiet"))
options.verbosity = 0;
if (isSet(parser, "verbose"))
options.verbosity = 2;
if (isSet(parser, "very-verbose"))
options.verbosity = 3;
seqan::getArgumentValue(options.text, parser, 0);
return seqan::ArgumentParser::PARSE_OK;
}
// --------------------------------------------------------------------------
// Function main()
// --------------------------------------------------------------------------
// Program entry point.
int main(int argc, char const ** argv)
{
// Parse the command line.
seqan::ArgumentParser parser;
AppOptions options;
seqan::ArgumentParser::ParseResult res = parseCommandLine(options, argc, argv);
// If there was an error parsing or built-in argument parser functionality
// was triggered then we exit the program. The return code is 1 if there
// were errors and 0 if there were none.
if (res != seqan::ArgumentParser::PARSE_OK)
return res == seqan::ArgumentParser::PARSE_ERROR;
std::cout << "EXAMPLE PROGRAM\n"
<< "===============\n\n";
// Print the command line arguments back to the user.
if (options.verbosity > 0)
{
std::cout << "__OPTIONS____________________________________________________________________\n"
<< '\n'
<< "VERBOSITY\t" << options.verbosity << '\n'
<< "TEXT \t" << options.text << "\n\n";
}
return 0;
}
| bkahlert/seqan-research | raw/pmsb13/pmsb13-data-20130530/sources/130wu1dgzoqmxyu2/2013-04-09T10-23-18.897+0200/sandbox/my_sandbox/apps/snd_app/snd_app.cpp | C++ | mit | 6,165 | [
30522,
1013,
1013,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
30524,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1013,
1013,
1055,
4859,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package vg.civcraft.mc.mercury.venus;
import vg.civcraft.mc.mercury.MercuryPlugin;
import vg.civcraft.mc.mercury.ServiceHandler;
public class VenusHandler implements ServiceHandler {
private VenusService service;
private MercuryPlugin plugin = MercuryPlugin.instance;
public VenusHandler(){
service = new VenusService();
if (service.connected) {
service.start();
} else {
service = null;
}
}
// Venus doesn't need to be pinged.
@Override
public void pingService() {}
@Override
public void addServerToServerList() {}
@Override
public void sendMessage(String server, String message, String... pluginChannels) {
if (service == null) {
return;
}
for (String channel : pluginChannels) {
service.sendMessage(server, message, channel);
}
}
@Override
public void sendGlobalMessage(String message, String... pluginChannels) {
throw new UnsupportedOperationException();
}
// Venus doesn't need channels registered.
@Override
public void addChannels(String... channels) {}
@Override
public void addGlobalChannels(String... pluginChannels) {
addChannels(pluginChannels);
}
@Override
public void destory() {
if (service != null)
service.teardown();
}
@Override
public boolean isEnabled(){
return service != null;
}
}
| Civcraft/Mercury | src/vg/civcraft/mc/mercury/venus/VenusHandler.java | Java | bsd-3-clause | 1,282 | [
30522,
7427,
1058,
2290,
1012,
25022,
25465,
27528,
2102,
1012,
11338,
1012,
8714,
1012,
11691,
1025,
12324,
1058,
2290,
1012,
25022,
25465,
27528,
2102,
1012,
11338,
1012,
8714,
1012,
8714,
24759,
15916,
2378,
1025,
12324,
1058,
2290,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
/**
* Created by PhpStorm.
* User: Lien
* Date: 5/05/2017
* Time: 13:59
*/
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Login</title>
<link href="https://fonts.googleapis.com/css?family=Raleway|Slabo+27px" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="/assets/css/login.css">
<script>
function validateForm() {
var x = document.forms["loginform"]["uname"].value;
if (x == "") {
alert("Name must be filled out");
return false;
}
var y = document.forms["loginform"]["psw"].value;
if (y == "") {
alert("Password must be filled out");
return false;
}
}
</script>
</head>
<body>
<!-- php code hide -->
<div class="center img">
<div class="fullop">
<img src="/assets/pxl_logo.png" alt="Logo PXL" width="2%" height="2%" >
</div>
<div class="fullop">
<h2 class="font-title">Login:</h2>
<form class="font" name="loginform" action="/login" method="post">
<label>Username: </label>
<input type="text" placeholder="Vul uw username in" name="uname" required>
<br>
<br>
<label>Paswoord: </label>
<input type="password" placeholder="Vul uw paswoord in" name="psw" required>
<br>
<br>
<button class="button fullop" type="submit">Login</button>
</form>
<div id="result" >
<p class="red"> <?php echo $message ?></p>
</div>
</div>
</body>
</html> | Alevyr/WebAdvancedCodeIgniter2017 | application/views/ViewLogin.php | PHP | mit | 1,588 | [
30522,
1026,
1029,
25718,
1013,
1008,
1008,
1008,
2580,
2011,
25718,
19718,
1012,
1008,
5310,
1024,
4682,
2078,
1008,
3058,
1024,
1019,
1013,
5709,
1013,
2418,
1008,
2051,
1024,
2410,
1024,
5354,
1008,
1013,
1029,
1028,
1026,
999,
9986,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tera.Game.Messages;
namespace DamageMeter.Heuristic
{
class S_PRIVATE_CHAT : AbstractPacketHeuristic
{
public new void Process(ParsedMessage message)
{
base.Process(message);
if (IsKnown || OpcodeFinder.Instance.IsKnown(message.OpCode)) return;
if (message.Payload.Count < 2+2+4+8+4+4) return;
if(!OpcodeFinder.Instance.IsKnown(OpcodeEnum.S_JOIN_PRIVATE_CHANNEL)) return;
var authorOffset = Reader.ReadUInt16();
var messageOffset = Reader.ReadUInt16();
var channel = Reader.ReadUInt32();
if(!S_JOIN_PRIVATE_CHANNEL.JoinedChannelId.Contains(channel)) return;
var authorId = Reader.ReadUInt64();
if(Reader.BaseStream.Position != authorOffset - 4) return;
try { var author = Reader.ReadTeraString(); }
catch (Exception e) { return; }
if (Reader.BaseStream.Position != messageOffset - 4) return;
try
{
var msg = Reader.ReadTeraString();
if(!msg.Contains("<FONT")) return;
}
catch (Exception e) { return; }
OpcodeFinder.Instance.SetOpcode(message.OpCode, OPCODE);
}
}
}
| neowutran/OpcodeSearcher | DamageMeter.Core/Heuristic/S_PRIVATE_CHAT.cs | C# | mit | 1,375 | [
30522,
2478,
2291,
1025,
2478,
2291,
1012,
6407,
1012,
12391,
1025,
2478,
2291,
1012,
11409,
4160,
1025,
2478,
2291,
1012,
3793,
1025,
2478,
2291,
1012,
11689,
2075,
1012,
8518,
1025,
2478,
28774,
2050,
1012,
2208,
1012,
7696,
1025,
3415,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Globalization;
using System.Windows.Data;
namespace map2agbgui.Converters
{
[ValueConversion(typeof(bool), typeof(bool))]
public class InverseBooleanConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return !(bool)value;
}
public object ConvertBack(object value, Type targetType, object parameter,CultureInfo culture)
{
throw new NotSupportedException();
}
}
}
| StarGate01/map2agb | map2agbgui/Converters/InverseBooleanConverter.cs | C# | gpl-3.0 | 660 | [
30522,
2478,
2291,
1025,
2478,
2291,
1012,
6407,
1012,
12391,
1025,
2478,
2291,
1012,
11409,
4160,
1025,
2478,
2291,
1012,
3793,
1025,
2478,
2291,
1012,
11689,
2075,
1012,
8518,
1025,
2478,
2291,
1012,
24370,
1025,
2478,
2291,
1012,
3645,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* Copyright 2009 Andy Lee.
*
* 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 uk.co.optimisticpanda.gtest.dto.defaultfill.enggen.visit;
import uk.co.optimisticpanda.gtest.dto.IDataEditor;
/**
* A Visitor that uses the passed in {@link IDataEditor} to edit the dtos that it visits
*
* @param <D>
* @author Andy Lee
*/
public class DataEditorVisitor<D> implements IEngineVisitor<D> {
private final IDataEditor<D> editor;
public DataEditorVisitor(IDataEditor<D> editor) {
this.editor = editor;
}
@Override
public void visit(int index, D dto) {
editor.edit(index, dto);
}
}
| plasma147/lorraine-dto-test-gen | src/main/java/uk/co/optimisticpanda/gtest/dto/defaultfill/enggen/visit/DataEditorVisitor.java | Java | apache-2.0 | 1,114 | [
30522,
1013,
1008,
1008,
9385,
2268,
5557,
3389,
1012,
1008,
1008,
7000,
2104,
1996,
15895,
6105,
1010,
2544,
1016,
1012,
1014,
1006,
1996,
1000,
6105,
1000,
1007,
1025,
2017,
2089,
2025,
1008,
2224,
2023,
5371,
3272,
1999,
12646,
2007,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<h1>Our Family Photo</h1>
<br />
<div style="background-color:black;padding:10px;">
<!-- Nav tabs -->
<ul class="nav nav-stackedtabs" role="tablist" style="float:right;width:20%;">
{% for item in site.data.photos %}
<li role="presentation" {% if forloop.first %}class="active"{% endif %}><a href="#{{ item.year }}" aria-controls="{{ item.year }}" role="tab" data-toggle="tab">{{ item.year }}</a></li>
{% endfor %}
</ul>
<!-- Tab panes -->
<div class="tab-content">
{% for photo in site.data.photos %}
<div role="tabpanel" class="tab-pane {% if forloop.first %}active{% endif %}" id="{{ photo.year }}">
{% responsive_image_block %}
path: assets/img/family-photos/{{ photo.image }}
class: "img-responsive"
alt: "{{ item.year }}"
title: "{{ item.year }}"
{% endresponsive_image_block %}
{% if photo.discription %}
<div>
<h2>{{ photo.title }}</h2>
<p>{{ photo.discription }}</p>
</div>
{% endif %}
</div>
{% endfor %}
</div>
</div>
| mattrude/therudes.com | _includes/photo.html | HTML | gpl-3.0 | 1,256 | [
30522,
1026,
1044,
2487,
1028,
2256,
2155,
6302,
1026,
1013,
1044,
2487,
1028,
1026,
7987,
1013,
1028,
1026,
4487,
2615,
2806,
1027,
1000,
4281,
1011,
3609,
1024,
2304,
1025,
11687,
4667,
1024,
2184,
2361,
2595,
1025,
1000,
1028,
1026,
99... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
namespace Elgg\Upgrades;
use Elgg\Upgrade\SystemUpgrade;
use Elgg\Upgrade\Result;
use Elgg\Database\Select;
use Elgg\Database\Update;
/**
* Change the metadata name of the user notification settings to be multi-purpose
*
* @since 4.0
*/
class ChangeUserNotificationSettingsNamespace implements SystemUpgrade {
/**
* {@inheritDoc}
*/
public function getVersion(): int {
return 2021040701;
}
/**
* {@inheritDoc}
*/
public function needsIncrementOffset(): bool {
return false;
}
/**
* {@inheritDoc}
*/
public function shouldBeSkipped(): bool {
return empty($this->countItems());
}
/**
* {@inheritDoc}
*/
public function countItems(): int {
$select = Select::fromTable('metadata', 'md');
$entities_table = $select->joinEntitiesTable('md', 'entity_guid');
$select->select('count(*) AS total')
->where($select->compare('md.name', 'like', 'notification:method:%', ELGG_VALUE_STRING))
->andWhere($select->compare("{$entities_table}.type", '=', 'user', ELGG_VALUE_STRING));
$result = elgg()->db->getDataRow($select);
return (int) $result->total;
}
/**
* {@inheritDoc}
*/
public function run(Result $result, $offset): Result {
$update = Update::table('metadata');
$update->set('name', 'REPLACE(name, "notification:method:", "notification:default:")')
->where($update->compare('name', 'like', 'notification:method:%', ELGG_VALUE_STRING));
$users = $update->subquery('entities');
$users->select('guid')
->where($update->compare('type', '=', 'user', ELGG_VALUE_STRING));
$update->andWhere($update->compare('entity_guid', 'in', $users->getSQL()));
$num_rows = elgg()->db->updateData($update, true);
$result->addSuccesses($num_rows);
return $result;
}
}
| mrclay/Elgg-leaf | engine/classes/Elgg/Upgrades/ChangeUserNotificationSettingsNamespace.php | PHP | gpl-2.0 | 1,760 | [
30522,
1026,
1029,
25718,
3415,
15327,
3449,
13871,
1032,
18739,
1025,
2224,
3449,
13871,
1032,
12200,
1032,
2291,
6279,
24170,
1025,
2224,
3449,
13871,
1032,
12200,
1032,
2765,
1025,
2224,
3449,
13871,
1032,
7809,
1032,
7276,
1025,
2224,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
#
# Makefile for the Marvell Audio ALSA Device Driver
#
ifneq ($(MACHINE),)
include $(srctree)/$(MACHINE)/config/mvRules.mk
endif
obj-$(CONFIG_MMC_MVSDMMC) += mvsdmmc.o
| nighthawk149/xpenology-4.2-kernel | arch/arm/plat-armada/mv_drivers_lsp/mv_sdio/Makefile | Makefile | gpl-2.0 | 170 | [
30522,
1001,
1001,
30524,
1006,
3698,
1007,
1010,
1007,
2421,
1002,
1006,
5034,
6593,
9910,
1007,
1013,
1002,
1006,
3698,
1007,
1013,
9530,
8873,
2290,
1013,
19842,
6820,
4244,
1012,
12395,
2203,
10128,
27885,
3501,
1011,
1002,
1006,
9530,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* ASoC driver for TI DAVINCI EVM platform
*
* Author: Vladimir Barinov, <vbarinov@embeddedalley.com>
* Copyright: (C) 2007 MontaVista Software, Inc., <source@mvista.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/timer.h>
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <linux/i2c.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/soc.h>
#include <asm/dma.h>
#include <asm/mach-types.h>
#include <asm/hardware/asp.h>
#include <mach/edma.h>
#ifdef CONFIG_MACH_AM335XEVM
#include <mach/board-am335xevm.h>
#endif
#include "davinci-pcm.h"
#include "davinci-i2s.h"
#include "davinci-mcasp.h"
#define AUDIO_FORMAT (SND_SOC_DAIFMT_DSP_B | \
SND_SOC_DAIFMT_CBM_CFM | SND_SOC_DAIFMT_IB_NF)
static int evm_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params)
{
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct snd_soc_dai *codec_dai = rtd->codec_dai;
struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
int ret = 0;
unsigned sysclk;
/* ASP1 on DM355 EVM is clocked by an external oscillator */
if (machine_is_davinci_dm355_evm() || machine_is_davinci_dm6467_evm() ||
machine_is_davinci_dm365_evm())
sysclk = 27000000;
/* ASP0 in DM6446 EVM is clocked by U55, as configured by
* board-dm644x-evm.c using GPIOs from U18. There are six
* options; here we "know" we use a 48 KHz sample rate.
*/
else if (machine_is_davinci_evm())
sysclk = 12288000;
else if (machine_is_davinci_da830_evm() ||
machine_is_davinci_da850_evm())
sysclk = 24576000;
/* On AM335X, CODEC gets MCLK from external Xtal (12MHz). */
else if (machine_is_am335xevm())
#ifdef CONFIG_MACH_AM335XEVM
if (am335x_evm_get_id() == EVM_SK)
sysclk = 24000000;
else
#endif
sysclk = 12000000;
else if (machine_is_var_som_am33())
sysclk = 24000000;
else
return -EINVAL;
/* set codec DAI configuration */
ret = snd_soc_dai_set_fmt(codec_dai, AUDIO_FORMAT);
if (ret < 0)
return ret;
/* set cpu DAI configuration */
ret = snd_soc_dai_set_fmt(cpu_dai, AUDIO_FORMAT);
if (ret < 0)
return ret;
/* set the codec system clock */
ret = snd_soc_dai_set_sysclk(codec_dai, 0, sysclk, SND_SOC_CLOCK_OUT);
if (ret < 0)
return ret;
return 0;
}
static int evm_spdif_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params)
{
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
/* set cpu DAI configuration */
return snd_soc_dai_set_fmt(cpu_dai, AUDIO_FORMAT);
}
static struct snd_soc_ops evm_ops = {
.hw_params = evm_hw_params,
};
static struct snd_soc_ops evm_spdif_ops = {
.hw_params = evm_spdif_hw_params,
};
/* davinci-evm machine dapm widgets */
static const struct snd_soc_dapm_widget aic3x_dapm_widgets[] = {
SND_SOC_DAPM_HP("Headphone Jack", NULL),
SND_SOC_DAPM_LINE("Line Out", NULL),
SND_SOC_DAPM_MIC("Mic Jack", NULL),
SND_SOC_DAPM_LINE("Line In", NULL),
};
/* davinci-evm machine audio_mapnections to the codec pins */
static const struct snd_soc_dapm_route audio_map[] = {
/* Headphone connected to HPLOUT, HPROUT */
{"Headphone Jack", NULL, "HPLOUT"},
{"Headphone Jack", NULL, "HPROUT"},
/* Line Out connected to LLOUT, RLOUT */
{"Line Out", NULL, "LLOUT"},
{"Line Out", NULL, "RLOUT"},
/* Mic connected to (MIC3L | MIC3R) */
{"MIC3L", NULL, "Mic Bias 2V"},
{"MIC3R", NULL, "Mic Bias 2V"},
{"Mic Bias 2V", NULL, "Mic Jack"},
/* Line In connected to (LINE1L | LINE2L), (LINE1R | LINE2R) */
{"LINE1L", NULL, "Line In"},
{"LINE2L", NULL, "Line In"},
{"LINE1R", NULL, "Line In"},
{"LINE2R", NULL, "Line In"},
};
/* Logic for a aic3x as connected on a davinci-evm */
static int evm_aic3x_init(struct snd_soc_pcm_runtime *rtd)
{
struct snd_soc_codec *codec = rtd->codec;
struct snd_soc_dapm_context *dapm = &codec->dapm;
/* Add davinci-evm specific widgets */
snd_soc_dapm_new_controls(dapm, aic3x_dapm_widgets,
ARRAY_SIZE(aic3x_dapm_widgets));
/* Set up davinci-evm specific audio path audio_map */
snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
/* not connected */
snd_soc_dapm_disable_pin(dapm, "MONO_LOUT");
snd_soc_dapm_disable_pin(dapm, "HPLCOM");
snd_soc_dapm_disable_pin(dapm, "HPRCOM");
/* always connected */
snd_soc_dapm_enable_pin(dapm, "Headphone Jack");
snd_soc_dapm_enable_pin(dapm, "Line Out");
snd_soc_dapm_enable_pin(dapm, "Mic Jack");
snd_soc_dapm_enable_pin(dapm, "Line In");
return 0;
}
/* davinci-evm digital audio interface glue - connects codec <--> CPU */
static struct snd_soc_dai_link dm6446_evm_dai = {
.name = "TLV320AIC3X",
.stream_name = "AIC3X",
.cpu_dai_name = "davinci-mcbsp",
.codec_dai_name = "tlv320aic3x-hifi",
.codec_name = "tlv320aic3x-codec.1-001b",
.platform_name = "davinci-pcm-audio",
.init = evm_aic3x_init,
.ops = &evm_ops,
};
static struct snd_soc_dai_link dm355_evm_dai = {
.name = "TLV320AIC3X",
.stream_name = "AIC3X",
.cpu_dai_name = "davinci-mcbsp.1",
.codec_dai_name = "tlv320aic3x-hifi",
.codec_name = "tlv320aic3x-codec.1-001b",
.platform_name = "davinci-pcm-audio",
.init = evm_aic3x_init,
.ops = &evm_ops,
};
static struct snd_soc_dai_link dm365_evm_dai = {
#ifdef CONFIG_SND_DM365_AIC3X_CODEC
.name = "TLV320AIC3X",
.stream_name = "AIC3X",
.cpu_dai_name = "davinci-mcbsp",
.codec_dai_name = "tlv320aic3x-hifi",
.init = evm_aic3x_init,
.codec_name = "tlv320aic3x-codec.1-0018",
.ops = &evm_ops,
#elif defined(CONFIG_SND_DM365_VOICE_CODEC)
.name = "Voice Codec - CQ93VC",
.stream_name = "CQ93",
.cpu_dai_name = "davinci-vcif",
.codec_dai_name = "cq93vc-hifi",
.codec_name = "cq93vc-codec",
#endif
.platform_name = "davinci-pcm-audio",
};
static struct snd_soc_dai_link dm6467_evm_dai[] = {
{
.name = "TLV320AIC3X",
.stream_name = "AIC3X",
.cpu_dai_name= "davinci-mcasp.0",
.codec_dai_name = "tlv320aic3x-hifi",
.platform_name ="davinci-pcm-audio",
.codec_name = "tlv320aic3x-codec.0-001a",
.init = evm_aic3x_init,
.ops = &evm_ops,
},
{
.name = "McASP",
.stream_name = "spdif",
.cpu_dai_name= "davinci-mcasp.1",
.codec_dai_name = "dit-hifi",
.codec_name = "spdif_dit",
.platform_name = "davinci-pcm-audio",
.ops = &evm_spdif_ops,
},
};
static struct snd_soc_dai_link da830_evm_dai = {
.name = "TLV320AIC3X",
.stream_name = "AIC3X",
.cpu_dai_name = "davinci-mcasp.1",
.codec_dai_name = "tlv320aic3x-hifi",
.codec_name = "tlv320aic3x-codec.1-0018",
.platform_name = "davinci-pcm-audio",
.init = evm_aic3x_init,
.ops = &evm_ops,
};
static struct snd_soc_dai_link da850_evm_dai = {
.name = "TLV320AIC3X",
.stream_name = "AIC3X",
.cpu_dai_name= "davinci-mcasp.0",
.codec_dai_name = "tlv320aic3x-hifi",
.codec_name = "tlv320aic3x-codec.1-0018",
.platform_name = "davinci-pcm-audio",
.init = evm_aic3x_init,
.ops = &evm_ops,
};
static struct snd_soc_dai_link am335x_evm_dai = {
.name = "TLV320AIC3X",
.stream_name = "AIC3X",
.cpu_dai_name = "davinci-mcasp.1",
.codec_dai_name = "tlv320aic3x-hifi",
.codec_name = "tlv320aic3x-codec.2-001b",
.platform_name = "davinci-pcm-audio",
.init = evm_aic3x_init,
.ops = &evm_ops,
};
static struct snd_soc_dai_link am335x_evm_sk_dai = {
.name = "TLV320AIC3X",
.stream_name = "AIC3X",
.cpu_dai_name = "davinci-mcasp.1",
.codec_dai_name = "tlv320aic3x-hifi",
.codec_name = "tlv320aic3x-codec.1-001b",
.platform_name = "davinci-pcm-audio",
.init = evm_aic3x_init,
.ops = &evm_ops,
};
static struct snd_soc_dai_link am335x_var_som_dai = {
.name = "TLV320AIC3X",
.stream_name = "AIC3X",
.cpu_dai_name = "davinci-mcasp.0",
.codec_dai_name = "tlv320aic3x-hifi",
.codec_name = "tlv320aic3x-codec.2-001b",
.platform_name = "davinci-pcm-audio",
.init = evm_aic3x_init,
.ops = &evm_ops,
};
/* davinci dm6446 evm audio machine driver */
static struct snd_soc_card dm6446_snd_soc_card_evm = {
.name = "DaVinci DM6446 EVM",
.dai_link = &dm6446_evm_dai,
.num_links = 1,
};
/* davinci dm355 evm audio machine driver */
static struct snd_soc_card dm355_snd_soc_card_evm = {
.name = "DaVinci DM355 EVM",
.dai_link = &dm355_evm_dai,
.num_links = 1,
};
/* davinci dm365 evm audio machine driver */
static struct snd_soc_card dm365_snd_soc_card_evm = {
.name = "DaVinci DM365 EVM",
.dai_link = &dm365_evm_dai,
.num_links = 1,
};
/* davinci dm6467 evm audio machine driver */
static struct snd_soc_card dm6467_snd_soc_card_evm = {
.name = "DaVinci DM6467 EVM",
.dai_link = dm6467_evm_dai,
.num_links = ARRAY_SIZE(dm6467_evm_dai),
};
static struct snd_soc_card da830_snd_soc_card = {
.name = "DA830/OMAP-L137 EVM",
.dai_link = &da830_evm_dai,
.num_links = 1,
};
static struct snd_soc_card da850_snd_soc_card = {
.name = "DA850/OMAP-L138 EVM",
.dai_link = &da850_evm_dai,
.num_links = 1,
};
static struct snd_soc_card am335x_snd_soc_card = {
.name = "AM335X EVM",
.dai_link = &am335x_evm_dai,
.num_links = 1,
};
static struct snd_soc_card am335x_evm_sk_snd_soc_card = {
.name = "AM335X EVM",
.dai_link = &am335x_evm_sk_dai,
.num_links = 1,
};
static struct platform_device *evm_snd_device;
static int __init evm_init(void)
{
struct snd_soc_card *evm_snd_dev_data;
int index;
int ret;
if (machine_is_davinci_evm()) {
evm_snd_dev_data = &dm6446_snd_soc_card_evm;
index = 0;
} else if (machine_is_davinci_dm355_evm()) {
evm_snd_dev_data = &dm355_snd_soc_card_evm;
index = 1;
} else if (machine_is_davinci_dm365_evm()) {
evm_snd_dev_data = &dm365_snd_soc_card_evm;
index = 0;
} else if (machine_is_davinci_dm6467_evm()) {
evm_snd_dev_data = &dm6467_snd_soc_card_evm;
index = 0;
} else if (machine_is_davinci_da830_evm()) {
evm_snd_dev_data = &da830_snd_soc_card;
index = 1;
} else if (machine_is_davinci_da850_evm()) {
evm_snd_dev_data = &da850_snd_soc_card;
index = 0;
} else if (machine_is_am335xevm()) {
evm_snd_dev_data = &am335x_snd_soc_card;
#ifdef CONFIG_MACH_AM335XEVM
if (am335x_evm_get_id() == EVM_SK)
evm_snd_dev_data = &am335x_evm_sk_snd_soc_card;
#endif
index = 0;
} else if (machine_is_var_som_am33()) {
am335x_snd_soc_card.dai_link = &am335x_var_som_dai;
evm_snd_dev_data = &am335x_snd_soc_card;
index = 0;
} else
return -EINVAL;
evm_snd_device = platform_device_alloc("soc-audio", index);
if (!evm_snd_device)
return -ENOMEM;
platform_set_drvdata(evm_snd_device, evm_snd_dev_data);
ret = platform_device_add(evm_snd_device);
if (ret)
platform_device_put(evm_snd_device);
return ret;
}
static void __exit evm_exit(void)
{
platform_device_unregister(evm_snd_device);
}
module_init(evm_init);
module_exit(evm_exit);
MODULE_AUTHOR("Vladimir Barinov");
MODULE_DESCRIPTION("TI DAVINCI EVM ASoC driver");
MODULE_LICENSE("GPL");
| SystemTera/SystemTera.Server-V-3.2-Kernel | sound/soc/davinci/davinci-evm.c | C | gpl-2.0 | 10,908 | [
30522,
1013,
1008,
1008,
2004,
10085,
4062,
2005,
14841,
4830,
6371,
6895,
23408,
2213,
4132,
1008,
1008,
3166,
1024,
8748,
22466,
16693,
1010,
1026,
30524,
2618,
2009,
1998,
1013,
2030,
19933,
1008,
2009,
2104,
1996,
3408,
1997,
1996,
2700... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# AUTOGENERATED FILE
FROM balenalib/up-board-ubuntu:impish-run
ENV NODE_VERSION 14.18.3
ENV YARN_VERSION 1.22.4
RUN buildDeps='curl libatomic1' \
&& set -x \
&& for key in \
6A010C5166006599AA17F08146C2130DFD2497F5 \
; do \
gpg --keyserver pgp.mit.edu --recv-keys "$key" || \
gpg --keyserver keyserver.pgp.com --recv-keys "$key" || \
gpg --keyserver keyserver.ubuntu.com --recv-keys "$key" ; \
done \
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends \
&& rm -rf /var/lib/apt/lists/* \
&& curl -SLO "http://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.gz" \
&& echo "bd96f88e054801d1368787f7eaf77b49cd052b9543c56bd6bc0bfc90310e2756 node-v$NODE_VERSION-linux-x64.tar.gz" | sha256sum -c - \
&& tar -xzf "node-v$NODE_VERSION-linux-x64.tar.gz" -C /usr/local --strip-components=1 \
&& rm "node-v$NODE_VERSION-linux-x64.tar.gz" \
&& curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" \
&& curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz.asc" \
&& gpg --batch --verify yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \
&& mkdir -p /opt/yarn \
&& tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/yarn --strip-components=1 \
&& ln -s /opt/yarn/bin/yarn /usr/local/bin/yarn \
&& ln -s /opt/yarn/bin/yarn /usr/local/bin/yarnpkg \
&& rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \
&& npm config set unsafe-perm true -g --unsafe-perm \
&& rm -rf /tmp/*
CMD ["echo","'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs"]
RUN curl -SLO "https://raw.githubusercontent.com/balena-io-library/base-images/8accad6af708fca7271c5c65f18a86782e19f877/scripts/assets/tests/test-stack@node.sh" \
&& echo "Running test-stack@node" \
&& chmod +x test-stack@node.sh \
&& bash test-stack@node.sh \
&& rm -rf test-stack@node.sh
RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo 'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: Intel 64-bit (x86-64) \nOS: Ubuntu impish \nVariant: run variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \nNode.js v14.18.3, Yarn v1.22.4 \nExtra features: \n- Easy way to install packages with `install_packages <package-name>` command \n- Run anywhere with cross-build feature (for ARM only) \n- Keep the container idling with `balena-idle` command \n- Show base image details with `balena-info` command' > /.balena/messages/image-info
RUN echo '#!/bin/sh.real\nbalena-info\nrm -f /bin/sh\ncp /bin/sh.real /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \
&& chmod +x /bin/sh-shim \
&& cp /bin/sh /bin/sh.real \
&& mv /bin/sh-shim /bin/sh | resin-io-library/base-images | balena-base-images/node/up-board/ubuntu/impish/14.18.3/run/Dockerfile | Dockerfile | apache-2.0 | 2,913 | [
30522,
1001,
8285,
6914,
16848,
5371,
2013,
28352,
8189,
29521,
1013,
2039,
1011,
2604,
1011,
1057,
8569,
3372,
2226,
1024,
17727,
4509,
1011,
2448,
4372,
2615,
13045,
1035,
2544,
2403,
1012,
2324,
1012,
1017,
4372,
2615,
27158,
1035,
2544,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package org.codehaus.xfire.wsdl11;
import org.codehaus.xfire.service.Service;
import org.codehaus.xfire.transport.Transport;
/**
* Indicates that a particular transport supports WSDL 1.1 generation.
*
* @author <a href="mailto:dan@envoisolutions.com">Dan Diephouse</a>
*/
public interface WSDL11Transport extends Transport
{
public String getName();
public String getServiceURL(Service service);
}
| eduardodaluz/xfire | xfire-core/src/main/org/codehaus/xfire/wsdl11/WSDL11Transport.java | Java | mit | 415 | [
30522,
7427,
8917,
1012,
3642,
13821,
1012,
1060,
10273,
1012,
1059,
16150,
2140,
14526,
1025,
12324,
8917,
1012,
3642,
13821,
1012,
1060,
10273,
1012,
2326,
1012,
2326,
1025,
12324,
8917,
1012,
3642,
13821,
1012,
1060,
10273,
1012,
3665,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# Copyright 2019, Google LLC.
#
# 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.
"""Libraries of Keras metrics."""
import tensorflow as tf
def _apply_mask(y_true, sample_weight, masked_tokens, dtype):
if sample_weight is None:
sample_weight = tf.ones_like(y_true, dtype)
else:
sample_weight = tf.cast(sample_weight, dtype)
for token in masked_tokens:
mask = tf.cast(tf.not_equal(y_true, token), dtype)
sample_weight = sample_weight * mask
return sample_weight
class NumTokensCounter(tf.keras.metrics.Sum):
"""A `tf.keras.metrics.Metric` that counts tokens seen after masking."""
def __init__(self, masked_tokens=None, name='num_tokens', dtype=tf.int64):
self._masked_tokens = masked_tokens or []
super().__init__(name, dtype)
def update_state(self, y_true, y_pred, sample_weight=None):
sample_weight = _apply_mask(y_true, sample_weight, self._masked_tokens,
self._dtype)
sample_weight = tf.reshape(sample_weight, [-1])
super().update_state(sample_weight)
def get_config(self):
config = super().get_config()
config['masked_tokens'] = tuple(self._masked_tokens)
return config
class MaskedCategoricalAccuracy(tf.keras.metrics.SparseCategoricalAccuracy):
"""An accuracy metric that masks some tokens."""
def __init__(self, masked_tokens=None, name='accuracy', dtype=None):
self._masked_tokens = masked_tokens or []
super().__init__(name, dtype=dtype)
def update_state(self, y_true, y_pred, sample_weight=None):
sample_weight = _apply_mask(y_true, sample_weight, self._masked_tokens,
self._dtype)
num_classes = tf.shape(y_pred)[-1]
y_true = tf.reshape(y_true, [-1])
y_pred = tf.reshape(y_pred, [-1, num_classes])
sample_weight = tf.reshape(sample_weight, [-1])
super().update_state(y_true, y_pred, sample_weight)
def get_config(self):
config = super().get_config()
config['masked_tokens'] = tuple(self._masked_tokens)
return config
| google-research/federated | utils/keras_metrics.py | Python | apache-2.0 | 2,516 | [
30522,
1001,
9385,
10476,
1010,
8224,
11775,
1012,
1001,
1001,
7000,
2104,
1996,
15895,
6105,
1010,
2544,
1016,
1012,
1014,
1006,
1996,
1000,
6105,
1000,
1007,
1025,
1001,
2017,
2089,
2025,
2224,
2023,
5371,
3272,
1999,
12646,
2007,
1996,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
/*
* This file is part of NotificationPusher.
*
* (c) 2013 Cédric Dugat <cedric@dugat.me>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sly\NotificationPusher\Adapter;
use Sly\NotificationPusher\Model\BaseOptionedModel;
use Sly\NotificationPusher\Model\PushInterface;
use Sly\NotificationPusher\Model\DeviceInterface;
use Sly\NotificationPusher\Exception\AdapterException;
use Sly\NotificationPusher\Exception\PushException;
use Sly\NotificationPusher\Collection\DeviceCollection;
use ZendService\Apple\Apns\Client\AbstractClient as ServiceAbstractClient;
use ZendService\Apple\Apns\Client\Message as ServiceClient;
use ZendService\Apple\Apns\Message as ServiceMessage;
use ZendService\Apple\Apns\Message\Alert as ServiceAlert;
use ZendService\Apple\Apns\Response\Message as ServiceResponse;
use ZendService\Apple\Apns\Exception\RuntimeException as ServiceRuntimeException;
use ZendService\Apple\Apns\Client\Feedback as ServiceFeedbackClient;
/**
* APNS adapter.
*
* @uses \Sly\NotificationPusher\Adapter\BaseAdapter
*
* @author Cédric Dugat <cedric@dugat.me>
*/
class Apns extends BaseAdapter
{
/** @var ServiceClient */
private $openedClient;
/** @var ServiceFeedbackClient */
private $feedbackClient;
/**
* {@inheritdoc}
*
* @throws \Sly\NotificationPusher\Exception\AdapterException
*/
public function __construct(array $parameters = array())
{
parent::__construct($parameters);
$cert = $this->getParameter('certificate');
if (false === file_exists($cert)) {
throw new AdapterException(sprintf('Certificate %s does not exist', $cert));
}
}
/**
* {@inheritdoc}
*
* @throws \Sly\NotificationPusher\Exception\PushException
*/
public function push(PushInterface $push)
{
$client = $this->getOpenedServiceClient();
$pushedDevices = new DeviceCollection();
foreach ($push->getDevices() as $device) {
$message = $this->getServiceMessageFromOrigin($device, $push->getMessage());
try {
$this->response[$device->getToken()] = $client->send($message);
} catch (ServiceRuntimeException $e) {
throw new PushException($e->getMessage());
}
if (ServiceResponse::RESULT_OK === $this->response[$device->getToken()]->getCode()) {
$pushedDevices->add($device);
}
}
return $pushedDevices;
}
/**
* Feedback.
*
* @return array
*/
public function getFeedback()
{
$client = $this->getOpenedFeedbackClient();
$responses = array();
$serviceResponses = $client->feedback();
foreach ($serviceResponses as $response) {
$responses[$response->getToken()] = new \DateTime(date("c", $response->getTime()));
}
return $responses;
}
/**
* Get opened client.
*
* @param \ZendService\Apple\Apns\Client\AbstractClient $client Client
*
* @return \ZendService\Apple\Apns\Client\AbstractClient
*/
public function getOpenedClient(ServiceAbstractClient $client)
{
$client->open(
$this->isProductionEnvironment() ? ServiceClient::PRODUCTION_URI : ServiceClient::SANDBOX_URI,
$this->getParameter('certificate'),
$this->getParameter('passPhrase')
);
return $client;
}
/**
* Get opened ServiceClient
*
* @return ServiceAbstractClient
*/
private function getOpenedServiceClient()
{
if (!isset($this->openedClient)) {
$this->openedClient = $this->getOpenedClient(new ServiceClient());
}
return $this->openedClient;
}
/**
* Get opened ServiceFeedbackClient
*
* @return ServiceAbstractClient
*/
private function getOpenedFeedbackClient()
{
if (!isset($this->feedbackClient)) {
$this->feedbackClient = $this->getOpenedClient(new ServiceFeedbackClient());
}
return $this->feedbackClient;
}
/**
* Get service message from origin.
*
* @param \Sly\NotificationPusher\Model\DeviceInterface $device Device
* @param BaseOptionedModel|\Sly\NotificationPusher\Model\MessageInterface $message Message
*
* @return \ZendService\Apple\Apns\Message
*/
public function getServiceMessageFromOrigin(DeviceInterface $device, BaseOptionedModel $message)
{
$badge = ($message->hasOption('badge'))
? (int) ($message->getOption('badge') + $device->getParameter('badge', 0))
: 0
;
$sound = $message->getOption('sound', 'bingbong.aiff');
$contentAvailable = $message->getOption('content-available');
$category = $message->getOption('category');
$alert = new ServiceAlert(
$message->getText(),
$message->getOption('actionLocKey'),
$message->getOption('locKey'),
$message->getOption('locArgs'),
$message->getOption('launchImage'),
$message->getOption('title'),
$message->getOption('titleLocKey'),
$message->getOption('titleLocArgs')
);
if ($actionLocKey = $message->getOption('actionLocKey')) {
$alert->setActionLocKey($actionLocKey);
}
if ($locKey = $message->getOption('locKey')) {
$alert->setLocKey($locKey);
}
if ($locArgs = $message->getOption('locArgs')) {
$alert->setLocArgs($locArgs);
}
if ($launchImage = $message->getOption('launchImage')) {
$alert->setLaunchImage($launchImage);
}
if ($title = $message->getOption('title')) {
$alert->setTitle($title);
}
if ($titleLocKey = $message->getOption('titleLocKey')) {
$alert->setTitleLocKey($titleLocKey);
}
if ($titleLocArgs = $message->getOption('titleLocArgs')) {
$alert->setTitleLocArgs($titleLocArgs);
}
$serviceMessage = new ServiceMessage();
$serviceMessage->setId(sha1($device->getToken().$message->getText()));
$serviceMessage->setAlert($alert);
$serviceMessage->setToken($device->getToken());
if (0 !== $badge) {
$serviceMessage->setBadge($badge);
}
$serviceMessage->setCustom($message->getOption('custom', array()));
if (null !== $sound) {
$serviceMessage->setSound($sound);
}
if (null !== $contentAvailable) {
$serviceMessage->setContentAvailable($contentAvailable);
}
if (null !== $category) {
$serviceMessage->setCategory($category);
}
return $serviceMessage;
}
/**
* {@inheritdoc}
*/
public function supports($token)
{
return (ctype_xdigit($token) && 64 == strlen($token));
}
/**
* {@inheritdoc}
*/
public function getDefinedParameters()
{
return array();
}
/**
* {@inheritdoc}
*/
public function getDefaultParameters()
{
return array('passPhrase' => null);
}
/**
* {@inheritdoc}
*/
public function getRequiredParameters()
{
return array('certificate');
}
}
| monove/NotificationPusher | src/Sly/NotificationPusher/Adapter/Apns.php | PHP | mit | 7,477 | [
30522,
1026,
1029,
25718,
1013,
1008,
1008,
2023,
5371,
2003,
2112,
1997,
26828,
12207,
5886,
1012,
1008,
1008,
1006,
1039,
1007,
2286,
26170,
8655,
4017,
1026,
26170,
1030,
8655,
4017,
1012,
2033,
1028,
1008,
1008,
2005,
1996,
2440,
9385,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# $Id$
#
# Author:: Francis Cianfrocca (gmail: blackhedd)
# Homepage:: http://rubyeventmachine.com
# Date:: 8 April 2006
#
# See EventMachine and EventMachine::Connection for documentation and
# usage examples.
#
#----------------------------------------------------------------------------
#
# Copyright (C) 2006-07 by Francis Cianfrocca. All Rights Reserved.
# Gmail: blackhedd
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of either: 1) the GNU General Public License
# as published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version; or 2) Ruby's License.
#
# See the file COPYING for complete licensing information.
#
#---------------------------------------------------------------------------
#
#
#
$:.unshift "../lib"
require 'eventmachine'
require 'socket'
require 'test/unit'
class TestServers < Test::Unit::TestCase
Host = "127.0.0.1"
Port = 9555
module NetstatHelper
GlobalUdp4Rexp = /udp.*\s+(?:\*|(?:0\.){3}0)[:.](\d+)\s/i
GlobalTcp4Rexp = /tcp.*\s+(?:\*|(?:0\.){3}0)[:.](\d+)\s/i
LocalUdpRexp = /udp.*\s+(?:127\.0\.0\.1|::1)[:.](\d+)\s/i
LocalTcpRexp = /tcp.*\s+(?:127\.0\.0\.1|::1)[:.](\d+)\s/i
def grep_netstat(pattern)
`netstat -an`.scan(/^.*$/).grep(pattern)
end
end
include NetstatHelper
class TestStopServer < EM::Connection
def initialize *args
super
end
def post_init
# TODO,sucks that this isn't OOPy enough.
EM.stop_server @server_instance
end
end
def run_test_stop_server
EM.run {
sig = EM.start_server(Host, Port)
assert(grep_netstat(LocalTcpRexp).grep(%r(#{Port})).size >= 1, "Server didn't start")
EM.stop_server sig
# Give the server some time to shutdown.
EM.add_timer(0.1) {
assert(grep_netstat(LocalTcpRexp).grep(%r(#{Port})).empty?, "Servers didn't stop")
EM.stop
}
}
end
def test_stop_server
assert(grep_netstat(LocalTcpRexp).grep(Port).empty?, "Port already in use")
5.times {run_test_stop_server}
assert(grep_netstat(LocalTcpRexp).grep(%r(#{Port})).empty?, "Servers didn't stop")
end
end
| mattgraham/play-graham | vendor/gems/ruby/1.8/gems/eventmachine-0.12.10/tests/test_servers.rb | Ruby | mit | 2,198 | [
30522,
1001,
1002,
8909,
1002,
1001,
1001,
3166,
1024,
1024,
4557,
9915,
2078,
19699,
10085,
3540,
1006,
20917,
4014,
1024,
2304,
9072,
2094,
1007,
1001,
2188,
13704,
1024,
1024,
8299,
1024,
1013,
1013,
10090,
18697,
3372,
22911,
14014,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
// vim: set tabstop=4 shiftwidth=4 noexpandtab:
/*
A KIPI plugin to generate HTML image galleries
Copyright 2006 by Aurelien Gateau <aurelien dot gateau at free.fr>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA.
*/
#ifndef WIZARD_H
#define WIZARD_H
// KDE
#include <kassistantdialog.h>
namespace KIPI {
class Interface;
}
namespace KIPIHTMLExport {
class GalleryInfo;
/**
* The wizard used by the user to select the various settings.
*/
class Wizard : public KAssistantDialog {
Q_OBJECT
public:
Wizard(QWidget* parent, GalleryInfo* info, KIPI::Interface*);
~Wizard();
protected Q_SLOTS:
virtual void accept();
private Q_SLOTS:
void updateCollectionSelectorPageValidity();
void updateFinishPageValidity();
void slotThemeSelectionChanged();
void slotHelp();
private:
struct Private;
Private* d;
};
} // namespace
#endif /* WIZARD_H */
| rosedu/digikam-2012-kipi-plugins | htmlexport/wizard.h | C | gpl-2.0 | 1,497 | [
30522,
1013,
1013,
6819,
2213,
1024,
2275,
21628,
16033,
2361,
1027,
1018,
5670,
9148,
11927,
2232,
1027,
1018,
2053,
10288,
9739,
11927,
7875,
1024,
1013,
1008,
1037,
11382,
8197,
13354,
2378,
2000,
9699,
16129,
3746,
11726,
9385,
2294,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package org.buildmlearn.toolkit.flashcardtemplate.data;
import org.w3c.dom.Document;
import org.xml.sax.SAXException;
import java.io.File;
import java.io.IOException;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
/**
* Created by Anupam (opticod) on 10/8/16.
*/
/**
* @brief Contains xml data utils for flash card template's simulator.
*/
public class DataUtils {
public static String[] readTitleAuthor() {
String result[] = new String[2];
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setValidating(false);
DocumentBuilder db;
Document doc;
try {
File fXmlFile = new File(org.buildmlearn.toolkit.flashcardtemplate.Constants.XMLFileName);
db = dbf.newDocumentBuilder();
doc = db.parse(fXmlFile);
doc.normalize();
result[0] = doc.getElementsByTagName("title").item(0).getChildNodes()
.item(0).getNodeValue();
result[1] = doc.getElementsByTagName("name").item(0).getChildNodes()
.item(0).getNodeValue();
} catch (ParserConfigurationException | SAXException | IOException e) {
e.printStackTrace();
}
return result;
}
}
| opticod/BuildmLearn-Toolkit-Android | source-code/app/src/main/java/org/buildmlearn/toolkit/flashcardtemplate/data/DataUtils.java | Java | bsd-3-clause | 1,360 | [
30522,
7427,
8917,
1012,
3857,
19968,
14644,
2078,
1012,
6994,
23615,
1012,
5956,
11522,
18532,
15725,
1012,
2951,
1025,
12324,
8917,
1012,
1059,
2509,
2278,
1012,
14383,
1012,
6254,
1025,
12324,
8917,
1012,
20950,
1012,
19656,
1012,
24937,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
#Date of creation : 9 Jan 2016.
#Aim of program : To print power set of a set of characters.
#Coded by : Rishikesh Agrawani.
*/
package main
import "fmt"
func main() {
var n, r, i, j uint
fmt.Print("Enter the number of binary variables(for which you want the binary combinations): ")
fmt.Scanf("%d", &n)
fmt.Print("\nEnter ", n, " binary variables name( name should be only 1 character long) separated by space: ")
a := make([]string, n)
r = 1
for i = 0; i < n; i++ {
fmt.Scanf("%s", &a[i])
r *= 2
}
fmt.Println("\nColumns => ", n, "\nRows => ", r)
for i = 0; i < r; i++ {
for j = 0; j < n; j++ {
if (i>>j)&1 == 1 {
fmt.Print(a[j], " ")
} else {
fmt.Print("- ")
}
}
fmt.Println()
}
}
/*1st RUN:
Enter the number of binary variables(for which you want the binary combinations): 4
Enter 4 binary variables name( name should be only 1 character long) separated by space: a b c d
Columns => 4
Rows => 16
- - - -
a - - -
- b - -
a b - -
- - c -
a - c -
- b c -
a b c -
- - - d
a - - d
- b - d
a b - d
- - c d
a - c d
- b c d
a b c d
*/
/*2nd RUN:
Enter the number of binary variables(for which you want the binary combinations):
Enter 5 binary variables name( name should be only 1 character long) separated by space:
Columns => 5
Rows => 32
- - - - -
p - - - -
- q - - -
p q - - -
- - r - -
p - r - -
- q r - -
p q r - -
- - - s -
p - - s -
- q - s -
p q - s -
- - r s -
p - r s -
- q r s -
p q r s -
- - - - t
p - - - t
- q - - t
p q - - t
- - r - t
p - r - t
- q r - t
p q r - t
- - - s t
p - - s t
- q - s t
p q - s t
- - r s t
p - r s t
- q r s t
p q r s t
*/
| hygull/go | sources/hck-ds-examples/power_set_for_set_of_characters.go | GO | gpl-2.0 | 1,645 | [
30522,
1013,
1008,
1001,
3058,
1997,
4325,
1024,
1023,
5553,
2355,
1012,
1001,
6614,
1997,
2565,
1024,
2000,
6140,
2373,
2275,
1997,
1037,
2275,
1997,
3494,
1012,
1001,
22402,
2011,
1024,
15544,
6182,
9681,
2232,
29542,
29092,
1012,
1008,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
import pilas
import json
from pilas.escena import Base
from general import General
from individual import Individual
class jugadores(Base):
def __init__(self):
Base.__init__(self)
def fondo(self):
pilas.fondos.Fondo("data/img/fondos/aplicacion.jpg")
def general(self):
self.sonido_boton.reproducir()
pilas.almacenar_escena(General())
def individual(self):
self.sonido_boton.reproducir()
pilas.almacenar_escena(Individual())
def volver(self):
self.sonido_boton.reproducir()
pilas.recuperar_escena()
def iniciar(self):
self.fondo()
self.sonido_boton = pilas.sonidos.cargar("data/audio/boton.ogg")
self.interfaz()
self.mostrar()
def interfaz(self):
opcion= [("General",self.general),("Individual",self.individual),("Volver",self.volver)]
menu = pilas.actores.Menu(opcion, y=50, fuente="data/fonts/American Captain.ttf")
menu.escala = 1.3
enunciado = pilas.actores.Actor("data/img/enunciados/estadisticas.png",y=250)
enunciado.escala = 0.3 | gercordero/va_de_vuelta | src/estadisticas.py | Python | gpl-3.0 | 1,023 | [
30522,
12324,
14255,
8523,
12324,
1046,
3385,
2013,
14255,
8523,
1012,
9686,
27524,
2050,
12324,
2918,
2013,
2236,
12324,
2236,
2013,
3265,
12324,
3265,
2465,
26536,
26467,
2229,
1006,
2918,
1007,
1024,
13366,
1035,
1035,
1999,
4183,
30524,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
#ifndef STORM_LOGIC_LONGRUNAVERAGEOPERATORFORMULA_H_
#define STORM_LOGIC_LONGRUNAVERAGEOPERATORFORMULA_H_
#include "storm/logic/OperatorFormula.h"
namespace storm {
namespace logic {
class LongRunAverageOperatorFormula : public OperatorFormula {
public:
LongRunAverageOperatorFormula(std::shared_ptr<Formula const> const& subformula, OperatorInformation const& operatorInformation = OperatorInformation());
virtual ~LongRunAverageOperatorFormula() {
// Intentionally left empty.
}
virtual bool isLongRunAverageOperatorFormula() const override;
virtual boost::any accept(FormulaVisitor const& visitor, boost::any const& data) const override;
virtual std::ostream& writeToStream(std::ostream& out) const override;
};
}
}
#endif /* STORM_LOGIC_LONGRUNAVERAGEOPERATORFORMULA_H_ */
| MazZzinatus/storm | src/storm/logic/LongRunAverageOperatorFormula.h | C | gpl-3.0 | 952 | [
30522,
1001,
2065,
13629,
2546,
4040,
1035,
7961,
1035,
2146,
26605,
26061,
3351,
25918,
8844,
14192,
7068,
1035,
1044,
1035,
1001,
9375,
4040,
1035,
7961,
1035,
2146,
26605,
26061,
3351,
25918,
8844,
14192,
7068,
1035,
1044,
1035,
1001,
24... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
const app = require('../server');
const readline = require('readline');
const {
User,
Role,
RoleMapping,
} = app.models;
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
Role.findOne({ where: { name: 'admin' } })
.then((role) => {
if (!role) {
console.log('No admin role found. Create fixtures first.');
process.exit();
}
const admin = {};
const fields = ['username', 'password'];
let field = fields.shift();
console.log(`${field}: `);
rl.on('line', (line) => {
admin[field] = line;
field = fields.shift();
if (!field) {
process.stdout.write('Creating the user... ');
User.create(admin)
.then(user =>
RoleMapping.create({
UserId: user.id,
RoleId: role.id,
})
)
.then(() => {
console.log('Done!\n');
process.exit(0);
})
.catch((err) => {
console.error(err);
process.exit(1);
});
return;
}
process.stdout.write(`${field}: \n`);
});
});
| oamaok/kinko | server/scripts/create-admin.js | JavaScript | mit | 1,056 | [
30522,
9530,
3367,
10439,
1027,
5478,
1006,
1005,
1012,
1012,
1013,
8241,
1005,
1007,
1025,
9530,
3367,
3191,
4179,
1027,
5478,
1006,
1005,
3191,
4179,
1005,
1007,
1025,
9530,
3367,
1063,
5310,
1010,
2535,
1010,
2535,
2863,
14853,
1010,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package se.sics.gvod.common.msgs;
import io.netty.buffer.ByteBuf;
import se.sics.gvod.net.BaseMsgFrameDecoder;
import se.sics.gvod.net.VodAddress;
import se.sics.gvod.net.msgs.RewriteableMsg;
import se.sics.gvod.net.msgs.RewriteableRetryTimeout;
import se.sics.gvod.net.msgs.ScheduleRetryTimeout;
import se.sics.gvod.net.util.UserTypesEncoderFactory;
import se.sics.gvod.timer.TimeoutId;
/**
*
* @author jdowling
*/
public class DisconnectMsg {
public static class Request extends DirectMsgNetty.Request {
public Request(VodAddress source, VodAddress destination) {
super(source, destination);
}
@Override
public byte getOpcode() {
return BaseMsgFrameDecoder.DISCONNECT_REQUEST;
}
@Override
public int getSize() {
return super.getHeaderSize()
;
}
@Override
public ByteBuf toByteArray() throws MessageEncodingException {
ByteBuf buf = createChannelBufferWithHeader();
return buf;
}
@Override
public RewriteableMsg copy() {
Request r = new Request(vodSrc, vodDest);
r.setTimeoutId(timeoutId);
return r;
}
}
public static class Response extends DirectMsgNetty.Response {
private final int ref;
public Response(VodAddress source, VodAddress destination, TimeoutId timeoutId, int ref) {
super(source, destination, timeoutId);
this.ref = ref;
}
public int getRef() {
return ref;
}
@Override
public byte getOpcode() {
return BaseMsgFrameDecoder.DISCONNECT_RESPONSE;
}
@Override
public int getSize() {
return super.getHeaderSize()
+ 2 /* refs */;
}
@Override
public ByteBuf toByteArray() throws MessageEncodingException {
ByteBuf buffer = createChannelBufferWithHeader();
UserTypesEncoderFactory.writeUnsignedintAsTwoBytes(buffer, ref);
return buffer;
}
@Override
public RewriteableMsg copy() {
return new Response(vodSrc, vodDest, timeoutId, ref);
}
}
public static class RequestTimeout extends RewriteableRetryTimeout {
private final VodAddress peer;
public RequestTimeout(ScheduleRetryTimeout request, Request requestMsg) {
super(request, requestMsg, requestMsg.getVodSource().getOverlayId());
this.peer = requestMsg.getVodDestination();
}
public VodAddress getPeer() {
return peer;
}
}
}
| Decentrify/NatTraversal_Old | network/netty/src/main/java/se/sics/gvod/common/msgs/DisconnectMsg.java | Java | lgpl-3.0 | 2,791 | [
30522,
1013,
1008,
1008,
2000,
2689,
2023,
23561,
1010,
5454,
5906,
1064,
23561,
2015,
1008,
1998,
2330,
1996,
23561,
1999,
1996,
3559,
1012,
1008,
1013,
7427,
7367,
1012,
14387,
2015,
1012,
1043,
6767,
2094,
1012,
2691,
1012,
5796,
5620,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<link rel="import" href="catalog-analytics.html">
<link rel="import" href="custom-element-demo.html">
<link rel="import" href="contributors-list.html">
<link rel="import" href="activity-graph.html">
<link rel="import" href="catalog-dialog.html">
<link rel="import" href="re-captcha.html">
<link rel="import" href="spinner-lite.html">
<link rel="import" href="browser-table.html">
<link rel="import" href="../bower_components/paper-toast/paper-toast.html"> | andymutton/v2 | client/src/lazy-resources.html | HTML | apache-2.0 | 455 | [
30522,
1026,
4957,
2128,
2140,
1027,
1000,
12324,
1000,
17850,
12879,
1027,
1000,
12105,
1011,
25095,
1012,
16129,
1000,
1028,
1026,
4957,
2128,
2140,
1027,
1000,
12324,
1000,
17850,
12879,
1027,
1000,
7661,
1011,
5783,
1011,
9703,
1012,
16... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MinimalDatabase
{
public class DatabaseException : Exception
{
public DatabaseException(string message)
: base(message) { }
public DatabaseException(string message, Exception innerException)
: base(message, innerException) { }
}
}
| jnagykuhlen/MinimalDatabase | MinimalDatabase/DatabaseException.cs | C# | mit | 414 | [
30522,
2478,
2291,
1025,
2478,
2291,
1012,
6407,
1012,
12391,
1025,
2478,
2291,
1012,
11409,
4160,
1025,
2478,
30524,
3415,
15327,
10124,
2850,
2696,
15058,
1063,
2270,
2465,
7809,
10288,
24422,
1024,
6453,
1063,
2270,
7809,
10288,
24422,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# Bromus diandrus var. diandrus VARIETY
#### Status
ACCEPTED
#### According to
GRIN Taxonomy for Plants
#### Published in
null
#### Original name
null
### Remarks
null | mdoering/backbone | life/Plantae/Magnoliophyta/Liliopsida/Poales/Poaceae/Bromus/Bromus diandrus/Bromus diandrus diandrus/README.md | Markdown | apache-2.0 | 172 | [
30522,
1001,
22953,
7606,
22939,
4859,
7946,
13075,
1012,
22939,
4859,
7946,
3528,
1001,
1001,
1001,
1001,
3570,
3970,
1001,
1001,
1001,
1001,
2429,
2000,
5861,
25274,
2005,
4264,
1001,
1001,
1001,
1001,
2405,
1999,
19701,
1001,
1001,
1001,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<a href='https://github.com/angular/angular.js/edit/v1.2.x/src/Angular.js?message=docs(angular.bootstrap)%3A%20describe%20your%20change...#L1295' class='improve-docs btn btn-primary'><i class="glyphicon glyphicon-edit"> </i>Improve this Doc</a>
<a href='https://github.com/angular/angular.js/tree/v1.2.32/src/Angular.js#L1295' class='view-source pull-right btn btn-primary'>
<i class="glyphicon glyphicon-zoom-in"> </i>View Source
</a>
<header class="api-profile-header">
<h1 class="api-profile-header-heading">angular.bootstrap</h1>
<ol class="api-profile-header-structure naked-list step-list">
<li>
- function in module <a href="api/ng">ng</a>
</li>
</ol>
</header>
<div class="api-profile-description">
<p>Use this function to manually start up angular application.</p>
<p>See: <a href="guide/bootstrap">Bootstrap</a></p>
<p>Note that ngScenario-based end-to-end tests cannot use this function to bootstrap manually.
They must use <a href="api/ng/directive/ngApp">ngApp</a>.</p>
<p>Angular will detect if it has been loaded into the browser more than once and only allow the
first loaded script to be bootstrapped and will report a warning to the browser console for
each of the subsequent scripts. This prevents strange results in applications, where otherwise
multiple instances of Angular try to work on the DOM.</p>
<p>
<div>
<a ng-click="openPlunkr('examples/example-multi-bootstrap')" class="btn pull-right">
<i class="glyphicon glyphicon-edit"> </i>
Edit in Plunker</a>
<div class="runnable-example"
path="examples/example-multi-bootstrap"
name="multi-bootstrap"
module="multi-bootstrap">
<div class="runnable-example-file"
name="index.html"
language="html"
type="html">
<pre><code><script src="../../../angular.js"></script> <div ng-controller="BrokenTable"> <table> <tr> <th ng-repeat="heading in headings">{{heading}}</th> </tr> <tr ng-repeat="filling in fillings"> <td ng-repeat="fill in filling">{{fill}}</td> </tr> </table> </div></code></pre>
</div>
<div class="runnable-example-file"
name="controller.js"
language="js"
type="js">
<pre><code>var app = angular.module('multi-bootstrap', []) .controller('BrokenTable', function($scope) { $scope.headings = ['One', 'Two', 'Three']; $scope.fillings = [[1, 2, 3], ['A', 'B', 'C'], [7, 8, 9]]; });</code></pre>
</div>
<div class="runnable-example-file"
name="protractor.js"
type="protractor"
language="js">
<pre><code>it('should only insert one table cell for each item in $scope.fillings', function() { expect(element.all(by.css('td')).count()) .toBe(9); });</code></pre>
</div>
<iframe class="runnable-example-frame" src="examples/example-multi-bootstrap/index.html" name="example-multi-bootstrap"></iframe>
</div>
</div>
</p>
</div>
<div>
<h2 id="usage">Usage</h2>
<p><code>angular.bootstrap(element, [modules]);</code></p>
<section class="api-section">
<h3>Arguments</h3>
<table class="variables-matrix input-arguments">
<thead>
<tr>
<th>Param</th>
<th>Type</th>
<th>Details</th>
</tr>
</thead>
<tbody>
<tr>
<td>
element
</td>
<td>
<a href="" class="label type-hint type-hint-domelement">DOMElement</a>
</td>
<td>
<p>DOM element which is the root of angular application.</p>
</td>
</tr>
<tr>
<td>
modules
<div><em>(optional)</em></div>
</td>
<td>
<a href="" class="label type-hint type-hint-array">Array<String|Function|Array>=</a>
</td>
<td>
<p>an array of modules to load into the application.
Each item in the array should be the name of a predefined module or a (DI annotated)
function that will be invoked by the injector as a run block.
See: <a href="api/ng/function/angular.module">modules</a></p>
</td>
</tr>
</tbody>
</table>
</section>
<h3>Returns</h3>
<table class="variables-matrix return-arguments">
<tr>
<td><a href="" class="label type-hint type-hint-auto">auto.$injector</a></td>
<td><p>Returns the newly created injector for this app.</p>
</td>
</tr>
</table>
</div>
| souths/njy2 | js/lib/angular-1.2.32/docs/partials/api/ng/function/angular.bootstrap.html | HTML | mit | 4,714 | [
30522,
1026,
1037,
17850,
12879,
1027,
1005,
16770,
1024,
1013,
1013,
21025,
2705,
12083,
1012,
4012,
1013,
16108,
1013,
16108,
1012,
1046,
2015,
1013,
10086,
1013,
1058,
2487,
1012,
1016,
1012,
1060,
1013,
5034,
2278,
1013,
16108,
1012,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
namespace _3.RefactorLoop
{
using System;
class RefactorLoop
{
static void Main()
{
int[] array = new int[100];
int expectedValue = 666; // It's not necessary to be 666 :)
for (int i = 0; i < array.Length; i++)
{
Console.WriteLine(array[i]);
if (i % 10 == 0)
{
if (array[i] == expectedValue)
{
Console.WriteLine("Value Found");
}
}
}
}
}
}
| 2She2/HighQualityProgrammingCode | 07.UsingControlStructuresStatementsAndLoops/3.RefactorLoop/RefactorLoop.cs | C# | mit | 594 | [
30522,
3415,
15327,
1035,
1017,
1012,
25416,
18908,
2953,
4135,
7361,
1063,
2478,
2291,
1025,
2465,
25416,
18908,
2953,
4135,
7361,
1063,
10763,
11675,
2364,
1006,
1007,
1063,
20014,
1031,
1033,
9140,
1027,
2047,
20014,
1031,
2531,
1033,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* @license Apache-2.0
*
* Copyright (c) 2021 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* tslint:disable:no-invalid-this */
import isSkewSymmetricMatrix = require( './index' );
// TESTS //
// The function returns a boolean...
{
const matrix = {
'data': [ 2, 1, 1, 2 ],
'ndims': 2,
'shape': [ 2, 2 ],
'strides': [ 2, 1 ],
'offset': 0,
'order': 'row-major',
'dtype': 'generic',
'length': 4,
'flags': {},
'get': function get( i: number, j: number ): number {
const idx = ( this.strides[ 0 ] * i ) + ( this.strides[ 1 ] * j );
return this.data[ idx ];
},
'set': function set( i: number, j: number, v: number ): number {
const idx = ( this.strides[ 0 ] * i ) + ( this.strides[ 1 ] * j );
this.data[ idx ] = v;
return v;
}
};
isSkewSymmetricMatrix( matrix ); // $ExpectType boolean
isSkewSymmetricMatrix( [] ); // $ExpectType boolean
isSkewSymmetricMatrix( false ); // $ExpectType boolean
}
// The compiler throws an error if the function is provided an unsupported number of arguments...
{
isSkewSymmetricMatrix(); // $ExpectError
}
| stdlib-js/stdlib | lib/node_modules/@stdlib/assert/is-skew-symmetric-matrix/docs/types/test.ts | TypeScript | apache-2.0 | 1,610 | [
30522,
1013,
1008,
1008,
1030,
6105,
15895,
1011,
1016,
1012,
1014,
1008,
1008,
9385,
1006,
1039,
1007,
25682,
1996,
2358,
19422,
12322,
6048,
1012,
1008,
1008,
7000,
2104,
1996,
15895,
6105,
1010,
2544,
1016,
1012,
1014,
1006,
1996,
1000,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
from __future__ import absolute_import
from collections import defaultdict as ddict
import os.path as op
def enum(**enums):
"""#enumeration
#backward compatible
:param enums:
"""
return type('Enum', (), enums)
IONISATION_MODE = enum(NEG=-1, POS=1)
class ExperimentalSettings(object):
"""
:param mz_tol_ppm:
:param ionisation_mode:
:param is_dims_experiment:
"""
ADDUCTS_POS = op.abspath("mzos/ressources/POS_ADDUCTS_IMS.csv")
ADDUCTS_NEG = op.abspath("mzos/ressources/NEG_ADDUCTS_IMS.csv")
FRAGMENTS = op.abspath("mzos/ressources/FRAGMENTS_IMS.csv")
def __init__(self, mz_tol_ppm, polarity, is_dims_exp,
frag_conf=None,
neg_adducts_conf=None,
pos_adducts_conf=None):
self.samples = set()
self.polarity = polarity # warning is an ENUM
self.mz_tol_ppm = mz_tol_ppm
self.is_dims_exp = is_dims_exp
# self.databases = databases
self.group_by_id = ddict(set)
self.group_by_sample = {}
# setting isos file, same for both polarity
# self.isos_file = ExperimentalSettings.ISOS
# setting good frags_file
self.frags_file = frag_conf or ExperimentalSettings.FRAGMENTS
self.adducts_file = neg_adducts_conf or ExperimentalSettings.ADDUCTS_NEG \
if polarity == IONISATION_MODE.NEG else pos_adducts_conf or ExperimentalSettings.ADDUCTS_POS
def get_frags(self):
"""
:return:
"""
lines = list()
with open(self.frags_file) as f:
lines += [l.split(",") for l in f.readlines()[1:]]
return [((float(l[3]), 1), l[0]) for l in lines]
def get_adducts(self):
"""
:return:
"""
lines = list()
with open(self.adducts_file) as f:
lines += [l.split(",") for l in f.readlines()[1:]]
return [((float(l[3]), 1), l[0]) for l in lines]
def get_mass_to_check(self):
"""
:return:
"""
if self.is_dims_exp:
return self.get_frags()
return self.get_adducts() + self.get_frags()
def create_group(self, id_, samples):
"""
:param id_:
:param samples:
:return:
"""
group = Group(id_, samples)
for s in list(samples):
self.group_by_sample[s] = group
self.group_by_id[id_] = group
self.samples.union(set(samples))
return group
def get_group(self, id_):
"""
:param id_:
:return:
"""
return self.group_by_id.get(id_)
def get_group_of(self, sample):
"""
:param sample:
:return: return group or None
"""
return self.group_by_sample.get(sample)
def get_group_id_of(self, sample):
"""
:param sample:
:return:
"""
group = self.get_group_of(sample)
if group is None:
return None
return group.name_id
class Group(list):
"""
:param name_id:
:param samples:
:param description:
"""
def __init__(self, name_id, samples, description=""):
super(Group, self).__init__()
self.samples = samples
self.description = description
self.name_id = name_id | jerkos/mzOS | mzos/exp_design.py | Python | mit | 3,317 | [
30522,
2013,
1035,
1035,
2925,
1035,
1035,
12324,
7619,
1035,
12324,
2013,
6407,
12324,
12398,
29201,
2004,
20315,
2594,
2102,
12324,
9808,
1012,
4130,
2004,
6728,
13366,
4372,
2819,
1006,
1008,
1008,
4372,
18163,
1007,
1024,
1000,
1000,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# C#笔记
标签: C#
打开程序:Program.cs中的main方法中创建Main对象, Main.cs文件内的 Main:Form 的默认构造函数被调用,
从而调用Main.Designer.cs中的Main类的 InitializeComponent()方法对组件进行初始化。
当Main被加载时,会触发Main_Load()方法被调用。
//初始化组件的方法
InitializeComponent(){
初始化对象:
private System.Windows.Forms.ToolStripMenuItem mI客退追朔ToolStripMenuItem;
调用AddRange(
mI客退追朔ToolStripMenuItem,
...
)
}
两个组件: menuStrip 和 StatusStrip
MenuStrip 中包含 ToolStripMenuItem
StatusStrip 中包含3个 ToolStripStatusLabel
### 单词
barcode 条码
two-dimensional barcode 二维码
defect缺陷
### 品质不良录入
命令空间:namespace MITVBarcode
品质不良录入:对应的类 MIDEFECT ,点击事件处理函数 MIDEFECT(object sender, EventArgs e)
该类位于:RMADEF.cs文件中。
## 第8章:委托、Lambda表达式
### 委托
### Lambda表达式
### 事件
## 第11章:LINQ
## 第16章:Visual Studio 2010
## 30章: 核心ADO.NET
ADO.NET是英文ActiveX Data Object for the .NET Framework的缩写;是建立在Microsoft .NET Framework之上的,为编程人员提供数据库访问服务的一种对象模型。
数据模型访问示意图:
```
程序 | 数据访问 | 数据库 |
------------------------------------------------
| | DB2 |
| | SQL Server |
| | Oracle |
使用C#或 | 数据访问模型 | MySQL |
VB.NET编写 | | Access |
```
ADO.NET的结构图:
重要(该图指明了DataAdpter的作用)
根据数据源的不同,选择不同的.NET Framework数据提供程序进行连接。
例如:适用于SQL Server .NET Framework数据库提供程序。
数据访问对象:
| 对象 | 说明 | 别名 |
|--------- |--------------------------- | ------------ |
|Connection | 建立与特定数据库的连接 | |
|Command | 执行各种访问数据库的命令并返回结果 | 数据命令对象 |
|DataReader | 从数据源中读取只进且只读的记录集 | 数据库读取器 |
|DataSet | 支持ADO.NET 断开连接方式访问数据 | |
|DataAdapter| 用数据源填充DataSet并解析更新 |
ADO.NET既能在与数据源连接的环境下工作,又能在断开与数据源连接的条件下工作。
ADO.NET访问数据库的途径
```
Connection ——> Command ——> DataReader ——> Response Write
^ |
| 途径一(连接时) |
v v
DataBasc Memory Browser
^ ^ ^
| 途径二(断开时) | |
v v |
Connection ——> DataAdapter ——> DataSet ——> GridView
```
ADO.NET包含对XML标准的完全支持。
要想连接到数据库,首先必须创建一个Connection对象。要连接到SQL Server数据库,需要引入 System.Data.SqlClient 命名空间,并创建一个 SqlConnection 类的实例。(最后需关闭连接)。
```C#
SqlConnection myConnection = new SqlConnection(connStr); //连接string
myConnection.Open();
SqlCommand myConnand = new SqlCommand(queryStr, myConnection); //查询string
SqlDataReader myDataReader = myCommand.ExecuteReader();
myDataReader.Read(); //读取一行
myDataReader.Close(); //关闭数据库读取器 ;调用其Cancel()方法可以取消执行。
myConnection.Close(); //关闭数据库连接
```
#### DataSet和DataAdapter对象的使用方法
### System.Data.SqlClient 名稱空間
使用ADO.NET訪問C#中的數據
System.Data 名稱空間中定義的標準接口:
SqlConnection連接數據庫
SqlCommand用作SQL語句或存儲過程調用的包裝器
SqlDataReader用作只向前的連接數據讀取器.
ADO.NET类最重要的功能是:它们是以断开连接的方式工作,这在目前以Web为中心的环境
中非常重要。我们常常把服务(例如在线书店)构建为连接到一个服务器,检索一些数据,再在客户
端上处理这些数据,之后重新连接服务器,并把数据传递回去,进行处理。ADO.NET的断开连接
的本质就可以启用这种操作。(他們都脫機處理數據庫)
使用 SqlConnection類連接數據庫.
#### 高效的使用連接
在.NET中使用"稀缺"的資源時,最好確保每個資源在使用完成后立即釋放.
1. 使用using子句確保在退出塊后立即釋放實現IDisposable接口的對象.
using (SqlConnection conn = new SqlConnection(source)){
conn.Open();
//Do Something useful
}
無論塊是如何退出的,using子句都會確保不關閉數據庫連接.
但是,应确保像这样的任何资源尽可能早地释放。因为在块的其余部分可能有更多的
代码,而没有必要锁定资源。
另外,如果在using块中出现了异常,
2. 使用try...catch...finally語句塊.
#### 命令
命令就是一個要在數據庫上執行的包含SQL語句的文本字符串.
把SQL子句作為一個參數傳遞給Command類的構造函數,就是一條命令.
sql Connection conn = new SqlConnection(source);
conn.Open();
sqlCommand cmd = new SqlCommand(select,conn);
#### 執行命令
SqlDataReader reader = cmd.ExecuteReader(); //執行命令,返回一個類型化的IDataReader
while(reader.Read()){}
这个方法执行命令,并根据使用的提供程序返回一个类型化的DataReader对象,返回的对象可
以用于遍历返回的记录
EXecuteNonQuery()方法:执行命令,但不返回任何结果. 这个方法一般用于update、 insert和delete语句,
其中唯一的返回值是受影响的记录个数.
### 管理數據和關係: DataSet類
DataSet类是数据的脱机容器。它不包含数据库连接的概念,实际上存储在Dadet类中的数据
不一定来源于数据库,它可以是来自CsV文件、XML文件的记录,或是从测量设备中读取的点
DataSet类由一组数据表组成,每个表都有一组数据列和数据行,除了定义数
据外,还可以在DataSet类中定义表之间的链接.
重点是记住,DataSet类基本上是内存中的数据库,其中包含了所有表、关系和约束
數據表: DataTable對象
數據列: DataColumn
數據行: DataRow
SqlDataAdapter类,它用于把数据置入DataSet中.
SqlDataAdapter类,用於存儲select,insert,update和delete命令的類,因此可以用於填充DataSet和更新數據庫.
datareader对象提供只读单向数据的快速传递,
单向:您只能依次读取下一条数据;只读:DataReader中的数据是只读的,不能修改;
相对地,DataSet中的数据可以任意读取和修改
### CombBox
Items 設置, 在屬性窗口中點擊Items值處,在彈出的字符串集合編輯器中每行一個Item進行輸入.
### 屬性編輯器
### 控制台輸出
Console.WriteLine(“格式”,对象1,对象2);
{0,-8} 输出第一个参数,且值占8个字符宽度,且为左对齐
{1,8} 输出第二个参数,且值占8个字符宽度,且为右对齐
| FanDean/fandean.github.io | _drafts/C#/C#笔记.md | Markdown | mit | 7,096 | [
30522,
1001,
1039,
1001,
100,
100,
100,
100,
1993,
1039,
1001,
100,
100,
100,
100,
1993,
2565,
1012,
20116,
1746,
1916,
2364,
1863,
1901,
1746,
100,
100,
2364,
100,
100,
1989,
2364,
1012,
20116,
1861,
100,
1773,
1916,
2364,
1024,
2433,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Imports System.Collections.Immutable
Imports System.Reflection
Imports System.Runtime.InteropServices
Imports Microsoft.CodeAnalysis.Collections
Imports Microsoft.CodeAnalysis.VisualBasic.Symbols
Imports Roslyn.Utilities
Namespace Microsoft.CodeAnalysis.VisualBasic.ExpressionEvaluator
Friend Delegate Function GenerateMethodBody(method As EEMethodSymbol, diagnostics As DiagnosticBag) As BoundStatement
Friend NotInheritable Class EEMethodSymbol
Inherits MethodSymbol
Friend ReadOnly TypeMap As TypeSubstitution
Friend ReadOnly SubstitutedSourceMethod As MethodSymbol
Friend ReadOnly Locals As ImmutableArray(Of LocalSymbol)
Friend ReadOnly LocalsForBinding As ImmutableArray(Of LocalSymbol)
Private ReadOnly _compilation As VisualBasicCompilation
Private ReadOnly _container As EENamedTypeSymbol
Private ReadOnly _name As String
Private ReadOnly _locations As ImmutableArray(Of Location)
Private ReadOnly _typeParameters As ImmutableArray(Of TypeParameterSymbol)
Private ReadOnly _parameters As ImmutableArray(Of ParameterSymbol)
Private ReadOnly _meParameter As ParameterSymbol
Private ReadOnly _displayClassVariables As ImmutableDictionary(Of String, DisplayClassVariable)
Private ReadOnly _voidType As NamedTypeSymbol
''' <summary>
''' Invoked at most once to generate the method body.
''' (If the compilation has no errors, it will be invoked
''' exactly once, otherwise it may be skipped.)
''' </summary>
Private ReadOnly _generateMethodBody As GenerateMethodBody
Private _lazyReturnType As TypeSymbol
' NOTE: This is only used for asserts, so it could be conditional on DEBUG.
Private ReadOnly _allTypeParameters As ImmutableArray(Of TypeParameterSymbol)
Friend Sub New(
compilation As VisualBasicCompilation,
container As EENamedTypeSymbol,
name As String,
location As Location,
sourceMethod As MethodSymbol,
sourceLocals As ImmutableArray(Of LocalSymbol),
sourceLocalsForBinding As ImmutableArray(Of LocalSymbol),
sourceDisplayClassVariables As ImmutableDictionary(Of String, DisplayClassVariable),
voidType As NamedTypeSymbol,
generateMethodBody As GenerateMethodBody)
Debug.Assert(sourceMethod.IsDefinition)
Debug.Assert(sourceMethod.ContainingSymbol = container.SubstitutedSourceType.OriginalDefinition)
Debug.Assert(sourceLocals.All(Function(l) l.ContainingSymbol = sourceMethod))
_compilation = compilation
_container = container
_name = name
_locations = ImmutableArray.Create(location)
_voidType = voidType
' What we want is to map all original type parameters to the corresponding new type parameters
' (since the old ones have the wrong owners). Unfortunately, we have a circular dependency:
' 1) Each new type parameter requires the entire map in order to be able to construct its constraint list.
' 2) The map cannot be constructed until all new type parameters exist.
' Our solution is to pass each new type parameter a lazy reference to the type map. We then
' initialize the map as soon as the new type parameters are available - and before they are
' handed out - so that there is never a period where they can require the type map and find
' it uninitialized.
Dim sourceMethodTypeParameters = sourceMethod.TypeParameters
Dim allSourceTypeParameters = container.SourceTypeParameters.Concat(sourceMethodTypeParameters)
Dim getTypeMap As New Func(Of TypeSubstitution)(Function() TypeMap)
_typeParameters = sourceMethodTypeParameters.SelectAsArray(
Function(tp As TypeParameterSymbol, i As Integer, arg As Object) DirectCast(New EETypeParameterSymbol(Me, tp, i, getTypeMap), TypeParameterSymbol),
DirectCast(Nothing, Object))
_allTypeParameters = container.TypeParameters.Concat(_typeParameters)
Me.TypeMap = TypeSubstitution.Create(sourceMethod, allSourceTypeParameters, ImmutableArrayExtensions.Cast(Of TypeParameterSymbol, TypeSymbol)(_allTypeParameters))
EENamedTypeSymbol.VerifyTypeParameters(Me, _typeParameters)
Dim substitutedSourceType = container.SubstitutedSourceType
Me.SubstitutedSourceMethod = sourceMethod.AsMember(substitutedSourceType)
If _typeParameters.Any() Then
Me.SubstitutedSourceMethod = Me.SubstitutedSourceMethod.Construct(_typeParameters.As(Of TypeSymbol)())
End If
TypeParameterChecker.Check(Me.SubstitutedSourceMethod, _allTypeParameters)
' Create a map from original parameter to target parameter.
Dim parameterBuilder = ArrayBuilder(Of ParameterSymbol).GetInstance()
Dim substitutedSourceMeParameter = Me.SubstitutedSourceMethod.MeParameter
Dim subsitutedSourceHasMeParameter = substitutedSourceMeParameter IsNot Nothing
If subsitutedSourceHasMeParameter Then
_meParameter = MakeParameterSymbol(0, GeneratedNames.MakeStateMachineCapturedMeName(), substitutedSourceMeParameter) ' NOTE: Name doesn't actually matter.
Debug.Assert(_meParameter.Type = Me.SubstitutedSourceMethod.ContainingType)
parameterBuilder.Add(_meParameter)
End If
Dim ordinalOffset = If(subsitutedSourceHasMeParameter, 1, 0)
For Each substitutedSourceParameter In Me.SubstitutedSourceMethod.Parameters
Dim ordinal = substitutedSourceParameter.Ordinal + ordinalOffset
Debug.Assert(ordinal = parameterBuilder.Count)
Dim parameter = MakeParameterSymbol(ordinal, substitutedSourceParameter.Name, substitutedSourceParameter)
parameterBuilder.Add(parameter)
Next
_parameters = parameterBuilder.ToImmutableAndFree()
Dim localsBuilder = ArrayBuilder(Of LocalSymbol).GetInstance()
Dim localsMap = PooledDictionary(Of LocalSymbol, LocalSymbol).GetInstance()
For Each sourceLocal In sourceLocals
Dim local = sourceLocal.ToOtherMethod(Me, Me.TypeMap)
localsMap.Add(sourceLocal, local)
localsBuilder.Add(local)
Next
Me.Locals = localsBuilder.ToImmutableAndFree()
localsBuilder = ArrayBuilder(Of LocalSymbol).GetInstance()
For Each sourceLocal In sourceLocalsForBinding
Dim local As LocalSymbol = Nothing
If Not localsMap.TryGetValue(sourceLocal, local) Then
local = sourceLocal.ToOtherMethod(Me, Me.TypeMap)
localsMap.Add(sourceLocal, local)
End If
localsBuilder.Add(local)
Next
Me.LocalsForBinding = localsBuilder.ToImmutableAndFree()
' Create a map from variable name to display class field.
Dim displayClassVariables = PooledDictionary(Of String, DisplayClassVariable).GetInstance()
For Each pair In sourceDisplayClassVariables
Dim variable = pair.Value
Dim displayClassInstanceFromLocal = TryCast(variable.DisplayClassInstance, DisplayClassInstanceFromLocal)
Dim displayClassInstance = If(displayClassInstanceFromLocal Is Nothing,
DirectCast(New DisplayClassInstanceFromMe(Me.Parameters(0)), DisplayClassInstance),
New DisplayClassInstanceFromLocal(DirectCast(localsMap(displayClassInstanceFromLocal.Local), EELocalSymbol)))
variable = variable.SubstituteFields(displayClassInstance, Me.TypeMap)
displayClassVariables.Add(pair.Key, variable)
Next
_displayClassVariables = displayClassVariables.ToImmutableDictionary()
displayClassVariables.Free()
localsMap.Free()
_generateMethodBody = generateMethodBody
End Sub
Private Function MakeParameterSymbol(ordinal As Integer, name As String, sourceParameter As ParameterSymbol) As ParameterSymbol
Return New SynthesizedParameterSymbolWithCustomModifiers(
Me,
sourceParameter.Type,
ordinal,
sourceParameter.IsByRef,
name,
sourceParameter.CustomModifiers,
sourceParameter.HasByRefBeforeCustomModifiers)
End Function
Public Overrides ReadOnly Property MethodKind As MethodKind
Get
Return MethodKind.Ordinary
End Get
End Property
Public Overrides ReadOnly Property Name As String
Get
Return _name
End Get
End Property
Public Overrides ReadOnly Property Arity As Integer
Get
Return _typeParameters.Length
End Get
End Property
Public Overrides ReadOnly Property IsExtensionMethod As Boolean
Get
Return False
End Get
End Property
Friend Overrides ReadOnly Property HasSpecialName As Boolean
Get
Return True
End Get
End Property
Friend Overrides ReadOnly Property ImplementationAttributes As MethodImplAttributes
Get
Return Nothing
End Get
End Property
Friend Overrides ReadOnly Property HasDeclarativeSecurity As Boolean
Get
Return False
End Get
End Property
Public Overrides Function GetDllImportData() As DllImportData
Return Nothing
End Function
Friend Overrides Function GetSecurityInformation() As IEnumerable(Of Microsoft.Cci.SecurityAttribute)
Throw ExceptionUtilities.Unreachable
End Function
Friend Overrides ReadOnly Property ReturnTypeMarshallingInformation As MarshalPseudoCustomAttributeData
Get
Return Nothing
End Get
End Property
Friend Overrides Function TryGetMeParameter(<Out> ByRef meParameter As ParameterSymbol) As Boolean
meParameter = Nothing
Return True
End Function
Public Overrides ReadOnly Property IsVararg As Boolean
Get
Return False
End Get
End Property
Public Overrides ReadOnly Property IsSub As Boolean
Get
Return ReturnType.SpecialType = SpecialType.System_Void
End Get
End Property
Public Overrides ReadOnly Property IsAsync As Boolean
Get
Return False
End Get
End Property
Public Overrides ReadOnly Property ReturnType As TypeSymbol
Get
If _lazyReturnType Is Nothing Then
Throw New InvalidOperationException()
End If
Return _lazyReturnType
End Get
End Property
Public Overrides ReadOnly Property TypeArguments As ImmutableArray(Of TypeSymbol)
Get
Return ImmutableArrayExtensions.Cast(Of TypeParameterSymbol, TypeSymbol)(_typeParameters)
End Get
End Property
Public Overrides ReadOnly Property TypeParameters As ImmutableArray(Of TypeParameterSymbol)
Get
Return _typeParameters
End Get
End Property
Public Overrides ReadOnly Property Parameters As ImmutableArray(Of ParameterSymbol)
Get
Return _parameters
End Get
End Property
Public Overrides ReadOnly Property ExplicitInterfaceImplementations As ImmutableArray(Of MethodSymbol)
Get
Return ImmutableArray(Of MethodSymbol).Empty
End Get
End Property
Public Overrides ReadOnly Property ReturnTypeCustomModifiers As ImmutableArray(Of CustomModifier)
Get
Return ImmutableArray(Of CustomModifier).Empty
End Get
End Property
Public Overrides ReadOnly Property AssociatedSymbol As Symbol
Get
Return Nothing
End Get
End Property
Friend Overrides Function GetAppliedConditionalSymbols() As ImmutableArray(Of String)
Throw ExceptionUtilities.Unreachable
End Function
Friend Overrides ReadOnly Property CallingConvention As Cci.CallingConvention
Get
Debug.Assert(Me.IsShared)
Dim cc = Cci.CallingConvention.Default
If Me.IsVararg Then
cc = cc Or Cci.CallingConvention.ExtraArguments
End If
If Me.IsGenericMethod Then
cc = cc Or Cci.CallingConvention.Generic
End If
Return cc
End Get
End Property
Friend Overrides ReadOnly Property GenerateDebugInfoImpl As Boolean
Get
Return False
End Get
End Property
Public Overrides ReadOnly Property ContainingSymbol As Symbol
Get
Return _container
End Get
End Property
Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Get
Return _locations
End Get
End Property
Public Overrides ReadOnly Property DeclaringSyntaxReferences As ImmutableArray(Of SyntaxReference)
Get
Throw ExceptionUtilities.Unreachable
End Get
End Property
Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility
Get
Return Accessibility.Internal
End Get
End Property
Public Overrides ReadOnly Property IsShared As Boolean
Get
Return True
End Get
End Property
Public Overrides ReadOnly Property IsOverridable As Boolean
Get
Return False
End Get
End Property
Public Overrides ReadOnly Property IsOverrides As Boolean
Get
Return False
End Get
End Property
Public Overrides ReadOnly Property IsMustOverride As Boolean
Get
Return False
End Get
End Property
Public Overrides ReadOnly Property IsNotOverridable As Boolean
Get
Return False
End Get
End Property
Public Overrides ReadOnly Property IsExternalMethod As Boolean
Get
Return False
End Get
End Property
Public Overrides ReadOnly Property IsIterator As Boolean
Get
Return False
End Get
End Property
Public Overrides ReadOnly Property IsOverloads As Boolean
Get
Return False
End Get
End Property
Friend Overrides ReadOnly Property ObsoleteAttributeData As ObsoleteAttributeData
Get
Throw ExceptionUtilities.Unreachable
End Get
End Property
Friend Overrides ReadOnly Property IsMethodKindBasedOnSyntax As Boolean
Get
Return False
End Get
End Property
Friend Overrides ReadOnly Property Syntax As VisualBasicSyntaxNode
Get
Return Nothing
End Get
End Property
#Disable Warning RS0010
''' <remarks>
''' The corresponding C# method,
''' <see cref="M:Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.EEMethodSymbol.GenerateMethodBody(Microsoft.CodeAnalysis.CSharp.TypeCompilationState,Microsoft.CodeAnalysis.DiagnosticBag)"/>,
''' invokes the <see cref="LocalRewriter"/> and the <see cref="LambdaRewriter"/> explicitly.
''' In VB, the caller (of this method) does that.
''' </remarks>
#Enable Warning RS0010
Friend Overrides Function GetBoundMethodBody(diagnostics As DiagnosticBag, <Out> ByRef Optional methodBodyBinder As Binder = Nothing) As BoundBlock
Dim body = _generateMethodBody(Me, diagnostics)
Debug.Assert(body IsNot Nothing)
_lazyReturnType = CalculateReturnType(body)
' Can't do this until the return type has been computed.
TypeParameterChecker.Check(Me, _allTypeParameters)
Dim syntax As VisualBasicSyntaxNode = body.Syntax
Dim statementsBuilder = ArrayBuilder(Of BoundStatement).GetInstance()
statementsBuilder.Add(body)
' Insert an implicit return statement if necessary.
If body.Kind <> BoundKind.ReturnStatement Then
statementsBuilder.Add(New BoundReturnStatement(syntax, Nothing, Nothing, Nothing))
End If
Dim originalLocalsBuilder = ArrayBuilder(Of LocalSymbol).GetInstance()
Dim originalLocalsSet = PooledHashSet(Of LocalSymbol).GetInstance()
For Each local In LocalsForBinding
Debug.Assert(Not originalLocalsSet.Contains(local))
originalLocalsBuilder.Add(local)
originalLocalsSet.Add(local)
Next
For Each local In Me.Locals
If Not originalLocalsSet.Contains(local) Then
originalLocalsBuilder.Add(local)
End If
Next
originalLocalsSet.Free()
Dim originalLocals = originalLocalsBuilder.ToImmutableAndFree()
Dim newBody = New BoundBlock(syntax, Nothing, originalLocals, statementsBuilder.ToImmutableAndFree())
If diagnostics.HasAnyErrors() Then
Return newBody
End If
DiagnosticsPass.IssueDiagnostics(newBody, diagnostics, Me)
If diagnostics.HasAnyErrors() Then
Return newBody
End If
' Check for use-site errors (e.g. missing types in the signature).
Dim useSiteInfo As DiagnosticInfo = Me.CalculateUseSiteErrorInfo()
If useSiteInfo IsNot Nothing Then
diagnostics.Add(useSiteInfo, _locations(0))
Return newBody
End If
Debug.Assert(Not newBody.HasErrors)
' NOTE: In C#, EE rewriting happens AFTER local rewriting. However, that order would be difficult
' to accommodate in VB, so we reverse it.
' Rewrite local declaration statement.
newBody = LocalDeclarationRewriter.Rewrite(_compilation, _container, newBody)
' Rewrite pseudo-variable references to helper method calls.
newBody = DirectCast(PlaceholderLocalRewriter.Rewrite(_compilation, _container, newBody), BoundBlock)
' Create a map from original local to target local.
Dim localMap = PooledDictionary(Of LocalSymbol, LocalSymbol).GetInstance()
Dim targetLocals = newBody.Locals
Debug.Assert(originalLocals.Length = targetLocals.Length)
For i = 0 To originalLocals.Length - 1
Dim originalLocal = originalLocals(i)
Dim targetLocal = targetLocals(i)
Debug.Assert(TypeOf originalLocal IsNot EELocalSymbol OrElse
DirectCast(originalLocal, EELocalSymbol).Ordinal = DirectCast(targetLocal, EELocalSymbol).Ordinal)
localMap.Add(originalLocal, targetLocal)
Next
' Variables may have been captured by lambdas in the original method
' or in the expression, and we need to preserve the existing values of
' those variables in the expression. This requires rewriting the variables
' in the expression based on the closure classes from both the original
' method and the expression, and generating a preamble that copies
' values into the expression closure classes.
'
' Consider the original method:
' Shared Sub M()
' Dim x, y, z as Integer
' ...
' F(Function() x + y)
' End Sub
' and the expression in the EE: "F(Function() x + z)".
'
' The expression is first rewritten using the closure class and local <1>
' from the original method: F(Function() <1>.x + z)
' Then lambda rewriting introduces a new closure class that includes
' the locals <1> and z, and a corresponding local <2>: F(Function() <2>.<1>.x + <2>.z)
' And a preamble is added to initialize the fields of <2>:
' <2> = New <>c__DisplayClass0()
' <2>.<1> = <1>
' <2>.z = z
' Create a map from variable name to display class field.
Dim displayClassVariables = PooledDictionary(Of String, DisplayClassVariable).GetInstance()
For Each pair In _displayClassVariables
Dim variable = pair.Value
Dim displayClassInstanceFromLocal = TryCast(variable.DisplayClassInstance, DisplayClassInstanceFromLocal)
Dim displayClassInstance = If(displayClassInstanceFromLocal Is Nothing,
DirectCast(New DisplayClassInstanceFromMe(Me.Parameters(0)), DisplayClassInstance),
New DisplayClassInstanceFromLocal(DirectCast(localMap(displayClassInstanceFromLocal.Local), EELocalSymbol)))
variable = New DisplayClassVariable(variable.Name, variable.Kind, displayClassInstance, variable.DisplayClassFields)
displayClassVariables.Add(pair.Key, variable)
Next
' Rewrite references to "Me" to refer to this method's "Me" parameter.
' Rewrite variables within body to reference existing display classes.
newBody = DirectCast(CapturedVariableRewriter.Rewrite(
If(Me.SubstitutedSourceMethod.IsShared, Nothing, Me.Parameters(0)),
displayClassVariables.ToImmutableDictionary(),
newBody,
diagnostics), BoundBlock)
displayClassVariables.Free()
If diagnostics.HasAnyErrors() Then
Return newBody
End If
' Insert locals from the original method, followed by any new locals.
Dim localBuilder = ArrayBuilder(Of LocalSymbol).GetInstance()
For Each originalLocal In Me.Locals
Dim targetLocal = localMap(originalLocal)
Debug.Assert(TypeOf targetLocal IsNot EELocalSymbol OrElse DirectCast(targetLocal, EELocalSymbol).Ordinal = localBuilder.Count)
localBuilder.Add(targetLocal)
Next
localMap.Free()
newBody = newBody.Update(newBody.StatementListSyntax, localBuilder.ToImmutableAndFree(), newBody.Statements)
TypeParameterChecker.Check(newBody, _allTypeParameters)
Return newBody
End Function
Private Function CalculateReturnType(body As BoundStatement) As TypeSymbol
Select Case body.Kind
Case BoundKind.ReturnStatement
Return DirectCast(body, BoundReturnStatement).ExpressionOpt.Type
Case BoundKind.ExpressionStatement,
BoundKind.RedimStatement
Return _voidType
Case Else
Throw ExceptionUtilities.UnexpectedValue(body.Kind)
End Select
End Function
Friend Overrides Function CalculateLocalSyntaxOffset(localPosition As Integer, localTree As SyntaxTree) As Integer
Throw ExceptionUtilities.Unreachable
End Function
End Class
End Namespace | DavidKarlas/roslyn | src/ExpressionEvaluator/VisualBasic/Source/ExpressionCompiler/Symbols/EEMethodSymbol.vb | Visual Basic | apache-2.0 | 24,290 | [
30522,
17589,
2291,
1012,
6407,
1012,
10047,
28120,
3085,
17589,
2291,
1012,
9185,
17589,
2291,
1012,
2448,
7292,
1012,
6970,
11923,
2121,
7903,
2229,
17589,
7513,
1012,
3642,
25902,
1012,
6407,
17589,
7513,
1012,
3642,
25902,
1012,
5107,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package org.protocoderrunner.apprunner;
import android.app.AlarmManager;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.Service;
import android.app.TaskStackBuilder;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.graphics.PixelFormat;
import android.os.IBinder;
import android.os.Looper;
import android.support.v4.app.NotificationCompat;
import android.view.Gravity;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.RelativeLayout;
import android.widget.Toast;
import org.protocoderrunner.R;
import org.protocoderrunner.apprunner.api.PApp;
import org.protocoderrunner.apprunner.api.PBoards;
import org.protocoderrunner.apprunner.api.PConsole;
import org.protocoderrunner.apprunner.api.PDashboard;
import org.protocoderrunner.apprunner.api.PDevice;
import org.protocoderrunner.apprunner.api.PFileIO;
import org.protocoderrunner.apprunner.api.PMedia;
import org.protocoderrunner.apprunner.api.PNetwork;
import org.protocoderrunner.apprunner.api.PProtocoder;
import org.protocoderrunner.apprunner.api.PSensors;
import org.protocoderrunner.apprunner.api.PUI;
import org.protocoderrunner.apprunner.api.PUtil;
import org.protocoderrunner.apprunner.api.other.WhatIsRunning;
import org.protocoderrunner.events.Events;
import org.protocoderrunner.project.Project;
import org.protocoderrunner.project.ProjectManager;
import org.protocoderrunner.utils.MLog;
import de.greenrobot.event.EventBus;
//stopService
//stopSelf
public class AppRunnerService extends Service {
private static final String SERVICE_CLOSE = "service_close";
private AppRunnerInterpreter interp;
private final String TAG = "AppRunnerService";
private Project currentProject;
public PApp pApp;
public PBoards pBoards;
public PConsole pConsole;
public PDashboard pDashboard;
public PDevice pDevice;
public PFileIO pFileIO;
public PMedia pMedia;
public PNetwork pNetwork;
public PProtocoder pProtocoder;
public PSensors pSensors;
public PUI pUi;
public PUtil pUtil;
private WindowManager windowManager;
private RelativeLayout parentScriptedLayout;
private RelativeLayout mainLayout;
private BroadcastReceiver mReceiver;
private NotificationManager mNotifManager;
private PendingIntent mRestartPendingIntent;
private Toast mToast;
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
// Can be called twice
interp = new AppRunnerInterpreter(this);
interp.createInterpreter(false);
pApp = new PApp(this);
//pApp.initForParentFragment(this);
pBoards = new PBoards(this);
pConsole = new PConsole(this);
pDashboard = new PDashboard(this);
pDevice = new PDevice(this);
//pDevice.initForParentFragment(this);
pFileIO = new PFileIO(this);
pMedia = new PMedia(this);
//pMedia.initForParentFragment(this);
pNetwork = new PNetwork(this);
//pNetwork.initForParentFragment(this);
pProtocoder = new PProtocoder(this);
pSensors = new PSensors(this);
//pSensors.initForParentFragment(this);
pUi = new PUI(this);
pUi.initForParentService(this);
//pUi.initForParentFragment(this);
pUtil = new PUtil(this);
interp.interpreter.addObjectToInterface("app", pApp);
interp.interpreter.addObjectToInterface("boards", pBoards);
interp.interpreter.addObjectToInterface("console", pConsole);
interp.interpreter.addObjectToInterface("dashboard", pDashboard);
interp.interpreter.addObjectToInterface("device", pDevice);
interp.interpreter.addObjectToInterface("fileio", pFileIO);
interp.interpreter.addObjectToInterface("media", pMedia);
interp.interpreter.addObjectToInterface("network", pNetwork);
interp.interpreter.addObjectToInterface("protocoder", pProtocoder);
interp.interpreter.addObjectToInterface("sensors", pSensors);
interp.interpreter.addObjectToInterface("ui", pUi);
interp.interpreter.addObjectToInterface("util", pUtil);
mainLayout = initLayout();
String projectName = intent.getStringExtra(Project.NAME);
String projectFolder = intent.getStringExtra(Project.FOLDER);
currentProject = ProjectManager.getInstance().get(projectFolder, projectName);
ProjectManager.getInstance().setCurrentProject(currentProject);
MLog.d(TAG, "launching " + projectName + " in " + projectFolder);
AppRunnerSettings.get().project = currentProject;
String script = ProjectManager.getInstance().getCode(currentProject);
interp.evalFromService(script);
//audio
//AudioManager audio = (AudioManager) this.getSystemService(Context.AUDIO_SERVICE);
//int currentVolume = audio.getStreamVolume(AudioManager.STREAM_MUSIC);
//this.setVolumeControlStream(AudioManager.STREAM_MUSIC);
windowManager = (WindowManager) getSystemService(WINDOW_SERVICE);
boolean isTouchable = true;
int touchParam;
if (isTouchable) {
touchParam = WindowManager.LayoutParams.TYPE_PHONE;
} else {
touchParam = WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY;
}
WindowManager.LayoutParams params = new WindowManager.LayoutParams(
WindowManager.LayoutParams.WRAP_CONTENT,
WindowManager.LayoutParams.WRAP_CONTENT,
touchParam,
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE,
PixelFormat.TRANSLUCENT);
params.gravity = Gravity.TOP | Gravity.LEFT;
params.x = 0;
params.y = 0;
windowManager.addView(mainLayout, params);
// TEST
//if (!EventBus.getDefault().isRegistered(this)) {
// EventBus.getDefault().register(this);
//}
mNotifManager = (NotificationManager) AppRunnerService.this.getSystemService(Context.NOTIFICATION_SERVICE);
int notificationId = (int) Math.ceil(100000 * Math.random());
createNotification(notificationId, projectFolder, projectName);
//just in case it crash
Intent restartIntent = new Intent("org.protocoder.LauncherActivity"); //getApplicationContext(), AppRunnerActivity.class);
restartIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
restartIntent.putExtra("wasCrash", true);
// intent.setPackage("org.protocoder");
//intent.setClassName("org.protocoder", "MainActivity");
mRestartPendingIntent = PendingIntent.getActivity(AppRunnerService.this, 0, restartIntent, 0);
mToast = Toast.makeText(AppRunnerService.this, "Crash :(", Toast.LENGTH_LONG);
return Service.START_NOT_STICKY;
}
private void createNotification(final int notificationId, String scriptFolder, String scriptName) {
IntentFilter filter = new IntentFilter();
filter.addAction(SERVICE_CLOSE);
mReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
if (intent.getAction().equals(SERVICE_CLOSE)) {
AppRunnerService.this.stopSelf();
mNotifManager.cancel(notificationId);
}
}
};
registerReceiver(mReceiver, filter);
//RemoteViews remoteViews = new RemoteViews(getPackageName(),
// R.layout.widget);
Intent stopIntent = new Intent(SERVICE_CLOSE);
PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0, stopIntent, 0);
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.app_icon)
.setContentTitle(scriptName).setContentText("Running service: " + scriptFolder + " > " + scriptName)
.setOngoing(false)
.addAction(R.drawable.protocoder_icon, "stop", pendingIntent)
.setDeleteIntent(pendingIntent);
// Creates an explicit intent for an Activity in your app
Intent resultIntent = new Intent(this, AppRunnerActivity.class);
// The stack builder object will contain an artificial back stack for
// navigating backward from the Activity leads out your application to the Home screen.
TaskStackBuilder stackBuilder = TaskStackBuilder.create(this);
stackBuilder.addParentStack(AppRunnerActivity.class);
stackBuilder.addNextIntent(resultIntent);
PendingIntent resultPendingIntent = stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT);
mBuilder.setContentIntent(resultPendingIntent);
NotificationManager mNotificationManager = (NotificationManager) this.getSystemService(this.NOTIFICATION_SERVICE);
mNotificationManager.notify(notificationId, mBuilder.build());
Thread.setDefaultUncaughtExceptionHandler(handler);
}
Thread.UncaughtExceptionHandler handler = new Thread.UncaughtExceptionHandler() {
@Override
public void uncaughtException(Thread thread, Throwable ex) {
new Thread() {
@Override
public void run() {
Looper.prepare();
Toast.makeText(AppRunnerService.this, "lalll", Toast.LENGTH_LONG);
Looper.loop();
}
}.start();
// handlerToast.post(runnable);
AlarmManager mgr = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
mgr.set(AlarmManager.RTC, System.currentTimeMillis() + 100, mRestartPendingIntent);
mNotifManager.cancelAll();
android.os.Process.killProcess(android.os.Process.myPid());
System.exit(10);
throw new RuntimeException(ex);
}
};
public void addScriptedLayout(RelativeLayout scriptedUILayout) {
parentScriptedLayout.addView(scriptedUILayout);
}
public RelativeLayout initLayout() {
ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
// set the parent
parentScriptedLayout = new RelativeLayout(this);
parentScriptedLayout.setLayoutParams(layoutParams);
parentScriptedLayout.setGravity(Gravity.BOTTOM);
parentScriptedLayout.setBackgroundColor(getResources().getColor(R.color.transparent));
return parentScriptedLayout;
}
@Override
public IBinder onBind(Intent intent) {
// TODO for communication return IBinder implementation
return null;
}
@Override
public void onCreate() {
super.onCreate();
MLog.d(TAG, "onCreate");
// interp.callJsFunction("onCreate");
// its called only once
}
@Override
public void onDestroy() {
super.onDestroy();
MLog.d(TAG, "onDestroy");
interp.callJsFunction("onDestroy");
windowManager.removeView(mainLayout);
unregisterReceiver(mReceiver);
WhatIsRunning.getInstance().stopAll();
interp = null;
//EventBus.getDefault().unregister(this);
}
public void onEventMainThread(Events.ProjectEvent evt) {
// Using transaction so the view blocks
MLog.d(TAG, "event -> " + evt.getAction());
if (evt.getAction() == "stop") {
stopSelf();
}
}
// execute lines
public void onEventMainThread(Events.ExecuteCodeEvent evt) {
String code = evt.getCode(); // .trim();
MLog.d(TAG, "event -> q " + code);
interp.evalFromService(code);
}
} | josejuansanchez/protocoder-mvd | protocoder_apprunner/src/main/java/org/protocoderrunner/apprunner/AppRunnerService.java | Java | lgpl-3.0 | 11,875 | [
30522,
7427,
8917,
1012,
15053,
16044,
12171,
4609,
3678,
1012,
10439,
23195,
1025,
12324,
11924,
1012,
10439,
1012,
8598,
24805,
4590,
1025,
12324,
11924,
1012,
10439,
1012,
26828,
24805,
4590,
1025,
12324,
11924,
1012,
10439,
1012,
14223,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
import parse = require('xml-parser');
declare var assert: { equal<T>(a: T, b: T): void };
var doc: parse.Document = parse(
'<?xml version="1.0" encoding="utf-8"?>' +
'<mydoc><child a="1">foo</child><child/></mydoc>');
var declaration: parse.Declaration = doc.declaration;
assert.equal(declaration.attributes['version'], '1.0');
assert.equal(declaration.attributes['encoding'], 'utf-8');
var root: parse.Node = doc.root;
assert.equal(root.name, 'mydoc');
var children: parse.Node[] = root.children;
assert.equal(children.length, 2);
var child1: parse.Node = children[0];
assert.equal(child1.name, 'child');
assert.equal(child1.attributes['a'], '1');
assert.equal(child1.content, 'foo');
| aaronryden/DefinitelyTyped | types/xml-parser/xml-parser-tests.ts | TypeScript | mit | 693 | [
30522,
12324,
11968,
3366,
1027,
5478,
1006,
1005,
20950,
1011,
11968,
8043,
1005,
1007,
1025,
13520,
13075,
20865,
1024,
1063,
5020,
1026,
1056,
1028,
1006,
1037,
1024,
1056,
1010,
1038,
1024,
1056,
1007,
1024,
11675,
1065,
1025,
13075,
99... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
namespace Wahlemedia\Showroom\Updates;
use Schema;
use October\Rain\Database\Schema\Blueprint;
use October\Rain\Database\Updates\Migration;
class add_short_description_to_items_table extends Migration
{
public function up()
{
Schema::table('wahlemedia_showroom_items', function (Blueprint $table) {
$table->text('short_description')->nullable();
});
}
public function down()
{
Schema::dropColumn('short_description');
}
}
| wahlemedia/oc-showroom-plugin | updates/add_short_description_to_items_table.php | PHP | mit | 492 | [
30522,
1026,
1029,
25718,
3415,
15327,
30524,
1035,
5167,
1035,
2795,
8908,
9230,
1063,
2270,
3853,
2039,
1006,
1007,
1063,
8040,
28433,
1024,
1024,
2795,
1006,
1005,
22894,
16930,
2098,
2401,
1035,
2265,
9954,
1035,
5167,
1005,
1010,
3853,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
#include "common.hpp"
template <class HostT>
HostT vcl_scalar_to_host(const vcl::scalar<HostT>& vcl_s)
{
HostT cpu_s = vcl_s;
return cpu_s;
}
#define EXPORT_SCALAR_CLASS(TYPE) \
DISAMBIGUATE_CLASS_FUNCTION_PTR(vcl::scalar<TYPE>, \
const vcl::scalar<TYPE> \
::handle_type&, \
handle, \
get_scalar_##TYPE##_handle, \
() const); \
bp::class_<vcl::scalar<TYPE> >("scalar_" #TYPE) \
.def(bp::init<TYPE>()) \
.def(bp::init<TYPE, vcl::context>()) \
.def(bp::init<vcl::scalar<TYPE> >()) \
.def("to_host", &vcl_scalar_to_host<TYPE>) \
.add_property("handle", bp::make_function \
(get_scalar_##TYPE##_handle, \
bp::return_internal_reference<>())) \
;
PYVCL_SUBMODULE(scalars) {
EXPORT_SCALAR_CLASS(int);
EXPORT_SCALAR_CLASS(uint);
EXPORT_SCALAR_CLASS(long);
EXPORT_SCALAR_CLASS(ulong);
EXPORT_SCALAR_CLASS(float);
EXPORT_SCALAR_CLASS(double);
}
| viennacl/pyviennacl-dev | src/_viennacl/scalars.cpp | C++ | mit | 1,472 | [
30522,
1001,
2421,
1000,
2691,
1012,
6522,
2361,
1000,
23561,
1026,
2465,
3677,
2102,
1028,
3677,
2102,
18315,
2140,
1035,
26743,
2099,
1035,
2000,
1035,
3677,
1006,
9530,
3367,
18315,
2140,
1024,
1024,
26743,
2099,
1026,
3677,
2102,
1028,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
#
# testing rufus-doric
#
# Tue Mar 23 11:07:23 JST 2010
#
require File.join(File.dirname(__FILE__), 'base')
require 'rufus/doric'
class Owner < Rufus::Doric::Model
db :doric
doric_type :owners
_id_field :name
property :name
property :vehicle_id
end
class Car < Rufus::Doric::Model
db :doric
doric_type :cars
_id_field :plate
property :plate
end
class Boat < Rufus::Doric::Model
db :doric
doric_type :boats
_id_field :immatriculation
property :immatriculation
end
class SuperOwner < Rufus::Doric::Model
db :doric
doric_type :super_owners
_id_field :name
property :name
property :vehicle_ids
end
class UtLooserAssocationsTest < Test::Unit::TestCase
def setup
Rufus::Doric.db('doric').delete('.')
Rufus::Doric.db('doric').put('.')
Rufus::Doric.db('doric').http.cache.clear
# CouchDB feeds the same etags for views, even after a db has
# been deleted and put back, so have to do that 'forgetting'
Owner.new(
:name => 'fred', :vehicle_id => 'GE1212'
).save!
Owner.new(
:name => 'famke', :vehicle_id => 'GE1313'
).save!
Owner.new(
:name => 'fellini', :vehicle_id => 'TO45R4'
).save!
Car.new(:plate => 'GE1212').save!
Boat.new(:immatriculation => 'GE1313').save!
SuperOwner.new(
:name => 'aristotle', :vehicle_ids => %w[ GE1212 GE1313 NADA ]).save!
@fred = Owner.find('fred')
@famke = Owner.find('famke')
@fellini = Owner.find('fellini')
@aristotle = SuperOwner.find('aristotle')
end
#def teardown
#end
def test_vehicles
assert_equal Car, @fred.vehicle.class
assert_equal Boat, @famke.vehicle.class
assert_nil @fellini.vehicle
end
def test_super_owner
assert_equal [ Car, Boat ], @aristotle.vehicles.collect { |v| v.class }
end
end
| jmettraux/rufus-doric | test/ut_7_looser_associations.rb | Ruby | mit | 1,829 | [
30522,
1001,
1001,
5604,
18316,
1011,
2079,
7277,
1001,
1001,
10722,
2063,
9388,
2603,
2340,
1024,
5718,
1024,
2603,
1046,
3367,
2230,
1001,
5478,
5371,
1012,
3693,
1006,
5371,
1012,
16101,
18442,
1006,
1035,
1035,
5371,
1035,
1035,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
header("Content-Type: text/html;charset=utf-8");
$name = $_POST['first_name'];
$email = $_POST['email'];
$message = $_POST['comments'];
$to = "jgo@camaraderepresentantes.org";
$subject = "Estimado Representante";
$body = '
<html>
<head>
<title>Estimado Representante</title>
</head>
<body>
<p><b>Name: </b> '.$name.'</p>
<p><b>Email: </b> '.$email.'</p>
<p><b>Message: </b> '.$message.'</p>
</body>
</html>
';
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=utf-8\r\n";
$headers .= "Bcc: estimadosenador@gmail.com" . "\r\n";
$headers .= "From: ".$name." <".$email.">\r\n";
$sended = mail($to, $subject, $body, $headers);
?>
<html>
<head>
<title>Estimado Representante</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div class="bigone">
<div class="menu clearfix">
<a href="index.html"><h2>Home</h2></a>
<a href="about.html"><h2>About</h2></a>
</div>
<div class="line"></div>
<div class="cta">
<h1>Estimado Representante,</h1>
<h4>
Esta página es dedicada al pueblo puertorriqueño para ejercer nuestro derecho de libertad de expresión <br>y exigir el más alto respeto y cumplimiento a nuestros representantes legislativos. Este canal será una fuente de ideas, uno que fomente la unidad y el progreso, uno que demande fiscalización, responsabilidad, ética, e igualdad.<br>
<br><b>Puertorriqueño</b>, felicita, comenta, y protesta pero siempre con propiedad y respeto. Di lo que ves. Di lo que piensas. La libertad de expresión te lo permite. La democracia te lo pide. Porque todo representante tiene que escuchar para poder cumplir.
</h4>
</div>
<div class="about">
<h5><b>Tu mensaje fue enviado.</b><br>
<br>Si te gustó la página, por favor compártela, y así lograremos que más puertorriqueños se expresen.<br>
<br>Gracias por usar Estimado Representante.</h5>
</div>
</body>
</html>
| efrenpagan/estimadolegislador | jgo.php | PHP | apache-2.0 | 2,041 | [
30522,
1026,
1029,
25718,
20346,
1006,
1000,
4180,
1011,
2828,
1024,
3793,
1013,
16129,
1025,
25869,
13462,
1027,
21183,
2546,
1011,
1022,
1000,
1007,
1025,
1002,
2171,
1027,
1002,
1035,
2695,
1031,
1005,
2034,
1035,
2171,
1005,
1033,
1025,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
#include "test_stl.h"
#include <QSet>
#include <QtTest/QtTest>
#include <vector>
#include <cstring>
#include <cwchar>
#include "../src/utils/stl.h"
void STLTest::testBufferArry() {
using utils::BufferArray;
// constructor
std::string test1("123456789abcdefg");
BufferArray buffer(test1);
QVERIFY(test1.size() + 1 == buffer.size());
QVERIFY(buffer.capacity() == buffer.size());
QVERIFY(strncmp(test1.data(), buffer.data(), test1.size()) == 0);
// operator[]
QVERIFY(test1[0] == '1');
QVERIFY(test1[1] == '2');
QVERIFY(test1[2] == '3');
// reserve
buffer.resize(30);
QVERIFY(buffer.capacity() == 30);
// shrink_to_fit
buffer.shrink_to_fit();
QVERIFY(buffer.capacity() == buffer.size());
// resize
buffer.resize(9);
std::string test2("12345678");
QVERIFY(test2.size() + 1 == buffer.size());
QVERIFY(buffer.capacity() > buffer.size());
QVERIFY(strncmp(test2.data(), buffer.data(), test2.size()) == 0);
// shrink_to_fit
buffer.shrink_to_fit();
QVERIFY(buffer.capacity() == buffer.size());
#ifdef UTILS_CXX11_MODE
// move
std::string test3("gqjdiw913abc_123d");
BufferArray other_buffer(test3);
buffer = std::move(other_buffer);
QVERIFY(test3.size() + 1 == buffer.size());
QVERIFY(buffer.capacity() == buffer.size());
QVERIFY(strncmp(test3.data(), buffer.data(), test3.size()) == 0);
// constructor2
const char test_string[] = "abcdefg";
size_t test_size = sizeof(test_string);
buffer = BufferArray(test_string);
QVERIFY(test_size == buffer.size());
QVERIFY(buffer.capacity() == buffer.size());
QVERIFY(memcmp(test_string, buffer.data(), test_size) == 0);
#endif
}
void STLTest::testWBufferArry() {
using utils::WBufferArray;
// constructor
std::wstring test1(L"123456789abcdefg");
WBufferArray buffer(test1);
QVERIFY(test1.size() + 1 == buffer.size());
QVERIFY(buffer.capacity() == buffer.size());
QVERIFY(wcsncmp(test1.data(), buffer.data(), test1.size()) == 0);
// operator[]
QVERIFY(test1[0] == L'1');
QVERIFY(test1[1] == L'2');
QVERIFY(test1[2] == L'3');
// reserve
buffer.resize(30);
QVERIFY(buffer.capacity() == 30);
// shrink_to_fit
buffer.shrink_to_fit();
QVERIFY(buffer.capacity() == buffer.size());
// resize
buffer.resize(9);
std::wstring test2(L"12345678");
QVERIFY(test2.size() + 1 == buffer.size());
QVERIFY(buffer.capacity() > buffer.size());
QVERIFY(wcsncmp(test2.data(), buffer.data(), test2.size()) == 0);
#ifdef UTILS_CXX11_MODE
// move
std::wstring test3(L"gqjdiw913abc_123d");
WBufferArray other_buffer(test3);
buffer = std::move(other_buffer);
QVERIFY(test3.size() + 1 == buffer.size());
QVERIFY(buffer.capacity() == buffer.size());
QVERIFY(wcsncmp(test3.data(), buffer.data(), test3.size()) == 0);
// constructor2
const wchar_t test_string[] = L"abcdefg";
size_t test_size = sizeof(test_string) / sizeof(wchar_t);
buffer = WBufferArray(test_string);
QVERIFY(test_size == buffer.size());
QVERIFY(buffer.capacity() == buffer.size());
QVERIFY(memcmp(test_string, buffer.data(), test_size) == 0);
#endif
}
QTEST_APPLESS_MAIN(STLTest)
| lucius-feng/seafile-client | tests/test_stl.cpp | C++ | apache-2.0 | 3,120 | [
30522,
1001,
2421,
1000,
3231,
1035,
2358,
2140,
1012,
1044,
1000,
1001,
2421,
1026,
1053,
13462,
1028,
1001,
2421,
1026,
1053,
14581,
2102,
1013,
1053,
14581,
2102,
1028,
1001,
2421,
1026,
9207,
1028,
1001,
2421,
1026,
20116,
18886,
3070,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* Created on Oct 18, 2004
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/
package org.tolweb.tapestry;
import java.util.Collection;
import org.apache.tapestry.BaseComponent;
import org.apache.tapestry.IRequestCycle;
import org.tolweb.hibernate.TitleIllustration;
import org.tolweb.tapestry.injections.BaseInjectable;
import org.tolweb.tapestry.injections.ImageInjectable;
import org.tolweb.treegrow.main.Contributor;
import org.tolweb.treegrow.main.ImageVersion;
import org.tolweb.treegrow.main.NodeImage;
import org.tolweb.treegrow.main.StringUtils;
/**
* @author dmandel
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/
public abstract class TitleIllustrations extends BaseComponent implements
ImageInjectable, BaseInjectable {
@SuppressWarnings("unchecked")
public abstract Collection getIllustrations();
public abstract TitleIllustration getCurrentIllustration();
public abstract void setCurrentIllustration(TitleIllustration value);
public abstract void setIsSingleIllustration(boolean value);
public abstract boolean getIsSingleIllustration();
public abstract int getIndex();
public abstract void setContributor(Contributor contributor);
public String getAltText() {
if (getCurrentIllustration().getImage() != null) {
NodeImage img = getCurrentIllustration().getImage();
if (StringUtils.notEmpty(img.getAltText())) {
return img.getAltText();
} else {
return " ";
}
} else {
return " ";
}
}
public void prepareForRender(IRequestCycle cycle) {
super.prepareForRender(cycle);
if (getIllustrations() != null && getIllustrations().size() == 1) {
setIsSingleIllustration(true);
} else {
setIsSingleIllustration(false);
}
}
public String getCurrentImageLocation() {
TitleIllustration currentIllustration = getCurrentIllustration();
ImageVersion version = currentIllustration.getVersion();
String url;
if (StringUtils.isEmpty(version.getFileName())) {
url = getImageDAO().generateAndSaveVersion(version);
} else {
url = getImageUtils().getVersionUrl(currentIllustration.getVersion());
}
return url;
}
public String getCurrentImageClass() {
if (getIsSingleIllustration()) {
return "singletillus";
} else {
return null;
}
}
}
| tolweb/tolweb-app | OnlineContributors/src/org/tolweb/tapestry/TitleIllustrations.java | Java | bsd-3-clause | 2,683 | [
30522,
1013,
1008,
1008,
2580,
2006,
13323,
2324,
1010,
2432,
1008,
1008,
28681,
2080,
2000,
2689,
1996,
23561,
2005,
2023,
7013,
5371,
2175,
2000,
1008,
3332,
1011,
18394,
1011,
9262,
1011,
3642,
2806,
1011,
3642,
23561,
2015,
1008,
1013,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace DockSample
{
public partial class SplashScreen : Form
{
public SplashScreen()
{
InitializeComponent();
}
}
}
| thijse/dockpanelsuite | DockSample/SplashScreen.cs | C# | mit | 355 | [
30522,
2478,
2291,
1025,
2478,
2291,
1012,
6407,
1012,
12391,
1025,
2478,
2291,
1012,
6922,
5302,
9247,
1025,
2478,
2291,
1012,
2951,
1025,
2478,
2291,
1012,
5059,
1025,
2478,
2291,
1012,
11409,
4160,
1025,
2478,
2291,
1012,
3793,
1025,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
Copyright (C) 2014 Härnösands kommun
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* Action for print using mapfish.
*/
Ext.define('OpenEMap.action.Print', {
extend : 'OpenEMap.action.Action',
require : 'GeoExt.plugins.PrintExtent',
constructor : function(config) {
var mapPanel = config.mapPanel;
var printExtent = mapPanel.plugins[0];
var printProvider = printExtent.printProvider;
printProvider.customParams = {attribution: config.mapPanel.config.attribution.trim(), mapTitle: ''};
var printDialog = null;
var page = null;
var onTransformComplete = function() {
var scale = printDialog.down('#scale');
scale.select(page.scale);
};
var onBeforedownload = function() {
if (printDialog) printDialog.setLoading(false);
};
var onPrintexception = function(printProvider, response) {
if (printDialog) printDialog.setLoading(false);
Ext.Msg.show({
title:'Felmeddelande',
msg: 'Print failed.\n\n' + response.responseText,
icon: Ext.Msg.ERROR
});
};
var close = function() {
printProvider.un('beforedownload', onBeforedownload);
printProvider.on('printexception', onPrintexception);
printExtent.control.events.unregister('transformcomplete', null, onTransformComplete);
printExtent.removePage(page);
printExtent.hide();
printDialog = null;
};
var onClose = function() {
close();
control.deactivate();
};
config.iconCls = config.iconCls || 'action-print';
config.tooltip = config.tooltip || 'Skriv ut';
config.toggleGroup = 'extraTools';
var Custom = OpenLayers.Class(OpenLayers.Control, {
initialize: function(options) {
OpenLayers.Control.prototype.initialize.apply(
this, arguments
);
},
type: OpenLayers.Control.TYPE_TOGGLE,
activate: function() {
if (printDialog) {
return;
}
// NOTE: doing a hide/show at first display fixes interaction problems with preview extent for unknown reasons
printExtent.hide();
printExtent.show();
page = printExtent.addPage();
printProvider.dpis.data.items.forEach(function(d){
var validDpi = false;
if (d.data.name === '72'){
validDpi = true;
d.data.name = 'Låg (' +d.data.name + ' dpi)';
}
else if (d.data.name === '150'){
validDpi = true;
d.data.name = 'Medel (' +d.data.name + ' dpi)';
}
else if (d.data.name === '300'){
validDpi = true;
d.data.name = 'Hög (' +d.data.name + ' dpi)';
}
});
printProvider.layouts.data.items.forEach(function(p){
if (/landscape$/.test(p.data.name)){
p.data.displayName = p.data.name.replace('landscape', 'liggande');
} else if (/portrait$/.test(p.data.name)){
p.data.displayName = p.data.name.replace('portrait', 'stående');
}
});
printDialog = new Ext.Window({
autoHeight : true,
width : 290,
resizable: false,
layout : 'fit',
bodyPadding : '5 5 0',
title: 'Utskriftsinställningar',
listeners: {
close: onClose
},
items : [ {
xtype : 'form',
layout : 'anchor',
defaults : {
anchor : '100%'
},
fieldDefaults : {
labelWidth : 120
},
items : [ {
xtype : 'textfield',
fieldLabel: 'Rubrik',
valueField: 'mapTitle',
itemId : 'mapTitle',
queryMode: 'local',
value: printProvider.customParams.mapTitle,
listeners: {
change: function(textfield){
printProvider.customParams.mapTitle = textfield.value;
}
}
},{
xtype : 'combo',
fieldLabel: 'Pappersformat',
store : printProvider.layouts,
displayField : 'displayName',
valueField : 'name',
itemId : 'printLayouts',
queryMode: 'local',
value : printProvider.layouts.getAt(0).get("name"),
listeners: {
select: function(combo, records, eOpts) {
var record = records[0];
printProvider.setLayout(record);
}
}
}, {
xtype : 'combo',
fieldLabel: 'Kvalité',
store : printProvider.dpis,
displayField : 'name',
valueField : 'value',
queryMode: 'local',
value: printProvider.dpis.first().get("value"),
listeners: {
select: function(combo, records, eOpts) {
var record = records[0];
printProvider.setDpi(record);
}
}
}, {
xtype : 'combo',
fieldLabel: 'Skala',
store : printProvider.scales,
displayField : 'name',
valueField : 'value',
queryMode: 'local',
itemId: 'scale',
value: printProvider.scales.first().get("value"),
listeners: {
select: function(combo, records, eOpts) {
var record = records[0];
page.setScale(record, "m");
}
}
} ]
} ],
bbar : [ '->', {
text : "Skriv ut",
handler : function() {
printDialog.setLoading(true);
printExtent.print();
}
} ]
});
printDialog.show();
var scale = printDialog.down('#scale');
scale.select(page.scale);
var layoutId = 6;
var printLayouts = printDialog.down('#printLayouts');
printLayouts.select(printLayouts.store.data.get(layoutId));
var currentPrintLayout = printLayouts.store.data.items[layoutId];
printProvider.setLayout(currentPrintLayout);
printExtent.control.events.register('transformcomplete', null, onTransformComplete);
printExtent.control.events.register('transformcomplete', null, onTransformComplete);
printProvider.on('beforedownload', onBeforedownload);
printProvider.on('printexception', onPrintexception);
OpenLayers.Control.prototype.activate.apply(this, arguments);
},
deactivate: function() {
if (printDialog) printDialog.close();
OpenLayers.Control.prototype.deactivate.apply(this, arguments);
}
});
var control = new Custom({
type: OpenLayers.Control.TYPE_TOGGLE
});
config.control = control;
this.callParent(arguments);
}
});
| Sundsvallskommun/OpenEMap-WebUserInterface | src/main/javascript/action/Print.js | JavaScript | agpl-3.0 | 9,608 | [
30522,
1013,
1008,
9385,
1006,
1039,
1007,
2297,
5292,
19139,
8791,
5104,
12849,
7382,
4609,
2023,
2565,
2003,
2489,
4007,
1024,
2017,
2064,
2417,
2923,
3089,
8569,
2618,
2009,
1998,
1013,
2030,
19933,
2009,
2104,
1996,
3408,
1997,
1996,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
/**
* Created by PhpStorm.
* User: countzero
* Date: 23.02.14
* Time: 0:31
*/
namespace Wealthbot\RiaBundle\Entity;
use \Symfony\Component\Filesystem\Filesystem;
class AdvisorCodeEventListener
{
private $fs;
public function __construct()
{
$this->fs = new Filesystem();
}
public function createDirectory(AdvisorCode $advisorCode)
{
$filename = self::getIncomingFilesLocation() . $advisorCode->getName();
if (!$this->fs->exists($filename)) {
$this->fs->mkdir($filename, 0777);
}
}
public static function getIncomingFilesLocation()
{
return __DIR__ . '/../../../../system/incoming_files/';
}
}
| AlphaStaxLLC/wealthbot | src/Wealthbot/RiaBundle/Entity/AdvisorCodeEventListener.php | PHP | gpl-2.0 | 702 | [
30522,
1026,
1029,
25718,
1013,
1008,
1008,
1008,
2580,
2011,
25718,
19718,
1012,
1008,
5310,
1024,
4175,
6290,
2080,
1008,
3058,
1024,
2603,
1012,
6185,
1012,
2403,
1008,
2051,
1024,
1014,
1024,
2861,
1008,
1013,
3415,
15327,
7177,
18384,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package lsh.ext.gson.adapters;
import java.io.IOException;
import java.util.Date;
import com.google.gson.TypeAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import lombok.AccessLevel;
import lombok.RequiredArgsConstructor;
/**
* Represents the epoch to {@link Date} and vice versa type adapter.
*
* @author Lyubomyr Shaydariv
*/
@RequiredArgsConstructor(access = AccessLevel.PRIVATE)
public final class EpochDateTypeAdapter
extends TypeAdapter<Date> {
private static final TypeAdapter<Date> instance = new EpochDateTypeAdapter()
.nullSafe();
/**
* @return An instance of {@link EpochDateTypeAdapter}.
*/
public static TypeAdapter<Date> getInstance() {
return instance;
}
@Override
public Date read(final JsonReader in)
throws IOException {
return new Date(in.nextLong() * 1000);
}
@Override
public void write(final JsonWriter out, final Date value)
throws IOException {
out.value(value.getTime() / 1000);
}
}
| lyubomyr-shaydariv/ext-gson | src/main/java/lsh/ext/gson/adapters/EpochDateTypeAdapter.java | Java | apache-2.0 | 997 | [
30522,
7427,
1048,
4095,
1012,
4654,
2102,
1012,
28177,
2239,
1012,
15581,
2545,
1025,
12324,
9262,
1012,
22834,
1012,
22834,
10288,
24422,
1025,
12324,
9262,
1012,
21183,
4014,
1012,
3058,
1025,
12324,
4012,
1012,
8224,
1012,
28177,
2239,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/**
* Copyright 2011-2017 Asakusa Framework Team.
*
* 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 com.asakusafw.testdriver.rule;
import java.math.BigDecimal;
import java.text.MessageFormat;
/**
* Accepts iff actual decimal is in [ expected + lower-bound, expected + upper-bound ].
* @since 0.2.0
*/
public class DecimalRange implements ValuePredicate<BigDecimal> {
private final BigDecimal lowerBound;
private final BigDecimal upperBound;
/**
* Creates a new instance.
* @param lowerBound lower bound offset from expected value
* @param upperBound upper bound offset from expected value
*/
public DecimalRange(BigDecimal lowerBound, BigDecimal upperBound) {
this.lowerBound = lowerBound;
this.upperBound = upperBound;
}
@Override
public boolean accepts(BigDecimal expected, BigDecimal actual) {
if (expected == null || actual == null) {
throw new IllegalArgumentException();
}
return expected.add(lowerBound).compareTo(actual) <= 0
&& actual.compareTo(expected.add(upperBound)) <= 0;
}
@Override
public String describeExpected(BigDecimal expected, BigDecimal actual) {
if (expected == null) {
return "(error)"; //$NON-NLS-1$
}
return MessageFormat.format(
"{0} ~ {1}", //$NON-NLS-1$
Util.format(expected.add(lowerBound)),
Util.format(expected.add(upperBound)));
}
}
| cocoatomo/asakusafw | testing-project/asakusa-test-moderator/src/main/java/com/asakusafw/testdriver/rule/DecimalRange.java | Java | apache-2.0 | 2,011 | [
30522,
1013,
1008,
1008,
1008,
9385,
2249,
1011,
2418,
17306,
22332,
2050,
7705,
2136,
1012,
1008,
1008,
7000,
2104,
1996,
15895,
6105,
1010,
2544,
1016,
1012,
1014,
1006,
1996,
1000,
6105,
1000,
1007,
1025,
1008,
2017,
2089,
2025,
2224,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!DOCTYPE html>
<html lang="en-gb" dir="ltr">
<head>
<meta charset="utf-8">
<meta name="robots" content="noindex, nofollow">
<title>Change password - My Site | Textpattern CMS</title>
<script src="../docs/assets/js/jquery.js"></script>
<script src="../docs/assets/js/jquery-ui.js"></script>
<link rel="stylesheet" href="../dist/hive/assets/css/textpattern.css">
<link rel="alternate stylesheet" title="Hive (Flat Neutral)" href="../dist/hiveneutral/assets/css/textpattern.css">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<meta name="generator" content="Textpattern CMS">
<script defer src="../dist/hive/assets/js/main.js"></script>
<script defer src="../dist/hive/assets/js/autosize.js"></script>
<script src="../docs/assets/js/design-patterns.js"></script>
</head>
<body class="login" id="page-login">
<noscript>Please enable JavaScript in your browser to use this application.</noscript>
<a class="txp-skip-link" href="#txp-main">Go to content</a>
<script src="../dist/hive/assets/js/darkmode.js"></script>
<header class="txp-header">
<h1>Textpattern</h1>
</header><!-- /txp-header -->
<main id="txp-main" class="txp-body">
<div class="messagepane" id="messagepane"></div>
<form class="txp-login" id="login_form" method="post" action="login.html">
<h1 id="txp-login-heading">Change password</h1>
<div class="txp-form-field change-password">
<div class="txp-form-field-label"><label for="change_password">Change password</label></div>
<div class="txp-form-field-value">
<input class="txp-maskable" id="change_password" name="p_password" type="password" size="32" autocomplete="new-password">
<div class="show-password">
<input class="checkbox" id="show_password" name="unmask" type="checkbox" value="1">
<label for="show_password">Show password</label>
</div>
</div>
</div>
<p class="login-button">
<input class="publish" type="submit" value="Confirm password change">
</p>
<p class="login-return"><a href="login.html">Back to Textpattern log in</a></p>
</form>
</main><!-- /txp-body -->
</body>
</html>
| philwareham/txp-hive-admin-theme | mockups/new-password.html | HTML | gpl-2.0 | 2,416 | [
30522,
1026,
999,
9986,
13874,
16129,
1028,
1026,
16129,
11374,
1027,
1000,
4372,
1011,
16351,
1000,
16101,
1027,
1000,
8318,
2099,
1000,
1028,
1026,
2132,
1028,
1026,
18804,
25869,
13462,
1027,
1000,
21183,
2546,
1011,
1022,
1000,
1028,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!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_18) on Fri Apr 06 23:09:09 CEST 2012 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
Uses of Class com.googlecode.fspotcloud.peer.ImageData (F-Spot Cloud Java Edition 0.12-beta API)
</TITLE>
<META NAME="date" CONTENT="2012-04-06">
<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 com.googlecode.fspotcloud.peer.ImageData (F-Spot Cloud Java Edition 0.12-beta 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> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../com/googlecode/fspotcloud/peer/ImageData.html" title="class in com.googlecode.fspotcloud.peer"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?com/googlecode/fspotcloud/peer//class-useImageData.html" target="_top"><B>FRAMES</B></A>
<A HREF="ImageData.html" target="_top"><B>NO FRAMES</B></A>
<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>com.googlecode.fspotcloud.peer.ImageData</B></H2>
</CENTER>
No usage of com.googlecode.fspotcloud.peer.ImageData
<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> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../com/googlecode/fspotcloud/peer/ImageData.html" title="class in com.googlecode.fspotcloud.peer"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?com/googlecode/fspotcloud/peer//class-useImageData.html" target="_top"><B>FRAMES</B></A>
<A HREF="ImageData.html" target="_top"><B>NO FRAMES</B></A>
<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 © 2012. All Rights Reserved.
</BODY>
</HTML>
| slspeek/FSpotCloudSite | apidocs/com/googlecode/fspotcloud/peer/class-use/ImageData.html | HTML | gpl-3.0 | 6,120 | [
30522,
1026,
999,
9986,
13874,
16129,
2270,
1000,
1011,
1013,
1013,
1059,
2509,
2278,
1013,
1013,
26718,
2094,
16129,
1018,
1012,
5890,
17459,
1013,
1013,
4372,
1000,
1000,
8299,
1024,
1013,
1013,
7479,
1012,
1059,
2509,
1012,
8917,
1013,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package de.metas.inoutcandidate.modelvalidator;
/*
* #%L
* de.metas.swat.base
* %%
* Copyright (C) 2015 metas GmbH
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-2.0.html>.
* #L%
*/
import org.adempiere.ad.modelvalidator.annotations.ModelChange;
import org.adempiere.ad.modelvalidator.annotations.Validator;
import org.compiere.model.I_M_InOutLine;
import org.compiere.model.ModelValidator;
@Validator(I_M_InOutLine.class)
public class M_InOutLine_Shipment
{
@ModelChange(
timings = { ModelValidator.TYPE_AFTER_CHANGE, ModelValidator.TYPE_AFTER_DELETE, ModelValidator.TYPE_AFTER_NEW },
ifColumnsChanged = I_M_InOutLine.COLUMNNAME_MovementQty)
public void onMovementQtyChange(final I_M_InOutLine inOutLine)
{
// All code from here was moved to de.metas.handlingunits.model.validator.M_InOutLine.onMovementQtyChange(I_M_InOutLine)
// because we need to be aware if this is about HUs or not....
// TODO: implement a generic approach is applies the algorithm without actually going through HUs stuff
}
}
| klst-com/metasfresh | de.metas.swat/de.metas.swat.base/src/main/java/de/metas/inoutcandidate/modelvalidator/M_InOutLine_Shipment.java | Java | gpl-2.0 | 1,640 | [
30522,
7427,
2139,
1012,
18804,
2015,
1012,
1999,
5833,
9336,
4305,
13701,
1012,
2944,
10175,
8524,
4263,
1025,
1013,
1008,
1008,
1001,
1003,
1048,
1008,
2139,
1012,
18804,
2015,
1012,
25414,
1012,
2918,
1008,
1003,
1003,
1008,
9385,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
/*
*
* Theme Colour Scheme Functions
* ------------------------------------------------
* Swift Framework
* Copyright Swift Ideas 2014 - http://www.swiftideas.net
*
*/
// create an array to contain current values in the theme customizer
$sf_customize_item_array = array(
'accent_color',
'accent_alt_color',
'secondary_accent_color',
'secondary_accent_alt_color',
'page_bg_color',
'inner_page_bg_color',
'section_divide_color',
'alt_bg_color',
'topbar_bg_color',
'topbar_text_color',
'topbar_link_color',
'topbar_link_hover_color',
'topbar_divider_color',
'header_bg_color1',
'header_bg_color2',
'nav_text_color',
'nav_text_hover_color',
'nav_selected_text_color',
'nav_pointer_color',
'nav_sm_bg_color',
'nav_sm_text_color',
'nav_sm_bg_hover_color',
'nav_sm_text_hover_color',
'nav_sm_selected_text_color',
'nav_divider',
'nav_divider_color',
'promo_bar_bg_color',
'promo_bar_text_color',
'page_heading_bg_color',
'page_heading_text_color',
'breadcrumb_text_color',
'breadcrumb_link_color',
'body_color',
'link_color',
'h1_color',
'h2_color',
'h3_color',
'h4_color',
'h5_color',
'h6_color',
'impact_text_color',
'pt_primary_bg_color',
'pt_secondary_bg_color',
'pt_tertiary_bg_color',
'lpt_primary_row_color',
'lpt_secondary_row_color',
'lpt_default_pricing_header',
'lpt_default_package_header',
'lpt_default_footer',
'icon_container_bg_color',
'sf_icon_color',
'boxed_content_color',
'footer_bg_color',
'footer_text_color',
'footer_border_color',
'copyright_bg_color',
'copyright_text_color',
'copyright_link_color'
);
$sf_customize_item_array = array(
array ( 'accent_color' => 'Accent Color' ),
array ( 'accent_alt_color' => 'Accent Alt Color' ),
array ( 'secondary_accent_color' => 'Secondary Accent Color' ),
array ( 'secondary_accent_alt_color' => 'Secondary Accent Alt Color' ),
array ( 'page_bg_color' => 'Page Background Color' ),
array ( 'inner_page_bg_color' => 'Inner Page Background Color' ),
array ( 'section_divide_color' => 'Section Divide Color' ),
array ( 'alt_bg_color' => 'Alt Background Color' ),
array ( 'topbar_bg_color' => 'Top Bar Background Color' ),
array ( 'topbar_text_color' => 'Top Bar Text Color' ),
array ( 'topbar_link_color' => 'Top Bar Link Color' ),
array ( 'topbar_link_hover_color' => 'Top Bar Link Hover Color' ),
array ( 'topbar_divider_color' => 'Top Bar Divider Color' ),
array ( 'header_bg_color1' => 'Header BG Color' ),
array ( 'header_bg_color2' => 'Header BG Color2' ),
array ( 'nav_text_color' => 'Nav Text Color' ),
array ( 'nav_text_hover_color' => 'Nav Text Hover Color' ),
array ( 'nav_selected_text_color' => 'Nav Selected Text Color' ),
array ( 'nav_pointer_color' => 'Nav Pointer Color' ),
array ( 'nav_sm_bg_color' => 'Nav Sub Menu BG Color' ),
array ( 'nav_sm_text_color' => 'Nav Sub Menu Text Color' ),
array ( 'nav_sm_bg_hover_color' => 'Nav Sub Menu BG Hover Color' ),
array ( 'nav_sm_text_hover_color' => 'Nav Sub Menu Text Hover Color' ),
array ( 'nav_sm_selected_text_color' => 'Nav Sub Menu Selected Text Color' ),
array ( 'nav_divider' => 'Nav Divider' ),
array ( 'nav_divider_color' => 'Nav Divider Color' ),
array ( 'promo_bar_bg_color' => 'Promo Bar BG Color' ),
array ( 'promo_bar_text_color' => 'Promo Bar Text Color' ),
array ( 'page_heading_bg_color' => 'Page Heading BG Color' ),
array ( 'page_heading_text_color' => 'Page Heading Text Color' ),
array ( 'breadcrumb_text_color' => 'Breadcrumb Text Color' ),
array ( 'breadcrumb_link_color' => 'Breadcrumb Link Color' ),
array ( 'body_color' => 'Body Color' ),
array ( 'link_color' => 'Link Color' ),
array ( 'h1_color' => 'H1 Color' ),
array ( 'h2_color' => 'H2 Color' ),
array ( 'h3_color' => 'H3 Color' ),
array ( 'h4_color' => 'H4 Color' ),
array ( 'h5_color' => 'H5 Color' ),
array ( 'h6_color' => 'H6 Color' ),
array ( 'impact_text_color' => 'Impact Txt Color' ),
array ( 'pt_primary_bg_color' => 'Primary BG Color' ),
array ( 'pt_secondary_bg_color' => 'Secondary BG Color' ),
array ( 'pt_tertiary_bg_color' => 'Tertiary BG Color' ),
array ( 'lpt_primary_row_color' => 'Primary Row Color' ),
array ( 'lpt_secondary_row_color' => 'Secondary Row Color' ),
array ( 'lpt_default_pricing_header' => 'Default Pricing Header' ),
array ( 'lpt_default_package_header' => 'Default Package Header' ),
array ( 'lpt_default_footer' => 'Default Footer' ),
array ( 'icon_container_bg_color' => 'Icon BG Color' ),
array ( 'sf_icon_color' => 'Icon Color' ),
array ( 'boxed_content_color' => 'Boxed Content Color' ),
array ( 'footer_bg_color' => 'Footer BG Color' ),
array ( 'footer_text_color' => 'Footer Text Color' ),
array ( 'footer_border_color' => 'Footer Border Color' ),
array ( 'copyright_bg_color' => '© BG Color' ),
array ( 'copyright_text_color' => '© Text Color' ),
array ( 'copyright_link_color' => '© Link Color' )
);
function sf_get_current_color_scheme_id() {
$sf_dante_options = get_option ( 'sf_dante_options' );
if ( isset( $sf_dante_options['colour_scheme_select_scheme'] ) ) {
return $sf_dante_options['colour_scheme_select_scheme'];
} else {
return 0;
}
}
function sf_get_schema_info($schema_id) {
global $sf_customize_item_array;
if ( $schema_id ) {
$schemas = get_option ( 'sf_dante_options_schemes_saved' );
if ($schemas) {
foreach ($schemas as $schema) {
if ( $schema['color_scheme_name'] == $schema_id ) { // found the right schema
return $schema;
}
}
} // schemas
}
}
function sf_get_color_scheme_list( $extra = true ) {
$schemas = get_option ( 'sf_dante_options_schemes_saved' );
$dropdown_values = array();
if ($schemas) {
foreach ($schemas as $schema) {
if ( isset($schema['color_scheme_name']) ) {
$dropdown_values[$schema['color_scheme_name']] = $schema['color_scheme_name'];
}
}
}
if ( !empty($dropdown_values) ) {
asort($dropdown_values); // sort by ABC
}
if ( $extra ) {
$dropdown_values = array('' => '--- Current Values ---') + $dropdown_values;
// $dropdown_values = array('' => '') + $dropdown_values;
}
return $dropdown_values;
}
function sf_add_schema($schema_array = array()) {
global $sf_customize_item_array;
$newSchema = array();
if (!empty($schema_array)) {
foreach ($schema_array as $schema ) {
if (strtolower($schema['Setting Name']) == "color scheme name") {
//echo $schema['Setting Value'] .'-sssssss';
if ( isset($schema['Setting Value'])) {
$newSchema['color_scheme_name'] = $schema['Setting Value'];
$newSchemaName = $schema['Setting Value'];
}
} else {
// cycle throught the items
foreach ( $sf_customize_item_array as $sf_customize_id => $sf_customize_data ) {
if ( $schema['Setting Name'] == key($sf_customize_data) && isset($schema['Setting Value']) ) {
$newSchema[key($sf_customize_data)] = $schema['Setting Value'];
}
}
}
}
$schemas = get_option ( 'sf_dante_options_schemes_saved' ); // get list of schemas
if ( $newSchema && !empty($newSchema) ) {
$schemas[$newSchemaName] = $newSchema; // add new schema that list
}
update_option ( 'sf_dante_options_schemes_saved', $schemas );
}
} // sf_add_schema
function sf_delete_schema_ajax() {
$schema_id = $_REQUEST['schema_id'];
if ( $schema_id ) {
$schemas = get_option ( 'sf_dante_options_schemes_saved' ); // get list of schemas
if ( isset ( $schemas[$schema_id] ) ) {
unset ( $schemas[$schema_id] );
update_option ( 'sf_dante_options_schemes_saved', $schemas );
echo "success";
} else {
echo "failed";
}
} else {
echo "failed";
}
die();
}
add_action("wp_ajax_sf_delete_schema_ajax", "sf_delete_schema_ajax");
add_action("wp_ajax_nopriv_sf_delete_schema_ajax", "sf_delete_schema_ajax");
function sf_add_schema_ajax() {
$file_url = $_REQUEST['file_url'];
$file_id = $_REQUEST['file_id'];
if ($file_id) {
$url = wp_get_attachment_url( $file_id );
$uploads = wp_upload_dir();
$file_path = str_replace( $uploads['baseurl'], $uploads['basedir'], $url );
require_once (SF_INCLUDES_PATH . '/sf-colour-scheme/File_CSV_DataSource/DataSource.php');
$time_start = microtime(true);
$csv = new File_CSV_DataSource;
sf_stripBOM($file_path);
if (!$csv->load($file_path)) {
echo 'Failed to load file, aborting.';
// $this->print_messages();
die();
}
$skipped = 0;
$csv_array = array();
foreach ($csv->connect() as $csv_data) {
$csv_array[] = $csv_data;
}
// add new schema from csv data
sf_add_schema ( $csv_array );
// return back a list of schemes to populate the select box via ajax
echo sf_get_schema_select_html();
die();
}
die();
}
add_action("wp_ajax_sf_add_schema_ajax", "sf_add_schema_ajax");
add_action("wp_ajax_nopriv_sf_add_schema_ajax", "sf_add_schema_ajax");
function sf_use_schema_ajax() {
global $sf_customize_item_array;
$schema_id = $_REQUEST['schema_id'];
if ( $schema_id ) {
$schema_info = sf_get_schema_info ( $schema_id );
if ( !empty($schema_info) ) {
foreach ($schema_info as $key => $value) {
// don't update or add the name, or any element not in the official array
// print_r($sf_customize_item_array);
foreach ( $sf_customize_item_array as $item) {
if ( isset($item[$key]) ) {
update_option ( $key, $value );
$success = true;
}
}
}
if ( $success) { echo "success"; }
}
// print_r ($schema_info);
} else {
echo "failed";
}
die();
}
add_action("wp_ajax_sf_use_schema_ajax", "sf_use_schema_ajax");
add_action("wp_ajax_nopriv_sf_use_schema_ajax", "sf_use_schema_ajax");
function sf_save_schema_ajax() {
global $sf_customize_item_array;
$schema_name = $_REQUEST['schema_name'];
$new_schema = array();
if ( $schema_name ) {
// ok, so let's loop through all the saved values and add them to an array
$new_schema['color_scheme_name'] = $schema_name;
foreach ( $sf_customize_item_array as $item) {
$new_schema[key($item)] = get_option ( key($item) );
}
// print_r ($new_schema);
// let's save this array, similar to importing
$schemas = get_option ( 'sf_dante_options_schemes_saved' ); // get list of schemas
// print_r ($schemas);
$schemas[$schema_name] = $new_schema; // add new schema that list
// print_r ($schemas); exit;
update_option ( 'sf_dante_options_schemes_saved', $schemas );
// return back a list of schemes to populate the select box via ajax
echo sf_get_schema_select_html();
}
die();
}
add_action("wp_ajax_sf_save_schema_ajax", "sf_save_schema_ajax");
add_action("wp_ajax_nopriv_sf_save_schema_ajax", "sf_save_schema_ajax");
// delete BOM from UTF-8 file
function sf_stripBOM($fname) {
$res = fopen($fname, 'rb');
if (false !== $res) {
$bytes = fread($res, 3);
if ($bytes == pack('CCC', 0xef, 0xbb, 0xbf)) {
$this->log['notice'][] = 'Getting rid of byte order mark...';
fclose($res);
$contents = file_get_contents($fname);
if (false === $contents) {
trigger_error('Failed to get file contents.', E_USER_WARNING);
}
$contents = substr($contents, 3);
$success = file_put_contents($fname, $contents);
if (false === $success) {
trigger_error('Failed to put file contents.', E_USER_WARNING);
}
} else {
fclose($res);
}
} else {
$this->log['error'][] = 'Failed to open file, aborting.';
}
}
function sf_get_schema_select_html() {
global $sf_customize_item_array;
$schemas_array = get_option ( 'sf_dante_options_schemes_saved' );
$html = '<select name="sf_dante_options[colour_scheme_select_scheme]" id="colour_scheme_select_scheme"> ';
$dropdown_values = sf_get_color_scheme_list();
foreach ( $dropdown_values as $dropdown_key => $dropdown_value ) {
$html .= '<option value="'.$dropdown_key.'">'.$dropdown_value.'</option>';
}
$html .= '</select>';
return $html;
} // sf_get_schema_select_html
function sf_get_schema_html_ajax() {
$schema_id = $_POST['schema_id'];
$html = sf_get_current_color_scheme_html_preview ( $schema_id );
echo $html;
die();
}
add_action("wp_ajax_sf_get_schema_html_ajax", "sf_get_schema_html_ajax");
add_action("wp_ajax_nopriv_sf_get_schema_html_ajax", "sf_get_schema_html_ajax");
function sf_is_current_color_settings_empty () {
global $sf_customize_item_array;
$values = 0;
if (!empty($sf_customize_item_array)) {
foreach ( $sf_customize_item_array as $setting ) {
if ( get_option(key($setting)) ) {
$values++;
}
}
}
if ( $values == 0) {
return true;
} else {
return false;
}
}
function sf_get_current_color_scheme_html_preview( $schema_id = false ) {
global $sf_customize_item_array;
// echo "++++".$schema_id;
if ( !$schema_id ) {
$schema_id = sf_get_current_color_scheme_id();
}
$schemas_array = get_option ( 'sf_dante_options_schemes_saved' );
$html = "<ul id=\"sf_dante_options-color-list\" class=\"color-list\">";
if ( !$schema_id || $schema_id == "0" ) {
// a scheme has not been selected, so we take from current values
$values = 0;
if (!empty($sf_customize_item_array)) {
foreach ( $sf_customize_item_array as $setting ) {
if ( get_option(key($setting)) ) {
$html .= '<li style="width: 50px; line-height: 11px; text-align: center; float: left; margin: 5px; height: 95px; ">';
$html .= '<div style="width: 40px; height: 40px; margin: 0 auto 10px auto; background-color:'.get_option(key($setting)).';border:1px solid #e3e3e3;"></div>';
$html .= '<label style="font-size: 10px; text-align: center;">'.reset($setting).'</label>';
$html .= '</li>';
$values++;
}
}
}
if ( $values == 0) {
$html .= '<li><strong>'.__('No saved values exist yet', 'swift-framework-admin').'</strong><br/>'.__('Go to the theme customizer to save your colour options.', 'swift-framework-admin').'</li>';
}
} else {
//echo sf_get_current_color_scheme_id();
foreach ($schemas_array as $key => $schema) {
if ( $key == $schema_id ) {
foreach ( $sf_customize_item_array as $setting ) {
$html .= '<li style="width: 50px; line-height: 11px; text-align: center; float: left; margin: 5px; height: 95px; ">';
$html .= '<div style="width: 40px; height: 40px; margin: 0 auto 10px auto; background-color:'.$schema[key($setting)].';border:1px solid #e3e3e3;"></div>';
$html .= '<label style="font-size: 10px; text-align: center;">'.reset($setting).'</label>';
$html .= '</li>';
}
}
}
}
$html .= "</ul>";
if (!empty($html)) { return $html; }
}
function sf_export_color_scheme_html() {
global $sf_customize_item_array;
$html = '<p><input type="text" maxlength="20" name="sf-export-scheme-name" id="sf-export-scheme-name" placeholder="Name The Schema" />';
$export_link = sf_create_export_download_link('url');
$html .= '<a class="button-primary" id="sf-export-scheme-dl" href="'.$export_link.'">Download CSV</a></p>';
return $html;
}
function sf_download_file($content = null, $file_name = null) {
global $sf_customize_item_array;
if (! wp_verify_nonce($_REQUEST['nonce'], 'sf_dante_options_schema_action') )
wp_die('Security check');
// here you get the options to export and set it as content, ex:
// Establish color scheme name and filename
if ( isset($_REQUEST['file_name']) ) {
$file_name = $_REQUEST['file_name'].'.csv';
$scheme_name = $_REQUEST['file_name'];
} else {
$file_name = 'schema.csv';
$scheme_name = "schema";
}
$content = "Setting Name,Setting Value"."\r\n";
$content .= "Color Scheme Name,".$scheme_name."\r\n";
foreach ( $sf_customize_item_array as $item ) {
$key = key($item);
$exportable_options[$key] = get_option( $key );
}
foreach ( $exportable_options as $option_label => $option_value ) {
$content .= $option_label.",".$option_value."\r\n";
}
header('HTTP/1.1 200 OK');
if ( !current_user_can('edit_theme_options') ) {
wp_die('<p>'.__('You do not have sufficient permissions to edit templates for this site.').'</p>');
}
if ($content === null || $file_name === null){
wp_die('<p>'.__('Error Downloading file.').'</p>');
}
$sf_dante_options = get_option ( 'sf_dante_options' );
$fsize = strlen($content);
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header('Content-Description: File Transfer');
header("Content-Disposition: attachment; filename=" . $file_name);
header("Content-Length: ".$fsize);
header("Expires: 0");
header("Pragma: public");
echo $content;
exit;
}
function sf_create_export_download_link($echo = false){
$site_url = home_url();
$args = array(
'sf_dante_options_schema_action' => 'export_schema',
'nonce' => wp_create_nonce('sf_dante_options_schema_action')
);
$export_url = esc_url( add_query_arg($args, $site_url) );
if ($echo === true)
echo $export_url;
elseif ($echo == 'url')
return $export_url;
}
function sf_add_query_var_vars() {
global $wp;
$wp->add_query_var('sf_dante_options_schema_action');
}
//then add a template redirect which looks for that query var and if found calls the download function
function sf_admin_redirect_download_files(){
global $wp;
global $wp_query;
//download theme export
if (array_key_exists('sf_dante_options_schema_action', $wp->query_vars) && $wp->query_vars['sf_dante_options_schema_action'] == 'export_schema') {
sf_download_file();
die();
} else if (array_key_exists('sf_dante_options_schema_action', $wp->query_vars) && $wp->query_vars['sf_dante_options_schema_action'] == 'import_scheme') {
// db_import_scheme();
die();
}
}
//add hooks for these functions
add_action('template_redirect', 'sf_admin_redirect_download_files');
add_filter('init', 'sf_add_query_var_vars');
| antoninab/wordpress-dante | wp-content/themes/dante/includes/sf-colour-scheme.php | PHP | gpl-2.0 | 19,726 | [
30522,
1026,
1029,
25718,
1013,
1008,
1008,
1008,
4323,
6120,
5679,
4972,
1008,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
/**
* @group DB
* @internal
* @copyright (c) 2012 Codestruck, LLC.
* @license http://opensource.org/licenses/mit-license.php/
*/
class Octopus_DB_LiveSelectJoin_Test extends PHPUnit_Framework_TestCase
{
public function __construct()
{
$this->db = Octopus_DB::singleton();
$sql = "DROP TABLE IF EXISTS apples";
$this->db->query($sql);
$sql = "DROP TABLE IF EXISTS bananas";
$this->db->query($sql);
$sql = "DROP TABLE IF EXISTS carrots";
$this->db->query($sql);
$sql = "CREATE TABLE apples (
`apple_id` INT( 10 ) NOT NULL AUTO_INCREMENT PRIMARY KEY,
`apple_name` VARCHAR( 128 ) NOT NULL,
`apple_foo` VARCHAR( 128 ) NOT NULL
)
";
$this->db->query($sql);
$sql = "CREATE TABLE bananas (
`banana_id` INT( 10 ) NOT NULL AUTO_INCREMENT PRIMARY KEY,
`apple_id` INT( 10 ) NOT NULL,
`banana_name` VARCHAR( 128 ) NOT NULL,
`banana_foo` VARCHAR( 128 ) NOT NULL
)
";
$this->db->query($sql);
$sql = "CREATE TABLE carrots (
`carrot_id` INT( 10 ) NOT NULL AUTO_INCREMENT PRIMARY KEY,
`apple_id` INT( 10 ) NOT NULL,
`carrot_name` VARCHAR( 128 ) NOT NULL
)
";
$this->db->query($sql);
}
function setUp()
{
$i = new Octopus_DB_Insert();
$i->table('apples');
$i->set('apple_name', 'aoeu');
$i->execute();
$apple_id = $i->getId();
$i = new Octopus_DB_Insert();
$i->table('bananas');
$i->set('banana_name', 'ba');
$i->set('apple_id', $apple_id);
$i->execute();
$i = new Octopus_DB_Insert();
$i->table('bananas');
$i->set('banana_name', 'no apple');
$i->execute();
}
function tearDown()
{
$sql = "TRUNCATE TABLE apples";
$this->db->query($sql);
$sql = "TRUNCATE TABLE bananas";
$this->db->query($sql);
$sql = "TRUNCATE TABLE carrots";
$this->db->query($sql);
}
function testJoin()
{
$s = new Octopus_DB_Select();
$s->table(array('bananas', 'b'));
$s->leftJoin(array('apples', 'a'), 'apple_id');
$query = $s->query();
$this->assertEquals(2, $query->numRows());
$s = new Octopus_DB_Select();
$s->table(array('bananas', 'b'));
$s->innerJoin(array('apples', 'a'), 'apple_id');
$query = $s->query();
$this->assertEquals(1, $query->numRows());
}
function testJoinFields()
{
$s = new Octopus_DB_Select();
$s->table(array('bananas', 'b'));
$s->leftJoin(array('apples', 'a'), 'apple_id', array('apple_name'));
$query = $s->query();
$this->assertEquals(2, $query->numRows());
$all = $s->fetchAll();
$row = $all[0];
$this->assertEquals(5, count($row));
$this->assertArrayHasKey('banana_id', $row);
$this->assertArrayHasKey('banana_name', $row);
$this->assertArrayHasKey('banana_foo', $row);
$this->assertArrayHasKey('apple_id', $row);
$this->assertArrayHasKey('apple_name', $row);
$s = new Octopus_DB_Select();
$s->table(array('bananas', 'b'), array('banana_name'));
$s->innerJoin(array('apples', 'a'), array('apple_id'), array('apple_name'));
$query = $s->query();
$this->assertEquals(1, $query->numRows());
$row = $s->fetchRow();
$this->assertEquals(2, count($row));
$this->assertArrayHasKey('banana_name', $row);
$this->assertArrayHasKey('apple_name', $row);
$s = new Octopus_DB_Select();
$s->table(array('bananas', 'b'), array('banana_name'));
$s->innerJoin(array('apples', 'a'), 'apple_id');
$query = $s->query();
$this->assertEquals(1, $query->numRows());
$row = $s->fetchRow();
$this->assertEquals(4, count($row));
$this->assertArrayHasKey('banana_name', $row);
$this->assertArrayHasKey('apple_id', $row);
$this->assertArrayHasKey('apple_name', $row);
$this->assertArrayHasKey('apple_foo', $row);
}
function testJoinRunFunction()
{
$s = new Octopus_DB_Select();
$s->table('a', array('cat_id', 'name'));
$s->leftJoin('b', 'cat_id', array('article_id'));
$s->runFunction('count', 'b', array('article_id', 'count'));
$sql = 'SELECT a.cat_id, a.name, COUNT(b.article_id) AS count FROM a LEFT JOIN b USING (cat_id)';
$this->assertEquals($sql, $s->getSql());
}
}
?>
| codestruck/octopus | tests/db/LiveSelectJoinTest.php | PHP | mit | 4,499 | [
30522,
1026,
1029,
25718,
1013,
1008,
1008,
1008,
1030,
2177,
16962,
1008,
1030,
4722,
1008,
1030,
9385,
1006,
1039,
1007,
2262,
30524,
1008,
1013,
2465,
24318,
1035,
16962,
1035,
3268,
12260,
6593,
5558,
2378,
1035,
3231,
8908,
25718,
1949... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
// Generated from /POI/java/org/apache/poi/hpsf/VariantBool.java
#pragma once
#include <fwd-POI.hpp>
#include <org/apache/poi/hpsf/fwd-POI.hpp>
#include <org/apache/poi/util/fwd-POI.hpp>
#include <java/lang/Object.hpp>
struct default_init_tag;
class poi::hpsf::VariantBool
: public virtual ::java::lang::Object
{
public:
typedef ::java::lang::Object super;
private:
static ::poi::util::POILogger* LOG_;
public: /* package */
static constexpr int32_t SIZE { int32_t(2) };
private:
bool _value { };
protected:
void ctor();
public: /* package */
virtual void read(::poi::util::LittleEndianByteArrayInputStream* lei);
virtual bool getValue();
virtual void setValue(bool value);
// Generated
VariantBool();
protected:
VariantBool(const ::default_init_tag&);
public:
static ::java::lang::Class *class_();
static void clinit();
private:
static ::poi::util::POILogger*& LOG();
virtual ::java::lang::Class* getClass0();
};
| pebble2015/cpoi | src/org/apache/poi/hpsf/VariantBool.hpp | C++ | apache-2.0 | 992 | [
30522,
1013,
1013,
7013,
2013,
1013,
13433,
2072,
1013,
9262,
1013,
8917,
1013,
15895,
1013,
13433,
2072,
1013,
6522,
22747,
1013,
8349,
5092,
4747,
1012,
9262,
1001,
10975,
8490,
2863,
2320,
1001,
2421,
1026,
1042,
21724,
1011,
13433,
2072... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package book.util;
import java.io.*;
import java.util.*;
public class MiscUtil {
public static boolean hasDuplicates(Vector v) {
int i = 0;
int j = 0;
boolean duplicates = false;
for (i = 0; i < v.size() - 1; i++) {
for (j = (i + 1); j < v.size(); j++) {
if (v.elementAt(i).toString().equalsIgnoreCase(
v.elementAt(j).toString())) {
duplicates = true;
}
}
}
return duplicates;
}
public static Vector removeDuplicates(Vector s) {
int i = 0;
int j = 0;
boolean duplicates = false;
Vector v = new Vector();
for (i = 0; i < s.size(); i++) {
duplicates = false;
for (j = (i + 1); j < s.size(); j++) {
if (s.elementAt(i).toString().equalsIgnoreCase(
s.elementAt(j).toString())) {
duplicates = true;
}
}
if (duplicates == false) {
v.addElement(s.elementAt(i).toString().trim());
}
}
return v;
}
public static Vector removeDuplicateDomains(Vector s) {
int i = 0;
int j = 0;
boolean duplicates = false;
String str1 = "";
String str2 = "";
Vector v = new Vector();
for (i = 0; i < s.size(); i++) {
duplicates = false;
for (j = (i + 1); j < s.size(); j++) {
str1 = "";
str2 = "";
str1 = s.elementAt(i).toString().trim();
str2 = s.elementAt(j).toString().trim();
if (str1.indexOf('@') > -1) {
str1 = str1.substring(str1.indexOf('@'));
}
if (str2.indexOf('@') > -1) {
str2 = str2.substring(str2.indexOf('@'));
}
if (str1.equalsIgnoreCase(str2)) {
duplicates = true;
}
}
if (duplicates == false) {
v.addElement(s.elementAt(i).toString().trim());
}
}
return v;
}
public static boolean areVectorsEqual(Vector a, Vector b) {
if (a.size() != b.size()) {
return false;
}
int i = 0;
int vectorSize = a.size();
boolean identical = true;
for (i = 0; i < vectorSize; i++) {
if (!(a.elementAt(i).toString().equalsIgnoreCase(
b.elementAt(i).toString()))) {
identical = false;
}
}
return identical;
}
public static Vector removeDuplicates(Vector a, Vector b) {
int i = 0;
int j = 0;
boolean present = true;
Vector v = new Vector();
for (i = 0; i < a.size(); i++) {
present = false;
for (j = 0; j < b.size(); j++) {
if (a.elementAt(i).toString().equalsIgnoreCase(
b.elementAt(j).toString())) {
present = true;
}
}
if (!(present)) {
v.addElement(a.elementAt(i));
}
}
return v;
}
}// end of class
| bnguyen82/stuff-projects | database-util/src/book/util/MiscUtil.java | Java | mit | 2,765 | [
30522,
7427,
2338,
1012,
21183,
4014,
1025,
12324,
9262,
1012,
22834,
1012,
1008,
1025,
12324,
9262,
1012,
21183,
4014,
1012,
1008,
1025,
2270,
2465,
28616,
12690,
4014,
1063,
2270,
10763,
22017,
20898,
2038,
8566,
24759,
24695,
2015,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/* This file contains an example program from The Little Book of
Semaphores, available from Green Tea Press, greenteapress.com
Copyright 2014 Allen B. Downey
License: Creative Commons Attribution-ShareAlike 3.0
*/
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <semaphore.h>
#define NUM_CHILDREN 2
void perror_exit (char *s)
{
perror (s); exit (-1);
}
void *check_malloc(int size)
{
void *p = malloc (size);
if (p == NULL) perror_exit ("malloc failed");
return p;
}
typedef sem_t Semaphore;
Semaphore *make_semaphore (int n)
{
Semaphore *sem = check_malloc (sizeof(Semaphore));
int ret = sem_init(sem, 0, n);
if (ret == -1) perror_exit ("sem_init failed");
return sem;
}
int sem_signal(Semaphore *sem)
{
return sem_post(sem);
}
typedef struct {
int counter;
int end;
int *array;
Semaphore *mutex;
} Shared;
Shared *make_shared (int end)
{
int i;
Shared *shared = check_malloc (sizeof (Shared));
shared->counter = 0;
shared->end = end;
shared->array = check_malloc (shared->end * sizeof(int));
for (i=0; i<shared->end; i++) {
shared->array[i] = 0;
}
shared->mutex = make_semaphore(1);
return shared;
}
pthread_t make_thread(void *(*entry)(void *), Shared *shared)
{
int ret;
pthread_t thread;
ret = pthread_create (&thread, NULL, entry, (void *) shared);
if (ret != 0) perror_exit ("pthread_create failed");
return thread;
}
void join_thread (pthread_t thread)
{
int ret = pthread_join (thread, NULL);
if (ret == -1) perror_exit ("pthread_join failed");
}
void child_code (Shared *shared)
{
printf ("Starting child at counter %d\n", shared->counter);
while (1) {
sem_wait(shared->mutex);
if (shared->counter >= shared->end) {
sem_signal(shared->mutex);
return;
}
shared->array[shared->counter]++;
shared->counter++;
if (shared->counter % 10000 == 0) {
printf ("%d\n", shared->counter);
}
sem_signal(shared->mutex);
}
}
void *entry (void *arg)
{
Shared *shared = (Shared *) arg;
child_code (shared);
printf ("Child done.\n");
pthread_exit (NULL);
}
void check_array (Shared *shared)
{
int i, errors=0;
printf ("Checking...\n");
for (i=0; i<shared->end; i++) {
if (shared->array[i] != 1) errors++;
}
printf ("%d errors.\n", errors);
}
int main ()
{
int i;
pthread_t child[NUM_CHILDREN];
Shared *shared = make_shared (100000000);
for (i=0; i<NUM_CHILDREN; i++) {
child[i] = make_thread (entry, shared);
}
for (i=0; i<NUM_CHILDREN; i++) {
join_thread (child[i]);
}
check_array (shared);
return 0;
}
| jackfan108/SoftwareSystems | lecture21/counter_mutex.c | C | gpl-3.0 | 2,620 | [
30522,
1013,
1008,
2023,
5371,
3397,
2019,
2742,
2565,
2013,
1996,
2210,
2338,
1997,
7367,
2863,
8458,
16610,
1010,
2800,
2013,
2665,
5572,
2811,
1010,
2665,
27058,
20110,
1012,
4012,
9385,
2297,
5297,
1038,
1012,
2091,
3240,
6105,
1024,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*/
package com.microsoft.azure.management.sql.v2017_03_01_preview;
import java.util.Collection;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.microsoft.rest.ExpandableStringEnum;
/**
* Defines values for DatabaseStatus.
*/
public final class DatabaseStatus extends ExpandableStringEnum<DatabaseStatus> {
/** Static value Online for DatabaseStatus. */
public static final DatabaseStatus ONLINE = fromString("Online");
/** Static value Restoring for DatabaseStatus. */
public static final DatabaseStatus RESTORING = fromString("Restoring");
/** Static value RecoveryPending for DatabaseStatus. */
public static final DatabaseStatus RECOVERY_PENDING = fromString("RecoveryPending");
/** Static value Recovering for DatabaseStatus. */
public static final DatabaseStatus RECOVERING = fromString("Recovering");
/** Static value Suspect for DatabaseStatus. */
public static final DatabaseStatus SUSPECT = fromString("Suspect");
/** Static value Offline for DatabaseStatus. */
public static final DatabaseStatus OFFLINE = fromString("Offline");
/** Static value Standby for DatabaseStatus. */
public static final DatabaseStatus STANDBY = fromString("Standby");
/** Static value Shutdown for DatabaseStatus. */
public static final DatabaseStatus SHUTDOWN = fromString("Shutdown");
/** Static value EmergencyMode for DatabaseStatus. */
public static final DatabaseStatus EMERGENCY_MODE = fromString("EmergencyMode");
/** Static value AutoClosed for DatabaseStatus. */
public static final DatabaseStatus AUTO_CLOSED = fromString("AutoClosed");
/** Static value Copying for DatabaseStatus. */
public static final DatabaseStatus COPYING = fromString("Copying");
/** Static value Creating for DatabaseStatus. */
public static final DatabaseStatus CREATING = fromString("Creating");
/** Static value Inaccessible for DatabaseStatus. */
public static final DatabaseStatus INACCESSIBLE = fromString("Inaccessible");
/** Static value OfflineSecondary for DatabaseStatus. */
public static final DatabaseStatus OFFLINE_SECONDARY = fromString("OfflineSecondary");
/** Static value Pausing for DatabaseStatus. */
public static final DatabaseStatus PAUSING = fromString("Pausing");
/** Static value Paused for DatabaseStatus. */
public static final DatabaseStatus PAUSED = fromString("Paused");
/** Static value Resuming for DatabaseStatus. */
public static final DatabaseStatus RESUMING = fromString("Resuming");
/** Static value Scaling for DatabaseStatus. */
public static final DatabaseStatus SCALING = fromString("Scaling");
/**
* Creates or finds a DatabaseStatus from its string representation.
* @param name a name to look for
* @return the corresponding DatabaseStatus
*/
@JsonCreator
public static DatabaseStatus fromString(String name) {
return fromString(name, DatabaseStatus.class);
}
/**
* @return known DatabaseStatus values
*/
public static Collection<DatabaseStatus> values() {
return values(DatabaseStatus.class);
}
}
| selvasingh/azure-sdk-for-java | sdk/sql/mgmt-v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/DatabaseStatus.java | Java | mit | 3,401 | [
30522,
1013,
1008,
1008,
1008,
9385,
1006,
1039,
1007,
7513,
3840,
1012,
2035,
2916,
9235,
1012,
1008,
7000,
2104,
1996,
10210,
6105,
1012,
2156,
6105,
1012,
19067,
2102,
1999,
1996,
2622,
7117,
2005,
1008,
6105,
2592,
1012,
1008,
1008,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link rel="SHORTCUT ICON" href="../../../../../img/clover.ico" />
<link rel="stylesheet" href="../../../../../aui/css/aui.min.css" media="all"/>
<link rel="stylesheet" href="../../../../../aui/css/aui-experimental.min.css" media="all"/>
<!--[if IE 9]><link rel="stylesheet" href="../../../../../aui/css/aui-ie9.min.css" media="all"/><![endif]-->
<style type="text/css" media="all">
@import url('../../../../../style.css');
@import url('../../../../../tree.css');
</style>
<script src="../../../../../jquery-1.8.3.min.js" type="text/javascript"></script>
<script src="../../../../../aui/js/aui.min.js" type="text/javascript"></script>
<script src="../../../../../aui/js/aui-experimental.min.js" type="text/javascript"></script>
<script src="../../../../../aui/js/aui-soy.min.js" type="text/javascript"></script>
<script src="../../../../../package-nodes-tree.js" type="text/javascript"></script>
<script src="../../../../../clover-tree.js" type="text/javascript"></script>
<script src="../../../../../clover.js" type="text/javascript"></script>
<script src="../../../../../clover-descriptions.js" type="text/javascript"></script>
<script src="../../../../../cloud.js" type="text/javascript"></script>
<title>ABA Route Transit Number Validator 1.0.1-SNAPSHOT</title>
</head>
<body>
<div id="page">
<header id="header" role="banner">
<nav class="aui-header aui-dropdown2-trigger-group" role="navigation">
<div class="aui-header-inner">
<div class="aui-header-primary">
<h1 id="logo" class="aui-header-logo aui-header-logo-clover">
<a href="http://openclover.org" title="Visit OpenClover home page"><span class="aui-header-logo-device">OpenClover</span></a>
</h1>
</div>
<div class="aui-header-secondary">
<ul class="aui-nav">
<li id="system-help-menu">
<a class="aui-nav-link" title="Open online documentation" target="_blank"
href="http://openclover.org/documentation">
<span class="aui-icon aui-icon-small aui-iconfont-help"> Help</span>
</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<div class="aui-page-panel">
<div class="aui-page-panel-inner">
<div class="aui-page-panel-nav aui-page-panel-nav-clover">
<div class="aui-page-header-inner" style="margin-bottom: 20px;">
<div class="aui-page-header-image">
<a href="http://cardatechnologies.com" target="_top">
<div class="aui-avatar aui-avatar-large aui-avatar-project">
<div class="aui-avatar-inner">
<img src="../../../../../img/clover_logo_large.png" alt="Clover icon"/>
</div>
</div>
</a>
</div>
<div class="aui-page-header-main" >
<h1>
<a href="http://cardatechnologies.com" target="_top">
ABA Route Transit Number Validator 1.0.1-SNAPSHOT
</a>
</h1>
</div>
</div>
<nav class="aui-navgroup aui-navgroup-vertical">
<div class="aui-navgroup-inner">
<ul class="aui-nav">
<li class="">
<a href="../../../../../dashboard.html">Project overview</a>
</li>
</ul>
<div class="aui-nav-heading packages-nav-heading">
<strong>Packages</strong>
</div>
<div class="aui-nav project-packages">
<form method="get" action="#" class="aui package-filter-container">
<input type="text" autocomplete="off" class="package-filter text"
placeholder="Type to filter packages..." name="package-filter" id="package-filter"
title="Start typing package name (or part of the name) to search through the tree. Use arrow keys and the Enter key to navigate."/>
</form>
<p class="package-filter-no-results-message hidden">
<small>No results found.</small>
</p>
<div class="packages-tree-wrapper" data-root-relative="../../../../../" data-package-name="com.cardatechnologies.utils.validators.abaroutevalidator">
<div class="packages-tree-container"></div>
<div class="clover-packages-lozenges"></div>
</div>
</div>
</div>
</nav> </div>
<section class="aui-page-panel-content">
<div class="aui-page-panel-content-clover">
<div class="aui-page-header-main"><ol class="aui-nav aui-nav-breadcrumbs">
<li><a href="../../../../../dashboard.html"> Project Clover database Sat Aug 7 2021 12:29:33 MDT</a></li>
<li><a href="test-pkg-summary.html">Package com.cardatechnologies.utils.validators.abaroutevalidator</a></li>
<li><a href="test-Test_AbaRouteValidator_03.html">Class Test_AbaRouteValidator_03</a></li>
</ol></div>
<h1 class="aui-h2-clover">
Test testAbaNumberCheck_2679_good
</h1>
<table class="aui">
<thead>
<tr>
<th>Test</th>
<th><label title="The test result. Either a Pass, Fail or Error.">Status</label></th>
<th><label title="When the test execution was started">Start time</label></th>
<th><label title="The total time in seconds taken to run this test.">Time (seconds)</label></th>
<th><label title="A failure or error message if the test is not successful.">Message</label></th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="../../../../../com/cardatechnologies/utils/validators/abaroutevalidator/Test_AbaRouteValidator_03.html?line=4360#src-4360" >testAbaNumberCheck_2679_good</a>
</td>
<td>
<span class="sortValue">1</span><span class="aui-lozenge aui-lozenge-success">PASS</span>
</td>
<td>
7 Aug 12:33:35
</td>
<td>
0.0 </td>
<td>
<div></div>
<div class="errorMessage"></div>
</td>
</tr>
</tbody>
</table>
<div> </div>
<table class="aui aui-table-sortable">
<thead>
<tr>
<th style="white-space:nowrap;"><label title="A class that was directly hit by this test.">Target Class</label></th>
<th colspan="4"><label title="The percentage of coverage contributed by each single test.">Coverage contributed by</label> testAbaNumberCheck_2679_good</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<span class="sortValue">com.cardatechnologies.utils.validators.abaroutevalidator.AbaRouteValidator</span>
  <a href="../../../../../com/cardatechnologies/utils/validators/abaroutevalidator/AbaRouteValidator.html?id=28540#AbaRouteValidator" title="AbaRouteValidator" name="sl-47">com.cardatechnologies.utils.validators.abaroutevalidator.AbaRouteValidator</a>
</td>
<td>
<span class="sortValue">0.7352941</span>73.5%
</td>
<td class="align-middle" style="width: 100%" colspan="3">
<div>
<div title="73.5% Covered" style="min-width:40px;" class="barNegative contribBarNegative contribBarNegative"><div class="barPositive contribBarPositive contribBarPositive" style="width:73.5%"></div></div></div> </td>
</tr>
</tbody>
</table>
</div> <!-- class="aui-page-panel-content-clover" -->
<footer id="footer" role="contentinfo">
<section class="footer-body">
<ul>
<li>
Report generated by <a target="_new" href="http://openclover.org">OpenClover</a> v 4.4.1
on Sat Aug 7 2021 12:49:26 MDT using coverage data from Sat Aug 7 2021 12:47:23 MDT.
</li>
</ul>
<ul>
<li>OpenClover is free and open-source software. </li>
</ul>
</section>
</footer> </section> <!-- class="aui-page-panel-content" -->
</div> <!-- class="aui-page-panel-inner" -->
</div> <!-- class="aui-page-panel" -->
</div> <!-- id="page" -->
</body>
</html> | dcarda/aba.route.validator | target13/site/clover/com/cardatechnologies/utils/validators/abaroutevalidator/Test_AbaRouteValidator_03_testAbaNumberCheck_2679_good_m0s.html | HTML | apache-2.0 | 9,176 | [
30522,
1026,
999,
9986,
13874,
16129,
1028,
1026,
16129,
20950,
3619,
1027,
1000,
8299,
1024,
1013,
1013,
7479,
1012,
1059,
2509,
1012,
8917,
1013,
2639,
1013,
1060,
11039,
19968,
1000,
20950,
1024,
11374,
1027,
1000,
4372,
1000,
11374,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/***************************************************************************
SRC/MIXMOD/XEMOutputControler.cpp description
copyright : (C) MIXMOD Team - 2001-2011
email : contact@mixmod.org
***************************************************************************/
/***************************************************************************
This file is part of MIXMOD
MIXMOD is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
MIXMOD is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with MIXMOD. If not, see <http://www.gnu.org/licenses/>.
All informations available on : http://www.mixmod.org
***************************************************************************/
#include <string.h>
#include "XEMOutputControler.h"
#include "XEMUtil.h"
//------------
// Constructor
//------------
XEMOutputControler::XEMOutputControler(){
int64_t i;
_output = NULL;
_nbOutputFiles = maxNbOutputFiles;
for (i=0; i<_nbOutputFiles; i++){
_tabOutputTypes[i] = (XEMOutputType) i;
}
createEmptyFiles();
}
//------------
// Constructor
//------------
XEMOutputControler::XEMOutputControler(XEMOutput * output){
int64_t i;
_output = output;
_nbOutputFiles = maxNbOutputFiles;
for (i=0; i<_nbOutputFiles; i++){
_tabOutputTypes[i] = (XEMOutputType) i;
}
createEmptyFiles();
}
//-----------
// Destructor
//-----------
XEMOutputControler::~XEMOutputControler(){
int64_t i;
//cout<<"tabFileName"<<endl;
for (i=0; i<maxNbOutputFiles; i++){
//cout<<"tabFileName : "<<_tabFiles[i]<<endl;
delete _tabFiles[i];
}
}
//---------
// Selector
//---------
void XEMOutputControler::setOutput(XEMOutput * output){
_output = output;
}
//---------
// editFile
//---------
void XEMOutputControler::editFile(){
int64_t i;
if (_output){
_output->editFile(_tabFiles);
for (i=0; i<_nbOutputFiles; i++){
_tabFiles[i]->close();
}
}
}
//---------
// editErroMixmodFile
//---------
void XEMOutputControler::editErroMixmodFile(XEMErrorType error){
// errorMixmodOutput
int64_t i = (int64_t)errorMixmodOutput;
*_tabFiles[i]<<error<<endl;
}
//--------------------------
// Create Empty output Files
//--------------------------
void XEMOutputControler::createEmptyFiles(){
int64_t i,j;
string charCriterionType= "";
string fileName = "";
int64_t nbOutputFileType = 9;
string * fileNameTmp = new string[nbOutputFileType];
for (i=0 ; i<nbOutputFileType; i++){
fileNameTmp[i] = "";
}
fileNameTmp[0] = "standard.txt";
fileNameTmp[1] = "numericStandard.txt";
fileNameTmp[2] = "label.txt";
fileNameTmp[3] = "parameter.txt";
fileNameTmp[4] = "posteriorProbabilities.txt";
fileNameTmp[5] = "partition.txt";
fileNameTmp[6] = "likelihood.txt";
fileNameTmp[7] = "Error.txt";
fileNameTmp[8] = "numericLikelihood.txt";
// CV, BIC, NEC, ICL, DCV ... files
//---------------------------------
for (i=0;i<nbMaxSelection;i++){
if (i==0){
charCriterionType = "BIC";
}
if (i==1){
charCriterionType = "CV";
}
if (i==2){
charCriterionType = "ICL";
}
if (i==3){
charCriterionType = "NEC";
}
if (i==4){
charCriterionType = "DCV";
}
for (j=0; j<nbOutputFileType; j++){
fileName = charCriterionType;
_tabFiles[nbOutputFileType*i+j] = new ofstream(fileName.append(fileNameTmp[j]).c_str(), ios::out);
_tabFiles[nbOutputFileType*i+j]->setf(ios::fixed, ios::floatfield);
}
}
// other files
//------------
//char * completeFileName ="complete.txt";
_tabFiles[(int64_t)completeOutput] = new ofstream("complete.txt", ios::out);
_tabFiles[(int64_t)completeOutput]->setf(ios::fixed, ios::floatfield);
//char * numericCompleteFileName ="numericComplete.txt";
_tabFiles[(int64_t)numericCompleteOutput] = new ofstream("numericComplete.txt", ios::out);
_tabFiles[(int64_t)numericCompleteOutput]->setf(ios::fixed, ios::floatfield);
//char * CVlabelClassificationFileName = "CVlabelClassification.txt";
_tabFiles[(int64_t)CVlabelClassificationOutput] = new ofstream("CVlabelClassification.txt", ios::out);
_tabFiles[(int64_t)CVlabelClassificationOutput]->setf(ios::fixed, ios::floatfield);
//char * errorMixmodFileName = "errorMixmod.txt";
_tabFiles[(int64_t)errorMixmodOutput] = new ofstream("errorMixmod.txt", ios::out);
_tabFiles[(int64_t)errorMixmodOutput]->setf(ios::fixed, ios::floatfield);
//char * errorModelFileName = "errorModel.txt";
_tabFiles[(int64_t)errorModelOutput] = new ofstream("errorModel.txt", ios::out);
_tabFiles[(int64_t)errorModelOutput]->setf(ios::fixed, ios::floatfield);
// DCV files
_tabFiles[(int64_t)DCVinfo] = new ofstream("DCVinfo.txt", ios::out);
_tabFiles[(int64_t)DCVinfo]->setf(ios::fixed, ios::floatfield);
_tabFiles[(int64_t)DCVnumericInfo] = new ofstream("DCVnumericInfo.txt", ios::out);
_tabFiles[(int64_t)DCVnumericInfo]->setf(ios::fixed, ios::floatfield);
// verify if files are open
for (i=0 ;i<_nbOutputFiles; i++){
if (! _tabFiles[i]->is_open())
throw errorOpenFile;
}
delete [] fileNameTmp;
/*delete completeFileName;
delete numericCompleteFileName;
delete CVlabelClassificationFileName;
delete errorMixmodFileName;
delete errorModelFileName;
*/
}
| openturns/otmixmod | lib/src/mixmod/MIXMOD/XEMOutputControler.cpp | C++ | gpl-3.0 | 5,794 | [
30522,
1013,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!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_26) on Tue Dec 13 22:42:15 CET 2011 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
Uses of Class fspotcloud.test.FirefoxRemoteSuite (F-Spot Cloud Java Edition 0.40-7.5.9 Test API)
</TITLE>
<META NAME="date" CONTENT="2011-12-13">
<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 fspotcloud.test.FirefoxRemoteSuite (F-Spot Cloud Java Edition 0.40-7.5.9 Test 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> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../fspotcloud/test/FirefoxRemoteSuite.html" title="class in fspotcloud.test"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html?fspotcloud/test//class-useFirefoxRemoteSuite.html" target="_top"><B>FRAMES</B></A>
<A HREF="FirefoxRemoteSuite.html" target="_top"><B>NO FRAMES</B></A>
<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>fspotcloud.test.FirefoxRemoteSuite</B></H2>
</CENTER>
No usage of fspotcloud.test.FirefoxRemoteSuite
<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> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../fspotcloud/test/FirefoxRemoteSuite.html" title="class in fspotcloud.test"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html?fspotcloud/test//class-useFirefoxRemoteSuite.html" target="_top"><B>FRAMES</B></A>
<A HREF="FirefoxRemoteSuite.html" target="_top"><B>NO FRAMES</B></A>
<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 © 2011. All Rights Reserved.
</BODY>
</HTML>
| slspeek/FSpotCloudSite | testapidocs/fspotcloud/test/class-use/FirefoxRemoteSuite.html | HTML | gpl-3.0 | 5,969 | [
30522,
1026,
999,
9986,
13874,
16129,
2270,
1000,
1011,
1013,
1013,
1059,
2509,
2278,
1013,
1013,
26718,
2094,
16129,
1018,
1012,
5890,
17459,
1013,
1013,
4372,
1000,
1000,
8299,
1024,
1013,
1013,
7479,
1012,
1059,
2509,
1012,
8917,
1013,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SpectrumSearch
==============
New generation of http://www.massbank.jp/SearchPage.html that will be implemented as Java client application.
| MassBank/SpectrumSearch | README.md | Markdown | gpl-2.0 | 141 | [
30522,
8674,
17310,
11140,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
2047,
4245,
1997,
8299,
1024,
1013,
1013,
7479,
1012,
3742,
9299,
1012,
16545,
1013,
3945,
13704,
1012,
16129,
2008,
2097,
2022,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<div style="background:#c5ccd3;" class="view simpleView">
<h1 data-app-constraint="top" dojoType="dojox.mobile.Heading" >Main Scene</h1>
</div>
| avz-cmf/zaboy-middleware | www/js/dojox/app/tests/multiSceneApp/simple.html | HTML | gpl-3.0 | 147 | [
30522,
1026,
4487,
2615,
2806,
1027,
1000,
4281,
1024,
1001,
1039,
2629,
9468,
2094,
2509,
1025,
1000,
2465,
1027,
1000,
3193,
3722,
8584,
1000,
1028,
1026,
1044,
2487,
2951,
1011,
10439,
1011,
27142,
1027,
1000,
2327,
1000,
2079,
5558,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package VMOMI::VmDasBeingResetEvent;
use parent 'VMOMI::VmEvent';
use strict;
use warnings;
our @class_ancestors = (
'VmEvent',
'Event',
'DynamicData',
);
our @class_members = (
['reason', undef, 0, 1],
);
sub get_class_ancestors {
return @class_ancestors;
}
sub get_class_members {
my $class = shift;
my @super_members = $class->SUPER::get_class_members();
return (@super_members, @class_members);
}
1;
| stumpr/p5-vmomi | lib/VMOMI/VmDasBeingResetEvent.pm | Perl | apache-2.0 | 444 | [
30522,
7427,
1058,
5302,
4328,
1024,
1024,
1058,
26876,
3022,
19205,
3070,
6072,
12870,
15338,
1025,
2224,
6687,
1005,
1058,
5302,
4328,
1024,
1024,
1058,
4168,
15338,
1005,
1025,
2224,
9384,
1025,
2224,
16234,
1025,
2256,
1030,
2465,
1035,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
require "administrate/base_dashboard"
class LogEntryDashboard < Administrate::BaseDashboard
ATTRIBUTES = %i(action logeable).freeze
ATTRIBUTE_TYPES = {
id: Field::Number,
action: Field::String,
logeable: Field::Polymorphic.with_options(classes: [Customer, ::Order]),
}.freeze
COLLECTION_ATTRIBUTES = [:id] + ATTRIBUTES
FORM_ATTRIBUTES = ATTRIBUTES
SHOW_PAGE_ATTRIBUTES = ATTRIBUTES
def display_resource(resource)
"#{resource.action}[#{safe_display_logeable(resource.logeable)}]"
end
private
def safe_display_logeable(logeable)
logeable ? display_logeable(logeable) : ""
end
def display_logeable(logeable)
(logeable.class.to_s + "Dashboard").
constantize.
new.
display_resource(logeable)
end
end
| thoughtbot/administrate | spec/example_app/app/dashboards/log_entry_dashboard.rb | Ruby | mit | 770 | [
30522,
5478,
1000,
4748,
25300,
20528,
2618,
1013,
2918,
1035,
24923,
1000,
2465,
8833,
4765,
2854,
8883,
2232,
6277,
1026,
4748,
25300,
20528,
2618,
1024,
1024,
2241,
11823,
6277,
12332,
1027,
1003,
1045,
1006,
2895,
8833,
5243,
3468,
1007... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/**
* Soccer API
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* OpenAPI spec version: 1.0
* Contact: voetbalsvk@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
export interface ByteResponseDTO {
bytes?: string;
}
| tdedobbeleer/soccer-angular | src/app/ws/soccer/model/byteResponseDTO.ts | TypeScript | apache-2.0 | 420 | [
30522,
1013,
1008,
1008,
1008,
4715,
17928,
1008,
2053,
6412,
3024,
1006,
7013,
2011,
25430,
27609,
3642,
6914,
16770,
1024,
1013,
1013,
21025,
2705,
12083,
1012,
4012,
1013,
25430,
27609,
1011,
17928,
1013,
25430,
27609,
1011,
3642,
6914,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
import moment from 'moment';
import PublicationsController from './controller/publications.controller.js';
import AuthorsController from './controller/authors.controller.js';
import PublishersController from './controller/publishers.controller.js';
/*
* Application routing
*/
function routing($routeProvider) {
$routeProvider
.when('/publications', {
template: require('./view/publications.html'),
controller: PublicationsController,
controllerAs: 'vm'
})
.when('/authors', {
template: require('./view/authors.html'),
controller: AuthorsController,
controllerAs: 'vm'
})
.when('/publishers', {
template: require('./view/publishers.html'),
controller: PublishersController,
controllerAs: 'vm'
})
.otherwise({ redirectTo: '/publications' });
}
routing.$inject = ['$routeProvider'];
/*
* Theming configuration for Material AngularJS
*/
function theming($mdThemingProvider) {
$mdThemingProvider
.theme('default')
.primaryPalette('indigo')
.accentPalette('red');
}
theming.$inject = ['$mdThemingProvider'];
/*
* Date localization configuration
*/
function dateLocalization($mdDateLocaleProvider) {
const dateFmt = 'YYYY-MM-DD';
$mdDateLocaleProvider.formatDate = (date) => {
return moment(date).format(dateFmt);
};
$mdDateLocaleProvider.parseDate = (str) => {
const m = moment(str, dateFmt);
return m.isValid() ? m.toDate() : new Date(NaN);
};
}
dateLocalization.$inject = ['$mdDateLocaleProvider'];
export { routing, theming, dateLocalization };
| enric-sinh/publication-library | web/src/app/app.config.js | JavaScript | gpl-3.0 | 1,574 | [
30522,
12324,
2617,
2013,
1005,
2617,
1005,
1025,
12324,
5523,
8663,
13181,
10820,
2013,
1005,
1012,
1013,
11486,
1013,
5523,
1012,
11486,
1012,
1046,
2015,
1005,
1025,
12324,
6048,
8663,
13181,
10820,
2013,
1005,
1012,
1013,
11486,
1013,
6... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
\documentclass{article}
\usepackage{epsfig}
\usepackage{color}
\usepackage{amsmath}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage[german]{babel}
\usepackage{helvet}
\selectlanguage{german}
\oddsidemargin15pt
\evensidemargin15pt
\textheight25mm
\textwidth20cm
\begin{document}
\definecolor{bunt}{rgb}{1.0,1.0,0.9}
\thispagestyle{empty}
\sffamily
\LARGE
\pagecolor{black}
\color{white}
\noindent
Die zwei Brennpunkte der Marsbahn werden mit
einem \color{red}roten +\color{white} ~markiert.
Die Sonne steht in einem Brennpunkt der Bahn.
\end{document}
| Jeija/keplerslaws | kepler/texte/Untertitel1_1_DE.tex | TeX | gpl-2.0 | 613 | [
30522,
1032,
6254,
26266,
1063,
3720,
1065,
1032,
2224,
23947,
4270,
1063,
20383,
8873,
2290,
1065,
1032,
2224,
23947,
4270,
1063,
3609,
1065,
1032,
2224,
23947,
4270,
1063,
2572,
26212,
2705,
1065,
1032,
2224,
23947,
4270,
1031,
1056,
2487... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-module-namespace-exotic-objects-isextensible
description: The [[IsExtensible]] internal method returns `false`
flags: [module]
---*/
import * as ns from './is-extensible.js';
assert.sameValue(Object.isExtensible(ns), false);
| sebastienros/jint | Jint.Tests.Test262/test/language/module-code/namespace/internals/is-extensible.js | JavaScript | bsd-2-clause | 381 | [
30522,
1013,
1013,
9385,
1006,
1039,
1007,
2355,
1996,
15754,
2622,
6048,
1012,
2035,
2916,
9235,
1012,
1013,
1013,
2023,
3642,
2003,
9950,
2011,
1996,
18667,
2094,
6105,
2179,
1999,
1996,
6105,
5371,
1012,
1013,
1008,
1011,
1011,
1011,
9... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
module PostsWithCollectionAndFilesHelper
end
| AskDiana/uploadcare-rails | spec/dummy/app/helpers/posts_with_collection_and_files_helper.rb | Ruby | mit | 45 | [
30522,
11336,
8466,
24415,
26895,
18491,
5685,
8873,
4244,
16001,
4842,
2203,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
module.exports = {
extends: 'airbnb',
parser: 'babel-eslint',
plugins: [
'react',
'jsx-a11y',
'import'
],
globals: {
OT: true
},
env: {
browser: true,
},
rules: {
'no-confusing-arrow': ['error', { allowParens: true }],
'react/jsx-filename-extension': 'off',
'react/forbid-prop-types': ['error', { forbid: ['any', 'array'] }]
}
};
| aiham/opentok-react | src/.eslintrc.js | JavaScript | mit | 382 | [
30522,
11336,
1012,
14338,
1027,
1063,
8908,
1024,
1005,
2250,
24700,
2497,
1005,
1010,
11968,
8043,
1024,
1005,
11561,
2140,
1011,
9686,
4115,
2102,
1005,
1010,
13354,
7076,
1024,
1031,
1005,
10509,
1005,
1010,
1005,
1046,
2015,
2595,
1011... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.apache.commons.imaging.color;
public final class ColorHsv
{
public final double H, S, V;
public ColorHsv(double h, double s, double v)
{
H = h;
S = s;
V = v;
}
@Override
public final String toString()
{
return "{H: " + H + ", S: " + S + ", V: " + V + "}";
}
} | apache/sanselan | src/main/java/org/apache/commons/imaging/color/ColorHsv.java | Java | apache-2.0 | 1,141 | [
30522,
1013,
1008,
1008,
7000,
2000,
1996,
15895,
4007,
3192,
1006,
2004,
2546,
1007,
2104,
2028,
2030,
2062,
1008,
12130,
6105,
10540,
1012,
2156,
1996,
5060,
5371,
5500,
2007,
1008,
2023,
2147,
2005,
3176,
2592,
4953,
9385,
6095,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
document.write('2018年1月'); | kulend/Vino.Core.CMS | source/Ku.Core.CMS.Web.Backend/wwwroot/lib/data_location/version.js | JavaScript | apache-2.0 | 30 | [
30522,
6254,
1012,
4339,
1006,
1005,
2760,
1840,
1015,
1872,
1005,
1007,
1025,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
use app\models\Upload;
if ($object_id) {
?>
<div>
<img src="<?= Upload::getThumb($type, $value, true); ?>" data-toggle="lightbox" data-image="<?= Upload::getPicture($value, true); ?>" height="65" id="<?= $id; ?>_picture">
<p>预览缩略图</p>
</div>
<?php } else { ?>
<img src="<?= Upload::getThumb($type, $value, true); ?>" height="65" id="<?= $id; ?>_picture"><p>预览缩略图</p>
<?php
}
if ($display_upload && empty($value)) {
?>
<div class="upload_picture">
<input type="file" name="file" id="uploadif_<?= $id; ?>">
</div>
<?php } ?>
<input name="<?= $old_name; ?>" type="hidden" value="<?= $value; ?>">
<input name="<?= $name; ?>" type="hidden" id="<?= $id; ?>_path" value="<?= $value; ?>">
<?php if ($object_id && $value && $delete_url) { ?>
<p><button class="btn btn-sm btn-danger btn-confirm" type="button" data-title="删除图片" data-url="<?php echo $delete_url; ?>" data-params="_csrf=<?= \Yii::$app->request->csrfToken ?>"><span class="icon-remove"></span> 删除</button></p>
<?php } ?>
<script type="text/javascript">
$(function () {
$('#uploadif_<?= $id; ?>').fileupload({
url: '<?= $upload_url; ?>', //文件上传地址
dataType: 'json',
done: function (e, data) {
//done方法就是上传完毕的回调函数,其他回调函数可以自行查看api
if (data.result.error === 0) {
$('#<?= $id; ?>_path').val(data.result.url);
$('#<?= $id; ?>_picture').attr('src', '<?= \Yii::$app->params['upload_dir']; ?>' + data.result.url + '?' + Math.random());
$('#<?= $id; ?>_picture').attr('data-image', '<?= \Yii::$app->params['upload_dir']; ?>' + data.result.url + '?' + Math.random());
$('.upload_picture').hide();
} else {
alert(data.result.message);
}
}
});
});
</script> | sushipai/yii2basic | components/views/admin_picture.php | PHP | bsd-3-clause | 2,006 | [
30522,
1026,
1029,
25718,
2224,
10439,
1032,
4275,
1032,
2039,
11066,
1025,
2065,
1006,
1002,
4874,
1035,
8909,
1007,
1063,
1029,
1028,
1026,
4487,
2615,
1028,
1026,
10047,
2290,
5034,
2278,
1027,
1000,
1026,
1029,
1027,
2039,
11066,
1024,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
(function($) {
module("applicationSettings1");
// Test case : Application Settings
_asyncTest("Application Settings 1", function()
{
expect(14);
var gitana = GitanaTest.authenticateFullOAuth();
gitana.then(function() {
// NOTE: this = platform
var platform = this;
// create a application
this.createApplication().then(function() {
// NOTE: this = application
var application = this;
// ensure zero settings at onset
this.listSettings().count(function(count) {
equal(count, 0, "No settings");
});
var applicationSettings;
this.readApplicationSettings().then(function() {
applicationSettings = this;
});
// should now be 1 setting
this.listSettings().count(function(count) {
equal(count, 1, "One setting");
});
this.then(function() {
this.subchain(applicationSettings).then(function() {
this.setSetting('key1','val1');
this.setSetting('key2',true);
this.setSetting('key3',['arr1','arr2']);
this.setSetting('key4',3);
this.setSetting('key5',{
"foo" : "bar",
"foo2" : "bar2"
});
this.update();
});
});
this.readApplicationSettings().then(function() {
equal(this.getSetting('key1'), 'val1', "String setting is set with correct value.");
equal(this.getSetting('key2'), true, "Boolean setting is set with correct value.");
deepEqual(this.getSetting('key3'), ['arr1','arr2'], "Array setting is set with correct value.");
equal(this.getSetting('key4'), 3, "Integer setting is set with correct value.");
deepEqual(this.getSetting('key5'), {
"foo" : "bar",
"foo2" : "bar2"
}, "Object setting is set with correct value.");
});
this.querySettings({
"settings.key1" : "val1"
}).count(function(count) {
equal(count, 1, "Found the setting via query.");
});
this.subchain(platform).readPrimaryDomain().then(function() {
var user1 = null;
var userName1 = "user" + new Date().getTime();
this.createUser({
"name": userName1
}).then(function() {
user1 = this;
this.subchain(application).readApplicationPrincipalSettings(user1).then(function() {
this.setSetting('ukey1', 'val1');
this.setSetting('ukey2', true);
this.setSetting('ukey3', ['arr1','arr2']);
this.setSetting('ukey4', 3);
this.setSetting('ukey5', {
"foo" : "bar",
"foo2" : "bar2"
});
this.update().reload().then(function() {
equal(this.getSetting('ukey1'), 'val1', "Principal string setting is set with correct value.");
equal(this.getSetting('ukey2'), true, "Principal boolean setting is set with correct value.");
deepEqual(this.getSetting('ukey3'), ['arr1','arr2'], "Principal array setting is set with correct value.");
equal(this.getSetting('ukey4'), 3, "Principal integer setting is set with correct value.");
deepEqual(this.getSetting('ukey5'), {
"foo" : "bar",
"foo2" : "bar2"
}, "Object setting is set with correct value.");
});
this.then(function() {
this.subchain(user1).del();
});
});
});
});
this.then(function() {
this.subchain(applicationSettings).del().then(function() {
this.subchain(application).querySettings({
"settings.key1" : "val1"
}).count(function(count) {
equal(count, 0, "Application settings has been deleted.");
});
});
});
this.del();
});
this.then(function() {
success();
});
});
var success = function()
{
start();
};
});
}(jQuery) );
| gitana/gitana-javascript-driver | tests/js/testApplicationSettings1.js | JavaScript | apache-2.0 | 5,226 | [
30522,
1006,
3853,
1006,
1002,
1007,
1063,
11336,
1006,
1000,
5097,
18319,
3070,
2015,
2487,
1000,
1007,
1025,
1013,
1013,
3231,
2553,
1024,
4646,
10906,
1035,
2004,
6038,
6593,
4355,
1006,
1000,
4646,
10906,
1015,
1000,
1010,
3853,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
//
// ViewController.h
// Auto Destroy View
//
// Created by Ravi Vooda on 2/23/15.
// Copyright (c) 2015 Ravi Vooda. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@end
| ravivooda/AutoDestroyView | Auto Destroy View/Auto Destroy View/ViewController.h | C | mit | 225 | [
30522,
1013,
1013,
1013,
1013,
3193,
8663,
13181,
10820,
1012,
1044,
1013,
1013,
8285,
6033,
3193,
1013,
1013,
1013,
1013,
2580,
2011,
16806,
29536,
13390,
2006,
1016,
1013,
2603,
1013,
2321,
1012,
1013,
1013,
9385,
1006,
1039,
1007,
2325,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/**
* BSD 2-Clause License
*
* Copyright (c) 2016-2017, Jochen Seeber
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package me.seeber.gradle.ide.eclipse.annotations;
import static java.lang.String.format;
import java.io.Closeable;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
import com.google.common.collect.ImmutableMap;
import com.google.common.io.Closeables;
import com.google.common.io.Files;
import me.seeber.gradle.util.Validate;
import net.bytebuddy.description.type.TypeDescription;
import net.bytebuddy.dynamic.ClassFileLocator;
import net.bytebuddy.pool.TypePool;
import net.bytebuddy.pool.TypePool.CacheProvider;
import net.bytebuddy.pool.TypePool.Default.ReaderMode;
/**
* Scan a dependency for nullability annotations
*
* @see <a href="https://wiki.eclipse.org/JDT_Core/Null_Analysis/External_Annotations">Eclipse JDT External
* Annotations</a>
*/
public class JarReader implements Closeable {
/**
* Class loader to resolve types
*/
private final ClassLoader classLoader;
/**
* Class file locator to search for class files
*/
private @Nullable ClassFileLocator classFileLocator;
/**
* Loaded types
*/
private @Nullable Map<@NonNull String, @NonNull TypeDescription> types = new HashMap<>();
/**
* Create a new AnnotationsJarBuilder
*
* @param jarFile JAR file to read
* @param classLoader Class loader to resolve types
*/
public JarReader(File jarFile, ClassLoader classLoader) {
this.classLoader = classLoader;
try {
openJarFile(jarFile);
}
catch (IOException e) {
throw new RuntimeException("Cannot create annotations JAR builder", e);
}
}
/**
* Open a JAR file for reading
*
* @param jarFile JAR file for reading
* @throws IOException I'm so sorry...
*/
protected void openJarFile(File jarFile) throws IOException {
ClassFileLocator classFileLocator = null;
try {
List<String> classFileNames = new ArrayList<>();
try (JarFile jar = new JarFile(jarFile)) {
for (JarEntry entry : Collections.list(jar.entries())) {
if (!entry.isDirectory() && Files.getFileExtension(entry.getName()).equals("class")) {
classFileNames.add(entry.getName());
}
}
}
catch (IOException e) {
throw new RuntimeException(format("Could not scan jar file '%s' for contained classes", jarFile), e);
}
classFileLocator = ClassFileLocator.ForJarFile.of(jarFile);
TypePool parentTypePool = TypePool.Default.of(getClassLoader());
TypePool typePool = new TypePool.Default.WithLazyResolution(CacheProvider.Simple.withObjectType(),
classFileLocator, ReaderMode.FAST, parentTypePool);
Map<@NonNull String, @NonNull TypeDescription> types = new HashMap<>();
for (String classFileName : classFileNames) {
String className = Files.getNameWithoutExtension(classFileName.replace(File.separatorChar, '.'));
TypeDescription type = typePool.describe(className).resolve();
if (!type.isPackageType()) {
types.put(type.getName(), type);
}
}
this.classFileLocator = classFileLocator;
this.types = ImmutableMap.copyOf(types);
}
catch (Exception e) {
Closeables.close(classFileLocator, true);
throw new RuntimeException(String.format("Could not scan JAR file '%s'", jarFile));
}
}
/**
* Get the loaded types
*
* @return types Loaded types
*/
public Map<String, TypeDescription> getTypes() {
return Validate.notNull(this.types);
}
/**
* Get the class loader
*
* @return classLoader Class loader
*/
public ClassLoader getClassLoader() {
return this.classLoader;
}
/**
* @see java.lang.AutoCloseable#close()
*/
@Override
public void close() throws IOException {
this.types = null;
Closeables.close(this.classFileLocator, false);
}
}
| jochenseeber/gradle-project-config | src/main/java/me/seeber/gradle/ide/eclipse/annotations/JarReader.java | Java | bsd-2-clause | 5,838 | [
30522,
1013,
1008,
1008,
1008,
18667,
2094,
1016,
1011,
11075,
6105,
1008,
1008,
9385,
1006,
1039,
1007,
2355,
1011,
2418,
1010,
8183,
8661,
2156,
5677,
1008,
2035,
2916,
9235,
1012,
1008,
1008,
25707,
1998,
2224,
1999,
3120,
1998,
12441,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
require_once('../../lib/Laposta.php');
Laposta::setApiKey("JdMtbsMq2jqJdQZD9AHC");
// initialize field with list_id
$field = new Laposta_Field("BaImMu3JZA");
try {
// get field info, use field_id or email as argument
// $result will contain een array with the response from the server
$result = $field->get("iPcyYaTCkG");
print '<pre>';print_r($result);print '</pre>';
} catch (Exception $e) {
// you can use the information in $e to react to the exception
print '<pre>';print_r($e);print '</pre>';
}
?>
| laposta/laposta-api-php | examples/field/get.php | PHP | mit | 520 | [
30522,
1026,
1029,
25718,
5478,
1035,
2320,
1006,
1005,
1012,
1012,
1013,
1012,
1012,
1013,
5622,
2497,
1013,
5001,
28696,
1012,
25718,
1005,
1007,
1025,
5001,
28696,
1024,
1024,
2275,
9331,
17339,
2100,
1006,
1000,
26219,
20492,
5910,
2213... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define([], factory);
else if(typeof exports === 'object')
exports["choose_file"] = factory();
else
root["choose_file"] = factory();
})(this, function() {
return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ exports: {},
/******/ id: moduleId,
/******/ loaded: false
/******/ };
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/ // Flag the module as loaded
/******/ module.loaded = true;
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/ // __webpack_hash__
/******/ __webpack_require__.h = "05ce0eff1b9563477190";
/******/ // Load entry module and return exports
/******/ return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(1);
/***/ },
/* 1 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
var assign = __webpack_require__(4);
var is_function = __webpack_require__(2);
var is_presto = !!window.opera;
var is_trident = document.all && !is_presto;
var defaults = {
multiple: false,
accept: '*/*',
success: function (input) {}
};
var on = function (event, element, callback) {
if (element.addEventListener) {
element.addEventListener(event, callback, false);
} else if (element.attachEvent) {
element.attachEvent('on' + event, callback);
}
};
var input_remove = function (input) {
is_trident || input.parentNode && input.parentNode.removeChild(input);
// input.removeAttribute('accept');
// input.removeAttribute('style');
};
module.exports = function (params) {
var input;
var options;
options = assign({}, defaults, is_function(params) ? {
success: params
} : params || {});
options.success = is_function(options.success) ? options.success : defaults.success;
input = document.createElement('input');
input.setAttribute('style', 'position: absolute; clip: rect(0, 0, 0, 0);');
input.setAttribute('accept', options.accept);
input.setAttribute('type', 'file');
input.multiple = !!options.multiple;
on(is_trident ? 'input' : 'change', input, function (e) {
if (is_presto) {
input_remove(input);
}
if (input.value) {
options.success(input);
}
});
(document.body || document.documentElement).appendChild(input);
if (is_presto) {
setTimeout(function () {
input.click();
}, 0);
} else {
input.click();
input_remove(input);
}
};
/***/ },
/* 2 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {var isObject = __webpack_require__(3);
/** `Object#toString` result references. */
var funcTag = '[object Function]',
genTag = '[object GeneratorFunction]';
/** Used for built-in method references. */
var objectProto = global.Object.prototype;
/**
* Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
* of values.
*/
var objectToString = objectProto.toString;
/**
* Checks if `value` is classified as a `Function` object.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
* @example
*
* _.isFunction(_);
* // => true
*
* _.isFunction(/abc/);
* // => false
*/
function isFunction(value) {
// The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 8 which returns 'object' for typed array constructors, and
// PhantomJS 1.9 which returns 'function' for `NodeList` instances.
var tag = isObject(value) ? objectToString.call(value) : '';
return tag == funcTag || tag == genTag;
}
module.exports = isFunction;
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
/***/ },
/* 3 */
/***/ function(module, exports) {
/**
* Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
* (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
* @example
*
* _.isObject({});
* // => true
*
* _.isObject([1, 2, 3]);
* // => true
*
* _.isObject(_.noop);
* // => true
*
* _.isObject(null);
* // => false
*/
function isObject(value) {
// Avoid a V8 JIT bug in Chrome 19-20.
// See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
var type = typeof value;
return !!value && (type == 'object' || type == 'function');
}
module.exports = isObject;
/***/ },
/* 4 */
/***/ function(module, exports) {
/* eslint-disable no-unused-vars */
'use strict';
var hasOwnProperty = Object.prototype.hasOwnProperty;
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
function toObject(val) {
if (val === null || val === undefined) {
throw new TypeError('Object.assign cannot be called with null or undefined');
}
return Object(val);
}
module.exports = Object.assign || function (target, source) {
var from;
var to = toObject(target);
var symbols;
for (var s = 1; s < arguments.length; s++) {
from = Object(arguments[s]);
for (var key in from) {
if (hasOwnProperty.call(from, key)) {
to[key] = from[key];
}
}
if (Object.getOwnPropertySymbols) {
symbols = Object.getOwnPropertySymbols(from);
for (var i = 0; i < symbols.length; i++) {
if (propIsEnumerable.call(from, symbols[i])) {
to[symbols[i]] = from[symbols[i]];
}
}
}
}
return to;
};
/***/ }
/******/ ])
});
; | zobzn/choose-file | dist/choose-file.js | JavaScript | mit | 6,946 | [
30522,
1006,
3853,
4773,
23947,
19496,
14028,
2389,
5302,
8566,
3709,
12879,
5498,
3508,
1006,
7117,
1010,
4713,
1007,
1063,
2065,
1006,
2828,
11253,
14338,
1027,
1027,
1027,
1005,
4874,
1005,
1004,
1004,
2828,
11253,
11336,
1027,
1027,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package com.binaryedu.web.controllers;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;
public class SignUpSuccessController implements Controller
{
protected final Log logger = LogFactory.getLog(this.getClass());
public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
logger.info("Returning Sign Up Success View");
return new ModelAndView("signupSuccess");
}
}
| parambirs/binaryedu | src/main/java/com/binaryedu/web/controllers/SignUpSuccessController.java | Java | mit | 782 | [
30522,
7427,
4012,
1012,
12441,
2098,
2226,
1012,
4773,
1012,
21257,
1025,
12324,
9262,
1012,
22834,
1012,
22834,
10288,
24422,
1025,
12324,
9262,
2595,
1012,
14262,
2615,
7485,
1012,
14262,
2615,
25890,
2595,
24422,
1025,
12324,
9262,
2595,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/**
* Created by Administrator on 2017/3/11.
*/
public class ReverseWordsInSequence {
public void reverseSequence(String str) {
if (str == null) return;
String[] strArray = str.split(" ");
StringBuilder sb = new StringBuilder();
for (int i = strArray.length-1; i >= 0; --i)
sb.append(strArray[i] + " ");
System.out.println(sb);
}
public static void main(String[] args) {
ReverseWordsInSequence r = new ReverseWordsInSequence();
String str = "I am a Students.";
r.reverseSequence(str);
}
}
/**
* Created by Administrator on 2017/3/11.
*/
public class ReverseWordsInSequence {
public String reverseSequence(String str) {
if (str == null || str.length() <= 1)
return str;
StringBuilder sb = new StringBuilder(str);
reverse(sb, 0, str.length() - 1);
int begin = 0, end = 0;
while (end < str.length()) {
while (end < str.length() && sb.charAt(end) != ' ')
end++;
reverse(sb, begin, end - 1);
begin = end + 1;
end = begin;
}
return sb.toString();
}
public void reverse(StringBuilder sb, int start, int end) {
if (sb == null || end <= start)
return;
while (start < end) {
char temp = sb.charAt(start);
sb.setCharAt(start, sb.charAt(end));
sb.setCharAt(end, temp);
start++;
end--;
}
}
public static void main(String[] args) {
ReverseWordsInSequence r = new ReverseWordsInSequence();
String str = "i am a students.";
System.out.print(r.reverseSequence(str));
}
}
| RudyZH/Aim2Offer | 042_ReverseWordsInSequence.java | Java | mit | 1,796 | [
30522,
1013,
1008,
1008,
1008,
2580,
2011,
8911,
2006,
2418,
1013,
1017,
1013,
2340,
1012,
1008,
1013,
2270,
2465,
7901,
22104,
7076,
2063,
4226,
5897,
1063,
2270,
11675,
7901,
3366,
4226,
5897,
1006,
5164,
2358,
2099,
1007,
1063,
2065,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
def test_root(client):
response = client.get('/')
assert response.status_code == 200
assert response.data.decode('utf-8') == 'Hey enlil'
| EliRibble/enlil | tests/api/test_root.py | Python | mit | 150 | [
30522,
13366,
3231,
1035,
7117,
1006,
7396,
1007,
1024,
3433,
1027,
7396,
1012,
2131,
1006,
1005,
1013,
1005,
1007,
20865,
3433,
1012,
3570,
1035,
3642,
1027,
1027,
3263,
20865,
3433,
1012,
2951,
1012,
21933,
3207,
1006,
1005,
21183,
2546,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Catalog\Model\Indexer\Product\Flat;
class State extends \Magento\Catalog\Model\Indexer\AbstractFlatState
{
/**
* Indexer ID in configuration
*/
const INDEXER_ID = 'catalog_product_flat';
/**
* Flat Is Enabled Config XML Path
*/
const INDEXER_ENABLED_XML_PATH = 'catalog/frontend/flat_catalog_product';
/**
* @var \Magento\Catalog\Helper\Product\Flat\Indexer
*/
protected $_productFlatIndexerHelper;
/**
* @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
* @param \Magento\Framework\Indexer\IndexerRegistry $indexerRegistry
* @param \Magento\Catalog\Helper\Product\Flat\Indexer $flatIndexerHelper
* @param bool $isAvailable
*/
public function __construct(
\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
\Magento\Framework\Indexer\IndexerRegistry $indexerRegistry,
\Magento\Catalog\Helper\Product\Flat\Indexer $flatIndexerHelper,
$isAvailable = false
) {
parent::__construct($scopeConfig, $indexerRegistry, $isAvailable);
$this->_productFlatIndexerHelper = $flatIndexerHelper;
}
/**
* @return \Magento\Catalog\Helper\Product\Flat\Indexer
*/
public function getFlatIndexerHelper()
{
return $this->_productFlatIndexerHelper;
}
}
| rajmahesh/magento2-master | vendor/magento/module-catalog/Model/Indexer/Product/Flat/State.php | PHP | gpl-3.0 | 1,470 | [
30522,
1026,
1029,
25718,
1013,
1008,
1008,
1008,
9385,
1075,
2355,
17454,
13663,
1012,
2035,
2916,
9235,
1012,
1008,
2156,
24731,
1012,
19067,
2102,
2005,
6105,
4751,
1012,
1008,
1013,
3415,
15327,
17454,
13663,
1032,
12105,
1032,
2944,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* Copyright (C) 2010---2013 星星(wuweixing)<349446658@qq.com>
*
* This file is part of Wabacus
*
* Wabacus is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.wabacus.system.datatype;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.text.DecimalFormat;
import java.util.HashMap;
import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.wabacus.config.database.type.AbsDatabaseType;
public class IntType extends AbsNumberType
{
private final static Log log=LogFactory.getLog(IntType.class);
private final static Map<String,AbsNumberType> mIntTypeObjects=new HashMap<String,AbsNumberType>();
public Object getColumnValue(ResultSet rs,String column,AbsDatabaseType dbtype)
throws SQLException
{
return Integer.valueOf(rs.getInt(column));
}
public Object getColumnValue(ResultSet rs,int iindex,AbsDatabaseType dbtype)
throws SQLException
{
return Integer.valueOf(rs.getInt(iindex));
}
public void setPreparedStatementValue(int iindex,String value,PreparedStatement pstmt,
AbsDatabaseType dbtype) throws SQLException
{
log.debug("setInt("+iindex+","+value+")");
Object objTmp=label2value(value);
if(objTmp==null)
{
pstmt.setObject(iindex,null,java.sql.Types.INTEGER);
}else
{
pstmt.setInt(iindex,(Integer)objTmp);
}
}
public Class getJavaTypeClass()
{
return Integer.class;
}
public Object label2value(String label)
{
if(label==null||label.trim().equals("")) return null;
if(this.numberformat!=null&&!this.numberformat.trim().equals(""))
{
return Integer.valueOf(this.getNumber(label.trim()).intValue());
}else
{
int idxdot=label.indexOf(".");
if(idxdot==0)
{
label="0";
}else if(idxdot>0)
{
label=label.substring(0,idxdot).trim();
if(label.equals("")) label="0";
}
return Integer.valueOf(label.trim());
}
}
public String value2label(Object value)
{
if(value==null) return "";
if(!(value instanceof Integer)) return String.valueOf(value);
if(this.numberformat!=null&&!this.numberformat.trim().equals(""))
{
DecimalFormat df=new DecimalFormat(this.numberformat);
return df.format((Integer)value);
}else
{
return String.valueOf(value);
}
}
protected Map<String,AbsNumberType> getAllMNumberTypeObjects()
{
return mIntTypeObjects;
}
}
| foxerfly/Wabacus4.1src | src/com/wabacus/system/datatype/IntType.java | Java | gpl-3.0 | 3,450 | [
30522,
1013,
1008,
1008,
9385,
1006,
1039,
1007,
2230,
1011,
1011,
1011,
2286,
1866,
1866,
1006,
8814,
19845,
19612,
1007,
1026,
4090,
2683,
22932,
28756,
27814,
1030,
1053,
4160,
1012,
4012,
1028,
1008,
1008,
2023,
5371,
2003,
2112,
1997,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.