code
stringlengths
5
1.01M
repo_name
stringlengths
5
84
path
stringlengths
4
311
language
stringclasses
30 values
license
stringclasses
15 values
size
int64
5
1.01M
input_ids
listlengths
502
502
token_type_ids
listlengths
502
502
attention_mask
listlengths
502
502
labels
listlengths
502
502
// Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef GPU_COMMAND_BUFFER_SERVICE_IN_PROCESS_COMMAND_BUFFER_H_ #define GPU_COMMAND_BUFFER_SERVICE_IN_PROCESS_COMMAND_BUFFER_H_ #include <map> #include <vector> #include "base/atomic_sequence_num.h" #include "base/callback.h" #include "base/compiler_specific.h" #include "base/containers/scoped_ptr_hash_map.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/synchronization/lock.h" #include "base/synchronization/waitable_event.h" #include "base/threading/thread.h" #include "gpu/command_buffer/client/gpu_control.h" #include "gpu/command_buffer/common/command_buffer.h" #include "gpu/gpu_export.h" #include "ui/gfx/gpu_memory_buffer.h" #include "ui/gfx/native_widget_types.h" #include "ui/gl/gl_surface.h" #include "ui/gl/gpu_preference.h" namespace base { class SequenceChecker; } namespace gfx { class GLContext; class GLShareGroup; class GLSurface; class Size; } #if defined(OS_ANDROID) namespace gfx { class SurfaceTexture; } namespace gpu { class StreamTextureManagerInProcess; } #endif namespace gpu { class SyncPointManager; class ValueStateMap; namespace gles2 { class FramebufferCompletenessCache; class GLES2Decoder; class MailboxManager; class ProgramCache; class ShaderTranslatorCache; class SubscriptionRefSet; } class CommandBufferServiceBase; class GpuMemoryBufferManager; class GpuScheduler; class ImageFactory; class TransferBufferManagerInterface; // This class provides a thread-safe interface to the global GPU service (for // example GPU thread) when being run in single process mode. // However, the behavior for accessing one context (i.e. one instance of this // class) from different client threads is undefined. class GPU_EXPORT InProcessCommandBuffer : public CommandBuffer, public GpuControl { public: class Service; explicit InProcessCommandBuffer(const scoped_refptr<Service>& service); ~InProcessCommandBuffer() override; // If |surface| is not NULL, use it directly; in this case, the command // buffer gpu thread must be the same as the client thread. Otherwise create // a new GLSurface. bool Initialize(scoped_refptr<gfx::GLSurface> surface, bool is_offscreen, gfx::AcceleratedWidget window, const gfx::Size& size, const std::vector<int32>& attribs, gfx::GpuPreference gpu_preference, const base::Closure& context_lost_callback, InProcessCommandBuffer* share_group, GpuMemoryBufferManager* gpu_memory_buffer_manager, ImageFactory* image_factory); void Destroy(); // CommandBuffer implementation: bool Initialize() override; State GetLastState() override; int32 GetLastToken() override; void Flush(int32 put_offset) override; void OrderingBarrier(int32 put_offset) override; void WaitForTokenInRange(int32 start, int32 end) override; void WaitForGetOffsetInRange(int32 start, int32 end) override; void SetGetBuffer(int32 shm_id) override; scoped_refptr<gpu::Buffer> CreateTransferBuffer(size_t size, int32* id) override; void DestroyTransferBuffer(int32 id) override; gpu::error::Error GetLastError() override; // GpuControl implementation: gpu::Capabilities GetCapabilities() override; int32 CreateImage(ClientBuffer buffer, size_t width, size_t height, unsigned internalformat) override; void DestroyImage(int32 id) override; int32 CreateGpuMemoryBufferImage(size_t width, size_t height, unsigned internalformat, unsigned usage) override; uint32 InsertSyncPoint() override; uint32 InsertFutureSyncPoint() override; void RetireSyncPoint(uint32 sync_point) override; void SignalSyncPoint(uint32 sync_point, const base::Closure& callback) override; void SignalQuery(uint32 query_id, const base::Closure& callback) override; void SetSurfaceVisible(bool visible) override; uint32 CreateStreamTexture(uint32 texture_id) override; void SetLock(base::Lock*) override; bool IsGpuChannelLost() override; // The serializer interface to the GPU service (i.e. thread). class Service { public: Service(); virtual ~Service(); virtual void AddRef() const = 0; virtual void Release() const = 0; // Queues a task to run as soon as possible. virtual void ScheduleTask(const base::Closure& task) = 0; // Schedules |callback| to run at an appropriate time for performing idle // work. virtual void ScheduleIdleWork(const base::Closure& task) = 0; virtual bool UseVirtualizedGLContexts() = 0; virtual scoped_refptr<gles2::ShaderTranslatorCache> shader_translator_cache() = 0; virtual scoped_refptr<gles2::FramebufferCompletenessCache> framebuffer_completeness_cache() = 0; virtual SyncPointManager* sync_point_manager() = 0; scoped_refptr<gfx::GLShareGroup> share_group(); scoped_refptr<gles2::MailboxManager> mailbox_manager(); scoped_refptr<gles2::SubscriptionRefSet> subscription_ref_set(); scoped_refptr<gpu::ValueStateMap> pending_valuebuffer_state(); gpu::gles2::ProgramCache* program_cache(); private: scoped_refptr<gfx::GLShareGroup> share_group_; scoped_refptr<gles2::MailboxManager> mailbox_manager_; scoped_refptr<gles2::SubscriptionRefSet> subscription_ref_set_; scoped_refptr<gpu::ValueStateMap> pending_valuebuffer_state_; scoped_ptr<gpu::gles2::ProgramCache> program_cache_; }; #if defined(OS_ANDROID) scoped_refptr<gfx::SurfaceTexture> GetSurfaceTexture( uint32 stream_id); #endif private: struct InitializeOnGpuThreadParams { bool is_offscreen; gfx::AcceleratedWidget window; const gfx::Size& size; const std::vector<int32>& attribs; gfx::GpuPreference gpu_preference; gpu::Capabilities* capabilities; // Ouptut. InProcessCommandBuffer* context_group; ImageFactory* image_factory; InitializeOnGpuThreadParams(bool is_offscreen, gfx::AcceleratedWidget window, const gfx::Size& size, const std::vector<int32>& attribs, gfx::GpuPreference gpu_preference, gpu::Capabilities* capabilities, InProcessCommandBuffer* share_group, ImageFactory* image_factory) : is_offscreen(is_offscreen), window(window), size(size), attribs(attribs), gpu_preference(gpu_preference), capabilities(capabilities), context_group(share_group), image_factory(image_factory) {} }; bool InitializeOnGpuThread(const InitializeOnGpuThreadParams& params); bool DestroyOnGpuThread(); void FlushOnGpuThread(int32 put_offset); void ScheduleIdleWorkOnGpuThread(); uint32 CreateStreamTextureOnGpuThread(uint32 client_texture_id); bool MakeCurrent(); base::Closure WrapCallback(const base::Closure& callback); State GetStateFast(); void QueueTask(const base::Closure& task) { service_->ScheduleTask(task); } void CheckSequencedThread(); void RetireSyncPointOnGpuThread(uint32 sync_point); void SignalSyncPointOnGpuThread(uint32 sync_point, const base::Closure& callback); bool WaitSyncPointOnGpuThread(uint32 sync_point); void SignalQueryOnGpuThread(unsigned query_id, const base::Closure& callback); void DestroyTransferBufferOnGpuThread(int32 id); void CreateImageOnGpuThread(int32 id, const gfx::GpuMemoryBufferHandle& handle, const gfx::Size& size, gfx::BufferFormat format, uint32 internalformat); void DestroyImageOnGpuThread(int32 id); void SetGetBufferOnGpuThread(int32 shm_id, base::WaitableEvent* completion); // Callbacks: void OnContextLost(); void OnResizeView(gfx::Size size, float scale_factor); bool GetBufferChanged(int32 transfer_buffer_id); void PumpCommands(); void PerformIdleWork(); // Members accessed on the gpu thread (possibly with the exception of // creation): bool context_lost_; scoped_refptr<TransferBufferManagerInterface> transfer_buffer_manager_; scoped_ptr<GpuScheduler> gpu_scheduler_; scoped_ptr<gles2::GLES2Decoder> decoder_; scoped_refptr<gfx::GLContext> context_; scoped_refptr<gfx::GLSurface> surface_; base::Closure context_lost_callback_; bool idle_work_pending_; // Used to throttle PerformIdleWork. ImageFactory* image_factory_; // Members accessed on the client thread: State last_state_; int32 last_put_offset_; gpu::Capabilities capabilities_; GpuMemoryBufferManager* gpu_memory_buffer_manager_; base::AtomicSequenceNumber next_image_id_; // Accessed on both threads: scoped_ptr<CommandBufferServiceBase> command_buffer_; base::Lock command_buffer_lock_; base::WaitableEvent flush_event_; scoped_refptr<Service> service_; State state_after_last_flush_; base::Lock state_after_last_flush_lock_; scoped_refptr<gfx::GLShareGroup> gl_share_group_; #if defined(OS_ANDROID) scoped_ptr<StreamTextureManagerInProcess> stream_texture_manager_; #endif // Only used with explicit scheduling and the gpu thread is the same as // the client thread. scoped_ptr<base::SequenceChecker> sequence_checker_; base::WeakPtr<InProcessCommandBuffer> gpu_thread_weak_ptr_; base::WeakPtrFactory<InProcessCommandBuffer> gpu_thread_weak_ptr_factory_; DISALLOW_COPY_AND_ASSIGN(InProcessCommandBuffer); }; // Default Service class when a null service is used. class GPU_EXPORT GpuInProcessThread : public base::Thread, public NON_EXPORTED_BASE(InProcessCommandBuffer::Service), public base::RefCountedThreadSafe<GpuInProcessThread> { public: explicit GpuInProcessThread(SyncPointManager* sync_point_manager); void AddRef() const override; void Release() const override; void ScheduleTask(const base::Closure& task) override; void ScheduleIdleWork(const base::Closure& callback) override; bool UseVirtualizedGLContexts() override; scoped_refptr<gles2::ShaderTranslatorCache> shader_translator_cache() override; scoped_refptr<gles2::FramebufferCompletenessCache> framebuffer_completeness_cache() override; SyncPointManager* sync_point_manager() override; private: ~GpuInProcessThread() override; friend class base::RefCountedThreadSafe<GpuInProcessThread>; SyncPointManager* sync_point_manager_; // Non-owning. scoped_refptr<gpu::gles2::ShaderTranslatorCache> shader_translator_cache_; scoped_refptr<gpu::gles2::FramebufferCompletenessCache> framebuffer_completeness_cache_; DISALLOW_COPY_AND_ASSIGN(GpuInProcessThread); }; } // namespace gpu #endif // GPU_COMMAND_BUFFER_SERVICE_IN_PROCESS_COMMAND_BUFFER_H_
Chilledheart/chromium
gpu/command_buffer/service/in_process_command_buffer.h
C
bsd-3-clause
11,305
[ 30522, 1013, 1013, 9385, 2286, 1996, 10381, 21716, 5007, 6048, 1012, 2035, 2916, 9235, 1012, 1013, 1013, 2224, 1997, 2023, 3120, 3642, 2003, 9950, 2011, 1037, 18667, 2094, 1011, 2806, 6105, 2008, 2064, 2022, 1013, 1013, 2179, 1999, 1996, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Placeholder.js ============== A small JavaScript library to add placeholders for elements that don't support them.
ConnorAtherton/Placeholder.js
README.md
Markdown
mit
116
[ 30522, 2173, 14528, 1012, 1046, 2015, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1037, 2235, 9262, 22483, 3075, 2000, 5587, 2173, 17794, 2005, 3787, 2008, 2123, 1005, 1056, 2490, 2068, 1012, 102, 0...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
import * as React from 'react'; /** JumbotronProps props */ export interface JumbotronProps { /** prop1 description */ prop1: string; } /** * Jumbotron description */ const Jumbotron = (props: JumbotronProps) => { return <div>Test</div>; }; export default Jumbotron;
pvasek/react-docgen-typescript
src/__tests__/data/FunctionalComponentAsConstAsDefaultExport.tsx
TypeScript
mit
278
[ 30522, 12324, 1008, 2004, 10509, 2013, 1005, 10509, 1005, 1025, 1013, 1008, 1008, 18414, 13344, 15312, 21572, 4523, 24387, 1008, 1013, 9167, 8278, 18414, 13344, 15312, 21572, 4523, 1063, 1013, 1008, 1008, 17678, 2487, 6412, 1008, 1013, 17678,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
jsonp({"cep":"79103835","logradouro":"Travessa do Livro","bairro":"Vila S\u00edlvia Regina","cidade":"Campo Grande","uf":"MS","estado":"Mato Grosso do Sul"});
lfreneda/cepdb
api/v1/79103835.jsonp.js
JavaScript
cc0-1.0
159
[ 30522, 1046, 3385, 2361, 1006, 1063, 1000, 8292, 2361, 1000, 1024, 1000, 6535, 10790, 22025, 19481, 1000, 1010, 1000, 8833, 12173, 8162, 2080, 1000, 1024, 1000, 19817, 21055, 3736, 2079, 22135, 3217, 1000, 1010, 1000, 21790, 18933, 1000, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
!function(o){"object"==typeof module&&module.exports?module.exports=o.default=o:"function"==typeof define&&define.amd?define("highcharts/themes/sunset",["highcharts"],function(e){return o(e),o.Highcharts=e,o}):o("undefined"!=typeof Highcharts?Highcharts:void 0)}(function(e){function o(e,o,t,s){e.hasOwnProperty(o)||(e[o]=s.apply(null,t))}o(e=e?e._modules:{},"Extensions/Themes/Sunset.js",[e["Core/Globals.js"],e["Core/Utilities.js"]],function(e,o){o=o.setOptions,e.theme={colors:["#FDD089","#FF7F79","#A0446E","#251535"],colorAxis:{maxColor:"#60042E",minColor:"#FDD089"},plotOptions:{map:{nullColor:"#fefefc"}},navigator:{series:{color:"#FF7F79",lineColor:"#A0446E"}}},o(e.theme)}),o(e,"masters/themes/sunset.src.js",[],function(){})});
cdnjs/cdnjs
ajax/libs/highcharts/9.0.1/themes/sunset.min.js
JavaScript
mit
737
[ 30522, 999, 3853, 1006, 1051, 1007, 1063, 1000, 4874, 1000, 1027, 1027, 2828, 11253, 11336, 1004, 1004, 11336, 1012, 14338, 1029, 11336, 1012, 14338, 1027, 1051, 1012, 12398, 1027, 1051, 1024, 1000, 3853, 1000, 1027, 1027, 2828, 11253, 9375...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# Factory methods for UITabBarItem. I've never understood why UITabBarItem makes # it so easy to set the view tag, but these methods do not require you to do so. class UITabBarItem class << self def titled(title, options={}) tag = options.fetch(:tag, 0) image = options[:image] badge = options[:badge] if image && image.respond_to?(:uiimage) image = image.uiimage end selected_image = options[:selected_image] if selected_image && selected_image.respond_to?(:uiimage) selected_image = selected_image.uiimage end item = self.alloc.initWithTitle(title, image: image, selectedImage: selected_image) if tag item.tag = tag end if badge item.badgeValue = badge.to_s end return item end def system(type, options={}) type = type.uitabbarsystemitem if type.respond_to?(:uitabbarsystemitem) tag = options.fetch(:tag, 0) badge = options[:badge] item = self.alloc.initWithTabBarSystemItem(type, tag: tag) if badge item.badgeValue = badge.to_s end return item end def more(options={}) return self.system(UITabBarSystemItemMore, options) end def favorites(options={}) return self.system(UITabBarSystemItemFavorites, options) end def featured(options={}) return self.system(UITabBarSystemItemFeatured, options) end def top_rated(options={}) return self.system(UITabBarSystemItemTopRated, options) end def recents(options={}) return self.system(UITabBarSystemItemRecents, options) end def contacts(options={}) return self.system(UITabBarSystemItemContacts, options) end def history(options={}) return self.system(UITabBarSystemItemHistory, options) end def bookmarks(options={}) return self.system(UITabBarSystemItemBookmarks, options) end def search(options={}) return self.system(UITabBarSystemItemSearch, options) end def downloads(options={}) return self.system(UITabBarSystemItemDownloads, options) end def most_recent(options={}) return self.system(UITabBarSystemItemMostRecent, options) end def most_viewed(options={}) return self.system(UITabBarSystemItemMostViewed, options) end end end
earthrid/sugarcube
lib/ios/sugarcube-factories/uitabbaritem.rb
Ruby
bsd-2-clause
2,351
[ 30522, 1001, 4713, 4725, 2005, 21318, 2696, 22414, 17625, 2213, 1012, 1045, 1005, 2310, 2196, 5319, 2339, 21318, 2696, 22414, 17625, 2213, 3084, 1001, 2009, 2061, 3733, 2000, 2275, 1996, 3193, 6415, 1010, 2021, 2122, 4725, 2079, 2025, 5478,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * Copyright 2015 Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.physical_web.collection; import static org.junit.Assert.*; import org.junit.Before; import org.junit.Test; import java.util.Comparator; /** * UrlGroup unit test class. */ public class UrlGroupTest { private static final String ID1 = "id1"; private static final String ID2 = "id2"; private static final String URL1 = "http://physical-web.org/#a"; private static final String URL2 = "http://physical-web.org/#b"; private static final String GROUPID1 = "group1"; private static final String GROUPID2 = "group2"; private static final double RANK1 = 0.5d; private static final double RANK2 = 0.9d; private PwPair mPwPair1; private PwPair mPwPair2; private static Comparator<PwPair> testComparator = new Comparator<PwPair>() { @Override public int compare(PwPair lhs, PwPair rhs) { return lhs.getUrlDevice().getId().compareTo(rhs.getUrlDevice().getId()); } }; public static PwPair createRankedPair(String id, String url, String groupId) { UrlDevice urlDevice = new UrlDevice(id, url); PwsResult pwsResult = new PwsResult.Builder(url, url) .setTitle("title1") .setDescription("description1") .setGroupId(groupId) .build(); return new PwPair(urlDevice, pwsResult); } @Before public void setUp() { mPwPair1 = createRankedPair(ID1, URL1, GROUPID1); mPwPair2 = createRankedPair(ID2, URL2, GROUPID1); } @Test public void constructorCreatesProperObject() { UrlGroup urlGroup = new UrlGroup(GROUPID1); assertEquals(urlGroup.getGroupId(), GROUPID1); } @Test public void addPairAndGetTopPairWorks() { UrlGroup urlGroup = new UrlGroup(GROUPID1); urlGroup.addPair(mPwPair1); PwPair pwPair = urlGroup.getTopPair(testComparator); assertEquals(pwPair.getUrlDevice().getId(), ID1); assertEquals(pwPair.getUrlDevice().getUrl(), URL1); assertEquals(pwPair.getPwsResult().getRequestUrl(), URL1); assertEquals(pwPair.getPwsResult().getSiteUrl(), URL1); assertEquals(pwPair.getPwsResult().getGroupId(), GROUPID1); } @Test public void addPairTwiceAndGetTopPairWorks() { UrlGroup urlGroup = new UrlGroup(GROUPID1); urlGroup.addPair(mPwPair1); urlGroup.addPair(mPwPair2); // higher rank PwPair pwPair = urlGroup.getTopPair(testComparator); assertEquals(pwPair.getUrlDevice().getId(), ID1); } }
google/physical-web
java/libs/src/test/java/org/physical_web/collection/UrlGroupTest.java
Java
apache-2.0
2,989
[ 30522, 1013, 1008, 1008, 9385, 2325, 8224, 4297, 1012, 2035, 2916, 9235, 1012, 1008, 1008, 7000, 2104, 1996, 15895, 6105, 1010, 2544, 1016, 1012, 1014, 1006, 1996, 1000, 6105, 1000, 1007, 1025, 1008, 2017, 2089, 2025, 2224, 2023, 5371, 32...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
//----------------------------------------------------------------------------- // Copyright (C) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Windows; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("mtWPFManipulation")] [assembly: AssemblyDescription("Windows7 Integration Library Demo")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Microsoft")] [assembly: AssemblyProduct("Windows7 Integration Library")] [assembly: AssemblyCopyright("Copyright © Microsoft 2009")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] //In order to begin building localizable applications, set //<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file //inside a <PropertyGroup>. For example, if you are using US english //in your source files, set the <UICulture> to en-US. Then uncomment //the NeutralResourceLanguage attribute below. Update the "en-US" in //the line below to match the UICulture setting in the project file. //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] [assembly: ThemeInfo( ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located //(used if a resource is not found in the page, // or application resource dictionaries) ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located //(used if a resource is not found in the page, // app, or any theme specific resource dictionaries) )] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
RIT-Tool-Time/Cascade
Cascade/Win7RC_MT/Demo/Multitouch/MutlitouchWPF/mtWPFManipulation/Properties/AssemblyInfo.cs
C#
gpl-3.0
2,523
[ 30522, 1013, 1013, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 101...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
using System; using System.Diagnostics; using BCurve=NS_GMath.I_BCurveD; namespace NS_GMath { public class Param { /* * CONSTS & ENUMS */ public const double Infinity=2.0e20; public const double Degen=1.0e20; public const double Invalid=1.5e20; public enum TypeParam { Before=-2, Start=-1, Inner=0, End=1, After=2, Invalid=100, }; /* * MEMBERS */ double val; /* * PROPERTIES */ public double Val { get { return this.val; } set { if (Math.Abs(value)>Param.Infinity) { value=Param.Infinity*Math.Sign(value); } this.val=value; } } public bool IsValid { get { return (this.val!=Param.Invalid); } } public bool IsFictive { get { return ((this.IsDegen)||(this.IsInfinite)||(!this.IsValid)); } } public bool IsDegen { get { return (this.val==Param.Degen); } } public bool IsInfinite { get { return (Math.Abs(this.val)==Param.Infinity); } } /* * CONSTRUCTORS */ protected Param() { this.val=0.5; } public Param(double val) { this.Val=val; } /* * METHODS */ virtual public void ClearRelease() { } virtual public Param Copy() { return new Param(this.val); } public void Invalidate() { this.val=Param.Invalid; } public void Round(params double[] valRound) { for (int i=0; i<valRound.Length; i++) { if (Math.Abs(this.Val-valRound[i])<MConsts.EPS_DEC) this.Val=valRound[i]; } } public void Reverse(double valRev) { if (this.val==Param.Degen) return; if (this.val==Param.Invalid) return; if (Math.Abs(this.val)==Param.Infinity) { this.val=-this.val; return; } this.val=valRev-this.val; this.Clip(-Param.Infinity,Param.Infinity); } public void Clip(double start, double end) { if (start>end) { throw new ExceptionGMath("Param","Clip",null); } if (this.val==Param.Degen) return; if (this.val==Param.Invalid) return; this.Round(start,end); if (this.Val<start) this.Val=start; if (this.Val>end) this.Val=end; } public void FromReduced(BCurve bcurve) { // parameter of the (reduced)curve may be invalidated if // the curve intersects the self-intersecting Bezier if (this.val==Param.Invalid) return; if (bcurve.IsDegen) { return; } if (bcurve is Bez2D) { Bez2D bez=bcurve as Bez2D; Param parM; if (bez.IsSeg(out parM)) { bez.ParamFromSeg(this); } } } /* * CONVERSIONS */ public static implicit operator double(Param par) { return par.val; } public static implicit operator Param(double val) { return new Param(val); } } public class CParam : Param { Knot knot; /* * CONSTRUCTORS */ public CParam(double val, Knot knot) { this.Val=val; this.knot=knot; } public CParam(Param par, Knot knot) { if (par.GetType()!=typeof(Param)) { throw new ExceptionGMath("Param","CParam",null); } this.Val=par.Val; this.knot=knot; } /* * PROPERTIES */ public Knot Kn { get { return this.knot; } } public int IndKnot { get { if (this.knot==null) return GConsts.IND_UNINITIALIZED; return this.knot.IndexKnot; } } /* * METHODS */ override public void ClearRelease() { this.knot=null; } override public Param Copy() { throw new ExceptionGMath("Param","Copy","NOT IMPLEMENTED"); //return null; } } }
Microsoft/Font-Validator
GMath/Param.cs
C#
mit
5,165
[ 30522, 2478, 2291, 1025, 2478, 2291, 1012, 16474, 2015, 1025, 2478, 4647, 3126, 3726, 1027, 24978, 1035, 20917, 2705, 1012, 1045, 1035, 4647, 3126, 7178, 1025, 3415, 15327, 24978, 1035, 20917, 2705, 1063, 2270, 2465, 11498, 2213, 1063, 1013...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package com.lightspeedhq.ecom; import com.lightspeedhq.ecom.domain.LightspeedEComError; import feign.FeignException; import lombok.Getter; /** * * @author stevensnoeijen */ public class LightspeedEComErrorException extends FeignException { @Getter private LightspeedEComError error; public LightspeedEComErrorException(String message, LightspeedEComError error) { super(message); this.error = error; } @Override public String toString() { return error.toString(); } }
Falkplan/lightspeedecom-api
lightspeedecom-api/src/main/java/com/lightspeedhq/ecom/LightspeedEComErrorException.java
Java
mit
528
[ 30522, 7427, 4012, 1012, 4597, 25599, 2232, 4160, 1012, 17338, 2213, 1025, 12324, 4012, 1012, 4597, 25599, 2232, 4160, 1012, 17338, 2213, 1012, 5884, 1012, 4597, 25599, 8586, 8462, 18933, 2099, 1025, 12324, 24664, 16206, 1012, 24664, 10177, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.7.0_65) on Mon Mar 16 13:36:33 CET 2015 --> <title>Class Hierarchy</title> <meta name="date" content="2015-03-16"> <link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Class Hierarchy"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="overview-summary.html">Overview</a></li> <li>Package</li> <li>Class</li> <li class="navBarCell1Rev">Tree</li> <li><a href="deprecated-list.html">Deprecated</a></li> <li><a href="index-files/index-1.html">Index</a></li> <li><a href="help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="index.html?overview-tree.html" target="_top">Frames</a></li> <li><a href="overview-tree.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h1 class="title">Hierarchy For All Packages</h1> <span class="strong">Package Hierarchies:</span> <ul class="horizontal"> <li><a href="no/nordicsemi/android/dfu/package-tree.html">no.nordicsemi.android.dfu</a>, </li> <li><a href="no/nordicsemi/android/dfu/exception/package-tree.html">no.nordicsemi.android.dfu.exception</a>, </li> <li><a href="no/nordicsemi/android/dfu/manifest/package-tree.html">no.nordicsemi.android.dfu.manifest</a>, </li> <li><a href="no/nordicsemi/android/error/package-tree.html">no.nordicsemi.android.error</a></li> </ul> </div> <div class="contentContainer"> <h2 title="Class Hierarchy">Class Hierarchy</h2> <ul> <li type="circle">java.lang.Object <ul> <li type="circle">no.nordicsemi.android.dfu.<a href="no/nordicsemi/android/dfu/BuildConfig.html" title="class in no.nordicsemi.android.dfu"><span class="strong">BuildConfig</span></a></li> <li type="circle">no.nordicsemi.android.dfu.manifest.<a href="no/nordicsemi/android/dfu/manifest/FileInfo.html" title="class in no.nordicsemi.android.dfu.manifest"><span class="strong">FileInfo</span></a> <ul> <li type="circle">no.nordicsemi.android.dfu.manifest.<a href="no/nordicsemi/android/dfu/manifest/SoftDeviceBootloaderFileInfo.html" title="class in no.nordicsemi.android.dfu.manifest"><span class="strong">SoftDeviceBootloaderFileInfo</span></a></li> </ul> </li> <li type="circle">no.nordicsemi.android.error.<a href="no/nordicsemi/android/error/GattError.html" title="class in no.nordicsemi.android.error"><span class="strong">GattError</span></a></li> <li type="circle">no.nordicsemi.android.dfu.manifest.<a href="no/nordicsemi/android/dfu/manifest/InitPacketData.html" title="class in no.nordicsemi.android.dfu.manifest"><span class="strong">InitPacketData</span></a></li> <li type="circle">java.io.InputStream (implements java.io.Closeable) <ul> <li type="circle">java.io.FilterInputStream <ul> <li type="circle">no.nordicsemi.android.dfu.<a href="no/nordicsemi/android/dfu/HexInputStream.html" title="class in no.nordicsemi.android.dfu"><span class="strong">HexInputStream</span></a></li> <li type="circle">java.util.zip.InflaterInputStream <ul> <li type="circle">java.util.zip.ZipInputStream <ul> <li type="circle">no.nordicsemi.android.dfu.<a href="no/nordicsemi/android/dfu/ArchiveInputStream.html" title="class in no.nordicsemi.android.dfu"><span class="strong">ArchiveInputStream</span></a></li> </ul> </li> </ul> </li> </ul> </li> </ul> </li> <li type="circle">IntentService <ul> <li type="circle">no.nordicsemi.android.dfu.<a href="no/nordicsemi/android/dfu/DfuBaseService.html" title="class in no.nordicsemi.android.dfu"><span class="strong">DfuBaseService</span></a></li> </ul> </li> <li type="circle">no.nordicsemi.android.dfu.manifest.<a href="no/nordicsemi/android/dfu/manifest/Manifest.html" title="class in no.nordicsemi.android.dfu.manifest"><span class="strong">Manifest</span></a></li> <li type="circle">no.nordicsemi.android.dfu.manifest.<a href="no/nordicsemi/android/dfu/manifest/ManifestFile.html" title="class in no.nordicsemi.android.dfu.manifest"><span class="strong">ManifestFile</span></a></li> <li type="circle">no.nordicsemi.android.dfu.<a href="no/nordicsemi/android/dfu/R.html" title="class in no.nordicsemi.android.dfu"><span class="strong">R</span></a></li> <li type="circle">no.nordicsemi.android.dfu.<a href="no/nordicsemi/android/dfu/R.attr.html" title="class in no.nordicsemi.android.dfu"><span class="strong">R.attr</span></a></li> <li type="circle">no.nordicsemi.android.dfu.<a href="no/nordicsemi/android/dfu/R.drawable.html" title="class in no.nordicsemi.android.dfu"><span class="strong">R.drawable</span></a></li> <li type="circle">no.nordicsemi.android.dfu.<a href="no/nordicsemi/android/dfu/R.string.html" title="class in no.nordicsemi.android.dfu"><span class="strong">R.string</span></a></li> <li type="circle">java.lang.Throwable (implements java.io.Serializable) <ul> <li type="circle">java.lang.Exception <ul> <li type="circle">no.nordicsemi.android.dfu.exception.<a href="no/nordicsemi/android/dfu/exception/DeviceDisconnectedException.html" title="class in no.nordicsemi.android.dfu.exception"><span class="strong">DeviceDisconnectedException</span></a></li> <li type="circle">no.nordicsemi.android.dfu.exception.<a href="no/nordicsemi/android/dfu/exception/DfuException.html" title="class in no.nordicsemi.android.dfu.exception"><span class="strong">DfuException</span></a></li> <li type="circle">java.io.IOException <ul> <li type="circle">no.nordicsemi.android.dfu.exception.<a href="no/nordicsemi/android/dfu/exception/HexFileValidationException.html" title="class in no.nordicsemi.android.dfu.exception"><span class="strong">HexFileValidationException</span></a></li> </ul> </li> <li type="circle">no.nordicsemi.android.dfu.exception.<a href="no/nordicsemi/android/dfu/exception/RemoteDfuException.html" title="class in no.nordicsemi.android.dfu.exception"><span class="strong">RemoteDfuException</span></a></li> <li type="circle">no.nordicsemi.android.dfu.exception.<a href="no/nordicsemi/android/dfu/exception/UnknownResponseException.html" title="class in no.nordicsemi.android.dfu.exception"><span class="strong">UnknownResponseException</span></a></li> <li type="circle">no.nordicsemi.android.dfu.exception.<a href="no/nordicsemi/android/dfu/exception/UploadAbortedException.html" title="class in no.nordicsemi.android.dfu.exception"><span class="strong">UploadAbortedException</span></a></li> </ul> </li> </ul> </li> </ul> </li> </ul> <h2 title="Interface Hierarchy">Interface Hierarchy</h2> <ul> <li type="circle">no.nordicsemi.android.dfu.<a href="no/nordicsemi/android/dfu/DfuSettingsConstants.html" title="interface in no.nordicsemi.android.dfu"><span class="strong">DfuSettingsConstants</span></a></li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="overview-summary.html">Overview</a></li> <li>Package</li> <li>Class</li> <li class="navBarCell1Rev">Tree</li> <li><a href="deprecated-list.html">Deprecated</a></li> <li><a href="index-files/index-1.html">Index</a></li> <li><a href="help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="index.html?overview-tree.html" target="_top">Frames</a></li> <li><a href="overview-tree.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
frostmournex/DFULibrary
documentation/javadoc/overview-tree.html
HTML
bsd-3-clause
8,953
[ 30522, 1026, 999, 9986, 13874, 16129, 2270, 1000, 1011, 1013, 1013, 1059, 2509, 2278, 1013, 1013, 26718, 2094, 16129, 1018, 1012, 5890, 17459, 1013, 1013, 4372, 1000, 1000, 8299, 1024, 1013, 1013, 7479, 1012, 1059, 2509, 1012, 8917, 1013, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package railo.runtime.sql; public class SQLParserException extends Exception { public SQLParserException(String message) { super(message); } }
JordanReiter/railo
railo-java/railo-core/src/railo/runtime/sql/SQLParserException.java
Java
lgpl-2.1
150
[ 30522, 7427, 4334, 2080, 1012, 2448, 7292, 1012, 29296, 1025, 2270, 2465, 29296, 19362, 8043, 10288, 24422, 8908, 6453, 1063, 2270, 29296, 19362, 8043, 10288, 24422, 1006, 5164, 4471, 1007, 1063, 3565, 1006, 4471, 1007, 1025, 1065, 1065, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php class SatellitePlugin { var $plugin_name; var $plugin_base; var $pre = 'Satellite'; var $debugging = false; var $menus = array(); var $latestorbit = 'jquery.orbit-1.3.1.js'; //var $latestorbit = 'orbit-min.js'; var $cssfile = 'orbit-css.php'; var $cssadmin = 'admin-styles.css'; var $sections = array( 'satellite' => 'satellite-slides', 'settings' => 'satellite', 'newgallery' => 'satellite-galleries', ); var $helpers = array('Ajax', 'Config', 'Db', 'Html', 'Form', 'Metabox', 'Version'); var $models = array('Slide','Gallery'); function register_plugin($name, $base) { $this->plugin_base = rtrim(dirname($base), DS); $this->initialize_classes(); $this->initialize_options(); if (function_exists('load_plugin_textdomain')) { $currentlocale = get_locale(); if (!empty($currentlocale)) { $moFile = dirname(__FILE__) . DS . "languages" . DS . SATL_PLUGIN_NAME . "-" . $currentlocale . ".mo"; if (@file_exists($moFile) && is_readable($moFile)) { load_textdomain(SATL_PLUGIN_NAME, $moFile); } } } if ($this->debugging == true) { global $wpdb; $wpdb->show_errors(); error_reporting(E_ALL); @ini_set('display_errors', 1); } $this->add_action('wp_head', 'enqueue_scripts', 1); $this->add_action('admin_head', 'add_admin_styles'); $this->add_action("admin_head", 'plupload_admin_head'); $this->add_action('admin_init', 'admin_scripts'); $this->add_filter('the_posts', 'conditionally_add_scripts_and_styles'); // the_posts gets triggered before wp_head $this->add_action('wp_ajax_plupload_action', "g_plupload_action"); return true; } function add_admin_styles() { $adminStyleUrl = SATL_PLUGIN_URL . '/css/' . $this -> cssadmin . '?v=' . SATL_VERSION; wp_register_style(SATL_PLUGIN_NAME . "_adstyle", $adminStyleUrl); wp_enqueue_style(SATL_PLUGIN_NAME . "_adstyle"); } function conditionally_add_scripts_and_styles($posts){ if (empty($posts)) return $posts; $shortcode_found = false; // use this flag to see if styles and scripts need to be enqueued if ($this->get_option('shortreq') == 'N') { $shortcode_found = true; } else { foreach ($posts as $post) { if ( ( stripos($post->post_content, '[gpslideshow') !== false ) || ( stripos($post->post_content, '[satellite') !== false) || ( stripos($post->post_content, '[slideshow') !== false && $this->get_option('embedss') == "Y" ) ) { $shortcode_found = true; // bingo! $pID = $post->ID; break; } } } if ($shortcode_found) { $satlStyleFile = SATL_PLUGIN_DIR . '/css/' . $this -> cssfile; $satlStyleUrl = SATL_PLUGIN_URL . '/css/' . $this -> cssfile . '?v=' . SATL_VERSION . '&amp;pID=' . $pID; if ($_SERVER['HTTPS']) { $satlStyleUrl = str_replace("http:", "https:", $satlStyleUrl); } //$infogal = $this; if (file_exists($satlStyleFile)) { if ($styles = $this->get_option('styles')) { foreach ($styles as $skey => $sval) { $satlStyleUrl .= "&amp;" . $skey . "=" . urlencode($sval); } } $width_temp = $this->get_option('width_temp'); $height_temp = $this->get_option('height_temp'); $align_temp = $this->get_option('align_temp'); $nav_temp = $this->get_option('nav_temp'); //print_r($wp_query->current_post); if (is_array($width_temp)) { foreach ($width_temp as $skey => $sval) { if ($skey == $pID) $satlStyleUrl .= "&amp;width_temp=" . urlencode($sval); } } if (is_array($height_temp)) { foreach ($height_temp as $skey => $sval) { if ($skey == $pID) $satlStyleUrl .= "&amp;height_temp=" . urlencode($sval); } } if (is_array($align_temp)) { foreach ($align_temp as $skey => $sval) { if ($skey == $pID) $satlStyleUrl .= "&amp;align=" . urlencode($sval); } } if (is_array($nav_temp)) { foreach ($nav_temp as $skey => $sval) { if ($skey == $pID) $satlStyleUrl .= "&amp;nav=" . urlencode($sval); } } wp_register_style(SATL_PLUGIN_NAME . "_style", $satlStyleUrl); } // enqueue here wp_enqueue_style(SATL_PLUGIN_NAME . "_style"); wp_enqueue_script(SATL_PLUGIN_NAME . "_script", '/' . PLUGINDIR . '/' . SATL_PLUGIN_NAME . '/js/' . $this->latestorbit, array('jquery'), SATL_VERSION); //wp_enqueue_script(SATL_PLUGIN_NAME . "_script"); } return $posts; } function init_class($name = null, $params = array()) { if (!empty($name)) { $name = $this->pre . $name; if (class_exists($name)) { if ($class = new $name($params)) { return $class; } } } $this->init_class('Country'); return false; } function initialize_classes() { if (!empty($this->helpers)) { foreach ($this->helpers as $helper) { $hfile = dirname(__FILE__) . DS . 'helpers' . DS . strtolower($helper) . '.php'; if (file_exists($hfile)) { require_once($hfile); if (empty($this->{$helper}) || !is_object($this->{$helper})) { $classname = $this->pre . $helper . 'Helper'; if (class_exists($classname)) { $this->{$helper} = new $classname; } } } } } if (!empty($this->models)) { foreach ($this->models as $model) { $mfile = dirname(__FILE__) . DS . 'models' . DS . strtolower($model) . '.php'; if (file_exists($mfile)) { require_once($mfile); if (empty($this->{$model}) || !is_object($this->{$model})) { $classname = $this->pre . $model; if (class_exists($classname)) { $this->{$model} = new $classname; } } } } } } function initialize_options() { $styles = array( 'width' => "450", 'height' => "300", 'thumbheight' => "75", 'thumbarea' => "275", 'thumbareamargin' => "30", 'thumbmargin' => "2", 'thumbspacing' => "5", 'thumbactive' => "#FFFFFF", 'thumbopacity' => "70", 'align' => "none", 'border' => "1px solid #CCCCCC", 'background' => "#000000", 'infotitle' => "2", 'infobackground' => "#000000", 'infocolor' => "#FFFFFF", 'playshow' => "A", 'navpush' => "0", 'infomin' => "Y" ); $this->add_option('styles', $styles); //General Settings $this->add_option('fadespeed', 10); $this->add_option('nav_opacity', 30); $this->add_option('navhover', 70); $this->add_option('nolinker', "N"); $this->add_option('nolinkpage', 0); $this->add_option('pagelink', "S"); $this->add_option('wpattach', "N"); $this->add_option('captionlink', "N"); $this->add_option('transition', "FB"); $this->add_option('information', "Y"); $this->add_option('infospeed', 10); $this->add_option('showhover', "P"); $this->add_option('thumbnails', "N"); $this->add_option('thumbposition', "bottom"); $this->add_option('thumbscrollspeed', 5); $this->add_option('autoslide', "Y"); $this->add_option('autoslide_temp', "Y"); $this->add_option('imagesbox', "T"); $this->add_option('autospeed', 10); $this->add_option('abscenter', "Y"); $this->add_option('embedss', "Y"); $this->add_option('satwiz', "Y"); $this->add_option('shortreq', "Y"); $this->add_option('ggljquery', "Y"); $this->add_option('splash', "N"); $this->add_option('stldb_version', "1.0"); // Orbit Only $this->add_option('autospeed2', 5000); $this->add_option('duration', 700); $this->add_option('othumbs', "B"); $this->add_option('bullcenter', "true"); //Multi-ImageSlide $this->add_option('multicols', 3); $this->add_option('dropshadow', 'N'); //Full Right / Left $this->add_option('thumbarea', 250); //Premium $this->add_option('custslide', 10); $this->add_option('preload', 'N'); $this->add_option('keyboard', 'N'); $this->add_option('manager', 'manage_options'); $this->add_option('nav', "on"); //$this->add_option('orbitinfo', 'Y'); //$this->add_option('orbitinfo_temp', 'Y'); } function render_msg($message = '') { $this->render('msg-top', array('message' => $message), true, 'admin'); } function render_err($message = '') { $this->render('err-top', array('message' => $message), true, 'admin'); } function redirect($location = '', $msgtype = '', $message = '') { $url = $location; if ($msgtype == "message") { $url .= '&' . $this->pre . 'updated=true'; } elseif ($msgtype == "error") { $url .= '&' . $this->pre . 'error=true'; } if (!empty($message)) { $url .= '&' . $this->pre . 'message=' . urlencode($message); } ?> <script type="text/javascript"> window.location = '<?php echo (empty($url)) ? get_option('home') : $url; ?>'; </script> <?php flush(); } function paginate($model = null, $fields = '*', $sub = null, $conditions = null, $searchterm = null, $per_page = 10, $order = array('modified', "DESC")) { global $wpdb; if (!empty($model)) { global $paginate; $paginate = $this->vendor('Paginate'); $paginate->table = $this->{$model}->table; $paginate->sub = (empty($sub)) ? $this->{$model}->controller : $sub; $paginate->fields = (empty($fields)) ? '*' : $fields; $paginate->where = (empty($conditions)) ? false : $conditions; $paginate->searchterm = (empty($searchterm)) ? false : $searchterm; $paginate->per_page = $per_page; $paginate->order = $order; $data = $paginate->start_paging($_GET[$this->pre . 'page']); if (!empty($data)) { $newdata = array(); foreach ($data as $record) { $newdata[] = $this->init_class($model, $record); } $data = array(); $data[$model] = $newdata; $data['Paginate'] = $paginate; } return $data; } return false; } function vendor($name = '', $folder = '') { if (!empty($name)) { $filename = 'class.' . strtolower($name) . '.php'; $filepath = rtrim(dirname(__FILE__), DS) . DS . 'vendors' . DS . $folder . ''; $filefull = $filepath . $filename; if (file_exists($filefull)) { require_once($filefull); $class = 'Satellite' . $name; if (${$name} = new $class) { return ${$name}; } } } return false; } function check_uploaddir() { if (!file_exists(SATL_UPLOAD_DIR)) { if (@mkdir(SATL_UPLOAD_DIR, 0777)) { @chmod(SATL_UPLOAD_DIR, 0755); return true; } else { $message = __('Uploads folder named "' . SATL_PLUGIN_NAME . '" cannot be created inside "' . SATL_UPLOAD_DIR, SATL_PLUGIN_NAME); $this->render_msg($message); } } return false; } function check_sgprodir() { $sgprodir = SATL_UPLOAD_DIR.'/../slideshow-gallery-pro/'; if (file_exists($sgprodir) && $this->is_empty_folder(SATL_UPLOAD_DIR)) { if ($this->is_empty_folder($sgprodir)) { return false; } $message = __('Transitioning from <strong>Slideshow Gallery Pro</strong>? <a href="admin.php?page=satellite-slides&method=copysgpro">Copy Files</a> from your previous custom galleries', SATL_PLUGIN_NAME); $this->render_msg($message); } return false; } function is_empty_folder($folder){ $c=0; if(is_dir($folder) ){ $files = opendir($folder); while ($file=readdir($files)){$c++;} if ($c>2){ return false; }else{ return true; } } } function add_action($action, $function = null, $priority = 10, $params = 1) { if (add_action($action, array($this, (empty($function)) ? $action : $function), $priority, $params)) { return true; } return false; } function add_filter($filter, $function = null, $priority = 10, $params = 1) { if (add_filter($filter, array($this, (empty($function)) ? $filter : $function), $priority, $params)) { return true; } return false; } function admin_scripts() { if (!empty($_GET['page']) && in_array($_GET['page'], (array) $this->sections)) { wp_enqueue_script('autosave'); if ($_GET['page'] == 'satellite') { wp_enqueue_script('common'); wp_enqueue_script('wp-lists'); wp_enqueue_script('postbox'); wp_enqueue_script('settings-editor', '/' . PLUGINDIR . '/' . SATL_PLUGIN_NAME . '/js/settings-editor.js', array('jquery'), SATL_VERSION); wp_enqueue_script('admin', '/' . PLUGINDIR . '/' . SATL_PLUGIN_NAME . '/js/admin.js', array('jquery'), SATL_VERSION); } if ($_GET['page'] == "satellite-slides" && $_GET['method'] == "order") { wp_enqueue_script('jquery-ui-sortable'); } if ($_GET['page'] == "satellite-galleries") { wp_enqueue_script('plupload-all'); wp_enqueue_script('jquery-ui-sortable'); wp_enqueue_script('admin', '/' . PLUGINDIR . '/' . SATL_PLUGIN_NAME . '/js/admin.js', array('jquery'), SATL_VERSION); } wp_enqueue_scripts(); //wp_enqueue_script('jquery-ui-sortable'); add_thickbox(); } } function enqueue_scripts() { if ($this->get_option('ggljquery') == "Y") { wp_deregister_script( 'jquery' ); wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'); } wp_enqueue_script('jquery'); if (SATL_PRO && ($this->get_option('preload') == 'Y')) { wp_register_script('satellite_preloader', '/' . PLUGINDIR . '/' . SATL_PLUGIN_NAME . '/pro/preloader.js'); wp_enqueue_script('satellite_preloader'); } if ($this->get_option('imagesbox') == "T") add_thickbox(); return true; } function plupload_admin_head() { //Thank you Krishna!! http://www.krishnakantsharma.com/ // place js config array for plupload $plupload_init = array( 'runtimes' => 'html5,silverlight,flash,html4', 'browse_button' => 'plupload-browse-button', // will be adjusted per uploader 'container' => 'plupload-upload-ui', // will be adjusted per uploader 'drop_element' => 'drag-drop-area', // will be adjusted per uploader 'file_data_name' => 'async-upload', // will be adjusted per uploader 'multiple_queues' => true, 'max_file_size' => wp_max_upload_size() . 'b', 'url' => admin_url('admin-ajax.php'), 'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'), 'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'), 'filters' => array(array('title' => __('Allowed Files'), 'extensions' => '*')), 'multipart' => true, 'urlstream_upload' => true, 'multi_selection' => false, // will be added per uploader // additional post data to send to our ajax hook 'multipart_params' => array( '_ajax_nonce' => "", // will be added per uploader 'action' => 'plupload_action', // the ajax action name 'imgid' => 0 // will be added per uploader ) ); ?> <script type="text/javascript"> var base_plupload_config=<?php echo json_encode($plupload_init); ?>; </script> <?php } function g_plupload_action() { // check ajax noonce $imgid = $_POST["imgid"]; check_ajax_referer($imgid . 'pluploadan'); // handle file upload $status = wp_handle_upload($_FILES[$imgid . 'async-upload'], array('test_form' => true, 'action' => 'plupload_action')); // send the uploaded file url in response echo $status['url']; exit; } function plugin_base() { return rtrim(dirname(__FILE__), '/'); } function url() { return rtrim(WP_PLUGIN_URL, '/') . '/' . substr(preg_replace("/\\" . DS . "/si", "/", $this->plugin_base()), strlen(ABSPATH)); } function add_option($name = '', $value = '') { if (add_option($this->pre . $name, $value)) { return true; } return false; } function update_option($name = '', $value = '') { if (update_option($this->pre . $name, $value)) { return true; } return false; } function get_option($name = '', $stripslashes = true) { if ($option = get_option($this->pre . $name)) { if (@unserialize($option) !== false) { return unserialize($option); } if ($stripslashes == true) { $option = stripslashes_deep($option); } return $option; } return false; } function debug($var = array()) { if ($this->debugging) { echo '<pre>' . print_r($var, true) . '</pre>'; return true; } return false; } function check_table( $model = null ) { global $wpdb; if ( !empty($model) ) { if ( !empty($this->fields) && is_array($this->fields ) ) { if ( /* !$wpdb->get_var("SHOW TABLES LIKE '" . $this->table . "'") ||*/ $this->get_option($model.'db_version') != SATL_VERSION ) { $query = "CREATE TABLE " . $this->table . " (\n"; $c = 1; foreach ( $this->fields as $field => $attributes ) { if ( $field != "key" ) { $query .= "`" . $field . "` " . $attributes . ""; //$query .= "`".$field . "` " . $attributes ; } else { $query .= "" . $attributes . ""; } if ($c < count($this->fields)) { $query .= ",\n"; } $c++; } $query .= ");"; if (!empty($query)) { $this->table_query[] = $query; } if (SATL_PRO) { if ( class_exists( 'SatellitePremium' ) ) { $satlprem = new SatellitePremium; $satlprem->check_pro_dirs(); } } if (!empty($this->table_query)) { require_once(ABSPATH . 'wp-admin'.DS.'includes'.DS.'upgrade.php'); dbDelta($this->table_query, true); $this -> update_option($model.'db_version', SATL_VERSION); $this -> update_option('stldb_version', SATL_VERSION); error_log("Updated slideshow satellite databases"); } } else { //echo "this model db version: ".$this->get_option($model.'db_version'); $field_array = $this->get_fields($this->table); foreach ($this->fields as $field => $attributes) { if ($field != "key") { $this->add_field($this->table, $field, $attributes); } } } } } return false; } function get_fields($table = null) { global $wpdb; if (!empty($table)) { $fullname = $table; if (($tablefields = mysql_list_fields(DB_NAME, $fullname, $wpdb->dbh)) !== false) { $columns = mysql_num_fields($tablefields); $field_array = array(); for ($i = 0; $i < $columns; $i++) { $fieldname = mysql_field_name($tablefields, $i); $field_array[] = $fieldname; } return $field_array; } } return false; } function delete_field($table = '', $field = '') { global $wpdb; if (!empty($table)) { if (!empty($field)) { $query = "ALTER TABLE `" . $wpdb->prefix . "" . $table . "` DROP `" . $field . "`"; if ($wpdb->query($query)) { return false; } } } return false; } function change_field($table = '', $field = '', $newfield = '', $attributes = "TEXT NOT NULL") { global $wpdb; if (!empty($table)) { if (!empty($field)) { if (!empty($newfield)) { $field_array = $this->get_fields($table); if (!in_array($field, $field_array)) { if ($this->add_field($table, $newfield)) { return true; } } else { $query = "ALTER TABLE `" . $table . "` CHANGE `" . $field . "` `" . $newfield . "` " . $attributes . ";"; if ($wpdb->query($query)) { return true; } } } } } return false; } function add_field($table = '', $field = '', $attributes = "TEXT NOT NULL") { global $wpdb; if (!empty($table)) { if (!empty($field)) { $field_array = $this->get_fields($table); if (!empty($field_array)) { if (!in_array($field, $field_array)) { $query = "ALTER TABLE `" . $table . "` ADD `" . $field . "` " . $attributes . ";"; if ($wpdb->query($query)) { return true; } } } } } return false; } function render($file = '', $params = array(), $output = true, $folder = 'admin') { if (!empty($file)) { $filename = $file . '.php'; $filepath = $this->plugin_base() . DS . 'views' . DS . $folder . DS; $filefull = $filepath . $filename; if (file_exists($filefull)) { if (!empty($params)) { foreach ($params as $pkey => $pval) { ${$pkey} = $pval; } } if ($output == false) { ob_start(); } include($filefull); if ($output == false) { $data = ob_get_clean(); return $data; } else { flush(); return true; } } } return false; } /** * Add Settings link to plugins - code from GD Star Ratings */ function add_satl_settings_link($links, $file) { static $this_plugin; if (!$this_plugin) $this_plugin = plugin_basename(__FILE__); if ($file == $this_plugin) { $settings_link = '<a href="admin.php?page=satellite">' . __("Settings", SATL_PLUGIN_NAME) . '</a>'; array_unshift($links, $settings_link); } return $links; } } ?>
diegorojas/encontros.maracatu.org.br
wp-content/plugins/slideshow-satellite/slideshow-satellite-plugin.php
PHP
gpl-2.0
26,130
[ 30522, 1026, 1029, 25718, 2465, 5871, 24759, 15916, 2378, 1063, 13075, 1002, 13354, 2378, 1035, 2171, 1025, 13075, 1002, 13354, 2378, 1035, 2918, 1025, 13075, 1002, 3653, 1027, 1005, 5871, 1005, 1025, 13075, 1002, 2139, 8569, 12588, 1027, 6...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#!/bin/sh bosh create-env \ "${BBL_STATE_DIR}/bosh-deployment/bosh.yml" \ --state "${BBL_STATE_DIR}/vars/bosh-state.json" \ --vars-store "${BBL_STATE_DIR}/vars/director-vars-store.yml" \ --vars-file "${BBL_STATE_DIR}/vars/director-vars-file.yml" \ -o "${BBL_STATE_DIR}/bosh-deployment/gcp/cpi.yml" \ -o "${BBL_STATE_DIR}/bosh-deployment/jumpbox-user.yml" \ -o "${BBL_STATE_DIR}/bosh-deployment/uaa.yml" \ -o "${BBL_STATE_DIR}/bosh-deployment/credhub.yml" \ -o ./large-director.yml \ -o "${BBL_STATE_DIR}/bbl-ops-files/gcp/bosh-director-ephemeral-ip-ops.yml" \ --var-file gcp_credentials_json="${BBL_GCP_SERVICE_ACCOUNT_KEY_PATH}" \ -v project_id="${BBL_GCP_PROJECT_ID}" \ -v zone="${BBL_GCP_ZONE}"
cloudfoundry/buildpacks-ci
deployments/patches/create-director-override.sh
Shell
apache-2.0
736
[ 30522, 1001, 999, 1013, 8026, 1013, 14021, 8945, 4095, 3443, 1011, 4372, 2615, 1032, 1000, 1002, 1063, 22861, 2140, 1035, 2110, 1035, 16101, 1065, 1013, 8945, 4095, 1011, 10813, 1013, 8945, 4095, 1012, 1061, 19968, 1000, 1032, 1011, 1011, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#include <math.h> #include <stdio.h> #include <pthread.h> #include <stdlib.h> #define THREAD_COUNT 4 typedef struct { int start; int end; } range_t; void *calculate_range(void* range) { range_t* curr_range = (range_t*)range; void* result = (void*)1; for (int i = curr_range->start; i < curr_range->end; i++) { double a = cos(i) * cos(i) + sin(i) * sin(i); if (a > 1.0005 || a < 0.9995) { result = (void*)0; } } free(curr_range); return result; } int main() { pthread_t threads[THREAD_COUNT]; int arg_start = 0; for (int i = 0; i < THREAD_COUNT; i++) { range_t *curr_range = (range_t*)malloc(sizeof(range_t)); curr_range->start = arg_start; curr_range->end = arg_start + 25000000; int res = pthread_create(&threads[i], NULL, calculate_range, curr_range); if (res != 0) { perror("Could not spawn new thread"); exit(-1); } arg_start = curr_range->end; } long final_result = 1; for (int i = 0; i < THREAD_COUNT; i++) { void *thread_result; int res = pthread_join(threads[i], (void **)&thread_result); if (res != 0) { perror("Could not spawn thread"); exit(-1); } final_result <<= (long)thread_result; } if (final_result & (1 << 4)) { printf("OK!\n"); } else { printf("Not OK!\n"); } return 0; }
arnaudoff/elsys
2015-2016/operating-systems/threads_homework/main.c
C
mit
1,476
[ 30522, 1001, 2421, 1026, 8785, 1012, 1044, 1028, 1001, 2421, 1026, 2358, 20617, 1012, 1044, 1028, 1001, 2421, 1026, 13866, 28362, 4215, 1012, 1044, 1028, 1001, 2421, 1026, 2358, 19422, 12322, 1012, 1044, 1028, 1001, 9375, 11689, 1035, 4175,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* Blackfin Ethernet Media Access Controller (EMAC) model. Copyright (C) 2010-2012 Free Software Foundation, Inc. Contributed by Analog Devices, Inc. This file is part of simulators. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef DV_BFIN_EMAC_H #define DV_BFIN_EMAC_H /* EMAC_OPMODE Masks */ #define RE (1 << 0) #define ASTP (1 << 1) #define PR (1 << 7) #define TE (1 << 16) /* EMAC_STAADD Masks */ #define STABUSY (1 << 0) #define STAOP (1 << 1) #define STADISPRE (1 << 2) #define STAIE (1 << 3) #define REGAD_SHIFT 6 #define REGAD_MASK (0x1f << REGAD_SHIFT) #define REGAD(val) (((val) & REGAD_MASK) >> REGAD_SHIFT) #define PHYAD_SHIFT 11 #define PHYAD_MASK (0x1f << PHYAD_SHIFT) #define PHYAD(val) (((val) & PHYAD_MASK) >> PHYAD_SHIFT) /* EMAC_SYSCTL Masks */ #define PHYIE (1 << 0) #define RXDWA (1 << 1) #define RXCKS (1 << 2) #define TXDWA (1 << 4) /* EMAC_RX_STAT Masks */ #define RX_FRLEN 0x7ff #define RX_COMP (1 << 12) #define RX_OK (1 << 13) #define RX_ACCEPT (1 << 31) /* EMAC_TX_STAT Masks */ #define TX_COMP (1 << 0) #define TX_OK (1 << 1) #endif
ILyoan/gdb
sim/bfin/dv-bfin_emac.h
C
gpl-2.0
1,701
[ 30522, 1013, 1008, 2304, 16294, 26110, 2865, 3229, 11486, 1006, 7861, 6305, 1007, 2944, 1012, 9385, 1006, 1039, 1007, 2230, 1011, 2262, 2489, 4007, 3192, 1010, 4297, 1012, 5201, 2011, 11698, 5733, 1010, 4297, 1012, 2023, 5371, 2003, 2112, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * Copyright (c) 2010-2011 Atheros Communications Inc. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include "htc.h" MODULE_AUTHOR("Atheros Communications"); MODULE_LICENSE("Dual BSD/GPL"); MODULE_DESCRIPTION("Atheros driver 802.11n HTC based wireless devices"); static unsigned int ath9k_debug = ATH_DBG_DEFAULT; module_param_named(debug, ath9k_debug, uint, 0); MODULE_PARM_DESC(debug, "Debugging mask"); int htc_modparam_nohwcrypt; module_param_named(nohwcrypt, htc_modparam_nohwcrypt, int, 0444); MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption"); static int ath9k_htc_btcoex_enable; module_param_named(btcoex_enable, ath9k_htc_btcoex_enable, int, 0444); MODULE_PARM_DESC(btcoex_enable, "Enable wifi-BT coexistence"); #define CHAN2G(_freq, _idx) { \ .center_freq = (_freq), \ .hw_value = (_idx), \ .max_power = 20, \ } #define CHAN5G(_freq, _idx) { \ .band = IEEE80211_BAND_5GHZ, \ .center_freq = (_freq), \ .hw_value = (_idx), \ .max_power = 20, \ } static struct ieee80211_channel ath9k_2ghz_channels[] = { CHAN2G(2412, 0), /* Channel 1 */ CHAN2G(2417, 1), /* Channel 2 */ CHAN2G(2422, 2), /* Channel 3 */ CHAN2G(2427, 3), /* Channel 4 */ CHAN2G(2432, 4), /* Channel 5 */ CHAN2G(2437, 5), /* Channel 6 */ CHAN2G(2442, 6), /* Channel 7 */ CHAN2G(2447, 7), /* Channel 8 */ CHAN2G(2452, 8), /* Channel 9 */ CHAN2G(2457, 9), /* Channel 10 */ CHAN2G(2462, 10), /* Channel 11 */ CHAN2G(2467, 11), /* Channel 12 */ CHAN2G(2472, 12), /* Channel 13 */ CHAN2G(2484, 13), /* Channel 14 */ }; static struct ieee80211_channel ath9k_5ghz_channels[] = { /* _We_ call this UNII 1 */ CHAN5G(5180, 14), /* Channel 36 */ CHAN5G(5200, 15), /* Channel 40 */ CHAN5G(5220, 16), /* Channel 44 */ CHAN5G(5240, 17), /* Channel 48 */ /* _We_ call this UNII 2 */ CHAN5G(5260, 18), /* Channel 52 */ CHAN5G(5280, 19), /* Channel 56 */ CHAN5G(5300, 20), /* Channel 60 */ CHAN5G(5320, 21), /* Channel 64 */ /* _We_ call this "Middle band" */ CHAN5G(5500, 22), /* Channel 100 */ CHAN5G(5520, 23), /* Channel 104 */ CHAN5G(5540, 24), /* Channel 108 */ CHAN5G(5560, 25), /* Channel 112 */ CHAN5G(5580, 26), /* Channel 116 */ CHAN5G(5600, 27), /* Channel 120 */ CHAN5G(5620, 28), /* Channel 124 */ CHAN5G(5640, 29), /* Channel 128 */ CHAN5G(5660, 30), /* Channel 132 */ CHAN5G(5680, 31), /* Channel 136 */ CHAN5G(5700, 32), /* Channel 140 */ /* _We_ call this UNII 3 */ CHAN5G(5745, 33), /* Channel 149 */ CHAN5G(5765, 34), /* Channel 153 */ CHAN5G(5785, 35), /* Channel 157 */ CHAN5G(5805, 36), /* Channel 161 */ CHAN5G(5825, 37), /* Channel 165 */ }; /* Atheros hardware rate code addition for short premble */ #define SHPCHECK(__hw_rate, __flags) \ ((__flags & IEEE80211_RATE_SHORT_PREAMBLE) ? (__hw_rate | 0x04) : 0) #define RATE(_bitrate, _hw_rate, _flags) { \ .bitrate = (_bitrate), \ .flags = (_flags), \ .hw_value = (_hw_rate), \ .hw_value_short = (SHPCHECK(_hw_rate, _flags)) \ } static struct ieee80211_rate ath9k_legacy_rates[] = { RATE(10, 0x1b, 0), RATE(20, 0x1a, IEEE80211_RATE_SHORT_PREAMBLE), /* shortp : 0x1e */ RATE(55, 0x19, IEEE80211_RATE_SHORT_PREAMBLE), /* shortp: 0x1d */ RATE(110, 0x18, IEEE80211_RATE_SHORT_PREAMBLE), /* short: 0x1c */ RATE(60, 0x0b, 0), RATE(90, 0x0f, 0), RATE(120, 0x0a, 0), RATE(180, 0x0e, 0), RATE(240, 0x09, 0), RATE(360, 0x0d, 0), RATE(480, 0x08, 0), RATE(540, 0x0c, 0), }; #ifdef CONFIG_MAC80211_LEDS static const struct ieee80211_tpt_blink ath9k_htc_tpt_blink[] = { { .throughput = 0 * 1024, .blink_time = 334 }, { .throughput = 1 * 1024, .blink_time = 260 }, { .throughput = 5 * 1024, .blink_time = 220 }, { .throughput = 10 * 1024, .blink_time = 190 }, { .throughput = 20 * 1024, .blink_time = 170 }, { .throughput = 50 * 1024, .blink_time = 150 }, { .throughput = 70 * 1024, .blink_time = 130 }, { .throughput = 100 * 1024, .blink_time = 110 }, { .throughput = 200 * 1024, .blink_time = 80 }, { .throughput = 300 * 1024, .blink_time = 50 }, }; #endif static int ath9k_htc_wait_for_target(struct ath9k_htc_priv *priv) { int time_left; if (atomic_read(&priv->htc->tgt_ready) > 0) { atomic_dec(&priv->htc->tgt_ready); return 0; } /* Firmware can take up to 50ms to get ready, to be safe use 1 second */ time_left = wait_for_completion_timeout(&priv->htc->target_wait, HZ); if (!time_left) { dev_err(priv->dev, "ath9k_htc: Target is unresponsive\n"); return -ETIMEDOUT; } atomic_dec(&priv->htc->tgt_ready); return 0; } static void ath9k_deinit_priv(struct ath9k_htc_priv *priv) { ath9k_hw_deinit(priv->ah); kfree(priv->ah); priv->ah = NULL; } static void ath9k_deinit_device(struct ath9k_htc_priv *priv) { struct ieee80211_hw *hw = priv->hw; wiphy_rfkill_stop_polling(hw->wiphy); ath9k_deinit_leds(priv); ieee80211_unregister_hw(hw); ath9k_rx_cleanup(priv); ath9k_tx_cleanup(priv); ath9k_deinit_priv(priv); } static inline int ath9k_htc_connect_svc(struct ath9k_htc_priv *priv, u16 service_id, void (*tx) (void *, struct sk_buff *, enum htc_endpoint_id, bool txok), enum htc_endpoint_id *ep_id) { struct htc_service_connreq req; memset(&req, 0, sizeof(struct htc_service_connreq)); req.service_id = service_id; req.ep_callbacks.priv = priv; req.ep_callbacks.rx = ath9k_htc_rxep; req.ep_callbacks.tx = tx; return htc_connect_service(priv->htc, &req, ep_id); } static int ath9k_init_htc_services(struct ath9k_htc_priv *priv, u16 devid, u32 drv_info) { int ret; /* WMI CMD*/ ret = ath9k_wmi_connect(priv->htc, priv->wmi, &priv->wmi_cmd_ep); if (ret) goto err; /* Beacon */ ret = ath9k_htc_connect_svc(priv, WMI_BEACON_SVC, ath9k_htc_beaconep, &priv->beacon_ep); if (ret) goto err; /* CAB */ ret = ath9k_htc_connect_svc(priv, WMI_CAB_SVC, ath9k_htc_txep, &priv->cab_ep); if (ret) goto err; /* UAPSD */ ret = ath9k_htc_connect_svc(priv, WMI_UAPSD_SVC, ath9k_htc_txep, &priv->uapsd_ep); if (ret) goto err; /* MGMT */ ret = ath9k_htc_connect_svc(priv, WMI_MGMT_SVC, ath9k_htc_txep, &priv->mgmt_ep); if (ret) goto err; /* DATA BE */ ret = ath9k_htc_connect_svc(priv, WMI_DATA_BE_SVC, ath9k_htc_txep, &priv->data_be_ep); if (ret) goto err; /* DATA BK */ ret = ath9k_htc_connect_svc(priv, WMI_DATA_BK_SVC, ath9k_htc_txep, &priv->data_bk_ep); if (ret) goto err; /* DATA VI */ ret = ath9k_htc_connect_svc(priv, WMI_DATA_VI_SVC, ath9k_htc_txep, &priv->data_vi_ep); if (ret) goto err; /* DATA VO */ ret = ath9k_htc_connect_svc(priv, WMI_DATA_VO_SVC, ath9k_htc_txep, &priv->data_vo_ep); if (ret) goto err; /* * Setup required credits before initializing HTC. * This is a bit hacky, but, since queuing is done in * the HIF layer, shouldn't matter much. */ if (IS_AR7010_DEVICE(drv_info)) priv->htc->credits = 45; else priv->htc->credits = 33; ret = htc_init(priv->htc); if (ret) goto err; dev_info(priv->dev, "ath9k_htc: HTC initialized with %d credits\n", priv->htc->credits); return 0; err: dev_err(priv->dev, "ath9k_htc: Unable to initialize HTC services\n"); return ret; } static void ath9k_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request) { struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy); struct ath9k_htc_priv *priv = hw->priv; ath_reg_notifier_apply(wiphy, request, ath9k_hw_regulatory(priv->ah)); } static unsigned int ath9k_regread(void *hw_priv, u32 reg_offset) { struct ath_hw *ah = (struct ath_hw *) hw_priv; struct ath_common *common = ath9k_hw_common(ah); struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv; __be32 val, reg = cpu_to_be32(reg_offset); int r; r = ath9k_wmi_cmd(priv->wmi, WMI_REG_READ_CMDID, (u8 *) &reg, sizeof(reg), (u8 *) &val, sizeof(val), 100); if (unlikely(r)) { ath_dbg(common, WMI, "REGISTER READ FAILED: (0x%04x, %d)\n", reg_offset, r); return -EIO; } return be32_to_cpu(val); } static void ath9k_multi_regread(void *hw_priv, u32 *addr, u32 *val, u16 count) { struct ath_hw *ah = (struct ath_hw *) hw_priv; struct ath_common *common = ath9k_hw_common(ah); struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv; __be32 tmpaddr[8]; __be32 tmpval[8]; int i, ret; for (i = 0; i < count; i++) { tmpaddr[i] = cpu_to_be32(addr[i]); } ret = ath9k_wmi_cmd(priv->wmi, WMI_REG_READ_CMDID, (u8 *)tmpaddr , sizeof(u32) * count, (u8 *)tmpval, sizeof(u32) * count, 100); if (unlikely(ret)) { ath_dbg(common, WMI, "Multiple REGISTER READ FAILED (count: %d)\n", count); } for (i = 0; i < count; i++) { val[i] = be32_to_cpu(tmpval[i]); } } static void ath9k_regwrite_single(void *hw_priv, u32 val, u32 reg_offset) { struct ath_hw *ah = (struct ath_hw *) hw_priv; struct ath_common *common = ath9k_hw_common(ah); struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv; const __be32 buf[2] = { cpu_to_be32(reg_offset), cpu_to_be32(val), }; int r; r = ath9k_wmi_cmd(priv->wmi, WMI_REG_WRITE_CMDID, (u8 *) &buf, sizeof(buf), (u8 *) &val, sizeof(val), 100); if (unlikely(r)) { ath_dbg(common, WMI, "REGISTER WRITE FAILED:(0x%04x, %d)\n", reg_offset, r); } } static void ath9k_regwrite_buffer(void *hw_priv, u32 val, u32 reg_offset) { struct ath_hw *ah = (struct ath_hw *) hw_priv; struct ath_common *common = ath9k_hw_common(ah); struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv; u32 rsp_status; int r; mutex_lock(&priv->wmi->multi_write_mutex); /* Store the register/value */ priv->wmi->multi_write[priv->wmi->multi_write_idx].reg = cpu_to_be32(reg_offset); priv->wmi->multi_write[priv->wmi->multi_write_idx].val = cpu_to_be32(val); priv->wmi->multi_write_idx++; /* If the buffer is full, send it out. */ if (priv->wmi->multi_write_idx == MAX_CMD_NUMBER) { r = ath9k_wmi_cmd(priv->wmi, WMI_REG_WRITE_CMDID, (u8 *) &priv->wmi->multi_write, sizeof(struct register_write) * priv->wmi->multi_write_idx, (u8 *) &rsp_status, sizeof(rsp_status), 100); if (unlikely(r)) { ath_dbg(common, WMI, "REGISTER WRITE FAILED, multi len: %d\n", priv->wmi->multi_write_idx); } priv->wmi->multi_write_idx = 0; } mutex_unlock(&priv->wmi->multi_write_mutex); } static void ath9k_regwrite(void *hw_priv, u32 val, u32 reg_offset) { struct ath_hw *ah = (struct ath_hw *) hw_priv; struct ath_common *common = ath9k_hw_common(ah); struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv; if (atomic_read(&priv->wmi->mwrite_cnt)) ath9k_regwrite_buffer(hw_priv, val, reg_offset); else ath9k_regwrite_single(hw_priv, val, reg_offset); } static void ath9k_enable_regwrite_buffer(void *hw_priv) { struct ath_hw *ah = (struct ath_hw *) hw_priv; struct ath_common *common = ath9k_hw_common(ah); struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv; atomic_inc(&priv->wmi->mwrite_cnt); } static void ath9k_regwrite_flush(void *hw_priv) { struct ath_hw *ah = (struct ath_hw *) hw_priv; struct ath_common *common = ath9k_hw_common(ah); struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv; u32 rsp_status; int r; atomic_dec(&priv->wmi->mwrite_cnt); mutex_lock(&priv->wmi->multi_write_mutex); if (priv->wmi->multi_write_idx) { r = ath9k_wmi_cmd(priv->wmi, WMI_REG_WRITE_CMDID, (u8 *) &priv->wmi->multi_write, sizeof(struct register_write) * priv->wmi->multi_write_idx, (u8 *) &rsp_status, sizeof(rsp_status), 100); if (unlikely(r)) { ath_dbg(common, WMI, "REGISTER WRITE FAILED, multi len: %d\n", priv->wmi->multi_write_idx); } priv->wmi->multi_write_idx = 0; } mutex_unlock(&priv->wmi->multi_write_mutex); } static u32 ath9k_reg_rmw(void *hw_priv, u32 reg_offset, u32 set, u32 clr) { u32 val; val = ath9k_regread(hw_priv, reg_offset); val &= ~clr; val |= set; ath9k_regwrite(hw_priv, val, reg_offset); return val; } static void ath_usb_read_cachesize(struct ath_common *common, int *csz) { *csz = L1_CACHE_BYTES >> 2; } static bool ath_usb_eeprom_read(struct ath_common *common, u32 off, u16 *data) { struct ath_hw *ah = (struct ath_hw *) common->ah; (void)REG_READ(ah, AR5416_EEPROM_OFFSET + (off << AR5416_EEPROM_S)); if (!ath9k_hw_wait(ah, AR_EEPROM_STATUS_DATA, AR_EEPROM_STATUS_DATA_BUSY | AR_EEPROM_STATUS_DATA_PROT_ACCESS, 0, AH_WAIT_TIMEOUT)) return false; *data = MS(REG_READ(ah, AR_EEPROM_STATUS_DATA), AR_EEPROM_STATUS_DATA_VAL); return true; } static const struct ath_bus_ops ath9k_usb_bus_ops = { .ath_bus_type = ATH_USB, .read_cachesize = ath_usb_read_cachesize, .eeprom_read = ath_usb_eeprom_read, }; static void setup_ht_cap(struct ath9k_htc_priv *priv, struct ieee80211_sta_ht_cap *ht_info) { struct ath_common *common = ath9k_hw_common(priv->ah); u8 tx_streams, rx_streams; int i; ht_info->ht_supported = true; ht_info->cap = IEEE80211_HT_CAP_SUP_WIDTH_20_40 | IEEE80211_HT_CAP_SM_PS | IEEE80211_HT_CAP_SGI_40 | IEEE80211_HT_CAP_DSSSCCK40; if (priv->ah->caps.hw_caps & ATH9K_HW_CAP_SGI_20) ht_info->cap |= IEEE80211_HT_CAP_SGI_20; ht_info->cap |= (1 << IEEE80211_HT_CAP_RX_STBC_SHIFT); ht_info->ampdu_factor = IEEE80211_HT_MAX_AMPDU_64K; ht_info->ampdu_density = IEEE80211_HT_MPDU_DENSITY_8; memset(&ht_info->mcs, 0, sizeof(ht_info->mcs)); /* ath9k_htc supports only 1 or 2 stream devices */ tx_streams = ath9k_cmn_count_streams(priv->ah->txchainmask, 2); rx_streams = ath9k_cmn_count_streams(priv->ah->rxchainmask, 2); ath_dbg(common, CONFIG, "TX streams %d, RX streams: %d\n", tx_streams, rx_streams); if (tx_streams != rx_streams) { ht_info->mcs.tx_params |= IEEE80211_HT_MCS_TX_RX_DIFF; ht_info->mcs.tx_params |= ((tx_streams - 1) << IEEE80211_HT_MCS_TX_MAX_STREAMS_SHIFT); } for (i = 0; i < rx_streams; i++) ht_info->mcs.rx_mask[i] = 0xff; ht_info->mcs.tx_params |= IEEE80211_HT_MCS_TX_DEFINED; } static int ath9k_init_queues(struct ath9k_htc_priv *priv) { struct ath_common *common = ath9k_hw_common(priv->ah); int i; for (i = 0; i < ARRAY_SIZE(priv->hwq_map); i++) priv->hwq_map[i] = -1; priv->beaconq = ath9k_hw_beaconq_setup(priv->ah); if (priv->beaconq == -1) { ath_err(common, "Unable to setup BEACON xmit queue\n"); goto err; } priv->cabq = ath9k_htc_cabq_setup(priv); if (priv->cabq == -1) { ath_err(common, "Unable to setup CAB xmit queue\n"); goto err; } if (!ath9k_htc_txq_setup(priv, IEEE80211_AC_BE)) { ath_err(common, "Unable to setup xmit queue for BE traffic\n"); goto err; } if (!ath9k_htc_txq_setup(priv, IEEE80211_AC_BK)) { ath_err(common, "Unable to setup xmit queue for BK traffic\n"); goto err; } if (!ath9k_htc_txq_setup(priv, IEEE80211_AC_VI)) { ath_err(common, "Unable to setup xmit queue for VI traffic\n"); goto err; } if (!ath9k_htc_txq_setup(priv, IEEE80211_AC_VO)) { ath_err(common, "Unable to setup xmit queue for VO traffic\n"); goto err; } return 0; err: return -EINVAL; } static void ath9k_init_channels_rates(struct ath9k_htc_priv *priv) { if (priv->ah->caps.hw_caps & ATH9K_HW_CAP_2GHZ) { priv->sbands[IEEE80211_BAND_2GHZ].channels = ath9k_2ghz_channels; priv->sbands[IEEE80211_BAND_2GHZ].band = IEEE80211_BAND_2GHZ; priv->sbands[IEEE80211_BAND_2GHZ].n_channels = ARRAY_SIZE(ath9k_2ghz_channels); priv->sbands[IEEE80211_BAND_2GHZ].bitrates = ath9k_legacy_rates; priv->sbands[IEEE80211_BAND_2GHZ].n_bitrates = ARRAY_SIZE(ath9k_legacy_rates); } if (priv->ah->caps.hw_caps & ATH9K_HW_CAP_5GHZ) { priv->sbands[IEEE80211_BAND_5GHZ].channels = ath9k_5ghz_channels; priv->sbands[IEEE80211_BAND_5GHZ].band = IEEE80211_BAND_5GHZ; priv->sbands[IEEE80211_BAND_5GHZ].n_channels = ARRAY_SIZE(ath9k_5ghz_channels); priv->sbands[IEEE80211_BAND_5GHZ].bitrates = ath9k_legacy_rates + 4; priv->sbands[IEEE80211_BAND_5GHZ].n_bitrates = ARRAY_SIZE(ath9k_legacy_rates) - 4; } } static void ath9k_init_misc(struct ath9k_htc_priv *priv) { struct ath_common *common = ath9k_hw_common(priv->ah); memcpy(common->bssidmask, ath_bcast_mac, ETH_ALEN); priv->ah->opmode = NL80211_IFTYPE_STATION; } static int ath9k_init_priv(struct ath9k_htc_priv *priv, u16 devid, char *product, u32 drv_info) { struct ath_hw *ah = NULL; struct ath_common *common; int i, ret = 0, csz = 0; set_bit(OP_INVALID, &priv->op_flags); ah = kzalloc(sizeof(struct ath_hw), GFP_KERNEL); if (!ah) return -ENOMEM; ah->hw_version.devid = devid; ah->hw_version.usbdev = drv_info; ah->ah_flags |= AH_USE_EEPROM; ah->reg_ops.read = ath9k_regread; ah->reg_ops.multi_read = ath9k_multi_regread; ah->reg_ops.write = ath9k_regwrite; ah->reg_ops.enable_write_buffer = ath9k_enable_regwrite_buffer; ah->reg_ops.write_flush = ath9k_regwrite_flush; ah->reg_ops.rmw = ath9k_reg_rmw; priv->ah = ah; common = ath9k_hw_common(ah); common->ops = &ah->reg_ops; common->bus_ops = &ath9k_usb_bus_ops; common->ah = ah; common->hw = priv->hw; common->priv = priv; common->debug_mask = ath9k_debug; common->btcoex_enabled = ath9k_htc_btcoex_enable == 1; spin_lock_init(&priv->beacon_lock); spin_lock_init(&priv->tx.tx_lock); mutex_init(&priv->mutex); mutex_init(&priv->htc_pm_lock); tasklet_init(&priv->rx_tasklet, ath9k_rx_tasklet, (unsigned long)priv); tasklet_init(&priv->tx_failed_tasklet, ath9k_tx_failed_tasklet, (unsigned long)priv); INIT_DELAYED_WORK(&priv->ani_work, ath9k_htc_ani_work); INIT_WORK(&priv->ps_work, ath9k_ps_work); INIT_WORK(&priv->fatal_work, ath9k_fatal_work); setup_timer(&priv->tx.cleanup_timer, ath9k_htc_tx_cleanup_timer, (unsigned long)priv); /* * Cache line size is used to size and align various * structures used to communicate with the hardware. */ ath_read_cachesize(common, &csz); common->cachelsz = csz << 2; /* convert to bytes */ ret = ath9k_hw_init(ah); if (ret) { ath_err(common, "Unable to initialize hardware; initialization status: %d\n", ret); goto err_hw; } ret = ath9k_init_queues(priv); if (ret) goto err_queues; for (i = 0; i < ATH9K_HTC_MAX_BCN_VIF; i++) priv->cur_beacon_conf.bslot[i] = NULL; ath9k_cmn_init_crypto(ah); ath9k_init_channels_rates(priv); ath9k_init_misc(priv); ath9k_htc_init_btcoex(priv, product); return 0; err_queues: ath9k_hw_deinit(ah); err_hw: kfree(ah); priv->ah = NULL; return ret; } static const struct ieee80211_iface_limit if_limits[] = { { .max = 2, .types = BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_P2P_CLIENT) }, { .max = 2, .types = BIT(NL80211_IFTYPE_AP) | BIT(NL80211_IFTYPE_P2P_GO) }, }; static const struct ieee80211_iface_combination if_comb = { .limits = if_limits, .n_limits = ARRAY_SIZE(if_limits), .max_interfaces = 2, .num_different_channels = 1, }; static void ath9k_set_hw_capab(struct ath9k_htc_priv *priv, struct ieee80211_hw *hw) { struct ath_common *common = ath9k_hw_common(priv->ah); hw->flags = IEEE80211_HW_SIGNAL_DBM | IEEE80211_HW_AMPDU_AGGREGATION | IEEE80211_HW_SPECTRUM_MGMT | IEEE80211_HW_HAS_RATE_CONTROL | IEEE80211_HW_RX_INCLUDES_FCS | IEEE80211_HW_SUPPORTS_PS | IEEE80211_HW_PS_NULLFUNC_STACK | IEEE80211_HW_REPORTS_TX_ACK_STATUS | IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING; hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_ADHOC) | BIT(NL80211_IFTYPE_AP) | BIT(NL80211_IFTYPE_P2P_GO) | BIT(NL80211_IFTYPE_P2P_CLIENT); hw->wiphy->iface_combinations = &if_comb; hw->wiphy->n_iface_combinations = 1; hw->wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT; hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN | WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL; hw->queues = 4; hw->channel_change_time = 5000; hw->max_listen_interval = 1; hw->vif_data_size = sizeof(struct ath9k_htc_vif); hw->sta_data_size = sizeof(struct ath9k_htc_sta); /* tx_frame_hdr is larger than tx_mgmt_hdr anyway */ hw->extra_tx_headroom = sizeof(struct tx_frame_hdr) + sizeof(struct htc_frame_hdr) + 4; if (priv->ah->caps.hw_caps & ATH9K_HW_CAP_2GHZ) hw->wiphy->bands[IEEE80211_BAND_2GHZ] = &priv->sbands[IEEE80211_BAND_2GHZ]; if (priv->ah->caps.hw_caps & ATH9K_HW_CAP_5GHZ) hw->wiphy->bands[IEEE80211_BAND_5GHZ] = &priv->sbands[IEEE80211_BAND_5GHZ]; if (priv->ah->caps.hw_caps & ATH9K_HW_CAP_HT) { if (priv->ah->caps.hw_caps & ATH9K_HW_CAP_2GHZ) setup_ht_cap(priv, &priv->sbands[IEEE80211_BAND_2GHZ].ht_cap); if (priv->ah->caps.hw_caps & ATH9K_HW_CAP_5GHZ) setup_ht_cap(priv, &priv->sbands[IEEE80211_BAND_5GHZ].ht_cap); } SET_IEEE80211_PERM_ADDR(hw, common->macaddr); } static int ath9k_init_firmware_version(struct ath9k_htc_priv *priv) { struct ieee80211_hw *hw = priv->hw; struct wmi_fw_version cmd_rsp; int ret; memset(&cmd_rsp, 0, sizeof(cmd_rsp)); WMI_CMD(WMI_GET_FW_VERSION); if (ret) return -EINVAL; priv->fw_version_major = be16_to_cpu(cmd_rsp.major); priv->fw_version_minor = be16_to_cpu(cmd_rsp.minor); snprintf(hw->wiphy->fw_version, sizeof(hw->wiphy->fw_version), "%d.%d", priv->fw_version_major, priv->fw_version_minor); dev_info(priv->dev, "ath9k_htc: FW Version: %d.%d\n", priv->fw_version_major, priv->fw_version_minor); /* * Check if the available FW matches the driver's * required version. */ if (priv->fw_version_major != MAJOR_VERSION_REQ || priv->fw_version_minor < MINOR_VERSION_REQ) { dev_err(priv->dev, "ath9k_htc: Please upgrade to FW version %d.%d\n", MAJOR_VERSION_REQ, MINOR_VERSION_REQ); return -EINVAL; } return 0; } static int ath9k_init_device(struct ath9k_htc_priv *priv, u16 devid, char *product, u32 drv_info) { struct ieee80211_hw *hw = priv->hw; struct ath_common *common; struct ath_hw *ah; int error = 0; struct ath_regulatory *reg; char hw_name[64]; /* Bring up device */ error = ath9k_init_priv(priv, devid, product, drv_info); if (error != 0) goto err_init; ah = priv->ah; common = ath9k_hw_common(ah); ath9k_set_hw_capab(priv, hw); error = ath9k_init_firmware_version(priv); if (error != 0) goto err_fw; /* Initialize regulatory */ error = ath_regd_init(&common->regulatory, priv->hw->wiphy, ath9k_reg_notifier); if (error) goto err_regd; reg = &common->regulatory; /* Setup TX */ error = ath9k_tx_init(priv); if (error != 0) goto err_tx; /* Setup RX */ error = ath9k_rx_init(priv); if (error != 0) goto err_rx; ath9k_hw_disable(priv->ah); #ifdef CONFIG_MAC80211_LEDS /* must be initialized before ieee80211_register_hw */ priv->led_cdev.default_trigger = ieee80211_create_tpt_led_trigger(priv->hw, IEEE80211_TPT_LEDTRIG_FL_RADIO, ath9k_htc_tpt_blink, ARRAY_SIZE(ath9k_htc_tpt_blink)); #endif /* Register with mac80211 */ error = ieee80211_register_hw(hw); if (error) goto err_register; /* Handle world regulatory */ if (!ath_is_world_regd(reg)) { error = regulatory_hint(hw->wiphy, reg->alpha2); if (error) goto err_world; } error = ath9k_htc_init_debug(priv->ah); if (error) { ath_err(common, "Unable to create debugfs files\n"); goto err_world; } ath_dbg(common, CONFIG, "WMI:%d, BCN:%d, CAB:%d, UAPSD:%d, MGMT:%d, BE:%d, BK:%d, VI:%d, VO:%d\n", priv->wmi_cmd_ep, priv->beacon_ep, priv->cab_ep, priv->uapsd_ep, priv->mgmt_ep, priv->data_be_ep, priv->data_bk_ep, priv->data_vi_ep, priv->data_vo_ep); ath9k_hw_name(priv->ah, hw_name, sizeof(hw_name)); wiphy_info(hw->wiphy, "%s\n", hw_name); ath9k_init_leds(priv); ath9k_start_rfkill_poll(priv); return 0; err_world: ieee80211_unregister_hw(hw); err_register: ath9k_rx_cleanup(priv); err_rx: ath9k_tx_cleanup(priv); err_tx: /* Nothing */ err_regd: /* Nothing */ err_fw: ath9k_deinit_priv(priv); err_init: return error; } int ath9k_htc_probe_device(struct htc_target *htc_handle, struct device *dev, u16 devid, char *product, u32 drv_info) { struct ieee80211_hw *hw; struct ath9k_htc_priv *priv; int ret; hw = ieee80211_alloc_hw(sizeof(struct ath9k_htc_priv), &ath9k_htc_ops); if (!hw) return -ENOMEM; priv = hw->priv; priv->hw = hw; priv->htc = htc_handle; priv->dev = dev; htc_handle->drv_priv = priv; SET_IEEE80211_DEV(hw, priv->dev); ret = ath9k_htc_wait_for_target(priv); if (ret) goto err_free; priv->wmi = ath9k_init_wmi(priv); if (!priv->wmi) { ret = -EINVAL; goto err_free; } ret = ath9k_init_htc_services(priv, devid, drv_info); if (ret) goto err_init; ret = ath9k_init_device(priv, devid, product, drv_info); if (ret) goto err_init; return 0; err_init: ath9k_deinit_wmi(priv); err_free: ieee80211_free_hw(hw); return ret; } void ath9k_htc_disconnect_device(struct htc_target *htc_handle, bool hotunplug) { if (htc_handle->drv_priv) { /* Check if the device has been yanked out. */ if (hotunplug) htc_handle->drv_priv->ah->ah_flags |= AH_UNPLUGGED; ath9k_deinit_device(htc_handle->drv_priv); ath9k_deinit_wmi(htc_handle->drv_priv); ieee80211_free_hw(htc_handle->drv_priv->hw); } } #ifdef CONFIG_PM void ath9k_htc_suspend(struct htc_target *htc_handle) { ath9k_htc_setpower(htc_handle->drv_priv, ATH9K_PM_FULL_SLEEP); } int ath9k_htc_resume(struct htc_target *htc_handle) { struct ath9k_htc_priv *priv = htc_handle->drv_priv; int ret; ret = ath9k_htc_wait_for_target(priv); if (ret) return ret; ret = ath9k_init_htc_services(priv, priv->ah->hw_version.devid, priv->ah->hw_version.usbdev); return ret; } #endif static int __init ath9k_htc_init(void) { if (ath9k_hif_usb_init() < 0) { pr_err("No USB devices found, driver not installed\n"); return -ENODEV; } return 0; } module_init(ath9k_htc_init); static void __exit ath9k_htc_exit(void) { ath9k_hif_usb_exit(); pr_info("Driver unloaded\n"); } module_exit(ath9k_htc_exit);
prasidh09/cse506
unionfs-3.10.y/drivers/net/wireless/ath/ath9k/htc_drv_init.c
C
gpl-2.0
26,608
[ 30522, 1013, 1008, 1008, 9385, 1006, 1039, 1007, 2230, 1011, 2249, 2012, 5886, 2891, 4806, 4297, 1012, 1008, 1008, 6656, 2000, 2224, 1010, 6100, 1010, 19933, 1010, 1998, 1013, 2030, 16062, 2023, 4007, 2005, 2151, 1008, 3800, 2007, 2030, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#include <CImageLibI.h> #include <CImageColorDefP.h> #include <cstring> bool CImageColorDef:: getRGB(const std::string &name, double *r, double *g, double *b) { int ri, gi, bi; if (! getRGBI(name, &ri, &gi, &bi)) return false; double rgb_scale = 1.0/255.0; *r = ri*rgb_scale; *g = gi*rgb_scale; *b = bi*rgb_scale; return true; } bool CImageColorDef:: getRGBI(const std::string &name, int *r, int *g, int *b) { int i; std::string lname = CStrUtil::toLower(name); const char *name1 = lname.c_str(); for (i = 0; color_def_data[i].name != 0; ++i) if (strcmp(color_def_data[i].name, name1) == 0) break; if (color_def_data[i].name == 0) return false; *r = color_def_data[i].r; *g = color_def_data[i].g; *b = color_def_data[i].b; return true; }
colinw7/CImageLib
src/CImageColorDef.cpp
C++
mit
801
[ 30522, 1001, 2421, 1026, 25022, 26860, 29521, 2072, 1012, 1044, 1028, 1001, 2421, 1026, 25022, 26860, 18717, 3207, 22540, 1012, 1044, 1028, 1001, 2421, 1026, 20116, 18886, 3070, 1028, 22017, 2140, 25022, 26860, 18717, 3207, 2546, 1024, 1024, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
var searchData= [ ['checksyscall_2eh',['CheckSysCall.h',['../db/d19/_check_sys_call_8h.html',1,'']]], ['classid_2eh',['ClassID.h',['../dc/d14/_class_i_d_8h.html',1,'']]], ['comparator_2eh',['Comparator.h',['../d7/d0c/_comparator_8h.html',1,'']]] ];
AubinMahe/AubinMahe.github.io
doxygen/html/search/files_2.js
JavaScript
apache-2.0
255
[ 30522, 30524, 1005, 1010, 1015, 1010, 1005, 1005, 1033, 1033, 1033, 1010, 1031, 1005, 2465, 3593, 1035, 1016, 11106, 1005, 1010, 1031, 1005, 2465, 3593, 1012, 1044, 1005, 1010, 1031, 1005, 1012, 1012, 1013, 5887, 1013, 1040, 16932, 1013, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("GettTest")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("GettTest")] [assembly: AssemblyCopyright("Copyright © 2016 Togocoder")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("91610e04-b20e-4350-b4c6-52d21ff78322")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.1.0.0")] [assembly: AssemblyFileVersion("1.1.0.0")]
togocoder/Gett.NET
GettTest/Properties/AssemblyInfo.cs
C#
mit
1,401
[ 30522, 2478, 2291, 1012, 9185, 1025, 2478, 2291, 1012, 2448, 7292, 1012, 21624, 8043, 7903, 2229, 1025, 2478, 2291, 1012, 2448, 7292, 1012, 6970, 11923, 2121, 7903, 2229, 1025, 1013, 1013, 2236, 2592, 2055, 2019, 3320, 2003, 4758, 2083, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* BLIS An object-based framework for developing high-performance BLAS-like libraries. Copyright (C) 2014, The University of Texas at Austin 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 The University of Texas at Austin 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 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. */ void libblis_test_symm( test_params_t* params, test_op_t* op );
xianyi/blis
testsuite/src/test_symm.h
C
bsd-3-clause
1,749
[ 30522, 1013, 1008, 1038, 6856, 2019, 4874, 1011, 2241, 7705, 2005, 4975, 2152, 1011, 2836, 1038, 8523, 1011, 2066, 8860, 1012, 9385, 1006, 1039, 1007, 2297, 1010, 1996, 2118, 1997, 3146, 2012, 5899, 25707, 1998, 2224, 1999, 3120, 1998, 12...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * * Copyright (C) 2007 Google, Inc. * Copyright (c) 2007-2011, Code Aurora Forum. All rights reserved. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #include <linux/version.h> #include <linux/kernel.h> #include <linux/init.h> #include <linux/errno.h> #include <linux/string.h> #include <linux/delay.h> #include <linux/clk.h> #include <linux/cpufreq.h> #include <linux/mutex.h> #include <linux/io.h> #include <linux/sort.h> #include <mach/board.h> #include <mach/msm_iomap.h> #include <asm/mach-types.h> #ifdef CONFIG_MFD_MAX8957 #include <mach/vreg.h> #endif #include "smd_private.h" #include "clock.h" #include "acpuclock.h" #include "spm.h" #define SCSS_CLK_CTL_ADDR (MSM_ACC_BASE + 0x04) #define SCSS_CLK_SEL_ADDR (MSM_ACC_BASE + 0x08) #define PLL2_L_VAL_ADDR (MSM_CLK_CTL_BASE + 0x33C) #define PLL2_M_VAL_ADDR (MSM_CLK_CTL_BASE + 0x340) #define PLL2_N_VAL_ADDR (MSM_CLK_CTL_BASE + 0x344) #define PLL2_CONFIG_ADDR (MSM_CLK_CTL_BASE + 0x34C) #define VREF_SEL 1 /* 0: 0.625V (50mV step), 1: 0.3125V (25mV step). */ #define V_STEP (25 * (2 - VREF_SEL)) /* Minimum voltage step size. */ #define VREG_DATA (VREG_CONFIG | (VREF_SEL << 5)) #define VREG_CONFIG (BIT(7) | BIT(6)) /* Enable VREG, pull-down if disabled. */ /* Cause a compile error if the voltage is not a multiple of the step size. */ #define MV(mv) ((mv) / (!((mv) % V_STEP))) /* mv = (750mV + (raw * 25mV)) * (2 - VREF_SEL) */ #define VDD_RAW(mv) (((MV(mv) / V_STEP) - 30) | VREG_DATA) #define MIN_UV_MV 750 #define MAX_UV_MV 1475 #define MAX_AXI_KHZ 192000 #define ACPU_MIN_UV_MV 700U #define ACPU_MAX_UV_MV 1300U struct clock_state { struct clkctl_acpu_speed *current_speed; struct mutex lock; struct clk *ebi1_clk; }; struct pll { unsigned int l; unsigned int m; unsigned int n; unsigned int pre_div; }; struct clkctl_acpu_speed { unsigned int use_for_scaling; unsigned int acpu_clk_khz; int src; unsigned int acpu_src_sel; unsigned int acpu_src_div; unsigned int axi_clk_hz; unsigned int vdd_mv; unsigned int vdd_raw; struct pll *pll_rate; unsigned long lpj; /* loops_per_jiffy */ }; static struct clock_state drv_state = { 0 }; /* Switch to this when reprogramming PLL2 */ static struct clkctl_acpu_speed *backup_s; static struct pll pll2_tbl[] = { { 42, 0, 1, 0 }, /* 806 MHz */ { 53, 1, 3, 0 }, /* 1024 MHz */ { 125, 0, 1, 1 }, /* 1200 MHz */ { 68, 0, 1, 0 }, /* 1401 MHz */ { 73, 0, 1, 0 }, /* 1401 MHz */ { 79, 0, 1, 0 }, /* 1500 MHz */ { 81, 0, 1, 0 }, /* 1560 MHz */ { 84, 0, 1, 0 }, /* 1560 MHz */ { 89, 0, 1, 0 }, /* 1560 MHz */ { 94, 0, 1, 0 }, /* 1560 MHz */ }; /* Use negative numbers for sources that can't be enabled/disabled */ enum acpuclk_source { LPXO = -2, AXI = -1, PLL_0 = 0, PLL_1, PLL_2, PLL_3, MAX_SOURCE }; static struct clk *acpuclk_sources[MAX_SOURCE]; /* * Each ACPU frequency has a certain minimum MSMC1 voltage requirement * that is implicitly met by voting for a specific minimum AXI frequency. * Do NOT change the AXI frequency unless you are _absoulutely_ sure you * know all the h/w requirements. */ static struct clkctl_acpu_speed acpu_freq_tbl[] = { { 0, 24576, LPXO, 0, 0, 30720000, 900, VDD_RAW(900) }, { 0, 61440, PLL_3, 5, 11, 61440000, 900, VDD_RAW(900) }, { 0, 122880, PLL_3, 5, 5, 61440000, 900, VDD_RAW(900) }, //{ 0, 184320, PLL_3, 5, 4, 61440000, 900, VDD_RAW(900) }, { 0, MAX_AXI_KHZ, AXI, 1, 0, 61440000, 900, VDD_RAW(900) }, { 1, 184320, PLL_3, 5, 4, 61440000, 900, VDD_RAW(900) }, { 1, 245760, PLL_3, 5, 2, 61440000, 900, VDD_RAW(900) }, { 1, 368640, PLL_3, 5, 1, 122800000, 900, VDD_RAW(900) }, /* AXI has MSMC1 implications. See above. */ { 1, 768000, PLL_1, 2, 0, 153600000, 1050, VDD_RAW(1050) }, /* * AXI has MSMC1 implications. See above. */ { 1, 806400, PLL_2, 3, 0, 192000000, 1100, VDD_RAW(1100), &pll2_tbl[0]}, { 1, 1024000, PLL_2, 3, 0, 192000000, 1200, VDD_RAW(1200), &pll2_tbl[1]}, { 1, 1200000, PLL_2, 3, 0, 192000000, 1200, VDD_RAW(1200), &pll2_tbl[2]}, { 1, 1305600, PLL_2, 3, 0, 192000000, 1200, VDD_RAW(1200), &pll2_tbl[3]}, { 1, 1401600, PLL_2, 3, 0, 192000000, 1250, VDD_RAW(1250), &pll2_tbl[4]}, { 1, 1516800, PLL_2, 3, 0, 192000000, 1300, VDD_RAW(1300), &pll2_tbl[5]}, #ifdef CONFIG_JESUS_PHONE { 1, 1536000, PLL_2, 3, 0, 192000000, 1300, VDD_RAW(1300), &pll2_tbl[6]}, { 1, 1612800, PLL_2, 3, 0, 192000000, 1400, VDD_RAW(1400), &pll2_tbl[7]}, { 1, 1708800, PLL_2, 3, 0, 192000000, 1400, VDD_RAW(1400) ,&pll2_tbl[8]}, { 1, 1804800, PLL_2, 3, 0, 192000000, 1450, VDD_RAW(1450) ,&pll2_tbl[9]}, { 0 } #else { 0 } #endif }; static int acpuclk_set_acpu_vdd(struct clkctl_acpu_speed *s) { int ret = 0; #ifdef CONFIG_MFD_MAX8957 struct vreg *vreg = vreg_get(0, "msmc2"); if (!vreg) { printk(KERN_INFO "%s: vreg_get error\n", __func__); return -ENODEV; } ret = vreg_set_level(vreg, s->vdd_mv); #else ret = msm_spm_set_vdd(0, s->vdd_raw); #endif if (ret) printk(KERN_ERR "%s: failed, vdd_mv=%d, ret=%d\n", __func__, s->vdd_mv, ret); else /* Wait for voltage to stabilize. */ udelay(62); #ifdef CONFIG_ACPUCLOCK_OVERCLOCKING if (!ret) return 0; #endif #ifdef CONFIG_ACPUCLOCK_OVERCLOCKING if (!ret) return 0; #endif return ret; } /* Assumes PLL2 is off and the acpuclock isn't sourced from PLL2 */ static void acpuclk_config_pll2(struct pll *pll) { uint32_t config = readl_relaxed(PLL2_CONFIG_ADDR); /* Make sure write to disable PLL_2 has completed * before reconfiguring that PLL. */ mb(); writel_relaxed(pll->l, PLL2_L_VAL_ADDR); writel_relaxed(pll->m, PLL2_M_VAL_ADDR); writel_relaxed(pll->n, PLL2_N_VAL_ADDR); if (pll->pre_div) config |= BIT(15); else config &= ~BIT(15); writel_relaxed(config, PLL2_CONFIG_ADDR); /* Make sure PLL is programmed before returning. */ mb(); } /* Set clock source and divider given a clock speed */ static void acpuclk_set_src(const struct clkctl_acpu_speed *s) { uint32_t reg_clksel, reg_clkctl, src_sel; reg_clksel = readl_relaxed(SCSS_CLK_SEL_ADDR); /* CLK_SEL_SRC1NO */ src_sel = reg_clksel & 1; /* Program clock source and divider. */ reg_clkctl = readl_relaxed(SCSS_CLK_CTL_ADDR); reg_clkctl &= ~(0xFF << (8 * src_sel)); reg_clkctl |= s->acpu_src_sel << (4 + 8 * src_sel); reg_clkctl |= s->acpu_src_div << (0 + 8 * src_sel); writel_relaxed(reg_clkctl, SCSS_CLK_CTL_ADDR); /* Toggle clock source. */ reg_clksel ^= 1; /* Program clock source selection. */ writel_relaxed(reg_clksel, SCSS_CLK_SEL_ADDR); /* Make sure switch to new source is complete. */ mb(); } static int acpuclk_7x30_set_rate(int cpu, unsigned long rate, enum setrate_reason reason) { struct clkctl_acpu_speed *tgt_s, *strt_s; int res, rc = 0; if (reason == SETRATE_CPUFREQ) mutex_lock(&drv_state.lock); strt_s = drv_state.current_speed; if (rate == strt_s->acpu_clk_khz) goto out; for (tgt_s = acpu_freq_tbl; tgt_s->acpu_clk_khz != 0; tgt_s++) { if (tgt_s->acpu_clk_khz == rate) break; } if (tgt_s->acpu_clk_khz == 0) { rc = -EINVAL; goto out; } if (reason == SETRATE_CPUFREQ) { /* Increase VDD if needed. */ if (tgt_s->vdd_mv > strt_s->vdd_mv) { rc = acpuclk_set_acpu_vdd(tgt_s); if (rc < 0) { pr_err("ACPU VDD increase to %d mV failed " "(%d)\n", tgt_s->vdd_mv, rc); goto out; } } } pr_debug("Switching from ACPU rate %u KHz -> %u KHz\n", strt_s->acpu_clk_khz, tgt_s->acpu_clk_khz); /* Increase the AXI bus frequency if needed. This must be done before * increasing the ACPU frequency, since voting for high AXI rates * implicitly takes care of increasing the MSMC1 voltage, as needed. */ if (tgt_s->axi_clk_hz > strt_s->axi_clk_hz) { rc = clk_set_rate(drv_state.ebi1_clk, tgt_s->axi_clk_hz); if (rc < 0) { pr_err("Setting AXI min rate failed (%d)\n", rc); goto out; } } /* Move off of PLL2 if we're reprogramming it */ if (tgt_s->src == PLL_2 && strt_s->src == PLL_2) { clk_enable(acpuclk_sources[backup_s->src]); acpuclk_set_src(backup_s); clk_disable(acpuclk_sources[strt_s->src]); } /* Reconfigure PLL2 if we're moving to it */ if (tgt_s->src == PLL_2) acpuclk_config_pll2(tgt_s->pll_rate); /* Make sure target PLL is on. */ if ((strt_s->src != tgt_s->src && tgt_s->src >= 0) || (tgt_s->src == PLL_2 && strt_s->src == PLL_2)) { pr_debug("Enabling PLL %d\n", tgt_s->src); clk_enable(acpuclk_sources[tgt_s->src]); } /* Perform the frequency switch */ acpuclk_set_src(tgt_s); drv_state.current_speed = tgt_s; loops_per_jiffy = tgt_s->lpj; if (tgt_s->src == PLL_2 && strt_s->src == PLL_2) clk_disable(acpuclk_sources[backup_s->src]); /* Nothing else to do for SWFI. */ if (reason == SETRATE_SWFI) goto out; /* Turn off previous PLL if not used. */ if (strt_s->src != tgt_s->src && strt_s->src >= 0) { pr_debug("Disabling PLL %d\n", strt_s->src); clk_disable(acpuclk_sources[strt_s->src]); } /* Decrease the AXI bus frequency if we can. */ if (tgt_s->axi_clk_hz < strt_s->axi_clk_hz) { res = clk_set_rate(drv_state.ebi1_clk, tgt_s->axi_clk_hz); if (res < 0) pr_warning("Setting AXI min rate failed (%d)\n", res); } /* Nothing else to do for power collapse. */ if (reason == SETRATE_PC) goto out; /* Drop VDD level if we can. */ if (tgt_s->vdd_mv < strt_s->vdd_mv) { res = acpuclk_set_acpu_vdd(tgt_s); if (res) pr_warning("ACPU VDD decrease to %d mV failed (%d)\n", tgt_s->vdd_mv, res); } pr_debug("ACPU speed change complete\n"); out: if (reason == SETRATE_CPUFREQ) mutex_unlock(&drv_state.lock); return rc; } static unsigned long acpuclk_7x30_get_rate(int cpu) { WARN_ONCE(drv_state.current_speed == NULL, "acpuclk_get_rate: not initialized\n"); if (drv_state.current_speed) return drv_state.current_speed->acpu_clk_khz; else return 0; } /*---------------------------------------------------------------------------- * Clock driver initialization *---------------------------------------------------------------------------*/ static void __init acpuclk_hw_init(void) { struct clkctl_acpu_speed *s; uint32_t div, sel, src_num; uint32_t reg_clksel, reg_clkctl; int res; u8 pll2_l = readl_relaxed(PLL2_L_VAL_ADDR) & 0xFF; drv_state.ebi1_clk = clk_get(NULL, "ebi1_dcvs_clk"); BUG_ON(IS_ERR(drv_state.ebi1_clk)); reg_clksel = readl_relaxed(SCSS_CLK_SEL_ADDR); /* Determine the ACPU clock rate. */ switch ((reg_clksel >> 1) & 0x3) { case 0: /* Running off the output of the raw clock source mux. */ reg_clkctl = readl_relaxed(SCSS_CLK_CTL_ADDR); src_num = reg_clksel & 0x1; sel = (reg_clkctl >> (12 - (8 * src_num))) & 0x7; div = (reg_clkctl >> (8 - (8 * src_num))) & 0xF; /* Check frequency table for matching sel/div pair. */ for (s = acpu_freq_tbl; s->acpu_clk_khz != 0; s++) { if (s->acpu_src_sel == sel && s->acpu_src_div == div) break; } if (s->acpu_clk_khz == 0) { pr_err("Error - ACPU clock reports invalid speed\n"); return; } break; case 2: /* Running off of the SCPLL selected through the core mux. */ /* Switch to run off of the SCPLL selected through the raw * clock source mux. */ for (s = acpu_freq_tbl; s->acpu_clk_khz != 0 && s->src != PLL_2 && s->acpu_src_div == 0; s++) ; if (s->acpu_clk_khz != 0) { /* Program raw clock source mux. */ acpuclk_set_src(s); /* Switch to raw clock source input of the core mux. */ reg_clksel = readl_relaxed(SCSS_CLK_SEL_ADDR); reg_clksel &= ~(0x3 << 1); writel_relaxed(reg_clksel, SCSS_CLK_SEL_ADDR); break; } /* else fall through */ default: pr_err("Error - ACPU clock reports invalid source\n"); return; } /* Look at PLL2's L val to determine what speed PLL2 is running at */ if (s->src == PLL_2) for ( ; s->acpu_clk_khz; s++) if (s->pll_rate && s->pll_rate->l == pll2_l) break; /* Set initial ACPU VDD. */ acpuclk_set_acpu_vdd(s); drv_state.current_speed = s; /* Initialize current PLL's reference count. */ if (s->src >= 0) clk_enable(acpuclk_sources[s->src]); res = clk_set_rate(drv_state.ebi1_clk, s->axi_clk_hz); if (res < 0) pr_warning("Setting AXI min rate failed!\n"); pr_info("ACPU running at %d KHz\n", s->acpu_clk_khz); return; } /* Initalize the lpj field in the acpu_freq_tbl. */ static void __init lpj_init(void) { int i; const struct clkctl_acpu_speed *base_clk = drv_state.current_speed; for (i = 0; acpu_freq_tbl[i].acpu_clk_khz; i++) { acpu_freq_tbl[i].lpj = cpufreq_scale(loops_per_jiffy, base_clk->acpu_clk_khz, acpu_freq_tbl[i].acpu_clk_khz); } } #ifdef CONFIG_CPU_FREQ_MSM static struct cpufreq_frequency_table cpufreq_tbl[ARRAY_SIZE(acpu_freq_tbl)]; static void setup_cpufreq_table(void) { unsigned i = 0; const struct clkctl_acpu_speed *speed; for (speed = acpu_freq_tbl; speed->acpu_clk_khz; speed++) if (speed->use_for_scaling) { cpufreq_tbl[i].index = i; cpufreq_tbl[i].frequency = speed->acpu_clk_khz; i++; } cpufreq_tbl[i].frequency = CPUFREQ_TABLE_END; cpufreq_frequency_table_get_attr(cpufreq_tbl, smp_processor_id()); } #else static inline void setup_cpufreq_table(void) { } #endif /* * Truncate the frequency table at the current PLL2 rate and determine the * backup PLL to use when scaling PLL2. */ void __init pll2_fixup(void) { struct clkctl_acpu_speed *speed = acpu_freq_tbl; #ifndef CONFIG_ACPUCLOCK_OVERCLOCKING u8 pll2_l = readl_relaxed(PLL2_L_VAL_ADDR) & 0xFF; #endif for ( ; speed->acpu_clk_khz; speed++) { if (speed->src != PLL_2) backup_s = speed; #ifndef CONFIG_ACPUCLOCK_OVERCLOCKING /* Base on PLL2_L_VAL_ADDR to switch acpu speed */ else { if (speed->pll_rate && speed->pll_rate->l != pll2_l) speed->use_for_scaling = 0; } if (speed->pll_rate && speed->pll_rate->l == pll2_l) { speed++; speed->acpu_clk_khz = 0; return; } #endif } #ifndef CONFIG_ACPUCLOCK_OVERCLOCKING pr_err("Unknown PLL2 lval %d\n", pll2_l); BUG(); #endif } #define RPM_BYPASS_MASK (1 << 3) #define PMIC_MODE_MASK (1 << 4) static void __init populate_plls(void) { acpuclk_sources[PLL_1] = clk_get_sys("acpu", "pll1_clk"); BUG_ON(IS_ERR(acpuclk_sources[PLL_1])); acpuclk_sources[PLL_2] = clk_get_sys("acpu", "pll2_clk"); BUG_ON(IS_ERR(acpuclk_sources[PLL_2])); acpuclk_sources[PLL_3] = clk_get_sys("acpu", "pll3_clk"); BUG_ON(IS_ERR(acpuclk_sources[PLL_3])); } static struct acpuclk_data acpuclk_7x30_data = { .set_rate = acpuclk_7x30_set_rate, .get_rate = acpuclk_7x30_get_rate, .power_collapse_khz = MAX_AXI_KHZ, .wait_for_irq_khz = MAX_AXI_KHZ, .switch_time_us = 50, }; static int __init acpuclk_7x30_init(struct acpuclk_soc_data *soc_data) { pr_info("%s()\n", __func__); mutex_init(&drv_state.lock); pll2_fixup(); populate_plls(); acpuclk_hw_init(); lpj_init(); setup_cpufreq_table(); acpuclk_register(&acpuclk_7x30_data); return 0; } struct acpuclk_soc_data acpuclk_7x30_soc_data __initdata = { .init = acpuclk_7x30_init, }; #ifdef CONFIG_CPU_FREQ_VDD_LEVELS ssize_t acpuclk_get_vdd_levels_str(char *buf) { int i, len = 0; if (buf) { mutex_lock(&drv_state.lock); for (i = 0; acpu_freq_tbl[i].acpu_clk_khz; i++) { len += sprintf(buf + len, "%8u: %4d\n", acpu_freq_tbl[i].acpu_clk_khz, acpu_freq_tbl[i].vdd_mv); } mutex_unlock(&drv_state.lock); } return len; } void acpuclk_set_vdd(unsigned int khz, int vdd) { int i; unsigned int new_vdd; vdd = vdd / V_STEP * V_STEP; mutex_lock(&drv_state.lock); for (i = 0; acpu_freq_tbl[i].acpu_clk_khz; i++) { if (khz == 0) new_vdd = min(max((acpu_freq_tbl[i].vdd_mv + vdd), ACPU_MIN_UV_MV), ACPU_MAX_UV_MV); else if (acpu_freq_tbl[i].acpu_clk_khz == khz) new_vdd = min(max((unsigned int)vdd, ACPU_MIN_UV_MV), ACPU_MAX_UV_MV); else continue; acpu_freq_tbl[i].vdd_mv = new_vdd; acpu_freq_tbl[i].vdd_raw = VDD_RAW(new_vdd); } mutex_unlock(&drv_state.lock); } #endif
StarKissed/starkissed-kernel-mecha
arch/arm/mach-msm/acpuclock-7x30.c
C
gpl-2.0
15,651
[ 30522, 1013, 1008, 1008, 1008, 9385, 1006, 1039, 1007, 2289, 8224, 1010, 4297, 1012, 1008, 9385, 1006, 1039, 1007, 2289, 1011, 2249, 1010, 3642, 13158, 7057, 1012, 2035, 2916, 9235, 1012, 1008, 1008, 2023, 4007, 2003, 7000, 2104, 1996, 34...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package ecologylab.bigsemantics.service.crawler; import java.io.IOException; /** * A general framework for crawling resources. * * @author quyin */ public interface ResourceCrawler<T> { /** * Queue a resource with the given URI. * * @param uri */ void queue(String uri); /** * If the crawler has more resources to crawl. * * @return true if there are still resources to crawl. */ boolean hasNext(); /** * Retrieve the next resource. * * @return The next crawled resource. * @throws IOException * If the resource cannot be accessed. */ T next() throws IOException; /** * Expand a given resource. * * @param resource */ void expand(T resource); /** * @return The number of resources queued. */ int countQueued(); /** * @return The number of resources that are to be crawled. */ int countWaiting(); /** * @return The number of resources that have been accessed. */ int countAccessed(); /** * @return The number of resources that have been accessed successfully. */ int countSuccess(); /** * @return The number of resources that have been accessed unsuccessfully. */ int countFailure(); }
ecologylab/BigSemanticsService
BasicCrawler/src/ecologylab/bigsemantics/service/crawler/ResourceCrawler.java
Java
apache-2.0
1,304
[ 30522, 7427, 13517, 20470, 1012, 2502, 3366, 2386, 14606, 1012, 2326, 1012, 13529, 2121, 1025, 12324, 9262, 1012, 22834, 1012, 22834, 10288, 24422, 1025, 1013, 1008, 1008, 1008, 1037, 2236, 7705, 2005, 15927, 4219, 1012, 1008, 1008, 1030, 3...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * Hibernate, Relational Persistence for Idiomatic Java * * Copyright (c) 2011, Red Hat Inc. or third-party contributors as * indicated by the @author tags or express copyright attribution * statements applied by the authors. All third-party contributions are * distributed under license by Red Hat Inc. * * This copyrighted material is made available to anyone wishing to use, modify, * copy, or redistribute it subject to the terms and conditions of the GNU * Lesser General Public License, as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this distribution; if not, write to: * Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ package org.hibernate.test.annotations.cascade; import java.util.HashSet; import org.junit.Test; import org.hibernate.HibernateException; import org.hibernate.Session; import org.hibernate.Transaction; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.fail; /** * @author Jeff Schnitzer * @author Gail Badner */ @SuppressWarnings("unchecked") public class NonNullableCircularDependencyCascadeTest extends BaseCoreFunctionalTestCase { @Test public void testIdClassInSuperclass() throws Exception { Session s = openSession(); Transaction tx = s.beginTransaction(); Parent p = new Parent(); p.setChildren( new HashSet<Child>() ); Child ch = new Child(p); p.getChildren().add(ch); p.setDefaultChild(ch); try { s.persist(p); s.flush(); fail( "should have failed because of transient entities have non-nullable, circular dependency." ); } catch ( HibernateException ex) { // expected } tx.rollback(); s.close(); } @Override protected Class[] getAnnotatedClasses() { return new Class[]{ Child.class, Parent.class }; } }
HerrB92/obp
OpenBeaconPackage/libraries/hibernate-release-4.2.7.SP1/project/hibernate-core/src/test/java/org/hibernate/test/annotations/cascade/NonNullableCircularDependencyCascadeTest.java
Java
mit
2,167
[ 30522, 1013, 1008, 1008, 7632, 5677, 12556, 1010, 28771, 28297, 2005, 8909, 18994, 12070, 9262, 1008, 1008, 9385, 1006, 1039, 1007, 2249, 1010, 2417, 6045, 4297, 1012, 2030, 2353, 1011, 2283, 16884, 2004, 1008, 5393, 2011, 1996, 1030, 3166,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> <title>Dynatree - Example</title> <script src="../jquery/jquery.js" type="text/javascript"></script> <script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script> <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> <link href="../src/skin-vista/ui.dynatree.css" rel="stylesheet" type="text/css"> <script src="../src/jquery.dynatree.js" type="text/javascript"></script> <!-- Start_Exclude: This block is not part of the sample code --> <link href="prettify.css" rel="stylesheet"> <script src="prettify.js" type='text/javascript'></script> <link href='sample.css' rel='stylesheet' type='text/css'> <script src='sample.js' type='text/javascript'></script> <!-- End_Exclude --> <script type='text/javascript'> $(function(){ $("#tree").dynatree({ // In real life we would call a URL on the server like this: // initAjax: { // url: "/getTopLevelNodesAsJson", // data: { mode: "funnyMode" } // }, // .. but here we use a local file instead: initAjax: { url: "sample-data1.json" }, onActivate: function(node) { $("#echoActive").text(node.data.title); }, onDeactivate: function(node) { $("#echoActive").text("-"); } }); }); </script> </head> <body class="example"> <h1>Example: Init from Ajax request</h1> <p class="description"> This sample initializes the tree from a JSON request. </p> <!-- Add a <div> element where the tree should appear: --> <div id="tree"> </div> <div>Active node: <span id="echoActive">-</span></div> <!-- Start_Exclude: This block is not part of the sample code --> <hr> <p class="sample-links no_code"> <a class="hideInsideFS" href="http://dynatree.googlecode.com">jquery.dynatree.js project home</a> <a class="hideOutsideFS" href="#">Link to this page</a> <a class="hideInsideFS" href="samples.html">Example Browser</a> <a href="#" class="codeExample">View source code</a> </p> <!-- End_Exclude --> </body> </html>
starzel/vdexeditor
static/dynatree/doc/sample-init-lazy.html
HTML
mit
2,248
[ 30522, 1026, 999, 9986, 13874, 16129, 2270, 1000, 1011, 1013, 1013, 1059, 2509, 2278, 1013, 1013, 26718, 2094, 16129, 1018, 1012, 5890, 1013, 1013, 4372, 1000, 1000, 8299, 1024, 1013, 1013, 7479, 1012, 1059, 2509, 1012, 8917, 1013, 19817, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!--- THIS IS AN AUTOGENERATED FILE. EDIT PACKAGES/BOUNDLESS-INPUT/INDEX.JS INSTEAD. --> # Input Input abstracts away the cross-platform differences of placeholder styling and behaviors, for example: Internet Explorer dismisses native placeholders on input focus and other platforms do not. This component ensures that text input controls will feel and behave similarly on more devices. ## Component Instance Methods When using `Input` in your project, you may call the following methods on a rendered instance of the component. Use [`refs`](https://facebook.github.io/react/docs/refs-and-the-dom.html) to get the instance. - __getValue()__ returns the current value of the input field - __setValue(string)__ programmatically set the input value; useful for clearing out the input in "uncontrolled" mode -- note that digging into the internals and setting the `refs.field.value = ''` directly will not trigger events and messes up the internal state of the component ## Installation ```bash npm i boundless-input --save ``` Then use it like: ```jsx /** @jsx createElement */ import { createElement, PureComponent } from 'react'; import Input from 'boundless-input'; export default class InputDemo extends PureComponent { state = { input: '', } handleChange = (e) => this.setState({ input: e.target.value }) render() { return ( <div className='spread'> <div> <h5>hidePlaceholderOnFocus="false"</h5> <Input hidePlaceholderOnFocus={false} inputProps={{ placeholder: 'Start typing and I disappear!', }} /> </div> <div style={{ marginLeft: '1em' }}> <h5>hidePlaceholderOnFocus="true"</h5> <Input hidePlaceholderOnFocus={true} inputProps={{ placeholder: 'Focus on me and I disappear!', }} /> </div> <div style={{ marginLeft: '1em' }}> <h5>"controlled" input</h5> <Input hidePlaceholderOnFocus={true} inputProps={{ placeholder: 'Focus on me and I disappear!', onChange: this.handleChange, value: this.state.input, }} /> </div> </div> ); } } ``` Input can also just be directly used from the main [Boundless library](https://www.npmjs.com/package/boundless). This is recommended when you're getting started to avoid maintaining the package versions of several components: ```bash npm i boundless --save ``` the ES6 `import` statement then becomes like: ```js import { Input } from 'boundless'; ``` ## Props > Note: only top-level props are in the README, for the full list check out the [website](https://boundless.js.org/Input). ### Required Props There are no required props. ### Optional Props - __`*`__ &middot; any [React-supported attribute](https://facebook.github.io/react/docs/tags-and-attributes.html#html-attributes) Expects | Default Value --- | --- `any` | `n/a` - __`component`__ &middot; overrides the HTML container tag Expects | Default Value --- | --- `string` | `'div'` - __`hidePlaceholderOnFocus`__ &middot; triggers the placeholder to disappear when the input field is focused, reappears when the user has tabbed away or focus is moved Expects | Default Value --- | --- `bool` | `true` - __`inputProps`__ Expects | Default Value --- | --- `object` | `{ type: 'text' }` ## Reference Styles ### Stylus You can see what variables are available to override in [variables.styl](https://github.com/enigma-io/boundless/blob/master/variables.styl). ```stylus // Redefine any variables as desired, e.g: color-accent = royalblue // Bring in the component styles; they will be autoconfigured based on the above @require "node_modules/boundless-input/style" ``` ### CSS If desired, a precompiled plain CSS stylesheet is available for customization at `/build/style.css`, based on Boundless's [default variables](https://github.com/enigma-io/boundless/blob/master/variables.styl).
enigma-io/boundless
packages/boundless-input/README.md
Markdown
mit
4,410
[ 30522, 1026, 999, 1011, 1011, 1011, 2023, 2003, 2019, 8285, 6914, 16848, 5371, 1012, 10086, 14555, 1013, 5391, 3238, 1011, 7953, 1013, 5950, 1012, 1046, 2015, 2612, 1012, 1011, 1011, 1028, 1001, 7953, 7953, 29474, 2185, 1996, 2892, 1011, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package org.hyperimage.client.image; import java.awt.Dimension; import java.awt.image.BufferedImage; import java.io.IOException; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; import java.util.logging.Level; import java.util.logging.Logger; import org.imgscalr.Scalr; import org.imgscalr.Scalr.Mode; public class HiImageImplDigilib extends HiImageAbstract { private static final Logger logger = Logger.getLogger(HiImageImplDigilib.class.getName()); private static HiImageImplDigilib hiImageImpl; private HiImageImplDigilib() { } public static HiImageImplDigilib getInstance() { if (hiImageImpl == null) { synchronized (HiImageImplDigilib.class) { if (hiImageImpl == null) { hiImageImpl = new HiImageImplDigilib(); } } } return hiImageImpl; } public BufferedImage scaleImage(BufferedImage image, Dimension dimension, String repositoryID) { logger.info("Scaling image to " + dimension); if (repositoryID == null) { logger.warning("No repositoryID provided. Trying to scale locally."); return Scalr.resize(image, Scalr.Method.AUTOMATIC, Mode.FIT_EXACT, dimension.width, dimension.height); } else { try { String restPath = repositoryID + "&dw=" + dimension.width + "&dh=" + dimension.height; logger.info("Trying to get image from " + restPath); URL url = new URL(restPath); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); // conn.setRequestMethod("GET"); // conn.setRequestProperty("Accept", "image/jpeg"); if (conn.getResponseCode() != 200) { logger.log(Level.SEVERE, "Failed to get data. HTTP error code : " + conn.getResponseCode() + ", " + conn.getResponseMessage()); throw new HiImageException("Failed to get data. HTTP error code : " + conn.getResponseCode() + ", " + conn.getResponseMessage()); } BufferedImage result = createImageFromStream(conn.getInputStream()); conn.disconnect(); return result; } catch (MalformedURLException e) { logger.log(Level.SEVERE, "Scaling failed", e); throw new HiImageException("Scaling failed", e); } catch (IOException e) { logger.log(Level.SEVERE, "Scaling failed", e); throw new HiImageException("Scaling failed", e); } } } }
DAASI/HyperImage3
HIImage/src/main/java/org/hyperimage/client/image/HiImageImplDigilib.java
Java
apache-2.0
2,276
[ 30522, 7427, 8917, 1012, 23760, 9581, 3351, 1012, 7396, 1012, 3746, 1025, 12324, 9262, 1012, 22091, 2102, 1012, 9812, 1025, 12324, 9262, 1012, 22091, 2102, 1012, 3746, 1012, 17698, 2098, 9581, 3351, 1025, 12324, 9262, 1012, 22834, 1012, 228...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
{% load application_view_menu %} <div id="application-view-header"> <h1>report: <a href="/report/#report/{{ report.pk }}/details/">{{ report.name }}</a></h1> </div> {% application_view_menu object report.pk %} <div class="application-view-content clearfix"> <div class="text-bullet"> <span class="name">link:</span> <span class="value"> <a href="/report/external/{{ report.bound_link }}" target="_blank"> {% if request.is_secure %}https:{% else %}http:{% endif %}//{{ request.get_host }}/report/external/{{ report.bound_link }} </a> </span> </div> <div class="text-bullet"> <span class="name">public:</span> <span class="value">{{ report.public|yesno }}</span> </div> </div> <div class="application-view-content clearfix"> {{ report.content }} </div>
qualitio/qualitio
qualitio/templates/report/report_bound.html
HTML
gpl-3.0
812
[ 30522, 1063, 1003, 7170, 4646, 1035, 3193, 1035, 12183, 1003, 1065, 1026, 4487, 2615, 8909, 1027, 1000, 4646, 1011, 3193, 1011, 20346, 1000, 1028, 1026, 1044, 2487, 1028, 3189, 1024, 1026, 1037, 17850, 12879, 1027, 1000, 1013, 3189, 1013, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// Copyright (c) 2000, Google Inc. // 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 Google Inc. 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 THE COPYRIGHT // OWNER 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. // --- // // Reorganized by Craig Silverstein // // In this file we define the arena template code. This includes the // ArenaAllocator, which is meant only to be used with STL, and also // the Gladiator (which needs to know how to new and delete various // types of objects). // // If you're only using the MALLOC-LIKE functionality of the arena, // you don't need to include this file at all! You do need to include // it (in your own .cc file) if you want to use the STRING, STL, or // NEW aspects of the arena. See arena.h for details on these types. // // ArenaAllocator is an STL allocator, but because it relies on unequal // instances, it may not work with all standards-conforming STL // implementations. But it works with SGI STL so we're happy. // // Here's an example of how the ArenaAllocator would be used. // Say we have a vector of ints that we want to have use the arena // for memory allocation. Here's one way to do it: // UnsafeArena* arena = new UnsafeArena(1000); // or SafeArena(), or 10000 // vector<int, ArenaAllocator<int, UnsafeArena> > v(arena); // // Note that every STL type always allows the allocator (in this case, // the arena, which is automatically promoted to an allocator) as the last // arg to the constructor. So if you would normally do // vector<...> v(foo, bar), // with the arena you can do // vector<...> v(foo, bar, arena); #ifndef BASE_ARENA_INL_H_ #define BASE_ARENA_INL_H_ #include <config_ctemplate.h> #include "base/arena.h" #include <assert.h> #include <stddef.h> #include <new> #include <memory> _START_GOOGLE_NAMESPACE_ // T is the type we want to allocate, and C is the type of the arena. // ArenaAllocator has the thread-safety characteristics of C. template <class T, class C> class ArenaAllocator { public: typedef T value_type; typedef size_t size_type; typedef ptrdiff_t difference_type; typedef T* pointer; typedef const T* const_pointer; typedef T& reference; typedef const T& const_reference; pointer address(reference r) const { return &r; } const_pointer address(const_reference r) const { return &r; } size_type max_size() const { return size_t(-1) / sizeof(T); } // DO NOT USE! The default constructor is for gcc3 compatibility only. ArenaAllocator() : arena_(0) { } // This is not an explicit constructor! So you can pass in an arena* // to functions needing an ArenaAllocator (like the astring constructor) // and everything will work ok. ArenaAllocator(C* arena) : arena_(arena) { } // NOLINT ~ArenaAllocator() { } pointer allocate(size_type n, std::allocator<void>::const_pointer /*hint*/ = 0) { assert(arena_ && "No arena to allocate from!"); return reinterpret_cast<T*>(arena_->AllocAligned(n * sizeof(T), kAlignment)); } void deallocate(pointer p, size_type n) { arena_->Free(p, n * sizeof(T)); } void construct(pointer p, const T & val) { new(reinterpret_cast<void*>(p)) T(val); } void construct(pointer p) { new(reinterpret_cast<void*>(p)) T(); } void destroy(pointer p) { p->~T(); } C* arena(void) const { return arena_; } template<class U> struct rebind { typedef ArenaAllocator<U, C> other; }; template<class U> ArenaAllocator(const ArenaAllocator<U, C>& other) : arena_(other.arena()) { } template<class U> bool operator==(const ArenaAllocator<U, C>& other) const { return arena_ == other.arena(); } template<class U> bool operator!=(const ArenaAllocator<U, C>& other) const { return arena_ != other.arena(); } protected: static const int kAlignment; C* arena_; }; template<class T, class C> const int ArenaAllocator<T, C>::kAlignment = (1 == sizeof(T) ? 1 : BaseArena::kDefaultAlignment); // 'new' must be in the global namespace. _END_GOOGLE_NAMESPACE_ using GOOGLE_NAMESPACE::UnsafeArena; // Operators for allocation on the arena // Syntax: new (AllocateInArena, arena) MyClass; // new (AllocateInArena, arena) MyClass[num]; // Useful for classes you can't descend from Gladiator, such as POD, // STL containers, etc. enum AllocateInArenaType { AllocateInArena }; inline void* operator new(size_t size, AllocateInArenaType /* unused */, UnsafeArena *arena) { return arena->Alloc(size); } inline void* operator new[](size_t size, AllocateInArenaType /* unused */, UnsafeArena *arena) { return arena->Alloc(size); } _START_GOOGLE_NAMESPACE_ // Ordinarily in C++, one allocates all instances of a class from an // arena. If that's what you want to do, you don't need Gladiator. // (However you may find ArenaOnlyGladiator useful.) // // However, for utility classes that are used by multiple clients, the // everything-in-one-arena model may not work. Some clients may wish // not to use an arena at all. Or perhaps a composite structure // (tree) will contain multiple objects (nodes) and some of those // objects will be created by a factory, using an arena, while other // objects will be created on-the-fly by an unsuspecting user who // doesn't know anything about the arena. // // To support that, have the arena-allocated class inherit from // Gladiator. The ordinary operator new will continue to allocate // from the heap. To allocate from an arena, do // Myclass * m = new (AllocateInArena, a) Myclass (args, to, constructor); // where a is either an arena or an allocator. Now you can call // delete on all the objects, whether they are allocated from an arena // or on the heap. Heap memory will be released, while arena memory will // not be. // // If a client knows that no objects were allocated on the heap, it // need not delete any objects (but it may if it wishes). The only // objects that must be deleted are those that were actually allocated // from the heap. // // NOTE: an exception to the google C++ style guide rule for "No multiple // implementation inheritance" is granted for this class: you can treat this // class as an "Interface" class, and use it in a multiple inheritence context, // even though it implements operator new/delete. class Gladiator { public: Gladiator() { } virtual ~Gladiator() { } // We do not override the array allocators, so array allocation and // deallocation will always be from the heap. Typically, arrays are // larger, and thus the costs of arena allocation are higher and the // benefits smaller. Since arrays are typically allocated and deallocated // very differently from scalars, this may not interfere too much with // the arena concept. If it does pose a problem, flesh out the // ArrayGladiator class below. void* operator new(const size_t size) { void* ret = ::operator new(1 + size); static_cast<char *>(ret)[size] = 1; // mark as heap-allocated return ret; } // the ignored parameter keeps us from stepping on placement new template<class T> void* operator new(const size_t size, const int ignored, T* allocator) { if (allocator) { void* ret = allocator->AllocAligned(1 + size, BaseArena::kDefaultAlignment); static_cast<char*>(ret)[size] = 0; // mark as arena-allocated return ret; } else { return operator new(size); // this is the function above } } void operator delete(void* memory, const size_t size) { if (static_cast<char*>(memory)[size]) { assert (1 == static_cast<char *>(memory)[size]); ::operator delete(memory); } else { // We never call the allocator's Free method. If we need to do // that someday, we can store a pointer to the arena instead of // the Boolean marker flag. } } template<class T> void operator delete(void* memory, const size_t size, const int ign, T* allocator) { // This "placement delete" can only be called if the constructor // throws an exception. if (allocator) { allocator->Free(memory, 1 + size); } else { ::operator delete(memory); } } }; // This avoids the space overhead of Gladiator if you just want to // override new and delete. It helps avoid some of the more common // problems that can occur when overriding new and delete. class ArenaOnlyGladiator { public: ArenaOnlyGladiator() { } // No virtual destructor is needed because we ignore the size // parameter in all the delete functions. // virtual ~ArenaOnlyGladiator() { } // can't just return NULL here -- compiler gives a warning. :-| void* operator new(const size_t /*size*/) { assert(0); return reinterpret_cast<void *>(1); } void* operator new[](const size_t /*size*/) { assert(0); return reinterpret_cast<void *>(1); } // the ignored parameter keeps us from stepping on placement new template<class T> void* operator new(const size_t size, const int ignored, T* allocator) { assert(allocator); return allocator->AllocAligned(size, BaseArena::kDefaultAlignment); } template<class T> void* operator new[](const size_t size, const int ignored, T* allocator) { assert(allocator); return allocator->AllocAligned (size, BaseArena::kDefaultAlignment); } void operator delete(void* /*memory*/, const size_t /*size*/) { } template<class T> void operator delete(void* memory, const size_t size, const int ign, T* allocator) { } void operator delete [](void* /*memory*/) { } template<class T> void operator delete(void* memory, const int ign, T* allocator) { } }; #if 0 // ********** for example purposes only; 100% untested. // Note that this implementation incurs an overhead of kHeaderSize for // every array that is allocated. *Before* the space is returned to the // user, we store the address of the Arena that owns the space, and // the length of th space itself. class ArrayGladiator : public Gladiator { public: void * operator new[] (const size_t size) { const int sizeplus = size + kHeaderSize; void * const ret = ::operator new(sizeplus); *static_cast<Arena **>(ret) = NULL; // mark as heap-allocated *static_cast<size_t *>(ret + sizeof(Arena *)) = sizeplus; return ret + kHeaderSize; } // the ignored parameter keeps us from stepping on placement new template<class T> void * operator new[] (const size_t size, const int ignored, T * allocator) { if (allocator) { const int sizeplus = size + kHeaderSize; void * const ret = allocator->AllocAligned(sizeplus, BaseArena::kDefaultAlignment); *static_cast<Arena **>(ret) = allocator->arena(); *static_cast<size_t *>(ret + sizeof(Arena *)) = sizeplus; return ret + kHeaderSize; } else { return operator new[](size); // this is the function above } } void operator delete [] (void * memory) { memory -= kHeaderSize; Arena * const arena = *static_cast<Arena **>(memory); const size_t sizeplus = *static_cast<size_t *>(memory + sizeof(arena)); if (arena) { arena->SlowFree(memory, sizeplus); } else { ::operator delete (memory); } } template<class T> void * operator delete (void * memory, const int ign, T * allocator) { // This "placement delete" can only be called if the constructor // throws an exception. memory -= kHeaderSize; const size_t sizeplus = *static_cast<size_t *>(memory + sizeof(Arena *)); if (allocator) { allocator->Free(memory, 1 + size); } else { operator delete (memory); } } protected: static const int kMinSize = sizeof size_t + sizeof(Arena *); static const int kHeaderSize = kMinSize > BaseArena::kDefaultAlignment ? 2 * BaseArena::kDefaultAlignment : BaseArena::kDefaultAlignment; }; #endif // ********** example _END_GOOGLE_NAMESPACE_ #endif // BASE_ARENA_INL_H_
hpfem/agros2d
3rdparty/ctemplate/base/arena-inl.h
C
gpl-2.0
14,094
[ 30522, 1013, 1013, 9385, 1006, 1039, 1007, 2456, 1010, 8224, 4297, 1012, 1013, 1013, 2035, 2916, 9235, 1012, 1013, 1013, 1013, 1013, 25707, 1998, 2224, 1999, 3120, 1998, 12441, 3596, 1010, 2007, 2030, 2302, 1013, 1013, 14080, 1010, 2024, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package cat.foixench.test.parcelable; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } }
gothalo/Android-2017
014-Parcelable/app/src/test/java/cat/foixench/test/parcelable/ExampleUnitTest.java
Java
gpl-3.0
406
[ 30522, 7427, 4937, 1012, 1042, 10448, 2595, 2368, 2818, 1012, 3231, 1012, 20463, 3085, 1025, 12324, 8917, 1012, 12022, 4183, 1012, 3231, 1025, 12324, 10763, 8917, 1012, 12022, 4183, 1012, 20865, 1012, 1008, 1025, 1013, 1008, 1008, 1008, 274...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
exports.translate = function(tag) { return this.import("riot").compile(tag); };
lixiaoyan/jspm-plugin-riot
riot.js
JavaScript
mit
82
[ 30522, 14338, 1012, 17637, 1027, 3853, 1006, 6415, 1007, 1063, 2709, 2023, 1012, 12324, 1006, 1000, 11421, 1000, 1007, 1012, 4012, 22090, 1006, 6415, 1007, 1025, 1065, 1025, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
'use strict'; import EventMap from 'eventmap'; import Log from './log'; var audioTypes = { 'mp3': 'audio/mpeg', 'wav': 'audio/wav', 'ogg': 'audio/ogg' }; var imageTypes = { 'png': 'image/png', 'jpg': 'image/jpg', 'gif': 'image/gif' }; class AssetLoader extends EventMap { constructor(assets) { super(); this.assets = assets || {}; this.files = {}; this.maxAssets = 0; this.assetsLoaded = 0; this.percentLoaded = 0; this.cache = {}; } start() { // TODO: Something was wrong here. So it's deleted right now } } export default AssetLoader;
maxwerr/gamebox
src/assetloader.js
JavaScript
unlicense
599
[ 30522, 1005, 2224, 9384, 1005, 1025, 12324, 2724, 2863, 2361, 2013, 1005, 2724, 2863, 2361, 1005, 1025, 12324, 8833, 2013, 1005, 1012, 1013, 8833, 1005, 1025, 13075, 5746, 13874, 2015, 1027, 1063, 1005, 23378, 1005, 1024, 1005, 5746, 1013, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#ifndef TRUE #define TRUE 1 #endif //TRUE #ifndef FALSE #define FALSE 0 #endif //FALSE #include <plib/ssg.h> #include <plib/sg.h> #include <raceman.h> #include <track.h> #include "grscene.h" typedef struct LightInfo { int index; ssgVtxTable *light; //ssgSimpleState* onState; //ssgSimpleState* offState; ssgStateSelector *states; struct LightInfo *next; } tLightInfo; typedef struct TrackLights { tLightInfo *st_red; tLightInfo *st_green; tLightInfo *st_yellow; tLightInfo *st_green_st; } tTrackLights; typedef struct StateList { ssgSimpleState *state; struct StateList *next; } tStateList; static tStateList *statelist; static ssgBranch *lightBranch; static tTrackLights trackLights; //static void setOnOff( tLightInfo *light, char onoff ); static void calcNorm( sgVec3 topleft, sgVec3 bottomright, sgVec3 *result ) { (*result)[ 0 ] = bottomright[ 1 ] - topleft[ 1 ]; (*result)[ 1 ] = topleft[ 0 ] - bottomright[ 0 ]; (*result)[ 2 ] = 0.0f; } static ssgSimpleState* createState( char const *filename ) { tStateList *current = statelist; while( current && current->state ) { if( strcmp( filename, current->state->getTextureFilename() ) == 0 ) { return current->state; } current = current->next; } current = (tStateList*)malloc( sizeof( tStateList ) ); current->state = new ssgSimpleState(); if( !current->state ) { free( current ); return NULL; } current->state->disable( GL_LIGHTING ); current->state->enable( GL_BLEND ); current->state->enable( GL_CULL_FACE ); current->state->enable( GL_TEXTURE_2D ); current->state->setColourMaterial( GL_AMBIENT_AND_DIFFUSE ); current->state->setTexture( filename, TRUE, TRUE, TRUE ); current->state->ref(); current->next = statelist; statelist = current; return current->state; } static void deleteStates() { tStateList *current = statelist; tStateList *next; while( current ) { next = current->next; if( current->state ) { current->state->deRef(); delete current->state; } free( current ); current = next; } } static void addLight( tGraphicLightInfo *info, tTrackLights *lights, ssgBranch *parent ) { tLightInfo *trackLight; int states = 2; ssgVertexArray *vertexArray = new ssgVertexArray( 4 ); ssgNormalArray *normalArray = new ssgNormalArray( 4 ); ssgColourArray *colourArray = new ssgColourArray( 4 ); ssgTexCoordArray *texArray = new ssgTexCoordArray( 4 ); sgVec3 vertex; sgVec3 normal; sgVec4 colour; sgVec2 texcoord; colour[ 0 ] = info->red; colour[ 1 ] = info->green; colour[ 2 ] = info->blue; colour[ 3 ] = 1.0f; colourArray->add( colour ); colourArray->add( colour ); colourArray->add( colour ); colourArray->add( colour ); vertex[ 0 ] = info->topleft.x; vertex[ 1 ] = info->topleft.y; vertex[ 2 ] = info->topleft.z; vertexArray->add( vertex ); vertex[ 2 ] = info->bottomright.z; vertexArray->add( vertex ); vertex[ 0 ] = info->bottomright.x; vertex[ 1 ] = info->bottomright.y; vertex[ 2 ] = info->topleft.z; //? vertexArray->add( vertex ); vertex[ 2 ] = info->topleft.z; vertex[ 2 ] = info->bottomright.z; //? vertexArray->add( vertex ); calcNorm( vertexArray->get( 0 ), vertexArray->get( 2 ), &normal ); normalArray->add( normal ); normalArray->add( normal ); normalArray->add( normal ); normalArray->add( normal ); texcoord[ 0 ] = 0.0f; texcoord[ 1 ] = 0.0f; texArray->add( texcoord ); texcoord[ 0 ] = 0.0f; texcoord[ 1 ] = 1.0f; texArray->add( texcoord ); texcoord[ 0 ] = 1.0f; texcoord[ 1 ] = 0.0f; texArray->add( texcoord ); texcoord[ 0 ] = 1.0f; texcoord[ 1 ] = 1.0f; texArray->add( texcoord ); if( info->role == GR_TRACKLIGHT_START_YELLOW || info->role == GR_TRACKLIGHT_POST_YELLOW || info->role == GR_TRACKLIGHT_POST_GREEN || info->role == GR_TRACKLIGHT_POST_RED || info->role == GR_TRACKLIGHT_POST_BLUE || info->role == GR_TRACKLIGHT_POST_WHITE || info->role == GR_TRACKLIGHT_PIT_BLUE ) { states = 3; } trackLight = (tLightInfo*)malloc( sizeof( tLightInfo ) ); trackLight->index = info->index; trackLight->light = new ssgVtxTable( GL_TRIANGLE_STRIP, vertexArray, normalArray, texArray, colourArray ); trackLight->states = new ssgStateSelector( states ); trackLight->states->setStep( 0, createState( info->offTexture ) ); trackLight->states->setStep( 1 + MAX( states - 2, info->index % 2 ), createState( info->onTexture ) ); if( states == 3 ) trackLight->states->setStep( 1 + ( info->index + 1 ) % 2, createState( info->offTexture ) ); trackLight->states->selectStep( 0 ); trackLight->light->setState( trackLight->states ); //trackLight->onState = createState( info->onTexture ); //trackLight->offState = createState( info->offTexture ); switch( info->role ) { case GR_TRACKLIGHT_START_RED: trackLight->next = lights->st_red; lights->st_red = trackLight; break; case GR_TRACKLIGHT_START_GREEN: trackLight->next = lights->st_green; lights->st_green = trackLight; break; case GR_TRACKLIGHT_START_GREENSTART: trackLight->next = lights->st_green_st; lights->st_green_st = trackLight; break; case GR_TRACKLIGHT_START_YELLOW: trackLight->next = lights->st_yellow; lights->st_yellow = trackLight; break; case GR_TRACKLIGHT_POST_YELLOW: case GR_TRACKLIGHT_POST_GREEN: case GR_TRACKLIGHT_POST_RED: case GR_TRACKLIGHT_POST_BLUE: case GR_TRACKLIGHT_POST_WHITE: case GR_TRACKLIGHT_PIT_RED: case GR_TRACKLIGHT_PIT_GREEN: case GR_TRACKLIGHT_PIT_BLUE: default: delete trackLight->light; free( trackLight ); return; } parent->addKid( trackLight->light ); } static void addLights( tTrackLights *lights, ssgBranch *parent ) { int xx; for( xx = 0; xx < grTrack->graphic.nb_lights; ++xx ) addLight( &(grTrack->graphic.lights[ xx ]), lights, parent ); } static void manageStartLights( tTrackLights *startlights, tSituation *s, char phase ) { static int onoff_red_index = -1; static char onoff_red = FALSE; static char onoff_green = FALSE; static char onoff_green_st = FALSE; static char onoff_yellow = FALSE; static char onoff_phase = 1; char onoff; int current_index; char active = s->currentTime >= 0.0f && ( s->_totTime < 0.0f || s->currentTime < s->_totTime ); tLightInfo *current; if( s->currentTime < 0.0f ) current_index = (int)floor( s->currentTime * -10.0f ); else current_index = -1; current = startlights->st_red; onoff = !active && s->_raceType != RM_TYPE_RACE; if( current_index != onoff_red_index || onoff != onoff_red ) { onoff_red_index = current_index; onoff_red = onoff; while( current ) { //setOnOff( current, onoff || ( current_index >= 0 && current_index < current->index ) ); current->states->selectStep( ( onoff || ( current_index >= 0 && current_index < current->index ) ) ? 1 : 0 ); current = current->next; } } current = startlights->st_green; onoff = active && s->_raceType != RM_TYPE_RACE; if( onoff_green != onoff ) { onoff_green = onoff; while( current ) { //setOnOff( current, onoff ); current->states->selectStep( onoff ? 1 : 0 ); current = current->next; } } current = startlights->st_green_st; onoff = active && ( s->_raceType != RM_TYPE_RACE || s->currentTime < 30.0f ); if( onoff_green_st != onoff ) { onoff_green_st = onoff; while( current ) { //setOnOff( current, onoff ); current->states->selectStep( onoff ? 1 : 0 ); current = current->next; } } current = startlights->st_yellow; onoff = FALSE; if( onoff_yellow != onoff || ( onoff && phase != onoff_phase ) ) { onoff_yellow = onoff; while( current ) { //setOnOff( current, onoff ? ( phase + current->index ) % 2 : 0 ); current->states->selectStep( onoff ? phase : 0 ); current = current->next; } } onoff_phase = phase; } /*static void setOnOff( tLightInfo *light, char onoff ) { ssgSimpleState *sstate; if( !light ) return; sstate = onoff ? light->onState : light->offState; if( light->light != NULL && light->light->getState() != sstate ) light->light->setState( sstate ); }*/ void grTrackLightInit() { statelist = NULL; lightBranch = new ssgBranch(); TrackLightAnchor->addKid( lightBranch ); memset( &trackLights, 0, sizeof( tTrackLights ) ); addLights( &trackLights, lightBranch ); } void grTrackLightUpdate( tSituation *s ) { char phase = ( (int)floor( fmod( s->currentTime + 120.0f, (double)0.3f ) / 0.3f ) % 2 ) + 1; manageStartLights( &trackLights, s, phase ); } void grTrackLightShutdown() { TrackLightAnchor->removeAllKids(); //lightBranch->removeAllKids(); /*delete lightBranch;*/ lightBranch = NULL; deleteStates(); }
xy008areshsu/speed-dreams-2
src/modules/graphic/ssggraph/grtracklight.cpp
C++
gpl-2.0
8,533
[ 30522, 1001, 2065, 13629, 2546, 30524, 1044, 1028, 1001, 2421, 1026, 2679, 2386, 1012, 1044, 1028, 1001, 2421, 1026, 2650, 1012, 1044, 1028, 1001, 2421, 1000, 24665, 11020, 8625, 1012, 1044, 1000, 21189, 12879, 2358, 6820, 6593, 2422, 2378,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
import { combineReducers } from 'redux' import auth from './auth' import watt from './watt' import locations from './locations' export default combineReducers({ auth, watt, locations })
tombatossals/energy
src/reducers/index.js
JavaScript
mit
193
[ 30522, 12324, 1063, 11506, 5596, 18796, 2869, 1065, 2013, 1005, 2417, 5602, 1005, 12324, 8740, 2705, 2013, 1005, 1012, 1013, 8740, 2705, 1005, 12324, 15231, 2013, 1005, 1012, 1013, 15231, 1005, 12324, 5269, 2013, 1005, 1012, 1013, 5269, 100...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/** * Orthanc - A Lightweight, RESTful DICOM Store * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU Affero General Public License * as published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. **/ #include "SeriesVolumeSorter.h" #include <algorithm> #include <limits> #include <math.h> #include <cassert> namespace OrthancPlugins { SeriesVolumeSorter::SeriesVolumeSorter() : isVolume_(true), sorted_(true) { } void SeriesVolumeSorter::Reserve(size_t countInstances) { positions_.reserve(countInstances); indexes_.reserve(countInstances); } void SeriesVolumeSorter::AddInstance(const std::string& instanceId, const InstanceInformation& instance) { if (instance.HasIndexInSeries()) { indexes_.push_back(std::make_pair(instanceId, instance.GetIndexInSeries())); } if (!isVolume_ || !instance.HasPosition()) { isVolume_ = false; } else { if (positions_.size() == 0) { // This is the first slice in a possible 3D volume. Remember its normal. normal_[0] = instance.GetNormal(0); normal_[1] = instance.GetNormal(1); normal_[2] = instance.GetNormal(2); } else { static const float THRESHOLD = 10.0f * std::numeric_limits<float>::epsilon(); // This is still a possible 3D volume. Check whether the normal // is constant wrt. the previous slices. if (fabs(normal_[0] - instance.GetNormal(0)) > THRESHOLD || fabs(normal_[1] - instance.GetNormal(1)) > THRESHOLD || fabs(normal_[2] - instance.GetNormal(2)) > THRESHOLD) { // The normal is not constant, not a 3D volume. isVolume_ = false; positions_.clear(); } } if (isVolume_) { float distance = (normal_[0] * instance.GetPosition(0) + normal_[1] * instance.GetPosition(1) + normal_[2] * instance.GetPosition(2)); positions_.push_back(std::make_pair(instanceId, distance)); } } sorted_ = false; } std::string SeriesVolumeSorter::GetInstance(size_t index) { if (!sorted_) { if (isVolume_) { assert(indexes_.size() == positions_.size()); std::sort(positions_.begin(), positions_.end(), ComparePosition); float a = positions_.front().second; float b = positions_.back().second; assert(a <= b); if (fabs(b - a) <= 10.0f * std::numeric_limits<float>::epsilon()) { // Not enough difference between the minimum and maximum // positions along the normal of the volume isVolume_ = false; } } if (!isVolume_) { std::sort(indexes_.begin(), indexes_.end(), CompareIndex); } } if (isVolume_) { return positions_[index].first; } else { return indexes_[index].first; } } }
rbetancor/orthanc-webviewer
Plugin/SeriesVolumeSorter.cpp
C++
agpl-3.0
3,652
[ 30522, 1013, 1008, 1008, 1008, 2030, 21604, 2278, 1011, 1037, 12038, 1010, 2717, 3993, 4487, 9006, 3573, 1008, 9385, 1006, 1039, 1007, 2262, 1011, 2325, 28328, 8183, 16168, 2638, 1010, 2966, 5584, 1008, 2533, 1010, 2118, 2902, 1997, 17766, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!DOCTYPE html> <!--[if lt IE 9]><html class="no-js lt-ie9" lang="en" dir="ltr"><![endif]--> <!--[if gt IE 8]><!--> <html class="no-js" lang="en" dir="ltr"> <!--<![endif]--> <!-- Usage: /eic/site/ccc-rec.nsf/tpl-eng/template-1col.html?Open&id=3 (optional: ?Open&page=filename.html&id=x) --> <!-- Created: ; Product Code: 536; Server: stratnotes2.ic.gc.ca --> <head> <!-- Title begins / Début du titre --> <title> Pizza Pizza - Complete profile - Canadian Company Capabilities - Industries and Business - Industry Canada </title> <!-- Title ends / Fin du titre --> <!-- Meta-data begins / Début des métadonnées --> <meta charset="utf-8" /> <meta name="dcterms.language" title="ISO639-2" content="eng" /> <meta name="dcterms.title" content="" /> <meta name="description" content="" /> <meta name="dcterms.description" content="" /> <meta name="dcterms.type" content="report, data set" /> <meta name="dcterms.subject" content="businesses, industry" /> <meta name="dcterms.subject" content="businesses, industry" /> <meta name="dcterms.issued" title="W3CDTF" content="" /> <meta name="dcterms.modified" title="W3CDTF" content="" /> <meta name="keywords" content="" /> <meta name="dcterms.creator" content="" /> <meta name="author" content="" /> <meta name="dcterms.created" title="W3CDTF" content="" /> <meta name="dcterms.publisher" content="" /> <meta name="dcterms.audience" title="icaudience" content="" /> <meta name="dcterms.spatial" title="ISO3166-1" content="" /> <meta name="dcterms.spatial" title="gcgeonames" content="" /> <meta name="dcterms.format" content="HTML" /> <meta name="dcterms.identifier" title="ICsiteProduct" content="536" /> <!-- EPI-11240 --> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <!-- MCG-202 --> <meta content="width=device-width,initial-scale=1" name="viewport"> <!-- EPI-11567 --> <meta name = "format-detection" content = "telephone=no"> <!-- EPI-12603 --> <meta name="robots" content="noarchive"> <!-- EPI-11190 - Webtrends --> <script> var startTime = new Date(); startTime = startTime.getTime(); </script> <!--[if gte IE 9 | !IE ]><!--> <link href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/favicon.ico" rel="icon" type="image/x-icon"> <link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/wet-boew.min.css"> <!--<![endif]--> <link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/theme.min.css"> <!--[if lt IE 9]> <link href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/favicon.ico" rel="shortcut icon" /> <link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/ie8-wet-boew.min.css" /> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/js/ie8-wet-boew.min.js"></script> <![endif]--> <!--[if lte IE 9]> <![endif]--> <noscript><link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/noscript.min.css" /></noscript> <!-- Google Tag Manager DO NOT REMOVE OR MODIFY - NE PAS SUPPRIMER OU MODIFIER --> <script>dataLayer1 = [];</script> <!-- End Google Tag Manager --> <!-- EPI-11235 --> <link rel="stylesheet" href="/eic/home.nsf/css/add_WET_4-0_Canada_Apps.css"> <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet"> <link href="/app/ccc/srch/css/print.css" media="print" rel="stylesheet" type="text/css" /> </head> <body class="home" vocab="http://schema.org/" typeof="WebPage"> <!-- EPIC HEADER BEGIN --> <!-- Google Tag Manager DO NOT REMOVE OR MODIFY - NE PAS SUPPRIMER OU MODIFIER --> <noscript><iframe title="Google Tag Manager" src="//www.googletagmanager.com/ns.html?id=GTM-TLGQ9K" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer1'?'&l='+l:'';j.async=true;j.src='//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer1','GTM-TLGQ9K');</script> <!-- End Google Tag Manager --> <!-- EPI-12801 --> <span typeof="Organization"><meta property="legalName" content="Department_of_Industry"></span> <ul id="wb-tphp"> <li class="wb-slc"> <a class="wb-sl" href="#wb-cont">Skip to main content</a> </li> <li class="wb-slc visible-sm visible-md visible-lg"> <a class="wb-sl" href="#wb-info">Skip to "About this site"</a> </li> </ul> <header role="banner"> <div id="wb-bnr" class="container"> <section id="wb-lng" class="visible-md visible-lg text-right"> <h2 class="wb-inv">Language selection</h2> <div class="row"> <div class="col-md-12"> <ul class="list-inline mrgn-bttm-0"> <li><a href="nvgt.do?V_TOKEN=1492309590010&V_SEARCH.docsCount=3&V_DOCUMENT.docRank=35711&V_SEARCH.docsStart=35710&V_SEARCH.command=navigate&V_SEARCH.resultsJSP=/prfl.do&lang=fra&redirectUrl=/app/scr/imbs/ccc/rgstrtn/updt.sec?_flId?_flxKy=e1s1&amp;estblmntNo=234567041301&amp;profileId=61&amp;_evId=bck&amp;lang=eng&amp;V_SEARCH.showStricts=false&amp;prtl=1&amp;_flId?_flId?_flxKy=e1s1" title="Français" lang="fr">Français</a></li> </ul> </div> </div> </section> <div class="row"> <div class="brand col-xs-8 col-sm-9 col-md-6"> <a href="http://www.canada.ca/en/index.html"><object type="image/svg+xml" tabindex="-1" data="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/sig-blk-en.svg"></object><span class="wb-inv"> Government of Canada</span></a> </div> <section class="wb-mb-links col-xs-4 col-sm-3 visible-sm visible-xs" id="wb-glb-mn"> <h2>Search and menus</h2> <ul class="list-inline text-right chvrn"> <li><a href="#mb-pnl" title="Search and menus" aria-controls="mb-pnl" class="overlay-lnk" role="button"><span class="glyphicon glyphicon-search"><span class="glyphicon glyphicon-th-list"><span class="wb-inv">Search and menus</span></span></span></a></li> </ul> <div id="mb-pnl"></div> </section> <!-- Site Search Removed --> </div> </div> <nav role="navigation" id="wb-sm" class="wb-menu visible-md visible-lg" data-trgt="mb-pnl" data-ajax-fetch="//cdn.canada.ca/gcweb-cdn-dev/sitemenu/sitemenu-en.html" typeof="SiteNavigationElement"> <h2 class="wb-inv">Topics menu</h2> <div class="container nvbar"> <div class="row"> <ul class="list-inline menu"> <li><a href="https://www.canada.ca/en/services/jobs.html">Jobs</a></li> <li><a href="http://www.cic.gc.ca/english/index.asp">Immigration</a></li> <li><a href="https://travel.gc.ca/">Travel</a></li> <li><a href="https://www.canada.ca/en/services/business.html">Business</a></li> <li><a href="https://www.canada.ca/en/services/benefits.html">Benefits</a></li> <li><a href="http://healthycanadians.gc.ca/index-eng.php">Health</a></li> <li><a href="https://www.canada.ca/en/services/taxes.html">Taxes</a></li> <li><a href="https://www.canada.ca/en/services.html">More services</a></li> </ul> </div> </div> </nav> <!-- EPIC BODY BEGIN --> <nav role="navigation" id="wb-bc" class="" property="breadcrumb"> <h2 class="wb-inv">You are here:</h2> <div class="container"> <div class="row"> <ol class="breadcrumb"> <li><a href="/eic/site/icgc.nsf/eng/home" title="Home">Home</a></li> <li><a href="/eic/site/icgc.nsf/eng/h_07063.html" title="Industries and Business">Industries and Business</a></li> <li><a href="/eic/site/ccc-rec.nsf/tpl-eng/../eng/home" >Canadian Company Capabilities</a></li> </ol> </div> </div> </nav> </header> <main id="wb-cont" role="main" property="mainContentOfPage" class="container"> <!-- End Header --> <!-- Begin Body --> <!-- Begin Body Title --> <!-- End Body Title --> <!-- Begin Body Head --> <!-- End Body Head --> <!-- Begin Body Content --> <br> <!-- Complete Profile --> <!-- Company Information above tabbed area--> <input id="showMore" type="hidden" value='more'/> <input id="showLess" type="hidden" value='less'/> <h1 id="wb-cont"> Company profile - Canadian Company Capabilities </h1> <div class="profileInfo hidden-print"> <ul class="list-inline"> <li><a href="cccSrch.do?lang=eng&profileId=&prtl=1&key.hitsPerPage=25&searchPage=%252Fapp%252Fccc%252Fsrch%252FcccBscSrch.do%253Flang%253Deng%2526amp%253Bprtl%253D1%2526amp%253Btagid%253D&V_SEARCH.scopeCategory=CCC.Root&V_SEARCH.depth=1&V_SEARCH.showStricts=false&V_SEARCH.sortSpec=title+asc&amp;rstBtn.x=" class="btn btn-link">New Search</a>&nbsp;|</li> <li><form name="searchForm" method="post" action="/app/ccc/srch/bscSrch.do"> <input type="hidden" name="lang" value="eng" /> <input type="hidden" name="profileId" value="" /> <input type="hidden" name="prtl" value="1" /> <input type="hidden" name="searchPage" value="%2Fapp%2Fccc%2Fsrch%2FcccBscSrch.do%3Flang%3Deng%26amp%3Bprtl%3D1%26amp%3Btagid%3D" /> <input type="hidden" name="V_SEARCH.scopeCategory" value="CCC.Root" /> <input type="hidden" name="V_SEARCH.depth" value="1" /> <input type="hidden" name="V_SEARCH.showStricts" value="false" /> <input id="repeatSearchBtn" class="btn btn-link" type="submit" value="Return to search results" /> </form></li> <li>|&nbsp;<a href="nvgt.do?V_SEARCH.docsStart=35709&amp;V_DOCUMENT.docRank=35710&amp;V_SEARCH.docsCount=3&amp;lang=eng&amp;prtl=1&amp;sbPrtl=&amp;profile=cmpltPrfl&amp;V_TOKEN=1492309607544&amp;V_SEARCH.command=navigate&amp;V_SEARCH.resultsJSP=%2fprfl.do&amp;estblmntNo=234567165022&amp;profileId=&amp;key.newSearchLabel=">Previous Company</a></li> <li>|&nbsp;<a href="nvgt.do?V_SEARCH.docsStart=35711&amp;V_DOCUMENT.docRank=35712&amp;V_SEARCH.docsCount=3&amp;lang=eng&amp;prtl=1&amp;sbPrtl=&amp;profile=cmpltPrfl&amp;V_TOKEN=1492309607544&amp;V_SEARCH.command=navigate&amp;V_SEARCH.resultsJSP=%2fprfl.do&amp;estblmntNo=234567164568&amp;profileId=&amp;key.newSearchLabel=">Next Company</a></li> </ul> </div> <details> <summary>Third-Party Information Liability Disclaimer</summary> <p>Some of the information on this Web page has been provided by external sources. The Government of Canada is not responsible for the accuracy, reliability or currency of the information supplied by external sources. Users wishing to rely upon this information should consult directly with the source of the information. Content provided by external sources is not subject to official languages, privacy and accessibility requirements.</p> </details> <h2> Pizza Pizza </h2> <div class="row"> <div class="col-md-5"> <h2 class="h5 mrgn-bttm-0">Legal/Operating Name:</h2> <p>Pizza Pizza</p> <div class="mrgn-tp-md"></div> <p class="mrgn-bttm-0" ><a href="http://www.pizzapizza.ca" target="_blank" title="Website URL">http://www.pizzapizza.ca</a></p> <p><a href="mailto:feedback@pizzapizza.ca" title="feedback@pizzapizza.ca">feedback@pizzapizza.ca</a></p> </div> <div class="col-md-4 mrgn-sm-sm"> <h2 class="h5 mrgn-bttm-0">Mailing Address:</h2> <address class="mrgn-bttm-md"> 735 Guelph Line<br/> BURLINGTON, Ontario<br/> L7R 3N2 <br/> </address> <h2 class="h5 mrgn-bttm-0">Location Address:</h2> <address class="mrgn-bttm-md"> 735 Guelph Line<br/> BURLINGTON, Ontario<br/> L7R 3N2 <br/> </address> <p class="mrgn-bttm-0"><abbr title="Telephone">Tel.</abbr>: (905) 527-1111 </p> <p class="mrgn-bttm-lg"><abbr title="Facsimile">Fax</abbr>: </p> </div> <div class="col-md-3 mrgn-tp-md"> </div> </div> <div class="row mrgn-tp-md mrgn-bttm-md"> <div class="col-md-12"> <h2 class="wb-inv">Company Profile</h2> <br> Pizza Pizza at 735 GUELPH LINE is located In the BURLINGTON MALL at Prospect St. Pizza Pizza is Canada&#39;s number one destination for Hot and Fresh pizza. We offer Old-School, Gourmet and International Pizza recipes as well as wings, pasta, salads and sandwiches. Our growing menu and restaurant locations make us the best choice for people who don&#39;t want to sacrifice taste for quality and balanced food options. Since 1967, Pizza Pizza has been guided by a vision to provide the “best food, made especially for you” with a focus on quality ingredients, customer service, continuous innovation and community involvement. In 2013, Foodservice and Hospitality Magazine named Pizza Pizza Limited Company of the Year. <br><br> </div> </div> <!-- <div class="wb-tabs ignore-session update-hash wb-eqht-off print-active"> --> <div class="wb-tabs ignore-session"> <div class="tabpanels"> <details id="details-panel1"> <summary> Full profile </summary> <!-- Tab 1 --> <h2 class="wb-invisible"> Full profile </h2> <!-- Contact Information --> <h3 class="page-header"> Contact information </h3> <section class="container-fluid"> <div class="row mrgn-tp-lg"> <div class="col-md-3"> <strong> General Inquiries </strong></div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Telephone: </strong> </div> <div class="col-md-7"> (416) 967-1111 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Email: </strong> </div> <div class="col-md-7"> directories@pizzapizza.ca </div> </div> </section> <p class="mrgn-tp-lg text-right small hidden-print"> <a href="#wb-cont">top of page</a> </p> <!-- Company Description --> <h3 class="page-header"> Company description </h3> <section class="container-fluid"> <div class="row"> <div class="col-md-5"> <strong> Exporting: </strong> </div> <div class="col-md-7"> No &nbsp; </div> </div> <div class="row"> <div class="col-md-5"> <strong> Primary Industry (NAICS): </strong> </div> <div class="col-md-7"> 722210 - Limited-Service Eating Places </div> </div> <div class="row"> <div class="col-md-5"> <strong> Primary Business Activity: </strong> </div> <div class="col-md-7"> Retail &nbsp; </div> </div> </section> <!-- Products / Services / Licensing --> <h3 class="page-header"> Product / Service / Licensing </h3> <section class="container-fluid"> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> pizza<br> </div> </div> </section> <p class="mrgn-tp-lg text-right small hidden-print"> <a href="#wb-cont">top of page</a> </p> <!-- Technology Profile --> <!-- Market Profile --> <!-- Sector Information --> <details class="mrgn-tp-md mrgn-bttm-md"> <summary> Third-Party Information Liability Disclaimer </summary> <p> Some of the information on this Web page has been provided by external sources. The Government of Canada is not responsible for the accuracy, reliability or currency of the information supplied by external sources. Users wishing to rely upon this information should consult directly with the source of the information. Content provided by external sources is not subject to official languages, privacy and accessibility requirements. </p> </details> </details> <details id="details-panel2"> <summary> Contacts </summary> <h2 class="wb-invisible"> Contact information </h2> <!-- Contact Information --> <section class="container-fluid"> <div class="row mrgn-tp-lg"> <div class="col-md-3"> <strong> General Inquiries </strong></div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Telephone: </strong> </div> <div class="col-md-7"> (416) 967-1111 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Email: </strong> </div> <div class="col-md-7"> directories@pizzapizza.ca </div> </div> </section> </details> <details id="details-panel3"> <summary> Description </summary> <h2 class="wb-invisible"> Company description </h2> <section class="container-fluid"> <div class="row"> <div class="col-md-5"> <strong> Exporting: </strong> </div> <div class="col-md-7"> No &nbsp; </div> </div> <div class="row"> <div class="col-md-5"> <strong> Primary Industry (NAICS): </strong> </div> <div class="col-md-7"> 722210 - Limited-Service Eating Places </div> </div> <div class="row"> <div class="col-md-5"> <strong> Primary Business Activity: </strong> </div> <div class="col-md-7"> Retail &nbsp; </div> </div> </section> </details> <details id="details-panel4"> <summary> Products, services and licensing </summary> <h2 class="wb-invisible"> Product / Service / Licensing </h2> <section class="container-fluid"> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> pizza<br> </div> </div> </section> </details> </div> </div> <div class="row"> <div class="col-md-12 text-right"> Last Update Date 2016-11-09 </div> </div> <!-- - Artifact ID: CBW - IMBS - CCC Search WAR - Group ID: ca.gc.ic.strategis.imbs.ccc.search - Version: 3.26 - Built-By: bamboo - Build Timestamp: 2017-03-02T21:29:28Z --> <!-- End Body Content --> <!-- Begin Body Foot --> <!-- End Body Foot --> <!-- END MAIN TABLE --> <!-- End body --> <!-- Begin footer --> <div class="row pagedetails"> <div class="col-sm-5 col-xs-12 datemod"> <dl id="wb-dtmd"> <dt class=" hidden-print">Date Modified:</dt> <dd class=" hidden-print"> <span><time>2017-03-02</time></span> </dd> </dl> </div> <div class="clear visible-xs"></div> <div class="col-sm-4 col-xs-6"> </div> <div class="col-sm-3 col-xs-6 text-right"> </div> <div class="clear visible-xs"></div> </div> </main> <footer role="contentinfo" id="wb-info"> <nav role="navigation" class="container wb-navcurr"> <h2 class="wb-inv">About government</h2> <!-- EPIC FOOTER BEGIN --> <!-- EPI-11638 Contact us --> <ul class="list-unstyled colcount-sm-2 colcount-md-3"> <li><a href="http://www.ic.gc.ca/eic/site/icgc.nsf/eng/h_07026.html#pageid=E048-H00000&amp;from=Industries">Contact us</a></li> <li><a href="https://www.canada.ca/en/government/dept.html">Departments and agencies</a></li> <li><a href="https://www.canada.ca/en/government/publicservice.html">Public service and military</a></li> <li><a href="https://www.canada.ca/en/news.html">News</a></li> <li><a href="https://www.canada.ca/en/government/system/laws.html">Treaties, laws and regulations</a></li> <li><a href="https://www.canada.ca/en/transparency/reporting.html">Government-wide reporting</a></li> <li><a href="http://pm.gc.ca/eng">Prime Minister</a></li> <li><a href="https://www.canada.ca/en/government/system.html">How government works</a></li> <li><a href="http://open.canada.ca/en/">Open government</a></li> </ul> </nav> <div class="brand"> <div class="container"> <div class="row"> <nav class="col-md-10 ftr-urlt-lnk"> <h2 class="wb-inv">About this site</h2> <ul> <li><a href="https://www.canada.ca/en/social.html">Social media</a></li> <li><a href="https://www.canada.ca/en/mobile.html">Mobile applications</a></li> <li><a href="http://www1.canada.ca/en/newsite.html">About Canada.ca</a></li> <li><a href="http://www.ic.gc.ca/eic/site/icgc.nsf/eng/h_07033.html">Terms and conditions</a></li> <li><a href="http://www.ic.gc.ca/eic/site/icgc.nsf/eng/h_07033.html#p1">Privacy</a></li> </ul> </nav> <div class="col-xs-6 visible-sm visible-xs tofpg"> <a href="#wb-cont">Top of Page <span class="glyphicon glyphicon-chevron-up"></span></a> </div> <div class="col-xs-6 col-md-2 text-right"> <object type="image/svg+xml" tabindex="-1" role="img" data="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/wmms-blk.svg" aria-label="Symbol of the Government of Canada"></object> </div> </div> </div> </div> </footer> <!--[if gte IE 9 | !IE ]><!--> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script src="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/js/wet-boew.min.js"></script> <!--<![endif]--> <!--[if lt IE 9]> <script src="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/js/ie8-wet-boew2.min.js"></script> <![endif]--> <script src="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/js/theme.min.js"></script> <!-- EPI-10519 --> <span class="wb-sessto" data-wb-sessto='{"inactivity": 1800000, "reactionTime": 180000, "sessionalive": 1800000, "logouturl": "/app/ccc/srch/cccSrch.do?lang=eng&prtl=1"}'></span> <script src="/eic/home.nsf/js/jQuery.externalOpensInNewWindow.js"></script> <!-- EPI-11190 - Webtrends --> <script src="/eic/home.nsf/js/webtrends.js"></script> <script>var endTime = new Date();</script> <noscript> <div><img alt="" id="DCSIMG" width="1" height="1" src="//wt-sdc.ic.gc.ca/dcs6v67hwe0ei7wsv8g9fv50d_3k6i/njs.gif?dcsuri=/nojavascript&amp;WT.js=No&amp;WT.tv=9.4.0&amp;dcssip=www.ic.gc.ca"/></div> </noscript> <!-- /Webtrends --> <!-- JS deps --> <script src="/eic/home.nsf/js/jquery.imagesloaded.js"></script> <!-- EPI-11262 - Util JS --> <script src="/eic/home.nsf/js/_WET_4-0_utils_canada.min.js"></script> <!-- EPI-11383 --> <script src="/eic/home.nsf/js/jQuery.icValidationErrors.js"></script> <span style="display:none;" id='app-info' data-project-groupid='' data-project-artifactid='' data-project-version='' data-project-build-timestamp='' data-issue-tracking='' data-scm-sha1='' data-scm-sha1-abbrev='' data-scm-branch='' data-scm-commit-date=''></span> </body></html> <!-- End Footer --> <!-- - Artifact ID: CBW - IMBS - CCC Search WAR - Group ID: ca.gc.ic.strategis.imbs.ccc.search - Version: 3.26 - Built-By: bamboo - Build Timestamp: 2017-03-02T21:29:28Z -->
GoC-Spending/data-corporations
html/234567165009.html
HTML
mit
31,021
[ 30522, 1026, 999, 9986, 13874, 16129, 1028, 1026, 999, 1011, 1011, 1031, 2065, 8318, 29464, 1023, 1033, 1028, 1026, 16129, 2465, 1027, 1000, 2053, 1011, 1046, 2015, 8318, 1011, 29464, 2683, 1000, 11374, 1027, 1000, 4372, 1000, 16101, 1027, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
{% extends "base.html" %} {% load staticfiles %} {% load analysis_tags %} {% block content %} <script type='text/javascript'> $(function () { $('[data-toggle="tooltip"]').tooltip() }); </script> <div class="flex-nav"> {% include "analysis/pages/nav-sidebar.html" %} <section class="flex-nav__body cuckoo-analysis" tabindex="0"> <header class="page-header cuckoo-analysis__header"> <h1>Compare</h1> </header> <div class="container-fluid"> <div class="row"> <div class="col-md-6" style="border-right: 1px dashed #878787;"> <h2 style="text-align: center;">Analysis 1</h2> <hr> {% include "analysis/pages/compare/_info.html" with record=left %} <div class="col-md-8"> <h4>Execution Graph</h4> <p>This graph gives you an abstracted overview of the execution of the analyzer file. More specifically it represents the percentage of occurrences of behavioral events classified by category: the bigger the colored block, the higher is the count of events for the respective category performed by the analyzed malware</p> <p>Comparing two graphs from different analyses can give you help estimate how much the behavior of the two files differ.</p> <p>Following are the colored categories:</p> <p style="text-align: center;"> <span class="badge registry" style="color:black;">registry</span> <span class="badge file" style="color:black;">file</span> <span class="badge system" style="color:black;">system</span> <span class="badge network" style="color:black;">network</span> <span class="badge process" style="color:black;">process</span> <span class="badge services" style="color:black;">services</span> <span class="badge synchronization" style="color:black;">synchronization</span> <span class="badge windows" style="color:black;">windows</span> </p> </div> <div class="col-md-4"> <div style="height: 300px;border: 2px solid #666;"> {% for cat, count in left_counts.items %} <div style="height: {{count}}%" class="{{cat}}" data-toggle="tooltip" data-placement="top" title="{{count}}% {{cat}}"></div> {% endfor %} </div> </div> </div> <div class="col-md-6"> <h2 style="text-align: center;">Analysis 2</h2> <hr> {% include "analysis/pages/compare/_info.html" with record=right %} <div class="col-md-4"> <div style="height: 300px;border: 2px solid #666;"> {% for cat, count in right_counts.items %} <div style="height: {{count}}%" class="{{cat}}" data-toggle="tooltip" data-placement="top" title="{{count}}% {{cat}}"></div> {% endfor %} </div> </div> <div class="col-md-8"></div> </div> </div> </div> <!-- footer replacement to avoid double scrollbars --> <footer class="flex-grid__footer spread-alignment"> <p class="footnote"> &copy;2010-2018 <a href="https://www.cuckoosandbox.org" target="_blank">Cuckoo Sandbox</a> </p> <div class="logo"> <img src="{% static "graphic/cuckoo_inverse.png" %}" alt="Cuckoo Malware Analysis Sandbox" /> <a href="#">Back to Top</a> </div> </footer> </section> </div> {% endblock %}
cuckoobox/cuckoo
cuckoo/web/templates/analysis/pages/compare/both.html
HTML
mit
4,409
[ 30522, 1063, 1003, 8908, 1000, 2918, 1012, 16129, 1000, 1003, 1065, 1063, 1003, 7170, 10763, 8873, 4244, 1003, 1065, 1063, 1003, 7170, 4106, 1035, 22073, 1003, 1065, 1063, 1003, 3796, 4180, 1003, 1065, 1026, 5896, 2828, 1027, 1005, 3793, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/file_util.h" #include "base/files/scoped_temp_dir.h" #include "base/test/test_simple_task_runner.h" #include "base/threading/thread.h" #include "content/browser/browser_thread_impl.h" #include "content/browser/indexed_db/indexed_db_connection.h" #include "content/browser/indexed_db/indexed_db_context_impl.h" #include "content/browser/indexed_db/mock_indexed_db_callbacks.h" #include "content/browser/indexed_db/mock_indexed_db_database_callbacks.h" #include "content/public/browser/storage_partition.h" #include "content/public/common/url_constants.h" #include "content/public/test/test_browser_context.h" #include "testing/gtest/include/gtest/gtest.h" #include "webkit/browser/quota/mock_special_storage_policy.h" #include "webkit/browser/quota/quota_manager.h" #include "webkit/browser/quota/special_storage_policy.h" #include "webkit/common/database/database_identifier.h" namespace content { class IndexedDBTest : public testing::Test { public: const GURL kNormalOrigin; const GURL kSessionOnlyOrigin; IndexedDBTest() : kNormalOrigin("http://normal/"), kSessionOnlyOrigin("http://session-only/"), message_loop_(base::MessageLoop::TYPE_IO), task_runner_(new base::TestSimpleTaskRunner), special_storage_policy_(new quota::MockSpecialStoragePolicy), file_thread_(BrowserThread::FILE_USER_BLOCKING, &message_loop_), io_thread_(BrowserThread::IO, &message_loop_) { special_storage_policy_->AddSessionOnly(kSessionOnlyOrigin); } protected: void FlushIndexedDBTaskRunner() { task_runner_->RunUntilIdle(); } base::MessageLoop message_loop_; scoped_refptr<base::TestSimpleTaskRunner> task_runner_; scoped_refptr<quota::MockSpecialStoragePolicy> special_storage_policy_; private: BrowserThreadImpl file_thread_; BrowserThreadImpl io_thread_; DISALLOW_COPY_AND_ASSIGN(IndexedDBTest); }; TEST_F(IndexedDBTest, ClearSessionOnlyDatabases) { base::ScopedTempDir temp_dir; ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); base::FilePath normal_path; base::FilePath session_only_path; // Create the scope which will ensure we run the destructor of the context // which should trigger the clean up. { scoped_refptr<IndexedDBContextImpl> idb_context = new IndexedDBContextImpl( temp_dir.path(), special_storage_policy_, NULL, task_runner_); normal_path = idb_context->GetFilePathForTesting( webkit_database::GetIdentifierFromOrigin(kNormalOrigin)); session_only_path = idb_context->GetFilePathForTesting( webkit_database::GetIdentifierFromOrigin(kSessionOnlyOrigin)); ASSERT_TRUE(file_util::CreateDirectory(normal_path)); ASSERT_TRUE(file_util::CreateDirectory(session_only_path)); FlushIndexedDBTaskRunner(); message_loop_.RunUntilIdle(); } FlushIndexedDBTaskRunner(); message_loop_.RunUntilIdle(); EXPECT_TRUE(base::DirectoryExists(normal_path)); EXPECT_FALSE(base::DirectoryExists(session_only_path)); } TEST_F(IndexedDBTest, SetForceKeepSessionState) { base::ScopedTempDir temp_dir; ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); base::FilePath normal_path; base::FilePath session_only_path; // Create the scope which will ensure we run the destructor of the context. { // Create some indexedDB paths. // With the levelDB backend, these are directories. scoped_refptr<IndexedDBContextImpl> idb_context = new IndexedDBContextImpl( temp_dir.path(), special_storage_policy_, NULL, task_runner_); // Save session state. This should bypass the destruction-time deletion. idb_context->SetForceKeepSessionState(); normal_path = idb_context->GetFilePathForTesting( webkit_database::GetIdentifierFromOrigin(kNormalOrigin)); session_only_path = idb_context->GetFilePathForTesting( webkit_database::GetIdentifierFromOrigin(kSessionOnlyOrigin)); ASSERT_TRUE(file_util::CreateDirectory(normal_path)); ASSERT_TRUE(file_util::CreateDirectory(session_only_path)); message_loop_.RunUntilIdle(); } // Make sure we wait until the destructor has run. message_loop_.RunUntilIdle(); // No data was cleared because of SetForceKeepSessionState. EXPECT_TRUE(base::DirectoryExists(normal_path)); EXPECT_TRUE(base::DirectoryExists(session_only_path)); } class MockConnection : public IndexedDBConnection { public: explicit MockConnection(bool expect_force_close) : IndexedDBConnection(NULL, NULL), expect_force_close_(expect_force_close), force_close_called_(false) {} virtual ~MockConnection() { EXPECT_TRUE(force_close_called_ == expect_force_close_); } virtual void ForceClose() OVERRIDE { ASSERT_TRUE(expect_force_close_); force_close_called_ = true; } virtual bool IsConnected() OVERRIDE { return !force_close_called_; } private: bool expect_force_close_; bool force_close_called_; }; TEST_F(IndexedDBTest, ForceCloseOpenDatabasesOnDelete) { base::ScopedTempDir temp_dir; ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); base::FilePath test_path; // Create the scope which will ensure we run the destructor of the context. { TestBrowserContext browser_context; const GURL kTestOrigin("http://test/"); scoped_refptr<IndexedDBContextImpl> idb_context = new IndexedDBContextImpl( temp_dir.path(), special_storage_policy_, NULL, task_runner_); test_path = idb_context->GetFilePathForTesting( webkit_database::GetIdentifierFromOrigin(kTestOrigin)); ASSERT_TRUE(file_util::CreateDirectory(test_path)); const bool kExpectForceClose = true; MockConnection connection1(kExpectForceClose); idb_context->TaskRunner()->PostTask( FROM_HERE, base::Bind(&IndexedDBContextImpl::ConnectionOpened, idb_context, kTestOrigin, &connection1)); MockConnection connection2(!kExpectForceClose); idb_context->TaskRunner()->PostTask( FROM_HERE, base::Bind(&IndexedDBContextImpl::ConnectionOpened, idb_context, kTestOrigin, &connection2)); idb_context->TaskRunner()->PostTask( FROM_HERE, base::Bind(&IndexedDBContextImpl::ConnectionClosed, idb_context, kTestOrigin, &connection2)); idb_context->TaskRunner()->PostTask( FROM_HERE, base::Bind( &IndexedDBContextImpl::DeleteForOrigin, idb_context, kTestOrigin)); FlushIndexedDBTaskRunner(); message_loop_.RunUntilIdle(); } // Make sure we wait until the destructor has run. message_loop_.RunUntilIdle(); EXPECT_FALSE(base::DirectoryExists(test_path)); } TEST_F(IndexedDBTest, DeleteFailsIfDirectoryLocked) { base::ScopedTempDir temp_dir; ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); const GURL kTestOrigin("http://test/"); scoped_refptr<IndexedDBContextImpl> idb_context = new IndexedDBContextImpl( temp_dir.path(), special_storage_policy_, NULL, task_runner_); base::FilePath test_path = idb_context->GetFilePathForTesting( webkit_database::GetIdentifierFromOrigin(kTestOrigin)); ASSERT_TRUE(file_util::CreateDirectory(test_path)); scoped_ptr<LevelDBLock> lock = LevelDBDatabase::LockForTesting(test_path); ASSERT_TRUE(lock); idb_context->TaskRunner()->PostTask( FROM_HERE, base::Bind( &IndexedDBContextImpl::DeleteForOrigin, idb_context, kTestOrigin)); FlushIndexedDBTaskRunner(); EXPECT_TRUE(base::DirectoryExists(test_path)); } TEST_F(IndexedDBTest, ForceCloseOpenDatabasesOnCommitFailure) { const GURL kTestOrigin("http://test/"); base::ScopedTempDir temp_dir; ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); scoped_refptr<IndexedDBContextImpl> context = new IndexedDBContextImpl( temp_dir.path(), special_storage_policy_, NULL, task_runner_); scoped_refptr<IndexedDBFactory> factory = context->GetIDBFactory(); scoped_refptr<MockIndexedDBCallbacks> callbacks(new MockIndexedDBCallbacks()); scoped_refptr<MockIndexedDBDatabaseCallbacks> db_callbacks( new MockIndexedDBDatabaseCallbacks()); const int64 transaction_id = 1; factory->Open(ASCIIToUTF16("db"), IndexedDBDatabaseMetadata::DEFAULT_INT_VERSION, transaction_id, callbacks, db_callbacks, kTestOrigin, temp_dir.path()); EXPECT_TRUE(callbacks->connection()); // ConnectionOpened() is usually called by the dispatcher. context->ConnectionOpened(kTestOrigin, callbacks->connection()); EXPECT_TRUE(factory->IsBackingStoreOpenForTesting(kTestOrigin)); // Simulate the write failure. callbacks->connection()->database()->TransactionCommitFailed(); EXPECT_TRUE(db_callbacks->forced_close_called()); EXPECT_FALSE(factory->IsBackingStoreOpenForTesting(kTestOrigin)); } } // namespace content
cvsuser-chromium/chromium
content/browser/indexed_db/indexed_db_unittest.cc
C++
bsd-3-clause
9,106
[ 30522, 1013, 1013, 9385, 1006, 1039, 1007, 2262, 1996, 10381, 21716, 5007, 6048, 1012, 2035, 2916, 9235, 1012, 1013, 1013, 2224, 1997, 2023, 3120, 3642, 2003, 9950, 2011, 1037, 18667, 2094, 1011, 2806, 6105, 2008, 2064, 2022, 1013, 1013, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
.sidebar .sidebar-nav.navbar-collapse { padding-right: 0; padding-left: 0; } .sidebar .sidebar-search { padding: 15px; } .sidebar ul li { border-bottom: 1px solid #e7e7e7; } .sidebar ul li a.active { background-color: #eee; } .sidebar .arrow { float: right; } .sidebar .fa.arrow:before { content: "\f104"; } .sidebar .active>a>.fa.arrow:before { content: "\f107"; } .sidebar .nav-second-level li, .sidebar .nav-third-level li { border-bottom: 0!important; } .sidebar .nav-second-level li a { padding-left: 37px; } .sidebar .nav-third-level li a { padding-left: 52px; } @media(min-width:768px) { .sidebar { z-index: 1; position: absolute; width: 250px; margin-top: 65px; } .navbar-top-links .dropdown-messages, .navbar-top-links .dropdown-tasks, .navbar-top-links .dropdown-alerts { margin-left: auto; } }
minziappa/abilists_apps
src/main/webapp/static/apps/css/admin/sidebar.css
CSS
apache-2.0
924
[ 30522, 1012, 2217, 8237, 1012, 2217, 8237, 1011, 6583, 2615, 1012, 6583, 26493, 2906, 1011, 7859, 1063, 11687, 4667, 1011, 2157, 1024, 1014, 1025, 11687, 4667, 1011, 2187, 1024, 1014, 1025, 1065, 1012, 2217, 8237, 1012, 2217, 8237, 1011, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// Copyright (C) 2014 The Regents of the University of California (Regents). // 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 The Regents or University of California 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 THE COPYRIGHT HOLDERS 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. // // Please contact the author of this library if you have any questions. // Author: Chris Sweeney (cmsweeney@cs.ucsb.edu) #include "convolution.h" #include <Eigen/Dense> #include <iostream> #ifdef AKAZE_USE_OPENMP #include <omp.h> #endif // AKAZE_USE_OPENMP namespace { using Eigen::Matrix; using Eigen::RowVectorXf; inline double Gaussian(double x, double mu, double sigma) { return std::exp(-(x - mu) * (x - mu) / (2.0 * sigma * sigma)); } } // namespace void SeparableConvolution2d(const RowMatrixXf& image, const Eigen::RowVectorXf& kernel_x, const Eigen::RowVectorXf& kernel_y, const BorderType& border_type, RowMatrixXf* out) { const int full_size = kernel_x.size(); const int half_size = full_size / 2; out->resize(image.rows(), image.cols()); // Convolving a vertical filter across rows is the same thing as transpose // multiply i.e. kernel_y^t * rows. This will give us the convoled value for // each row. However, care must be taken at the top and bottom borders. const RowVectorXf reverse_kernel_y = kernel_y.reverse(); if (border_type == REFLECT) { for (int i = 0; i < half_size; i++) { const int forward_size = i + half_size + 1; const int reverse_size = full_size - forward_size; out->row(i) = kernel_y.tail(forward_size) * image.block(0, 0, forward_size, image.cols()) + reverse_kernel_y.tail(reverse_size) * image.block(1, 0, reverse_size, image.cols()); // Apply the same technique for the end rows. // TODO(csweeney): Move this to its own loop for cache exposure? out->row(image.rows() - i - 1) = kernel_y.head(forward_size) * image.block(image.rows() - forward_size, 0, forward_size, image.cols()) + reverse_kernel_y.head(reverse_size) * image.block(image.rows() - reverse_size - 1, 0, reverse_size, image.cols()); } } else { // Perform border with REPLICATE as the option. for (int i = 0; i < half_size; i++) { const int forward_size = i + half_size + 1; const int reverse_size = full_size - forward_size; out->row(i) = kernel_y.tail(forward_size) * image.block(0, 0, forward_size, image.cols()) + reverse_kernel_y.tail(reverse_size) * image.row(0).replicate(reverse_size, 1); // Apply the same technique for the end rows. out->row(image.rows() - i - 1) = kernel_y.head(forward_size) * image.block(image.rows() - forward_size, 0, forward_size, image.cols()) + reverse_kernel_y.head(reverse_size) * image.row(image.rows() - 1).replicate(reverse_size, 1); } } // Applying the rest of the y filter. #ifdef AKAZE_USE_OPENMP #pragma omp parallel for #endif for (int row = half_size; row < image.rows() - half_size; row++) { out->row(row) = kernel_y * image.block(row - half_size, 0, full_size, out->cols()); } // Convolving with the horizontal filter is easy. Rather than using the kernel // as a sliding indow, we use the row pixels as a sliding window around the // filter. We prepend and append the proper border values so that we are sure // to end up with the correct convolved values. if (border_type == REFLECT) { RowVectorXf temp_row(image.cols() + full_size - 1); #ifdef AKAZE_USE_OPENMP #pragma omp parallel for firstprivate(temp_row) #endif for (int row = 0; row < out->rows(); row++) { temp_row.head(half_size) = out->row(row).segment(1, half_size).reverse(); temp_row.segment(half_size, image.cols()) = out->row(row); temp_row.tail(half_size) = out->row(row) .segment(image.cols() - 1 - half_size, half_size) .reverse(); // Convolve the row. We perform the first step here explicitly so that we // avoid setting the row equal to zero. out->row(row) = kernel_x(0) * temp_row.head(image.cols()); for (int i = 1; i < full_size; i++) { out->row(row) += kernel_x(i) * temp_row.segment(i, image.cols()); } } } else { RowVectorXf temp_row(image.cols() + full_size - 1); #ifdef AKAZE_USE_OPENMP #pragma omp parallel for firstprivate(temp_row) #endif for (int row = 0; row < out->rows(); row++) { temp_row.head(half_size).setConstant((*out)(row, 0)); temp_row.segment(half_size, image.cols()) = out->row(row); temp_row.tail(half_size).setConstant((*out)(row, out->cols() - 1)); // Convolve the row. We perform the first step here explicitly so that we // avoid setting the row equal to zero. out->row(row) = kernel_x(0) * temp_row.head(image.cols()); for (int i = 1; i < full_size; i++) { out->row(row) += kernel_x(i) * temp_row.segment(i, image.cols()); } } } } void ScharrDerivative(const RowMatrixXf& image, const int x_deg, const int y_deg, const int size, const bool normalize, RowMatrixXf* out) { const int sigma = size * 2 + 1; Eigen::RowVectorXf kernel1(sigma); kernel1.setZero(); kernel1(0) = -1.0; kernel1(sigma - 1) = 1.0; Eigen::RowVectorXf kernel2(sigma); kernel2.setZero(); if (!normalize) { kernel2(0) = 3; kernel2(sigma / 2) = 10; kernel2(sigma - 1) = 3; } else { float w = 10.0 / 3.0; float norm = 1.0 / (2.0 * size * (w + 2.0)); kernel2(0) = norm; kernel2(sigma / 2) = w * norm; kernel2(sigma - 1) = norm; } if (x_deg == 1) { SeparableConvolution2d(image, kernel1, kernel2, REFLECT, out); } else { SeparableConvolution2d(image, kernel2, kernel1, REFLECT, out); } return; } void GaussianBlur(const RowMatrixXf& image, const double sigma, RowMatrixXf* out) { int kernel_size = std::ceil(((sigma - 0.8) / 0.3 + 1.0) * 2.0); if (kernel_size % 2 == 0) { kernel_size += 1; } RowVectorXf gauss_kernel(kernel_size); double norm_factor = 0; for (int i = 0; i < gauss_kernel.size(); i++) { gauss_kernel(i) = Gaussian(i, (kernel_size - 1.0) / 2.0, sigma); norm_factor += gauss_kernel(i); } gauss_kernel /= norm_factor; SeparableConvolution2d(image, gauss_kernel, gauss_kernel, REPLICATE, out); }
sweeneychris/akaze-eigen
src/convolution.cpp
C++
bsd-3-clause
8,411
[ 30522, 1013, 1013, 9385, 1006, 1039, 1007, 2297, 1996, 22832, 1997, 1996, 2118, 1997, 2662, 1006, 22832, 1007, 1012, 1013, 1013, 2035, 2916, 9235, 1012, 1013, 1013, 1013, 1013, 25707, 1998, 2224, 1999, 3120, 1998, 12441, 3596, 1010, 2007, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// Copyright (c) 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // This file contains routines to kill processes and get the exit code and // termination status. #ifndef BASE_PROCESS_KILL_H_ #define BASE_PROCESS_KILL_H_ #include "base/files/file_path.h" #include "base/process/process.h" #include "base/process/process_handle.h" #include "base/time/time.h" #include "build/build_config.h" namespace base { class ProcessFilter; #if defined(OS_WIN) namespace win { // See definition in sandbox/win/src/sandbox_types.h const DWORD kSandboxFatalMemoryExceeded = 7012; // Exit codes with special meanings on Windows. const DWORD kNormalTerminationExitCode = 0; const DWORD kDebuggerInactiveExitCode = 0xC0000354; const DWORD kKeyboardInterruptExitCode = 0xC000013A; const DWORD kDebuggerTerminatedExitCode = 0x40010004; const DWORD kStatusInvalidImageHashExitCode = 0xC0000428; // This exit code is used by the Windows task manager when it kills a // process. It's value is obviously not that unique, and it's // surprising to me that the task manager uses this value, but it // seems to be common practice on Windows to test for it as an // indication that the task manager has killed something if the // process goes away. const DWORD kProcessKilledExitCode = 1; } // namespace win #endif // OS_WIN // Return status values from GetTerminationStatus. Don't use these as // exit code arguments to KillProcess*(), use platform/application // specific values instead. enum TerminationStatus { // clang-format off TERMINATION_STATUS_NORMAL_TERMINATION, // zero exit status TERMINATION_STATUS_ABNORMAL_TERMINATION, // non-zero exit status TERMINATION_STATUS_PROCESS_WAS_KILLED, // e.g. SIGKILL or task manager kill TERMINATION_STATUS_PROCESS_CRASHED, // e.g. Segmentation fault TERMINATION_STATUS_STILL_RUNNING, // child hasn't exited yet #if defined(OS_CHROMEOS) // Used for the case when oom-killer kills a process on ChromeOS. TERMINATION_STATUS_PROCESS_WAS_KILLED_BY_OOM, #endif #if defined(OS_ANDROID) // On Android processes are spawned from the system Zygote and we do not get // the termination status. We can't know if the termination was a crash or an // oom kill for sure, but we can use status of the strong process bindings as // a hint. TERMINATION_STATUS_OOM_PROTECTED, // child was protected from oom kill #endif TERMINATION_STATUS_LAUNCH_FAILED, // child process never launched TERMINATION_STATUS_OOM, // Process died due to oom #if defined(OS_WIN) // On Windows, the OS terminated process due to code integrity failure. TERMINATION_STATUS_INTEGRITY_FAILURE, #endif TERMINATION_STATUS_MAX_ENUM // clang-format on }; // Attempts to kill all the processes on the current machine that were launched // from the given executable name, ending them with the given exit code. If // filter is non-null, then only processes selected by the filter are killed. // Returns true if all processes were able to be killed off, false if at least // one couldn't be killed. BASE_EXPORT bool KillProcesses(const FilePath::StringType& executable_name, int exit_code, const ProcessFilter* filter); #if defined(OS_POSIX) // Attempts to kill the process group identified by |process_group_id|. Returns // true on success. BASE_EXPORT bool KillProcessGroup(ProcessHandle process_group_id); #endif // defined(OS_POSIX) // Get the termination status of the process by interpreting the // circumstances of the child process' death. |exit_code| is set to // the status returned by waitpid() on POSIX, and from GetExitCodeProcess() on // Windows, and may not be null. Note that on Linux, this function // will only return a useful result the first time it is called after // the child exits (because it will reap the child and the information // will no longer be available). BASE_EXPORT TerminationStatus GetTerminationStatus(ProcessHandle handle, int* exit_code); #if defined(OS_POSIX) // Send a kill signal to the process and then wait for the process to exit // and get the termination status. // // This is used in situations where it is believed that the process is dead // or dying (because communication with the child process has been cut). // In order to avoid erroneously returning that the process is still running // because the kernel is still cleaning it up, this will wait for the process // to terminate. In order to avoid the risk of hanging while waiting for the // process to terminate, send a SIGKILL to the process before waiting for the // termination status. // // Note that it is not an option to call WaitForExitCode and then // GetTerminationStatus as the child will be reaped when WaitForExitCode // returns, and this information will be lost. // BASE_EXPORT TerminationStatus GetKnownDeadTerminationStatus( ProcessHandle handle, int* exit_code); #if defined(OS_LINUX) // Spawns a thread to wait asynchronously for the child |process| to exit // and then reaps it. BASE_EXPORT void EnsureProcessGetsReaped(Process process); #endif // defined(OS_LINUX) #endif // defined(OS_POSIX) // Registers |process| to be asynchronously monitored for termination, forcibly // terminated if necessary, and reaped on exit. The caller should have signalled // |process| to exit before calling this API. The API will allow a couple of // seconds grace period before forcibly terminating |process|. // TODO(https://crbug.com/806451): The Mac implementation currently blocks the // calling thread for up to two seconds. BASE_EXPORT void EnsureProcessTerminated(Process process); // These are only sparingly used, and not needed on Fuchsia. They could be // implemented if necessary. #if !defined(OS_FUCHSIA) // Wait for all the processes based on the named executable to exit. If filter // is non-null, then only processes selected by the filter are waited on. // Returns after all processes have exited or wait_milliseconds have expired. // Returns true if all the processes exited, false otherwise. BASE_EXPORT bool WaitForProcessesToExit( const FilePath::StringType& executable_name, base::TimeDelta wait, const ProcessFilter* filter); // Waits a certain amount of time (can be 0) for all the processes with a given // executable name to exit, then kills off any of them that are still around. // If filter is non-null, then only processes selected by the filter are waited // on. Killed processes are ended with the given exit code. Returns false if // any processes needed to be killed, true if they all exited cleanly within // the wait_milliseconds delay. BASE_EXPORT bool CleanupProcesses(const FilePath::StringType& executable_name, base::TimeDelta wait, int exit_code, const ProcessFilter* filter); #endif // !defined(OS_FUCHSIA) } // namespace base #endif // BASE_PROCESS_KILL_H_
endlessm/chromium-browser
base/process/kill.h
C
bsd-3-clause
7,138
[ 30522, 1013, 1013, 9385, 1006, 1039, 1007, 2286, 1996, 10381, 21716, 5007, 6048, 1012, 2035, 2916, 9235, 1012, 1013, 1013, 2224, 1997, 2023, 3120, 3642, 2003, 9950, 2011, 1037, 18667, 2094, 1011, 2806, 6105, 2008, 2064, 2022, 1013, 1013, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * NBlocks, Copyright (C) 2011 Matías E. Vazquez (matiasevqz@gmail.com) * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //TODO //arreglar el cleanPanel (porq borra el fondo tambien) //arreglar el PieceFactory, porq algo esta mal en los metodos //de esa clase // agregar un metodo setHighScore package com.gammery.nblocks.view; import javax.swing.*; import java.awt.*; import com.gammery.nblocks.model.*; //import java.util.*; public class NextPiecesPanel extends JPanel { private PieceFrame[] fNextPieces; private int framesUsed; private int frameWidth; private int frameHeight; private Color backgroundColor; private BlockType blockType; public static final int MAX_PANELS = 5; public NextPiecesPanel() { this(Color.BLACK, MAX_PANELS, 144, 144); } //TODO Podria recibir un Color[] para usar distintos colores para cada frame public NextPiecesPanel(Color bgColor, int frames, int fWidth, int fHeight) { setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); frameWidth = fWidth; frameHeight = fHeight; backgroundColor = bgColor; framesUsed = (frames < 1) ? 1 : frames; fNextPieces = new PieceFrame[frames]; //PanelPiece[] fNextPieces[0] = new PieceFrame(BlockType.GRADIENT_BLOCK, Color.RED, backgroundColor, frameWidth, frameHeight); add(fNextPieces[0]); for (int i = 1; i < fNextPieces.length; i++) { //add(Box.createRigidArea(new Dimension(0, 8))); fNextPieces[i] = new PieceFrame(frameWidth, frameHeight); add(fNextPieces[i]); } framesUsed = frames; } public void setBlockType(BlockType bType) { blockType = bType; for (int i = 0; i < fNextPieces.length; i++) { // tiene que ser a todos por mas que no se esten usando en este momento fNextPieces[i].setBlockType(blockType); // para que cuando se habiliten otros tengan todos el mismo bType } } /* public void setFrameColors(Color frameColor, Color bgColor) { // this.frameColor = frameColor; // this.bgColor = bgColor; for (int i = 0; i < framesUsed; i++) { fNextPieces[i].setFrameColors(frameColor, bgColor); } } */ public int getFramesUsed() { return framesUsed; } public void setFramesUsed(int newFramesUsed) { if (newFramesUsed > fNextPieces.length) newFramesUsed = fNextPieces.length; else if (newFramesUsed < 0) newFramesUsed = 0; if (newFramesUsed < framesUsed) { for (int i = 0; (newFramesUsed + i) < framesUsed; i++) fNextPieces[newFramesUsed + i].drawPiece(null); } framesUsed = newFramesUsed; // repaint(); // XXX ES NECESARIO????? } //FIXME Esto tiene que verificar el length del array o a framesUsed??????????????????? // es mejor usar foreach aca y Collection, o sea este metdo //public void displayNextPiece(Collection<Piece> nextPieces) // nextPieces -> pieces public void displayNextPiece(java.util.List<Piece> pieces) { // int i = 0; // for (Piece piece : nextPieces) { // if (i >= fNextPieces.length) // break; // fNextPieces[i++].drawPiece(piece, blockType); // } for (int i = 0; i < framesUsed; i++) { fNextPieces[i].drawPiece(pieces.get(i)); } } /* * Alternativa usando iterator public void displayNextPiece(Iterator<Piece> it) { int i = 0; while (i++ < fNextPiece.length && it.hasNext()) { fNextPiece[i++].drawPiece(it.next()); } } */ public void cleanFrames() { for (int i = 0; i < fNextPieces.length; i++) { fNextPieces[i].clean(); } } // Testing method public static void main(String args[]) { NextPiecesPanel gp = new NextPiecesPanel(); JFrame f = new JFrame(); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.setVisible(true); f.setLayout(new FlowLayout()); f.add(gp); f.setSize(800, 800); PieceFactory pFactory = PieceFactory.getInstance(); try { for (int i = 0; i < 16; i++) { int framesUsed = gp.getFramesUsed(); gp.displayNextPiece(pFactory.next(framesUsed)); Thread.sleep(800); pFactory.next(); gp.cleanFrames(); Thread.sleep(800); } } catch (Exception e) { } } }
mevqz/nblocks
src/com/gammery/nblocks/view/NextPiecesPanel.java
Java
gpl-2.0
4,728
[ 30522, 1013, 1008, 1008, 28013, 25384, 1010, 9385, 1006, 1039, 1007, 2249, 13523, 7951, 1041, 1012, 12436, 22938, 1006, 13523, 7951, 6777, 4160, 2480, 1030, 20917, 4014, 1012, 4012, 1007, 1008, 2023, 2565, 2003, 2489, 4007, 1025, 2017, 2064...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package gb import ( "errors" "fmt" "io" "path/filepath" "reflect" "testing" ) func TestExecuteBuildAction(t *testing.T) { tests := []struct { pkg string err error }{{ pkg: "a", err: nil, }, { pkg: "b", // actually command err: nil, }, { pkg: "c", err: nil, }, { pkg: "d.v1", err: nil, }, { pkg: "x", err: errors.New("import cycle detected: x -> y -> x"), }, { pkg: "h", // imports "blank", which is blank, see issue #131 err: fmt.Errorf("no buildable Go source files in %s", filepath.Join(getwd(t), "testdata", "src", "blank")), }} for _, tt := range tests { ctx := testContext(t) pkg, err := ctx.ResolvePackage(tt.pkg) if !sameErr(err, tt.err) { t.Errorf("ctx.ResolvePackage(%v): want %v, got %v", tt.pkg, tt.err, err) continue } if err != nil { continue } action, err := BuildPackages(pkg) if err != nil { t.Errorf("BuildAction(%v): ", tt.pkg, err) continue } if err := Execute(action); !sameErr(err, tt.err) { t.Errorf("Execute(%v): want: %v, got %v", action.Name, tt.err, err) } ctx.Destroy() } } var niltask = TaskFn(func() error { return nil }) var executorTests = []struct { action *Action // root action err error // expected error }{{ action: &Action{ Name: "no error", Task: niltask, }, }, { action: &Action{ Name: "root error", Task: TaskFn(func() error { return io.EOF }), }, err: io.EOF, }, { action: &Action{ Name: "child, child, error", Task: TaskFn(func() error { return fmt.Errorf("I should not have been called") }), Deps: []*Action{&Action{ Name: "child, error", Task: niltask, Deps: []*Action{&Action{ Name: "error", Task: TaskFn(func() error { return io.EOF }), }}, }}, }, err: io.EOF, }, { action: &Action{ Name: "once only", Task: TaskFn(func() error { if c1 != 1 || c2 != 1 || c3 != 1 { return fmt.Errorf("unexpected count, c1: %v, c2: %v, c3: %v", c1, c2, c3) } return nil }), Deps: []*Action{createDag()}, }, }, { action: &Action{ Name: "failure count", Task: TaskFn(func() error { return fmt.Errorf("I should not have been called") }), Deps: []*Action{createFailDag()}, }, err: fmt.Errorf("task3 called 1 time"), }} func createDag() *Action { task1 := TaskFn(func() error { c1++; return nil }) task2 := TaskFn(func() error { c2++; return nil }) task3 := TaskFn(func() error { c3++; return nil }) action1 := Action{Name: "c1", Task: task1} action2 := Action{Name: "c2", Task: task2} action3 := Action{Name: "c3", Task: task3} action1.Deps = append(action1.Deps, &action2, &action3) action2.Deps = append(action2.Deps, &action3) return &action1 } func createFailDag() *Action { task1 := TaskFn(func() error { c1++; return nil }) task2 := TaskFn(func() error { c2++; return fmt.Errorf("task2 called %v time", c2) }) task3 := TaskFn(func() error { c3++; return fmt.Errorf("task3 called %v time", c3) }) action1 := Action{Name: "c1", Task: task1} action2 := Action{Name: "c2", Task: task2} action3 := Action{Name: "c3", Task: task3} action1.Deps = append(action1.Deps, &action2, &action3) action2.Deps = append(action2.Deps, &action3) return &action1 } var c1, c2, c3 int func executeReset() { c1 = 0 c2 = 0 c3 = 0 // reset executor test variables } func TestExecute(t *testing.T) { for _, tt := range executorTests { executeReset() got := Execute(tt.action) if !reflect.DeepEqual(got, tt.err) { t.Errorf("Execute: %v: want err: %v, got err %v", tt.action.Name, tt.err, got) } } } func testExecuteConcurrentN(t *testing.T, n int) { for _, tt := range executorTests { executeReset() got := ExecuteConcurrent(tt.action, n) if !reflect.DeepEqual(got, tt.err) { t.Errorf("ExecuteConcurrent(%v): %v: want err: %v, got err %v", n, tt.action.Name, tt.err, got) } } } func TestExecuteConcurrent1(t *testing.T) { testExecuteConcurrentN(t, 1) } func TestExecuteConcurrent2(t *testing.T) { testExecuteConcurrentN(t, 2) } func TestExecuteConcurrent4(t *testing.T) { testExecuteConcurrentN(t, 4) } func TestExecuteConcurrent7(t *testing.T) { testExecuteConcurrentN(t, 7) }
srid/vessel
vendor/src/github.com/constabulary/gb/executor_test.go
GO
mit
4,139
[ 30522, 7427, 16351, 12324, 1006, 1000, 10697, 1000, 1000, 4718, 2102, 1000, 1000, 22834, 1000, 1000, 4130, 1013, 5371, 15069, 1000, 1000, 8339, 1000, 1000, 5604, 1000, 1007, 4569, 2278, 3231, 10288, 8586, 10421, 8569, 4014, 2850, 7542, 1006...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title>User agent detail - LG-G922 Obigo/WAP2.0 MIDP-2.0/CLDC-1.1</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.3/css/materialize.min.css"> <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> <link href="../circle.css" rel="stylesheet"> </head> <body> <div class="container"> <div class="section"> <h1 class="header center orange-text">User agent detail</h1> <div class="row center"> <h5 class="header light"> LG-G922 Obigo/WAP2.0 MIDP-2.0/CLDC-1.1 </h5> </div> </div> <div class="section"> <table class="striped"><tr><th></th><th colspan="3">General</th><th colspan="5">Device</th><th colspan="3">Bot</th><th colspan="2"></th></tr><tr><th>Provider</th><th>Browser</th><th>Engine</th><th>OS</th><th>Brand</th><th>Model</th><th>Type</th><th>Is mobile</th><th>Is touch</th><th>Is bot</th><th>Name</th><th>Type</th><th>Parse time</th><th>Actions</th></tr><tr><th colspan="14" class="green lighten-3">Test suite</th></tr><tr><td>UAParser<br /><small>v0.5.0.2</small><br /><small>vendor/thadafinser/uap-core/tests/test_device.yaml</small></td><td> </td><td><i class="material-icons">close</i></td><td> </td><td style="border-left: 1px solid #555">LG</td><td>G922</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-cfed3005-df48-4fa8-bf03-4f6ef8988f59">Detail</a> <!-- Modal Structure --> <div id="modal-cfed3005-df48-4fa8-bf03-4f6ef8988f59" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>UAParser result detail</h4> <p><pre><code class="php">Array ( [user_agent_string] => LG-G922 Obigo/WAP2.0 MIDP-2.0/CLDC-1.1 [family] => LG G922 [brand] => LG [model] => G922 ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><th colspan="14" class="green lighten-3">Providers</th></tr><tr><td>BrowscapFull<br /><small>6014</small><br /></td><td>Teleca-Obigo </td><td> </td><td>JAVA </td><td style="border-left: 1px solid #555">LG</td><td>G922</td><td>Mobile Phone</td><td>yes</td><td></td><td style="border-left: 1px solid #555"></td><td></td><td></td><td>0.006</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-47a9cd06-e213-4882-bc34-db6aed664223">Detail</a> <!-- Modal Structure --> <div id="modal-47a9cd06-e213-4882-bc34-db6aed664223" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>BrowscapFull result detail</h4> <p><pre><code class="php">stdClass Object ( [browser_name_regex] => /^lg\-g922 obigo\/wap2\.0 .*$/ [browser_name_pattern] => lg-g922 obigo/wap2.0 * [parent] => Teleca-Obigo [comment] => Teleca-Obigo [browser] => Teleca-Obigo [browser_type] => Browser [browser_bits] => 32 [browser_maker] => Obigo [browser_modus] => unknown [version] => 0.0 [majorver] => 0 [minorver] => 0 [platform] => JAVA [platform_version] => unknown [platform_description] => unknown [platform_bits] => 32 [platform_maker] => Oracle [alpha] => [beta] => [win16] => [win32] => [win64] => [frames] => 1 [iframes] => 1 [tables] => 1 [cookies] => 1 [backgroundsounds] => [javascript] => 1 [vbscript] => [javaapplets] => [activexcontrols] => [ismobiledevice] => 1 [istablet] => [issyndicationreader] => [crawler] => [isfake] => [isanonymized] => [ismodified] => [cssversion] => 1 [aolversion] => 0 [device_name] => G922 [device_maker] => LG [device_type] => Mobile Phone [device_pointing_method] => unknown [device_code_name] => G922 [device_brand_name] => LG [renderingengine_name] => unknown [renderingengine_version] => unknown [renderingengine_description] => unknown [renderingengine_maker] => unknown ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>BrowscapLite<br /><small>6014</small><br /></td> <td colspan="12" class="center-align red lighten-1"> <strong>No result found</strong> </td> </tr><tr><td>BrowscapPhp<br /><small>6014</small><br /></td><td>Teleca-Obigo </td><td><i class="material-icons">close</i></td><td>JAVA </td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>Mobile Phone</td><td>yes</td><td></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.027</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-ad0041a2-b0f4-43f6-a70d-cad1443caa68">Detail</a> <!-- Modal Structure --> <div id="modal-ad0041a2-b0f4-43f6-a70d-cad1443caa68" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>BrowscapPhp result detail</h4> <p><pre><code class="php">stdClass Object ( [browser_name_regex] => /^.*obigo\/wap2\.0.*$/ [browser_name_pattern] => *obigo/wap2.0* [parent] => Teleca-Obigo [comment] => Teleca-Obigo [browser] => Teleca-Obigo [browser_type] => unknown [browser_bits] => 0 [browser_maker] => Obigo [browser_modus] => unknown [version] => 0.0 [majorver] => 0 [minorver] => 0 [platform] => JAVA [platform_version] => unknown [platform_description] => unknown [platform_bits] => 0 [platform_maker] => unknown [alpha] => false [beta] => false [win16] => false [win32] => false [win64] => false [frames] => false [iframes] => false [tables] => false [cookies] => false [backgroundsounds] => false [javascript] => false [vbscript] => false [javaapplets] => false [activexcontrols] => false [ismobiledevice] => 1 [istablet] => [issyndicationreader] => false [crawler] => [isfake] => false [isanonymized] => false [ismodified] => false [cssversion] => 0 [aolversion] => 0 [device_name] => unknown [device_maker] => unknown [device_type] => Mobile Phone [device_pointing_method] => unknown [device_code_name] => unknown [device_brand_name] => unknown [renderingengine_name] => unknown [renderingengine_version] => unknown [renderingengine_description] => unknown [renderingengine_maker] => unknown ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>DonatjUAParser<br /><small>v0.5.1</small><br /></td><td>LG-G922 </td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-15fbc1f0-2615-4d42-b5d9-a30dd647b050">Detail</a> <!-- Modal Structure --> <div id="modal-15fbc1f0-2615-4d42-b5d9-a30dd647b050" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>DonatjUAParser result detail</h4> <p><pre><code class="php">Array ( [platform] => [browser] => LG-G922 [version] => ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>JenssegersAgent<br /><small>v2.3.3</small><br /></td><td>ObigoBrowser </td><td><i class="material-icons">close</i></td><td>JavaOS </td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>yes</td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.001</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-b85a2b91-6a55-4436-a82c-1ea0d46e2e51">Detail</a> <!-- Modal Structure --> <div id="modal-b85a2b91-6a55-4436-a82c-1ea0d46e2e51" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>JenssegersAgent result detail</h4> <p><pre><code class="php">Array ( [browserName] => ObigoBrowser [browserVersion] => [osName] => JavaOS [osVersion] => [deviceModel] => [isMobile] => 1 [isRobot] => [botName] => ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>NeutrinoApiCom<br /><small></small><br /></td><td>Obigo WAP 2.0</td><td><i class="material-icons">close</i></td><td> </td><td style="border-left: 1px solid #555">LG</td><td>G922</td><td>mobile-browser</td><td>yes</td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.20701</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-8c2a7a4e-3fbf-4df2-8d61-5e730422f67b">Detail</a> <!-- Modal Structure --> <div id="modal-8c2a7a4e-3fbf-4df2-8d61-5e730422f67b" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>NeutrinoApiCom result detail</h4> <p><pre><code class="php">stdClass Object ( [mobile_screen_height] => 0 [is_mobile] => 1 [type] => mobile-browser [mobile_brand] => LG [mobile_model] => G922 [version] => 2.0 [is_android] => [browser_name] => Obigo WAP [operating_system_family] => unknown [operating_system_version] => [is_ios] => [producer] => LG [operating_system] => unknown [mobile_screen_width] => 0 [mobile_browser] => ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>PiwikDeviceDetector<br /><small>3.6.1</small><br /></td><td>Obigo WAP2</td><td> </td><td> </td><td style="border-left: 1px solid #555">LG</td><td>G922</td><td>smartphone</td><td>yes</td><td></td><td style="border-left: 1px solid #555"></td><td></td><td></td><td>0.003</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-4a941d34-a8d3-4914-9724-346f60ad7046">Detail</a> <!-- Modal Structure --> <div id="modal-4a941d34-a8d3-4914-9724-346f60ad7046" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>PiwikDeviceDetector result detail</h4> <p><pre><code class="php">Array ( [client] => Array ( [type] => browser [name] => Obigo [short_name] => OB [version] => WAP2 [engine] => ) [operatingSystem] => Array ( ) [device] => Array ( [brand] => LG [brandName] => LG [model] => G922 [device] => 1 [deviceName] => smartphone ) [bot] => [extra] => Array ( [isBot] => [isBrowser] => 1 [isFeedReader] => [isMobileApp] => [isPIM] => [isLibrary] => [isMediaPlayer] => [isCamera] => [isCarBrowser] => [isConsole] => [isFeaturePhone] => [isPhablet] => [isPortableMediaPlayer] => [isSmartDisplay] => [isSmartphone] => 1 [isTablet] => [isTV] => [isDesktop] => [isMobile] => 1 [isTouchEnabled] => ) ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>SinergiBrowserDetector<br /><small>6.0.1</small><br /></td> <td colspan="12" class="center-align red lighten-1"> <strong>No result found</strong> </td> </tr><tr><td>UAParser<br /><small>v3.4.5</small><br /></td><td>Obigo 2.0</td><td><i class="material-icons">close</i></td><td> </td><td style="border-left: 1px solid #555">LG</td><td>G922</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.001</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-3160e405-8a8f-46dd-8f47-5115f06462d2">Detail</a> <!-- Modal Structure --> <div id="modal-3160e405-8a8f-46dd-8f47-5115f06462d2" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>UAParser result detail</h4> <p><pre><code class="php">UAParser\Result\Client Object ( [ua] => UAParser\Result\UserAgent Object ( [major] => 2 [minor] => 0 [patch] => [family] => Obigo ) [os] => UAParser\Result\OperatingSystem Object ( [major] => [minor] => [patch] => [patchMinor] => [family] => Other ) [device] => UAParser\Result\Device Object ( [brand] => LG [model] => G922 [family] => LG G922 ) [originalUserAgent] => LG-G922 Obigo/WAP2.0 MIDP-2.0/CLDC-1.1 ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>UserAgentApiCom<br /><small></small><br /></td><td>Obigo 2.0</td><td> </td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>Mobile</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.15201</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-afeb05fb-26b9-4509-b8ac-0c604a9e97d6">Detail</a> <!-- Modal Structure --> <div id="modal-afeb05fb-26b9-4509-b8ac-0c604a9e97d6" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>UserAgentApiCom result detail</h4> <p><pre><code class="php">stdClass Object ( [platform_name] => Mobile [platform_version] => 2.0 [platform_type] => Mobile [browser_name] => Obigo [browser_version] => 2.0 ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>UserAgentStringCom<br /><small></small><br /></td> <td colspan="12" class="center-align red lighten-1"> <strong>No result found</strong> </td> </tr><tr><td>WhatIsMyBrowserCom<br /><small></small><br /></td><td>Obigo WAP2 Browser WAP2</td><td> </td><td> </td><td style="border-left: 1px solid #555">LG</td><td>LGG922</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0.24001</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-5fc1ff22-a74d-481b-9ad1-fcfde73ded9c">Detail</a> <!-- Modal Structure --> <div id="modal-5fc1ff22-a74d-481b-9ad1-fcfde73ded9c" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>WhatIsMyBrowserCom result detail</h4> <p><pre><code class="php">stdClass Object ( [operating_system_name] => [simple_sub_description_string] => [simple_browser_string] => Obigo WAP2 Browser on LGG922 [browser_version] => [extra_info] => Array ( ) [operating_platform] => LGG922 [extra_info_table] => Array ( ) [layout_engine_name] => [detected_addons] => Array ( ) [operating_system_flavour_code] => [hardware_architecture] => [operating_system_flavour] => [operating_system_frameworks] => Array ( ) [browser_name_code] => obigo-wap2-browser [operating_system_version] => [simple_operating_platform_string] => [is_abusive] => [layout_engine_version] => [browser_capabilities] => Array ( [0] => MIDP v2.0 [1] => CLDC v1.1 ) [operating_platform_vendor_name] => LG [operating_system] => [operating_system_version_full] => [operating_platform_code] => LGG922 [browser_name] => Obigo WAP2 Browser [operating_system_name_code] => [user_agent] => LG-G922 Obigo/WAP2.0 MIDP-2.0/CLDC-1.1 [browser_version_full] => WAP2 [browser] => Obigo WAP2 Browser ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>WhichBrowser<br /><small>v2.0.18</small><br /></td><td>Obigo WAP 2.0</td><td> </td><td> </td><td style="border-left: 1px solid #555">LG</td><td>G922</td><td>mobile:feature</td><td>yes</td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.003</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-083a336f-5d73-4505-84f3-c5fc9bb78652">Detail</a> <!-- Modal Structure --> <div id="modal-083a336f-5d73-4505-84f3-c5fc9bb78652" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>WhichBrowser result detail</h4> <p><pre><code class="php">Array ( [browser] => Array ( [name] => Obigo WAP [version] => 2.0 [type] => browser ) [device] => Array ( [type] => mobile [subtype] => feature [manufacturer] => LG [model] => G922 ) ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>Woothee<br /><small>v1.2.0</small><br /></td> <td colspan="12" class="center-align red lighten-1"> <strong>No result found</strong> </td> </tr><tr><td>Wurfl<br /><small>1.7.1.0</small><br /></td><td>Java Applet </td><td><i class="material-icons">close</i></td><td> </td><td style="border-left: 1px solid #555"></td><td></td><td>Feature Phone</td><td>yes</td><td></td><td style="border-left: 1px solid #555"></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0.016</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-a2bedf8c-4a95-42a7-96c5-aaf233b2ac50">Detail</a> <!-- Modal Structure --> <div id="modal-a2bedf8c-4a95-42a7-96c5-aaf233b2ac50" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>Wurfl result detail</h4> <p><pre><code class="php">Array ( [virtual] => Array ( [is_android] => false [is_ios] => false [is_windows_phone] => false [is_app] => false [is_full_desktop] => false [is_largescreen] => false [is_mobile] => true [is_robot] => false [is_smartphone] => false [is_touchscreen] => false [is_wml_preferred] => false [is_xhtmlmp_preferred] => true [is_html_preferred] => false [advertised_device_os] => [advertised_device_os_version] => [advertised_browser] => Java Applet [advertised_browser_version] => [complete_device_name] => [device_name] => [form_factor] => Feature Phone [is_phone] => true [is_app_webview] => false ) [all] => Array ( [brand_name] => [model_name] => [unique] => true [ununiqueness_handler] => [is_wireless_device] => true [device_claims_web_support] => false [has_qwerty_keyboard] => false [can_skip_aligned_link_row] => true [uaprof] => [uaprof2] => [uaprof3] => [nokia_series] => 0 [nokia_edition] => 0 [device_os] => [mobile_browser] => [mobile_browser_version] => [device_os_version] => [pointing_method] => [release_date] => 2002_july [marketing_name] => [model_extra_info] => [nokia_feature_pack] => 0 [can_assign_phone_number] => true [is_tablet] => false [manufacturer_name] => [is_bot] => false [is_google_glass] => false [proportional_font] => false [built_in_back_button_support] => false [card_title_support] => true [softkey_support] => false [table_support] => true [numbered_menus] => false [menu_with_select_element_recommended] => false [menu_with_list_of_links_recommended] => true [icons_on_menu_items_support] => false [break_list_of_links_with_br_element_recommended] => true [access_key_support] => false [wrap_mode_support] => false [times_square_mode_support] => false [deck_prefetch_support] => false [elective_forms_recommended] => true [wizards_recommended] => false [image_as_link_support] => false [insert_br_element_after_widget_recommended] => false [wml_can_display_images_and_text_on_same_line] => false [wml_displays_image_in_center] => false [opwv_wml_extensions_support] => false [wml_make_phone_call_string] => wtai://wp/mc; [chtml_display_accesskey] => false [emoji] => false [chtml_can_display_images_and_text_on_same_line] => false [chtml_displays_image_in_center] => false [imode_region] => none [chtml_make_phone_call_string] => tel: [chtml_table_support] => false [xhtml_honors_bgcolor] => false [xhtml_supports_forms_in_table] => false [xhtml_support_wml2_namespace] => false [xhtml_autoexpand_select] => false [xhtml_select_as_dropdown] => false [xhtml_select_as_radiobutton] => false [xhtml_select_as_popup] => false [xhtml_display_accesskey] => false [xhtml_supports_invisible_text] => false [xhtml_supports_inline_input] => false [xhtml_supports_monospace_font] => false [xhtml_supports_table_for_layout] => false [xhtml_supports_css_cell_table_coloring] => false [xhtml_format_as_css_property] => false [xhtml_format_as_attribute] => false [xhtml_nowrap_mode] => false [xhtml_marquee_as_css_property] => false [xhtml_readable_background_color1] => #FFFFFF [xhtml_readable_background_color2] => #FFFFFF [xhtml_allows_disabled_form_elements] => false [xhtml_document_title_support] => true [xhtml_preferred_charset] => utf8 [opwv_xhtml_extensions_support] => false [xhtml_make_phone_call_string] => tel: [xhtmlmp_preferred_mime_type] => application/vnd.wap.xhtml+xml [xhtml_table_support] => true [xhtml_send_sms_string] => none [xhtml_send_mms_string] => none [xhtml_file_upload] => not_supported [cookie_support] => true [accept_third_party_cookie] => true [xhtml_supports_iframe] => none [xhtml_avoid_accesskeys] => false [xhtml_can_embed_video] => none [ajax_support_javascript] => false [ajax_manipulate_css] => false [ajax_support_getelementbyid] => false [ajax_support_inner_html] => false [ajax_xhr_type] => none [ajax_manipulate_dom] => false [ajax_support_events] => false [ajax_support_event_listener] => false [ajax_preferred_geoloc_api] => none [xhtml_support_level] => 1 [preferred_markup] => html_wi_oma_xhtmlmp_1_0 [wml_1_1] => true [wml_1_2] => false [wml_1_3] => false [html_wi_w3_xhtmlbasic] => true [html_wi_oma_xhtmlmp_1_0] => true [html_wi_imode_html_1] => false [html_wi_imode_html_2] => false [html_wi_imode_html_3] => false [html_wi_imode_html_4] => false [html_wi_imode_html_5] => false [html_wi_imode_htmlx_1] => false [html_wi_imode_htmlx_1_1] => false [html_wi_imode_compact_generic] => false [html_web_3_2] => false [html_web_4_0] => false [voicexml] => false [multipart_support] => false [total_cache_disable_support] => false [time_to_live_support] => false [resolution_width] => 128 [resolution_height] => 92 [columns] => 11 [max_image_width] => 120 [max_image_height] => 92 [rows] => 6 [physical_screen_width] => 27 [physical_screen_height] => 27 [dual_orientation] => false [density_class] => 1.0 [wbmp] => true [bmp] => false [epoc_bmp] => false [gif_animated] => true [jpg] => true [png] => true [tiff] => false [transparent_png_alpha] => false [transparent_png_index] => false [svgt_1_1] => false [svgt_1_1_plus] => false [greyscale] => false [gif] => true [colors] => 256 [webp_lossy_support] => false [webp_lossless_support] => false [post_method_support] => true [basic_authentication_support] => true [empty_option_value_support] => true [emptyok] => false [nokia_voice_call] => false [wta_voice_call] => false [wta_phonebook] => false [wta_misc] => false [wta_pdc] => false [https_support] => true [phone_id_provided] => false [max_data_rate] => 9 [wifi] => false [sdio] => false [vpn] => false [has_cellular_radio] => true [max_deck_size] => 10000 [max_url_length_in_requests] => 256 [max_url_length_homepage] => 0 [max_url_length_bookmark] => 0 [max_url_length_cached_page] => 0 [max_no_of_connection_settings] => 0 [max_no_of_bookmarks] => 0 [max_length_of_username] => 0 [max_length_of_password] => 0 [max_object_size] => 0 [downloadfun_support] => false [directdownload_support] => false [inline_support] => false [oma_support] => false [ringtone] => false [ringtone_3gpp] => false [ringtone_midi_monophonic] => false [ringtone_midi_polyphonic] => false [ringtone_imelody] => false [ringtone_digiplug] => false [ringtone_compactmidi] => false [ringtone_mmf] => false [ringtone_rmf] => false [ringtone_xmf] => false [ringtone_amr] => false [ringtone_awb] => false [ringtone_aac] => false [ringtone_wav] => false [ringtone_mp3] => false [ringtone_spmidi] => false [ringtone_qcelp] => false [ringtone_voices] => 1 [ringtone_df_size_limit] => 0 [ringtone_directdownload_size_limit] => 0 [ringtone_inline_size_limit] => 0 [ringtone_oma_size_limit] => 0 [wallpaper] => false [wallpaper_max_width] => 0 [wallpaper_max_height] => 0 [wallpaper_preferred_width] => 0 [wallpaper_preferred_height] => 0 [wallpaper_resize] => none [wallpaper_wbmp] => false [wallpaper_bmp] => false [wallpaper_gif] => false [wallpaper_jpg] => false [wallpaper_png] => false [wallpaper_tiff] => false [wallpaper_greyscale] => false [wallpaper_colors] => 2 [wallpaper_df_size_limit] => 0 [wallpaper_directdownload_size_limit] => 0 [wallpaper_inline_size_limit] => 0 [wallpaper_oma_size_limit] => 0 [screensaver] => false [screensaver_max_width] => 0 [screensaver_max_height] => 0 [screensaver_preferred_width] => 0 [screensaver_preferred_height] => 0 [screensaver_resize] => none [screensaver_wbmp] => false [screensaver_bmp] => false [screensaver_gif] => false [screensaver_jpg] => false [screensaver_png] => false [screensaver_greyscale] => false [screensaver_colors] => 2 [screensaver_df_size_limit] => 0 [screensaver_directdownload_size_limit] => 0 [screensaver_inline_size_limit] => 0 [screensaver_oma_size_limit] => 0 [picture] => false [picture_max_width] => 0 [picture_max_height] => 0 [picture_preferred_width] => 0 [picture_preferred_height] => 0 [picture_resize] => none [picture_wbmp] => false [picture_bmp] => false [picture_gif] => false [picture_jpg] => false [picture_png] => false [picture_greyscale] => false [picture_colors] => 2 [picture_df_size_limit] => 0 [picture_directdownload_size_limit] => 0 [picture_inline_size_limit] => 0 [picture_oma_size_limit] => 0 [video] => false [oma_v_1_0_forwardlock] => false [oma_v_1_0_combined_delivery] => false [oma_v_1_0_separate_delivery] => false [streaming_video] => false [streaming_3gpp] => false [streaming_mp4] => false [streaming_mov] => false [streaming_video_size_limit] => 0 [streaming_real_media] => none [streaming_flv] => false [streaming_3g2] => false [streaming_vcodec_h263_0] => -1 [streaming_vcodec_h263_3] => -1 [streaming_vcodec_mpeg4_sp] => -1 [streaming_vcodec_mpeg4_asp] => -1 [streaming_vcodec_h264_bp] => -1 [streaming_acodec_amr] => none [streaming_acodec_aac] => none [streaming_wmv] => none [streaming_preferred_protocol] => rtsp [streaming_preferred_http_protocol] => none [wap_push_support] => false [connectionless_service_indication] => false [connectionless_service_load] => false [connectionless_cache_operation] => false [connectionoriented_unconfirmed_service_indication] => false [connectionoriented_unconfirmed_service_load] => false [connectionoriented_unconfirmed_cache_operation] => false [connectionoriented_confirmed_service_indication] => false [connectionoriented_confirmed_service_load] => false [connectionoriented_confirmed_cache_operation] => false [utf8_support] => false [ascii_support] => false [iso8859_support] => false [expiration_date] => false [j2me_cldc_1_0] => false [j2me_cldc_1_1] => false [j2me_midp_1_0] => false [j2me_midp_2_0] => false [doja_1_0] => false [doja_1_5] => false [doja_2_0] => false [doja_2_1] => false [doja_2_2] => false [doja_3_0] => false [doja_3_5] => false [doja_4_0] => false [j2me_jtwi] => false [j2me_mmapi_1_0] => false [j2me_mmapi_1_1] => false [j2me_wmapi_1_0] => false [j2me_wmapi_1_1] => false [j2me_wmapi_2_0] => false [j2me_btapi] => false [j2me_3dapi] => false [j2me_locapi] => false [j2me_nokia_ui] => false [j2me_motorola_lwt] => false [j2me_siemens_color_game] => false [j2me_siemens_extension] => false [j2me_heap_size] => 0 [j2me_max_jar_size] => 0 [j2me_storage_size] => 0 [j2me_max_record_store_size] => 0 [j2me_screen_width] => 0 [j2me_screen_height] => 0 [j2me_canvas_width] => 0 [j2me_canvas_height] => 0 [j2me_bits_per_pixel] => 0 [j2me_audio_capture_enabled] => false [j2me_video_capture_enabled] => false [j2me_photo_capture_enabled] => false [j2me_capture_image_formats] => none [j2me_http] => false [j2me_https] => false [j2me_socket] => false [j2me_udp] => false [j2me_serial] => false [j2me_gif] => false [j2me_gif89a] => false [j2me_jpg] => false [j2me_png] => false [j2me_bmp] => false [j2me_bmp3] => false [j2me_wbmp] => false [j2me_midi] => false [j2me_wav] => false [j2me_amr] => false [j2me_mp3] => false [j2me_mp4] => false [j2me_imelody] => false [j2me_rmf] => false [j2me_au] => false [j2me_aac] => false [j2me_realaudio] => false [j2me_xmf] => false [j2me_wma] => false [j2me_3gpp] => false [j2me_h263] => false [j2me_svgt] => false [j2me_mpeg4] => false [j2me_realvideo] => false [j2me_real8] => false [j2me_realmedia] => false [j2me_left_softkey_code] => 0 [j2me_right_softkey_code] => 0 [j2me_middle_softkey_code] => 0 [j2me_select_key_code] => 0 [j2me_return_key_code] => 0 [j2me_clear_key_code] => 0 [j2me_datefield_no_accepts_null_date] => false [j2me_datefield_broken] => false [receiver] => false [sender] => false [mms_max_size] => 0 [mms_max_height] => 0 [mms_max_width] => 0 [built_in_recorder] => false [built_in_camera] => false [mms_jpeg_baseline] => false [mms_jpeg_progressive] => false [mms_gif_static] => false [mms_gif_animated] => false [mms_png] => false [mms_bmp] => false [mms_wbmp] => false [mms_amr] => false [mms_wav] => false [mms_midi_monophonic] => false [mms_midi_polyphonic] => false [mms_midi_polyphonic_voices] => 0 [mms_spmidi] => false [mms_mmf] => false [mms_mp3] => false [mms_evrc] => false [mms_qcelp] => false [mms_ota_bitmap] => false [mms_nokia_wallpaper] => false [mms_nokia_operatorlogo] => false [mms_nokia_3dscreensaver] => false [mms_nokia_ringingtone] => false [mms_rmf] => false [mms_xmf] => false [mms_symbian_install] => false [mms_jar] => false [mms_jad] => false [mms_vcard] => false [mms_vcalendar] => false [mms_wml] => false [mms_wbxml] => false [mms_wmlc] => false [mms_video] => false [mms_mp4] => false [mms_3gpp] => false [mms_3gpp2] => false [mms_max_frame_rate] => 0 [nokiaring] => false [picturemessage] => false [operatorlogo] => false [largeoperatorlogo] => false [callericon] => false [nokiavcard] => false [nokiavcal] => false [sckl_ringtone] => false [sckl_operatorlogo] => false [sckl_groupgraphic] => false [sckl_vcard] => false [sckl_vcalendar] => false [text_imelody] => false [ems] => false [ems_variablesizedpictures] => false [ems_imelody] => false [ems_odi] => false [ems_upi] => false [ems_version] => 0 [siemens_ota] => false [siemens_logo_width] => 101 [siemens_logo_height] => 29 [siemens_screensaver_width] => 101 [siemens_screensaver_height] => 50 [gprtf] => false [sagem_v1] => false [sagem_v2] => false [panasonic] => false [sms_enabled] => true [wav] => false [mmf] => false [smf] => false [mld] => false [midi_monophonic] => false [midi_polyphonic] => false [sp_midi] => false [rmf] => false [xmf] => false [compactmidi] => false [digiplug] => false [nokia_ringtone] => false [imelody] => false [au] => false [amr] => false [awb] => false [aac] => false [mp3] => false [voices] => 1 [qcelp] => false [evrc] => false [flash_lite_version] => [fl_wallpaper] => false [fl_screensaver] => false [fl_standalone] => false [fl_browser] => false [fl_sub_lcd] => false [full_flash_support] => false [css_supports_width_as_percentage] => true [css_border_image] => none [css_rounded_corners] => none [css_gradient] => none [css_spriting] => false [css_gradient_linear] => none [is_transcoder] => false [transcoder_ua_header] => user-agent [rss_support] => false [pdf_support] => false [progressive_download] => false [playback_vcodec_h263_0] => -1 [playback_vcodec_h263_3] => -1 [playback_vcodec_mpeg4_sp] => -1 [playback_vcodec_mpeg4_asp] => -1 [playback_vcodec_h264_bp] => -1 [playback_real_media] => none [playback_3gpp] => false [playback_3g2] => false [playback_mp4] => false [playback_mov] => false [playback_acodec_amr] => none [playback_acodec_aac] => none [playback_df_size_limit] => 0 [playback_directdownload_size_limit] => 0 [playback_inline_size_limit] => 0 [playback_oma_size_limit] => 0 [playback_acodec_qcelp] => false [playback_wmv] => none [hinted_progressive_download] => false [html_preferred_dtd] => xhtml_mp1 [viewport_supported] => false [viewport_width] => [viewport_userscalable] => [viewport_initial_scale] => [viewport_maximum_scale] => [viewport_minimum_scale] => [mobileoptimized] => false [handheldfriendly] => false [canvas_support] => none [image_inlining] => false [is_smarttv] => false [is_console] => false [nfc_support] => false [ux_full_desktop] => false [jqm_grade] => none [is_sencha_touch_ok] => false ) ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>Zsxsoft<br /><small>1.3</small><br /></td><td>Obigo WAP2.0</td><td><i class="material-icons">close</i></td><td> </td><td style="border-left: 1px solid #555">LG</td><td>G922</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0.001</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-5d43e024-b46c-44f6-8914-529b05569bc2">Detail</a> <!-- Modal Structure --> <div id="modal-5d43e024-b46c-44f6-8914-529b05569bc2" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>Zsxsoft result detail</h4> <p><pre><code class="php">Array ( [browser] => Array ( [link] => http://en.wikipedia.org/wiki/Obigo_Browser [title] => Obigo WAP2.0 [code] => obigo [version] => WAP2.0 [name] => Obigo [image] => img/16/browser/obigo.png ) [os] => Array ( [link] => [name] => [version] => [code] => null [x64] => [title] => [type] => os [dir] => os [image] => img/16/os/null.png ) [device] => Array ( [link] => http://www.lgmobile.com [title] => LG G922 [model] => G922 [brand] => LG [code] => lg [dir] => device [type] => device [image] => img/16/device/lg.png ) [platform] => Array ( [link] => http://www.lgmobile.com [title] => LG G922 [model] => G922 [brand] => LG [code] => lg [dir] => device [type] => device [image] => img/16/device/lg.png ) ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr></table> </div> <div class="section"> <h1 class="header center orange-text">About this comparison</h1> <div class="row center"> <h5 class="header light"> The primary goal of this project is simple<br /> I wanted to know which user agent parser is the most accurate in each part - device detection, bot detection and so on...<br /> <br /> The secondary goal is to provide a source for all user agent parsers to improve their detection based on this results.<br /> <br /> You can also improve this further, by suggesting ideas at <a href="https://github.com/ThaDafinser/UserAgentParserComparison">ThaDafinser/UserAgentParserComparison</a><br /> <br /> The comparison is based on the abstraction by <a href="https://github.com/ThaDafinser/UserAgentParser">ThaDafinser/UserAgentParser</a> </h5> </div> </div> <div class="card"> <div class="card-content"> Comparison created <i>2016-05-10 08:07:11</i> | by <a href="https://github.com/ThaDafinser">ThaDafinser</a> </div> </div> </div> <script src="https://code.jquery.com/jquery-2.1.4.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.3/js/materialize.min.js"></script> <script src="http://cdnjs.cloudflare.com/ajax/libs/list.js/1.2.0/list.min.js"></script> <script> $(document).ready(function(){ // the "href" attribute of .modal-trigger must specify the modal ID that wants to be triggered $('.modal-trigger').leanModal(); }); </script> </body> </html>
ThaDafinser/UserAgentParserComparison
v5/user-agent-detail/c4/23/c42390fe-75db-4b07-a102-6fd5f5dc7ad0.html
HTML
mit
46,803
[ 30522, 1026, 999, 9986, 13874, 16129, 1028, 1026, 16129, 11374, 1027, 1000, 4372, 1000, 1028, 1026, 2132, 1028, 1026, 18804, 25869, 13462, 1027, 1000, 21183, 2546, 1011, 1022, 1000, 1013, 1028, 1026, 2516, 1028, 5310, 4005, 6987, 1011, 1048...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/** * @license Apache-2.0 * * Copyright (c) 2018 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ 'use strict'; // MODULES // var resolve = require( 'path' ).resolve; var glob = require( 'glob' ).sync; var cwd = require( '@stdlib/process/cwd' ); var copy = require( '@stdlib/utils/copy' ); var DEFAULTS = require( './defaults.json' ); var validate = require( './validate.js' ); var linter = require( './lint.js' ); var IGNORE = require( './ignore_patterns.json' ); // MAIN // /** * Synchronously lints filenames. * * @param {Options} [options] - function options * @param {string} [options.dir] - root directory from which to search for files * @param {string} [options.pattern='**\/*'] - filename pattern * @throws {TypeError} options argument must be an object * @throws {TypeError} must provide valid options * @returns {(ObjectArray|EmptyArray)} list of lint errors * * @example * var errs = lint(); * // returns [...] */ function lint( options ) { var pattern; var names; var opts; var err; var dir; opts = copy( DEFAULTS ); if ( arguments.length ) { err = validate( opts, options ); if ( err ) { throw err; } } if ( opts.dir ) { dir = resolve( cwd(), opts.dir ); } else { dir = cwd(); } pattern = opts.pattern; opts = { 'cwd': dir, 'ignore': IGNORE, 'nodir': true // do not match directories }; names = glob( pattern, opts ); return linter( names ); } // EXPORTS // module.exports = lint;
stdlib-js/stdlib
lib/node_modules/@stdlib/_tools/lint/filenames/lib/sync.js
JavaScript
apache-2.0
1,960
[ 30522, 1013, 1008, 1008, 1008, 1030, 6105, 15895, 1011, 1016, 1012, 1014, 1008, 1008, 9385, 1006, 1039, 1007, 2760, 1996, 2358, 19422, 12322, 6048, 1012, 1008, 1008, 7000, 2104, 1996, 15895, 6105, 1010, 2544, 1016, 1012, 1014, 1006, 1996, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#pragma once #ifndef HPTT_PARAM_PARAMETER_TRANS_H_ #define HPTT_PARAM_PARAMETER_TRANS_H_ #include <array> #include <utility> #include <unordered_map> #include <unordered_set> #include <algorithm> #include <hptt/types.h> #include <hptt/tensor.h> #include <hptt/arch/compat.h> #include <hptt/util/util_trans.h> #include <hptt/kernels/kernel_trans.h> namespace hptt { template <typename FloatType, TensorUInt ORDER> class TensorMergedWrapper : public TensorWrapper<FloatType, ORDER> { public: TensorMergedWrapper() = delete; TensorMergedWrapper(const TensorWrapper<FloatType, ORDER> &tensor, const std::unordered_set<TensorUInt> &merge_set); HPTT_INL FloatType &operator[](const TensorIdx * RESTRICT indices); HPTT_INL const FloatType &operator[]( const TensorIdx * RESTRICT indices) const; HPTT_INL FloatType &operator[](TensorIdx **indices); HPTT_INL const FloatType &operator[](const TensorIdx **indices) const; private: TensorUInt begin_order_idx_, merged_order_; TensorUInt merge_idx_(const std::unordered_set<TensorUInt> &merge_set); }; template <typename TensorType, bool UPDATE_OUT> struct ParamTrans { // Type alias and constant values using Float = typename TensorType::Float; using Deduced = DeducedFloatType<Float>; using KernelPack = KernelPackTrans<Float, UPDATE_OUT>; static constexpr auto ORDER = TensorType::TENSOR_ORDER; ParamTrans(const TensorType &input_tensor, TensorType &output_tensor, const std::array<TensorUInt, ORDER> &perm, const Deduced alpha, const Deduced beta); HPTT_INL bool is_common_leading() const; HPTT_INL void set_coef(const Deduced alpha, const Deduced beta); HPTT_INL const KernelPack &get_kernel() const; void set_lin_wrapper_loop(const TensorUInt size_kn_inld, const TensorUInt size_kn_outld); void set_sca_wrapper_loop(const TensorUInt size_kn_in_inld, const TensorUInt size_kn_in_outld, const TensorUInt size_kn_out_inld, const TensorUInt size_kn_out_outld); void reset_data(const Float *data_in, Float *data_out); private: TensorUInt merge_idx_(const TensorType &input_tensor, const TensorType &output_tensor, const std::array<TensorUInt, ORDER> &perm); // They need to be initialized before merging std::unordered_set<TensorUInt> input_merge_set_, output_merge_set_; KernelPackTrans<Float, UPDATE_OUT> kn_; public: std::array<TensorUInt, ORDER> perm; Deduced alpha, beta; TensorIdx stride_in_inld, stride_in_outld, stride_out_inld, stride_out_outld; TensorUInt begin_order_idx; const TensorUInt merged_order; // Put the merged tensors here, they must be initialized after merging TensorMergedWrapper<Float, ORDER> input_tensor, output_tensor; }; /* * Import implementation */ #include "parameter_trans.tcc" } #endif // HPTT_PARAM_PARAMETER_TRANS_H_
tongsucn/hptt
inc/hptt/param/parameter_trans.h
C
gpl-3.0
2,854
[ 30522, 1001, 10975, 8490, 2863, 2320, 1001, 2065, 13629, 2546, 6522, 4779, 1035, 11498, 2213, 1035, 16381, 1035, 9099, 1035, 1044, 1035, 1001, 9375, 6522, 4779, 1035, 11498, 2213, 1035, 16381, 1035, 9099, 1035, 1044, 1035, 1001, 2421, 1026,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php if ( is_single_portfolio() ){ return get_template_part("single-portfolio","single-portfolio"); } $options = get_post_meta($post->ID, '_post_options', true); $sidebar = @$options["sidebar"]; if(empty($sidebar)){ $sidebar = get_theme_option('blog','blog_single_layout'); } $blog_single_navigation = get_theme_option('blog', 'blog_single_navigation'); $blog_single_featured = get_theme_option('blog', 'blog_single_featured'); $blog_single_featured_image_layout = get_theme_option('blog', 'blog_single_featured_image_layout'); get_header(); echo get_theme_generator('page_top', $options); ?> <div id="content"> <div class="inner<?php if($sidebar =='right'){ echo ' sidebar-right'; } else if( $sidebar == 'left'){ echo ' sidebar-left';} ?>"> <div id="main"> <?php if ( have_posts() ) : the_post(); if( $blog_single_featured == "on" ){ echo '<div class="post-featured">'; echo get_theme_generator("blog_featured_image", $sidebar, $blog_single_featured_image_layout); echo '</div>'; } the_content(); if ( get_theme_option("advanced", "comment_post") == "on" ) { comments_template( '', true ); } endif; ?> <?php if($blog_single_navigation == "on") { ?> <div class="post-navigation"> <div class="post-previous"><?php previous_post_link( '%link', __( '&larr;', T_NAME ) . ' %title', true ); ?></div> <div class="post-next"><?php next_post_link( '%link', '%title ' . __( '&rarr;', T_NAME ) , true ); ?></div> </div> <?php } ?> </div> <?php if($sidebar == 'left' || $sidebar == 'right'){ get_sidebar(); } ?> </div> </div> <?php get_footer(); ?>
tz24/Tebmart-Clean
wp-content/themes/kinex/single.php
PHP
gpl-2.0
1,731
[ 30522, 1026, 1029, 25718, 2065, 1006, 2003, 1035, 2309, 1035, 11103, 1006, 1007, 1007, 1063, 2709, 2131, 1035, 23561, 1035, 2112, 1006, 1000, 2309, 1011, 11103, 1000, 1010, 1000, 2309, 1011, 11103, 1000, 1007, 1025, 1065, 1002, 7047, 1027, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// This code is provided under the MIT license. Originally by Alessandro Pilati. using Duality; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SnowyPeak.Duality.Plugins.YAUI.Templates { public class ControlTemplate { public ContentRef<Appearance> Appearance { get; set; } public Border Margin { get; set; } public Size MinSize { get; set; } public ControlTemplate() { this.Appearance = YAUI.Appearance.DEFAULT; this.Margin = Border.Zero; this.MinSize = Size.Zero; } public ControlTemplate(ControlTemplate source) { this.Appearance = source.Appearance; this.Margin = source.Margin; this.MinSize = source.MinSize; } } }
SirePi/duality-ui
SnowyPeak.Duality.Plugins.YAUI/Templates/ControlTemplate.cs
C#
mit
742
[ 30522, 1013, 1013, 2023, 3642, 2003, 3024, 2104, 1996, 10210, 6105, 1012, 2761, 2011, 17956, 14255, 20051, 2072, 1012, 2478, 7037, 3012, 1025, 2478, 2291, 1025, 2478, 2291, 1012, 6407, 1012, 12391, 1025, 2478, 2291, 1012, 11409, 4160, 1025,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * java-gnome, a UI library for writing GTK and GNOME programs from Java! * * Copyright © 2007-2010 Operational Dynamics Consulting, Pty Ltd and Others * * The code in this file, and the program it is a part of, is made available * to you by its authors as open source software: you can redistribute it * and/or modify it under the terms of the GNU General Public License version * 2 ("GPL") as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GPL for more details. * * You should have received a copy of the GPL along with this program. If not, * see http://www.gnu.org/licenses/. The authors of this program may be * contacted through http://java-gnome.sourceforge.net/. * * Linking this library statically or dynamically with other modules is making * a combined work based on this library. Thus, the terms and conditions of * the GPL cover the whole combination. As a special exception (the * "Claspath Exception"), the copyright holders of this library give you * permission to link this library with independent modules to produce an * executable, regardless of the license terms of these independent modules, * and to copy and distribute the resulting executable under terms of your * choice, provided that you also meet, for each linked independent module, * the terms and conditions of the license of that module. An independent * module is a module which is not derived from or based on this library. If * you modify this library, you may extend the Classpath Exception to your * version of the library, but you are not obligated to do so. If you do not * wish to do so, delete this exception statement from your version. */ package org.gnome.gtk; /** * A MenuToolButton is an special kind of ToolButton that has an additional * drop-down Menu. * * <p> * Next to the ToolButton itself, a MenuToolButton shows another little Button * with an arrow. When the user clicks this additional Button, a drop-down * Menu pops up. * * <p> * The main usage of a MenuToolButton is to provide access to several related * actions in a Toolbar without wasting too much screen space. For example, * your application can have a MenuToolButton for the "New Document" action, * using the attached Menu to let users choose what kind of new document they * want to create. * * <p> * A MenuToolButton has a default action, to be executed when user clicks the * main Button itself and not the the arrow Button. You can capture that * default event with the {@link ToolButton.Clicked} signal. User Menu * selections are captured with the usual {@link MenuItem.Activate} signal of * each <code>MenuItem</code>. * * @see Toolbar * @see Menu * * @author Vreixo Formoso * @since 4.0.4 */ public class MenuToolButton extends ToolButton { protected MenuToolButton(long pointer) { super(pointer); } /** * Creates a new MenuToolButton using the given icon and Label. * * @param iconWidget * The Widget to be used as the icon for the MenuToolButton. * Usually you will want to use a Widget display an image, such * as {@link Image}. Use <code>null</code> if you do not want * an icon. * @param label * The Label for the MenuToolButton, or <code>null</code> to * provide not Label. */ public MenuToolButton(Widget iconWidget, String label) { super(GtkMenuToolButton.createMenuToolButton(iconWidget, label)); } /** * Creates a new MenuToolButton from the specific stock item. Both the * Label and icon will be set properly from the stock item. By using a * system stock item, the newly created MenuToolButton with use the same * Label and Image as other GNOME applications. To ensure consistent look * and feel between applications, it is highly recommended that you use * provided stock items whenever possible. * * @param stock * The StockId that will determine the Label and icon of the * MenuToolButton. */ public MenuToolButton(Stock stock) { super(GtkMenuToolButton.createMenuToolButtonFromStock(stock.getStockId())); } /** * Sets the Menu to be popped up when the user clicks the arrow Button. * * <p> * You can pass <code>null</code> to make arrow insensitive. */ public void setMenu(Menu menu) { GtkMenuToolButton.setMenu(this, menu); } /** * Get the Menu associated with the MenuToolButton. * * @return The associated Menu or <code>null</code> if no Menu has been * set. */ public Menu getMenu() { return (Menu) GtkMenuToolButton.getMenu(this); } }
cyberpython/java-gnome
src/bindings/org/gnome/gtk/MenuToolButton.java
Java
gpl-2.0
4,952
[ 30522, 1013, 1008, 1008, 9262, 1011, 25781, 1010, 1037, 21318, 3075, 2005, 3015, 14181, 2243, 1998, 25781, 3454, 2013, 9262, 999, 1008, 1008, 9385, 1075, 2289, 1011, 2230, 6515, 10949, 10552, 1010, 13866, 2100, 5183, 1998, 2500, 1008, 1008,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// Copyright 2022 Google LLC. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package beta import ( "bytes" "context" "crypto/sha256" "encoding/json" "fmt" "time" "google.golang.org/api/googleapi" "github.com/GoogleCloudPlatform/declarative-resource-client-library/dcl" ) type ServiceAccount struct { Name *string `json:"name"` Project *string `json:"project"` UniqueId *string `json:"uniqueId"` Email *string `json:"email"` DisplayName *string `json:"displayName"` Description *string `json:"description"` OAuth2ClientId *string `json:"oauth2ClientId"` ActasResources *ServiceAccountActasResources `json:"actasResources"` Disabled *bool `json:"disabled"` } func (r *ServiceAccount) String() string { return dcl.SprintResource(r) } type ServiceAccountActasResources struct { empty bool `json:"-"` Resources []ServiceAccountActasResourcesResources `json:"resources"` } type jsonServiceAccountActasResources ServiceAccountActasResources func (r *ServiceAccountActasResources) UnmarshalJSON(data []byte) error { var res jsonServiceAccountActasResources if err := json.Unmarshal(data, &res); err != nil { return err } var m map[string]interface{} json.Unmarshal(data, &m) if len(m) == 0 { *r = *EmptyServiceAccountActasResources } else { r.Resources = res.Resources } return nil } // This object is used to assert a desired state where this ServiceAccountActasResources is // empty. Go lacks global const objects, but this object should be treated // as one. Modifying this object will have undesirable results. var EmptyServiceAccountActasResources *ServiceAccountActasResources = &ServiceAccountActasResources{empty: true} func (r *ServiceAccountActasResources) Empty() bool { return r.empty } func (r *ServiceAccountActasResources) String() string { return dcl.SprintResource(r) } func (r *ServiceAccountActasResources) HashCode() string { // Placeholder for a more complex hash method that handles ordering, etc // Hash resource body for easy comparison later hash := sha256.New().Sum([]byte(r.String())) return fmt.Sprintf("%x", hash) } type ServiceAccountActasResourcesResources struct { empty bool `json:"-"` FullResourceName *string `json:"fullResourceName"` } type jsonServiceAccountActasResourcesResources ServiceAccountActasResourcesResources func (r *ServiceAccountActasResourcesResources) UnmarshalJSON(data []byte) error { var res jsonServiceAccountActasResourcesResources if err := json.Unmarshal(data, &res); err != nil { return err } var m map[string]interface{} json.Unmarshal(data, &m) if len(m) == 0 { *r = *EmptyServiceAccountActasResourcesResources } else { r.FullResourceName = res.FullResourceName } return nil } // This object is used to assert a desired state where this ServiceAccountActasResourcesResources is // empty. Go lacks global const objects, but this object should be treated // as one. Modifying this object will have undesirable results. var EmptyServiceAccountActasResourcesResources *ServiceAccountActasResourcesResources = &ServiceAccountActasResourcesResources{empty: true} func (r *ServiceAccountActasResourcesResources) Empty() bool { return r.empty } func (r *ServiceAccountActasResourcesResources) String() string { return dcl.SprintResource(r) } func (r *ServiceAccountActasResourcesResources) HashCode() string { // Placeholder for a more complex hash method that handles ordering, etc // Hash resource body for easy comparison later hash := sha256.New().Sum([]byte(r.String())) return fmt.Sprintf("%x", hash) } // Describe returns a simple description of this resource to ensure that automated tools // can identify it. func (r *ServiceAccount) Describe() dcl.ServiceTypeVersion { return dcl.ServiceTypeVersion{ Service: "iam", Type: "ServiceAccount", Version: "beta", } } func (r *ServiceAccount) ID() (string, error) { if err := extractServiceAccountFields(r); err != nil { return "", err } nr := r.urlNormalized() params := map[string]interface{}{ "name": dcl.ValueOrEmptyString(nr.Name), "project": dcl.ValueOrEmptyString(nr.Project), "uniqueId": dcl.ValueOrEmptyString(nr.UniqueId), "email": dcl.ValueOrEmptyString(nr.Email), "displayName": dcl.ValueOrEmptyString(nr.DisplayName), "description": dcl.ValueOrEmptyString(nr.Description), "oAuth2ClientId": dcl.ValueOrEmptyString(nr.OAuth2ClientId), "actasResources": dcl.ValueOrEmptyString(nr.ActasResources), "disabled": dcl.ValueOrEmptyString(nr.Disabled), } return dcl.Nprintf("projects/{{project}}/serviceAccounts/{{name}}@{{project}}.iam.gserviceaccount.com", params), nil } const ServiceAccountMaxPage = -1 type ServiceAccountList struct { Items []*ServiceAccount nextToken string pageSize int32 resource *ServiceAccount } func (l *ServiceAccountList) HasNext() bool { return l.nextToken != "" } func (l *ServiceAccountList) Next(ctx context.Context, c *Client) error { ctx, cancel := context.WithTimeout(ctx, c.Config.TimeoutOr(0*time.Second)) defer cancel() if !l.HasNext() { return fmt.Errorf("no next page") } items, token, err := c.listServiceAccount(ctx, l.resource, l.nextToken, l.pageSize) if err != nil { return err } l.Items = items l.nextToken = token return err } func (c *Client) ListServiceAccount(ctx context.Context, project string) (*ServiceAccountList, error) { ctx = dcl.ContextWithRequestID(ctx) ctx, cancel := context.WithTimeout(ctx, c.Config.TimeoutOr(0*time.Second)) defer cancel() return c.ListServiceAccountWithMaxResults(ctx, project, ServiceAccountMaxPage) } func (c *Client) ListServiceAccountWithMaxResults(ctx context.Context, project string, pageSize int32) (*ServiceAccountList, error) { ctx, cancel := context.WithTimeout(ctx, c.Config.TimeoutOr(0*time.Second)) defer cancel() // Create a resource object so that we can use proper url normalization methods. r := &ServiceAccount{ Project: &project, } items, token, err := c.listServiceAccount(ctx, r, "", pageSize) if err != nil { return nil, err } return &ServiceAccountList{ Items: items, nextToken: token, pageSize: pageSize, resource: r, }, nil } func (c *Client) GetServiceAccount(ctx context.Context, r *ServiceAccount) (*ServiceAccount, error) { ctx = dcl.ContextWithRequestID(ctx) ctx, cancel := context.WithTimeout(ctx, c.Config.TimeoutOr(0*time.Second)) defer cancel() // This is *purposefully* supressing errors. // This function is used with url-normalized values + not URL normalized values. // URL Normalized values will throw unintentional errors, since those values are not of the proper parent form. extractServiceAccountFields(r) b, err := c.getServiceAccountRaw(ctx, r) if err != nil { if dcl.IsNotFound(err) { return nil, &googleapi.Error{ Code: 404, Message: err.Error(), } } return nil, err } result, err := unmarshalServiceAccount(b, c, r) if err != nil { return nil, err } result.Project = r.Project result.Name = r.Name c.Config.Logger.InfoWithContextf(ctx, "Retrieved raw result state: %v", result) c.Config.Logger.InfoWithContextf(ctx, "Canonicalizing with specified state: %v", r) result, err = canonicalizeServiceAccountNewState(c, result, r) if err != nil { return nil, err } if err := postReadExtractServiceAccountFields(result); err != nil { return result, err } c.Config.Logger.InfoWithContextf(ctx, "Created result state: %v", result) return result, nil } func (c *Client) DeleteServiceAccount(ctx context.Context, r *ServiceAccount) error { ctx = dcl.ContextWithRequestID(ctx) ctx, cancel := context.WithTimeout(ctx, c.Config.TimeoutOr(0*time.Second)) defer cancel() if r == nil { return fmt.Errorf("ServiceAccount resource is nil") } c.Config.Logger.InfoWithContext(ctx, "Deleting ServiceAccount...") deleteOp := deleteServiceAccountOperation{} return deleteOp.do(ctx, r, c) } // DeleteAllServiceAccount deletes all resources that the filter functions returns true on. func (c *Client) DeleteAllServiceAccount(ctx context.Context, project string, filter func(*ServiceAccount) bool) error { listObj, err := c.ListServiceAccount(ctx, project) if err != nil { return err } err = c.deleteAllServiceAccount(ctx, filter, listObj.Items) if err != nil { return err } for listObj.HasNext() { err = listObj.Next(ctx, c) if err != nil { return nil } err = c.deleteAllServiceAccount(ctx, filter, listObj.Items) if err != nil { return err } } return nil } func (c *Client) ApplyServiceAccount(ctx context.Context, rawDesired *ServiceAccount, opts ...dcl.ApplyOption) (*ServiceAccount, error) { ctx, cancel := context.WithTimeout(ctx, c.Config.TimeoutOr(0*time.Second)) defer cancel() ctx = dcl.ContextWithRequestID(ctx) var resultNewState *ServiceAccount err := dcl.Do(ctx, func(ctx context.Context) (*dcl.RetryDetails, error) { newState, err := applyServiceAccountHelper(c, ctx, rawDesired, opts...) resultNewState = newState if err != nil { // If the error is 409, there is conflict in resource update. // Here we want to apply changes based on latest state. if dcl.IsConflictError(err) { return &dcl.RetryDetails{}, dcl.OperationNotDone{Err: err} } return nil, err } return nil, nil }, c.Config.RetryProvider) return resultNewState, err } func applyServiceAccountHelper(c *Client, ctx context.Context, rawDesired *ServiceAccount, opts ...dcl.ApplyOption) (*ServiceAccount, error) { c.Config.Logger.InfoWithContext(ctx, "Beginning ApplyServiceAccount...") c.Config.Logger.InfoWithContextf(ctx, "User specified desired state: %v", rawDesired) // 1.1: Validation of user-specified fields in desired state. if err := rawDesired.validate(); err != nil { return nil, err } if err := extractServiceAccountFields(rawDesired); err != nil { return nil, err } initial, desired, fieldDiffs, err := c.serviceAccountDiffsForRawDesired(ctx, rawDesired, opts...) if err != nil { return nil, fmt.Errorf("failed to create a diff: %w", err) } diffs, err := convertFieldDiffsToServiceAccountDiffs(c.Config, fieldDiffs, opts) if err != nil { return nil, err } // TODO(magic-modules-eng): 2.2 Feasibility check (all updates are feasible so far). // 2.3: Lifecycle Directive Check var create bool lp := dcl.FetchLifecycleParams(opts) if initial == nil { if dcl.HasLifecycleParam(lp, dcl.BlockCreation) { return nil, dcl.ApplyInfeasibleError{Message: fmt.Sprintf("Creation blocked by lifecycle params: %#v.", desired)} } create = true } else if dcl.HasLifecycleParam(lp, dcl.BlockAcquire) { return nil, dcl.ApplyInfeasibleError{ Message: fmt.Sprintf("Resource already exists - apply blocked by lifecycle params: %#v.", initial), } } else { for _, d := range diffs { if d.RequiresRecreate { return nil, dcl.ApplyInfeasibleError{ Message: fmt.Sprintf("infeasible update: (%v) would require recreation", d), } } if dcl.HasLifecycleParam(lp, dcl.BlockModification) { return nil, dcl.ApplyInfeasibleError{Message: fmt.Sprintf("Modification blocked, diff (%v) unresolvable.", d)} } } } // 2.4 Imperative Request Planning var ops []serviceAccountApiOperation if create { ops = append(ops, &createServiceAccountOperation{}) } else { for _, d := range diffs { ops = append(ops, d.UpdateOp) } } c.Config.Logger.InfoWithContextf(ctx, "Created plan: %#v", ops) // 2.5 Request Actuation for _, op := range ops { c.Config.Logger.InfoWithContextf(ctx, "Performing operation %T %+v", op, op) if err := op.do(ctx, desired, c); err != nil { c.Config.Logger.InfoWithContextf(ctx, "Failed operation %T %+v: %v", op, op, err) return nil, err } c.Config.Logger.InfoWithContextf(ctx, "Finished operation %T %+v", op, op) } return applyServiceAccountDiff(c, ctx, desired, rawDesired, ops, opts...) } func applyServiceAccountDiff(c *Client, ctx context.Context, desired *ServiceAccount, rawDesired *ServiceAccount, ops []serviceAccountApiOperation, opts ...dcl.ApplyOption) (*ServiceAccount, error) { // 3.1, 3.2a Retrieval of raw new state & canonicalization with desired state c.Config.Logger.InfoWithContext(ctx, "Retrieving raw new state...") rawNew, err := c.GetServiceAccount(ctx, desired.urlNormalized()) if err != nil { return nil, err } // Get additional values from the first response. // These values should be merged into the newState above. if len(ops) > 0 { lastOp := ops[len(ops)-1] if o, ok := lastOp.(*createServiceAccountOperation); ok { if r, hasR := o.FirstResponse(); hasR { c.Config.Logger.InfoWithContext(ctx, "Retrieving raw new state from operation...") fullResp, err := unmarshalMapServiceAccount(r, c, rawDesired) if err != nil { return nil, err } rawNew, err = canonicalizeServiceAccountNewState(c, rawNew, fullResp) if err != nil { return nil, err } } } } c.Config.Logger.InfoWithContextf(ctx, "Canonicalizing with raw desired state: %v", rawDesired) // 3.2b Canonicalization of raw new state using raw desired state newState, err := canonicalizeServiceAccountNewState(c, rawNew, rawDesired) if err != nil { return rawNew, err } c.Config.Logger.InfoWithContextf(ctx, "Created canonical new state: %v", newState) // 3.3 Comparison of the new state and raw desired state. // TODO(magic-modules-eng): EVENTUALLY_CONSISTENT_UPDATE newDesired, err := canonicalizeServiceAccountDesiredState(rawDesired, newState) if err != nil { return newState, err } if err := postReadExtractServiceAccountFields(newState); err != nil { return newState, err } // Need to ensure any transformations made here match acceptably in differ. if err := postReadExtractServiceAccountFields(newDesired); err != nil { return newState, err } c.Config.Logger.InfoWithContextf(ctx, "Diffing using canonicalized desired state: %v", newDesired) newDiffs, err := diffServiceAccount(c, newDesired, newState) if err != nil { return newState, err } if len(newDiffs) == 0 { c.Config.Logger.InfoWithContext(ctx, "No diffs found. Apply was successful.") } else { c.Config.Logger.InfoWithContextf(ctx, "Found diffs: %v", newDiffs) diffMessages := make([]string, len(newDiffs)) for i, d := range newDiffs { diffMessages[i] = fmt.Sprintf("%v", d) } return newState, dcl.DiffAfterApplyError{Diffs: diffMessages} } c.Config.Logger.InfoWithContext(ctx, "Done Apply.") return newState, nil } func (r *ServiceAccount) GetPolicy(basePath string) (string, string, *bytes.Buffer, error) { u := r.getPolicyURL(basePath) body := &bytes.Buffer{} body.WriteString(fmt.Sprintf(`{"options":{"requestedPolicyVersion": %d}}`, r.IAMPolicyVersion())) return u, "POST", body, nil }
GoogleCloudPlatform/declarative-resource-client-library
services/google/iam/beta/service_account.go
GO
apache-2.0
15,545
[ 30522, 1013, 1013, 9385, 16798, 2475, 8224, 11775, 1012, 2035, 2916, 9235, 1012, 1013, 1013, 1013, 1013, 7000, 2104, 1996, 15895, 6105, 1010, 2544, 1016, 1012, 1014, 1006, 1996, 1000, 6105, 1000, 1007, 1025, 1013, 1013, 2017, 2089, 2025, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
//////////////////////////////////////////////////////////////////////////////// // The MIT License (MIT) // // Copyright (c) 2021 Tim Stair // // 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. //////////////////////////////////////////////////////////////////////////////// namespace CardMaker.Events.Args { public delegate void IssueAdded(object sender, IssueMessageEventArgs args); public class IssueMessageEventArgs { public string Message { get; private set; } public IssueMessageEventArgs(string sMessage) { Message = sMessage; } } }
nhmkdev/cardmaker
CardMaker/Events/Args/IssueMessageEventArgs.cs
C#
mit
1,629
[ 30522, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 101...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* Fallback per-CPU frame pointer holder * * Copyright (C) 2006 Red Hat, Inc. All Rights Reserved. * Written by David Howells (dhowells@redhat.com) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ #ifndef _ASM_GENERIC_IRQ_REGS_H #define _ASM_GENERIC_IRQ_REGS_H #include <linux/percpu.h> /* * Per-cpu current frame pointer - the location of the last exception frame on * the stack */ DECLARE_PER_CPU(struct pt_regs *, __irq_regs); static inline struct pt_regs *get_irq_regs(void) { return __this_cpu_read(__irq_regs); } static inline struct pt_regs *set_irq_regs(struct pt_regs *new_regs) { struct pt_regs *old_regs; old_regs = __this_cpu_read(__irq_regs); __this_cpu_write(__irq_regs, new_regs); return old_regs; } #endif /* _ASM_GENERIC_IRQ_REGS_H */
AiJiaZone/linux-4.0
virt/include/asm-generic/irq_regs.h
C
gpl-2.0
980
[ 30522, 1013, 1008, 2991, 5963, 2566, 1011, 17368, 4853, 20884, 9111, 1008, 1008, 9385, 1006, 1039, 1007, 2294, 2417, 6045, 1010, 4297, 1012, 2035, 2916, 9235, 1012, 1008, 2517, 2011, 2585, 18473, 2015, 1006, 28144, 29385, 12718, 1030, 2417,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
namespace :import do desc <<-DESC Import data from an ETDataset node analysis file. Imports all the attributes which live in cells with the headers 'Attribute' and 'Value' on an Excel tab called 'Dashboard'. If these names are not met, this script will not function as intended. For example: rake import:node NODE=industry_burner_coal DESC task node: :environment do include ImportHelper if ENV['NODE'].blank? raise "Please provide a node name. For example: bundle exec rake import:node NODE=my_node" end node = if Atlas::EnergyNode.exists?(ENV['NODE']) Atlas::EnergyNode.find(ENV['NODE']) elsif Atlas::MoleculeNode.exists?(ENV['NODE']) Atlas::MoleculeNode.find(ENV['NODE']) else raise "No such node found in ETSource: #{ENV['NODE']}" end basename = [node.key, node.class.subclass_suffix].compact.join('.') node_path = "#{node.graph_config.name}/#{node.sector}/#{basename}" xlsx = Roo::Spreadsheet.open("#{ETDATASET_PATH}/nodes_source_analyses/#{node_path}.xlsx") xlsx.sheet('Dashboard').each(attribute: 'Attribute', value: 'Value') do |key_val| next unless key_val[:value].is_a?(Numeric) attribute = key_val[:attribute].strip if attribute =~ /\./ attribute, subkey = attribute.split('.', 2) begin subhash = get_attribute(node, attribute, subkey) rescue KeyError => e warn('Ignored:' + e) next end # Check for sub-subhashes (does not work for FeverDetails, TransformerDetails - Storage etc) subhash, subkey = set_subhashes(subhash, subkey) if subhash.is_a?(Hash) set_attribute(subhash, subkey, key_val[:value]) else begin set_attribute(node, attribute, key_val[:value]) rescue KeyError => e warn('Ignored:' + e) end end end node.save(false) end end # Helper methods for this task module ImportHelper def set_attribute(item, attribute, value) if item.respond_to?("#{attribute}=") item.public_send("#{attribute}=", value) elsif item.is_a?(Hash) item[attribute.to_sym] = value else raise_attribute_error(item, attribute, "= #{value}") end end def get_attribute(item, attribute, *info) if item.respond_to?(attribute) item.public_send(attribute) else raise_attribute_error(item, attribute, *info) end end def raise_attribute_error(item, attribute, *info) raise KeyError("#{attribute} #{info} (no such attribute on #{item.class})") end def set_subhashes(subhash, subkey) while subkey.include?('.') left, right = subkey.split('.', 2) left = left.to_sym subhash[left] = {} unless subhash[left].is_a?(Hash) subkey = right subhash = subhash[left] end [subhash, subkey] end end
quintel/etsource
tasks/etdataset/import_node.rb
Ruby
mit
2,901
[ 30522, 3415, 15327, 30524, 2102, 13045, 4106, 5371, 1012, 17589, 2035, 1996, 12332, 2029, 2444, 1999, 4442, 2007, 1996, 20346, 2015, 1005, 17961, 1005, 1998, 1005, 3643, 1005, 2006, 2019, 24970, 21628, 2170, 1005, 24923, 1005, 1012, 2065, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// This code (and its parent process in changes.js) is a Node.JS listener // listening to CouchDB's _changes feed, and is derived from // https://github.com/mikeal/node.couch.js and // http://dominicbarnes.us/node-couchdb-api/api/database/changes.html // It monitors when requests are submitted to: // (when configuring a directory's settings) get a url in general // (when a directory is already configured) download all cong data for a directory // TODO: Could we use backbone-couch.js here instead of cradle, in order to use our // Backbone model here? var buffer = '', http = require('http'), https = require('https'), ncl_dir = '/_attachments/node_changes_listeners/', config = require('./config'), db = config.db, log = require('./lib').log; //$ = require('jquery'); //var model = require('model.js').model //stdin = process.openStdin(); // if (config.debug) // var longjohn = require('./node_modules/longjohn') //stdin.setEncoding('utf8'); console.log('Starting changes listener...') // -------- Declare utility functions -------- function get_url(doc, from_url, to_html, status_flag, options){ var http_lib = http if (doc[from_url].indexOf('https') === 0){ // Switch to using https if necessary var http_lib = https } http_lib.get(doc[from_url], function(res){ var pageData = '' res.on('data', function(chunk){ pageData += chunk }) res.on('end', function(){ // Check to see if we got a 404 response if (res.statusCode == '404'){ console.log('Got a 404!') // TODO: If we got a 404, then notify the user this page doesn't exist doc[status_flag] = '404' db.save(doc._id, doc._rev, doc) }else{ // Write the contents of the html variable back to the database doc[to_html] = pageData doc[status_flag] = 'gotten' // console.log(new Date().getTime() + '\t n: ' + status_flag + ': ' + doc[status_flag] + ' ' + doc[from_url]) // TODO: Use Backbone here instead of cradle db.save(doc._id, doc._rev, doc, function(err, res){ // TODO: Do anything more that needs to be done here if (to_html == 'url_html'){ console.log('Getting url_html...handling response end') console.log(doc) } if (options && options.success){ options.success() } }); } }) }); } function save(options){ db.get(options.doc._id, function(err, doc){ options.doc = doc if (!err && options.doc && options.doc._id && typeof options.doc._id !== 'undefined'){ // Save to the db all the HTML we've gotten // TODO: This is running several times in series options.doc[options.to_html] = options.output_array options.doc[options.status_flag] = 'gotten'; // Deletes number downloaded since it's not needed anymore delete options.doc[options.number_downloaded] db.save(options.doc._id, options.doc._rev, options.doc, function(err, response){ if (err !== null){ console.error(err) // Recurse to try saving again // Only recurse a certain number of times, then fail, to avoid a memory leak if (options.save_attempts <= 5){ options.save_attempts++; // console.log('options.save_attempts: ' + options.save_attempts) save(options) }else{ // TODO: This is where we get an error. For some reason sometimes, // but not always, we have the wrong revision here, and this causes get_state_url_html // to never == 'gotten', (so the state details page doesn't display?) // console.error('Failed to save doc: ' + options.doc._id, options.doc._rev) } }else{ // console.log('Succeeded at saving all the states\' HTML pages') options.output_array_saved = true // Remove this options.status_flag from the list of tasks currently_getting.splice(currently_getting.indexOf(options.status_flag),1) // Clean up some memory options.output_array = [] } }) } }) } function recurse_then_save(i, options){ // If we've downloaded all the HTML, and haven't saved to the db yet if (options.output_array.length == options.doc[options.from_urls].length && options.output_array_saved !== true){ options.save_attempts = 0 if (options.output_array_saved !== true){ save(options) // console.log ("after saving all the states") } } // Call the parent function recursively to enable throttling the rate of web-scraping requests // Handle next URL recurse_urls(i+1, options) } function recurse_urls(i, options){ if (typeof options.doc[options.from_urls] == 'undefined'){ // console.log(options.doc[options.from_urls]) } // Stop running if we have reached the end of the list of URLs, if (options.doc[options.from_urls][i] !== '' && typeof options.doc[options.from_urls][i] !== 'undefined' && // and don't run if we've already downloaded the HTML for this URL typeof options.doc[i] == 'undefined'){ // TODO: Make this handle options.doc[options.method] == 'post' http.get(options.doc[options.from_urls][i], function(res){ var pageData = '' res.on('data', function(chunk){ pageData += chunk }) res.on('end', function(){ // TODO: Check to see if we got a 404 response // Append result to options.output_array options.output_array[i] = pageData if (options.doc[options.status_flag] !== 'getting'){ options.doc[options.status_flag] = 'getting' // Set flag to indicate that we just reset the status_flag options.flag_set = true // report to the db the fact we are getting the HTML // console.log ("before saving all the states") db.save(options.doc._id, options.doc._rev, options.doc, function(err, response){ recurse_then_save(i, options) }) } // Record the number downloaded // Don't run until the status_flag has been set if (typeof options.flag_set !== 'undefined' && options.flag_set === true){ recurse_then_save(i, options) } }) }) }else{ currently_getting.splice(currently_getting.indexOf(options.status_flag),1) } } currently_getting = [] function get_url_set(options){ // Don't run more than one copy of this task at a time if (currently_getting.indexOf(options.status_flag) == -1){ // Add this options.status_flag to the list of tasks currently_getting.push(options.status_flag) var i = 0 options.output_array = [] options.output_array_saved = false // Use a recursive function to allow throttling the rate of web-scraping requests // per second to avoid getting banned by some servers. recurse_urls(i, options) } } // -------- Main routine that handles all db changes -------- // Only get changes after "update_seq" db.get('', function(err,doc){ // TODO: This throws: TypeError: Cannot read property 'update_seq' of undefined db.changes({since:doc.update_seq}).on('change', function (change) { db.get(change.id, change.changes[0].rev, function(err, doc){ if (change.id && change.id.slice(0, '_design/'.length) !== '_design/') { // This is a change to a data document // Feed the new doc into the changes listeners if (doc) { // Don't handle docs that have been deleted // Watch for requests to get the contents of a URL for a church directory // TODO: Check to see if the URL is valid if (doc.collection == 'directory' && doc.get_url_html=='requested' && doc.url){ // E.g., when a user enters "opc.org/locator.html" into the church directory configuration page, // then go get the contents of that URL. get_url(doc, 'url', 'url_html', 'get_url_html') } if (doc.collection == 'directory' && doc.get_cong_url_html=='requested' && doc.cong_url){ get_url(doc, 'cong_url_raw', 'cong_url_html', 'get_cong_url_html', {success:function(){ // Iterate state pages' HTML for (var i=0; i<doc.state_url_html.length; i++){ // TODO: Get each cong's URL var state_html = doc.state_url_html[i] // TODO: Get each cong page's HTML & write to database } }}) } // Watch for requests to get the contents of a state page URL if (doc.collection == 'directory' && doc.get_state_url_html=='requested' && doc.state_url){ // Interpolate state names into URLs var state_page_urls = [] // console.log('before interpolating state names into URLs') for (var i=0; i<doc.state_page_values.length; i++){ if (doc.state_page_values[i] !== ''){ state_page_urls.push(doc.state_url.replace('{state_name}', doc.state_page_values[i])) } } // console.log('about to get_url_set') doc.state_page_urls = state_page_urls get_url_set({ doc: doc, from_urls: 'state_page_urls', method: 'state_url_method', to_html: 'state_url_html', status_flag: 'get_state_url_html', number_downloaded: 'state_urls_gotten', success:function(){ // TODO: Cleanup unnecessary doc attributes here? Probably that should be done in // ImportDirectoryView.js instead. }}) } // Watch for requests to get the contents of a batchgeo map URL if (doc.collection == 'directory' && doc.get_batchgeo_map_html=='requested' && doc.batchgeo_map_url){ get_url(doc, 'batchgeo_map_url', 'batchgeo_map_html', 'get_batchgeo_map_html') } // Watch for requests to get the contents of a JSON feed if (doc.collection == 'directory' && doc.get_json=='requested' && doc.json_url){ get_url(doc, 'json_url', 'json', 'get_json') } } } }); }); })
DouglasHuston/rcl
node_changes_listeners/changes_listeners.js
JavaScript
bsd-3-clause
10,689
[ 30522, 1013, 1013, 2023, 3642, 1006, 1998, 2049, 6687, 30524, 1013, 5962, 2000, 6411, 18939, 1005, 1055, 1035, 3431, 5438, 1010, 1998, 2003, 5173, 2013, 1013, 1013, 16770, 1024, 1013, 1013, 21025, 2705, 12083, 1012, 4012, 1013, 3505, 2389, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// generated by jwg -output misc/fixture/j/model_json.go misc/fixture/j; DO NOT EDIT package j import ( "encoding/json" ) // FooJSON is jsonized struct for Foo. type FooJSON struct { Tmp *Temp `json:"tmp,omitempty"` Bar `json:",omitempty"` *Buzz `json:",omitempty"` HogeJSON `json:",omitempty"` *FugaJSON `json:",omitempty"` } // FooJSONList is synonym about []*FooJSON. type FooJSONList []*FooJSON // FooPropertyEncoder is property encoder for [1]sJSON. type FooPropertyEncoder func(src *Foo, dest *FooJSON) error // FooPropertyDecoder is property decoder for [1]sJSON. type FooPropertyDecoder func(src *FooJSON, dest *Foo) error // FooPropertyInfo stores property information. type FooPropertyInfo struct { fieldName string jsonName string Encoder FooPropertyEncoder Decoder FooPropertyDecoder } // FieldName returns struct field name of property. func (info *FooPropertyInfo) FieldName() string { return info.fieldName } // JSONName returns json field name of property. func (info *FooPropertyInfo) JSONName() string { return info.jsonName } // FooJSONBuilder convert between Foo to FooJSON mutually. type FooJSONBuilder struct { _properties map[string]*FooPropertyInfo _jsonPropertyMap map[string]*FooPropertyInfo _structPropertyMap map[string]*FooPropertyInfo Tmp *FooPropertyInfo Bar *FooPropertyInfo Buzz *FooPropertyInfo Hoge *FooPropertyInfo Fuga *FooPropertyInfo } // NewFooJSONBuilder make new FooJSONBuilder. func NewFooJSONBuilder() *FooJSONBuilder { jb := &FooJSONBuilder{ _properties: map[string]*FooPropertyInfo{}, _jsonPropertyMap: map[string]*FooPropertyInfo{}, _structPropertyMap: map[string]*FooPropertyInfo{}, Tmp: &FooPropertyInfo{ fieldName: "Tmp", jsonName: "tmp", Encoder: func(src *Foo, dest *FooJSON) error { if src == nil { return nil } dest.Tmp = src.Tmp return nil }, Decoder: func(src *FooJSON, dest *Foo) error { if src == nil { return nil } dest.Tmp = src.Tmp return nil }, }, Bar: &FooPropertyInfo{ fieldName: "Bar", jsonName: "", Encoder: func(src *Foo, dest *FooJSON) error { if src == nil { return nil } dest.Bar = src.Bar return nil }, Decoder: func(src *FooJSON, dest *Foo) error { if src == nil { return nil } dest.Bar = src.Bar return nil }, }, Buzz: &FooPropertyInfo{ fieldName: "Buzz", jsonName: "", Encoder: func(src *Foo, dest *FooJSON) error { if src == nil { return nil } dest.Buzz = src.Buzz return nil }, Decoder: func(src *FooJSON, dest *Foo) error { if src == nil { return nil } dest.Buzz = src.Buzz return nil }, }, Hoge: &FooPropertyInfo{ fieldName: "Hoge", jsonName: "", Encoder: func(src *Foo, dest *FooJSON) error { if src == nil { return nil } d, err := NewHogeJSONBuilder().AddAll().Convert(&src.Hoge) if err != nil { return err } dest.HogeJSON = *d return nil }, Decoder: func(src *FooJSON, dest *Foo) error { if src == nil { return nil } d, err := src.HogeJSON.Convert() if err != nil { return err } dest.Hoge = *d return nil }, }, Fuga: &FooPropertyInfo{ fieldName: "Fuga", jsonName: "", Encoder: func(src *Foo, dest *FooJSON) error { if src == nil { return nil } else if src.Fuga == nil { return nil } d, err := NewFugaJSONBuilder().AddAll().Convert(src.Fuga) if err != nil { return err } dest.FugaJSON = d return nil }, Decoder: func(src *FooJSON, dest *Foo) error { if src == nil { return nil } else if src.FugaJSON == nil { return nil } d, err := src.FugaJSON.Convert() if err != nil { return err } dest.Fuga = d return nil }, }, } jb._structPropertyMap["Tmp"] = jb.Tmp jb._jsonPropertyMap["tmp"] = jb.Tmp jb._structPropertyMap["Bar"] = jb.Bar jb._jsonPropertyMap[""] = jb.Bar jb._structPropertyMap["Buzz"] = jb.Buzz jb._jsonPropertyMap[""] = jb.Buzz jb._structPropertyMap["Hoge"] = jb.Hoge jb._jsonPropertyMap[""] = jb.Hoge jb._structPropertyMap["Fuga"] = jb.Fuga jb._jsonPropertyMap[""] = jb.Fuga return jb } // Properties returns all properties on FooJSONBuilder. func (b *FooJSONBuilder) Properties() []*FooPropertyInfo { return []*FooPropertyInfo{ b.Tmp, b.Bar, b.Buzz, b.Hoge, b.Fuga, } } // AddAll adds all property to FooJSONBuilder. func (b *FooJSONBuilder) AddAll() *FooJSONBuilder { b._properties["Tmp"] = b.Tmp b._properties["Bar"] = b.Bar b._properties["Buzz"] = b.Buzz b._properties["Hoge"] = b.Hoge b._properties["Fuga"] = b.Fuga return b } // Add specified property to FooJSONBuilder. func (b *FooJSONBuilder) Add(info *FooPropertyInfo) *FooJSONBuilder { b._properties[info.fieldName] = info return b } // AddByJSONNames add properties to FooJSONBuilder by JSON property name. if name is not in the builder, it will ignore. func (b *FooJSONBuilder) AddByJSONNames(names ...string) *FooJSONBuilder { for _, name := range names { info := b._jsonPropertyMap[name] if info == nil { continue } b._properties[info.fieldName] = info } return b } // AddByNames add properties to FooJSONBuilder by struct property name. if name is not in the builder, it will ignore. func (b *FooJSONBuilder) AddByNames(names ...string) *FooJSONBuilder { for _, name := range names { info := b._structPropertyMap[name] if info == nil { continue } b._properties[info.fieldName] = info } return b } // Remove specified property to FooJSONBuilder. func (b *FooJSONBuilder) Remove(info *FooPropertyInfo) *FooJSONBuilder { delete(b._properties, info.fieldName) return b } // RemoveByJSONNames remove properties to FooJSONBuilder by JSON property name. if name is not in the builder, it will ignore. func (b *FooJSONBuilder) RemoveByJSONNames(names ...string) *FooJSONBuilder { for _, name := range names { info := b._jsonPropertyMap[name] if info == nil { continue } delete(b._properties, info.fieldName) } return b } // RemoveByNames remove properties to FooJSONBuilder by struct property name. if name is not in the builder, it will ignore. func (b *FooJSONBuilder) RemoveByNames(names ...string) *FooJSONBuilder { for _, name := range names { info := b._structPropertyMap[name] if info == nil { continue } delete(b._properties, info.fieldName) } return b } // Convert specified non-JSON object to JSON object. func (b *FooJSONBuilder) Convert(orig *Foo) (*FooJSON, error) { if orig == nil { return nil, nil } ret := &FooJSON{} for _, info := range b._properties { if err := info.Encoder(orig, ret); err != nil { return nil, err } } return ret, nil } // ConvertList specified non-JSON slice to JSONList. func (b *FooJSONBuilder) ConvertList(orig []*Foo) (FooJSONList, error) { if orig == nil { return nil, nil } list := make(FooJSONList, len(orig)) for idx, or := range orig { json, err := b.Convert(or) if err != nil { return nil, err } list[idx] = json } return list, nil } // Convert specified JSON object to non-JSON object. func (orig *FooJSON) Convert() (*Foo, error) { ret := &Foo{} b := NewFooJSONBuilder().AddAll() for _, info := range b._properties { if err := info.Decoder(orig, ret); err != nil { return nil, err } } return ret, nil } // Convert specified JSONList to non-JSON slice. func (jsonList FooJSONList) Convert() ([]*Foo, error) { orig := ([]*FooJSON)(jsonList) list := make([]*Foo, len(orig)) for idx, or := range orig { obj, err := or.Convert() if err != nil { return nil, err } list[idx] = obj } return list, nil } // Marshal non-JSON object to JSON string. func (b *FooJSONBuilder) Marshal(orig *Foo) ([]byte, error) { ret, err := b.Convert(orig) if err != nil { return nil, err } return json.Marshal(ret) } // HogeJSON is jsonized struct for Hoge. type HogeJSON struct { Hoge1 string `json:"hoge1,omitempty"` } // HogeJSONList is synonym about []*HogeJSON. type HogeJSONList []*HogeJSON // HogePropertyEncoder is property encoder for [1]sJSON. type HogePropertyEncoder func(src *Hoge, dest *HogeJSON) error // HogePropertyDecoder is property decoder for [1]sJSON. type HogePropertyDecoder func(src *HogeJSON, dest *Hoge) error // HogePropertyInfo stores property information. type HogePropertyInfo struct { fieldName string jsonName string Encoder HogePropertyEncoder Decoder HogePropertyDecoder } // FieldName returns struct field name of property. func (info *HogePropertyInfo) FieldName() string { return info.fieldName } // JSONName returns json field name of property. func (info *HogePropertyInfo) JSONName() string { return info.jsonName } // HogeJSONBuilder convert between Hoge to HogeJSON mutually. type HogeJSONBuilder struct { _properties map[string]*HogePropertyInfo _jsonPropertyMap map[string]*HogePropertyInfo _structPropertyMap map[string]*HogePropertyInfo Hoge1 *HogePropertyInfo } // NewHogeJSONBuilder make new HogeJSONBuilder. func NewHogeJSONBuilder() *HogeJSONBuilder { jb := &HogeJSONBuilder{ _properties: map[string]*HogePropertyInfo{}, _jsonPropertyMap: map[string]*HogePropertyInfo{}, _structPropertyMap: map[string]*HogePropertyInfo{}, Hoge1: &HogePropertyInfo{ fieldName: "Hoge1", jsonName: "hoge1", Encoder: func(src *Hoge, dest *HogeJSON) error { if src == nil { return nil } dest.Hoge1 = src.Hoge1 return nil }, Decoder: func(src *HogeJSON, dest *Hoge) error { if src == nil { return nil } dest.Hoge1 = src.Hoge1 return nil }, }, } jb._structPropertyMap["Hoge1"] = jb.Hoge1 jb._jsonPropertyMap["hoge1"] = jb.Hoge1 return jb } // Properties returns all properties on HogeJSONBuilder. func (b *HogeJSONBuilder) Properties() []*HogePropertyInfo { return []*HogePropertyInfo{ b.Hoge1, } } // AddAll adds all property to HogeJSONBuilder. func (b *HogeJSONBuilder) AddAll() *HogeJSONBuilder { b._properties["Hoge1"] = b.Hoge1 return b } // Add specified property to HogeJSONBuilder. func (b *HogeJSONBuilder) Add(info *HogePropertyInfo) *HogeJSONBuilder { b._properties[info.fieldName] = info return b } // AddByJSONNames add properties to HogeJSONBuilder by JSON property name. if name is not in the builder, it will ignore. func (b *HogeJSONBuilder) AddByJSONNames(names ...string) *HogeJSONBuilder { for _, name := range names { info := b._jsonPropertyMap[name] if info == nil { continue } b._properties[info.fieldName] = info } return b } // AddByNames add properties to HogeJSONBuilder by struct property name. if name is not in the builder, it will ignore. func (b *HogeJSONBuilder) AddByNames(names ...string) *HogeJSONBuilder { for _, name := range names { info := b._structPropertyMap[name] if info == nil { continue } b._properties[info.fieldName] = info } return b } // Remove specified property to HogeJSONBuilder. func (b *HogeJSONBuilder) Remove(info *HogePropertyInfo) *HogeJSONBuilder { delete(b._properties, info.fieldName) return b } // RemoveByJSONNames remove properties to HogeJSONBuilder by JSON property name. if name is not in the builder, it will ignore. func (b *HogeJSONBuilder) RemoveByJSONNames(names ...string) *HogeJSONBuilder { for _, name := range names { info := b._jsonPropertyMap[name] if info == nil { continue } delete(b._properties, info.fieldName) } return b } // RemoveByNames remove properties to HogeJSONBuilder by struct property name. if name is not in the builder, it will ignore. func (b *HogeJSONBuilder) RemoveByNames(names ...string) *HogeJSONBuilder { for _, name := range names { info := b._structPropertyMap[name] if info == nil { continue } delete(b._properties, info.fieldName) } return b } // Convert specified non-JSON object to JSON object. func (b *HogeJSONBuilder) Convert(orig *Hoge) (*HogeJSON, error) { if orig == nil { return nil, nil } ret := &HogeJSON{} for _, info := range b._properties { if err := info.Encoder(orig, ret); err != nil { return nil, err } } return ret, nil } // ConvertList specified non-JSON slice to JSONList. func (b *HogeJSONBuilder) ConvertList(orig []*Hoge) (HogeJSONList, error) { if orig == nil { return nil, nil } list := make(HogeJSONList, len(orig)) for idx, or := range orig { json, err := b.Convert(or) if err != nil { return nil, err } list[idx] = json } return list, nil } // Convert specified JSON object to non-JSON object. func (orig *HogeJSON) Convert() (*Hoge, error) { ret := &Hoge{} b := NewHogeJSONBuilder().AddAll() for _, info := range b._properties { if err := info.Decoder(orig, ret); err != nil { return nil, err } } return ret, nil } // Convert specified JSONList to non-JSON slice. func (jsonList HogeJSONList) Convert() ([]*Hoge, error) { orig := ([]*HogeJSON)(jsonList) list := make([]*Hoge, len(orig)) for idx, or := range orig { obj, err := or.Convert() if err != nil { return nil, err } list[idx] = obj } return list, nil } // Marshal non-JSON object to JSON string. func (b *HogeJSONBuilder) Marshal(orig *Hoge) ([]byte, error) { ret, err := b.Convert(orig) if err != nil { return nil, err } return json.Marshal(ret) } // FugaJSON is jsonized struct for Fuga. type FugaJSON struct { Fuga1 string `json:"fuga1,omitempty"` } // FugaJSONList is synonym about []*FugaJSON. type FugaJSONList []*FugaJSON // FugaPropertyEncoder is property encoder for [1]sJSON. type FugaPropertyEncoder func(src *Fuga, dest *FugaJSON) error // FugaPropertyDecoder is property decoder for [1]sJSON. type FugaPropertyDecoder func(src *FugaJSON, dest *Fuga) error // FugaPropertyInfo stores property information. type FugaPropertyInfo struct { fieldName string jsonName string Encoder FugaPropertyEncoder Decoder FugaPropertyDecoder } // FieldName returns struct field name of property. func (info *FugaPropertyInfo) FieldName() string { return info.fieldName } // JSONName returns json field name of property. func (info *FugaPropertyInfo) JSONName() string { return info.jsonName } // FugaJSONBuilder convert between Fuga to FugaJSON mutually. type FugaJSONBuilder struct { _properties map[string]*FugaPropertyInfo _jsonPropertyMap map[string]*FugaPropertyInfo _structPropertyMap map[string]*FugaPropertyInfo Fuga1 *FugaPropertyInfo } // NewFugaJSONBuilder make new FugaJSONBuilder. func NewFugaJSONBuilder() *FugaJSONBuilder { jb := &FugaJSONBuilder{ _properties: map[string]*FugaPropertyInfo{}, _jsonPropertyMap: map[string]*FugaPropertyInfo{}, _structPropertyMap: map[string]*FugaPropertyInfo{}, Fuga1: &FugaPropertyInfo{ fieldName: "Fuga1", jsonName: "fuga1", Encoder: func(src *Fuga, dest *FugaJSON) error { if src == nil { return nil } dest.Fuga1 = src.Fuga1 return nil }, Decoder: func(src *FugaJSON, dest *Fuga) error { if src == nil { return nil } dest.Fuga1 = src.Fuga1 return nil }, }, } jb._structPropertyMap["Fuga1"] = jb.Fuga1 jb._jsonPropertyMap["fuga1"] = jb.Fuga1 return jb } // Properties returns all properties on FugaJSONBuilder. func (b *FugaJSONBuilder) Properties() []*FugaPropertyInfo { return []*FugaPropertyInfo{ b.Fuga1, } } // AddAll adds all property to FugaJSONBuilder. func (b *FugaJSONBuilder) AddAll() *FugaJSONBuilder { b._properties["Fuga1"] = b.Fuga1 return b } // Add specified property to FugaJSONBuilder. func (b *FugaJSONBuilder) Add(info *FugaPropertyInfo) *FugaJSONBuilder { b._properties[info.fieldName] = info return b } // AddByJSONNames add properties to FugaJSONBuilder by JSON property name. if name is not in the builder, it will ignore. func (b *FugaJSONBuilder) AddByJSONNames(names ...string) *FugaJSONBuilder { for _, name := range names { info := b._jsonPropertyMap[name] if info == nil { continue } b._properties[info.fieldName] = info } return b } // AddByNames add properties to FugaJSONBuilder by struct property name. if name is not in the builder, it will ignore. func (b *FugaJSONBuilder) AddByNames(names ...string) *FugaJSONBuilder { for _, name := range names { info := b._structPropertyMap[name] if info == nil { continue } b._properties[info.fieldName] = info } return b } // Remove specified property to FugaJSONBuilder. func (b *FugaJSONBuilder) Remove(info *FugaPropertyInfo) *FugaJSONBuilder { delete(b._properties, info.fieldName) return b } // RemoveByJSONNames remove properties to FugaJSONBuilder by JSON property name. if name is not in the builder, it will ignore. func (b *FugaJSONBuilder) RemoveByJSONNames(names ...string) *FugaJSONBuilder { for _, name := range names { info := b._jsonPropertyMap[name] if info == nil { continue } delete(b._properties, info.fieldName) } return b } // RemoveByNames remove properties to FugaJSONBuilder by struct property name. if name is not in the builder, it will ignore. func (b *FugaJSONBuilder) RemoveByNames(names ...string) *FugaJSONBuilder { for _, name := range names { info := b._structPropertyMap[name] if info == nil { continue } delete(b._properties, info.fieldName) } return b } // Convert specified non-JSON object to JSON object. func (b *FugaJSONBuilder) Convert(orig *Fuga) (*FugaJSON, error) { if orig == nil { return nil, nil } ret := &FugaJSON{} for _, info := range b._properties { if err := info.Encoder(orig, ret); err != nil { return nil, err } } return ret, nil } // ConvertList specified non-JSON slice to JSONList. func (b *FugaJSONBuilder) ConvertList(orig []*Fuga) (FugaJSONList, error) { if orig == nil { return nil, nil } list := make(FugaJSONList, len(orig)) for idx, or := range orig { json, err := b.Convert(or) if err != nil { return nil, err } list[idx] = json } return list, nil } // Convert specified JSON object to non-JSON object. func (orig *FugaJSON) Convert() (*Fuga, error) { ret := &Fuga{} b := NewFugaJSONBuilder().AddAll() for _, info := range b._properties { if err := info.Decoder(orig, ret); err != nil { return nil, err } } return ret, nil } // Convert specified JSONList to non-JSON slice. func (jsonList FugaJSONList) Convert() ([]*Fuga, error) { orig := ([]*FugaJSON)(jsonList) list := make([]*Fuga, len(orig)) for idx, or := range orig { obj, err := or.Convert() if err != nil { return nil, err } list[idx] = obj } return list, nil } // Marshal non-JSON object to JSON string. func (b *FugaJSONBuilder) Marshal(orig *Fuga) ([]byte, error) { ret, err := b.Convert(orig) if err != nil { return nil, err } return json.Marshal(ret) }
favclip/jwg
misc/fixture/j/model_json.go
GO
mit
18,918
[ 30522, 1013, 1013, 7013, 2011, 1046, 27767, 1011, 6434, 28616, 2278, 1013, 15083, 1013, 1046, 1013, 2944, 1035, 1046, 3385, 1012, 2175, 28616, 2278, 1013, 15083, 1013, 1046, 1025, 2079, 2025, 10086, 7427, 1046, 12324, 1006, 1000, 17181, 101...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// Copyright 2015 Comcast Cable Communications Management, LLC // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // This file was initially generated by gen_to_start.go (add link), as a start // of the Traffic Ops golang data model package api import ( "encoding/json" _ "github.com/Comcast/traffic_control/traffic_ops/experimental/server/output_format" // needed for swagger "github.com/jmoiron/sqlx" "log" "time" ) type StaticdnsentriesTypes struct { Name string `db:"name" json:"name"` Description string `db:"description" json:"description"` CreatedAt time.Time `db:"created_at" json:"createdAt"` Links StaticdnsentriesTypesLinks `json:"_links" db:-` } type StaticdnsentriesTypesLinks struct { Self string `db:"self" json:"_self"` } type StaticdnsentriesTypesLink struct { ID string `db:"staticdnsentries_type" json:"name"` Ref string `db:"staticdnsentries_types_name_ref" json:"_ref"` } // @Title getStaticdnsentriesTypesById // @Description retrieves the staticdnsentries_types information for a certain id // @Accept application/json // @Param id path int false "The row id" // @Success 200 {array} StaticdnsentriesTypes // @Resource /api/2.0 // @Router /api/2.0/staticdnsentries_types/{id} [get] func getStaticdnsentriesType(name string, db *sqlx.DB) (interface{}, error) { ret := []StaticdnsentriesTypes{} arg := StaticdnsentriesTypes{} arg.Name = name queryStr := "select *, concat('" + API_PATH + "staticdnsentries_types/', name) as self" queryStr += " from staticdnsentries_types WHERE name=:name" nstmt, err := db.PrepareNamed(queryStr) err = nstmt.Select(&ret, arg) if err != nil { log.Println(err) return nil, err } nstmt.Close() return ret, nil } // @Title getStaticdnsentriesTypess // @Description retrieves the staticdnsentries_types // @Accept application/json // @Success 200 {array} StaticdnsentriesTypes // @Resource /api/2.0 // @Router /api/2.0/staticdnsentries_types [get] func getStaticdnsentriesTypes(db *sqlx.DB) (interface{}, error) { ret := []StaticdnsentriesTypes{} queryStr := "select *, concat('" + API_PATH + "staticdnsentries_types/', name) as self" queryStr += " from staticdnsentries_types" err := db.Select(&ret, queryStr) if err != nil { log.Println(err) return nil, err } return ret, nil } // @Title postStaticdnsentriesTypes // @Description enter a new staticdnsentries_types // @Accept application/json // @Param Body body StaticdnsentriesTypes true "StaticdnsentriesTypes object that should be added to the table" // @Success 200 {object} output_format.ApiWrapper // @Resource /api/2.0 // @Router /api/2.0/staticdnsentries_types [post] func postStaticdnsentriesType(payload []byte, db *sqlx.DB) (interface{}, error) { var v StaticdnsentriesTypes err := json.Unmarshal(payload, &v) if err != nil { log.Println(err) return nil, err } sqlString := "INSERT INTO staticdnsentries_types(" sqlString += "name" sqlString += ",description" sqlString += ",created_at" sqlString += ") VALUES (" sqlString += ":name" sqlString += ",:description" sqlString += ",:created_at" sqlString += ")" result, err := db.NamedExec(sqlString, v) if err != nil { log.Println(err) return nil, err } return result, err } // @Title putStaticdnsentriesTypes // @Description modify an existing staticdnsentries_typesentry // @Accept application/json // @Param id path int true "The row id" // @Param Body body StaticdnsentriesTypes true "StaticdnsentriesTypes object that should be added to the table" // @Success 200 {object} output_format.ApiWrapper // @Resource /api/2.0 // @Router /api/2.0/staticdnsentries_types/{id} [put] func putStaticdnsentriesType(name string, payload []byte, db *sqlx.DB) (interface{}, error) { var arg StaticdnsentriesTypes err := json.Unmarshal(payload, &arg) arg.Name = name if err != nil { log.Println(err) return nil, err } sqlString := "UPDATE staticdnsentries_types SET " sqlString += "name = :name" sqlString += ",description = :description" sqlString += ",created_at = :created_at" sqlString += " WHERE name=:name" result, err := db.NamedExec(sqlString, arg) if err != nil { log.Println(err) return nil, err } return result, err } // @Title delStaticdnsentriesTypesById // @Description deletes staticdnsentries_types information for a certain id // @Accept application/json // @Param id path int false "The row id" // @Success 200 {array} StaticdnsentriesTypes // @Resource /api/2.0 // @Router /api/2.0/staticdnsentries_types/{id} [delete] func delStaticdnsentriesType(name string, db *sqlx.DB) (interface{}, error) { arg := StaticdnsentriesTypes{} arg.Name = name result, err := db.NamedExec("DELETE FROM staticdnsentries_types WHERE name=:name", arg) if err != nil { log.Println(err) return nil, err } return result, err }
smalenfant/traffic_control
traffic_ops/experimental/server/api/staticdnsentries_types.go
GO
apache-2.0
5,501
[ 30522, 1013, 1013, 9385, 2325, 4012, 10526, 5830, 4806, 2968, 1010, 11775, 1013, 1013, 7000, 2104, 1996, 15895, 6105, 1010, 2544, 1016, 1012, 1014, 1006, 1996, 1000, 6105, 1000, 1007, 1025, 1013, 1013, 2017, 2089, 2025, 2224, 2023, 5371, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!DOCTYPE html PUBLIC "-//W3C//DTD 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.6"/> <title>Leddar™ SDK: LtChar</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="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 id="projectlogo"><img alt="Logo" src="d-tec_04.ico"/></td> <td style="padding-left: 0.5em;"> <div id="projectname">Leddar™ SDK &#160;<span id="projectnumber">2.8.1.2</span> </div> <div id="projectbrief">Programmer&#39;s interface to Leddar™ sensors</div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.6 --> <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="namespaces.html"><span>Namespaces</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> </ul> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="dir_00a1b8aabf5e206d69f1425f2b45fec7.html">LeddarC</a></li><li class="navelem"><a class="el" href="_leddar_c_8h.html">LeddarC.h</a></li> </ul> </div> </div><!-- top --> <div class="contents"> <table cellspacing="0" cellpadding="0" border="0"> <tr> <td valign="top"> <div class="navtab"> <table> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_af85746be0c3feccba186f2328085f1d1.html#af85746be0c3feccba186f2328085f1d1">LD_ALREADY_STARTED</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_abcdc4ae1541ba150c964f81ea1523ee8.html#abcdc4ae1541ba150c964f81ea1523ee8">LD_END_OF_FILE</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_a67f3156919dbb3409d9005813ab8f60e.html#a67f3156919dbb3409d9005813ab8f60e">LD_ERROR</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_af52cadeef92720706a4292a02306f57a.html#af52cadeef92720706a4292a02306f57a">LD_INVALID_ARGUMENT</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_a4e75085f3516c8e32efb9680dd39db3b.html#a4e75085f3516c8e32efb9680dd39db3b">LD_NO_DATA_TRANSFER</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_a6f2955b08316f82a55c6fc11eaf2a086.html#a6f2955b08316f82a55c6fc11eaf2a086">LD_NO_RECORD</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_ab2dc16614677481cfa6e7057b54bf6d4.html#ab2dc16614677481cfa6e7057b54bf6d4">LD_NOT_CONNECTED</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_a2067bb708c7934b5eff9239191d7f223.html#a2067bb708c7934b5eff9239191d7f223">LD_NOT_ENOUGH_SPACE</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_a015d6492e91a9010162eeb6aabddd5a8.html#a015d6492e91a9010162eeb6aabddd5a8">LD_START_OF_FILE</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_a6344db3ff5413c11cb91b462fc10993d.html#a6344db3ff5413c11cb91b462fc10993d">LD_SUCCESS</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_a825d8070b8c27d0263b11de3c363e07f.html#a825d8070b8c27d0263b11de3c363e07f">LdCallback</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_a6426f009b70aafc5bd37bd6432ed0544.html#a6426f009b70aafc5bd37bd6432ed0544">LdDataLevels</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_a6426f009b70aafc5bd37bd6432ed0544.html#a6426f009b70aafc5bd37bd6432ed0544a651d1e6f0acfd8fb0c855a58f60fe713">LDDL_DETECTIONS</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_a6426f009b70aafc5bd37bd6432ed0544.html#a6426f009b70aafc5bd37bd6432ed0544a3d0eb81377b2430c71a9acf47f868555">LDDL_NONE</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_a6426f009b70aafc5bd37bd6432ed0544.html#a6426f009b70aafc5bd37bd6432ed0544a7e071af9aea2e9fa53d7f541f5278015">LDDL_STATE</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_ace36c269c92407bede98659c4b027e63.html#ace36c269c92407bede98659c4b027e63">LeddarAddCallback</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_a8a577c1215c1c831d53fdd82cdb32bac.html#a8a577c1215c1c831d53fdd82cdb32bac">LeddarBool</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_ad7b9cb965cfad6c418390ce8b3eb3135.html#ad7b9cb965cfad6c418390ce8b3eb3135">LEDDARC_DLL</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_aecacc21120320286e0156fbd355d0500.html#aecacc21120320286e0156fbd355d0500">LeddarConfigureRecording</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_a295cd941492c374ef0668fa5098a7e82.html#a295cd941492c374ef0668fa5098a7e82">LeddarConnect</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_aa5076bc03ffbf1b4a90729ea505237ce.html#aa5076bc03ffbf1b4a90729ea505237ce">LeddarCreate</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_a439ca18af6c20d66ffe9642ec3dea4a6.html#a439ca18af6c20d66ffe9642ec3dea4a6">LeddarDestroy</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_a9504ba227b4aa9ef2fb56dfd7755e9e7.html#a9504ba227b4aa9ef2fb56dfd7755e9e7">LeddarDisconnect</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_ad1fd0fbbc9f7e28f54bb927079e8ceb2.html#ad1fd0fbbc9f7e28f54bb927079e8ceb2">LeddarExecuteCommand</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_a3d88cbf44b158184ec727be92593f65d.html#a3d88cbf44b158184ec727be92593f65d">LeddarGetConfigurationModified</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_ad7c19aa53d0247e55890ed7d1aea8f85.html#ad7c19aa53d0247e55890ed7d1aea8f85">LeddarGetConnected</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_a015c86ebb427cf82e1e195bc35a4bb93.html#a015c86ebb427cf82e1e195bc35a4bb93">LeddarGetCurrentRecordIndex</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_a10afb0ef3918442d954ba953c7130f3a.html#a10afb0ef3918442d954ba953c7130f3a">LeddarGetDetectionCount</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_a3ab279b7b1cb278636d68ce7a2cfc9e4.html#a3ab279b7b1cb278636d68ce7a2cfc9e4">LeddarGetDetections</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_a463af074399552222af4d53581afbd14.html#a463af074399552222af4d53581afbd14">LeddarGetErrorMessage</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_a430a8a03e2cb4775812ba8c1090e9c15.html#a430a8a03e2cb4775812ba8c1090e9c15">LeddarGetKey</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_a6ee84b275e2605d826ddbdfb4daa9fb4.html#a6ee84b275e2605d826ddbdfb4daa9fb4">LeddarGetMaxRecordFileSize</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_acd758a6a10506d91b23c2dc0e31738f2.html#acd758a6a10506d91b23c2dc0e31738f2">LeddarGetProperty</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_a45ea405c76602fa00e993af09da0973f.html#a45ea405c76602fa00e993af09da0973f">LeddarGetRecording</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_a42909be96a4f2c662962e045963d7264.html#a42909be96a4f2c662962e045963d7264">LeddarGetRecordingDirectory</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_ad6b06c76eb7cd1cbd8931c548e83007d.html#ad6b06c76eb7cd1cbd8931c548e83007d">LeddarGetRecordingLevels</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_af56ebd0501de548cd20818abdd292408.html#af56ebd0501de548cd20818abdd292408">LeddarGetRecordLoading</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_ac145b32fa5be3052b49578d43c97edc1.html#ac145b32fa5be3052b49578d43c97edc1">LeddarGetRecordSize</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_a998a34eda5d04f9b40526d8a5245192b.html#a998a34eda5d04f9b40526d8a5245192b">LeddarGetResult</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_afce231d0e348bcc167964256508583b5.html#afce231d0e348bcc167964256508583b5">LeddarGetTextProperty</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_abb5af813f2a0fff38e65e78300d40673.html#abb5af813f2a0fff38e65e78300d40673">LeddarHandle</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_a62e672038f956aa4aef1b5d844ab0c45.html#a62e672038f956aa4aef1b5d844ab0c45">LeddarKeyPressed</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_aeebd5ce1950246b3f237adb42175c472.html#aeebd5ce1950246b3f237adb42175c472">LeddarListSensors</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_aa6913696195e6a72e9eeccf29b329530.html#aa6913696195e6a72e9eeccf29b329530">LeddarLoadRecord</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_a2e7e091c8eb2279700e1d1f344634648.html#a2e7e091c8eb2279700e1d1f344634648">LeddarMoveRecordTo</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_a9df77734e7170367e85e5322ca126d0e.html#a9df77734e7170367e85e5322ca126d0e">LeddarPing</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_ad280bfa3af3820175d402e08771bba97.html#ad280bfa3af3820175d402e08771bba97">LeddarRemoveCallback</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_a7c1dfd3122c60ef3cd1f71ba3cb676c1.html#a7c1dfd3122c60ef3cd1f71ba3cb676c1">LeddarRestoreConfiguration</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_a1ee43e71f4b7a8fc0204b54d428d829a.html#a1ee43e71f4b7a8fc0204b54d428d829a">LeddarSetProperty</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_a5cd1a8ecf8df3c48339121884887df52.html#a5cd1a8ecf8df3c48339121884887df52">LeddarSetTextProperty</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_a02639d22d61e1b4dda4239b59d01842c.html#a02639d22d61e1b4dda4239b59d01842c">LeddarSleep</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_a136423bf24849854b9348fe406dde418.html#a136423bf24849854b9348fe406dde418">LeddarStartDataTransfer</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_ac19709e65910d5b4f6ddc38ec9c88581.html#ac19709e65910d5b4f6ddc38ec9c88581">LeddarStartRecording</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_a8bf1f8eca8efb7a2b2c60c63fa46a694.html#a8bf1f8eca8efb7a2b2c60c63fa46a694">LeddarStepBackward</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_a2c2e1e7d64bdf4960378894befd3b69f.html#a2c2e1e7d64bdf4960378894befd3b69f">LeddarStepForward</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_a07db8673e7e88f403862b5c11de20456.html#a07db8673e7e88f403862b5c11de20456">LeddarStopDataTransfer</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_a32dccb7d2f6b53025f369a7ff29aa4ac.html#a32dccb7d2f6b53025f369a7ff29aa4ac">LeddarStopRecording</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_acda2fabcb7c62bceef227c2f86c1d08f.html#acda2fabcb7c62bceef227c2f86c1d08f">LeddarU16</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_a810529ed1c930b3fd87dc5e7d6582308.html#a810529ed1c930b3fd87dc5e7d6582308">LeddarU32</a></td></tr> <tr><td class="navtab"><a class="qindex" href="_leddar_c_8h_aeb836bf403a1c59d5d8d52c4e2e4f577.html#aeb836bf403a1c59d5d8d52c4e2e4f577">LeddarWriteConfiguration</a></td></tr> <tr><td class="navtab"><a class="qindexHL" href="_leddar_c_8h_af747d7c1e4cf4a603cb68f7feb3a1e40.html#af747d7c1e4cf4a603cb68f7feb3a1e40">LtChar</a></td></tr> </table> </div> </td> <td valign="top" class="mempage"> <a class="anchor" id="af747d7c1e4cf4a603cb68f7feb3a1e40"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define LtChar&#160;&#160;&#160;char</td> </tr> </table> </div><div class="memdoc"> </div> </div> </td> </tr> </table> </div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated on Wed Mar 19 2014 14:50:41 for Leddar™ SDK by &#160;<a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.6 </small></address> </body> </html>
jpmerc/leddartech
Doc/html/_leddar_c_8h_af747d7c1e4cf4a603cb68f7feb3a1e40.html
HTML
gpl-2.0
13,534
[ 30522, 1026, 999, 9986, 13874, 16129, 2270, 1000, 1011, 1013, 1013, 1059, 2509, 2278, 1013, 1013, 26718, 2094, 1060, 11039, 19968, 1015, 1012, 1014, 17459, 1013, 1013, 4372, 1000, 1000, 8299, 1024, 1013, 1013, 30524, 1013, 2639, 1013, 1060,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# MangoETAcquisitionQt Student's project for [MangoEt](http://www.kikiwi.fr/index.php?page=mango) TENUM, société créée en 1993, s’est implantée sur le site de Labège Innopole, cœur du tissu industriel et technologique toulousain. Leur activité se concentre sur le bureau d’études, avec comme atout majeur une solide expertise dans le domaine des radio-transmissions hors normes. La carte MangoET est une carte de télémesure qui permet aux utilisateurs de collecter facilement les résultats d’expériences scientifiques liées à l'étude de l'environnement dans le cadre éducatif. Créé par Tenum en partenariat avec le Centre National d'Étude Spatiale, Mango entre dans des projets scolaires à but scientifique. La conception des capteurs est réalisée par les élèves, aidés de leurs enseignants pour tenter de répondre à des problématiques environnementales. La carte est utilisée dans le cadre de projets tel que l’entreprise Argonautica où elle est mise dans une bouée. L’extension téléphone (ET) peut être utilisée pour recevoir des informations venant de la carte à distance. Les anciennes générations de Mango intégraient un module XBee mais ce dernier a été abandonné du fait de sa courte portée pour être remplacé par le module GSM. Ainsi la carte MangoET permet d'acquérir des tensions issues de capteurs, de les enregistrer, de les géolocaliser et de les transmettre par GSM. Le projet a différents objectifs : - Essai de capteurs. Dans le cadre de projets scientifiques, des écoliers sont amenés à fabriquer des capteurs qu'ils devront pouvoir tester via notre application - Réutilisation du code : Le code source du projet permettra à Tenum de migrer leurs applications vers l'environnement de développement Qt et les langages de programmation C et C++. Leurs applications sont actuellement réalisées en Visual Basic (VB). Le code source devra aussi permettre à des élèves de lycée notamment les étudiants d’IRIS de réaliser leurs propres applications Mango. Dans le cadre de notre projet la carte MangoET a deux types d’utilisations : - Utilisation en direct de la carte sur bureau en guise de carte d’acquisition La carte est connectée à un ordinateur et permet de faire des mesures en temps réel ou de visualiser des mesures qui ont été prises ultérieurement. Il est aussi possible d'envoyer des SMS et d'obtenir la position GPS de la carte. - Utilisation de la carte « sur le terrain » Dans le cadre de notre projet, notre application permettra de configurer la fréquence des mesures ainsi que la fréquence de l'envoi des SMS. Mais elle permettra aussi d’exploiter les résultats des mesures après une expédition (afficher les mesures des voies enregistrées en expédition et afficher le trajet suivi). Les SMS sont envoyés à un Smartphone sous Android contenant une application qui permet à l'utilisateur de localiser la carte
PierrickV/MangoETAcquisitionQt
README.md
Markdown
gpl-3.0
2,955
[ 30522, 1001, 24792, 12928, 2278, 15549, 28032, 3258, 4160, 2102, 3076, 1005, 1055, 2622, 2005, 1031, 24792, 3388, 1033, 1006, 8299, 1024, 1013, 1013, 7479, 1012, 11382, 3211, 9148, 1012, 10424, 1013, 5950, 1012, 25718, 1029, 3931, 1027, 247...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// This file is automatically generated. package adila.db; /* * Asus ZenFone 2 Laser (ZE600KL) * * DEVICE: ASUS_Z00M * MODEL: ASUS_Z00MD */ final class asus5fz00m_asus5fz00md { public static final String DATA = "Asus|ZenFone 2 Laser (ZE600KL)|"; }
karim/adila
database/src/main/java/adila/db/asus5fz00m_asus5fz00md.java
Java
mit
259
[ 30522, 1013, 1013, 2023, 5371, 2003, 8073, 7013, 1012, 7427, 27133, 2721, 1012, 16962, 1025, 1013, 1008, 1008, 2004, 2271, 16729, 14876, 2638, 1016, 9138, 1006, 27838, 16086, 2692, 2243, 2140, 1007, 1008, 1008, 5080, 1024, 2004, 2271, 1035,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/** * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.hadoop.hbase.master.normalizer; import org.apache.hadoop.hbase.classification.InterfaceAudience; import org.apache.hadoop.hbase.client.Admin; /** * Interface for normalization plan. */ @InterfaceAudience.Private public interface NormalizationPlan { enum PlanType { SPLIT, MERGE, NONE } /** * Executes normalization plan on cluster (does actual splitting/merging work). * @param admin instance of Admin */ void execute(Admin admin); /** * @return the type of this plan */ PlanType getType(); }
gustavoanatoly/hbase
hbase-server/src/main/java/org/apache/hadoop/hbase/master/normalizer/NormalizationPlan.java
Java
apache-2.0
1,367
[ 30522, 1013, 1008, 30524, 1996, 15895, 6105, 1010, 2544, 1016, 1012, 1014, 1006, 1996, 1008, 1000, 6105, 1000, 1007, 1025, 2017, 2089, 2025, 2224, 2023, 5371, 3272, 1999, 12646, 1008, 2007, 1996, 6105, 1012, 2017, 2089, 6855, 1037, 6100, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * Copyright 2013 Stanislav Artemkin <artemkin@gmail.com>. * * 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 * OWNER 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. * * Implementation of 32/Z85 specification (http://rfc.zeromq.org/spec:32/Z85) * Source repository: http://github.com/artemkin/z85 */ #pragma once #include <stddef.h> #if defined (__cplusplus) extern "C" { #endif /******************************************************************************* * ZeroMQ Base-85 encoding/decoding functions with custom padding * *******************************************************************************/ /** * @brief Encodes 'inputSize' bytes from 'source' into 'dest'. * If 'inputSize' is not divisible by 4 with no remainder, 'source' is padded. * Destination buffer must be already allocated. Use Z85_encode_with_padding_bound() to * evaluate size of the destination buffer. * * @param source in, input buffer (binary string to be encoded) * @param dest out, destination buffer * @param inputSize in, number of bytes to be encoded * @return number of printable symbols written into 'dest' or 0 if something goes wrong */ size_t Z85_encode_with_padding(const char* source, char* dest, size_t inputSize); /** * @brief Decodes 'inputSize' printable symbols from 'source' into 'dest', * encoded with Z85_encode_with_padding(). * Destination buffer must be already allocated. Use Z85_decode_with_padding_bound() to * evaluate size of the destination buffer. * * @param source in, input buffer (printable string to be decoded) * @param dest out, destination buffer * @param inputSize in, number of symbols to be decoded * @return number of bytes written into 'dest' or 0 if something goes wrong */ size_t Z85_decode_with_padding(const char* source, char* dest, size_t inputSize); /** * @brief Evaluates a size of output buffer needed to encode 'size' bytes * into string of printable symbols using Z85_encode_with_padding(). * * @param size in, number of bytes to be encoded * @return minimal size of output buffer in bytes */ size_t Z85_encode_with_padding_bound(size_t size); /** * @brief Evaluates a size of output buffer needed to decode 'size' symbols * into binary string using Z85_decode_with_padding(). * * @param source in, input buffer (first symbol is read from 'source' to evaluate padding) * @param size in, number of symbols to be decoded * @return minimal size of output buffer in bytes */ size_t Z85_decode_with_padding_bound(const char* source, size_t size); /******************************************************************************* * ZeroMQ Base-85 encoding/decoding functions (specification compliant) * *******************************************************************************/ /** * @brief Encodes 'inputSize' bytes from 'source' into 'dest'. * If 'inputSize' is not divisible by 4 with no remainder, 0 is retured. * Destination buffer must be already allocated. Use Z85_encode_bound() to * evaluate size of the destination buffer. * * @param source in, input buffer (binary string to be encoded) * @param dest out, destination buffer * @param inputSize in, number of bytes to be encoded * @return number of printable symbols written into 'dest' or 0 if something goes wrong */ size_t Z85_encode(const char* source, char* dest, size_t inputSize); /** * @brief Decodes 'inputSize' printable symbols from 'source' into 'dest'. * If 'inputSize' is not divisible by 5 with no remainder, 0 is returned. * Destination buffer must be already allocated. Use Z85_decode_bound() to * evaluate size of the destination buffer. * * @param source in, input buffer (printable string to be decoded) * @param dest out, destination buffer * @param inputSize in, number of symbols to be decoded * @return number of bytes written into 'dest' or 0 if something goes wrong */ size_t Z85_decode(const char* source, char* dest, size_t inputSize); /** * @brief Evaluates a size of output buffer needed to encode 'size' bytes * into string of printable symbols using Z85_encode(). * * @param size in, number of bytes to be encoded * @return minimal size of output buffer in bytes */ size_t Z85_encode_bound(size_t size); /** * @brief Evaluates a size of output buffer needed to decode 'size' symbols * into binary string using Z85_decode(). * * @param size in, number of symbols to be decoded * @return minimal size of output buffer in bytes */ size_t Z85_decode_bound(size_t size); /******************************************************************************* * ZeroMQ Base-85 unsafe encoding/decoding functions (specification compliant) * *******************************************************************************/ /** * @brief Encodes bytes from [source;sourceEnd) range into 'dest'. * It can be used for implementation of your own padding scheme. * Preconditions: * - (sourceEnd - source) % 4 == 0 * - destination buffer must be already allocated * * @param source in, begin of input buffer * @param sourceEnd in, end of input buffer (not included) * @param dest out, output buffer * @return a pointer immediately after last symbol written into the 'dest' */ char* Z85_encode_unsafe(const char* source, const char* sourceEnd, char* dest); /** * @brief Decodes symbols from [source;sourceEnd) range into 'dest'. * It can be used for implementation of your own padding scheme. * Preconditions: * - (sourceEnd - source) % 5 == 0 * - destination buffer must be already allocated * * @param source in, begin of input buffer * @param sourceEnd in, end of input buffer (not included) * @param dest out, output buffer * @return a pointer immediately after last byte written into the 'dest' */ char* Z85_decode_unsafe(const char* source, const char* sourceEnd, char* dest); #if defined (__cplusplus) } #endif
artemkin/z85
src/z85.h
C
bsd-2-clause
7,243
[ 30522, 1013, 1008, 1008, 9385, 2286, 9761, 19834, 16185, 2213, 4939, 1026, 16185, 2213, 4939, 1030, 20917, 4014, 1012, 4012, 1028, 1012, 1008, 1008, 25707, 1998, 2224, 1999, 3120, 1998, 12441, 3596, 1010, 2007, 2030, 2302, 1008, 14080, 1010...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/> # ############################################################################## import base64 import netsvc from osv import osv from osv import fields from tools.translate import _ import tools def _reopen(self, wizard_id, res_model, res_id): return {'type': 'ir.actions.act_window', 'view_mode': 'form', 'view_type': 'form', 'res_id': wizard_id, 'res_model': self._name, 'target': 'new', # save original model in context, otherwise # it will be lost on the action's context switch 'context': {'mail.compose.target.model': res_model, 'mail.compose.target.id': res_id,} } class mail_compose_message(osv.osv_memory): _inherit = 'mail.compose.message' def _get_templates(self, cr, uid, context=None): """ Return Email Template of particular Model. """ if context is None: context = {} record_ids = [] email_template= self.pool.get('email.template') model = False if context.get('message_id'): mail_message = self.pool.get('mail.message') message_data = mail_message.browse(cr, uid, int(context.get('message_id')), context) model = message_data.model elif context.get('mail.compose.target.model') or context.get('active_model'): model = context.get('mail.compose.target.model', context.get('active_model')) if model: record_ids = email_template.search(cr, uid, [('model', '=', model)]) return email_template.name_get(cr, uid, record_ids, context) + [(False,'')] return [] _columns = { 'use_template': fields.boolean('Use Template'), 'template_id': fields.selection(_get_templates, 'Template', size=-1 # means we want an int db column ), } _defaults = { 'template_id' : lambda self, cr, uid, context={} : context.get('mail.compose.template_id', False) } def on_change_template(self, cr, uid, ids, use_template, template_id, email_from=None, email_to=None, context=None): if context is None: context = {} values = {} if template_id: res_id = context.get('mail.compose.target.id') or context.get('active_id') or False if context.get('mail.compose.message.mode') == 'mass_mail': # use the original template values - to be rendered when actually sent # by super.send_mail() values = self.pool.get('email.template').read(cr, uid, template_id, self.fields_get_keys(cr, uid), context) report_xml_pool = self.pool.get('ir.actions.report.xml') template = self.pool.get('email.template').get_email_template(cr, uid, template_id, res_id, context) values['attachments'] = False attachments = {} if template.report_template: report_name = self.render_template(cr, uid, template.report_name, template.model, res_id, context=context) report_service = 'report.' + report_xml_pool.browse(cr, uid, template.report_template.id, context).report_name # Ensure report is rendered using template's language ctx = context.copy() if template.lang: ctx['lang'] = self.render_template(cr, uid, template.lang, template.model, res_id, context) service = netsvc.LocalService(report_service) (result, format) = service.create(cr, uid, [res_id], {'model': template.model}, ctx) result = base64.b64encode(result) if not report_name: report_name = report_service ext = "." + format if not report_name.endswith(ext): report_name += ext attachments[report_name] = result # Add document attachments for attach in template.attachment_ids: # keep the bytes as fetched from the db, base64 encoded attachments[attach.datas_fname] = attach.datas values['attachments'] = attachments if values['attachments']: attachment = values.pop('attachments') attachment_obj = self.pool.get('ir.attachment') att_ids = [] for fname, fcontent in attachment.iteritems(): data_attach = { 'name': fname, 'datas': fcontent, 'datas_fname': fname, 'description': fname, 'res_model' : self._name, 'res_id' : ids[0] if ids else False } att_ids.append(attachment_obj.create(cr, uid, data_attach)) values['attachment_ids'] = att_ids else: # render the mail as one-shot values = self.pool.get('email.template').generate_email(cr, uid, template_id, res_id, context=context) # retrofit generated attachments in the expected field format if values['attachments']: attachment = values.pop('attachments') attachment_obj = self.pool.get('ir.attachment') att_ids = [] for fname, fcontent in attachment.iteritems(): data_attach = { 'name': fname, 'datas': fcontent, 'datas_fname': fname, 'description': fname, 'res_model' : self._name, 'res_id' : ids[0] if ids else False } att_ids.append(attachment_obj.create(cr, uid, data_attach)) values['attachment_ids'] = att_ids else: # restore defaults values = self.default_get(cr, uid, self.fields_get_keys(cr, uid), context) values.update(use_template=use_template, template_id=template_id) return {'value': values} def template_toggle(self, cr, uid, ids, context=None): for record in self.browse(cr, uid, ids, context=context): had_template = record.use_template record.write({'use_template': not(had_template)}) if had_template: # equivalent to choosing an empty template onchange_defaults = self.on_change_template(cr, uid, record.id, not(had_template), False, email_from=record.email_from, email_to=record.email_to, context=context) record.write(onchange_defaults['value']) return _reopen(self, record.id, record.model, record.res_id) def save_as_template(self, cr, uid, ids, context=None): if context is None: context = {} email_template = self.pool.get('email.template') model_pool = self.pool.get('ir.model') for record in self.browse(cr, uid, ids, context=context): model = record.model or context.get('active_model') model_ids = model_pool.search(cr, uid, [('model', '=', model)]) model_id = model_ids and model_ids[0] or False model_name = '' if model_id: model_name = model_pool.browse(cr, uid, model_id, context=context).name template_name = "%s: %s" % (model_name, tools.ustr(record.subject)) values = { 'name': template_name, 'email_from': record.email_from or False, 'subject': record.subject or False, 'body_text': record.body_text or False, 'email_to': record.email_to or False, 'email_cc': record.email_cc or False, 'email_bcc': record.email_bcc or False, 'reply_to': record.reply_to or False, 'model_id': model_id or False, 'attachment_ids': [(6, 0, [att.id for att in record.attachment_ids])] } template_id = email_template.create(cr, uid, values, context=context) record.write({'template_id': template_id, 'use_template': True}) # _reopen same wizard screen with new template preselected return _reopen(self, record.id, model, record.res_id) # override the basic implementation def render_template(self, cr, uid, template, model, res_id, context=None): return self.pool.get('email.template').render_template(cr, uid, template, model, res_id, context=context) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
ksrajkumar/openerp-6.1
openerp/addons/email_template/wizard/mail_compose_message.py
Python
agpl-3.0
10,036
[ 30522, 1001, 1011, 1008, 1011, 16861, 1024, 21183, 2546, 1011, 1022, 1011, 1008, 1011, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 30524, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_29) on Mon Nov 26 17:22:07 MSK 2012 --> <TITLE> Uses of Class org.apache.poi.ss.formula.ptg.PercentPtg (POI API Documentation) </TITLE> <META NAME="date" CONTENT="2012-11-26"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class org.apache.poi.ss.formula.ptg.PercentPtg (POI API Documentation)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../org/apache/poi/ss/formula/ptg/PercentPtg.html" title="class in org.apache.poi.ss.formula.ptg"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../../index.html?org/apache/poi/ss/formula/ptg/\class-usePercentPtg.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="PercentPtg.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <CENTER> <H2> <B>Uses of Class<br>org.apache.poi.ss.formula.ptg.PercentPtg</B></H2> </CENTER> No usage of org.apache.poi.ss.formula.ptg.PercentPtg <P> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../org/apache/poi/ss/formula/ptg/PercentPtg.html" title="class in org.apache.poi.ss.formula.ptg"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../../index.html?org/apache/poi/ss/formula/ptg/\class-usePercentPtg.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="PercentPtg.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> <i>Copyright 2012 The Apache Software Foundation or its licensors, as applicable.</i> </BODY> </HTML>
brenthand/Panda
poi-3.9/docs/apidocs/org/apache/poi/ss/formula/ptg/class-use/PercentPtg.html
HTML
apache-2.0
6,341
[ 30522, 1026, 999, 9986, 13874, 16129, 2270, 1000, 1011, 1013, 1013, 1059, 2509, 2278, 1013, 1013, 26718, 2094, 16129, 1018, 1012, 5890, 17459, 1013, 1013, 4372, 1000, 1000, 8299, 1024, 1013, 1013, 7479, 1012, 1059, 2509, 1012, 8917, 1013, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package tw.me.ychuang.rpc.json; import java.lang.reflect.Type; import org.apache.commons.lang3.ClassUtils; import org.apache.commons.lang3.exception.ExceptionUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import tw.me.ychuang.rpc.Response; import tw.me.ychuang.rpc.Result; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.JsonParseException; import com.google.gson.JsonPrimitive; import com.google.gson.JsonSerializationContext; import com.google.gson.JsonSerializer; /** * Serializes and deserializes a response to / from one JSON string. * * @author Y.C. Huang */ public class ResponseTypeAdapter<Respose> implements JsonSerializer<Response>, JsonDeserializer<Response> { private static final Logger log = LoggerFactory.getLogger(ResponseTypeAdapter.class); /** * Serializes a response to a json element */ @Override public JsonElement serialize(Response response, Type responseClass, JsonSerializationContext context) { JsonObject jsonResponse = new JsonObject(); jsonResponse.addProperty("id", response.getId()); Result result = response.getResult(); if (result == null) { jsonResponse.add("result", JsonNull.INSTANCE); return jsonResponse; } JsonObject jsonResult = new JsonObject(); jsonResponse.add("result", jsonResult); Class resultClass = result.getReturnClass(); JsonPrimitive jsonResultClass = new JsonPrimitive(resultClass.getName()); JsonPrimitive jsonExceptional = new JsonPrimitive(result.isExceptional()); JsonElement jsonReturn = null; if (result.getReturn() != null) { if (false == result.isExceptional()) { jsonReturn = context.serialize(result.getReturn(), resultClass); } else { Throwable cause = (Throwable) result.getReturn(); String stackTraceMessage = ExceptionUtils.getStackTrace(cause); jsonReturn = new JsonPrimitive(stackTraceMessage); } } else { jsonReturn = JsonNull.INSTANCE; } jsonResult.add("return", jsonReturn); jsonResult.add("returnClass", jsonResultClass); jsonResult.add("exceptional", jsonExceptional); return jsonResponse; } /** * Deserialize a json element to a response */ @Override public Response deserialize(JsonElement jsonElement, Type responseClass, JsonDeserializationContext context) throws JsonParseException { JsonObject jsonResponse = (JsonObject) jsonElement; long id = jsonResponse.getAsJsonPrimitive("id").getAsLong(); JsonElement jsonRsElement = jsonResponse.get("result"); Response response = null; if (jsonRsElement.isJsonNull()) { response = new Response(id, null, null); return response; } JsonObject jsonResult = jsonRsElement.getAsJsonObject(); JsonElement jsonReturn = jsonResult.get("return"); JsonPrimitive jsonReturnClass = jsonResult.getAsJsonPrimitive("returnClass"); JsonPrimitive jsonExceptional = jsonResult.getAsJsonPrimitive("exceptional"); Class resultClass = null; try { resultClass = ClassUtils.getClass(jsonReturnClass.getAsString()); } catch (ClassNotFoundException e) { throw new JsonParseException("Cannot find a matching class by name: " + jsonReturnClass.getAsString(), e); } Result result = null; if (jsonReturn.isJsonNull()) { result = new Result(null, resultClass); } else { Object resultObj = null; if (resultClass.isPrimitive()) { resultObj = PrimitiveWrapperUtils.toPrimitive(jsonReturn.getAsString(), resultClass); } else if (ClassUtils.isPrimitiveOrWrapper(resultClass)) { resultObj = PrimitiveWrapperUtils.toPrimitiveWrapper(jsonReturn.getAsString(), resultClass); } else if (Throwable.class.isAssignableFrom(resultClass)) { resultObj = jsonReturn.getAsString(); } else { resultObj = context.deserialize(jsonReturn, resultClass); } result = new Result(resultObj, resultClass); } response = new Response(id, result, resultClass.getName()); return response; } }
allan-huang/remote-procedure-call
src/main/java/tw/me/ychuang/rpc/json/ResponseTypeAdapter.java
Java
apache-2.0
4,051
[ 30522, 7427, 1056, 2860, 1012, 2033, 1012, 1061, 26200, 3070, 1012, 1054, 15042, 1012, 1046, 3385, 1025, 12324, 9262, 1012, 11374, 1012, 8339, 1012, 2828, 1025, 12324, 8917, 1012, 15895, 1012, 7674, 1012, 11374, 2509, 1012, 2465, 21823, 487...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php /** * Copyright (C) 2014-2018 ServMask Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * * ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗ * ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝ * ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝ * ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗ * ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗ * ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ */ ?> <div class="error"> <p> <?php printf( __( 'All in One WP Migration is not able to create <strong>%s</strong> file. ' . 'Try to change permissions of the parent folder or send us an email at ' . '<a href="mailto:support@servmask.com">support@servmask.com</a> for assistance.', AI1WM_PLUGIN_NAME ), AI1WM_STORAGE_INDEX ) ?> </p> </div>
pcutler/stoneopen
wp-content/plugins/all-in-one-wp-migration/lib/view/main/storage-index-notice.php
PHP
gpl-2.0
2,224
[ 30522, 1026, 1029, 25718, 1013, 1008, 1008, 1008, 9385, 1006, 1039, 1007, 2297, 1011, 2760, 14262, 2615, 9335, 2243, 4297, 1012, 1008, 1008, 2023, 2565, 2003, 2489, 4007, 1024, 2017, 2064, 2417, 2923, 3089, 8569, 2618, 2009, 1998, 1013, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/*===========================================================================* * * * ggobjt.c - Object functions * * * * Copyright (c) 1996-2010 iMatix Corporation * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or (at * * your option) any later version. * * * * This program is distributed in the hope that it will be useful, but * * WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * * General Public License for more details. * * * * For information on alternative licensing for OEMs, please contact * * iMatix Corporation. * * * *===========================================================================*/ #include "ggpriv.h" /* Project header file */ /*- Types -------------------------------------------------------------------*/ typedef struct _GSL_OBJECT GSL_OBJECT; struct _GSL_OBJECT { GSL_OBJECT *next, *prev; PLUGIN_INITIALISE *init; /* Called when thread starts */ function shutdown; /* Called when GSL terminates */ }; /*- Global variables --------------------------------------------------------*/ char object_error [LINE_MAX + 1]; /*- Global variables used in this source file only --------------------------*/ static LIST object_list = {&object_list, &object_list}; /*- Function prototypes -----------------------------------------------------*/ /*- Functions ---------------------------------------------------------------*/ void initialise_objects (void) { list_reset (& object_list); } void destroy_objects (void) { GSL_OBJECT *object = object_list. next; while ((void *) object != & object_list) { if (object-> shutdown) (void) (object-> shutdown) (); list_unlink (object); mem_free (object); object = object_list. next; } } int object_register (PLUGIN_INITIALISE *init, function shutdown) { GSL_OBJECT *object; list_create (object, sizeof (GSL_OBJECT)); ASSERT (object); list_relink_before (object, & object_list); object-> init = init; object-> shutdown = shutdown; return 0; } int initialise_classes (THREAD *thread) { GGCODE_TCB *tcb; GSL_OBJECT *object; CLASS_DESCRIPTOR *class; void *item; int rc; VALUE value; tcb = thread-> tcb; symb_class. create ("class", NULL, NULL, & class, & item); tcb-> classes = item; FORLIST (object, object_list) { class = NULL; item = NULL; rc = object-> init (& class, & item, thread); if (rc) return rc; if (class) { init_value (& value); value. type = TYPE_POINTER; value. c = class; value. i = item; symb_class. put_attr (tcb-> classes, class-> name ? class-> name : "$", & value, FALSE); } } return 0; } GSL_FUNCTION * locate_method (CLASS_DESCRIPTOR *class, const char *name) { int min = 0, max, chop = 0, cmp = -1; max = class-> method_cnt; /* Check for case where object has one function to handle all methods */ if ((max == 1) && (! class-> methods [chop]. name)) { chop = 0; cmp = 0; } else { while (max > min) { chop = (max + min) / 2; cmp = strcmp (class-> methods [chop]. name, name); if (cmp < 0) min = chop + 1; else if (cmp > 0) max = chop; else break; } } if ((cmp != 0) && (min < class-> method_cnt)) { chop = (max + min) / 2; cmp = strcmp (class-> methods [chop]. name, name); } if (cmp == 0) return & class-> methods [chop]; else return NULL; } int build_method_arguments (SCRIPT_NODE *fn_node, RESULT_NODE ***arg) { int count, n; SCRIPT_NODE *node; count = 0; node = fn_node; if (node) count++; while (node != NULL) { if ((node-> type == GG_OPERATOR) && (node-> operator == OP_NEXT_ARG)) { count++; node = node-> op1; } else break; } if (count) { *arg = mem_alloc (sizeof (RESULT_NODE *) * count); for (n = 0; n < count; n++) (*arg) [n] = NULL; } return count; } Bool arguments_are_defined (int argc, RESULT_NODE **argv, RESULT_NODE *result) { int i; for (i = 0; i < argc; i++) if (argv [i] && argv [i]-> value. type == TYPE_UNDEFINED) { result-> culprit = argv [i]-> culprit; argv [i]-> culprit = NULL; return FALSE; } return TRUE; } void * get_class_item (THREAD *gsl_thread, const char *class) { VALUE *value; value = symb_class. get_attr (((GGCODE_TCB *) gsl_thread-> tcb)-> classes, class, FALSE); return value ? value-> i : NULL; }
asokoloski/gsl
src/ggobjt.c
C
gpl-3.0
6,345
[ 30522, 1013, 1008, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 102...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
using System; using System.Collections.Generic; using Gtk; using System.Reflection; namespace Moscrif.IDE.Actions { public class OpenSubmitSupport: Gtk.Action { public OpenSubmitSupport(): base("submitsupport", MainClass.Languages.Translate("menu_submit_support"), MainClass.Languages.Translate("menu_submit_support"),null) { } protected override void OnActivated () { base.OnActivated(); string linkUrl = String.Format("http://moscrif.com/support"); if (!String.IsNullOrEmpty(linkUrl)){ System.Diagnostics.Process.Start(linkUrl); } } } }
moscrif/ide
actions/OpenSubmitSupport.cs
C#
bsd-3-clause
577
[ 30522, 2478, 2291, 1025, 2478, 2291, 1012, 6407, 1012, 12391, 1025, 2478, 14181, 2243, 1025, 2478, 2291, 1012, 9185, 1025, 3415, 15327, 9587, 11020, 3089, 2546, 1012, 8909, 2063, 1012, 4506, 1063, 2270, 2465, 7480, 12083, 22930, 6342, 9397,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
--- title: Lelki Izrael date: 06/05/2021 --- Az Úr az ókori Izrael hibái és kudarcai dacára sem állt el tervétől, hogy hűséges népet hoz létre, akik szolgálják Őt. Az Ószövetség előretekintett arra az időre, amikor az Úr megteremti a lelki Izraelt, a hívők hűséges közösségét, zsidókat és pogányokat, akik folytatják a világon az evangélium hirdetésének munkáját. Így jutunk el az őskeresztény egyházhoz. **Olvassuk el Gal 3:26-29 szakaszát!** `1. Milyen ígéretről beszél Pál a 29. versben?` `2. Mi az a döntő elem, amitől az ígéret örököse lesz valaki (Gal 3:26)?` `3. Miért törli el Pál az elválasztó falakat a nemek, a nemzetiségek és a társadalmi szintek között?` `4. Mit jelent a Krisztusban való egység?` `5. Hogyan segít értelmezni Róm 4:16-17 verse azt, amit Pál Gal 3:26-29 szakaszában kifejt?` Ábrahám utódaként Krisztus különleges értelemben a szövetségi ígéretek örököse lett. Keresztség által pedig mi is Krisztus családjához tartozunk, általa jogunk lesz arra, hogy részesedjünk az Ábrahámnak adott ígéretekben. Tehát mindazt megtaláljuk Krisztusban, amit Isten megígért Ábrahámnak, így az ígéretek nekünk is szólnak, nem nemzeti, faji, nemi hovatartozásunk miatt, hanem kegyelemből, amiben hit által részesít bennünket Isten. „Az Ábrahámnak és magvának szóló ajándék nemcsak Kánaán földjét foglalta magában, hanem az egész földet. Így mondja az apostol: »Nem a törvény által adatott az ígéret Ábrahámnak, vagy az ő magvának, hogy e világnak örököse lesz, hanem a hitnek igazsága által« (Róm 4:13). A Biblia világosan tanítja, hogy az Ábrahámnak adott ígéretek Krisztus által fognak teljesedni… [A hívő] »Romolhatatlan, szeplőtlen és hervadhatatlan örökség« (1Pt 1:4) örököse, a bűn átkától megszabadított föld örököse” (Ellen G. White: Pátriárkák és próféták. Budapest, 1993, Advent Kiadó, 134. o.). Az ígéret akkor teljesedik be majd szó szerint, amikor a szentek örökkön-örökké Krisztussal élnek az új földön (Dán 7:27). --- #### Ellen G. White idézetek Az egyház Isten erős vára és menedékvárosa, melyet ebben a hűtlen világban tart fenn. Az egyház minden hitszegése árulás az ellen, aki megvásárolta az emberiséget egyszülött Fiának vére által. A földön, már az ősidőktől kezdve, hűséges lelkek alkották az egyházat. Minden korszakban voltak az Úrnak őszinte őrei, bizonyságtevői. Az intő felhívást voltak hivatva továbbadni, és ha fegyverzetüket le kellett tenniük, mások ismét felvették és folytatták a munkát. Isten szövetséget kötött ezekkel a tanúkkal, és így kapcsolta össze földi egyházát a mennyeivel. Angyalait küldte el a gyülekezete szolgálatára, és a poklok kapui sem arathattak diadalt felette. A Mindenható megőrizte egyházát az évszázadokon át tartó üldözések, harcok és sötétség közepette. Egyetlen felhő sem borulhatott rá az Ő tudta nélkül. Műve ellen nem léphetett fel olyan ellenséges hatalom, amelyről ne lett volna tudomása. Minden úgy teljesedett, ahogyan előzőleg kinyilatkoztatta. Sohasem hagyta el gyülekezetét, hanem mindazt, ami bekövetkezett, előbb jövendölésekbe foglalta. Amit Szentlelke által a próféták egykor kijelentettek, az mind be is teljesedett. Isten véghezviszi minden szándékát. Trónjának alapzata: szent törvénye, és a sötétségnek semmiféle hatalma sem döntheti meg. Az igazságot Isten sugallja és védelmezi; és minden ellenállás felett diadalt arat. – Az apostolok története, 11. o. Isten célja ma is az, mint amikor Izraelt kihozta Egyiptomból. Mikor a világ látja jóságát, kegyességét, igazságát és a gyülekezetben megnyilvánuló szeretetét, akkor az Atya jellemét látja. S mikor a menny törvénye ennyire meglátszik az életükben, a világ is felismeri azok fensőbbségét, akik minden más népnél jobban szeretik, félik és szolgálják az Urat. Isten a népének minden tagját figyeli. Mindegyikükkel van terve. Az a célja, hogy megkülönböztetett nép, szent utasításának gyakorlói legyenek. Isten mai népéhez ugyanúgy szól a szent ihletés szava, mint a régi Izraelhez szólt: „Mert az Úrnak, a te Istenednek szent népe vagy te, téged választott az Úr, a te Istened, hogy saját népe légy néki minden nép közül e föld színén.” (5Móz 7:6) – Bizonyságtételek, VI. köt., 12. o. Isten Izraelének, a menny képviselőinek, akik ma Krisztus igaz egyházát alkotják, erőseknek kell lenniük. A feladatuk, hogy befejezzék azt a munkát, amelyet Isten bízott az emberre, és hirdessék: közeledik a végső ítélet napja. Nekünk is meg kell küzdenünk azokkal a hatásokkal, amelyek Salamon uralkodása idején Izrael bukását okozták. Azok az erők, amelyek minden igazságosság ellenségei, erős sánc mögé rejtőznek. Csak Isten erejével győzhetünk. – Próféták és királyok, 74. o.
imasaru/sabbath-school-lessons
src/hu/2021-02/06/06.md
Markdown
mit
5,084
[ 30522, 1011, 1011, 1011, 2516, 1024, 3393, 13687, 2072, 1045, 2480, 16652, 2140, 3058, 1024, 5757, 1013, 5709, 1013, 25682, 1011, 1011, 1011, 17207, 24471, 17207, 7929, 10050, 1045, 2480, 16652, 2140, 7632, 26068, 9686, 13970, 7662, 3540, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#ifndef __STDDEF #define __STDDEF /* $Id: stddef.h,v 1.1 2002/08/28 23:59:20 drh Exp $ */ #ifndef NULL #define NULL ((void*)0) #endif #define offsetof(ty,mem) ((size_t)((char*)&((ty*)0)->mem - (char*)0)) typedef long ptrdiff_t; #if !defined(_SIZE_T) && !defined(_SIZE_T_) && !defined(_SIZE_T_DEFINED) #define _SIZE_T #define _SIZE_T_ #define _SIZE_T_DEFINED typedef unsigned long size_t; #endif #if !defined(_WCHAR_T) && !defined(_WCHAR_T_) && !defined(_WCHAR_T_DEFINED) #define _WCHAR_T #define _WCHAR_T_ #define _WCHAR_T_DEFINED #if (_WCHAR_T_SIZE + 0) == 1 typedef unsigned char wchar_t; #elif (_WCHAR_T_SIZE + 0) == 2 typedef unsigned short wchar_t; #elif (_WCHAR_T_SIZE + 0) == 4 typedef unsigned int wchar_t; #else typedef unsigned short wchar_t; #endif #endif #endif /* __STDDEF */
dpilawa/bytec
lcc/include/sparc/solaris/stddef.h
C
gpl-2.0
797
[ 30522, 1001, 2065, 13629, 2546, 1035, 1035, 2358, 14141, 12879, 1001, 9375, 1035, 1035, 2358, 14141, 12879, 1013, 1008, 1002, 8909, 1024, 2358, 14141, 12879, 30524, 1001, 2065, 13629, 2546, 19701, 1001, 9375, 19701, 1006, 1006, 11675, 1008, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<? extend'layout.html'?> <link rel="stylesheet" href="/static/library/ztree/css/zTreeStyle/zTreeStyle.css" type="text/css"/> <script type="text/javascript" src="/static/library/ztree/js/jquery.ztree.all-3.5.min.js"></script> <style type="text/css"> .ztree li span.button.add {margin-left:2px; margin-right: -1px; background-position:-144px 0; vertical-align:top; *vertical-align:middle} </style> <div class="tab segment"> <div class="container"> <div class="introduction"> <h2 class="ui dividing header"> <?=_("Modbus")?> - <?=app.appname ?> </h2> </div> </div> </div> <div class="main container"> <div class="ui two column relaxed grid basic segment"> <div class="six wide column"> <p> <div class="ui dropdown selection modes" onChange="changeType(this)"> <input id="modbus_modes" name="modbus_modes" type="hidden" value=-1 /> <div class="text">MODBUS MODES</div> <i class="dropdown icon"></i> <div class="menu"> <div class="item" data-value=0>MODBUS RTU</div> <div class="item" data-value=1>MODBUS TCP</div> <div class="item" data-value=2>MODBUS ASCII</div> <div class ="item" data-value=3>SERIAL SERVER</div> </div> </div> </p> <div class="ui clearing divider"></div> <div class="ui segment"> <div id="treeDemo" class="ztree"></div> </div> <div class="ui clearing divider"></div> <div class="ui button" id="packet" name="packet_sequencing">Packet Sequencing</div> </div> <div class="ten wide column"> <div class="ui basic segment"> <div class="ui button" id="pSave" name="pSave">Save</div> <div class="ui clearing divider"></div> <form class="ui form"> <div id="RTU" name="RTU"> <div class="inline field"> 端口: <div class="ui dropdown selection sPort"> <div class="text">PORT</div> <i class="dropdown icon"></i> <div class="menu"> <? for k, v in pairs(list) do ?> <div class="item" data-value="<?=v?>"><?=v?></div> <? end ?> </div> </div> 波特率: <div class="ui dropdown selection baud"> <input type="hidden" value=9600 /> <div class="text">BAUD</div> <i class="dropdown icon"></i> <div class="menu"> <div class="item" data-value=0>0</div> <div class="item" data-value=50>50</div> <div class="item" data-value=75>75</div> <div class="item" data-value=110>110</div> <div class="item" data-value=134>134</div> <div class="item" data-value=150>150</div> <div class="item" data-value=300>300</div> <div class="item" data-value=600>600</div> <div class="item" data-value=1200>1200</div> <div class="item" data-value=1800>1800</div> <div class="item" data-value=2400>2400</div> <div class="item" data-value=4800>4800</div> <div class="item" data-value=9600>9600</div> <div class="item" data-value=19200>19200</div> <div class="item" data-value=38400>38400</div> <div class="item" data-value=57600>57600</div> <div class="item" data-value=115200>115200</div> <div class="item" data-value=230400>230400</div> <div class="item" data-value=460800>460800</div> <div class="item" data-value=921600>921600</div> </div> </div> 数据位: <div class="ui dropdown selection data_bits"> <input type="hidden" value=8 /> <div class="text">DATA BITS</div> <i class="dropdown icon"></i> <div class="menu"> <div class="item" data-value=6>6</div> <div class="item" data-value=7>7</div> <div class="item" data-value=8>8</div> </div> </div> </div> <div class="inline field"> 校验位: <div class="ui dropdown selection parity"> <input type="hidden" value=0 /> <div class="text">PARITY</div> <i class="dropdown icon"></i> <div class="menu"> <div class="item" data-value=0>NONE</div> <div class="item" data-value=1>ODD PARITY</div> <div class="item" data-value=2>EVEN PARITY</div> </div> </div> 停止位: <div class="ui dropdown selection stop_bits"> <input type="hidden" value=1 /> <div class="text">STOP BITS</div> <i class="dropdown icon"></i> <div class="menu"> <div class="item" data-value=1>1</div> <div class="item" data-value=1.5>1.5</div> <div class="item" data-value=2>2</div> </div> </div> </div> </div> <div id="TCP" name="TCP"> <input placeholder="IP" id="sIp" name="sIp" type="text" /> <input placeholder="PORT" id="port" name="port" type="text" /> </div> <div id="DEVICES" name="DEVICES"> <label>UNIT:</label> <input placeholder="UNIT" id="unit" name="unit" type="text" /> <div class="ui accordion"> <div class="active title"> <i class="dropdown icon"></i> Ratio </div> <div class="content"> <div class="ui blue button" id="Add" onclick="addRow('ratios');"> Add</div> <!-- <div class="ui blue button" id="test" onclick="tableToJson('ratios');"> test</div> --> <table class="ui table segment" id="ratios"> <tbody> <th>Name</th> <th>Value</th> <th>Remove</th> </tbody> </table> <p></p> </div> </div> <p></p> 错误校验: <div class="ui dropdown selection ecm"> <div class="text">Error Checking Methods</div> <i class="dropdown icon"></i> <div class="menu"> <div class="item" data-value=0>NONE</div> <div class="item" data-value=1>CRC</div> <div class="item" data-value=2>LRC</div> </div> </div> </div> </form> <div class="ui clearing divider"></div> <div class="ui button" id="advance" name="advance">Advance</div> </div> </div> </div> </div> <div class="ui basic small modal"> <div class="content"> <div class="left"> <p>Name</p> <div class="ui small input"> <input id="ratio_lname" type="text"></input> </div> </div> <div class="right"> <p>Value</p> <div class="ui small input"> <input id="ratio_value" type="text"></input> </div> </div> </div> <div class="actions"> <div class="two fluid ui buttons"> <div class="ui negative labeled icon button"> <i class="remove icon"></i> Cancel </div> <div class="ui positive right labeled icon button"> Save <i class="checkmark icon"></i> </div> </div> </div> </div> <script type="text/javascript"> var setting = { check: { enable: true, nocheckInherit: false, }, view: { addHoverDom: addHoverDom, removeHoverDom: removeHoverDom, selectedMulti: false }, edit: { enable: true, editNameSelectAll: true, showRemoveBtn: showRemoveBtn, showRenameBtn: showRenameBtn, /* showRemoveBtn: false, showRenameBtn: false */ }, data: { keep: { parent:true, leaf:true }, simpleData: { enable: true, idKey: "id", pIdKey: "pId", rootPId: 0 } }, callback: { beforeClick: beforeClick, onClick: onClick, beforeDrag: beforeDrag, beforeRemove: beforeRemove, beforeRename: beforeRename, onRemove: onRemove } }; function addRow() { $('.ui.modal') .modal('setting', { closable : false, onDeny : function(){ }, onApprove : function() { var lname = $('#ratio_lname').val(); lname = lname.trim(); var value = $("#ratio_value").val(); if (lname.length == 0 || !value) { window.alert("Name/Value cannot be empty"); return false; }; var table = document.getElementById("ratios"); var row = table.insertRow(1); var cell1 = row.insertCell(0); var cell2 = row.insertCell(1); cell1.innerHTML = lname; cell2.innerHTML = value; var cell3 = row.insertCell(2); var element3 = document.createElement("input"); element3.type = "button"; element3.name = "Remove"; element3.value = "Remove"; element3.setAttribute("onclick", "deleteRow(this)"); cell3.appendChild(element3); return true; } }) .modal('show') ; }; function deleteRow(r) { var i=r.parentNode.parentNode.rowIndex; document.getElementById('ratios').deleteRow(i) } function tableToJson(table) { var myRows = []; var $headers = $("th"); var $rows = $("tbody tr").each(function(index) { $cells = $(this).find("td"); myRows[index] = {}; $cells.each(function(cellIndex) { myRows[index][$($headers[cellIndex]).html()] = $(this).html(); }); }); // Let's put this in the object like you want and convert to JSON (Note: jQuery will also do this for you on the Ajax request) //var myObj = {}; //myObj.myrows = myRows; //console.log(JSON.stringify(myRows)); //console.log(JSON.stringify(myObj)); return JSON.stringify(myRows); } function changeType(obj) { var val = $("#modbus_modes").attr("value"); if (val == 0 || val == 2) { $("#RTU").show(); $("#TCP").hide(); } else if (val == 1) { $("#RTU").hide(); $("#TCP").show(); } else if (val == 3) { $("#RTU").hide(); $("#TCP").show(); } else { $("#RTU").hide(); $("#TCP").hide(); } $("#DEVICES").hide(); return val; } $("#DEVICES").hide(); $("#RTU").hide(); $("#TCP").hide(); var json_text = <?=json_text ?>; //$(".ui.modes").dropdown("set value", json_text[0].config.mode); $(".ui.dropdown").dropdown(); var tree_config; //console.log(json_text) if (json_text.length == 0) { tree_config = ""; } else { var tree = new Array(); if (json_text.length == 1) { var treenode = new Object(); treenode.id = json_text[0].tree.id; treenode.pId = json_text[0].tree.pId; treenode.name = json_text[0].tree.name; treenode.checked = json_text[0].tree.checked; treenode.isParent = true; tree[0] = treenode; } else { for (var i = 0; i < json_text.length; i++) { var treenode = new Object(); treenode.id = json_text[i].tree.id; treenode.pId = json_text[i].tree.pId; treenode.name = json_text[i].tree.name; treenode.checked = json_text[i].tree.checked; tree[i] = treenode; } } tree_config = tree } var zNodes = tree_config; var log, className = "dark"; function beforeClick(treeId, treeNode, clickFlag) { className = (className === "dark" ? "":"dark"); showLog("[ "+getTime()+" beforeClick ]&nbsp;&nbsp;" + treeNode.name ); return (treeNode.click != false); } function onClick(event, treeId, treeNode, clickFlag) { var zTree = $.fn.zTree.getZTreeObj("treeDemo"); nodes = zTree.getSelectedNodes(); treeNode = nodes[0]; if (treeNode) { var id = treeNode.id; var pId = treeNode.pId; var name = treeNode.name; } else { alert("Please select one node at first ..."); return; } var mode = json_text[0].config.mode ? json_text[0].config.mode : $(".ui.modes").dropdown("get value"); $(".ui.modes") .data() .moduleDropdown .action .activate(undefined, mode) ; //var val = changeType(); if (id == 1 && pId ==0) { if (mode == "0" || mode == "2") { $("#RTU").show(); $("#TCP").hide(); } else if (mode == "1") { $("#RTU").hide(); $("#TCP").show(); } else if (mode == "3") { $("#RTU").hide(); $("#TCP").show(); } else { $("#RTU").hide(); $("#TCP").hide(); } $("#DEVICES").hide(); } else { $("#RTU").hide(); $("#TCP").hide(); $("#DEVICES").show(); } if (mode == "1" || mode == "3") { for (var i = 0; i < json_text.length; i++) { if (id == json_text[i].tree.id && pId == json_text[i].tree.pId && name == json_text[i].tree.name) { document.getElementById("port").value = json_text[i].config.port; document.getElementById("sIp").value = json_text[i].config.sIp; document.getElementById("unit").value = json_text[i].config.unit; var data = '<tbody> <th>Name</th> <th>Value</th> <th>Remove</th> </tbody>'; $("#ratios").html(data); if (!treeNode.isParent) { for (var j = 1; j < json_text[i].config.ratio.length; j++) { var table = document.getElementById("ratios"); var row = table.insertRow(1); var cell1 = row.insertCell(0); var cell2 = row.insertCell(1); cell1.innerHTML = json_text[i].config.ratio[j].Name; cell2.innerHTML = json_text[i].config.ratio[j].Value; var cell3 = row.insertCell(2); var element3 = document.createElement("input"); element3.type = "button"; element3.name = "Remove"; element3.value = "Remove"; element3.setAttribute("onclick", "deleteRow(this)"); cell3.appendChild(element3); } } $(".ui.ecm") .data() .moduleDropdown .action .activate(undefined, json_text[i].config.ecm) ; break; } else { document.getElementById("port").value = ""; document.getElementById("sIp").value = ""; document.getElementById("unit").value = ""; $(".ui.ecm") .data() .moduleDropdown .action .activate(undefined, 0) ; } } } else if (mode == "0" || mode == "2") { for (var i = 0; i < json_text.length; i++) { if (id == json_text[i].tree.id && pId == json_text[i].tree.pId && name == json_text[i].tree.name) { //$(".ui.sPort").dropdown("set value", json_text[i].config.sPort); $(".ui.sPort") .data() .moduleDropdown .action .activate(undefined, json_text[i].config.sPort) ; $(".ui.baud") .data() .moduleDropdown .action .activate(undefined, json_text[i].config.baud) ; $(".ui.data_bits") .data() .moduleDropdown .action .activate(undefined, json_text[i].config.dbs) ; $(".ui.parity") .data() .moduleDropdown .action .activate(undefined, json_text[i].config.parity) ; $(".ui.stop_bits") .data() .moduleDropdown .action .activate(undefined, json_text[i].config.sbs) ; $(".ui.ecm") .data() .moduleDropdown .action .activate(undefined, json_text[i].config.ecm) ; document.getElementById("unit").value = json_text[i].config.unit; var data = '<tbody> <th>Name</th> <th>Value</th> <th>Remove</th> </tbody>'; $("#ratios").html(data); if (!treeNode.isParent) { for (var j = 1; j < json_text[i].config.ratio.length; j++) { var table = document.getElementById("ratios"); var row = table.insertRow(1); var cell1 = row.insertCell(0); var cell2 = row.insertCell(1); cell1.innerHTML = json_text[i].config.ratio[j].Name; cell2.innerHTML = json_text[i].config.ratio[j].Value; var cell3 = row.insertCell(2); var element3 = document.createElement("input"); element3.type = "button"; element3.name = "Remove"; element3.value = "Remove"; element3.setAttribute("onclick", "deleteRow(this)"); cell3.appendChild(element3); } } break; } else { $(".ui.sPort") .data() .moduleDropdown .action .activate(undefined, "0") ; $(".ui.baud") .data() .moduleDropdown .action .activate(undefined, "9600") ; $(".ui.data_bits") .data() .moduleDropdown .action .activate(undefined, "8") ; $(".ui.parity") .data() .moduleDropdown .action .activate(undefined, "0") ; $(".ui.stop_bits") .data() .moduleDropdown .action .activate(undefined, "1") ; $(".ui.ecm") .data() .moduleDropdown .action .activate(undefined, "0") ; document.getElementById("unit").value = ""; } } } else { alert("Please select modbus transmission method"); } } function beforeDrag(treeId, treeNodes) { return false; } function beforeRemove(treeId, treeNode) { className = (className === "dark" ? "":"dark"); showLog("[ "+getTime()+" beforeRemove ]&nbsp;&nbsp;&nbsp;&nbsp; " + treeNode.name); var isTrue = confirm("Confirm delete node '" + treeNode.name + "' it?"); if (isTrue) { var zTree = $.fn.zTree.getZTreeObj("treeDemo"); nodes = zTree.getSelectedNodes(); treeNode = nodes[0]; var id = treeNode.id; var pId = treeNode.pId; var name = treeNode.name; for (var i = 0; i < json_text.length; i++) { if (id == json_text[i].tree.id && pId == json_text[i].tree.pId && name == json_text[i].tree.name) { //console.log(JSON.stringify(json_text)); $.post("/apps/<?=app.appname?>/remove", {id:id, pId:pId, name:name, json_text:(JSON.stringify(json_text)), filename:"<?=app.appname?>"}, function(data){ }); } } var callbackFlag = $("#callbackTrigger").attr("checked"); zTree.removeNode(treeNode, callbackFlag); location.reload(); } return isTrue; } function onRemove(e, treeId, treeNode) { showLog("[ "+getTime()+" onRemove ]&nbsp;&nbsp;&nbsp;&nbsp; " + treeNode.name); } function beforeRename(treeId, treeNode, newName) { if (newName.length == 0) { alert("Node name can not be empty."); var zTree = $.fn.zTree.getZTreeObj("treeDemo"); setTimeout(function(){zTree.editName(treeNode)}, 10); return false; } return true; } function showLog(str) { if (!log) log = $("#log"); log.append("<li class='"+className+"'>"+str+"</li>"); if(log.children("li").length > 8) { log.get(0).removeChild(log.children("li")[0]); } } function getTime() { var now= new Date(), h=now.getHours(), m=now.getMinutes(), s=now.getSeconds(), ms=now.getMilliseconds(); return (h+":"+m+":"+s+ " " +ms); } var newCount = 1; function addHoverDom(treeId, treeNode) { var sObj = $("#" + treeNode.tId + "_span"); if (treeNode.editNameFlag || $("#addBtn_"+treeNode.tId).length>0) return; var addStr = "<span class='button add' id='addBtn_" + treeNode.tId + "' title='add node' onfocus='this.blur();'></span>"; sObj.after(addStr); var btn = $("#addBtn_"+treeNode.tId); if (btn) btn.bind("click", function(){ //var zTree = $.fn.zTree.getZTreeObj("treeDemo"); //zTree.addNodes(treeNode, {id:(100 + newCount), pId:treeNode.id, name:"new node" + (newCount++)}); var zTree = $.fn.zTree.getZTreeObj("treeDemo"), nodes = zTree.getSelectedNodes(); treeNode = nodes[0]; isParent = treeNode.isParent; var max = 0; if (json_text.length > 1) { max = parseInt(json_text[0].tree.id); for (var i = 0; i < json_text.length; i++) { if (parseInt(json_text[i].tree.id) > max) { max = parseInt(json_text[i].tree.id); } } treeNode = zTree.addNodes(treeNode, {id:(max + newCount ), pId:treeNode.id, name:"new node" + (newCount++), checked:true}); } else { treeNode = zTree.addNodes(treeNode, {id:(treeNode.id * 10 + newCount ), pId:treeNode.id, name:"new node" + (newCount++), checked:true}); } return false; }); }; function showRemoveBtn(treeId, treeNode) { return !treeNode.isParent; } function showRenameBtn(treeId, treeNode) { return !treeNode.isParent; } function removeHoverDom(treeId, treeNode) { $("#addBtn_"+treeNode.tId).unbind().remove(); }; function pSave(){ var zTree = $.fn.zTree.getZTreeObj("treeDemo"); nodes = zTree.getSelectedNodes(); treeNode = nodes[0]; if (treeNode) { var id = treeNode.id; var pId = treeNode.pId; var name = treeNode.name; var checked = treeNode.checked; } else { alert("Please select one node at first..."); return; } var unit = document.getElementById("unit").value; var val = changeType(); if (val == "0" || val == "2") { var sPort = $(".ui.sPort").dropdown("get value"); var baud = $(".ui.baud").dropdown("get value") ? $(".ui.baud").dropdown("get value") : 9600; var dbs = $(".ui.data_bits").dropdown("get value") ? $(".ui.data_bits").dropdown("get value") : 8; var parity = $(".ui.parity").dropdown("get value") ? $(".ui.parity").dropdown("get value") : 0; var sbs = $(".ui.stop_bits").dropdown("get value") ? $(".ui.stop_bits").dropdown("get value") : 1; if (!treeNode.isParent) { var ecm = $(".ui.ecm").dropdown("get value"); var ratio = tableToJson('ratios'); } else { ecm = ""; ratio = ""; } //console.log("sPort=", sPort, "baud=", baud, "dbs=", dbs, "parity=", parity, "sbs=", sbs, "ecm=", ecm); //alert($(".ui.parity").dropdown("get value")); $.post("", {id:id, pId:pId, name:name, checked:checked, mode:val, sPort:sPort, baud:baud, dbs:dbs, parity:parity, sbs:sbs, ecm:ecm, unit:unit, ratio:ratio}, function(data, status){ if (status) { window.location.reload(); } }); } else if (val == "1" || val == "3") { var port = document.getElementById("port").value; var sIp = document.getElementById("sIp").value; if (!treeNode.isParent) { var ecm = $(".ui.ecm").dropdown("get value"); var ratio = tableToJson('ratios'); } else { ecm = ""; ratio = ""; } $.post("", {id:id, pId:pId, name:name, checked:checked, mode:val, port:port, sIp:sIp, unit:unit, ecm:ecm, ratio:ratio}, function(data, status){ if (status) { window.location.reload(); } }); } else { alert("error"); return; } } function advance() { var zTree = $.fn.zTree.getZTreeObj("treeDemo"); nodes = zTree.getSelectedNodes(); treeNode = nodes[0]; if (treeNode && parseInt(treeNode.id) != 1 && parseInt(treeNode.pId) != 0) { var id = treeNode.id; var pId = treeNode.pId; var name = treeNode.name; } else { alert("Please select one child node at first..."); return; } window.location.href="/apps/<?=app.appname?>/" + "tree?name=" + treeNode.name; } function packet_sequencing() { window.location.href="/apps/<?=app.appname?>/packet_sequencing"; } $(document).ready(function(){ $.fn.zTree.init($("#treeDemo"), setting, zNodes); $("#pSave").bind("click", pSave); $("#advance").bind("click", advance); $("#packet").bind("click", packet_sequencing); var treeObj = $.fn.zTree.getZTreeObj("treeDemo"); treeObj.expandAll(true); var nodes=treeObj.getNodes(); nodes[0].nocheck = true; treeObj.updateNode(nodes[0]); }); </script>
kooiot/GoIoT
apps/modbus_andy/web/templates/index.html
HTML
gpl-2.0
21,937
[ 30522, 1026, 1029, 7949, 1005, 9621, 1012, 16129, 1005, 1029, 1028, 1026, 4957, 2128, 2140, 1027, 1000, 6782, 21030, 2102, 1000, 17850, 12879, 1027, 1000, 1013, 10763, 1013, 3075, 1013, 1062, 13334, 1013, 20116, 2015, 1013, 1062, 13334, 217...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class CreateTablePermissionRole extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('permission_role', function ($table) { $table->increments('id')->unsigned(); $table->integer('permission_id')->unsigned(); $table->integer('role_id')->unsigned(); $table->foreign('permission_id')->references('id')->on('permissions'); // assumes a users table $table->foreign('role_id')->references('id')->on('roles'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::drop('permission_role'); } }
teruk/cpm
app/database/migrations/2015_01_04_063318_create_table_permission_role.php
PHP
mit
767
[ 30522, 1026, 1029, 25718, 2224, 5665, 12717, 12556, 1032, 7809, 1032, 8040, 28433, 1032, 2630, 16550, 1025, 2224, 5665, 12717, 12556, 1032, 7809, 1032, 9230, 2015, 1032, 9230, 1025, 2465, 3443, 10880, 4842, 25481, 13153, 2063, 8908, 9230, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#pragma checksum "D:\PortF\WP\BloodType\BloodType\Views\FindView.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "BDAC66D69FA30A905B8C6636DBAC6F55" //------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.34014 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ using Microsoft.Phone.Controls; using System; using System.Windows; using System.Windows.Automation; using System.Windows.Automation.Peers; using System.Windows.Automation.Provider; using System.Windows.Controls; using System.Windows.Controls.Primitives; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Ink; using System.Windows.Input; using System.Windows.Interop; using System.Windows.Markup; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Media.Imaging; using System.Windows.Resources; using System.Windows.Shapes; using System.Windows.Threading; namespace BloodType.Views { public partial class FindView : Microsoft.Phone.Controls.PhoneApplicationPage { internal System.Windows.Media.Animation.Storyboard PlayBubbles; internal System.Windows.Media.Animation.Storyboard PlayTypeRev; internal System.Windows.Media.Animation.Storyboard PlayType; internal System.Windows.Controls.Grid LayoutRoot; internal System.Windows.Controls.Grid ContentPanel; internal System.Windows.Controls.TextBlock motherText; internal System.Windows.Controls.TextBlock fatherText; internal System.Windows.Controls.Slider sliderMother; internal System.Windows.Controls.Slider sliderFather; internal System.Windows.Controls.Grid grid; internal System.Windows.Controls.TextBlock resultText; internal System.Windows.Shapes.Ellipse bolleke; internal System.Windows.Shapes.Ellipse bolleke_Copy; internal System.Windows.Shapes.Ellipse bolleke_Copy1; internal System.Windows.Shapes.Ellipse bolleke_Copy2; internal System.Windows.Shapes.Ellipse bolleke_Copy3; internal System.Windows.Shapes.Ellipse bolleke_Copy4; internal System.Windows.Shapes.Ellipse bolleke_Copy5; internal System.Windows.Shapes.Ellipse bolleke_Copy6; internal System.Windows.Shapes.Ellipse bolleke_Copy7; private bool _contentLoaded; /// <summary> /// InitializeComponent /// </summary> [System.Diagnostics.DebuggerNonUserCodeAttribute()] public void InitializeComponent() { if (_contentLoaded) { return; } _contentLoaded = true; System.Windows.Application.LoadComponent(this, new System.Uri("/BloodType;component/Views/FindView.xaml", System.UriKind.Relative)); this.PlayBubbles = ((System.Windows.Media.Animation.Storyboard)(this.FindName("PlayBubbles"))); this.PlayTypeRev = ((System.Windows.Media.Animation.Storyboard)(this.FindName("PlayTypeRev"))); this.PlayType = ((System.Windows.Media.Animation.Storyboard)(this.FindName("PlayType"))); this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot"))); this.ContentPanel = ((System.Windows.Controls.Grid)(this.FindName("ContentPanel"))); this.motherText = ((System.Windows.Controls.TextBlock)(this.FindName("motherText"))); this.fatherText = ((System.Windows.Controls.TextBlock)(this.FindName("fatherText"))); this.sliderMother = ((System.Windows.Controls.Slider)(this.FindName("sliderMother"))); this.sliderFather = ((System.Windows.Controls.Slider)(this.FindName("sliderFather"))); this.grid = ((System.Windows.Controls.Grid)(this.FindName("grid"))); this.resultText = ((System.Windows.Controls.TextBlock)(this.FindName("resultText"))); this.bolleke = ((System.Windows.Shapes.Ellipse)(this.FindName("bolleke"))); this.bolleke_Copy = ((System.Windows.Shapes.Ellipse)(this.FindName("bolleke_Copy"))); this.bolleke_Copy1 = ((System.Windows.Shapes.Ellipse)(this.FindName("bolleke_Copy1"))); this.bolleke_Copy2 = ((System.Windows.Shapes.Ellipse)(this.FindName("bolleke_Copy2"))); this.bolleke_Copy3 = ((System.Windows.Shapes.Ellipse)(this.FindName("bolleke_Copy3"))); this.bolleke_Copy4 = ((System.Windows.Shapes.Ellipse)(this.FindName("bolleke_Copy4"))); this.bolleke_Copy5 = ((System.Windows.Shapes.Ellipse)(this.FindName("bolleke_Copy5"))); this.bolleke_Copy6 = ((System.Windows.Shapes.Ellipse)(this.FindName("bolleke_Copy6"))); this.bolleke_Copy7 = ((System.Windows.Shapes.Ellipse)(this.FindName("bolleke_Copy7"))); } } }
alexandrecz/BloodType
BloodType/BloodType/obj/Release/Views/FindView.g.cs
C#
mit
5,194
[ 30522, 1001, 10975, 8490, 2863, 14148, 2819, 1000, 1040, 1024, 1032, 3417, 2546, 1032, 1059, 2361, 1032, 2668, 13874, 1032, 2668, 13874, 1032, 5328, 1032, 2424, 8584, 1012, 1060, 3286, 2140, 1000, 1000, 1063, 27433, 5243, 28756, 2692, 1011,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// Read the Docs // http://readthedocs.org/ // Searching as the user types. (function(){ // Save a reference to the global object. var root = this; // Global Search object on which public functions can be added var Search; Search = root.Search = {}; // for instituting a delay between keypresses and searches var timer = null; var delay = 250; var lastQuery = null; var useApi = false; // Check if the browser supports history manipulation so // we can change the URL upon instant searches var replaceStateSupported = (typeof history.replaceState === "function"); // queue of current requests var xhr = []; var $input, $button, $results, $title, $selected_facets = null; function init() { $input = $('#id_site_search_2'); $button = $('#id_search_button'); $results = $("#id_search_result"); $title = $("#id_search_title"); $selected_facets = $("#id_selected_facets"); // minimum requirements for this script to kick in... if(!$input.length || !$results.length) { return false; } else { lastQuery = queryString() bind(); } } Search.init = init; // Setup the bindings for clicking search or keypresses function bind() { // Set a delay so not _every_ keystroke sends a search $input.keyup(function(ev) { // Don't do anything unless the query has changed if(lastQuery == queryString()) { return; } if(timer) { clearTimeout(timer); } timer = setTimeout("Search.run()", delay); }); $button.click(Search.run); } // Abort all existing XHR requests, since a new search is starting function abortCurrentXHR() { var request = xhr.pop(); while(request) { request.abort(); request = xhr.pop(); } } // Replace the search results HTML with `html` (string) function replaceResults(html) { $results.empty(); $results.append(html); $title.html(getTitle()); $results.show(); } // Construct the results HTML // TODO: Use a template! function buildHTML(results) { var html = []; for (var i=0; i<results.length; i++) { html.push([ '<li class="module-item">', '<p class="module-item-title">', 'File: <a href="', results[i].absolute_url, '?highlight=', $("#id_site_search_2").val(), '">', results[i].project.name, " - ", results[i].name, "</a>", "</p>", "<p>", results[i].text, "</p>", "</li>"].join('') ); } return html.join(''); } // Pop the last search off the queue and render the `results` function onResultsReceived(results) { // remove the request from the queue xhr.pop(); lastQuery = queryString() replaceResults(buildHTML(results)); replaceState(); $("#id_remove_facets").attr('href', removeFacetsUrl()); } // Replace the URL with the one corresponding to the current search function replaceState() { if(!replaceStateSupported) { return; } var url = "/search/project/?" + queryString(); var title = getTitle() + ' | Read the Docs'; window.history.replaceState({}, title, url); } // Page title function getTitle() { return "Results for " + $("#id_site_search_2").val(); } // Params used in the search function getSearchData() { var data = { q: getKeywords(), } var selected_facets = $selected_facets.val() || '' if(selected_facets) { data['selected_facets'] = selected_facets; } return data; } // e.g. q=my+search&selected_facets=project_exact:Read%20The%20Docs function queryString() { return jQuery.param(getSearchData()); } // The active query value function getKeywords() { return $input.val() } // Url for the current query with any facet filters removed function removeFacetsUrl() { return '?' + jQuery.param({q: getKeywords()}); } // Perform the ajax request to get the search results from the API function run(ev) { if(ev) { ev.preventDefault(); } abortCurrentXHR(); // Don't do anything if there is no query if(getKeywords() == '') { $results.empty(); $results.hide(); $title.html("No search term entered"); return; } var data = getSearchData(); if(useApi) { apiSearch(data); } else { htmlSearch(data); } } Search.run = run; // TODO: The api search is incomplete. It doesn't take into account // facets nor pagination. It's a partial implemenation. function apiSearch(data) { xhr.push(jQuery.ajax({ type: 'GET', url: "/api/v1/file/search/", data: data, dataType: 'jsonp', success: function(res, text, xhqr) { onResultsReceived(res.objects); } })); } // Alternative search implementation not using the API. function htmlSearch(data) { xhr.push(jQuery.ajax({ type: 'GET', url: "/search/project/", data: data, success: function(res, text, xhqr) { onHtmlReceived(res); } })); } // Alternative implementation not using the API. Receives // the full HTML including title, pagination, facets, etc. function onHtmlReceived(html) { xhr.pop(); // remove the request from the queue lastQuery = queryString() $("#search_module").replaceWith(html); replaceState(); } }).call(this);
johncosta/private-readthedocs.org
media/javascript/instantsearch.js
JavaScript
mit
5,472
[ 30522, 1013, 1013, 3191, 1996, 9986, 2015, 1013, 1013, 8299, 1024, 1013, 1013, 3191, 23816, 10085, 2015, 1012, 8917, 1013, 1013, 1013, 6575, 2004, 1996, 5310, 4127, 1012, 1006, 3853, 1006, 1007, 1063, 1013, 1013, 3828, 1037, 4431, 2000, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package personifiler.cluster; import static org.junit.Assert.*; import org.junit.Test; import personifiler.util.TestUtils; /** * Tests for {@link RandIndex} * * @author Allen Cheng */ public class TestRandIndex { /** * Tests that the rand index of a cluster is between 0.0 and 1.0 */ @Test public void testRandIndex() { ClusterPeople cluster = new ClusterPeople(TestUtils.getSampleFeatureMatrix()); double randIndex = cluster.randIndex(TestUtils.getSampleGroundTruth()); assertTrue(randIndex >= 0.0 && randIndex <= 1.0); } }
allen12/Personifiler
test/personifiler/cluster/TestRandIndex.java
Java
mit
554
[ 30522, 7427, 2711, 10128, 9463, 2099, 1012, 9324, 1025, 12324, 10763, 8917, 1012, 12022, 4183, 1012, 20865, 1012, 1008, 1025, 12324, 8917, 1012, 12022, 4183, 1012, 3231, 1025, 12324, 2711, 10128, 9463, 2099, 1012, 21183, 4014, 1012, 3231, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
--- layout: post.html title: "Fundraising for PyLadies for PyCon 2015" tag: [PyCon] author: Lynn Root author_link: http://twitter.com/roguelynn --- **TL;DR**: [Donate](#ways-to-donate) to PyLadies for PyCon! It's that time again! With [PyCon 2015][0] planning in high gear, PyLadies is revving up to raise funds to help women attend the biggest Python conference of the year. Last year, we raised **$40,000**. We're hoping to do that again to help women attend PyCon. Here's the breakdown: ### Our numbers * In addition to registration, it will take about $500-1000 per woman in North America to attend PyCon 2015 in Montreal * In addition to registration, it will take about $1000-2000 per woman outside of North America to attend PyCon 2015 in Montreal ### Why PyLadies? Our effect on the community _(percentages are not at all accurate, and are roughly estimated based on guessing names-to-gender scripts):_ * PyCon 2011 had less than 10% women attendees (speaker % unknown) * PyLadies started in late 2011 * PyCon 2012 had about 11% women attendees, and about the same in speakers. * This included giving PyLadies and [Women Who Code][8] booths to help promote our messages * At the time of PyCon 2014, PyLadies had over [35 chapters][7], doing stuff like: * hosts events like learning python, learning git/github, * providing space for study groups, * enriching members with speaker series (like Guido van Rossum!), * events to help think up of talks to submit for PyCon (as well as DjangoCon), * hold events for folks to practice their talk, etc * PyLadies work showed: * PyCon 2013 had over 20% women attendees, and about 22% women speakers. * PyCon 2014 had over 30% women attendees, and about a third of the speakers were women. * No overhead - we're all volunteers! ;-) * Lastly, donations tax deductible since PyLadies is under the financial enclave of the Python Software Foundation ### What we're actively doing: * We're using all of the $12k that PyLadies raised at last year's PyCon auction to increase the aid pool - something that we were hoping to actually use towards growing PyLadies locations (but it's okay! $10k for more women friends at PyCon!) * We're bugging companies and individuals do donate (hence this blog post!). ### What you will get in return * Unless you explicitly choose to be anonymous (though the [online donation site][5] or in private discussions), we will profusely thank you via our public channels (Twitter, this blog, and at our PyCon booth) * Provide a detailed write-up and financial introspection of how many women we've helped because of this campaign * Visibility! It shows the PyCon/Python community that your company/you are serious about women in tech - which can directly benefit sponsors with increased hiring pool of female Pythonistas. ### Ways to donate All of the following methods are tax-deductible with funds going to the [Python Software Foundation][1], a 501(c)3 charitable organization. * Through our [donation page][4] (ideal for individuals) * Email me at [lynn@lynnroot.com][2] (ideal for companies or anyone needing a proper invoice, or individualized solutions) * Become a [sponsor][6] for PyCon (this is more indirect and less potent, but overall helpful to PyCon) More information is available on the [PyCon Financial Aid][5] site if you would like to apply for financial aid for PyCon, whether you are a PyLady or PyGent. [0]: http://us.pycon.org/2015 [1]: http://python.org/psf [2]: mailto:lynn@lynnroot.com?subject=PyLadies%20Donation [3]: http://pyladies.com/blog [4]: https://psfmember.org/civicrm/contribute/transact?reset=1&id=6 [5]: https://us.pycon.org/2014/assistance/ [6]: https://us.pycon.org/2014/sponsors/prospectus/ [7]: https://github.com/pyladies/pyladies/tree/master/www/locations [8]: http://www.meetup.com/women-who-code-sf [9]: http://www.marketwired.com/press-release/-1771597.htm
pyladies/pyladies-theme
_posts/2014-11-02-fundraising-for-pycon-2015.md
Markdown
mit
3,931
[ 30522, 1011, 1011, 1011, 9621, 1024, 2695, 1012, 16129, 2516, 1024, 1000, 15524, 2005, 1052, 23943, 18389, 2005, 1052, 2100, 8663, 2325, 1000, 6415, 1024, 1031, 1052, 2100, 8663, 1033, 3166, 1024, 9399, 7117, 3166, 1035, 4957, 1024, 8299, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/** * * Copyright (c) Microsoft and contributors. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * * See the License for the specific language governing permissions and * limitations under the License. * */ // Warning: This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if the // code is regenerated. package com.microsoft.windowsazure.management.websites.models; import com.microsoft.windowsazure.core.OperationResponse; /** * The Create Web Site operation response. */ public class WebSiteCreateResponse extends OperationResponse { private WebSite webSite; /** * Optional. Details of the created web site. * @return The WebSite value. */ public WebSite getWebSite() { return this.webSite; } /** * Optional. Details of the created web site. * @param webSiteValue The WebSite value. */ public void setWebSite(final WebSite webSiteValue) { this.webSite = webSiteValue; } }
flydream2046/azure-sdk-for-java
service-management/azure-svc-mgmt-websites/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteCreateResponse.java
Java
apache-2.0
1,447
[ 30522, 1013, 1008, 1008, 1008, 1008, 9385, 1006, 1039, 1007, 7513, 1998, 16884, 1012, 2035, 2916, 9235, 1012, 1008, 1008, 7000, 2104, 1996, 15895, 6105, 1010, 2544, 1016, 1012, 1014, 1006, 1996, 1000, 6105, 1000, 1007, 1025, 1008, 2017, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (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.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is [Open Source Virtual Machine.]. * * The Initial Developer of the Original Code is * Adobe System Incorporated. * Portions created by the Initial Developer are Copyright (C) 2008 * the Initial Developer. All Rights Reserved. * * Contributor(s): * Adobe AS3 Team * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ #include "avmplus.h" namespace avmplus { using namespace MMgc; QCache::QCache(uint32_t _max, MMgc::GC* _gc) : m_gc(_gc), m_head(NULL), m_count(0), m_max(0) { MathUtils::RandomFastInit(&m_rand); resize(_max); } void QCache::flush() { QCachedItem* gen = first(); while (gen) { QCachedItem* n = next(gen); gen->next = NULL; gen = n; } m_head = NULL; m_count = 0; } void QCache::resize(uint32_t _max) { flush(); // 0 -> unlimited m_max = !_max ? 0xffffffff : _max; } QCachedItem* QCache::add(QCachedItem* gen) { AvmAssert(gen && !next(gen)); QCachedItem* evicted = NULL; // if no space, evict oldest if (m_count >= m_max) { AvmAssert(m_count == m_max); uint32_t which = MathUtils::Random(count(), &m_rand); QCachedItem* evicted_prev = NULL; for (QCachedItem* td = first(); td; td = next(td)) { if (!which--) { evicted = td; break; } evicted_prev = td; } if (evicted_prev) { evicted = evicted_prev->next; AvmAssert(evicted != NULL && evicted != gen); WB(m_gc, evicted_prev, &evicted_prev->next, evicted->next); } else { evicted = m_head; AvmAssert(evicted != NULL && evicted != gen); WB(m_gc, this, &m_head, evicted->next); } --m_count; #ifdef QCACHE_DEBUG validate(); #endif } // add at head WB(m_gc, gen, &gen->next, m_head); WB(m_gc, this, &m_head, gen); ++m_count; #ifdef QCACHE_DEBUG validate(); #endif return evicted; } #ifdef QCACHE_DEBUG void QCache::validate() const { if (!m_head) { AvmAssert(m_count == 0); return; } uint32_t c = 0; QCachedItem* prev = NULL; for (QCachedItem* td = first(); td; td = next(td)) { AvmAssert(prev ? prev->next == td : true); ++c; prev = td; if (c > m_max) { // oops, probably a cycle, busted code AvmAssert(0); } } AvmAssert(c == m_count); } #endif }
greyhavens/thane
tamarin-central/core/QCache.cpp
C++
bsd-2-clause
3,678
[ 30522, 1013, 1008, 1008, 1008, 1008, 1008, 1008, 4088, 6105, 3796, 1008, 1008, 1008, 1008, 1008, 1008, 2544, 1024, 6131, 2140, 1015, 1012, 1015, 1013, 14246, 2140, 1016, 1012, 1014, 1013, 1048, 21600, 2140, 1016, 1012, 1015, 1008, 1008, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'BadgeByCourse.title_en' db.add_column('badges_badgebycourse', 'title_en', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), keep_default=False) # Adding field 'BadgeByCourse.title_es' db.add_column('badges_badgebycourse', 'title_es', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), keep_default=False) # Adding field 'BadgeByCourse.title_it' db.add_column('badges_badgebycourse', 'title_it', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), keep_default=False) # Adding field 'BadgeByCourse.title_pt' db.add_column('badges_badgebycourse', 'title_pt', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), keep_default=False) # Adding field 'BadgeByCourse.title_fr' db.add_column('badges_badgebycourse', 'title_fr', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), keep_default=False) # Adding field 'BadgeByCourse.title_de' db.add_column('badges_badgebycourse', 'title_de', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), keep_default=False) # Adding field 'BadgeByCourse.description_en' db.add_column('badges_badgebycourse', 'description_en', self.gf('django.db.models.fields.TextField')(null=True, blank=True), keep_default=False) # Adding field 'BadgeByCourse.description_es' db.add_column('badges_badgebycourse', 'description_es', self.gf('django.db.models.fields.TextField')(null=True, blank=True), keep_default=False) # Adding field 'BadgeByCourse.description_it' db.add_column('badges_badgebycourse', 'description_it', self.gf('django.db.models.fields.TextField')(null=True, blank=True), keep_default=False) # Adding field 'BadgeByCourse.description_pt' db.add_column('badges_badgebycourse', 'description_pt', self.gf('django.db.models.fields.TextField')(null=True, blank=True), keep_default=False) # Adding field 'BadgeByCourse.description_fr' db.add_column('badges_badgebycourse', 'description_fr', self.gf('django.db.models.fields.TextField')(null=True, blank=True), keep_default=False) # Adding field 'BadgeByCourse.description_de' db.add_column('badges_badgebycourse', 'description_de', self.gf('django.db.models.fields.TextField')(null=True, blank=True), keep_default=False) def backwards(self, orm): # Deleting field 'BadgeByCourse.title_en' db.delete_column('badges_badgebycourse', 'title_en') # Deleting field 'BadgeByCourse.title_es' db.delete_column('badges_badgebycourse', 'title_es') # Deleting field 'BadgeByCourse.title_it' db.delete_column('badges_badgebycourse', 'title_it') # Deleting field 'BadgeByCourse.title_pt' db.delete_column('badges_badgebycourse', 'title_pt') # Deleting field 'BadgeByCourse.title_fr' db.delete_column('badges_badgebycourse', 'title_fr') # Deleting field 'BadgeByCourse.title_de' db.delete_column('badges_badgebycourse', 'title_de') # Deleting field 'BadgeByCourse.description_en' db.delete_column('badges_badgebycourse', 'description_en') # Deleting field 'BadgeByCourse.description_es' db.delete_column('badges_badgebycourse', 'description_es') # Deleting field 'BadgeByCourse.description_it' db.delete_column('badges_badgebycourse', 'description_it') # Deleting field 'BadgeByCourse.description_pt' db.delete_column('badges_badgebycourse', 'description_pt') # Deleting field 'BadgeByCourse.description_fr' db.delete_column('badges_badgebycourse', 'description_fr') # Deleting field 'BadgeByCourse.description_de' db.delete_column('badges_badgebycourse', 'description_de') models = { 'auth.group': { 'Meta': {'object_name': 'Group'}, 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) }, 'auth.permission': { 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) }, 'auth.user': { 'Meta': {'object_name': 'User'}, 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'email': ('django.db.models.fields.EmailField', [], {'max_length': '254', 'blank': 'True'}), 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '254'}) }, 'badges.alignment': { 'Meta': {'object_name': 'Alignment'}, 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), 'url': ('django.db.models.fields.CharField', [], {'max_length': '255'}) }, 'badges.award': { 'Meta': {'ordering': "['-modified', '-awarded']", 'unique_together': "(('user', 'badge'),)", 'object_name': 'Award'}, 'awarded': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), 'badge': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'awards_set'", 'to': "orm['badges.Badge']"}), 'evidence': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), 'expires': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'identity_hash': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), 'identity_hashed': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), 'identity_salt': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), 'identity_type': ('django.db.models.fields.CharField', [], {'default': "'email'", 'max_length': '255', 'blank': 'True'}), 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'user_awards'", 'to': "orm['auth.User']"}), 'uuid': ('django.db.models.fields.CharField', [], {'default': "'4d5a6e5e-c0cb-11e4-a589-08002759738a'", 'max_length': '255', 'db_index': 'True'}) }, 'badges.badge': { 'Meta': {'ordering': "['-modified', '-created']", 'object_name': 'Badge'}, 'alignments': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "u'alignments'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['badges.Alignment']"}), 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), 'criteria': ('django.db.models.fields.URLField', [], {'max_length': '255'}), 'description': ('django.db.models.fields.TextField', [], {}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}), 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50'}), 'tags': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "u'tags'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['badges.Tag']"}), 'title': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}) }, 'badges.badgebycourse': { 'Meta': {'object_name': 'BadgeByCourse'}, 'color': ('django.db.models.fields.TextField', [], {}), 'course': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['courses.Course']"}), 'criteria': ('django.db.models.fields.TextField', [], {}), 'criteria_type': ('django.db.models.fields.IntegerField', [], {}), 'description': ('django.db.models.fields.TextField', [], {'null': 'True'}), 'description_de': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), 'description_en': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), 'description_es': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), 'description_fr': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), 'description_it': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), 'description_pt': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'note': ('django.db.models.fields.IntegerField', [], {}), 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}), 'title_de': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), 'title_en': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), 'title_es': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), 'title_fr': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), 'title_it': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), 'title_pt': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}) }, 'badges.identity': { 'Meta': {'object_name': 'Identity'}, 'hashed': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'identity_hash': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), 'salt': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), 'type': ('django.db.models.fields.CharField', [], {'default': "'email'", 'max_length': '255'}), 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'identity'", 'unique': 'True', 'to': "orm['auth.User']"}) }, 'badges.revocation': { 'Meta': {'object_name': 'Revocation'}, 'award': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'revocations'", 'to': "orm['badges.Award']"}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'reason': ('django.db.models.fields.CharField', [], {'max_length': '255'}) }, 'badges.tag': { 'Meta': {'object_name': 'Tag'}, 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}) }, 'contenttypes.contenttype': { 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) }, 'courses.course': { 'Meta': {'ordering': "['order']", 'object_name': 'Course'}, 'background': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), 'certification_available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'certification_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), 'completion_badge': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'course'", 'null': 'True', 'to': "orm['badges.Badge']"}), 'created_from': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'courses_created_of'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['courses.Course']"}), 'description': ('tinymce.models.HTMLField', [], {}), 'description_de': ('tinymce.models.HTMLField', [], {'null': 'True', 'blank': 'True'}), 'description_en': ('tinymce.models.HTMLField', [], {'null': 'True', 'blank': 'True'}), 'description_es': ('tinymce.models.HTMLField', [], {'null': 'True', 'blank': 'True'}), 'description_fr': ('tinymce.models.HTMLField', [], {'null': 'True', 'blank': 'True'}), 'description_it': ('tinymce.models.HTMLField', [], {'null': 'True', 'blank': 'True'}), 'description_pt': ('tinymce.models.HTMLField', [], {'null': 'True', 'blank': 'True'}), 'ects': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '8'}), 'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), 'enrollment_method': ('django.db.models.fields.CharField', [], {'default': "'free'", 'max_length': '200'}), 'estimated_effort': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}), 'estimated_effort_de': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}), 'estimated_effort_en': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}), 'estimated_effort_es': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}), 'estimated_effort_fr': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}), 'estimated_effort_it': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}), 'estimated_effort_pt': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}), 'external_certification_available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'forum_slug': ('django.db.models.fields.CharField', [], {'max_length': '350', 'null': 'True', 'blank': 'True'}), 'group_max_size': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '50'}), 'has_groups': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'hashtag': ('django.db.models.fields.CharField', [], {'default': "'Hashtag'", 'max_length': '128'}), 'highlight': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'intended_audience': ('tinymce.models.HTMLField', [], {'null': 'True', 'blank': 'True'}), 'is_activity_clonable': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'languages': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['courses.Language']", 'symmetrical': 'False'}), 'learning_goals': ('tinymce.models.HTMLField', [], {'blank': 'True'}), 'learning_goals_de': ('tinymce.models.HTMLField', [], {'null': 'True', 'blank': 'True'}), 'learning_goals_en': ('tinymce.models.HTMLField', [], {'null': 'True', 'blank': 'True'}), 'learning_goals_es': ('tinymce.models.HTMLField', [], {'null': 'True', 'blank': 'True'}), 'learning_goals_fr': ('tinymce.models.HTMLField', [], {'null': 'True', 'blank': 'True'}), 'learning_goals_it': ('tinymce.models.HTMLField', [], {'null': 'True', 'blank': 'True'}), 'learning_goals_pt': ('tinymce.models.HTMLField', [], {'null': 'True', 'blank': 'True'}), 'max_mass_emails_month': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '200'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}), 'name_de': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), 'name_en': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), 'name_es': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), 'name_fr': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), 'name_it': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), 'name_pt': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), 'official_course': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'order': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1', 'db_index': 'True'}), 'owner': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'courses_as_owner'", 'to': "orm['auth.User']"}), 'promotion_media_content_id': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), 'promotion_media_content_type': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}), 'requirements': ('tinymce.models.HTMLField', [], {'blank': 'True'}), 'requirements_de': ('tinymce.models.HTMLField', [], {'null': 'True', 'blank': 'True'}), 'requirements_en': ('tinymce.models.HTMLField', [], {'null': 'True', 'blank': 'True'}), 'requirements_es': ('tinymce.models.HTMLField', [], {'null': 'True', 'blank': 'True'}), 'requirements_fr': ('tinymce.models.HTMLField', [], {'null': 'True', 'blank': 'True'}), 'requirements_it': ('tinymce.models.HTMLField', [], {'null': 'True', 'blank': 'True'}), 'requirements_pt': ('tinymce.models.HTMLField', [], {'null': 'True', 'blank': 'True'}), 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50'}), 'start_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), 'static_page': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['courses.StaticPage']", 'unique': 'True', 'null': 'True', 'blank': 'True'}), 'status': ('django.db.models.fields.CharField', [], {'default': "'d'", 'max_length': '10'}), 'students': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'courses_as_student'", 'blank': 'True', 'through': "orm['courses.CourseStudent']", 'to': "orm['auth.User']"}), 'teachers': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'courses_as_teacher'", 'symmetrical': 'False', 'through': "orm['courses.CourseTeacher']", 'to': "orm['auth.User']"}), 'threshold': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '4', 'decimal_places': '2', 'blank': 'True'}), 'thumbnail': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), 'thumbnail_alt': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}) }, 'courses.coursestudent': { 'Meta': {'object_name': 'CourseStudent'}, 'course': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['courses.Course']"}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'old_course_status': ('django.db.models.fields.CharField', [], {'default': "'f'", 'max_length': '1'}), 'pos_lat': ('django.db.models.fields.FloatField', [], {'default': '0.0'}), 'pos_lon': ('django.db.models.fields.FloatField', [], {'default': '0.0'}), 'progress': ('django.db.models.fields.IntegerField', [], {'default': '0'}), 'rate': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True'}), 'student': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), 'timestamp': ('django.db.models.fields.BigIntegerField', [], {'null': 'True'}) }, 'courses.courseteacher': { 'Meta': {'ordering': "['order']", 'object_name': 'CourseTeacher'}, 'course': ('adminsortable.fields.SortableForeignKey', [], {'to': "orm['courses.Course']"}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'order': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1', 'db_index': 'True'}), 'teacher': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) }, 'courses.language': { 'Meta': {'object_name': 'Language'}, 'abbr': ('django.db.models.fields.CharField', [], {'max_length': '2', 'null': 'True'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}) }, 'courses.staticpage': { 'Meta': {'object_name': 'StaticPage'}, 'body': ('tinymce.models.HTMLField', [], {'null': 'True', 'blank': 'True'}), 'body_de': ('tinymce.models.HTMLField', [], {'null': 'True', 'blank': 'True'}), 'body_en': ('tinymce.models.HTMLField', [], {'null': 'True', 'blank': 'True'}), 'body_es': ('tinymce.models.HTMLField', [], {'null': 'True', 'blank': 'True'}), 'body_fr': ('tinymce.models.HTMLField', [], {'null': 'True', 'blank': 'True'}), 'body_it': ('tinymce.models.HTMLField', [], {'null': 'True', 'blank': 'True'}), 'body_pt': ('tinymce.models.HTMLField', [], {'null': 'True', 'blank': 'True'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'title': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), 'title_de': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), 'title_en': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), 'title_es': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), 'title_fr': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), 'title_it': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), 'title_pt': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}) } } complete_apps = ['badges']
GeographicaGS/moocng
moocng/badges/migrations/0011_badgesbycoursemultilang.py
Python
apache-2.0
26,422
[ 30522, 1001, 1011, 1008, 1011, 16861, 1024, 21183, 2546, 1011, 1022, 1011, 1008, 1011, 12324, 3058, 7292, 2013, 2148, 1012, 16962, 12324, 16962, 2013, 2148, 1012, 1058, 2475, 12324, 8040, 28433, 4328, 29397, 2013, 6520, 23422, 1012, 16962, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* ** Copyright (C) 1998-2007 George Tzanetakis <gtzan@cs.uvic.ca> ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef MARSYAS_STEREOSPECTRUMSOURCES_H #define MARSYAS_STEREOSPECTRUMSOURCES_H #include "MarSystem.h" namespace Marsyas { /** \class StereoSpectrumSources \ingroup Analysis \brief StereoSpectrumSources estimates the number of sources placed into different stereo positions. After computing the Stereo Spectrum we can try to estimate the number of sources playing in different stereo positions. */ class Peaker; class StereoSpectrumSources: public MarSystem { private: realvec orderedPans_; realvec panChanges_; realvec panPeaks_; Peaker* panPeaker_; void myUpdate(MarControlPtr sender); public: StereoSpectrumSources(std::string name); StereoSpectrumSources(const StereoSpectrumSources& a); ~StereoSpectrumSources(); MarSystem* clone() const; void myProcess(realvec& in, realvec& out); }; }//namespace Marsyas #endif
murraymeehan/marsyas
src/marsyas/StereoSpectrumSources.h
C
gpl-2.0
1,667
[ 30522, 1013, 1008, 1008, 1008, 9385, 1006, 1039, 1007, 2687, 1011, 2289, 2577, 1056, 13471, 12928, 14270, 1026, 14181, 13471, 1030, 20116, 1012, 23068, 2594, 1012, 6187, 1028, 1008, 1008, 1008, 1008, 2023, 2565, 2003, 2489, 4007, 1025, 2017...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package ru.otus.l51.tests; /** * Created by tully. */ @SuppressWarnings("unused") public class TestClass { private int a = 0; private String s = ""; public TestClass() { } public TestClass(Integer a) { this.a = a; } public TestClass(Integer a, String s) { this.a = a; this.s = s; } int getA() { return a; } String getS() { return s; } private void setDefault(){ a = 0; s = ""; } }
artem-gabbasov/otus_java_2017_04_L1
L5.1/src/test/java/ru/otus/l51/tests/TestClass.java
Java
mit
502
[ 30522, 7427, 21766, 1012, 27178, 2271, 1012, 1048, 22203, 1012, 5852, 1025, 1013, 1008, 1008, 1008, 2580, 2011, 25724, 1012, 1008, 1013, 1030, 16081, 9028, 5582, 2015, 1006, 1000, 15171, 1000, 1007, 2270, 2465, 3231, 26266, 1063, 2797, 2001...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
intelli = { /** * Name of the current page */ pageName: '', securityTokenKey: '__st', lang: {}, /** * Check if value exists in array * * @param {Array} val value to be checked * @param {String} arr array * * @return {Boolean} */ inArray: function (val, arr) { if (typeof arr === 'object' && arr) { for (var i = 0; i < arr.length; i++) { if (arr[i] == val) { return true; } } } return false; }, cookie: { /** * Returns the value of cookie * * @param {String} name cookie name * * @return {String} */ read: function (name) { var nameEQ = name + '='; var ca = document.cookie.split(';'); for (var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') c = c.substring(1, c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length); } return null; }, /** * Creates new cookie * * @param {String} name cookie name * @param {String} value cookie value * @param {Integer} days number of days to keep cookie value for * @param {String} value path value */ write: function (name, value, days, path) { var expires = ''; if (days) { var date = new Date(); date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); expires = '; expires=' + date.toGMTString(); } path = path || '/'; document.cookie = name + '=' + value + expires + '; path=' + path; }, /** * Clear cookie value * * @param {String} name cookie name */ clear: function (name) { intelli.cookie.write(name, '', -1); } }, urlVal: function (name) { name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]"); var regex = new RegExp('[\\?&]' + name + '=([^&#]*)'); var results = regex.exec(window.location.href); return (null === results) ? null : decodeURIComponent(results[1]); }, notifBox: function (opt) { var msg = opt.msg; var type = opt.type || 'info'; var autohide = opt.autohide || (type == 'notification' || type == 'success' || type == 'error' ? true : false); var pause = opt.pause || 10; var html = ''; if ('notif' == type || type == 'notification') { type = 'success'; } var boxid = 'notification'; if (opt.boxid) { boxid = opt.boxid; } var obj = $('#' + boxid); if ($.isArray(msg)) { html += '<ul class="unstyled">'; for (var i = 0; i < msg.length; i++) { if ('' != msg[i]) { html += '<li>' + msg[i] + '</li>'; } } html += '</ul>'; } else { html += ['<div>', msg, '</div>'].join(''); } obj.attr('class', 'alert alert-' + type).html(html).show(); if (autohide) { obj.delay(pause * 1000).fadeOut('slow'); } $('html, body').animate({scrollTop: obj.offset().top}, 'slow'); return obj; }, notifFloatBox: function (options) { var msg = options.msg, type = options.type || 'info', pause = options.pause || 3000, autohide = options.autohide, html = ''; // building message box html += '<div id="notifFloatBox" class="notifFloatBox notifFloatBox--' + type + '"><a href="#" class="close">&times;</a>'; if ($.isArray(msg)) { html += '<ul>'; for (var i = 0; i < msg.length; i++) { if ('' != msg[i]) { html += '<li>' + msg[i] + '</li>'; } } html += '</ul>'; } else { html += '<ul><li>' + msg + '</li></ul>'; } html += '</div>'; // placing message box if (!$('#notifFloatBox').length > 0) { $(html).appendTo('body').css('display', 'block').addClass('animated bounceInDown'); if (autohide) { setTimeout(function () { $('#notifFloatBox').fadeOut(function () { $(this).remove(); }); }, pause); } $('.close', '#notifFloatBox').on('click', function (e) { e.preventDefault(); $('#notifFloatBox').fadeOut(function () { $(this).remove(); }); }); } }, is_email: function (email) { return (email.search(/^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z]{2,3})+$/) > -1); }, ckeditor: function (name, params) { if (CKEDITOR.instances[name]) { return false; } params = params || {}; params.baseHref = intelli.config.clear_url; CKEDITOR.replace(name, params); }, add_tab: function (name, text) { var $tab = $('<li>').append($('<a>').attr({'data-toggle': 'tab', href: '#' + name}).text(text)); var $content = $('<div>').attr('id', name).addClass('tab-pane'); if ($('.nav-tabs', '.tabbable').children().length == 0) { $tab.addClass('active'); $content.addClass('active'); } $('.nav-tabs', '.tabbable').append($tab); $('.tab-content', '.tabbable').append($content); }, sortable: function (elem, params) { /*! Sortable 1.0.1 - MIT | git://github.com/rubaxa/Sortable.git */ !function (a) { "use strict"; "function" == typeof define && define.amd ? define(a) : "undefined" != typeof module && "undefined" != typeof module.exports ? module.exports = a() : "undefined" != typeof Package ? Sortable = a() : window.Sortable = a() }(function () { "use strict"; function a(a, b) { this.el = a, this.options = b = b || {}; var d = { group: Math.random(), sort: !0, disabled: !1, store: null, handle: null, scroll: !0, scrollSensitivity: 30, scrollSpeed: 10, draggable: /[uo]l/i.test(a.nodeName) ? "li" : ">*", ghostClass: "sortable-ghost", ignore: "a, img", filter: null, animation: 0, setData: function (a, b) { a.setData("Text", b.textContent) }, dropBubble: !1, dragoverBubble: !1 }; for (var e in d)!(e in b) && (b[e] = d[e]); var g = b.group; g && "object" == typeof g || (g = b.group = {name: g}), ["pull", "put"].forEach(function (a) { a in g || (g[a] = !0) }), L.forEach(function (d) { b[d] = c(this, b[d] || M), f(a, d.substr(2).toLowerCase(), b[d]) }, this), a[E] = g.name + " " + (g.put.join ? g.put.join(" ") : ""); for (var h in this)"_" === h.charAt(0) && (this[h] = c(this, this[h])); f(a, "mousedown", this._onTapStart), f(a, "touchstart", this._onTapStart), I && f(a, "selectstart", this._onTapStart), f(a, "dragover", this._onDragOver), f(a, "dragenter", this._onDragOver), P.push(this._onDragOver), b.store && this.sort(b.store.get(this)) } function b(a) { s && s.state !== a && (i(s, "display", a ? "none" : ""), !a && s.state && t.insertBefore(s, q), s.state = a) } function c(a, b) { var c = O.call(arguments, 2); return b.bind ? b.bind.apply(b, [a].concat(c)) : function () { return b.apply(a, c.concat(O.call(arguments))) } } function d(a, b, c) { if (a) { c = c || G, b = b.split("."); var d = b.shift().toUpperCase(), e = new RegExp("\\s(" + b.join("|") + ")\\s", "g"); do if (">*" === d && a.parentNode === c || ("" === d || a.nodeName.toUpperCase() == d) && (!b.length || ((" " + a.className + " ").match(e) || []).length == b.length))return a; while (a !== c && (a = a.parentNode)) } return null } function e(a) { a.dataTransfer.dropEffect = "move", a.preventDefault() } function f(a, b, c) { a.addEventListener(b, c, !1) } function g(a, b, c) { a.removeEventListener(b, c, !1) } function h(a, b, c) { if (a)if (a.classList) a.classList[c ? "add" : "remove"](b); else { var d = (" " + a.className + " ").replace(/\s+/g, " ").replace(" " + b + " ", ""); a.className = d + (c ? " " + b : "") } } function i(a, b, c) { var d = a && a.style; if (d) { if (void 0 === c)return G.defaultView && G.defaultView.getComputedStyle ? c = G.defaultView.getComputedStyle(a, "") : a.currentStyle && (c = a.currentStyle), void 0 === b ? c : c[b]; b in d || (b = "-webkit-" + b), d[b] = c + ("string" == typeof c ? "" : "px") } } function j(a, b, c) { if (a) { var d = a.getElementsByTagName(b), e = 0, f = d.length; if (c)for (; f > e; e++)c(d[e], e); return d } return [] } function k(a) { a.draggable = !1 } function l() { J = !1 } function m(a, b) { var c = a.lastElementChild, d = c.getBoundingClientRect(); return b.clientY - (d.top + d.height) > 5 && c } function n(a) { for (var b = a.tagName + a.className + a.src + a.href + a.textContent, c = b.length, d = 0; c--;)d += b.charCodeAt(c); return d.toString(36) } function o(a) { for (var b = 0; a && (a = a.previousElementSibling) && "TEMPLATE" !== a.nodeName.toUpperCase();)b++; return b } function p(a, b) { var c, d; return function () { void 0 === c && (c = arguments, d = this, setTimeout(function () { 1 === c.length ? a.call(d, c[0]) : a.apply(d, c), c = void 0 }, b)) } } var q, r, s, t, u, v, w, x, y, z, A, B, C, D = {}, E = "Sortable" + (new Date).getTime(), F = window, G = F.document, H = F.parseInt, I = !!G.createElement("div").dragDrop, J = !1, K = function (a, b, c, d, e, f) { var g = G.createEvent("Event"); g.initEvent(b, !0, !0), g.item = c || a, g.from = d || a, g.clone = s, g.oldIndex = e, g.newIndex = f, a.dispatchEvent(g) }, L = "onAdd onUpdate onRemove onStart onEnd onFilter onSort".split(" "), M = function () { }, N = Math.abs, O = [].slice, P = []; return a.prototype = { constructor: a, _dragStarted: function () { h(q, this.options.ghostClass, !0), a.active = this, K(t, "start", q, t, y) }, _onTapStart: function (a) { var b = a.type, c = a.touches && a.touches[0], e = (c || a).target, g = e, h = this.options, i = this.el, l = h.filter; if (!("mousedown" === b && 0 !== a.button || h.disabled)) { if (h.handle && (e = d(e, h.handle, i)), e = d(e, h.draggable, i), y = o(e), "function" == typeof l) { if (l.call(this, a, e, this))return K(g, "filter", e, i, y), void a.preventDefault() } else if (l && (l = l.split(",").some(function (a) { return a = d(g, a.trim(), i), a ? (K(a, "filter", e, i, y), !0) : void 0 })))return void a.preventDefault(); if (e && !q && e.parentNode === i) { "selectstart" === b && e.dragDrop(), B = a, t = this.el, q = e, v = q.nextSibling, A = this.options.group, q.draggable = !0, h.ignore.split(",").forEach(function (a) { j(e, a.trim(), k) }), c && (B = { target: e, clientX: c.clientX, clientY: c.clientY }, this._onDragStart(B, !0), a.preventDefault()), f(G, "mouseup", this._onDrop), f(G, "touchend", this._onDrop), f(G, "touchcancel", this._onDrop), f(q, "dragend", this), f(t, "dragstart", this._onDragStart), f(G, "dragover", this); try { G.selection ? G.selection.empty() : window.getSelection().removeAllRanges() } catch (m) { } } } }, _emulateDragOver: function () { if (C) { i(r, "display", "none"); var a = G.elementFromPoint(C.clientX, C.clientY), b = a, c = this.options.group.name, d = P.length; if (b)do { if ((" " + b[E] + " ").indexOf(c) > -1) { for (; d--;)P[d]({clientX: C.clientX, clientY: C.clientY, target: a, rootEl: b}); break } a = b } while (b = b.parentNode); i(r, "display", "") } }, _onTouchMove: function (a) { if (B) { var b = a.touches[0], c = b.clientX - B.clientX, d = b.clientY - B.clientY, e = "translate3d(" + c + "px," + d + "px,0)"; C = b, i(r, "webkitTransform", e), i(r, "mozTransform", e), i(r, "msTransform", e), i(r, "transform", e), this._onDrag(b), a.preventDefault() } }, _onDragStart: function (a, b) { var c = a.dataTransfer, d = this.options; if (this._offUpEvents(), "clone" == A.pull && (s = q.cloneNode(!0), i(s, "display", "none"), t.insertBefore(s, q)), b) { var e, g = q.getBoundingClientRect(), h = i(q); r = q.cloneNode(!0), i(r, "top", g.top - H(h.marginTop, 10)), i(r, "left", g.left - H(h.marginLeft, 10)), i(r, "width", g.width), i(r, "height", g.height), i(r, "opacity", "0.8"), i(r, "position", "fixed"), i(r, "zIndex", "100000"), t.appendChild(r), e = r.getBoundingClientRect(), i(r, "width", 2 * g.width - e.width), i(r, "height", 2 * g.height - e.height), f(G, "touchmove", this._onTouchMove), f(G, "touchend", this._onDrop), f(G, "touchcancel", this._onDrop), this._loopId = setInterval(this._emulateDragOver, 150) } else c && (c.effectAllowed = "move", d.setData && d.setData.call(this, c, q)), f(G, "drop", this); if (u = d.scroll, u === !0) { u = t; do if (u.offsetWidth < u.scrollWidth || u.offsetHeight < u.scrollHeight)break; while (u = u.parentNode) } setTimeout(this._dragStarted, 0) }, _onDrag: p(function (a) { if (t && this.options.scroll) { var b, c, d = this.options, e = d.scrollSensitivity, f = d.scrollSpeed, g = a.clientX, h = a.clientY, i = window.innerWidth, j = window.innerHeight, k = (e >= i - g) - (e >= g), l = (e >= j - h) - (e >= h); k || l ? b = F : u && (b = u, c = u.getBoundingClientRect(), k = (N(c.right - g) <= e) - (N(c.left - g) <= e), l = (N(c.bottom - h) <= e) - (N(c.top - h) <= e)), (D.vx !== k || D.vy !== l || D.el !== b) && (D.el = b, D.vx = k, D.vy = l, clearInterval(D.pid), b && (D.pid = setInterval(function () { b === F ? F.scrollTo(F.scrollX + k * f, F.scrollY + l * f) : (l && (b.scrollTop += l * f), k && (b.scrollLeft += k * f)) }, 24))) } }, 30), _onDragOver: function (a) { var c, e, f, g = this.el, h = this.options, j = h.group, k = j.put, n = A === j, o = h.sort; if (void 0 !== a.preventDefault && (a.preventDefault(), !h.dragoverBubble && a.stopPropagation()), !J && A && (n ? o || (f = !t.contains(q)) : A.pull && k && (A.name === j.name || k.indexOf && ~k.indexOf(A.name))) && (void 0 === a.rootEl || a.rootEl === this.el)) { if (c = d(a.target, h.draggable, g), e = q.getBoundingClientRect(), f)return b(!0), void(s || v ? t.insertBefore(q, s || v) : o || t.appendChild(q)); if (0 === g.children.length || g.children[0] === r || g === a.target && (c = m(g, a))) { if (c) { if (c.animated)return; u = c.getBoundingClientRect() } b(n), g.appendChild(q), this._animate(e, q), c && this._animate(u, c) } else if (c && !c.animated && c !== q && void 0 !== c.parentNode[E]) { w !== c && (w = c, x = i(c)); var p, u = c.getBoundingClientRect(), y = u.right - u.left, z = u.bottom - u.top, B = /left|right|inline/.test(x.cssFloat + x.display), C = c.offsetWidth > q.offsetWidth, D = c.offsetHeight > q.offsetHeight, F = (B ? (a.clientX - u.left) / y : (a.clientY - u.top) / z) > .5, G = c.nextElementSibling; J = !0, setTimeout(l, 30), b(n), p = B ? c.previousElementSibling === q && !C || F && C : G !== q && !D || F && D, p && !G ? g.appendChild(q) : c.parentNode.insertBefore(q, p ? G : c), this._animate(e, q), this._animate(u, c) } } }, _animate: function (a, b) { var c = this.options.animation; if (c) { var d = b.getBoundingClientRect(); i(b, "transition", "none"), i(b, "transform", "translate3d(" + (a.left - d.left) + "px," + (a.top - d.top) + "px,0)"), b.offsetWidth, i(b, "transition", "all " + c + "ms"), i(b, "transform", "translate3d(0,0,0)"), clearTimeout(b.animated), b.animated = setTimeout(function () { i(b, "transition", ""), b.animated = !1 }, c) } }, _offUpEvents: function () { g(G, "mouseup", this._onDrop), g(G, "touchmove", this._onTouchMove), g(G, "touchend", this._onDrop), g(G, "touchcancel", this._onDrop) }, _onDrop: function (b) { var c = this.el, d = this.options; clearInterval(this._loopId), clearInterval(D.pid), g(G, "drop", this), g(G, "dragover", this), g(c, "dragstart", this._onDragStart), this._offUpEvents(), b && (b.preventDefault(), !d.dropBubble && b.stopPropagation(), r && r.parentNode.removeChild(r), q && (g(q, "dragend", this), k(q), h(q, this.options.ghostClass, !1), t !== q.parentNode ? (z = o(q), K(q.parentNode, "sort", q, t, y, z), K(t, "sort", q, t, y, z), K(q, "add", q, t, y, z), K(t, "remove", q, t, y, z)) : (s && s.parentNode.removeChild(s), q.nextSibling !== v && (z = o(q), K(t, "update", q, t, y, z), K(t, "sort", q, t, y, z))), a.active && K(t, "end", q, t, y, z)), t = q = r = v = s = B = C = w = x = A = a.active = null, this.save()) }, handleEvent: function (a) { var b = a.type; "dragover" === b ? (this._onDrag(a), e(a)) : ("drop" === b || "dragend" === b) && this._onDrop(a) }, toArray: function () { for (var a, b = [], c = this.el.children, e = 0, f = c.length; f > e; e++)a = c[e], d(a, this.options.draggable, this.el) && b.push(a.getAttribute("data-id") || n(a)); return b }, sort: function (a) { var b = {}, c = this.el; this.toArray().forEach(function (a, e) { var f = c.children[e]; d(f, this.options.draggable, c) && (b[a] = f) }, this), a.forEach(function (a) { b[a] && (c.removeChild(b[a]), c.appendChild(b[a])) }) }, save: function () { var a = this.options.store; a && a.set(this) }, closest: function (a, b) { return d(a, b || this.options.draggable, this.el) }, option: function (a, b) { var c = this.options; return void 0 === b ? c[a] : void(c[a] = b) }, destroy: function () { var a = this.el, b = this.options; L.forEach(function (c) { g(a, c.substr(2).toLowerCase(), b[c]) }), g(a, "mousedown", this._onTapStart), g(a, "touchstart", this._onTapStart), g(a, "selectstart", this._onTapStart), g(a, "dragover", this._onDragOver), g(a, "dragenter", this._onDragOver), Array.prototype.forEach.call(a.querySelectorAll("[draggable]"), function (a) { a.removeAttribute("draggable") }), P.splice(P.indexOf(this._onDragOver), 1), this._onDrop(), this.el = null } }, a.utils = { on: f, off: g, css: i, find: j, bind: c, is: function (a, b) { return !!d(a, b, a) }, throttle: p, closest: d, toggleClass: h, dispatchEvent: K, index: o }, a.version = "1.0.1", a.create = function (b, c) { return new a(b, c) }, a }); var el = document.getElementById(elem); Sortable.create(el, params); }, confirm: function (text, options, callback) { bootbox.confirm(text, function (result) { if (result) { if (typeof options === 'object' && options) { if ('' != options.url) { window.location = options.url; } } } if (typeof callback === 'function') { callback(result); } }); }, includeSecurityToken: function(params) { if ('object' === typeof params) { params[this.securityTokenKey] = intelli.securityToken; } return params; }, post: function(url, data, success, dataType) { return $.post(url, this.includeSecurityToken(data), success, dataType); }, getLocale: function() { if ('function' === typeof moment) { var existLocales = moment.locales(); var locales = [ intelli.languages[intelli.config.lang].locale.replace('_', '-'), intelli.config.lang ]; var map = { zh: 'zh-cn' }; for (var i in locales) { var locale = locales[i]; if (typeof map[locale] !== 'undefined') { locale = map[locale]; } if (-1 !== $.inArray(locale, existLocales)) { return locale; } } } return 'en'; } }; function _t(key, def) { if (intelli.admin && intelli.admin.lang[key]) { return intelli.admin.lang[key]; } return _f(key, def); } function _f(key, def) { if (intelli.lang[key]) { return intelli.lang[key]; } return (def ? (def === true ? key : def) : '{' + key + '}'); }
intelliants/subrion
js/intelli/intelli.js
JavaScript
gpl-3.0
24,710
[ 30522, 13420, 3669, 1027, 1063, 1013, 1008, 1008, 1008, 2171, 1997, 1996, 2783, 3931, 1008, 1013, 3931, 18442, 1024, 1005, 1005, 1010, 3036, 18715, 2368, 14839, 1024, 1005, 1035, 1035, 2358, 1005, 1010, 11374, 1024, 1063, 1065, 1010, 1013, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
obj-$(CONFIG_ICDTCP3_ITD) += itddrv.o obj-$(CONFIG_ICDTCP3_LCD) += hd44780drv.o obj-$(CONFIG_ICDTCP3) += icdcommon.o
insofter/linux
drivers/icdtcp3/Makefile
Makefile
gpl-2.0
120
[ 30522, 27885, 3501, 1011, 1002, 1006, 9530, 8873, 2290, 1035, 24582, 11927, 21906, 2509, 1035, 2009, 2094, 1007, 1009, 1027, 2009, 14141, 2099, 2615, 1012, 1051, 27885, 3501, 1011, 1002, 1006, 9530, 8873, 2290, 1035, 24582, 11927, 21906, 25...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
-- phpMyAdmin SQL Dump -- version 4.0.8 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Dec 17, 2013 at 03:37 PM -- Server version: 5.5.32-cll-lve -- PHP Version: 5.3.17 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -- -- Database: `openlaun_openlaunch` -- -- -------------------------------------------------------- -- -- Table structure for table `BlogCategory` -- CREATE TABLE IF NOT EXISTS `BlogCategory` ( `id` int(11) NOT NULL AUTO_INCREMENT, `cs_created` int(24) NOT NULL, `cs_modified` int(24) NOT NULL, `name` varchar(128) NOT NULL, `page` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ; -- -------------------------------------------------------- -- -- Table structure for table `BlogPost` -- CREATE TABLE IF NOT EXISTS `BlogPost` ( `id` int(11) NOT NULL AUTO_INCREMENT, `cs_created` int(24) NOT NULL, `cs_modified` int(24) NOT NULL, `name` varchar(128) NOT NULL, `content` text NOT NULL, `user` int(11) NOT NULL, `category` int(11) NOT NULL, `published` int(1) NOT NULL, `page` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=8 ; -- -------------------------------------------------------- -- -- Table structure for table `Comment` -- CREATE TABLE IF NOT EXISTS `Comment` ( `id` int(11) NOT NULL AUTO_INCREMENT, `cs_created` int(24) NOT NULL, `cs_modified` int(24) NOT NULL, `modeltype` varchar(128) NOT NULL, `model` int(32) NOT NULL, `user` int(11) NOT NULL, `content` varchar(40000) NOT NULL, `hidden` int(1) NOT NULL, `locked` int(1) NOT NULL, `element` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=21 ; -- -------------------------------------------------------- -- -- Table structure for table `Communication` -- CREATE TABLE IF NOT EXISTS `Communication` ( `id` int(11) NOT NULL AUTO_INCREMENT, `cs_created` int(24) NOT NULL, `cs_modified` int(24) NOT NULL, `name` varchar(128) NOT NULL, `email` varchar(128) NOT NULL, `phone` varchar(128) NOT NULL, `content` text NOT NULL, `user` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ; -- -------------------------------------------------------- -- -- Table structure for table `ContactForm` -- CREATE TABLE IF NOT EXISTS `ContactForm` ( `id` int(11) NOT NULL AUTO_INCREMENT, `cs_created` int(24) NOT NULL, `cs_modified` int(24) NOT NULL, `page` int(11) NOT NULL, `askname` int(1) NOT NULL, `askemail` int(1) NOT NULL, `askphone` int(1) NOT NULL, `askaddress` int(1) NOT NULL, `askcomment` int(1) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ; -- -------------------------------------------------------- -- -- Table structure for table `FeatureGalleryCategory` -- CREATE TABLE IF NOT EXISTS `FeatureGalleryCategory` ( `id` int(11) NOT NULL AUTO_INCREMENT, `cs_created` int(24) NOT NULL, `cs_modified` int(24) NOT NULL, `name` varchar(128) NOT NULL, `order` int(11) NOT NULL, `page` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ; -- -------------------------------------------------------- -- -- Table structure for table `FeatureGalleryEntry` -- CREATE TABLE IF NOT EXISTS `FeatureGalleryEntry` ( `id` int(11) NOT NULL AUTO_INCREMENT, `cs_created` int(24) NOT NULL, `cs_modified` int(24) NOT NULL, `name` varchar(128) NOT NULL, `description` text NOT NULL, `image` varchar(128) NOT NULL, `category` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=11 ; -- -------------------------------------------------------- -- -- Table structure for table `Forum` -- CREATE TABLE IF NOT EXISTS `Forum` ( `id` int(11) NOT NULL AUTO_INCREMENT, `cs_created` int(24) NOT NULL, `cs_modified` int(24) NOT NULL, `name` varchar(128) NOT NULL, `description` varchar(5000) NOT NULL, `order` int(11) NOT NULL, `category` int(11) NOT NULL, `canpost` varchar(5000) NOT NULL, `canview` varchar(5000) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ; -- -------------------------------------------------------- -- -- Table structure for table `ForumCategory` -- CREATE TABLE IF NOT EXISTS `ForumCategory` ( `id` int(11) NOT NULL AUTO_INCREMENT, `cs_created` int(24) NOT NULL, `cs_modified` int(24) NOT NULL, `name` varchar(128) NOT NULL, `order` int(11) NOT NULL, `page` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ; -- -------------------------------------------------------- -- -- Table structure for table `ForumTopic` -- CREATE TABLE IF NOT EXISTS `ForumTopic` ( `id` int(11) NOT NULL AUTO_INCREMENT, `cs_created` int(24) NOT NULL, `cs_modified` int(24) NOT NULL, `name` varchar(128) NOT NULL, `closed` int(1) NOT NULL, `pinned` int(1) NOT NULL, `hidden` int(1) NOT NULL, `user` int(11) NOT NULL, `forum` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=16 ; -- -------------------------------------------------------- -- -- Table structure for table `GitHubProject` -- CREATE TABLE IF NOT EXISTS `GitHubProject` ( `id` int(11) NOT NULL AUTO_INCREMENT, `cs_created` int(24) NOT NULL, `cs_modified` int(24) NOT NULL, `name` varchar(128) NOT NULL, `githubuser` varchar(128) NOT NULL, `githubproject` varchar(128) NOT NULL, `production` varchar(64) NOT NULL, `url` varchar(256) NOT NULL, `created` varchar(50) NOT NULL, `pushed` varchar(50) NOT NULL, `forks` int(11) NOT NULL, `branches` int(11) NOT NULL, `issues` int(11) NOT NULL, `watchers` int(11) NOT NULL, `language` varchar(20) NOT NULL, `size` int(11) NOT NULL, `page` int(11) NOT NULL, `content` text NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ; -- -------------------------------------------------------- -- -- Table structure for table `LoginSession` -- CREATE TABLE IF NOT EXISTS `LoginSession` ( `id` int(11) NOT NULL AUTO_INCREMENT, `cs_created` int(24) NOT NULL, `cs_modified` int(24) NOT NULL, `user` int(11) NOT NULL, `cookie` text NOT NULL, `sessionid` varchar(128) NOT NULL, `browser` varchar(128) NOT NULL, `platform` varchar(128) NOT NULL, `ipaddress` varchar(128) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=98 ; -- -------------------------------------------------------- -- -- Table structure for table `Page` -- CREATE TABLE IF NOT EXISTS `Page` ( `id` int(11) NOT NULL AUTO_INCREMENT, `cs_created` int(24) NOT NULL, `cs_modified` int(24) NOT NULL, `name` varchar(128) NOT NULL, `website` int(11) NOT NULL, `parent` int(11) NOT NULL, `menu` int(1) NOT NULL, `home` int(1) NOT NULL, `order` int(32) NOT NULL, `template` varchar(128) NOT NULL, `can` varchar(20000) NOT NULL, `link` varchar(128) NOT NULL, `html` text NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=19 ; -- -------------------------------------------------------- -- -- Table structure for table `Person` -- CREATE TABLE IF NOT EXISTS `Person` ( `id` int(11) NOT NULL AUTO_INCREMENT, `cs_created` int(24) NOT NULL, `cs_modified` int(24) NOT NULL, `prefix` varchar(128) NOT NULL, `first` varchar(128) NOT NULL, `middle` varchar(128) NOT NULL, `last` varchar(128) NOT NULL, `suffix` varchar(128) NOT NULL, `nickname` varchar(128) NOT NULL, `email` varchar(128) NOT NULL, `phone` varchar(128) NOT NULL, `street` varchar(128) NOT NULL, `suite` varchar(128) NOT NULL, `city` varchar(128) NOT NULL, `province` varchar(128) NOT NULL, `zip` varchar(128) NOT NULL, `country` varchar(128) NOT NULL, `website` varchar(128) NOT NULL, `organization` varchar(128) NOT NULL, `facebook` varchar(128) NOT NULL, `twitter` varchar(128) NOT NULL, `openid` varchar(128) NOT NULL, `profile` text NOT NULL, `roles` varchar(20000) NOT NULL, `ipaddress` varchar(128) NOT NULL, `ban` int(1) NOT NULL, `confirmed` int(1) NOT NULL, `confirmkey` varchar(128) NOT NULL, `signature` varchar(128) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=18 ; -- -------------------------------------------------------- -- -- Table structure for table `Role` -- CREATE TABLE IF NOT EXISTS `Role` ( `id` int(11) NOT NULL AUTO_INCREMENT, `cs_created` int(24) NOT NULL, `cs_modified` int(24) NOT NULL, `name` varchar(128) NOT NULL, `permissions` varchar(20000) NOT NULL, `category` varchar(128) NOT NULL, `allmembers` int(1) NOT NULL, `allguests` int(1) NOT NULL, `allemployees` int(1) NOT NULL, `icon` varchar(128) NOT NULL, `importance` int(32) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ; -- -------------------------------------------------------- -- -- Table structure for table `WikiCategory` -- CREATE TABLE IF NOT EXISTS `WikiCategory` ( `id` int(11) NOT NULL AUTO_INCREMENT, `cs_created` int(24) NOT NULL, `cs_modified` int(24) NOT NULL, `name` varchar(128) NOT NULL, `order` int(11) NOT NULL, `page` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ; -- -------------------------------------------------------- -- -- Table structure for table `WikiPage` -- CREATE TABLE IF NOT EXISTS `WikiPage` ( `id` int(11) NOT NULL AUTO_INCREMENT, `cs_created` int(24) NOT NULL, `cs_modified` int(24) NOT NULL, `name` varchar(128) NOT NULL, `order` int(11) NOT NULL, `category` int(11) NOT NULL, `content` text NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=19 ; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
matteskridge/OpenLaunch
structure.sql
SQL
mit
10,319
[ 30522, 1011, 1011, 25718, 8029, 4215, 10020, 29296, 15653, 1011, 1011, 2544, 1018, 1012, 1014, 1012, 1022, 1011, 1011, 8299, 1024, 1013, 1013, 7479, 1012, 25718, 8029, 4215, 10020, 1012, 5658, 1011, 1011, 1011, 1011, 3677, 1024, 2334, 15006...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package cz.augi.gsonscala import java.util.Optional import java.util.concurrent.TimeUnit import com.google.gson.{Gson, GsonBuilder} import org.junit.runner.RunWith import org.scalatest.{FlatSpec, Matchers} import org.scalatest.junit.JUnitRunner import scala.concurrent.duration.Duration class AsMillis extends UnitSpec { val gson = new GsonBuilder() .registerMillisDurationConverters() .registerUnixMillisInstantConverter() .registerBasicConverters() .create() } class AsSeconds extends UnitSpec { val gson = new GsonBuilder() .registerSecondsDurationConverters() .registerUnixSecondsInstantConverter() .registerBasicConverters() .create() } class AsString extends UnitSpec { val gson = new GsonBuilder() .registerStringDurationConverters() .registerStringInstantConverter() .registerBasicConverters() .create() } @RunWith(classOf[JUnitRunner]) abstract class UnitSpec extends FlatSpec with Matchers { def gson: Gson private case class ExampleClass( instant: java.time.Instant, duration: java.time.Duration, scalaDuration: Duration, optional: Optional[String], option: Option[String], seq: Seq[Int]) "Converters" must "serialize and deserialize" in { val input = ExampleClass( java.time.Instant.ofEpochMilli(123456000), java.time.Duration.ofMillis(123000), Duration(456, TimeUnit.SECONDS), Optional.of("this is optional string"), Some("this is option string"), Seq(1, 2, 3)) val json = gson.toJson(input) val deserialized: ExampleClass = gson.fromJson(json, input.getClass) deserialized shouldEqual input } it must "handle missing values" in { val input = ExampleClass( java.time.Instant.ofEpochMilli(123456000), java.time.Duration.ofMillis(123000), Duration(456000, TimeUnit.MILLISECONDS), Optional.empty(), None, Seq.empty) val json = gson.toJson(input) val deserialized: ExampleClass = gson.fromJson(json, input.getClass) deserialized shouldEqual input } implicit class ExampleClassMatcher(actual: ExampleClass) { def shouldEqual(expected: ExampleClass): Unit = { actual.instant shouldBe expected.instant actual.duration shouldBe expected.duration actual.scalaDuration shouldBe expected.scalaDuration actual.optional shouldBe expected.optional actual.option shouldBe expected.option actual.seq shouldEqual expected.seq } } }
augi/gson-scala
src/test/scala/cz/augi/gsonscala/UnitSpec.scala
Scala
mit
2,859
[ 30522, 7427, 1039, 2480, 1012, 15476, 2072, 1012, 28177, 5644, 25015, 12324, 9262, 1012, 21183, 4014, 1012, 11887, 12324, 9262, 1012, 21183, 4014, 1012, 16483, 1012, 2051, 19496, 2102, 12324, 4012, 1012, 8224, 1012, 28177, 2239, 1012, 1063, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
{% extends "layouts/base.html" %} {% from "macros/_form.html" import render_form %} {% block body %} <h2>{{ _('Add') }} {{ _('User') }}</h2> {{ render_form(url_for('user.add_user'), form) }} {% endblock %}
fcl-93/rootio_web
rootio/templates/user/user.html
HTML
agpl-3.0
223
[ 30522, 1063, 1003, 8908, 1000, 9621, 2015, 1013, 2918, 1012, 16129, 1000, 1003, 1065, 1063, 1003, 2013, 1000, 26632, 2015, 1013, 1035, 2433, 1012, 16129, 1000, 12324, 17552, 1035, 2433, 1003, 1065, 1063, 1003, 3796, 2303, 1003, 1065, 1026, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
using UnityEngine; using System; using System.Collections; using System.Collections.Generic; using System.Runtime.InteropServices; using System.IO; using System.Text; public class KinectManager : MonoBehaviour { public enum Smoothing : int { None, Default, Medium, Aggressive } // Public Bool to determine how many players there are. Default of one user. public bool TwoUsers = false; // Public Bool to determine if the sensor is used in near mode. public bool NearMode = false; // Public Bool to determine whether to receive and compute the user map public bool ComputeUserMap = false; // Public Bool to determine whether to receive and compute the color map public bool ComputeColorMap = false; // Public Bool to determine whether to display user map on the GUI public bool DisplayUserMap = false; // Public Bool to determine whether to display color map on the GUI public bool DisplayColorMap = false; // Public Bool to determine whether to display the skeleton lines on user map public bool DisplaySkeletonLines = false; // Public Floats to specify the width and height of the depth and color maps as % of the camera width and height // if percents are zero, they are calculated based on actual Kinect image´s width and height public float MapsPercentWidth = 0f; public float MapsPercentHeight = 0f; // How high off the ground is the sensor (in meters). public float SensorHeight = 1.0f; // Kinect elevation angle (in degrees) public int SensorAngle = 0; // Minimum user distance in order to process skeleton data public float MinUserDistance = 1.0f; // Public Bool to determine whether to detect only the closest user or not public bool DetectClosestUser = true; // Public Bool to determine whether to use only the tracked joints (and ignore the inferred ones) public bool IgnoreInferredJoints = true; // Selection of smoothing parameters public Smoothing smoothing = Smoothing.Default; // Public Bool to determine the use of additional filters public bool UseBoneOrientationsFilter = false; public bool UseClippedLegsFilter = false; public bool UseBoneOrientationsConstraint = true; public bool UseSelfIntersectionConstraint = false; // Lists of GameObjects that will be controlled by which player. public List<GameObject> Player1Avatars; public List<GameObject> Player2Avatars; // Calibration poses for each player, if needed public KinectGestures.Gestures Player1CalibrationPose; public KinectGestures.Gestures Player2CalibrationPose; // List of Gestures to detect for each player public List<KinectGestures.Gestures> Player1Gestures; public List<KinectGestures.Gestures> Player2Gestures; // Minimum time between gesture detections public float MinTimeBetweenGestures = 0f; // List of Gesture Listeners. They must implement KinectGestures.GestureListenerInterface public List<MonoBehaviour> GestureListeners; // GUI Text to show messages. public GameObject CalibrationText; // GUI Texture to display the hand cursor for Player1 public GameObject HandCursor1; // GUI Texture to display the hand cursor for Player1 public GameObject HandCursor2; // Bool to specify whether Left/Right-hand-cursor and the Click-gesture control the mouse cursor and click public bool ControlMouseCursor = false; // Bool to keep track of whether Kinect has been initialized private bool KinectInitialized = false; // Bools to keep track of who is currently calibrated. private bool Player1Calibrated = false; private bool Player2Calibrated = false; private bool AllPlayersCalibrated = false; // Values to track which ID (assigned by the Kinect) is player 1 and player 2. private uint Player1ID; private uint Player2ID; // Lists of AvatarControllers that will let the models get updated. private List<AvatarController> Player1Controllers; private List<AvatarController> Player2Controllers; // User Map vars. private Texture2D usersLblTex; private Color32[] usersMapColors; private ushort[] usersPrevState; private Rect usersMapRect; private int usersMapSize; private Texture2D usersClrTex; //Color[] usersClrColors; private Rect usersClrRect; //short[] usersLabelMap; private short[] usersDepthMap; private float[] usersHistogramMap; // List of all users private List<uint> allUsers; // Image stream handles for the kinect private IntPtr colorStreamHandle; private IntPtr depthStreamHandle; // Color image data, if used private Color32[] colorImage; private byte[] usersColorMap; // Skeleton related structures private KinectWrapper.NuiSkeletonFrame skeletonFrame; private KinectWrapper.NuiTransformSmoothParameters smoothParameters; private int player1Index, player2Index; // Skeleton tracking states, positions and joints' orientations private Vector3 player1Pos, player2Pos; private Matrix4x4 player1Ori, player2Ori; private bool[] player1JointsTracked, player2JointsTracked; private bool[] player1PrevTracked, player2PrevTracked; private Vector3[] player1JointsPos, player2JointsPos; private Matrix4x4[] player1JointsOri, player2JointsOri; private KinectWrapper.NuiSkeletonBoneOrientation[] jointOrientations; // Calibration gesture data for each player private KinectGestures.GestureData player1CalibrationData; private KinectGestures.GestureData player2CalibrationData; // Lists of gesture data, for each player private List<KinectGestures.GestureData> player1Gestures = new List<KinectGestures.GestureData>(); private List<KinectGestures.GestureData> player2Gestures = new List<KinectGestures.GestureData>(); // general gesture tracking time start private float[] gestureTrackingAtTime; // List of Gesture Listeners. They must implement KinectGestures.GestureListenerInterface public List<KinectGestures.GestureListenerInterface> gestureListeners; private Matrix4x4 kinectToWorld, flipMatrix; private static KinectManager instance; // Timer for controlling Filter Lerp blends. private float lastNuiTime; // Filters private TrackingStateFilter[] trackingStateFilter; private BoneOrientationsFilter[] boneOrientationFilter; private ClippedLegsFilter[] clippedLegsFilter; private BoneOrientationsConstraint boneConstraintsFilter; private SelfIntersectionConstraint selfIntersectionConstraint; // returns the single KinectManager instance public static KinectManager Instance { get { return instance; } } // checks if Kinect is initialized and ready to use. If not, there was an error during Kinect-sensor initialization public static bool IsKinectInitialized() { return instance != null ? instance.KinectInitialized : false; } // checks if Kinect is initialized and ready to use. If not, there was an error during Kinect-sensor initialization public bool IsInitialized() { return KinectInitialized; } // this function is used internally by AvatarController public static bool IsCalibrationNeeded() { return false; } // // returns the raw depth/user data,if ComputeUserMap is true // public short[] GetUsersDepthMap() // { // return usersDepthMap; // } // returns the depth data for a specific pixel,if ComputeUserMap is true public short GetDepthForPixel(int x, int y) { int index = y * KinectWrapper.Constants.ImageWidth + x; if(index >= 0 && index < usersDepthMap.Length) return usersDepthMap[index]; else return 0; } // returns the depth map position for a 3d joint position public Vector2 GetDepthMapPosForJointPos(Vector3 posJoint) { Vector3 vDepthPos = KinectWrapper.MapSkeletonPointToDepthPoint(posJoint); Vector2 vMapPos = new Vector2(vDepthPos.x, vDepthPos.y); return vMapPos; } // returns the color map position for a depth 2d position public Vector2 GetColorMapPosForDepthPos(Vector2 posDepth) { int cx, cy; KinectWrapper.NuiImageViewArea pcViewArea = new KinectWrapper.NuiImageViewArea { eDigitalZoom = 0, lCenterX = 0, lCenterY = 0 }; int hr = KinectWrapper.NuiImageGetColorPixelCoordinatesFromDepthPixelAtResolution( KinectWrapper.Constants.ImageResolution, KinectWrapper.Constants.ImageResolution, ref pcViewArea, (int)posDepth.x, (int)posDepth.y, GetDepthForPixel((int)posDepth.x, (int)posDepth.y), out cx, out cy); return new Vector2(cx, cy); } // returns the depth image/users histogram texture,if ComputeUserMap is true public Texture2D GetUsersLblTex() { return usersLblTex; } // returns the color image texture,if ComputeColorMap is true public Texture2D GetUsersClrTex() { return usersClrTex; } // returns true if at least one user is currently detected by the sensor public bool IsUserDetected() { return KinectInitialized && (allUsers.Count > 0); } // returns the UserID of Player1, or 0 if no Player1 is detected public uint GetPlayer1ID() { return Player1ID; } // returns the UserID of Player2, or 0 if no Player2 is detected public uint GetPlayer2ID() { return Player2ID; } // returns true if the User is calibrated and ready to use public bool IsPlayerCalibrated(uint UserId) { if(UserId == Player1ID) return Player1Calibrated; else if(UserId == Player2ID) return Player2Calibrated; return false; } // returns the raw unmodified joint position, as returned by the Kinect sensor public Vector3 GetRawSkeletonJointPos(uint UserId, int joint) { if(UserId == Player1ID) return joint >= 0 && joint < player1JointsPos.Length ? (Vector3)skeletonFrame.SkeletonData[player1Index].SkeletonPositions[joint] : Vector3.zero; else if(UserId == Player2ID) return joint >= 0 && joint < player2JointsPos.Length ? (Vector3)skeletonFrame.SkeletonData[player2Index].SkeletonPositions[joint] : Vector3.zero; return Vector3.zero; } // returns the User position, relative to the Kinect-sensor, in meters public Vector3 GetUserPosition(uint UserId) { if(UserId == Player1ID) return player1Pos; else if(UserId == Player2ID) return player2Pos; return Vector3.zero; } // returns the User rotation, relative to the Kinect-sensor public Quaternion GetUserOrientation(uint UserId, bool flip) { if(UserId == Player1ID && player1JointsTracked[(int)KinectWrapper.NuiSkeletonPositionIndex.HipCenter]) return ConvertMatrixToQuat(player1Ori, (int)KinectWrapper.NuiSkeletonPositionIndex.HipCenter, flip); else if(UserId == Player2ID && player2JointsTracked[(int)KinectWrapper.NuiSkeletonPositionIndex.HipCenter]) return ConvertMatrixToQuat(player2Ori, (int)KinectWrapper.NuiSkeletonPositionIndex.HipCenter, flip); return Quaternion.identity; } // returns true if the given joint of the specified user is being tracked public bool IsJointTracked(uint UserId, int joint) { if(UserId == Player1ID) return joint >= 0 && joint < player1JointsTracked.Length ? player1JointsTracked[joint] : false; else if(UserId == Player2ID) return joint >= 0 && joint < player2JointsTracked.Length ? player2JointsTracked[joint] : false; return false; } // returns the joint position of the specified user, relative to the Kinect-sensor, in meters public Vector3 GetJointPosition(uint UserId, int joint) { if(UserId == Player1ID) return joint >= 0 && joint < player1JointsPos.Length ? player1JointsPos[joint] : Vector3.zero; else if(UserId == Player2ID) return joint >= 0 && joint < player2JointsPos.Length ? player2JointsPos[joint] : Vector3.zero; return Vector3.zero; } // returns the local joint position of the specified user, relative to the parent joint, in meters public Vector3 GetJointLocalPosition(uint UserId, int joint) { int parent = KinectWrapper.GetSkeletonJointParent(joint); if(UserId == Player1ID) return joint >= 0 && joint < player1JointsPos.Length ? (player1JointsPos[joint] - player1JointsPos[parent]) : Vector3.zero; else if(UserId == Player2ID) return joint >= 0 && joint < player2JointsPos.Length ? (player2JointsPos[joint] - player2JointsPos[parent]) : Vector3.zero; return Vector3.zero; } // returns the joint rotation of the specified user, relative to the Kinect-sensor public Quaternion GetJointOrientation(uint UserId, int joint, bool flip) { if(UserId == Player1ID) { if(joint >= 0 && joint < player1JointsOri.Length && player1JointsTracked[joint]) return ConvertMatrixToQuat(player1JointsOri[joint], joint, flip); } else if(UserId == Player2ID) { if(joint >= 0 && joint < player2JointsOri.Length && player2JointsTracked[joint]) return ConvertMatrixToQuat(player2JointsOri[joint], joint, flip); } return Quaternion.identity; } // returns the joint rotation of the specified user, relative to the parent joint public Quaternion GetJointLocalOrientation(uint UserId, int joint, bool flip) { int parent = KinectWrapper.GetSkeletonJointParent(joint); if(UserId == Player1ID) { if(joint >= 0 && joint < player1JointsOri.Length && player1JointsTracked[joint]) { Matrix4x4 localMat = (player1JointsOri[parent].inverse * player1JointsOri[joint]); return Quaternion.LookRotation(localMat.GetColumn(2), localMat.GetColumn(1)); } } else if(UserId == Player2ID) { if(joint >= 0 && joint < player2JointsOri.Length && player2JointsTracked[joint]) { Matrix4x4 localMat = (player2JointsOri[parent].inverse * player2JointsOri[joint]); return Quaternion.LookRotation(localMat.GetColumn(2), localMat.GetColumn(1)); } } return Quaternion.identity; } // returns the direction between baseJoint and nextJoint, for the specified user public Vector3 GetDirectionBetweenJoints(uint UserId, int baseJoint, int nextJoint, bool flipX, bool flipZ) { Vector3 jointDir = Vector3.zero; if(UserId == Player1ID) { if(baseJoint >= 0 && baseJoint < player1JointsPos.Length && player1JointsTracked[baseJoint] && nextJoint >= 0 && nextJoint < player1JointsPos.Length && player1JointsTracked[nextJoint]) { jointDir = player1JointsPos[nextJoint] - player1JointsPos[baseJoint]; } } else if(UserId == Player2ID) { if(baseJoint >= 0 && baseJoint < player2JointsPos.Length && player2JointsTracked[baseJoint] && nextJoint >= 0 && nextJoint < player2JointsPos.Length && player2JointsTracked[nextJoint]) { jointDir = player2JointsPos[nextJoint] - player2JointsPos[baseJoint]; } } if(jointDir != Vector3.zero) { if(flipX) jointDir.x = -jointDir.x; if(flipZ) jointDir.z = -jointDir.z; } return jointDir; } // adds a gesture to the list of detected gestures for the specified user public void DetectGesture(uint UserId, KinectGestures.Gestures gesture) { int index = GetGestureIndex(UserId, gesture); if(index >= 0) DeleteGesture(UserId, gesture); KinectGestures.GestureData gestureData = new KinectGestures.GestureData(); gestureData.userId = UserId; gestureData.gesture = gesture; gestureData.state = 0; gestureData.joint = 0; gestureData.progress = 0f; gestureData.complete = false; gestureData.cancelled = false; gestureData.checkForGestures = new List<KinectGestures.Gestures>(); switch(gesture) { case KinectGestures.Gestures.ZoomIn: gestureData.checkForGestures.Add(KinectGestures.Gestures.ZoomOut); gestureData.checkForGestures.Add(KinectGestures.Gestures.Wheel); break; case KinectGestures.Gestures.ZoomOut: gestureData.checkForGestures.Add(KinectGestures.Gestures.ZoomIn); gestureData.checkForGestures.Add(KinectGestures.Gestures.Wheel); break; case KinectGestures.Gestures.Wheel: gestureData.checkForGestures.Add(KinectGestures.Gestures.ZoomIn); gestureData.checkForGestures.Add(KinectGestures.Gestures.ZoomOut); break; // case KinectGestures.Gestures.Jump: // gestureData.checkForGestures.Add(KinectGestures.Gestures.Squat); // break; // // case KinectGestures.Gestures.Squat: // gestureData.checkForGestures.Add(KinectGestures.Gestures.Jump); // break; // // case KinectGestures.Gestures.Push: // gestureData.checkForGestures.Add(KinectGestures.Gestures.Pull); // break; // // case KinectGestures.Gestures.Pull: // gestureData.checkForGestures.Add(KinectGestures.Gestures.Push); // break; } if(UserId == Player1ID) player1Gestures.Add(gestureData); else if(UserId == Player2ID) player2Gestures.Add(gestureData); } // resets the gesture-data state for the given gesture of the specified user public bool ResetGesture(uint UserId, KinectGestures.Gestures gesture) { int index = GetGestureIndex(UserId, gesture); if(index < 0) return false; KinectGestures.GestureData gestureData = (UserId == Player1ID) ? player1Gestures[index] : player2Gestures[index]; gestureData.state = 0; gestureData.joint = 0; gestureData.progress = 0f; gestureData.complete = false; gestureData.cancelled = false; gestureData.startTrackingAtTime = Time.realtimeSinceStartup + KinectWrapper.Constants.MinTimeBetweenSameGestures; if(UserId == Player1ID) player1Gestures[index] = gestureData; else if(UserId == Player2ID) player2Gestures[index] = gestureData; return true; } // resets the gesture-data states for all detected gestures of the specified user public void ResetPlayerGestures(uint UserId) { if(UserId == Player1ID) { int listSize = player1Gestures.Count; for(int i = 0; i < listSize; i++) { ResetGesture(UserId, player1Gestures[i].gesture); } } else if(UserId == Player2ID) { int listSize = player2Gestures.Count; for(int i = 0; i < listSize; i++) { ResetGesture(UserId, player2Gestures[i].gesture); } } } // deletes the given gesture from the list of detected gestures for the specified user public bool DeleteGesture(uint UserId, KinectGestures.Gestures gesture) { int index = GetGestureIndex(UserId, gesture); if(index < 0) return false; if(UserId == Player1ID) player1Gestures.RemoveAt(index); else if(UserId == Player2ID) player2Gestures.RemoveAt(index); return true; } // clears detected gestures list for the specified user public void ClearGestures(uint UserId) { if(UserId == Player1ID) { player1Gestures.Clear(); } else if(UserId == Player2ID) { player2Gestures.Clear(); } } // returns the count of detected gestures in the list of detected gestures for the specified user public int GetGesturesCount(uint UserId) { if(UserId == Player1ID) return player1Gestures.Count; else if(UserId == Player2ID) return player2Gestures.Count; return 0; } // returns the list of detected gestures for the specified user public List<KinectGestures.Gestures> GetGesturesList(uint UserId) { List<KinectGestures.Gestures> list = new List<KinectGestures.Gestures>(); if(UserId == Player1ID) { foreach(KinectGestures.GestureData data in player1Gestures) list.Add(data.gesture); } else if(UserId == Player2ID) { foreach(KinectGestures.GestureData data in player1Gestures) list.Add(data.gesture); } return list; } // returns true, if the given gesture is in the list of detected gestures for the specified user public bool IsGestureDetected(uint UserId, KinectGestures.Gestures gesture) { int index = GetGestureIndex(UserId, gesture); return index >= 0; } // returns true, if the given gesture for the specified user is complete public bool IsGestureComplete(uint UserId, KinectGestures.Gestures gesture, bool bResetOnComplete) { int index = GetGestureIndex(UserId, gesture); if(index >= 0) { if(UserId == Player1ID) { KinectGestures.GestureData gestureData = player1Gestures[index]; if(bResetOnComplete && gestureData.complete) { ResetPlayerGestures(UserId); return true; } return gestureData.complete; } else if(UserId == Player2ID) { KinectGestures.GestureData gestureData = player2Gestures[index]; if(bResetOnComplete && gestureData.complete) { ResetPlayerGestures(UserId); return true; } return gestureData.complete; } } return false; } // returns true, if the given gesture for the specified user is cancelled public bool IsGestureCancelled(uint UserId, KinectGestures.Gestures gesture) { int index = GetGestureIndex(UserId, gesture); if(index >= 0) { if(UserId == Player1ID) { KinectGestures.GestureData gestureData = player1Gestures[index]; return gestureData.cancelled; } else if(UserId == Player2ID) { KinectGestures.GestureData gestureData = player2Gestures[index]; return gestureData.cancelled; } } return false; } // returns the progress in range [0, 1] of the given gesture for the specified user public float GetGestureProgress(uint UserId, KinectGestures.Gestures gesture) { int index = GetGestureIndex(UserId, gesture); if(index >= 0) { if(UserId == Player1ID) { KinectGestures.GestureData gestureData = player1Gestures[index]; return gestureData.progress; } else if(UserId == Player2ID) { KinectGestures.GestureData gestureData = player2Gestures[index]; return gestureData.progress; } } return 0f; } // returns the current "screen position" of the given gesture for the specified user public Vector3 GetGestureScreenPos(uint UserId, KinectGestures.Gestures gesture) { int index = GetGestureIndex(UserId, gesture); if(index >= 0) { if(UserId == Player1ID) { KinectGestures.GestureData gestureData = player1Gestures[index]; return gestureData.screenPos; } else if(UserId == Player2ID) { KinectGestures.GestureData gestureData = player2Gestures[index]; return gestureData.screenPos; } } return Vector3.zero; } // recreates and reinitializes the lists of avatar controllers, after the list of avatars for player 1/2 was changed public void SetAvatarControllers() { if(Player1Avatars.Count == 0 && Player2Avatars.Count == 0) { AvatarController[] avatars = FindObjectsOfType(typeof(AvatarController)) as AvatarController[]; foreach(AvatarController avatar in avatars) { Player1Avatars.Add(avatar.gameObject); } } if(Player1Controllers != null) { Player1Controllers.Clear(); foreach(GameObject avatar in Player1Avatars) { if(avatar != null && avatar.activeInHierarchy) { AvatarController controller = avatar.GetComponent<AvatarController>(); controller.RotateToInitialPosition(); controller.Start(); Player1Controllers.Add(controller); } } } if(Player2Controllers != null) { Player2Controllers.Clear(); foreach(GameObject avatar in Player2Avatars) { if(avatar != null && avatar.activeInHierarchy) { AvatarController controller = avatar.GetComponent<AvatarController>(); controller.RotateToInitialPosition(); controller.Start(); Player2Controllers.Add(controller); } } } } // removes the currently detected kinect users, allowing a new detection/calibration process to start public void ClearKinectUsers() { if(!KinectInitialized) return; // remove current users for(int i = allUsers.Count - 1; i >= 0; i--) { uint userId = allUsers[i]; RemoveUser(userId); } ResetFilters(); } // clears Kinect buffers and resets the filters public void ResetFilters() { if(!KinectInitialized) return; // clear kinect vars player1Pos = Vector3.zero; player2Pos = Vector3.zero; player1Ori = Matrix4x4.identity; player2Ori = Matrix4x4.identity; int skeletonJointsCount = (int)KinectWrapper.NuiSkeletonPositionIndex.Count; for(int i = 0; i < skeletonJointsCount; i++) { player1JointsTracked[i] = false; player2JointsTracked[i] = false; player1PrevTracked[i] = false; player2PrevTracked[i] = false; player1JointsPos[i] = Vector3.zero; player2JointsPos[i] = Vector3.zero; player1JointsOri[i] = Matrix4x4.identity; player2JointsOri[i] = Matrix4x4.identity; } if(trackingStateFilter != null) { for(int i = 0; i < trackingStateFilter.Length; i++) if(trackingStateFilter[i] != null) trackingStateFilter[i].Reset(); } if(boneOrientationFilter != null) { for(int i = 0; i < boneOrientationFilter.Length; i++) if(boneOrientationFilter[i] != null) boneOrientationFilter[i].Reset(); } if(clippedLegsFilter != null) { for(int i = 0; i < clippedLegsFilter.Length; i++) if(clippedLegsFilter[i] != null) clippedLegsFilter[i].Reset(); } } //----------------------------------- end of public functions --------------------------------------// void Start() { //CalibrationText = GameObject.Find("CalibrationText"); int hr = 0; try { hr = KinectWrapper.NuiInitialize(KinectWrapper.NuiInitializeFlags.UsesSkeleton | KinectWrapper.NuiInitializeFlags.UsesDepthAndPlayerIndex | (ComputeColorMap ? KinectWrapper.NuiInitializeFlags.UsesColor : 0)); if (hr != 0) { throw new Exception("NuiInitialize Failed"); } hr = KinectWrapper.NuiSkeletonTrackingEnable(IntPtr.Zero, 8); // 0, 12,8 if (hr != 0) { throw new Exception("Cannot initialize Skeleton Data"); } depthStreamHandle = IntPtr.Zero; if(ComputeUserMap) { hr = KinectWrapper.NuiImageStreamOpen(KinectWrapper.NuiImageType.DepthAndPlayerIndex, KinectWrapper.Constants.ImageResolution, 0, 2, IntPtr.Zero, ref depthStreamHandle); if (hr != 0) { throw new Exception("Cannot open depth stream"); } } colorStreamHandle = IntPtr.Zero; if(ComputeColorMap) { hr = KinectWrapper.NuiImageStreamOpen(KinectWrapper.NuiImageType.Color, KinectWrapper.Constants.ImageResolution, 0, 2, IntPtr.Zero, ref colorStreamHandle); if (hr != 0) { throw new Exception("Cannot open color stream"); } } // set kinect elevation angle KinectWrapper.NuiCameraElevationSetAngle(SensorAngle); // init skeleton structures skeletonFrame = new KinectWrapper.NuiSkeletonFrame() { SkeletonData = new KinectWrapper.NuiSkeletonData[KinectWrapper.Constants.NuiSkeletonCount] }; // values used to pass to smoothing function smoothParameters = new KinectWrapper.NuiTransformSmoothParameters(); switch(smoothing) { case Smoothing.Default: smoothParameters.fSmoothing = 0.5f; smoothParameters.fCorrection = 0.5f; smoothParameters.fPrediction = 0.5f; smoothParameters.fJitterRadius = 0.05f; smoothParameters.fMaxDeviationRadius = 0.04f; break; case Smoothing.Medium: smoothParameters.fSmoothing = 0.5f; smoothParameters.fCorrection = 0.1f; smoothParameters.fPrediction = 0.5f; smoothParameters.fJitterRadius = 0.1f; smoothParameters.fMaxDeviationRadius = 0.1f; break; case Smoothing.Aggressive: smoothParameters.fSmoothing = 0.7f; smoothParameters.fCorrection = 0.3f; smoothParameters.fPrediction = 1.0f; smoothParameters.fJitterRadius = 1.0f; smoothParameters.fMaxDeviationRadius = 1.0f; break; } // init the tracking state filter trackingStateFilter = new TrackingStateFilter[KinectWrapper.Constants.NuiSkeletonMaxTracked]; for(int i = 0; i < trackingStateFilter.Length; i++) { trackingStateFilter[i] = new TrackingStateFilter(); trackingStateFilter[i].Init(); } // init the bone orientation filter boneOrientationFilter = new BoneOrientationsFilter[KinectWrapper.Constants.NuiSkeletonMaxTracked]; for(int i = 0; i < boneOrientationFilter.Length; i++) { boneOrientationFilter[i] = new BoneOrientationsFilter(); boneOrientationFilter[i].Init(); } // init the clipped legs filter clippedLegsFilter = new ClippedLegsFilter[KinectWrapper.Constants.NuiSkeletonMaxTracked]; for(int i = 0; i < clippedLegsFilter.Length; i++) { clippedLegsFilter[i] = new ClippedLegsFilter(); } // init the bone orientation constraints boneConstraintsFilter = new BoneOrientationsConstraint(); boneConstraintsFilter.AddDefaultConstraints(); // init the self intersection constraints selfIntersectionConstraint = new SelfIntersectionConstraint(); // create arrays for joint positions and joint orientations int skeletonJointsCount = (int)KinectWrapper.NuiSkeletonPositionIndex.Count; player1JointsTracked = new bool[skeletonJointsCount]; player2JointsTracked = new bool[skeletonJointsCount]; player1PrevTracked = new bool[skeletonJointsCount]; player2PrevTracked = new bool[skeletonJointsCount]; player1JointsPos = new Vector3[skeletonJointsCount]; player2JointsPos = new Vector3[skeletonJointsCount]; player1JointsOri = new Matrix4x4[skeletonJointsCount]; player2JointsOri = new Matrix4x4[skeletonJointsCount]; gestureTrackingAtTime = new float[KinectWrapper.Constants.NuiSkeletonMaxTracked]; //create the transform matrix that converts from kinect-space to world-space Quaternion quatTiltAngle = new Quaternion(); quatTiltAngle.eulerAngles = new Vector3(-SensorAngle, 0.0f, 0.0f); //float heightAboveHips = SensorHeight - 1.0f; // transform matrix - kinect to world //kinectToWorld.SetTRS(new Vector3(0.0f, heightAboveHips, 0.0f), quatTiltAngle, Vector3.one); kinectToWorld.SetTRS(new Vector3(0.0f, SensorHeight, 0.0f), quatTiltAngle, Vector3.one); flipMatrix = Matrix4x4.identity; flipMatrix[2, 2] = -1; instance = this; DontDestroyOnLoad(gameObject); } catch(DllNotFoundException e) { string message = "Please check the Kinect SDK installation."; Debug.LogError(message); Debug.LogError(e.ToString()); if(CalibrationText != null) CalibrationText.guiText.text = message; return; } catch (Exception e) { string message = e.Message + " - " + KinectWrapper.GetNuiErrorString(hr); Debug.LogError(message); Debug.LogError(e.ToString()); if(CalibrationText != null) CalibrationText.guiText.text = message; return; } // get the main camera rectangle Rect cameraRect = Camera.main.pixelRect; // calculate map width and height in percent, if needed if(MapsPercentWidth == 0f) MapsPercentWidth = (KinectWrapper.GetDepthWidth() / 2) / cameraRect.width; if(MapsPercentHeight == 0f) MapsPercentHeight = (KinectWrapper.GetDepthHeight() / 2) / cameraRect.height; if(ComputeUserMap) { // Initialize depth & label map related stuff usersMapSize = KinectWrapper.GetDepthWidth() * KinectWrapper.GetDepthHeight(); usersLblTex = new Texture2D(KinectWrapper.GetDepthWidth(), KinectWrapper.GetDepthHeight()); usersMapColors = new Color32[usersMapSize]; usersPrevState = new ushort[usersMapSize]; //usersMapRect = new Rect(Screen.width, Screen.height - usersLblTex.height / 2, -usersLblTex.width / 2, usersLblTex.height / 2); //usersMapRect = new Rect(cameraRect.width, cameraRect.height - cameraRect.height * MapsPercentHeight, -cameraRect.width * MapsPercentWidth, cameraRect.height * MapsPercentHeight); usersMapRect = new Rect(cameraRect.width - cameraRect.width * MapsPercentWidth, cameraRect.height, cameraRect.width * MapsPercentWidth, -cameraRect.height * MapsPercentHeight); usersDepthMap = new short[usersMapSize]; usersHistogramMap = new float[8192]; } if(ComputeColorMap) { // Initialize color map related stuff usersClrTex = new Texture2D(KinectWrapper.GetDepthWidth(), KinectWrapper.GetDepthHeight()); //usersClrRect = new Rect(cameraRect.width, cameraRect.height - cameraRect.height * MapsPercentHeight, -cameraRect.width * MapsPercentWidth, cameraRect.height * MapsPercentHeight); usersClrRect = new Rect(cameraRect.width - cameraRect.width * MapsPercentWidth, cameraRect.height, cameraRect.width * MapsPercentWidth, -cameraRect.height * MapsPercentHeight); if(ComputeUserMap) usersMapRect.x -= cameraRect.width * MapsPercentWidth; //usersClrTex.width / 2; colorImage = new Color32[KinectWrapper.GetDepthWidth() * KinectWrapper.GetDepthHeight()]; usersColorMap = new byte[colorImage.Length << 2]; } // try to automatically find the available avatar controllers in the scene if(Player1Avatars.Count == 0 && Player2Avatars.Count == 0) { AvatarController[] avatars = FindObjectsOfType(typeof(AvatarController)) as AvatarController[]; foreach(AvatarController avatar in avatars) { Player1Avatars.Add(avatar.gameObject); } } // Initialize user list to contain ALL users. allUsers = new List<uint>(); // Pull the AvatarController from each of the players Avatars. Player1Controllers = new List<AvatarController>(); Player2Controllers = new List<AvatarController>(); // Add each of the avatars' controllers into a list for each player. foreach(GameObject avatar in Player1Avatars) { if(avatar != null && avatar.activeInHierarchy) { Player1Controllers.Add(avatar.GetComponent<AvatarController>()); } } foreach(GameObject avatar in Player2Avatars) { if(avatar != null && avatar.activeInHierarchy) { Player2Controllers.Add(avatar.GetComponent<AvatarController>()); } } // create the list of gesture listeners gestureListeners = new List<KinectGestures.GestureListenerInterface>(); foreach(MonoBehaviour script in GestureListeners) { if(script && (script is KinectGestures.GestureListenerInterface)) { KinectGestures.GestureListenerInterface listener = (KinectGestures.GestureListenerInterface)script; gestureListeners.Add(listener); } } // GUI Text. if(CalibrationText != null) { CalibrationText.guiText.text = "WAITING FOR USERS"; } Debug.Log("Waiting for users."); KinectInitialized = true; } void Update() { if(KinectInitialized) { // // for testing purposes only // KinectWrapper.UpdateKinectSensor(); // If the players aren't all calibrated yet, draw the user map. if(ComputeUserMap) { if(depthStreamHandle != IntPtr.Zero && KinectWrapper.PollDepth(depthStreamHandle, NearMode, ref usersDepthMap)) { UpdateUserMap(); } } if(ComputeColorMap) { if(colorStreamHandle != IntPtr.Zero && KinectWrapper.PollColor(colorStreamHandle, ref usersColorMap, ref colorImage)) { UpdateColorMap(); } } if(KinectWrapper.PollSkeleton(ref smoothParameters, ref skeletonFrame)) { ProcessSkeleton(); } // Update player 1's models if he/she is calibrated and the model is active. if(Player1Calibrated) { foreach (AvatarController controller in Player1Controllers) { //if(controller.Active) { controller.UpdateAvatar(Player1ID, NearMode); } } // Check for complete gestures foreach(KinectGestures.GestureData gestureData in player1Gestures) { if(gestureData.complete) { if(gestureData.gesture == KinectGestures.Gestures.Click) { if(ControlMouseCursor) { MouseControl.MouseClick(); } } foreach(KinectGestures.GestureListenerInterface listener in gestureListeners) { if(listener.GestureCompleted(Player1ID, 0, gestureData.gesture, (KinectWrapper.SkeletonJoint)gestureData.joint, gestureData.screenPos)) { ResetPlayerGestures(Player1ID); } } } else if(gestureData.cancelled) { foreach(KinectGestures.GestureListenerInterface listener in gestureListeners) { if(listener.GestureCancelled(Player1ID, 0, gestureData.gesture, (KinectWrapper.SkeletonJoint)gestureData.joint)) { ResetGesture(Player1ID, gestureData.gesture); } } } else if(gestureData.progress >= 0.1f) { if((gestureData.gesture == KinectGestures.Gestures.RightHandCursor || gestureData.gesture == KinectGestures.Gestures.LeftHandCursor) && gestureData.progress >= 0.5f) { if(HandCursor1 != null) { HandCursor1.transform.position = Vector3.Lerp(HandCursor1.transform.position, gestureData.screenPos, 3 * Time.deltaTime); } if(ControlMouseCursor) { MouseControl.MouseMove(gestureData.screenPos); } } foreach(KinectGestures.GestureListenerInterface listener in gestureListeners) { listener.GestureInProgress(Player1ID, 0, gestureData.gesture, gestureData.progress, (KinectWrapper.SkeletonJoint)gestureData.joint, gestureData.screenPos); } } } } // Update player 2's models if he/she is calibrated and the model is active. if(Player2Calibrated) { foreach (AvatarController controller in Player2Controllers) { //if(controller.Active) { controller.UpdateAvatar(Player2ID, NearMode); } } // Check for complete gestures foreach(KinectGestures.GestureData gestureData in player2Gestures) { if(gestureData.complete) { if(gestureData.gesture == KinectGestures.Gestures.Click) { if(ControlMouseCursor) { MouseControl.MouseClick(); } } foreach(KinectGestures.GestureListenerInterface listener in gestureListeners) { if(listener.GestureCompleted(Player2ID, 1, gestureData.gesture, (KinectWrapper.SkeletonJoint)gestureData.joint, gestureData.screenPos)) { ResetPlayerGestures(Player2ID); } } } else if(gestureData.cancelled) { foreach(KinectGestures.GestureListenerInterface listener in gestureListeners) { if(listener.GestureCancelled(Player2ID, 1, gestureData.gesture, (KinectWrapper.SkeletonJoint)gestureData.joint)) { ResetGesture(Player2ID, gestureData.gesture); } } } else if(gestureData.progress >= 0.1f) { if((gestureData.gesture == KinectGestures.Gestures.RightHandCursor || gestureData.gesture == KinectGestures.Gestures.LeftHandCursor) && gestureData.progress >= 0.5f) { if(HandCursor2 != null) { HandCursor2.transform.position = Vector3.Lerp(HandCursor2.transform.position, gestureData.screenPos, 3 * Time.deltaTime); } if(ControlMouseCursor) { MouseControl.MouseMove(gestureData.screenPos); } } foreach(KinectGestures.GestureListenerInterface listener in gestureListeners) { listener.GestureInProgress(Player2ID, 1, gestureData.gesture, gestureData.progress, (KinectWrapper.SkeletonJoint)gestureData.joint, gestureData.screenPos); } } } } } // Kill the program with ESC. if(Input.GetKeyDown(KeyCode.Escape)) { Application.Quit(); } } // Make sure to kill the Kinect on quitting. void OnApplicationQuit() { if(KinectInitialized) { // Shutdown OpenNI KinectWrapper.NuiShutdown(); instance = null; } } // Draw the Histogram Map on the GUI. void OnGUI() { if(KinectInitialized) { if(ComputeUserMap && (/**(allUsers.Count == 0) ||*/ DisplayUserMap)) { GUI.DrawTexture(usersMapRect, usersLblTex); } if(ComputeColorMap && (/**(allUsers.Count == 0) ||*/ DisplayColorMap)) { GUI.DrawTexture(usersClrRect, usersClrTex); } } } // Update the User Map void UpdateUserMap() { int numOfPoints = 0; Array.Clear(usersHistogramMap, 0, usersHistogramMap.Length); // Calculate cumulative histogram for depth for (int i = 0; i < usersMapSize; i++) { // Only calculate for depth that contains users if ((usersDepthMap[i] & 7) != 0) { usersHistogramMap[usersDepthMap[i] >> 3]++; numOfPoints++; } } if (numOfPoints > 0) { for (int i = 1; i < usersHistogramMap.Length; i++) { usersHistogramMap[i] += usersHistogramMap[i-1]; } for (int i = 0; i < usersHistogramMap.Length; i++) { usersHistogramMap[i] = 1.0f - (usersHistogramMap[i] / numOfPoints); } } // dummy structure needed by the coordinate mapper KinectWrapper.NuiImageViewArea pcViewArea = new KinectWrapper.NuiImageViewArea { eDigitalZoom = 0, lCenterX = 0, lCenterY = 0 }; // Create the actual users texture based on label map and depth histogram Color32 clrClear = Color.clear; for (int i = 0; i < usersMapSize; i++) { // Flip the texture as we convert label map to color array int flipIndex = i; // usersMapSize - i - 1; ushort userMap = (ushort)(usersDepthMap[i] & 7); ushort userDepth = (ushort)(usersDepthMap[i] >> 3); ushort nowUserPixel = userMap != 0 ? (ushort)((userMap << 13) | userDepth) : userDepth; ushort wasUserPixel = usersPrevState[flipIndex]; // draw only the changed pixels if(nowUserPixel != wasUserPixel) { usersPrevState[flipIndex] = nowUserPixel; if (userMap == 0) { usersMapColors[flipIndex] = clrClear; } else { if(colorImage != null) { int x = i % KinectWrapper.Constants.ImageWidth; int y = i / KinectWrapper.Constants.ImageWidth; int cx, cy; int hr = KinectWrapper.NuiImageGetColorPixelCoordinatesFromDepthPixelAtResolution( KinectWrapper.Constants.ImageResolution, KinectWrapper.Constants.ImageResolution, ref pcViewArea, x, y, usersDepthMap[i], out cx, out cy); if(hr == 0) { int colorIndex = cx + cy * KinectWrapper.Constants.ImageWidth; //colorIndex = usersMapSize - colorIndex - 1; if(colorIndex >= 0 && colorIndex < usersMapSize) { Color32 colorPixel = colorImage[colorIndex]; usersMapColors[flipIndex] = colorPixel; // new Color(colorPixel.r / 256f, colorPixel.g / 256f, colorPixel.b / 256f, 0.9f); usersMapColors[flipIndex].a = 230; // 0.9f } } } else { // Create a blending color based on the depth histogram float histDepth = usersHistogramMap[userDepth]; Color c = new Color(histDepth, histDepth, histDepth, 0.9f); switch(userMap % 4) { case 0: usersMapColors[flipIndex] = Color.red * c; break; case 1: usersMapColors[flipIndex] = Color.green * c; break; case 2: usersMapColors[flipIndex] = Color.blue * c; break; case 3: usersMapColors[flipIndex] = Color.magenta * c; break; } } } } } // Draw it! usersLblTex.SetPixels32(usersMapColors); usersLblTex.Apply(); } // Update the Color Map void UpdateColorMap() { usersClrTex.SetPixels32(colorImage); usersClrTex.Apply(); } // Assign UserId to player 1 or 2. void CalibrateUser(uint UserId, ref KinectWrapper.NuiSkeletonData skeletonData) { // If player 1 hasn't been calibrated, assign that UserID to it. if(!Player1Calibrated) { // Check to make sure we don't accidentally assign player 2 to player 1. if (!allUsers.Contains(UserId)) { if(CheckForCalibrationPose(UserId, ref Player1CalibrationPose, ref player1CalibrationData, ref skeletonData)) { Player1Calibrated = true; Player1ID = UserId; allUsers.Add(UserId); foreach(AvatarController controller in Player1Controllers) { controller.SuccessfulCalibration(UserId); } // add the gestures to detect, if any foreach(KinectGestures.Gestures gesture in Player1Gestures) { DetectGesture(UserId, gesture); } print ("user.detected"); // notify the gesture listeners about the new user foreach(KinectGestures.GestureListenerInterface listener in gestureListeners) { listener.UserDetected(UserId, 0); } // reset skeleton filters ResetFilters(); // If we're not using 2 users, we're all calibrated. //if(!TwoUsers) { AllPlayersCalibrated = !TwoUsers ? allUsers.Count >= 1 : allUsers.Count >= 2; // true; } } } } // Otherwise, assign to player 2. else if(TwoUsers && !Player2Calibrated) { if (!allUsers.Contains(UserId)) { if(CheckForCalibrationPose(UserId, ref Player2CalibrationPose, ref player2CalibrationData, ref skeletonData)) { Player2Calibrated = true; Player2ID = UserId; allUsers.Add(UserId); foreach(AvatarController controller in Player2Controllers) { controller.SuccessfulCalibration(UserId); } // add the gestures to detect, if any foreach(KinectGestures.Gestures gesture in Player2Gestures) { DetectGesture(UserId, gesture); } // notify the gesture listeners about the new user foreach(KinectGestures.GestureListenerInterface listener in gestureListeners) { listener.UserDetected(UserId, 1); } // reset skeleton filters ResetFilters(); // All users are calibrated! AllPlayersCalibrated = !TwoUsers ? allUsers.Count >= 1 : allUsers.Count >= 2; // true; } } } // If all users are calibrated, stop trying to find them. if(AllPlayersCalibrated) { Debug.Log("All players calibrated."); if(CalibrationText != null) { CalibrationText.guiText.text = ""; } } } // Remove a lost UserId void RemoveUser(uint UserId) { // If we lose player 1... if(UserId == Player1ID) { // Null out the ID and reset all the models associated with that ID. Player1ID = 0; Player1Calibrated = false; foreach(AvatarController controller in Player1Controllers) { controller.RotateToCalibrationPose(UserId, IsCalibrationNeeded()); } foreach(KinectGestures.GestureListenerInterface listener in gestureListeners) { listener.UserLost(UserId, 0); } player1CalibrationData.userId = 0; } // If we lose player 2... if(UserId == Player2ID) { // Null out the ID and reset all the models associated with that ID. Player2ID = 0; Player2Calibrated = false; foreach(AvatarController controller in Player2Controllers) { controller.RotateToCalibrationPose(UserId, IsCalibrationNeeded()); } foreach(KinectGestures.GestureListenerInterface listener in gestureListeners) { listener.UserLost(UserId, 1); } player2CalibrationData.userId = 0; } // clear gestures list for this user ClearGestures(UserId); // remove from global users list allUsers.Remove(UserId); AllPlayersCalibrated = !TwoUsers ? allUsers.Count >= 1 : allUsers.Count >= 2; // false; // Try to replace that user! Debug.Log("Waiting for users."); if(CalibrationText != null) { CalibrationText.guiText.text = "WAITING FOR USERS"; } } // Some internal constants private const int stateTracked = (int)KinectWrapper.NuiSkeletonPositionTrackingState.Tracked; private const int stateNotTracked = (int)KinectWrapper.NuiSkeletonPositionTrackingState.NotTracked; private int [] mustBeTrackedJoints = { (int)KinectWrapper.NuiSkeletonPositionIndex.AnkleLeft, (int)KinectWrapper.NuiSkeletonPositionIndex.FootLeft, (int)KinectWrapper.NuiSkeletonPositionIndex.AnkleRight, (int)KinectWrapper.NuiSkeletonPositionIndex.FootRight, }; // Process the skeleton data void ProcessSkeleton() { List<uint> lostUsers = new List<uint>(); lostUsers.AddRange(allUsers); // calculate the time since last update float currentNuiTime = Time.realtimeSinceStartup; float deltaNuiTime = currentNuiTime - lastNuiTime; for(int i = 0; i < KinectWrapper.Constants.NuiSkeletonCount; i++) { KinectWrapper.NuiSkeletonData skeletonData = skeletonFrame.SkeletonData[i]; uint userId = skeletonData.dwTrackingID; if(skeletonData.eTrackingState == KinectWrapper.NuiSkeletonTrackingState.SkeletonTracked) { // get the skeleton position Vector3 skeletonPos = kinectToWorld.MultiplyPoint3x4(skeletonData.Position); if(!AllPlayersCalibrated) { // check if this is the closest user bool bClosestUser = true; if(DetectClosestUser) { for(int j = 0; j < KinectWrapper.Constants.NuiSkeletonCount; j++) { if(j != i) { KinectWrapper.NuiSkeletonData skeletonDataOther = skeletonFrame.SkeletonData[j]; if((skeletonDataOther.eTrackingState == KinectWrapper.NuiSkeletonTrackingState.SkeletonTracked) && (Mathf.Abs(kinectToWorld.MultiplyPoint3x4(skeletonDataOther.Position).z) < Mathf.Abs(skeletonPos.z))) { bClosestUser = false; break; } } } } if(bClosestUser) { CalibrateUser(userId, ref skeletonData); } } //// get joints orientations //KinectWrapper.NuiSkeletonBoneOrientation[] jointOrients = new KinectWrapper.NuiSkeletonBoneOrientation[(int)KinectWrapper.NuiSkeletonPositionIndex.Count]; //KinectWrapper.NuiSkeletonCalculateBoneOrientations(ref skeletonData, jointOrients); if(userId == Player1ID && Mathf.Abs(skeletonPos.z) >= MinUserDistance) { player1Index = i; // get player position player1Pos = skeletonPos; // apply tracking state filter first trackingStateFilter[0].UpdateFilter(ref skeletonData); // fixup skeleton to improve avatar appearance. if(UseClippedLegsFilter && clippedLegsFilter[0] != null) { clippedLegsFilter[0].FilterSkeleton(ref skeletonData, deltaNuiTime); } if(UseSelfIntersectionConstraint && selfIntersectionConstraint != null) { selfIntersectionConstraint.Constrain(ref skeletonData); } // get joints' position and rotation for (int j = 0; j < (int)KinectWrapper.NuiSkeletonPositionIndex.Count; j++) { bool playerTracked = IgnoreInferredJoints ? (int)skeletonData.eSkeletonPositionTrackingState[j] == stateTracked : (Array.BinarySearch(mustBeTrackedJoints, j) >= 0 ? (int)skeletonData.eSkeletonPositionTrackingState[j] == stateTracked : (int)skeletonData.eSkeletonPositionTrackingState[j] != stateNotTracked); player1JointsTracked[j] = player1PrevTracked[j] && playerTracked; player1PrevTracked[j] = playerTracked; if(player1JointsTracked[j]) { player1JointsPos[j] = kinectToWorld.MultiplyPoint3x4(skeletonData.SkeletonPositions[j]); //player1JointsOri[j] = jointOrients[j].absoluteRotation.rotationMatrix * flipMatrix; } // if(j == (int)KinectWrapper.NuiSkeletonPositionIndex.HipCenter) // { // string debugText = String.Format("{0} {1}", /**(int)skeletonData.eSkeletonPositionTrackingState[j], */ // player1JointsTracked[j] ? "T" : "F", player1JointsPos[j]/**, skeletonData.SkeletonPositions[j]*/); // // if(CalibrationText) // CalibrationText.guiText.text = debugText; // } } // draw the skeleton on top of texture if(DisplaySkeletonLines && ComputeUserMap) { DrawSkeleton(usersLblTex, ref skeletonData, ref player1JointsTracked); } // calculate joint orientations KinectWrapper.GetSkeletonJointOrientation(ref player1JointsPos, ref player1JointsTracked, ref player1JointsOri); // filter orientation constraints if(UseBoneOrientationsConstraint && boneConstraintsFilter != null) { boneConstraintsFilter.Constrain(ref player1JointsOri, ref player1JointsTracked); } // filter joint orientations. // it should be performed after all joint position modifications. if(UseBoneOrientationsFilter && boneOrientationFilter[0] != null) { boneOrientationFilter[0].UpdateFilter(ref skeletonData, ref player1JointsOri); } // get player rotation player1Ori = player1JointsOri[(int)KinectWrapper.NuiSkeletonPositionIndex.HipCenter]; // check for gestures if(Time.realtimeSinceStartup >= gestureTrackingAtTime[0]) { int listGestureSize = player1Gestures.Count; float timestampNow = Time.realtimeSinceStartup; for(int g = 0; g < listGestureSize; g++) { KinectGestures.GestureData gestureData = player1Gestures[g]; if((timestampNow >= gestureData.startTrackingAtTime) && !IsConflictingGestureInProgress(gestureData)) { KinectGestures.CheckForGesture(userId, ref gestureData, Time.realtimeSinceStartup, ref player1JointsPos, ref player1JointsTracked); player1Gestures[g] = gestureData; if(gestureData.complete) { gestureTrackingAtTime[0] = timestampNow + MinTimeBetweenGestures; } } } } } else if(userId == Player2ID && Mathf.Abs(skeletonPos.z) >= MinUserDistance) { player2Index = i; // get player position player2Pos = skeletonPos; // apply tracking state filter first trackingStateFilter[1].UpdateFilter(ref skeletonData); // fixup skeleton to improve avatar appearance. if(UseClippedLegsFilter && clippedLegsFilter[1] != null) { clippedLegsFilter[1].FilterSkeleton(ref skeletonData, deltaNuiTime); } if(UseSelfIntersectionConstraint && selfIntersectionConstraint != null) { selfIntersectionConstraint.Constrain(ref skeletonData); } // get joints' position and rotation for (int j = 0; j < (int)KinectWrapper.NuiSkeletonPositionIndex.Count; j++) { bool playerTracked = IgnoreInferredJoints ? (int)skeletonData.eSkeletonPositionTrackingState[j] == stateTracked : (Array.BinarySearch(mustBeTrackedJoints, j) >= 0 ? (int)skeletonData.eSkeletonPositionTrackingState[j] == stateTracked : (int)skeletonData.eSkeletonPositionTrackingState[j] != stateNotTracked); player2JointsTracked[j] = player2PrevTracked[j] && playerTracked; player2PrevTracked[j] = playerTracked; if(player2JointsTracked[j]) { player2JointsPos[j] = kinectToWorld.MultiplyPoint3x4(skeletonData.SkeletonPositions[j]); } } // draw the skeleton on top of texture if(DisplaySkeletonLines && ComputeUserMap) { DrawSkeleton(usersLblTex, ref skeletonData, ref player2JointsTracked); } // calculate joint orientations KinectWrapper.GetSkeletonJointOrientation(ref player2JointsPos, ref player2JointsTracked, ref player2JointsOri); // filter orientation constraints if(UseBoneOrientationsConstraint && boneConstraintsFilter != null) { boneConstraintsFilter.Constrain(ref player2JointsOri, ref player2JointsTracked); } // filter joint orientations. // it should be performed after all joint position modifications. if(UseBoneOrientationsFilter && boneOrientationFilter[1] != null) { boneOrientationFilter[1].UpdateFilter(ref skeletonData, ref player2JointsOri); } // get player rotation player2Ori = player2JointsOri[(int)KinectWrapper.NuiSkeletonPositionIndex.HipCenter]; // check for gestures if(Time.realtimeSinceStartup >= gestureTrackingAtTime[1]) { int listGestureSize = player2Gestures.Count; float timestampNow = Time.realtimeSinceStartup; for(int g = 0; g < listGestureSize; g++) { KinectGestures.GestureData gestureData = player2Gestures[g]; if((timestampNow >= gestureData.startTrackingAtTime) && !IsConflictingGestureInProgress(gestureData)) { KinectGestures.CheckForGesture(userId, ref gestureData, Time.realtimeSinceStartup, ref player2JointsPos, ref player2JointsTracked); player2Gestures[g] = gestureData; if(gestureData.complete) { gestureTrackingAtTime[1] = timestampNow + MinTimeBetweenGestures; } } } } } lostUsers.Remove(userId); } } // update the nui-timer lastNuiTime = currentNuiTime; // remove the lost users if any if(lostUsers.Count > 0) { foreach(uint userId in lostUsers) { RemoveUser(userId); } lostUsers.Clear(); } } // draws the skeleton in the given texture private void DrawSkeleton(Texture2D aTexture, ref KinectWrapper.NuiSkeletonData skeletonData, ref bool[] playerJointsTracked) { int jointsCount = (int)KinectWrapper.NuiSkeletonPositionIndex.Count; for(int i = 0; i < jointsCount; i++) { int parent = KinectWrapper.GetSkeletonJointParent(i); if(playerJointsTracked[i] && playerJointsTracked[parent]) { Vector3 posParent = KinectWrapper.MapSkeletonPointToDepthPoint(skeletonData.SkeletonPositions[parent]); Vector3 posJoint = KinectWrapper.MapSkeletonPointToDepthPoint(skeletonData.SkeletonPositions[i]); // posParent.y = KinectWrapper.Constants.ImageHeight - posParent.y - 1; // posJoint.y = KinectWrapper.Constants.ImageHeight - posJoint.y - 1; // posParent.x = KinectWrapper.Constants.ImageWidth - posParent.x - 1; // posJoint.x = KinectWrapper.Constants.ImageWidth - posJoint.x - 1; //Color lineColor = playerJointsTracked[i] && playerJointsTracked[parent] ? Color.red : Color.yellow; DrawLine(aTexture, (int)posParent.x, (int)posParent.y, (int)posJoint.x, (int)posJoint.y, Color.yellow); } } aTexture.Apply(); } // draws a line in a texture private void DrawLine(Texture2D a_Texture, int x1, int y1, int x2, int y2, Color a_Color) { int width = KinectWrapper.Constants.ImageWidth; int height = KinectWrapper.Constants.ImageHeight; int dy = y2 - y1; int dx = x2 - x1; int stepy = 1; if (dy < 0) { dy = -dy; stepy = -1; } int stepx = 1; if (dx < 0) { dx = -dx; stepx = -1; } dy <<= 1; dx <<= 1; if(x1 >= 0 && x1 < width && y1 >= 0 && y1 < height) for(int x = -1; x <= 1; x++) for(int y = -1; y <= 1; y++) a_Texture.SetPixel(x1 + x, y1 + y, a_Color); if (dx > dy) { int fraction = dy - (dx >> 1); while (x1 != x2) { if (fraction >= 0) { y1 += stepy; fraction -= dx; } x1 += stepx; fraction += dy; if(x1 >= 0 && x1 < width && y1 >= 0 && y1 < height) for(int x = -1; x <= 1; x++) for(int y = -1; y <= 1; y++) a_Texture.SetPixel(x1 + x, y1 + y, a_Color); } } else { int fraction = dx - (dy >> 1); while (y1 != y2) { if (fraction >= 0) { x1 += stepx; fraction -= dy; } y1 += stepy; fraction += dx; if(x1 >= 0 && x1 < width && y1 >= 0 && y1 < height) for(int x = -1; x <= 1; x++) for(int y = -1; y <= 1; y++) a_Texture.SetPixel(x1 + x, y1 + y, a_Color); } } } // convert the matrix to quaternion, taking care of the mirroring private Quaternion ConvertMatrixToQuat(Matrix4x4 mOrient, int joint, bool flip) { Vector4 vZ = mOrient.GetColumn(2); Vector4 vY = mOrient.GetColumn(1); if(!flip) { vZ.y = -vZ.y; vY.x = -vY.x; vY.z = -vY.z; } else { vZ.x = -vZ.x; vZ.y = -vZ.y; vY.z = -vY.z; } if(vZ.x != 0.0f || vZ.y != 0.0f || vZ.z != 0.0f) return Quaternion.LookRotation(vZ, vY); else return Quaternion.identity; } // return the index of gesture in the list, or -1 if not found private int GetGestureIndex(uint UserId, KinectGestures.Gestures gesture) { if(UserId == Player1ID) { int listSize = player1Gestures.Count; for(int i = 0; i < listSize; i++) { if(player1Gestures[i].gesture == gesture) return i; } } else if(UserId == Player2ID) { int listSize = player2Gestures.Count; for(int i = 0; i < listSize; i++) { if(player2Gestures[i].gesture == gesture) return i; } } return -1; } private bool IsConflictingGestureInProgress(KinectGestures.GestureData gestureData) { foreach(KinectGestures.Gestures gesture in gestureData.checkForGestures) { int index = GetGestureIndex(gestureData.userId, gesture); if(index >= 0) { if(gestureData.userId == Player1ID) { if(player1Gestures[index].progress > 0f) return true; } else if(gestureData.userId == Player2ID) { if(player2Gestures[index].progress > 0f) return true; } } } return false; } // check if the calibration pose is complete for given user private bool CheckForCalibrationPose(uint userId, ref KinectGestures.Gestures calibrationGesture, ref KinectGestures.GestureData gestureData, ref KinectWrapper.NuiSkeletonData skeletonData) { if(calibrationGesture == KinectGestures.Gestures.None) return true; // init gesture data if needed if(gestureData.userId != userId) { gestureData.userId = userId; gestureData.gesture = calibrationGesture; gestureData.state = 0; gestureData.joint = 0; gestureData.progress = 0f; gestureData.complete = false; gestureData.cancelled = false; } // get temporary joints' position int skeletonJointsCount = (int)KinectWrapper.NuiSkeletonPositionIndex.Count; bool[] jointsTracked = new bool[skeletonJointsCount]; Vector3[] jointsPos = new Vector3[skeletonJointsCount]; int stateTracked = (int)KinectWrapper.NuiSkeletonPositionTrackingState.Tracked; int stateNotTracked = (int)KinectWrapper.NuiSkeletonPositionTrackingState.NotTracked; int [] mustBeTrackedJoints = { (int)KinectWrapper.NuiSkeletonPositionIndex.AnkleLeft, (int)KinectWrapper.NuiSkeletonPositionIndex.FootLeft, (int)KinectWrapper.NuiSkeletonPositionIndex.AnkleRight, (int)KinectWrapper.NuiSkeletonPositionIndex.FootRight, }; for (int j = 0; j < skeletonJointsCount; j++) { jointsTracked[j] = Array.BinarySearch(mustBeTrackedJoints, j) >= 0 ? (int)skeletonData.eSkeletonPositionTrackingState[j] == stateTracked : (int)skeletonData.eSkeletonPositionTrackingState[j] != stateNotTracked; if(jointsTracked[j]) { jointsPos[j] = kinectToWorld.MultiplyPoint3x4(skeletonData.SkeletonPositions[j]); } } // estimate the gesture progess KinectGestures.CheckForGesture(userId, ref gestureData, Time.realtimeSinceStartup, ref jointsPos, ref jointsTracked); // check if gesture is complete if(gestureData.complete) { gestureData.userId = 0; return true; } return false; } }
Acidburn0zzz/Corridors
Assets/KinectScripts/KinectManager.cs
C#
mit
63,304
[ 30522, 2478, 8499, 13159, 3170, 1025, 2478, 2291, 1025, 2478, 2291, 1012, 6407, 1025, 2478, 2291, 1012, 6407, 1012, 12391, 1025, 2478, 2291, 1012, 2448, 7292, 1012, 6970, 11923, 2121, 7903, 2229, 1025, 2478, 2291, 1012, 22834, 1025, 2478, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <HTML><HEAD><TITLE>Invalid Man Page</TITLE></HEAD> <BODY> <H1>Invalid Man Page</H1> The requested file gnu_dev_makedev.3 is not a valid (unformatted) man page.</BODY></HTML>
cs-education/sysassets
man_pages/html/man3/gnu_dev_makedev.3.html
HTML
apache-2.0
239
[ 30522, 1026, 999, 9986, 13874, 16129, 2270, 1000, 1011, 1013, 1013, 1059, 2509, 2278, 1013, 1013, 26718, 2094, 16129, 1018, 1012, 5890, 17459, 1013, 1013, 4372, 1000, 1028, 30524, 3931, 1026, 1013, 2516, 1028, 1026, 1013, 2132, 1028, 1026, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* Overlay , enable it if display in header, and header{over-flow:hidden;} */ #simplemodal-overlay {background-color:#000;} #simplemodal-container a.modalCloseImg {background:url(../images/close_bt.png) top no-repeat; width:26px; height:26px; display:inline; z-index:3200; position:absolute; top:6px; right:10px; cursor:pointer;} #simplemodal-container a.modalCloseImg:hover {background:url(../images/close_bt.png) bottom no-repeat; width:26px; height:26px; display:inline; z-index:3200; position:absolute; top:6px; right:10px; cursor:pointer;} .simplemodal-wrap{ overflow:visible!important; } .btl-content-block{ background: none repeat scroll 0 0 #FFFFFF; border-radius: 4px; border:1px solid #dadada; box-shadow: 8px 8px 8px rgba(0, 0, 0, 0.4); display: none; height: auto; overflow: hidden; text-align: left; font-size:12px; position:relative; } .btl-content-block form{ margin:0; padding:0; } .form-vertical { text-align:center; } .btl-content-block h3{ background: url("../images/header_bglogin.jpg") repeat-x scroll left top transparent; font-weight: normal; line-height: 35px; margin:0px; padding: 3px 0px 0px 19px!important; text-transform: uppercase; font-size:18px; } .btl-input > input[type=text], .btl-input > input[type=password], #recaptcha > input{ border: 1px solid #dadada; border-radius:4px; margin:0; text-indent: 5px; width: 189px; height: 34px; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset; transition: border 0.2s linear 0s, box-shadow 0.2s linear 0s; } #recaptcha > input{ width: 100px; } .btl-input > input:focus, #recaptcha > input:focus{ border-color: #E9322D; box-shadow: 0 0 6px #F8B9B7; } #recaptcha span#btl-captcha-reload{ display: inline-block; width: 16px; height: 16px; background: url('../images/reload.png') no-repeat; text-indent: -9999px; cursor: pointer; } #btl{ position:relative; } #btl .btl-panel{ overflow:hidden; } #btl .btl-panel > #btl-panel-profile{ background:url(../images/btl-panel-bg.png) top right no-repeat; padding-right:30px; } button::-moz-focus-inner { padding:0; border: none; } #btl .btl-panel > span{ display:inline-block; padding:0 13px; cursor:pointer; text-indent: 0!important; width: auto; } #btl .btl-panel > span{ margin:0px; } #btl .btl-panel > span.active,button.btl-buttonsubmit:focus,input.btl-buttonsubmit:focus{ opacity:0.8; } .btl-error{ display:none; } .btl-error-detail{ display:none; float: right; color: #FF0000; margin-bottom:4px; } .btl-field,#register-link,.btl-error-detail,.btl-error,.btl-note{ margin-left:20px; margin-right:25px!important; overflow:hidden; } .btl-label{ float:left!important; } .btl-input{ float:right!important; } .btl-label, .btl-input { line-height:38px; height: 38px; } #recaptcha{ height: auto!important; float:right; } #btl-content-login .btl-input input{ width: 190px; } #btl-input-remember{ } #btl-checkbox-remember{ width: 15px!important; vertical-align:middle; padding:0; margin:0; } .clear{ clear:both; } .btl-error{ color: #FF0000; } input.btl-buttonsubmit, button.btl-buttonsubmit{ border:none!important; box-shadow: 1px 1px 3px rgba(9,4,3,0.86); cursor: pointer; text-align: center!important; text-shadow: 0 1px 1px #4A4A4A; width: auto!important; display:inline-block; } div.btl-buttonsubmit{ text-align:center!important; padding:5px 0 0 0!important; border-top:1px solid #dddddd; margin:10px 25px 30px 20px } /* STYLE FOR DROP-DOWN PANEL (all element in #btl-content) */ #btl-content ul li a:hover{ color:#7BA428 !important; text-decoration: underline!important; background-color: transparent!important; } #btl-content > .btl-content-block{ position:absolute!important; z-index:9999; } #btl-content #btl-content-login{ width:350px; } #btl-content-registration{ min-width:350px; } .btl-note,#register-link{ padding:18px 0px; } #btl-content-login .btl-input{ float:right; } #btl-content-login .spacer{ height:14px; } #btl-content div.btl-buttonsubmit{ border-top: 1px dotted #c4c4c4; } #btl-content #btl-content-login .btl-label { line-height:38px; min-width: 0px!important; } /* CSS FOR USER PROFILE MODULE**/ #btl-content #btl-content-profile{ overflow:hidden; } #module-in-profile{ min-width:200px; } #btl-content #btl-content-profile #module-in-profile ul{ position: static; text-align: left; margin: 0 0 0 15px; padding: 0!important; } #btl-content-profile ul.menu li { background: url("../images/bullet.png") no-repeat scroll 5px 15px transparent; padding: 0 0 0 20px!important; border-bottom: 1px solid #E8E8E8; display:list-item!important; line-height: 37px; } #btl-content #btl-content-profile #module-in-profile ul li a{ color: #6b6b6b; text-decoration: none !important; text-transform: none!important; font-family: arial,tahoma; } #btl-content-profile ul.menu li a { color: #616161!important; text-decoration:none!important; border:none!important; background:none!important; display:inline!important; padding:0!important; margin:0!important; text-transform: none!important; } #btl-content-profile div.btl-buttonsubmit{ clear:both; margin-bottom:15px; border: none!important; text-align: center; margin-top: 0!important; } /* style panel when action process */ #btl-register-in-process,#btl-login-in-process{ display: none; background: url("../images/loading.gif") no-repeat #000 50%; opacity: 0.4; width: 100%; height: 100%; position: absolute; z-index: 9999; top:-1px; left:-1px; padding-top:1px; padding-left:1px; } /* style panel when register success */ #btl-success{ display: none; margin: 20px 0 30px 0; background:url("../images/notice-info.png") no-repeat; display: none; color:#000; border-bottom: 2px solid #90B203; border-top: 2px solid #90B203; font-size:14px; padding: 10px 10px 10px 25px; } /* style for ul in login panel*/ #bt_ul{ margin-top:-10px!important; margin-bottom:20px!important; margin-right: 25px!important; float:left; } /* for modal*/ #btl-content-login ul{ position: static!important; text-align: left; list-style-type: disc !important; } #btl-content-login ul li{ margin-top: 3px; } #bt_ul li a{ padding: 0!important; text-decoration: none!important; color:#545454!important; } #btl-wrap-module{ padding-left: 20px; padding-bottom: 20px; padding-top: 10px; }
leonmueller321/CST4
modules/mod_bt_login/tmpl/css/style2.0.css
CSS
gpl-2.0
6,390
[ 30522, 1013, 1008, 2058, 8485, 1010, 9585, 2009, 2065, 4653, 1999, 20346, 1010, 1998, 20346, 1063, 2058, 1011, 4834, 1024, 5023, 1025, 1065, 1008, 1013, 1001, 3722, 5302, 9305, 1011, 2058, 8485, 1063, 4281, 1011, 3609, 1024, 1001, 2199, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
!function(){"use strict";!function(){if(void 0===window.Reflect||void 0===window.customElements||window.customElements.polyfillWrapFlushCallback)return;const t=HTMLElement;window.HTMLElement={HTMLElement:function(){return Reflect.construct(t,[],this.constructor)}}.HTMLElement,HTMLElement.prototype=t.prototype,HTMLElement.prototype.constructor=HTMLElement,Object.setPrototypeOf(HTMLElement,t)}()}();
cdnjs/cdnjs
ajax/libs/webcomponentsjs/2.5.0/custom-elements-es5-adapter.min.js
JavaScript
mit
400
[ 30522, 999, 3853, 1006, 1007, 1063, 1000, 2224, 9384, 1000, 1025, 999, 3853, 1006, 1007, 1063, 2065, 1006, 11675, 1014, 1027, 1027, 1027, 3332, 1012, 8339, 1064, 1064, 11675, 1014, 1027, 1027, 1027, 3332, 1012, 7661, 12260, 8163, 1064, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* Stuart Bowman 2016 This class contains the graph nodes themselves, as well as helper functions for use by the generation class to better facilitate evaluation and breeding. It also contains the class definition for the nodes themselves, as well as the A* search implementation used by the genetic algorithm to check if a path can be traced between two given points on the maze. */ using UnityEngine; using System.Collections; using System.Collections.Generic; public class Graph { public Dictionary<int, Node> nodes; float AStarPathSuccess = 0.0f;//fraction of samples that could be maped to nodes and completed with AStar float AStarAvgPathLength = 0.0f;//average path length of successful paths public float getAStarPathSuccess() { return AStarPathSuccess; } public float getAStarAvgPathLength() { return AStarAvgPathLength; } public float getCompositeScore() { return AStarPathSuccess; }//a weighted, composite score of all evaluated attributes of this graph public int newNodeStartingID = 0; public Graph(int startingID) { newNodeStartingID = startingID; nodes = new Dictionary<int, Node>(); } public Graph(List<GameObject> floors, List<GameObject> walls, int initNumNodes = 20) { nodes = new Dictionary<int, Node>(); for (int i = 0; i < initNumNodes; i++) { int rndTile = Random.Range(0, floors.Count); //get the 2d bounding area for any floor tile MeshCollider mc = floors[rndTile].GetComponent<MeshCollider>(); Vector2 xyWorldSpaceBoundsBottomLeft = new Vector2(mc.bounds.center.x - mc.bounds.size.x/2, mc.bounds.center.z - mc.bounds.size.z/2); Vector2 rndPosInTile = new Vector2(Random.Range(0, mc.bounds.size.x), Random.Range(0, mc.bounds.size.z)); Vector2 rndWorldPos = xyWorldSpaceBoundsBottomLeft + rndPosInTile; Node n = addNewNode(rndWorldPos); } connectAllNodes(); } public Graph(Graph g)//deep copy constructor { nodes = new Dictionary<int, Node>(); //deep copy foreach (KeyValuePair<int, Node> entry in g.nodes) { //deep copy the node with the best score bool inherited = entry.Value.isNodeInheritedFromParent(); Node currentNode = new Node(new Vector2(entry.Value.pos.x, entry.Value.pos.y), entry.Value.ID, inherited); //don't bother copying the A* and heuristic stuff for each node, it's just going to be re-crunched later nodes.Add(currentNode.ID, currentNode); } AStarPathSuccess = g.getAStarPathSuccess(); AStarAvgPathLength = g.getAStarAvgPathLength(); } public static float normDistRand(float mean, float stdDev) { float u1 = Random.Range(0, 1.0f); float u2 = Random.Range(0, 1.0f); float randStdNormal = Mathf.Sqrt(-2.0f * Mathf.Log(u1) * Mathf.Sin(2.0f * 3.14159f * u2)); return mean + stdDev * randStdNormal; } public string getSummary() { string result = ""; result += nodes.Count + "\tNodes\t(" + getNumOfNewlyAddedNodes() + " new)\n"; result += getAStarPathSuccess() * 100 + "%\tA* Satisfaction\n"; result += getAStarAvgPathLength() + "\tUnit avg. A* Path\n"; return result; } int getNumOfNewlyAddedNodes() { int result = 0; foreach (KeyValuePair<int, Node> entry in nodes) { if (entry.Value.isNodeInheritedFromParent() == false) result++; } return result; } public void connectAllNodes() { foreach (KeyValuePair<int,Node> entry in nodes) { foreach (KeyValuePair<int, Node> entry2 in nodes) { if (entry.Value != entry2.Value) { if (!Physics.Linecast(new Vector3(entry.Value.pos.x, 2, entry.Value.pos.y), new Vector3(entry2.Value.pos.x, 2, entry2.Value.pos.y))) { entry.Value.connectTo(entry2.Value); } } } } } public int getFirstUnusedID() { for (int i = 0; i < nodes.Count; i++) { if (!nodes.ContainsKey(i)) return i; } return nodes.Count; } public int getMaxID() { int temp = 0; foreach (KeyValuePair<int, Node> entry in nodes) { if (entry.Value.ID > temp) temp = entry.Value.ID; } if (temp < newNodeStartingID) return newNodeStartingID; return temp; } public class Node { public int ID; public Vector2 pos; public List<Node> connectedNodes; bool inheritedFromParent; public Node Ancestor;//used in A* public float g, h;//public values for temporary use during searching and heuristic analysis public float f { get {return g + h; } private set { } } public bool isNodeInheritedFromParent() { return inheritedFromParent; } public Node(Vector2 position, int id, bool inherited) { connectedNodes = new List<Node>(); pos = position; ID = id; inheritedFromParent = inherited; } public void connectTo(Node node) { if (!connectedNodes.Contains(node)) { connectedNodes.Add(node); if (!node.connectedNodes.Contains(this)) { node.connectedNodes.Add(this); } } } public void disconnectFrom(Node n) { for (int i = 0; i < connectedNodes.Count; i++) { if (connectedNodes[i] == n) n.connectedNodes.Remove(this); } connectedNodes.Remove(n); } } public Node addNewNode(Vector2 pos) { int newID = this.getMaxID()+1;//get the new id from the maxID property Node tempNode = new Node(pos, newID, false); nodes.Add(newID, tempNode); return tempNode; } public Node addNewNode(Vector2 pos, int ID) { Node tempNode = new Node(pos, ID, false); nodes.Add(ID, tempNode); return tempNode; } public Node addNewNode(Vector2 pos, int ID, bool inherited) { Node tempNode = new Node(pos, ID, inherited); nodes.Add(ID, tempNode); return tempNode; } public void removeNode(int ID) { Node nodeToRemove = nodes[ID]; foreach (Node n in nodeToRemove.connectedNodes) { //remove symmetrical connections n.connectedNodes.Remove(nodeToRemove); } nodes.Remove(ID);//delete the actual node } public void printAdjMatrix() { foreach (KeyValuePair<int, Node> entry in nodes) { string connNodes = "Node: " + entry.Value.ID + "\nConn: "; foreach (Node n2 in entry.Value.connectedNodes) { connNodes += n2.ID + ", "; } Debug.Log(connNodes); } } public List<Node> AStar(int startingNodeKey, int endingNodeKey) { List<Node> ClosedSet = new List<Node>(); List<Node> OpenSet = new List<Node>(); foreach(KeyValuePair<int, Node> entry in nodes) { entry.Value.g = 99999;//set all g values to infinity entry.Value.Ancestor = null;//set all node ancestors to null } nodes[startingNodeKey].g = 0; nodes[startingNodeKey].h = Vector2.Distance(nodes[startingNodeKey].pos, nodes[endingNodeKey].pos); OpenSet.Add(nodes[startingNodeKey]); while (OpenSet.Count > 0 ) { float minscore = 99999; int minIndex = 0; for(int i = 0;i<OpenSet.Count;i++) { if (OpenSet[i].f < minscore) { minscore = OpenSet[i].f; minIndex = i; } } //deep copy the node with the best score Node currentNode = new Node(new Vector2(OpenSet[minIndex].pos.x, OpenSet[minIndex].pos.y), OpenSet[minIndex].ID, false); currentNode.g = OpenSet[minIndex].g; currentNode.h = OpenSet[minIndex].h; currentNode.Ancestor = OpenSet[minIndex].Ancestor; if (currentNode.ID == endingNodeKey) { //build the path list List<Node> fullPath = new List<Node>(); Node temp = currentNode; while (temp != null) { fullPath.Add(temp); temp = temp.Ancestor; } return fullPath; } //remove this node from the open set OpenSet.RemoveAt(minIndex); ClosedSet.Add(currentNode); //go through the list of nodes that are connected to the current node foreach(Node n in nodes[currentNode.ID].connectedNodes) { bool isInClosedSet = false; //check if it's already in the closed set for (int i = 0; i < ClosedSet.Count; i++) { if (ClosedSet[i].ID == n.ID) { isInClosedSet = true; break; } } if (isInClosedSet) continue; float tenativeG = currentNode.g + Vector2.Distance(n.pos, currentNode.pos); bool isInOpenSet = false; for (int i = 0; i < OpenSet.Count; i++) { if (OpenSet[i].ID == n.ID) isInOpenSet = true; } if (!isInOpenSet) OpenSet.Add(n); else if (tenativeG >= n.g) continue; n.Ancestor = currentNode; n.g = tenativeG; n.h = Vector2.Distance(n.pos, nodes[endingNodeKey].pos); } } //didn't find a path return new List<Node>(); } public void generateAStarSatisfaction(List<Vector2> startingPoint, List<Vector2> endingPoint) { int successfulPaths = 0; float avgPathLen = 0.0f; for (int i = 0; i < startingPoint.Count; i++) { Node startingNode = closestNodeToPoint(startingPoint[i]); if (startingNode == null) continue;//skip to next iteration if no starting node can be found Node endingNode = closestNodeToPoint(endingPoint[i]); if (endingNode == null) continue;//skip to next iteration if no ending node can be found List<Node> path = AStar(startingNode.ID, endingNode.ID); if (path.Count != 0)//if the path was successful { successfulPaths++; avgPathLen += path[path.Count - 1].g + Vector2.Distance(startingPoint[i], startingNode.pos) + Vector2.Distance(endingPoint[i], endingNode.pos); } } avgPathLen /= successfulPaths; //store results AStarAvgPathLength = avgPathLen; AStarPathSuccess = successfulPaths / (float)startingPoint.Count; } Node closestNodeToPoint(Vector2 point) { //find closest node to the given starting point List<Node> lineOfSightNodes = new List<Node>(); foreach (KeyValuePair<int, Node> entry in nodes) { if (!Physics.Linecast(new Vector3(point.x, 2, point.y), new Vector3(entry.Value.pos.x, 2, entry.Value.pos.y))) { lineOfSightNodes.Add(entry.Value); } } float minDist = 999999; int minIndex = 0; if (lineOfSightNodes.Count == 0) return null;//no nodes are line of sight to this point for (int j = 0; j < lineOfSightNodes.Count; j++) { float dist = Vector2.Distance(point, lineOfSightNodes[j].pos); if (dist < minDist) { minDist = dist; minIndex = j; } } return lineOfSightNodes[minIndex]; } }
stuartsoft/gngindiestudy
Assets/Scripts/Graph.cs
C#
gpl-2.0
12,517
[ 30522, 1013, 1008, 6990, 19298, 2355, 2023, 2465, 3397, 1996, 10629, 14164, 3209, 1010, 2004, 2092, 2004, 2393, 2121, 4972, 2005, 2224, 2011, 1996, 4245, 2465, 2000, 2488, 10956, 9312, 1998, 8119, 1012, 2009, 2036, 3397, 1996, 2465, 6210, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
{{extend "layout.html"}} {{include "_update.html"}} <script type="text/javascript">//<![CDATA[ $(function() { // Organisation Autocomplete {{entity_id = request.controller + "_" + request.function + "_organisation_id"}} {{urlpath_c = "org"}} {{urlpath_f = "organisation"}} {{urlvar_field = "name"}} {{include "auto_input.js"}} // Person AutoComplete {{real_input = request.controller + "_" + request.function + "_person_id"}} {{dummy_input = "dummy_" + real_input}} // Hide the real Input Field $('#{{=real_input}}').hide(); // Add a dummy field $('#{{=real_input}}').after("<input id='{{=dummy_input}}' class='ac_input' size=50 />"); {{include "pr/person_autocomplete.js"}} // Populate the Dummy Input from the real one var oldvalue = $('#{{=real_input}} > option[selected="selected"]').html(); $('#{{=dummy_input}}').val(oldvalue); // Re-populate the real Input when the Dummy is selected $('#{{=dummy_input}}').result(function(event, data, formatted) { var newvalue = data.id; $('#{{=real_input}}').val(newvalue); }); }); //]]></script>
luisibanez/SahanaEden
views/rms/pledge_update.html
HTML
mit
1,143
[ 30522, 1063, 1063, 7949, 1000, 9621, 1012, 16129, 1000, 1065, 1065, 1063, 1063, 2421, 1000, 1035, 10651, 1012, 16129, 1000, 1065, 1065, 1026, 5896, 2828, 1027, 1000, 3793, 1013, 9262, 22483, 1000, 1028, 1013, 1013, 1026, 999, 1031, 3729, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * Licensed to ElasticSearch and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. ElasticSearch licenses this * file to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.elasticsearch.index.engine; import org.elasticsearch.index.shard.ShardId; /** * */ public class EngineAlreadyStartedException extends EngineException { public EngineAlreadyStartedException(ShardId shardId) { super(shardId, "Already started"); } }
Kreolwolf1/Elastic
src/main/java/org/elasticsearch/index/engine/EngineAlreadyStartedException.java
Java
apache-2.0
1,086
[ 30522, 1013, 1008, 1008, 7000, 2000, 21274, 17310, 30524, 2104, 1996, 15895, 6105, 1010, 2544, 1016, 1012, 1014, 1006, 1996, 1008, 1000, 6105, 1000, 1007, 1025, 2017, 2089, 2025, 2224, 2023, 5371, 3272, 1999, 12646, 1008, 2007, 1996, 6105, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package test.matcher; import static hu.interconnect.util.DateUtils.parseNap; import java.util.Date; import org.hamcrest.CoreMatchers; import org.hamcrest.Description; import org.hamcrest.Matcher; import org.hamcrest.core.IsAnything; import hu.interconnect.hr.backend.api.dto.SzabadsagFelhasznalasResponseDTO; import hu.interconnect.hr.backend.api.enumeration.FelhasznaltSzabadnapJelleg; import test.matcher.AbstractTypeSafeDiagnosingMatcher; public class SzabadsagFelhasznalasResponseDTOMatcher extends AbstractTypeSafeDiagnosingMatcher<SzabadsagFelhasznalasResponseDTO> { private Matcher<Integer> tsz = new IsAnything<>(); private Matcher<Date> kezdet = new IsAnything<>(); private Matcher<Date> veg = new IsAnything<>(); private Matcher<FelhasznaltSzabadnapJelleg> jelleg = new IsAnything<>(); private Matcher<Integer> munkanapokSzama = new IsAnything<>(); public SzabadsagFelhasznalasResponseDTOMatcher tsz(Integer tsz) { this.tsz = CoreMatchers.is(tsz); return this; } public SzabadsagFelhasznalasResponseDTOMatcher kezdet(Matcher<Date> kezdet) { this.kezdet = kezdet; return this; } public SzabadsagFelhasznalasResponseDTOMatcher kezdet(String kezdetStr) { this.kezdet = CoreMatchers.is(parseNap(kezdetStr)); return this; } public SzabadsagFelhasznalasResponseDTOMatcher veg(Matcher<Date> veg) { this.veg = veg; return this; } public SzabadsagFelhasznalasResponseDTOMatcher veg(String vegStr) { this.veg = CoreMatchers.is(parseNap(vegStr)); return this; } public SzabadsagFelhasznalasResponseDTOMatcher jelleg(FelhasznaltSzabadnapJelleg jelleg) { this.jelleg = CoreMatchers.is(jelleg); return this; } public SzabadsagFelhasznalasResponseDTOMatcher munkanapokSzama(Integer munkanapokSzama) { this.munkanapokSzama = CoreMatchers.is(munkanapokSzama); return this; } @Override protected boolean matchesSafely(SzabadsagFelhasznalasResponseDTO item, Description mismatchDescription) { return matches(tsz, item.tsz, "tsz value: ", mismatchDescription) && matches(kezdet, item.kezdet, "kezdet value: ", mismatchDescription) && matches(veg, item.veg, "veg value: ", mismatchDescription) && matches(jelleg, item.jelleg, "jelleg value: ", mismatchDescription) && matches(munkanapokSzama, item.munkanapokSzama, "munkanapokSzama value: ", mismatchDescription); } @Override public void describeTo(Description description) { description.appendText(SzabadsagFelhasznalasResponseDTO.class.getSimpleName()) .appendText(", tsz: ").appendDescriptionOf(tsz) .appendText(", kezdet: ").appendDescriptionOf(kezdet) .appendText(", veg: ").appendDescriptionOf(veg) .appendText(", jelleg: ").appendDescriptionOf(jelleg) .appendText(", munkanapokSzama: ").appendDescriptionOf(munkanapokSzama); } }
tornaia/hr2
hr2-java-parent/hr2-backend-api/src/test/java/test/matcher/SzabadsagFelhasznalasResponseDTOMatcher.java
Java
mit
2,803
[ 30522, 7427, 3231, 1012, 2674, 2121, 1025, 12324, 10763, 15876, 1012, 6970, 8663, 2638, 6593, 1012, 21183, 4014, 1012, 3058, 21823, 4877, 1012, 11968, 5054, 9331, 1025, 12324, 9262, 1012, 21183, 4014, 1012, 3058, 1025, 12324, 8917, 1012, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#include "fizzbuzz.h" #include <iostream> int main(int /*argc*/, char* /*argv*/[]) { playFizzBuzz(); return 0; }
pauldreik/cppsandbox
fizzbuzz/main.cpp
C++
gpl-3.0
119
[ 30522, 1001, 2421, 1000, 10882, 13213, 8569, 13213, 1012, 1044, 1000, 1001, 2421, 1026, 16380, 25379, 1028, 20014, 2364, 1006, 20014, 1013, 1008, 12098, 18195, 1008, 1013, 1010, 25869, 1008, 1013, 1008, 12098, 2290, 2615, 1008, 1013, 1031, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * Copyright (c) 2016-2016 Codenvy, S.A. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Codenvy, S.A. - initial API and implementation */ /** * Possible modes of formatters * @author Florent Benoit */ export type FormatterMode = 'MODERN' | 'CSV'
sdirix/emf4che
dockerfiles/lib/src/spi/ascii/formatter-mode.ts
TypeScript
epl-1.0
478
[ 30522, 1013, 1008, 1008, 9385, 1006, 1039, 1007, 2355, 1011, 2355, 3642, 2078, 10736, 1010, 1055, 1012, 1037, 1012, 1008, 2035, 2916, 9235, 1012, 2023, 2565, 1998, 1996, 10860, 4475, 1008, 2024, 2081, 2800, 2104, 1996, 3408, 1997, 1996, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
using System.Collections.Generic; using System.Web.Mvc; using SmartStore.Services.Payments; namespace SmartStore.Web.Framework.Controllers { public abstract class PaymentControllerBase : SmartController { public abstract IList<string> ValidatePaymentForm(FormCollection form); public abstract ProcessPaymentRequest GetPaymentInfo(FormCollection form); } }
ilovejs/SmartStoreNET
src/Presentation/SmartStore.Web.Framework/Controllers/PaymentControllerBase.cs
C#
lgpl-2.1
389
[ 30522, 2478, 2291, 1012, 6407, 1012, 12391, 1025, 2478, 2291, 1012, 4773, 1012, 19842, 2278, 1025, 2478, 6047, 23809, 2063, 1012, 2578, 1012, 10504, 1025, 3415, 15327, 6047, 23809, 2063, 1012, 4773, 1012, 7705, 1012, 21257, 1063, 2270, 1006...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
"use strict"; let datafire = require('datafire'); let openapi = require('./openapi.json'); module.exports = datafire.Integration.fromOpenAPI(openapi, "billbee");
DataFire/Integrations
integrations/generated/billbee/index.js
JavaScript
mit
161
[ 30522, 1000, 2224, 9384, 1000, 1025, 2292, 2951, 10273, 1027, 5478, 1006, 1005, 2951, 10273, 1005, 1007, 1025, 2292, 2330, 9331, 2072, 1027, 5478, 1006, 1005, 1012, 1013, 2330, 9331, 2072, 1012, 1046, 3385, 1005, 1007, 1025, 11336, 1012, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/******************************************************************************* * * * WashingtonDC Dreamcast Emulator * Copyright (C) 2019 snickerbockers * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * * ******************************************************************************/ #include <string.h> #include <stdbool.h> #include "code_block.h" static void jit_optimize_nop(struct il_code_block *blk); static void jit_optimize_dead_write(struct il_code_block *blk); static void jit_optimize_discard(struct il_code_block *blk); static bool check_for_reads_after(struct il_code_block *blk, unsigned inst_idx); void jit_optimize(struct il_code_block *blk) { jit_optimize_nop(blk); jit_optimize_dead_write(blk); jit_optimize_discard(blk); } // remove IL instructions which don't actually do anything. static void jit_optimize_nop(struct il_code_block *blk) { unsigned inst_no = 0; while (inst_no < blk->inst_count) { struct jit_inst *inst = blk->inst_list + inst_no; if (inst->op == JIT_OP_AND && inst->immed.and.slot_src == inst->immed.and.slot_dst) { /* * ANDing a slot with itself. * * this tends to happen due to the way that the SH4 TST instruction * is implemented. Programs will AND a register to itself to set * the C flag, and that causes a spurious IL instruction when the * same register is tested against itself because the AND operation * instruction in the IL is separate from the SLOT_TO_BOOL * operation. */ il_code_block_strike_inst(blk, inst_no); continue; } inst_no++; } } // remove IL instructions which write to a slot which is not later read from static void jit_optimize_dead_write(struct il_code_block *blk) { unsigned src_inst = 0; while (src_inst < blk->inst_count) { struct jit_inst *inst = blk->inst_list + src_inst; int write_slots[JIT_IL_MAX_WRITE_SLOTS]; jit_inst_get_write_slots(inst, write_slots); // skip this instruction if it doesn't write to any slots unsigned write_count = 0; unsigned slot_no; for (slot_no = 0; slot_no < JIT_IL_MAX_WRITE_SLOTS; slot_no++) if (write_slots[slot_no] != -1) write_count++; if (!write_count) { src_inst++; continue; } if (!check_for_reads_after(blk, src_inst)) il_code_block_strike_inst(blk, src_inst); else src_inst++; } } static bool check_for_reads_after(struct il_code_block *blk, unsigned inst_idx) { struct jit_inst *inst = blk->inst_list + inst_idx; int write_slots[JIT_IL_MAX_WRITE_SLOTS]; jit_inst_get_write_slots(inst, write_slots); unsigned check_idx; for (check_idx = inst_idx + 1; check_idx < blk->inst_count; check_idx++) { struct jit_inst *check_inst = blk->inst_list + check_idx; int slot_no; for (slot_no = 0; slot_no < JIT_IL_MAX_WRITE_SLOTS; slot_no++) { if (write_slots[slot_no] != -1) { if (jit_inst_is_read_slot(check_inst, write_slots[slot_no])) return true; else if (jit_inst_is_write_slot(check_inst, write_slots[slot_no])) write_slots[slot_no] = -1; } } } return false; } static void jit_optimize_discard(struct il_code_block *blk) { for (unsigned slot_no = 0; slot_no < blk->n_slots; slot_no++) { int inst_no; for (inst_no = blk->inst_count - 1; inst_no >= 0; inst_no--) { struct jit_inst const *inst = blk->inst_list + inst_no; if (jit_inst_is_read_slot(inst, slot_no) || jit_inst_is_write_slot(inst, slot_no)) { struct jit_inst op; op.op = JIT_OP_DISCARD_SLOT; op.immed.discard_slot.slot_no = slot_no; il_code_block_insert_inst(blk, &op, inst_no + 1); break; } } } }
washingtondc-emu/washingtondc
src/libwashdc/jit/optimize.c
C
gpl-3.0
4,742
[ 30522, 1013, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 100...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package com.raymond.entrypoint; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.http.HttpStatus; import org.springframework.security.core.AuthenticationException; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.RestControllerAdvice; import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler; import javax.servlet.http.HttpServletResponse; /** * Created by Raymond Kwong on 12/1/2018. */ @Qualifier("handlerExceptionResolver") @RestControllerAdvice public class GlobalExceptionHandler extends ResponseEntityExceptionHandler { @ExceptionHandler(AuthenticationException.class) public ErrorResponseBean handleAuthenticationException(AuthenticationException exception, HttpServletResponse response){ ErrorResponseBean errorResponseBean = new ErrorResponseBean(); errorResponseBean.setError(HttpStatus.UNAUTHORIZED.getReasonPhrase()); errorResponseBean.setMessage(exception.getMessage()); response.setStatus(HttpStatus.UNAUTHORIZED.value()); return errorResponseBean; } }
RaymondKwong/raymond_projects
services/jwtauth/src/main/java/com/raymond/entrypoint/GlobalExceptionHandler.java
Java
mit
1,163
[ 30522, 7427, 4012, 1012, 7638, 1012, 4443, 8400, 1025, 12324, 8917, 1012, 3500, 15643, 30524, 4773, 1012, 14187, 1012, 5754, 17287, 3508, 1012, 6453, 11774, 3917, 1025, 12324, 8917, 1012, 3500, 15643, 6198, 1012, 4773, 1012, 14187, 1012, 57...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
import numpy as np from scipy.linalg import norm from .base import AppearanceLucasKanade class SimultaneousForwardAdditive(AppearanceLucasKanade): @property def algorithm(self): return 'Simultaneous-FA' def _fit(self, lk_fitting, max_iters=20, project=True): # Initial error > eps error = self.eps + 1 image = lk_fitting.image lk_fitting.weights = [] n_iters = 0 # Number of shape weights n_params = self.transform.n_parameters # Initial appearance weights if project: # Obtained weights by projection IWxp = image.warp_to(self.template.mask, self.transform, interpolator=self.interpolator) weights = self.appearance_model.project(IWxp) # Reset template self.template = self.appearance_model.instance(weights) else: # Set all weights to 0 (yielding the mean) weights = np.zeros(self.appearance_model.n_active_components) lk_fitting.weights.append(weights) # Compute appearance model Jacobian wrt weights appearance_jacobian = self.appearance_model._jacobian.T # Forward Additive Algorithm while n_iters < max_iters and error > self.eps: # Compute warped image with current weights IWxp = image.warp_to(self.template.mask, self.transform, interpolator=self.interpolator) # Compute warp Jacobian dW_dp = self.transform.jacobian( self.template.mask.true_indices) # Compute steepest descent images, VI_dW_dp J = self.residual.steepest_descent_images( image, dW_dp, forward=(self.template, self.transform, self.interpolator)) # Concatenate VI_dW_dp with appearance model Jacobian self._J = np.hstack((J, appearance_jacobian)) # Compute Hessian and inverse self._H = self.residual.calculate_hessian(self._J) # Compute steepest descent parameter updates sd_delta_p = self.residual.steepest_descent_update( self._J, self.template, IWxp) # Compute gradient descent parameter updates delta_p = np.real(self._calculate_delta_p(sd_delta_p)) # Update warp weights parameters = self.transform.as_vector() + delta_p[:n_params] self.transform.from_vector_inplace(parameters) lk_fitting.parameters.append(parameters) # Update appearance weights weights -= delta_p[n_params:] self.template = self.appearance_model.instance(weights) lk_fitting.weights.append(weights) # Test convergence error = np.abs(norm(delta_p)) n_iters += 1 lk_fitting.fitted = True return lk_fitting class SimultaneousForwardCompositional(AppearanceLucasKanade): @property def algorithm(self): return 'Simultaneous-FC' def _set_up(self): # Compute warp Jacobian self._dW_dp = self.transform.jacobian( self.template.mask.true_indices) def _fit(self, lk_fitting, max_iters=20, project=True): # Initial error > eps error = self.eps + 1 image = lk_fitting.image lk_fitting.weights = [] n_iters = 0 # Number of shape weights n_params = self.transform.n_parameters # Initial appearance weights if project: # Obtained weights by projection IWxp = image.warp_to(self.template.mask, self.transform, interpolator=self.interpolator) weights = self.appearance_model.project(IWxp) # Reset template self.template = self.appearance_model.instance(weights) else: # Set all weights to 0 (yielding the mean) weights = np.zeros(self.appearance_model.n_active_components) lk_fitting.weights.append(weights) # Compute appearance model Jacobian wrt weights appearance_jacobian = self.appearance_model._jacobian.T # Forward Additive Algorithm while n_iters < max_iters and error > self.eps: # Compute warped image with current weights IWxp = image.warp_to(self.template.mask, self.transform, interpolator=self.interpolator) # Compute steepest descent images, VI_dW_dp J = self.residual.steepest_descent_images(IWxp, self._dW_dp) # Concatenate VI_dW_dp with appearance model Jacobian self._J = np.hstack((J, appearance_jacobian)) # Compute Hessian and inverse self._H = self.residual.calculate_hessian(self._J) # Compute steepest descent parameter updates sd_delta_p = self.residual.steepest_descent_update( self._J, self.template, IWxp) # Compute gradient descent parameter updates delta_p = np.real(self._calculate_delta_p(sd_delta_p)) # Update warp weights self.transform.compose_after_from_vector_inplace(delta_p[:n_params]) lk_fitting.parameters.append(self.transform.as_vector()) # Update appearance weights weights -= delta_p[n_params:] self.template = self.appearance_model.instance(weights) lk_fitting.weights.append(weights) # Test convergence error = np.abs(norm(delta_p)) n_iters += 1 lk_fitting.fitted = True return lk_fitting class SimultaneousInverseCompositional(AppearanceLucasKanade): @property def algorithm(self): return 'Simultaneous-IA' def _set_up(self): # Compute the Jacobian of the warp self._dW_dp = self.transform.jacobian( self.appearance_model.mean.mask.true_indices) def _fit(self, lk_fitting, max_iters=20, project=True): # Initial error > eps error = self.eps + 1 image = lk_fitting.image lk_fitting.weights = [] n_iters = 0 # Number of shape weights n_params = self.transform.n_parameters # Initial appearance weights if project: # Obtained weights by projection IWxp = image.warp_to(self.template.mask, self.transform, interpolator=self.interpolator) weights = self.appearance_model.project(IWxp) # Reset template self.template = self.appearance_model.instance(weights) else: # Set all weights to 0 (yielding the mean) weights = np.zeros(self.appearance_model.n_active_components) lk_fitting.weights.append(weights) # Compute appearance model Jacobian wrt weights appearance_jacobian = -self.appearance_model._jacobian.T # Baker-Matthews, Inverse Compositional Algorithm while n_iters < max_iters and error > self.eps: # Compute warped image with current weights IWxp = image.warp_to(self.template.mask, self.transform, interpolator=self.interpolator) # Compute steepest descent images, VT_dW_dp J = self.residual.steepest_descent_images(self.template, self._dW_dp) # Concatenate VI_dW_dp with appearance model Jacobian self._J = np.hstack((J, appearance_jacobian)) # Compute Hessian and inverse self._H = self.residual.calculate_hessian(self._J) # Compute steepest descent parameter updates sd_delta_p = self.residual.steepest_descent_update( self._J, IWxp, self.template) # Compute gradient descent parameter updates delta_p = -np.real(self._calculate_delta_p(sd_delta_p)) # Update warp weights self.transform.compose_after_from_vector_inplace(delta_p[:n_params]) lk_fitting.parameters.append(self.transform.as_vector()) # Update appearance weights weights -= delta_p[n_params:] self.template = self.appearance_model.instance(weights) lk_fitting.weights.append(weights) # Test convergence error = np.abs(norm(delta_p)) n_iters += 1 lk_fitting.fitted = True return lk_fitting
jabooth/menpo-archive
menpo/fit/lucaskanade/appearance/simultaneous.py
Python
bsd-3-clause
8,583
[ 30522, 12324, 16371, 8737, 2100, 2004, 27937, 2013, 16596, 7685, 1012, 27022, 2140, 2290, 12324, 13373, 2013, 1012, 2918, 12324, 3311, 7630, 15671, 9126, 9648, 2465, 17424, 29278, 7652, 4215, 23194, 3512, 1006, 3311, 7630, 15671, 9126, 9648, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...