text
stringlengths
2
1.04M
meta
dict
#ifndef AVFORMAT_MATROSKA_H #define AVFORMAT_MATROSKA_H #include "libavcodec/avcodec.h" #include "metadata.h" #include "internal.h" /* EBML version supported */ #define EBML_VERSION 1 /* top-level master-IDs */ #define EBML_ID_HEADER 0x1A45DFA3 /* IDs in the HEADER master */ #define EBML_ID_EBMLVERSION 0x4286 #define EBML_ID_EBMLREADVERSION 0x42F7 #define EBML_ID_EBMLMAXIDLENGTH 0x42F2 #define EBML_ID_EBMLMAXSIZELENGTH 0x42F3 #define EBML_ID_DOCTYPE 0x4282 #define EBML_ID_DOCTYPEVERSION 0x4287 #define EBML_ID_DOCTYPEREADVERSION 0x4285 /* general EBML types */ #define EBML_ID_VOID 0xEC #define EBML_ID_CRC32 0xBF /* * Matroska element IDs, max. 32 bits */ /* toplevel segment */ #define MATROSKA_ID_SEGMENT 0x18538067 /* Matroska top-level master IDs */ #define MATROSKA_ID_INFO 0x1549A966 #define MATROSKA_ID_TRACKS 0x1654AE6B #define MATROSKA_ID_CUES 0x1C53BB6B #define MATROSKA_ID_TAGS 0x1254C367 #define MATROSKA_ID_SEEKHEAD 0x114D9B74 #define MATROSKA_ID_ATTACHMENTS 0x1941A469 #define MATROSKA_ID_CLUSTER 0x1F43B675 #define MATROSKA_ID_CHAPTERS 0x1043A770 /* IDs in the info master */ #define MATROSKA_ID_TIMECODESCALE 0x2AD7B1 #define MATROSKA_ID_DURATION 0x4489 #define MATROSKA_ID_TITLE 0x7BA9 #define MATROSKA_ID_WRITINGAPP 0x5741 #define MATROSKA_ID_MUXINGAPP 0x4D80 #define MATROSKA_ID_DATEUTC 0x4461 #define MATROSKA_ID_SEGMENTUID 0x73A4 /* ID in the tracks master */ #define MATROSKA_ID_TRACKENTRY 0xAE /* IDs in the trackentry master */ #define MATROSKA_ID_TRACKNUMBER 0xD7 #define MATROSKA_ID_TRACKUID 0x73C5 #define MATROSKA_ID_TRACKTYPE 0x83 #define MATROSKA_ID_TRACKVIDEO 0xE0 #define MATROSKA_ID_TRACKAUDIO 0xE1 #define MATROSKA_ID_TRACKOPERATION 0xE2 #define MATROSKA_ID_TRACKCOMBINEPLANES 0xE3 #define MATROSKA_ID_TRACKPLANE 0xE4 #define MATROSKA_ID_TRACKPLANEUID 0xE5 #define MATROSKA_ID_TRACKPLANETYPE 0xE6 #define MATROSKA_ID_CODECID 0x86 #define MATROSKA_ID_CODECPRIVATE 0x63A2 #define MATROSKA_ID_CODECNAME 0x258688 #define MATROSKA_ID_CODECINFOURL 0x3B4040 #define MATROSKA_ID_CODECDOWNLOADURL 0x26B240 #define MATROSKA_ID_CODECDECODEALL 0xAA #define MATROSKA_ID_TRACKNAME 0x536E #define MATROSKA_ID_TRACKLANGUAGE 0x22B59C #define MATROSKA_ID_TRACKFLAGENABLED 0xB9 #define MATROSKA_ID_TRACKFLAGDEFAULT 0x88 #define MATROSKA_ID_TRACKFLAGFORCED 0x55AA #define MATROSKA_ID_TRACKFLAGLACING 0x9C #define MATROSKA_ID_TRACKMINCACHE 0x6DE7 #define MATROSKA_ID_TRACKMAXCACHE 0x6DF8 #define MATROSKA_ID_TRACKDEFAULTDURATION 0x23E383 #define MATROSKA_ID_TRACKCONTENTENCODINGS 0x6D80 #define MATROSKA_ID_TRACKCONTENTENCODING 0x6240 #define MATROSKA_ID_TRACKTIMECODESCALE 0x23314F #define MATROSKA_ID_TRACKMAXBLKADDID 0x55EE /* IDs in the trackvideo master */ #define MATROSKA_ID_VIDEOFRAMERATE 0x2383E3 #define MATROSKA_ID_VIDEODISPLAYWIDTH 0x54B0 #define MATROSKA_ID_VIDEODISPLAYHEIGHT 0x54BA #define MATROSKA_ID_VIDEOPIXELWIDTH 0xB0 #define MATROSKA_ID_VIDEOPIXELHEIGHT 0xBA #define MATROSKA_ID_VIDEOPIXELCROPB 0x54AA #define MATROSKA_ID_VIDEOPIXELCROPT 0x54BB #define MATROSKA_ID_VIDEOPIXELCROPL 0x54CC #define MATROSKA_ID_VIDEOPIXELCROPR 0x54DD #define MATROSKA_ID_VIDEODISPLAYUNIT 0x54B2 #define MATROSKA_ID_VIDEOFLAGINTERLACED 0x9A #define MATROSKA_ID_VIDEOSTEREOMODE 0x53B8 #define MATROSKA_ID_VIDEOASPECTRATIO 0x54B3 #define MATROSKA_ID_VIDEOCOLORSPACE 0x2EB524 /* IDs in the trackaudio master */ #define MATROSKA_ID_AUDIOSAMPLINGFREQ 0xB5 #define MATROSKA_ID_AUDIOOUTSAMPLINGFREQ 0x78B5 #define MATROSKA_ID_AUDIOBITDEPTH 0x6264 #define MATROSKA_ID_AUDIOCHANNELS 0x9F /* IDs in the content encoding master */ #define MATROSKA_ID_ENCODINGORDER 0x5031 #define MATROSKA_ID_ENCODINGSCOPE 0x5032 #define MATROSKA_ID_ENCODINGTYPE 0x5033 #define MATROSKA_ID_ENCODINGCOMPRESSION 0x5034 #define MATROSKA_ID_ENCODINGCOMPALGO 0x4254 #define MATROSKA_ID_ENCODINGCOMPSETTINGS 0x4255 /* ID in the cues master */ #define MATROSKA_ID_POINTENTRY 0xBB /* IDs in the pointentry master */ #define MATROSKA_ID_CUETIME 0xB3 #define MATROSKA_ID_CUETRACKPOSITION 0xB7 /* IDs in the cuetrackposition master */ #define MATROSKA_ID_CUETRACK 0xF7 #define MATROSKA_ID_CUECLUSTERPOSITION 0xF1 #define MATROSKA_ID_CUEBLOCKNUMBER 0x5378 /* IDs in the tags master */ #define MATROSKA_ID_TAG 0x7373 #define MATROSKA_ID_SIMPLETAG 0x67C8 #define MATROSKA_ID_TAGNAME 0x45A3 #define MATROSKA_ID_TAGSTRING 0x4487 #define MATROSKA_ID_TAGLANG 0x447A #define MATROSKA_ID_TAGDEFAULT 0x4484 #define MATROSKA_ID_TAGDEFAULT_BUG 0x44B4 #define MATROSKA_ID_TAGTARGETS 0x63C0 #define MATROSKA_ID_TAGTARGETS_TYPE 0x63CA #define MATROSKA_ID_TAGTARGETS_TYPEVALUE 0x68CA #define MATROSKA_ID_TAGTARGETS_TRACKUID 0x63C5 #define MATROSKA_ID_TAGTARGETS_CHAPTERUID 0x63C4 #define MATROSKA_ID_TAGTARGETS_ATTACHUID 0x63C6 /* IDs in the seekhead master */ #define MATROSKA_ID_SEEKENTRY 0x4DBB /* IDs in the seekpoint master */ #define MATROSKA_ID_SEEKID 0x53AB #define MATROSKA_ID_SEEKPOSITION 0x53AC /* IDs in the cluster master */ #define MATROSKA_ID_CLUSTERTIMECODE 0xE7 #define MATROSKA_ID_CLUSTERPOSITION 0xA7 #define MATROSKA_ID_CLUSTERPREVSIZE 0xAB #define MATROSKA_ID_BLOCKGROUP 0xA0 #define MATROSKA_ID_SIMPLEBLOCK 0xA3 /* IDs in the blockgroup master */ #define MATROSKA_ID_BLOCK 0xA1 #define MATROSKA_ID_BLOCKDURATION 0x9B #define MATROSKA_ID_BLOCKREFERENCE 0xFB /* IDs in the attachments master */ #define MATROSKA_ID_ATTACHEDFILE 0x61A7 #define MATROSKA_ID_FILEDESC 0x467E #define MATROSKA_ID_FILENAME 0x466E #define MATROSKA_ID_FILEMIMETYPE 0x4660 #define MATROSKA_ID_FILEDATA 0x465C #define MATROSKA_ID_FILEUID 0x46AE /* IDs in the chapters master */ #define MATROSKA_ID_EDITIONENTRY 0x45B9 #define MATROSKA_ID_CHAPTERATOM 0xB6 #define MATROSKA_ID_CHAPTERTIMESTART 0x91 #define MATROSKA_ID_CHAPTERTIMEEND 0x92 #define MATROSKA_ID_CHAPTERDISPLAY 0x80 #define MATROSKA_ID_CHAPSTRING 0x85 #define MATROSKA_ID_CHAPLANG 0x437C #define MATROSKA_ID_EDITIONUID 0x45BC #define MATROSKA_ID_EDITIONFLAGHIDDEN 0x45BD #define MATROSKA_ID_EDITIONFLAGDEFAULT 0x45DB #define MATROSKA_ID_EDITIONFLAGORDERED 0x45DD #define MATROSKA_ID_CHAPTERUID 0x73C4 #define MATROSKA_ID_CHAPTERFLAGHIDDEN 0x98 #define MATROSKA_ID_CHAPTERFLAGENABLED 0x4598 #define MATROSKA_ID_CHAPTERPHYSEQUIV 0x63C3 typedef enum { MATROSKA_TRACK_TYPE_NONE = 0x0, MATROSKA_TRACK_TYPE_VIDEO = 0x1, MATROSKA_TRACK_TYPE_AUDIO = 0x2, MATROSKA_TRACK_TYPE_COMPLEX = 0x3, MATROSKA_TRACK_TYPE_LOGO = 0x10, MATROSKA_TRACK_TYPE_SUBTITLE = 0x11, MATROSKA_TRACK_TYPE_CONTROL = 0x20, } MatroskaTrackType; typedef enum { MATROSKA_TRACK_ENCODING_COMP_ZLIB = 0, MATROSKA_TRACK_ENCODING_COMP_BZLIB = 1, MATROSKA_TRACK_ENCODING_COMP_LZO = 2, MATROSKA_TRACK_ENCODING_COMP_HEADERSTRIP = 3, } MatroskaTrackEncodingCompAlgo; typedef enum { MATROSKA_VIDEO_STEREOMODE_TYPE_MONO = 0, MATROSKA_VIDEO_STEREOMODE_TYPE_LEFT_RIGHT = 1, MATROSKA_VIDEO_STEREOMODE_TYPE_BOTTOM_TOP = 2, MATROSKA_VIDEO_STEREOMODE_TYPE_TOP_BOTTOM = 3, MATROSKA_VIDEO_STEREOMODE_TYPE_CHECKERBOARD_RL = 4, MATROSKA_VIDEO_STEREOMODE_TYPE_CHECKERBOARD_LR = 5, MATROSKA_VIDEO_STEREOMODE_TYPE_ROW_INTERLEAVED_RL = 6, MATROSKA_VIDEO_STEREOMODE_TYPE_ROW_INTERLEAVED_LR = 7, MATROSKA_VIDEO_STEREOMODE_TYPE_COL_INTERLEAVED_RL = 8, MATROSKA_VIDEO_STEREOMODE_TYPE_COL_INTERLEAVED_LR = 9, MATROSKA_VIDEO_STEREOMODE_TYPE_ANAGLYPH_CYAN_RED = 10, MATROSKA_VIDEO_STEREOMODE_TYPE_RIGHT_LEFT = 11, MATROSKA_VIDEO_STEREOMODE_TYPE_ANAGLYPH_GREEN_MAG = 12, MATROSKA_VIDEO_STEREOMODE_TYPE_BOTH_EYES_BLOCK_LR = 13, MATROSKA_VIDEO_STEREOMODE_TYPE_BOTH_EYES_BLOCK_RL = 14, } MatroskaVideoStereoModeType; /* * Matroska Codec IDs, strings */ typedef struct CodecTags{ char str[20]; enum CodecID id; }CodecTags; /* max. depth in the EBML tree structure */ #define EBML_MAX_DEPTH 16 #define MATROSKA_VIDEO_STEREO_MODE_COUNT 15 #define MATROSKA_VIDEO_STEREO_PLANE_COUNT 3 extern const CodecTags ff_mkv_codec_tags[]; extern const CodecMime ff_mkv_mime_tags[]; extern const AVMetadataConv ff_mkv_metadata_conv[]; extern const char * const matroska_video_stereo_mode[MATROSKA_VIDEO_STEREO_MODE_COUNT]; extern const char * const matroska_video_stereo_plane[MATROSKA_VIDEO_STEREO_PLANE_COUNT]; #endif /* AVFORMAT_MATROSKA_H */
{ "content_hash": "7900b1b61c327891c2b7faf6648eb823", "timestamp": "", "source": "github", "line_count": 247, "max_line_length": 89, "avg_line_length": 35.03238866396761, "alnum_prop": 0.7606610424130359, "repo_name": "stainberg/android_FFMPEG", "id": "6f6ab1e92953f1a3ba13dd702c9fcf40cbe8750c", "size": "9486", "binary": false, "copies": "10", "ref": "refs/heads/master", "path": "jni/libffmpeg/libavformat/matroska.h", "mode": "33188", "license": "mit", "language": [ { "name": "Assembly", "bytes": "1349647" }, { "name": "C", "bytes": "23354469" }, { "name": "C++", "bytes": "1072041" }, { "name": "CSS", "bytes": "18642" }, { "name": "Java", "bytes": "12732" }, { "name": "Objective-C", "bytes": "74127" }, { "name": "Perl", "bytes": "12611" }, { "name": "Shell", "bytes": "38067" }, { "name": "Verilog", "bytes": "2917" } ], "symlink_target": "" }
$LOAD_PATH.unshift File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift File.expand_path('./helpers', __FILE__) $LOAD_PATH.unshift File.expand_path('./namespace', __FILE__) require 'simplecov' require 'codecov' SimpleCov.start SimpleCov.formatter = SimpleCov::Formatter::Codecov require 'etcdv3' require 'helpers/test_instance' require 'helpers/connections' require 'helpers/metadata_passthrough' require 'helpers/shared_examples_for_timeout' $instance = Helpers::TestInstance.new RSpec.configure do |config| config.include(Helpers::Connections) config.include(Helpers::MetadataPassthrough) config.expect_with :rspec do |expectations| expectations.include_chain_clauses_in_custom_matcher_descriptions = true end config.mock_with :rspec do |mocks| mocks.verify_partial_doubles = true end config.shared_context_metadata_behavior = :apply_to_host_groups config.before(:suite) do $stderr = File.open(File::NULL, "w") $instance.start end config.after(:suite) do $instance.stop end end
{ "content_hash": "9c12cc4d28c07135537da0ba9187e15f", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 76, "avg_line_length": 27.157894736842106, "alnum_prop": 0.7422480620155039, "repo_name": "davissp14/etcdv3-ruby", "id": "885f54ed79d0e3625858877f7852ca12a616877a", "size": "1032", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "spec/spec_helper.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "66405" } ], "symlink_target": "" }
Copyright (c) 2013, Stuart Knightley 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 require1k 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 STUART KNIGHTLEY 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.
{ "content_hash": "51d884d0bd862dce2c47725ba8c3415e", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 79, "avg_line_length": 55.370370370370374, "alnum_prop": 0.7939799331103679, "repo_name": "kierandenshi/require1k", "id": "88ed9b0401d22e69e7b2212cfa0f365cc58cfb5c", "size": "1495", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "LICENSE.md", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "HTML", "bytes": "553" }, { "name": "JavaScript", "bytes": "7500" } ], "symlink_target": "" }
using System; using System.Configuration; using System.IO; using System.Xml.Linq; using Helsenorge.Messaging.Abstractions; using Helsenorge.Messaging.Server.NLog; using Helsenorge.Registries; using Microsoft.Extensions.Caching.Distributed; using Microsoft.Extensions.Caching.Memory; using Microsoft.Extensions.CommandLineUtils; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; using NLog; using NLog.Config; using ILogger = Microsoft.Extensions.Logging.ILogger; namespace Helsenorge.Messaging.Server { class Program { private static ILogger _logger; private static ILoggerFactory _loggerFactory; private static IMessagingServer _messagingServer; private static ServerSettings _serverSettings; static int Main(string[] args) { var app = new CommandLineApplication(); app.HelpOption("-?|-h|--help"); var profileArgument = app.Argument("[profile]", "The name of the json profile file to use (excluded file extension)"); app.OnExecute(() => { if (string.IsNullOrEmpty(profileArgument.Value)) { app.ShowHelp(); return 2; } Configure(profileArgument.Value); _messagingServer.Start(); string input; do { Console.WriteLine("Type 'q' to exit."); input = Console.ReadLine(); } while (input != "q"); _messagingServer.Stop(TimeSpan.FromSeconds(10)); return 0; }); int exitCode = app.Execute(args); #if DEBUG Console.WriteLine(); Console.WriteLine("Press any key to continue. . ."); Console.ReadKey(true); #endif return exitCode; } private static void Configure(string profile) { // read configuration values var builder = new Microsoft.Extensions.Configuration.ConfigurationBuilder() .SetBasePath(AppDomain.CurrentDomain.BaseDirectory) .AddJsonFile("appsettings.json", false) .AddJsonFile($"{profile}.json", false); var configurationRoot = builder.Build(); // configure logging _loggerFactory = new LoggerFactory(); _loggerFactory.AddConsole(configurationRoot.GetSection("Logging")); _loggerFactory.AddNLog(); LogManager.Configuration = new XmlLoggingConfiguration("nlog.config", true); _logger = _loggerFactory.CreateLogger("TestServer"); // configure caching var distributedCache = DistributedCacheFactory.Create(); // set up address registry var addressRegistrySettings = new AddressRegistrySettings(); configurationRoot.GetSection("AddressRegistrySettings").Bind(addressRegistrySettings); addressRegistrySettings.WcfConfiguration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); var addressRegistry = new AddressRegistry(addressRegistrySettings, distributedCache); // set up collaboration registry var collaborationProtocolRegistrySettings = new CollaborationProtocolRegistrySettings(); configurationRoot.GetSection("CollaborationProtocolRegistrySettings").Bind(collaborationProtocolRegistrySettings); collaborationProtocolRegistrySettings.WcfConfiguration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); var collaborationProtocolRegistry = new CollaborationProtocolRegistry(collaborationProtocolRegistrySettings, distributedCache, addressRegistry); _serverSettings = new ServerSettings(); configurationRoot.GetSection("ServerSettings").Bind(_serverSettings); // set up messaging var messagingSettings = new MessagingSettings(); configurationRoot.GetSection("MessagingSettings").Bind(messagingSettings); messagingSettings.ServiceBus.Synchronous.ReplyQueueMapping.Add(Environment.MachineName, "DUMMY"); // we just need a value, it will never be used messagingSettings.LogPayload = true; _messagingServer = new MessagingServer(messagingSettings, _logger, _loggerFactory, collaborationProtocolRegistry, addressRegistry); _messagingServer.RegisterAsynchronousMessageReceivedStartingCallback((m) => { MappedDiagnosticsLogicalContext.Set("correlationId", m.MessageId); }); _messagingServer.RegisterAsynchronousMessageReceivedCallback((m) => { if (m.Payload.ToString().Contains("ThrowException")) { throw new InvalidOperationException(); } var path = Path.Combine(_serverSettings.DestinationDirectory, "Asynchronous"); if (Directory.Exists(path) == false) { Directory.CreateDirectory(path); } var fileName = Path.Combine(path, m.MessageId + ".xml"); using (var sw = File.CreateText(fileName)) { m.Payload.Save(sw); } }); _messagingServer.RegisterAsynchronousMessageReceivedCompletedCallback((m) => { MappedDiagnosticsLogicalContext.Set("correlationId", m.MessageId); }); _messagingServer.RegisterSynchronousMessageReceivedStartingCallback((m) => { MappedDiagnosticsLogicalContext.Set("correlationId", string.Empty);// reset correlation id }); _messagingServer.RegisterSynchronousMessageReceivedCallback((m) => { var path = Path.Combine(_serverSettings.DestinationDirectory, "Synchronous"); if (Directory.Exists(path) == false) { Directory.CreateDirectory(path); } var fileName = Path.Combine(path, m.MessageId + ".xml"); using (var sw = File.CreateText(fileName)) { m.Payload.Save(sw); } return new XDocument(new XElement("DummyResponse")); }); _messagingServer.RegisterSynchronousMessageReceivedCompletedCallback((m) => { MappedDiagnosticsLogicalContext.Set("correlationId", string.Empty); // reset correlation id }); } } internal class ServerSettings { public string DestinationDirectory { get; set; } } }
{ "content_hash": "8fb94573849f94ba2870b9ede7c4eedb", "timestamp": "", "source": "github", "line_count": 169, "max_line_length": 156, "avg_line_length": 40.46153846153846, "alnum_prop": 0.6121673003802282, "repo_name": "chriscena/Helsenorge.Messaging", "id": "7c3a0944e0e6663a7825e867bf40f1075a45403d", "size": "6838", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Helsenorge.Messaging.Server/Program.cs", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "318" }, { "name": "C#", "bytes": "832343" }, { "name": "PowerShell", "bytes": "360" }, { "name": "Smalltalk", "bytes": "3430" } ], "symlink_target": "" }
package browser import ( "os" "os/exec" "runtime" ) // Commands returns a list of possible commands to use to open a url. func Commands() [][]string { var cmds [][]string if exe := os.Getenv("BROWSER"); exe != "" { cmds = append(cmds, []string{exe}) } switch runtime.GOOS { case "darwin": cmds = append(cmds, []string{"/usr/bin/open"}) case "windows": cmds = append(cmds, []string{"cmd", "/c", "start"}) default: cmds = append(cmds, []string{"xdg-open"}) } cmds = append(cmds, []string{"chrome"}, []string{"google-chrome"}, []string{"firefox"}) return cmds } // Open tries to open url in a browser and reports whether it succeeded. func Open(url string) bool { for _, args := range Commands() { cmd := exec.Command(args[0], append(args[1:], url)...) if cmd.Start() == nil { return true } } return false }
{ "content_hash": "0051d1dc41425ea15d2f8e6ec8612456", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 88, "avg_line_length": 23.36111111111111, "alnum_prop": 0.6266349583828775, "repo_name": "momchil-velikov/go", "id": "11e65c2feb62abe296bc2e5c6f7405f86ec71dd1", "size": "1077", "binary": false, "copies": "1", "ref": "refs/heads/dev.chill", "path": "src/cmd/internal/browser/browser.go", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Assembly", "bytes": "1989835" }, { "name": "Awk", "bytes": "450" }, { "name": "Batchfile", "bytes": "7351" }, { "name": "C", "bytes": "187779" }, { "name": "C++", "bytes": "1370" }, { "name": "CSS", "bytes": "8" }, { "name": "FORTRAN", "bytes": "394" }, { "name": "Go", "bytes": "32611699" }, { "name": "HTML", "bytes": "1806598" }, { "name": "JavaScript", "bytes": "2550" }, { "name": "Logos", "bytes": "1248" }, { "name": "Makefile", "bytes": "748" }, { "name": "Perl", "bytes": "34825" }, { "name": "Protocol Buffer", "bytes": "1698" }, { "name": "Python", "bytes": "12446" }, { "name": "Shell", "bytes": "66347" } ], "symlink_target": "" }
/** * @fileoverview Utility for caching lint results. * @author Kevin Partington */ "use strict"; //----------------------------------------------------------------------------- // Requirements //----------------------------------------------------------------------------- const assert = require("assert"); const fs = require("fs"); const fileEntryCache = require("file-entry-cache"); const stringify = require("json-stable-stringify-without-jsonify"); const pkg = require("../../package.json"); const hash = require("./hash"); //----------------------------------------------------------------------------- // Helpers //----------------------------------------------------------------------------- const configHashCache = new WeakMap(); /** * Calculates the hash of the config * @param {ConfigArray} config The config. * @returns {string} The hash of the config */ function hashOfConfigFor(config) { if (!configHashCache.has(config)) { configHashCache.set(config, hash(`${pkg.version}_${stringify(config)}`)); } return configHashCache.get(config); } //----------------------------------------------------------------------------- // Public Interface //----------------------------------------------------------------------------- /** * Lint result cache. This wraps around the file-entry-cache module, * transparently removing properties that are difficult or expensive to * serialize and adding them back in on retrieval. */ class LintResultCache { /** * Creates a new LintResultCache instance. * @constructor * @param {string} cacheFileLocation The cache file location. * configuration lookup by file path). */ constructor(cacheFileLocation) { assert(cacheFileLocation, "Cache file location is required"); this.fileEntryCache = fileEntryCache.create(cacheFileLocation); } /** * Retrieve cached lint results for a given file path, if present in the * cache. If the file is present and has not been changed, rebuild any * missing result information. * @param {string} filePath The file for which to retrieve lint results. * @param {ConfigArray} config The config of the file. * @returns {Object|null} The rebuilt lint results, or null if the file is * changed or not in the filesystem. */ getCachedLintResults(filePath, config) { /* * Cached lint results are valid if and only if: * 1. The file is present in the filesystem * 2. The file has not changed since the time it was previously linted * 3. The ESLint configuration has not changed since the time the file * was previously linted * If any of these are not true, we will not reuse the lint results. */ const fileDescriptor = this.fileEntryCache.getFileDescriptor(filePath); const hashOfConfig = hashOfConfigFor(config); const changed = fileDescriptor.changed || fileDescriptor.meta.hashOfConfig !== hashOfConfig; if (fileDescriptor.notFound || changed) { return null; } // If source is present but null, need to reread the file from the filesystem. if (fileDescriptor.meta.results && fileDescriptor.meta.results.source === null) { fileDescriptor.meta.results.source = fs.readFileSync(filePath, "utf-8"); } return fileDescriptor.meta.results; } /** * Set the cached lint results for a given file path, after removing any * information that will be both unnecessary and difficult to serialize. * Avoids caching results with an "output" property (meaning fixes were * applied), to prevent potentially incorrect results if fixes are not * written to disk. * @param {string} filePath The file for which to set lint results. * @param {ConfigArray} config The config of the file. * @param {Object} result The lint result to be set for the file. * @returns {void} */ setCachedLintResults(filePath, config, result) { if (result && Object.prototype.hasOwnProperty.call(result, "output")) { return; } const fileDescriptor = this.fileEntryCache.getFileDescriptor(filePath); if (fileDescriptor && !fileDescriptor.notFound) { // Serialize the result, except that we want to remove the file source if present. const resultToSerialize = Object.assign({}, result); /* * Set result.source to null. * In `getCachedLintResults`, if source is explicitly null, we will * read the file from the filesystem to set the value again. */ if (Object.prototype.hasOwnProperty.call(resultToSerialize, "source")) { resultToSerialize.source = null; } fileDescriptor.meta.results = resultToSerialize; fileDescriptor.meta.hashOfConfig = hashOfConfigFor(config); } } /** * Persists the in-memory cache to disk. * @returns {void} */ reconcile() { this.fileEntryCache.reconcile(); } } module.exports = LintResultCache;
{ "content_hash": "d367950a0b2288a2019f9ace1c62ea2d", "timestamp": "", "source": "github", "line_count": 142, "max_line_length": 100, "avg_line_length": 36.443661971830984, "alnum_prop": 0.5947826086956521, "repo_name": "zhengxiexie/blog", "id": "9408780fb022c69a236cfdf76563ebe11efd94f7", "size": "5175", "binary": false, "copies": "6", "ref": "refs/heads/master", "path": "node_modules/eslint/lib/cli-engine/lint-result-cache.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "98499" }, { "name": "HTML", "bytes": "598782" }, { "name": "JavaScript", "bytes": "38652" }, { "name": "Python", "bytes": "794" }, { "name": "Shell", "bytes": "65" } ], "symlink_target": "" }
#ifndef ARM_COMPUTE_CL_FLOOR_KERNEL_H #define ARM_COMPUTE_CL_FLOOR_KERNEL_H #include "src/core/common/Macros.h" #include "src/gpu/cl/ClCompileContext.h" #include "src/gpu/cl/IClKernel.h" namespace arm_compute { namespace opencl { namespace kernels { /** OpenCL kernel to perform a floor operation */ class ClFloorKernel : public IClKernel { public: ClFloorKernel(); ARM_COMPUTE_DISALLOW_COPY_ALLOW_MOVE(ClFloorKernel); /** Configure kernel for a given list of arguments * * @param[in] compile_context The compile context to be used. * @param[in] src Source tensor info. Data type supported: F16/F32. * @param[out] dst Destination tensor info. Same as @p src */ void configure(const ClCompileContext &compile_context, const ITensorInfo *src, ITensorInfo *dst); /** Static function to check if given info will lead to a valid configuration * * Similar to @ref ClFloorKernel::configure() * * @return a status */ static Status validate(const ITensorInfo *src, const ITensorInfo *dst); // Inherited methods overridden: void run_op(ITensorPack &tensors, const Window &window, cl::CommandQueue &queue) override; }; } // namespace kernels } // namespace opencl } // namespace arm_compute #endif /* ARM_COMPUTE_CL_FLOOR_KERNEL_H */
{ "content_hash": "5997be2d604a2a6976930a14e2ced5a0", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 102, "avg_line_length": 31.785714285714285, "alnum_prop": 0.6928838951310862, "repo_name": "ARM-software/ComputeLibrary", "id": "6e413340ba16fd302b321b2156fe3a0aa43937e2", "size": "2491", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "src/gpu/cl/kernels/ClFloorKernel.h", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "3062248" }, { "name": "C++", "bytes": "34872664" }, { "name": "Go", "bytes": "4183" }, { "name": "Python", "bytes": "122193" }, { "name": "Shell", "bytes": "3515" } ], "symlink_target": "" }
cask "dropbox-beta" do version "135.3.4177" sha256 "5af5f00a868bf6f4599033f9837eadd8466828ebc2f1706f76fbb77064d690fe" url "https://www.dropbox.com/download?build=#{version}&plat=mac&type=full", verified: "dropbox.com/" name "Dropbox" desc "Client for the Dropbox cloud storage service" homepage "https://www.dropboxforum.com/t5/Desktop-client-builds/bd-p/101003016" livecheck do url :homepage strategy :page_match regex(/Beta\sBuild\s(\d+(?:\.\d+)+)/i) end auto_updates true conflicts_with cask: "dropbox" app "Dropbox.app" uninstall launchctl: "com.dropbox.DropboxMacUpdate.agent" zap trash: [ "/Library/DropboxHelperTools", "~/.dropbox", "~/Library/Application Scripts/com.dropbox.foldertagger", "~/Library/Application Scripts/com.getdropbox.dropbox.garcon", "~/Library/Application Support/Dropbox", "~/Library/Caches/CloudKit/com.apple.bird/iCloud.com.getdropbox.Dropbox", "~/Library/Caches/com.dropbox.DropboxMacUpdate", "~/Library/Caches/com.getdropbox.DropboxMetaInstaller", "~/Library/Caches/com.getdropbox.dropbox", "~/Library/Caches/com.plausiblelabs.crashreporter.data/com.dropbox.DropboxMacUpdate", "~/Library/Containers/com.dropbox.foldertagger", "~/Library/Containers/com.getdropbox.dropbox.garcon", "~/Library/Dropbox", "~/Library/Group Containers/com.getdropbox.dropbox.garcon", "~/Library/LaunchAgents/com.dropbox.DropboxMacUpdate.agent.plist", "~/Library/Logs/Dropbox_debug.log", "~/Library/Preferences/com.dropbox.DropboxMacUpdate.plist", "~/Library/Preferences/com.dropbox.DropboxMonitor.plist", "~/Library/Preferences/com.dropbox.tungsten.helper.plist", "~/Library/Preferences/com.getdropbox.dropbox.plist", ] end
{ "content_hash": "21c7d974867cce3b2d371c3eb6a0797a", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 89, "avg_line_length": 38.391304347826086, "alnum_prop": 0.7293318233295584, "repo_name": "404NetworkError/homebrew-versions", "id": "01138ff98be38fc0f484873084c689fcf8a4696d", "size": "1766", "binary": false, "copies": "1", "ref": "refs/heads/main-fork", "path": "Casks/dropbox-beta.rb", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "Ruby", "bytes": "160183" }, { "name": "Shell", "bytes": "4423" } ], "symlink_target": "" }
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> <title>Function store</title> <link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css"> <meta name="generator" content="DocBook XSL Stylesheets V1.76.1"> <link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset"> <link rel="up" href="../../program_options/reference.html#header.boost.program_options.variables_map_hpp" title="Header &lt;boost/program_options/variables_map.hpp&gt;"> <link rel="prev" href="store_idp66588800.html" title="Function store"> <link rel="next" href="notify.html" title="Function notify"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> <table cellpadding="2" width="100%"><tr> <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td> <td align="center"><a href="../../../../index.html">Home</a></td> <td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td> <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> <td align="center"><a href="../../../../more/index.htm">More</a></td> </tr></table> <hr> <div class="spirit-nav"> <a accesskey="p" href="store_idp66588800.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../program_options/reference.html#header.boost.program_options.variables_map_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="notify.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a> </div> <div class="refentry"> <a name="boost.program_options.store_idp66465904"></a><div class="titlepage"></div> <div class="refnamediv"> <h2><span class="refentrytitle">Function store</span></h2> <p>boost::program_options::store</p> </div> <h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2> <div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../program_options/reference.html#header.boost.program_options.variables_map_hpp" title="Header &lt;boost/program_options/variables_map.hpp&gt;">boost/program_options/variables_map.hpp</a>&gt; </span> <span class="identifier">BOOST_PROGRAM_OPTIONS_DECL</span> <span class="keyword">void</span> <span class="identifier">store</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="basic_parsed_options.html" title="Class template basic_parsed_options">basic_parsed_options</a><span class="special">&lt;</span> <span class="keyword">wchar_t</span> <span class="special">&gt;</span> <span class="special">&amp;</span> options<span class="special">,</span> <a class="link" href="variables_map.html" title="Class variables_map">variables_map</a> <span class="special">&amp;</span> m<span class="special">)</span><span class="special">;</span></pre></div> <div class="refsect1"> <a name="idp122357392"></a><h2>Description</h2> <p>Stores in 'm' all options that are defined in 'options'. If 'm' already has a non-defaulted value of an option, that value is not changed, even if 'options' specify some value. This is wide character variant. </p> </div> </div> <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> <td align="left"></td> <td align="right"><div class="copyright-footer">Copyright &#169; 2002-2004 Vladimir Prus<p>Distributed under the Boost Software License, Version 1.0. (See accompanying file <code class="filename">LICENSE_1_0.txt</code> or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) </p> </div></td> </tr></table> <hr> <div class="spirit-nav"> <a accesskey="p" href="store_idp66588800.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../program_options/reference.html#header.boost.program_options.variables_map_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="notify.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a> </div> </body> </html>
{ "content_hash": "ebab25d22a80150d454b2a9223b8f78c", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 593, "avg_line_length": 82.96363636363637, "alnum_prop": 0.6760902914749068, "repo_name": "hand-iemura/lightpng", "id": "a1dd470aee1f6704c2136404194e11bcbf0f44af", "size": "4563", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "boost_1_53_0/doc/html/boost/program_options/store_idp66465904.html", "mode": "33188", "license": "mit", "language": [ { "name": "Assembly", "bytes": "139512" }, { "name": "Batchfile", "bytes": "43970" }, { "name": "C", "bytes": "2306793" }, { "name": "C#", "bytes": "40804" }, { "name": "C++", "bytes": "139009726" }, { "name": "CMake", "bytes": "1741" }, { "name": "CSS", "bytes": "309758" }, { "name": "Cuda", "bytes": "26749" }, { "name": "FORTRAN", "bytes": "1387" }, { "name": "Groff", "bytes": "8039" }, { "name": "HTML", "bytes": "139153356" }, { "name": "IDL", "bytes": "14" }, { "name": "JavaScript", "bytes": "132031" }, { "name": "Lex", "bytes": "1255" }, { "name": "M4", "bytes": "29689" }, { "name": "Makefile", "bytes": "1074346" }, { "name": "Max", "bytes": "36857" }, { "name": "Objective-C", "bytes": "3745" }, { "name": "PHP", "bytes": "59030" }, { "name": "Perl", "bytes": "29502" }, { "name": "Perl6", "bytes": "2053" }, { "name": "Python", "bytes": "1710815" }, { "name": "QML", "bytes": "593" }, { "name": "Rebol", "bytes": "354" }, { "name": "Shell", "bytes": "376263" }, { "name": "Tcl", "bytes": "1172" }, { "name": "TeX", "bytes": "13404" }, { "name": "XSLT", "bytes": "761090" }, { "name": "Yacc", "bytes": "18910" } ], "symlink_target": "" }
using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.IO; using System.Linq; using System.Net.Http; using System.Net.Http.Formatting; using System.Net.Http.Headers; using System.Web.Http.Description; using System.Xml.Linq; using Newtonsoft.Json; namespace Loadi.Areas.HelpPage { /// <summary> /// This class will generate the samples for the help page. /// </summary> public class HelpPageSampleGenerator { /// <summary> /// Initializes a new instance of the <see cref="HelpPageSampleGenerator"/> class. /// </summary> public HelpPageSampleGenerator() { ActualHttpMessageTypes = new Dictionary<HelpPageSampleKey, Type>(); ActionSamples = new Dictionary<HelpPageSampleKey, object>(); SampleObjects = new Dictionary<Type, object>(); } /// <summary> /// Gets CLR types that are used as the content of <see cref="HttpRequestMessage"/> or <see cref="HttpResponseMessage"/>. /// </summary> public IDictionary<HelpPageSampleKey, Type> ActualHttpMessageTypes { get; internal set; } /// <summary> /// Gets the objects that are used directly as samples for certain actions. /// </summary> public IDictionary<HelpPageSampleKey, object> ActionSamples { get; internal set; } /// <summary> /// Gets the objects that are serialized as samples by the supported formatters. /// </summary> public IDictionary<Type, object> SampleObjects { get; internal set; } /// <summary> /// Gets the request body samples for a given <see cref="ApiDescription"/>. /// </summary> /// <param name="api">The <see cref="ApiDescription"/>.</param> /// <returns>The samples keyed by media type.</returns> public IDictionary<MediaTypeHeaderValue, object> GetSampleRequests(ApiDescription api) { return GetSample(api, SampleDirection.Request); } /// <summary> /// Gets the response body samples for a given <see cref="ApiDescription"/>. /// </summary> /// <param name="api">The <see cref="ApiDescription"/>.</param> /// <returns>The samples keyed by media type.</returns> public IDictionary<MediaTypeHeaderValue, object> GetSampleResponses(ApiDescription api) { return GetSample(api, SampleDirection.Response); } /// <summary> /// Gets the request or response body samples. /// </summary> /// <param name="api">The <see cref="ApiDescription"/>.</param> /// <param name="sampleDirection">The value indicating whether the sample is for a request or for a response.</param> /// <returns>The samples keyed by media type.</returns> public virtual IDictionary<MediaTypeHeaderValue, object> GetSample(ApiDescription api, SampleDirection sampleDirection) { if (api == null) { throw new ArgumentNullException("api"); } string controllerName = api.ActionDescriptor.ControllerDescriptor.ControllerName; string actionName = api.ActionDescriptor.ActionName; IEnumerable<string> parameterNames = api.ParameterDescriptions.Select(p => p.Name); Collection<MediaTypeFormatter> formatters; Type type = ResolveType(api, controllerName, actionName, parameterNames, sampleDirection, out formatters); var samples = new Dictionary<MediaTypeHeaderValue, object>(); // Use the samples provided directly for actions var actionSamples = GetAllActionSamples(controllerName, actionName, parameterNames, sampleDirection); foreach (var actionSample in actionSamples) { samples.Add(actionSample.Key.MediaType, WrapSampleIfString(actionSample.Value)); } // Do the sample generation based on formatters only if an action doesn't return an HttpResponseMessage. // Here we cannot rely on formatters because we don't know what's in the HttpResponseMessage, it might not even use formatters. if (type != null && !typeof(HttpResponseMessage).IsAssignableFrom(type)) { object sampleObject = GetSampleObject(type); foreach (var formatter in formatters) { foreach (MediaTypeHeaderValue mediaType in formatter.SupportedMediaTypes) { if (!samples.ContainsKey(mediaType)) { object sample = GetActionSample(controllerName, actionName, parameterNames, type, formatter, mediaType, sampleDirection); // If no sample found, try generate sample using formatter and sample object if (sample == null && sampleObject != null) { sample = WriteSampleObjectUsingFormatter(formatter, sampleObject, type, mediaType); } samples.Add(mediaType, WrapSampleIfString(sample)); } } } } return samples; } /// <summary> /// Search for samples that are provided directly through <see cref="ActionSamples"/>. /// </summary> /// <param name="controllerName">Name of the controller.</param> /// <param name="actionName">Name of the action.</param> /// <param name="parameterNames">The parameter names.</param> /// <param name="type">The CLR type.</param> /// <param name="formatter">The formatter.</param> /// <param name="mediaType">The media type.</param> /// <param name="sampleDirection">The value indicating whether the sample is for a request or for a response.</param> /// <returns>The sample that matches the parameters.</returns> public virtual object GetActionSample(string controllerName, string actionName, IEnumerable<string> parameterNames, Type type, MediaTypeFormatter formatter, MediaTypeHeaderValue mediaType, SampleDirection sampleDirection) { object sample; // First, try get sample provided for a specific mediaType, controllerName, actionName and parameterNames. // If not found, try get the sample provided for a specific mediaType, controllerName and actionName regardless of the parameterNames // If still not found, try get the sample provided for a specific type and mediaType if (ActionSamples.TryGetValue(new HelpPageSampleKey(mediaType, sampleDirection, controllerName, actionName, parameterNames), out sample) || ActionSamples.TryGetValue(new HelpPageSampleKey(mediaType, sampleDirection, controllerName, actionName, new[] { "*" }), out sample) || ActionSamples.TryGetValue(new HelpPageSampleKey(mediaType, type), out sample)) { return sample; } return null; } /// <summary> /// Gets the sample object that will be serialized by the formatters. /// First, it will look at the <see cref="SampleObjects"/>. If no sample object is found, it will try to create one using <see cref="ObjectGenerator"/>. /// </summary> /// <param name="type">The type.</param> /// <returns>The sample object.</returns> public virtual object GetSampleObject(Type type) { object sampleObject; if (!SampleObjects.TryGetValue(type, out sampleObject)) { // Try create a default sample object ObjectGenerator objectGenerator = new ObjectGenerator(); sampleObject = objectGenerator.GenerateObject(type); } return sampleObject; } /// <summary> /// Resolves the type of the action parameter or return value when <see cref="HttpRequestMessage"/> or <see cref="HttpResponseMessage"/> is used. /// </summary> /// <param name="api">The <see cref="ApiDescription"/>.</param> /// <param name="controllerName">Name of the controller.</param> /// <param name="actionName">Name of the action.</param> /// <param name="parameterNames">The parameter names.</param> /// <param name="sampleDirection">The value indicating whether the sample is for a request or a response.</param> /// <param name="formatters">The formatters.</param> [SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", Justification = "This is only used in advanced scenarios.")] public virtual Type ResolveType(ApiDescription api, string controllerName, string actionName, IEnumerable<string> parameterNames, SampleDirection sampleDirection, out Collection<MediaTypeFormatter> formatters) { if (!Enum.IsDefined(typeof(SampleDirection), sampleDirection)) { throw new InvalidEnumArgumentException("sampleDirection", (int)sampleDirection, typeof(SampleDirection)); } if (api == null) { throw new ArgumentNullException("api"); } Type type; if (ActualHttpMessageTypes.TryGetValue(new HelpPageSampleKey(sampleDirection, controllerName, actionName, parameterNames), out type) || ActualHttpMessageTypes.TryGetValue(new HelpPageSampleKey(sampleDirection, controllerName, actionName, new[] { "*" }), out type)) { // Re-compute the supported formatters based on type Collection<MediaTypeFormatter> newFormatters = new Collection<MediaTypeFormatter>(); foreach (var formatter in api.ActionDescriptor.Configuration.Formatters) { if (IsFormatSupported(sampleDirection, formatter, type)) { newFormatters.Add(formatter); } } formatters = newFormatters; } else { switch (sampleDirection) { case SampleDirection.Request: ApiParameterDescription requestBodyParameter = api.ParameterDescriptions.FirstOrDefault(p => p.Source == ApiParameterSource.FromBody); type = requestBodyParameter == null ? null : requestBodyParameter.ParameterDescriptor.ParameterType; formatters = api.SupportedRequestBodyFormatters; break; case SampleDirection.Response: default: type = api.ResponseDescription.ResponseType ?? api.ResponseDescription.DeclaredType; formatters = api.SupportedResponseFormatters; break; } } return type; } /// <summary> /// Writes the sample object using formatter. /// </summary> /// <param name="formatter">The formatter.</param> /// <param name="value">The value.</param> /// <param name="type">The type.</param> /// <param name="mediaType">Type of the media.</param> /// <returns></returns> [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "The exception is recorded as InvalidSample.")] public virtual object WriteSampleObjectUsingFormatter(MediaTypeFormatter formatter, object value, Type type, MediaTypeHeaderValue mediaType) { if (formatter == null) { throw new ArgumentNullException("formatter"); } if (mediaType == null) { throw new ArgumentNullException("mediaType"); } object sample = String.Empty; MemoryStream ms = null; HttpContent content = null; try { if (formatter.CanWriteType(type)) { ms = new MemoryStream(); content = new ObjectContent(type, value, formatter, mediaType); formatter.WriteToStreamAsync(type, value, ms, content, null).Wait(); ms.Position = 0; StreamReader reader = new StreamReader(ms); string serializedSampleString = reader.ReadToEnd(); if (mediaType.MediaType.ToUpperInvariant().Contains("XML")) { serializedSampleString = TryFormatXml(serializedSampleString); } else if (mediaType.MediaType.ToUpperInvariant().Contains("JSON")) { serializedSampleString = TryFormatJson(serializedSampleString); } sample = new TextSample(serializedSampleString); } else { sample = new InvalidSample(String.Format( CultureInfo.CurrentCulture, "Failed to generate the sample for media type '{0}'. Cannot use formatter '{1}' to write type '{2}'.", mediaType, formatter.GetType().Name, type.Name)); } } catch (Exception e) { sample = new InvalidSample(String.Format( CultureInfo.CurrentCulture, "An exception has occurred while using the formatter '{0}' to generate sample for media type '{1}'. Exception message: {2}", formatter.GetType().Name, mediaType.MediaType, e.Message)); } finally { if (ms != null) { ms.Dispose(); } if (content != null) { content.Dispose(); } } return sample; } [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Handling the failure by returning the original string.")] private static string TryFormatJson(string str) { try { object parsedJson = JsonConvert.DeserializeObject(str); return JsonConvert.SerializeObject(parsedJson, Formatting.Indented); } catch { // can't parse JSON, return the original string return str; } } [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Handling the failure by returning the original string.")] private static string TryFormatXml(string str) { try { XDocument xml = XDocument.Parse(str); return xml.ToString(); } catch { // can't parse XML, return the original string return str; } } private static bool IsFormatSupported(SampleDirection sampleDirection, MediaTypeFormatter formatter, Type type) { switch (sampleDirection) { case SampleDirection.Request: return formatter.CanReadType(type); case SampleDirection.Response: return formatter.CanWriteType(type); } return false; } private IEnumerable<KeyValuePair<HelpPageSampleKey, object>> GetAllActionSamples(string controllerName, string actionName, IEnumerable<string> parameterNames, SampleDirection sampleDirection) { HashSet<string> parameterNamesSet = new HashSet<string>(parameterNames, StringComparer.OrdinalIgnoreCase); foreach (var sample in ActionSamples) { HelpPageSampleKey sampleKey = sample.Key; if (String.Equals(controllerName, sampleKey.ControllerName, StringComparison.OrdinalIgnoreCase) && String.Equals(actionName, sampleKey.ActionName, StringComparison.OrdinalIgnoreCase) && (sampleKey.ParameterNames.SetEquals(new[] { "*" }) || parameterNamesSet.SetEquals(sampleKey.ParameterNames)) && sampleDirection == sampleKey.SampleDirection) { yield return sample; } } } private static object WrapSampleIfString(object sample) { string stringSample = sample as string; if (stringSample != null) { return new TextSample(stringSample); } return sample; } } }
{ "content_hash": "961ae30a05b65e551982038ad72890a4", "timestamp": "", "source": "github", "line_count": 372, "max_line_length": 229, "avg_line_length": 46.266129032258064, "alnum_prop": 0.5831154494218813, "repo_name": "anhcop86/SN-Stock", "id": "e6e2d9dcdf036a95a8c00446c3207883c1026ecf", "size": "17211", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "FinAndLife_Investment/Loadi/Areas/HelpPage/SampleGeneration/HelpPageSampleGenerator.cs", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "ASP", "bytes": "458360" }, { "name": "ApacheConf", "bytes": "36" }, { "name": "Batchfile", "bytes": "2919" }, { "name": "C", "bytes": "1" }, { "name": "C#", "bytes": "5464433" }, { "name": "C++", "bytes": "1" }, { "name": "CSS", "bytes": "2204922" }, { "name": "HTML", "bytes": "1465878" }, { "name": "Java", "bytes": "3211" }, { "name": "JavaScript", "bytes": "6851479" }, { "name": "Makefile", "bytes": "285" }, { "name": "PHP", "bytes": "6746" }, { "name": "PLpgSQL", "bytes": "5140" }, { "name": "Pascal", "bytes": "325862" }, { "name": "PowerShell", "bytes": "952106" }, { "name": "Puppet", "bytes": "8212" }, { "name": "Ruby", "bytes": "578" }, { "name": "Shell", "bytes": "3043" } ], "symlink_target": "" }
SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in Philipp. J. Sci. , C 5:23. 1910 #### Original name null ### Remarks null
{ "content_hash": "be93c3cc15a2dd2e4357a89dc370699d", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 12.307692307692308, "alnum_prop": 0.66875, "repo_name": "mdoering/backbone", "id": "f639572018683d3585ceccbe540af691965b41e6", "size": "231", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Asterales/Asteraceae/Albizia/Albizia philippinensis/ Syn. Albizia marginata/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
An element providing a starting point for your own reusable Polymer elements. ![][image-1] ## Dependencies Element dependencies are managed via [Bower][1]. You can install that via: npm install -g bower Then, go ahead and download the element's dependencies: bower install ## Playing With Your Element If you wish to work on your element in isolation, we recommend that you use [Polyserve][2] to keep your element's bower dependencies in line. You can install it via: npm install -g polyserve And you can run it via: polyserve Once running, you can preview your element at `http://localhost:8080/components/wallcology-selector/index.html`, ## To install in your app `bower install https://github.com/ltg-uic/wallcology-selector.git --save` ## Using it in code toggle-selector: side button/dropdown button-selector: all the choices for a toggle selected-items: listens for new selections buttons current-toggle: tells you which one is the current selected toggle <wallcology-selector toggle-selectors="{{toggleSelectors}}" button-selectors={{buttonSelectors}} max-selections="2" selected-items="{{selectedItems}}" current-toggle="{{currentToggle}}"></wallcology-selector> ## Testing Your Element Simply navigate to the `/demo` directory of your element to run its tests. If you are using Polyserve: `http://localhost:8080/components/wallcology-selector/index.html` [1]: http://bower.io/ [2]: https://github.com/PolymerLabs/polyserve [image-1]: cap.png
{ "content_hash": "835d63800351426e559cb2324f6fb978", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 145, "avg_line_length": 27, "alnum_prop": 0.7215836526181354, "repo_name": "ltg-uic/wallcology-selector", "id": "28b5b7288a1867bf296c0ace16fead7721fd7337", "size": "1589", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "33353" }, { "name": "JavaScript", "bytes": "50167" } ], "symlink_target": "" }
package QueryTree; import java.util.ArrayList; import java.util.List; import GlobalDefinition.Constant; import GlobalDefinition.JoinExpression; import GlobalDefinition.SimpleExpression; import Parser.SelectItemsFinder; import Parser.TableNamesFinder; import Parser.WhereClauseDecomposition; import Parser.WhereItemsFinder; import WhereTree.WhereNode; import WhereTree.WhereTree; import net.sf.jsqlparser.statement.select.Select; public class QueryTree { public class FormattedTreeNode{ public String content; public int nodeID; public int parentID; public int siteID; public FormattedTreeNode(){ this.content = null; this.nodeID = -1; this.parentID = -1; this.siteID = -1; } } private TreeNode root = null; private List<FormattedTreeNode> nodeList = null; private List<LeafNode> leafNodeList = null; private int nodeID; private int treeType; private String sql; public QueryTree(){ this.nodeID = 0; this.treeType = 0; this.sql = null; } public TreeNode getRoot() { return root; } public void setRoot(TreeNode root) { this.root = root; } public boolean isValidTree(){ return !(root == null); } public void displayTree(){ recDisplayTree(root,0,0); } private void recDisplayTree(TreeNode thisNode, int level, int childNumber) { // TODO Auto-generated method stub System.out.print("level = " + level +" child = " + childNumber + ": " ); System.out.print(thisNode.getContent()); System.out.println(" siteID = " + thisNode.getSiteID() + " nodeID = " + thisNode.getNodeID()); //if(thisNode.getParentNode() != null) //System.out.println("parent node Id : " + thisNode.getParentNode().getNodeID()); int childCount = thisNode.getChildCount(); for (int i = 0; i < childCount; i++) { TreeNode nextNode = thisNode.getChildList().get(i); if(nextNode != null){ recDisplayTree(nextNode,level+1,i); } else return; } } public void generateTreeList(){ if(root == null) return; nodeList = new ArrayList<FormattedTreeNode>(); generateTreeListByNode(root); } private void generateTreeListByNode(TreeNode node) { // TODO Auto-generated method stub FormattedTreeNode n = new FormattedTreeNode(); n.content = node.getContent(); n.nodeID = node.getNodeID(); n.parentID = (node.getParentNode() == null)?-1:node.getParentNode().getNodeID(); n.siteID = node.getSiteID(); nodeList.add(n); if(node.isLeaf()) return; for (int i = 0; i < node.getChildCount(); i++) { generateTreeListByNode(node.getChild(i)); } } private void setSiteIdOnNodes() { if(this.root == null) return; setSiteIdOnNodesByChild(root); } private int setSiteIdOnNodesByChild(TreeNode node) { // TODO Auto-generated method stub if(node.isLeaf()) return node.getSiteID(); List<TreeNode> childList = node.getChildList(); for (int i = 0; i < childList.size(); i++) { setSiteIdOnNodesByChild(childList.get(i)); } node.setNodeID(setSiteIdOnNodesByChild(node.getChild(0))); return node.getSiteID(); } public List<FormattedTreeNode> getNodeList() { return nodeList; } public void setNodeList(List<FormattedTreeNode> nodeList) { this.nodeList = nodeList; } public List<LeafNode> getLeafNodeList() { if(this.root ==null) return null; leafNodeList = new ArrayList<LeafNode>(); getLeafNodeList(root); return leafNodeList; } private void getLeafNodeList(TreeNode node) { if(node.isLeaf()){ leafNodeList.add((LeafNode)node); return; } for (int i = 0; i < node.getChildCount(); i++) { getLeafNodeList(node.getChild(i)); } } private LeafNode findLeafNode(String tableName,ArrayList<LeafNode> leaves) { if(leaves.size() == 0) return null; for (int i = 0; i < leaves.size(); i++) { if (leaves.get(i).getTableName().equalsIgnoreCase(tableName)) { return leaves.get(i); } } return null; } private void localisation(LeafNode leafNode) { if(leafNode.hasSegment()) return; UnionNode unionNode = new UnionNode(); unionNode.setParentNode(leafNode.getParentNode()); leafNode.getParentNode().removeChildNode(leafNode); leafNode.setParentNode(null); unionNode.setNodeID(leafNode.getNodeID()); String tableName = leafNode.getTableName(); /*GDD gdd = GDD.getInstance(); List<String> subTableList = (List<String>)gdd.getTableFragList(tableName); TODO Look at fragmenting conditions and attach the appropriate leaf nodes from the site to the union node * */ } public void setLeafNodeList(List<LeafNode> leafNodeList) { this.leafNodeList = leafNodeList; } public void setNodeID(int nodeID){ this.nodeID = nodeID; } public int getNodeID(){ return this.nodeID; } public void setTreeType(int treeType){ this.treeType = treeType; } public int getTreeType(){ return this.treeType; } public void setSQL(String sql){ this.sql = sql; } public String getSQL(){ return this.sql; } public void genSelectTree(Select select){ this.treeType = Constant.TREE_SELECT; /***** Select Clause *****/ SelectItemsFinder selectItemsFinder = new SelectItemsFinder(); ArrayList<String> selectItemsList = selectItemsFinder.getSelectItemsList(select); String attributes = new String(); ProjectionNode node = new ProjectionNode(); node.setNodeName("PROJECTION"); node.setNodeID(-1); for (int i = 0; i < selectItemsList.size(); i++) { attributes += selectItemsList.get(i) + (i < selectItemsList.size() - 1?",":""); int pos = selectItemsList.get(i).indexOf("."); if(pos == -1){ node.addTableName(null); node.addAttribute(selectItemsList.get(i)); } else{ String tableName = selectItemsList.get(i).substring(0, pos); String attrName = selectItemsList.get(i).substring(pos+1); node.addTableName(tableName); node.addAttribute(attrName); } } node.setRoot(true); node.setParentNode(null); node.setNodeID(this.nodeID); this.nodeID++; root = node; //System.out.println(attributes); /***** from clause *****/ ArrayList<LeafNode> leaves = new ArrayList<LeafNode>(); TableNamesFinder tableNamesFinder = new TableNamesFinder(); ArrayList<String> tableList = (ArrayList<String>) tableNamesFinder.getTablesList(select); for (int i = 0; i < tableList.size(); i++) { LeafNode leafNode = new LeafNode(); leafNode.setNodeName(tableList.get(i)); leafNode.setTableName(tableList.get(i)); leafNode.setSegment(false); leafNode.setNodeID(this.nodeID); this.nodeID++; leaves.add(leafNode); } /* for (int i = 0; i < leaves.size(); i++) { System.out.print(leaves.get(i).getTableName()+" "); } System.out.println(); */ /***** where tree *****/ WhereClauseDecomposition wc = new WhereClauseDecomposition(select); WhereNode wn = wc.getWhereTree().toCNF(wc.getWhereTree().getRoot()); WhereTree wt = new WhereTree(); wt.setRoot(wn); wt.collectJoins(wt.getRoot()); ArrayList<JoinExpression> joinList = wt.getJeList(); ArrayList<SimpleExpression> selectionList = wt.getSeList(); /* System.out.println("\n***** Join List *****\n"); for (int i = 0; i < joinList.size(); i++) { System.out.println(joinList.get(i).leftTableName +"." +joinList.get(i).leftColumn +" = " +joinList.get(i).rightTableName +"." +joinList.get(i).rightColumn); } System.out.println("\n***** Selection List *****\n"); for (int i = 0; i < selectionList.size(); i++) { System.out.println(selectionList.get(i).tableName +"." +selectionList.get(i).columnName +selectionList.get(i).op +selectionList.get(i).value +"\t" + selectionList.get(i).valType + " " + selectionList.get(i).valueType); } */ /*------where clause----*/ WhereItemsFinder finder3 = new WhereItemsFinder(select); //COMPLETE WHERE ITWEMS FINDER /*------join clause----*/ ArrayList<JoinNode> joins = new ArrayList<JoinNode>(); for(int i=0;i<joinList.size();++i){ JoinNode node2 = new JoinNode(); node2.setLeftTableName(joinList.get(i).leftTableName); node2.setRightTableName(joinList.get(i).rightTableName); node2.addAttribute(joinList.get(i).leftColumn, joinList.get(i).rightColumn); node2.setNodeName("JOIN"); node2.setNodeID(this.nodeID); this.nodeID++; joins.add(node2); } /*-------selection clause-------*/ ArrayList<SelectionNode> selections = new ArrayList<SelectionNode>(); for(int i=0;i<selectionList.size();++i){ SelectionNode node3 = new SelectionNode(); node3.setNodeName("SELECTION"); node3.addCondition(selectionList.get(i)); node3.setNodeID(this.nodeID); node3.setTableName(selectionList.get(i).tableName); this.nodeID++; selections.add(node3); } for(int i=0;i<selections.size();++i){ SelectionNode snode = selections.get(i); TreeNode child = findLeafNode(snode.getTableName(), leaves); while (child.getParentNode()!=null) child = child.getParentNode(); child.setParentNode(snode); } for(int i=0;i<joins.size();++i){ JoinNode jnode = joins.get(i); TreeNode leftChild = findLeafNode(jnode.getLeftTableName(),leaves); TreeNode rightChild = findLeafNode(jnode.getRightTableName(),leaves); while(leftChild.getParentNode()!= null) leftChild = leftChild.getParentNode(); while(rightChild.getParentNode()!=null) rightChild = rightChild.getParentNode(); leftChild.setParentNode(jnode); rightChild.setParentNode(jnode); } TreeNode leaf1 = leaves.get(0); while(leaf1.getParentNode()!= null) { leaf1 = leaf1.getParentNode(); } leaf1.setParentNode(root); } }
{ "content_hash": "6ada46eb8e9937971d10fd55a80ba1c2", "timestamp": "", "source": "github", "line_count": 353, "max_line_length": 109, "avg_line_length": 27.48441926345609, "alnum_prop": 0.6768707482993197, "repo_name": "vishnupriyam/Distributed-Database-Project", "id": "1d075cc604333578de773dfe7c7ec3434f2309a1", "size": "9702", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/QueryTree/QueryTree.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "109649" } ], "symlink_target": "" }
<!-- HTML header for doxygen 1.8.10--> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.11"/> <title>SideCar: /Users/howes/src/sidecar/Algorithms/IQ2AmplitudePhase Directory Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="DoxygenStyleSheet.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td id="projectalign" style="padding-left: 0.5em;"> <div id="projectname">SideCar </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.11 --> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="pages.html"><span>Related&#160;Pages</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li class="current"><a href="files.html"><span>File&#160;List</span></a></li> <li><a href="globals.html"><span>Globals</span></a></li> </ul> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_16861240cd43450fd06793f5fadb1278.html">sidecar</a></li><li class="navelem"><a class="el" href="dir_3824fe7a0668e861ddceb9cdc5c9a07b.html">Algorithms</a></li><li class="navelem"><a class="el" href="dir_abcd23130528c35f0d6aaa23c545175d.html">IQ2AmplitudePhase</a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="headertitle"> <div class="title">IQ2AmplitudePhase Directory Reference</div> </div> </div><!--header--> <div class="contents"> <div class="dynheader"> Directory dependency graph for IQ2AmplitudePhase:</div> <div class="dyncontent"> <div class="center"><img src="dir_abcd23130528c35f0d6aaa23c545175d_dep.png" border="0" usemap="#dir__abcd23130528c35f0d6aaa23c545175d__dep" alt="/Users/howes/src/sidecar/Algorithms/IQ2AmplitudePhase"/></div> <map name="dir__abcd23130528c35f0d6aaa23c545175d__dep" id="dir__abcd23130528c35f0d6aaa23c545175d__dep"> <area shape="rect" id="node1" href="dir_abcd23130528c35f0d6aaa23c545175d.html" title="IQ2AmplitudePhase" alt="" coords="27,56,165,104"/> <area shape="rect" id="node2" href="dir_f8aecf1212e5099580012e9c7ab66cf2.html" title="Utils" alt="" coords="60,248,132,296"/> <area shape="rect" id="edge2-headlabel" href="dir_000044_000031.html" title="1" alt="" coords="92,219,99,238"/> <area shape="rect" id="node3" href="dir_094e4b0d3d17f2701d893b5e76e9f974.html" title="Messages" alt="" coords="94,152,175,200"/> <area shape="rect" id="edge3-headlabel" href="dir_000044_000004.html" title="2" alt="" coords="122,122,130,141"/> <area shape="rect" id="edge1-headlabel" href="dir_000004_000031.html" title="13" alt="" coords="113,225,128,243"/> <area shape="rect" id="clust1" href="dir_3824fe7a0668e861ddceb9cdc5c9a07b.html" title="Algorithms" alt="" coords="16,16,176,115"/> </map> </div> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="files"></a> Files</h2></td></tr> <tr class="memitem:IQ2AmplitudePhase_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="IQ2AmplitudePhase_8h.html">IQ2AmplitudePhase.h</a> <a href="IQ2AmplitudePhase_8h_source.html">[code]</a></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> </div><!-- contents --> <!-- HTML footer for doxygen 1.8.10--> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated by &#160;<a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.11 </small></address> </body> </html>
{ "content_hash": "c2d3e0f2bdcec8274821e41fa07948a6", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 412, "avg_line_length": 53.98823529411764, "alnum_prop": 0.6842449335367182, "repo_name": "bradhowes/sidecar", "id": "63731591bbf0b028d1bc3094f798aeeba2133485", "size": "4589", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/dir_abcd23130528c35f0d6aaa23c545175d.html", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "110411" }, { "name": "C++", "bytes": "5118221" }, { "name": "CMake", "bytes": "69600" }, { "name": "CSS", "bytes": "6054" }, { "name": "HTML", "bytes": "19612" }, { "name": "Objective-C++", "bytes": "629" }, { "name": "Python", "bytes": "106205" }, { "name": "Shell", "bytes": "18893" }, { "name": "Tcl", "bytes": "1042" } ], "symlink_target": "" }
"""Functions for FIR filter design.""" from __future__ import division, print_function, absolute_import from math import ceil, log import numpy as np from numpy.fft import irfft from scipy.special import sinc from . import sigtools __all__ = ['kaiser_beta', 'kaiser_atten', 'kaiserord', 'firwin', 'firwin2', 'remez'] # Some notes on function parameters: # # `cutoff` and `width` are given as a numbers between 0 and 1. These # are relative frequencies, expressed as a fraction of the Nyquist rate. # For example, if the Nyquist rate is 2KHz, then width=0.15 is a width # of 300 Hz. # # The `order` of a FIR filter is one less than the number of taps. # This is a potential source of confusion, so in the following code, # we will always use the number of taps as the parameterization of # the 'size' of the filter. The "number of taps" means the number # of coefficients, which is the same as the length of the impulse # response of the filter. def kaiser_beta(a): """Compute the Kaiser parameter `beta`, given the attenuation `a`. Parameters ---------- a : float The desired attenuation in the stopband and maximum ripple in the passband, in dB. This should be a *positive* number. Returns ------- beta : float The `beta` parameter to be used in the formula for a Kaiser window. References ---------- Oppenheim, Schafer, "Discrete-Time Signal Processing", p.475-476. """ if a > 50: beta = 0.1102 * (a - 8.7) elif a > 21: beta = 0.5842 * (a - 21) ** 0.4 + 0.07886 * (a - 21) else: beta = 0.0 return beta def kaiser_atten(numtaps, width): """Compute the attenuation of a Kaiser FIR filter. Given the number of taps `N` and the transition width `width`, compute the attenuation `a` in dB, given by Kaiser's formula: a = 2.285 * (N - 1) * pi * width + 7.95 Parameters ---------- N : int The number of taps in the FIR filter. width : float The desired width of the transition region between passband and stopband (or, in general, at any discontinuity) for the filter. Returns ------- a : float The attenuation of the ripple, in dB. See Also -------- kaiserord, kaiser_beta """ a = 2.285 * (numtaps - 1) * np.pi * width + 7.95 return a def kaiserord(ripple, width): """ Design a Kaiser window to limit ripple and width of transition region. Parameters ---------- ripple : float Positive number specifying maximum ripple in passband (dB) and minimum ripple in stopband. width : float Width of transition region (normalized so that 1 corresponds to pi radians / sample). Returns ------- numtaps : int The length of the kaiser window. beta : float The beta parameter for the kaiser window. See Also -------- kaiser_beta, kaiser_atten Notes ----- There are several ways to obtain the Kaiser window: - ``signal.kaiser(numtaps, beta, sym=0)`` - ``signal.get_window(beta, numtaps)`` - ``signal.get_window(('kaiser', beta), numtaps)`` The empirical equations discovered by Kaiser are used. References ---------- Oppenheim, Schafer, "Discrete-Time Signal Processing", p.475-476. """ A = abs(ripple) # in case somebody is confused as to what's meant if A < 8: # Formula for N is not valid in this range. raise ValueError("Requested maximum ripple attentuation %f is too " "small for the Kaiser formula." % A) beta = kaiser_beta(A) # Kaiser's formula (as given in Oppenheim and Schafer) is for the filter # order, so we have to add 1 to get the number of taps. numtaps = (A - 7.95) / 2.285 / (np.pi * width) + 1 return int(ceil(numtaps)), beta def firwin(numtaps, cutoff, width=None, window='hamming', pass_zero=True, scale=True, nyq=1.0): """ FIR filter design using the window method. This function computes the coefficients of a finite impulse response filter. The filter will have linear phase; it will be Type I if `numtaps` is odd and Type II if `numtaps` is even. Type II filters always have zero response at the Nyquist rate, so a ValueError exception is raised if firwin is called with `numtaps` even and having a passband whose right end is at the Nyquist rate. Parameters ---------- numtaps : int Length of the filter (number of coefficients, i.e. the filter order + 1). `numtaps` must be even if a passband includes the Nyquist frequency. cutoff : float or 1D array_like Cutoff frequency of filter (expressed in the same units as `nyq`) OR an array of cutoff frequencies (that is, band edges). In the latter case, the frequencies in `cutoff` should be positive and monotonically increasing between 0 and `nyq`. The values 0 and `nyq` must not be included in `cutoff`. width : float or None If `width` is not None, then assume it is the approximate width of the transition region (expressed in the same units as `nyq`) for use in Kaiser FIR filter design. In this case, the `window` argument is ignored. window : string or tuple of string and parameter values Desired window to use. See `scipy.signal.get_window` for a list of windows and required parameters. pass_zero : bool If True, the gain at the frequency 0 (i.e. the "DC gain") is 1. Otherwise the DC gain is 0. scale : bool Set to True to scale the coefficients so that the frequency response is exactly unity at a certain frequency. That frequency is either: - 0 (DC) if the first passband starts at 0 (i.e. pass_zero is True) - `nyq` (the Nyquist rate) if the first passband ends at `nyq` (i.e the filter is a single band highpass filter); center of first passband otherwise nyq : float Nyquist frequency. Each frequency in `cutoff` must be between 0 and `nyq`. Returns ------- h : (numtaps,) ndarray Coefficients of length `numtaps` FIR filter. Raises ------ ValueError If any value in `cutoff` is less than or equal to 0 or greater than or equal to `nyq`, if the values in `cutoff` are not strictly monotonically increasing, or if `numtaps` is even but a passband includes the Nyquist frequency. See also -------- scipy.signal.firwin2 Examples -------- Low-pass from 0 to f:: >>> from scipy import signal >>> signal.firwin(numtaps, f) Use a specific window function:: >>> signal.firwin(numtaps, f, window='nuttall') High-pass ('stop' from 0 to f):: >>> signal.firwin(numtaps, f, pass_zero=False) Band-pass:: >>> signal.firwin(numtaps, [f1, f2], pass_zero=False) Band-stop:: >>> signal.firwin(numtaps, [f1, f2]) Multi-band (passbands are [0, f1], [f2, f3] and [f4, 1]):: >>> signal.firwin(numtaps, [f1, f2, f3, f4]) Multi-band (passbands are [f1, f2] and [f3,f4]):: >>> signal.firwin(numtaps, [f1, f2, f3, f4], pass_zero=False) """ # The major enhancements to this function added in November 2010 were # developed by Tom Krauss (see ticket #902). cutoff = np.atleast_1d(cutoff) / float(nyq) # Check for invalid input. if cutoff.ndim > 1: raise ValueError("The cutoff argument must be at most " "one-dimensional.") if cutoff.size == 0: raise ValueError("At least one cutoff frequency must be given.") if cutoff.min() <= 0 or cutoff.max() >= 1: raise ValueError("Invalid cutoff frequency: frequencies must be " "greater than 0 and less than nyq.") if np.any(np.diff(cutoff) <= 0): raise ValueError("Invalid cutoff frequencies: the frequencies " "must be strictly increasing.") if width is not None: # A width was given. Find the beta parameter of the Kaiser window # and set `window`. This overrides the value of `window` passed in. atten = kaiser_atten(numtaps, float(width) / nyq) beta = kaiser_beta(atten) window = ('kaiser', beta) pass_nyquist = bool(cutoff.size & 1) ^ pass_zero if pass_nyquist and numtaps % 2 == 0: raise ValueError("A filter with an even number of coefficients must " "have zero response at the Nyquist rate.") # Insert 0 and/or 1 at the ends of cutoff so that the length of cutoff # is even, and each pair in cutoff corresponds to passband. cutoff = np.hstack(([0.0] * pass_zero, cutoff, [1.0] * pass_nyquist)) # `bands` is a 2D array; each row gives the left and right edges of # a passband. bands = cutoff.reshape(-1, 2) # Build up the coefficients. alpha = 0.5 * (numtaps - 1) m = np.arange(0, numtaps) - alpha h = 0 for left, right in bands: h += right * sinc(right * m) h -= left * sinc(left * m) # Get and apply the window function. from .signaltools import get_window win = get_window(window, numtaps, fftbins=False) h *= win # Now handle scaling if desired. if scale: # Get the first passband. left, right = bands[0] if left == 0: scale_frequency = 0.0 elif right == 1: scale_frequency = 1.0 else: scale_frequency = 0.5 * (left + right) c = np.cos(np.pi * m * scale_frequency) s = np.sum(h * c) h /= s return h # Original version of firwin2 from scipy ticket #457, submitted by "tash". # # Rewritten by Warren Weckesser, 2010. def firwin2(numtaps, freq, gain, nfreqs=None, window='hamming', nyq=1.0, antisymmetric=False): """ FIR filter design using the window method. From the given frequencies `freq` and corresponding gains `gain`, this function constructs an FIR filter with linear phase and (approximately) the given frequency response. Parameters ---------- numtaps : int The number of taps in the FIR filter. `numtaps` must be less than `nfreqs`. freq : array_like, 1D The frequency sampling points. Typically 0.0 to 1.0 with 1.0 being Nyquist. The Nyquist frequency can be redefined with the argument `nyq`. The values in `freq` must be nondecreasing. A value can be repeated once to implement a discontinuity. The first value in `freq` must be 0, and the last value must be `nyq`. gain : array_like The filter gains at the frequency sampling points. Certain constraints to gain values, depending on the filter type, are applied, see Notes for details. nfreqs : int, optional The size of the interpolation mesh used to construct the filter. For most efficient behavior, this should be a power of 2 plus 1 (e.g, 129, 257, etc). The default is one more than the smallest power of 2 that is not less than `numtaps`. `nfreqs` must be greater than `numtaps`. window : string or (string, float) or float, or None, optional Window function to use. Default is "hamming". See `scipy.signal.get_window` for the complete list of possible values. If None, no window function is applied. nyq : float Nyquist frequency. Each frequency in `freq` must be between 0 and `nyq` (inclusive). antisymmetric : bool Whether resulting impulse response is symmetric/antisymmetric. See Notes for more details. Returns ------- taps : ndarray The filter coefficients of the FIR filter, as a 1-D array of length `numtaps`. See also -------- scipy.signal.firwin Notes ----- From the given set of frequencies and gains, the desired response is constructed in the frequency domain. The inverse FFT is applied to the desired response to create the associated convolution kernel, and the first `numtaps` coefficients of this kernel, scaled by `window`, are returned. The FIR filter will have linear phase. The type of filter is determined by the value of 'numtaps` and `antisymmetric` flag. There are four possible combinations: - odd `numtaps`, `antisymmetric` is False, type I filter is produced - even `numtaps`, `antisymmetric` is False, type II filter is produced - odd `numtaps`, `antisymmetric` is True, type III filter is produced - even `numtaps`, `antisymmetric` is True, type IV filter is produced Magnitude response of all but type I filters are subjects to following constraints: - type II -- zero at the Nyquist frequency - type III -- zero at zero and Nyquist frequencies - type IV -- zero at zero frequency .. versionadded:: 0.9.0 References ---------- .. [1] Oppenheim, A. V. and Schafer, R. W., "Discrete-Time Signal Processing", Prentice-Hall, Englewood Cliffs, New Jersey (1989). (See, for example, Section 7.4.) .. [2] Smith, Steven W., "The Scientist and Engineer's Guide to Digital Signal Processing", Ch. 17. http://www.dspguide.com/ch17/1.htm Examples -------- A lowpass FIR filter with a response that is 1 on [0.0, 0.5], and that decreases linearly on [0.5, 1.0] from 1 to 0: >>> from scipy import signal >>> taps = signal.firwin2(150, [0.0, 0.5, 1.0], [1.0, 1.0, 0.0]) >>> print(taps[72:78]) [-0.02286961 -0.06362756 0.57310236 0.57310236 -0.06362756 -0.02286961] """ if len(freq) != len(gain): raise ValueError('freq and gain must be of same length.') if nfreqs is not None and numtaps >= nfreqs: raise ValueError(('ntaps must be less than nfreqs, but firwin2 was ' 'called with ntaps=%d and nfreqs=%s') % (numtaps, nfreqs)) if freq[0] != 0 or freq[-1] != nyq: raise ValueError('freq must start with 0 and end with `nyq`.') d = np.diff(freq) if (d < 0).any(): raise ValueError('The values in freq must be nondecreasing.') d2 = d[:-1] + d[1:] if (d2 == 0).any(): raise ValueError('A value in freq must not occur more than twice.') if antisymmetric: if numtaps % 2 == 0: ftype = 4 else: ftype = 3 else: if numtaps % 2 == 0: ftype = 2 else: ftype = 1 if ftype == 2 and gain[-1] != 0.0: raise ValueError("A Type II filter must have zero gain at the Nyquist rate.") elif ftype == 3 and (gain[0] != 0.0 or gain[-1] != 0.0): raise ValueError("A Type III filter must have zero gain at zero and Nyquist rates.") elif ftype == 4 and gain[0] != 0.0: raise ValueError("A Type IV filter must have zero gain at zero rate.") if nfreqs is None: nfreqs = 1 + 2 ** int(ceil(log(numtaps, 2))) # Tweak any repeated values in freq so that interp works. eps = np.finfo(float).eps for k in range(len(freq)): if k < len(freq) - 1 and freq[k] == freq[k + 1]: freq[k] = freq[k] - eps freq[k + 1] = freq[k + 1] + eps # Linearly interpolate the desired response on a uniform mesh `x`. x = np.linspace(0.0, nyq, nfreqs) fx = np.interp(x, freq, gain) # Adjust the phases of the coefficients so that the first `ntaps` of the # inverse FFT are the desired filter coefficients. shift = np.exp(-(numtaps - 1) / 2. * 1.j * np.pi * x / nyq) if ftype > 2: shift *= 1j fx2 = fx * shift # Use irfft to compute the inverse FFT. out_full = irfft(fx2) if window is not None: # Create the window to apply to the filter coefficients. from .signaltools import get_window wind = get_window(window, numtaps, fftbins=False) else: wind = 1 # Keep only the first `numtaps` coefficients in `out`, and multiply by # the window. out = out_full[:numtaps] * wind if ftype == 3: out[out.size // 2] = 0.0 return out def remez(numtaps, bands, desired, weight=None, Hz=1, type='bandpass', maxiter=25, grid_density=16): """ Calculate the minimax optimal filter using the Remez exchange algorithm. Calculate the filter-coefficients for the finite impulse response (FIR) filter whose transfer function minimizes the maximum error between the desired gain and the realized gain in the specified frequency bands using the Remez exchange algorithm. Parameters ---------- numtaps : int The desired number of taps in the filter. The number of taps is the number of terms in the filter, or the filter order plus one. bands : array_like A monotonic sequence containing the band edges in Hz. All elements must be non-negative and less than half the sampling frequency as given by `Hz`. desired : array_like A sequence half the size of bands containing the desired gain in each of the specified bands. weight : array_like, optional A relative weighting to give to each band region. The length of `weight` has to be half the length of `bands`. Hz : scalar, optional The sampling frequency in Hz. Default is 1. type : {'bandpass', 'differentiator', 'hilbert'}, optional The type of filter: 'bandpass' : flat response in bands. This is the default. 'differentiator' : frequency proportional response in bands. 'hilbert' : filter with odd symmetry, that is, type III (for even order) or type IV (for odd order) linear phase filters. maxiter : int, optional Maximum number of iterations of the algorithm. Default is 25. grid_density : int, optional Grid density. The dense grid used in `remez` is of size ``(numtaps + 1) * grid_density``. Default is 16. Returns ------- out : ndarray A rank-1 array containing the coefficients of the optimal (in a minimax sense) filter. See Also -------- freqz : Compute the frequency response of a digital filter. References ---------- .. [1] J. H. McClellan and T. W. Parks, "A unified approach to the design of optimum FIR linear phase digital filters", IEEE Trans. Circuit Theory, vol. CT-20, pp. 697-701, 1973. .. [2] J. H. McClellan, T. W. Parks and L. R. Rabiner, "A Computer Program for Designing Optimum FIR Linear Phase Digital Filters", IEEE Trans. Audio Electroacoust., vol. AU-21, pp. 506-525, 1973. Examples -------- We want to construct a filter with a passband at 0.2-0.4 Hz, and stop bands at 0-0.1 Hz and 0.45-0.5 Hz. Note that this means that the behavior in the frequency ranges between those bands is unspecified and may overshoot. >>> from scipy import signal >>> bpass = signal.remez(72, [0, 0.1, 0.2, 0.4, 0.45, 0.5], [0, 1, 0]) >>> freq, response = signal.freqz(bpass) >>> ampl = np.abs(response) >>> import matplotlib.pyplot as plt >>> fig = plt.figure() >>> ax1 = fig.add_subplot(111) >>> ax1.semilogy(freq/(2*np.pi), ampl, 'b-') # freq in Hz >>> plt.show() """ # Convert type try: tnum = {'bandpass': 1, 'differentiator': 2, 'hilbert': 3}[type] except KeyError: raise ValueError("Type must be 'bandpass', 'differentiator', " "or 'hilbert'") # Convert weight if weight is None: weight = [1] * len(desired) bands = np.asarray(bands).copy() return sigtools._remez(numtaps, bands, desired, weight, tnum, Hz, maxiter, grid_density)
{ "content_hash": "613bd463ad83ebea3b86bbb557b01c9e", "timestamp": "", "source": "github", "line_count": 582, "max_line_length": 94, "avg_line_length": 34.52061855670103, "alnum_prop": 0.6168931362301528, "repo_name": "kmspriyatham/symath", "id": "fd7c2e59c4b725138e868e603ca272a47cd4767b", "size": "20091", "binary": false, "copies": "16", "ref": "refs/heads/master", "path": "scipy/scipy/signal/fir_filter_design.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "17042868" }, { "name": "C++", "bytes": "10078577" }, { "name": "CSS", "bytes": "14254" }, { "name": "FORTRAN", "bytes": "6345626" }, { "name": "JavaScript", "bytes": "3133" }, { "name": "M", "bytes": "66" }, { "name": "Matlab", "bytes": "4280" }, { "name": "Objective-C", "bytes": "15478" }, { "name": "Python", "bytes": "7388118" }, { "name": "Shell", "bytes": "3288" }, { "name": "TeX", "bytes": "37261" }, { "name": "nesC", "bytes": "1736" } ], "symlink_target": "" }
const puppeteer = require('puppeteer'); const assert = require('assert'); const cas = require('../../cas.js'); (async () => { const browser = await puppeteer.launch(cas.browserOptions()); const page = await cas.newPage(browser); const service = "https://example.com"; await page.goto(`https://localhost:8443/cas/login?service=${service}`); await cas.loginWith(page, "casuser", "Mellon"); let ticket = await cas.assertTicketParameter(page); const body = await cas.doRequest(`https://localhost:8443/cas/serviceValidate?service=${service}&ticket=${ticket}`); console.log(body) assert(body.includes('<cas:serviceResponse xmlns:cas=\'http://www.yale.edu/tp/cas\'>')) assert(body.includes('<cas:user>casuser</cas:user>')) assert(body.includes('<cas:credentialType>UsernamePasswordCredential</cas:credentialType>')) assert(body.includes('<cas:isFromNewLogin>true</cas:isFromNewLogin>')) assert(body.includes('<cas:authenticationMethod>STATIC</cas:authenticationMethod>')) assert(body.includes('<cas:successfulAuthenticationHandlers>STATIC</cas:successfulAuthenticationHandlers>')) assert(body.includes('<cas:longTermAuthenticationRequestTokenUsed>false</cas:longTermAuthenticationRequestTokenUsed>')) await browser.close(); })();
{ "content_hash": "8c8d316115a390c960977c290f6d6d0f", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 123, "avg_line_length": 56.04347826086956, "alnum_prop": 0.7284716834755625, "repo_name": "Jasig/cas", "id": "7edb6b3fafbdee685a82f6c0480146c51d05f0d6", "size": "1289", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "ci/tests/puppeteer/scenarios/ticket-validation-casv2/script.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "185031" }, { "name": "Groovy", "bytes": "4306" }, { "name": "HTML", "bytes": "7607" }, { "name": "Java", "bytes": "3433944" }, { "name": "JavaScript", "bytes": "43706" }, { "name": "Shell", "bytes": "4256" } ], "symlink_target": "" }
package com.azure.cosmos; import com.azure.cosmos.implementation.TestConfigurations; import com.azure.cosmos.models.ThroughputProperties; public class ThroughputPropertiesCodeSnippet { public static void main(String[] args) throws Exception { CosmosAsyncClient client = new CosmosClientBuilder() .endpoint(TestConfigurations.HOST) .key(TestConfigurations.MASTER_KEY) .buildAsyncClient(); final String databaseName = "testDB"; int throughput = 5000; ThroughputProperties properties = ThroughputProperties.createAutoscaledThroughput(throughput); client.createDatabase(databaseName, properties).block(); client.close(); } }
{ "content_hash": "95ba9c3a5614b1313eddb15bb1d26277", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 102, "avg_line_length": 39.9, "alnum_prop": 0.6478696741854637, "repo_name": "Azure/azure-sdk-for-java", "id": "91200638154c4401e3acfdec9eeabeaf8fabdf86", "size": "798", "binary": false, "copies": "2", "ref": "refs/heads/main", "path": "sdk/cosmos/azure-cosmos/src/samples/java/com/azure/cosmos/ThroughputPropertiesCodeSnippet.java", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "8762" }, { "name": "Bicep", "bytes": "15055" }, { "name": "CSS", "bytes": "7676" }, { "name": "Dockerfile", "bytes": "2028" }, { "name": "Groovy", "bytes": "3237482" }, { "name": "HTML", "bytes": "42090" }, { "name": "Java", "bytes": "432409546" }, { "name": "JavaScript", "bytes": "36557" }, { "name": "Jupyter Notebook", "bytes": "95868" }, { "name": "PowerShell", "bytes": "737517" }, { "name": "Python", "bytes": "240542" }, { "name": "Scala", "bytes": "1143898" }, { "name": "Shell", "bytes": "18488" }, { "name": "XSLT", "bytes": "755" } ], "symlink_target": "" }
use std::collections::HashMap; use std::io::{Result, Error, ErrorKind}; use std::fmt::{self, Debug, Formatter}; use value::Value; pub type FilterFunction = fn(Option<Box<Value>>, &str) -> Option<Box<Value>>; pub struct FilterNode { func: FilterFunction, arg: String, name: String, } impl Debug for FilterNode { fn fmt(&self, f: &mut Formatter) -> fmt::Result { write!(f, "FilterNode (name: {}, arg: {})", self.name, self.arg) } } impl Clone for FilterNode { fn clone(&self) -> Self { FilterNode { func: self.func, arg: self.arg.clone(), name: self.name.clone(), } } } impl FilterNode { pub fn from_expression(expr: &str, filters: &HashMap<String, FilterFunction>) -> Result<FilterNode> { let mut part_splitter = expr.splitn(2, ":"); let name = part_splitter.next().unwrap().to_string(); match filters.get(&name) { Some(filter) => { Ok(FilterNode { name: name, func: *filter, arg: match part_splitter.next() { Some(args) => args.to_string(), None => "".to_string(), } }) }, None => Err( Error::new( ErrorKind::NotFound, format!("No filter with name {}", name) ) ) } } pub fn apply(&self, input: Option<Box<Value>>) -> Option<Box<Value>> { (self.func)(input, &self.arg) } }
{ "content_hash": "cb7d421cb53696a787bf6090d9493b1e", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 102, "avg_line_length": 22.54385964912281, "alnum_prop": 0.6070038910505836, "repo_name": "SlNPacifist/rust-dtl", "id": "bbc5b49233b7ba74103bb8c662c7f13704f0cd74", "size": "2429", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/filter/filter_node.rs", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "28" }, { "name": "Rust", "bytes": "66763" } ], "symlink_target": "" }
/**************************************************************************************/ /* */ /* Visualization Library */ /* http://visualizationlibrary.org */ /* */ /* Copyright (c) 2005-2017, Michele Bosi */ /* 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. */ /* */ /**************************************************************************************/ #include "BaseDemo.hpp" #include <vlGraphics/GeometryPrimitives.hpp> #include <vlGraphics/Array.hpp> #include <vlGraphics/Light.hpp> #include <vlGraphics/GLSL.hpp> using namespace vl; /* * You can find the documentatio for this example in the offical documentation at: * Quick Start Guides -> Texturing */ class App_Texturing: public BaseDemo { public: void multitexturing() { if (!Has_Multitexture) { Log::error("Multitexturing not supported.\n"); return; } // create a box with texture coordinates const bool generate_tex_coords = true; ref<Geometry> box = makeBox( vec3(0,0,0), 5,5,5, generate_tex_coords ); box->computeNormals(); // IMPORTANT: makeBox() filled for use box->texCoordArray(0) however in order to use multi-texturing we need // texture coordinates also for unit #1 so we make texture unit #1 share the texture coordinates with unit #0. box->setTexCoordArray(1, box->texCoordArray(0)); // load base texture // note: TF_UNKNOWN tells VL to set the texture format to whatever format the image is. ref<Texture> tex_holebox = new Texture("/images/holebox.tif", TF_UNKNOWN, mMipmappingOn ); tex_holebox->getTexParameter()->setMagFilter(TPF_LINEAR); tex_holebox->getTexParameter()->setMinFilter(TPF_LINEAR_MIPMAP_LINEAR); // load detail texture ref<Texture> tex_detail = new Texture("/images/detail.tif", TF_UNKNOWN, mMipmappingOn ); tex_detail->getTexParameter()->setMagFilter(TPF_LINEAR); tex_detail->getTexParameter()->setMinFilter(TPF_LINEAR_MIPMAP_LINEAR); // IMPORTANT: since we requested mipmapping we set the MinFilter to GL_LINEAR_MIPMAP_LINEAR, i.e. trilinear filtering. // Note also that using a mipmapped filter with a texture that has no mipmaps will typically show a black texture. // You can set the MinFilter to any of GL_NEAREST, GL_LINEAR, GL_NEAREST_MIPMAP_NEAREST, GL_LINEAR_MIPMAP_NEAREST, // GL_NEAREST_MIPMAP_LINEAR, GL_LINEAR_MIPMAP_LINEAR. However rembember that you can set the MagFilter only to // GL_NEAREST or GL_LINEAR as mipmapping does not make any sense for texture magnification. ref<Light> light = new Light; // single texture effect with alpha testing ref<Effect> fx_right_cube = new Effect; fx_right_cube->shader()->setRenderState( light.get(), 0 ); fx_right_cube->shader()->enable(EN_LIGHTING); fx_right_cube->shader()->enable(EN_DEPTH_TEST); fx_right_cube->shader()->enable(EN_BLEND); fx_right_cube->shader()->enable(EN_ALPHA_TEST); fx_right_cube->shader()->gocAlphaFunc()->set(FU_GEQUAL, 0.98f); fx_right_cube->shader()->gocLightModel()->setTwoSide(true); fx_right_cube->shader()->gocTextureSampler(0)->setTexture( tex_holebox.get() ); // multi-texture effect with alpha testing ref<Effect> fx_left_cube = new Effect; fx_left_cube->shader()->setRenderState( light.get(), 0 ); fx_left_cube->shader()->enable(EN_LIGHTING); fx_left_cube->shader()->enable(EN_DEPTH_TEST); fx_left_cube->shader()->enable(EN_BLEND); fx_left_cube->shader()->enable(EN_ALPHA_TEST); fx_left_cube->shader()->gocAlphaFunc()->set(FU_GEQUAL, 0.98f); fx_left_cube->shader()->gocLightModel()->setTwoSide(true); fx_left_cube->shader()->gocTextureSampler(0)->setTexture( tex_holebox.get() ); fx_left_cube->shader()->gocTextureSampler(1)->setTexture( tex_detail.get() ); fx_left_cube->shader()->gocTexEnv(1)->setMode(TEM_MODULATE); // modulate texture #0 and #1 // add right box mRightCubeTransform = new Transform; rendering()->as<Rendering>()->transform()->addChild(mRightCubeTransform.get()); sceneManager()->tree()->addActor( box.get(), fx_right_cube.get(), mRightCubeTransform.get() ); // add left box mLeftCubeTransform = new Transform; rendering()->as<Rendering>()->transform()->addChild(mLeftCubeTransform.get()); sceneManager()->tree()->addActor( box.get(), fx_left_cube.get(), mLeftCubeTransform.get() ); } void texture3D() { if(!Has_Texture_3D) { Log::error("Texture 3D not supported.\n"); return; } // Create a 2x2 vertices quad facing the camera mQuad3DTex = makeGrid( vec3(0,0,0), 10.0f, 10.0f, 2, 2 ); // Rotate plane toward the user, otherwise it would be on the x/z plane mQuad3DTex->transform( mat4::getRotation(90, 1,0,0), false ); // Texture coordinates to be animated in updateScene() mTexCoords_3D = new ArrayFloat3; mTexCoords_3D->resize( 2*2 ); mQuad3DTex->setTexCoordArray(0, mTexCoords_3D.get()); // Effect used by the actor ref<Effect> fx_3d = new Effect; fx_3d->shader()->enable(EN_DEPTH_TEST); // Add and position the actor in the scene Actor* act_3d = sceneManager()->tree()->addActor( mQuad3DTex.get(), fx_3d.get(), new Transform ); act_3d->transform()->setLocalAndWorldMatrix( mat4::getTranslation(-6,+6,-6) ); // Setup a 3D texture with mipmapping ref<Texture> texture_3d = new Texture; // Load "/volume/VLTest.dat" which is a 3D image and prepare a 3D texture from it texture_3d->createTexture3D( "/volume/VLTest.dat", TF_UNKNOWN, mMipmappingOn ); texture_3d->getTexParameter()->setMagFilter(TPF_LINEAR); texture_3d->getTexParameter()->setMinFilter(TPF_LINEAR_MIPMAP_LINEAR); fx_3d->shader()->gocTextureSampler(0)->setTexture( texture_3d.get() ); } void texture2DArray() { if( ! Has_Texture_Array ) { Log::error("Texture 2d array not supported.\n"); return; } // Create a 2x2 vertices quad facing the camera mQuad2DArrayTex = makeGrid( vec3(0,0,0), 10.0f, 10.0f, 2, 2 ); // Rotate plane toward the user mQuad2DArrayTex->transform( mat4::getRotation(90, 1,0,0), false ); // Texture coordinates to be animated in updateScene() mTexCoords_2DArray = new ArrayFloat3; mTexCoords_2DArray->resize( 2*2 ); mQuad2DArrayTex->setTexCoordArray(0, mTexCoords_2DArray.get()); // Create the effect used by the actor ref<Effect> fx_2darray = new Effect; fx_2darray->shader()->enable(EN_DEPTH_TEST); // Add and position the actor in the scene Actor* act_2darray = sceneManager()->tree()->addActor( mQuad2DArrayTex.get(), fx_2darray.get(), new Transform ); act_2darray->transform()->setLocalAndWorldMatrix( mat4::getTranslation(+6,+6,-6) ); // Load a 3D image, VL considers 3D images equivalent to an array of 2D images. ref<Image> img_volume = loadImage("/volume/VLTest.dat"); m2DArraySize = img_volume->depth(); // Create the 2D texture array and bind it to unit #0 ref<Texture> texture_2darray = new Texture; texture_2darray->createTexture2DArray( img_volume.get(), TF_RGBA, mMipmappingOn ); texture_2darray->getTexParameter()->setMagFilter(TPF_LINEAR); texture_2darray->getTexParameter()->setMinFilter(TPF_LINEAR_MIPMAP_LINEAR); fx_2darray->shader()->gocTextureSampler(0)->setTexture( texture_2darray.get() ); // IMPORTANT // We need a GLSL program that uses 'sampler2DArray()' to access the 1D and 2D texture arrays! GLSLProgram* glsl = fx_2darray->shader()->gocGLSLProgram(); glsl->attachShader( new GLSLFragmentShader("/glsl/texture_2d_array.fs") ); // Bind the sampler to unit #0 glsl->gocUniform("sampler0")->setUniformI(0); } void texture1DArray() { if( ! Has_Texture_Array ) { Log::error("Texture 1d array not supported.\n"); return; } // Load a 2D texture, VL considers 2D images equivalent to arrays of 1D images. ref<Image> img_holebox = loadImage("/images/holebox.tif"); m1DArraySize = img_holebox->height(); // Create a grid with img_holebox->height() slices mQuad1DArrayTex = makeGrid( vec3(0,0,0), 10, 10, 2, img_holebox->height() ); mQuad1DArrayTex->transform( mat4::getRotation(90, 1,0,0), false ); // Texture coordinates to be animated in updateScene() mTexCoords_1DArray = new ArrayFloat2; mTexCoords_1DArray->resize( 2 * img_holebox->height() ); mQuad1DArrayTex->setTexCoordArray(0, mTexCoords_1DArray.get()); // Create the effect used by the actor ref<Effect> fx_1darray = new Effect; fx_1darray->shader()->enable(EN_DEPTH_TEST); // Add and position the actor in the scene Actor* act_1darray = sceneManager()->tree()->addActor( mQuad1DArrayTex.get(), fx_1darray.get(), new Transform ); act_1darray->transform()->setLocalAndWorldMatrix( mat4::getTranslation(+6,-6,-6) ); // Create the 1D texture array and bind it to unit #0 ref<Texture> texture_1darray = new Texture; texture_1darray->createTexture1DArray( img_holebox.get(), TF_RGBA, mMipmappingOn ); texture_1darray->getTexParameter()->setMagFilter(TPF_LINEAR); texture_1darray->getTexParameter()->setMinFilter(TPF_LINEAR_MIPMAP_LINEAR); fx_1darray->shader()->gocTextureSampler(0)->setTexture( texture_1darray.get() ); // IMPORTANT // We need a GLSL program that uses 'sampler1DArray()' to access the 1D and 2D texture arrays! GLSLProgram* glsl = fx_1darray->shader()->gocGLSLProgram(); glsl->attachShader( new GLSLFragmentShader("/glsl/texture_1d_array.fs") ); glsl->gocUniform("sampler0")->setUniformI(0); } void textureRectangle() { if(!Has_Texture_Rectangle) { Log::error("Texture rectangle not supported.\n"); return; } ref<Image> img_holebox = loadImage("/images/holebox.tif"); // Create a box that faces the camera // Generate non-normalized uv coordinates, i.e. from <0,0> to <img_holebox->width(), img_holebox->height()> float s_max = (float)img_holebox->width(); float t_max = (float)img_holebox->height(); ref<Geometry> quad_rect = makeGrid( vec3(0,0,0), 10.0f, 10.0f, 2, 2, true, fvec2(0, 0), fvec2(s_max, t_max) ); quad_rect->transform( mat4::getRotation(90, 1,0,0), false ); // Effect used by the actor ref<Effect> fx_rect = new Effect; fx_rect->shader()->enable(EN_DEPTH_TEST); // Add and position the actor in the scene Actor* act_rect = sceneManager()->tree()->addActor( quad_rect.get(), fx_rect.get(), new Transform ); act_rect->transform()->setLocalAndWorldMatrix( mat4::getTranslation(-6,-6,-6) ); // Setup the texture rectangle ref<Texture> texture_rectangle = new Texture; // Note that mipmapping is not an option for texture rectangles since they do not support mipmaps texture_rectangle->createTextureRectangle( img_holebox.get(), TF_RGBA ); // Set non-mipmapping filters for the texture texture_rectangle->getTexParameter()->setMagFilter(TPF_LINEAR); texture_rectangle->getTexParameter()->setMinFilter(TPF_LINEAR); // GL_REPEAT (the default) is not allowed with texture rectangle so we set it to GL_CLAMP texture_rectangle->getTexParameter()->setWrapS(TPW_CLAMP); texture_rectangle->getTexParameter()->setWrapT(TPW_CLAMP); texture_rectangle->getTexParameter()->setWrapR(TPW_CLAMP); fx_rect->shader()->gocTextureSampler(0)->setTexture( texture_rectangle.get() ); } void sphericalMapping() { if (Has_GLES) { Log::error("Spherical mapping texture coordinate generation not supported.\n"); return; } // Effect used by the actor mFXSpheric = new Effect; mFXSpheric->shader()->enable(EN_DEPTH_TEST); mFXSpheric->shader()->enable(EN_CULL_FACE); mFXSpheric->shader()->enable(EN_LIGHTING); mFXSpheric->shader()->setRenderState( new Light, 0 ); // Add sphere mapped torus // makeTorus() also generates the normals which are needed by GL_SPHERE_MAP texture coordinate generation mode ref<Geometry> torus = makeTorus(vec3(), 8,3, 40,40); mActSpheric = sceneManager()->tree()->addActor( torus.get(), mFXSpheric.get(), new Transform ); rendering()->as<Rendering>()->transform()->addChild( mActSpheric->transform() ); // Create a 2d texture sphere map ref<Texture> texture_sphere_map = new Texture; texture_sphere_map->createTexture2D( "/images/spheremap_klimt.jpg", TF_UNKNOWN, mMipmappingOn ); texture_sphere_map->getTexParameter()->setMagFilter(TPF_LINEAR); texture_sphere_map->getTexParameter()->setMinFilter(TPF_LINEAR_MIPMAP_LINEAR); mFXSpheric->shader()->gocTextureSampler(0)->setTexture( texture_sphere_map.get() ); // Enable spherical mapping texture coordinate generation for s and t mFXSpheric->shader()->gocTexGen(0)->setGenModeS(TGM_SPHERE_MAP); mFXSpheric->shader()->gocTexGen(0)->setGenModeT(TGM_SPHERE_MAP); } void cubeMapping() { if ( ! Has_Cubemap_Textures ) { Log::error("Texture cubemap not supported.\n"); return; } ref<Image> img_cubemap = loadCubemap( "/images/cubemap/cubemap00.png", // (x+) right "/images/cubemap/cubemap01.png", // (x-) left "/images/cubemap/cubemap02.png", // (y+) top "/images/cubemap/cubemap03.png", // (y-) bottom "/images/cubemap/cubemap04.png", // (z+) back "/images/cubemap/cubemap05.png"); // (z-) front // Effect used by the actor mFXCubic = new Effect; mFXCubic->shader()->enable(EN_DEPTH_TEST); mFXCubic->shader()->enable(EN_CULL_FACE); mFXCubic->shader()->enable(EN_LIGHTING); mFXCubic->shader()->setRenderState( new Light, 0 ); // Add cube-mapped torus // makeTorus() also generates the normals which are needed by GL_REFLECTION_MAP texture coordinate generation mode ref<Geometry> torus = makeTorus( vec3(), 8,3, 40,40 ); mActCubic = sceneManager()->tree()->addActor( torus.get(), mFXCubic.get(), new Transform ); rendering()->as<Rendering>()->transform()->addChild( mActCubic->transform() ); // Create the cube-map texture ref<Texture> texture_cubic = new Texture; texture_cubic->createTextureCubemap( img_cubemap.get(), TF_RGBA, mMipmappingOn ); // Texture filtering modes texture_cubic->getTexParameter()->setMagFilter(TPF_LINEAR); texture_cubic->getTexParameter()->setMinFilter(TPF_LINEAR_MIPMAP_LINEAR); // Clamp to edge to minimize seams texture_cubic->getTexParameter()->setWrapS(TPW_CLAMP_TO_EDGE); texture_cubic->getTexParameter()->setWrapT(TPW_CLAMP_TO_EDGE); texture_cubic->getTexParameter()->setWrapR(TPW_CLAMP_TO_EDGE); // Install the texture on unit #0 mFXCubic->shader()->gocTextureSampler(0)->setTexture( texture_cubic.get() ); // Enable automatic texture generation for s, t, r on unit #0 mFXCubic->shader()->gocTexGen(0)->setGenModeS(TGM_REFLECTION_MAP); mFXCubic->shader()->gocTexGen(0)->setGenModeT(TGM_REFLECTION_MAP); mFXCubic->shader()->gocTexGen(0)->setGenModeR(TGM_REFLECTION_MAP); // Align the cube-map to the world space axes rather than eye space axes. mFXCubic->shader()->gocTextureMatrix(0)->setUseCameraRotationInverse(true); } void initEvent() { // Log applet info Log::notify(appletInfo()); // Default values mMipmappingOn = true; mLodBias = 0.0; // Show all the texture types tests multitexturing(); textureRectangle(); texture3D(); texture2DArray(); texture1DArray(); sphericalMapping(); cubeMapping(); } void updateScene() { // 5 seconds period float t = sin( Time::currentTime()*fPi*2.0f/5.0f) * 0.5f + 0.5f; t = t * (1.0f - 0.02f*2) + 0.02f; // Rotating cubes if (Has_Multitexture) { mRightCubeTransform->setLocalMatrix( mat4::getTranslation(+6,0,0) * mat4::getRotation( Time::currentTime()*45, 0, 1, 0) ); mLeftCubeTransform ->setLocalMatrix( mat4::getTranslation(-6,0,0) * mat4::getRotation( Time::currentTime()*45, 0, 1, 0) ); } // 3D texture coordinates animation if (mTexCoords_3D) { // Animate the z texture coordinate. mTexCoords_3D->at(0) = fvec3(0, 0, t); mTexCoords_3D->at(1) = fvec3(0, 1, t); mTexCoords_3D->at(2) = fvec3(1, 0, t); mTexCoords_3D->at(3) = fvec3(1, 1, t); // Mark texture coords as dirty to update its BufferObjects. mTexCoords_3D->setBufferObjectDirty(true); // Request the quad geometry to check its BufferObjects at the next rendering. mQuad3DTex->setBufferObjectDirty(true); } // 2D texture array coordinates animation if (mTexCoords_2DArray) { // Animate the z texture coordinate. // Note that unlike for 3D textures in 2d array textures the z coordinate // is not defined between 0..1 but between 1..N where N is the number of // texture layers present in the texture array. mTexCoords_2DArray->at(0) = fvec3(0, 0, t*m2DArraySize); mTexCoords_2DArray->at(1) = fvec3(0, 1, t*m2DArraySize); mTexCoords_2DArray->at(2) = fvec3(1, 0, t*m2DArraySize); mTexCoords_2DArray->at(3) = fvec3(1, 1, t*m2DArraySize); // Mark texture coords as dirty to update its BufferObjects. mTexCoords_2DArray->setBufferObjectDirty(true); // Request the quad geometry to check its BufferObjects at the next rendering. mQuad2DArrayTex->setBufferObjectDirty(true); } // 1D texture array coordinates animation if (mTexCoords_1DArray) { for(int i=0; i<m1DArraySize; ++i) { // Create some waving animation float x_offset = 0.1f * cos( t*3.14159265f + 10.0f*((float)i/m1DArraySize)*3.14159265f ); // Note: the y texture coordinate is an integer value between 0 and N where N // is the number of texture 1D layers present in the texture array mTexCoords_1DArray->at(i*2+0) = fvec2(0+x_offset, (float)i); mTexCoords_1DArray->at(i*2+1) = fvec2(1+x_offset, (float)i); } // Mark texture coords as dirty to update its BufferObjects. mTexCoords_1DArray->setBufferObjectDirty(true); // Request the quad geometry to check its BufferObjects at the next rendering. mQuad1DArrayTex->setBufferObjectDirty(true); } // Spherical mapped torus animation if (mActSpheric) { // Just rotate the torus mActSpheric->transform()->setLocalMatrix( mat4::getTranslation(0,+6,0)*mat4::getRotation(45*Time::currentTime(),1,0,0) ); mActSpheric->transform()->computeWorldMatrix(); } // Cube mapped torus animation if (mActCubic) { // Just rotate the torus mActCubic->transform()->setLocalMatrix( mat4::getTranslation(0,-6,0)*mat4::getRotation(45*Time::currentTime(),1,0,0) ); mActCubic->transform()->computeWorldMatrix(); } } void mouseWheelEvent(int w) { // Change the LOD bias of the texture to simulate sharp/dull reflections. mLodBias += w*0.3f; mLodBias = clamp(mLodBias, 0.0f, 4.0f); mFXSpheric->shader()->gocTexEnv(0)->setLodBias(mLodBias); mFXCubic->shader()->gocTexEnv(0)->setLodBias(mLodBias); } protected: ref<Geometry> mQuad3DTex; ref<Geometry> mQuad2DArrayTex; ref<Geometry> mQuad1DArrayTex; ref<Transform> mRightCubeTransform; ref<Transform> mLeftCubeTransform; ref<ArrayFloat3> mTexCoords_3D; ref<ArrayFloat3> mTexCoords_2DArray; ref<ArrayFloat2> mTexCoords_1DArray; int m1DArraySize; int m2DArraySize; ref<Actor> mActSpheric; ref<Actor> mActCubic; ref<Effect> mFXSpheric; ref<Effect> mFXCubic; float mLodBias; bool mMipmappingOn; }; // Have fun! BaseDemo* Create_App_Texturing() { return new App_Texturing; }
{ "content_hash": "a191a58f2ee875c06739c0dc4af7bebb", "timestamp": "", "source": "github", "line_count": 501, "max_line_length": 128, "avg_line_length": 44.746506986027946, "alnum_prop": 0.6312338299580694, "repo_name": "Wulfire/visualizationlibrary", "id": "d171e47d8bc631fb5c0e9f0d69da719df59950ad", "size": "22418", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/examples/Applets/App_Texturing.cpp", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "C", "bytes": "465" }, { "name": "C++", "bytes": "5471072" }, { "name": "CMake", "bytes": "81143" }, { "name": "GLSL", "bytes": "109470" }, { "name": "JavaScript", "bytes": "7470" } ], "symlink_target": "" }
./gradlew --quiet -PmainClass=application.modelview.MVApplicationLauncher run
{ "content_hash": "96c3884545858a8143e08c27dcb8014f", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 77, "avg_line_length": 78, "alnum_prop": 0.8461538461538461, "repo_name": "UNIZAR-30245-ARQS/country-data-mvc", "id": "f3a934d4e083f4a65e5429c93a6e90e09ce35b5c", "size": "90", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "mv.sh", "mode": "33261", "license": "mit", "language": [ { "name": "Java", "bytes": "27069" }, { "name": "Shell", "bytes": "175" } ], "symlink_target": "" }
var app = require('app'); var config = require('app/config'); app.engine('ejs', require('ejs-mate')); app.set('views', 'app/views'); app.set('view engine', 'ejs'); app.disable('x-powered-by'); app.use(require('dont-sniff-mimetype')()); app.use(require('frameguard')()); app.use(require('x-xss-protection')()); app.use(require('body-parser').json()); app.use(require('cookie-parser')()); app.use(require('express').static(app.PUBLIC_DIR)); var session = require('express-session'), RedisSession = require('connect-redis')(session); var db = require('app/db'); require('app/db/models/session'); app.use(session({ name: 'session.sid', secret: app.IS_DEV ? '2156215kjlqsado@#$%' : require('uuid').v4(), resave: false, saveUninitialized: false, store: new RedisSession() })); app.use(require('app/lib/passport').initialize()); app.use(require('app/lib/passport').session()); app.use(require('app/views/helpers')); require('app/controllers'); require('https').createServer(config.ssl, app).listen(config.portSSL); require('http').createServer(function (req, res) { if (!req.headers['host']) { res.writeHead(404); res.end(); return; } res.writeHead(301, {"Location": "https://" + req.headers['host'].replace(/:\d+$/, '') + req.url}); res.end(); }).listen(config.portWEB); require('spreadcast').serve({ server: require('https').createServer(config.ssl).listen(8200) }); if (app.IS_DEV) { var socket = new (require('ws').Server)({ server: require('https').createServer(config.ssl).listen(8100) }); socket.on('connection', function (item) { item.on('message', function (data) { socket.clients.forEach(function (client) { if (client !== item && client.readyState === 1) { client.send(data); } }); }); }); }
{ "content_hash": "f46327bbe0be4398a591a42abf15346e", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 99, "avg_line_length": 26.560606060606062, "alnum_prop": 0.6577296063890473, "repo_name": "redexp/perquisition", "id": "abf08e4ce30a975b6c014c0fb30df43e3164d210", "size": "1753", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "index.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "154419" }, { "name": "HTML", "bytes": "153508" }, { "name": "JavaScript", "bytes": "6763517" }, { "name": "Makefile", "bytes": "208" }, { "name": "Roff", "bytes": "2072" }, { "name": "Shell", "bytes": "139" } ], "symlink_target": "" }
package org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.yarn.api.records.Resource; import org.apache.hadoop.yarn.conf.YarnConfiguration; import org.apache.hadoop.yarn.event.AsyncDispatcher; import org.apache.hadoop.yarn.server.resourcemanager.ResourceManager; import org.apache.hadoop.yarn.server.resourcemanager.scheduler.ResourceScheduler; import org.apache.hadoop.yarn.util.resource.Resources; import org.junit.Before; import org.junit.Test; import org.mockito.Mockito; public class TestFSLeafQueue { private FSLeafQueue schedulable = null; private Resource maxResource = Resources.createResource(10); @Before public void setup() throws IOException { FairScheduler scheduler = new FairScheduler(); Configuration conf = createConfiguration(); // All tests assume only one assignment per node update conf.set(FairSchedulerConfiguration.ASSIGN_MULTIPLE, "false"); ResourceManager resourceManager = new ResourceManager(); resourceManager.init(conf); ((AsyncDispatcher)resourceManager.getRMContext().getDispatcher()).start(); scheduler.reinitialize(conf, resourceManager.getRMContext()); String queueName = "root.queue1"; QueueManager mockMgr = mock(QueueManager.class); when(mockMgr.getMaxResources(queueName)).thenReturn(maxResource); when(mockMgr.getMinResources(queueName)).thenReturn(Resources.none()); schedulable = new FSLeafQueue(queueName, mockMgr, scheduler, null); } @Test public void testUpdateDemand() { AppSchedulable app = mock(AppSchedulable.class); Mockito.when(app.getDemand()).thenReturn(maxResource); schedulable.addAppSchedulable(app); schedulable.addAppSchedulable(app); schedulable.updateDemand(); assertTrue("Demand is greater than max allowed ", Resources.equals(schedulable.getDemand(), maxResource)); } private Configuration createConfiguration() { Configuration conf = new YarnConfiguration(); conf.setClass(YarnConfiguration.RM_SCHEDULER, FairScheduler.class, ResourceScheduler.class); return conf; } }
{ "content_hash": "4ce6b052426faf6ace14abfb2f4cbeef", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 81, "avg_line_length": 35.52307692307692, "alnum_prop": 0.7713295799047206, "repo_name": "jokes000/hardfs", "id": "5bfb182ced356c8407e38d5cae4203dd983e4de0", "size": "3115", "binary": false, "copies": "8", "ref": "refs/heads/master", "path": "hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestFSLeafQueue.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "997110" }, { "name": "C++", "bytes": "76090" }, { "name": "CSS", "bytes": "41761" }, { "name": "Erlang", "bytes": "232" }, { "name": "Java", "bytes": "34526149" }, { "name": "JavaScript", "bytes": "4688" }, { "name": "Perl", "bytes": "18992" }, { "name": "Python", "bytes": "11309" }, { "name": "Shell", "bytes": "199524" }, { "name": "TeX", "bytes": "19322" }, { "name": "XSLT", "bytes": "34239" } ], "symlink_target": "" }
package asw.socket.server.connector; import asw.socket.service.*; import java.net.*; import java.io.*; import java.util.logging.Logger; /* Remote proxy lato server per il servizio Service. */ public class ServiceServerUDPProxy { private Service service; // il vero servizio private int port; // porta per il servizio /* logger */ private Logger logger = Logger.getLogger("asw.socket.server.connector"); public ServiceServerUDPProxy(Service service, int port) { this.service = service; this.port = port; } public void run() { DatagramSocket socket = null; try { /* crea il socket su cui ricevere le richieste */ socket = new DatagramSocket(this.port); /* per il server, disabilita il timeout */ socket.setSoTimeout(0); /* crea il buffer per le richieste */ byte[] buffer = new byte[1000]; while (true) { getRequestAndSendReply(socket, buffer); } } catch (SocketException e) { logger.info("Server Proxy: Socket Exception: " + e.getMessage()); } finally { if (socket!=null) { socket.close(); } } } /* gestisce una richiesta */ private void getRequestAndSendReply(DatagramSocket socket, byte[] buffer) { try { /* aspetta un datagramma di richiesta */ DatagramPacket requestPacket = new DatagramPacket(buffer, buffer.length); socket.receive(requestPacket); // bloccante /* estrai la richiesta dal datagramma di richiesta */ String request = new String( requestPacket.getData(), requestPacket.getOffset(), requestPacket.getLength() ); logger.info("Server Proxy: received request: " + request); /* la richiesta ha la forma "operazione$argomento" */ /* estrae operazione e argomento */ String op = this.getOp(request); String arg = this.getParam(request); /* ivoca il servizio, ottiene il risultato, e calcola la risposta */ /* * la risposta puo' avere le seguenti forme: * "#risultato" oppure * "@messaggio per eccezione di servizio" oppure * "!messaggio per eccezione remota" */ String reply = null; try { String result = this.executeOperation(op, arg); /* se siamo qui, operazione completata, la risposta ha la forma "#risultato" */ reply = "#" + result; } catch (ServiceException e) { /* se siamo qui, operazione NON completata, la risposta ha la forma "@messaggio" */ reply = "@" + e.getMessage(); } catch (RemoteException e) { /* il servente non solleva MAI RemoteException, * ma si può arrivare qui da executeOperation() * se la richiesta è malformata */ reply = "!" + e.getMessage(); } logger.info("Server Proxy: sending reply: " + reply); /* crea il datagramma di risposta */ /* la risposta ha la forma "risposta" */ byte[] replyMessage = reply.getBytes(); DatagramPacket replyPacket = new DatagramPacket( replyMessage, replyMessage.length, requestPacket.getAddress(), requestPacket.getPort() ); /* invia il datagramma di risposta */ socket.send(replyPacket); // non bloccante } catch (IOException e) { logger.info("Server Proxy: IO Exception: " + e.getMessage()); } } /* estrae l'operazione dalla richiesta */ private String getOp(String request) { /* la richiesta ha la forma "operazione$parametro" */ int sep = request.indexOf("$"); String op = request.substring(0,sep); return op; } /* estrae il parametro dalla richiesta */ private String getParam(String request) { /* la richiesta ha la forma "operazione$parametro" */ int sep = request.indexOf("$"); String param = request.substring(sep+1); return param; } /* gestisce la richiesta del servizio corretto al servente */ private String executeOperation(String op, String arg) throws ServiceException, RemoteException { String result = null; if ( op.equals("alpha") ) { result = service.alpha(arg); } else if ( op.equals("beta") ) { result = service.beta(arg); } else { throw new RemoteException("Operation " + op + " is not supported"); } return result; } }
{ "content_hash": "44738734e16df73ab68fd8779cad95d7", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 101, "avg_line_length": 37.224806201550386, "alnum_prop": 0.5653894210745523, "repo_name": "aswroma3/asw", "id": "b4afb924997ef18c0da758f0ff815484a9365aed", "size": "4804", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "projects/asw-815-connettori-distribuiti/a-client-server-udp/server/src/main/java/asw/socket/server/connector/ServiceServerUDPProxy.java", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "26798" }, { "name": "Java", "bytes": "321724" }, { "name": "Puppet", "bytes": "405" }, { "name": "Shell", "bytes": "22231" } ], "symlink_target": "" }
<?php /** * @file * Contains \Drupal\Tests\Component\Plugin\Factory\ReflectionFactoryTest. * * Also contains Argument* classes used as data for testing. */ namespace Drupal\Tests\Component\Plugin\Factory; use Drupal\Component\Plugin\Factory\ReflectionFactory; use PHPUnit\Framework\TestCase; /** * @group Plugin * @coversDefaultClass \Drupal\Component\Plugin\Factory\ReflectionFactory */ class ReflectionFactoryTest extends TestCase { /** * Data provider for testGetInstanceArguments. * * The classes used here are defined at the bottom of this file. * * @return array * - Expected output. * - Class to reflect for input to getInstanceArguments(). * - $plugin_id parameter to getInstanceArguments(). * - $plugin_definition parameter to getInstanceArguments(). * - $configuration parameter to getInstanceArguments(). */ public function providerGetInstanceArguments() { return [ [ ['arguments_plugin_id'], 'Drupal\Tests\Component\Plugin\Factory\ArgumentsPluginId', 'arguments_plugin_id', ['arguments_plugin_id' => ['class' => 'Drupal\Tests\Component\Plugin\Factory\ArgumentsPluginId']], [], ], [ [[], ['arguments_many' => ['class' => 'Drupal\Tests\Component\Plugin\Factory\ArgumentsMany']], 'arguments_many', 'default_value', 'what_default'], 'Drupal\Tests\Component\Plugin\Factory\ArgumentsMany', 'arguments_many', ['arguments_many' => ['class' => 'Drupal\Tests\Component\Plugin\Factory\ArgumentsMany']], [], ], [ // Config array key exists and is set. ['thing'], 'Drupal\Tests\Component\Plugin\Factory\ArgumentsConfigArrayKey', 'arguments_config_array_key', ['arguments_config_array_key' => ['class' => 'Drupal\Tests\Component\Plugin\Factory\ArgumentsConfigArrayKey']], ['config_name' => 'thing'], ], [ // Config array key exists and is not set. [NULL], 'Drupal\Tests\Component\Plugin\Factory\ArgumentsConfigArrayKey', 'arguments_config_array_key', ['arguments_config_array_key' => ['class' => 'Drupal\Tests\Component\Plugin\Factory\ArgumentsConfigArrayKey']], ['config_name' => NULL], ], [ // Touch the else clause at the end of the method. [NULL, NULL, NULL, NULL], 'Drupal\Tests\Component\Plugin\Factory\ArgumentsAllNull', 'arguments_all_null', ['arguments_all_null' => ['class' => 'Drupal\Tests\Component\Plugin\Factory\ArgumentsAllNull']], [], ], [ // A plugin with no constructor. [NULL, NULL, NULL, NULL], 'Drupal\Tests\Component\Plugin\Factory\ArgumentsNoConstructor', 'arguments_no_constructor', ['arguments_no_constructor' => ['class' => 'Drupal\Tests\Component\Plugin\Factory\ArgumentsNoConstructor']], [], ], ]; } /** * @covers ::createInstance * @dataProvider providerGetInstanceArguments */ public function testCreateInstance($expected, $reflector_name, $plugin_id, $plugin_definition, $configuration) { // Create a mock DiscoveryInterface which can return our plugin definition. $mock_discovery = $this->getMockBuilder('Drupal\Component\Plugin\Discovery\DiscoveryInterface') ->setMethods(['getDefinition', 'getDefinitions', 'hasDefinition']) ->getMock(); $mock_discovery->expects($this->never())->method('getDefinitions'); $mock_discovery->expects($this->never())->method('hasDefinition'); $mock_discovery->expects($this->once()) ->method('getDefinition') ->willReturn($plugin_definition); // Create a stub ReflectionFactory object. We use StubReflectionFactory // because createInstance() has a dependency on a static method. // StubReflectionFactory overrides this static method. $reflection_factory = new StubReflectionFactory($mock_discovery); // Finally test that createInstance() returns an object of the class we // want. $this->assertInstanceOf($reflector_name, $reflection_factory->createInstance($plugin_id)); } /** * @covers ::getInstanceArguments * @dataProvider providerGetInstanceArguments */ public function testGetInstanceArguments($expected, $reflector_name, $plugin_id, $plugin_definition, $configuration) { $reflection_factory = $this->getMockBuilder('Drupal\Component\Plugin\Factory\ReflectionFactory') ->disableOriginalConstructor() ->getMock(); $get_instance_arguments_ref = new \ReflectionMethod($reflection_factory, 'getInstanceArguments'); $get_instance_arguments_ref->setAccessible(TRUE); // Special case for plugin class without a constructor. // getInstanceArguments() throws an exception if there's no constructor. // This is not a documented behavior of getInstanceArguments(), but allows // us to use one data set for this test method as well as // testCreateInstance(). if ($plugin_id == 'arguments_no_constructor') { $this->setExpectedException('\ReflectionException'); } // Finally invoke getInstanceArguments() on our mocked factory. $ref = new \ReflectionClass($reflector_name); $result = $get_instance_arguments_ref->invoke( $reflection_factory, $ref, $plugin_id, $plugin_definition, $configuration); $this->assertEquals($expected, $result); } } /** * Override ReflectionFactory because ::createInstance() calls a static method. * * We have to override getPluginClass so that we can stub out its return value. */ class StubReflectionFactory extends ReflectionFactory { /** * {@inheritdoc} */ public static function getPluginClass($plugin_id, $plugin_definition = NULL, $required_interface = NULL) { // Return the class name from the plugin definition. return $plugin_definition[$plugin_id]['class']; } } /** * A stub class used by testGetInstanceArguments(). * * @see providerGetInstanceArguments() */ class ArgumentsPluginId { public function __construct($plugin_id) { // No-op. } } /** * A stub class used by testGetInstanceArguments(). * * @see providerGetInstanceArguments() */ class ArgumentsMany { public function __construct( $configuration, $plugin_definition, $plugin_id, $foo = 'default_value', $what_am_i_doing_here = 'what_default' ) { // No-op. } } /** * A stub class used by testGetInstanceArguments(). * * @see providerGetInstanceArguments() */ class ArgumentsConfigArrayKey { public function __construct($config_name) { // No-op. } } /** * A stub class used by testGetInstanceArguments(). * * @see providerGetInstanceArguments() */ class ArgumentsAllNull { public function __construct($charismatic, $demure, $delightful, $electrostatic) { // No-op. } } /** * A stub class used by testGetInstanceArguments(). * * @see providerGetInstanceArguments() */ class ArgumentsNoConstructor { }
{ "content_hash": "4d286ef1fce0e863937178422605621e", "timestamp": "", "source": "github", "line_count": 216, "max_line_length": 154, "avg_line_length": 32.18518518518518, "alnum_prop": 0.6746260069044879, "repo_name": "wow-yorick/suffix-zx", "id": "3d1a41d11257720474ee7390b9f6bde933852a61", "size": "6952", "binary": false, "copies": "20", "ref": "refs/heads/master", "path": "cms/core/tests/Drupal/Tests/Component/Plugin/Factory/ReflectionFactoryTest.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "711070" }, { "name": "HTML", "bytes": "944057" }, { "name": "JavaScript", "bytes": "1530798" }, { "name": "PHP", "bytes": "39866961" }, { "name": "Shell", "bytes": "55615" } ], "symlink_target": "" }
package org.apache.hadoop.mapred; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.Comparator; import java.util.List; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.mapreduce.TaskType; /** * Utility class containing scheduling algorithms used in the fair scheduler. */ class SchedulingAlgorithms { public static final Log LOG = LogFactory.getLog( SchedulingAlgorithms.class.getName()); /** * Compare Schedulables in order of priority and then submission time, as in * the default FIFO scheduler in Hadoop. */ public static class CreditComparator implements Comparator<PoolSchedulable> { TaskType tasktype; public CreditComparator(TaskType ttype){ this.tasktype = ttype; } @Override public int compare(PoolSchedulable s1, PoolSchedulable s2) { return (int)(s2.getCredit(tasktype) - s1.getCredit(tasktype)); } } public static class SlotsComparator implements Comparator<PoolSchedulable> { TaskType taskType; public SlotsComparator(TaskType ttype) { taskType = ttype; } @Override public int compare(PoolSchedulable p1, PoolSchedulable p2) { return p1.getSlotsGap() - p2.getSlotsGap(); } } /** * Compare Schedulables in order of priority and then submission time, as in * the default FIFO scheduler in Hadoop. */ public static class FifoComparator implements Comparator<Schedulable> { @Override public int compare(Schedulable s1, Schedulable s2) { int res = s1.getPriority().compareTo(s2.getPriority()); if (res == 0) { res = (int) Math.signum(s1.getStartTime() - s2.getStartTime()); } if (res == 0) { // In the rare case where jobs were submitted at the exact same time, // compare them by name (which will be the JobID) to get a deterministic // ordering, so we don't alternately launch tasks from different jobs. res = s1.getName().compareTo(s2.getName()); } return res; } } /** * Compare Schedulables via weighted fair sharing. In addition, Schedulables * below their min share get priority over those whose min share is met. * * Schedulables below their min share are compared by how far below it they * are as a ratio. For example, if job A has 8 out of a min share of 10 tasks * and job B has 50 out of a min share of 100, then job B is scheduled next, * because B is at 50% of its min share and A is at 80% of its min share. * * Schedulables above their min share are compared by (runningTasks / weight). * If all weights are equal, slots are given to the job with the fewest tasks; * otherwise, jobs with more weight get proportionally more slots. */ public static class FairShareComparator implements Comparator<Schedulable> { @Override public int compare(Schedulable s1, Schedulable s2) { double minShareRatio1, minShareRatio2; double tasksToWeightRatio1, tasksToWeightRatio2; int minShare1 = Math.min(s1.getMinShare(), s1.getDemand()); int minShare2 = Math.min(s2.getMinShare(), s2.getDemand()); boolean s1Needy = s1.getRunningTasks() < minShare1; boolean s2Needy = s2.getRunningTasks() < minShare2; minShareRatio1 = s1.getRunningTasks() / Math.max(minShare1, 1.0); minShareRatio2 = s2.getRunningTasks() / Math.max(minShare2, 1.0); tasksToWeightRatio1 = s1.getRunningTasks() / s1.getWeight(); tasksToWeightRatio2 = s2.getRunningTasks() / s2.getWeight(); int res = 0; if (s1Needy && !s2Needy) res = -1; else if (s2Needy && !s1Needy) res = 1; else if (s1Needy && s2Needy) res = (int) Math.signum(minShareRatio1 - minShareRatio2); else // Neither schedulable is needy res = (int) Math.signum(tasksToWeightRatio1 - tasksToWeightRatio2); if (res == 0) { // Jobs are tied in fairness ratio. Break the tie by submit time and job // name to get a deterministic ordering, which is useful for unit tests. res = (int) Math.signum(s1.getStartTime() - s2.getStartTime()); if (res == 0) res = s1.getName().compareTo(s2.getName()); } return res; } } /** * Number of iterations for the binary search in computeFairShares. This is * equivalent to the number of bits of precision in the output. 25 iterations * gives precision better than 0.1 slots in clusters with one million slots. */ private static final int COMPUTE_FAIR_SHARES_ITERATIONS = 25; /** * Given a set of Schedulables and a number of slots, compute their weighted * fair shares. The min shares and demands of the Schedulables are assumed to * be set beforehand. We compute the fairest possible allocation of shares * to the Schedulables that respects their min shares and demands. * * To understand what this method does, we must first define what weighted * fair sharing means in the presence of minimum shares and demands. If there * were no minimum shares and every Schedulable had an infinite demand (i.e. * could launch infinitely many tasks), then weighted fair sharing would be * achieved if the ratio of slotsAssigned / weight was equal for each * Schedulable and all slots were assigned. Minimum shares and demands add * two further twists: * - Some Schedulables may not have enough tasks to fill all their share. * - Some Schedulables may have a min share higher than their assigned share. * * To deal with these possibilities, we define an assignment of slots as * being fair if there exists a ratio R such that: * - Schedulables S where S.demand < R * S.weight are assigned share S.demand * - Schedulables S where S.minShare > R * S.weight are given share S.minShare * - All other Schedulables S are assigned share R * S.weight * - The sum of all the shares is totalSlots. * * We call R the weight-to-slots ratio because it converts a Schedulable's * weight to the number of slots it is assigned. * * We compute a fair allocation by finding a suitable weight-to-slot ratio R. * To do this, we use binary search. Given a ratio R, we compute the number * of slots that would be used in total with this ratio (the sum of the shares * computed using the conditions above). If this number of slots is less than * totalSlots, then R is too small and more slots could be assigned. If the * number of slots is more than totalSlots, then R is too large. * * We begin the binary search with a lower bound on R of 0 (which means that * all Schedulables are only given their minShare) and an upper bound computed * to be large enough that too many slots are given (by doubling R until we * either use more than totalSlots slots or we fulfill all jobs' demands). * The helper method slotsUsedWithWeightToSlotRatio computes the total number * of slots used with a given value of R. * * The running time of this algorithm is linear in the number of Schedulables, * because slotsUsedWithWeightToSlotRatio is linear-time and the number of * iterations of binary search is a constant (dependent on desired precision). */ public static void computeFairShares( Collection<? extends Schedulable> schedulables, double totalSlots) { // Find an upper bound on R that we can use in our binary search. We start // at R = 1 and double it until we have either used totalSlots slots or we // have met all Schedulables' demands (if total demand < totalSlots). double totalDemand = 0; for (Schedulable sched: schedulables) { totalDemand += sched.getDemand(); } double cap = Math.min(totalDemand, totalSlots); double rMax = 1.0; while (slotsUsedWithWeightToSlotRatio(rMax, schedulables) < cap) { rMax *= 2.0; } // Perform the binary search for up to COMPUTE_FAIR_SHARES_ITERATIONS steps double left = 0; double right = rMax; for (int i = 0; i < COMPUTE_FAIR_SHARES_ITERATIONS; i++) { double mid = (left + right) / 2.0; if (slotsUsedWithWeightToSlotRatio(mid, schedulables) < cap) { left = mid; } else { right = mid; } } // Set the fair shares based on the value of R we've converged to for (Schedulable sched: schedulables) { sched.setFairShare(computeShare(sched, right)); } } /** * Compute the number of slots that would be used given a weight-to-slot * ratio w2sRatio, for use in the computeFairShares algorithm as described * in #{@link SchedulingAlgorithms#computeFairShares(Collection, double)}. */ private static double slotsUsedWithWeightToSlotRatio(double w2sRatio, Collection<? extends Schedulable> schedulables) { double slotsTaken = 0; for (Schedulable sched: schedulables) { double share = computeShare(sched, w2sRatio); slotsTaken += share; } return slotsTaken; } /** * Compute the number of slots assigned to a Schedulable given a particular * weight-to-slot ratio w2sRatio, for use in computeFairShares as described * in #{@link SchedulingAlgorithms#computeFairShares(Collection, double)}. */ private static double computeShare(Schedulable sched, double w2sRatio) { double share = sched.getWeight() * w2sRatio; share = Math.max(share, sched.getMinShare()); share = Math.min(share, sched.getDemand()); return share; } }
{ "content_hash": "bc66386340b9ee83716d375a1f54abde", "timestamp": "", "source": "github", "line_count": 230, "max_line_length": 81, "avg_line_length": 41.469565217391306, "alnum_prop": 0.6950094359404487, "repo_name": "CodingCat/LongTermFairScheduler", "id": "922af5dd6a5d88f6ec0e93ab561e27828c2777bd", "size": "10344", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/contrib/creditscheduler/src/java/org/apache/hadoop/mapred/SchedulingAlgorithms.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "402884" }, { "name": "C++", "bytes": "368086" }, { "name": "Java", "bytes": "16257106" }, { "name": "JavaScript", "bytes": "38376" }, { "name": "Objective-C", "bytes": "119767" }, { "name": "PHP", "bytes": "152555" }, { "name": "Perl", "bytes": "152209" }, { "name": "Python", "bytes": "621805" }, { "name": "Ruby", "bytes": "28485" }, { "name": "Shell", "bytes": "976307" }, { "name": "Smalltalk", "bytes": "56562" } ], "symlink_target": "" }
'use strict'; /** * Compute a squared sample Pearson product-moment correlation coefficient incrementally. * * @module @stdlib/stats/incr/pcorr2 * * @example * var incrpcorr2 = require( '@stdlib/stats/incr/pcorr2' ); * * var accumulator = incrpcorr2(); * * var r2 = accumulator(); * // returns null * * r2 = accumulator( 2.0, 1.0 ); * // returns 0.0 * * r2 = accumulator( -5.0, 3.14 ); * // returns ~1.0 * * r2 = accumulator(); * // returns ~1.0 */ // MODULES // var incrpcorr2 = require( './main.js' ); // EXPORTS // module.exports = incrpcorr2;
{ "content_hash": "718e5702c0d474c24a37270ab6869440", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 88, "avg_line_length": 15.857142857142858, "alnum_prop": 0.6288288288288288, "repo_name": "stdlib-js/stdlib", "id": "89c54e84ca257e41f5aa5e6650e9d42eeace1d20", "size": "1171", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "lib/node_modules/@stdlib/stats/incr/pcorr2/lib/index.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Awk", "bytes": "21739" }, { "name": "C", "bytes": "15336495" }, { "name": "C++", "bytes": "1349482" }, { "name": "CSS", "bytes": "58039" }, { "name": "Fortran", "bytes": "198059" }, { "name": "HTML", "bytes": "56181" }, { "name": "Handlebars", "bytes": "16114" }, { "name": "JavaScript", "bytes": "85975525" }, { "name": "Julia", "bytes": "1508654" }, { "name": "Makefile", "bytes": "4806816" }, { "name": "Python", "bytes": "3343697" }, { "name": "R", "bytes": "576612" }, { "name": "Shell", "bytes": "559315" }, { "name": "TypeScript", "bytes": "19309407" }, { "name": "WebAssembly", "bytes": "5980" } ], "symlink_target": "" }
path-complete is a [Node.js](http://nodejs.org/) package for command line TAB path completion. ## Video Demonstration [https://vimeo.com/38800422](https://vimeo.com/38800422) ## Installation `npm install path-complete` ## Basic Usage You can run the extremely simple test case by executing `node test/test.js` or use the code below to do the same. ```javascript var pc = require('path-complete'); process.stdout.write('look for path: '); pc.getPathFromStdin(function(path) { console.log(''); console.log('path: ' + path); }); ```
{ "content_hash": "11d035eee10151b57ad0c968981708f3", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 113, "avg_line_length": 24.636363636363637, "alnum_prop": 0.7103321033210332, "repo_name": "tonylukasavage/path-complete", "id": "694306719b1e13d1fef0ef920a7295ed57c9fa8a", "size": "631", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "3014" } ], "symlink_target": "" }
SET statement_timeout = 0; SET lock_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SET check_function_bodies = false; SET client_min_messages = warning; -- -- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: - -- CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog; -- -- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: - -- COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language'; -- -- Name: pg_stat_statements; Type: EXTENSION; Schema: -; Owner: - -- CREATE EXTENSION IF NOT EXISTS pg_stat_statements WITH SCHEMA public; -- -- Name: EXTENSION pg_stat_statements; Type: COMMENT; Schema: -; Owner: - -- COMMENT ON EXTENSION pg_stat_statements IS 'track execution statistics of all SQL statements executed'; -- -- Name: postgis; Type: EXTENSION; Schema: -; Owner: - -- CREATE EXTENSION IF NOT EXISTS postgis WITH SCHEMA public; -- -- Name: EXTENSION postgis; Type: COMMENT; Schema: -; Owner: - -- COMMENT ON EXTENSION postgis IS 'PostGIS geometry, geography, and raster spatial types and functions'; -- -- Name: uuid-ossp; Type: EXTENSION; Schema: -; Owner: - -- CREATE EXTENSION IF NOT EXISTS "uuid-ossp" WITH SCHEMA public; -- -- Name: EXTENSION "uuid-ossp"; Type: COMMENT; Schema: -; Owner: - -- COMMENT ON EXTENSION "uuid-ossp" IS 'generate universally unique identifiers (UUIDs)'; SET search_path = public, pg_catalog; SET default_tablespace = ''; SET default_with_oids = false; -- -- Name: events; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE events ( id integer NOT NULL, title text, description text, geom geometry, updated_at timestamp without time zone, created_at timestamp without time zone, publisher_id integer, feature_id text, properties json DEFAULT '{}'::json ); -- -- Name: events_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE events_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: events_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE events_id_seq OWNED BY events.id; -- -- Name: http_requests; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE http_requests ( id uuid DEFAULT uuid_generate_v4() NOT NULL, scheme character varying(255), userinfo text, host text, port integer, path text, query text, fragment text, method character varying(255), response_status integer, duration integer, started_at timestamp without time zone ); -- -- Name: publishers; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE publishers ( id integer NOT NULL, title text, endpoint text, updated_at timestamp without time zone, created_at timestamp without time zone, active boolean, city text, icon text, visible boolean DEFAULT true, state text, description text, tags text[] DEFAULT '{}'::text[] NOT NULL ); -- -- Name: publishers_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE publishers_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: publishers_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE publishers_id_seq OWNED BY publishers.id; -- -- Name: schema_info; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE schema_info ( version integer DEFAULT 0 NOT NULL ); -- -- Name: subscriptions; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE subscriptions ( geom geometry, updated_at timestamp without time zone, created_at timestamp without time zone, publisher_id integer, channel text NOT NULL, phone_number text, email_address text, webhook_url text, unsubscribed_at timestamp without time zone, id uuid DEFAULT uuid_generate_v4() NOT NULL ); -- -- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY events ALTER COLUMN id SET DEFAULT nextval('events_id_seq'::regclass); -- -- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY publishers ALTER COLUMN id SET DEFAULT nextval('publishers_id_seq'::regclass); -- -- Name: events_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY events ADD CONSTRAINT events_pkey PRIMARY KEY (id); -- -- Name: http_requests_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY http_requests ADD CONSTRAINT http_requests_pkey PRIMARY KEY (id); -- -- Name: publishers_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY publishers ADD CONSTRAINT publishers_pkey PRIMARY KEY (id); -- -- Name: subscriptions_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY subscriptions ADD CONSTRAINT subscriptions_pkey PRIMARY KEY (id); -- -- Name: events_geom_gist; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX events_geom_gist ON events USING gist (geom); -- -- Name: events_publisher_id_feature_id_index; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE UNIQUE INDEX events_publisher_id_feature_id_index ON events USING btree (publisher_id, feature_id); -- -- Name: publishers_endpoint_index; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE UNIQUE INDEX publishers_endpoint_index ON publishers USING btree (endpoint); -- -- Name: subscriptions_geom_gist; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX subscriptions_geom_gist ON subscriptions USING gist (geom); -- -- Name: events_publisher_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY events ADD CONSTRAINT events_publisher_id_fkey FOREIGN KEY (publisher_id) REFERENCES publishers(id); -- -- Name: subscriptions_publisher_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY subscriptions ADD CONSTRAINT subscriptions_publisher_id_fkey FOREIGN KEY (publisher_id) REFERENCES publishers(id); -- -- PostgreSQL database dump complete --
{ "content_hash": "5df2255fcd04cebd3bbabcf11734f6c5", "timestamp": "", "source": "github", "line_count": 286, "max_line_length": 106, "avg_line_length": 21.496503496503497, "alnum_prop": 0.693070917371503, "repo_name": "elberdev/citygram-nyc", "id": "bdfe26117b573fe51d163c261710545548c73f7b", "size": "6183", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "db/schema.sql", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "283" }, { "name": "HTML", "bytes": "35907" }, { "name": "JavaScript", "bytes": "9073" }, { "name": "Ruby", "bytes": "84599" } ], "symlink_target": "" }
package com.sun.bookstore6.validators; import com.sun.bookstore6.util.MessageFactory; import javax.faces.component.UIComponent; import javax.faces.component.UIInput; import javax.faces.context.FacesContext; import javax.faces.application.FacesMessage; import javax.faces.validator.Validator; import javax.faces.validator.ValidatorException; import javax.faces.component.StateHolder; import java.util.ArrayList; import java.util.Iterator; import java.util.StringTokenizer; import com.sun.bookstore6.util.MessageFactory; /** * <p><strong>FormatValidator</strong> is a Validator that checks * the validity of String representation of the value of the * associated component against a list of specified patterns.</p> * <ul> * <li>Call getValue() to retrieve the current value of the component. * If it is <code>null</code>, exit immediately. (If null values * should not be allowed, a RequiredValidator can be configured * to check for this case.)</li> * <li><code>formatPattern</code> is a <code>|</code> separated string * of allowed patterns. </li> * <li> This validator uses the following rules to match a value against a * pattern. * <li> if the matching pattern has a "A", then corresponding character * in input value should be a letter. * <li> if the matching pattern has a "9", then corresponding character * in input value should be a number. * <li> if the matching pattern has a "#", then corresponding character * in input value should be a number or a letter. * <li> Any other character must match literally. * </ul> </ul> * * Validators have to be Serializable, so you can't maintain a reference to * a java.sql.Connection or javax.sql.DataSource inside this class in case * you need to hook upto the database or some other back end resource. * One approach would be to use JNDI-based data source lookups or do * this verification in the business tier. */ public class FormatValidator implements Validator, StateHolder { // ----------------------------------------------------- Manifest Constants /** * <p>The message identifier of the Message to be created if * the validation fails. The message format string for this * message may optionally include a <code>{0}</code> placeholder, which * will be replaced by list of format patterns.</p> */ public static final String FORMAT_INVALID_MESSAGE_ID = "FormatInvalid"; private ArrayList<String> formatPatternsList = null; // // General Methods // /** * <code>|</code> separated String of format patterns * that this validator must match against. */ private String formatPatterns = null; private boolean transientValue = false; // // Constructors and Initializers // public FormatValidator() { super(); } /** * <p>Construct a FormatValidator with the specified formatPatterns * String. </p> * * @param formatPatterns <code>|</code> separated String of format patterns * that this validator must match against. * */ public FormatValidator(String formatPatterns) { super(); this.formatPatterns = formatPatterns; parseFormatPatterns(); } /** * <p>Return the format patterns that the validator supports. */ public String getFormatPatterns() { return (this.formatPatterns); } /** * <p>Set the format patterns that the validator support..</p> * * @param formatPatterns <code>|</code> separated String of format patterns * that this validator must match against. * */ public void setFormatPatterns(String formatPatterns) { this.formatPatterns = formatPatterns; parseFormatPatterns(); } /** * Parses the <code>formatPatterns</code> into validPatterns * <code>ArrayList</code>. The delimiter must be "|". */ public void parseFormatPatterns() { if ((formatPatterns == null) || (formatPatterns.length() == 0)) { return; } if (formatPatternsList != null) { // formatPatterns have been parsed already. return; } else { formatPatternsList = new ArrayList<String>(); } StringTokenizer st = new StringTokenizer(formatPatterns, "|"); while (st.hasMoreTokens()) { String token = st.nextToken(); formatPatternsList.add(token); } } // // Methods from Validator // public void validate( FacesContext context, UIComponent component, Object toValidate) { boolean valid = false; String value = null; if ((context == null) || (component == null)) { throw new NullPointerException(); } if (!(component instanceof UIInput)) { return; } if ((null == formatPatternsList) || (null == toValidate)) { return; } value = toValidate.toString(); // validate the value against the list of valid patterns. Iterator patternIt = formatPatternsList.iterator(); while (patternIt.hasNext()) { valid = isFormatValid(((String) patternIt.next()), value); if (valid) { break; } } if (!valid) { FacesMessage errMsg = MessageFactory.getMessage( context, FORMAT_INVALID_MESSAGE_ID, (new Object[] { formatPatterns })); throw new ValidatorException(errMsg); } } /** * Returns true if the value matches one of the valid patterns. */ protected boolean isFormatValid( String pattern, String value) { boolean valid = true; // if there is no pattern to match then value is valid if ((pattern == null) || (pattern.length() == 0)) { return true; } // if the value is null or a zero length string return false. if ((value == null) || (value.length() == 0)) { return false; } // if the length of the value is not equal to the length of the // pattern string then the value is not valid. if (value.length() != pattern.length()) { return false; } value = value.trim(); // rules for matching. // 1. if the matching pattern has a "A", then corresponding character // in the value should a letter. // 2. if the matching pattern has a "9", then corresponding character // in the value should a number // 3. if the matching pattern has a "#", then corresponding character // in the value should a number or a letter // 4.. any other character must match literally. char[] input = value.toCharArray(); char[] fmtpattern = pattern.toCharArray(); for (int i = 0; i < fmtpattern.length; ++i) { if (fmtpattern[i] == 'A') { if (!(Character.isLetter(input[i]))) { valid = false; } } else if (fmtpattern[i] == '9') { if (!(Character.isDigit(input[i]))) { valid = false; } } else if (fmtpattern[i] == '#') { if ((!(Character.isDigit(input[i]))) && (!(Character.isLetter(input[i])))) { valid = false; } } else { if (!(fmtpattern[i] == input[i])) { valid = false; } } } return valid; } public Object saveState(FacesContext context) { Object[] values = new Object[2]; values[0] = formatPatterns; values[1] = (ArrayList<String>) formatPatternsList; return (values); } public void restoreState( FacesContext context, Object state) { Object[] values = (Object[]) state; formatPatterns = (String) values[0]; formatPatternsList = (ArrayList<String>) values[1]; } public boolean isTransient() { return (this.transientValue); } public void setTransient(boolean transientValue) { this.transientValue = transientValue; } }
{ "content_hash": "a86aa28bfb8da96716d70206b455a84d", "timestamp": "", "source": "github", "line_count": 262, "max_line_length": 79, "avg_line_length": 31.950381679389313, "alnum_prop": 0.5902520606857007, "repo_name": "adamjhamer/hdiv-archive", "id": "bccc52c1276ffb1e893dff661fa4c6191b3f59fc", "size": "8619", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "hdiv-web-jsf-bookstore/examples/web/bookstore6/src/java/com/sun/bookstore6/validators/FormatValidator.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "1247136" }, { "name": "Shell", "bytes": "35" } ], "symlink_target": "" }
using namespace swift; static llvm::codegen::RegisterCodeGenFlags CGF; //===----------------------------------------------------------------------===// // Option Declarations //===----------------------------------------------------------------------===// // The OptimizationList is automatically populated with registered passes by the // PassNameParser. // static llvm::cl::list<const llvm::PassInfo *, bool, llvm::PassNameParser> PassList(llvm::cl::desc("Optimizations available:")); static llvm::cl::opt<bool> UseLegacyPassManager("legacy-pass-manager", llvm::cl::desc("Use the legacy llvm pass manager"), llvm::cl::init(true)); static llvm::cl::opt<bool> Optimized("O", llvm::cl::desc("Optimization level O. Similar to swift -O")); // TODO: I wanted to call this 'verify', but some other pass is using this // option. static llvm::cl::opt<bool> VerifyEach( "verify-each", llvm::cl::desc("Should we spend time verifying that the IR is well " "formed")); static llvm::cl::opt<std::string> TargetTriple("mtriple", llvm::cl::desc("Override target triple for module")); static llvm::cl::opt<bool> PrintStats("print-stats", llvm::cl::desc("Should LLVM Statistics be printed")); static llvm::cl::opt<std::string> InputFilename(llvm::cl::Positional, llvm::cl::desc("<input file>"), llvm::cl::init("-"), llvm::cl::value_desc("filename")); static llvm::cl::opt<std::string> OutputFilename("o", llvm::cl::desc("Override output filename"), llvm::cl::value_desc("filename")); static llvm::cl::opt<std::string> DefaultDataLayout( "default-data-layout", llvm::cl::desc("data layout string to use if not specified by module"), llvm::cl::value_desc("layout-string"), llvm::cl::init("")); //===----------------------------------------------------------------------===// // Helper Methods //===----------------------------------------------------------------------===// static llvm::CodeGenOpt::Level GetCodeGenOptLevel() { // TODO: Is this the right thing to do here? if (Optimized) return llvm::CodeGenOpt::Default; return llvm::CodeGenOpt::None; } // Returns the TargetMachine instance or zero if no triple is provided. static llvm::TargetMachine * getTargetMachine(llvm::Triple TheTriple, StringRef CPUStr, StringRef FeaturesStr, const llvm::TargetOptions &Options) { std::string Error; const auto *TheTarget = llvm::TargetRegistry::lookupTarget( llvm::codegen::getMArch(), TheTriple, Error); // Some modules don't specify a triple, and this is okay. if (!TheTarget) { return nullptr; } return TheTarget->createTargetMachine( TheTriple.getTriple(), CPUStr, FeaturesStr, Options, Optional<llvm::Reloc::Model>(llvm::codegen::getExplicitRelocModel()), llvm::codegen::getExplicitCodeModel(), GetCodeGenOptLevel()); } static void dumpOutput(llvm::Module &M, llvm::raw_ostream &os) { // For now just always dump assembly. llvm::legacy::PassManager EmitPasses; EmitPasses.add(createPrintModulePass(os)); EmitPasses.run(M); } // This function isn't referenced outside its translation unit, but it // can't use the "static" keyword because its address is used for // getMainExecutable (since some platforms don't support taking the // address of main, and some platforms can't implement getMainExecutable // without being given the address of a function in the main executable). void anchorForGetMainExecutable() {} static inline void addPass(llvm::legacy::PassManagerBase &PM, llvm::Pass *P) { // Add the pass to the pass manager... PM.add(P); if (P->getPassID() == &SwiftAAWrapperPass::ID) { PM.add(llvm::createExternalAAWrapperPass([](llvm::Pass &P, llvm::Function &, llvm::AAResults &AAR) { if (auto *WrapperPass = P.getAnalysisIfAvailable<SwiftAAWrapperPass>()) AAR.addAAResult(WrapperPass->getResult()); })); } // If we are verifying all of the intermediate steps, add the verifier... if (VerifyEach) PM.add(llvm::createVerifierPass()); } static void runSpecificPasses(StringRef Binary, llvm::Module *M, llvm::TargetMachine *TM, llvm::Triple &ModuleTriple) { llvm::legacy::PassManager Passes; llvm::TargetLibraryInfoImpl TLII(ModuleTriple); Passes.add(new llvm::TargetLibraryInfoWrapperPass(TLII)); const llvm::DataLayout &DL = M->getDataLayout(); if (DL.isDefault() && !DefaultDataLayout.empty()) { M->setDataLayout(DefaultDataLayout); } // Add internal analysis passes from the target machine. Passes.add(createTargetTransformInfoWrapperPass( TM ? TM->getTargetIRAnalysis() : llvm::TargetIRAnalysis())); if (TM) { // FIXME: We should dyn_cast this when supported. auto &LTM = static_cast<llvm::LLVMTargetMachine &>(*TM); llvm::Pass *TPC = LTM.createPassConfig(Passes); Passes.add(TPC); } for (const llvm::PassInfo *PassInfo : PassList) { llvm::Pass *P = nullptr; if (PassInfo->getNormalCtor()) P = PassInfo->getNormalCtor()(); else llvm::errs() << Binary << ": cannot create pass: " << PassInfo->getPassName() << "\n"; if (P) { addPass(Passes, P); } } // Do it. Passes.run(*M); } //===----------------------------------------------------------------------===// // Main Implementation //===----------------------------------------------------------------------===// int main(int argc, char **argv) { PROGRAM_START(argc, argv); INITIALIZE_LLVM(); // Initialize passes llvm::PassRegistry &Registry = *llvm::PassRegistry::getPassRegistry(); initializeCore(Registry); initializeScalarOpts(Registry); initializeObjCARCOpts(Registry); initializeVectorization(Registry); initializeIPO(Registry); initializeAnalysis(Registry); initializeTransformUtils(Registry); initializeInstCombine(Registry); initializeInstrumentation(Registry); initializeTarget(Registry); // For codegen passes, only passes that do IR to IR transformation are // supported. initializeCodeGenPreparePass(Registry); initializeAtomicExpandPass(Registry); initializeRewriteSymbolsLegacyPassPass(Registry); initializeWinEHPreparePass(Registry); initializeDwarfEHPrepareLegacyPassPass(Registry); initializeSjLjEHPreparePass(Registry); // Register Swift Only Passes. initializeSwiftAAWrapperPassPass(Registry); initializeSwiftARCOptPass(Registry); initializeSwiftARCContractPass(Registry); initializeInlineTreePrinterPass(Registry); initializeLegacySwiftMergeFunctionsPass(Registry); llvm::cl::ParseCommandLineOptions(argc, argv, "Swift LLVM optimizer\n"); if (PrintStats) llvm::EnableStatistics(); llvm::SMDiagnostic Err; // Load the input module... auto LLVMContext = std::make_unique<llvm::LLVMContext>(); std::unique_ptr<llvm::Module> M = parseIRFile(InputFilename, Err, *LLVMContext.get()); if (!M) { Err.print(argv[0], llvm::errs()); return 1; } if (verifyModule(*M, &llvm::errs())) { llvm::errs() << argv[0] << ": " << InputFilename << ": error: input module is broken!\n"; return 1; } // If we are supposed to override the target triple, do so now. if (!TargetTriple.empty()) M->setTargetTriple(llvm::Triple::normalize(TargetTriple)); // Figure out what stream we are supposed to write to... std::unique_ptr<llvm::ToolOutputFile> Out; // Default to standard output. if (OutputFilename.empty()) OutputFilename = "-"; std::error_code EC; Out.reset( new llvm::ToolOutputFile(OutputFilename, EC, llvm::sys::fs::OF_None)); if (EC) { llvm::errs() << EC.message() << '\n'; return 1; } llvm::Triple ModuleTriple(M->getTargetTriple()); std::string CPUStr, FeaturesStr; llvm::TargetMachine *Machine = nullptr; const llvm::TargetOptions Options = llvm::codegen::InitTargetOptionsFromCodeGenFlags(ModuleTriple); if (ModuleTriple.getArch()) { CPUStr = llvm::codegen::getCPUStr(); FeaturesStr = llvm::codegen::getFeaturesStr(); Machine = getTargetMachine(ModuleTriple, CPUStr, FeaturesStr, Options); } std::unique_ptr<llvm::TargetMachine> TM(Machine); // Override function attributes based on CPUStr, FeaturesStr, and command line // flags. llvm::codegen::setFunctionAttributes(CPUStr, FeaturesStr, *M); if (Optimized) { IRGenOptions Opts; Opts.OptMode = OptimizationMode::ForSpeed; Opts.LegacyPassManager = UseLegacyPassManager; // Then perform the optimizations. performLLVMOptimizations(Opts, M.get(), TM.get()); } else { runSpecificPasses(argv[0], M.get(), TM.get(), ModuleTriple); } // Finally dump the output. dumpOutput(*M, Out->os()); return 0; }
{ "content_hash": "53f1b617dc2ce82fa1c3ac5b11bc3fe9", "timestamp": "", "source": "github", "line_count": 261, "max_line_length": 80, "avg_line_length": 34.842911877394634, "alnum_prop": 0.6296459203870683, "repo_name": "benlangmuir/swift", "id": "45c6178222aec63926a7292a088748c53d0b50c5", "size": "11838", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "tools/swift-llvm-opt/LLVMOpt.cpp", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "47063" }, { "name": "C", "bytes": "5465361" }, { "name": "C++", "bytes": "48553779" }, { "name": "CMake", "bytes": "726224" }, { "name": "D", "bytes": "1107" }, { "name": "DTrace", "bytes": "2593" }, { "name": "Emacs Lisp", "bytes": "57637" }, { "name": "LLVM", "bytes": "74481" }, { "name": "Makefile", "bytes": "2361" }, { "name": "Objective-C", "bytes": "476267" }, { "name": "Objective-C++", "bytes": "162387" }, { "name": "Python", "bytes": "1818826" }, { "name": "Roff", "bytes": "3683" }, { "name": "Ruby", "bytes": "2132" }, { "name": "Shell", "bytes": "215898" }, { "name": "Swift", "bytes": "40342212" }, { "name": "Vim Script", "bytes": "20025" }, { "name": "sed", "bytes": "1056" } ], "symlink_target": "" }
static MEANING parents[MAX_PARENTS+20]; // nodes above where we are now static int parentIndex = 0; // add into parents at here static int parentWalk = 0; // retrieve from parents starting here. when reach parentIndex you have run out static unsigned int currentBaseInfer; // start of reserved marks static unsigned int currentFreeInfer; // marks before this are reserved unsigned int inferMark = 0; // primary "been-here" mark for all inferencing and tree traversals static unsigned int saveMark = 0; // tertiary mark - used in zone 1 control static unsigned int ignoremark = 0; // mark on entries to ignore static WORDP fact = 0; #define ORIGINALWORD 0x00000001 #define NORMAL 0x00000002 // class and set are a group (recursive) #define QUOTED 0x00000004 // class and set are simple words #define PREMARK 0X00000008 // marking but save word not meaning so wont use as scan #define NOQUEUE 0X00000010 // just marked with mark, not queued #define QUEUE 0X00000020 // add to q #define NOTOPIC 0X00000040 // dont follow topic/set names #define BLOCKMEANING 0X00000080 #define FACTTYPE 0X00000100 #define FINDTOPIC 0X00000200 #define UPDICTIONARY 0X00000400 #define USERFACTS 0X00000800 #define SYSTEMFACTS 0X00001000 #define FINDCONCEPT 0X00002000 // 4 8 unused #define USE_ORIGINAL_SUBJECT 0x00010000 // use subject as fact source #define USE_ORIGINAL_OBJECT 0x00020000 // use object as fact source #define RICCOCHET_USING_SUBJECT 0x00040000 #define RICCOCHET_USING_OBJECT 0x00080000 #define RICCOCHET_BITS ( USE_ORIGINAL_SUBJECT | USE_ORIGINAL_OBJECT | RICCOCHET_USING_SUBJECT | RICCOCHET_USING_OBJECT ) // queued entries pending scanning static MEANING queue[MAX_QUEUE+20]; static unsigned int queueIndex; // answers from inferences go in these sets FACT* factSet[MAX_FIND_SETS+2][MAX_FIND+1]; int factFlags[MAX_FIND+1]; int factIndex[MAX_FIND+1]; unsigned int factSetNext[MAX_FIND_SETS+1]; // when walking a set over time, which index to continue from static void AddSet2Scan(unsigned int flags,WORDP D,int depth); unsigned int NextInferMark() // set up for a new inference { return ++inferMark; } FACT* IsConceptMember(WORDP D) { if (!D) return NULL; FACT* F = GetSubjectNondeadHead(D); while (F) { if (F->verb == Mmember) return F; // is a concept member so it is ok F = GetSubjectNondeadNext(F); } return NULL; } static bool IsExcluded(WORDP set,WORDP item) { if (!(set->internalBits & HAS_EXCLUDE)) return false; FACT* F = GetObjectNondeadHead(set); while (F) { if (F->verb == Mexclude && Meaning2Word(F->subject) == item) break; F = GetObjectNondeadNext(F); } return (F) ? true : false; } static bool SetContains1(MEANING set,MEANING M, unsigned int depth) { if (!M || !set) return false; // the word WORDP D = Meaning2Word(M); unsigned int index = Meaning2Index(M); D->inferMark = inferMark; FACT* F = GetSubjectNondeadHead(D); WORDP D1 = Meaning2Word(set); // we walk up the tree from the word and see if it runs into D1, the set. if (depth == 0) { SetFactBack(D,0); if (trace & TRACE_INFER && CheckTopicTrace()) Log(STDTRACELOG,(char*)" %s ? %s ",D->word,D1->word); } unsigned int counter = 20000; while (F && --counter) { if (index != 0 && F->subject != M); // fact doesnt apply else if (F->verb == Mmember) { // if this topic or concept has exclusions, check to see if this is a marked exclusion bool blocked = false; WORDP object = Meaning2Word(F->object); if (object->internalBits & HAS_EXCLUDE) { FACT* G = GetObjectNondeadHead(object); while (G && !blocked) { if (G->verb == Mexclude && Meaning2Word(G->subject)->inferMark == inferMark) blocked = true; else G = GetObjectNondeadNext(G); } } // since this is not a marked exclusion, we can say it is a member if (F->object == set && !blocked) { if (trace & TRACE_INFER && CheckTopicTrace()) // show the path from set back to word { Log(STDTRACELOG,(char*)"\r\n"); Log(STDTRACETABLOG,(char*)"within: %s ",D1->word); WORDP path = Meaning2Word(F->subject); while (path) { Log(STDTRACELOG,(char*)" %s ",path->word); FACT* prior = Index2Fact(GetFactBack(path)); path = (prior) ? Meaning2Word(prior->subject) : 0; } Log(STDTRACELOG,(char*)"\r\n"); Log(STDTRACETABLOG,(char*)""); } return true; } if (!blocked && object->inferMark != inferMark) { SetFactBack(object,Fact2Index(F)); if (SetContains1(set,F->object,depth + 1)) return true; } } else if (F->verb == Mis) // a link up the wordnet ontology { if (F->object == set) return true; WORDP object = Meaning2Word(F->object); if (object->inferMark != inferMark) { SetFactBack(object,Fact2Index(F)); if (SetContains1(set,F->object,depth + 1)) return true; } } F = GetSubjectNondeadNext(F); } if (trace & TRACE_INFER && depth == 0 && CheckTopicTrace()) { Log(STDTRACELOG,(char*)" not within "); } return false; } bool SetContains(MEANING set,MEANING M) { bool answer = SetContains1(set,M,0); ClearBacktracks(); return answer; } static bool AllowedMember(FACT* F, unsigned int i,unsigned int is,unsigned int index) { if (trace & TRACE_INFER && CheckTopicTrace()) TraceFact(F); unsigned int localIndex = Meaning2Index(F->subject); unsigned int pos = GetMeaningType(F->subject); bool bad = false; if (!i && pos ) { if (pos & VERB && is & NOUN) { bad = true; } else if (pos & NOUN && is & VERB) { bad = true; } else if ((pos & ADJECTIVE || localIndex & ADVERB) && is & (NOUN|VERB)) { bad = false; } } else if (index && pos && pos != index) bad = true; return !bad; } static void QueryFacts(WORDP original, WORDP D,unsigned int index,unsigned int store,char* kind,MEANING A) { if (!D || D->inferMark == inferMark) return; D->inferMark = inferMark; FACT* F; FACT* G = GetSubjectNondeadHead(D); unsigned int count = 20000; unsigned int restriction = 0; if (kind) // limitation on translation of word as member of a set { if (!strnicmp(kind,(char*)"subject",7)) restriction = NOUN; else if (!strnicmp(kind,(char*)"verb",4)) restriction = VERB; else if (!strnicmp(kind,(char*)"object",7)) restriction = NOUN; } while (G) { F = G; G = GetSubjectNondeadNext(G); if (trace & TRACE_INFER && CheckTopicTrace()) TraceFact(F); if (!--count) { ReportBug((char*)"matchfacts infinite loop") break; } uint64 flags = F->flags; unsigned int fromindex = Meaning2Index(F->subject); if (fromindex == index || !fromindex); // we allow penguins to go up to bird, then use unnamed bird to go to ~topic else if (index ) continue; // not following this path else if (flags & ORIGINALWORD) continue; // you must match exactly- generic not allowed to match specific wordnet meaning- hierarchy BELOW only if (F->verb == Mmember && !AllowedMember(F,0,restriction,0)) continue; // POS doesn't match if (F->verb == Mmember && !(flags & ORIGINALWORD)) { WORDP object = Meaning2Word(F->object); if (object->inferMark != inferMark) { if (*object->word == '~') // set, not a word association { if (IsExcluded(object,original)) continue; // explicitly excluded from this set if (object->internalBits & TOPIC) { int topic = FindTopicIDByName(object->word); if (topic && !(GetTopicFlags(topic) & TOPIC_SYSTEM) && HasGambits(topic)) AddFact(store,CreateFact(MakeMeaning(original,0),A,MakeMeaning(object,0),FACTTRANSIENT)); } } QueryFacts(original,object,0,store,kind,A); } } } } FunctionResult QueryTopicsOf(char* word,unsigned int store,char* kind) // find topics referred to by word { SET_FACTSET_COUNT(store,0); NextInferMark(); WORDP D = FindWord(word,0); QueryFacts(D,D,0,store,kind,MakeMeaning(FindWord((char*)"a"))); if (trace & TRACE_INFER && CheckTopicTrace()) Log(STDTRACELOG,(char*)"QueryTopics: %s %d ",word,FACTSET_COUNT(store)); impliedSet = ALREADY_HANDLED; return NOPROBLEM_BIT; } static bool AddWord2Scan(int flags,MEANING M,MEANING from,int depth,unsigned int type) // mark (and maybe queue) this word + implied wordnet up hierarchy + auto-equivalences { if (queueIndex >= MAX_QUEUE || !M) return false; if (type && !(M & type) && GETTYPERESTRICTION(M)) return false; // not valid type restriction // mark word or abandon marking WORDP D = Meaning2Word(M); unsigned int index = Meaning2Index(M); if (D->inferMark == saveMark || (ignoremark && D->inferMark == ignoremark)) return false; // marked with a current mark if (depth > FOLLOW_LIMIT) { ReportBug((char*)"Exceeding follow limit %s\r\n",D->word) return false; } // concept set has exclusions, so if excluded is already marked, do not allow this topic to be marked if (D->internalBits & HAS_EXCLUDE) { FACT* G = GetObjectNondeadHead(D); while (G) { if (G->verb == Mexclude && Meaning2Word(G->subject)->inferMark == saveMark) return false; G = GetObjectNondeadNext(G); } } D->inferMark = saveMark; if (flags & QUEUE) queue[queueIndex++] = M; if (trace & TRACE_QUERY && CheckTopicTrace()) { static char last[1000]; if (from) { char* mean = WriteMeaning(from); if (stricmp(last,mean)) { Log(STDTRACELOG,(char*)"\r\n"); Log(STDTRACETABLOG,(char*)"(%s=>) ",mean); if (strlen(mean) > 999) ReportBug("Scan insert > 1000") else strcpy(last,mean); } } Log(STDTRACELOG,(flags & QUEUE) ? (char*)" %s+" : " %s. ",WriteMeaning(M)); } // auto check all equivalences as well FACT* F = GetSubjectNondeadHead(D); while (F) { if (F->verb == Mmember) // can be member of an ordinary word (like USA member United_States_of_America), creates equivalence { WORDP D = Meaning2Word(F->object); if (*D->word != '~') AddWord2Scan(flags,F->object,F->subject,depth+1,type); // member is not to a set, but to a word. So it's an equivalence } F = GetSubjectNondeadNext(F); } // and if item is generic, all synsets if (index == 0 && !(flags & ORIGINALWORD)) { unsigned int count = GetMeaningCount(D); for (unsigned int i = 1; i <= count; ++i) AddWord2Scan(flags,GetMeaning(D,i),M,depth+1,type); } return true; } static bool AddWordOnly(int flags,char* word,unsigned int type) // mark (and maybe queue) this word { if (queueIndex >= MAX_QUEUE || !*word) return false; // mark word or abandon marking WORDP D = StoreWord(word,AS_IS); if (D->inferMark == saveMark) return false; // marked with a current mark D->inferMark = saveMark; if (flags & QUEUE) queue[queueIndex++] = MakeMeaning(D); if (trace & TRACE_QUERY && CheckTopicTrace()) Log(STDTRACELOG,(flags & QUEUE) ? (char*)" %s+" : (char*)" %s. ",D->word); return true; } static void AddWordOrSet2Scan(unsigned int how, char* word,int depth) { ++depth; if (!(how & ORIGINALWORD) && *word == '~' && word[1]) // recursive on set and all its members { WORDP D = FindWord(word,0); if (D) { if (how & NOTOPIC && D->internalBits & TOPIC) {;} else if (AddWord2Scan(how, MakeMeaning(D,0),0,depth,0)) AddSet2Scan(how,D,depth); // mark the original name and then follow its members } } else { if (*word == '\'') { // WORDP D = FindWord(word); //if (!D) ++word; // but dont harm 'tween_decks which is natural } AddWord2Scan(how, ReadMeaning(word, true, true), 0, depth, 0); } } static void AddSet2Scan(unsigned int how,WORDP D,int depth) { ++depth; FACT* F = GetObjectNondeadHead(D); while (F) { if (F->verb == Mmember) AddWordOrSet2Scan(how | (F->flags & ORIGINALWORD),Meaning2Word(F->subject)->word,depth); F = GetObjectNondeadNext(F); } } // used by query setup - scans noun hierarchies upwards for inference static void ScanHierarchy(MEANING T,int savemark,unsigned int flowmark,bool up,unsigned int flag, unsigned int type) { if (!T) return; if (trace & TRACE_QUERY && CheckTopicTrace()) Log(STDTRACELOG,(char*)"\r\nHierarchy: (%s=>) ",WriteMeaning(T)); if (!AddWord2Scan(flag,T,0,0,type)) return; parentIndex = parentWalk = 0; parents[parentIndex++] = T; WORDP A = Meaning2Word(T); int index = Meaning2Index(T); int start = 1; // find its wordnet ontological meanings, they then link synset head to synset head // automatically store matching synset heads to this also -- THIS APPLIES ONLY TO THE ORIGINAL WORDP MEANING* onto = GetMeaningsFromMeaning(T); unsigned int size = GetMeaningCount(A); if (!up || flag & BLOCKMEANING ) size = 0;// we are a specific meaning already, so are the synset head of something - or are going down else if (index) start= size = index; // do JUST this one else if (!size) size = 1; // even if no ontology, do it once for for (unsigned int k = start; k <= size; ++k) // for each meaning of this word, mark its synset heads { MEANING T1; if (GetMeaningCount(A)) { T1 = (MEANING)(ulong_t)onto[k]; // this is the synset ptr. if (T1 & SYNSET_MARKER) T1 = MakeMeaning(A,k) | SYNSET_MARKER; else T1 = GetMaster(T1); if (type && !(T1 & type)) continue; if (! AddWord2Scan(flag,T1,T,0,type)) continue; // either already marked OR to be ignored parents[parentIndex++] = T1; } } while (parentWalk < parentIndex) // walk up its chains in stages { T = parents[parentWalk++]; if (!T) continue; if (parentIndex > MAX_PARENTS) break; // overflow may happen. give up WORDP D = Meaning2Word(T); unsigned int index = Meaning2Index(T); // now follow facts of the synset head itself or the word itself. FACT* F = GetSubjectNondeadHead(D); while (F) { WORDP verb = Meaning2Word(F->verb); FACT* G = F; if (trace & TRACE_QUERY && CheckTopicTrace()) TraceFact(F); F = GetSubjectNondeadNext(F); if (verb->inferMark != flowmark) continue; // if the incoming ptr is generic, it can follow out any generic or pos_generic reference. // It cannot follow out a specific reference of a particular meaning. // An incoming non-generic ptr is always specific (never pos_generic) and can only match specific exact. if (index && T != G->subject) continue; // generic can run all meanings out of here MEANING x = G->object; if (type && GETTYPERESTRICTION(G->subject ) && !(type & GETTYPERESTRICTION(G->subject ))) continue; // fact has bad type restriction on subject if (!AddWord2Scan(flag,x,G->subject,0,type)) continue; // either already marked OR to be ignored parents[parentIndex++] = x; } } if (trace & TRACE_QUERY && CheckTopicTrace()) Log(STDTRACELOG,(char*)"\r\n"); } static bool Riccochet(unsigned int baseFlags, FACT* G,int set,unsigned int limit,unsigned int rmarks,unsigned int rmarkv, unsigned int rmarko) {// use two fields to select a third. Then look at facts of that third to find a matching verb. FACT* F; WORDP D1; if (G->flags & (FACTSUBJECT|FACTOBJECT)) // we cant get here if the wrong field is a fact. { D1 = fact; F = (baseFlags & USE_ORIGINAL_SUBJECT) ? Index2Fact(G->subject) : Index2Fact(G->object); } else { D1 = (baseFlags & USE_ORIGINAL_SUBJECT) ? Meaning2Word(G->subject) : Meaning2Word(G->object); F = (baseFlags & RICCOCHET_USING_SUBJECT) ? GetSubjectNondeadHead(D1) : GetObjectNondeadHead(D1); } if (trace & TRACE_QUERY && CheckTopicTrace()) { WORDP S = (G->flags & FACTSUBJECT) ? fact : Meaning2Word(G->subject); WORDP V = (G->flags & FACTVERB) ? fact : Meaning2Word(G->verb); WORDP O = (G->flags & FACTOBJECT) ? fact : Meaning2Word(G->object); char* use = (baseFlags & RICCOCHET_USING_SUBJECT) ? (char*) "subjectfield" : (char*) "objectfield"; if (baseFlags & USE_ORIGINAL_SUBJECT) Log(STDTRACELOG,(char*)"Riccochet incoming (%s %s %s) via subject %s using %s\r\n",S->word,V->word,O->word,D1->word,use); else Log(STDTRACELOG,(char*)"Riccochet incoming (%s %s %s) via object %s using %s\r\n",S->word,V->word,O->word,D1->word,use); } // walk all facts at node testnig for riccochet while (F) // walk_of_S3 { if (trace & TRACE_QUERY && CheckTopicTrace()) TraceFact(F); FACT* I = F; if (D1 == fact) F = NULL; // only the 1 main fact else F = (baseFlags & RICCOCHET_USING_SUBJECT) ? GetSubjectNondeadNext(F) : GetObjectNondeadNext(F); if (I->flags & FACTDEAD) continue; // cannot use this // reasons this fact is no good if (I->flags & MARKED_FACT) continue; // already seen this answer if ((baseFlags & SYSTEMFACTS && I > factLocked) || (baseFlags & USERFACTS && I <= factLocked) ) continue; // restricted by owner of fact if (rmarks && (I->flags & FACTSUBJECT || Meaning2Word(I->subject)->inferMark != rmarks)) continue; // mark must match if (rmarkv && (I->flags & FACTVERB || Meaning2Word(I->verb)->inferMark != rmarkv)) continue; // mark must match if (rmarko && (I->flags & FACTOBJECT || Meaning2Word(I->object)->inferMark != rmarko)) continue; // mark must match I->flags |= MARKED_FACT; AddFact(set,I); if (trace & TRACE_QUERY && CheckTopicTrace()) { Log(STDTRACELOG,(char*)" Found:"); TraceFact(I); } if (FACTSET_COUNT(set) >= limit) return false; } return true; } static bool ConceptPropogateTest(MEANING M,unsigned int mark,unsigned int depth) // is this meaning ultimately in a marked set { if (!depth) { NextInferMark(); if (trace & TRACE_QUERY && CheckTopicTrace()) Log(STDTRACELOG,(char*)"\r\n ~propogate: "); } FACT* F = GetSubjectNondeadHead(M); while (F) { if (F->verb == Mmember && F->subject == M) { MEANING O = F->object; WORDP D = Meaning2Word(O); if (trace & TRACE_QUERY && CheckTopicTrace()) Log(STDTRACELOG,(char*)" %d->%s ",depth,D->word); if (D->inferMark == mark) return true; // this is what we seek if (D->inferMark != inferMark)// not already visited this pass or is marked for current query for other use { if (D->inferMark < currentBaseInfer || D->inferMark >= currentFreeInfer) D->inferMark = inferMark; // safely set seen this (efficiency) if (*D->word == '~' && ConceptPropogateTest(O,mark,depth+1)) return true; // NOT setting been here- and dont follow fake members ( word member word) } } F = GetSubjectNondeadNext(F); } return false; } unsigned int Query(char* kind, char* subjectword, char* verbword, char* objectword, unsigned int count, char* fromset, char* toset, char* propogate, char* match) { int store = GetSetID(toset); if (store == ILLEGAL_FACTSET) store = 0; if (trace & TRACE_QUERY && CheckTopicTrace()) Log(STDTRACETABLOG,(char*)"QUERY: @%d %s ",store,kind); WORDP C = FindWord(kind,0); if (!C || !(C->internalBits & QUERY_KIND)) { ReportBug((char*)"Illegal query name: %s",kind) return 0; } char copy[MAX_WORD_SIZE]; // hold the actual control value, so we can overwrite it char* control = NULL; if (C->w.userValue && *C->w.userValue) { strcpy(copy,C->w.userValue); control = copy; } else { ReportBug((char*)"query control lacks data %s",kind) return 0; } // get correct forms of arguments - _ is an empty argument, but legal char word[MAX_WORD_SIZE]; int n; if (!strchr(subjectword,' ')) // anything with a natural space in it should be left alone { n = BurstWord(subjectword); if (n > 1) strcpy(subjectword,JoinWords(n,false)); } if (!strchr(verbword,' ')) // anything with a natural space in it should be left alone { n = BurstWord(verbword); if (n > 1) strcpy(verbword,JoinWords(n,false)); } if (!strchr(objectword,' ')) // anything with a natural space in it should be left alone { n = BurstWord(objectword); if (n > 1) strcpy(objectword,JoinWords(n,false)); } if (!strchr(match,' ')) // anything with a natural space in it should be left alone { n = BurstWord(match); if (n > 1) strcpy(match,JoinWords(n,false)); } if (!strchr(propogate,' ')) // anything with a natural space in it should be left alone { n = BurstWord(propogate); if (n > 1) strcpy(propogate,JoinWords(n,false)); } if (trace & TRACE_QUERY && CheckTopicTrace()) { Log(STDTRACETABLOG,(char*)" control: %s s/v/o:[%s %s %s] count:%d ",control,subjectword,verbword,objectword,count); if (*fromset != '?') Log(STDTRACELOG,(char*)"fromset:%s ",fromset); if (*toset != '?') Log(STDTRACELOG,(char*)"toset:%s ",toset); if (*propogate != '?') Log(STDTRACELOG,(char*)"propogate:%s",propogate); if (*match != '?') Log(STDTRACELOG,(char*)"match:%s",match); Log(STDTRACELOG,(char*)"\r\n"); Log(STDTRACETABLOG,(char*)""); } // handle what sets are involved if (impliedOp == 0 || impliedOp == '=') SET_FACTSET_COUNT(store,0); // auto kill content else if (impliedOp != '+') { SET_FACTSET_COUNT(store,0); // we dont support other ops like -= return 0; } int from = GetSetID(fromset); if (from == ILLEGAL_FACTSET) from = 0; unsigned int baseFlags = 0; if (!stricmp(fromset,(char*)"user")) baseFlags |= USERFACTS; if (!stricmp(fromset,(char*)"system")) baseFlags |= SYSTEMFACTS; queueIndex = 0; ignoremark = 0; unsigned int baseMark = inferMark; // offsets of this value currentBaseInfer = baseMark + 1; // start of used marks // process initialization nextsearch: // can do multiple searches, thought they have the same basemark so can be used across searchs (or not) up to 9 marks #ifdef INFORMATION # first segment describes what to initially mark and initially queue for processing (sources of facts) # Values: # 1..9 = set global tag to this label - 0 means turn off global tag # i = use argument tag on words to ignore during a tag or queue operation # Next char is tag label. 0 means no ignoremark # s/v/o/p/m/~set/tick-word = use subject/verb/object/progogate/match/factset argument as item to process or use named set or given word # S/V/O choice is a fact id # This is automatically marked using the current mark and is followed by # q = queue items (sets will follow to all members recursively and wordnet identities will propogate up) # Q = queue this exact word only # t = tag (no queue) items # e = expandtag (no queue) (any set gets all things below it tagged) # h = tag propogation from base (such propogation might be large) # 1ST char after h is mark on verbs to propogate thru # 2nd char is t or q (for tag or mark/queue) # 3rd char (< >) after h is whether to propogate up from left/subject to object or down/right from object to subject when propogating # n = implied all topics marked to ignore on object # f = use given facts in from as items to process -- f@n means use this set # This is followed by # s/v/o/f = use corresponding field of fact or entire fact # the value to process will be marked AND may or may not get stored, depending on following flag being q or m #endif // ZONE 1 - mark and queue setups char myset[10]; int baseOffset = 0; // facts come from this side, and go out the verb or other side char* choice; char* at; int qMark = 0; int mark = 0; int whichset = 0; fact = FindWord((char*)"fact"); char maxmark = '0'; // deepest mark user has used if (trace & TRACE_QUERY && CheckTopicTrace()) { // convert all _ and periods to spaces for easier viewing char* underscore; while ((underscore = strchr(control,'_'))) *underscore = ' '; char* colon = strchr(control,':'); if (colon) *colon = 0; Log(STDTRACELOG,(char*)"@@@ Control1 mark/queue: %s\r\n",control); if (colon) *colon = ':'; Log(STDTRACETABLOG,(char*)""); } --control; bool facttype = false; while (*++control && *control != ':' ) { choice = NULL; switch(*control) { case '_': case '.': case ' ': // does nothing per se continue; case '0': // means NO savemark saveMark = 0; continue; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': // set current marks saveMark = baseMark + *control - '0'; if (*control > maxmark) maxmark = *control; continue; case 'n': // ignore all member facts involving topic as object if (trace & TRACE_QUERY && CheckTopicTrace()) Log(STDTRACELOG,(char*)" ignore all member facts w topics as objects "); ++control; baseFlags |= NOTOPIC; continue; case '~': case '\'': // use named set or named word choice = control; at = strchr(control,'.'); // set name ends with _ or . or space (generated) if (!at) at = strchr(control,'_'); if (!at) at = strchr(control,' '); if (!at) { ReportBug((char*)"Couldnt find end of name %s in control",control) return 0; // couldn't find end of name } *at = 0; control = at; // skip past to end break; case 'i': ++control; if (trace & TRACE_QUERY && CheckTopicTrace()) Log(STDTRACELOG,(char*)" ignore #%c results ", *control); ignoremark = (*control == '0') ? 0 : (baseMark + (*control - '0')); break; case 's': choice = subjectword; mark = 0; break; case 'S': choice = subjectword; mark = 0; facttype = true; break; case 'v': // automatically quote verbs. NEVER let them wander if (*verbword == '\'') strcpy(word,verbword); else { *word = '\''; strcpy(word+1,verbword); } choice = word; mark = 1; break; case 'V': choice = verbword; mark = 1; facttype = true; break; case 'o': choice = objectword; mark = 2; break; case 'O': choice = objectword; mark = 2; facttype = true; break; case 'p': choice = propogate; break; case 'm': choice = match; break; case 'f': // we have incoming facts to use whichset = (control[1] == '@') ? GetSetID(++control) : from; // only allowed sets 1-9 if (whichset == ILLEGAL_FACTSET) return 0; sprintf(myset,"@%d",whichset); choice = myset; break; default: ReportBug((char*)"Bad control code for query init %s(%s) %s",C->word,C->w.userValue,control) return 0; } if (choice) // we have something to follow { ++control; // now see flags on the choice unsigned int flags = baseFlags; // dont treat 'tween_decks as an originalword request if (choice[0] == '\'' ) // && !IsAlphaUTF8(choice[1])) //dont expand this beyond its first leve -- $$tmp would come in with its value, which if set would fan out. '$$tmp gets just its value { flags |= ORIGINALWORD; ++choice; } if (choice[0] == '^') // replace the function arg { strcpy(word,callArgumentList[atoi(choice+1)+fnVarBase]); choice = word; } // dynamic choices if (choice[0] == '_') { int wild = GetWildcardID(choice); if (wild == ILLEGAL_MATCHVARIABLE){;} else if (flags != 0) { choice = wildcardOriginalText[wild]; if (*choice != '~') flags = 0; // '_0 treated as normal word unquoted (original meaning) unless its a set, then it must not expand instead } else choice = wildcardCanonicalText[wild]; } else if (choice[0] == USERVAR_PREFIX) choice = GetUserVariable(choice); else if (choice[0] == SYSVAR_PREFIX && choice[1]) choice = SystemVariable(choice,NULL); else if (choice[0] == '@' ) { if (trace & TRACE_QUERY && CheckTopicTrace()) { Log(STDTRACELOG,(char*)"\r\n"); Log(STDTRACETABLOG,(char*)"FactField: %c(%d) ",saveMark-baseMark+'0',saveMark); } choice = NULL; for (unsigned int j = 1; j <= FACTSET_COUNT(whichset); ++j) { FACT* F = factSet[whichset][j]; if (F->flags & FACTDEAD) continue; // cannot use this MEANING M; if (*control == 'f') // whole fact can be queued. It cannot be marked as on the queue { queue[queueIndex++] = Fact2Index(F); continue; } else if (*control == 's') M = F->subject; else if (*control == 'v') M = F->verb; else if (*control == 'o') M = F->object; else { ReportBug((char*)"bad control for query %s(%s) %s",C->word,C->w.userValue,control) return 0; } if (trace & TRACE_QUERY && CheckTopicTrace()) Log(STDTRACELOG,(char*)" %s ",WriteMeaning(M)); AddWord2Scan((control[1] == 'q') ? (QUEUE|flags) : flags,M,0,0,0); } continue; } else if (facttype) // choice is a fact { if (!IsDigit(*choice)) return 0; // illegal fact reference unsigned int f = atoi(choice); if (atoi(choice) > (int) Fact2Index(factFree)) return 0; // beyond legal range // we can q it but we dont mark it.... queue[queueIndex++] = f; baseFlags |= FACTTYPE; facttype = false; continue; } if (choice[0] == '\\') // accept this unchanged { if (trace & TRACE_QUERY && CheckTopicTrace()) Log(STDTRACELOG,(char*)" raw "); ++choice; } // for non-factset values of choice char buf[1000]; if (trace & TRACE_QUERY && CheckTopicTrace()) sprintf(buf,(char*)"%s #%c(%d)",choice,saveMark-baseMark+'0',saveMark); if (*control == 'q') { if (trace & TRACE_QUERY && CheckTopicTrace()) { Log(STDTRACELOG,(char*)"\r\n"); Log(STDTRACETABLOG,(char*)"Tag+Queue: %s ",buf); } qMark = saveMark; // if we q more later, use this mark by default if (*choice) AddWordOrSet2Scan(QUEUE|flags,choice,0); // mark and queue items } else if (*control == 'Q') { if (trace & TRACE_QUERY && CheckTopicTrace()) { Log(STDTRACELOG,(char*)"\r\n"); Log(STDTRACETABLOG,(char*)"Tag+QueueWord: %s ",buf); } qMark = saveMark; // if we q more later, use this mark by default if (*choice) AddWordOnly(QUEUE|flags,choice,0); // mark and queue item } else if (*control == 't') { if (trace & TRACE_QUERY && CheckTopicTrace()) { Log(STDTRACELOG,(char*)"\r\n"); Log(STDTRACETABLOG,(char*)"Tag: %s ",buf); if (flags & ORIGINALWORD) Log(STDTRACELOG,(char*)" don't expand "); } if (!*choice); else if (*choice == '\'') AddWord2Scan(flags, ReadMeaning(choice+1,true,true),0,0,0); // ignore unneeded quote else AddWord2Scan(flags, ReadMeaning(choice,true,true),0,0,0); } else if (*control == 'T') // tag and dont follow { if (trace & TRACE_QUERY && CheckTopicTrace()) { Log(STDTRACELOG,(char*)"\r\n"); Log(STDTRACETABLOG,(char*)"Tag: %s ",buf); if (flags & ORIGINALWORD) Log(STDTRACELOG,(char*)" don't expand "); } qMark = saveMark; // if we q more later, use this mark by default if (*choice) AddWordOnly(flags,choice,0); // mark and queue item } else if (*control == 'e') { if (trace & TRACE_QUERY && CheckTopicTrace()) { Log(STDTRACELOG,(char*)"\r\n"); Log(STDTRACETABLOG,(char*)" ExpandTag: %s ",buf); } if (*choice) AddWordOrSet2Scan(flags,choice,0); // tag but dont queue } else if (*control == '<' || *control == '>') // chase hierarchy (exclude VERB hierarchy-- we infer on nouns) { // callArgumentList are: flowverbs, queue or mark, char kind = *control; //< or > int flows = baseMark + *++control - '0'; // mark for flow unsigned int flag = (*++control == 'q') ? QUEUE : 0; if (trace & TRACE_QUERY && CheckTopicTrace()) { if (flag) Log(STDTRACELOG,(char*)" Tag+Queue Propogate %c ",kind); else Log(STDTRACELOG,(char*)" Tag Propogate %c ",kind); } // if (flag & QUEUE) flag |= BLOCKMEANING; // mark subject 0 and object 2 are nouns, 1 is verb if (*choice) ScanHierarchy(ReadMeaning(choice,true,true),saveMark,flows,kind == '<',flag, (mark != 1) ? NOUN : VERB); } else { ReportBug((char*)"bad follow argument %s",control) return 0; } if (trace & TRACE_QUERY && CheckTopicTrace()) { Log(STDTRACELOG,(char*)"\r\n"); Log(STDTRACETABLOG,(char*)""); } } else if (baseFlags & USERFACTS) // transfer over user flags { unsigned int total = factFree - factLocked; if (total >= MAX_QUEUE) total = MAX_QUEUE - 1; FACT* F = factFree - total; while (++F <= factFree) queue[queueIndex++] = Fact2Index(F); baseFlags |= FACTTYPE; } } inferMark += maxmark - '0'; // update to use up marks we have involved currentFreeInfer = inferMark; ignoremark = 0; // require be restated if a matching requirement // ZONE 2 - how to use contents of the queue // given items in queue, what field from a queued entry to use facts from if (*control) control = SkipWhitespace(control+1); // skip over the : and past any white space if (!strncmp(control,(char*)"queue",5)) control = SkipWhitespace(control+5); // just a label defining the field if (trace & TRACE_QUERY && CheckTopicTrace()) { char* colon = strchr(control+1,':'); if (colon) *colon = 0; if (control[1]) { Log(STDTRACELOG,(char*)"@@@ Control2 queue use: %s\r\n",control+1); Log(STDTRACETABLOG,(char*)""); } if (colon) *colon = ':'; } if (*control && --control) while (*++control && *control != ':' ) { switch (*control) { case '_': case '.': case ' ': // does nothing per se continue; case 's': baseOffset = 0; break; case 'v': baseOffset = 1; break; case 'o': baseOffset = 2; break; case 'f': baseFlags |= FACTTYPE; break; // queued items are facts instead of meaning case 'e': baseOffset = 3; break; default: ReportBug((char*)"Bad control code for #2 (queue test) %s(%s) %s",C->word,C->w.userValue,control) return 0; } } whichset = store; // ZONE 3 - how to detect facts we can return as answers and where they go // set marks to compare on (test criteria for saving an answer) bool sentences = false; bool sentencev = false; bool sentenceo = false; unsigned int marks = 0, markv = 0, marko = 0; unsigned int markns = 0, marknv = 0, markno = 0; unsigned int rmarks = 0, rmarkv = 0, rmarko = 0; unsigned int intersectMark = 0, propogateVerb = 0; unsigned int systemFlags = 0; unsigned int ultimateSubjectMember = 0; unsigned int ultimateVerbMember = 0; unsigned int ultimateObjectMember = 0; unsigned int factflags = 0; saveMark = qMark; // default q value is what we used before if (*control) control = SkipWhitespace(control+1); // skip over the : and past any white space if (!strncmp(control,(char*)"match",5)) control = SkipWhitespace(control + 5); // just a comment label defining what the field does if (trace & TRACE_QUERY && *control && CheckTopicTrace()) { char* colon = strchr(control+1,':'); if (colon) *colon = 0; if (control[1]) { Log(STDTRACELOG,(char*)"@@@ Control3 match requirements: %s\r\n",control+1); // if there is data Log(STDTRACETABLOG,(char*)""); } if (colon) *colon = ':'; } bool noSystemFlag = false; if (*control && --control) while (*++control && *control != ':' ) { switch (*control) { case '_': case '.': case ' ': // does nothing per se continue; case '!': // do NOT match this ++control; if (*control == 's') { if (trace & TRACE_QUERY && CheckTopicTrace()) Log(STDTRACELOG,(char*)" don't match subjects #%c ",*control); markns = baseMark + (*++control - '0'); } if (*control == 'v') { if (trace & TRACE_QUERY && CheckTopicTrace()) Log(STDTRACELOG,(char*)" don't match verbs #%c ",*control); marknv = baseMark + (*++control - '0'); } if (*control == 'o') { if (trace & TRACE_QUERY && CheckTopicTrace()) Log(STDTRACELOG,(char*)" don't match objects #%c ",*control); markno = baseMark + (*++control - '0'); } if (*control == 'n') { if (trace & TRACE_QUERY && CheckTopicTrace()) Log(STDTRACELOG,(char*)" don't match concepts with noconceptlist marking "); noSystemFlag = true; systemFlags = NOCONCEPTLIST; } break; case 'x': // field after has sentence mark ++control; if (*control == 's') sentences = true; else if (*control == 'v') sentencev = true; else if (*control == 'o') sentenceo = true; break; // normal tests of fact fields case 's': marks = baseMark + (*++control - '0'); if (trace & TRACE_QUERY && CheckTopicTrace()) Log(STDTRACELOG,(char*)" subject must be #%c ",*control); break; case 'v': markv = baseMark + (*++control - '0'); if (trace & TRACE_QUERY && CheckTopicTrace()) Log(STDTRACELOG,(char*)" verb must be #%c ",*control); break; case 'o': marko = baseMark + (*++control - '0'); if (trace & TRACE_QUERY && CheckTopicTrace()) Log(STDTRACELOG,(char*)" object must be #%c ",*control); break; // dont pay attention to this value during search (opposite the baseOffset) case 'i': ++control; if (trace & TRACE_QUERY && CheckTopicTrace()) Log(STDTRACELOG,(char*)" ignore results with #%c ",*control); ignoremark = (*control == '0') ? 0 : (baseMark + (*control - '0')); break; // future queuing uses this mark (hopefully same as original queued) case 'q': saveMark = baseMark + (*++control - '0'); break; case '~': intersectMark = baseMark + (*++control - '0'); // label to intersect to in propogation break; case 'n': systemFlags |= NOCONCEPTLIST; break; case 't': baseFlags |= FINDTOPIC; break; case 'c': baseFlags |= FINDCONCEPT; break; case '<': case '>': if (trace & TRACE_QUERY && CheckTopicTrace()) Log(STDTRACELOG,(char*)" propogate on verb #%c ",*control); propogateVerb = baseMark + (*++control - '0'); // label of verbs to propogate on break; case '@': // where to put answers (default is store) if (trace & TRACE_QUERY && CheckTopicTrace()) Log(STDTRACELOG,(char*)" store facts in @%c",*control); whichset = *++control - '0'; break; case '^': baseFlags |= UPDICTIONARY; break; // rise up dominant dictionary meaning case 'f': // has this flag from match factflags = atoi(match); break; case 'm': ++control; if (*control == 'o') ultimateObjectMember = baseMark + (*++control - '0'); else if (*control == 'v') ultimateVerbMember = baseMark + (*++control - '0'); else if (*control == 's') ultimateSubjectMember = baseMark + (*++control - '0'); if (trace & TRACE_QUERY && CheckTopicTrace()) Log(STDTRACELOG,(char*)" object must ultimately be member of set marked #%c ",*control); break; default: ReportBug((char*)"Bad control code for Zone 3 test %s(%s) %s",C->word,C->w.userValue,control) return 0; } } // ZONE 4- how to migrate around the graph and save new queue entries // now examine riccochet OR other propogation controls (if any) // May say to match another field, and when it matches store X on queue if (*control) control = SkipWhitespace(control+1); // skip over the : and past any white space if (!strncmp(control,(char*)"walk",4)) control = SkipWhitespace(control +4); if (trace & TRACE_QUERY && *control && CheckTopicTrace()) { char* colon = strchr(control+1,':'); if (colon) *colon = 0; if (control[1]) { Log(STDTRACELOG,(char*)"@@@ Control4 riccochet: %s\r\n",control+1); Log(STDTRACETABLOG,(char*)""); } if (colon) *colon = ':'; } if (*control && --control) while (*++control && *control != '|') { switch (*control) { case '_': case '.': case ' ': // does nothing per se continue; // tests on riccochet fields case 'S': if (trace & TRACE_QUERY && CheckTopicTrace()) Log(STDTRACELOG,(char*)"Riccochet on Subject #%c ",*control); rmarks = baseMark + (*++control - '0'); break; case 'V': if (trace & TRACE_QUERY && CheckTopicTrace()) Log(STDTRACELOG,(char*)"Riccochet on Verb #%c ",*control); rmarkv = baseMark + (*++control - '0'); break; case 'O': if (trace & TRACE_QUERY && CheckTopicTrace()) Log(STDTRACELOG,(char*)"Riccochet on Object #%c ",*control); rmarko = baseMark + (*++control - '0'); break; // fields to access as next element from a NORMAL fact - 1st reference is base fact, second is riccochet fact case 's': // MEANING offsets into a fact to get to subject,verb,object baseFlags |= (baseFlags & (USE_ORIGINAL_SUBJECT|USE_ORIGINAL_OBJECT)) ? RICCOCHET_USING_SUBJECT : USE_ORIGINAL_SUBJECT; break; case 'v': ReportBug((char*)"bad riccochet field") return 0; case 'o': baseFlags |= (baseFlags & (USE_ORIGINAL_SUBJECT|USE_ORIGINAL_OBJECT)) ? RICCOCHET_USING_OBJECT : USE_ORIGINAL_OBJECT; break; default: ReportBug((char*)"Bad control code for Zone 4 test %s(%s) %s",C->word,C->w.userValue,control) return 0; } } if (trace & TRACE_QUERY && CheckTopicTrace()) { Log(STDTRACELOG,(char*)"Start processing loop\r\n"); Log(STDTRACETABLOG,(char*)""); } // now perform the query FACT* F; unsigned int scanIndex = 0; int pStart,pEnd; while (scanIndex < queueIndex) { MEANING next = queue[scanIndex++]; next &= SIMPLEMEANING; // no type bits, just word ref unsigned int index; // get node which has fact list on it if (baseFlags & FACTTYPE) // q data is facts { F = Index2Fact(next); if (baseOffset == 0) F = GetSubjectNondeadHead(F); else if (baseOffset == 1) F = GetVerbNondeadHead(F); else if (baseOffset == 2) F = GetObjectNondeadHead(F); index = 0; } else // q data is meanings { WORDP D = Meaning2Word((ulong_t)next); if (baseOffset == 0) F = GetSubjectNondeadHead(D); else if (baseOffset == 1) F = GetVerbNondeadHead(D); else F = GetObjectNondeadHead(D); index = Meaning2Index(next); } bool once = false; while (F) { if (trace & TRACE_QUERY && CheckTopicTrace()) TraceFact(F,true); // prepare for next fact to walk FACT* G = F; MEANING INCOMING; MEANING OUTGOING; // what fields do we process by default if (baseOffset == 0) { F = GetSubjectNondeadNext(F); INCOMING = G->subject; OUTGOING = G->object; } else if (baseOffset == 1) { F = GetVerbNondeadNext(F); INCOMING = G->verb; OUTGOING = G->object; } else if (baseOffset == 2) { F = GetObjectNondeadNext(F); INCOMING = G->object; OUTGOING = G->subject; } else // baseOffset == 3 when using user facts as the initial base { INCOMING = G->subject; OUTGOING = G->object; } if (G->flags & FACTDEAD) continue; // cannot use this if (baseFlags & USERFACTS && G <= factLocked) continue; // restricted by kind of fact if (baseFlags & SYSTEMFACTS && G > factLocked) continue; INCOMING &= SIMPLEMEANING; OUTGOING &= SIMPLEMEANING; // is this fact based on what we were checking for? (we store all specific instances on the general dictionary) if (index && INCOMING != next) continue; WORDP OTHER = Meaning2Word(OUTGOING); WORDP S = (G->flags & FACTSUBJECT) ? fact : Meaning2Word(G->subject); WORDP V = (G->flags & FACTVERB) ? fact : Meaning2Word(G->verb); WORDP O = (G->flags & FACTOBJECT) ? fact : Meaning2Word(G->object); // if this is part of ignore set, ignore it (not good if came via verb BUG) if (ignoremark && OTHER->inferMark == ignoremark ) { if (trace & TRACE_QUERY && CheckTopicTrace()) Log(STDTRACELOG,(char*)"ignore "); continue; } // pay no attention to topic facts if (baseFlags & NOTOPIC && O->internalBits & TOPIC) { if (trace & TRACE_QUERY && CheckTopicTrace()) Log(STDTRACELOG,(char*)"notopic "); continue; } bool match = true; // follow dictionary path? if (baseFlags & UPDICTIONARY && G->verb == Mis && !once) { once = true; if (AddWord2Scan(QUEUE,OUTGOING,INCOMING,0,0)){;} // add object onto queue continue; } // field validation fails on some field? if (marks && S->inferMark != marks) match = false; else if (markns && S->inferMark == markns) match = false; if (markv && V->inferMark != markv) match = false; else if (marknv && V->inferMark == marknv) match = false; if (marko && O->inferMark != marko) match = false; else if (markno && O->inferMark == markno) match = false; if (sentences && !GetNextSpot(S,0,pStart,pEnd)) match = false; if (sentencev && !GetNextSpot(V,0,pStart,pEnd)) match = false; if (sentenceo && !GetNextSpot(O,0,pStart,pEnd)) match = false; if (factflags && !(G->flags & factflags)) match = false; // lacks appropriate fact flags if (intersectMark && OTHER->inferMark != intersectMark) match = false;// we have not reached requested intersection if (ultimateSubjectMember && !(ConceptPropogateTest(G->object,ultimateSubjectMember,0))) match = false; // object is not a member of designated set if (ultimateVerbMember && !(ConceptPropogateTest(G->object,ultimateVerbMember,0))) match = false; // object is not a member of designated set if (ultimateObjectMember && !(ConceptPropogateTest(G->object,ultimateObjectMember,0))) match = false; // object is not a member of designated set if (systemFlags && match && !noSystemFlag) { if (!(OTHER->systemFlags & systemFlags)) match = false; // dont go here } else if (systemFlags && match && noSystemFlag) { if (OTHER->systemFlags & systemFlags) match = false; // dont go here } // if search is riccochet, we now walk facts of riccochet target if (match && baseFlags & RICCOCHET_BITS ) { if (!Riccochet(baseFlags,G,whichset,count,rmarks,rmarkv,rmarko)) { scanIndex = queueIndex; // end outer loop F = NULL; } } // end riccochet else if (match && !(G->flags & MARKED_FACT) && !(baseFlags & (FINDTOPIC | FINDCONCEPT))) // find unique fact -- it was not rejected by anything { G->flags |= MARKED_FACT; AddFact(whichset,G); if (trace & TRACE_QUERY && CheckTopicTrace() ) { Log(STDTRACELOG,(char*)" Found:"); TraceFact(G); } if (FACTSET_COUNT(whichset) >= count) { scanIndex = queueIndex; // end outer loop F = NULL; break; } if (count == 1 && intersectMark) // create backtract in next set { int set1 = whichset + 1; if (set1 > MAX_FIND_SETS) set1 = 0; // wrap around end WORDP D = Meaning2Word(INCOMING); unsigned int count = 0; while (D) { factSet[set1][++count] = CreateFact(INCOMING,MakeMeaning(D),OUTGOING,FACTTRANSIENT); D = Meaning2Word(GetFactBack(D)); OUTGOING = INCOMING; INCOMING = MakeMeaning(D); } SET_FACTSET_COUNT(set1,count); } } // if propogation is enabled, queue appropriate choices if (match && baseFlags & FINDTOPIC && OTHER->internalBits & TOPIC) // supposed to find a topic { if (trace & TRACE_QUERY && CheckTopicTrace()) { Log(STDTRACELOG,(char*)"\r\n propogate "); Log(STDTRACETABLOG,(char*)""); } AddFact(whichset,G); if (trace & TRACE_QUERY && CheckTopicTrace()) { Log(STDTRACELOG,(char*)" Found:"); TraceFact(G); } if (FACTSET_COUNT(whichset) >= count) { scanIndex = queueIndex; // end outer loop F = NULL; break; } if (G->flags & MARKED_FACT) {;} // stored this fact, stop propogation else if (AddWord2Scan(QUEUE,OUTGOING,INCOMING,0,0)) SetFactBack(OTHER,INCOMING); // add object onto queue and provide traceback G->flags |= MARKED_FACT; } else if (match && baseFlags & FINDCONCEPT && OTHER->internalBits & CONCEPT && !(OTHER->internalBits & TOPIC)) // supposed to find a concept { if (trace & TRACE_QUERY && CheckTopicTrace()) { Log(STDTRACELOG,(char*)"\r\n propogate "); Log(STDTRACETABLOG,(char*)""); } AddFact(whichset,G); if (trace & TRACE_QUERY && CheckTopicTrace()) { Log(STDTRACELOG,(char*)" Found:"); TraceFact(G); } if (FACTSET_COUNT(whichset) >= count) { scanIndex = queueIndex; // end outer loop F = NULL; break; } if (G->flags & MARKED_FACT) {;} // stored this fact, stop propogation else if (AddWord2Scan(QUEUE,OUTGOING,INCOMING,0,0)) SetFactBack(OTHER,INCOMING); // add object onto queue and provide traceback G->flags |= MARKED_FACT; } else if (!match && propogateVerb && V->inferMark == propogateVerb) // this is not a fact to check, this is a fact to propogate on { if (trace & TRACE_QUERY && CheckTopicTrace()) { Log(STDTRACELOG,(char*)"\r\n propogate "); Log(STDTRACETABLOG,(char*)""); } if (G->flags & MARKED_FACT) {;} // stored this fact, stop propogation else if (AddWord2Scan(QUEUE,OUTGOING,INCOMING,0,0)) SetFactBack(OTHER,INCOMING); // add object onto queue and provide traceback if (trace & TRACE_QUERY && CheckTopicTrace()) { Log(STDTRACELOG,(char*)"\r\n"); Log(STDTRACETABLOG,(char*)""); } } if (baseOffset == 3) break; // resume with next fact in q rather than any chaining } // end loop on facts } // end loop on scan queue // clear marks for duplicates unsigned int counter = FACTSET_COUNT(whichset); for (unsigned int i = 1; i <= counter; ++i) factSet[whichset][i]->flags &= -1 ^ MARKED_FACT; factSetNext[store] = 0; if (trace & TRACE_QUERY && CheckTopicTrace()) { char word[MAX_WORD_SIZE]; if (counter) Log(STDTRACETABLOG,(char*)" result: @%d[%d] e.g. %s\r\n",whichset,counter,WriteFact(factSet[whichset][1],false,word)); else Log(STDTRACETABLOG,(char*)" result: @%d none found \r\n",whichset); Log(STDTRACETABLOG,(char*)""); } ClearBacktracks(); if (*control++ == '|') goto nextsearch; // chained search, do the next return counter; }
{ "content_hash": "a990c136c6b79e21d75d77267ad0118b", "timestamp": "", "source": "github", "line_count": 1388, "max_line_length": 197, "avg_line_length": 35.69308357348703, "alnum_prop": 0.6328771547373946, "repo_name": "jazzyjackson/ChatScript", "id": "27fcaba114ba0217091580eddae9725b224d4271", "size": "49684", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "SRC/infer.cpp", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "9093" }, { "name": "C", "bytes": "8226558" }, { "name": "C++", "bytes": "3431435" }, { "name": "HTML", "bytes": "962541" }, { "name": "M4", "bytes": "3958" }, { "name": "Makefile", "bytes": "77059" }, { "name": "Objective-C", "bytes": "78885" }, { "name": "PHP", "bytes": "32765" }, { "name": "Pascal", "bytes": "52114" }, { "name": "Perl", "bytes": "27708" }, { "name": "Roff", "bytes": "518664" }, { "name": "Shell", "bytes": "569617" }, { "name": "Visual Basic", "bytes": "225" } ], "symlink_target": "" }
using System; using System.Diagnostics.CodeAnalysis; using System.Threading; using ViewSwitchingNavigation.Infrastructure.Properties; namespace ViewSwitchingNavigation.Infrastructure { [SuppressMessage("Microsoft.Design", "CA1001", Justification = "Calling the End method, which is part of the contract of using an IAsyncResult, releases the IDisposable.")] public class AsyncResult<T> : IAsyncResult { private readonly object lockObject; private readonly AsyncCallback asyncCallback; private readonly object asyncState; private ManualResetEvent waitHandle; private T result; private Exception exception; private bool isCompleted; private bool completedSynchronously; private bool endCalled; public AsyncResult(AsyncCallback asyncCallback, object asyncState) { this.lockObject = new object(); this.asyncCallback = asyncCallback; this.asyncState = asyncState; } public object AsyncState { get { return this.asyncState; } } public WaitHandle AsyncWaitHandle { get { lock (this.lockObject) { if (this.waitHandle == null) { this.waitHandle = new ManualResetEvent(this.IsCompleted); } } return this.waitHandle; } } public bool CompletedSynchronously { get { return this.completedSynchronously; } } public bool IsCompleted { get { return this.isCompleted; } } public T Result { get { return this.result; } } [SuppressMessage("Microsoft.Design", "CA1000:DoNotDeclareStaticMembersOnGenericTypes", Justification = "Entry point to be used to implement End* methods.")] public static AsyncResult<T> End(IAsyncResult asyncResult) { var localResult = asyncResult as AsyncResult<T>; if (localResult == null) { throw new ArgumentNullException("asyncResult"); } lock (localResult.lockObject) { if (localResult.endCalled) { throw new InvalidOperationException(Resources.EndMethodAlreadyCalled); } localResult.endCalled = true; } if (!localResult.IsCompleted) { localResult.AsyncWaitHandle.WaitOne(); } if (localResult.waitHandle != null) { localResult.waitHandle.Close(); } if (localResult.exception != null) { throw localResult.exception; } return localResult; } public void SetComplete(T result, bool completedSynchronously) { this.result = result; this.DoSetComplete(completedSynchronously); } public void SetComplete(Exception e, bool completedSynchronously) { this.exception = e; this.DoSetComplete(completedSynchronously); } private void DoSetComplete(bool completedSynchronously) { if (completedSynchronously) { this.completedSynchronously = true; this.isCompleted = true; } else { lock (this.lockObject) { this.isCompleted = true; if (this.waitHandle != null) { this.waitHandle.Set(); } } } if (this.asyncCallback != null) { this.asyncCallback(this); } } } }
{ "content_hash": "a493d24bfe29bda74cd9cfb6fa25a659", "timestamp": "", "source": "github", "line_count": 142, "max_line_length": 133, "avg_line_length": 28.190140845070424, "alnum_prop": 0.5241069198101423, "repo_name": "grandtiger/Prism", "id": "ce0e876720a3c334b6c6d7a7af85b710833b94a3", "size": "4126", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "Samples/Quickstarts/View-Switching Navigation_Desktop/ViewSwitchingNavigation.Infrastructure/AsyncResult.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C#", "bytes": "1561453" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <resources> <style name="AppBaseTheme" parent="android:Theme.Holo"> </style> </resources>
{ "content_hash": "7596fc9ab224efc97518d97fce813b96", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 59, "avg_line_length": 22.833333333333332, "alnum_prop": 0.656934306569343, "repo_name": "omar0z/android-hello-world", "id": "4b77d85f7c38267b1a7ee5e13e6a396532016c75", "size": "137", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/main/res/values-v14/styles.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "2257" } ], "symlink_target": "" }
<!doctype html> <html class="no-js" lang="de"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Dijkstra vs. Kay</title> <link rel="stylesheet" type="text/css" href="http://sysop.matthias-werner.net/assets/css/styles_feeling_responsive.css" /> <script src="http://sysop.matthias-werner.net/assets/js/modernizr.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/webfont/1.5.18/webfont.js"></script> <script> WebFont.load({ google: { families: [ 'Lato:400,700,400italic:latin', 'Volkhov::latin' ] } }); </script> <noscript> <link href='http://fonts.googleapis.com/css?family=Lato:400,700,400italic|Volkhov' rel='stylesheet' type='text/css' /> </noscript> <meta name="description" content="Matthias Werners Blog. " /> <link rel="icon" sizes="32x32" href="http://sysop.matthias-werner.net/assets/img/favicon-32x32.png" /> <link rel="icon" sizes="192x192" href="http://sysop.matthias-werner.net/assets/img/touch-icon-192x192.png" /> <link rel="apple-touch-icon-precomposed" sizes="180x180" href="http://sysop.matthias-werner.net/assets/img/apple-touch-icon-180x180-precomposed.png" /> <link rel="apple-touch-icon-precomposed" sizes="152x152" href="http://sysop.matthias-werner.net/assets/img/apple-touch-icon-152x152-precomposed.png" /> <link rel="apple-touch-icon-precomposed" sizes="144x144" href="http://sysop.matthias-werner.net/assets/img/apple-touch-icon-144x144-precomposed.png" /> <link rel="apple-touch-icon-precomposed" sizes="120x120" href="http://sysop.matthias-werner.net/assets/img/apple-touch-icon-120x120-precomposed.png" /> <link rel="apple-touch-icon-precomposed" sizes="114x114" href="http://sysop.matthias-werner.net/assets/img/apple-touch-icon-114x114-precomposed.png" /> <link rel="apple-touch-icon-precomposed" sizes="76x76" href="http://sysop.matthias-werner.net/assets/img/apple-touch-icon-76x76-precomposed.png" /> <link rel="apple-touch-icon-precomposed" sizes="72x72" href="http://sysop.matthias-werner.net/assets/img/apple-touch-icon-72x72-precomposed.png" /> <link rel="apple-touch-icon-precomposed" href="http://sysop.matthias-werner.net/assets/img/apple-touch-icon-precomposed.png" /> <meta name="msapplication-TileImage" content="http://sysop.matthias-werner.net/assets/img/msapplication_tileimage.png" /> <meta name="msapplication-TileColor" content="#fabb00" /> <!-- Facebook Optimization --> <meta property="og:locale" content="en_EN" /> <meta property="og:title" content="Dijkstra vs. Kay" /> <meta property="og:description" content="Matthias Werners Blog. " /> <meta property="og:url" content="http://sysop.matthias-werner.net//quotes/2016/02/02/arroganz/" /> <meta property="og:site_name" content="Systems Operational" /> <!-- Search Engine Optimization --> <link type="text/plain" rel="author" href="http://sysop.matthias-werner.net/humans.txt" /> </head> <script type="text/javascript" src="https://cdn.rawgit.com/mathjax/MathJax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"> </script> </head> <body id="top-of-page" class="page-fullwidth"> <div id="navigation" class="sticky"> <nav class="top-bar" role="navigation" data-topbar> <ul class="title-area"> <li class="name"> <h1 class="show-for-small-only"><a href="http://sysop.matthias-werner.net" class="icon-tree"> Systems Operational</a></h1> </li> <!-- Remove the class "menu-icon" to get rid of menu icon. Take out "Menu" to just have icon alone --> <li class="toggle-topbar menu-icon"><a href="#"><span>Navigation</span></a></li> </ul> <section class="top-bar-section"> <ul class="right"> <li class="divider"></li> <li><a href="http://sysop.matthias-werner.net/about/">Über mich</a></li> </ul> <ul class="left"> <li><a href="http://sysop.matthias-werner.net/">Start</a></li> <li class="divider"></li> <li class="has-dropdown"> <a href="http://sysop.matthias-werner.net/blog/">Blog</a> <ul class="dropdown"> <li><a href="http://sysop.matthias-werner.net/blog/archive/">Archive</a></li> </ul> </li> <li class="divider"></li> <li><a href="http://sysop.matthias-werner.net/blog/aihpos/">aihPos</a></li> <li class="divider"></li> </ul> </section> </nav> </div><!-- /#navigation --> <div id="masthead-no-image-header"> <div class="row"> <div class="small-12 columns"> <a id="logo" href="http://sysop.matthias-werner.net" title="Systems Operational – Matthias Werners selten gepflegtes Blog über Computer und Menschen"> <img src="http://sysop.matthias-werner.net/assets/img/logo.png" alt="Systems Operational – Matthias Werners selten gepflegtes Blog über Computer und Menschen"> </a> </div><!-- /.small-12.columns --> </div><!-- /.row --> </div><!-- /#masthead --> <div class="row t30"> <div class="medium-12 columns"> <article> <header> <p class="subheadline">Zitate des Tages</p> <h1>Dijkstra vs. Kay</h1> </header> <span itemprop="articleSection"> <blockquote> <p>Don’t blame me for the fact that competent programming, as I view it as an intellectual possibility, will be too difficult for ‘the average programmer’ — you must not fall into the trap of rejecting a surgical technique because it is beyond the capabilities of the barber in his shop around the corner. <cite>Edsger W. Dijkstra</cite></p> </blockquote> <blockquote> <p>I don’t know how many of you have ever met Dijkstra, but you probably know that arrogance in computer science is measured in nano-Dijkstras. <cite>Alan C. Kay</cite></p> </blockquote> </span> <div id="page-meta" class="t30"> <p> <!-- Look the author details up from the site config. --> <!-- Output author details if some exist. --> <span itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name" class="pr20 icon-edit"><a href="http://osg.informatik.tu-chemnitz.de/Staff/M_Werner/index.php?lang=en" target="_blank"> Matthias Werner</a></span> </span> <time class="icon-calendar pr20" datetime="2016-02-02" itemprop="datePublished"> 2016-02-02</time> <span class="icon-archive pr20"> QUOTES</span> <br /> <span class="pr20"></span> </p> <div id="post-nav" class="row"> <div class="small-5 columns"><a class="button small radius prev" href="http://sysop.matthias-werner.net/small%20hacks/2015/10/27/os-x-und-nfs/">&laquo; OS X und NFS</a></div><!-- /.small-4.columns --> <div class="small-2 columns text-center"><a class="radius button small" href="http://sysop.matthias-werner.net/blog/archive/" title="Blog Archiv">Archiv</a></div><!-- /.small-4.columns --> <div class="small-5 columns text-right"><a class="button small radius next" href="http://sysop.matthias-werner.net/small%20hacks/2016/05/29/schluesselwortsuche-fuer-safari/">Schlüsselwortsuche für Safari &raquo;</a></div><!-- /.small-4.columns --> </div> </div><!-- /.page-meta --> </article> </div><!-- /.medium-12.columns --> </div><!-- /.row --> <div id="up-to-top" class="row"> <div class="small-12 columns" style="text-align: right;"> <a class="iconfont" href="#top-of-page">&#xf108;</a> </div><!-- /.small-12.columns --> </div><!-- /.row --> <footer id="footer-content" class="bg-grau"> <div id="footer"> <div class="row"> <div class="medium-6 large-5 columns"> <h5 class="shadow-black">Über diese Website</h5> <p class="shadow-black"> Matthias Werners Blog. <a href="http://sysop.matthias-werner.net/info/">Mehr ›</a> </p> </div><!-- /.large-6.columns --> <div class="small-6 medium-3 large-3 large-offset-1 columns"> <ul class="no-bullet shadow-black"> </ul> </div><!-- /.large-4.columns --> <div class="small-6 medium-3 large-3 columns"> <ul class="no-bullet shadow-black"> </ul> </div><!-- /.large-3.columns --> </div><!-- /.row --> </div><!-- /#footer --> </footer> <script src="http://sysop.matthias-werner.net/assets/js/javascript.min.js"></script> </body> </html>
{ "content_hash": "fde942f953dcd27b7773dcc046c940d8", "timestamp": "", "source": "github", "line_count": 401, "max_line_length": 307, "avg_line_length": 23.698254364089774, "alnum_prop": 0.5696095969693781, "repo_name": "werner-matthias/SysOp", "id": "ed3045a1bec1279ac0d423dc19cd8d17d518646a", "size": "9525", "binary": false, "copies": "1", "ref": "refs/heads/source", "path": "_site/quotes/2016/02/02/arroganz/index.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "433469" }, { "name": "HTML", "bytes": "1137099" }, { "name": "JavaScript", "bytes": "1153498" }, { "name": "Ruby", "bytes": "2958" }, { "name": "XSLT", "bytes": "24636" } ], "symlink_target": "" }
package main const ( envGopath = "GOPATH" envGoroot = "GOROOT" liveReloadProtocol = "livedev" liveReloadHTML = ` <script type="text/javascript"> !function (w, c) { try{ (new WebSocket('ws://' + w.location.hostname + ':%d/', 'livedev')).onclose=function(){w.location.reload()} }catch(ex){c.log('Livedev: ', ex)} }(window, window.console||{log:function(){}}) </script> ` )
{ "content_hash": "e9424a51e2907ccdb60acefac798aa3e", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 109, "avg_line_length": 23.294117647058822, "alnum_prop": 0.6237373737373737, "repo_name": "qrtz/livedev", "id": "bf69d06c593410d6fb57fc99dc6790422906b7e1", "size": "396", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "const.go", "mode": "33188", "license": "mit", "language": [ { "name": "Go", "bytes": "50341" } ], "symlink_target": "" }
package com.facebook.buck.android; import com.android.sdklib.build.ApkBuilder; import com.android.sdklib.build.ApkCreationException; import com.android.sdklib.build.DuplicateFileException; import com.android.sdklib.build.SealedApkException; import com.facebook.buck.io.ProjectFilesystem; import com.facebook.buck.step.ExecutionContext; import com.facebook.buck.step.Step; import com.facebook.buck.util.HumanReadableException; import com.facebook.buck.util.KeystoreProperties; import com.google.common.base.Joiner; import com.google.common.base.Throwables; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMultimap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Multimap; import java.io.IOException; import java.io.InputStream; import java.io.PrintStream; import java.nio.file.Path; import java.security.Key; import java.security.KeyStore; import java.security.KeyStoreException; import java.security.NoSuchAlgorithmException; import java.security.PrivateKey; import java.security.UnrecoverableKeyException; import java.security.cert.Certificate; import java.security.cert.CertificateException; import java.security.cert.X509Certificate; import java.util.Collection; import java.util.Map; /** * Merges resources into a final APK. This code is based off of the now deprecated apkbuilder tool: * https://android.googlesource.com/platform/sdk/+/fd30096196e3747986bdf8a95cc7713dd6e0b239%5E/sdkmanager/libs/sdklib/src/main/java/com/android/sdklib/build/ApkBuilderMain.java */ public class ApkBuilderStep implements Step { /** * The type of a keystore created via the {@code jarsigner} command in Sun/Oracle Java. * See http://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#KeyStore. */ private static final String JARSIGNER_KEY_STORE_TYPE = "jks"; private final ProjectFilesystem filesystem; private final Path resourceApk; private final Path dexFile; private final Path pathToOutputApkFile; private final ImmutableSet<Path> assetDirectories; private final ImmutableSet<Path> nativeLibraryDirectories; private final ImmutableSet<Path> zipFiles; private final ImmutableSet<Path> jarFilesThatMayContainResources; private final Path pathToKeystore; private final Path pathToKeystorePropertiesFile; private final boolean debugMode; /** * * @param resourceApk Path to the Apk which only contains resources, no dex files. * @param pathToOutputApkFile Path to output our APK to. * @param dexFile Path to the classes.dex file. * @param assetDirectories List of paths to assets to be included in the apk. * @param nativeLibraryDirectories List of paths to native directories. * @param zipFiles List of paths to zipfiles to be included into the apk. * @param debugMode Whether or not to run ApkBuilder with debug mode turned on. * @param pathToKeystore Path to the keystore used to sign the APK. * @param pathToKeystorePropertiesFile Path to a {@code .properties} file that contains * information about the keystore used to sign the APK. */ public ApkBuilderStep( ProjectFilesystem filesystem, Path resourceApk, Path pathToOutputApkFile, Path dexFile, ImmutableSet<Path> assetDirectories, ImmutableSet<Path> nativeLibraryDirectories, ImmutableSet<Path> zipFiles, ImmutableSet<Path> jarFilesThatMayContainResources, Path pathToKeystore, Path pathToKeystorePropertiesFile, boolean debugMode) { this.filesystem = filesystem; this.resourceApk = resourceApk; this.pathToOutputApkFile = pathToOutputApkFile; this.dexFile = dexFile; this.assetDirectories = assetDirectories; this.nativeLibraryDirectories = nativeLibraryDirectories; this.jarFilesThatMayContainResources = jarFilesThatMayContainResources; this.zipFiles = zipFiles; this.pathToKeystore = pathToKeystore; this.pathToKeystorePropertiesFile = pathToKeystorePropertiesFile; this.debugMode = debugMode; } @Override public int execute(ExecutionContext context) throws IOException { PrintStream output = null; if (context.getVerbosity().shouldUseVerbosityFlagIfAvailable()) { output = context.getStdOut(); } try { PrivateKeyAndCertificate privateKeyAndCertificate = createKeystoreProperties(); ApkBuilder builder = new ApkBuilder( filesystem.getPathForRelativePath(pathToOutputApkFile).toFile(), filesystem.getPathForRelativePath(resourceApk).toFile(), filesystem.getPathForRelativePath(dexFile).toFile(), privateKeyAndCertificate.privateKey, privateKeyAndCertificate.certificate, output); builder.setDebugMode(debugMode); for (Path nativeLibraryDirectory : nativeLibraryDirectories) { builder.addNativeLibraries( filesystem.getPathForRelativePath(nativeLibraryDirectory).toFile()); } for (Path assetDirectory : assetDirectories) { builder.addSourceFolder(filesystem.getPathForRelativePath(assetDirectory).toFile()); } for (Path zipFile : zipFiles) { // TODO(natthu): Skipping silently is bad. These should really be assertions. if (filesystem.exists(zipFile) && filesystem.isFile(zipFile)) { builder.addZipFile(filesystem.getPathForRelativePath(zipFile).toFile()); } } for (Path jarFileThatMayContainResources : jarFilesThatMayContainResources) { Path jarFile = filesystem.getPathForRelativePath(jarFileThatMayContainResources); builder.addResourcesFromJar(jarFile.toFile()); } // Build the APK builder.sealApk(); } catch (ApkCreationException | CertificateException | IOException | KeyStoreException | NoSuchAlgorithmException | SealedApkException | UnrecoverableKeyException e) { context.logError(e, "Error when creating APK at: %s.", pathToOutputApkFile); Throwables.propagateIfInstanceOf(e, IOException.class); return 1; } catch (DuplicateFileException e) { throw new HumanReadableException( String.format("Found duplicate file for APK: %1$s\nOrigin 1: %2$s\nOrigin 2: %3$s", e.getArchivePath(), e.getFile1(), e.getFile2())); } return 0; } private PrivateKeyAndCertificate createKeystoreProperties() throws CertificateException, IOException, KeyStoreException, NoSuchAlgorithmException, UnrecoverableKeyException { KeystoreProperties keystoreProperties = KeystoreProperties.createFromPropertiesFile( pathToKeystore, pathToKeystorePropertiesFile, filesystem); KeyStore keystore = KeyStore.getInstance(JARSIGNER_KEY_STORE_TYPE); InputStream inputStream = filesystem.getInputStreamForRelativePath(pathToKeystore); char[] keystorePassword = keystoreProperties.getStorepass().toCharArray(); try { keystore.load(inputStream, keystorePassword); } catch (IOException | NoSuchAlgorithmException | CertificateException e) { throw new HumanReadableException(e, "%s is an invalid keystore.", pathToKeystore); } String alias = keystoreProperties.getAlias(); char[] keyPassword = keystoreProperties.getKeypass().toCharArray(); Key key = keystore.getKey(alias, keyPassword); Certificate certificate = keystore.getCertificate(alias); return new PrivateKeyAndCertificate((PrivateKey) key, (X509Certificate) certificate); } @Override public String getShortName() { return "apk_builder"; } @Override public String getDescription(ExecutionContext context) { ImmutableList.Builder<String> args = ImmutableList.builder(); args.add( "java", "-classpath", // TODO(bolinfest): Make the directory that corresponds to $ANDROID_HOME a field that is // accessible via an AndroidPlatformTarget and insert that here in place of "$ANDROID_HOME". "$ANDROID_HOME/tools/lib/sdklib.jar", "com.android.sdklib.build.ApkBuilderMain"); args.add(String.valueOf(pathToOutputApkFile)); args.add("-v" /* verbose */); if (debugMode) { args.add("-d"); } // Unfortunately, ApkBuilderMain does not have CLI args to set the keystore, // so these member variables are left out of the command: // pathToKeystore, pathToKeystorePropertiesFile Multimap<String, Collection<Path>> groups = ImmutableMultimap.<String, Collection<Path>>builder() .put("-z", ImmutableList.of(resourceApk)) .put("-f", ImmutableList.of(dexFile)) .put("-rf", assetDirectories) .put("-nf", nativeLibraryDirectories) .put("-z", zipFiles) .put("-rj", jarFilesThatMayContainResources) .build(); for (Map.Entry<String, Collection<Path>> group : groups.entries()) { String prefix = group.getKey(); for (Path path : group.getValue()) { args.add(prefix, String.valueOf(path)); } } return Joiner.on(' ').join(args.build()); } private static class PrivateKeyAndCertificate { private final PrivateKey privateKey; private final X509Certificate certificate; PrivateKeyAndCertificate(PrivateKey privateKey, X509Certificate certificate) { this.privateKey = privateKey; this.certificate = certificate; } } }
{ "content_hash": "25a38ca8a0f5c58a688e117ba9cb3635", "timestamp": "", "source": "github", "line_count": 235, "max_line_length": 176, "avg_line_length": 40.15744680851064, "alnum_prop": 0.730316837978171, "repo_name": "liuyang-li/buck", "id": "64c3ded6b2671a3db10fb991c6aa043d6c20a57b", "size": "10042", "binary": false, "copies": "7", "ref": "refs/heads/master", "path": "src/com/facebook/buck/android/ApkBuilderStep.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Assembly", "bytes": "87" }, { "name": "Batchfile", "bytes": "683" }, { "name": "C", "bytes": "246045" }, { "name": "C#", "bytes": "237" }, { "name": "C++", "bytes": "4689" }, { "name": "CSS", "bytes": "54863" }, { "name": "D", "bytes": "1017" }, { "name": "Go", "bytes": "13683" }, { "name": "Groff", "bytes": "440" }, { "name": "Groovy", "bytes": "2297" }, { "name": "HTML", "bytes": "5023" }, { "name": "IDL", "bytes": "128" }, { "name": "Java", "bytes": "12000000" }, { "name": "JavaScript", "bytes": "931213" }, { "name": "Lex", "bytes": "2442" }, { "name": "Makefile", "bytes": "1791" }, { "name": "Matlab", "bytes": "47" }, { "name": "OCaml", "bytes": "2956" }, { "name": "Objective-C", "bytes": "108013" }, { "name": "Objective-C++", "bytes": "34" }, { "name": "PowerShell", "bytes": "244" }, { "name": "Python", "bytes": "488758" }, { "name": "Rust", "bytes": "938" }, { "name": "Shell", "bytes": "34363" }, { "name": "Smalltalk", "bytes": "897" }, { "name": "Thrift", "bytes": "120" }, { "name": "Yacc", "bytes": "323" } ], "symlink_target": "" }
package org.cleanlogic.cesiumjs4gwt.showcase; import com.google.gwt.user.client.ui.DialogBox; /** * This will create a standard gwt-dialogbox with a close button. the css for * the close button: * * <pre> * .gwt-DialogBox-closebutton { * font-weight: bold; * color: #dd0000; * padding: 2px; * margin-left: 2px; * } * .gwt-DialogBox-closebutton:ACTIVE { * padding: 1px; * border: thin #dd0000 solid; * } * .gwt-DialogBox-closebutton:HOVER { * padding: 2px; * color: #ee0000; * } * </pre> * * @author Frank Wynants */ public class DialogBoxWithCloseButton extends DialogBox { /** The count. */ private static int count = 0; /** * Define closeDialog using JSNI. * * @param dialogBox The dialog box. * @param functionName The name of the function to invoke. */ private static native void redefineClose(DialogBox dialogBox, String functionName) /*-{ $wnd[functionName] = function () { dialogBox.@org.cleanlogic.cesiumjs4gwt.showcase.DialogBoxWithCloseButton::hideDialog()(); } }-*/; /** The id. */ private final String uid; /** * Creates an instance. */ public DialogBoxWithCloseButton() { this(false); } /** * Creates an instance. * * @param autoHide True to autohide. */ public DialogBoxWithCloseButton(final boolean autoHide) { this(autoHide, true); } /** * Creates an instance. * * @param autoHide True to autohide. * @param modal True to make the dialog modal. */ public DialogBoxWithCloseButton(final boolean autoHide, final boolean modal) { super(autoHide, modal); setGlassEnabled(true); this.uid = "DialogBoxWithCloseButton_" + count++ + "_Close"; setText("Dialog"); } /** * Hides the dialog. */ public void hideDialog() { super.hide(); } /* * (non-Javadoc) * * @see com.google.gwt.user.client.ui.DialogBox#setHTML(java.lang.String) */ @Override public void setHTML(final String html) { final String styleName = getStyleName() + "-closebutton"; super.setHTML( "<table border='0' cellspacing='0' cellpadding='0' width='100%'><tr><td width='5%'>&nbsp;</td><td align='left' width='90%'>" + html + "</td><td align='right' valign='middle' width='5%'><span class='" + styleName + "' onclick='" + this.uid + "()'>X</span></td></tr></table>"); redefineClose(this, this.uid); } /* * (non-Javadoc) * * @see com.google.gwt.user.client.ui.DialogBox#setText(java.lang.String) */ @Override public void setText(final String text) { this.setHTML(text); } }
{ "content_hash": "1c087feee1f01261efc611af9d61dd4c", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 140, "avg_line_length": 25.8, "alnum_prop": 0.5796335447498239, "repo_name": "iSergio/gwt-cs", "id": "9113ee376169289dbf78bcdf1d6a747009e4097f", "size": "3442", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "cesiumjs4gwt-showcase/src/main/java/org/cleanlogic/cesiumjs4gwt/showcase/DialogBoxWithCloseButton.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "40122" }, { "name": "HTML", "bytes": "35454" }, { "name": "Java", "bytes": "51456524" } ], "symlink_target": "" }
package com.google.api.codegen.csharp; import com.google.api.codegen.ApiConfig; import com.google.api.codegen.CollectionConfig; import com.google.api.codegen.FlatteningConfig; import com.google.api.codegen.GapicContext; import com.google.api.codegen.InterfaceConfig; import com.google.api.codegen.MethodConfig; import com.google.api.codegen.PageStreamingConfig; import com.google.api.codegen.ServiceConfig; import com.google.api.gax.core.RetrySettings; import com.google.api.gax.protobuf.PathTemplate; import com.google.api.tools.framework.aspects.documentation.model.DocumentationUtil; import com.google.api.tools.framework.model.Field; import com.google.api.tools.framework.model.Interface; import com.google.api.tools.framework.model.MessageType; import com.google.api.tools.framework.model.Method; import com.google.api.tools.framework.model.Model; import com.google.api.tools.framework.model.ProtoElement; import com.google.api.tools.framework.model.ProtoFile; import com.google.api.tools.framework.model.TypeRef; import com.google.auto.value.AutoValue; import com.google.common.base.Function; import com.google.common.base.Joiner; import com.google.common.base.Predicate; import com.google.common.base.Predicates; import com.google.common.base.Splitter; import com.google.common.base.Strings; import com.google.common.collect.FluentIterable; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Maps; import com.google.protobuf.DescriptorProtos.FieldDescriptorProto.Type; import autovalue.shaded.com.google.common.common.collect.ImmutableList; import io.grpc.Status; import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.Set; import javax.annotation.Nullable; /** * A GapicContext specialized for C#. */ public class CSharpGapicContext extends GapicContext implements CSharpContext { /** * A map from primitive types in proto to C# counterparts. */ private static final ImmutableMap<Type, String> PRIMITIVE_TYPE_MAP = ImmutableMap.<Type, String>builder() .put(Type.TYPE_BOOL, "bool") .put(Type.TYPE_DOUBLE, "double") .put(Type.TYPE_FLOAT, "float") .put(Type.TYPE_INT64, "long") .put(Type.TYPE_UINT64, "ulong") .put(Type.TYPE_SINT64, "long") .put(Type.TYPE_FIXED64, "ulong") .put(Type.TYPE_SFIXED64, "long") .put(Type.TYPE_INT32, "int") .put(Type.TYPE_UINT32, "uint") .put(Type.TYPE_SINT32, "int") .put(Type.TYPE_FIXED32, "uint") .put(Type.TYPE_SFIXED32, "int") .put(Type.TYPE_STRING, "string") .put(Type.TYPE_BYTES, "ByteString") .build(); private CSharpContextCommon csharpCommon; public CSharpGapicContext(Model model, ApiConfig config) { super(model, config); } @Override public void resetState(CSharpContextCommon csharpCommon) { this.csharpCommon = csharpCommon; } // Snippet Helpers // =============== /** * Adds the given type name to the import list. Returns an empty string so that the output is not * affected. */ public String addImport(String namespace) { return csharpCommon.addImport(namespace); } // This member function is necessary to provide access to snippets for // the functionality, since snippets can't call static functions. public String getNamespace(ProtoFile file) { return s_getNamespace(file); } /** * Gets the C# namespace for the given proto file. */ // Code effectively copied from protoc, in csharp_helpers.cc, GetFileNamespace // This function is necessary to provide a static entry point for the same-named // member function. public static String s_getNamespace(ProtoFile file) { String optionsNamespace = file.getProto().getOptions().getCsharpNamespace(); if (!Strings.isNullOrEmpty(optionsNamespace)) { return optionsNamespace; } return CSharpContextCommon.s_underscoresToCamelCase(file.getProto().getPackage(), true, true); } public Iterable<String> removeItem(Iterable<String> items, final String remove) { return FluentIterable.from(items) .filter( new Predicate<String>() { @Override public boolean apply(String item) { return !item.equals(remove); } }); } @AutoValue public abstract static class ServiceInfo { public static ServiceInfo create(String host, int port, Iterable<String> scopes) { return new AutoValue_CSharpGapicContext_ServiceInfo(host, port, scopes); } public abstract String host(); public abstract int port(); public abstract Iterable<String> scopes(); } public ServiceInfo getServiceInfo(Interface service) { ServiceConfig serviceConfig = getServiceConfig(); return ServiceInfo.create( serviceConfig.getServiceAddress(service), serviceConfig.getServicePort(), serviceConfig.getAuthScopes(service)); } @AutoValue public abstract static class RetryDefInfo { public static RetryDefInfo create( String rawName, String name, String statusCodeUseList, boolean anyStatusCodes, Iterable<String> statusCodeNames) { return new AutoValue_CSharpGapicContext_RetryDefInfo( rawName, name, statusCodeUseList, anyStatusCodes, statusCodeNames); } public abstract String rawName(); public abstract String name(); public abstract String statusCodeUseList(); public abstract boolean anyStatusCodes(); public abstract Iterable<String> statusCodeNames(); } @AutoValue public abstract static class RetrySettingInfo { public static RetrySettingInfo create( String rawName, String name, long delayMs, double delayMultiplier, long delayMaxMs, long timeoutMs, double timeoutMultiplier, long timeoutMaxMs, long totalTimeoutMs) { return new AutoValue_CSharpGapicContext_RetrySettingInfo( rawName, name, delayMs, delayMultiplier, delayMaxMs, timeoutMs, timeoutMultiplier, timeoutMaxMs, totalTimeoutMs); } public abstract String rawName(); public abstract String name(); public abstract long delayMs(); public abstract double delayMultiplier(); public abstract long delayMaxMs(); public abstract long timeoutMs(); public abstract double timeoutMultiplier(); public abstract long timeoutMaxMs(); public abstract long totalTimeoutMs(); } @AutoValue public abstract static class RetryInfo { public static RetryInfo create(List<RetryDefInfo> defs, List<RetrySettingInfo> settings) { return new AutoValue_CSharpGapicContext_RetryInfo(defs, settings); } public abstract List<RetryDefInfo> defs(); public abstract List<RetrySettingInfo> settings(); } public RetryInfo getRetryInfo(Interface service) { final InterfaceConfig interfaceConfig = getApiConfig().getInterfaceConfig(service); List<RetryDefInfo> defs = FluentIterable.from(interfaceConfig.getRetryCodesDefinition().entrySet()) .transform( new Function<Map.Entry<String, ImmutableSet<Status.Code>>, RetryDefInfo>() { @Override public RetryDefInfo apply(Map.Entry<String, ImmutableSet<Status.Code>> entry) { Iterable<String> statusCodeNames = FluentIterable.from(entry.getValue()) .transform( new Function<Status.Code, String>() { @Override public String apply(Status.Code statusCode) { String statusCodeNameLower = statusCode.toString().toLowerCase(); return CSharpContextCommon.s_underscoresToPascalCase( statusCodeNameLower); } }); return RetryDefInfo.create( entry.getKey(), CSharpContextCommon.s_underscoresToPascalCase(entry.getKey()), Joiner.on(", ") .join(CSharpContextCommon.s_prefix(statusCodeNames, "StatusCode.")), entry.getValue().size() > 0, statusCodeNames); } }) .toList(); List<RetrySettingInfo> settings = FluentIterable.from(interfaceConfig.getRetrySettingsDefinition().entrySet()) .transform( new Function<Map.Entry<String, RetrySettings>, RetrySettingInfo>() { @Override public RetrySettingInfo apply(Map.Entry<String, RetrySettings> entry) { RetrySettings retrySettings = entry.getValue(); return RetrySettingInfo.create( entry.getKey(), CSharpContextCommon.s_underscoresToPascalCase(entry.getKey()), retrySettings.getInitialRetryDelay().getMillis(), retrySettings.getRetryDelayMultiplier(), retrySettings.getMaxRetryDelay().getMillis(), retrySettings.getInitialRpcTimeout().getMillis(), retrySettings.getRpcTimeoutMultiplier(), retrySettings.getMaxRpcTimeout().getMillis(), retrySettings.getTotalTimeout().getMillis()); } }) .toList(); return RetryInfo.create(defs, settings); } @AutoValue public abstract static class ParamInfo { public static ParamInfo create( String name, String typeName, String defaultValue, String propertyName, String propertyTransform, boolean isRepeated) { return new AutoValue_CSharpGapicContext_ParamInfo( name, typeName, defaultValue, propertyName, propertyTransform, isRepeated); } public abstract String name(); public abstract String typeName(); public abstract String defaultValue(); public abstract String propertyName(); public abstract String propertyTransform(); public abstract boolean isRepeated(); } @AutoValue public abstract static class PageStreamerInfo { public static PageStreamerInfo create( String resourceTypeName, String requestTypeName, String responseTypeName, String tokenTypeName, String staticFieldName, String requestPageTokenFieldName, String responseNextPageTokenFieldName, String responseResourceFieldName, String emptyPageToken) { return new AutoValue_CSharpGapicContext_PageStreamerInfo( resourceTypeName, requestTypeName, responseTypeName, tokenTypeName, staticFieldName, requestPageTokenFieldName, responseNextPageTokenFieldName, responseResourceFieldName, emptyPageToken); } public abstract String resourceTypeName(); public abstract String requestTypeName(); public abstract String responseTypeName(); public abstract String tokenTypeName(); public abstract String staticFieldName(); public abstract String requestPageTokenFieldName(); public abstract String responseNextPageTokenFieldName(); public abstract String responseResourceFieldName(); public abstract String emptyPageToken(); } @AutoValue public abstract static class FlatInfo { public static FlatInfo create( Iterable<ParamInfo> params, Iterable<String> xmlDocAsync, Iterable<String> xmlDocSync) { return new AutoValue_CSharpGapicContext_FlatInfo(params, xmlDocAsync, xmlDocSync); } public abstract Iterable<ParamInfo> params(); public abstract Iterable<String> xmlDocAsync(); public abstract Iterable<String> xmlDocSync(); } private FlatInfo createFlatInfo(Method method, List<Field> flat, PageStreamingConfig page) { List<ParamInfo> params = FluentIterable.from(flat) .transform( new Function<Field, ParamInfo>() { @Override public ParamInfo apply(Field field) { return ParamInfo.create( CSharpContextCommon.s_underscoresToCamelCase(field.getSimpleName()), typeName(field.getType()), "", CSharpContextCommon.s_underscoresToPascalCase(field.getSimpleName()), "", field.getType().isRepeated()); } }) .toList(); if (page != null) { ParamInfo pageToken = ParamInfo.create("pageToken", "string", " = null", "PageToken", " ?? \"\"", false); ParamInfo pageSize = ParamInfo.create("pageSize", "int?", " = null", "PageSize", " ?? 0", false); params = FluentIterable.from(params).append(pageToken, pageSize).toList(); } return FlatInfo.create( params, makeMethodXmlDoc(method, flat, true, page != null), makeMethodXmlDoc(method, flat, false, page != null)); } @AutoValue public abstract static class MethodInfo { public static MethodInfo create( String name, String grpcName, String asyncReturnTypeName, String syncReturnTypeName, boolean isPageStreaming, PageStreamerInfo pageStreaming, String requestTypeName, String responseTypeName, String syncReturnStatement, boolean anyFlats, Iterable<FlatInfo> flats, RetryDefInfo retryCodes, RetrySettingInfo retryParams) { return new AutoValue_CSharpGapicContext_MethodInfo( name, grpcName, asyncReturnTypeName, syncReturnTypeName, isPageStreaming, pageStreaming, requestTypeName, responseTypeName, syncReturnStatement, anyFlats, flats, retryCodes, retryParams); } public abstract String name(); public abstract String grpcName(); public abstract String asyncReturnTypeName(); public abstract String syncReturnTypeName(); public abstract boolean isPageStreaming(); @Nullable public abstract PageStreamerInfo pageStreaming(); public abstract String requestTypeName(); public abstract String responseTypeName(); public abstract String syncReturnStatement(); public abstract boolean anyFlats(); public abstract Iterable<FlatInfo> flats(); public abstract RetryDefInfo retryCodes(); public abstract RetrySettingInfo retrySetting(); } private MethodInfo createMethodInfo( InterfaceConfig interfaceConfig, final Method method, MethodConfig methodConfig, RetryDefInfo retryDef, RetrySettingInfo retrySetting) { final PageStreamingConfig pageStreamingConfig = methodConfig.getPageStreaming(); FlatteningConfig flattening = methodConfig.getFlattening(); TypeRef returnType = method.getOutputType(); boolean returnTypeEmpty = messages().isEmptyType(returnType); String methodName; String asyncReturnTypeName; String syncReturnTypeName; if (returnTypeEmpty) { methodName = method.getSimpleName(); asyncReturnTypeName = "Task"; syncReturnTypeName = "void"; } else { if (pageStreamingConfig != null) { methodName = method.getSimpleName(); TypeRef resourceType = pageStreamingConfig.getResourcesField().getType(); String elementTypeName = basicTypeName(resourceType); asyncReturnTypeName = "IPagedAsyncEnumerable<" + typeName(returnType) + ", " + elementTypeName + ">"; syncReturnTypeName = "IPagedEnumerable<" + typeName(returnType) + ", " + elementTypeName + ">"; } else { methodName = method.getSimpleName(); asyncReturnTypeName = "Task<" + typeName(returnType) + ">"; syncReturnTypeName = typeName(returnType); } } List<FlatInfo> flats = flattening != null ? FluentIterable.from(flattening.getFlatteningGroups()) .transform( new Function<List<Field>, FlatInfo>() { @Override public FlatInfo apply(List<Field> flat) { return createFlatInfo(method, flat, pageStreamingConfig); } }) .toList() : Collections.<FlatInfo>emptyList(); return MethodInfo.create( methodName, method.getSimpleName(), asyncReturnTypeName, syncReturnTypeName, pageStreamingConfig != null, getPageStreamerInfo(interfaceConfig, method), typeName(method.getInputType()), typeName(returnType), returnTypeEmpty ? "" : "return ", !flats.isEmpty(), flats, retryDef, retrySetting); } public List<MethodInfo> getMethodInfos(Interface service) { final InterfaceConfig interfaceConfig = getApiConfig().getInterfaceConfig(service); RetryInfo retryInfo = getRetryInfo(service); final Map<String, RetryDefInfo> retryDefByName = Maps.uniqueIndex( retryInfo.defs(), new Function<RetryDefInfo, String>() { @Override public String apply(RetryDefInfo value) { return value.rawName(); } }); final Map<String, RetrySettingInfo> retrySettingByName = Maps.uniqueIndex( retryInfo.settings(), new Function<RetrySettingInfo, String>() { @Override public String apply(RetrySettingInfo value) { return value.rawName(); } }); // TODO: Change back to .from(service.getMethods()) once streaming is implemented. // We ignore streaming for now to not cause test failures. return FluentIterable.from(getNonStreamingMethods(service)) .transform( new Function<Method, MethodInfo>() { @Override public MethodInfo apply(Method method) { MethodConfig methodConfig = interfaceConfig.getMethodConfig(method); return createMethodInfo( interfaceConfig, method, methodConfig, retryDefByName.get(methodConfig.getRetryCodesConfigName()), retrySettingByName.get(methodConfig.getRetrySettingsConfigName())); } }) .filter( new Predicate<MethodInfo>() { @Override public boolean apply(MethodInfo method) { return method.anyFlats(); } }) .toList(); } private PageStreamerInfo getPageStreamerInfo(InterfaceConfig interfaceConfig, Method method) { MethodConfig methodConfig = interfaceConfig.getMethodConfig(method); PageStreamingConfig pageStreamingConfig = methodConfig.getPageStreaming(); if (pageStreamingConfig == null) { return null; } // IEnumerable required in IPageResponse<T> partial of page-streaming protobuf entities addImport("System.Collections"); return PageStreamerInfo.create( basicTypeName(pageStreamingConfig.getResourcesField().getType()), typeName(method.getInputType()), typeName(method.getOutputType()), typeName(pageStreamingConfig.getRequestTokenField().getType()), "s_" + firstLetterToLower(method.getSimpleName()) + "PageStreamer", CSharpContextCommon.s_underscoresToPascalCase( pageStreamingConfig.getRequestTokenField().getSimpleName()), CSharpContextCommon.s_underscoresToPascalCase( pageStreamingConfig.getResponseTokenField().getSimpleName()), CSharpContextCommon.s_underscoresToPascalCase( pageStreamingConfig.getResourcesField().getSimpleName()), "\"\""); } public List<PageStreamerInfo> getPageStreamerInfos(Interface service) { final InterfaceConfig interfaceConfig = getApiConfig().getInterfaceConfig(service); // TODO: Change back to .from(service.getMethods()) once streaming is implemented. // We ignore streaming for now to not cause test failures. return FluentIterable.from(getNonStreamingMethods(service)) .transform( new Function<Method, PageStreamerInfo>() { @Override public PageStreamerInfo apply(Method method) { return getPageStreamerInfo(interfaceConfig, method); } }) .filter(Predicates.notNull()) .toList(); } @AutoValue public abstract static class PathTemplateInfo { public static PathTemplateInfo create( String baseName, String docName, String namePattern, Iterable<String> vars, String varArgDeclList, String varArgUseList) { return new AutoValue_CSharpGapicContext_PathTemplateInfo( baseName, docName, namePattern, vars, varArgDeclList, varArgUseList); } public abstract String baseName(); public abstract String docName(); public abstract String namePattern(); public abstract Iterable<String> vars(); public abstract String varArgDeclList(); public abstract String varArgUseList(); } public List<PathTemplateInfo> getPathTemplateInfos(Interface service) { InterfaceConfig interfaceConfig = getApiConfig().getInterfaceConfig(service); return FluentIterable.from(interfaceConfig.getCollectionConfigs()) .transform( new Function<CollectionConfig, PathTemplateInfo>() { @Override public PathTemplateInfo apply(CollectionConfig collection) { PathTemplate template = collection.getNameTemplate(); Set<String> vars = template.vars(); StringBuilder varArgDeclList = new StringBuilder(); StringBuilder varArgUseList = new StringBuilder(); for (String var : vars) { varArgDeclList.append("string " + var + "Id, "); varArgUseList.append(var + "Id, "); } return PathTemplateInfo.create( CSharpContextCommon.s_underscoresToPascalCase(collection.getEntityName()), CSharpContextCommon.s_underscoresToCamelCase(collection.getEntityName()), collection.getNamePattern(), vars, varArgDeclList.substring(0, varArgDeclList.length() - 2), varArgUseList.substring(0, varArgUseList.length() - 2)); } }) .toList(); } /** * Returns the C# representation of a reference to a type. */ private String typeName(TypeRef type) { if (type.isMap()) { TypeRef keyType = type.getMapKeyField().getType(); TypeRef valueType = type.getMapValueField().getType(); return "IDictionary<" + typeName(keyType) + ", " + typeName(valueType) + ">"; } // Must check for map first, as a map is also repeated if (type.isRepeated()) { return String.format("IEnumerable<%s>", basicTypeName(type)); } return basicTypeName(type); } /** * Returns the C# representation of a type, without cardinality. */ private String basicTypeName(TypeRef type) { String result = PRIMITIVE_TYPE_MAP.get(type.getKind()); if (result != null) { if (type.getKind() == Type.TYPE_BYTES) { // Special handling of ByteString. // It requires a 'using' directive, unlike all other primitive types. addImport("Google.Protobuf"); } return result; } switch (type.getKind()) { case TYPE_MESSAGE: return getTypeName(type.getMessageType()); case TYPE_ENUM: return getTypeName(type.getEnumType()); default: throw new IllegalArgumentException("unknown type kind: " + type.getKind()); } } /** * Gets the full name of the message or enum type in C#. */ private String getTypeName(ProtoElement elem) { // TODO: Handle naming collisions. This will probably require // using alias directives, which will be awkward... // Handle nested types, construct the required type prefix ProtoElement parentEl = elem.getParent(); String prefix = ""; while (parentEl != null && parentEl instanceof MessageType) { prefix = parentEl.getSimpleName() + ".Types." + prefix; parentEl = parentEl.getParent(); } // Add an import for the type, if not already imported addImport(getNamespace(elem.getFile())); // Return the combined type prefix and type name return prefix + elem.getSimpleName(); } private List<String> docLines(ProtoElement element, final String prefix) { FluentIterable<String> lines = FluentIterable.from( Splitter.on(String.format("%n")).split(DocumentationUtil.getDescription(element))); return lines .transform( new Function<String, String>() { @Override public String apply(String line) { return prefix + line.replace("&", "&amp;").replace("<", "&lt;"); } }) .toList(); } private List<String> makeMethodXmlDoc( Method method, List<Field> params, boolean isAsync, boolean isPageStreaming) { Iterable<String> parameters = FluentIterable.from(params) .transformAndConcat( new Function<Field, Iterable<String>>() { @Override public Iterable<String> apply(Field param) { String paramName = CSharpContextCommon.s_underscoresToCamelCase(param.getSimpleName()); String header = "/// <param name=\"" + paramName + "\">"; List<String> lines = docLines(param, ""); if (lines.size() > 1) { return ImmutableList.<String>builder() .add(header) .addAll( FluentIterable.from(lines) .transform( new Function<String, String>() { @Override public String apply(String line) { return "/// " + line; } })) .add("/// </param>") .build(); } else { return Collections.singletonList(header + lines.get(0) + "</param>"); } } }); if (isPageStreaming) { String[] pageToken = { "/// <param name=\"pageToken\">The token returned from the previous request.", "/// A value of <c>null</c> or an empty string retrieves the first page.</param>", }; String[] pageSize = { "/// <param name=\"pageSize\">The size of page to request.", "/// The response will not be larger than this, but may be smaller.", "/// A value of <c>null</c> or 0 uses a server-defined page size.</param>", }; parameters = FluentIterable.from(parameters) .append(Arrays.asList(pageToken)) .append(Arrays.asList(pageSize)) .toList(); } return ImmutableList.<String>builder() .add("/// <summary>") .addAll(docLines(method, "/// ")) .add("/// </summary>") .addAll(parameters) .build(); } private String firstLetterToLower(String input) { if (input != null && input.length() >= 1) { return input.substring(0, 1).toLowerCase(Locale.ENGLISH) + input.substring(1); } else { return input; } } public String prependComma(String text) { return text.isEmpty() ? "" : ", " + text; } }
{ "content_hash": "b029cec5d2f13f80fc2fc5ccadaaa40f", "timestamp": "", "source": "github", "line_count": 791, "max_line_length": 99, "avg_line_length": 36.122629582806574, "alnum_prop": 0.6227557484338362, "repo_name": "jmuk/toolkit", "id": "2b26bac9673432afd3bc61c6faccc0e7072ee845", "size": "29164", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/main/java/com/google/api/codegen/csharp/CSharpGapicContext.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Groovy", "bytes": "2110" }, { "name": "Java", "bytes": "988936" }, { "name": "Protocol Buffer", "bytes": "26267" } ], "symlink_target": "" }
package io.fabric8.karaf.core.properties.function; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; import java.util.List; import java.util.Map; import io.fabric8.kubernetes.api.model.ConfigMap; import io.fabric8.kubernetes.api.model.Secret; import io.fabric8.kubernetes.client.KubernetesClient; import io.fabric8.kubernetes.client.utils.Utils; import org.apache.commons.codec.binary.Base64; import org.slf4j.Logger; import org.slf4j.LoggerFactory; final class KubernetesSupport { public static final Logger LOGGER = LoggerFactory.getLogger(KubernetesSupport.class); public static final String FABRIC8_K8S_SECRET_PATHS = "fabric8.k8s.secrets.path"; public static final String FABRIC8_K8S_SECRET_API_ENABLED = "fabric8.k8s.secrets.api.enabled"; private KubernetesSupport() { } // ****************************** // Resource abstraction // ****************************** static abstract class Resource { public String get(KubernetesClient client, String name, String key) { Map<String, String> data = getData(client, name); return data != null ? data.get(key) : null; } abstract Map<String, String> getData(KubernetesClient client, String name); } static final class SecretsResource extends Resource { private final boolean useApi; private final List<Path> paths; public SecretsResource() { this.useApi = Utils.getSystemPropertyOrEnvVar(FABRIC8_K8S_SECRET_API_ENABLED, false); this.paths = new ArrayList<>(); String secretPaths = Utils.getSystemPropertyOrEnvVar(FABRIC8_K8S_SECRET_PATHS); if (Utils.isNotNullOrEmpty(secretPaths)) { for (String path : secretPaths.split(",")) { this.paths.add(Paths.get(path)); } } } @Override Map<String, String> getData(KubernetesClient client, String name) { Secret resource = client.secrets().withName(name).get(); return (resource != null) ? resource.getData() : null; } @Override public String get(KubernetesClient client, String name, String key) { // The secret's value String value = null; // First check if secret has been mounted locally for (Path path : this.paths) { Path secretPath = path.resolve(name).resolve(key); if (Files.exists(secretPath) && Files.isRegularFile(secretPath)) { try { value = new String(Files.readAllBytes(secretPath)).trim(); } catch (IOException e) { LOGGER.warn("", e); } } } // Then retrieve secrets using APIs if enabled and not found locally if (this.useApi && Utils.isNullOrEmpty(value)) { value = super.get(client, name, key); if (Utils.isNotNullOrEmpty(value)) { value = new String(Base64.decodeBase64(value)); } } return value; } } static final class ConfigMapResource extends Resource { @Override Map<String, String> getData(KubernetesClient client, String name) { ConfigMap resource = client.configMaps().withName(name).get(); return (resource != null) ? resource.getData() : null; } } // ****************************** // Resource helpers // ****************************** public static Resource secretsResource() { return new SecretsResource(); } public static Resource configMapResource() { return new ConfigMapResource(); } }
{ "content_hash": "5355a2843435c35edfb6b4d456bff502", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 98, "avg_line_length": 34.78378378378378, "alnum_prop": 0.5918155918155918, "repo_name": "jboss-fuse/fuse-karaf", "id": "b1dc6dda363f2060a9ed1853dbb4356793db0477", "size": "4499", "binary": false, "copies": "5", "ref": "refs/heads/7.x.redhat-7-x", "path": "modules/fabric8-karaf/fabric8-karaf-core/src/main/java/io/fabric8/karaf/core/properties/function/KubernetesSupport.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "6429" }, { "name": "CSS", "bytes": "256" }, { "name": "HTML", "bytes": "296528" }, { "name": "Java", "bytes": "1162611" }, { "name": "Shell", "bytes": "32418" }, { "name": "XSLT", "bytes": "6352" } ], "symlink_target": "" }
import React from "react"; import Paragraph from "../paragraph"; export default class Index extends React.Component { render () { return <Paragraph> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </Paragraph>; } };
{ "content_hash": "e8d16b4a2f81d194550ee6ba21d031fa", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 78, "avg_line_length": 37.27777777777778, "alnum_prop": 0.7317436661698957, "repo_name": "AKST/react-scss-boilerplate", "id": "ffbe2fd202a123f67dd9de81c85580f456801203", "size": "671", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "app/components/type/lorem-ipsum/index.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "1144" }, { "name": "HTML", "bytes": "391" }, { "name": "JavaScript", "bytes": "2499" }, { "name": "Shell", "bytes": "4717" } ], "symlink_target": "" }
Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **read** | **list[str]** | List of user principals that can read the record. | [optional] **write** | **list[str]** | List of user principals that can read, update and delete the record. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
{ "content_hash": "f31751d004a60cbd8d4cb1dbdfc80967", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 161, "avg_line_length": 57.75, "alnum_prop": 0.5887445887445888, "repo_name": "gabisurita/kinto-codegen-tutorial", "id": "2c493b22d842aef2c0c29b15e10a72e7a0a853a3", "size": "497", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "python-client/docs/RecordPermissions.md", "mode": "33188", "license": "mit", "language": [ { "name": "PHP", "bytes": "95504" }, { "name": "Python", "bytes": "662063" }, { "name": "Shell", "bytes": "3259" } ], "symlink_target": "" }
@class SQGoodsClassificationModel; @interface SQTopCategoryCell : UITableViewCell @property (nonatomic, strong) SQGoodsClassificationModel *model; @end
{ "content_hash": "08be3a2ec0dfb40f64b4232dd80859b9", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 64, "avg_line_length": 25.666666666666668, "alnum_prop": 0.8376623376623377, "repo_name": "zc150815/ired6-1.0.0", "id": "b5e5a28e9631ec5a4d4577e2a792689068d792e1", "size": "316", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ired6 1.0.0/ired6/Classes/HomePage/Views/SQTopCategoryCell.h", "mode": "33188", "license": "mit", "language": [ { "name": "Objective-C", "bytes": "1283950" }, { "name": "Ruby", "bytes": "262" }, { "name": "Shell", "bytes": "8861" } ], "symlink_target": "" }
"use strict"; var socialLogin = angular.module('socialLogin', []); socialLogin.provider("social", function(){ var fbKey, fbApiV, googleKey, linkedInKey; return { setFbKey: function(obj){ fbKey = obj.appId; fbApiV = obj.apiVersion; var d = document, fbJs, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0]; fbJs = d.createElement('script'); fbJs.id = id; fbJs.async = true; fbJs.src = "//connect.facebook.net/en_US/sdk.js"; fbJs.onload = function() { FB.init({ appId: fbKey, status: true, cookie: true, xfbml: true, version: fbApiV }); }; ref.parentNode.insertBefore(fbJs, ref); }, setGoogleKey: function(value){ googleKey = value; var d = document, gJs, ref = d.getElementsByTagName('script')[0]; gJs = d.createElement('script'); gJs.async = true; gJs.src = "//apis.google.com/js/platform.js" gJs.onload = function() { var params ={ client_id: value, scope: 'email' } gapi.load('auth2', function() { gapi.auth2.init(params); }); }; ref.parentNode.insertBefore(gJs, ref); }, setLinkedInKey: function(value){ linkedInKey = value; var lIN, d = document, ref = d.getElementsByTagName('script')[0]; lIN = d.createElement('script'); lIN.async = false; lIN.src = "//platform.linkedin.com/in.js"; lIN.text = ("api_key: " + linkedInKey).replace("\"", ""); ref.parentNode.insertBefore(lIN, ref); }, $get: function(){ return{ fbKey: fbKey, googleKey: googleKey, linkedInKey: linkedInKey, fbApiV: fbApiV } } } }); socialLogin.factory("socialLoginService", function($window, $rootScope){ return { logout: function(){ var provider = $window.localStorage.getItem('_login_provider'); switch(provider) { case "google": //its a hack need to find better solution. var gElement = document.getElementById("gSignout"); if (typeof(gElement) != 'undefined' && gElement != null) { gElement.remove(); } var d = document, gSignout, ref = d.getElementsByTagName('script')[0]; gSignout = d.createElement('script'); gSignout.src = "https://accounts.google.com/Logout"; gSignout.type = "text/javascript"; gSignout.id = "gSignout"; $window.localStorage.removeItem('_login_provider'); $rootScope.$broadcast('event:social-sign-out-success', "success"); ref.parentNode.insertBefore(gSignout, ref); break; case "linkedIn": IN.User.logout(function(){ $window.localStorage.removeItem('_login_provider'); $rootScope.$broadcast('event:social-sign-out-success', "success"); }, {}); break; case "facebook": FB.logout(function(res){ $window.localStorage.removeItem('_login_provider'); $rootScope.$broadcast('event:social-sign-out-success', "success"); }); break; } }, setProvider: function(provider){ $window.localStorage.setItem('_login_provider', provider); } } }); socialLogin.factory("fbService", function($q){ return { login: function(){ var deferred = $q.defer(); FB.login(function(res){ deferred.resolve(res); }, {scope: 'email,user_about_me,user_birthday', auth_type: 'rerequest'}); return deferred.promise; }, getUserDetails: function(){ var deferred = $q.defer(); FB.api('/me?fields=name,email,picture,cover,birthday,education,gender,about,hometown,interested_in,languages,link,location,sports,website', function(res){ console.log(res); if(!res || res.error){ deferred.reject('Error occured while fetching user details.'); }else{ deferred.resolve(res); } }); return deferred.promise; } } }); socialLogin.directive("linkedIn", function($rootScope, social, socialLoginService, $window){ return { restrict: 'EA', scope: {}, link: function(scope, ele, attr){ ele.on("click", function(){ IN.User.authorize(function(){ IN.API.Raw("/people/~:(id,first-name,last-name,email-address,picture-url,headline,location,industry,summary,specialties,positions,public-profile-url)").result(function(res){ console.log(res); socialLoginService.setProvider("linkedIn"); var userDetails = {name: res.firstName + " " + res.lastName, email: res.emailAddress, uid: res.id, provider: "linkedIN", imageUrl: res.pictureUrl}; $rootScope.$broadcast('event:social-sign-in-success', userDetails); }); }); }) } } }); socialLogin.directive("gLogin", function($rootScope, social, socialLoginService){ return { restrict: 'EA', scope: {}, replace: true, link: function(scope, ele, attr){ ele.on('click', function(){ if(typeof(scope.gauth) == "undefined") scope.gauth = gapi.auth2.getAuthInstance(); scope.gauth.signIn().then(function(googleUser){ var profile = googleUser.getBasicProfile(); var idToken = googleUser.getAuthResponse().access_token; socialLoginService.setProvider("google"); $rootScope.$broadcast('event:social-sign-in-success', {token: idToken, name: profile.getName(), email: profile.getEmail(), uid: profile.getId(), provider: "google", imageUrl: profile.getImageUrl()}); }, function(err){ console.log(err); }) }); } } }); socialLogin.directive("fbLogin", function($rootScope, fbService, social, socialLoginService){ return { restrict: 'A', scope: {}, replace: true, link: function(scope, ele, attr){ ele.on('click', function(){ fbService.login().then(function(res){ if(res.status == "connected"){ fbService.getUserDetails().then(function(user){ socialLoginService.setProvider("facebook"); console.log(user); var userDetails = {name: user.name, email: user.email, uid: user.id, provider: "facebook", imageUrl: user.picture.data.url} $rootScope.$broadcast('event:social-sign-in-success', user); }, function(err){ console.log(err); }) } }, function(err){ console.log(err); }); }); } } });
{ "content_hash": "3c1ad98311d7ed7fc5dae38e071b46e6", "timestamp": "", "source": "github", "line_count": 198, "max_line_length": 219, "avg_line_length": 39.77777777777778, "alnum_prop": 0.48984255967496193, "repo_name": "lakshit1001/CampusBox-webapp", "id": "40369b580fcd359c4edf30e71ec745710bbd2bdc", "size": "7876", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "bower_components/angularjs-social-login/angularjs-social-login.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "38392" }, { "name": "HTML", "bytes": "350172" }, { "name": "JavaScript", "bytes": "216683" } ], "symlink_target": "" }
package one.util.huntbugs.testdata; import java.io.IOException; import java.io.InputStream; import java.io.Reader; import one.util.huntbugs.registry.anno.AssertNoWarning; import one.util.huntbugs.registry.anno.AssertWarning; /** * @author Tagir Valeev * */ public class TestCheckReturnValue { @AssertWarning("ReturnValueOfRead") public void read(InputStream is, byte[] arr) throws IOException { is.read(arr); } @AssertWarning("ReturnValueOfSkip") public void skipTen(Reader r) throws IOException { r.skip(10); } @AssertNoWarning("ReturnValueOfSkip") public void skipTenOk(Reader r) throws IOException { long skip = 10; while(skip > 0) { skip -= r.skip(skip); } } @AssertNoWarning("*") public void readOk(InputStream is, byte[] arr) throws IOException { if(is.read(arr) != arr.length) { throw new IOException("Not fuly read"); } } }
{ "content_hash": "b3f64daa64cd05f1e90f09d191c9e832", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 71, "avg_line_length": 24.25, "alnum_prop": 0.6494845360824743, "repo_name": "Maccimo/huntbugs", "id": "294be2dad4c44e3a112e06e2b8162fbeaa9c9722", "size": "1577", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "huntbugs/src/test/java/one/util/huntbugs/testdata/TestCheckReturnValue.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "1236624" }, { "name": "XSLT", "bytes": "12652" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en-us" dir="ltr" itemscope itemtype="http://schema.org/Article"> <head> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"/> <title>O Golpista do Ano</title> <meta name="author" content="" /> <meta name="description" content="Um filme com estilo episódico (fade out em vários momentos), narração em off de um protagonista que supostamente está morto (acho que já pensaram nisso antes&hellip;) e invencionices demasiadas com a..."/> <meta name="yandex-verification" content="48a8210fc043c5e8" /> <meta name="generator" content="Hugo 0.54.0" /> <meta itemprop="name" content="O Golpista do Ano"/> <meta itemprop="description" content="Um filme com estilo episódico (fade out em vários momentos), narração em off de um protagonista que supostamente está morto (acho que já pensaram nisso antes&hellip;) e invencionices demasiadas com a..."/> <meta itemprop="image" content="/img/logo.svg"/> <meta property="og:title" content="O Golpista do Ano"/> <meta property="og:type" content="article"/> <meta property="og:url" content="http://www.cinetenisverde.com.br/o-golpista-do-ano/"/> <meta property="og:image" content="/img/logo.svg"/> <meta property="og:description" content="Um filme com estilo episódico (fade out em vários momentos), narração em off de um protagonista que supostamente está morto (acho que já pensaram nisso antes&hellip;) e invencionices demasiadas com a..."/> <meta property="og:site_name" content="Cine Tênis Verde"/> <meta property="article:published_time" content="2010-06-04T00:00:00&#43;00:00"/> <meta property="article:section" content="post"/> <meta name="twitter:card" content="summary"/> <meta name="twitter:site" content=""/> <meta name="twitter:title" content="O Golpista do Ano"/> <meta name="twitter:description" content="Um filme com estilo episódico (fade out em vários momentos), narração em off de um protagonista que supostamente está morto (acho que já pensaram nisso antes&hellip;) e invencionices demasiadas com a..."/> <meta name="twitter:creator" content=""/> <meta name="twitter:image:src" content="/img/logo.svg"/> <link rel="stylesheet" type="text/css" href="/css/capsule.min.css"/> <link rel="stylesheet" type="text/css" href="/css/custom.css"/> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-50557403-1', 'auto'); ga('send', 'pageview'); </script> <link rel="apple-touch-icon" href="/img/apple-touch-icon.png"/> <link rel="icon" href="/img/favicon.ico"/> </head> <body style="min-height:100vh;display:flex;flex-direction:column"> <nav class="navbar has-shadow is-white" role="navigation" aria-label="main navigation"> <div class="container"> <div class="navbar-brand"> <a class="navbar-item" href="/"> <img alt="Brand" src="/img/brand.svg"> <div class="title is-4">&nbsp;Cine Tênis Verde</div> </a> <label class="button navbar-burger is-white" for="navbar-burger-state"> <span></span> <span></span> <span></span> </label> </div> <input type="checkbox" id="navbar-burger-state"/> <div class="navbar-menu"> <div class="navbar-end"> <a href="/post" class="navbar-item ">search </a> <a href="https://twitter.com/cinetenisverde" class="navbar-item ">twitter </a> <a href="/index.xml" class="navbar-item ">rss </a> </div> </div> </div> </nav> <section class="section" style="flex:1"> <div class="container"> <p class="title">O Golpista do Ano</p> <p class="subtitle"><span class="entry-sidebar-stars"> &#x2605;&#x2605;&#x2605;&#x2605;&#x2606; </span> Wanderley Caloni, <a href="https://github.com/Caloni/cinetenisverde/commits/master/content/post/o-golpista-do-ano.md">June 4, 2010</a></p> <p><p> <div class="content"> <p>Um filme com estilo episódico (fade out em vários momentos), narração em off de um protagonista que supostamente está morto (acho que já pensaram nisso antes&hellip;) e invencionices demasiadas com a câmera, muitas vezes na mão. Apesar de ter tudo para dar errado, O Golpista do Ano apresenta Jim Carrey, Ewan McGregor e até Rodrigo Santoro em personagens que acompanham as personas dos atores, mas desafiam a realidade dos eventos (sim, o filme é baseado em alguns fatos em torno da figura de Phillip Morris).</p> <p>O fato é que com atuações convincentes e uma trama que nos leva ao ápice da malandragem, O Golpista do Ano se saiu muito melhor que o tão falado Trapaça. Ewan McGregor, por exemplo, domina a história e o personagem desde o início, estabelecendo de uma vez por todas a relação entre Phillips e Steven, vital para o filme (como demonstra o título original). Realizando cenas engraçadas e emocionantes ao mesmo tempo, o roteiro e direção da dupla John Requa e Glenn Ficarra consegue oscilar de maneira mais ou menos tranquila entre os dois lados da mesma moeda.</p> <p>No entanto, embora use de uma direção de arte significativa em seus mínimos detalhes (exemplo: quando eles se separam definitivamente cada um em uma prisão, as cores de seus uniformes são diferentes), a caracterização excessiva de Jim Carrey &ndash; principalmente em seu leito de morte &ndash; acaba mais assustando que se ornando com o conjunto da obra. Afinal de contas, deveria ser uma comédia, certo?</p> <p>Talvez eu esteja errado. A vida real desses três sujeitos é uma comédia, mas definitivamente eles possuíam poucos momentos para rir de si mesmos.</p> <a href="https://www.imdb.com/title/tt1045772/mediaviewer/" target="ctvimg">Imagens</a> e créditos no <a title="IMDB: Internet Movie DataBase" href="http://www.imdb.com/title/tt1045772">IMDB</a>. </div> <span class="entry-sidebar-stars"> &#x2605;&#x2605;&#x2605;&#x2605;&#x2606; </span> O Golpista do Ano &#9679; O Golpista do Ano. I Love You Phillip Morris (France, 2009). Dirigido por Glenn Ficarra, John Requa. Escrito por John Requa, Glenn Ficarra, Steve McVicker. Com Jim Carrey, Ewan McGregor, Leslie Mann, Rodrigo Santoro, Antoni Corone, Brennan Brown, Michael Mandell, Annie Golden, Marylouise Burke. &#9679; Nota: 4/5. Categoria: movies. Publicado em 2010-06-04. Texto escrito por Wanderley Caloni. <p><br>Quer <a href="https://twitter.com/search?q=@cinetenisverde O%20Golpista%20do%20Ano">comentar</a>?<br></p> </div> </section> <section class="section"> <br> <div class="container"> <div class="is-flex"> <span> <a class="button">Share</a> </span> &nbsp; <span> <a class="button" href="https://www.facebook.com/sharer/sharer.php?u=http%3a%2f%2fwww.cinetenisverde.com.br%2fo-golpista-do-ano%2f"> <span class="icon"><i class="fa fa-facebook"></i></span> </a> <a class="button" href="https://twitter.com/intent/tweet?url=http%3a%2f%2fwww.cinetenisverde.com.br%2fo-golpista-do-ano%2f&text=O%20Golpista%20do%20Ano"> <span class="icon"><i class="fa fa-twitter"></i></span> </a> <a class="button" href="https://news.ycombinator.com/submitlink?u=http%3a%2f%2fwww.cinetenisverde.com.br%2fo-golpista-do-ano%2f"> <span class="icon"><i class="fa fa-hacker-news"></i></span> </a> <a class="button" href="https://reddit.com/submit?url=http%3a%2f%2fwww.cinetenisverde.com.br%2fo-golpista-do-ano%2f&title=O%20Golpista%20do%20Ano"> <span class="icon"><i class="fa fa-reddit"></i></span> </a> <a class="button" href="https://plus.google.com/share?url=http%3a%2f%2fwww.cinetenisverde.com.br%2fo-golpista-do-ano%2f"> <span class="icon"><i class="fa fa-google-plus"></i></span> </a> <a class="button" href="https://www.linkedin.com/shareArticle?url=http%3a%2f%2fwww.cinetenisverde.com.br%2fo-golpista-do-ano%2f&title=O%20Golpista%20do%20Ano"> <span class="icon"><i class="fa fa-linkedin"></i></span> </a> <a class="button" href="https://www.tumblr.com/widgets/share/tool?canonicalUrl=http%3a%2f%2fwww.cinetenisverde.com.br%2fo-golpista-do-ano%2f&title=O%20Golpista%20do%20Ano&caption="> <span class="icon"><i class="fa fa-tumblr"></i></span> </a> <a class="button" href="https://pinterest.com/pin/create/bookmarklet/?media=%2fimg%2flogo.svg&url=http%3a%2f%2fwww.cinetenisverde.com.br%2fo-golpista-do-ano%2f&description=O%20Golpista%20do%20Ano"> <span class="icon"><i class="fa fa-pinterest"></i></span> </a> <a class="button" href="whatsapp://send?text=http%3a%2f%2fwww.cinetenisverde.com.br%2fo-golpista-do-ano%2f"> <span class="icon"><i class="fa fa-whatsapp"></i></span> </a> <a class="button" href="https://web.skype.com/share?url=http%3a%2f%2fwww.cinetenisverde.com.br%2fo-golpista-do-ano%2f"> <span class="icon"><i class="fa fa-skype"></i></span> </a> </span> </div> </div> <br> </section> <footer class="footer"> <div class="container"> <nav class="level"> <div class="level-right has-text-centered"> <div class="level-item"> <a class="button" href="http://www.cinetenisverde.com.br/"> <span class="icon"><i class="fa fa-home"></i></span> </a> &nbsp; <a class="button" href="/post"> <span class="icon"><i class="fa fa-search"></i></span> </a> &nbsp; <a class="button" href="https://twitter.com/cinetenisverde"> <span class="icon"><i class="fa fa-twitter"></i></span> </a> &nbsp; <a class="button" href="/index.xml"> <span class="icon"><i class="fa fa-rss"></i></span> </a> &nbsp; </div> </div> </nav> </div> </footer> </body> </html>
{ "content_hash": "bb7b1b4e04248f78d96986b92b70cb2e", "timestamp": "", "source": "github", "line_count": 292, "max_line_length": 565, "avg_line_length": 37.61986301369863, "alnum_prop": 0.6172052799271734, "repo_name": "cinetenisverde/cinetenisverde.github.io", "id": "ba58af028dd477913246c180f0bc61d672bbdeaa", "size": "11048", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "o-golpista-do-ano/index.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "533" }, { "name": "HTML", "bytes": "31113501" }, { "name": "JavaScript", "bytes": "3266" }, { "name": "Python", "bytes": "2943" } ], "symlink_target": "" }
SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
{ "content_hash": "286cc27a8a662c6b097d1dbb9313a95d", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 10.23076923076923, "alnum_prop": 0.6917293233082706, "repo_name": "mdoering/backbone", "id": "1d709a98c405da9f01ea8dbf759347ab60638a96", "size": "196", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Asterales/Campanulaceae/Wahlenbergia/Wahlenbergia paniculata/ Syn. Wahlenbergia divaricata/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
This example shows the use of Jade templating engine, both with precompiled templates and raw templates. sudo npm install -g couchapp install couchapp npm install jade couchapp push app.js http://admin:password@localhost:5984/jadeapp Note: don't know why, I had to install couchapp both globaly and localy… also, create the DB jadeapp using futon if it's not there. Try: <http://127.0.0.1:5984/jadeapp/_design/jadeapp/_list/index2/none> <http://127.0.0.1:5984/jadeapp/_design/jadeapp/_list/index/none>
{ "content_hash": "8dfbcf3e31861c602a54c34073af4302", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 104, "avg_line_length": 36.42857142857143, "alnum_prop": 0.7686274509803922, "repo_name": "smallmultiples/couchapp-hello-world", "id": "4772b4d03021ac6178479702bb4d8b7f9580b4a0", "size": "538", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "advanced_hello_world/README.md", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "451676" } ], "symlink_target": "" }
.class public Landroid/content/pm/ActivityInfo; .super Landroid/content/pm/ComponentInfo; .source "ActivityInfo.java" # interfaces .implements Landroid/os/Parcelable; # annotations .annotation system Ldalvik/annotation/MemberClasses; value = { Landroid/content/pm/ActivityInfo$FlymeInjector; } .end annotation # static fields .field public static final CONFIG_THEME:I = 0x4000 .field public static final CONFIG_TYPEFACE:I = 0x5000 .field public static final CONFIG_DENSITY:I = 0x1000 .field public static final CONFIG_FONTCHANGE:I = 0x20000000 .field public static final CONFIG_FONT_SCALE:I = 0x40000000 .field public static final CONFIG_KEYBOARD:I = 0x10 .field public static final CONFIG_KEYBOARD_HIDDEN:I = 0x20 .field public static final CONFIG_LAYOUT_DIRECTION:I = 0x2000 .field public static final CONFIG_LOCALE:I = 0x4 .field public static final CONFIG_MCC:I = 0x1 .field public static final CONFIG_MNC:I = 0x2 .field public static CONFIG_NATIVE_BITS:[I = null .field public static final CONFIG_NAVIGATION:I = 0x40 .field public static final CONFIG_ORIENTATION:I = 0x80 .field public static final CONFIG_SCREEN_LAYOUT:I = 0x100 .field public static final CONFIG_SCREEN_SIZE:I = 0x400 .field public static final CONFIG_SMALLEST_SCREEN_SIZE:I = 0x800 .field public static final CONFIG_TOUCHSCREEN:I = 0x8 .field public static final CONFIG_UI_MODE:I = 0x200 .field public static final CREATOR:Landroid/os/Parcelable$Creator; .annotation system Ldalvik/annotation/Signature; value = { "Landroid/os/Parcelable$Creator", "<", "Landroid/content/pm/ActivityInfo;", ">;" } .end annotation .end field .field public static final DOCUMENT_LAUNCH_ALWAYS:I = 0x2 .field public static final DOCUMENT_LAUNCH_INTO_EXISTING:I = 0x1 .field public static final DOCUMENT_LAUNCH_NEVER:I = 0x3 .field public static final DOCUMENT_LAUNCH_NONE:I = 0x0 .field public static final FLAG_ALLOW_EMBEDDED:I = -0x80000000 .field public static final FLAG_ALLOW_TASK_REPARENTING:I = 0x40 .field public static final FLAG_ALWAYS_RETAIN_TASK_STATE:I = 0x8 .field public static final FLAG_AUTO_REMOVE_FROM_RECENTS:I = 0x2000 .field public static final FLAG_CLEAR_TASK_ON_LAUNCH:I = 0x4 .field public static final FLAG_EXCLUDE_FROM_RECENTS:I = 0x20 .field public static final FLAG_FINISH_ON_CLOSE_SYSTEM_DIALOGS:I = 0x100 .field public static final FLAG_FINISH_ON_TASK_LAUNCH:I = 0x2 .field public static final FLAG_HARDWARE_ACCELERATED:I = 0x200 .field public static final FLAG_IMMERSIVE:I = 0x800 .field public static final FLAG_MULTIPROCESS:I = 0x1 .field public static final FLAG_NO_HISTORY:I = 0x80 .field public static final FLAG_PRIMARY_USER_ONLY:I = 0x20000000 .field public static final FLAG_RELINQUISH_TASK_IDENTITY:I = 0x1000 .field public static final FLAG_RESUME_WHILE_PAUSING:I = 0x4000 .field public static final FLAG_SHOW_ON_LOCK_SCREEN:I = 0x400 .field public static final FLAG_SINGLE_USER:I = 0x40000000 .field public static final FLAG_STATE_NOT_NEEDED:I = 0x10 .field public static final LAUNCH_MULTIPLE:I = 0x0 .field public static final LAUNCH_SINGLE_INSTANCE:I = 0x3 .field public static final LAUNCH_SINGLE_TASK:I = 0x2 .field public static final LAUNCH_SINGLE_TOP:I = 0x1 .field public static final PERSIST_ACROSS_REBOOTS:I = 0x2 .field public static final PERSIST_NEVER:I = 0x1 .field public static final PERSIST_ROOT_ONLY:I = 0x0 .field public static final SCREEN_ORIENTATION_BEHIND:I = 0x3 .field public static final SCREEN_ORIENTATION_FULL_SENSOR:I = 0xa .field public static final SCREEN_ORIENTATION_FULL_USER:I = 0xd .field public static final SCREEN_ORIENTATION_LANDSCAPE:I = 0x0 .field public static final SCREEN_ORIENTATION_LOCKED:I = 0xe .field public static final SCREEN_ORIENTATION_NOSENSOR:I = 0x5 .field public static final SCREEN_ORIENTATION_PORTRAIT:I = 0x1 .field public static final SCREEN_ORIENTATION_REVERSE_LANDSCAPE:I = 0x8 .field public static final SCREEN_ORIENTATION_REVERSE_PORTRAIT:I = 0x9 .field public static final SCREEN_ORIENTATION_SENSOR:I = 0x4 .field public static final SCREEN_ORIENTATION_SENSOR_LANDSCAPE:I = 0x6 .field public static final SCREEN_ORIENTATION_SENSOR_PORTRAIT:I = 0x7 .field public static final SCREEN_ORIENTATION_UNSPECIFIED:I = -0x1 .field public static final SCREEN_ORIENTATION_USER:I = 0x2 .field public static final SCREEN_ORIENTATION_USER_LANDSCAPE:I = 0xb .field public static final SCREEN_ORIENTATION_USER_PORTRAIT:I = 0xc .field public static final UIOPTION_SPLIT_ACTION_BAR_WHEN_NARROW:I = 0x1 # instance fields .field public mFlymeActivityInfo:Landroid/content/ActivityInfoExt; .field public configChanges:I .field public documentLaunchMode:I .field public flags:I .field public launchMode:I .field public maxRecents:I .field public parentActivityName:Ljava/lang/String; .field public permission:Ljava/lang/String; .field public persistableMode:I .field public screenOrientation:I .field public softInputMode:I .field public targetActivity:Ljava/lang/String; .field public taskAffinity:Ljava/lang/String; .field public theme:I .field public uiOptions:I # direct methods .method static constructor <clinit>()V .locals 1 .prologue .line 567 const/16 v0, 0xe new-array v0, v0, [I fill-array-data v0, :array_0 sput-object v0, Landroid/content/pm/ActivityInfo;->CONFIG_NATIVE_BITS:[I .line 749 new-instance v0, Landroid/content/pm/ActivityInfo$1; invoke-direct {v0}, Landroid/content/pm/ActivityInfo$1;-><init>()V sput-object v0, Landroid/content/pm/ActivityInfo;->CREATOR:Landroid/os/Parcelable$Creator; return-void .line 567 nop :array_0 .array-data 4 0x2 0x1 0x4 0x8 0x10 0x20 0x40 0x80 0x800 0x1000 0x200 0x2000 0x100 0x4000 .end array-data .end method .method public constructor <init>()V .locals 1 .prologue invoke-direct {p0}, Landroid/content/pm/ComponentInfo;-><init>()V const/4 v0, -0x1 iput v0, p0, Landroid/content/pm/ActivityInfo;->screenOrientation:I const/4 v0, 0x0 iput v0, p0, Landroid/content/pm/ActivityInfo;->uiOptions:I invoke-static/range {p0 .. p0}, Landroid/content/pm/ActivityInfo$FlymeInjector;->createFlymeActivityInfo(Landroid/content/pm/ActivityInfo;)V return-void .end method .method public constructor <init>(Landroid/content/pm/ActivityInfo;)V .locals 1 .param p1, "orig" # Landroid/content/pm/ActivityInfo; .prologue invoke-direct {p0, p1}, Landroid/content/pm/ComponentInfo;-><init>(Landroid/content/pm/ComponentInfo;)V const/4 v0, -0x1 iput v0, p0, Landroid/content/pm/ActivityInfo;->screenOrientation:I const/4 v0, 0x0 iput v0, p0, Landroid/content/pm/ActivityInfo;->uiOptions:I iget v0, p1, Landroid/content/pm/ActivityInfo;->theme:I iput v0, p0, Landroid/content/pm/ActivityInfo;->theme:I iget v0, p1, Landroid/content/pm/ActivityInfo;->launchMode:I iput v0, p0, Landroid/content/pm/ActivityInfo;->launchMode:I iget-object v0, p1, Landroid/content/pm/ActivityInfo;->permission:Ljava/lang/String; iput-object v0, p0, Landroid/content/pm/ActivityInfo;->permission:Ljava/lang/String; iget-object v0, p1, Landroid/content/pm/ActivityInfo;->taskAffinity:Ljava/lang/String; iput-object v0, p0, Landroid/content/pm/ActivityInfo;->taskAffinity:Ljava/lang/String; iget-object v0, p1, Landroid/content/pm/ActivityInfo;->targetActivity:Ljava/lang/String; iput-object v0, p0, Landroid/content/pm/ActivityInfo;->targetActivity:Ljava/lang/String; iget v0, p1, Landroid/content/pm/ActivityInfo;->flags:I iput v0, p0, Landroid/content/pm/ActivityInfo;->flags:I iget v0, p1, Landroid/content/pm/ActivityInfo;->screenOrientation:I iput v0, p0, Landroid/content/pm/ActivityInfo;->screenOrientation:I iget v0, p1, Landroid/content/pm/ActivityInfo;->configChanges:I iput v0, p0, Landroid/content/pm/ActivityInfo;->configChanges:I iget v0, p1, Landroid/content/pm/ActivityInfo;->softInputMode:I iput v0, p0, Landroid/content/pm/ActivityInfo;->softInputMode:I iget v0, p1, Landroid/content/pm/ActivityInfo;->uiOptions:I iput v0, p0, Landroid/content/pm/ActivityInfo;->uiOptions:I iget-object v0, p1, Landroid/content/pm/ActivityInfo;->parentActivityName:Ljava/lang/String; iput-object v0, p0, Landroid/content/pm/ActivityInfo;->parentActivityName:Ljava/lang/String; iget v0, p1, Landroid/content/pm/ActivityInfo;->maxRecents:I iput v0, p0, Landroid/content/pm/ActivityInfo;->maxRecents:I invoke-static/range {p0 .. p1}, Landroid/content/pm/ActivityInfo$FlymeInjector;->copyFromActivityInfo(Landroid/content/pm/ActivityInfo;Landroid/content/pm/ActivityInfo;)V return-void .end method .method private constructor <init>(Landroid/os/Parcel;)V .locals 1 .param p1, "source" # Landroid/os/Parcel; .prologue invoke-direct {p0, p1}, Landroid/content/pm/ComponentInfo;-><init>(Landroid/os/Parcel;)V const/4 v0, -0x1 iput v0, p0, Landroid/content/pm/ActivityInfo;->screenOrientation:I const/4 v0, 0x0 iput v0, p0, Landroid/content/pm/ActivityInfo;->uiOptions:I invoke-virtual {p1}, Landroid/os/Parcel;->readInt()I move-result v0 iput v0, p0, Landroid/content/pm/ActivityInfo;->theme:I invoke-virtual {p1}, Landroid/os/Parcel;->readInt()I move-result v0 iput v0, p0, Landroid/content/pm/ActivityInfo;->launchMode:I invoke-virtual {p1}, Landroid/os/Parcel;->readString()Ljava/lang/String; move-result-object v0 iput-object v0, p0, Landroid/content/pm/ActivityInfo;->permission:Ljava/lang/String; invoke-virtual {p1}, Landroid/os/Parcel;->readString()Ljava/lang/String; move-result-object v0 iput-object v0, p0, Landroid/content/pm/ActivityInfo;->taskAffinity:Ljava/lang/String; invoke-virtual {p1}, Landroid/os/Parcel;->readString()Ljava/lang/String; move-result-object v0 iput-object v0, p0, Landroid/content/pm/ActivityInfo;->targetActivity:Ljava/lang/String; invoke-virtual {p1}, Landroid/os/Parcel;->readInt()I move-result v0 iput v0, p0, Landroid/content/pm/ActivityInfo;->flags:I invoke-virtual {p1}, Landroid/os/Parcel;->readInt()I move-result v0 iput v0, p0, Landroid/content/pm/ActivityInfo;->screenOrientation:I invoke-virtual {p1}, Landroid/os/Parcel;->readInt()I move-result v0 iput v0, p0, Landroid/content/pm/ActivityInfo;->configChanges:I invoke-virtual {p1}, Landroid/os/Parcel;->readInt()I move-result v0 iput v0, p0, Landroid/content/pm/ActivityInfo;->softInputMode:I invoke-virtual {p1}, Landroid/os/Parcel;->readInt()I move-result v0 iput v0, p0, Landroid/content/pm/ActivityInfo;->uiOptions:I invoke-virtual {p1}, Landroid/os/Parcel;->readString()Ljava/lang/String; move-result-object v0 iput-object v0, p0, Landroid/content/pm/ActivityInfo;->parentActivityName:Ljava/lang/String; invoke-virtual {p1}, Landroid/os/Parcel;->readInt()I move-result v0 iput v0, p0, Landroid/content/pm/ActivityInfo;->persistableMode:I invoke-virtual {p1}, Landroid/os/Parcel;->readInt()I move-result v0 iput v0, p0, Landroid/content/pm/ActivityInfo;->maxRecents:I invoke-static/range {p0 .. p1}, Landroid/content/pm/ActivityInfo$FlymeInjector;->readFromParcel(Landroid/content/pm/ActivityInfo;Landroid/os/Parcel;)V return-void .end method .method synthetic constructor <init>(Landroid/os/Parcel;Landroid/content/pm/ActivityInfo$1;)V .locals 0 .param p1, "x0" # Landroid/os/Parcel; .param p2, "x1" # Landroid/content/pm/ActivityInfo$1; .prologue .line 34 invoke-direct {p0, p1}, Landroid/content/pm/ActivityInfo;-><init>(Landroid/os/Parcel;)V return-void .end method .method public static activityInfoConfigToNative(I)I .locals 3 .param p0, "input" # I .prologue .line 587 const/4 v1, 0x0 .line 588 .local v1, "output":I const/4 v0, 0x0 .local v0, "i":I :goto_0 sget-object v2, Landroid/content/pm/ActivityInfo;->CONFIG_NATIVE_BITS:[I array-length v2, v2 if-ge v0, v2, :cond_1 .line 589 const/4 v2, 0x1 shl-int/2addr v2, v0 and-int/2addr v2, p0 if-eqz v2, :cond_0 .line 590 sget-object v2, Landroid/content/pm/ActivityInfo;->CONFIG_NATIVE_BITS:[I aget v2, v2, v0 or-int/2addr v1, v2 .line 588 :cond_0 add-int/lit8 v0, v0, 0x1 goto :goto_0 .line 593 :cond_1 return v1 .end method .method private persistableModeToString()Ljava/lang/String; .locals 2 .prologue .line 689 iget v0, p0, Landroid/content/pm/ActivityInfo;->persistableMode:I packed-switch v0, :pswitch_data_0 .line 693 new-instance v0, Ljava/lang/StringBuilder; invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V const-string v1, "UNKNOWN=" invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 iget v1, p0, Landroid/content/pm/ActivityInfo;->persistableMode:I invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder; move-result-object v0 invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v0 :goto_0 return-object v0 .line 690 :pswitch_0 const-string v0, "PERSIST_ROOT_ONLY" goto :goto_0 .line 691 :pswitch_1 const-string v0, "PERSIST_NEVER" goto :goto_0 .line 692 :pswitch_2 const-string v0, "PERSIST_ACROSS_REBOOTS" goto :goto_0 .line 689 :pswitch_data_0 .packed-switch 0x0 :pswitch_0 :pswitch_1 :pswitch_2 .end packed-switch .end method # virtual methods .method public describeContents()I .locals 1 .prologue .line 729 const/4 v0, 0x0 return v0 .end method .method public dump(Landroid/util/Printer;Ljava/lang/String;)V .locals 2 .param p1, "pw" # Landroid/util/Printer; .param p2, "prefix" # Ljava/lang/String; .prologue .line 698 invoke-super {p0, p1, p2}, Landroid/content/pm/ComponentInfo;->dumpFront(Landroid/util/Printer;Ljava/lang/String;)V .line 699 iget-object v0, p0, Landroid/content/pm/ActivityInfo;->permission:Ljava/lang/String; if-eqz v0, :cond_0 .line 700 new-instance v0, Ljava/lang/StringBuilder; invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 const-string/jumbo v1, "permission=" invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 iget-object v1, p0, Landroid/content/pm/ActivityInfo;->permission:Ljava/lang/String; invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v0 invoke-interface {p1, v0}, Landroid/util/Printer;->println(Ljava/lang/String;)V .line 702 :cond_0 new-instance v0, Ljava/lang/StringBuilder; invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 const-string/jumbo v1, "taskAffinity=" invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 iget-object v1, p0, Landroid/content/pm/ActivityInfo;->taskAffinity:Ljava/lang/String; invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 const-string v1, " targetActivity=" invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 iget-object v1, p0, Landroid/content/pm/ActivityInfo;->targetActivity:Ljava/lang/String; invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 const-string v1, " persistableMode=" invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 invoke-direct {p0}, Landroid/content/pm/ActivityInfo;->persistableModeToString()Ljava/lang/String; move-result-object v1 invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v0 invoke-interface {p1, v0}, Landroid/util/Printer;->println(Ljava/lang/String;)V .line 705 iget v0, p0, Landroid/content/pm/ActivityInfo;->launchMode:I if-nez v0, :cond_1 iget v0, p0, Landroid/content/pm/ActivityInfo;->flags:I if-nez v0, :cond_1 iget v0, p0, Landroid/content/pm/ActivityInfo;->theme:I if-eqz v0, :cond_2 .line 706 :cond_1 new-instance v0, Ljava/lang/StringBuilder; invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 const-string/jumbo v1, "launchMode=" invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 iget v1, p0, Landroid/content/pm/ActivityInfo;->launchMode:I invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder; move-result-object v0 const-string v1, " flags=0x" invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 iget v1, p0, Landroid/content/pm/ActivityInfo;->flags:I invoke-static {v1}, Ljava/lang/Integer;->toHexString(I)Ljava/lang/String; move-result-object v1 invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 const-string v1, " theme=0x" invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 iget v1, p0, Landroid/content/pm/ActivityInfo;->theme:I invoke-static {v1}, Ljava/lang/Integer;->toHexString(I)Ljava/lang/String; move-result-object v1 invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v0 invoke-interface {p1, v0}, Landroid/util/Printer;->println(Ljava/lang/String;)V .line 710 :cond_2 iget v0, p0, Landroid/content/pm/ActivityInfo;->screenOrientation:I const/4 v1, -0x1 if-ne v0, v1, :cond_3 iget v0, p0, Landroid/content/pm/ActivityInfo;->configChanges:I if-nez v0, :cond_3 iget v0, p0, Landroid/content/pm/ActivityInfo;->softInputMode:I if-eqz v0, :cond_4 .line 712 :cond_3 new-instance v0, Ljava/lang/StringBuilder; invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 const-string/jumbo v1, "screenOrientation=" invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 iget v1, p0, Landroid/content/pm/ActivityInfo;->screenOrientation:I invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder; move-result-object v0 const-string v1, " configChanges=0x" invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 iget v1, p0, Landroid/content/pm/ActivityInfo;->configChanges:I invoke-static {v1}, Ljava/lang/Integer;->toHexString(I)Ljava/lang/String; move-result-object v1 invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 const-string v1, " softInputMode=0x" invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 iget v1, p0, Landroid/content/pm/ActivityInfo;->softInputMode:I invoke-static {v1}, Ljava/lang/Integer;->toHexString(I)Ljava/lang/String; move-result-object v1 invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v0 invoke-interface {p1, v0}, Landroid/util/Printer;->println(Ljava/lang/String;)V .line 716 :cond_4 iget v0, p0, Landroid/content/pm/ActivityInfo;->uiOptions:I if-eqz v0, :cond_5 .line 717 new-instance v0, Ljava/lang/StringBuilder; invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 const-string v1, " uiOptions=0x" invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 iget v1, p0, Landroid/content/pm/ActivityInfo;->uiOptions:I invoke-static {v1}, Ljava/lang/Integer;->toHexString(I)Ljava/lang/String; move-result-object v1 invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v0 invoke-interface {p1, v0}, Landroid/util/Printer;->println(Ljava/lang/String;)V :cond_5 invoke-static/range {p0 .. p2}, Landroid/content/pm/ActivityInfo$FlymeInjector;->dumpsys(Landroid/content/pm/ActivityInfo;Landroid/util/Printer;Ljava/lang/String;)V invoke-super {p0, p1, p2}, Landroid/content/pm/ComponentInfo;->dumpBack(Landroid/util/Printer;Ljava/lang/String;)V return-void .end method .method public getRealConfigChanged()I .locals 2 .prologue .line 605 iget-object v0, p0, Landroid/content/pm/ActivityInfo;->applicationInfo:Landroid/content/pm/ApplicationInfo; iget v0, v0, Landroid/content/pm/ApplicationInfo;->targetSdkVersion:I const/16 v1, 0xd if-ge v0, v1, :cond_0 iget v0, p0, Landroid/content/pm/ActivityInfo;->configChanges:I or-int/lit16 v0, v0, 0x400 or-int/lit16 v0, v0, 0x800 :goto_0 return v0 :cond_0 iget v0, p0, Landroid/content/pm/ActivityInfo;->configChanges:I goto :goto_0 .end method .method public final getThemeResource()I .locals 1 .prologue .line 685 iget v0, p0, Landroid/content/pm/ActivityInfo;->theme:I if-eqz v0, :cond_0 iget v0, p0, Landroid/content/pm/ActivityInfo;->theme:I :goto_0 return v0 :cond_0 iget-object v0, p0, Landroid/content/pm/ActivityInfo;->applicationInfo:Landroid/content/pm/ApplicationInfo; iget v0, v0, Landroid/content/pm/ApplicationInfo;->theme:I goto :goto_0 .end method .method public toString()Ljava/lang/String; .locals 2 .prologue .line 723 new-instance v0, Ljava/lang/StringBuilder; invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V const-string v1, "ActivityInfo{" invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 invoke-static {p0}, Ljava/lang/System;->identityHashCode(Ljava/lang/Object;)I move-result v1 invoke-static {v1}, Ljava/lang/Integer;->toHexString(I)Ljava/lang/String; move-result-object v1 invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 const-string v1, " " invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 iget-object v1, p0, Landroid/content/pm/ActivityInfo;->name:Ljava/lang/String; invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 const-string/jumbo v1, "}" invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v0 return-object v0 .end method .method public writeToParcel(Landroid/os/Parcel;I)V .locals 1 .param p1, "dest" # Landroid/os/Parcel; .param p2, "parcelableFlags" # I .prologue invoke-super {p0, p1, p2}, Landroid/content/pm/ComponentInfo;->writeToParcel(Landroid/os/Parcel;I)V iget v0, p0, Landroid/content/pm/ActivityInfo;->theme:I invoke-virtual {p1, v0}, Landroid/os/Parcel;->writeInt(I)V iget v0, p0, Landroid/content/pm/ActivityInfo;->launchMode:I invoke-virtual {p1, v0}, Landroid/os/Parcel;->writeInt(I)V iget-object v0, p0, Landroid/content/pm/ActivityInfo;->permission:Ljava/lang/String; invoke-virtual {p1, v0}, Landroid/os/Parcel;->writeString(Ljava/lang/String;)V iget-object v0, p0, Landroid/content/pm/ActivityInfo;->taskAffinity:Ljava/lang/String; invoke-virtual {p1, v0}, Landroid/os/Parcel;->writeString(Ljava/lang/String;)V iget-object v0, p0, Landroid/content/pm/ActivityInfo;->targetActivity:Ljava/lang/String; invoke-virtual {p1, v0}, Landroid/os/Parcel;->writeString(Ljava/lang/String;)V iget v0, p0, Landroid/content/pm/ActivityInfo;->flags:I invoke-virtual {p1, v0}, Landroid/os/Parcel;->writeInt(I)V iget v0, p0, Landroid/content/pm/ActivityInfo;->screenOrientation:I invoke-virtual {p1, v0}, Landroid/os/Parcel;->writeInt(I)V iget v0, p0, Landroid/content/pm/ActivityInfo;->configChanges:I invoke-virtual {p1, v0}, Landroid/os/Parcel;->writeInt(I)V iget v0, p0, Landroid/content/pm/ActivityInfo;->softInputMode:I invoke-virtual {p1, v0}, Landroid/os/Parcel;->writeInt(I)V iget v0, p0, Landroid/content/pm/ActivityInfo;->uiOptions:I invoke-virtual {p1, v0}, Landroid/os/Parcel;->writeInt(I)V iget-object v0, p0, Landroid/content/pm/ActivityInfo;->parentActivityName:Ljava/lang/String; invoke-virtual {p1, v0}, Landroid/os/Parcel;->writeString(Ljava/lang/String;)V iget v0, p0, Landroid/content/pm/ActivityInfo;->persistableMode:I invoke-virtual {p1, v0}, Landroid/os/Parcel;->writeInt(I)V iget v0, p0, Landroid/content/pm/ActivityInfo;->maxRecents:I invoke-virtual {p1, v0}, Landroid/os/Parcel;->writeInt(I)V invoke-static/range {p0 .. p1}, Landroid/content/pm/ActivityInfo$FlymeInjector;->writeToParcel(Landroid/content/pm/ActivityInfo;Landroid/os/Parcel;)V return-void .end method
{ "content_hash": "9d7b6aad9fb7a784f7a59edfcb5482b8", "timestamp": "", "source": "github", "line_count": 1006, "max_line_length": 174, "avg_line_length": 27.406560636182903, "alnum_prop": 0.7140836386057814, "repo_name": "shumxin/FlymeOS_A5DUG", "id": "3d5ed6a8666606ee9a90f04fb2e3570063a18912", "size": "27571", "binary": false, "copies": "1", "ref": "refs/heads/lollipop-5.0", "path": "framework.jar.out/smali/android/content/pm/ActivityInfo.smali", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "GLSL", "bytes": "1500" }, { "name": "HTML", "bytes": "96769" }, { "name": "Makefile", "bytes": "13678" }, { "name": "Shell", "bytes": "103420" }, { "name": "Smali", "bytes": "189389087" } ], "symlink_target": "" }
ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
{ "content_hash": "f913cc91052c3bb117c53b9187bfc9e1", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 31, "avg_line_length": 9.692307692307692, "alnum_prop": 0.7063492063492064, "repo_name": "mdoering/backbone", "id": "c88b81e435bf912d5a72ca232e6bbaae7122650e", "size": "175", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Sapindales/Anacardiaceae/Rhus/Rhus argyrophylla/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
<?php use Magento\TestFramework\Helper\Bootstrap; /** @var \Magento\Framework\Registry $registry */ $registry = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\Registry'); $registry->unregister('isSecureArea'); $registry->register('isSecureArea', true); /** @var \Magento\Catalog\Model\Category $category */ $category = Bootstrap::getObjectManager()->get('Magento\Catalog\Model\Category'); $category = $category->loadByAttribute('url_key', 'test-category-name'); if ($category && $category->getId()) { $category->delete(); }
{ "content_hash": "204965fa8ab2b63e987a0a9d9061ff4d", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 107, "avg_line_length": 35.5625, "alnum_prop": 0.7293497363796133, "repo_name": "florentinaa/magento", "id": "f3aa903b157267964baa54d1f6b08d2950da0493", "size": "667", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "store/dev/tests/integration/testsuite/Magento/Catalog/Model/Category/_files/service_category_create_rollback.php", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "23874" }, { "name": "CSS", "bytes": "3779785" }, { "name": "HTML", "bytes": "6149486" }, { "name": "JavaScript", "bytes": "4396691" }, { "name": "PHP", "bytes": "22079463" }, { "name": "Shell", "bytes": "6072" }, { "name": "XSLT", "bytes": "19889" } ], "symlink_target": "" }
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/analytics/admin/v1alpha/analytics_admin.proto package com.google.analytics.admin.v1alpha; public interface GetUserLinkRequestOrBuilder extends // @@protoc_insertion_point(interface_extends:google.analytics.admin.v1alpha.GetUserLinkRequest) com.google.protobuf.MessageOrBuilder { /** * * * <pre> * Required. Example format: accounts/1234/userLinks/5678 * </pre> * * <code> * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } * </code> * * @return The name. */ java.lang.String getName(); /** * * * <pre> * Required. Example format: accounts/1234/userLinks/5678 * </pre> * * <code> * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } * </code> * * @return The bytes for name. */ com.google.protobuf.ByteString getNameBytes(); }
{ "content_hash": "c22a5fd07f5e8a21da337d9f76cd5aa5", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 105, "avg_line_length": 25.05, "alnum_prop": 0.6437125748502994, "repo_name": "googleapis/google-cloud-java", "id": "b9a664810f250cc840bd688d4543df6e0a1f35c1", "size": "1596", "binary": false, "copies": "2", "ref": "refs/heads/main", "path": "java-analytics-admin/proto-google-analytics-admin-v1alpha/src/main/java/com/google/analytics/admin/v1alpha/GetUserLinkRequestOrBuilder.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Dockerfile", "bytes": "2614" }, { "name": "HCL", "bytes": "28592" }, { "name": "Java", "bytes": "826434232" }, { "name": "Jinja", "bytes": "2292" }, { "name": "Python", "bytes": "200408" }, { "name": "Shell", "bytes": "97954" } ], "symlink_target": "" }
using System.Numerics; namespace Myra.Platform { public struct TouchLocation { public Vector2 Position { get; set; } } }
{ "content_hash": "3c29dddacf8f258ca2bdb1903166cc94", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 39, "avg_line_length": 14.222222222222221, "alnum_prop": 0.71875, "repo_name": "rds1983/Myra", "id": "debd1f0285a280ac451500f909500566e8e33b18", "size": "130", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Myra/Platform/TouchLocation.cs", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "60" }, { "name": "C#", "bytes": "637845" }, { "name": "PowerShell", "bytes": "3040" } ], "symlink_target": "" }
import BaseHTTPServer import os.path from mimetypes import MimeTypes from urlparse import urlparse mime = MimeTypes() class Handler( BaseHTTPServer.BaseHTTPRequestHandler ): def do_GET( self ): path = urlparse('client' + self.path).path if not os.path.isfile(path): path = 'client/index.html' self.send_response(200) self.send_header( 'Content-type', mime.guess_type(path)[0] ) self.end_headers() self.wfile.write( open(path).read() ) httpd = BaseHTTPServer.HTTPServer( ('127.0.0.1', 9999), Handler ) httpd.serve_forever()
{ "content_hash": "fbc1b59d7e3401fa0606bda8ab179c9f", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 68, "avg_line_length": 31.05263157894737, "alnum_prop": 0.6677966101694915, "repo_name": "demerzel3/desmond", "id": "04726a237e75e55e556c651821b231b33246b6a3", "size": "613", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "server.py", "mode": "33261", "license": "mit", "language": [ { "name": "CSS", "bytes": "6746" }, { "name": "HTML", "bytes": "21698" }, { "name": "JavaScript", "bytes": "107815" }, { "name": "Puppet", "bytes": "289" }, { "name": "Python", "bytes": "613" }, { "name": "Shell", "bytes": "78" } ], "symlink_target": "" }
package org.ldp4j.rdf; import java.net.URI; public final class URIRef extends Resource<URI> { URIRef(URI uri) { super(uri); } @Override public int hashCode() { return super.hashCode()*19; } @Override public boolean equals(Object o) { return (o instanceof URIRef) && super.equals(o); } @Override public int compareTo(Node o) { if(o==null) { return 1; } if(o==this) { return 0; } if(o instanceof BlankNode|| o instanceof Literal) { return -1; } return getIdentity().toString().compareTo(((URIRef)o).getIdentity().toString()); } @Override public String toString() { StringBuilder builder = new StringBuilder(); builder.append("<").append(getIdentity()).append(">"); return builder.toString(); } @Override public <T> T accept(NodeVisitor<T> visitor, T defaultValue) { return visitor.visitURIRef(this, defaultValue); } }
{ "content_hash": "8a1f60c2f470a77b493eb71e93f57641", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 82, "avg_line_length": 17.979591836734695, "alnum_prop": 0.6696935300794552, "repo_name": "ldp4j/ldp4j", "id": "2400644a84ece95676400d66997ae89b4ff51f57", "size": "2169", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "commons/rmf/api/src/main/java/org/ldp4j/rdf/URIRef.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "FreeMarker", "bytes": "3943" }, { "name": "Java", "bytes": "4041733" }, { "name": "Shell", "bytes": "7259" } ], "symlink_target": "" }
package wallet import ( "fmt" "math" "github.com/NebulousLabs/Sia/modules" "github.com/NebulousLabs/Sia/types" "github.com/NebulousLabs/bolt" ) // threadedResetSubscriptions unsubscribes the wallet from the consensus set and transaction pool // and subscribes again. func (w *Wallet) threadedResetSubscriptions() error { if !w.scanLock.TryLock() { return errScanInProgress } defer w.scanLock.Unlock() w.cs.Unsubscribe(w) w.tpool.Unsubscribe(w) err := w.cs.ConsensusSetSubscribe(w, modules.ConsensusChangeBeginning) if err != nil { return err } w.tpool.TransactionPoolSubscribe(w) return nil } // advanceSeedLookahead generates all keys from the current primary seed progress up to index // and adds them to the set of spendable keys. Therefore the new primary seed progress will // be index+1 and new lookahead keys will be generated starting from index+1 // Returns true if a blockchain rescan is required func (w *Wallet) advanceSeedLookahead(index uint64) (bool, error) { progress, err := dbGetPrimarySeedProgress(w.dbTx) if err != nil { return false, err } newProgress := index + 1 // Add spendable keys and remove them from lookahead spendableKeys := generateKeys(w.primarySeed, progress, newProgress-progress) for _, key := range spendableKeys { w.keys[key.UnlockConditions.UnlockHash()] = key delete(w.lookahead, key.UnlockConditions.UnlockHash()) } // Update the primarySeedProgress dbPutPrimarySeedProgress(w.dbTx, newProgress) if err != nil { return false, err } // Regenerate lookahead w.regenerateLookahead(newProgress) // If more than lookaheadRescanThreshold keys were generated // also initialize a rescan just to be safe. if uint64(len(spendableKeys)) > lookaheadRescanThreshold { return true, nil } return false, nil } // isWalletAddress is a helper function that checks if an UnlockHash is // derived from one of the wallet's spendable keys or future keys. func (w *Wallet) isWalletAddress(uh types.UnlockHash) bool { _, exists := w.keys[uh] return exists } // updateLookahead uses a consensus change to update the seed progress if one of the outputs // contains an unlock hash of the lookahead set. Returns true if a blockchain rescan is required func (w *Wallet) updateLookahead(tx *bolt.Tx, cc modules.ConsensusChange) (bool, error) { var largestIndex uint64 for _, diff := range cc.SiacoinOutputDiffs { if index, ok := w.lookahead[diff.SiacoinOutput.UnlockHash]; ok { if index > largestIndex { largestIndex = index } } } for _, diff := range cc.SiafundOutputDiffs { if index, ok := w.lookahead[diff.SiafundOutput.UnlockHash]; ok { if index > largestIndex { largestIndex = index } } } if largestIndex > 0 { return w.advanceSeedLookahead(largestIndex) } return false, nil } // updateConfirmedSet uses a consensus change to update the confirmed set of // outputs as understood by the wallet. func (w *Wallet) updateConfirmedSet(tx *bolt.Tx, cc modules.ConsensusChange) error { for _, diff := range cc.SiacoinOutputDiffs { // Verify that the diff is relevant to the wallet. if !w.isWalletAddress(diff.SiacoinOutput.UnlockHash) { continue } var err error if diff.Direction == modules.DiffApply { w.log.Println("Wallet has gained a spendable siacoin output:", diff.ID, "::", diff.SiacoinOutput.Value.HumanString()) err = dbPutSiacoinOutput(tx, diff.ID, diff.SiacoinOutput) } else { w.log.Println("Wallet has lost a spendable siacoin output:", diff.ID, "::", diff.SiacoinOutput.Value.HumanString()) err = dbDeleteSiacoinOutput(tx, diff.ID) } if err != nil { w.log.Severe("Could not update siacoin output:", err) } } for _, diff := range cc.SiafundOutputDiffs { // Verify that the diff is relevant to the wallet. if !w.isWalletAddress(diff.SiafundOutput.UnlockHash) { continue } var err error if diff.Direction == modules.DiffApply { w.log.Println("Wallet has gained a spendable siafund output:", diff.ID, "::", diff.SiafundOutput.Value) err = dbPutSiafundOutput(tx, diff.ID, diff.SiafundOutput) } else { w.log.Println("Wallet has lost a spendable siafund output:", diff.ID, "::", diff.SiafundOutput.Value) err = dbDeleteSiafundOutput(tx, diff.ID) } if err != nil { w.log.Severe("Could not update siafund output:", err) } } for _, diff := range cc.SiafundPoolDiffs { var err error if diff.Direction == modules.DiffApply { err = dbPutSiafundPool(tx, diff.Adjusted) } else { err = dbPutSiafundPool(tx, diff.Previous) } if err != nil { w.log.Severe("Could not update siafund pool:", err) } } return nil } // revertHistory reverts any transaction history that was destroyed by reverted // blocks in the consensus change. func (w *Wallet) revertHistory(tx *bolt.Tx, reverted []types.Block) error { for _, block := range reverted { // Remove any transactions that have been reverted. for i := len(block.Transactions) - 1; i >= 0; i-- { // If the transaction is relevant to the wallet, it will be the // most recent transaction in bucketProcessedTransactions. txid := block.Transactions[i].ID() pt, err := dbGetLastProcessedTransaction(tx) if err != nil { break // bucket is empty } if txid == pt.TransactionID { w.log.Println("A wallet transaction has been reverted due to a reorg:", txid) if err := dbDeleteLastProcessedTransaction(tx); err != nil { w.log.Severe("Could not revert transaction:", err) } } } // Remove the miner payout transaction if applicable. for i, mp := range block.MinerPayouts { if w.isWalletAddress(mp.UnlockHash) { w.log.Println("Miner payout has been reverted due to a reorg:", block.MinerPayoutID(uint64(i)), "::", mp.Value.HumanString()) if err := dbDeleteLastProcessedTransaction(tx); err != nil { w.log.Severe("Could not revert transaction:", err) } break // there will only ever be one miner transaction } } // decrement the consensus height if block.ID() != types.GenesisID { consensusHeight, err := dbGetConsensusHeight(tx) if err != nil { return err } err = dbPutConsensusHeight(tx, consensusHeight-1) if err != nil { return err } } } return nil } // applyHistory applies any transaction history that was introduced by the // applied blocks. func (w *Wallet) applyHistory(tx *bolt.Tx, cc modules.ConsensusChange) error { // compute spent outputs spentSiacoinOutputs := make(map[types.SiacoinOutputID]types.SiacoinOutput) spentSiafundOutputs := make(map[types.SiafundOutputID]types.SiafundOutput) for _, diff := range cc.SiacoinOutputDiffs { if diff.Direction == modules.DiffRevert { // revert means spent spentSiacoinOutputs[diff.ID] = diff.SiacoinOutput } } for _, diff := range cc.SiafundOutputDiffs { if diff.Direction == modules.DiffRevert { // revert means spent spentSiafundOutputs[diff.ID] = diff.SiafundOutput } } for _, block := range cc.AppliedBlocks { consensusHeight, err := dbGetConsensusHeight(tx) if err != nil { return err } // increment the consensus height if block.ID() != types.GenesisID { consensusHeight++ err = dbPutConsensusHeight(tx, consensusHeight) if err != nil { return err } } relevant := false for _, mp := range block.MinerPayouts { relevant = relevant || w.isWalletAddress(mp.UnlockHash) } if relevant { w.log.Println("Wallet has received new miner payouts:", block.ID()) // Apply the miner payout transaction if applicable. minerPT := modules.ProcessedTransaction{ Transaction: types.Transaction{}, TransactionID: types.TransactionID(block.ID()), ConfirmationHeight: consensusHeight, ConfirmationTimestamp: block.Timestamp, } for i, mp := range block.MinerPayouts { w.log.Println("\tminer payout:", block.MinerPayoutID(uint64(i)), "::", mp.Value.HumanString()) minerPT.Outputs = append(minerPT.Outputs, modules.ProcessedOutput{ ID: types.OutputID(block.MinerPayoutID(uint64(i))), FundType: types.SpecifierMinerPayout, MaturityHeight: consensusHeight + types.MaturityDelay, WalletAddress: w.isWalletAddress(mp.UnlockHash), RelatedAddress: mp.UnlockHash, Value: mp.Value, }) } err := dbAppendProcessedTransaction(tx, minerPT) if err != nil { return fmt.Errorf("could not put processed miner transaction: %v", err) } } for _, txn := range block.Transactions { // determine if transaction is relevant relevant := false for _, sci := range txn.SiacoinInputs { relevant = relevant || w.isWalletAddress(sci.UnlockConditions.UnlockHash()) } for _, sco := range txn.SiacoinOutputs { relevant = relevant || w.isWalletAddress(sco.UnlockHash) } for _, sfi := range txn.SiafundInputs { relevant = relevant || w.isWalletAddress(sfi.UnlockConditions.UnlockHash()) } for _, sfo := range txn.SiafundOutputs { relevant = relevant || w.isWalletAddress(sfo.UnlockHash) } // only create a ProcessedTransaction if txn is relevant if !relevant { continue } w.log.Println("A transaction has been confirmed on the blockchain:", txn.ID()) pt := modules.ProcessedTransaction{ Transaction: txn, TransactionID: txn.ID(), ConfirmationHeight: consensusHeight, ConfirmationTimestamp: block.Timestamp, } for _, sci := range txn.SiacoinInputs { pi := modules.ProcessedInput{ ParentID: types.OutputID(sci.ParentID), FundType: types.SpecifierSiacoinInput, WalletAddress: w.isWalletAddress(sci.UnlockConditions.UnlockHash()), RelatedAddress: sci.UnlockConditions.UnlockHash(), Value: spentSiacoinOutputs[sci.ParentID].Value, } pt.Inputs = append(pt.Inputs, pi) // Log any wallet-relevant inputs. if pi.WalletAddress { w.log.Println("\tSiacoin Input:", pi.ParentID, "::", pi.Value.HumanString()) } } for i, sco := range txn.SiacoinOutputs { po := modules.ProcessedOutput{ ID: types.OutputID(txn.SiacoinOutputID(uint64(i))), FundType: types.SpecifierSiacoinOutput, MaturityHeight: consensusHeight, WalletAddress: w.isWalletAddress(sco.UnlockHash), RelatedAddress: sco.UnlockHash, Value: sco.Value, } pt.Outputs = append(pt.Outputs, po) // Log any wallet-relevant outputs. if po.WalletAddress { w.log.Println("\tSiacoin Output:", po.ID, "::", po.Value.HumanString()) } } for _, sfi := range txn.SiafundInputs { pi := modules.ProcessedInput{ ParentID: types.OutputID(sfi.ParentID), FundType: types.SpecifierSiafundInput, WalletAddress: w.isWalletAddress(sfi.UnlockConditions.UnlockHash()), RelatedAddress: sfi.UnlockConditions.UnlockHash(), Value: spentSiafundOutputs[sfi.ParentID].Value, } pt.Inputs = append(pt.Inputs, pi) // Log any wallet-relevant inputs. if pi.WalletAddress { w.log.Println("\tSiafund Input:", pi.ParentID, "::", pi.Value.HumanString()) } siafundPool, err := dbGetSiafundPool(w.dbTx) if err != nil { return fmt.Errorf("could not get siafund pool: %v", err) } sfo := spentSiafundOutputs[sfi.ParentID] po := modules.ProcessedOutput{ ID: types.OutputID(sfi.ParentID), FundType: types.SpecifierClaimOutput, MaturityHeight: consensusHeight + types.MaturityDelay, WalletAddress: w.isWalletAddress(sfi.UnlockConditions.UnlockHash()), RelatedAddress: sfi.ClaimUnlockHash, Value: siafundPool.Sub(sfo.ClaimStart).Mul(sfo.Value), } pt.Outputs = append(pt.Outputs, po) // Log any wallet-relevant outputs. if po.WalletAddress { w.log.Println("\tClaim Output:", po.ID, "::", po.Value.HumanString()) } } for i, sfo := range txn.SiafundOutputs { po := modules.ProcessedOutput{ ID: types.OutputID(txn.SiafundOutputID(uint64(i))), FundType: types.SpecifierSiafundOutput, MaturityHeight: consensusHeight, WalletAddress: w.isWalletAddress(sfo.UnlockHash), RelatedAddress: sfo.UnlockHash, Value: sfo.Value, } pt.Outputs = append(pt.Outputs, po) // Log any wallet-relevant outputs. if po.WalletAddress { w.log.Println("\tSiafund Output:", po.ID, "::", po.Value.HumanString()) } } for _, fee := range txn.MinerFees { pt.Outputs = append(pt.Outputs, modules.ProcessedOutput{ FundType: types.SpecifierMinerFee, Value: fee, }) } err := dbAppendProcessedTransaction(tx, pt) if err != nil { return fmt.Errorf("could not put processed transaction: %v", err) } } } return nil } // ProcessConsensusChange parses a consensus change to update the set of // confirmed outputs known to the wallet. func (w *Wallet) ProcessConsensusChange(cc modules.ConsensusChange) { w.mu.Lock() defer w.mu.Unlock() if needRescan, err := w.updateLookahead(w.dbTx, cc); err != nil { w.log.Println("ERROR: failed to update lookahead:", err) } else if needRescan { go w.threadedResetSubscriptions() } if err := w.updateConfirmedSet(w.dbTx, cc); err != nil { w.log.Println("ERROR: failed to update confirmed set:", err) } if err := w.revertHistory(w.dbTx, cc.RevertedBlocks); err != nil { w.log.Println("ERROR: failed to revert consensus change:", err) } if err := w.applyHistory(w.dbTx, cc); err != nil { w.log.Println("ERROR: failed to apply consensus change:", err) } if err := dbPutConsensusChangeID(w.dbTx, cc.ID); err != nil { w.log.Println("ERROR: failed to update consensus change ID:", err) } if cc.Synced { go w.threadedDefragWallet() } } // ReceiveUpdatedUnconfirmedTransactions updates the wallet's unconfirmed // transaction set. func (w *Wallet) ReceiveUpdatedUnconfirmedTransactions(diff *modules.TransactionPoolDiff) { w.mu.Lock() defer w.mu.Unlock() // Do the pruning first. If there are any pruned transactions, we will need // to re-allocate the whole processed transactions array. droppedTransactions := make(map[types.TransactionID]struct{}) for i := range diff.RevertedTransactions { txids := w.unconfirmedSets[diff.RevertedTransactions[i]] for i := range txids { droppedTransactions[txids[i]] = struct{}{} } delete(w.unconfirmedSets, diff.RevertedTransactions[i]) } // Skip the reallocation if we can, otherwise reallocate the // unconfirmedProcessedTransactions to no longer have the dropped // transactions. if len(droppedTransactions) != 0 { // Capacity can't be reduced, because we have no way of knowing if the // dropped transactions are relevant to the wallet or not, and some will // not be relevant to the wallet, meaning they don't have a counterpart // in w.unconfirmedProcessedTransactions. newUPT := make([]modules.ProcessedTransaction, 0, len(w.unconfirmedProcessedTransactions)) for _, txn := range w.unconfirmedProcessedTransactions { _, exists := droppedTransactions[txn.TransactionID] if !exists { // Transaction was not dropped, add it to the new unconfirmed // transactions. newUPT = append(newUPT, txn) } } // Set the unconfirmed preocessed transactions to the pruned set. w.unconfirmedProcessedTransactions = newUPT } // Scroll through all of the diffs and add any new transactions. for _, unconfirmedTxnSet := range diff.AppliedTransactions { // Mark all of the transactions that appeared in this set. // // TODO: Technically only necessary to mark the ones that are relevant // to the wallet, but overhead should be low. w.unconfirmedSets[unconfirmedTxnSet.ID] = unconfirmedTxnSet.IDs // Get the values for the spent outputs. spentSiacoinOutputs := make(map[types.SiacoinOutputID]types.SiacoinOutput) for _, scod := range unconfirmedTxnSet.Change.SiacoinOutputDiffs { // Only need to grab the reverted ones, because only reverted ones // have the possibility of having been spent. if scod.Direction == modules.DiffRevert { spentSiacoinOutputs[scod.ID] = scod.SiacoinOutput } } // Add each transaction to our set of unconfirmed transactions. for i, txn := range unconfirmedTxnSet.Transactions { // determine whether transaction is relevant to the wallet relevant := false for _, sci := range txn.SiacoinInputs { relevant = relevant || w.isWalletAddress(sci.UnlockConditions.UnlockHash()) } for _, sco := range txn.SiacoinOutputs { relevant = relevant || w.isWalletAddress(sco.UnlockHash) } // only create a ProcessedTransaction if txn is relevant if !relevant { continue } pt := modules.ProcessedTransaction{ Transaction: txn, TransactionID: unconfirmedTxnSet.IDs[i], ConfirmationHeight: types.BlockHeight(math.MaxUint64), ConfirmationTimestamp: types.Timestamp(math.MaxUint64), } for _, sci := range txn.SiacoinInputs { pt.Inputs = append(pt.Inputs, modules.ProcessedInput{ ParentID: types.OutputID(sci.ParentID), FundType: types.SpecifierSiacoinInput, WalletAddress: w.isWalletAddress(sci.UnlockConditions.UnlockHash()), RelatedAddress: sci.UnlockConditions.UnlockHash(), Value: spentSiacoinOutputs[sci.ParentID].Value, }) } for i, sco := range txn.SiacoinOutputs { pt.Outputs = append(pt.Outputs, modules.ProcessedOutput{ ID: types.OutputID(txn.SiacoinOutputID(uint64(i))), FundType: types.SpecifierSiacoinOutput, MaturityHeight: types.BlockHeight(math.MaxUint64), WalletAddress: w.isWalletAddress(sco.UnlockHash), RelatedAddress: sco.UnlockHash, Value: sco.Value, }) } for _, fee := range txn.MinerFees { pt.Outputs = append(pt.Outputs, modules.ProcessedOutput{ FundType: types.SpecifierMinerFee, Value: fee, }) } w.unconfirmedProcessedTransactions = append(w.unconfirmedProcessedTransactions, pt) } } }
{ "content_hash": "082a966e06502bc18e15740140ff32db", "timestamp": "", "source": "github", "line_count": 529, "max_line_length": 129, "avg_line_length": 34.04914933837429, "alnum_prop": 0.6951476793248945, "repo_name": "debian-go/sia", "id": "14f6e7252c74d2e98311a0c7bf00088db59d3cb5", "size": "18012", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "modules/wallet/update.go", "mode": "33188", "license": "mit", "language": [ { "name": "Go", "bytes": "2989179" }, { "name": "Makefile", "bytes": "4521" }, { "name": "Shell", "bytes": "1373" } ], "symlink_target": "" }
package DateTime::TimeZone::OlsonDB::Observance; $DateTime::TimeZone::OlsonDB::Observance::VERSION = '1.95'; use strict; use warnings; use DateTime::Duration; use DateTime::TimeZone::OlsonDB; use DateTime::TimeZone::OlsonDB::Change; use List::Util 1.33 qw( any first ); use Params::Validate qw( validate SCALAR ARRAYREF UNDEF OBJECT ); sub new { my $class = shift; my %p = validate( @_, { gmtoff => { type => SCALAR }, rules => { type => ARRAYREF }, format => { type => SCALAR }, until => { type => SCALAR, default => '' }, utc_start_datetime => { type => OBJECT | UNDEF }, offset_from_std => { type => SCALAR, default => 0 }, last_offset_from_utc => { type => SCALAR, default => 0 }, last_offset_from_std => { type => SCALAR, default => 0 }, } ); my $offset_from_utc; if ( $p{gmtoff} =~ /^([\+\-]?\d\d?)$/ ) { # From the Olson database's etcetera file: # # We use POSIX-style signs in the Zone names and the output # abbreviations, even though this is the opposite of what many people # expect. POSIX has positive signs west of Greenwich, but many people # expect positive signs east of Greenwich. For example, TZ='Etc/GMT+4' # uses the abbreviation "GMT+4" and corresponds to 4 hours behind UT # (i.e. west of Greenwich) even though many people would expect it to # mean 4 hours ahead of UT (i.e. east of Greenwich). $offset_from_utc = 3600 * $1 * -1; } else { $offset_from_utc = DateTime::TimeZone::offset_as_seconds( $p{gmtoff} ); } my $offset_from_std = DateTime::TimeZone::offset_as_seconds( $p{offset_from_std} ); my $last_offset_from_utc = delete $p{last_offset_from_utc}; my $last_offset_from_std = delete $p{last_offset_from_std}; my $self = bless { %p, offset_from_utc => $offset_from_utc, offset_from_std => $offset_from_std, until => [ split /\s+/, $p{until} ], }, $class; $self->{first_rule} = $self->_first_rule( $last_offset_from_utc, $last_offset_from_std ); if ( $p{utc_start_datetime} ) { $offset_from_std += $self->{first_rule}->offset_from_std if $self->{first_rule}; my $local_start_datetime = $p{utc_start_datetime}->clone; $local_start_datetime += DateTime::Duration->new( seconds => $offset_from_utc + $offset_from_std ); $self->{local_start_datetime} = $local_start_datetime; } return $self; } sub offset_from_utc { $_[0]->{offset_from_utc} || 0 } sub offset_from_std { $_[0]->{offset_from_std} || 0 } sub total_offset { $_[0]->offset_from_utc + $_[0]->offset_from_std } sub rules { @{ $_[0]->{rules} } } sub first_rule { $_[0]->{first_rule} } sub format { $_[0]->{format} } sub utc_start_datetime { $_[0]->{utc_start_datetime} } sub local_start_datetime { $_[0]->{local_start_datetime} } sub formatted_short_name { my $self = shift; my $letter = shift; my $format = $self->format; return $format unless $format =~ /%/; return sprintf( $format, $letter ); } sub expand_from_rules { my $self = shift; my $zone = shift; # real max is year + 1 so we include max year my $max_year = (shift) + 1; my $min_year; if ( $self->utc_start_datetime ) { $min_year = $self->utc_start_datetime->year; } else { # There is at least one time zone that has an infinite # observance, but that observance has rules that only start at # a certain point - Pacific/Chatham # In this case we just find the earliest rule and start there $min_year = ( sort { $a <=> $b } map { $_->min_year } $self->rules )[0]; } my $until = $self->until( $zone->last_change->offset_from_std ); if ($until) { $max_year = $until->year; } else { # Some zones, like Asia/Tehran, have a predefined fixed set of # rules that go well into the future (2037 for Asia/Tehran) my $max_rule_year = 0; foreach my $rule ( $self->rules ) { $max_rule_year = $rule->max_year if $rule->max_year && $rule->max_year > $max_rule_year; } $max_year = $max_rule_year if $max_rule_year > $max_year; } foreach my $year ( $min_year .. $max_year ) { my @rules = $self->_sorted_rules_for_year($year); for my $rule (@rules) { my $dt = $rule->utc_start_datetime_for_year( $year, $self->offset_from_utc, $zone->last_change->offset_from_std ); next if $self->utc_start_datetime && $dt <= $self->utc_start_datetime; my $until = $self->until( $zone->last_change->offset_from_std ); next if $until && $dt >= $until; my $change = DateTime::TimeZone::OlsonDB::Change->new( type => 'rule', utc_start_datetime => $dt, local_start_datetime => $dt + DateTime::Duration->new( seconds => $self->total_offset + $rule->offset_from_std ), short_name => $self->formatted_short_name( $rule->letter ), observance => $self, rule => $rule, ); if ($DateTime::TimeZone::OlsonDB::DEBUG) { print "Adding rule change ...\n"; $change->_debug_output; } $zone->add_change($change); } } } sub _sorted_rules_for_year { my $self = shift; my $year = shift; my @rules = ( map { $_->[0] } sort { $a->[1] <=> $b->[1] } map { my $dt = $_->utc_start_datetime_for_year( $year, $self->offset_from_utc, 0 ); [ $_, $dt ] } grep { $_->min_year <= $year && ( ( !$_->max_year ) || $_->max_year >= $year ) } $self->rules ); my %rules_by_month; for my $rule (@rules) { push @{ $rules_by_month{ $rule->month() } }, $rule; } # For horrible cases like Morocco, we have both a "max year" rule and a # "this year" rule for a given month's change. In that case, we want to # pick the more specific ("this year") rule, not apply both. my @final_rules; for my $month ( sort { $a <=> $b } keys %rules_by_month ) { my @r = @{ $rules_by_month{$month} }; if ( @r == 2 ) { my ($repeating) = grep { !defined $_->max_year() } @r; my ($this_year) = grep { $_->max_year() && $_->max_year() == $year } @r; if ( $repeating && $this_year ) { if ( $year == 2037 ) { # This is what zic seems to do but I have no idea why if ($DateTime::TimeZone::OlsonDB::DEBUG) { print "Found two rules for the same month, picking the max year one because this year is 2037\n"; } push @final_rules, $repeating; } else { if ($DateTime::TimeZone::OlsonDB::DEBUG) { print "Found two rules for the same month, picking the one for this year\n"; } push @final_rules, $this_year; } next; } push @final_rules, @r; } else { push @final_rules, @r; } } return @final_rules; } sub until { my $self = shift; my $offset_from_std = shift || $self->offset_from_std; return unless defined $self->until_year; my $utc = DateTime::TimeZone::OlsonDB::utc_datetime_for_time_spec( spec => $self->until_time_spec, year => $self->until_year, month => $self->until_month, day => $self->until_day, offset_from_utc => $self->offset_from_utc, offset_from_std => $offset_from_std, ); return $utc; } sub until_year { $_[0]->{until}[0] } sub until_month { ( defined $_[0]->{until}[1] ? $DateTime::TimeZone::OlsonDB::MONTHS{ $_[0]->{until}[1] } : 1 ); } sub until_day { ( defined $_[0]->{until}[2] ? DateTime::TimeZone::OlsonDB::parse_day_spec( $_[0]->{until}[2], $_[0]->until_month, $_[0]->until_year ) : 1 ); } sub until_time_spec { defined $_[0]->{until}[3] ? $_[0]->{until}[3] : '00:00:00'; } sub _first_rule { my $self = shift; my $last_offset_from_utc = shift; my $last_offset_from_std = shift; return unless $self->rules; my $date = $self->utc_start_datetime or return $self->_first_no_dst_rule; my @rules = $self->rules; my %possible_rules; my $year = $date->year; foreach my $rule (@rules) { # We need to look at what the year _would_ be if we added the # rule's offset to the UTC date. Otherwise we can end up with # a UTC date in year X, and a rule that starts in _local_ year # X + 1, where that rule really does apply to that UTC date. my $temp_year = $date->clone->add( seconds => $self->offset_from_utc + $rule->offset_from_std ) ->year; # Save the highest value $year = $temp_year if $temp_year > $year; next if $rule->min_year > $temp_year; $possible_rules{$rule} = $rule; } my $earliest_year = $year - 1; foreach my $rule (@rules) { $earliest_year = $rule->min_year if $rule->min_year < $earliest_year; } # figure out what date each rule would start on _if_ that rule # were applied to this current observance. this could be a rule # that started much earlier, but is only now active because of an # observance switch. An obnoxious example of this is # America/Phoenix in 1944, which applies the US rule in April, # thus (re-)instating the "war time" rule from 1942. Can you say # ridiculous crack-smoking stupidity? my @rule_dates; foreach my $y ( $earliest_year .. $year ) { RULE: foreach my $rule ( values %possible_rules ) { # skip rules that can't have applied the year before the # observance started. if ( $rule->min_year > $y ) { print "Skipping rule beginning in ", $rule->min_year, ". Year is $y.\n" if $DateTime::TimeZone::OlsonDB::DEBUG; next RULE; } if ( $rule->max_year && $rule->max_year < $y ) { print "Skipping rule ending in ", $rule->max_year, ". Year is $y.\n" if $DateTime::TimeZone::OlsonDB::DEBUG; next RULE; } my $rule_start = $rule->utc_start_datetime_for_year( $y, $last_offset_from_utc, $last_offset_from_std ); push @rule_dates, [ $rule_start, $rule ]; } } @rule_dates = sort { $a->[0] <=> $b->[0] } @rule_dates; print "Looking for first rule ...\n" if $DateTime::TimeZone::OlsonDB::DEBUG; print " Observance starts: ", $date->datetime, "\n\n" if $DateTime::TimeZone::OlsonDB::DEBUG; # ... look through the rules to see if any are still in # effect at the beginning of the observance for ( my $x = 0; $x < @rule_dates; $x++ ) { my ( $dt, $rule ) = @{ $rule_dates[$x] }; my ( $next_dt, $next_rule ) = $x < @rule_dates - 1 ? @{ $rule_dates[ $x + 1 ] } : undef; next if $next_dt && $next_dt < $date; print " This rule starts: ", $dt->datetime, "\n" if $DateTime::TimeZone::OlsonDB::DEBUG; print " Next rule starts: ", $next_dt->datetime, "\n" if $next_dt && $DateTime::TimeZone::OlsonDB::DEBUG; print " No next rule\n\n" if !$next_dt && $DateTime::TimeZone::OlsonDB::DEBUG; if ( $dt <= $date ) { if ($next_dt) { return $rule if $date < $next_dt; return $next_rule if $date == $next_dt; } else { return $rule; } } } # If this observance has rules, but the rules don't have any # defined changes until after the observance starts, we get the # earliest standard time rule and use it. If there is none, shit # blows up (but this is not the case for any time zones as of # 2009a). I really, really hate the Olson database a lot of the # time! Could this be more arbitrary? my $std_time_rule = $self->_first_no_dst_rule; die "Cannot find a rule that applies to the observance's date range and cannot find a rule without DST to apply" unless $std_time_rule; return $std_time_rule; } sub _first_no_dst_rule { my $self = shift; return first { !$_->offset_from_std } sort { $a->min_year <=> $b->min_year } $self->rules; } 1;
{ "content_hash": "e7d324762ae505dc0fa5c45f7d080109", "timestamp": "", "source": "github", "line_count": 420, "max_line_length": 119, "avg_line_length": 31.833333333333332, "alnum_prop": 0.5130142109199701, "repo_name": "jkb78/extrajnm", "id": "d453808d4454796a885860c80364d021587b2bb8", "size": "13370", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "local/lib/perl5/DateTime/TimeZone/OlsonDB/Observance.pm", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "769811" }, { "name": "C++", "bytes": "29784" }, { "name": "CSS", "bytes": "39085" }, { "name": "HTML", "bytes": "1376610" }, { "name": "JavaScript", "bytes": "68493" }, { "name": "M4", "bytes": "4106" }, { "name": "Objective-C", "bytes": "3085" }, { "name": "Perl", "bytes": "29368111" }, { "name": "Perl 6", "bytes": "118159" }, { "name": "Roff", "bytes": "217515" }, { "name": "Shell", "bytes": "7782" }, { "name": "Tcl", "bytes": "53765" }, { "name": "XSLT", "bytes": "89467" } ], "symlink_target": "" }
import { AsyncTestCompleter, beforeEach, xdescribe, ddescribe, describe, el, expect, iit, inject, it, SpyObject, proxy } from 'angular2/test_lib'; import {DirectiveMetadata, LifecycleEvent} from 'angular2/src/core/metadata'; import {DirectiveBinding} from 'angular2/src/core/compiler/element_injector'; import {RenderDirectiveMetadata} from 'angular2/src/core/render/api'; export function main() { describe('Create DirectiveMetadata', () => { describe('lifecycle', () => { function metadata(type, annotation): RenderDirectiveMetadata { return DirectiveBinding.createFromType(type, annotation).metadata; } describe("onChanges", () => { it("should be true when the directive has the onChanges method", () => { expect(metadata(DirectiveWithOnChangesMethod, new DirectiveMetadata({})).callOnChanges) .toBe(true); }); it("should be true when the lifecycle includes onChanges", () => { expect(metadata(DirectiveNoHooks, new DirectiveMetadata({lifecycle: [LifecycleEvent.OnChanges]})) .callOnChanges) .toBe(true); }); it("should be false otherwise", () => { expect(metadata(DirectiveNoHooks, new DirectiveMetadata()).callOnChanges).toBe(false); }); it("should be false when empty lifecycle", () => { expect(metadata(DirectiveWithOnChangesMethod, new DirectiveMetadata({lifecycle: []})) .callOnChanges) .toBe(false); }); }); describe("onDestroy", () => { it("should be true when the directive has the onDestroy method", () => { expect(metadata(DirectiveWithOnDestroyMethod, new DirectiveMetadata({})).callOnDestroy) .toBe(true); }); it("should be true when the lifecycle includes onDestroy", () => { expect(metadata(DirectiveNoHooks, new DirectiveMetadata({lifecycle: [LifecycleEvent.OnDestroy]})) .callOnDestroy) .toBe(true); }); it("should be false otherwise", () => { expect(metadata(DirectiveNoHooks, new DirectiveMetadata()).callOnDestroy).toBe(false); }); }); describe("onInit", () => { it("should be true when the directive has the onInit method", () => { expect(metadata(DirectiveWithOnInitMethod, new DirectiveMetadata({})).callOnInit) .toBe(true); }); it("should be true when the lifecycle includes onDestroy", () => { expect(metadata(DirectiveNoHooks, new DirectiveMetadata({lifecycle: [LifecycleEvent.OnInit]})) .callOnInit) .toBe(true); }); it("should be false otherwise", () => { expect(metadata(DirectiveNoHooks, new DirectiveMetadata()).callOnInit).toBe(false); }); }); describe("doCheck", () => { it("should be true when the directive has the doCheck method", () => { expect(metadata(DirectiveWithOnCheckMethod, new DirectiveMetadata({})).callDoCheck) .toBe(true); }); it("should be true when the lifecycle includes doCheck", () => { expect(metadata(DirectiveNoHooks, new DirectiveMetadata({lifecycle: [LifecycleEvent.DoCheck]})) .callDoCheck) .toBe(true); }); it("should be false otherwise", () => { expect(metadata(DirectiveNoHooks, new DirectiveMetadata()).callDoCheck).toBe(false); }); }); describe("afterContentChecked", () => { it("should be true when the directive has the afterContentChecked method", () => { expect(metadata(DirectiveWithAfterContentCheckedMethod, new DirectiveMetadata({})) .callAfterContentChecked) .toBe(true); }); it("should be true when the lifecycle includes afterContentChecked", () => { expect(metadata(DirectiveNoHooks, new DirectiveMetadata({lifecycle: [LifecycleEvent.AfterContentChecked]})) .callAfterContentChecked) .toBe(true); }); it("should be false otherwise", () => { expect(metadata(DirectiveNoHooks, new DirectiveMetadata()).callAfterContentChecked) .toBe(false); }); }); }); }); } class DirectiveNoHooks {} class DirectiveWithOnChangesMethod { onChanges(_) {} } class DirectiveWithOnInitMethod { onInit() {} } class DirectiveWithOnCheckMethod { doCheck() {} } class DirectiveWithOnDestroyMethod { onDestroy(_) {} } class DirectiveWithAfterContentCheckedMethod { afterContentChecked() {} }
{ "content_hash": "fbe57362447582015848c0cd9d8d015b", "timestamp": "", "source": "github", "line_count": 148, "max_line_length": 99, "avg_line_length": 32.804054054054056, "alnum_prop": 0.5909371781668383, "repo_name": "pkdevbox/angular", "id": "7723cfe09c4923120a70d4ecc8d792af292b56cb", "size": "4855", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "modules/angular2/test/core/compiler/directive_lifecycle_spec.ts", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "62417" }, { "name": "Dart", "bytes": "541740" }, { "name": "HTML", "bytes": "57747" }, { "name": "JavaScript", "bytes": "68940" }, { "name": "Python", "bytes": "3535" }, { "name": "Shell", "bytes": "21082" }, { "name": "TypeScript", "bytes": "2708877" } ], "symlink_target": "" }
module Berp.Compile.Utils where unsupported :: String -> a unsupported str = error $ "berp unsupported. " ++ str
{ "content_hash": "e2cf13933c30d847e497f3582741f16c", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 53, "avg_line_length": 28.5, "alnum_prop": 0.7192982456140351, "repo_name": "bjpop/berp", "id": "5f9d1c3c1f4fd7b47ff066c6809abfee1932775d", "size": "511", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "libs/src/Berp/Compile/Utils.hs", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C", "bytes": "367" }, { "name": "Haskell", "bytes": "242614" }, { "name": "Python", "bytes": "16392" }, { "name": "TeX", "bytes": "8697" } ], "symlink_target": "" }
struct SnapshotRequestInfo; // MTPDeviceDelegateImplLinux communicates with the media transfer protocol // (MTP) device to complete file system operations. These operations are // performed asynchronously. Instantiate this class per MTP device storage. // MTPDeviceDelegateImplLinux lives on the IO thread. // MTPDeviceDelegateImplLinux does a call-and-reply to the UI thread // to dispatch the requests to MediaTransferProtocolManager. class MTPDeviceDelegateImplLinux : public MTPDeviceAsyncDelegate { private: friend void CreateMTPDeviceAsyncDelegate( const std::string&, const CreateMTPDeviceAsyncDelegateCallback&); enum InitializationState { UNINITIALIZED = 0, PENDING_INIT, INITIALIZED }; // Used to represent pending task details. struct PendingTaskInfo { PendingTaskInfo(const base::FilePath& path, content::BrowserThread::ID thread_id, const tracked_objects::Location& location, const base::Closure& task); ~PendingTaskInfo(); base::FilePath path; base::FilePath cached_path; const content::BrowserThread::ID thread_id; const tracked_objects::Location location; const base::Closure task; }; class MTPFileNode; // Maps file ids to file nodes. typedef std::map<uint32, MTPFileNode*> FileIdToMTPFileNodeMap; // Maps file paths to file info. typedef std::map<base::FilePath, fileapi::DirectoryEntry> FileInfoCache; // Should only be called by CreateMTPDeviceAsyncDelegate() factory call. // Defer the device initializations until the first file operation request. // Do all the initializations in EnsureInitAndRunTask() function. explicit MTPDeviceDelegateImplLinux(const std::string& device_location); // Destructed via CancelPendingTasksAndDeleteDelegate(). virtual ~MTPDeviceDelegateImplLinux(); // MTPDeviceAsyncDelegate: virtual void GetFileInfo(const base::FilePath& file_path, const GetFileInfoSuccessCallback& success_callback, const ErrorCallback& error_callback) OVERRIDE; virtual void ReadDirectory( const base::FilePath& root, const ReadDirectorySuccessCallback& success_callback, const ErrorCallback& error_callback) OVERRIDE; virtual void CreateSnapshotFile( const base::FilePath& device_file_path, const base::FilePath& local_path, const CreateSnapshotFileSuccessCallback& success_callback, const ErrorCallback& error_callback) OVERRIDE; virtual bool IsStreaming() OVERRIDE; virtual void ReadBytes( const base::FilePath& device_file_path, net::IOBuffer* buf, int64 offset, int buf_len, const ReadBytesSuccessCallback& success_callback, const ErrorCallback& error_callback) OVERRIDE; virtual void CancelPendingTasksAndDeleteDelegate() OVERRIDE; // The internal methods correspond to the similarly named methods above. // The |root_node_| cache should be filled at this point. virtual void GetFileInfoInternal( const base::FilePath& file_path, const GetFileInfoSuccessCallback& success_callback, const ErrorCallback& error_callback); virtual void ReadDirectoryInternal( const base::FilePath& root, const ReadDirectorySuccessCallback& success_callback, const ErrorCallback& error_callback); virtual void CreateSnapshotFileInternal( const base::FilePath& device_file_path, const base::FilePath& local_path, const CreateSnapshotFileSuccessCallback& success_callback, const ErrorCallback& error_callback); virtual void ReadBytesInternal( const base::FilePath& device_file_path, net::IOBuffer* buf, int64 offset, int buf_len, const ReadBytesSuccessCallback& success_callback, const ErrorCallback& error_callback); // Ensures the device is initialized for communication. // If the device is already initialized, call RunTask(). // // If the device is uninitialized, store the |task_info| in a pending task // queue and runs the pending tasks in the queue once the device is // successfully initialized. void EnsureInitAndRunTask(const PendingTaskInfo& task_info); // Runs a task. If |task_info.path| is empty, or if the path is cached, runs // the task immediately. // Otherwise, fills the cache first before running the task. // |task_info.task| runs on the UI thread. void RunTask(const PendingTaskInfo& task_info); // Writes data from the device to the snapshot file path based on the // parameters in |current_snapshot_request_info_| by doing a call-and-reply to // the UI thread. // // |snapshot_file_info| specifies the metadata details of the snapshot file. void WriteDataIntoSnapshotFile(const base::File::Info& snapshot_file_info); // Marks the current request as complete and call ProcessNextPendingRequest(). void PendingRequestDone(); // Processes the next pending request. void ProcessNextPendingRequest(); // Handles the device initialization event. |succeeded| indicates whether // device initialization succeeded. // // If the device is successfully initialized, runs the next pending task. void OnInitCompleted(bool succeeded); // Called when GetFileInfo() succeeds. |file_info| specifies the // requested file details. |success_callback| is invoked to notify the caller // about the requested file details. void OnDidGetFileInfo(const GetFileInfoSuccessCallback& success_callback, const base::File::Info& file_info); // Called when GetFileInfo() succeeds. GetFileInfo() is invoked to // get the |dir_id| directory metadata details. |file_info| specifies the // |dir_id| directory details. // // If |dir_id| is a directory, post a task on the UI thread to read the // |dir_id| directory file entries. // // If |dir_id| is not a directory, |error_callback| is invoked to notify the // caller about the file error and process the next pending request. void OnDidGetFileInfoToReadDirectory( uint32 dir_id, const ReadDirectorySuccessCallback& success_callback, const ErrorCallback& error_callback, const base::File::Info& file_info); // Called when GetFileInfo() succeeds. GetFileInfo() is invoked to // create the snapshot file of |snapshot_request_info.device_file_path|. // |file_info| specifies the device file metadata details. // // Posts a task on the UI thread to copy the data contents of the device file // to the snapshot file. void OnDidGetFileInfoToCreateSnapshotFile( scoped_ptr<SnapshotRequestInfo> snapshot_request_info, const base::File::Info& file_info); // Called when ReadDirectory() succeeds. // // |dir_id| is the directory read. // |success_callback| is invoked to notify the caller about the directory // file entries. // |file_list| contains the directory file entries with their file ids. // |has_more| is true if there are more file entries to read. void OnDidReadDirectory(uint32 dir_id, const ReadDirectorySuccessCallback& success_callback, const fileapi::AsyncFileUtil::EntryList& file_list, bool has_more); // Called when WriteDataIntoSnapshotFile() succeeds. // // |snapshot_file_info| specifies the snapshot file metadata details. // // |current_snapshot_request_info_.success_callback| is invoked to notify the // caller about |snapshot_file_info|. void OnDidWriteDataIntoSnapshotFile( const base::File::Info& snapshot_file_info, const base::FilePath& snapshot_file_path); // Called when WriteDataIntoSnapshotFile() fails. // // |error| specifies the file error code. // // |current_snapshot_request_info_.error_callback| is invoked to notify the // caller about |error|. void OnWriteDataIntoSnapshotFileError(base::File::Error error); // Called when ReadBytes() succeeds. // // |success_callback| is invoked to notify the caller about the read bytes. // |bytes_read| is the number of bytes read. void OnDidReadBytes(const ReadBytesSuccessCallback& success_callback, const base::File::Info& file_info, int bytes_read); // Called when FillFileCache() succeeds. void OnDidFillFileCache(const base::FilePath& path, const fileapi::AsyncFileUtil::EntryList& file_list, bool has_more); // Called when FillFileCache() fails. void OnFillFileCacheFailed(base::File::Error error); // Handles the device file |error| while operating on |file_id|. // |error_callback| is invoked to notify the caller about the file error. void HandleDeviceFileError(const ErrorCallback& error_callback, uint32 file_id, base::File::Error error); // Given a full path, returns a non-empty sub-path that needs to be read into // the cache if such a uncached path exists. // |cached_path| is the portion of |path| that has had cache lookup attempts. base::FilePath NextUncachedPathComponent( const base::FilePath& path, const base::FilePath& cached_path) const; // Fills the file cache using the results from NextUncachedPathComponent(). void FillFileCache(const base::FilePath& uncached_path); // Given a full path, if it exists in the cache, writes the file's id to |id| // and return true. bool CachedPathToId(const base::FilePath& path, uint32* id) const; // MTP device initialization state. InitializationState init_state_; // Used to make sure only one task is in progress at any time. // Otherwise the browser will try to send too many requests at once and // overload the device. bool task_in_progress_; // Registered file system device path. This path does not // correspond to a real device path (e.g. "/usb:2,2:81282"). const base::FilePath device_path_; // MTP device storage name (e.g. "usb:2,2:81282"). std::string storage_name_; // A list of pending tasks that needs to be run when the device is // initialized or when the current task in progress is complete. std::deque<PendingTaskInfo> pending_tasks_; // Used to track the current snapshot file request. A snapshot file is created // incrementally. CreateSnapshotFile request reads the device file and writes // to the snapshot file in chunks. In order to retain the order of the // snapshot file requests, make sure there is only one active snapshot file // request at any time. scoped_ptr<SnapshotRequestInfo> current_snapshot_request_info_; // A mapping for quick lookups into the |root_node_| tree structure. Since // |root_node_| contains pointers to this map, it must be declared after this // so destruction happens in the right order. FileIdToMTPFileNodeMap file_id_to_node_map_; // The root node of a tree-structure that caches the directory structure of // the MTP device. scoped_ptr<MTPFileNode> root_node_; // A list of child nodes encountered while a ReadDirectory operation, which // can return results over multiple callbacks, is in progress. std::set<std::string> child_nodes_seen_; // A cache to store file metadata for file entries read during a ReadDirectory // operation. Used to service incoming GetFileInfo calls for the duration of // the ReadDirectory operation. FileInfoCache file_info_cache_; // For callbacks that may run after destruction. base::WeakPtrFactory<MTPDeviceDelegateImplLinux> weak_ptr_factory_; DISALLOW_COPY_AND_ASSIGN(MTPDeviceDelegateImplLinux); }; #endif // CHROME_BROWSER_MEDIA_GALLERIES_LINUX_MTP_DEVICE_DELEGATE_IMPL_LINUX_H_
{ "content_hash": "8d60eceb96ee2512334aa0d7a66587c5", "timestamp": "", "source": "github", "line_count": 273, "max_line_length": 81, "avg_line_length": 42.637362637362635, "alnum_prop": 0.720446735395189, "repo_name": "ondra-novak/chromium.src", "id": "770c0603b0175e36fb345a518b9665baba214282", "size": "12424", "binary": false, "copies": "4", "ref": "refs/heads/nw", "path": "chrome/browser/media_galleries/linux/mtp_device_delegate_impl_linux.h", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "AppleScript", "bytes": "6973" }, { "name": "Arduino", "bytes": "464" }, { "name": "Assembly", "bytes": "35318" }, { "name": "Batchfile", "bytes": "7621" }, { "name": "C", "bytes": "8692951" }, { "name": "C++", "bytes": "206833388" }, { "name": "CSS", "bytes": "871479" }, { "name": "HTML", "bytes": "24541148" }, { "name": "Java", "bytes": "5457985" }, { "name": "JavaScript", "bytes": "17791684" }, { "name": "Makefile", "bytes": "92563" }, { "name": "Objective-C", "bytes": "1312233" }, { "name": "Objective-C++", "bytes": "7105758" }, { "name": "PHP", "bytes": "97817" }, { "name": "PLpgSQL", "bytes": "218379" }, { "name": "Perl", "bytes": "69392" }, { "name": "Protocol Buffer", "bytes": "387183" }, { "name": "Python", "bytes": "6929739" }, { "name": "Shell", "bytes": "473664" }, { "name": "Standard ML", "bytes": "4131" }, { "name": "XSLT", "bytes": "418" }, { "name": "nesC", "bytes": "15206" } ], "symlink_target": "" }
package demo.catlets; import io.mycat.MycatServer; import io.mycat.cache.LayerCachePool; import io.mycat.route.RouteResultset; import io.mycat.route.RouteResultsetNode; import io.mycat.route.factory.RouteStrategyFactory; import io.mycat.server.ErrorCode; import io.mycat.server.MySQLFrontConnection; import io.mycat.server.config.node.SchemaConfig; import io.mycat.server.config.node.SystemConfig; import io.mycat.server.config.node.TableConfig; import io.mycat.server.parser.ServerParse; import io.mycat.server.sequence.IncrSequenceMySQLHandler; import io.mycat.server.sequence.IncrSequencePropHandler; import io.mycat.server.sequence.SequenceHandler; import io.mycat.sqlengine.Catlet; import io.mycat.sqlengine.EngineCtx; import io.mycat.util.StringUtil; import org.apache.log4j.Logger; import com.alibaba.druid.sql.ast.SQLStatement; import com.alibaba.druid.sql.ast.expr.SQLIdentifierExpr; import com.alibaba.druid.sql.ast.expr.SQLIntegerExpr; import com.alibaba.druid.sql.ast.statement.SQLInsertStatement.ValuesClause; import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlInsertStatement; import com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser; /** * 执行批量插入sequence Id * @author 兵临城下 * @date 2015/03/20 */ public class BatchInsertSequence implements Catlet { private static final Logger LOGGER = Logger.getLogger(BatchInsertSequence.class); private RouteResultset rrs;//路由结果集 private String executeSql;//接收执行处理任务的sql private SequenceHandler sequenceHandler;//sequence处理对象 //重新路由使用 private SystemConfig sysConfig; private SchemaConfig schema; private int sqltype; private String charset; private MySQLFrontConnection sc; private LayerCachePool cachePool; @Override public void processSQL(String sql, EngineCtx ctx) { try { getRoute(executeSql); RouteResultsetNode[] nodes = rrs.getNodes(); if (nodes == null || nodes.length == 0 || nodes[0].getName() == null || nodes[0].getName().equals("")) { ctx.getSession().getSource().writeErrMessage(ErrorCode.ER_NO_DB_ERROR, "No dataNode found ,please check tables defined in schema:" + ctx.getSession().getSource().getSchema()); return; } sc.getSession2().execute(rrs, sqltype);//将路由好的数据执行入库 } catch (Exception e) { LOGGER.error("BatchInsertSequence.processSQL(String sql, EngineCtx ctx)",e); } } @Override public void route(SystemConfig sysConfig, SchemaConfig schema, int sqlType, String realSQL, String charset, MySQLFrontConnection sc, LayerCachePool cachePool) { int rs = ServerParse.parse(realSQL); this.sqltype = rs & 0xff; this.sysConfig=sysConfig; this.schema=schema; this.charset=charset; this.sc=sc; this.cachePool=cachePool; try { MySqlStatementParser parser = new MySqlStatementParser(realSQL); SQLStatement statement = parser.parseStatement(); MySqlInsertStatement insert = (MySqlInsertStatement)statement; if(insert.getValuesList()!=null){ String tableName = StringUtil.getTableName(realSQL).toUpperCase(); TableConfig tableConfig = schema.getTables().get(tableName); String primaryKey = tableConfig.getPrimaryKey();//获得表的主键字段 SQLIdentifierExpr sqlIdentifierExpr = new SQLIdentifierExpr(); sqlIdentifierExpr.setName(primaryKey); insert.getColumns().add(sqlIdentifierExpr); if(sequenceHandler == null){ int seqHandlerType = MycatServer.getInstance().getConfig().getSystem().getSequnceHandlerType(); switch(seqHandlerType){ case SystemConfig.SEQUENCEHANDLER_MYSQLDB: sequenceHandler = IncrSequenceMySQLHandler.getInstance(); break; case SystemConfig.SEQUENCEHANDLER_LOCALFILE: sequenceHandler = IncrSequencePropHandler.getInstance(); break; default: throw new java.lang.IllegalArgumentException("Invalid sequnce handler type "+seqHandlerType); } } for(ValuesClause vc : insert.getValuesList()){ SQLIntegerExpr sqlIntegerExpr = new SQLIntegerExpr(); long value = sequenceHandler.nextId(tableName.toUpperCase()); sqlIntegerExpr.setNumber(value);//插入生成的sequence值 vc.addValue(sqlIntegerExpr); } String insertSql = insert.toString(); this.executeSql = insertSql; } } catch (Exception e) { LOGGER.error("BatchInsertSequence.route(......)",e); } } /** * 根据sql获得路由执行结果 * @param sql */ private void getRoute(String sql){ try { rrs =RouteStrategyFactory.getRouteStrategy().route(sysConfig, schema, sqltype,sql,charset, sc, cachePool); } catch (Exception e) { LOGGER.error("BatchInsertSequence.getRoute(String sql)",e); } } }
{ "content_hash": "49a09693f155475df506dda98bccd5af", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 109, "avg_line_length": 33.78102189781022, "alnum_prop": 0.7480553154710458, "repo_name": "enjoy0924/Mycat-Server", "id": "2c569efbf6b7f7f5eac3282fbd24d6997a8d9af6", "size": "4766", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "src/main/java/demo/catlets/BatchInsertSequence.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "4231" }, { "name": "CSS", "bytes": "5337" }, { "name": "HTML", "bytes": "15511" }, { "name": "Java", "bytes": "2169370" }, { "name": "JavaScript", "bytes": "3555" }, { "name": "Shell", "bytes": "8408" } ], "symlink_target": "" }
struct cpu { uchar id; // Local APIC ID; index into cpus[] below struct context *scheduler; // swtch() here to enter scheduler struct taskstate ts; // Used by x86 to find stack for interrupt struct segdesc gdt[NSEGS]; // x86 global descriptor table volatile uint started; // Has the CPU started? int ncli; // Depth of pushcli nesting. int intena; // Were interrupts enabled before pushcli? // Cpu-local storage variables; see below struct cpu *cpu; struct proc *proc; // The currently-running process. }; extern struct cpu cpus[NCPU]; extern int ncpu; // Per-CPU variables, holding pointers to the // current cpu and to the current process. // The asm suffix tells gcc to use "%gs:0" to refer to cpu // and "%gs:4" to refer to proc. seginit sets up the // %gs segment register so that %gs refers to the memory // holding those two variables in the local cpu's struct cpu. // This is similar to how thread-local variables are implemented // in thread libraries such as Linux pthreads. extern struct cpu *cpu asm("%gs:0"); // &cpus[cpunum()] extern struct proc *proc asm("%gs:4"); // cpus[cpunum()].proc //PAGEBREAK: 17 // Saved registers for kernel context switches. // Don't need to save all the segment registers (%cs, etc), // because they are constant across kernel contexts. // Don't need to save %eax, %ecx, %edx, because the // x86 convention is that the caller has saved them. // Contexts are stored at the bottom of the stack they // describe; the stack pointer is the address of the context. // The layout of the context matches the layout of the stack in swtch.S // at the "Switch stacks" comment. Switch doesn't save eip explicitly, // but it is on the stack and allocproc() manipulates it. struct context { uint edi; uint esi; uint ebx; uint ebp; uint eip; }; enum procstate { UNUSED, EMBRYO, SLEEPING, RUNNABLE, RUNNING, ZOMBIE }; // Per-process state struct proc { uint sz; // Size of process memory (bytes) pde_t* pgdir; // Page table char *kstack; // Bottom of kernel stack for this process enum procstate state; // Process state volatile int pid; // Process ID struct proc *parent; // Parent process struct trapframe *tf; // Trap frame for current syscall struct context *context; // swtch() here to run process void *chan; // If non-zero, sleeping on chan int killed; // If non-zero, have been killed struct file *ofile[NOFILE]; // Open files struct inode *cwd; // Current directory char name[16]; // Process name (debugging) uint priority; }; // Process memory is laid out contiguously, low addresses first: // text // original data and bss // fixed-size stack // expandable heap
{ "content_hash": "2b2d1ce090c7e49228ac38545f74fb9e", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 73, "avg_line_length": 38.89333333333333, "alnum_prop": 0.6510113129928008, "repo_name": "jahandideh-iman/XV6_Scheduling", "id": "cce21c972d4244e65426d2ea863a83b8034fffe0", "size": "2981", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "proc.h", "mode": "33188", "license": "mit", "language": [ { "name": "Assembly", "bytes": "1733047" }, { "name": "C", "bytes": "179909" }, { "name": "C++", "bytes": "26196" }, { "name": "D", "bytes": "3242" }, { "name": "Emacs Lisp", "bytes": "86" }, { "name": "Objective-C", "bytes": "317" }, { "name": "OpenEdge ABL", "bytes": "1990" }, { "name": "Perl", "bytes": "1933" } ], "symlink_target": "" }
//----------------------------------------------------------------------------- // Copyright (c) 2012 GarageGames, LLC // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to // deal in the Software without restriction, including without limitation the // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or // sell copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS // IN THE SOFTWARE. //----------------------------------------------------------------------------- #include "platform/platform.h" #include "shaderGen/GLSL/depthGLSL.h" #include "materials/materialFeatureTypes.h" #include "materials/materialFeatureData.h" #include "terrain/terrFeatureTypes.h" void EyeSpaceDepthOutGLSL::processVert( Vector<ShaderComponent*> &componentList, const MaterialFeatureData &fd ) { MultiLine *meta = new MultiLine; output = meta; // grab output ShaderConnector *connectComp = dynamic_cast<ShaderConnector *>( componentList[C_CONNECTOR] ); Var *outWSEyeVec = connectComp->getElement( RT_TEXCOORD ); outWSEyeVec->setName( "wsEyeVec" ); outWSEyeVec->setStructName( "OUT" ); // grab incoming vert position Var *wsPosition = new Var( "depthPos", "float3" ); getWsPosition( componentList, fd.features[MFT_UseInstancing], meta, new DecOp( wsPosition ) ); Var *eyePos = (Var*)LangElement::find( "eyePosWorld" ); if( !eyePos ) { eyePos = new Var; eyePos->setType("float3"); eyePos->setName("eyePosWorld"); eyePos->uniform = true; eyePos->constSortPos = cspPass; } meta->addStatement( new GenOp( " @ = float4( @.xyz - @, 1 );\r\n", outWSEyeVec, wsPosition, eyePos ) ); } void EyeSpaceDepthOutGLSL::processPix( Vector<ShaderComponent*> &componentList, const MaterialFeatureData &fd ) { MultiLine *meta = new MultiLine; // grab connector position ShaderConnector *connectComp = dynamic_cast<ShaderConnector *>( componentList[C_CONNECTOR] ); Var *wsEyeVec = connectComp->getElement( RT_TEXCOORD ); wsEyeVec->setName( "wsEyeVec" ); wsEyeVec->setStructName( "IN" ); wsEyeVec->setType( "float4" ); wsEyeVec->mapsToSampler = false; wsEyeVec->uniform = false; // get shader constants Var *vEye = new Var; vEye->setType("float3"); vEye->setName("vEye"); vEye->uniform = true; vEye->constSortPos = cspPass; // Expose the depth to the depth format feature Var *depthOut = new Var; depthOut->setType("float"); depthOut->setName(getOutputVarName()); LangElement *depthOutDecl = new DecOp( depthOut ); meta->addStatement( new GenOp( "#ifndef CUBE_SHADOW_MAP\r\n" ) ); if (fd.features.hasFeature(MFT_TerrainBaseMap)) meta->addStatement(new GenOp(" @ =min(0.9999, dot(@, (@.xyz / @.w)));\r\n", depthOutDecl, vEye, wsEyeVec, wsEyeVec)); else meta->addStatement(new GenOp(" @ = dot(@, (@.xyz / @.w));\r\n", depthOutDecl, vEye, wsEyeVec, wsEyeVec)); meta->addStatement( new GenOp( "#else\r\n" ) ); Var *farDist = (Var*)Var::find( "oneOverFarplane" ); if ( !farDist ) { farDist = new Var; farDist->setType("float4"); farDist->setName("oneOverFarplane"); farDist->uniform = true; farDist->constSortPos = cspPass; } meta->addStatement( new GenOp( " @ = length( @.xyz / @.w ) * @.x;\r\n", depthOutDecl, wsEyeVec, wsEyeVec, farDist ) ); meta->addStatement( new GenOp( "#endif\r\n" ) ); // If there isn't an output conditioner for the pre-pass, than just write // out the depth to rgba and return. if( !fd.features[MFT_PrePassConditioner] ) meta->addStatement( new GenOp( " @;\r\n", assignColor( new GenOp( "float4(float3(@),1)", depthOut ), Material::None ) ) ); output = meta; } ShaderFeature::Resources EyeSpaceDepthOutGLSL::getResources( const MaterialFeatureData &fd ) { Resources temp; // Passing from VS->PS: // - world space position (wsPos) temp.numTexReg = 1; return temp; } void DepthOutGLSL::processVert( Vector<ShaderComponent*> &componentList, const MaterialFeatureData &fd ) { ShaderConnector *connectComp = dynamic_cast<ShaderConnector *>( componentList[C_CONNECTOR] ); // Grab the output vert. Var *outPosition = (Var*)LangElement::find( "gl_Position" ); //hpos // Grab our output depth. Var *outDepth = connectComp->getElement( RT_TEXCOORD ); outDepth->setName( "depth" ); outDepth->setStructName( "OUT" ); outDepth->setType( "float" ); output = new GenOp( " @ = @.z / @.w;\r\n", outDepth, outPosition, outPosition ); } void DepthOutGLSL::processPix( Vector<ShaderComponent*> &componentList, const MaterialFeatureData &fd ) { ShaderConnector *connectComp = dynamic_cast<ShaderConnector *>( componentList[C_CONNECTOR] ); // grab connector position Var *depthVar = connectComp->getElement( RT_TEXCOORD ); depthVar->setName( "depth" ); depthVar->setStructName( "IN" ); depthVar->setType( "float" ); depthVar->mapsToSampler = false; depthVar->uniform = false; /* // Expose the depth to the depth format feature Var *depthOut = new Var; depthOut->setType("float"); depthOut->setName(getOutputVarName()); */ LangElement *depthOut = new GenOp( "float4( @, 0, 0, 1 )", depthVar ); output = new GenOp( " @;\r\n", assignColor( depthOut, Material::None ) ); } ShaderFeature::Resources DepthOutGLSL::getResources( const MaterialFeatureData &fd ) { // We pass the depth to the pixel shader. Resources temp; temp.numTexReg = 1; return temp; }
{ "content_hash": "a513cd4b4ca1ce806025b6b4eea00b27", "timestamp": "", "source": "github", "line_count": 178, "max_line_length": 130, "avg_line_length": 36.37640449438202, "alnum_prop": 0.6500386100386101, "repo_name": "elfprince13/Torque3D", "id": "2eb5663e9858e75260be1f2cab079a6f446edd4c", "size": "6475", "binary": false, "copies": "7", "ref": "refs/heads/master", "path": "Engine/source/shaderGen/GLSL/depthGLSL.cpp", "mode": "33188", "license": "mit", "language": [ { "name": "Assembly", "bytes": "32222" }, { "name": "Batchfile", "bytes": "11079" }, { "name": "C", "bytes": "23777921" }, { "name": "C#", "bytes": "7484103" }, { "name": "C++", "bytes": "35989879" }, { "name": "CMake", "bytes": "383380" }, { "name": "CSS", "bytes": "29650" }, { "name": "GLSL", "bytes": "1204019" }, { "name": "HLSL", "bytes": "1270199" }, { "name": "HTML", "bytes": "1238769" }, { "name": "JavaScript", "bytes": "17803" }, { "name": "Lex", "bytes": "18750" }, { "name": "Lua", "bytes": "1288" }, { "name": "M4", "bytes": "44537" }, { "name": "Makefile", "bytes": "108016" }, { "name": "Module Management System", "bytes": "13253" }, { "name": "NSIS", "bytes": "1194010" }, { "name": "Objective-C", "bytes": "480865" }, { "name": "Objective-C++", "bytes": "132479" }, { "name": "OpenEdge ABL", "bytes": "4768" }, { "name": "PHP", "bytes": "615704" }, { "name": "Pascal", "bytes": "258402" }, { "name": "Perl", "bytes": "45228" }, { "name": "PowerShell", "bytes": "12011" }, { "name": "Python", "bytes": "4530" }, { "name": "Roff", "bytes": "351740" }, { "name": "Ruby", "bytes": "983" }, { "name": "SAS", "bytes": "13756" }, { "name": "Shell", "bytes": "495336" }, { "name": "Smalltalk", "bytes": "2661" }, { "name": "Smarty", "bytes": "333060" }, { "name": "Yacc", "bytes": "19590" } ], "symlink_target": "" }
package io.swagger.client.model; import com.wordnik.swagger.annotations.*; import com.fasterxml.jackson.annotation.JsonProperty; /** * Category object **/ @ApiModel(description = "Category object") public class Category { private Long id = null; private String name = null; /** **/ @ApiModelProperty(value = "") @JsonProperty("id") public Long getId() { return id; } public void setId(Long id) { this.id = id; } /** **/ @ApiModelProperty(value = "") @JsonProperty("name") public String getName() { return name; } public void setName(String name) { this.name = name; } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Category {\n"); sb.append(" id: ").append(id).append("\n"); sb.append(" name: ").append(name).append("\n"); sb.append("}\n"); return sb.toString(); } }
{ "content_hash": "776f3407a280addb9873a3d2671500c8", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 53, "avg_line_length": 16.36842105263158, "alnum_prop": 0.6045016077170418, "repo_name": "jfiala/swagger-spring-demo", "id": "d210657b29fbfeeef61c5ee4491dd24b5e29f830", "size": "933", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "user-rest-service-2.0.0-client-java-codegen-develop-2.0/src/main/java/io/swagger/client/model/Category.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C#", "bytes": "27237" }, { "name": "C++", "bytes": "79766" }, { "name": "CSS", "bytes": "360027" }, { "name": "HTML", "bytes": "34412" }, { "name": "Java", "bytes": "782614" }, { "name": "JavaScript", "bytes": "3621677" }, { "name": "Objective-C", "bytes": "56983" }, { "name": "PHP", "bytes": "98153" }, { "name": "Python", "bytes": "36004" }, { "name": "Ruby", "bytes": "29848" }, { "name": "Scala", "bytes": "37823" }, { "name": "Shell", "bytes": "18947" } ], "symlink_target": "" }
package com.team1458.turtleshell.pid; import com.team1458.turtleshell.util.MotorValue; /** * A PID that does nothing, always returns zero and will always be at target. * Used for disabling motor in TurtleManualDualPID. * * @author mehnadnerd * */ public class TurtleZeroPID implements TurtlePID{ private static TurtleZeroPID instance; public static TurtleZeroPID getInstance() { if(instance==null) { instance = new TurtleZeroPID(); } return instance; } @Override public boolean atTarget() { return true; } @Override public MotorValue newValue(double[] inputs) { return MotorValue.zero; } }
{ "content_hash": "13113aa283d45ff089b33d6ff1faffad", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 77, "avg_line_length": 19.5625, "alnum_prop": 0.7332268370607029, "repo_name": "FRC1458/turtleshell", "id": "1659cc2cb3b3bdaa8a8976759271f1dc186430ca", "size": "626", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "2016season/TurtleBot/src/com/team1458/turtleshell/pid/TurtleZeroPID.java", "mode": "33188", "license": "mit", "language": [ { "name": "Arduino", "bytes": "7042" }, { "name": "C", "bytes": "43737" }, { "name": "C++", "bytes": "55439" }, { "name": "HTML", "bytes": "900" }, { "name": "Java", "bytes": "632229" }, { "name": "JavaScript", "bytes": "329" }, { "name": "Processing", "bytes": "2002" }, { "name": "Shell", "bytes": "118" } ], "symlink_target": "" }
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="HandheldFriendly" content="True" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>glassfish - Not obvious</title> <meta name="description" content="" /> <link href="//fonts.googleapis.com/css?family=Noto+Sans:300,400,700" rel="stylesheet" type="text/css"> <link href="//fonts.googleapis.com/css?family=Noto+Serif:400,700,400italic" rel="stylesheet" type="text/css"> <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet"> <link href="//pdudits.github.io/hubpress/themes/saga/assets/css/style.css?v=1482270149895" rel="stylesheet" type="text/css"> <link href="//pdudits.github.io/hubpress/themes/saga/assets/css/animate.min.css?v=1482270149895" rel="stylesheet" type="text/css"> <link href="https://pdudits.github.io/hubpress/favicon.ico" rel="shortcut icon"> <link rel="canonical" href="https://pdudits.github.io/hubpress/https://pdudits.github.io/hubpress/tag/glassfish/" /> <meta name="referrer" content="origin" /> <meta property="og:site_name" content="Not obvious " /> <meta property="og:type" content="website" /> <meta property="og:title" content="glassfish - Not obvious" /> <meta property="og:url" content="https://pdudits.github.io/hubpress/https://pdudits.github.io/hubpress/tag/glassfish/" /> <meta name="twitter:card" content="summary" /> <meta name="twitter:title" content="glassfish - Not obvious" /> <meta name="twitter:url" content="https://pdudits.github.io/hubpress/https://pdudits.github.io/hubpress/tag/glassfish/" /> <script type="application/ld+json"> null </script> <meta name="generator" content="HubPress" /> <link rel="alternate" type="application/rss+xml" title="Not obvious " href="https://pdudits.github.io/hubpress/rss/" /> </head> <body class="tag-template tag-glassfish"> <header id="header" class="animated fadeIn"> <div class="header-background"> <section class="blog-content"> <a id="site-url" class="blog-title" href="https://pdudits.github.io/hubpress">Not obvious </a> <span class="blog-description">Notes about programming tasks that took too long. By Patrik Duditš. </span> <nav class="links fadeIn animated"> <ul> <li class="rss"><a title="RSS Feed" href="/rss/"><i class="fa fa-fw fa-rss-square"></i></a></li> <li class="github"><a title="GitHub" href="pdudits "><i class="fa fa-fw fa-github-square"></i></a></li> <li class="facebook"><a title="Facebook" href="pdudits"><i class="fa fa-fw fa-facebook-square"></i></a></li> <li class="twitter"><a title="Twitter" href="pdudits"><i class="fa fa-fw fa-twitter-square"></i></a></li> <li class="flickr"><a title="Flickr" href="pdudits"><i class="fa fa-fw fa-flickr"></i></a></li> </ul> </nav> </section> <section class="header-content"> <h1 class="tag-title animated fadeInUp">glassfish</h1> <span class="tag-data"><span class="tag-description animated fadeInUp"></span></span> </section> </div> </header> <main id="main" class="archive"> <section id="feed" class="feed"> <article class="post tag-glassfish tag-jax-ws" style="opacity: 0;"> <h2 class="post-title"><a href="https://pdudits.github.io/hubpress/2012/04/20/Enabling-SOAP-message-signing-for-EJB-webservice-client-in-Glassfish.html">Enabling SOAP message signing for EJB webservice client in Glassfish</a></h2> <section class="post-content"> Today&#8217;s solution is for following scenario: An EJB uses a web service client, and needs to sign its request with a trusted certificate.… </section> <section class="post-meta"> <span class="date"><i class="fa fa-clock-o"></i> <a href="https://pdudits.github.io/hubpress/2012/04/20/Enabling-SOAP-message-signing-for-EJB-webservice-client-in-Glassfish.html"><time class="timesince" data-timesince="1334872800" datetime="2012-04-20T00:00" title="20 April 2012">5 years ago</time></a></span> <span class="author"><i class="fa fa-user"></i> <a href="/">Patrik Duditš</a></span> <span class="tags"><i class="fa fa-tags"></i> <span> <a href="https://pdudits.github.io/hubpress/tag/glassfish/">glassfish</a>, <a href="https://pdudits.github.io/hubpress/tag/jax-ws/">jax ws</a></span> </span> </section> </article></section> <nav class="pagination" role="navigation"> <span class="page-number">Page 1 of 1</span> </nav> </main> <footer class="animated fadeIn" id="footer"> <section class="colophon"> <section class="copyright">Copyright &copy; <span itemprop="copyrightHolder">Not obvious </span>. <span rel="license">All Rights Reserved</span>.</section> <section class="poweredby">Published with <a class="icon-ghost" href="http://hubpress.io">HubPress</a></section> </section> <section class="bottom"> <section class="attribution"> <a href="http://github.com/Reedyn/Saga">Built with <i class="fa fa-heart"></i> and Free and Open-Source Software</a>. </section> </section> </footer> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js?v="></script> <script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.9.0/moment-with-locales.min.js?v="></script> <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js?v="></script> <script type="text/javascript"> jQuery( document ).ready(function() { // change date with ago jQuery('ago.ago').each(function(){ var element = jQuery(this).parent(); element.html( moment(element.text()).fromNow()); }); }); hljs.initHighlightingOnLoad(); </script> <script src="//pdudits.github.io/hubpress/themes/saga/assets/js/scripts.js?v=1482270149895"></script> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-340613-5', 'auto'); ga('send', 'pageview'); </script> </body> </html>
{ "content_hash": "82d9048cb370af2b1379081e3be52b1f", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 326, "avg_line_length": 58.17391304347826, "alnum_prop": 0.633034379671151, "repo_name": "pdudits/pdudits.github.io", "id": "f9b358186fe8185b263adb787f581b9d4e97b67a", "size": "6694", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "tag/glassfish/index.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "466631" }, { "name": "CoffeeScript", "bytes": "6630" }, { "name": "HTML", "bytes": "401449" }, { "name": "JavaScript", "bytes": "238406" }, { "name": "Ruby", "bytes": "806" }, { "name": "Shell", "bytes": "2265" } ], "symlink_target": "" }
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width,initial-scale=1"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="lang:clipboard.copy" content="Copy to clipboard"> <meta name="lang:clipboard.copied" content="Copied to clipboard"> <meta name="lang:search.language" content="en"> <meta name="lang:search.pipeline.stopwords" content="True"> <meta name="lang:search.pipeline.trimmer" content="True"> <meta name="lang:search.result.none" content="No matching documents"> <meta name="lang:search.result.one" content="1 matching document"> <meta name="lang:search.result.other" content="# matching documents"> <meta name="lang:search.tokenizer" content="[\s\-]+"> <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin=""> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono:400,500,700&display=fallback"> <style> body, input { font-family: "Roboto", "Helvetica Neue", Helvetica, Arial, sans-serif } code, kbd, pre { font-family: "Roboto Mono", "Courier New", Courier, monospace } </style> <link rel="stylesheet" href="../_static/stylesheets/application.css"/> <link rel="stylesheet" href="../_static/stylesheets/application-palette.css"/> <link rel="stylesheet" href="../_static/stylesheets/application-fixes.css"/> <link rel="stylesheet" href="../_static/fonts/material-icons.css"/> <meta name="theme-color" content="#3f51b5"> <script src="../_static/javascripts/modernizr.js"></script> <title>statsmodels.tsa.vector_ar.vecm.VECMResults.pvalues_beta &#8212; statsmodels</title> <link rel="icon" type="image/png" sizes="32x32" href="../_static/icons/favicon-32x32.png"> <link rel="icon" type="image/png" sizes="16x16" href="../_static/icons/favicon-16x16.png"> <link rel="manifest" href="../_static/icons/site.webmanifest"> <link rel="mask-icon" href="../_static/icons/safari-pinned-tab.svg" color="#919191"> <meta name="msapplication-TileColor" content="#2b5797"> <meta name="msapplication-config" content="../_static/icons/browserconfig.xml"> <link rel="stylesheet" href="../_static/stylesheets/examples.css"> <link rel="stylesheet" href="../_static/material.css" type="text/css" /> <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> <link rel="stylesheet" type="text/css" href="../_static/graphviz.css" /> <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script> <script type="text/javascript" src="../_static/jquery.js"></script> <script type="text/javascript" src="../_static/underscore.js"></script> <script type="text/javascript" src="../_static/doctools.js"></script> <script type="text/javascript" src="../_static/language_data.js"></script> <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script> <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true, "ignoreClass": "document", "processClass": "math|output_area"}})</script> <link rel="shortcut icon" href="../_static/favicon.ico"/> <link rel="author" title="About these documents" href="../about.html" /> <link rel="index" title="Index" href="../genindex.html" /> <link rel="search" title="Search" href="../search.html" /> <link rel="next" title="statsmodels.tsa.vector_ar.vecm.VECMResults.pvalues_det_coef" href="statsmodels.tsa.vector_ar.vecm.VECMResults.pvalues_det_coef.html" /> <link rel="prev" title="statsmodels.tsa.vector_ar.vecm.VECMResults.pvalues_alpha" href="statsmodels.tsa.vector_ar.vecm.VECMResults.pvalues_alpha.html" /> <script src="../_static/javascripts/version_dropdown.js"></script> <script> var json_loc = "../_static/versions.json", target_loc = "../../", text = "Versions"; $( document ).ready( add_version_dropdown(json_loc, target_loc, text)); </script> </head> <body dir=ltr data-md-color-primary=indigo data-md-color-accent=blue> <svg class="md-svg"> <defs data-children-count="0"> <svg xmlns="http://www.w3.org/2000/svg" width="416" height="448" viewBox="0 0 416 448" id="__github"><path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19T128 352t-18.125-8.5-10.75-19T96 304t3.125-20.5 10.75-19T128 256t18.125 8.5 10.75 19T160 304zm160 0q0 10-3.125 20.5t-10.75 19T288 352t-18.125-8.5-10.75-19T256 304t3.125-20.5 10.75-19T288 256t18.125 8.5 10.75 19T320 304zm40 0q0-30-17.25-51T296 232q-10.25 0-48.75 5.25Q229.5 240 208 240t-39.25-2.75Q130.75 232 120 232q-29.5 0-46.75 21T56 304q0 22 8 38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0 37.25-1.75t35-7.375 30.5-15 20.25-25.75T360 304zm56-44q0 51.75-15.25 82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5T212 416q-19.5 0-35.5-.75t-36.875-3.125-38.125-7.5-34.25-12.875T37 371.5t-21.5-28.75Q0 312 0 260q0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25 30.875Q171.5 96 212 96q37 0 70 8 26.25-20.5 46.75-30.25T376 64q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34 99.5z"/></svg> </defs> </svg> <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search"> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <a href="#generated/statsmodels.tsa.vector_ar.vecm.VECMResults.pvalues_beta" tabindex="1" class="md-skip"> Skip to content </a> <header class="md-header" data-md-component="header"> <nav class="md-header-nav md-grid"> <div class="md-flex navheader"> <div class="md-flex__cell md-flex__cell--shrink"> <a href="../index.html" title="statsmodels" class="md-header-nav__button md-logo"> <img src="../_static/statsmodels-logo-v2-bw.svg" height="26" alt="statsmodels logo"> </a> </div> <div class="md-flex__cell md-flex__cell--shrink"> <label class="md-icon md-icon--menu md-header-nav__button" for="__drawer"></label> </div> <div class="md-flex__cell md-flex__cell--stretch"> <div class="md-flex__ellipsis md-header-nav__title" data-md-component="title"> <span class="md-header-nav__topic">statsmodels 0.11.0</span> <span class="md-header-nav__topic"> statsmodels.tsa.vector_ar.vecm.VECMResults.pvalues_beta </span> </div> </div> <div class="md-flex__cell md-flex__cell--shrink"> <label class="md-icon md-icon--search md-header-nav__button" for="__search"></label> <div class="md-search" data-md-component="search" role="dialog"> <label class="md-search__overlay" for="__search"></label> <div class="md-search__inner" role="search"> <form class="md-search__form" action="../search.html" method="GET" name="search"> <input type="text" class="md-search__input" name="q" placeholder="Search" autocapitalize="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <label class="md-icon md-search__icon" for="__search"></label> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> &#xE5CD; </button> </form> <div class="md-search__output"> <div class="md-search__scrollwrap" data-md-scrollfix> <div class="md-search-result" data-md-component="result"> <div class="md-search-result__meta"> Type to start searching </div> <ol class="md-search-result__list"></ol> </div> </div> </div> </div> </div> </div> <div class="md-flex__cell md-flex__cell--shrink"> <div class="md-header-nav__source"> <a href="https://github.com/statsmodels/statsmodels" title="Go to repository" class="md-source" data-md-source="github"> <div class="md-source__icon"> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24" width="28" height="28"> <use xlink:href="#__github" width="24" height="24"></use> </svg> </div> <div class="md-source__repository"> statsmodels </div> </a> </div> </div> </div> </nav> </header> <div class="md-container"> <nav class="md-tabs" data-md-component="tabs"> <div class="md-tabs__inner md-grid"> <ul class="md-tabs__list"> <li class="md-tabs__item"><a href="../user-guide.html" class="md-tabs__link">User Guide</a></li> <li class="md-tabs__item"><a href="../vector_ar.html" class="md-tabs__link">Vector Autoregressions <code class="xref py py-mod docutils literal notranslate"><span class="pre">tsa.vector_ar</span></code></a></li> <li class="md-tabs__item"><a href="statsmodels.tsa.vector_ar.vecm.VECMResults.html" class="md-tabs__link">statsmodels.tsa.vector_ar.vecm.VECMResults</a></li> </ul> </div> </nav> <main class="md-main"> <div class="md-main__inner md-grid" data-md-component="container"> <div class="md-sidebar md-sidebar--primary" data-md-component="navigation"> <div class="md-sidebar__scrollwrap"> <div class="md-sidebar__inner"> <nav class="md-nav md-nav--primary" data-md-level="0"> <label class="md-nav__title md-nav__title--site" for="__drawer"> <a href="../index.html" title="statsmodels" class="md-nav__button md-logo"> <img src="../_static/statsmodels-logo-v2-bw.svg" alt=" logo" width="48" height="48"> </a> <a href="../index.html" title="statsmodels">statsmodels 0.11.0</a> </label> <div class="md-nav__source"> <a href="https://github.com/statsmodels/statsmodels" title="Go to repository" class="md-source" data-md-source="github"> <div class="md-source__icon"> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24" width="28" height="28"> <use xlink:href="#__github" width="24" height="24"></use> </svg> </div> <div class="md-source__repository"> statsmodels </div> </a> </div> <ul class="md-nav__list"> <li class="md-nav__item"> <a href="../install.html" class="md-nav__link">Installing statsmodels</a> </li> <li class="md-nav__item"> <a href="../gettingstarted.html" class="md-nav__link">Getting started</a> </li> <li class="md-nav__item"> <a href="../user-guide.html" class="md-nav__link">User Guide</a> <ul class="md-nav__list"> <li class="md-nav__item"> <a href="../user-guide.html#background" class="md-nav__link">Background</a> </li> <li class="md-nav__item"> <a href="../user-guide.html#regression-and-linear-models" class="md-nav__link">Regression and Linear Models</a> </li> <li class="md-nav__item"> <a href="../user-guide.html#time-series-analysis" class="md-nav__link">Time Series Analysis</a> <ul class="md-nav__list"> <li class="md-nav__item"> <a href="../tsa.html" class="md-nav__link">Time Series analysis <code class="xref py py-mod docutils literal notranslate"><span class="pre">tsa</span></code></a> </li> <li class="md-nav__item"> <a href="../statespace.html" class="md-nav__link">Time Series Analysis by State Space Methods <code class="xref py py-mod docutils literal notranslate"><span class="pre">statespace</span></code></a> </li> <li class="md-nav__item"> <a href="../vector_ar.html" class="md-nav__link">Vector Autoregressions <code class="xref py py-mod docutils literal notranslate"><span class="pre">tsa.vector_ar</span></code></a> </li></ul> </li> <li class="md-nav__item"> <a href="../user-guide.html#other-models" class="md-nav__link">Other Models</a> </li> <li class="md-nav__item"> <a href="../user-guide.html#statistics-and-tools" class="md-nav__link">Statistics and Tools</a> </li> <li class="md-nav__item"> <a href="../user-guide.html#data-sets" class="md-nav__link">Data Sets</a> </li> <li class="md-nav__item"> <a href="../user-guide.html#sandbox" class="md-nav__link">Sandbox</a> </li></ul> </li> <li class="md-nav__item"> <a href="../examples/index.html" class="md-nav__link">Examples</a> </li> <li class="md-nav__item"> <a href="../api.html" class="md-nav__link">API Reference</a> </li> <li class="md-nav__item"> <a href="../about.html" class="md-nav__link">About statsmodels</a> </li> <li class="md-nav__item"> <a href="../dev/index.html" class="md-nav__link">Developer Page</a> </li> <li class="md-nav__item"> <a href="../release/index.html" class="md-nav__link">Release Notes</a> </li> </ul> </nav> </div> </div> </div> <div class="md-sidebar md-sidebar--secondary" data-md-component="toc"> <div class="md-sidebar__scrollwrap"> <div class="md-sidebar__inner"> <nav class="md-nav md-nav--secondary"> <ul class="md-nav__list" data-md-scrollfix=""> <li class="md-nav__item"><a class="md-nav__extra_link" href="../_sources/generated/statsmodels.tsa.vector_ar.vecm.VECMResults.pvalues_beta.rst.txt">Show Source</a> </li> <li id="searchbox" class="md-nav__item"></li> </ul> </nav> </div> </div> </div> <div class="md-content"> <article class="md-content__inner md-typeset" role="main"> <h1 id="generated-statsmodels-tsa-vector-ar-vecm-vecmresults-pvalues-beta--page-root">statsmodels.tsa.vector_ar.vecm.VECMResults.pvalues_beta<a class="headerlink" href="#generated-statsmodels-tsa-vector-ar-vecm-vecmresults-pvalues-beta--page-root" title="Permalink to this headline">¶</a></h1> <dl class="attribute"> <dt id="statsmodels.tsa.vector_ar.vecm.VECMResults.pvalues_beta"> <code class="sig-prename descclassname">VECMResults.</code><code class="sig-name descname">pvalues_beta</code><a class="headerlink" href="#statsmodels.tsa.vector_ar.vecm.VECMResults.pvalues_beta" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> </article> </div> </div> </main> </div> <footer class="md-footer"> <div class="md-footer-nav"> <nav class="md-footer-nav__inner md-grid"> <a href="statsmodels.tsa.vector_ar.vecm.VECMResults.pvalues_alpha.html" title="Material" class="md-flex md-footer-nav__link md-footer-nav__link--prev" rel="prev"> <div class="md-flex__cell md-flex__cell--shrink"> <i class="md-icon md-icon--arrow-back md-footer-nav__button"></i> </div> <div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title"> <span class="md-flex__ellipsis"> <span class="md-footer-nav__direction"> Previous </span> statsmodels.tsa.vector_ar.vecm.VECMResults.pvalues_alpha </span> </div> </a> <a href="statsmodels.tsa.vector_ar.vecm.VECMResults.pvalues_det_coef.html" title="Admonition" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next"> <div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title"><span class="md-flex__ellipsis"> <span class="md-footer-nav__direction"> Next </span> statsmodels.tsa.vector_ar.vecm.VECMResults.pvalues_det_coef </span> </div> <div class="md-flex__cell md-flex__cell--shrink"><i class="md-icon md-icon--arrow-forward md-footer-nav__button"></i> </div> </a> </nav> </div> <div class="md-footer-meta md-typeset"> <div class="md-footer-meta__inner md-grid"> <div class="md-footer-copyright"> <div class="md-footer-copyright__highlight"> &#169; Copyright 2009-2019, Josef Perktold, Skipper Seabold, Jonathan Taylor, statsmodels-developers. </div> Last updated on Jan 22, 2020. <br/> Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.3.1. and <a href="https://github.com/bashtage/sphinx-material/">Material for Sphinx</a> </div> </div> </div> </footer> <script src="../_static/javascripts/application.js"></script> <script>app.initialize({version: "1.0.4", url: {base: ".."}})</script> </body> </html>
{ "content_hash": "b14224e1a01109d4d2c1838f27eb1304", "timestamp": "", "source": "github", "line_count": 410, "max_line_length": 999, "avg_line_length": 42.75853658536585, "alnum_prop": 0.6063544578175802, "repo_name": "statsmodels/statsmodels.github.io", "id": "e0bd4657997994c856b49dabc72609e2f10d4755", "size": "17535", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "v0.11.0/generated/statsmodels.tsa.vector_ar.vecm.VECMResults.pvalues_beta.html", "mode": "33188", "license": "bsd-3-clause", "language": [], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <feed><tipo>Rua</tipo><logradouro>Raul Pompéia</logradouro><bairro>Arruda</bairro><cidade>Recife</cidade><uf>PE</uf><cep>52120050</cep></feed>
{ "content_hash": "59f331104fc6a6fdf1b142ccd8ddec3c", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 142, "avg_line_length": 99.5, "alnum_prop": 0.7185929648241206, "repo_name": "chesarex/webservice-cep", "id": "db2ebb5e1b7276aaaf415ece23bda40f003736fd", "size": "200", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "public/ceps/52/120/050/cep.xml", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
#ifndef OpenTypeUtilities_h #define OpenTypeUtilities_h #include <windows.h> #include <wtf/Forward.h> #include <wtf/text/WTFString.h> namespace WebCore { struct BigEndianUShort; struct EOTPrefix; class SharedBuffer; #if OS(WINCE) typedef unsigned __int8 UInt8; #endif struct EOTHeader { EOTHeader(); size_t size() const { return m_buffer.size(); } const uint8_t* data() const { return m_buffer.data(); } EOTPrefix* prefix() { return reinterpret_cast<EOTPrefix*>(m_buffer.data()); } void updateEOTSize(size_t); void appendBigEndianString(const BigEndianUShort*, unsigned short length); void appendPaddingShort(); private: Vector<uint8_t, 512> m_buffer; }; bool getEOTHeader(SharedBuffer* fontData, EOTHeader& eotHeader, size_t& overlayDst, size_t& overlaySrc, size_t& overlayLength); bool renameFont(const SharedBuffer&, const String&, Vector<char>&); HANDLE renameAndActivateFont(const SharedBuffer&, const String&); } // namespace WebCore #endif // OpenTypeUtilities_h
{ "content_hash": "8262428b061d910310dc14d4700d5fb7", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 127, "avg_line_length": 24.75609756097561, "alnum_prop": 0.7339901477832512, "repo_name": "unofficial-opensource-apple/WebCore", "id": "ab839e02363e56b0c309f9b5e254df73a8ad230d", "size": "2394", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "platform/graphics/opentype/OpenTypeUtilities.h", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "Assembly", "bytes": "3242" }, { "name": "Bison", "bytes": "11790" }, { "name": "C", "bytes": "3445018" }, { "name": "C++", "bytes": "37881487" }, { "name": "CSS", "bytes": "121894" }, { "name": "JavaScript", "bytes": "131375" }, { "name": "Makefile", "bytes": "27" }, { "name": "Objective-C", "bytes": "392661" }, { "name": "Objective-C++", "bytes": "2868092" }, { "name": "Perl", "bytes": "638219" }, { "name": "Python", "bytes": "24585" }, { "name": "Shell", "bytes": "12541" } ], "symlink_target": "" }
hackerrank ============ Ruby solutions to [HackerRank](https://www.hackerrank.com/) tasks. --- Copyright (c) 2017 Dominik Fijaś Licensed under the [MIT License](https://github.com/domininik/hackerrank/blob/master/LICENSE.md)
{ "content_hash": "76ddd4e164145ac7ca24cf7b57fbd621", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 96, "avg_line_length": 25.333333333333332, "alnum_prop": 0.7236842105263158, "repo_name": "domininik/hackerrank", "id": "dd07cdbbcdcd39d13423c669c2dc76b9bd52b7c7", "size": "229", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "31474" } ], "symlink_target": "" }
import BaseTheme from '../../../base/ui/components/BaseTheme.native'; const SECONDARY_COLOR = BaseTheme.palette.border04; const lobbyText = { ...BaseTheme.typography.heading5, color: BaseTheme.palette.text01, textAlign: 'center' }; export default { buttonStylesBorderless: { iconStyle: { color: BaseTheme.palette.icon01, fontSize: 24 }, style: { flexDirection: 'row', justifyContent: 'center', marginHorizontal: BaseTheme.spacing[3], height: 24, width: 24 }, underlayColor: 'transparent' }, lobbyChatWrapper: { backgroundColor: BaseTheme.palette.ui01, alignItems: 'stretch', flexDirection: 'column', justifyItems: 'center', height: '100%' }, lobbyChatHeader: { flexDirection: 'row', padding: 20 }, lobbyChatTitle: { color: BaseTheme.palette.text01, fontSize: 20, fontWeight: 'bold', flexShrink: 1 }, lobbyChatCloseButton: { fontSize: 24, marginLeft: BaseTheme.spacing[3], marginTop: BaseTheme.spacing[1], color: BaseTheme.palette.icon01 }, contentWrapper: { flex: 1 }, contentWrapperWide: { flex: 1, flexDirection: 'row' }, largeVideoContainer: { minHeight: '50%' }, largeVideoContainerWide: { height: '100%', marginRight: 'auto', position: 'absolute', width: '50%' }, contentContainer: { alignSelf: 'center', display: 'flex', justifyContent: 'center', minHeight: '50%', paddingHorizontal: BaseTheme.spacing[3], width: 400 }, contentContainerWide: { alignItems: 'center', height: '100%', justifyContent: 'center', left: '50%', paddingHorizontal: BaseTheme.spacing[3], position: 'absolute', width: '50%' }, toolboxContainer: { alignItems: 'center', display: 'flex', flexDirection: 'row', justifyContent: 'center', marginTop: BaseTheme.spacing[3] }, toolboxContainerWide: { flexDirection: 'row', justifyContent: 'center', marginTop: BaseTheme.spacing[3] }, displayNameText: { fontWeight: 'bold', marginVertical: 10 }, editButton: { alignSelf: 'flex-end', paddingHorizontal: 10 }, editIcon: { color: 'black', fontSize: 16 }, formWrapper: { alignSelf: 'stretch', justifyContent: 'center', marginTop: 38 }, customInput: { marginHorizontal: BaseTheme.spacing[3], textAlign: 'center' }, fieldError: { color: BaseTheme.palette.warning03, marginLeft: BaseTheme.spacing[3], fontSize: 16 }, fieldLabel: { ...BaseTheme.typography.heading6, color: BaseTheme.palette.text01, textAlign: 'center' }, standardButtonWrapper: { alignSelf: 'stretch' }, joiningMessage: { color: BaseTheme.palette.text01, marginHorizontal: BaseTheme.spacing[3], textAlign: 'center' }, passwordJoinButtonsWrapper: { alignItems: 'stretch', alignSelf: 'stretch', marginHorizontal: BaseTheme.spacing[3] }, loadingIndicator: { marginBottom: BaseTheme.spacing[3] }, participantBox: { alignItems: 'center', alignSelf: 'stretch', borderColor: SECONDARY_COLOR, borderRadius: 4, borderWidth: 1, marginVertical: 18, paddingVertical: 12 }, lobbyButton: { marginTop: BaseTheme.spacing[3] }, openChatButton: { marginHorizontal: BaseTheme.spacing[3], marginTop: BaseTheme.spacing[3] }, enterPasswordButton: { marginHorizontal: BaseTheme.spacing[3], marginTop: BaseTheme.spacing[3] }, // KnockingParticipantList knockingParticipantList: { alignSelf: 'stretch', backgroundColor: 'rgba(22, 38, 55, 0.8)', flexDirection: 'column' }, knockingParticipantListButton: { borderRadius: 4, marginHorizontal: 3, paddingHorizontal: 10, paddingVertical: 5 }, knockingParticipantListDetails: { flex: 1, marginLeft: 10 }, knockingParticipantListEntry: { alignItems: 'center', flexDirection: 'row', padding: 10 }, knockingParticipantListPrimaryButton: { backgroundColor: 'rgb(3, 118, 218)' }, knockingParticipantListSecondaryButton: { backgroundColor: 'transparent' }, knockingParticipantListText: { color: 'white' }, lobbyTitle: { ...lobbyText }, lobbyRoomName: { ...lobbyText, marginBottom: BaseTheme.spacing[2] } };
{ "content_hash": "5fdf56ca54a238a0e53a6e0446b910b1", "timestamp": "", "source": "github", "line_count": 236, "max_line_length": 69, "avg_line_length": 21.26271186440678, "alnum_prop": 0.5617776006377042, "repo_name": "jitsi/jitsi-meet", "id": "a50200229053252a4592527cb8fa0e1513933213", "size": "5028", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "react/features/lobby/components/native/styles.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "829" }, { "name": "HTML", "bytes": "20408" }, { "name": "Java", "bytes": "232895" }, { "name": "JavaScript", "bytes": "2550511" }, { "name": "Lua", "bytes": "301404" }, { "name": "Makefile", "bytes": "4160" }, { "name": "Objective-C", "bytes": "154389" }, { "name": "Ruby", "bytes": "7816" }, { "name": "SCSS", "bytes": "152946" }, { "name": "Shell", "bytes": "36422" }, { "name": "Starlark", "bytes": "152" }, { "name": "Swift", "bytes": "50411" }, { "name": "TypeScript", "bytes": "2866536" } ], "symlink_target": "" }
*一个标准的测试用例* ```java import static org.junit.junpiter.api.Assertions.fail; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterEach; import org.junit.juptier.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; class StandardTests { @BeforeAll static void initAll() { } @BeforeEach void init() { } @Test void succeedingTest() { } @Test void failingTest() { fail("a failing test"); } @Test @Disabled("for demonstration purposes") void skippedTest() { // not executed } @AfterEach void tearDown() { } @AfterAll static void tearDownAll() { } } ``` > 注意: 测试类和测试方法不需要是 `public`.
{ "content_hash": "9e7786f43d1b029cdac83cec30782dce", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 53, "avg_line_length": 15.285714285714286, "alnum_prop": 0.6688918558077437, "repo_name": "cnfn/JUnit-5-User-Guide", "id": "1ae5477a016d3c3928e2fe14bd77057ce17535f0", "size": "822", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "3.2. Standard Test Class.md", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
import { RawSourceMap } from 'source-map'; import * as webpack from 'webpack'; export declare const buildOptimizerLoaderPath: string; export default function buildOptimizerLoader(this: webpack.loader.LoaderContext, content: string, previousSourceMap: RawSourceMap): void;
{ "content_hash": "898539ce38ce59ac28275d30914510dc", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 137, "avg_line_length": 54.6, "alnum_prop": 0.8131868131868132, "repo_name": "cloudfoundry-community/asp.net5-buildpack", "id": "7599005964e16731e289e4f98f2193b59fb0591f", "size": "475", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "fixtures/node_apps/angular_dotnet/ClientApp/node_modules/@angular-devkit/build-optimizer/src/build-optimizer/webpack-loader.d.ts", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Ruby", "bytes": "61792" } ], "symlink_target": "" }
namespace session_manager { class SessionManager; } namespace chromeos { class DataPromoNotification; class EventRewriter; class EventRewriterController; class IdleActionWarningObserver; class LightBar; class MagnificationManager; class PeripheralBatteryObserver; class PowerButtonObserver; class PowerPrefs; class RendererFreezer; class SessionManagerObserver; class SwapMetrics; class WakeOnWifiManager; namespace default_app_order { class ExternalLoader; } namespace internal { class DBusServices; } class ChromeBrowserMainPartsChromeos : public ChromeBrowserMainPartsLinux { public: explicit ChromeBrowserMainPartsChromeos( const content::MainFunctionParams& parameters); virtual ~ChromeBrowserMainPartsChromeos(); // ChromeBrowserMainParts overrides. virtual void PreEarlyInitialization() override; virtual void PreMainMessageLoopStart() override; virtual void PostMainMessageLoopStart() override; virtual void PreMainMessageLoopRun() override; // Stages called from PreMainMessageLoopRun. virtual void PreProfileInit() override; virtual void PostProfileInit() override; virtual void PreBrowserStart() override; virtual void PostBrowserStart() override; virtual void PostMainMessageLoopRun() override; virtual void PostDestroyThreads() override; private: scoped_ptr<default_app_order::ExternalLoader> app_order_loader_; scoped_ptr<PeripheralBatteryObserver> peripheral_battery_observer_; scoped_ptr<PowerPrefs> power_prefs_; scoped_ptr<PowerButtonObserver> power_button_observer_; scoped_ptr<IdleActionWarningObserver> idle_action_warning_observer_; scoped_ptr<DataPromoNotification> data_promo_notification_; scoped_ptr<RendererFreezer> renderer_freezer_; scoped_ptr<LightBar> light_bar_; scoped_ptr<WakeOnWifiManager> wake_on_wifi_manager_; scoped_ptr<internal::DBusServices> dbus_services_; scoped_ptr<session_manager::SessionManager> session_manager_; scoped_ptr<EventRewriterController> keyboard_event_rewriters_; scoped_refptr<chromeos::ExternalMetrics> external_metrics_; bool use_new_network_change_notifier_; DISALLOW_COPY_AND_ASSIGN(ChromeBrowserMainPartsChromeos); }; } // namespace chromeos #endif // CHROME_BROWSER_CHROMEOS_CHROME_BROWSER_MAIN_CHROMEOS_H_
{ "content_hash": "ffb4fefdd40ad1f12d96fe155e39475d", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 75, "avg_line_length": 29.723684210526315, "alnum_prop": 0.8078795927401505, "repo_name": "Jonekee/chromium.src", "id": "bcb198b8ac6cdc97653524702ba718e43a65aa14", "size": "2794", "binary": false, "copies": "9", "ref": "refs/heads/nw12", "path": "chrome/browser/chromeos/chrome_browser_main_chromeos.h", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "AppleScript", "bytes": "6973" }, { "name": "Arduino", "bytes": "464" }, { "name": "Assembly", "bytes": "34522" }, { "name": "Batchfile", "bytes": "8451" }, { "name": "C", "bytes": "9249764" }, { "name": "C++", "bytes": "222763973" }, { "name": "CSS", "bytes": "875874" }, { "name": "Dart", "bytes": "74976" }, { "name": "Go", "bytes": "18155" }, { "name": "HTML", "bytes": "27190037" }, { "name": "Java", "bytes": "7645280" }, { "name": "JavaScript", "bytes": "18828195" }, { "name": "Makefile", "bytes": "96270" }, { "name": "Objective-C", "bytes": "1397246" }, { "name": "Objective-C++", "bytes": "7575073" }, { "name": "PHP", "bytes": "97817" }, { "name": "PLpgSQL", "bytes": "248854" }, { "name": "Perl", "bytes": "63937" }, { "name": "Protocol Buffer", "bytes": "418340" }, { "name": "Python", "bytes": "8032766" }, { "name": "Shell", "bytes": "464218" }, { "name": "Standard ML", "bytes": "4965" }, { "name": "XSLT", "bytes": "418" }, { "name": "nesC", "bytes": "18335" } ], "symlink_target": "" }
module TextAssetMixins # Change these settings to configure which minifiers will be used. # Built-in CSS Minifiers: # * CssminMinifier # * RainpressMinifier # Built-in JS Minifiers: # * JsminMinifier # * PackrMinifier # See each of these models and their related plugins for possible options @@settings = { :css_minifier => CssminMinifier, :css_minify_opts => {:enhanced => true}, :js_minifier => JsminMinifier, :js_minify_opts => {} } def self.included(base) base.class_eval do alias_method_chain :render, :minification end end def minifiable? if self.class == Stylesheet !@@settings[:css_minifier].blank? elsif self.class == Javascript !@@settings[:js_minifier].blank? end end private def render_with_minification text = render_without_minification if minifiable? && minify? then text = minify_css(text) if self.class == Stylesheet text = minify_js(text) if self.class == Javascript end text end def minify_css(text) @@settings[:css_minifier].minify(text,@@settings[:css_minify_opts]) end def minify_js(text) @@settings[:js_minifier].minify(text,@@settings[:js_minify_opts]) end end
{ "content_hash": "2b52fd1f3308e4a789af572ab14dadd0", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 75, "avg_line_length": 25.641509433962263, "alnum_prop": 0.5982339955849889, "repo_name": "cristi/radiantcasts-episodes", "id": "d16ee98ef6e4691dca2b9c9cae5fb6628a59bc49", "size": "1359", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "episode-007/radiant-sns/vendor/extensions/sns_minifier/lib/text_asset_mixins.rb", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "1096926" }, { "name": "Ruby", "bytes": "359703" } ], "symlink_target": "" }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.3.1"/> <title>PhaseVis: src/Defines.h Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">PhaseVis &#160;<span id="projectnumber">1.0-rc1</span> </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.3.1 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="pages.html"><span>Related&#160;Pages</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="files.html"><span>File&#160;List</span></a></li> </ul> </div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Pages</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="headertitle"> <div class="title">Defines.h</div> </div> </div><!--header--> <div class="contents"> <div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/* </span></div> <div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> * File: Defines.h</span></div> <div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> * Author: stup</span></div> <div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> *</span></div> <div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> * Created on August 17, 2013, 2:29 PM</span></div> <div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> */</span></div> <div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;</div> <div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="preprocessor">#ifndef DEFINES_H</span></div> <div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define DEFINES_H</span></div> <div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="preprocessor"></span></div> <div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;</div> <div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div> <div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="keyword">inline</span> <span class="keywordtype">void</span> SAFE_DELETE(T *x)</div> <div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;{</div> <div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160; <span class="keywordflow">if</span>(x){</div> <div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160; <span class="keyword">delete</span> x;</div> <div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160; x = 0;</div> <div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160; }</div> <div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;}</div> <div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;</div> <div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;</div> <div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;</div> <div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;</div> <div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* DEFINES_H */</span><span class="preprocessor"></span></div> <div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor"></span></div> </div><!-- fragment --></div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated on Tue Jan 28 2014 01:28:29 for PhaseVis by &#160;<a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.3.1 </small></address> </body> </html>
{ "content_hash": "116e4a042bb8a7b08990a1e9c7856118", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 546, "avg_line_length": 59.475806451612904, "alnum_prop": 0.6390508474576271, "repo_name": "pstupka/PhaseVis", "id": "4a40cc4549facf35c48f152ee85a6e00417a3b19", "size": "7375", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "doc/html/_defines_8h_source.html", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "C", "bytes": "6535" }, { "name": "C++", "bytes": "170293" }, { "name": "CSS", "bytes": "26076" }, { "name": "IDL", "bytes": "4359" }, { "name": "JavaScript", "bytes": "45300" }, { "name": "Shell", "bytes": "2900" } ], "symlink_target": "" }
#ifndef INPUT_H #define INPUT_H #include <stdbool.h> #include <stdio.h> #include "nstr.h" /* Use this for set_input(separator) to auto-detect the separator on the first input line. */ #define SEP_AUTO '\0' /* Use this for set_input(separator) to use no separator, i.e. read the file as single-column. * This works because linebreaks are always read as record separator (fgets/getline), never as field separator. */ #define SEP_NONE '\n' /* Use this for set_input(enclosure) to auto-detect the enclosure. */ #define ENC_AUTO '\0' /* Use this for set_input(enclosure) if the input may contain mixed enclosure characters. */ #define ENC_MIXED '\xff' /* Use this for set_input(enclosure) if your input contains typical enclosure characters but they should not be interpreted as such. * This works because linebreaks are always read as record separator (fgets/getline), never as field enclosure. */ #define ENC_NONE '\n' typedef enum trimmode { TRIM_NONE = 0, TRIM_LINES_L = 1, TRIM_LINES_R = 2, TRIM_LINES = TRIM_LINES_L | TRIM_LINES_R, } trimmode_t; typedef enum filtermode { FILTER_NONE = 0, // no filtering FILTER_EMPTY, // drop records consisting solely of empty strings FILTER_ZEROES, // drop records consisting solely of single zeroes FILTER_EMPTY_OR_ZEROES, // drop records consisting solely of single zeroes or empty strings FILTER_BLANK, // drop records consisting solely of whitespace FILTER_BLANK_OR_ZEROES, // drop records consisting solely of single zeroes or whitespace } filtermode_t; void set_input (FILE* file, char separator, char enclosure, bool allow_breaks, bool remove_bom, bool skip_after_header, size_t skip_lines, size_t limit_lines, trimmode_t trim, filtermode_t filter); size_t lineno (void); bool next_line (void); /** * Returns a pointer to an nstr containing the next field, * or NULL if there was no next field on the current line (EOL or EOF). * The pointer is only valid until the next call! */ const nstr* next_field (void); #endif // INPUT_H
{ "content_hash": "1fce8adf5d54ea8161af6bae200193c5", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 197, "avg_line_length": 34.793103448275865, "alnum_prop": 0.7314172447968286, "repo_name": "mle86/csv-parser", "id": "7ed8895d7f2adaf7386a93e349c7dfccf73b794a", "size": "2268", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "input.h", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "70144" }, { "name": "C++", "bytes": "2268" }, { "name": "Makefile", "bytes": "1486" }, { "name": "Shell", "bytes": "40386" } ], "symlink_target": "" }
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.digitaltwins.models; import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; /** The object that represents the operation. */ @Immutable public final class OperationDisplay { /* * Service provider: Microsoft DigitalTwins. */ @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) private String provider; /* * Resource Type: DigitalTwinsInstances. */ @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) private String resource; /* * Name of the operation. */ @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) private String operation; /* * Friendly description for the operation. */ @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) private String description; /** * Get the provider property: Service provider: Microsoft DigitalTwins. * * @return the provider value. */ public String provider() { return this.provider; } /** * Get the resource property: Resource Type: DigitalTwinsInstances. * * @return the resource value. */ public String resource() { return this.resource; } /** * Get the operation property: Name of the operation. * * @return the operation value. */ public String operation() { return this.operation; } /** * Get the description property: Friendly description for the operation. * * @return the description value. */ public String description() { return this.description; } /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } }
{ "content_hash": "d885c1049e890c5abd5409c22de42549", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 81, "avg_line_length": 25.65, "alnum_prop": 0.6500974658869396, "repo_name": "Azure/azure-sdk-for-java", "id": "dd56b690d6b4cfdaf45f7ec4f8ffa9d708d3169b", "size": "2052", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/OperationDisplay.java", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "8762" }, { "name": "Bicep", "bytes": "15055" }, { "name": "CSS", "bytes": "7676" }, { "name": "Dockerfile", "bytes": "2028" }, { "name": "Groovy", "bytes": "3237482" }, { "name": "HTML", "bytes": "42090" }, { "name": "Java", "bytes": "432409546" }, { "name": "JavaScript", "bytes": "36557" }, { "name": "Jupyter Notebook", "bytes": "95868" }, { "name": "PowerShell", "bytes": "737517" }, { "name": "Python", "bytes": "240542" }, { "name": "Scala", "bytes": "1143898" }, { "name": "Shell", "bytes": "18488" }, { "name": "XSLT", "bytes": "755" } ], "symlink_target": "" }
package azkaban.trigger; import java.io.IOException; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.Collections; import java.util.List; import org.apache.commons.dbutils.DbUtils; import org.apache.commons.dbutils.QueryRunner; import org.apache.commons.dbutils.ResultSetHandler; import org.apache.log4j.Logger; import org.joda.time.DateTime; import azkaban.database.AbstractJdbcLoader; import azkaban.utils.GZIPUtils; import azkaban.utils.JSONUtils; import azkaban.utils.Props; public class JdbcTriggerLoader extends AbstractJdbcLoader implements TriggerLoader { private static Logger logger = Logger.getLogger(JdbcTriggerLoader.class); private EncodingType defaultEncodingType = EncodingType.GZIP; private static final String triggerTblName = "triggers"; private static final String GET_UPDATED_TRIGGERS = "SELECT trigger_id, trigger_source, modify_time, enc_type, data FROM " + triggerTblName + " WHERE modify_time>=?"; private static String GET_ALL_TRIGGERS = "SELECT trigger_id, trigger_source, modify_time, enc_type, data FROM " + triggerTblName; private static String GET_TRIGGER = "SELECT trigger_id, trigger_source, modify_time, enc_type, data FROM " + triggerTblName + " WHERE trigger_id=?"; private static String ADD_TRIGGER = "INSERT INTO " + triggerTblName + " ( modify_time) values (?)"; private static String REMOVE_TRIGGER = "DELETE FROM " + triggerTblName + " WHERE trigger_id=?"; private static String UPDATE_TRIGGER = "UPDATE " + triggerTblName + " SET trigger_source=?, modify_time=?, enc_type=?, data=? WHERE trigger_id=?"; public EncodingType getDefaultEncodingType() { return defaultEncodingType; } public void setDefaultEncodingType(EncodingType defaultEncodingType) { this.defaultEncodingType = defaultEncodingType; } public JdbcTriggerLoader(Props props) { super(props); } @Override public List<Trigger> getUpdatedTriggers(long lastUpdateTime) throws TriggerLoaderException { logger.info("Loading triggers changed since " + new DateTime(lastUpdateTime).toString()); Connection connection = getConnection(); QueryRunner runner = new QueryRunner(); ResultSetHandler<List<Trigger>> handler = new TriggerResultHandler(); List<Trigger> triggers; try { triggers = runner.query(connection, GET_UPDATED_TRIGGERS, handler, lastUpdateTime); } catch (SQLException e) { logger.error(GET_ALL_TRIGGERS + " failed."); throw new TriggerLoaderException("Loading triggers from db failed. ", e); } finally { DbUtils.closeQuietly(connection); } logger.info("Loaded " + triggers.size() + " triggers."); return triggers; } @Override public List<Trigger> loadTriggers() throws TriggerLoaderException { logger.info("Loading all triggers from db."); Connection connection = getConnection(); QueryRunner runner = new QueryRunner(); ResultSetHandler<List<Trigger>> handler = new TriggerResultHandler(); List<Trigger> triggers; try { triggers = runner.query(connection, GET_ALL_TRIGGERS, handler); } catch (SQLException e) { logger.error(GET_ALL_TRIGGERS + " failed."); throw new TriggerLoaderException("Loading triggers from db failed. ", e); } finally { DbUtils.closeQuietly(connection); } logger.info("Loaded " + triggers.size() + " triggers."); return triggers; } @Override public void removeTrigger(Trigger t) throws TriggerLoaderException { logger.info("Removing trigger " + t.toString() + " from db."); QueryRunner runner = createQueryRunner(); try { int removes = runner.update(REMOVE_TRIGGER, t.getTriggerId()); if (removes == 0) { throw new TriggerLoaderException("No trigger has been removed."); } } catch (SQLException e) { logger.error(REMOVE_TRIGGER + " failed."); throw new TriggerLoaderException("Remove trigger " + t.toString() + " from db failed. ", e); } } @Override public void addTrigger(Trigger t) throws TriggerLoaderException { logger.info("Inserting trigger " + t.toString() + " into db."); t.setLastModifyTime(System.currentTimeMillis()); Connection connection = getConnection(); try { addTrigger(connection, t, defaultEncodingType); } catch (Exception e) { throw new TriggerLoaderException("Error uploading trigger", e); } finally { DbUtils.closeQuietly(connection); } } private synchronized void addTrigger(Connection connection, Trigger t, EncodingType encType) throws TriggerLoaderException { QueryRunner runner = new QueryRunner(); long id; try { runner.update(connection, ADD_TRIGGER, DateTime.now().getMillis()); connection.commit(); id = runner.query(connection, LastInsertID.LAST_INSERT_ID, new LastInsertID()); if (id == -1l) { logger.error("trigger id is not properly created."); throw new TriggerLoaderException("trigger id is not properly created."); } t.setTriggerId((int) id); updateTrigger(t); logger.info("uploaded trigger " + t.getDescription()); } catch (SQLException e) { throw new TriggerLoaderException("Error creating trigger.", e); } } @Override public void updateTrigger(Trigger t) throws TriggerLoaderException { if (logger.isDebugEnabled()) { logger.debug("Updating trigger " + t.getTriggerId() + " into db."); } t.setLastModifyTime(System.currentTimeMillis()); Connection connection = getConnection(); try { updateTrigger(connection, t, defaultEncodingType); } catch (Exception e) { e.printStackTrace(); throw new TriggerLoaderException("Failed to update trigger " + t.toString() + " into db!"); } finally { DbUtils.closeQuietly(connection); } } private void updateTrigger(Connection connection, Trigger t, EncodingType encType) throws TriggerLoaderException { String json = JSONUtils.toJSON(t.toJson()); byte[] data = null; try { byte[] stringData = json.getBytes("UTF-8"); data = stringData; if (encType == EncodingType.GZIP) { data = GZIPUtils.gzipBytes(stringData); } logger.debug("NumChars: " + json.length() + " UTF-8:" + stringData.length + " Gzip:" + data.length); } catch (IOException e) { throw new TriggerLoaderException("Error encoding the trigger " + t.toString()); } QueryRunner runner = new QueryRunner(); try { int updates = runner.update(connection, UPDATE_TRIGGER, t.getSource(), t.getLastModifyTime(), encType.getNumVal(), data, t.getTriggerId()); connection.commit(); if (updates == 0) { throw new TriggerLoaderException("No trigger has been updated."); } else { if (logger.isDebugEnabled()) { logger.debug("Updated " + updates + " records."); } } } catch (SQLException e) { logger.error(UPDATE_TRIGGER + " failed."); throw new TriggerLoaderException("Update trigger " + t.toString() + " into db failed. ", e); } } private static class LastInsertID implements ResultSetHandler<Long> { private static String LAST_INSERT_ID = "SELECT LAST_INSERT_ID()"; @Override public Long handle(ResultSet rs) throws SQLException { if (!rs.next()) { return -1l; } long id = rs.getLong(1); return id; } } public class TriggerResultHandler implements ResultSetHandler<List<Trigger>> { @Override public List<Trigger> handle(ResultSet rs) throws SQLException { if (!rs.next()) { return Collections.<Trigger> emptyList(); } ArrayList<Trigger> triggers = new ArrayList<Trigger>(); do { int triggerId = rs.getInt(1); int encodingType = rs.getInt(4); byte[] data = rs.getBytes(5); Object jsonObj = null; if (data != null) { EncodingType encType = EncodingType.fromInteger(encodingType); try { // Convoluted way to inflate strings. Should find common package or // helper function. if (encType == EncodingType.GZIP) { // Decompress the sucker. String jsonString = GZIPUtils.unGzipString(data, "UTF-8"); jsonObj = JSONUtils.parseJSONFromString(jsonString); } else { String jsonString = new String(data, "UTF-8"); jsonObj = JSONUtils.parseJSONFromString(jsonString); } } catch (IOException e) { throw new SQLException("Error reconstructing trigger data "); } } Trigger t = null; try { t = Trigger.fromJson(jsonObj); triggers.add(t); } catch (Exception e) { e.printStackTrace(); logger.error("Failed to load trigger " + triggerId); } } while (rs.next()); return triggers; } } private Connection getConnection() throws TriggerLoaderException { Connection connection = null; try { connection = super.getDBConnection(false); } catch (Exception e) { DbUtils.closeQuietly(connection); throw new TriggerLoaderException("Error getting DB connection.", e); } return connection; } @Override public Trigger loadTrigger(int triggerId) throws TriggerLoaderException { logger.info("Loading trigger " + triggerId + " from db."); Connection connection = getConnection(); QueryRunner runner = new QueryRunner(); ResultSetHandler<List<Trigger>> handler = new TriggerResultHandler(); List<Trigger> triggers; try { triggers = runner.query(connection, GET_TRIGGER, handler, triggerId); } catch (SQLException e) { logger.error(GET_TRIGGER + " failed."); throw new TriggerLoaderException("Loading trigger from db failed. ", e); } finally { DbUtils.closeQuietly(connection); } if (triggers.size() == 0) { logger.error("Loaded 0 triggers. Failed to load trigger " + triggerId); throw new TriggerLoaderException( "Loaded 0 triggers. Failed to load trigger " + triggerId); } return triggers.get(0); } }
{ "content_hash": "4411b9a740ed370da23d7dd793e46edd", "timestamp": "", "source": "github", "line_count": 344, "max_line_length": 90, "avg_line_length": 30.54360465116279, "alnum_prop": 0.6498524792995146, "repo_name": "wilson-lauw/azkaban2.7", "id": "99b32f981b751daab0ea9cca9b75e7bacb7f8bcb", "size": "11100", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "azkaban-common/src/main/java/azkaban/trigger/JdbcTriggerLoader.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "89692" }, { "name": "HTML", "bytes": "242224" }, { "name": "Java", "bytes": "1700583" }, { "name": "JavaScript", "bytes": "684120" }, { "name": "Shell", "bytes": "4925" } ], "symlink_target": "" }
class RenameTransactionToDonation < ActiveRecord::Migration def up rename_table(:transactions, :donations) rename_column(:transaction_charities, :transaction_id, :donation_id) rename_table(:transaction_charities, :donation_charities) end def down rename_table(:donations, :transactions) rename_column(:donation_charities, :donation_id, :transaction_id) rename_table(:donation_charities, :transaction_charities) end end
{ "content_hash": "cd1e737917b7c809cf649e38c1a1525c", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 72, "avg_line_length": 30.266666666666666, "alnum_prop": 0.751101321585903, "repo_name": "developer-star/dollar-a-day", "id": "924f7fb519b84e66d5d061860596c260006609fd", "size": "454", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "db/migrate/20130902180211_rename_transaction_to_donation.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "43157" }, { "name": "HTML", "bytes": "172155" }, { "name": "JavaScript", "bytes": "31854" }, { "name": "Ruby", "bytes": "301355" }, { "name": "Shell", "bytes": "221" } ], "symlink_target": "" }
( set -e /bin/patch -t -p1 -d /usr/libexec/mcollective/ < /var/lib/comodit/applications/mcollective-client/bug-892764.patch echo ----- ) > /var/log/comodit/mcollective-client/install.log 2>&1
{ "content_hash": "7bd973c8bf7e9b8249116cd9fb15ce21", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 114, "avg_line_length": 24.25, "alnum_prop": 0.7164948453608248, "repo_name": "comodit/demos", "id": "40022d24cc90a8ee7a3073f23d47fa1f6d7908c7", "size": "205", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "openshift/openshift-mcollective-client/files/install.sh", "mode": "33188", "license": "mit", "language": [ { "name": "PHP", "bytes": "6281" }, { "name": "Python", "bytes": "54787" }, { "name": "Shell", "bytes": "10304" } ], "symlink_target": "" }
import sys class ToleoException(Exception): ''' Base exception class. ''' def __init__(self, message, error=None): super().__init__(message) self.message = message self.error = error or 'ToleoException' def quit(self): sys.exit('{}: {}'.format(self.error, self.message))
{ "content_hash": "c8b45506f172b055b02cda6047011881", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 59, "avg_line_length": 23.285714285714285, "alnum_prop": 0.5828220858895705, "repo_name": "carlwgeorge/toleo-old", "id": "c6b251cc4b869058bf58fb518c5572d953d57f5b", "size": "326", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "toleo/exceptions.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Python", "bytes": "15246" } ], "symlink_target": "" }
import unittest import os import subprocess import hgapi # vcs, , represent version controlled directories, internal from yotta.lib import vcs # fsutils, , misc filesystem utils, internal from yotta.lib import fsutils Test_Repo_git = "git@github.com:autopulated/testing-dummy.git" Test_Repo_hg = "ssh://hg@bitbucket.org/autopulated/hg-testing-dummy" class TestGit(unittest.TestCase): @classmethod def setUpClass(cls): # test if we have a git user set up, if not we need to set one child = subprocess.Popen([ 'git','config', '--global', 'user.email' ], stdout=subprocess.PIPE, stderr=subprocess.PIPE ) out, err = child.communicate() if not len(out): commands = [ ['git','config', '--global', 'user.email', 'test@yottabuild.org'], ['git','config', '--global', 'user.name', 'Yotta Test'] ] for cmd in commands: child = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) out, err = child.communicate() cls.working_copy = vcs.Git.cloneToTemporaryDir(Test_Repo_git) @classmethod def tearDownClass(cls): cls.working_copy.remove() def test_creation(self): self.assertTrue(self.working_copy) def test_getCommitId(self): commit_id = self.working_copy.getCommitId() self.assertTrue(len(commit_id) >= 6) def test_isClean(self): self.assertTrue(self.working_copy.isClean()) fsutils.rmF(os.path.join(self.working_copy.workingDirectory(), 'module.json')) self.assertFalse(self.working_copy.isClean()) def test_commit(self): with open(os.path.join(self.working_copy.workingDirectory(), 'module.json'), "a") as f: f.write("\n") self.working_copy.markForCommit('module.json') self.working_copy.commit('test commit: DO NOT PUSH') self.assertTrue(self.working_copy.isClean()) class TestHg(unittest.TestCase): @classmethod def setUpClass(cls): # test if we have a git user set up, if not we need to set one info = hgapi.Repo.command(".", os.environ, "showconfig") if info.find("ui.username") == -1: # hg doesn't provide a way to set the username from the command line. # The HGUSER environment variable can be used for that purpose. os.environ['HGUSER'] = 'Yotta Test <test@yottabuild.org>' cls.working_copy = vcs.HG.cloneToTemporaryDir(Test_Repo_hg) @classmethod def tearDownClass(cls): cls.working_copy.remove() def test_creation(self): self.assertTrue(self.working_copy) def test_getCommitId(self): commit_id = self.working_copy.getCommitId() self.assertTrue(len(commit_id) >= 6) def test_isClean(self): self.assertTrue(self.working_copy.isClean()) fsutils.rmF(os.path.join(self.working_copy.workingDirectory(), 'module.json')) self.assertFalse(self.working_copy.isClean()) def test_commit(self): with open(os.path.join(self.working_copy.workingDirectory(), 'module.json'), "a") as f: f.write("\n") self.working_copy.markForCommit('module.json') self.working_copy.commit('test commit: DO NOT PUSH') self.assertTrue(self.working_copy.isClean()) if __name__ == '__main__': unittest.main()
{ "content_hash": "32559f956820c74e22bfd0fa141d3098", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 95, "avg_line_length": 37.09782608695652, "alnum_prop": 0.6343392909463815, "repo_name": "BlackstoneEngineering/yotta", "id": "b1e4103ee9eeb9b3128e46e18f65fcfb3ce9fe0e", "size": "3581", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "yotta/test/vcs.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CMake", "bytes": "285" }, { "name": "Python", "bytes": "402177" }, { "name": "Shell", "bytes": "3034" } ], "symlink_target": "" }
package org.traccar.notification; import org.traccar.Config; import org.traccar.model.Extensible; public class PropertiesProvider { private Config config; private Extensible extensible; public PropertiesProvider(Config config) { this.config = config; } public PropertiesProvider(Extensible extensible) { this.extensible = extensible; } public String getString(String key) { if (config != null) { return config.getString(key); } else { return extensible.getString(key); } } public String getString(String key, String defaultValue) { String value = getString(key); if (value == null) { value = defaultValue; } return value; } }
{ "content_hash": "fcc3afa685913ba4a8395d94bdc7b482", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 62, "avg_line_length": 21.18918918918919, "alnum_prop": 0.6186224489795918, "repo_name": "duke2906/traccar", "id": "e7cac8d0f26e69e0968ade75015202e8b07266b4", "size": "1401", "binary": false, "copies": "8", "ref": "refs/heads/master", "path": "src/org/traccar/notification/PropertiesProvider.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Inno Setup", "bytes": "1331" }, { "name": "Java", "bytes": "2035412" }, { "name": "Shell", "bytes": "6682" } ], "symlink_target": "" }
from django.views.generic import TemplateView class LandingPageView(TemplateView): template_name = 'tt_disposal_wells/landing.html'
{ "content_hash": "a4c412c37a9d16e54ed988d368591ce7", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 52, "avg_line_length": 27.6, "alnum_prop": 0.7971014492753623, "repo_name": "texastribune/tt_disposal_wells", "id": "cb2a594a26d36decf9ca4b8911bb4c460452c399", "size": "138", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tt_disposal_wells/views.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "5526" }, { "name": "HTML", "bytes": "11692" }, { "name": "JavaScript", "bytes": "5151" }, { "name": "Python", "bytes": "9539" }, { "name": "Ruby", "bytes": "191" } ], "symlink_target": "" }
require 'test_helper' class QuizTest < ActiveSupport::TestCase test "should not save quiz without title" do quiz = Quiz.new assert_not quiz.save end end
{ "content_hash": "fc067199178fc4910c0b6f15065c62fc", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 46, "avg_line_length": 20.75, "alnum_prop": 0.7228915662650602, "repo_name": "mikevo/uno-heterogeneous-knowledge", "id": "54e28e1de0f88f7bc44b5405687433e62b382ecf", "size": "166", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/test/models/quiz_test.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "4050" }, { "name": "CoffeeScript", "bytes": "1619" }, { "name": "HTML", "bytes": "23320" }, { "name": "JavaScript", "bytes": "1942" }, { "name": "Ruby", "bytes": "63439" } ], "symlink_target": "" }
import { Component, EventEmitter, Input, Output } from '@angular/core'; @Component({ selector: 'app-zone-inspector', templateUrl: './inspector.component.html', styleUrls: ['./inspector.component.css'] }) export class ZoneInspectorComponent { @Input() zones: string[]; @Input() acceptsInput: boolean | string[]; @Input() producesOutput: boolean; @Input() takesInput: boolean = true; @Input() isProducer: boolean = true; @Output() acceptsInputChange = new EventEmitter<boolean | string[]>(); @Output() producesOutputChange = new EventEmitter<boolean>(); isZoneSelected(zone: string): boolean { return this.acceptsInput === true || Array.isArray(this.acceptsInput) && this.acceptsInput.indexOf(zone) !== -1; } setZoneSelected(zone: string, selected: boolean): void { // if it is not an array then convert it to an array if (this.acceptsInput === true) { this.acceptsInput = this.zones.slice(); } if (this.acceptsInput === false) { this.acceptsInput = []; } // ensure there are no duplicates this.acceptsInput = this.acceptsInput.filter(input => input !== zone); // perform the selection if required if (selected === true) { this.acceptsInput.push(zone); } this.acceptsInputChange.emit(this.acceptsInput); } }
{ "content_hash": "0b5d0f4855dd867c18183ef795dcf4b5", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 120, "avg_line_length": 31.90909090909091, "alnum_prop": 0.6260683760683761, "repo_name": "UXAspects/UXAspects", "id": "974a9d9f764f36555bd875381186099fbb882952", "size": "1404", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/app/pages/components/components-sections/conduits/multiple-zones/snippets/inspector.component.ts", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "10693" }, { "name": "HTML", "bytes": "309731" }, { "name": "JavaScript", "bytes": "33008" }, { "name": "Less", "bytes": "339318" }, { "name": "TypeScript", "bytes": "2633869" } ], "symlink_target": "" }
<!-- Copyright 2015 Smart Society Services B.V. 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 --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <artifactId>osgp-protocol-adapter-oslp-elster</artifactId> <name>osgp-protocol-adapter-oslp-elster</name> <packaging>war</packaging> <!-- Description, Organization, Licenses, URL and Distribution Management elements are needed for the maven-jxr-plugin to generate a maven site --> <description>Protocol adapter for Open Street Light Protocol.</description> <parent> <groupId>org.opensmartgridplatform</groupId> <artifactId>parent-pa-oslp</artifactId> <version>4.32.0-SNAPSHOT</version> <relativePath>../parent-pa-oslp/pom.xml</relativePath> </parent> <properties> <display.version>${project.version}-${BUILD_TAG}</display.version> </properties> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.4</version> <configuration> <attachClasses>true</attachClasses> <failOnMissingWebXml>false</failOnMissingWebXml> <nonFilteredFileExtensions> <nonFilteredFileExtension>gif</nonFilteredFileExtension> <nonFilteredFileExtension>ico</nonFilteredFileExtension> <nonFilteredFileExtension>jpg</nonFilteredFileExtension> <nonFilteredFileExtension>png</nonFilteredFileExtension> <nonFilteredFileExtension>pdf</nonFilteredFileExtension> </nonFilteredFileExtensions> </configuration> </plugin> </plugins> </build> <dependencies> <!-- Alliander --> <dependency> <groupId>org.opensmartgridplatform</groupId> <artifactId>oslp</artifactId> </dependency> <dependency> <groupId>org.opensmartgridplatform</groupId> <artifactId>osgp-dto</artifactId> </dependency> <dependency> <groupId>org.opensmartgridplatform</groupId> <artifactId>shared</artifactId> </dependency> <dependency> <groupId>org.opensmartgridplatform</groupId> <artifactId>osgp-core-db-api</artifactId> </dependency> <!-- Spring Framework --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-beans</artifactId> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context-support</artifactId> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-jdbc</artifactId> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-orm</artifactId> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-tx</artifactId> </dependency> <!-- Spring WS --> <dependency> <groupId>org.springframework.ws</groupId> <artifactId>spring-ws-core</artifactId> </dependency> <dependency> <groupId>org.springframework.ws</groupId> <artifactId>spring-ws-support</artifactId> </dependency> <!-- Spring Data --> <dependency> <groupId>org.springframework.data</groupId> <artifactId>spring-data-jpa</artifactId> </dependency> <!-- Joda Time (Date/Time util) --> <dependency> <groupId>joda-time</groupId> <artifactId>joda-time</artifactId> </dependency> <!-- Hikari connection pooling --> <dependency> <groupId>com.zaxxer</groupId> <artifactId>HikariCP</artifactId> </dependency> <!-- Hibernate --> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-core</artifactId> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-entitymanager</artifactId> </dependency> <!-- Hibernate validator --> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-validator</artifactId> </dependency> <!-- Flyway (DB Migration) --> <dependency> <groupId>org.flywaydb</groupId> <artifactId>flyway-core</artifactId> </dependency> <!-- Logging --> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> </dependency> <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> </dependency> <dependency> <groupId>org.logback-extensions</groupId> <artifactId>logback-ext-spring</artifactId> </dependency> <!-- Servlet API 3.0 --> <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <scope>provided</scope> </dependency> <!-- Jakarta commons codec --> <dependency> <groupId>commons-codec</groupId> <artifactId>commons-codec</artifactId> </dependency> <!-- Apache commons --> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> </dependency> <!-- Orika (mapping framework) --> <dependency> <groupId>ma.glasnost.orika</groupId> <artifactId>orika-core</artifactId> </dependency> <!-- Netty --> <dependency> <groupId>io.netty</groupId> <artifactId>netty</artifactId> </dependency> <!-- Apache ActiveMQ --> <dependency> <groupId>org.apache.activemq</groupId> <artifactId>activemq-client</artifactId> </dependency> <dependency> <groupId>org.apache.activemq</groupId> <artifactId>activemq-spring</artifactId> </dependency> <!-- Testing dependencies --> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> </dependency> </dependencies> </project>
{ "content_hash": "6b17a823dc5c599e5bb9433ee2917f9b", "timestamp": "", "source": "github", "line_count": 212, "max_line_length": 173, "avg_line_length": 30.202830188679247, "alnum_prop": 0.6578166484460409, "repo_name": "OSGP/Protocol-Adapter-OSLP", "id": "aa821933382116735bd97963975372c9636abf89", "size": "6403", "binary": false, "copies": "1", "ref": "refs/heads/development", "path": "osgp-adapter-protocol-oslp-elster/pom.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "853583" }, { "name": "PLSQL", "bytes": "79" }, { "name": "PLpgSQL", "bytes": "1682" } ], "symlink_target": "" }
// window project doc.go /* window document */ package Window
{ "content_hash": "86b7be0a958540edeaadd2d019c0ba45", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 24, "avg_line_length": 10.5, "alnum_prop": 0.7142857142857143, "repo_name": "Triangle345/GT", "id": "a1f5ca5ae1a702520b245a4aae65b2431b9ac55b", "size": "63", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Window/doc.go", "mode": "33261", "license": "mit", "language": [ { "name": "Go", "bytes": "87550" } ], "symlink_target": "" }
package qa.softwaretesting.sandbox; import org.testng.Assert; import org.testng.annotations.Test; public class EquationTests { @Test public void test0() { Equation e = new Equation(1, 1, 1); Assert.assertEquals(e.rootNumber(), 0); } @Test public void test1() { Equation e = new Equation(1, 2, 1); Assert.assertEquals(e.rootNumber(), 1); } @Test public void test2() { Equation e = new Equation(1, 5, 6); Assert.assertEquals(e.rootNumber(), 2); } @Test public void testLinear() { Equation e = new Equation(0, 1, 1); Assert.assertEquals(e.rootNumber(), 1); } @Test public void testConstant() { Equation e = new Equation(0, 0, 1); Assert.assertEquals(e.rootNumber(), 0); } @Test public void testZero() { Equation e = new Equation(0, 0, 0); Assert.assertEquals(e.rootNumber(), -1); } }
{ "content_hash": "020b2165a8ab9772df1cb63f90fda090", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 44, "avg_line_length": 20.302325581395348, "alnum_prop": 0.6334478808705613, "repo_name": "PaulGladoon/java_tests", "id": "88d281794321e5be4ac6fa8b8984415b7dde2264", "size": "873", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "sandbox/src/test/java/qa/softwaretesting/sandbox/EquationTests.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "141571" }, { "name": "PHP", "bytes": "346" } ], "symlink_target": "" }
package com.microsoft.azure.management.eventgrid.v2018_05_01_preview.implementation; import com.microsoft.azure.management.eventgrid.v2018_05_01_preview.EventType; import com.microsoft.azure.arm.model.implementation.WrapperImpl; import rx.Observable; class EventTypeImpl extends WrapperImpl<EventTypeInner> implements EventType { private final EventGridManager manager; EventTypeImpl(EventTypeInner inner, EventGridManager manager) { super(inner); this.manager = manager; } @Override public EventGridManager manager() { return this.manager; } @Override public String description() { return this.inner().description(); } @Override public String displayName() { return this.inner().displayName(); } @Override public String id() { return this.inner().id(); } @Override public String name() { return this.inner().name(); } @Override public String schemaUrl() { return this.inner().schemaUrl(); } @Override public String type() { return this.inner().type(); } }
{ "content_hash": "ab0e7617f448e720b840378966cc7e9d", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 84, "avg_line_length": 21.12962962962963, "alnum_prop": 0.6546888694127958, "repo_name": "hovsepm/azure-sdk-for-java", "id": "e0bd9fa1a502028ca45a96d47711af76cfe44aac", "size": "1371", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "eventgrid/resource-manager/v2018_05_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2018_05_01_preview/implementation/EventTypeImpl.java", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "6821" }, { "name": "HTML", "bytes": "1250" }, { "name": "Java", "bytes": "103388992" }, { "name": "JavaScript", "bytes": "8139" }, { "name": "PowerShell", "bytes": "160" }, { "name": "Python", "bytes": "3855" }, { "name": "Shell", "bytes": "609" } ], "symlink_target": "" }
<?php declare(strict_types=1); namespace Talesweaver\Application\Query\Scene; use Talesweaver\Application\Bus\QueryHandlerInterface; use Talesweaver\Domain\Scene; use Talesweaver\Domain\Scenes; class ByIdHandler implements QueryHandlerInterface { /** * @var Scenes */ private $scenes; public function __construct(Scenes $scenes) { $this->scenes = $scenes; } public function __invoke(ById $query): ?Scene { return $this->scenes->find($query->getId()); } }
{ "content_hash": "6857fe51b4ac0fa8b2d888cac6aa1191", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 54, "avg_line_length": 19.22222222222222, "alnum_prop": 0.6685934489402697, "repo_name": "szymach/talesweaver", "id": "15fafa70366373e5e479fe51a0673fd19a8e72d5", "size": "519", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Application/Query/Scene/ByIdHandler.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "11701" }, { "name": "HTML", "bytes": "101050" }, { "name": "JavaScript", "bytes": "20029" }, { "name": "PHP", "bytes": "859763" }, { "name": "TypeScript", "bytes": "21546" } ], "symlink_target": "" }
<!DOCTYPE html> <html ng-app="TreeViewApp" id="ng-app"> <head> <meta charset="utf-8"> <style> .node { cursor: pointer; } .node circle { fill: #fff; stroke: steelblue; stroke-width: 3px; } .node text { font: 12px sans-serif; } .link { fill: none; stroke: #ccc; stroke-width: 2px; } </style> <title>VMI Tool</title> <script>document.write('<base href="' + document.location + '" />');</script> <script src="../../lib/angular/angular.js"></script> <link rel="stylesheet" href="../../lib/bootstrap/dist/css/bootstrap.css"/> <link rel="stylesheet" href="../../lib/bootstrap/dist/css/bootstrap-theme.css"/> <script src="http://d3js.org/d3.v3.min.js"></script> <script type="text/javascript"> var appInIframe = angular.module('TreeViewApp', []); appInIframe.factory('$parentScope', function($window) { return $window.parent.angular.element($window.frameElement).scope(); }); appInIframe.controller('ChildController', function($scope, $parentScope, $window, $timeout) { $scope.message = function(msg) { var img = $window.saveAsPng(); $parentScope.$emit('save-treeView', img); // $parentScope.$apply(); if ($parentScope.$root.$$phase != '$apply' && $parentScope.$root.$$phase != '$digest') { $parentScope.$apply(); } }; $parentScope.$on('from-parent', function(e, message) { $window.createTree(message.children, message.parents, message.rootNode, message.nodeColors); $timeout(function(){ generateTreeImage(); }, 2000); }); $parentScope.$on('save-png', function(e, message) { $scope.message('save me'); var img = '$window.saveAsPng()'; $parentScope.$emit('close-hierarchy', img); }); $scope.getParentMessage = function() { var curScr = $parentScope.loadXML(); }; $scope.showImage=false; }); </script> </head> <body ng-controller="ChildController" ng-init="getParentMessage()"> <div id="svgtree"></div> <div ng-show="showImage"> <button id="save">Save as Image</button> <h4>SVG dataurl:</h4> <div id="svgdataurl"></div> <h4>SVG converted to PNG dataurl via HTML5 CANVAS:</h4> <div id="pngdataurl"></div> <h4>SVG converted to PNG dataurl via HTML5 CANVAS and then converted into a filename using :</h4> <div id="pngdataurl"></div> <canvas width="960" height="950" style="display: none"></canvas> <pre id="file-content"></pre> </div> <script> // var parents = undefined; // var children = undefined; var treeNode = {}, frameNode={}; var imgFileName = ''; var superParentFound = true; var superParent = ''; var superParentColor = ''; function createTree(children, parents, rootNode, nodeColors){ var currchild={}; var emptyNode = {}; var colors = []; imgFileName = rootNode + '.png'; for (var p=0, pl = parents.length; p < pl; p++){ if (parents[p]==='N/A' || parents[p]===undefined || parents[p]===''){ superParent = children[p]; parents.splice(p,1); children.splice(p,1); superParentColor = nodeColors[p]; nodeColors.splice(p,1); break; } } for (var c=0, cl = children.length; c < cl; c++){ if (c===0){ colors.push('red'); }else if(c%2===0){ colors.push('blue'); }else{ colors.push('green'); } } frameNode = {"name": superParent,"parent": "null", "type":superParentColor}; // frameNode = {"name": rootNode,"parent": "null","children": []}; for (var i=0; i < children.length; i++){ var childNode = {"name":children[i], "parent":parents[i], "type":nodeColors[i]}; var currparent = findParentNode(parents[i], treeNode); if (JSON.stringify(currparent)==='{}'){ currparent.name = frameNode.name; currparent.parent = frameNode.parent; } if (currparent.hasOwnProperty('children')){ currparent.children[currparent.children.length] = childNode; }else{ var childs = [childNode] currparent.children = childs; } var parentOfParent = findParentNode(currparent.parent, treeNode); if (JSON.stringify(treeNode) === '{}'){ treeNode = currparent; }/*else if (parentOfParent.parent === treeNode.name){ // treeNode.children[treeNode.children.length] = parentOfParent; }else if (parentOfParent.name !== treeNode.name){ // treeNode = parentOfParent; }*/ } generateTree(); } function findParentNode(parent, parentTree){ if (JSON.stringify(parentTree) === '{}') return {}; if (JSON.stringify(parentTree) === JSON.stringify(frameNode)) return parentTree; if (parentTree.name === parent) return parentTree; for (var i=0; i < parentTree.children.length; i++){ var childNode = parentTree.children[i]; if (childNode.name === parent){ return childNode; }else if(childNode.parent === parent){ return findParentNode(parent, treeNode); }else if(childNode.hasOwnProperty('children')){ var lvl2Parent = findParentNode(parent, childNode); if (lvl2Parent === {}) continue; if (lvl2Parent.name === parent) return lvl2Parent; } } // return {}; return treeNode; } var treeData = undefined; // ************** Generate the tree diagram ***************** var margin = {top: 20, right: 120, bottom: 20, left: 120}, width = 960 - margin.right - margin.left, height = 950 - margin.top - margin.bottom; var i = 0, duration = 750, root; var tree = d3.layout.tree() .size([height, width]); var diagonal = d3.svg.diagonal() .projection(function(d) { return [d.y, d.x]; }); // var svg = d3.select("body").append("svg") var svg = d3.select("#svgtree").append("svg") .attr("width", width + margin.right + margin.left) .attr("height", height + margin.top + margin.bottom) .append("g") .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); function generateTree(){ treeData = [treeNode]; root = treeData[0]; root.x0 = height / 2; root.y0 = 0; update(root); d3.select(self.frameElement).style("height", "700px"); } function generateTreeImage(){ /***************/ var html = d3.select("svg") .attr("version", 1.1) .attr("xmlns", "http://www.w3.org/2000/svg") .node().parentNode.innerHTML; var binary = ''; var bytes = new Uint8Array(html); var len = bytes.byteLength; for (var i = 0; i < len; i++) { binary += String.fromCharCode(bytes[i]); } var imgsrc = 'data:image/svg+xml;base64,'+ btoa(html); var img = '<img src="'+imgsrc+'">'; var image = new Image; // d3.select("#svgdataurl").html(img); var canvas = document.querySelector("canvas"), context = canvas.getContext("2d"); context.shadowBlur = 1; image.src = imgsrc; image.onload = function() { context.drawImage(image, 0, 0); var element = document.getElementById('file-content'); element.innerHTML = canvas.toDataURL("image/png"); //save and serve it as an actual filename binaryblob(); var a = document.createElement("a"); a.download = imgFileName; a.href = canvas.toDataURL("image/png"); var pngimg = "<img src='"+a.href+"''>"; d3.select("#pngdataurl").html(pngimg); a.click(); } } function update(source) { // Compute the new tree layout. var nodes = tree.nodes(root).reverse(), links = tree.links(nodes); // Normalize for fixed-depth. nodes.forEach(function(d) { d.y = d.depth * 180; }); // Update the nodes… var node = svg.selectAll("g.node") .data(nodes, function(d) { return d.id || (d.id = ++i); }); // Enter any new nodes at the parent's previous position. var nodeEnter = node.enter().append("g") .attr("class", "node") .attr("transform", function(d) { return "translate(" + source.y0 + "," + source.x0 + ")"; }) .on("click", click); /* nodeEnter.append("circle") .attr("r", 1e-6) .style("stroke", function(d) { return (d.type===undefined) ? superParentColor : d.type; }) .style("fill", function(d) { return (d.type===undefined) ? superParentColor : d.type; }); */ // .style("fill", function(d) { return d._children ? "lightsteelblue" : d.type; }); nodeEnter.append("path") .style("stroke", function(d) { return (d.type===undefined) ? superParentColor : d.type; }) .style("fill", function(d) { return (d.type===undefined) ? superParentColor : d.type; }) .attr("d", d3.svg.symbol() .size(200) .type(function(d) { if (d.type === undefined) { return "circle"; } else if (d.type === 'grey') { return "circle"; } else if (d.type === 'blue') { return "cross"; } else if (d.type === 'green') { return "square"; } else if (d.type === 'red') { return "diamond";} })); nodeEnter.append("text") .attr("x", function(d) { return d.children || d._children ? -13 : 13; }) .attr("dy", ".35em") .attr("text-anchor", function(d) { return d.children || d._children ? "end" : "start"; }) .text(function(d) { return d.name; }) .style("fill-opacity", function(d) { return (d.type===undefined) ? superParentColor : d.type; }); // Transition nodes to their new position. var nodeUpdate = node.transition() .duration(duration) .attr("transform", function(d) { return "translate(" + d.y + "," + d.x + ")"; }); nodeUpdate.select("circle") .attr("r", 10) .style("fill", function(d) { return (d.type===undefined) ? superParentColor : d.type; }); nodeUpdate.select("text") .style("fill-opacity", 1); // Transition exiting nodes to the parent's new position. var nodeExit = node.exit().transition() .duration(duration) .attr("transform", function(d) { return "translate(" + source.y + "," + source.x + ")"; }) .remove(); nodeExit.select("circle") .attr("r", 1e-6); nodeExit.select("text") .style("fill-opacity", 1e-6); // Update the links… var link = svg.selectAll("path.link") .data(links, function(d) { return d.target.id; }); // Enter any new links at the parent's previous position. link.enter().insert("path", "g") .attr("class", "link") .style("stroke", function(d) { return d.target.type; }) .attr("d", function(d) { var o = {x: source.x0, y: source.y0}; return diagonal({source: o, target: o}); }); // Transition links to their new position. link.transition() .duration(duration) .attr("d", diagonal); // Transition exiting nodes to the parent's new position. link.exit().transition() .duration(duration) .attr("d", function(d) { var o = {x: source.x, y: source.y}; return diagonal({source: o, target: o}); }) .remove(); // Stash the old positions for transition. nodes.forEach(function(d) { d.x0 = d.x; d.y0 = d.y; }); } // Toggle children on click. function click(d) { if (d.children) { d._children = d.children; d.children = null; } else { d.children = d._children; d._children = null; } update(d); } var hierImg = undefined; function saveAsPng(){ // var retimg = canvas.toDataURL("image/png"); return document.getElementById('file-content').innerHTML; } d3.select("#save").on("click", function(){ var html = d3.select("svg") .attr("version", 1.1) .attr("xmlns", "http://www.w3.org/2000/svg") .node().parentNode.innerHTML; var binary = ''; var bytes = new Uint8Array(html); var len = bytes.byteLength; for (var i = 0; i < len; i++) { binary += String.fromCharCode(bytes[i]); } var imgsrc = 'data:image/svg+xml;base64,'+ btoa(html); var img = '<img src="'+imgsrc+'">'; var image = new Image; d3.select("#svgdataurl").html(img); var canvas = document.querySelector("canvas"), context = canvas.getContext("2d"); image.src = imgsrc; image.onload = function() { context.drawImage(image, 0, 0); //save and serve it as an actual filename binaryblob(); var a = document.createElement("a"); a.download = imgFileName; a.href = canvas.toDataURL("image/png"); var element = document.getElementById('file-content'); element.innerHTML = canvas.toDataURL("image/png"); var pngimg = "<img src='"+a.href+"''>"; d3.select("#pngdataurl").html(pngimg); // a.click(); } }); function getBlob(){ var byteString = atob(document.querySelector("canvas").toDataURL().replace(/^data:image\/(png|jpg);base64,/, "")); //wtf is atob?? https://developer.mozilla.org/en-US/docs/Web/API/Window.atob var ab = new ArrayBuffer(byteString.length); var ia = new Uint8Array(ab); for (var i = 0; i < byteString.length; i++) { ia[i] = byteString.charCodeAt(i); } var dataView = new DataView(ab); var blob = new Blob([dataView], {type: "image/png"}); return blob; } function binaryblob(){ var byteString = atob(document.querySelector("canvas").toDataURL().replace(/^data:image\/(png|jpg);base64,/, "")); //wtf is atob?? https://developer.mozilla.org/en-US/docs/Web/API/Window.atob var ab = new ArrayBuffer(byteString.length); var ia = new Uint8Array(ab); for (var i = 0; i < byteString.length; i++) { ia[i] = byteString.charCodeAt(i); } var dataView = new DataView(ab); var blob = new Blob([dataView], {type: "image/png"}); var DOMURL = self.URL || self.webkitURL || self; var newurl = DOMURL.createObjectURL(blob); var img = '<img src="'+newurl+'">'; d3.select("#img").html(img); } </script> </body> </html>
{ "content_hash": "1df34ec78daa630a8968ed5cb39606d9", "timestamp": "", "source": "github", "line_count": 469, "max_line_length": 197, "avg_line_length": 31.671641791044777, "alnum_prop": 0.5512319913827926, "repo_name": "gadiga/capture-tool", "id": "942c3c7c5cba9853aada6dbb82d20ab34f03c9ac", "size": "14858", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "public/modules/gafxmls/TreeView.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "5199" }, { "name": "HTML", "bytes": "275053" }, { "name": "JavaScript", "bytes": "438081" }, { "name": "Shell", "bytes": "4074" } ], "symlink_target": "" }
package org.kaaproject.kaa.server.common.nosql.mongo.dao; import org.kaaproject.kaa.common.dto.NotificationDto; import org.kaaproject.kaa.server.common.dao.impl.NotificationDao; import org.kaaproject.kaa.server.common.nosql.mongo.dao.model.MongoNotification; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Repository; import java.util.List; import static org.kaaproject.kaa.common.dto.NotificationTypeDto.SYSTEM; import static org.kaaproject.kaa.common.dto.NotificationTypeDto.USER; import static org.kaaproject.kaa.server.common.nosql.mongo.dao.model.MongoModelConstants.ID; import static org.kaaproject.kaa.server.common.nosql.mongo.dao.model.MongoModelConstants.NF_SEQ_NUM; import static org.kaaproject.kaa.server.common.nosql.mongo.dao.model.MongoModelConstants.NF_TOPIC_ID; import static org.kaaproject.kaa.server.common.nosql.mongo.dao.model.MongoModelConstants.NF_TYPE; import static org.kaaproject.kaa.server.common.nosql.mongo.dao.model.MongoModelConstants.NF_VERSION; import static org.kaaproject.kaa.server.common.nosql.mongo.dao.model.MongoModelConstants.NOTIFICATION; import static org.springframework.data.mongodb.core.query.Criteria.where; import static org.springframework.data.mongodb.core.query.Query.query; @Repository public class NotificationMongoDao extends AbstractMongoDao<MongoNotification, String> implements NotificationDao<MongoNotification> { private static final Logger LOG = LoggerFactory.getLogger(NotificationMongoDao.class); @Override protected String getCollectionName() { return NOTIFICATION; } @Override protected Class<MongoNotification> getDocumentClass() { return MongoNotification.class; } @Override public void removeById(String id) { LOG.debug("Remove notification by id [{}]", id); remove(query(where(ID).is(id))); } @Override public List<MongoNotification> findNotificationsByTopicId(String topicId) { LOG.debug("Find notifications by topic id [{}]", topicId); return find(query(where(NF_TOPIC_ID).is(topicId))); } @Override public void removeNotificationsByTopicId(String topicId) { LOG.debug("Remove notifications by topic id [{}]", topicId); remove(query(where(NF_TOPIC_ID).is(topicId))); } @Override public List<MongoNotification> findNotificationsByTopicIdAndVersionAndStartSecNum(String topicId, int seqNumber, int sysNfVersion, int userNfVersion) { LOG.debug("Find notifications by topic id [{}], sequence number start [{}], system schema version [{}], user schema version [{}]", topicId, seqNumber, sysNfVersion, userNfVersion); return find(query(where(NF_TOPIC_ID).is(topicId).and(NF_SEQ_NUM).gt(seqNumber) .orOperator(where(NF_VERSION).is(sysNfVersion).and(NF_TYPE).is(SYSTEM), where(NF_VERSION).is(userNfVersion).and(NF_TYPE).is(USER)))); } @Override public MongoNotification save(NotificationDto notification) { return save(new MongoNotification(notification)); } }
{ "content_hash": "5833b2e1453dd0a529e743da66e18bf7", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 155, "avg_line_length": 43.901408450704224, "alnum_prop": 0.7500802053256336, "repo_name": "vzhukovskyi/kaa", "id": "f4fd51347f49e630d724472063b6cbd5034e1982", "size": "3718", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "server/common/nosql/mongo-dao/src/main/java/org/kaaproject/kaa/server/common/nosql/mongo/dao/NotificationMongoDao.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Arduino", "bytes": "22520" }, { "name": "C", "bytes": "1018980" }, { "name": "C++", "bytes": "1255365" }, { "name": "CMake", "bytes": "54170" }, { "name": "CSS", "bytes": "18207" }, { "name": "HTML", "bytes": "4788" }, { "name": "Java", "bytes": "13789776" }, { "name": "Makefile", "bytes": "1467" }, { "name": "Python", "bytes": "128276" }, { "name": "Shell", "bytes": "153256" }, { "name": "Thrift", "bytes": "20997" }, { "name": "XSLT", "bytes": "4062" } ], "symlink_target": "" }
a web API for [Assignment 1][assignment1] - __Lead Maintainer:__ [Kristina Matuleviciute][Lead] ## Overview Assignment 1 - Simple app with [ReactJS] - for client side, [Webpack] for module bundle and [Expressjs] for server side. 3 views: Home page, Table with friends' contacts information and add, delete functions, Picture gallery as a slide show. This application is responsive, all views are availble in smaller screens. Assignment 2 - A web API for Assignment 1. The integrated API with Reactapp. Technologies: Node, Express, MongoDB, Mongoose. ## Installation requirements ## Install To install the app locally, simply clone the repo, ``` git clone https://github.com/KristinaMatuleviciute/reactapp_restapi.git cd reactapp ``` Next, install via npm, ``` npm install ``` ## Running To run app: ``` npm run start ``` In a different terminal window run (you need to have mongodb installed): ``` sudo mongod ``` ## Routing between server side and client side [index.js][index]: Get all users: GET /api/users/ Create user: POST /api/users/ Update user: PUT /api/users/:id Delete user: DELETE /api/users/:id Get user's profile page: api/users/profile/:id ## License Copyright (c) 2017, Kristina Matuleviciute. Licensed under [MIT]. [MIT]: https://github.com/KristinaMatuleviciute/reactapp_restapi/blob/master/LICENSE.md [Lead]: https://github.com/KristinaMatuleviciute [assignment1]:https://github.com/KristinaMatuleviciute/reactapp [index]:https://github.com/KristinaMatuleviciute/reactapp_restapi/blob/master/api/users/index.js
{ "content_hash": "9a166f016128ddeb72260c4955e738c7", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 197, "avg_line_length": 25.419354838709676, "alnum_prop": 0.7423857868020305, "repo_name": "KristinaMatuleviciute/reactapp_restapi", "id": "ee846f3c9f67b2558495ed1a87c3339054595519", "size": "1613", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "30988" }, { "name": "JavaScript", "bytes": "1714089" } ], "symlink_target": "" }
define([ "jquery", "lib/mixins/events" ], function($, asEventEmitter) { "use strict"; var LISTENER = "#js-card-holder"; function Stack(args) { var defaults = { el: ".js-stack", list: ".js-card" }; this.config = $.extend({}, defaults, args); this.$el = $(this.config.el); this.list = this.config.list; if (this.$el.length) { this._init(); } } asEventEmitter.call(Stack.prototype); Stack.prototype._init = function() { this._listen(); this._broadcast(); }; Stack.prototype._listen = function() { var _this = this; $(LISTENER).on(":cards/request", function() { _this._block(); _this._addLoader(); }); $(LISTENER).on(":cards/received", function(e, data) { _this._removeLoader(); _this._clear(); _this._add(data.content); }); $(LISTENER).on(":cards/append/received", function(e, data) { _this._add(data.content); }); $(LISTENER).on(":page/request", function() { _this._block(); _this._addLoader(); }); $(LISTENER).on(":page/received", function(e, data) { _this._removeLoader(); _this._clear(); _this._add(data.content); }); $(LISTENER).on(":search/change", function() { _this._block(); }); }; Stack.prototype._broadcast = function() { var _this = this; this.$el.on("click", ".js-card.is-disabled", function(e) { e.preventDefault(); _this._unblock(); _this.trigger(":search/hide"); }); this.$el.on("click", ".js-clear-all-filters", function(e) { e.preventDefault(); _this.trigger(":filter/reset"); }); this.$el.on("click", ".js-adjust-dates", function(e) { e.preventDefault(); _this.trigger(":search/change"); }); }; Stack.prototype._addLoader = function() { this.$el.addClass("is-loading"); }; Stack.prototype._removeLoader = function() { this.$el.removeClass("is-loading"); }; Stack.prototype._block = function() { this.$el.find(this.list).addClass("is-disabled"); }; Stack.prototype._unblock = function() { this.$el.find(this.list).removeClass("is-disabled"); }; Stack.prototype._clear = function() { this.$el.find(this.list).remove(); }; Stack.prototype._add = function(newCards) { var $cards = $(newCards).addClass("is-invisible"); this.$el.append($cards); this._show($cards); }; Stack.prototype._show = function($cards) { var insertCards, _this = this, i = 0; insertCards = setInterval(function() { var $image; if (i !== $cards.length) { $image = $cards.eq(i).removeClass("is-invisible").find(".js-card__image"); i++; } else { _this.trigger(":page/changed"); clearInterval(insertCards); } }, 20); }; return Stack; });
{ "content_hash": "a0e6c3181068901e218826b883c09f5d", "timestamp": "", "source": "github", "line_count": 131, "max_line_length": 82, "avg_line_length": 21.870229007633586, "alnum_prop": 0.5542757417102967, "repo_name": "lonelyplanet/rizzo", "id": "75952c20995e214ccacaf0639ae116a748b6a977", "size": "2865", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "app/assets/javascripts/lib/page/stack.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "304981" }, { "name": "Gherkin", "bytes": "4333" }, { "name": "HTML", "bytes": "309679" }, { "name": "JavaScript", "bytes": "1563881" }, { "name": "Python", "bytes": "2485" }, { "name": "Ruby", "bytes": "144382" }, { "name": "Shell", "bytes": "683" } ], "symlink_target": "" }
RELEASE HISTORY =============== 0.0.43 (8/19/2025) ------------------ Release Notes ~~~~~~~~~~~~~ This release makes the isolated jvm compile strategy viable out-of-the-box for use with large dependency graphs. Without it, `test.junit` and `run.jvm` performance slows down significantly due to the large number of loose classfile directories. Please try it out in your repo by grabbing a copy of `pants.ini.isolated <https://github.com/pantsbuild/pants/blob/master/pants.ini.isolated>`_ and using a command like:: ./pants --config-override=pants.ini.isolated test examples/{src,tests}/{scala,java}/:: You'll like the results. Just update your own `pants.ini` with the pants.ini.isolated settings to use it by default! In the medium term, we're interested in making the isolated strategy the default jvm compilation strategy, so your assistance and feedback is appreciated! Special thanks to Stu Hood and Nick Howard for lots of work over the past months to get this point. API Changes ~~~~~~~~~~~ * A uniform way of expressing Task and Subsystem dependencies. `Issue #1957 <https://github.com/pantsbuild/pants/issues/1957>`_ `RB #2653 <https://rbcommons.com/s/twitter/r/2653>`_ * Remove some coverage-related options from test.junit. `RB #2639 <https://rbcommons.com/s/twitter/r/2639>`_ * Bump mock and six 3rdparty versions to latest `RB #2633 <https://rbcommons.com/s/twitter/r/2633>`_ * Re-implement suppression of output from compiler workunits `RB #2590 <https://rbcommons.com/s/twitter/r/2590>`_ Bugfixes ~~~~~~~~ * Improved go remote library support. `RB #2655 <https://rbcommons.com/s/twitter/r/2655>`_ * Shorten isolation generated jar paths `RB #2647 <https://rbcommons.com/s/twitter/r/2647>`_ * Fix duplicate login options when publishing. `RB #2560 <https://rbcommons.com/s/twitter/r/2560>`_ * Fixed no attribute exception in changed goal. `RB #2645 <https://rbcommons.com/s/twitter/r/2645>`_ * Fix goal idea issues with mistakenly identifying a test folder as regular code, missing resources folders, and resources folders overriding code folders. `RB #2046 <https://rbcommons.com/s/twitter/r/2046>`_ `RB #2642 <https://rbcommons.com/s/twitter/r/2642>`_ New Features ~~~~~~~~~~~~ * Support for running junit tests with different jvm versions. `RB #2651 <https://rbcommons.com/s/twitter/r/2651>`_ * Add support for jar'ing compile outputs in the isolated strategy. `RB #2643 <https://rbcommons.com/s/twitter/r/2643>`_ * Tests for 'java-resoures' and 'java-test-resources' in idea `RB #2046 <https://rbcommons.com/s/twitter/r/2046>`_ `RB #2634 <https://rbcommons.com/s/twitter/r/2634>`_ Small improvements, Refactoring and Tooling ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Filter zinc compilation warnings at the Reporter level `RB #2656 <https://rbcommons.com/s/twitter/r/2656>`_ * Update to sbt 0.13.9. `RB #2629 <https://rbcommons.com/s/twitter/r/2629>`_ * Speeding up jvm-platform-validate step. `Issue #1972 <https://github.com/pantsbuild/pants/issues/1972>`_ `RB #2626 <https://rbcommons.com/s/twitter/r/2626>`_ * Added test that failed HTTP responses do not raise exceptions in artifact cache `RB #2624 <https://rbcommons.com/s/twitter/r/2624>`_ `RB #2644 <https://rbcommons.com/s/twitter/r/2644>`_ * Tweak to option default extraction for help display. `RB #2640 <https://rbcommons.com/s/twitter/r/2640>`_ * A few small install doc fixes. `RB #2638 <https://rbcommons.com/s/twitter/r/2638>`_ * Detect new package when doing ownership checks. `RB #2637 <https://rbcommons.com/s/twitter/r/2637>`_ * Use os.path.realpath on test tmp dirs to appease OSX. `RB #2635 <https://rbcommons.com/s/twitter/r/2635>`_ * Update the pants install documentation. #docfixit `RB #2631 <https://rbcommons.com/s/twitter/r/2631>`_ 0.0.42 (8/14/2025) ------------------ Release Notes ~~~~~~~~~~~~~ This was #docfixit week, so the release contains more doc and help improvements than usual. Thanks in particular to Benjy for continued `./pants help` polish! This release also add support for golang in the `contrib/go` package. Thanks to Cody Gibb and John Sirois for that work. API Changes ~~~~~~~~~~~ * Elevate the pants version to a first class option `RB #2627 <https://rbcommons.com/s/twitter/r/2627>`_ * Support pants plugin resolution for easier inclusion of published plugins `RB #2615 <https://rbcommons.com/s/twitter/r/2615>`_ `RB #2622 <https://rbcommons.com/s/twitter/r/2622>`_ * Pin pex==1.0.3, alpha-sort & remove line breaks `RB #2598 <https://rbcommons.com/s/twitter/r/2598>`_ `RB #2596 <https://rbcommons.com/s/twitter/r/2596>`_ * Moved classifier from IvyArtifact to IvyModuleRef `RB #2579 <https://rbcommons.com/s/twitter/r/2579>`_ Bugfixes ~~~~~~~~ * Ignore 'NonfatalArtifactCacheError' when calling the artifact cache in the background `RB #2624 <https://rbcommons.com/s/twitter/r/2624>`_ * Re-Add debug option to benchmark run task, complain on no jvm targets, add test `RB #2619 <https://rbcommons.com/s/twitter/r/2619>`_ * Fixed what_changed for removed files `RB #2589 <https://rbcommons.com/s/twitter/r/2589>`_ * Disable jvm-platform-analysis by default `Issue #1972 <https://github.com/pantsbuild/pants/issues/1972>`_ `RB #2618 <https://rbcommons.com/s/twitter/r/2618>`_ * Fix ./pants help_advanced `RB #2616 <https://rbcommons.com/s/twitter/r/2616>`_ * Fix some more missing globs in build-file-rev mode. `RB #2591 <https://rbcommons.com/s/twitter/r/2591>`_ * Make jvm bundles output globs in filedeps with --globs. `RB #2583 <https://rbcommons.com/s/twitter/r/2583>`_ * Fix more realpath issues `Issue #1933 <https://github.com/pantsbuild/pants/issues/1933>`_ `RB #2582 <https://rbcommons.com/s/twitter/r/2582>`_ New Features ~~~~~~~~~~~~ * Allow plaintext-reporter to be able to respect a task's --level and --colors options. `RB #2580 <https://rbcommons.com/s/twitter/r/2580>`_ `RB #2614 <https://rbcommons.com/s/twitter/r/2614>`_ * contrib/go: Support for Go `RB #2544 <https://rbcommons.com/s/twitter/r/2544>`_ * contrib/go: Setup a release sdist `RB #2609 <https://rbcommons.com/s/twitter/r/2609>`_ * contrib/go: Remote library support `RB #2611 <https://rbcommons.com/s/twitter/r/2611>`_ `RB #2623 <https://rbcommons.com/s/twitter/r/2623>`_ * contrib/go: Introduce GoDistribution `RB #2595 <https://rbcommons.com/s/twitter/r/2595>`_ * contrib/go: Integrate GoDistribution with GoTask `RB #2600 <https://rbcommons.com/s/twitter/r/2600>`_ * Add support for android compilation with contrib/scrooge `RB #2553 <https://rbcommons.com/s/twitter/r/2553>`_ Small improvements, Refactoring and Tooling ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Added more testimonials to the Powered By page. #docfixit `RB #2625 <https://rbcommons.com/s/twitter/r/2625>`_ * Fingerprint more task options; particularly scalastyle configs `RB #2628 <https://rbcommons.com/s/twitter/r/2628>`_ * Fingerprint jvm tools task options by default `RB #2620 <https://rbcommons.com/s/twitter/r/2620>`_ * Make most compile-related options advanced. #docfixit `RB #2617 <https://rbcommons.com/s/twitter/r/2617>`_ * Make almost all global options advanced. #docfixit `RB #2602 <https://rbcommons.com/s/twitter/r/2602>`_ * Improve cmd-line help output. #docfixit `RB #2599 <https://rbcommons.com/s/twitter/r/2599>`_ * Default `-Dscala.usejavacp=true` for ScalaRepl. `RB #2613 <https://rbcommons.com/s/twitter/r/2613>`_ * Additional Option details for the Task developers guide. #docfixit `RB #2594 <https://rbcommons.com/s/twitter/r/2594>`_ `RB #2612 <https://rbcommons.com/s/twitter/r/2612>`_ * Improve subsystem testing support in subsystem_util. `RB #2603 <https://rbcommons.com/s/twitter/r/2603>`_ * Cleanups to the tasks developer's guide #docfixit `RB #2594 <https://rbcommons.com/s/twitter/r/2594>`_ * Add the optionable class to ScopeInfo. #docfixit `RB #2588 <https://rbcommons.com/s/twitter/r/2588>`_ * Add `pants_plugin` and `contrib_plugin` targets. `RB #2615 <https://rbcommons.com/s/twitter/r/2615>`_ 0.0.41 (8/7/2025) ----------------- Release Notes ~~~~~~~~~~~~~ Configuration for specifying scala/java compilation using zinc has changed in this release. You may need to combine `[compile.zinc-java]` and `[compile.scala]` into the new section `[compile.zinc]` The `migrate_config` tool will help you migrate your pants.ini settings for this new release. Download the pants source code and run: .. code:: ./pants run migrations/options/src/python:migrate_config -- <path to your pants.ini> API Changes ~~~~~~~~~~~ * Upgrade pex to 1.0.2. `RB #2571 <https://rbcommons.com/s/twitter/r/2571>`_ Bugfixes ~~~~~~~~ * Fix ApacheThriftGen chroot normalization scope. `RB #2568 <https://rbcommons.com/s/twitter/r/2568>`_ * Fix crasher when no jvm_options are set `RB #2578 <https://rbcommons.com/s/twitter/r/2578>`_ * Handle recursive globs with build-file-rev `RB #2572 <https://rbcommons.com/s/twitter/r/2572>`_ * Fixup PythonTask chroot caching. `RB #2567 <https://rbcommons.com/s/twitter/r/2567>`_ New Features ~~~~~~~~~~~~ * Add "omnivorous" ZincCompile to consume both java and scala sources `RB #2561 <https://rbcommons.com/s/twitter/r/2561>`_ Small improvements, Refactoring and Tooling ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Do fewer classpath calculations in `junit_run`. `RB #2576 <https://rbcommons.com/s/twitter/r/2576>`_ * fix misc ws issues `RB #2564 <https://rbcommons.com/s/twitter/r/2564>`_ `RB #2557 <https://rbcommons.com/s/twitter/r/2557>`_ * Resurrect the --[no-]lock global flag `RB #2563 <https://rbcommons.com/s/twitter/r/2563>`_ * Avoid caching volatile ~/.cache/pants/stats dir. `RB #2574 <https://rbcommons.com/s/twitter/r/2574>`_ * remove unused imports `RB #2556 <https://rbcommons.com/s/twitter/r/2556>`_ * Moved logic which validates jvm platform dependencies. `RB #2565 <https://rbcommons.com/s/twitter/r/2565>`_ * Bypass the pip cache when testing released sdists. `RB #2555 <https://rbcommons.com/s/twitter/r/2555>`_ * Add an affordance for 1 flag implying another. `RB #2562 <https://rbcommons.com/s/twitter/r/2562>`_ * Make artifact cache `max-entries-per-target` option name match its behaviour `RB #2550 <https://rbcommons.com/s/twitter/r/2550>`_ * Improve stats upload. `RB #2554 <https://rbcommons.com/s/twitter/r/2554>`_ 0.0.40 (7/31/2015) ------------------- Release Notes ~~~~~~~~~~~~~ The apache thrift gen for java code now runs in `-strict` mode by default, requiring all struct fields declare a field id. You can use the following configuration in pants.ini to retain the old default behavior and turn strict checking off: .. code:: [gen.thrift] strict: False The psutil dependency used by pants has been upgraded to 3.1.1. Supporting eggs have been uploaded to https://github.com/pantsbuild/cheeseshop/tree/gh-pages/third_party/python/dist. *Please note* that beyond this update, no further binary dependency updates will be provided at this location. API Changes ~~~~~~~~~~~ * Integrate the Android SDK, android-library `RB #2528 <https://rbcommons.com/s/twitter/r/2528>`_ Bugfixes ~~~~~~~~ * Guard against NoSuchProcess in the public API. `RB #2551 <https://rbcommons.com/s/twitter/r/2551>`_ * Fixup psutil.Process attribute accesses. `RB #2549 <https://rbcommons.com/s/twitter/r/2549>`_ * Removes type=Option.list from --compile-jvm-args option and --compile-scala-plugins `RB #2536 <https://rbcommons.com/s/twitter/r/2536>`_ `RB #2547 <https://rbcommons.com/s/twitter/r/2547>`_ * Prevent nailgun on nailgun violence when using symlinked java paths `RB #2538 <https://rbcommons.com/s/twitter/r/2538>`_ * Declaring product_types for simple_codegen_task. `RB #2540 <https://rbcommons.com/s/twitter/r/2540>`_ * Fix straggler usage of legacy psutil form `RB #2546 <https://rbcommons.com/s/twitter/r/2546>`_ New Features ~~~~~~~~~~~~ * Added JvmPlatform subsystem and added platform arg to JvmTarget. `RB #2494 <https://rbcommons.com/s/twitter/r/2494>`_ Small improvements, Refactoring and Tooling ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Resolve targets before creating PayloadField `RB #2496 <https://rbcommons.com/s/twitter/r/2496>`_ `RB #2536 <https://rbcommons.com/s/twitter/r/2536>`_ * Upgrade psutil to 3.1.1 `RB #2543 <https://rbcommons.com/s/twitter/r/2543>`_ * Move thrift utils only used by scrooge to contrib/scrooge. `RB #2535 <https://rbcommons.com/s/twitter/r/2535>`_ * docs: add link to slackin self-invite `RB #2537 <https://rbcommons.com/s/twitter/r/2537>`_ * Add Clover Health to the Powered By page `RB #2539 <https://rbcommons.com/s/twitter/r/2539>`_ * Add Powered By page `RB #2532 <https://rbcommons.com/s/twitter/r/2532>`_ * Create test for java_antlr_library `RB #2504 <https://rbcommons.com/s/twitter/r/2504>`_ * Migrate ApacheThriftGen to SimpleCodegenTask. `RB #2534 <https://rbcommons.com/s/twitter/r/2534>`_ * Covert RagelGen to SimpleCodeGen. `RB #2531 <https://rbcommons.com/s/twitter/r/2531>`_ * Shade the Checkstyle task tool jar. `RB #2533 <https://rbcommons.com/s/twitter/r/2533>`_ * Support eggs for setuptools and wheel. `RB #2529 <https://rbcommons.com/s/twitter/r/2529>`_ 0.0.39 (7/23/2015) ------------------ API Changes ~~~~~~~~~~~ * Disallow jar_library targets without jars `RB #2519 <https://rbcommons.com/s/twitter/r/2519>`_ Bugfixes ~~~~~~~~ * Fixup PythonChroot to ignore synthetic targets. `RB #2523 <https://rbcommons.com/s/twitter/r/2523>`_ * Exclude provides clauses regardless of soft_excludes `RB #2524 <https://rbcommons.com/s/twitter/r/2524>`_ * Fixed exclude id when name is None + added a test for excludes by just an org #1857 `RB #2518 <https://rbcommons.com/s/twitter/r/2518>`_ * Fixup SourceRoot to handle the buildroot. `RB #2514 <https://rbcommons.com/s/twitter/r/2514>`_ * Fixup SetupPy handling of exported thrift. `RB #2511 <https://rbcommons.com/s/twitter/r/2511>`_ New Features ~~~~~~~~~~~~ * Invalidate tasks based on BinaryUtil.version. `RB #2516 <https://rbcommons.com/s/twitter/r/2516>`_ * Remove local cache files `Issue #1762 <https://github.com/pantsbuild/pants/issues/1762>`_ `RB #2506 <https://rbcommons.com/s/twitter/r/2506>`_ * Option to expose intransitive target dependencies for the dependencies goal `RB #2503 <https://rbcommons.com/s/twitter/r/2503>`_ * Introduce Subsystem dependencies. `RB #2509 <https://rbcommons.com/s/twitter/r/2509>`_ `RB #2515 <https://rbcommons.com/s/twitter/r/2515>`_ Small improvements, Refactoring and Tooling ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Increase robustness of ProcessManager.terminate() in the face of zombies. `RB #2513 <https://rbcommons.com/s/twitter/r/2513>`_ * A global isort fix. `RB #2510 <https://rbcommons.com/s/twitter/r/2510>`_ 0.0.38 (7/21/2015) ------------------ Release Notes ~~~~~~~~~~~~~ A quick hotfix release to pick up a fix related to incorrectly specified scala targets. API Changes ~~~~~~~~~~~ * Remove the with_description method from target. `RB #2507 <https://rbcommons.com/s/twitter/r/2507>`_ Bugfixes ~~~~~~~~ * Handle the case where there are no classes for a target. `RB #2489 <https://rbcommons.com/s/twitter/r/2489>`_ New Features ~~~~~~~~~~~~ None. Small improvements, Refactoring and Tooling ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Refactor AntlrGen to use SimpleCodeGen. `RB #2487 <https://rbcommons.com/s/twitter/r/2487>`_ 0.0.37 (7/20/2015) ------------------ Release Notes ~~~~~~~~~~~~~ This is the regularly scheduled release for 7/17/2015 (slightly behind schedule!) API Changes ~~~~~~~~~~~ * Unified support for process management, to prepare for a new daemon. `RB #2490 <https://rbcommons.com/s/twitter/r/2490>`_ * An iterator over Option registration args. `RB #2478 <https://rbcommons.com/s/twitter/r/2478>`_ * An iterator over OptionValueContainer keys. `RB #2472 <https://rbcommons.com/s/twitter/r/2472>`_ Bugfixes ~~~~~~~~ * Correctly classify files as resources or classes `RB #2488 <https://rbcommons.com/s/twitter/r/2488>`_ * Fix test bugs introduced during the target cache refactor. `RB #2483 <https://rbcommons.com/s/twitter/r/2483>`_ * Don't explicitly enumerate goal scopes: makes life easier for the IntelliJ pants plugin. `RB #2500 <https://rbcommons.com/s/twitter/r/2500>`_ New Features ~~~~~~~~~~~~ * Switch almost all python tasks over to use cached chroots. `RB #2486 <https://rbcommons.com/s/twitter/r/2486>`_ * Add invalidation report flag to reporting subsystem. `RB #2448 <https://rbcommons.com/s/twitter/r/2448>`_ Small improvements, Refactoring and Tooling ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Add a note about the pantsbuild slack team. `RB #2491 <https://rbcommons.com/s/twitter/r/2491>`_ * Upgrade pantsbuild/pants to apache thrift 0.9.2. `RB #2484 <https://rbcommons.com/s/twitter/r/2484>`_ * Remove unused --lang option from protobuf_gen.py `RB #2485 <https://rbcommons.com/s/twitter/r/2485>`_ * Update release docs to recommend both server-login and pypi sections. `RB #2481 <https://rbcommons.com/s/twitter/r/2481>`_ 0.0.36 (7/14/2015) ------------------ Release Notes ~~~~~~~~~~~~~ This is a quick release following up on 0.0.35 to make available internal API changes made during options refactoring. API Changes ~~~~~~~~~~~ * Improved artifact cache usability by allowing tasks to opt-in to a mode that generates and then caches a directory for each target. `RB #2449 <https://rbcommons.com/s/twitter/r/2449>`_ `RB #2471 <https://rbcommons.com/s/twitter/r/2471>`_ * Re-compute the classpath for each batch of junit tests. `RB #2454 <https://rbcommons.com/s/twitter/r/2454>`_ Bugfixes ~~~~~~~~ * Stops unit tests in test_simple_codegen_task.py in master from failing. `RB #2469 <https://rbcommons.com/s/twitter/r/2469>`_ * Helpful error message when 'sources' is specified for jvm_binary. `Issue #871 <https://github.com/pantsbuild/pants/issues/871>`_ `RB #2455 <https://rbcommons.com/s/twitter/r/2455>`_ * Fix failure in test_execute_fail under python>=2.7.10 for test_simple_codegen_task.py. `RB #2461 <https://rbcommons.com/s/twitter/r/2461>`_ New Features ~~~~~~~~~~~~ * Support short-form task subsystem flags. `RB #2466 <https://rbcommons.com/s/twitter/r/2466>`_ * Reimplement help formatting to improve clarity of both the code and output. `RB #2458 <https://rbcommons.com/s/twitter/r/2458>`_ `RB #2464 <https://rbcommons.com/s/twitter/r/2464>`_ Small improvements, Refactoring and Tooling ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Visual docsite changes `RB #2463 <https://rbcommons.com/s/twitter/r/2463>`_ * Fix migrate_config to detect explicit [DEFAULT]s. `RB #2465 <https://rbcommons.com/s/twitter/r/2465>`_ 0.0.35 (7/10/2015) ------------------ Release Notes ~~~~~~~~~~~~~ With this release, if you use the `isolated jvm compile strategy <https://github.com/pantsbuild/pants/blob/0acdf8d8ab49a0a6bdf5084a99e0c1bca0231cf6/pants.ini.isolated>`_, java annotation processers that emit java sourcefiles or classfiles will be handled correctly and the generated code will be bundled appropriately in jars. In particular, this makes libraries like Google's AutoValue useable in a pants build. See: `RB #2451 <https://rbcommons.com/s/twitter/r/2451>`_. API Changes ~~~~~~~~~~~ * Deprecate with_description. `RB #2444 <https://rbcommons.com/s/twitter/r/2444>`_ Bugfixes ~~~~~~~~ * Fixup BuildFile must_exist logic. `RB #2441 <https://rbcommons.com/s/twitter/r/2441>`_ * Upgrade to pex 1.0.1. `Issue #1658 <https://github.com/pantsbuild/pants/issues/1658>`_ `RB #2438 <https://rbcommons.com/s/twitter/r/2438>`_ New Features ~~~~~~~~~~~~ * Add an option --main to the run.jvm task to override the specification of 'main' on a jvm_binary() target. `RB #2442 <https://rbcommons.com/s/twitter/r/2442>`_ * Add jvm_options for thrift-linter. `RB #2445 <https://rbcommons.com/s/twitter/r/2445>`_ * Added cwd argument to allow JavaTest targets to require particular working directories. `RB #2440 <https://rbcommons.com/s/twitter/r/2440>`_ Small improvements, Refactoring and Tooling ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Record all output classes for the jvm isolated compile strategy. `RB #2451 <https://rbcommons.com/s/twitter/r/2451>`_ * Robustify the pants ivy configuration. `Issue #1779 <https://github.com/pantsbuild/pants/issues/1779>`_ `RB #2450 <https://rbcommons.com/s/twitter/r/2450>`_ * Some refactoring of global options. `RB #2446 <https://rbcommons.com/s/twitter/r/2446>`_ * Improved error messaging for unknown Target kwargs. `RB #2443 <https://rbcommons.com/s/twitter/r/2443>`_ * Remove Nailgun specific classes from zinc, since pants invokes Main directly. `RB #2439 <https://rbcommons.com/s/twitter/r/2439>`_ 0.0.34 (7/6/2015) ----------------- Release Notes ~~~~~~~~~~~~~ Configuration for specifying cache settings and jvm options for some tools have changed in this release. The `migrate_config` tool will help you migrate your pants.ini settings for this new release. Download the pants source code and run: .. code:: ./pants run migrations/options/src/python:migrate_config -- <path to your pants.ini> API Changes ~~~~~~~~~~~ * Added flags for jar sources and javadocs to export goal because Foursquare got rid of ivy goal. `RB #2432 <https://rbcommons.com/s/twitter/r/2432>`_ * A JVM subsystem. `RB #2423 <https://rbcommons.com/s/twitter/r/2423>`_ * An artifact cache subsystem. `RB #2405 <https://rbcommons.com/s/twitter/r/2405>`_ Bugfixes ~~~~~~~~ * Change the xml report to use the fingerprint of the targets, not just their names. `RB #2435 <https://rbcommons.com/s/twitter/r/2435>`_ * Using linear-time BFS to sort targets topologically and group them by the type. `RB #2413 <https://rbcommons.com/s/twitter/r/2413>`_ * Fix isort in git hook context. `RB #2430 <https://rbcommons.com/s/twitter/r/2430>`_ * When using soft-excludes, ignore all target defined excludes `RB #2340 <https://rbcommons.com/s/twitter/r/2340>`_ * Fix bash-completion goal when run from sdist/pex. Also add tests, and beef up ci.sh & release.sh. `RB #2403 <https://rbcommons.com/s/twitter/r/2403>`_ * [junit tool] fix suppress output emits jibberish on console. `Issue #1657 <https://github.com/pantsbuild/pants/issues/1657>`_ `RB #2183 <https://rbcommons.com/s/twitter/r/2183>`_ * In junit-runner, fix an NPE in testFailure() for different scenarios `RB #2385 <https://rbcommons.com/s/twitter/r/2385>`_ `RB #2398 <https://rbcommons.com/s/twitter/r/2398>`_ `RB #2396 <https://rbcommons.com/s/twitter/r/2396>`_ * Scrub timestamp from antlr generated files to have stable fp for cache `RB #2382 <https://rbcommons.com/s/twitter/r/2382>`_ * JVM checkstyle should obey jvm_options `RB #2391 <https://rbcommons.com/s/twitter/r/2391>`_ * Fix bad logger.debug call in artifact_cache.py `RB #2386 <https://rbcommons.com/s/twitter/r/2386>`_ * Fixed a bug where codegen would crash due to a missing flag. `RB #2368 <https://rbcommons.com/s/twitter/r/2368>`_ * Fixup the Git Scm detection of server_url. `RB #2379 <https://rbcommons.com/s/twitter/r/2379>`_ * Repair depmap --graph `RB #2345 <https://rbcommons.com/s/twitter/r/2345>`_ Documentation ~~~~~~~~~~~~~ * Documented how to enable caching for tasks. `RB #2420 <https://rbcommons.com/s/twitter/r/2420>`_ * Remove comments that said these classes returned something. `RB #2419 <https://rbcommons.com/s/twitter/r/2419>`_ * Publishing doc fixes `RB #2407 <https://rbcommons.com/s/twitter/r/2407>`_ * Bad rst now fails the MarkdownToHtml task. `RB #2394 <https://rbcommons.com/s/twitter/r/2394>`_ * Add a CONTRIBUTORS maintenance script. `RB #2377 <https://rbcommons.com/s/twitter/r/2377>`_ `RB #2378 <https://rbcommons.com/s/twitter/r/2378>`_ * typo in the changelog for 0.0.33 release, fixed formatting of globs and rglobs `RB #2376 <https://rbcommons.com/s/twitter/r/2376>`_ * Documentation update for debugging a JVM tool `RB #2365 <https://rbcommons.com/s/twitter/r/2365>`_ New Features ~~~~~~~~~~~~ * Add log capture to isolated zinc compiles `RB #2404 <https://rbcommons.com/s/twitter/r/2404>`_ `RB #2415 <https://rbcommons.com/s/twitter/r/2415>`_ * Add support for restricting push remotes. `RB #2383 <https://rbcommons.com/s/twitter/r/2383>`_ * Ensure caliper is shaded in bench, add bench desc, use RUN so that output is printed `RB #2353 <https://rbcommons.com/s/twitter/r/2353>`_ Small improvements, Refactoring and Tooling ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Enhance the error output in simple_codegen_task.py when unable to generate target(s) `RB #2427 <https://rbcommons.com/s/twitter/r/2427>`_ * Add a get_rank() method to OptionValueContainer. `RB #2431 <https://rbcommons.com/s/twitter/r/2431>`_ * Pass jvm_options to scalastyle `RB #2428 <https://rbcommons.com/s/twitter/r/2428>`_ * Kill custom repos and cross-platform pex setup. `RB #2402 <https://rbcommons.com/s/twitter/r/2402>`_ * Add debugging for problem with invalidation and using stale report file in ivy resolve. `Issue #1747 <https://github.com/pantsbuild/pants/issues/1747>`_ `RB #2424 <https://rbcommons.com/s/twitter/r/2424>`_ * Enabled caching for scalastyle and checkstyle `RB #2416 <https://rbcommons.com/s/twitter/r/2416>`_ `RB #2414 <https://rbcommons.com/s/twitter/r/2414>`_ * Make sure all Task mixins are on the left. `RB #2421 <https://rbcommons.com/s/twitter/r/2421>`_ * Adds a more verbose description of tests when running the -per-test-timer command. (Junit) `RB #2418 <https://rbcommons.com/s/twitter/r/2418>`_ `RB #2408 <https://rbcommons.com/s/twitter/r/2408>`_ * Re-add support for reading from a local .m2 directory `RB #2409 <https://rbcommons.com/s/twitter/r/2409>`_ * Replace a few references to basestring with six. `RB #2410 <https://rbcommons.com/s/twitter/r/2410>`_ * Promote PANTS_DEV=1 to the only ./pants mode. `RB #2401 <https://rbcommons.com/s/twitter/r/2401>`_ * Add task meter to protoc step in codegen `RB #2392 <https://rbcommons.com/s/twitter/r/2392>`_ * Simplify known scopes computation. `RB #2389 <https://rbcommons.com/s/twitter/r/2389>`_ * Robustify the release process. `RB #2388 <https://rbcommons.com/s/twitter/r/2388>`_ * A common base class for things that can register options. `RB #2387 <https://rbcommons.com/s/twitter/r/2387>`_ * Fixed the error messages in assert_list(). `RB #2370 <https://rbcommons.com/s/twitter/r/2370>`_ * Simplify subsystem option scoping. `RB #2380 <https://rbcommons.com/s/twitter/r/2380>`_ 0.0.33 (6/13/2015) ------------------ Release Notes ~~~~~~~~~~~~~ The migrate config tool will help you migrate your pants.ini settings for this new release. Download the pants source code and run: .. code:: ./pants run migrations/options/src/python:migrate_config -- <path to your pants.ini> Folks who use a custom ivysettings.xml but have no ivy.ivy_settings option defined in pants.ini pointing to it must now add one like so: .. code:: [ivy] ivy_settings: %(pants_supportdir)s/ivy/ivysettings.xml API Changes ~~~~~~~~~~~ * Removed --project-info flag from depmap goal `RB #2363 <https://rbcommons.com/s/twitter/r/2363>`_ * Deprecate PytestRun env vars. `RB #2299 <https://rbcommons.com/s/twitter/r/2299>`_ * Add Subsystems for options that live outside a single task, use them to replace config settings in pants.ini `RB #2288 <https://rbcommons.com/s/twitter/r/2288>`_ `RB #2276 <https://rbcommons.com/s/twitter/r/2276>`_ `RB #2226 <https://rbcommons.com/s/twitter/r/2226>`_ `RB #2176 <https://rbcommons.com/s/twitter/r/2176>`_ `RB #2174 <https://rbcommons.com/s/twitter/r/2174>`_ `RB #2139 <https://rbcommons.com/s/twitter/r/2139>`_ `RB #2122 <https://rbcommons.com/s/twitter/r/2122>`_ `RB #2100 <https://rbcommons.com/s/twitter/r/2100>`_ `RB #2081 <https://rbcommons.com/s/twitter/r/2081>`_ `RB #2063 <https://rbcommons.com/s/twitter/r/2063>`_ * Read backend and bootstrap BUILD file settings from options instead of config. `RB #2229 <https://rbcommons.com/s/twitter/r/2229>`_ * Migrating internal tools into the pants repo and renaming to org.pantsbuild `RB #2278 <https://rbcommons.com/s/twitter/r/2278>`_ `RB #2211 <https://rbcommons.com/s/twitter/r/2211>`_ `RB #2207 <https://rbcommons.com/s/twitter/r/2207>`_ `RB #2205 <https://rbcommons.com/s/twitter/r/2205>`_ `RB #2186 <https://rbcommons.com/s/twitter/r/2186>`_ `RB #2195 <https://rbcommons.com/s/twitter/r/2195>`_ `RB #2193 <https://rbcommons.com/s/twitter/r/2193>`_ `RB #2192 <https://rbcommons.com/s/twitter/r/2192>`_ `RB #2191 <https://rbcommons.com/s/twitter/r/2191>`_ `RB #2191 <https://rbcommons.com/s/twitter/r/2191>`_ `RB #2137 <https://rbcommons.com/s/twitter/r/2137>`_ `RB #2071 <https://rbcommons.com/s/twitter/r/2071>`_ `RB #2043 <https://rbcommons.com/s/twitter/r/2043>`_ * Kill scala specs support. `RB #2208 <https://rbcommons.com/s/twitter/r/2208>`_ * Use the default ivysettings.xml provided by ivy. `RB #2204 <https://rbcommons.com/s/twitter/r/2204>`_ * Eliminate the globs.__sub__ use in option package. `RB #2082 <https://rbcommons.com/s/twitter/r/2082>`_ `RB #2197 <https://rbcommons.com/s/twitter/r/2197>`_ * Kill obsolete global publish.properties file. `RB #994 <https://rbcommons.com/s/twitter/r/994>`_ `RB #2069 <https://rbcommons.com/s/twitter/r/2069>`_ * Upgrade zinc to latest for perf wins. `RB #2355 <https://rbcommons.com/s/twitter/r/2355>`_ `RB #2194 <https://rbcommons.com/s/twitter/r/2194>`_ `RB #2168 <https://rbcommons.com/s/twitter/r/2168>`_ `RB #2154 <https://rbcommons.com/s/twitter/r/2154>`_ `RB #2154 <https://rbcommons.com/s/twitter/r/2154>`_ `RB #2149 <https://rbcommons.com/s/twitter/r/2149>`_ `RB #2125 <https://rbcommons.com/s/twitter/r/2125>`_ * Migrate jar_publish config scope. `RB #2175 <https://rbcommons.com/s/twitter/r/2175>`_ * Add a version number to the export format and a page with some documentation. `RB #2162 <https://rbcommons.com/s/twitter/r/2162>`_ * Make exclude_target_regexp option recursive `RB #2136 <https://rbcommons.com/s/twitter/r/2136>`_ * Kill pantsbuild dependence on maven.twttr.com. `RB #2019 <https://rbcommons.com/s/twitter/r/2019>`_ * Fold PythonTestBuilder into the PytestRun task. `RB #1993 <https://rbcommons.com/s/twitter/r/1993>`_ Bugfixes ~~~~~~~~ * Fixed errors in how arguments are passed to wire_gen. `RB #2354 <https://rbcommons.com/s/twitter/r/2354>`_ * Compute exclude_patterns first when unpacking jars `RB #2352 <https://rbcommons.com/s/twitter/r/2352>`_ * Add INDEX.LIST to as a Skip JarRule when creating a fat jar `RB #2342 <https://rbcommons.com/s/twitter/r/2342>`_ * wrapped-globs: make rglobs output git-compatible `RB #2332 <https://rbcommons.com/s/twitter/r/2332>`_ * Add a coherent error message when scrooge has no sources. `RB #2329 <https://rbcommons.com/s/twitter/r/2329>`_ * Only run junit when there are junit_test targets in the graph. `RB #2291 <https://rbcommons.com/s/twitter/r/2291>`_ * Fix bootstrap local cache. `RB #2336 <https://rbcommons.com/s/twitter/r/2336>`_ * Added a hash to a jar name for a bootstrapped jvm tool `RB #2334 <https://rbcommons.com/s/twitter/r/2334>`_ * Raise TaskError to exit non-zero if jar-tool fails `RB #2150 <https://rbcommons.com/s/twitter/r/2150>`_ * Fix java zinc isolated compile analysis corruption described github issue #1626 `RB #2325 <https://rbcommons.com/s/twitter/r/2325>`_ * Upstream analysis fix `RB #2312 <https://rbcommons.com/s/twitter/r/2312>`_ * Two changes that affect invalidation and artifact caching. `RB #2269 <https://rbcommons.com/s/twitter/r/2269>`_ * Add java_thrift_library fingerprint strategy `RB #2265 <https://rbcommons.com/s/twitter/r/2265>`_ * Moved creation of per test data to testStarted method. `RB #2257 <https://rbcommons.com/s/twitter/r/2257>`_ * Updated zinc to use sbt 0.13.8 and new java compilers that provide a proper log level with their output. `RB #2248 <https://rbcommons.com/s/twitter/r/2248>`_ * Apply excludes consistently across classpaths `RB #2247 <https://rbcommons.com/s/twitter/r/2247>`_ * Put all extra classpath elements (e.g., plugins) at the end (scala compile) `RB #2210 <https://rbcommons.com/s/twitter/r/2210>`_ * Fix missing import in git.py `RB #2202 <https://rbcommons.com/s/twitter/r/2202>`_ * Move a comment to work around a pytest bug. `RB #2201 <https://rbcommons.com/s/twitter/r/2201>`_ * More fixes for working with classifiers on jars. `Issue #1489 <https://github.com/pantsbuild/pants/issues/1489>`_ `RB #2163 <https://rbcommons.com/s/twitter/r/2163>`_ * Have ConsoleRunner halt(1) on exit(x) `RB #2180 <https://rbcommons.com/s/twitter/r/2180>`_ * Fix scm_build_file in symlinked directories `RB #2152 <https://rbcommons.com/s/twitter/r/2152>`_ `RB #2157 <https://rbcommons.com/s/twitter/r/2157>`_ * Added support for the ivy cache being under a symlink'ed dir `RB #2085 <https://rbcommons.com/s/twitter/r/2085>`_ `RB #2129 <https://rbcommons.com/s/twitter/r/2129>`_ `RB #2148 <https://rbcommons.com/s/twitter/r/2148>`_ * Make subclasses of ChangedTargetTask respect spec_excludes `RB #2146 <https://rbcommons.com/s/twitter/r/2146>`_ * propagate keyboard interrupts from worker threads `RB #2143 <https://rbcommons.com/s/twitter/r/2143>`_ * Only add resources to the relevant target `RB #2103 <https://rbcommons.com/s/twitter/r/2103>`_ `RB #2130 <https://rbcommons.com/s/twitter/r/2130>`_ * Cleanup analysis left behind from failed isolation compiles `RB #2127 <https://rbcommons.com/s/twitter/r/2127>`_ * test glob operators, fix glob + error `RB #2104 <https://rbcommons.com/s/twitter/r/2104>`_ * Wrap lock around nailgun spawning to protect against worker threads racing to spawn servers `RB #2102 <https://rbcommons.com/s/twitter/r/2102>`_ * Force some files to be treated as binary. `RB #2099 <https://rbcommons.com/s/twitter/r/2099>`_ * Convert JarRule and JarRules to use Payload to help fingerprint its configuration `RB #2096 <https://rbcommons.com/s/twitter/r/2096>`_ * Fix `./pants server` output `RB #2067 <https://rbcommons.com/s/twitter/r/2067>`_ * Fix issue with isolated strategy and sources owned by multiple targets `RB #2061 <https://rbcommons.com/s/twitter/r/2061>`_ * Handle broken resource mapping files (by throwing exceptions). `RB #2038 <https://rbcommons.com/s/twitter/r/2038>`_ * Change subproc sigint handler to exit more cleanly `RB #2024 <https://rbcommons.com/s/twitter/r/2024>`_ * Include classifier in JarDependency equality / hashing `RB #2029 <https://rbcommons.com/s/twitter/r/2029>`_ * Migrating more data to payload fields in jvm_app and jvm_binary targets `RB #2011 <https://rbcommons.com/s/twitter/r/2011>`_ * Fix ivy_resolve message: Missing expected ivy output file .../.ivy2/pants/internal-...-default.xml `RB #2015 <https://rbcommons.com/s/twitter/r/2015>`_ * Fix ignored invalidation data in ScalaCompile `RB #2018 <https://rbcommons.com/s/twitter/r/2018>`_ * Don't specify the jmake depfile if it doesn't exist `RB #2009 <https://rbcommons.com/s/twitter/r/2009>`_ `RB #2012 <https://rbcommons.com/s/twitter/r/2012>`_ * Force java generation on for protobuf_gen, get rid of spurious warning `RB #1994 <https://rbcommons.com/s/twitter/r/1994>`_ * Fix typo in ragel-gen entries (migrate-config) `RB #1995 <https://rbcommons.com/s/twitter/r/1995>`_ * Fix include dependees options. `RB #1760 <https://rbcommons.com/s/twitter/r/1760>`_ Documentation ~~~~~~~~~~~~~ * Be explicit that pants requires python 2.7.x to run. `RB #2343 <https://rbcommons.com/s/twitter/r/2343>`_ * Update documentation on how to develop and document a JVM tool used by Pants `RB #2318 <https://rbcommons.com/s/twitter/r/2318>`_ * Updates to changelog since 0.0.32 in preparation for next release. `RB #2294 <https://rbcommons.com/s/twitter/r/2294>`_ * Document the pantsbuild jvm tool release process. `RB #2289 <https://rbcommons.com/s/twitter/r/2289>`_ * Fix publishing docs for new 'publish.jar' syntax `RB #2255 <https://rbcommons.com/s/twitter/r/2255>`_ * Example configuration for the isolated strategy. `RB #2185 <https://rbcommons.com/s/twitter/r/2185>`_ * doc: uploading timing stats `RB #1700 <https://rbcommons.com/s/twitter/r/1700>`_ * Add robots.txt to exclude crawlers from walking a 'staging' test publishing dir `RB #2072 <https://rbcommons.com/s/twitter/r/2072>`_ * Add a note indicating that pants bootstrap requires a compiler `RB #2057 <https://rbcommons.com/s/twitter/r/2057>`_ * Fix docs to mention automatic excludes. `RB #2014 <https://rbcommons.com/s/twitter/r/2014>`_ New Features ~~~~~~~~~~~~ * Add a global --tag option to filter targets based on their tags. `RB #2362 <https://rbcommons.com/s/twitter/r/2362/>`_ * Add support for ServiceLoader service providers. `RB #2331 <https://rbcommons.com/s/twitter/r/2331>`_ * Implemented isolated code-generation strategy for simple_codegen_task. `RB #2322 <https://rbcommons.com/s/twitter/r/2322>`_ * Add options for specifying python cache dirs. `RB #2320 <https://rbcommons.com/s/twitter/r/2320>`_ * bash autocompletion support `RB #2307 <https://rbcommons.com/s/twitter/r/2307>`_ `RB #2326 <https://rbcommons.com/s/twitter/r/2326>`_ * Invoke jvm doc tools via java. `RB #2313 <https://rbcommons.com/s/twitter/r/2313>`_ * Add -log-filter option to the zinc task `RB #2315 <https://rbcommons.com/s/twitter/r/2315>`_ * Adds a product to bundle_create `RB #2254 <https://rbcommons.com/s/twitter/r/2254>`_ * Add flag to disable automatic excludes `RB #2252 <https://rbcommons.com/s/twitter/r/2252>`_ * Find java distributions in well known locations. `RB #2242 <https://rbcommons.com/s/twitter/r/2242>`_ * Added information about excludes to export goal `RB #2238 <https://rbcommons.com/s/twitter/r/2238>`_ * In process java compilation in Zinc #1555 `RB #2206 <https://rbcommons.com/s/twitter/r/2206>`_ * Add support for extra publication metadata. `RB #2184 <https://rbcommons.com/s/twitter/r/2184>`_ `RB #2240 <https://rbcommons.com/s/twitter/r/2240>`_ * Extract the android plugin as an sdist. `RB #2249 <https://rbcommons.com/s/twitter/r/2249>`_ * Adds optional output during zinc compilation. `RB #2233 <https://rbcommons.com/s/twitter/r/2233>`_ * Jvm Tools release process `RB #2292 <https://rbcommons.com/s/twitter/r/2292>`_ * Make it possible to create xml reports and output to console at the same time from ConsoleRunner. `RB #2183 <https://rbcommons.com/s/twitter/r/2183>`_ * Adding a product to binary_create so that we can depend on it in an external plugin. `RB #2172 <https://rbcommons.com/s/twitter/r/2172>`_ * Publishing to Maven Central `RB #2068 <https://rbcommons.com/s/twitter/r/2068>`_ `RB #2188 <https://rbcommons.com/s/twitter/r/2188>`_ * Provide global option to look up BUILD files in git history `RB #2121 <https://rbcommons.com/s/twitter/r/2121>`_ `RB #2164 <https://rbcommons.com/s/twitter/r/2164>`_ * Compile Java with Zinc `RB #2156 <https://rbcommons.com/s/twitter/r/2156>`_ * Add BuildFileManipulator implementation and tests to contrib `RB #977 <https://rbcommons.com/s/twitter/r/977>`_ * Add option to suppress printing the changelog during publishing `RB #2140 <https://rbcommons.com/s/twitter/r/2140>`_ * Filtering by targets' tags `RB #2106 <https://rbcommons.com/s/twitter/r/2106>`_ * Adds the ability to specify explicit fields in MANIFEST.MF in a jvm_binary target. `RB #2199 <https://rbcommons.com/s/twitter/r/2199>`_ `RB #2084 <https://rbcommons.com/s/twitter/r/2084>`_ `RB #2119 <https://rbcommons.com/s/twitter/r/2119>`_ `RB #2005 <https://rbcommons.com/s/twitter/r/2005>`_ * Parallelize isolated jvm compile strategy's chunk execution. `RB #2109 <https://rbcommons.com/s/twitter/r/2109>`_ * Make test tasks specify which target failed in exception. `RB #2090 <https://rbcommons.com/s/twitter/r/2090>`_ `RB #2113 <https://rbcommons.com/s/twitter/r/2113>`_ `RB #2112 <https://rbcommons.com/s/twitter/r/2112>`_ * Support glob output in filedeps. `RB #2092 <https://rbcommons.com/s/twitter/r/2092>`_ * Export: support export of sources and globs `RB #2082 <https://rbcommons.com/s/twitter/r/2082>`_ `RB #2094 <https://rbcommons.com/s/twitter/r/2094>`_ * Classpath isolation: make ivy resolution locally accurate. `RB #2064 <https://rbcommons.com/s/twitter/r/2064>`_ * Add support for a postscript to jar_publish commit messages. `RB #2070 <https://rbcommons.com/s/twitter/r/2070>`_ * Add optional support for auto-shading jvm tools. `RB #2052 <https://rbcommons.com/s/twitter/r/2052>`_ `RB #2073 <https://rbcommons.com/s/twitter/r/2073>`_ * Introduce a jvm binary shader. `RB #2050 <https://rbcommons.com/s/twitter/r/2050>`_ * Open source the spindle plugin for pants into contrib. `RB #2306 <https://rbcommons.com/s/twitter/r/2306>`_ `RB #2301 <https://rbcommons.com/s/twitter/r/2301>`_ `RB #2304 <https://rbcommons.com/s/twitter/r/2304>`_ `RB #2282 <https://rbcommons.com/s/twitter/r/2282>`_ `RB #2033 <https://rbcommons.com/s/twitter/r/2033>`_ * Implement an exported ownership model. `RB #2010 <https://rbcommons.com/s/twitter/r/2010>`_ Small improvements, Refactoring and Tooling ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Support caching chroots for reuse across pants runs. `RB #2349 <https://rbcommons.com/s/twitter/r/2349>`_ * Upgrade RBT to the latest release `RB #2360 <https://rbcommons.com/s/twitter/r/2360>`_ * Make sure arg to logRaw and log are only eval'ed once. (zinc) `RB #2338 <https://rbcommons.com/s/twitter/r/2338>`_ * Clean up unnecessary code `RB #2339 <https://rbcommons.com/s/twitter/r/2339>`_ * Exclude the com.example org from travis ivy cache. `RB #2344 <https://rbcommons.com/s/twitter/r/2344>`_ * Avoid ivy cache thrash due to ivydata updates. `RB #2333 <https://rbcommons.com/s/twitter/r/2333>`_ * Various refactoring of PythonChroot and related code. `RB #2327 <https://rbcommons.com/s/twitter/r/2327>`_ * Have pytest_run create its chroots via its base class. `RB #2314 <https://rbcommons.com/s/twitter/r/2314>`_ * Add a set of memoization decorators for functions. `RB #2308 <https://rbcommons.com/s/twitter/r/2308>`_ `RB #2317 <https://rbcommons.com/s/twitter/r/2317>`_ * Allow jvm tool tests to bootstrap from the artifact cache. `RB #2311 <https://rbcommons.com/s/twitter/r/2311>`_ * Fixed 'has no attribute' exception + better tests for export goal `RB #2305 <https://rbcommons.com/s/twitter/r/2305>`_ * Refactoring ProtobufGen to use SimpleCodeGen. `RB #2302 <https://rbcommons.com/s/twitter/r/2302>`_ * Refactoring JaxbGen to use SimpleCodeGen. `RB #2303 <https://rbcommons.com/s/twitter/r/2303>`_ * Add pants header to assorted python files `RB #2298 <https://rbcommons.com/s/twitter/r/2298>`_ * Remove unused imports from python files `RB #2295 <https://rbcommons.com/s/twitter/r/2295>`_ * Integrating Patrick's SimpleCodegenTask base class with WireGen. `RB #2274 <https://rbcommons.com/s/twitter/r/2274>`_ * Fix bad log statement in junit_run.py. `RB #2290 <https://rbcommons.com/s/twitter/r/2290>`_ * Provide more specific value parsing errors `RB #2283 <https://rbcommons.com/s/twitter/r/2283>`_ * Dry up incremental-compiler dep on sbt-interface. `RB #2279 <https://rbcommons.com/s/twitter/r/2279>`_ * Use BufferedOutputStream in jar-tool `RB #2270 <https://rbcommons.com/s/twitter/r/2270>`_ * Add relative_symlink to dirutil for latest run report `RB #2271 <https://rbcommons.com/s/twitter/r/2271>`_ * Shade zinc. `RB #2268 <https://rbcommons.com/s/twitter/r/2268>`_ * rm Exception.message calls `RB #2245 <https://rbcommons.com/s/twitter/r/2245>`_ * sanity check on generated cobertura xml report `RB #2231 <https://rbcommons.com/s/twitter/r/2231>`_ * [pants/jar] Fix a typo `RB #2230 <https://rbcommons.com/s/twitter/r/2230>`_ * Convert validation.assert_list isinstance checking to be lazy `RB #2228 <https://rbcommons.com/s/twitter/r/2228>`_ * use workunit output for cpp command running `RB #2223 <https://rbcommons.com/s/twitter/r/2223>`_ * Remove all global config state. `RB #2222 <https://rbcommons.com/s/twitter/r/2222>`_ `RB #2181 <https://rbncommons.com/s/twitter/r/2181>`_ `RB #2160 <https://rbcommons.com/s/twitter/r/2160>`_ `RB #2159 <https://rbcommons.com/s/twitter/r/2159>`_ `RB #2151 <https://rbcommons.com/s/twitter/r/2151>`_ `RB #2142 <https://rbcommons.com/s/twitter/r/2142>`_ `RB #2141 <https://rbcommons.com/s/twitter/r/2141>`_ * Make the version of specs in BUILD.tools match the one in 3rdparty/BUILD. `RB #2203 <https://rbcommons.com/s/twitter/r/2203>`_ * Handle warnings in BUILD file context. `RB #2198 <https://rbcommons.com/s/twitter/r/2198>`_ * Replace custom softreference cache with a guava cache. (zinc) `RB #2190 <https://rbcommons.com/s/twitter/r/2190>`_ * Establish a source_root for pants scala code. `RB #2189 <https://rbcommons.com/s/twitter/r/2189>`_ * Zinc patches to improve roundtrip time `RB #2178 <https://rbcommons.com/s/twitter/r/2178>`_ * cache parsed mustache templates as they are requested `RB #2171 <https://rbcommons.com/s/twitter/r/2171>`_ * memoize linkify to reduce reporting file stat calls `RB #2170 <https://rbcommons.com/s/twitter/r/2170>`_ * Refactor BuildFile and BuildFileAdressMapper `RB #2110 <https://rbcommons.com/s/twitter/r/2110>`_ * fix whitespace in workerpool test, rm unused import `RB #2144 <https://rbcommons.com/s/twitter/r/2144>`_ * Use jvm-compilers as the parent of isolation workunits instead of 'isolation', add workunits for analysis `RB #2134 <https://rbcommons.com/s/twitter/r/2134>`_ * Improve the error message when a tool fails to bootstrap. `RB #2135 <https://rbcommons.com/s/twitter/r/2135>`_ * Fix rglobs-to-filespec code. `RB #2133 <https://rbcommons.com/s/twitter/r/2133>`_ * Send workunit output to stderr during tests `RB #2108 <https://rbcommons.com/s/twitter/r/2108>`_ * Changes to zinc analysis split/merge test data generation: `RB #2095 <https://rbcommons.com/s/twitter/r/2095>`_ * Add a dummy workunit to the end of the run to print out a timestamp that includes the time spent in the last task. `RB #2054 <https://rbcommons.com/s/twitter/r/2054>`_ * Add 'java-resource' and 'java-test-resource' content type for Resources Roots. `RB #2046 <https://rbcommons.com/s/twitter/r/2046>`_ * Upgrade virtualenv from 12.0.7 to 12.1.1. `RB #2047 <https://rbcommons.com/s/twitter/r/2047>`_ * convert all % formatted strings under src/ to str.format format `RB #2042 <https://rbcommons.com/s/twitter/r/2042>`_ * Move overrides for registrations to debug. `RB #2023 <https://rbcommons.com/s/twitter/r/2023>`_ * Split jvm_binary.py into jvm_binary.py and jvm_app.py. `RB #2006 <https://rbcommons.com/s/twitter/r/2006>`_ * Validate analysis earlier, and handle it explicitly `RB #1999 <https://rbcommons.com/s/twitter/r/1999>`_ * Switch to importlib `RB #2003 <https://rbcommons.com/s/twitter/r/2003>`_ * Some refactoring and tidying-up in workunit. `RB #1981 <https://rbcommons.com/s/twitter/r/1981>`_ * Remove virtualenv tarball from CI cache. `RB #2281 <https://rbcommons.com/s/twitter/r/2281>`_ * Moved testing of examples and testprojects to tests `RB #2158 <https://rbcommons.com/s/twitter/r/2158>`_ * Share the python interpreter/egg caches between tests. `RB #2256 <https://rbcommons.com/s/twitter/r/2256>`_ * Add support for python test sharding. `RB #2243 <https://rbcommons.com/s/twitter/r/2243>`_ * Fixup OSX CI breaks. `RB #2241 <https://rbcommons.com/s/twitter/r/2241>`_ * fix test class name c&p error `RB #2227 <https://rbcommons.com/s/twitter/r/2227>`_ * Remove the pytest skip tag for scala publish integration test as it uses --doc-scaladoc-skip `RB #2225 <https://rbcommons.com/s/twitter/r/2225>`_ * integration test for classifiers `RB #2216 <https://rbcommons.com/s/twitter/r/2216>`_ `RB #2218 <https://rbcommons.com/s/twitter/r/2218>`_ `RB #2232 <https://rbcommons.com/s/twitter/r/2232>`_ * Use 2 IT shards to avoid OSX CI timeouts. `RB #2217 <https://rbcommons.com/s/twitter/r/2217>`_ * Don't have JvmToolTaskTestBase require access to "real" option values. `RB #2213 <https://rbcommons.com/s/twitter/r/2213>`_ * There were two test_export_integration.py tests. `RB #2215 <https://rbcommons.com/s/twitter/r/2215>`_ * Do not include integration tests in non-integration tests. `RB #2173 <https://rbcommons.com/s/twitter/r/2173>`_ * Streamline some test setup. `RB #2167 <https://rbcommons.com/s/twitter/r/2167>`_ * Ensure that certain test cleanup always happens, even if setUp fails. `RB #2166 <https://rbcommons.com/s/twitter/r/2166>`_ * Added a test of the bootstrapper logic with no cached bootstrap.jar `RB #2126 <https://rbcommons.com/s/twitter/r/2126>`_ * Remove integration tests from default targets in test BUILD files `RB #2086 <https://rbcommons.com/s/twitter/r/2086>`_ * Cap BootstrapJvmTools mem in JvmToolTaskTestBase. `RB #2077 <https://rbcommons.com/s/twitter/r/2077>`_ * Re-establish no nailguns under TravisCI. `RB #1852 <https://rbcommons.com/s/twitter/r/1852>`_ `RB #2065 <https://rbcommons.com/s/twitter/r/2065>`_ * Further cleanup of test context setup. `RB #2053 <https://rbcommons.com/s/twitter/r/2053>`_ * Remove plumbing for custom test config. `RB #2051 <https://rbcommons.com/s/twitter/r/2051>`_ * Use a fake context when testing. `RB #2049 <https://rbcommons.com/s/twitter/r/2049>`_ * Remove old TaskTest base class. `RB #2039 <https://rbcommons.com/s/twitter/r/2039>`_ `RB #2031 <https://rbcommons.com/s/twitter/r/2031>`_ `RB #2027 <https://rbcommons.com/s/twitter/r/2027>`_ `RB #2022 <https://rbcommons.com/s/twitter/r/2022>`_ `RB #2017 <https://rbcommons.com/s/twitter/r/2017>`_ `RB #2016 <https://rbcommons.com/s/twitter/r/2016>`_ * Refactor com.pants package to org.pantsbuild in examples and testprojects `RB #2037 <https://rbcommons.com/s/twitter/r/2037>`_ * Added a simple 'HelloWorld' java example. `RB #2028 <https://rbcommons.com/s/twitter/r/2028>`_ * Place the workdir below the pants_workdir `RB #2007 <https://rbcommons.com/s/twitter/r/2007>`_ 0.0.32 (3/26/2015) ------------------ Bugfixes ~~~~~~~~ * Fixup minified_dependencies `Issue #1329 <https://github.com/pantsbuild/pants/issues/1329>`_ `RB #1986 <https://rbcommons.com/s/twitter/r/1986>`_ * Don`t mutate options in the linter `RB #1978 <https://rbcommons.com/s/twitter/r/1978>`_ * Fix a bad logic bug in zinc analysis split code `RB #1969 <https://rbcommons.com/s/twitter/r/1969>`_ * always use relpath on --test file args `RB #1976 <https://rbcommons.com/s/twitter/r/1976>`_ * Fixup resources drift in the sdist package `RB #1974 <https://rbcommons.com/s/twitter/r/1974>`_ * Fix publish override flag `Issue #1277 <https://github.com/pantsbuild/pants/issues/1277>`_ `RB #1959 <https://rbcommons.com/s/twitter/r/1959>`_ API Changes ~~~~~~~~~~~ * Remove open_zip64 in favor of supporting zip64 everywhere `RB #1984 <https://rbcommons.com/s/twitter/r/1984>`_ Documentation ~~~~~~~~~~~~~ * rm python_old, an old document `RB #1973 <https://rbcommons.com/s/twitter/r/1973>`_ * Updated ivysettings.xml with comments and commented out local repos `RB #1979 <https://rbcommons.com/s/twitter/r/1979>`_ * Update how to setup proxies in ivy `RB #1975 <https://rbcommons.com/s/twitter/r/1975>`_ New Features ~~~~~~~~~~~~ * Ignore blank lines and comments in scalastyle excludes file `RB #1971 <https://rbcommons.com/s/twitter/r/1971>`_ * Adding a --test-junit-coverage-jvm-options flag `RB #1968 <https://rbcommons.com/s/twitter/r/1968>`_ * --soft-excludes flag for resolve-ivy `RB #1961 <https://rbcommons.com/s/twitter/r/1961>`_ Small improvements, Refactoring and Tooling ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Rid pantsbuild.pants of an un-needed antlr dep `RB #1989 <https://rbcommons.com/s/twitter/r/1989>`_ * Kill the BUILD.transitional targets `Issue #1126 <https://github.com/pantsbuild/pants/issues/1126>`_ `RB #1983 <https://rbcommons.com/s/twitter/r/1983>`_ * Convert ragel-gen.py to use new options and expunge config from BinaryUtil `RB #1970 <https://rbcommons.com/s/twitter/r/1970>`_ * Add the JvmCompileIsolatedStrategy `RB #1898 <https://rbcommons.com/s/twitter/r/1898>`_ * Move construction of PythonChroot to PythonTask base class `RB #1965 <https://rbcommons.com/s/twitter/r/1965>`_ * Delete the PythonBinaryBuilder class `RB #1964 <https://rbcommons.com/s/twitter/r/1964>`_ * Removing dead code `RB #1960 <https://rbcommons.com/s/twitter/r/1960>`_ * Make the test check that the return code is propagated `RB #1966 <https://rbcommons.com/s/twitter/r/1966>`_ * Cleanup `RB #1962 <https://rbcommons.com/s/twitter/r/1962>`_ * Get rid of almost all direct config access in python-building code `RB #1954 <https://rbcommons.com/s/twitter/r/1954>`_ 0.0.31 (3/20/2015) ------------------ Bugfixes ~~~~~~~~ * Make JavaProtobufLibrary not exportable to fix publish. `RB #1952 <https://rbcommons.com/s/twitter/r/1952>`_ * Pass compression option along to temp local artifact caches. `RB #1955 <https://rbcommons.com/s/twitter/r/1955>`_ * Fix a missing symbol in ScalaCompile `RB #1885 <https://rbcommons.com/s/twitter/r/1885>`_ `RB #1945 <https://rbcommons.com/s/twitter/r/1945>`_ * die only when invoked directly `RB #1953 <https://rbcommons.com/s/twitter/r/1953>`_ * add import for traceback, and add test to exercise that code path, rm unsed kwargs `RB #1868 <https://rbcommons.com/s/twitter/r/1868>`_ `RB #1943 <https://rbcommons.com/s/twitter/r/1943>`_ API Changes ~~~~~~~~~~~ * Use the publically released 2.1.1 version of Cobertura `RB #1933 <https://rbcommons.com/s/twitter/r/1933>`_ Documentation ~~~~~~~~~~~~~ * Update docs for 'prep_command()' `RB #1940 <https://rbcommons.com/s/twitter/r/1940>`_ New Features ~~~~~~~~~~~~ * added sources and javadocs to export goal output `RB #1936 <https://rbcommons.com/s/twitter/r/1936>`_ * Add flags to idea and eclipse goals to exclude pulling in sources and javadoc via ivy `RB #1939 <https://rbcommons.com/s/twitter/r/1939>`_ Small improvements, Refactoring and Tooling ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Remove a spurious import in test_antlr_builder `RB #1951 <https://rbcommons.com/s/twitter/r/1951>`_ * Refactor ZincUtils `RB #1946 <https://rbcommons.com/s/twitter/r/1946>`_ * change set([]) / OrderedSet([]) to set() / OrderedSet() `RB #1947 <https://rbcommons.com/s/twitter/r/1947>`_ * Rename TestPythonSetup to TestSetupPy `RB #1950 <https://rbcommons.com/s/twitter/r/1950>`_ * Rename the PythonSetup task to SetupPy `RB #1942 <https://rbcommons.com/s/twitter/r/1942>`_ 0.0.30 (3/18/2015) ------------------ Bugfixes ~~~~~~~~ * Fix missing deps from global switch to six range `RB #1931 <https://rbcommons.com/s/twitter/r/1931>`_ `RB #1937 <https://rbcommons.com/s/twitter/r/1937>`_ * Fix python_repl to work for python_requirement_libraries `RB #1934 <https://rbcommons.com/s/twitter/r/1934>`_ * Move count variable outside loop `RB #1926 <https://rbcommons.com/s/twitter/r/1926>`_ * Fix regression in synthetic target context handling `RB #1921 <https://rbcommons.com/s/twitter/r/1921>`_ * Try to fix the .rst render of the CHANGELOG on pypi `RB #1911 <https://rbcommons.com/s/twitter/r/1911>`_ * To add android.jar to the classpath, create a copy under task's workdir `RB #1902 <https://rbcommons.com/s/twitter/r/1902>`_ * walk synthetic targets dependencies when constructing context.target() `RB #1863 <https://rbcommons.com/s/twitter/r/1863>`_ `RB #1914 <https://rbcommons.com/s/twitter/r/1914>`_ * Mix the value of the zinc name-hashing flag into cache keys `RB #1912 <https://rbcommons.com/s/twitter/r/1912>`_ * Allow multiple ivy artifacts distinguished only by classifier `RB #1905 <https://rbcommons.com/s/twitter/r/1905>`_ * Fix `Git.detect_worktree` to fail gracefully `RB #1903 <https://rbcommons.com/s/twitter/r/1903>`_ * Avoid reparsing analysis repeatedly `RB #, <https://rbcommons.com/s/twitter/r/1898/,>`_ `RB #1938 <https://rbcommons.com/s/twitter/r/1938>`_ API Changes ~~~~~~~~~~~ * Remove the now-superfluous "parallel resource directories" hack `RB #1907 <https://rbcommons.com/s/twitter/r/1907>`_ * Make rglobs follow symlinked directories by default `RB #1881 <https://rbcommons.com/s/twitter/r/1881>`_ Documentation ~~~~~~~~~~~~~ * Trying to clarify how to contribute docs `RB #1922 <https://rbcommons.com/s/twitter/r/1922>`_ * Add documentation on how to turn on extra ivy debugging `RB #1906 <https://rbcommons.com/s/twitter/r/1906>`_ * Adds documentation to setup_repo.md with tips for how to configure Pants to work behind a firewall `RB #1899 <https://rbcommons.com/s/twitter/r/1899>`_ New Features ~~~~~~~~~~~~ * Support spec_excludes in what_changed. Prior art: https://rbcommons.com/s/twitter/r/1795/ `RB #1930 <https://rbcommons.com/s/twitter/r/1930>`_ * Add a new 'export' goal for use by IDE integration `RB #1917 <https://rbcommons.com/s/twitter/r/1917>`_ `RB #1929 <https://rbcommons.com/s/twitter/r/1929>`_ * Add ability to detect HTTP_PROXY or HTTPS_PROXY in environment and pass it along to ivy `RB #1877 <https://rbcommons.com/s/twitter/r/1877>`_ * Pants publish to support publishing extra publish artifacts as individual artifacts with classifier attached `RB #1879 <https://rbcommons.com/s/twitter/r/1879>`_ `RB #1889 <https://rbcommons.com/s/twitter/r/1889>`_ Small improvements, Refactoring and Tooling ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Deleting dead abbreviate_target_ids code. `RB #1918 <https://rbcommons.com/s/twitter/r/1918>`_ `RB #1944 <https://rbcommons.com/s/twitter/r/1944>`_ * Move AptCompile to its own file `RB #1935 <https://rbcommons.com/s/twitter/r/1935>`_ * use six.moves.range everywhere `RB #1931 <https://rbcommons.com/s/twitter/r/1931>`_ * Port scrooge/linter config to the options system `RB #1927 <https://rbcommons.com/s/twitter/r/1927>`_ * Fixes for import issues in JvmCompileStrategy post https://rbcommons.com/s/twitter/r/1885/ `RB #1900 <https://rbcommons.com/s/twitter/r/1900>`_ * Moving stuff out of jvm and into project info backend `RB #1917 <https://rbcommons.com/s/twitter/r/1917>`_ * Provides is meant to have been deprecated a long time ago `RB #1915 <https://rbcommons.com/s/twitter/r/1915>`_ * Move JVM debug config functionality to the new options system `RB #1924 <https://rbcommons.com/s/twitter/r/1924>`_ * Remove the --color option from specs_run. See https://rbcommons.com/s/twitter/r/1814/ `RB #1916 <https://rbcommons.com/s/twitter/r/1916>`_ * Remove superfluous 'self.conf' argument to self.classpath `RB #1913 <https://rbcommons.com/s/twitter/r/1913>`_ * Update ivy_utils error messages: include classifier and switch interpolation from % to format `RB #1908 <https://rbcommons.com/s/twitter/r/1908>`_ * Added a python helper for check_header.sh in git pre-commit script `RB #1910 <https://rbcommons.com/s/twitter/r/1910>`_ * Remove direct config access in scalastyle.py `RB #1897 <https://rbcommons.com/s/twitter/r/1897>`_ * Replace all instances of xrange with range, as xrange is deprecated in Python 3 `RB #1901 <https://rbcommons.com/s/twitter/r/1901>`_ * Raise a better exception on truncated Zinc analysis files `RB #1896 <https://rbcommons.com/s/twitter/r/1896>`_ * Fail fast for OSX CI runs `RB #1894 <https://rbcommons.com/s/twitter/r/1894>`_ * Upgrade to the latest rbt release `RB #1893 <https://rbcommons.com/s/twitter/r/1893>`_ * Use cmp instead of a file hash `RB #1892 <https://rbcommons.com/s/twitter/r/1892>`_ * Split out a JvmCompileStrategy interface `RB #1885 <https://rbcommons.com/s/twitter/r/1885>`_ * Decouple WorkUnit from RunTracker `RB #1928 <https://rbcommons.com/s/twitter/r/1928>`_ * Add Scm.add, change publish to add pushdb explicitly, move scm publish around `RB #1868 <https://rbcommons.com/s/twitter/r/1868>`_ 0.0.29 (3/9/2015) ----------------- CI ~~ * Support local pre-commit checks `RB #1883 <https://rbcommons.com/s/twitter/r/1883>`_ * Fix newline to fix broken master build `RB #1888 <https://rbcommons.com/s/twitter/r/1888>`_ * Shard out OSX CI `RB #1873 <https://rbcommons.com/s/twitter/r/1873>`_ * Update travis's pants cache settings `RB #1875 <https://rbcommons.com/s/twitter/r/1875>`_ * Fixup contrib tests on osx CI `RB #1867 <https://rbcommons.com/s/twitter/r/1867>`_ * Reduce number of test shards from 8 to 6 on Travis-ci `RB #1804 <https://rbcommons.com/s/twitter/r/1804>`_ * Cache the isort venv for ci runs `RB #1740 <https://rbcommons.com/s/twitter/r/1740>`_ * Fixup ci isort check `RB #1728 <https://rbcommons.com/s/twitter/r/1728>`_ Tests ~~~~~ * Add jar Publish integration tests to test the generated pom and ivy.xml files `RB #1879 <https://rbcommons.com/s/twitter/r/1879>`_ * Added test that shows that nested scope inherits properly from cmdline, config, and env `RB #1851 <https://rbcommons.com/s/twitter/r/1851>`_ `RB #1865 <https://rbcommons.com/s/twitter/r/1865>`_ * Improve AndroidDistribution coverage `RB #1861 <https://rbcommons.com/s/twitter/r/1861>`_ * Modernize the protobuf and wire task tests `RB #1854 <https://rbcommons.com/s/twitter/r/1854>`_ * Replace python_test_suite with target `RB #1821 <https://rbcommons.com/s/twitter/r/1821>`_ * Switch test_jvm_run.py to the new TaskTestBase instead of the old TaskTest `RB #1829 <https://rbcommons.com/s/twitter/r/1829>`_ * Remove two non-useful tests `RB #1828 <https://rbcommons.com/s/twitter/r/1828>`_ * Fix a python run integration test `RB #1810 <https://rbcommons.com/s/twitter/r/1810>`_ * Work around py test_runner issue with ns packages `RB #1813 <https://rbcommons.com/s/twitter/r/1813>`_ * Add a test for the Git changelog `RB #1792 <https://rbcommons.com/s/twitter/r/1792>`_ * Create a directory with no write perms for TestAndroidConfigUtil `RB #1796 <https://rbcommons.com/s/twitter/r/1796>`_ * Relocated some tests (no code changes) from tests/python/pants_test/tasks into tests/python/pants_test/backend/codegen/tasks to mirror the source location `RB #1746 <https://rbcommons.com/s/twitter/r/1746>`_ Docs ~~~~ * Add some documentation about using the pants reporting server for troubleshooting `RB #1887 <https://rbcommons.com/s/twitter/r/1887>`_ * Docstring reformatting for Task and InvalidationCheck `RB #1769 <https://rbcommons.com/s/twitter/r/1769>`_ * docs: Show correct pictures for intellij.html `RB #1716 <https://rbcommons.com/s/twitter/r/1716>`_ * doc += how to turn on cache `RB #1668 <https://rbcommons.com/s/twitter/r/1668>`_ New language: C++ ~~~~~~~~~~~~~~~~~ * Separate compile step for C++ to just compile objects `RB #1855 <https://rbcommons.com/s/twitter/r/1855>`_ * Fixup CppToolchain to be lazy and actually cache `RB #1850 <https://rbcommons.com/s/twitter/r/1850>`_ * C++ support in contrib `RB #1818 <https://rbcommons.com/s/twitter/r/1818>`_ API Changes ~~~~~~~~~~~ * Kill the global `--ng-daemons` flag `RB #1852 <https://rbcommons.com/s/twitter/r/1852>`_ * Removed parallel_test_paths setting from pants.ini. It isn't needed in the pants repo any more `RB #1846 <https://rbcommons.com/s/twitter/r/1846>`_ * BUILD file format cleanup: - Deprecate bundle().add in favor of bundle(files=) `RB #1788 <https://rbcommons.com/s/twitter/r/1788>`_ - Deprecate .intransitive() in favor of argument `RB #1797 <https://rbcommons.com/s/twitter/r/1797>`_ - Deprecate target.with_description in favor of target(description=) `RB #1790 <https://rbcommons.com/s/twitter/r/1790>`_ - Allow exclude in globs `RB #1762 <https://rbcommons.com/s/twitter/r/1762>`_ - Move with_artifacts to an artifacts argument `RB #1672 <https://rbcommons.com/s/twitter/r/1672>`_ * An attempt to deprecate some old methods `RB #1720 <https://rbcommons.com/s/twitter/r/1720>`_ * Options refactor work - Make option registration recursion optional `RB #1870 <https://rbcommons.com/s/twitter/r/1870>`_ - Remove all direct config uses from jar_publish.py `RB #1844 <https://rbcommons.com/s/twitter/r/1844>`_ - Read pants_distdir from options instead of config `RB #1842 <https://rbcommons.com/s/twitter/r/1842>`_ - Remove direct config references in thrift gen code `RB #1839 <https://rbcommons.com/s/twitter/r/1839>`_ - Android backend now exclusively uses the new option system `RB #1819 <https://rbcommons.com/s/twitter/r/1819>`_ - Replace config use in RunTracker with options `RB #1823 <https://rbcommons.com/s/twitter/r/1823>`_ - Add pants_bootstradir and pants_configdir to options bootstrapper `RB #1835 <https://rbcommons.com/s/twitter/r/1835>`_ - Remove all direct config access in task.py `RB #1827 <https://rbcommons.com/s/twitter/r/1827>`_ - Convert config-only options in goal idea and eclipse to use new options format `RB #1805 <https://rbcommons.com/s/twitter/r/1805>`_ - Remove config_section from some tasks `RB #1806 <https://rbcommons.com/s/twitter/r/1806>`_ - Disallow --no- on the name of boolean flags, refactor existing ones `Issue #34 <https://github.com/pantsbuild/intellij-pants-plugin/issues/34>`_ `RB #1799 <https://rbcommons.com/s/twitter/r/1799>`_ - Migrating pants.ini config values for protobuf-gen to advanced registered options under gen.protobuf `RB #1741 <https://rbcommons.com/s/twitter/r/1741>`_ * Add a way to deprecate options with 'deprecated_version' and 'deprecated_hint' kwargs to register() `RB #1799 <https://rbcommons.com/s/twitter/r/1799>`_ `RB #1814 <https://rbcommons.com/s/twitter/r/1814>`_ * Implement compile_classpath using UnionProducts `RB #1761 <https://rbcommons.com/s/twitter/r/1761>`_ * Introduce a @deprecated decorator `RB #1725 <https://rbcommons.com/s/twitter/r/1725>`_ * Update jar-tool to 0.1.9 and switch to use @argfile calling convention `RB #1798 <https://rbcommons.com/s/twitter/r/1798>`_ * Pants to respect XDB spec for global storage on unix systems `RB #1817 <https://rbcommons.com/s/twitter/r/1817>`_ * Adds a mixin (ImportJarsMixin) for the IvyImports task `RB #1783 <https://rbcommons.com/s/twitter/r/1783>`_ * Added invalidation check to UnpackJars task `RB #1776 <https://rbcommons.com/s/twitter/r/1776>`_ * Enable python-eval for pants source code `RB #1773 <https://rbcommons.com/s/twitter/r/1773>`_ * adding xml output for python coverage `Issue #1105 <https://github.com/pantsbuild/pants/issues/1105>`_ `RB #1770 <https://rbcommons.com/s/twitter/r/1770>`_ * Optionally adds a path value onto protoc's PATH befor launching it `RB #1756 <https://rbcommons.com/s/twitter/r/1756>`_ * Add progress information to partition reporting `RB #1749 <https://rbcommons.com/s/twitter/r/1749>`_ * Add SignApk product and Zipalign task `RB #1737 <https://rbcommons.com/s/twitter/r/1737>`_ * Add an 'advanced' parameter to registering options `RB #1739 <https://rbcommons.com/s/twitter/r/1739>`_ * Add an env var for enabling the profiler `RB #1305 <https://rbcommons.com/s/twitter/r/1305>`_ Bugfixes and features ~~~~~~~~~~~~~~~~~~~~~ * Kill the .saplings split `RB #1886 <https://rbcommons.com/s/twitter/r/1886>`_ * Update our requests library to something more recent `RB #1884 <https://rbcommons.com/s/twitter/r/1884>`_ * Make a nicer looking name for workunit output `RB #1876 <https://rbcommons.com/s/twitter/r/1876>`_ * Fixup DxCompile jvm_options to be a list `RB #1878 <https://rbcommons.com/s/twitter/r/1878>`_ * Make sure <?xml starts at the beginning of the file when creating an empty xml report `RB #1856 <https://rbcommons.com/s/twitter/r/1856>`_ * Set print_exception_stacktrace in pants.ini `RB #1872 <https://rbcommons.com/s/twitter/r/1872>`_ * Handle --print-exception-stacktrace and --version more elegantly `RB #1871 <https://rbcommons.com/s/twitter/r/1871>`_ * Improve AndroidDistribution caching `RB #1861 <https://rbcommons.com/s/twitter/r/1861>`_ * Add zinc to the platform_tools for zinc_utils `RB #1779 <https://rbcommons.com/s/twitter/r/1779>`_ `RB #1858 <https://rbcommons.com/s/twitter/r/1858>`_ * Fix WARN/WARNING confusion `RB #1866 <https://rbcommons.com/s/twitter/r/1866>`_ * Fixup Config to find DEFAULT values for missing sections `RB #1851 <https://rbcommons.com/s/twitter/r/1851>`_ * Get published artifact classfier from config `RB #1857 <https://rbcommons.com/s/twitter/r/1857>`_ * Make Context.targets() include synthetic targets `RB #1840 <https://rbcommons.com/s/twitter/r/1840>`_ `RB #1863 <https://rbcommons.com/s/twitter/r/1863>`_ * Fix micros to be left 0 padded to 6 digits `RB #1849 <https://rbcommons.com/s/twitter/r/1849>`_ * Setup logging before plugins are loaded `RB #1820 <https://rbcommons.com/s/twitter/r/1820>`_ * Introduce pants_setup_py and contrib_setup_py helpers `RB #1822 <https://rbcommons.com/s/twitter/r/1822>`_ * Support zinc name hashing `RB #1779 <https://rbcommons.com/s/twitter/r/1779>`_ * Actually generate a depfile from t.c.tools.compiler and use it in jmake `RB #1824 <https://rbcommons.com/s/twitter/r/1824>`_ `RB #1825 <https://rbcommons.com/s/twitter/r/1825>`_ * Ivy Imports now has a cache `RB #1785 <https://rbcommons.com/s/twitter/r/1785>`_ * Get rid of some direct config uses in python_repl.py `RB #1826 <https://rbcommons.com/s/twitter/r/1826>`_ * Add check if jars exists before registering products `RB #1808 <https://rbcommons.com/s/twitter/r/1808>`_ * shlex the python run args `RB #1782 <https://rbcommons.com/s/twitter/r/1782>`_ * Convert t.c.log usages to logging `RB #1815 <https://rbcommons.com/s/twitter/r/1815>`_ * Kill unused twitter.common reqs and deps `RB #1816 <https://rbcommons.com/s/twitter/r/1816>`_ * Check import sorting before checking headers `RB #1812 <https://rbcommons.com/s/twitter/r/1812>`_ * Fixup typo accessing debug_port option `RB #1811 <https://rbcommons.com/s/twitter/r/1811>`_ * Allow the dependees goal and idea to respect the --spec_excludes option `RB #1795 <https://rbcommons.com/s/twitter/r/1795>`_ * Copy t.c.lang.{AbstractClass,Singleton} to pants `RB #1803 <https://rbcommons.com/s/twitter/r/1803>`_ * Replace all t.c.lang.Compatibility uses with six `RB #1801 <https://rbcommons.com/s/twitter/r/1801>`_ * Fix sp in java example readme.md `RB #1800 <https://rbcommons.com/s/twitter/r/1800>`_ * Add util.XmlParser and AndroidManifestParser `RB #1757 <https://rbcommons.com/s/twitter/r/1757>`_ * Replace Compatibility.exec_function with `six.exec_` `RB #1742 <https://rbcommons.com/s/twitter/r/1742>`_ `RB #1794 <https://rbcommons.com/s/twitter/r/1794>`_ * Take care of stale pidfiles for pants server `RB #1791 <https://rbcommons.com/s/twitter/r/1791>`_ * Fixup the scrooge release `RB #1793 <https://rbcommons.com/s/twitter/r/1793>`_ * Extract scrooge tasks to contrib/ `RB #1780 <https://rbcommons.com/s/twitter/r/1780>`_ * Fixup JarPublish changelog rendering `RB #1787 <https://rbcommons.com/s/twitter/r/1787>`_ * Preserve dictionary order in the anonymizer `RB #1779 <https://rbcommons.com/s/twitter/r/1779>`_ `RB #1781 <https://rbcommons.com/s/twitter/r/1781>`_ * Fix a test file leak to the build root `RB #1771 <https://rbcommons.com/s/twitter/r/1771>`_ * Replace all instances of compatibility.string `RB #1764 <https://rbcommons.com/s/twitter/r/1764>`_ * Improve the python run error message `RB #1773 <https://rbcommons.com/s/twitter/r/1773>`_ `RB #1777 <https://rbcommons.com/s/twitter/r/1777>`_ * Upgrade pex to 0.8.6 `RB #1778 <https://rbcommons.com/s/twitter/r/1778>`_ * Introduce a PythonEval task `RB #1772 <https://rbcommons.com/s/twitter/r/1772>`_ * Add an elapsed timestamp to the banner for CI `RB #1775 <https://rbcommons.com/s/twitter/r/1775>`_ * Trying to clean up a TODO in IvyTaskMixin `RB #1753 <https://rbcommons.com/s/twitter/r/1753>`_ * rm double_dag `RB #1711 <https://rbcommons.com/s/twitter/r/1711>`_ * Add skip / target invalidation to thrift linting `RB #1755 <https://rbcommons.com/s/twitter/r/1755>`_ * Fixup `Task.invalidated` UI `RB #1758 <https://rbcommons.com/s/twitter/r/1758>`_ * Improve the implementation of help printing `RB #1739 <https://rbcommons.com/s/twitter/r/1739>`_ `RB #1744 <https://rbcommons.com/s/twitter/r/1744>`_ * Fix TestAndroidBase task_type override miss `RB #1751 <https://rbcommons.com/s/twitter/r/1751>`_ * Pass the BUILD file path to compile `RB #1742 <https://rbcommons.com/s/twitter/r/1742>`_ * Bandaid leaks of global Config state in tests `RB #1750 <https://rbcommons.com/s/twitter/r/1750>`_ * Fixing cobertura coverage so that it actually works `RB #1704 <https://rbcommons.com/s/twitter/r/1704>`_ * Restore the ability to bootstrap Ivy with a custom configuration file `RB #1709 <https://rbcommons.com/s/twitter/r/1709>`_ * Kill BUILD file bytecode compilation `RB #1736 <https://rbcommons.com/s/twitter/r/1736>`_ * Kill 'goal' usage in the pants script `RB #1738 <https://rbcommons.com/s/twitter/r/1738>`_ * Fixup ivy report generation and opening `RB #1735 <https://rbcommons.com/s/twitter/r/1735>`_ * Fixup pants sys.excepthook for pex context `RB #1733 <https://rbcommons.com/s/twitter/r/1733>`_ `RB #1734 <https://rbcommons.com/s/twitter/r/1734>`_ * Adding long form of help arguments to the help output `RB #1732 <https://rbcommons.com/s/twitter/r/1732>`_ * Simplify isort config `RB #1731 <https://rbcommons.com/s/twitter/r/1731>`_ * Expand scope of python file format checks `RB #1729 <https://rbcommons.com/s/twitter/r/1729>`_ * Add path-to option to depmap `RB #1545 <https://rbcommons.com/s/twitter/r/1545>`_ * Fix a stragler `.is_apt` usage `RB #1724 <https://rbcommons.com/s/twitter/r/1724>`_ * Introduce isort to check `*.py` import ordering `RB #1726 <https://rbcommons.com/s/twitter/r/1726>`_ * Upgrade to pex 0.8.5 `RB #1721 <https://rbcommons.com/s/twitter/r/1721>`_ * cleanup is_xxx checks: is_jar_library `RB #1719 <https://rbcommons.com/s/twitter/r/1719>`_ * Avoid redundant traversal in classpath calculation `RB #1714 <https://rbcommons.com/s/twitter/r/1714>`_ * Upgrade to the latest virtualenv `RB #1715 <https://rbcommons.com/s/twitter/r/1715>`_ `RB #1718 <https://rbcommons.com/s/twitter/r/1718>`_ * Fixup the release script `RB #1715 <https://rbcommons.com/s/twitter/r/1715>`_ * './pants goal' -> './pants' `RB #1617 <https://rbcommons.com/s/twitter/r/1617>`_ * Add new function open_zip64 which defaults allowZip64=True for Zip files `RB #1708 <https://rbcommons.com/s/twitter/r/1708>`_ * Fix a bug that --bundle-archive=tar generates .tar.gz instead of a .tar `RB #1707 <https://rbcommons.com/s/twitter/r/1707>`_ * Remove 3rdparty debug.keystore `RB #1703 <https://rbcommons.com/s/twitter/r/1703>`_ * Keystore no longer a target, apks signed with SignApkTask `RB #1690 <https://rbcommons.com/s/twitter/r/1690>`_ * remove this jar_rule I accidentally added `RB #1701 <https://rbcommons.com/s/twitter/r/1701>`_ * Require pushdb migration to specify a destination directory `RB #1684 <https://rbcommons.com/s/twitter/r/1684>`_ 0.0.28 (2/1/2015) ----------------- Bugfixes ~~~~~~~~ * Numerous doc improvements & generation fixes - Steal some info from options docstring - Document `--config-override` & `PANTS_` environment vars - Document JDK_HOME & JAVA_HOME use when choosing a java distribution - Rename "Goals Reference" page -> "Options Reference" - Document when to use isrequired - Fix Google indexing to ignore test sites - Update the code layout section of Pants Internals - Show changelog & for that support `page(source='something.rst')` - Add a reminder that you can do set-like math on FileSets - Hacking on Pants itself, update `--pdb` doc - Start of a "Why Choose Pants?" section - Highlight plugin examples from twitter/commons - Add a blurb about deploy_jar_rules to the JVM docs - Show how to pass `-s` to pytest - When to use java_sources, when not to - Start of a Pants-with-scala page - Publish page now shows `provides=` example - Add a flag to omit "internal" things - Slide tweaks based on class feedback - Document argument splitting for options `Issue #897 <https://github.com/pantsbuild/pants/issues/897>`_ `RB #1092 <https://rbcommons.com/s/twitter/r/1092>`_ `RB #1490 <https://rbcommons.com/s/twitter/r/1490>`_ `RB #1532 <https://rbcommons.com/s/twitter/r/1532>`_ `RB #1544 <https://rbcommons.com/s/twitter/r/1544>`_ `RB #1546 <https://rbcommons.com/s/twitter/r/1546>`_ `RB #1548 <https://rbcommons.com/s/twitter/r/1548>`_ `RB #1549 <https://rbcommons.com/s/twitter/r/1549>`_ `RB #1550 <https://rbcommons.com/s/twitter/r/1550>`_ `RB #1554 <https://rbcommons.com/s/twitter/r/1554>`_ `RB #1555 <https://rbcommons.com/s/twitter/r/1555>`_ `RB #1559 <https://rbcommons.com/s/twitter/r/1559>`_ `RB #1560 <https://rbcommons.com/s/twitter/r/1560>`_ `RB #1565 <https://rbcommons.com/s/twitter/r/1565>`_ `RB #1575 <https://rbcommons.com/s/twitter/r/1575>`_ `RB #1580 <https://rbcommons.com/s/twitter/r/1580>`_ `RB #1583 <https://rbcommons.com/s/twitter/r/1583>`_ `RB #1584 <https://rbcommons.com/s/twitter/r/1584>`_ `RB #1593 <https://rbcommons.com/s/twitter/r/1593>`_ `RB #1607 <https://rbcommons.com/s/twitter/r/1607>`_ `RB #1608 <https://rbcommons.com/s/twitter/r/1608>`_ `RB #1609 <https://rbcommons.com/s/twitter/r/1609>`_ `RB #1618 <https://rbcommons.com/s/twitter/r/1618>`_ `RB #1622 <https://rbcommons.com/s/twitter/r/1622>`_ `RB #1633 <https://rbcommons.com/s/twitter/r/1633>`_ `RB #1640 <https://rbcommons.com/s/twitter/r/1640>`_ `RB #1657 <https://rbcommons.com/s/twitter/r/1657>`_ `RB #1658 <https://rbcommons.com/s/twitter/r/1658>`_ `RB #1563 <https://rbcommons.com/s/twitter/r/1563>`_ `RB #1564 <https://rbcommons.com/s/twitter/r/1564>`_ `RB #1677 <https://rbcommons.com/s/twitter/r/1677>`_ `RB #1678 <https://rbcommons.com/s/twitter/r/1678>`_ `RB #1694 <https://rbcommons.com/s/twitter/r/1694>`_ `RB #1695 <https://rbcommons.com/s/twitter/r/1695>`_ * Add calls to relpath so that we don't generate overlong filenames on mesos `RB #1528 <https://rbcommons.com/s/twitter/r/1528>`_ `RB #1612 <https://rbcommons.com/s/twitter/r/1612>`_ `RB #1644 <https://rbcommons.com/s/twitter/r/1644>`_ * Regularize headers `RB #1691 <https://rbcommons.com/s/twitter/r/1691>`_ * Pants itself uses python2.7, kill unittest2 imports `RB #1689 <https://rbcommons.com/s/twitter/r/1689>`_ * Make 'setup-py' show up in './pants goal goals' `RB #1466 <https://rbcommons.com/s/twitter/r/1466>`_ * Test that CycleException happens for cycles (instead of a stack overflow) `RB #1686 <https://rbcommons.com/s/twitter/r/1686>`_ * Replace t.c.collection.OrderedDict with 2.7+ stdlib `RB #1687 <https://rbcommons.com/s/twitter/r/1687>`_ * Make ide_gen a subclass of Task to avoid depending on compile and resources tasks `Issue #997 <https://github.com/pantsbuild/pants/issues/997>`_ `RB #1679 <https://rbcommons.com/s/twitter/r/1679>`_ * Remove with_sources() from 3rdparty/BUILD `RB #1674 <https://rbcommons.com/s/twitter/r/1674>`_ * Handle thrift inclusion for python in apache_thrift_gen `RB #1656 <https://rbcommons.com/s/twitter/r/1656>`_ `RB #1675 <https://rbcommons.com/s/twitter/r/1675>`_ * Make beautifulsoup4 dep fixed rather than floating `RB #1670 <https://rbcommons.com/s/twitter/r/1670>`_ * Fixes for unpacked_jars `RB #1624 <https://rbcommons.com/s/twitter/r/1624>`_ * Fix spurious Products requirements `RB #1662 <https://rbcommons.com/s/twitter/r/1662>`_ * Fixup the options bootstrapper to support boolean flags `RB #1660 <https://rbcommons.com/s/twitter/r/1660>`_ `RB #1664 <https://rbcommons.com/s/twitter/r/1664>`_ * Change `Distribution.cached` to compare using Revision objects `RB #1653 <https://rbcommons.com/s/twitter/r/1653>`_ * Map linux i686 arch to i386 `Issue #962 <https://github.com/pantsbuild/pants/issues/962>`_ `RB #1659 <https://rbcommons.com/s/twitter/r/1659>`_ * bump virtualenv version to 12.0.5 `RB #1621 <https://rbcommons.com/s/twitter/r/1621>`_ * Bugfixes in calling super methods in traversable_specs and traversable_dependency_specs `RB #1611 <https://rbcommons.com/s/twitter/r/1611>`_ * Raise TaskError on python antlr generation failure `RB #1604 <https://rbcommons.com/s/twitter/r/1604>`_ * Fix topological ordering + chunking bug in jvm_compile `RB #1598 <https://rbcommons.com/s/twitter/r/1598>`_ * Fix CI from RB 1604 (and change a test name as suggested by nhoward) `RB #1606 <https://rbcommons.com/s/twitter/r/1606>`_ * Mark some missing-deps testprojects as expected to fail `RB #1601 <https://rbcommons.com/s/twitter/r/1601>`_ * Fix scalac plugin support broken in a refactor `RB #1596 <https://rbcommons.com/s/twitter/r/1596>`_ * Do not insert an error message as the "main" class in jvm_binary_task `RB #1590 <https://rbcommons.com/s/twitter/r/1590>`_ * Remove variable shadowing from method in archive.py `RB #1589 <https://rbcommons.com/s/twitter/r/1589>`_ * Don't realpath jars on the classpath `RB #1588 <https://rbcommons.com/s/twitter/r/1588>`_ `RB #1591 <https://rbcommons.com/s/twitter/r/1591>`_ * Cache ivy report dependency traversals consistently `RB #1557 <https://rbcommons.com/s/twitter/r/1557>`_ * Print the traceback when there is a problem loading or calling a backend module `RB #1582 <https://rbcommons.com/s/twitter/r/1582>`_ * Kill unused Engine.execution_order method and test `RB #1576 <https://rbcommons.com/s/twitter/r/1576>`_ * Support use of pytest's --pdb mode `RB #1570 <https://rbcommons.com/s/twitter/r/1570>`_ * fix missing dep. allows running this test on its own `RB #1561 <https://rbcommons.com/s/twitter/r/1561>`_ * Remove dead code and no longer needed topo sort from cache_manager `RB #1553 <https://rbcommons.com/s/twitter/r/1553>`_ * Use Travis CIs new container based builds and caching `RB #1523 <https://rbcommons.com/s/twitter/r/1523>`_ `RB #1537 <https://rbcommons.com/s/twitter/r/1537>`_ `RB #1538 <https://rbcommons.com/s/twitter/r/1538>`_ API Changes ~~~~~~~~~~~ * Improvements and extensions of `WhatChanged` functionality - Skip loading graph if no changed targets - Filter targets from changed using exclude_target_regexp - Compile/Test "changed" targets - Optionally include direct or transitive dependees of changed targets - Add changes-in-diffspec option to what-changed - Refactor WhatChanged into base class, use LazySourceMapper - Introduce LazySourceMapper and test `RB #1526 <https://rbcommons.com/s/twitter/r/1526>`_ `RB #1534 <https://rbcommons.com/s/twitter/r/1534>`_ `RB #1535 <https://rbcommons.com/s/twitter/r/1535>`_ `RB #1542 <https://rbcommons.com/s/twitter/r/1542>`_ `RB #1543 <https://rbcommons.com/s/twitter/r/1543>`_ `RB #1567 <https://rbcommons.com/s/twitter/r/1567>`_ `RB #1572 <https://rbcommons.com/s/twitter/r/1572>`_ `RB #1595 <https://rbcommons.com/s/twitter/r/1595>`_ `RB #1600 <https://rbcommons.com/s/twitter/r/1600>`_ * More options migration, improvements and bugfixes - Centralize invertible arg logic - Support loading boolean flags from pants.ini - Add a clarifying note in migrate_config - Some refactoring of IvyUtils - Rename the few remaining "jvm_args" variables to "jvm_options" - `./pants --help-all` lists all options - Add missing stanza in the migration script - Switch artifact cache setup from config to new options - Migrate jvm_compile's direct config accesses to the options system - Added some formatting to parse errors for dicts and lists in options - `s/new_options/options/g` - Re-implement the jvm tool registration mechanism via the options system - Make JvmRun support passthru args `RB #1347 <https://rbcommons.com/s/twitter/r/1347>`_ `RB #1495 <https://rbcommons.com/s/twitter/r/1495>`_ `RB #1521 <https://rbcommons.com/s/twitter/r/1521>`_ `RB #1527 <https://rbcommons.com/s/twitter/r/1527>`_ `RB #1552 <https://rbcommons.com/s/twitter/r/1552>`_ `RB #1569 <https://rbcommons.com/s/twitter/r/1569>`_ `RB #1585 <https://rbcommons.com/s/twitter/r/1585>`_ `RB #1599 <https://rbcommons.com/s/twitter/r/1599>`_ `RB #1626 <https://rbcommons.com/s/twitter/r/1626>`_ `RB #1630 <https://rbcommons.com/s/twitter/r/1630>`_ `RB #1631 <https://rbcommons.com/s/twitter/r/1631>`_ `RB #1646 <https://rbcommons.com/s/twitter/r/1646>`_ `RB #1680 <https://rbcommons.com/s/twitter/r/1680>`_ `RB #1681 <https://rbcommons.com/s/twitter/r/1681>`_ `RB #1696 <https://rbcommons.com/s/twitter/r/1696>`_ * Upgrade pex dependency to 0.8.4 - Pick up several perf wins - Pick up fix that allows pex to read older pexes `RB #1648 <https://rbcommons.com/s/twitter/r/1648>`_ `RB #1693 <https://rbcommons.com/s/twitter/r/1693>`_ * Upgrade jmake to org.pantsbuild releases - Upgrade jmake to version with isPackagePrivateClass fix - Upgrade jmake to version that works with java 1.5+ `Issue #13 <https://github.com/pantsbuild/jmake/issues/13>`_ `RB #1594 <https://rbcommons.com/s/twitter/r/1594>`_ `RB #1628 <https://rbcommons.com/s/twitter/r/1628>`_ `RB #1650 <https://rbcommons.com/s/twitter/r/1650>`_ * Fix ivy resolve args + added ability to provide custom ivy configurations `RB #1671 <https://rbcommons.com/s/twitter/r/1671>`_ * Allow target specs to come from files `RB #1669 <https://rbcommons.com/s/twitter/r/1669>`_ * Remove obsolete twitter-specific hack 'is_classpath_artifact' `RB #1676 <https://rbcommons.com/s/twitter/r/1676>`_ * Improve RoundEngine lifecycle `RB #1665 <https://rbcommons.com/s/twitter/r/1665>`_ * Changed Scala version from 2.9.3 to 2.10.3 because zinc was using 2.10.3 already `RB #1610 <https://rbcommons.com/s/twitter/r/1610>`_ * Prevent "round trip" dependencies `RB #1603 <https://rbcommons.com/s/twitter/r/1603>`_ * Edit `Config.get_required` so as to raise error for any blank options `RB #1638 <https://rbcommons.com/s/twitter/r/1638>`_ * Don't plumb an executor through when bootstrapping tools `RB #1634 <https://rbcommons.com/s/twitter/r/1634>`_ * Print jar_dependency deprecations to stderr `RB #1632 <https://rbcommons.com/s/twitter/r/1632>`_ * Add configuration parameter to control the requirements cache ttl `RB #1627 <https://rbcommons.com/s/twitter/r/1627>`_ * Got ivy to map in javadoc and source jars for pants goal idea `RB #1613 <https://rbcommons.com/s/twitter/r/1613>`_ `RB #1639 <https://rbcommons.com/s/twitter/r/1639>`_ * Remove the '^' syntax for the command line spec parsing `RB #1616 <https://rbcommons.com/s/twitter/r/1616>`_ * Kill leftover imports handling from early efforts `RB #592 <https://rbcommons.com/s/twitter/r/592>`_ `RB #1614 <https://rbcommons.com/s/twitter/r/1614>`_ * Adding the ability to pull in a Maven artifact and extract its contents `RB #1210 <https://rbcommons.com/s/twitter/r/1210>`_ * Allow FingerprintStrategy to opt out of fingerprinting `RB #1602 <https://rbcommons.com/s/twitter/r/1602>`_ * Remove the ivy_home property from context `RB #1592 <https://rbcommons.com/s/twitter/r/1592>`_ * Refactor setting of PYTHONPATH in pants.ini `RB #1586 <https://rbcommons.com/s/twitter/r/1586>`_ * Relocate 'to_jar_dependencies' method back to jar_library `RB #1574 <https://rbcommons.com/s/twitter/r/1574>`_ * Update protobuf_gen to be able to reference sources outside of the subdirectory of the BUILD file `RB #1573 <https://rbcommons.com/s/twitter/r/1573>`_ * Kill goal dependencies `RB #1577 <https://rbcommons.com/s/twitter/r/1577>`_ * Move excludes logic into cmd_line_spec_parser so it can filter out broken build targets `RB #930 <https://rbcommons.com/s/twitter/r/930>`_ `RB #1566 <https://rbcommons.com/s/twitter/r/1566>`_ * Replace exclusives_groups with a compile_classpath product `RB #1539 <https://rbcommons.com/s/twitter/r/1539>`_ * Allow adding to pythonpath via pant.ini `RB #1457 <https://rbcommons.com/s/twitter/r/1457>`_ 0.0.27 (12/19/2014) ------------------- Bugfixes ~~~~~~~~ * Fix python doc: "repl" and "setup-py" are goals now, don't use "py" `RB #1302 <https://rbcommons.com/s/twitter/r/1302>`_ * Fix python thrift generation `RB #1517 <https://rbcommons.com/s/twitter/r/1517>`_ * Fixup migrate_config to use new Config API `RB #1514 <https://rbcommons.com/s/twitter/r/1514>`_ 0.0.26 (12/17/2014) ------------------- Bugfixes ~~~~~~~~ * Fix the `ScroogeGen` target selection predicate `RB #1497 <https://rbcommons.com/s/twitter/r/1497>`_ 0.0.25 (12/17/2014) ------------------- API Changes ~~~~~~~~~~~ * Flesh out and convert to the new options system introduced in `pantsbuild.pants` 0.0.24 - Support loading config from multiple files - Support option reads via indexing - Add a `migrate_config` tool - Migrate tasks to the option registration system - Get rid of the old config registration mechanism - Add passthru arg support in the new options system - Support passthru args in tasks - Allow a task type know its own options scope - Support old-style flags even in the new flag system `RB #1093 <https://rbcommons.com/s/twitter/r/1093>`_ `RB #1094 <https://rbcommons.com/s/twitter/r/1094>`_ `RB #1095 <https://rbcommons.com/s/twitter/r/1095>`_ `RB #1096 <https://rbcommons.com/s/twitter/r/1096>`_ `RB #1097 <https://rbcommons.com/s/twitter/r/1097>`_ `RB #1102 <https://rbcommons.com/s/twitter/r/1102>`_ `RB #1109 <https://rbcommons.com/s/twitter/r/1109>`_ `RB #1114 <https://rbcommons.com/s/twitter/r/1114>`_ `RB #1124 <https://rbcommons.com/s/twitter/r/1124>`_ `RB #1125 <https://rbcommons.com/s/twitter/r/1125>`_ `RB #1127 <https://rbcommons.com/s/twitter/r/1127>`_ `RB #1129 <https://rbcommons.com/s/twitter/r/1129>`_ `RB #1131 <https://rbcommons.com/s/twitter/r/1131>`_ `RB #1135 <https://rbcommons.com/s/twitter/r/1135>`_ `RB #1138 <https://rbcommons.com/s/twitter/r/1138>`_ `RB #1140 <https://rbcommons.com/s/twitter/r/1140>`_ `RB #1146 <https://rbcommons.com/s/twitter/r/1146>`_ `RB #1147 <https://rbcommons.com/s/twitter/r/1147>`_ `RB #1170 <https://rbcommons.com/s/twitter/r/1170>`_ `RB #1175 <https://rbcommons.com/s/twitter/r/1175>`_ `RB #1183 <https://rbcommons.com/s/twitter/r/1183>`_ `RB #1186 <https://rbcommons.com/s/twitter/r/1186>`_ `RB #1192 <https://rbcommons.com/s/twitter/r/1192>`_ `RB #1195 <https://rbcommons.com/s/twitter/r/1195>`_ `RB #1203 <https://rbcommons.com/s/twitter/r/1203>`_ `RB #1211 <https://rbcommons.com/s/twitter/r/1211>`_ `RB #1212 <https://rbcommons.com/s/twitter/r/1212>`_ `RB #1214 <https://rbcommons.com/s/twitter/r/1214>`_ `RB #1218 <https://rbcommons.com/s/twitter/r/1218>`_ `RB #1223 <https://rbcommons.com/s/twitter/r/1223>`_ `RB #1225 <https://rbcommons.com/s/twitter/r/1225>`_ `RB #1229 <https://rbcommons.com/s/twitter/r/1229>`_ `RB #1230 <https://rbcommons.com/s/twitter/r/1230>`_ `RB #1231 <https://rbcommons.com/s/twitter/r/1231>`_ `RB #1232 <https://rbcommons.com/s/twitter/r/1232>`_ `RB #1234 <https://rbcommons.com/s/twitter/r/1234>`_ `RB #1236 <https://rbcommons.com/s/twitter/r/1236>`_ `RB #1244 <https://rbcommons.com/s/twitter/r/1244>`_ `RB #1248 <https://rbcommons.com/s/twitter/r/1248>`_ `RB #1251 <https://rbcommons.com/s/twitter/r/1251>`_ `RB #1258 <https://rbcommons.com/s/twitter/r/1258>`_ `RB #1269 <https://rbcommons.com/s/twitter/r/1269>`_ `RB #1270 <https://rbcommons.com/s/twitter/r/1270>`_ `RB #1276 <https://rbcommons.com/s/twitter/r/1276>`_ `RB #1281 <https://rbcommons.com/s/twitter/r/1281>`_ `RB #1286 <https://rbcommons.com/s/twitter/r/1286>`_ `RB #1289 <https://rbcommons.com/s/twitter/r/1289>`_ `RB #1297 <https://rbcommons.com/s/twitter/r/1297>`_ `RB #1300 <https://rbcommons.com/s/twitter/r/1300>`_ `RB #1308 <https://rbcommons.com/s/twitter/r/1308>`_ `RB #1309 <https://rbcommons.com/s/twitter/r/1309>`_ `RB #1317 <https://rbcommons.com/s/twitter/r/1317>`_ `RB #1320 <https://rbcommons.com/s/twitter/r/1320>`_ `RB #1323 <https://rbcommons.com/s/twitter/r/1323>`_ `RB #1328 <https://rbcommons.com/s/twitter/r/1328>`_ `RB #1341 <https://rbcommons.com/s/twitter/r/1341>`_ `RB #1343 <https://rbcommons.com/s/twitter/r/1343>`_ `RB #1351 <https://rbcommons.com/s/twitter/r/1351>`_ `RB #1357 <https://rbcommons.com/s/twitter/r/1357>`_ `RB #1373 <https://rbcommons.com/s/twitter/r/1373>`_ `RB #1375 <https://rbcommons.com/s/twitter/r/1375>`_ `RB #1385 <https://rbcommons.com/s/twitter/r/1385>`_ `RB #1389 <https://rbcommons.com/s/twitter/r/1389>`_ `RB #1399 <https://rbcommons.com/s/twitter/r/1399>`_ `RB #1409 <https://rbcommons.com/s/twitter/r/1409>`_ `RB #1435 <https://rbcommons.com/s/twitter/r/1435>`_ `RB #1441 <https://rbcommons.com/s/twitter/r/1441>`_ `RB #1442 <https://rbcommons.com/s/twitter/r/1442>`_ `RB #1443 <https://rbcommons.com/s/twitter/r/1443>`_ `RB #1451 <https://rbcommons.com/s/twitter/r/1451>`_ * Kill `Commands` and move all actions to `Tasks` in the goal infrastructure - Kill pants own use of the deprecated goal command - Restore the deprecation warning for specifying 'goal' on the cmdline - Get rid of the Command class completely - Enable passthru args for python run `RB #1321 <https://rbcommons.com/s/twitter/r/1321>`_ `RB #1327 <https://rbcommons.com/s/twitter/r/1327>`_ `RB #1394 <https://rbcommons.com/s/twitter/r/1394>`_ `RB #1402 <https://rbcommons.com/s/twitter/r/1402>`_ `RB #1448 <https://rbcommons.com/s/twitter/r/1448>`_ `RB #1453 <https://rbcommons.com/s/twitter/r/1453>`_ `RB #1465 <https://rbcommons.com/s/twitter/r/1465>`_ `RB #1471 <https://rbcommons.com/s/twitter/r/1471>`_ `RB #1476 <https://rbcommons.com/s/twitter/r/1476>`_ `RB #1479 <https://rbcommons.com/s/twitter/r/1479>`_ * Add support for loading plugins via standard the pkg_resources entry points mechanism `RB #1429 <https://rbcommons.com/s/twitter/r/1429>`_ `RB #1444 <https://rbcommons.com/s/twitter/r/1444>`_ * Many performance improvements and bugfixes to the artifact caching subsystem - Use a requests `Session` to enable connection pooling - Make CacheKey hash and pickle friendly - Multiprocessing Cache Check and Write - Skip compressing/writing artifacts that are already in the cache - Add the ability for JVM targets to refuse to allow themselves to be cached in the artifact cache - Fix name of non-fatal cache exception - Fix the issue of seeing "Error while writing to artifact cache: an integer is required" during [cache check] - Fix all uncompressed artifacts stored as just `.tar` `RB #981 <https://rbcommons.com/s/twitter/r/981>`_ `RB #986 <https://rbcommons.com/s/twitter/r/986>`_ `RB #1022 <https://rbcommons.com/s/twitter/r/1022>`_ `RB #1197 <https://rbcommons.com/s/twitter/r/1197>`_ `RB #1206 <https://rbcommons.com/s/twitter/r/1206>`_ `RB #1233 <https://rbcommons.com/s/twitter/r/1233>`_ `RB #1261 <https://rbcommons.com/s/twitter/r/1261>`_ `RB #1264 <https://rbcommons.com/s/twitter/r/1264>`_ `RB #1265 <https://rbcommons.com/s/twitter/r/1265>`_ `RB #1272 <https://rbcommons.com/s/twitter/r/1272>`_ `RB #1274 <https://rbcommons.com/s/twitter/r/1274>`_ `RB #1249 <https://rbcommons.com/s/twitter/r/1249>`_ `RB #1310 <https://rbcommons.com/s/twitter/r/1310>`_ * More enhancements to the `depmap` goal to support IDE plugins: - Add Pants Target Type to `depmap` to identify scala target VS java target - Add java_sources to the `depmap` info - Add transitive jar dependencies to `depmap` project info goal for intellij plugin `RB #1366 <https://rbcommons.com/s/twitter/r/1366>`_ `RB #1324 <https://rbcommons.com/s/twitter/r/1324>`_ `RB #1047 <https://rbcommons.com/s/twitter/r/1047>`_ * Port pants to pex 0.8.x `Issue #10 <https://github.com/pantsbuild/pex/issues/10>`_ `Issue #19 <https://github.com/pantsbuild/pex/issues/19>`_ `Issue #21 <https://github.com/pantsbuild/pex/issues/21>`_ `Issue #22 <https://github.com/pantsbuild/pex/issues/22>`_ `RB #778 <https://rbcommons.com/s/twitter/r/778>`_ `RB #785 <https://rbcommons.com/s/twitter/r/785>`_ `RB #1303 <https://rbcommons.com/s/twitter/r/1303>`_ `RB #1378 <https://rbcommons.com/s/twitter/r/1378>`_ `RB #1421 <https://rbcommons.com/s/twitter/r/1421>`_ * Remove support for __file__ in BUILDs `RB #1419 <https://rbcommons.com/s/twitter/r/1419>`_ * Allow setting the cwd for goals `run.jvm` and `test.junit` `RB #1344 <https://rbcommons.com/s/twitter/r/1344>`_ * Subclasses of `Exception` have strange deserialization `RB #1395 <https://rbcommons.com/s/twitter/r/1395>`_ * Remove outer (pants_exe) lock and serialized cmd `RB #1388 <https://rbcommons.com/s/twitter/r/1388>`_ * Make all access to `Context`'s lock via helpers `RB #1391 <https://rbcommons.com/s/twitter/r/1391>`_ * Allow adding entries to `source_roots` `RB #1359 <https://rbcommons.com/s/twitter/r/1359>`_ * Re-upload artifacts that encountered read-errors `RB #1361 <https://rbcommons.com/s/twitter/r/1361>`_ * Cache files created by (specially designed) annotation processors `RB #1250 <https://rbcommons.com/s/twitter/r/1250>`_ * Turn dependency dupes into errors `RB #1332 <https://rbcommons.com/s/twitter/r/1332>`_ * Add support for the Wire protobuf library `RB #1275 <https://rbcommons.com/s/twitter/r/1275>`_ * Pin pants support down to python2.7 - dropping 2.6 `RB #1278 <https://rbcommons.com/s/twitter/r/1278>`_ * Add a new param for page target, links, a list of hyperlinked-to targets `RB #1242 <https://rbcommons.com/s/twitter/r/1242>`_ * Add git root calculation for idea goal `RB #1189 <https://rbcommons.com/s/twitter/r/1189>`_ * Minimal target "tags" support `RB #1227 <https://rbcommons.com/s/twitter/r/1227>`_ * Include traceback with failures (even without fail-fast) `RB #1226 <https://rbcommons.com/s/twitter/r/1226>`_ * Add support for updating the environment from prep_commands `RB #1222 <https://rbcommons.com/s/twitter/r/1222>`_ * Read arguments for thrift-linter from `pants.ini` `RB #1215 <https://rbcommons.com/s/twitter/r/1215>`_ * Configurable Compression Level for Cache Artifacts `RB #1194 <https://rbcommons.com/s/twitter/r/1194>`_ * Add a flexible directory re-mapper for the bundle `RB #1181 <https://rbcommons.com/s/twitter/r/1181>`_ * Adds the ability to pass a filter method for ZIP extraction `RB #1199 <https://rbcommons.com/s/twitter/r/1199>`_ * Print a diagnostic if a BUILD file references a source file that does not exist `RB #1198 <https://rbcommons.com/s/twitter/r/1198>`_ * Add support for running a command before tests `RB #1179 <https://rbcommons.com/s/twitter/r/1179>`_ `RB #1177 <https://rbcommons.com/s/twitter/r/1177>`_ * Add `PantsRunIntegrationTest` into `pantsbuild.pants.testinfra` package `RB #1185 <https://rbcommons.com/s/twitter/r/1185>`_ * Refactor `jar_library` to be able to unwrap its list of jar_dependency objects `RB #1165 <https://rbcommons.com/s/twitter/r/1165>`_ * When resolving a tool dep, report back the `pants.ini` section with a reference that is failing `RB #1162 <https://rbcommons.com/s/twitter/r/1162>`_ * Add a list assertion for `python_requirement_library`'s requirements `RB #1142 <https://rbcommons.com/s/twitter/r/1142>`_ * Adding a list of dirs to exclude from the '::' scan in the `CmdLineSpecParser` `RB #1091 <https://rbcommons.com/s/twitter/r/1091>`_ * Protobuf and payload cleanups `RB #1099 <https://rbcommons.com/s/twitter/r/1099>`_ * Coalesce errors when parsing BUILDS in a spec `RB #1061 <https://rbcommons.com/s/twitter/r/1061>`_ * Refactor Payload `RB #1063 <https://rbcommons.com/s/twitter/r/1063>`_ * Add support for publishing plugins to pants `RB #1021 <https://rbcommons.com/s/twitter/r/1021>`_ Bugfixes ~~~~~~~~ * Numerous doc improvements & generation fixes - Updates to the pants essentials tech talk based on another dry-run - On skinny displays, don't show navigation UI by default - Handy rbt status tip from RBCommons newsletter - Document how to create a simple plugin - Update many bash examples that used old-style flags - Update Pants+IntelliJ docs to say the Plugin's the new hotness, link to plugin's README - Publish docs the new way - Update the "Pants Essentials" tech talk slides - Convert `.rst` files -> `.md` files - For included code snippets, don't just slap in a pre, provide syntax highlighting - Add notes about JDK versions supported - Dust off the Task Developer's Guide and `rm` the "pagerank" example - Add a `sitegen` task, create site with better navigation - For 'goal builddict', generate `.rst` and `.html`, not just `.rst` - Narrow setup 'Operating System' classfiers to known-good `Issue #16 <https://github.com/pantsbuild/pex/issues/16>`_ `Issue #461 <https://github.com/pantsbuild/pants/issues/461>`_ `Issue #739 <https://github.com/pantsbuild/pants/issues/739>`_ `RB #891 <https://rbcommons.com/s/twitter/r/891>`_ `RB #1074 <https://rbcommons.com/s/twitter/r/1074>`_ `RB #1075 <https://rbcommons.com/s/twitter/r/1075>`_ `RB #1079 <https://rbcommons.com/s/twitter/r/1079>`_ `RB #1084 <https://rbcommons.com/s/twitter/r/1084>`_ `RB #1086 <https://rbcommons.com/s/twitter/r/1086>`_ `RB #1088 <https://rbcommons.com/s/twitter/r/1088>`_ `RB #1090 <https://rbcommons.com/s/twitter/r/1090>`_ `RB #1101 <https://rbcommons.com/s/twitter/r/1101>`_ `RB #1126 <https://rbcommons.com/s/twitter/r/1126>`_ `RB #1128 <https://rbcommons.com/s/twitter/r/1128>`_ `RB #1134 <https://rbcommons.com/s/twitter/r/1134>`_ `RB #1136 <https://rbcommons.com/s/twitter/r/1136>`_ `RB #1154 <https://rbcommons.com/s/twitter/r/1154>`_ `RB #1155 <https://rbcommons.com/s/twitter/r/1155>`_ `RB #1164 <https://rbcommons.com/s/twitter/r/1164>`_ `RB #1166 <https://rbcommons.com/s/twitter/r/1166>`_ `RB #1176 <https://rbcommons.com/s/twitter/r/1176>`_ `RB #1178 <https://rbcommons.com/s/twitter/r/1178>`_ `RB #1182 <https://rbcommons.com/s/twitter/r/1182>`_ `RB #1191 <https://rbcommons.com/s/twitter/r/1191>`_ `RB #1196 <https://rbcommons.com/s/twitter/r/1196>`_ `RB #1205 <https://rbcommons.com/s/twitter/r/1205>`_ `RB #1241 <https://rbcommons.com/s/twitter/r/1241>`_ `RB #1263 <https://rbcommons.com/s/twitter/r/1263>`_ `RB #1277 <https://rbcommons.com/s/twitter/r/1277>`_ `RB #1284 <https://rbcommons.com/s/twitter/r/1284>`_ `RB #1292 <https://rbcommons.com/s/twitter/r/1292>`_ `RB #1295 <https://rbcommons.com/s/twitter/r/1295>`_ `RB #1296 <https://rbcommons.com/s/twitter/r/1296>`_ `RB #1298 <https://rbcommons.com/s/twitter/r/1298>`_ `RB #1299 <https://rbcommons.com/s/twitter/r/1299>`_ `RB #1301 <https://rbcommons.com/s/twitter/r/1301>`_ `RB #1314 <https://rbcommons.com/s/twitter/r/1314>`_ `RB #1315 <https://rbcommons.com/s/twitter/r/1315>`_ `RB #1326 <https://rbcommons.com/s/twitter/r/1326>`_ `RB #1348 <https://rbcommons.com/s/twitter/r/1348>`_ `RB #1355 <https://rbcommons.com/s/twitter/r/1355>`_ `RB #1356 <https://rbcommons.com/s/twitter/r/1356>`_ `RB #1358 <https://rbcommons.com/s/twitter/r/1358>`_ `RB #1363 <https://rbcommons.com/s/twitter/r/1363>`_ `RB #1370 <https://rbcommons.com/s/twitter/r/1370>`_ `RB #1377 <https://rbcommons.com/s/twitter/r/1377>`_ `RB #1386 <https://rbcommons.com/s/twitter/r/1386>`_ `RB #1387 <https://rbcommons.com/s/twitter/r/1387>`_ `RB #1401 <https://rbcommons.com/s/twitter/r/1401>`_ `RB #1407 <https://rbcommons.com/s/twitter/r/1407>`_ `RB #1427 <https://rbcommons.com/s/twitter/r/1427>`_ `RB #1430 <https://rbcommons.com/s/twitter/r/1430>`_ `RB #1434 <https://rbcommons.com/s/twitter/r/1434>`_ `RB #1440 <https://rbcommons.com/s/twitter/r/1440>`_ `RB #1446 <https://rbcommons.com/s/twitter/r/1446>`_ `RB #1464 <https://rbcommons.com/s/twitter/r/1464>`_ `RB #1484 <https://rbcommons.com/s/twitter/r/1484>`_ `RB #1491 <https://rbcommons.com/s/twitter/r/1491>`_ * CmdLineProcessor uses `binary class name <http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.2.1>`_ `RB #1489 <https://rbcommons.com/s/twitter/r/1489>`_ * Use subscripting for looking up targets in resources_by_products `RB #1380 <https://rbcommons.com/s/twitter/r/1380>`_ * Fix/refactor checkstyle `RB #1432 <https://rbcommons.com/s/twitter/r/1432>`_ * Fix missing import `RB #1483 <https://rbcommons.com/s/twitter/r/1483>`_ * Make `./pants help` and `./pants help <goal>` work properly `Issue #839 <https://github.com/pantsbuild/pants/issues/839>`_ `RB #1482 <https://rbcommons.com/s/twitter/r/1482>`_ * Cleanup after custom options bootstrapping in reflect `RB #1468 <https://rbcommons.com/s/twitter/r/1468>`_ * Handle UTF-8 in thrift files for python `RB #1459 <https://rbcommons.com/s/twitter/r/1459>`_ * Optimize goal changed `RB #1470 <https://rbcommons.com/s/twitter/r/1470>`_ * Fix a bug where a request for help wasn't detected `RB #1467 <https://rbcommons.com/s/twitter/r/1467>`_ * Always relativize the classpath where possible `RB #1455 <https://rbcommons.com/s/twitter/r/1455>`_ * Gracefully handle another run creating latest link `RB #1396 <https://rbcommons.com/s/twitter/r/1396>`_ * Properly detect existence of a symlink `RB #1437 <https://rbcommons.com/s/twitter/r/1437>`_ * Avoid throwing in `ApacheThriftGen.__init__` `RB #1428 <https://rbcommons.com/s/twitter/r/1428>`_ * Fix error message in scrooge_gen `RB #1426 <https://rbcommons.com/s/twitter/r/1426>`_ * Fixup `BuildGraph` to handle mixes of synthetic and BUILD targets `RB #1420 <https://rbcommons.com/s/twitter/r/1420>`_ * Fix antlr package derivation `RB #1410 <https://rbcommons.com/s/twitter/r/1410>`_ * Exit workers on sigint rather than ignore `RB #1405 <https://rbcommons.com/s/twitter/r/1405>`_ * Fix error in string formatting `RB #1416 <https://rbcommons.com/s/twitter/r/1416>`_ * Add missing class `RB #1414 <https://rbcommons.com/s/twitter/r/1414>`_ * Add missing import for dedent in `resource_mapping.py` `RB #1403 <https://rbcommons.com/s/twitter/r/1403>`_ * Replace twitter commons dirutil Lock with lockfile wrapper `RB #1390 <https://rbcommons.com/s/twitter/r/1390>`_ * Make `interpreter_cache` a property, acquire lock in accessor `Issue #819 <https://github.com/pantsbuild/pants/issues/819>`_ `RB #1392 <https://rbcommons.com/s/twitter/r/1392>`_ * Fix `.proto` files with unicode characters in the comments `RB #1330 <https://rbcommons.com/s/twitter/r/1330>`_ * Make `pants goal run` for Python exit with error code 1 if the python program exits non-zero `RB #1374 <https://rbcommons.com/s/twitter/r/1374>`_ * Fix a bug related to adding sibling resource bases `RB #1367 <https://rbcommons.com/s/twitter/r/1367>`_ * Support for the `--kill-nailguns` option was inadvertently removed, this puts it back `RB #1352 <https://rbcommons.com/s/twitter/r/1352>`_ * fix string formatting so `test -h` does not crash `RB #1353 <https://rbcommons.com/s/twitter/r/1353>`_ * Fix java_sources missing dep detection `RB #1336 <https://rbcommons.com/s/twitter/r/1336>`_ * Fix a nasty bug when injecting target closures in BuildGraph `RB #1337 <https://rbcommons.com/s/twitter/r/1337>`_ * Switch `src/*` usages of `Config.load` to use `Config.from_cache` instead `RB #1319 <https://rbcommons.com/s/twitter/r/1319>`_ * Optimize `what_changed`, remove un-needed extra sort `RB #1291 <https://rbcommons.com/s/twitter/r/1291>`_ * Fix `DetectDuplicate`'s handling of an `append`-type flag `RB #1282 <https://rbcommons.com/s/twitter/r/1282>`_ * Deeper selection of internal targets during publishing `RB #1213 <https://rbcommons.com/s/twitter/r/1213>`_ * Correctly parse named_is_latest entries from the pushdb `RB #1245 <https://rbcommons.com/s/twitter/r/1245>`_ * Fix error message: add missing space `RB #1266 <https://rbcommons.com/s/twitter/r/1266>`_ * WikiArtifact instances also have provides; limit ivy to jvm `RB #1259 <https://rbcommons.com/s/twitter/r/1259>`_ * Fix `[run.junit]` -> `[test.junit]` `RB #1256 <https://rbcommons.com/s/twitter/r/1256>`_ * Fix signature in `goal targets` and BUILD dictionary `RB #1253 <https://rbcommons.com/s/twitter/r/1253>`_ * Fix the regression introduced in https://rbcommons.com/s/twitter/r/1186 `RB #1254 <https://rbcommons.com/s/twitter/r/1254>`_ * Temporarily change `stderr` log level to silence `log.init` if `--quiet` `RB #1243 <https://rbcommons.com/s/twitter/r/1243>`_ * Add the environment's `PYTHONPATH` to `sys.path` when running dev pants `RB #1237 <https://rbcommons.com/s/twitter/r/1237>`_ * Remove `java_sources` as target roots for scala library in `depmap` project info `Issue #670 <https://github.com/pantsbuild/pants/issues/670>`_ `RB #1190 <https://rbcommons.com/s/twitter/r/1190>`_ * Allow UTF-8 characters in changelog `RB #1228 <https://rbcommons.com/s/twitter/r/1228>`_ * Ensure proper semantics when replacing all tasks in a goal `RB #1220 <https://rbcommons.com/s/twitter/r/1220>`_ `RB #1221 <https://rbcommons.com/s/twitter/r/1221>`_ * Fix reading of `scalac` plugin info from config `RB #1217 <https://rbcommons.com/s/twitter/r/1217>`_ * Dogfood bintray for pants support binaries `RB #1208 <https://rbcommons.com/s/twitter/r/1208>`_ * Do not crash on unicode filenames `RB #1193 <https://rbcommons.com/s/twitter/r/1193>`_ `RB #1209 <https://rbcommons.com/s/twitter/r/1209>`_ * In the event of an exception in `jvmdoc_gen`, call `get()` on the remaining futures `RB #1202 <https://rbcommons.com/s/twitter/r/1202>`_ * Move `workdirs` creation from `__init__` to `pre_execute` in jvm_compile & Remove `QuietTaskMixin` from several tasks `RB #1173 <https://rbcommons.com/s/twitter/r/1173>`_ * Switch from `os.rename` to `shutil.move` to support cross-fs renames when needed `RB #1157 <https://rbcommons.com/s/twitter/r/1157>`_ * Fix scalastyle task, wire it up, make configs optional `RB #1145 <https://rbcommons.com/s/twitter/r/1145>`_ * Fix issue 668: make `release.sh` execute packaged pants without loading internal backends during testing `Issue #668 <https://github.com/pantsbuild/pants/issues/668>`_ `RB #1158 <https://rbcommons.com/s/twitter/r/1158>`_ * Add `payload.get_field_value()` to fix KeyError from `pants goal idea testprojects::` `RB #1150 <https://rbcommons.com/s/twitter/r/1150>`_ * Remove `debug_args` from `pants.ini` `Issue #650 <https://github.com/pantsbuild/pants/issues/650>`_ `RB #1137 <https://rbcommons.com/s/twitter/r/1137>`_ * When a jvm doc tool (e.g. scaladoc) fails in combined mode, throw an exception `RB #1116 <https://rbcommons.com/s/twitter/r/1116>`_ * Remove hack to add java_sources in context `RB #1130 <https://rbcommons.com/s/twitter/r/1130>`_ * Memoize `Address.__hash__` computation `RB #1118 <https://rbcommons.com/s/twitter/r/1118>`_ * Add missing coverage deps `RB #1117 <https://rbcommons.com/s/twitter/r/1117>`_ * get `goal targets` using similar codepath to `goal builddict` `RB #1112 <https://rbcommons.com/s/twitter/r/1112>`_ * Memoize fingerprints by the FPStrategy hash `RB #1119 <https://rbcommons.com/s/twitter/r/1119>`_ * Factor in the jvm version string into the nailgun executor fingerprint `RB #1122 <https://rbcommons.com/s/twitter/r/1122>`_ * Fix some error reporting issues `RB #1113 <https://rbcommons.com/s/twitter/r/1113>`_ * Retry on failed scm push; also, pull with rebase to increase the odds of success `RB #1083 <https://rbcommons.com/s/twitter/r/1083>`_ * Make sure that 'option java_package' always overrides 'package' in protobuf_gen `RB #1108 <https://rbcommons.com/s/twitter/r/1108>`_ * Fix order-dependent force handling: if a version is forced in one place, it is forced everywhere `RB #1085 <https://rbcommons.com/s/twitter/r/1085>`_ * Survive targets without derivations `RB #1066 <https://rbcommons.com/s/twitter/r/1066>`_ * Make `internal_backend` plugins 1st class local pants plugins `RB #1073 <https://rbcommons.com/s/twitter/r/1073>`_ 0.0.24 (9/23/2014) ------------------ API Changes ~~~~~~~~~~~ * Add a whitelist to jvm dependency analyzer `RB #888 <https://rbcommons.com/s/twitter/r/888>`_ * Refactor exceptions in build_file.py and build_file_parser.py to derive from a common baseclass and eliminate throwing `IOError`. `RB #954 <https://rbcommons.com/s/twitter/r/954>`_ * Support absolute paths on the command line when they start with the build root `RB #867 <https://rbcommons.com/s/twitter/r/867>`_ * Make `::` fail for an invalid dir much like `:` does for a dir with no BUILD file `Issue #484 <https://github.com/pantsbuild/pants/issues/484>`_ `RB #907 <https://rbcommons.com/s/twitter/r/907>`_ * Deprecate `pants` & `dependencies` aliases and remove `config`, `goal`, `phase`, `get_scm` & `set_scm` aliases `RB #899 <https://rbcommons.com/s/twitter/r/899>`_ `RB #903 <https://rbcommons.com/s/twitter/r/903>`_ `RB #912 <https://rbcommons.com/s/twitter/r/912>`_ * Export test infrastructure for plugin writers to use in `pantsbuild.pants.testinfra` sdist `Issue #539 <https://github.com/pantsbuild/pants/issues/539>`_ `RB #997 <https://rbcommons.com/s/twitter/r/997>`_ `RB #1004 <https://rbcommons.com/s/twitter/r/1004>`_ * Publishing improvements: - Add support for doing remote publishes with an explicit snapshot name - One publish/push db file per artifact `RB #923 <https://rbcommons.com/s/twitter/r/923>`_ `RB #994 <https://rbcommons.com/s/twitter/r/994>`_ * Several improvements to `IdeGen` derived goals: - Adds the `--<goal>-use-source-root` for IDE project generation tasks - Added `--idea-exclude-maven-target` to keep IntelliJ from indexing 'target' directories - Changes the behavior of goal idea to create a subdirectory named for the project name - Added `exclude-folders` option in pants.ini, defaulted to excluding a few dirs in `.pants.d` `Issue #564 <https://github.com/pantsbuild/pants/issues/564>`_ `RB #1006 <https://rbcommons.com/s/twitter/r/1006>`_ `RB #1017 <https://rbcommons.com/s/twitter/r/1017>`_ `RB #1019 <https://rbcommons.com/s/twitter/r/1019>`_ `RB #1023 <https://rbcommons.com/s/twitter/r/1023>`_ * Enhancements to the `depmap` goal to support IDE plugins: - Add flag to dump project info output to file - Add missing resources to targets - Add content type to project Info `Issue #5 <https://github.com/pantsbuild/intellij-pants-plugin/issues/5>`_ `RB #964 <https://rbcommons.com/s/twitter/r/964>`_ `RB #987 <https://rbcommons.com/s/twitter/r/987>`_ `RB #998 <https://rbcommons.com/s/twitter/r/998>`_ * Make `SourceRoot` fundamentally understand a rel_path `RB #1036 <https://rbcommons.com/s/twitter/r/1036>`_ * Added thrift-linter to pants `RB #1044 <https://rbcommons.com/s/twitter/r/1044>`_ * Support limiting coverage measurements globally by module or path `Issue #328 <https://github.com/pantsbuild/pants/issues/328>`_ `Issue #369 <https://github.com/pantsbuild/pants/issues/369>`_ `RB #1034 <https://rbcommons.com/s/twitter/r/1034>`_ * Update interpreter_cache.py to support a repo-wide interpreter requirement `RB #1025 <https://rbcommons.com/s/twitter/r/1025>`_ * Changed goal markdown: - Writes output to `./dist/markdown/` - Pages can include snippets from source files `<http://pantsbuild.github.io/page.html#include-a-file-snippet>`_ `Issue #535 <https://github.com/pantsbuild/pants/issues/535>`_ `RB #949 <https://rbcommons.com/s/twitter/r/949>`_ `RB #961 <https://rbcommons.com/s/twitter/r/961>`_ * Rename `Phase` -> `Goal` `RB #856 <https://rbcommons.com/s/twitter/r/856>`_ `RB #879 <https://rbcommons.com/s/twitter/r/879>`_ `RB #880 <https://rbcommons.com/s/twitter/r/880>`_ `RB #887 <https://rbcommons.com/s/twitter/r/887>`_ `RB #890 <https://rbcommons.com/s/twitter/r/890>`_ `RB #910 <https://rbcommons.com/s/twitter/r/910>`_ `RB #913 <https://rbcommons.com/s/twitter/r/913>`_ `RB #915 <https://rbcommons.com/s/twitter/r/915>`_ `RB #931 <https://rbcommons.com/s/twitter/r/931>`_ * Android support additions: - Add `AaptBuild` task - Add `JarsignerTask` and `Keystore` target `RB #859 <https://rbcommons.com/s/twitter/r/859>`_ `RB #883 <https://rbcommons.com/s/twitter/r/883>`_ * Git/Scm enhancements: - Allow the buildroot to be a subdirectory of the git worktree - Support getting the commit date of refs - Add merge-base and origin url properties to git `Issue #405 <https://github.com/pantsbuild/pants/issues/405>`_ `RB #834 <https://rbcommons.com/s/twitter/r/834>`_ `RB #871 <https://rbcommons.com/s/twitter/r/871>`_ `RB #884 <https://rbcommons.com/s/twitter/r/884>`_ `RB #886 <https://rbcommons.com/s/twitter/r/886>`_ Bugfixes ~~~~~~~~ * Numerous doc improvements & generation fixes `Issue #397 <https://github.com/pantsbuild/pants/issues/397>`_ `Issue #451 <https://github.com/pantsbuild/pants/issues/451>`_ `Issue #475 <https://github.com/pantsbuild/pants/issues/475>`_ `RB #863 <https://rbcommons.com/s/twitter/r/863>`_ `RB #865 <https://rbcommons.com/s/twitter/r/865>`_ `RB #873 <https://rbcommons.com/s/twitter/r/873>`_ `RB #876 <https://rbcommons.com/s/twitter/r/876>`_ `RB #885 <https://rbcommons.com/s/twitter/r/885>`_ `RB #938 <https://rbcommons.com/s/twitter/r/938>`_ `RB #953 <https://rbcommons.com/s/twitter/r/953>`_ `RB #960 <https://rbcommons.com/s/twitter/r/960>`_ `RB #965 <https://rbcommons.com/s/twitter/r/965>`_ `RB #992 <https://rbcommons.com/s/twitter/r/992>`_ `RB #995 <https://rbcommons.com/s/twitter/r/995>`_ `RB #1007 <https://rbcommons.com/s/twitter/r/1007>`_ `RB #1008 <https://rbcommons.com/s/twitter/r/1008>`_ `RB #1018 <https://rbcommons.com/s/twitter/r/1018>`_ `RB #1020 <https://rbcommons.com/s/twitter/r/1020>`_ `RB #1048 <https://rbcommons.com/s/twitter/r/1048>`_ * Fixup missing 'page.mustache' resource for `markdown` goal `Issue #498 <https://github.com/pantsbuild/pants/issues/498>`_ `RB #918 <https://rbcommons.com/s/twitter/r/918>`_ * Publishing fixes: - Fix credentials fetching during publishing - Skipping a doc phase should result in transitive deps being skipped as well `RB #901 <https://rbcommons.com/s/twitter/r/901>`_ `RB #1011 <https://rbcommons.com/s/twitter/r/1011>`_ * Several `IdeGen` derived task fixes: - Fix eclipse_gen & idea_gen for targets with both java and scala - Fixup EclipseGen resources globs to include prefs. - When a directory contains both `java_library` and `junit_tests` targets, make sure the IDE understands this is a test path, not a lib path `RB #857 <https://rbcommons.com/s/twitter/r/857>`_ `RB #916 <https://rbcommons.com/s/twitter/r/916>`_ `RB #996 <https://rbcommons.com/s/twitter/r/996>`_ * Fixes to the `depmap` goal to support IDE plugins: - Fixed source roots in project info in case of `ScalaLibrary` with `java_sources` - Fix `--depmap-project-info` for scala sources with the same package_prefix - Fix depmap KeyError `RB #955 <https://rbcommons.com/s/twitter/r/955>`_ `RB #990 <https://rbcommons.com/s/twitter/r/990>`_ `RB #1015 <https://rbcommons.com/s/twitter/r/1015>`_ * Make a better error message when os.symlink fails during bundle `RB #1037 <https://rbcommons.com/s/twitter/r/1037>`_ * Faster source root operations - update the internal data structure to include a tree `RB #1003 <https://rbcommons.com/s/twitter/r/1003>`_ * The goal filter's --filter-ancestor parameter works better now `Issue #506 <https://github.com/pantsbuild/pants/issues/506>`_ `RB #925 <https://rbcommons.com/s/twitter/r/925/>`_ * Fix: goal markdown failed to load page.mustache `Issue #498 <https://github.com/pantsbuild/pants/issues/498>`_ `RB #918 <https://rbcommons.com/s/twitter/r/918>`_ * Fix the `changed` goal so it can be run in a repo with a directory called 'build' `RB #872 <https://rbcommons.com/s/twitter/r/872>`_ * Patch `JvmRun` to accept `JvmApp`s `RB #893 <https://rbcommons.com/s/twitter/r/893>`_ * Add python as default codegen product `RB #894 <https://rbcommons.com/s/twitter/r/894>`_ * Fix the `filedeps` goal - it was using a now-gone .expand_files() API `Issue #437 <https://github.com/pantsbuild/pants/issues/437>`_, `RB #939 <https://rbcommons.com/s/twitter/r/939>`_ * Put back error message that shows path to missing BUILD files `RB #929 <https://rbcommons.com/s/twitter/r/929>`_ * Make sure the `junit_run` task only runs on targets that are junit compatible `Issue #508 <https://github.com/pantsbuild/pants/issues/508>`_ `RB #924 <https://rbcommons.com/s/twitter/r/924>`_ * Fix `./pants goal targets` `Issue #333 <https://github.com/pantsbuild/pants/issues/333>`_ `RB #796 <https://rbcommons.com/s/twitter/r/796>`_ `RB #914 <https://rbcommons.com/s/twitter/r/914>`_ * Add `derived_from` to `ScroogeGen` synthetic targets `RB #926 <https://rbcommons.com/s/twitter/r/926>`_ * Properly order resources for pants goal test and pants goal run `RB #845 <https://rbcommons.com/s/twitter/r/845>`_ * Fixup Dependencies to be mainly target-type agnostic `Issue #499 <https://github.com/pantsbuild/pants/issues/499>`_ `RB #920 <https://rbcommons.com/s/twitter/r/920>`_ * Fixup JvmRun only-write-cmd-line flag to accept relative paths `Issue #494 <https://github.com/pantsbuild/pants/issues/494>`_ `RB #908 <https://rbcommons.com/s/twitter/r/908>`_ `RB #911 <https://rbcommons.com/s/twitter/r/911>`_ * Fix the `--ivy-report` option and add integration test `RB #976 <https://rbcommons.com/s/twitter/r/976>`_ * Fix a regression in Emma/Cobertura and add tests `Issue #508 <https://github.com/pantsbuild/pants/issues/508>`_ `RB #935 <https://rbcommons.com/s/twitter/r/935>`_ 0.0.23 (8/11/2014) ------------------ API Changes ~~~~~~~~~~~ * Remove unused Task.invalidate_for method and unused extra_data variable `RB #849 <https://rbcommons.com/s/twitter/r/849>`_ * Add DxCompile task to android backend `RB #840 <https://rbcommons.com/s/twitter/r/840>`_ * Change all Task subclass constructor args to (\*args, \**kwargs) `RB #846 <https://rbcommons.com/s/twitter/r/846>`_ * The public API for the new options system `Issue #425 <https://github.com/pantsbuild/pants/pull/425>`_ `RB #831 <https://rbcommons.com/s/twitter/r/831>`_ `RB #819 <https://rbcommons.com/s/twitter/r/819>`_ * Rename pants.goal.goal.Goal to pants.goal.task_registrar.TaskRegistrar `Issue #345 <https://github.com/pantsbuild/pants/pull/345>`_ `RB #843 <https://rbcommons.com/s/twitter/r/843>`_ Bugfixes ~~~~~~~~ * Better validation for AndroidTarget manifest field `RB #860 <https://rbcommons.com/s/twitter/r/860>`_ * Remove more references to /BUILD:target notation in docs `RB #855 <https://rbcommons.com/s/twitter/r/855>`_ `RB #853 <https://rbcommons.com/s/twitter/r/853>`_ * Fix up the error message when attempting to publish without any configured repos `RB #850 <https://rbcommons.com/s/twitter/r/850>`_ * Miscellaneous fixes to protobuf codegen including handling collisions deterministically `RB #720 <https://rbcommons.com/s/twitter/r/720>`_ * Migrate some reasonable default values from pants.ini into 'defaults' in the pants source `Issue #455 <https://github.com/pantsbuild/pants/pull/455>`_ `Issue #456 <https://github.com/pantsbuild/pants/pull/456>`_ `Issue #458 <https://github.com/pantsbuild/pants/pull/458>`_ `RB #852 <https://rbcommons.com/s/twitter/r/852>`_ * Updated the basename and name of some targets to prevent colliding bundles in dist/ `RB #847 <https://rbcommons.com/s/twitter/r/847>`_ * Provide a better error message when referencing the wrong path to a BUILD file `RB #841 <https://rbcommons.com/s/twitter/r/841>`_ * Add assert_list to ensure an argument is a list - use this to better validate many targets `RB #811 <https://rbcommons.com/s/twitter/r/811>`_ * Update front-facing help and error messages for Android targets/tasks `RB #837 <https://rbcommons.com/s/twitter/r/837>`_ * Use JvmFingerprintStrategy in cache manager `RB #835 <https://rbcommons.com/s/twitter/r/835>`_ 0.0.22 (8/4/2014) ----------------- API Changes ~~~~~~~~~~~ * Upgrade pex dependency from twitter.common.python 0.6.0 to pex 0.7.0 `RB #825 <https://rbcommons.com/s/twitter/r/825>`_ * Added a --spec-exclude command line flag to exclude specs by regular expression `RB #747 <https://rbcommons.com/s/twitter/r/747>`_ * Upgrade requests, flip to a ranged requirement to help plugins `RB #771 <https://rbcommons.com/s/twitter/r/771>`_ * New goal ``ensime`` to generate Ensime projects for Emacs users `RB #753 <https://rbcommons.com/s/twitter/r/753>`_ Bugfixes ~~~~~~~~ * `goal repl` consumes targets transitively `RB #781 <https://rbcommons.com/s/twitter/r/781>`_ * Fixup JvmCompile to always deliver non-None products that were required by downstream `RB #794 <https://rbcommons.com/s/twitter/r/794>`_ * Relativize classpath for non-ng java execution `RB #804 <https://rbcommons.com/s/twitter/r/804>`_ * Added some docs and a bugfix on debugging a JVM tool (like jar-tool or checkstyle) locally `RB #791 <https://rbcommons.com/s/twitter/r/791>`_ * Added an excludes attribute that is set to an empty set for all SourcePayload subclasses `Issue #414 <https://github.com/pantsbuild/pants/pull/414>`_ `RB #793 <https://rbcommons.com/s/twitter/r/793>`_ * Add binary fetching support for OSX 10.10 and populate thrift and protoc binaries `RB #789 <https://rbcommons.com/s/twitter/r/789>`_ * Fix the pants script exit status when bootstrapping fails `RB #779 <https://rbcommons.com/s/twitter/r/779>`_ * Added benchmark target to maven_layout() `RB #780 <https://rbcommons.com/s/twitter/r/780>`_ * Fixup a hole in external dependency listing wrt encoding `RB #776 <https://rbcommons.com/s/twitter/r/776>`_ * Force parsing for filtering specs `RB #775 <https://rbcommons.com/s/twitter/r/775>`_ * Fix a scope bug for java agent manifest writing `RB #768 <https://rbcommons.com/s/twitter/r/768>`_ `RB #770 <https://rbcommons.com/s/twitter/r/770>`_ * Plumb ivysettings.xml location to the publish template `RB #764 <https://rbcommons.com/s/twitter/r/764>`_ * Fix goal markdown: README.html pages clobbered each other `RB #750 <https://rbcommons.com/s/twitter/r/750>`_ 0.0.21 (7/25/2014) ------------------ Bugfixes ~~~~~~~~ * Fixup NailgunTasks with missing config_section overrides `RB # 762 <https://rbcommons.com/s/twitter/r/762>`_ 0.0.20 (7/25/2014) ------------------ API Changes ~~~~~~~~~~~ * Hide stack traces by default `Issue #326 <https://github.com/pantsbuild/pants/issues/326>`_ `RB #655 <https://rbcommons.com/s/twitter/r/655>`_ * Upgrade to ``twitter.common.python`` 0.6.0 and adjust to api change `RB #746 <https://rbcommons.com/s/twitter/r/746>`_ * Add support for `Cobertura <http://cobertura.github.io/cobertura>`_ coverage `Issue #70 <https://github.com/pantsbuild/pants/issues/70>`_ `RB #637 <https://rbcommons.com/s/twitter/r/637>`_ * Validate that ``junit_tests`` targets have non-empty sources `RB #619 <https://rbcommons.com/s/twitter/r/619>`_ * Add support for the `Ragel <http://www.complang.org/ragel>`_ state-machine generator `Issue #353 <https://github.com/pantsbuild/pants/issues/353>`_ `RB #678 <https://rbcommons.com/s/twitter/r/678>`_ * Add ``AndroidTask`` and ``AaptGen`` tasks `RB #672 <https://rbcommons.com/s/twitter/r/672>`_ `RB #676 <https://rbcommons.com/s/twitter/r/676>`_ `RB #700 <https://rbcommons.com/s/twitter/r/700>`_ Bugfixes ~~~~~~~~ * Numerous doc fixes `Issue #385 <https://github.com/pantsbuild/pants/issues/385>`_ `Issue #387 <https://github.com/pantsbuild/pants/issues/387>`_ `Issue #395 <https://github.com/pantsbuild/pants/issues/395>`_ `RB #728 <https://rbcommons.com/s/twitter/r/728>`_ `RB #729 <https://rbcommons.com/s/twitter/r/729>`_ `RB #730 <https://rbcommons.com/s/twitter/r/730>`_ `RB #738 <https://rbcommons.com/s/twitter/r/738>`_ * Expose types needed to specify ``jvm_binary.deploy_jar_rules`` `Issue #383 <https://github.com/pantsbuild/pants/issues/383>`_ `RB #727 <https://rbcommons.com/s/twitter/r/727>`_ * Require information about jars in ``depmap`` with ``--depmap-project-info`` `RB #721 <https://rbcommons.com/s/twitter/r/721>`_ 0.0.19 (7/23/2014) ------------------ API Changes ~~~~~~~~~~~ * Enable Nailgun Per Task `RB #687 <https://rbcommons.com/s/twitter/r/687>`_ Bugfixes ~~~~~~~~ * Numerous doc fixes `RB #699 <https://rbcommons.com/s/twitter/r/699>`_ `RB #703 <https://rbcommons.com/s/twitter/r/703>`_ `RB #704 <https://rbcommons.com/s/twitter/r/704>`_ * Fixup broken ``bundle`` alias `Issue #375 <https://github.com/pantsbuild/pants/issues/375>`_ `RB #722 <https://rbcommons.com/s/twitter/r/722>`_ * Remove dependencies on ``twitter.common.{dirutil,contextutils}`` `RB #710 <https://rbcommons.com/s/twitter/r/710>`_ `RB #713 <https://rbcommons.com/s/twitter/r/713>`_ `RB #717 <https://rbcommons.com/s/twitter/r/717>`_ `RB #718 <https://rbcommons.com/s/twitter/r/718>`_ `RB #719 <https://rbcommons.com/s/twitter/r/719>`_ `RB #726 <https://rbcommons.com/s/twitter/r/726>`_ * Fixup missing ``JunitRun`` resources requirement `RB #709 <https://rbcommons.com/s/twitter/r/709>`_ * Fix transitive dependencies for ``GroupIterator``/``GroupTask`` `RB #706 <https://rbcommons.com/s/twitter/r/706>`_ * Ensure resources are prepared after compile `Issue #373 <http://github.com/pantsbuild/pants/issues/373>`_ `RB #708 <https://rbcommons.com/s/twitter/r/708>`_ * Upgrade to ``twitter.common.python`` 0.5.10 to brings in the following bugfix:: Update the mtime on retranslation of existing distributions. 1bff97e stopped existing distributions from being overwritten, to prevent subtle errors. However without updating the mtime these distributions will appear to be permanently expired wrt the ttl. `RB #707 <https://rbcommons.com/s/twitter/r/707>`_ * Resurrected pants goal idea with work remaining on source and javadoc jar mapping `RB #695 <https://rbcommons.com/s/twitter/r/695>`_ * Fix BinaryUtil raise of BinaryNotFound `Issue #367 <https://github.com/pantsbuild/pants/issues/367>`_ `RB #705 <https://rbcommons.com/s/twitter/r/705>`_ 0.0.18 (7/16/2014) ------------------ API Changes ~~~~~~~~~~~ * Lock globs into ``rootdir`` and below `Issue #348 <https://github.com/pantsbuild/pants/issues/348>`_ `RB #686 <https://rbcommons.com/s/twitter/r/686>`_ Bugfixes ~~~~~~~~ * Several doc fixes `RB #654 <https://rbcommons.com/s/twitter/r/654>`_ `RB #693 <https://rbcommons.com/s/twitter/r/693>`_ * Fix relativity of antlr sources `RB #679 <https://rbcommons.com/s/twitter/r/679>`_ 0.0.17 (7/15/2014) ------------------ * Initial published version of ``pantsbuild.pants``
{ "content_hash": "711e363b4023d9fba702224fe2c28663", "timestamp": "", "source": "github", "line_count": 3576, "max_line_length": 136, "avg_line_length": 36.85682326621924, "alnum_prop": 0.6957738998482549, "repo_name": "sid-kap/pants", "id": "ef13b99a4f6ac22819a81b17492e0708449abac8", "size": "131800", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/python/pants/CHANGELOG.rst", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C++", "bytes": "767" }, { "name": "CSS", "bytes": "11139" }, { "name": "GAP", "bytes": "2459" }, { "name": "Go", "bytes": "1437" }, { "name": "HTML", "bytes": "68162" }, { "name": "Java", "bytes": "291340" }, { "name": "JavaScript", "bytes": "10157" }, { "name": "Protocol Buffer", "bytes": "3783" }, { "name": "Python", "bytes": "3384283" }, { "name": "Scala", "bytes": "76015" }, { "name": "Shell", "bytes": "48118" }, { "name": "Thrift", "bytes": "2583" } ], "symlink_target": "" }
<?php /** Zend_Pdf_Action */ // require_once 'Zend/Pdf/Action.php'; /** * PDF 'Launch an application, usually to open a file' action * * @package Zend_Pdf * @subpackage Actions * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Pdf_Action_Launch extends Zend_Pdf_Action { }
{ "content_hash": "29cdd0bea422d616e476d646262f940b", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 87, "avg_line_length": 21.842105263157894, "alnum_prop": 0.6746987951807228, "repo_name": "Chatventure/zf1", "id": "4a39521c901456c439cbe1bf962d025298c2ce01", "size": "1173", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "library/Zend/Pdf/Action/Launch.php", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "PHP", "bytes": "15045100" }, { "name": "Shell", "bytes": "1409" } ], "symlink_target": "" }
package org.mestor.entities.index_test; import javax.persistence.Entity; import org.eclipse.persistence.annotations.Index; @Entity public class ThreeGoodFieldLevelIndexes extends EntityBase { @Index(name = "field_index1") private String column1; @Index(name = "field_index2") private String column2; @Index(name = "field_index3") private String column3; @Index(name = "field_index3") private String column4; }
{ "content_hash": "ec63423b9814c81c81c5d103c484de1e", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 60, "avg_line_length": 19.363636363636363, "alnum_prop": 0.7605633802816901, "repo_name": "alexradzin/Mestor", "id": "f7bd88c17983899210b77cb40a8dfcc8025fcda5", "size": "426", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "integration/src/test/java/org/mestor/entities/index_test/ThreeGoodFieldLevelIndexes.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "1240610" } ], "symlink_target": "" }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html lang="en-US" xml:lang="en-US" xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/sub_dr_template.dwt" codeOutsideHTMLIsLocked="false" --> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <link href="../../stylesheets/sub_css.css" rel="stylesheet" type="text/css" /> <!-- InstanceBeginEditable name="DCMetaTags" --> <meta name="DC.Title" content="Texas Department of Criminal Justice" /> <meta name="DC.Creator" content="Texas Department of Criminal Justice" /> <meta name="DC.Date" content="20000302" /> <meta name="DC.Format.MIME" content="text/html" /> <meta name="DC.Format.SysReq" content="Internet browser" /> <meta name="DC.Identifier" content="http://www.tdcj.texas.gov/" /> <meta name="DC.Subject" content="criminal justice, administration of; Texas Department of Criminal Justice; correctional institutions; criminals; offenders; inmates; convict; criminal statistics" /> <meta name="DC.Subject.Keyword" content="Texas state agencies; correctional facilities; parole; criminals; criminal rehabilitation; Texas Commission on Jail Standards; Texas Correctional Industries; TCI; TDCJ; victims of crimes; probation, inmate, prison, convict; jail, death row, texas death row" /> <meta name="DC.Description" content="Home page for the Texas Department of Criminal Justice" /> <meta name="DC.Publisher" content="Texas Deptartment of Criminal Justice" /> <meta name="DC.Language" content="en-US, es-MX" /> <meta name="DC.Relation" content="http://www.tdcj.texas.gov" /> <meta name="DC.Coverage" content="World" /> <meta name="DC.Type" content="web pages; reference resources" /> <meta name="Author" content="Texas Department of Criminal Justice" /> <!-- InstanceEndEditable --> <!-- InstanceBeginEditable name="doctitle" --> <title>Death Row Information</title> <!-- InstanceEndEditable --> <!-- InstanceBeginEditable name="meta_description" --> <meta name="Description" content="Home page for the Texas Department of Criminal Justice." /> <meta name="DC.Title" content="Texas Department of Criminal Justice" /> <meta name="DC.Creator" content="Criminal Justice, Department of." /> <meta name="DC.Date" content="20000302" /> <meta name="DC.Format.MIME" content="text/html" /> <meta name="DC.Format.SysReq" content="Internet browser" /> <meta name="DC.Identifier" content="http://www.tdcj.texas.gov/" /> <meta name="DC.Subject" content="Criminal Justice, Administration of" /> <meta name="DC.Subject" content="Correctional Institutions" /> <meta name="DC.Subject" content="Criminals" /> <meta name="DC.Subject" content="Criminal Statistics" /> <meta name="DC.Subject.Keyword" content="Texas state agencies" /> <meta name="DC.Subject.Keyword" content="Correctional facilities" /> <meta name="DC.Subject.Keyword" content="Paroles." /> <meta name="DC.Subject.Keyword" content="Criminals and criminal rehabilitation" /> <meta name="DC.Subject.Keyword" content="Texas Commission on Jail Standards." /> <meta name="DC.Subject.Keyword" content="Texas Correctional Industries." /> <meta name="DC.Subject.Keyword" content="Victims of crimes" /> <meta name="DC.Subject.Keyword" content="Probation" /> <meta name="DC.Description" content="home page for the Texas Department of Criminal Justice" /> <meta name="DC.Publisher" content="Texas. Dept. of Criminal Justice." /> <meta name="DC.Language" content="english" /> <meta name="DC.Language" content="spanish" /> <meta name="DC.Relation" content="http://www.tdcj.texas.gov" /> <meta name="DC.Coverage" content="Texas" /> <meta name="DC.Type" content="homepages" /> <meta name="DC.Type" content="Reference resources" /> <meta name="Author" content="State of Texas, Texas Department of Criminal Justice" /> <!-- InstanceEndEditable --> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-23254198-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> </head> <body> <div id="skip"> <a href="#main_content">Skip to Main Content</a> </div> <div id="wrapper"> <div id="p_links"> <div id="p_links_inner"> <a href="../../info_employees.html">Employee Resources</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="http://itd.tdcj.texas.gov/TDCJ_Intranet/">TDCJ Intranet</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="../../directory/index.html">Contact Us</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="../../espanol/index.html" lang="es-MX" xml:lang="es-MX">Informaci&oacute;n en Espa&ntilde;ol</a> <!-- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="../rss/main_feed.rss" title="RSS Feed"><img src="../images/rss16px.png" width="16" height="16" alt="RSS Feed" /></a>&nbsp;&nbsp;&nbsp;&nbsp; <a href="#" title="Twitter"><img src="../images/twitter16px.png" width="16" height="16" alt="Follow us on Twitter" /></a>&nbsp;&nbsp;&nbsp;&nbsp; <a href="#" title="FaceBook"><img src="../images/facebook16px.png" width="16" height="16" alt="Facebook" /></a></div> --> </div> <div id="banner"></div> <p id="h_p_or_nocss">Texas Department of Criminal Justice</p> <div id="roll_outer"> <div id="nav"> <ul id="nav_list"> <li><a href="../../index.html" id="TDCJ_home" accesskey="0">Home</a></li> <li><a href="../../tab1_public.html" id="TDCJ_pr" accesskey="1">Public Resources</a></li> <li><a href="../../tab2_emp.html" id="TDCJ_em" accesskey="2">Employment</a></li> <li><a href="../../tab3_about.html" id="TDCJ_about" accesskey="3">About TDCJ</a></li> <li><a href="../../tab4_online.html" id="TDCJ_os" accesskey="4">Online Services</a></li> <li><a href="../../search.html" id="TDCJ_s" accesskey="5">Search</a></li> </ul> </div> </div> <div id="body"> <a name="main_content" id="main_content"></a> <!-- InstanceBeginEditable name="main_content" --> <div class="return_to_div"></div> <h1>Offender Information</h1> <table border="0" cellpadding="0" cellspacing="0" class="tabledata_deathrow_table"> <tr> <td rowspan="7" valign="top"><img src="garciajuan2.jpg" alt="Picture of Offender" class="photo_border_black_right" /></td> <td width="50%" valign="top" class="tabledata_bold_align_right_deathrow">Name</td> <td width="50%" valign="top" class="tabledata_align_left_deathrow">Garcia, Juan Martin </td> </tr> <tr> <td width="50%" valign="top" class="tabledata_bold_align_right_deathrow">TDCJ Number</td> <td width="50%" valign="top" class="tabledata_align_left_deathrow">999360 </td> </tr> <tr> <td width="50%" valign="top" class="tabledata_bold_align_right_deathrow">Date of Birth</td> <td width="50%" valign="top" class="tabledata_align_left_deathrow">2/18/1980 </td> </tr> <tr> <td width="50%" valign="top" class="tabledata_bold_align_right_deathrow">Date Received</td> <td width="50%" valign="top" class="tabledata_align_left_deathrow">6/21/2000</td> </tr> <tr> <td width="50%" valign="top" class="tabledata_bold_align_right_deathrow">Age (when Received)</td> <td width="50%" valign="top" class="tabledata_align_left_deathrow">20 </td> </tr> <tr> <td width="50%" valign="top" class="tabledata_bold_align_right_deathrow">Education Level (Highest Grade Completed)</td> <td width="50%" valign="top" class="tabledata_align_left_deathrow">8 </td> </tr> <tr> <td width="50%" valign="top" class="tabledata_bold_align_right_deathrow">Date of Offense</td> <td width="50%" valign="top" class="tabledata_align_left_deathrow">9/17/1998</td> </tr> <tr> <td align="left" valign="top">&nbsp;</td> <td width="50%" valign="top" class="tabledata_bold_align_right_deathrow">Age (at the time of Offense)</td> <td width="50%" valign="top" class="tabledata_align_left_deathrow">18 </td> </tr> <tr> <td align="left" valign="top">&nbsp;</td> <td width="50%" valign="top" class="tabledata_bold_align_right_deathrow">County</td> <td width="50%" valign="top" class="tabledata_align_left_deathrow">Harris </td> </tr> <tr> <td align="left" valign="top">&nbsp;</td> <td width="50%" valign="top" class="tabledata_bold_align_right_deathrow">Race</td> <td width="50%" valign="top" class="tabledata_align_left_deathrow">Hispanic </td> </tr> <tr> <td width="20%">&nbsp;</td> <td width="50%" valign="top" class="tabledata_bold_align_right_deathrow">Gender</td> <td width="50%" valign="top" class="tabledata_align_left_deathrow">Male </td> </tr> <tr> <td width="20%">&nbsp;</td> <td width="50%" valign="top" class="tabledata_bold_align_right_deathrow">Hair Color</td> <td width="50%" valign="top" class="tabledata_align_left_deathrow">Black </td> </tr> <tr> <td width="20%">&nbsp;</td> <td width="50%" valign="top" class="tabledata_bold_align_right_deathrow">Height</td> <td width="50%" valign="top" class="tabledata_align_left_deathrow">5 ft 5 in </td> </tr> <tr> <td width="20%">&nbsp;</td> <td width="50%" valign="top" class="tabledata_bold_align_right_deathrow">Weight</td> <td width="50%" valign="top" class="tabledata_align_left_deathrow">183 </td> </tr> <tr> <td width="20%">&nbsp;</td> <td width="50%" valign="top" class="tabledata_bold_align_right_deathrow">Eye Color</td> <td width="50%" valign="top" class="tabledata_align_left_deathrow">Brown </td> </tr> <tr> <td width="20%">&nbsp;</td> <td width="50%" valign="top" class="tabledata_bold_align_right_deathrow">Native County</td> <td width="50%" valign="top" class="tabledata_align_left_deathrow">Harris </td> </tr> <tr> <td width="20%">&nbsp;</td> <td width="50%" valign="top" class="tabledata_bold_align_right_deathrow">Native State</td> <td width="50%" valign="top" class="tabledata_align_left_deathrow">Texas </td> </tr> </table> <hr /> <p><span class="text_bold">Prior Occupation</span><br /> construction, landscaping, laborer </p> <p><span class="text_bold">Prior Prison Record</span><br /> None </p> <p><span class="text_bold">Summary of Incident</span><br /> 9/17/1998 during the night in Houston, Garcia and three co-defendants approached a hispanic male who was walking to his vehicle in the parking lot of an apartment complex. Garcia demanded the victim's money and then shot him in the head with a .25 caliber pistol, killing him. Garcia took $8 in cash from the victim. </p> <p><span class="text_bold">Co-Defendants</span><br /> Eleazar Mendoza<br /> Gabriel Morales<br /> Raymond McBen </p> <p><span class="text_bold">Race and Gender of Victim</span><br /> Hispanic male</p> <!-- InstanceEndEditable --> </div> <div id="bottom_nav"> <a href="../../info_employees.html">Employee Resources</a> | <a href="http://oig.tdcj.texas.gov/oig_fraud.html">Report Waste, Fraud, and Abuse of TDCJ Resources</a> | <a href="../../publications/index.html#energyplan">State Agency Energy Savings Program</a> | <a href="http://itd.tdcj.texas.gov/TDCJ_Intranet/">TDCJ Intranet</a><br /> <a href="../../site_policies/index.html">Site Policies</a> | <a href="http://www.tci.tdcj.texas.gov/">Texas Correctional Industries</a> | <a href="http://www.texas.gov/en/Pages/default.aspx">TexasOnline</a> | <a href="http://veterans.portal.texas.gov/en/Pages/default.aspx">Texas Veterans Portal</a> | <a href="http://governor.state.tx.us/homeland">Texas Homeland Security</a> | <a href="https://www.tsl.texas.gov/trail/index.html">TRAIL Statewide Search</a> | <a href="http://get.adobe.com/reader/">Adobe Reader</a><br /> Texas Department of Criminal Justice | P.O. Box 99 | Huntsville, Texas 77342-0099 | (936) 295-6371</div> </div> </div> <script type="text/javascript" src="../../javascripts/bread.js"></script> <noscript>&nbsp;</noscript> </body> <!-- InstanceEnd --></html>
{ "content_hash": "d8d3e2e5a0ac615e800b27ab578b395f", "timestamp": "", "source": "github", "line_count": 242, "max_line_length": 328, "avg_line_length": 51.553719008264466, "alnum_prop": 0.6538153254248157, "repo_name": "tommeagher/pythonGIJC15", "id": "f685dad47c76a3f19dd67f12863df19e6c4342f7", "size": "12476", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "website/death_row/dr_info/garciajuan.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "89688" }, { "name": "HTML", "bytes": "7408019" }, { "name": "Python", "bytes": "33992" } ], "symlink_target": "" }
using System; using System.Collections.ObjectModel; using System.Globalization; using System.Windows.Media; using System.Windows.Media.Imaging; using Put.io.Core.Common; using Put.io.Core.Extensions; using Put.io.Core.InvokeSynchronising; using Put.io.Core.Models; using System.Linq; using Put.io.Core.ProgressTracking; using Put.io.Core.Storage; namespace Put.io.Core.ViewModels { public class FileViewModel : ViewModelBase { protected ISettingsRepository Settings { get; set; } protected ProgressTracker ProgressTracker { get; set; } public FileViewModel() { if (IsInDesignMode) { File = new File { ScreenShot = @"http://i.imgur.com/pq7lih.jpg", Name = "This is a very long file name, oh my very long like most torrents" }; ScreenShot = new BitmapImage(new Uri(File.ScreenShot, UriKind.Absolute)); SizeInformation = "2.4 GB"; CreatedDate = DateTime.Now.ToShortDateString(); } } public FileViewModel(ISettingsRepository settings, ProgressTracker tracker, IPropertyChangedInvoke invoker) : this() { Settings = settings; ProgressTracker = tracker; Invoker = invoker; } #region Methods private void UpdateDynamicFields() { SizeInformation = File.Size.ToFileSize(); CreatedDate = File.CreatedDate.ToString(CultureInfo.CurrentCulture); const int maxFileName = 50; if (string.IsNullOrEmpty(File.Name) || File.Name.Length <= maxFileName) { NameTrimmed = File.Name; } else { NameTrimmed = File.Name.Substring(0, maxFileName - 3) + "..."; } } #endregion #region Properties private File _file; public File File { get { return _file; } set { if (_file == value) return; _file = value; OnPropertyChanged(); if (_file != null) UpdateDynamicFields(); } } private ObservableCollection<FileViewModel> _children; public ObservableCollection<FileViewModel> Children { get { return _children; } set { if (_children == value) return; if (value != null) { foreach (var fileViewModel in value) { fileViewModel.Parent = this; } } _children = value; OnPropertyChanged(); } } public FileViewModel Parent { get; set; } public bool IsExpandable { get { return File.ContentType == ContentType.Directory; } } public bool IsOpenable { get { return File.ContentType == ContentType.Video; } //TODO: Work out betterer } public string Path() { if (Parent == null) return " / "; var path = Parent.Path(); path += string.Format("{0} / ", ShrinkFileName(Parent.File.Name)); return path; } private const int MaxFileName = 20; private string ShrinkFileName(string name) { if (string.IsNullOrEmpty(name)) name = string.Empty; if (name.Length > MaxFileName + 3) { name = name.Substring(0, name.Length - (name.Length - MaxFileName)) + "..."; } return name; } private ImageSource _screenShot; public ImageSource ScreenShot { get { if (_screenShot != null) return _screenShot; if (string.IsNullOrEmpty(File.ScreenShot)) return null; //Download image with progress indication var transaction = ProgressTracker.StartNewTransaction(); var imageSource = new BitmapImage(); imageSource.ImageOpened += (sender, args) => ProgressTracker.CompleteTransaction(transaction); imageSource.ImageFailed += (sender, args) => ProgressTracker.CompleteTransaction(transaction); //Start the download imageSource.UriSource = new Uri(File.ScreenShot, UriKind.Absolute); _screenShot = imageSource; return _screenShot; } set { if (_screenShot == value) return; _screenShot = value; OnPropertyChanged(); } } private string _sizeInformation; public string SizeInformation { get { return _sizeInformation; } set { if (_sizeInformation == value) return; _sizeInformation = value; OnPropertyChanged(); } } private string _createdDate; public string CreatedDate { get { return _createdDate; } set { if (_createdDate == value) return; _createdDate = value; OnPropertyChanged(); } } private string _nameTrimmed; public string NameTrimmed { get { return _nameTrimmed; } set { if (_nameTrimmed == value) return; _nameTrimmed = value; OnPropertyChanged(); } } #endregion } }
{ "content_hash": "2e020af1e985f564984a563c6fd0c813", "timestamp": "", "source": "github", "line_count": 212, "max_line_length": 158, "avg_line_length": 28.67924528301887, "alnum_prop": 0.4820723684210526, "repo_name": "Workshop2/Put.io.Wp", "id": "aa81a111c13a0d54117562d366acd18269b9ae87", "size": "6082", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Put.io.Core/ViewModels/FileViewModel.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "176292" }, { "name": "PowerShell", "bytes": "1658" } ], "symlink_target": "" }