text:
module.exports = {

	desktop: require("./desktop"),

	Clipboard: require("./desktop/Clipboard").default,
	ClipboardFormats: require("./desktop/ClipboardFormats").default,
	ClipboardTransferMode: require("./desktop/ClipboardTransferMode").default,

	display: require("./display"),

	// Application: require("./display/Application").default,
	Bitmap: require("./display/Bitmap").default,
	BitmapData: require("./display/BitmapData").default,
	BitmapDataChannel: require("./display/BitmapDataChannel").default,
	BlendMode: require("./display/BlendMode").default,
	CanvasRenderer: require("./display/CanvasRenderer").default,
	CapsStyle: require("./display/CapsStyle").default,
	DisplayObject: require("./display/DisplayObject").default,
	DisplayObjectContainer: require("./display/DisplayObjectContainer").default,
	DisplayObjectRenderer: require("./display/DisplayObjectRenderer").default,
	DisplayObjectShader: require("./display/DisplayObjectShader").default,
	DOMElement: require("./display/DOMElement").default,
	DOMRenderer: require("./display/DOMRenderer").default,
	FPS: require("./display/FPS").default,
	FrameLabel: require("./display/FrameLabel").default,
	GradientType: require("./display/GradientType").default,
	Graphics: require("./display/Graphics").default,
	GraphicsBitmapFill: require("./display/GraphicsBitmapFill").default,
	GraphicsEndFill: require("./display/GraphicsEndFill").default,
	GraphicsGradientFill: require("./display/GraphicsGradientFill").default,
	GraphicsPath: require("./display/GraphicsPath").default,
	GraphicsPathCommand: require("./display/GraphicsPathCommand").default,
	GraphicsPathWinding: require("./display/GraphicsPathWinding").default,
	GraphicsQuadPath: require("./display/GraphicsQuadPath").default,
	GraphicsShader: require("./display/GraphicsShader").default,
	GraphicsShaderFill: require("./display/GraphicsShaderFill").default,
	GraphicsSolidFill: require("./display/GraphicsSolidFill").default,
	GraphicsStroke: require("./display/GraphicsStroke").default,
	GraphicsTrianglePath: require("./display/GraphicsTrianglePath").default,
	IBitmapDrawable: require("./display/IBitmapDrawable").default,
	IGraphicsData: require("./display/IGraphicsData").default,
	IGraphicsFill: require("./display/IGraphicsFill").default,
	IGraphicsPath: require("./display/IGraphicsPath").default,
	IGraphicsStroke: require("./display/IGraphicsStroke").default,
	InteractiveObject: require("./display/InteractiveObject").default,
	InterpolationMethod: require("./display/InterpolationMethod").default,
	ITileContainer: require("./display/ITileContainer").default,
	JointStyle: require("./display/JointStyle").default,
	JPEGEncoderOptions: require("./display/JPEGEncoderOptions").default,
	LineScaleMode: require("./display/LineScaleMode").default,
	Loader: require("./display/Loader").default,
	LoaderInfo: require("./display/LoaderInfo").default,
	MovieClip: require("./display/MovieClip").default,
	OpenGLRenderer: require("./display/OpenGLRenderer").default,
	PixelSnapping: require("./display/PixelSnapping").default,
	PNGEncoderOptions: require("./display/PNGEncoderOptions").default,
	Preloader: require("./display/Preloader").default,
	Shader: require("./display/Shader").default,
	ShaderData: require("./display/ShaderData").default,
	ShaderInput: require("./display/ShaderInput").default,
	ShaderJob: require("./display/ShaderJob").default,
	ShaderParameter: require("./display/ShaderParameter").default,
	ShaderParameterType: require("./display/ShaderParameterType").default,
	ShaderPrecision: require("./display/ShaderPrecision").default,
	Shape: require("./display/Shape").default,
	SimpleButton: require("./display/SimpleButton").default,
	SpreadMethod: require("./display/SpreadMethod").default,
	Sprite: require("./display/Sprite").default,
	Stage: require("./display/Stage").default,
	Stage3D: require("./display/Stage3D").default,
	StageAlign: require("./display/StageAlign").default,
	StageDisplayState: require("./display/StageDisplayState").default,
	StageQuality: require("./display/StageQuality").default,
	StageScaleMode: require("./display/StageScaleMode").default,
	Tile: require("./display/Tile").default,
	TileContainer: require("./display/TileContainer").default,
	Tilemap: require("./display/Tilemap").default,
	Tileset: require("./display/Tileset").default,
	TriangleCulling: require("./display/TriangleCulling").default,
	// Window: require("./display/Window").default,

	display3D: require("./display3D"),

	CubeTexture: require("./display3D/textures/CubeTexture").default,
	RectangleTexture: require("./display3D/textures/RectangleTexture").default,
	Texture: require("./display3D/textures/Texture").default,
	TextureBase: require("./display3D/textures/TextureBase").default,
	VideoTexture: require("./display3D/textures/VideoTexture").default,

	Context3D: require("./display3D/Context3D").default,
	Context3DBlendFactor: require("./display3D/Context3DBlendFactor").default,
	Context3DBufferUsage: require("./display3D/Context3DBufferUsage").default,
	Context3DClearMask: require("./display3D/Context3DClearMask").default,
	Context3DCompareMode: require("./display3D/Context3DCompareMode").default,
	Context3DMipFilter: require("./display3D/Context3DMipFilter").default,
	Context3DProfile: require("./display3D/Context3DProfile").default,
	Context3DProgramType: require("./display3D/Context3DProgramType").default,
	Context3DRenderMode: require("./display3D/Context3DRenderMode").default,
	Context3DStencilAction: require("./display3D/Context3DStencilAction").default,
	Context3DTextureFilter: require("./display3D/Context3DTextureFilter").default,
	Context3DTextureFormat: require("./display3D/Context3DTextureFormat").default,
	Context3DTriangleFace: require("./display3D/Context3DTriangleFace").default,
	Context3DVertexBufferFormat: require("./display3D/Context3DVertexBufferFormat").default,
	Context3DWrapMode: require("./display3D/Context3DWrapMode").default,
	IndexBuffer3D: require("./display3D/IndexBuffer3D").default,
	Program3D: require("./display3D/Program3D").default,
	VertexBuffer3D: require("./display3D/VertexBuffer3D").default,

	errors: require("./errors"),

	ArgumentError: require("./errors/ArgumentError").default,
	EOFError: require("./errors/EOFError").default,
	Error: require("./errors/Error").default,
	IllegalOperationError: require("./errors/IllegalOperationError").default,
	IOError: require("./errors/IOError").default,
	RangeError: require("./errors/RangeError").default,
	SecurityError: require("./errors/SecurityError").default,
	TypeError: require("./errors/TypeError").default,

	events: require("./events"),

	AccelerometerEvent: require("./events/AccelerometerEvent").default,
	ActivityEvent: require("./events/ActivityEvent").default,
	AsyncErrorEvent: require("./events/AsyncErrorEvent").default,
	DataEvent: require("./events/DataEvent").default,
	ErrorEvent: require("./events/ErrorEvent").default,
	Event: require("./events/Event").default,
	EventDispatcher: require("./events/EventDispatcher").default,
	EventPhase: require("./events/EventPhase").default,
	FocusEvent: require("./events/FocusEvent").default,
	FullScreenEvent: require("./events/FullScreenEvent").default,
	GameInputEvent: require("./events/GameInputEvent").default,
	HTTPStatusEvent: require("./events/HTTPStatusEvent").default,
	IEventDispatcher: require("./events/IEventDispatcher").default,
	IOErrorEvent: require("./events/IOErrorEvent").default,
	KeyboardEvent: require("./events/KeyboardEvent").default,
	MouseEvent: require("./events/MouseEvent").default,
	NetStatusEvent: require("./events/NetStatusEvent").default,
	ProgressEvent: require("./events/ProgressEvent").default,
	RenderEvent: require("./events/RenderEvent").default,
	SampleDataEvent: require("./events/SampleDataEvent").default,
	SecurityErrorEvent: require("./events/SecurityErrorEvent").default,
	TextEvent: require("./events/TextEvent").default,
	TimerEvent: require("./events/TimerEvent").default,
	TouchEvent: require("./events/TouchEvent").default,
	UncaughtErrorEvent: require("./events/UncaughtErrorEvent").default,
	UncaughtErrorEvents: require("./events/UncaughtErrorEvents").default,
	VideoTextureEvent: require("./events/VideoTextureEvent").default,

	external: require("./external"),

	ExternalInterface: require("./external/ExternalInterface").default,

	filters: require("./filters"),

	BitmapFilter: require("./filters/BitmapFilter").default,
	BitmapFilterQuality: require("./filters/BitmapFilterQuality").default,
	BitmapFilterShader: require("./filters/BitmapFilterShader").default,
	BitmapFilterType: require("./filters/BitmapFilterType").default,
	BlurFilter: require("./filters/BlurFilter").default,
	ColorMatrixFilter: require("./filters/ColorMatrixFilter").default,
	ConvolutionFilter: require("./filters/ConvolutionFilter").default,
	DropShadowFilter: require("./filters/DropShadowFilter").default,
	GlowFilter: require("./filters/GlowFilter").default,
	ShaderFilter: require("./filters/ShaderFilter").default,

	geom: require("./geom"),

	ColorTransform: require("./geom/ColorTransform").default,
	Matrix: require("./geom/Matrix").default,
	Matrix3D: require("./geom/Matrix3D").default,
	Orientation3D: require("./geom/Orientation3D").default,
	PerspectiveProjection: require("./geom/PerspectiveProjection").default,
	Point: require("./geom/Point").default,
	Rectangle: require("./geom/Rectangle").default,
	Transform: require("./geom/Transform").default,
	Utils3D: require("./geom/Utils3D").default,
	Vector3D: require("./geom/Vector3D").default,

	media: require("./media"),

	ID3Info: require("./media/ID3Info").default,
	Sound: require("./media/Sound").default,
	SoundChannel: require("./media/SoundChannel").default,
	SoundLoaderContext: require("./media/SoundLoaderContext").default,
	SoundMixer: require("./media/SoundMixer").default,
	SoundTransform: require("./media/SoundTransform").default,
	Video: require("./media/Video").default,

	net: require("./net"),

	FileFilter: require("./net/FileFilter").default,
	FileReference: require("./net/FileReference").default,
	FileReferenceList: require("./net/FileReferenceList").default,
	NetConnection: require("./net/NetConnection").default,
	NetStream: require("./net/NetStream").default,
	ObjectEncoding: require("./net/ObjectEncoding").default,
	SharedObject: require("./net/SharedObject").default,
	SharedObjectFlushStatus: require("./net/SharedObjectFlushStatus").default,
	Socket: require("./net/Socket").default,
	URLLoader: require("./net/URLLoader").default,
	URLLoaderDataFormat: require("./net/URLLoaderDataFormat").default,
	URLRequest: require("./net/URLRequest").default,
	URLRequestDefaults: require("./net/URLRequestDefaults").default,
	URLRequestHeader: require("./net/URLRequestHeader").default,
	URLRequestMethod: require("./net/URLRequestMethod").default,
	URLStream: require("./net/URLStream").default,
	URLVariables: require("./net/URLVariables").default,
	XMLSocket: require("./net/XMLSocket").default,
	navigateToURL: require("./net/navigateToURL").default,
	sendToURL: require("./net/sendToURL").default,

	printing: require("./printing"),

	PrintJob: require("./printing/PrintJob").default,
	PrintJobOptions: require("./printing/PrintJobOptions").default,
	PrintJobOrientation: require("./printing/PrintJobOrientation").default,

	profiler: require("./profiler"),

	Telemetry: require("./profiler/Telemetry").default,

	sensors: require("./sensors"),

	Accelerometer: require("./sensors/Accelerometer").default,

	system: require("./system"),

	ApplicationDomain: require("./system/ApplicationDomain").default,
	Capabilities: require("./system/Capabilities").default,
	LoaderContext: require("./system/LoaderContext").default,
	Security: require("./system/Security").default,
	SecurityDomain: require("./system/SecurityDomain").default,
	System: require("./system/System").default,
	TouchscreenType: require("./system/TouchscreenType").default,

	text: require("./text"),

	AntiAliasType: require("./text/AntiAliasType").default,
	Font: require("./text/Font").default,
	FontStyle: require("./text/FontStyle").default,
	FontType: require("./text/FontType").default,
	GridFitType: require("./text/GridFitType").default,
	TextField: require("./text/TextField").default,
	TextFieldAutoSize: require("./text/TextFieldAutoSize").default,
	TextFieldType: require("./text/TextFieldType").default,
	TextFormat: require("./text/TextFormat").default,
	TextFormatAlign: require("./text/TextFormatAlign").default,
	TextLineMetrics: require("./text/TextLineMetrics").default,

	ui: require("./ui"),

	GameInput: require("./ui/GameInput").default,
	GameInputControl: require("./ui/GameInputControl").default,
	GameInputDevice: require("./ui/GameInputDevice").default,
	Keyboard: require("./ui/Keyboard").default,
	KeyLocation: require("./ui/KeyLocation").default,
	Mouse: require("./ui/Mouse").default,
	MouseCursor: require("./ui/MouseCursor").default,
	Multitouch: require("./ui/Multitouch").default,
	MultitouchInputMode: require("./ui/MultitouchInputMode").default,

	utils: require("./utils"),

	AGALMiniAssembler: require("./utils/AGALMiniAssembler").default,
	AssetCache: require("./utils/AssetCache").default,
	AssetLibrary: require("./utils/AssetLibrary").default,
	AssetManifest: require("./utils/AssetManifest").default,
	Assets: require("./utils/Assets").default,
	AssetType: require("./utils/AssetType").default,
	ByteArray: require("./utils/ByteArray").default,
	CompressionAlgorithm: require("./utils/CompressionAlgorithm").default,
	Dictionary: require("./utils/Dictionary").default,
	Endian: require("./utils/Endian").default,
	Future: require("./utils/Future").default,
	IAssetCache: require("./utils/IAssetCache").default,
	IDataInput: require("./utils/IDataInput").default,
	IDataOutput: require("./utils/IDataOutput").default,
	// IExternalizable: require("./utils/IExternalizable").default,
	// Object: require("./utils/Object").default,
	Timer: require("./utils/Timer").default,
	clearTimeout: require("./utils/clearTimeout").default,
	getDefinitionByName: require("./utils/getDefinitionByName").default,
	getQualifiedClassName: require("./utils/getQualifiedClassName").default,
	getQualifiedSuperclassName: require("./utils/getQualifiedSuperclassName").default,
	getTimer: require("./utils/getTimer").default,
	setTimeout: require("./utils/setTimeout").default,

	Lib: require("./Lib").default,
	Memory: require("./Memory").default,
	Vector: require("./Vector").default,

}

redpajama_set_name: RedPajamaGithub


text:
The Lucky Wonders
Email List/Contact Us
Gig History
Byron Bay based folk/indie pop four piece The Lucky Wonders have made a huge entrance onto the Australian music scene in the short time since they formed, with a trail of rave reviews left in the wake of their album Thirteen O'Clock, two singles in the semifinals of the International Songwriting Competition and mammoth touring efforts. Songwriters Emma Royle and WAMI Award winner
Jessie Vintila first came together to create live music for puppet show Puppets Break Out, playing an 11 show season in the 2009 Adelaide Fringe Festival. The collaboration was such a success they were inspired to pursue it head-on, and formed the core of
The Lucky Wonders.
Within a few months the duo had enlisted the help of ARIA nominee Anthony Lycenko (Pete Murray, Xavier Rudd, The Beautiful Girls), Ben Franz (The Waifs, Tim Rogers) on bass and lap steel, and Dave Sanders (Rodriguez) on drums. Co-producing with Lycenko at Byron Bay's Rocking Horse and 301, they created the twelve tracks compiling Thirteen O'Clock, which was to meet overwhelming critical acclaim.
"Top 10 albums and best gig of the year" - Sue Barrett - Rhythms
"…a stunning debut album with tracks ranging right across the broad roots genre.…a winning package. FOUR STARS" BMA
"…uplifting and life affirming…" andpluckyourstrings
"…relaxing and warm…" Scene Magazine
"…outstanding…a breath of fresh air. FOUR STARS" Hobart Mercury
"a stunning album which takes music back to its roots" Sound Of Oz
In October 2009 they formed a four piece band, with Jessie on lead vocals, guitar and ukulele, Emma on guitar, ukulele and backing vocals, Anastassijah Scales on drums, and currently Sam Parker on bass.
Happy Pill, the first single released from Thirteen O'Clock in November 2009, received Triple J airplay and hit No. 1 on Unearthed Roots. Catchy, powerful and haunting, Happy Pill stayed in the Unearthed Top 25 for an impressive seven weeks.
When The Lucky Wonders independently released Thirteen O'Clock in March 2010 and embarked on a mammoth forty date Australian tour, the praise began to roll in. So too did the airplay, with rotation on Radio National, regional ABCs, community, country and commercial radio. ABC North Coast featured The Lucky Wonders as Artist of the Week. They were interviewed in countless publications, including full page features in Rhythms, LOTL, Cherrie and street press Australia wide. They signed a distribution deal with Vitamin Records, who successfully pitched the album to JB Hifi Stores around Australia.
The band found a warm reception for their beautifully crafted songs and warm, quirky, irreverent banter all over Australia, venturing to far flung reaches of WA and the Top End. They opened for Pete Murray, Paul Greene, Sal Kimber and The Rollin Wheel, and Skipping Girl Vinegar, and played some premier venues around the country such as The Vanguard, NotesLive, Lizottes, Heritage Hotel, The Soundlounge, The Powerhouse, The Troubadour, and Settlers in WA, and a sell-out show at Darwin's famous Railway Club.
On arriving home to Byron Bay, The Lucky Wonders returned to the studio to record follow up singles Anyway, inspired by Emma's leap of faith in selling her flat to fund The Lucky Wonders, and Thing About Leaving, a country-esque sigh of homecoming contentment. They released the tracks as a double A-side, welcomed by fans and critics alike. "We were blown away by The Lucky Wonders' last full-length release…and now they're following it up with this…both superb cuts" Babysue.
I'll Be Fine, a poppy, driving love longing song released in September 2011, was met with Triple J airplay, a place in the semi-finals of the International Songwriting Competition (along with Anyway), and again found The Lucky Wonders topping Unearthed Roots. The accompanying national tour saw The Luckies fanbase growing all over Australia. After successfully crowdfunding $20000 to make a second album, The Luckies are heading into the studio with engineer/co-producer Govinda Doyle (Angus and Julia Stone) for what is expected to be a very well-received follow-up to Thirteen O'Clock.

redpajama_set_name: RedPajamaCommonCrawl


text:
Namaste » sastra » Upanishads
The Upanishads are the end part of the Vedas which briefly expound the philosophic principles of the Vedas and are considered the essence of the Vedas. The philosophy of the Upanishads is sublime, profound, lofty and soul-stirring. The Upanishads speak of the identity of the atman (individual soul) and brahman (the Supreme Soul). They reveal the most subtle and deep spiritual truths.
Origin Of the Upanishads
108 Principal Upanishads
Significance and Ideal
There is no book in the whole world that is so thrilling, soul-stirring and inspiring as the Upanishad. The philosophy taught by the Upanishads has been the source of solace for many, both in the East and the West. The human intellect has not been able to conceive of anything more noble and sublime in the history of the world than the teachings of the Upanishads.
The Upanishads contain the essence of the Vedas. They are the concluding portions of the Vedas and are the source of the Vedanta philosophy. Profound, original, lofty and sublime thoughts arise from every verse. They contain the direct spiritual experiences or revelations of seers, or sages, the rishi. They are the products of the highest wisdom, supreme divine knowledge. Hence they stir the hearts of people and inspire them.
The glory or grandeur of the Upanishads cannot be adequately described in words, because words are finite and language is imperfect. The Upanishads have indeed greatly contributed to the peace and solace of mankind. They are highly elevating and soul-stirring. Millions of aspirants have drawn inspiration and guidance from the Upanishads. They are the cream of the Vedas. They are treasures of incalculable value. They are rich in profound philosophical thought. Their intrinsic value is very great. There is immense depth of meaning in the passages and verses. The language is beautiful.
The Upanishads give a vivid description of the nature of the Atman, the Supreme Soul, in a variety of ways, and expound suitable methods and aids to attain the Immortal Brahman, the Highest Purusha.
Ages have passed since they were first presented to the world. Even now they are remarkably sweet and charming. Their freshness is unique. Their fragrance is penetrating. Many cannot live today without the study of Upanishads daily. They give supreme food for the soul.
It is said that Schopenhauer, the renowned philosopher of the West, had always a book of the Upanishads on his table, and was in the habit, before going to bed, of performing his devotions from its pages. He said,
The Upanishads have undoubtedly exercised and will continue to exercise a considerable influence on the religion and philosophy of India. They present a view of reality which would certainly satisfy the scientific, the philosophic, as well as the religious aspirations of man.
The Upanishads are metaphysical treatises which are replete with sublime conceptions of Vedanta and with intuitions of universal truths. The Indian Rishis and seers of yore endeavoured to grasp the fundamental truths of being. They tried to solve the problems of the origin, the nature and the destiny of man and of the universe. They attempted to grasp the meaning and value of knowing and being. They endeavoured to find a solution for the problems of the means of life and the world and of the relation of the individual to the 'Unseen,' or the Supreme Soul. They sought earnestly satisfactory solution of these profound questions: Who am I? What is this universe or Samsara? Whence are we born? On what do we rest? Where do we go? Is there any such thing as immortality, freedom, perfection, eternal bliss, everlasting peace, Atman, Brahman, or the Self, Supreme Soul, which is birthless, deathless, changeless, self-existent? How to attain Brahman or Immortality?
They practised right living, Tapas, introspection, self-analysis, enquiry and meditation on the pure, inner Self and attained Self-Realization. Their intuitions of deep truths are subtle and direct. Their inner experiences, which are direct, first-hand, intuitive and mystical, which no science can impeach, which all philosophies declare as the ultimate goal of their endeavours, are embodied in the sublime books called the Upanishads.
The Upanishads are the knowledge portion, or Jnana-Kanda, of the Vedas. They are eternal. They came out of the mouth of Hiranyagarbha, or Brahman. They existed even before the creation of this world.
The Upanishads are a source of deep mystic divine knowledge which serves as the means of freedom from this formidable Samsara, earthly bondage. They are world-scriptures. They appeal to the lovers of religion and truth in all races, and at all times. They contain profound secrets of Vedanta, or Jnana-Yoga, and practical hints and clues which throw much light on the pathway of Self-Realization.
There are four Vedas., Rigveda, Yajurveda, Samaveda and atharvaveda. There are as many Upanishads to each Veda as there are Sakhas or branches (subdivisions). there are 21, 109, 1000, and 50 subdivisions to Rig, Yajur, Sama, and Atharva Vedas respectively. Thus there are one thousand and hundred and eighty (1,180) Upanishads.
There are total 108 Upanishads according to the Muktika Upanishad. Of these, the following 12 are considered the principle Upanishads. They are:
Isha Upanishad
Taitiriya Upanishad
Aitareya Upanishad
Prashna Upanishad
Mundaka Upanishad
Mandukya Upanishad
Chandogya Upanishad
Brihad-aranyaka Upanishad
Maha-Narayana Upanishad
Another 8, called minor Upanishads, are:
Kaivalya Upanishad
Kaushitaki Upanishad
Atma Upanishad
Amritabindu Upanishad
Brahma Upanishad
Paramahamsa Upanishad
Sarva Upanishad
Aruni (Aruneyi) Upanishad
Knowledge of the Upanishads destroys ignorance, the seed of Samsara. 'Shad' means to 'shatter' or 'destroy'. By having knowledge of the Upanishads one is able to sit near Brahman, i.e., to attain Self-realisation. Hence the name 'Upanishad'. Knowledge of Brahman is called 'Upanishad', because it leads to Brahman and helps aspirants to attain Brahman. The term 'Upanishad' is applied to the book also in a secondary sense, by courtesy.
The following two ideas dominate the teaching of all the Upanishads:
(1) Final emancipation can be attained only by knowledge of the Ultimate Reality, or Brahman (Brahmajnana):
(2) He who is equipped with the four means of salvation, viz., Viveka, (discrimination), Vairagya (dispassion), Shad-Sampat (the six-fold treasure; self-control, etc.) and Mumukshutva (yearning for liberation), can attain Brahman.
The Upanishads teach the philosophy of absolute unity.
The goal of men, according to the Upanishads, is realisation of Brahman. Self-Realization alone can dispel ignorance and bestow immortality, eternal bliss, and everlasting peace. Knowledge of Brahman alone can remove all sorrows, delusion and pain.
The Upanishads are rightly called the Vedanta, the end of the Vedas, that which is reserved for those who have freed themselves from the bonds of formal religion.
The Upanishads are not meant for the masses, as they contain the highest speculations of philosophy. They are meant only for the select few, who are fit and worthy to receive the instructions. Hence the term 'Upanishad' signified at first 'secret teaching' or 'secret doctrine'. As already stated, Sadhana-Chatushtaya (the fourfold means) is the primary qualification of an aspirant of Jnana-Yoga, or one who seeks the knowledge of the Upanishads.
Study the Upanishads systematically. Acquire the four means of liberation. Meditate on the non-dual Atman or Brahman and attain ever-lasting Bliss!
1. The Upanishads, By Sri Swami Sivananda, The Divine Life Society
Ādi Śaṅkaracharya
Advaita Vedānta
anandamaya kosha
Bhagavad Gītā
Brahma Sutra
Common Misconceptions about Hinduism
darśanas
Dharma Rajya
Hinduism at a Glance
jñåna
kosha
Madhvacharya
mãyã
Mīmāṃsā
Rewriting Indian History
Rewriting Indian History -- Part1
saṃskṛtam
Sanskrit Language
Schools of Saiva
Shri Adi Shankaracharya
Vedānta
Vivekacūḍāmaṇi
Yamas and Niyamas
Yoga Sutra of Patanjali
108 Upanishads
Amritabindhu Upanishad
Isha Upanishad Translation by Eknath Easwaran
Isha Upanishad Translation by Zaehner
Katha Upanishad Translation by Eknath Easwaran
Kena Upanishad Translation by Eknath Easwaran
Kena Upanishad Translation by Sri Aurobindo
Kena Upanishad Translation by Vidya
Kena Upanishad Translation by Zaehner
Mundaka Upanishad Translated by Eknath Easwaran
Tejabindu Upanishad
scripturessrutiupanishad


Slips, trips and falls are a top cause of workplace injury year after year. Within this category, falls from heights are by far the most severe; the cost per claim is more than three times that of falls on the same level and other slips and trips.
The Bureau of Labor Statistics recently reported that fatal falls have reached a 26-year high. Here's what you need to know about the severity of falls from heights and how to prevent them in your workplace.
Late last year, Missouri Employers Mutual received a claim involving a construction worker who stepped off the edge of a roof while installing sheet decking. He tumbled nearly 20 feet to the concrete below. The worker suffered very serious injuries that included eight fractured ribs, vertebral fractures, pelvic fracture and a closed head injury. He was taken by ambulance to a regional medical center where he was placed in the ICU. Because of the injury, he will suffer a significant disability.
The estimated cost of this claim is more than $558,000. It caused the policyholder's e-mod to jump from below 1.0 to 1.57, and could result in a premium increase of up to 67 percent. In this case, the policyholder had a fall protection policy in place requiring employees to wear safety harnesses and tie off when working at elevations. However, the worker who fell was not wearing a safety harness or tied off. This shows a breakdown in enforcement of the existing policy. The injury occurred on a Sunday, so the worker may have been working without supervision.
The first step is to document when and how employees are required to use fall protection equipment. Be detailed and thorough; include expectations for uncommon situations as well as day-to-day operations.
If your policies and training materials are collecting dust on a shelf, they aren't doing anything to help you keep your employees safe. You must communicate the policy often. Make sure every employee has read the policy, understood it and signed off. Don't forget to include policies in your new employee orientation.
From tying off to climbing a ladder, showing employees how to properly use equipment can go a long way in preventing falls. For example, have your employees try on harnesses, show them how to check for fit and how to properly attach them. Illustrate what it looks like to maintain three points of contact when using a ladder. You should also regularly inspect equipment and replace damaged gear immediately.
One MEM policyholder purchased new equipment with a safety grant, only to discover that the equipment's out-of-the-way location was a barrier to regular use. If they hadn't taken the time to investigate, the equipment's efficacy would have continued to fail expectations.
Learn more about how to make sure your documentation is effectively protecting you and your employees in this episode of the WorkSAFE Podcast.


Bump firing is a well-established capability that uses the recoil of a semi-automatic firearm to fire multiple shots in rapid succession. The patented Slide Fire® rifle stock allows shooters to safely and accurately bump fire their rifles without compromising safety and accuracy.
The Slide Fire® stock makes it easier to safely and accurately bump for your rifle. The Slide Fire® stock is fun, exciting and entertaining. As always, practice safe firearm procedures when using any firearm.
With the rifle in a safe position and proper aim on the target, pull the stock into your shoulder and grip the pistol grip as normal. Make sure you are in a stable stance in preparation for the recoil of the rifle.
The Lock Switch location will vary depending on model, so refer to your stock's instructions. Rotate the switch to the unlocked position to enable rapid fire. Returning the stock to the locked position will restore standard fire.
For ambidextrous models, ensure that the Finger Rest is on the opposite side of the rifle from your shooting hand. Place your trigger finger across the trigger, and seat the tip firmly on the rest.
Use your support hand to apply a light forward pressure to the rifle. This will force the trigger into your finger causing a round to be fired.
Recoil from the discharged round will cycle the action and return the firearm back to the rear position. Maintaining a light and consistent forward pressure will continue the firing sequence.
Make sure you keep your forward pressure as light and consistent as possible. Applying too much force will push out the recoil needed to operate the rifle causing a stoppage.


New Graduate Nurse Resume 25 Ideas Sample New Grad Nursing Resume Pics Student Nurse Resume Skills Uploaded by on Thursday, January 3rd, 2019 in category fake resume generator.
See also New Graduate Nurse Resume Nurse Resumes Samples Nursing Resume Samples For New Graduates New Grad Nurse Resume Sample Profile Experience Fresh Graduate Nurse Resume Sample from fake resume generator Topic.
Here we have another image New Graduate Nurse Resume New Graduate Nurse Residency Programs Best Of Graduate Nurse Resume Unique 37 Inspirational Nursing Resume Summary Graduate Nurse Resume Examples Australia featured under New Graduate Nurse Resume 25 Ideas Sample New Grad Nursing Resume Pics Student Nurse Resume Skills. We hope you enjoyed it and if you want to download the pictures in high quality, simply right click the image and choose "Save As". Thanks for reading New Graduate Nurse Resume 25 Ideas Sample New Grad Nursing Resume Pics Student Nurse Resume Skills.


Like a good obedient BO disciple I switched from using BO 6.5's "full client" (now called Desktop Intelligence) to using BOXI's Web Intelligence tool (also called WebI). To Business Objects' credit, they have put much of Desktop Intelligence's functionality in to WebI. But there is one disorienting difference.
My recollection tells me that if I exported a BO 6.5 Full client report to CSV that I received a CSV file with the same content that I would get through a Microsoft Excel export. Sure formatting, such as colors, column width, font, etc. were lost, but the order of the columns and even the report level variables in the table were exported to CSV from full client. Maybe, I a wrong about this (please point this out if I am), but that is the way I and some colleagues remember it.
BOXI Web Intelligence (and perhaps BO 6.x Web Intelligence) also has the ability to export to a CSV file, but this export behaves very differently. This export behaves much like the BO 6.x "View Data" or the "Data Cube" functionality. The BOXI WebI CSV export is a dump of the exact results of the first query of the report just as they were received from the database.
When you export a WebI report to CSV you may not get what you expect. The results should be identical to those you would get if you took the query and ran it directly against the database. This may be disappointing to some because it does not include any report-level aggregation, calculations, sorting, breaks, character formatting, or column ordering. HOWEVER, if a report developer is debugging a query or a universe object this output can be invaluable. For example, it can quickly uncover issues (such as Cartesian products) that dimensions can hide in a table. There are many uses for this output.
Why Does WebI's CSV Have This Limitation?
I don't claim to have inside information, but I can guess at two reasons for this limitation.
Report Development Debugging: I know I already mentioned this, but I really want people to use the CSV export to understand more about their query and report. This previously perceived limit is actually advantageous functionality in the right hands.
Discouraging ETL Use of Business Objects: If CSV were to output the aggregation and calculated columns of a report it would be readily used by end users as an ETL tool (Extract, Transform, Load). Some users still use it this way, but large scale use would explode if CSV exports were more than query dumps.
What Can I Do If I Want a CSV Export of My WebI Report Table's Data?
There is almost always a workaround. If you must have your table's data in CSV format then the solution is simple: export to Excel, open Excel output, save to CSV. You're welcome!
For some of our users, saving as Excel is not actually an option. As we are still on Excel 2003, they run smack up against the 65K row limit. Under 6.5, they were able to use the Full Client to function as a poor man's ETL system to populate local databases. Trying to do the same in WebI has exposed a host of difficulties. While I know this is not how WebI is *intended* to be used, is it really that unusual a case that it is not accounted for?
Why can we not schedule reports to a CSV or other text format?
By the way, even if every one of your users had Excel 2007 you would still be limited to 65K rows on Excel output. Last I talked with BO Engineers on this, the Excel file generator is custom code developed by BO and it is not impacted by what version you may install on the server or on the client. Also, they indicated that leaving this limit at 65K might be an intentional anti-ETL choice that BO makes.
some of our users are suffering with this problem.
they are used to exporting to access and now they have a 2 stage process which they claim is time consuming.
According to various Business Objects engineers this is by design and there is no way to do it.
HOWEVER, if you can build your aggregation and formulas into your SQL (or the SQL of your report's objects) then you may be able to make the actual query result useful in its native form and therefore the CSV export from WebI would be just right for their needs. BTW, building this into your SQL can often be a best practice that will improve accuracy and performance for your users.
Please comment back with your thoughts.
Not sure what could we do? Any ray of light?
Remember that Excel output is WYSIWYG. Therefore, it contains all of the aggregation of your report. Therefore, if your report is aggregating a lot of data then it is entirely reasonable that the CSV export could exceed your binary file size limit. For example, what if you pull back 500,000 rows of micro transactions for 5 different products, but in your report you aggregate all of those 500K rows to 5 lines of data. Then of course your Excel output file will be very small, but your CSV file would be HUGE. You need to take a look at how many records are being returned by your report's query/queries.
Please update let us know if this tip helps. Good luck.
Also, I have downloaded the data of 160000 rows in the excel sheet, it had downloaded automatically in multiple sheets in excel. My Version is 2003 and Webi 3.1 version.
Interesting observation Suresh. It would appear that maybe in XI 3.1 Business Objects has found a workaround to the limit and has started splitting the output across multiple sheets.
Since the Excel file is created by the server I am curious to know if it is creating an Excel 2007 *.xlsx file and perhaps your Excel 2003 version is splitting those 160,000 rows across multiple sheets. Can you please comment on this? Thanks!
I am running Webi 3.1 and I set the "Binary Stream Maximum Size (MB):" parameter for the webi server to 1000 and then ran a report that gives over 500.000 records.
An export to Excel gave me 8 sheets in 1 workbook (Eace sheet with 65k rows or export to csv and then into Excel2007 gave me one sheet with 500.000 lines.
Svavark thank you for confirming that. Very interesting. I had not noticed this. I like the workaround. I suppose it is implemented this way to be backward compatible with Excel 2003 as well. Not bad. Now if it just had two options, "Export to Excel 2003 or lower" and "Export to Excel 2007" then we would all be even happier. I will write a short article about this to give it more visibility. Thanks Suresh and Svavark!
2) Now Read the Excel file and capture each (Section ) details and create a new Excel file with the data of this Section alone.
Is there any way to convert a BO webi document to Excel report via .net application and prompt the excel to the user?
Please provide more details. I found at least two very different meanings to this question. Do you want to prompt the user to save to Excel? Do you want the user to be able to open an Excel document and then refresh the data in the spreadsheet when prompted with something like "Would you like to refresh the data"? Both are possible. 1st one would involve SDK or at least a modification to InfoView. The 2nd one would use LiveOffice (easier) or just stick some VBA/SDK code in an Excel report (harder but cheaper).
In saving report to .CSV format using BO 6.5, how is it actually done?
Is it restricted with access rights? I am trying to save a BO 6.5 to .CSV, but I can't seem to see an option for that.
Click on the data cube and there you will find an export option. This will export the data exactly as it came from the database without any report formatting or aggregation.
Please confirm that this is valid memory. Thanks!
I have another concern though.
Because with BOXI, InfoView, when you save the reports in .CSV format, all the queries behind the report are retrieved.
How would you limit the output to only a particular query that you would want to see the result?
Like in BO 6.5, if you only need results from Query 1, you could export that query only to excel, how could we do that in BOXI InfoView?
As far as I know this is not possible. If this were a very important requirement then you might build some kind of macro for processing the output as you want it to be, or you could even have prompts created that would be used to turn off the output of the other queries (making them return no rows) and turn on only the query you want to retrieve. Crazy ideas, but I have seen it all and the business requirements that drive 'em.
I've came across this page here when doing a search on how to export WebI 3.0 into csv or txt format.
In fact, is there such a way to export to txt format directly from the WebI reports without having to go through Excel?
Yes, in XIR2 and BO XI 3.1 (I just confirmed both) just open the report in the regular HTML viewer (not the Java Report Panel for editing). With the report open go to Document > Save to my computer as > CSV. You may also select "CSV (with options)" in order to select the text qualifier, column delimiter, or character set.
Thanks a lot for the input, Julian.
I'm very very new in BO and thus, I need a lot of guidance as I find that BO resources are quite limited. Thank goodness we have a blog like this which I think is quite resourceful.
Now, if I were to schedule my WebI report to CSV format, are we able to do so? I only found WebI, Excel and PDF under the Output Format when I go to Schedule>Output Format and Destination.
Thanks for the feedback! Unfortunately, it is impossible to schedule to CSV from WebI. This is by design, according to my various conversations with BO engineers. This prevents people from using WebI reports for ETL (Extract, Transform, Load) purposes and encourages them to keep using it for business intelligence reporting only.
scheduling the report in csv format is added in 3.1 sp2 release.
I see that we can schedule a webi doc to csv format in XI3.1 SP2 via InfoView or the CMC. I would like to do the same using the SDK. But in the SDK code we dont see the option for csv. We are using boesdk_java_apiRef_12_en.zip. Is this the latest version of the Java SDK?
I think that you are correct, you have the latest Java SDK API Reference; however, the "12" stands for BO XI 3.X and therefore, it has most likely not been updated with the patch releases. Since the CMC uses the SDK I highly suspect that the API for scheduling with CSV delivery is possible. Good luck finding the documentation though.
If you have SAP-BO Support maintenance, you could open a Customer Message (a.k.a. case) with them and demand that they provide this information. However, I tried to do this for Query Builder once and I was shot down, which led me to search out everything I could get my hands on and write and publish my own documentation.
This string is very interesting…I am an IT neophyte, so take pity on my question…Can anyone recommend a text book or books that will cover this scenario?
I would like to schedule an automatic refresh of 4 separate queries in Desktop Intelligence 11.5.0.0 every night where the query date ranges represent a 120 day rolling period and import the results into an Access database to replace 4 corresponding tables.
I can't think of a single book that would tell you exactly how to do that. I think I know how. I have done plenty of rolling data range reports (using universe-level conditions based on the system date). As for loading to a DB, you would need to probably deliver Excel or CSV output (XI 3.1 SP2) to a file share and have some batch process pick it up and load it to your database.
Sorry Satya, the component which produces the Excel output has nothing to do with anything installed on your computer, it is a DLL/class which BO has created. Until they alter it, you will not see this limit exceeded.
I can tell you that in BO XI 3.1 they now force output of over 65K rows onto additional sheets in the Excel workbook, but in order to retain compatibility with all versions of Excel and OpenOffice Calc each sheet is limited to 65K rows. I don't know if XI 3.0 includes this.
Hi Maurie, are you using Desktop Intelligence or Web Intelligence? Either way, I don't recall ever seeing blank rows in my CSV exports, but then again, I never really have used the CSV export functionality very much.
I am using the BO XI R2, I have a doubt here can I open the reports developed in Deskii in my Webii? If yes please explain the process or is there any third party tool to do the same.
Hi Sudhir, to be precise, WebI cannot open DeskI reports. However, InfoView has an HTML viewer for DeskI reports that displays them in a web browser. You cannot edit the report, but you can view it. This of course, will not run any macros. There is also a report conversion tool that will convert DeskI reports to WebI, it is pretty good, but not perfect.
Thanks a lot. I have a another doubt I have to merger my webii report with an external data source(csv file) through webii. can i do the same? if not then through deskii can i do it?
Hi Sudhir, I don't think you can do that with WebI (unless you can get Designer attached to it). I have not gotten creative enough with DeskI to be able to answer for DeskI. Sorry.
Sorry Tiffany, there is no way to exceed the 65K Excel export limit. There is a CSV export option in my XI R2 system, but it is a raw data dump and includes no report level formatting, aggregation, etc.
We are using 2.0 and my main user runs a WEBI report that exceeds 65K records and wants to play with the output in Excel 2007. Obviously the 65K limit prevents the use of the Save as Excel. When she runs and saves a CSV on her desktop the output gets cut off at 18000 records, the same happens if I save the output directly on the server where the software is installed but when I run it locally and save as CSV I get all 77K records. Any idea what is causing this 18K issue?
Hi Martin, I am not aware of any CSV export row limit, but I have seen this kind of strangeness on Excel once. After we installed a FP it went away, and it also went away when we increased that user's access or ran the same export as Administrator. The only other thing that could impact such an export is the binary files size limit set on the WebI server, but I think if this triggers it just raises and error (not truncates the data).
Actually I think I have narrowed down the problem to .Net version of Infoview.
Running the report in the Java version works fine. Normally we use Java but they use .Net for single sign on in AD. And the limit is 1.5 MB. I assume a FP corrects it but which one?
Hi Martin, I couldn't tell you which FixPack, you would have to read the "fixed issues" of each one. I can tell you that if you apply a FixPack you will need to generate new web applications from it for both your Java and .NET web application servers.
I guess I will have to dig through the fixpacks.
1)A report is running for 20 mins for the past two days. The next day the report is taking 50 mins to run. The report has no prompts. In the report side I have not made any changes. How to debug this?
Where the problem could be? why suddenly report takes more time to execute?
2)A report has 7 columns and 50 rows of data. In one row alone in the last three columns there is #Multivalue error.But the all the rest of the cells are with data. How that on one particular row for the last three columns the #Multivalue error can occur? How to approach and resolve this?
I request you to post on what is #Multivalue error and in what situations it occur and how to resolve it?
Hi Ram, Sorry for my delay, my day job has kept me very busy lately.
1) Have you tested the report's SQL directly against the database to see what the performance is. It is possible that the troubles with performance are completely database related. Changes to indexes, out-of-date table stats, and many other things can cause queries to reduce in performance.
2) The #Mulitvalue error is a most annoying error. Usually what happens is that your report is trying trying to aggregate databased on dimensions that do not completely uniquely identify a row of data. It also happens when using merged dimensions and one is using a dimension of a query and not the merged dimension. I suggest you export your data to CSV and take a close look at all records that provide data to the row throwing the error.
I hope to expound on these topics in an article soon.
I am looking for a WebI report saved to .csv to have end of line markers at the end of a record. I am finding that End of Line marker is not provided when I save WebI report to a .csv file.
Hi Brian, if you are not seeing the end-of-line markers that you need in the CSV output there is not much you can do. Of course, I suspect that you are trying to use a BO report to perform ETL actions and this is usually a business intelligence "no-no". The only thing I can think of is to have some kind of macro or small application that could put the markers there for you. You also, might try reporting this to BO to see if they might classify it as a bug or future enhancement (neither will result in a prompt solution for you though). I'd love to hear anyone else's ideas on this.
I need to save a WebI query into a .csv file without any text delimiter. WebI obliges me to choose text delimiters. Is there a way to do this? I'm using BO XI R2.
Save as CSV does actually save a dump of all your queries, not just the first query. It displays them one after the other so if you scroll down, you will see the results from the other queries.
« What is an Unbound Report and Why Should I Care?


We know, we know. How many variations on a reusable bag can you possibly have?
TazzyTotes Produce Bags actually fill a legit gap in the annals of environmentally enlightened shopping. Most eco-geeks will bring their own sack to the grocery store, then seal fruit, vegetables, and other bulk food in separate plastic bags — not terribly green.
TazzyTotes Produce Bags are basically plastic bags without the plastic. Designed by the Vancouver studio JDi Design, Inc., they come in a see-through polyester mesh fabric, so your cashier doesn't have to go digging in your sack to figure out what kind of oranges you're buying. As backup, erasable labels and a recyclable pen make it easy to jot down PLU codes and weights.
They're good-looking, too — none of the usual hippied-out cotton or nylon reminiscent of a bad '80s windbreaker. The produce bags won bronze in last month's International Design Excellence Awards. They're part of JDi Design's larger tazzyTotes line, which includes pretty much anything you've ever wanted to sling over your shoulder: shopping-cart bags, market totes, expandable bags, bottle bags — all easy on the environment. Bid farewell to plastic bags forever.


text:
Q: How to download source code from google app engine standard (appcfg.py is deprecated) How to download source code from google app engine standard when the appcfg.py is deprecated by the google.

A: The gcloud SDK doesn't (yet) have an equivalent capability. From Migrating to Cloud SDK:

As a result of the deprecation of the appcfg tool and the standalone
  App Engine SDK, the following features are currently not supported in
  Cloud SDK:

*

*Downloads of your application's source code with AppCfg.

However, despite being deprecated, the GAE SDK remains so far functional, so you can still use its appcfg.py download capability, at least until its announced shutdown date - July 30, 2020 (see also Feature Deprecations). Hopefully by that time there will be an equivalent gcloud functionality.
Separately from straight downloading the app code it may be possible (but more tedious) to view the files and restore them them by copy-pasting their content, see Google Cloud DataStore automatic indexing.

redpajama_set_name: RedPajamaStackExchange


text:
'Healing the Nations' is the work of Christian denominations pulling together
Ecumenical leaders who are gathered in Louisville through Saturday are exploring how God continues to call the church to be a faithful witness, even during the current troubled times.
PC(USA) asks U.S. Supreme Court to take up defamation case appeal
The Presbyterian Church (U.S.A.) is asking the U.S. Supreme Court to take up its appeal of a defamation case filed by a former employee of the Presbyterian Mission Agency.
The real-time shift
The Presbyterian Church (U.S.A.)'s Research Services department is embracing the need for real-time data to be gathered and reported, informing the policies and initiatives facing the church in these ever-changing times.
A prayer for Mother's Day
A few years ago, the Rev. Dr. Diane Moffett, president and executive director of the Presbyterian Mission Agency, wrote this prayer for Mother's Day worship:
Funding sources identified for Stony Point Center work
The sources to pay for the nearly $631,000 in deferred maintenance that a consultant says is needed at the Stony Point Center north of New York City have been identified.
6 tips to help you become a website power user
If you sometimes have trouble finding what you're looking for on the Presbyterian Mission Agency website (www. presbyterianmission.org), relax. Here are six quick tips to get you where you want to go, quickly and easily.
Inquiring minds want to know
How do you feel about the communications you receive from the Presbyterian Church (U.S.A.)? Do you struggle to find what you're looking for on pcusa.org? Do you share information you receive with friends and colleagues on social media? Do you get too many e-newsletters or maybe none at all?
Battling our 'insidious search for domination, power and authority'
Posted April 25th, 2019
Caring for God's creation — especially for our fellow human beings — requires constant attention and daily effort, the Rev. Denise Anderson said during the Chapel Service Wednesday at the Presbyterian Center in Louisville, Ky.
In for a penny, in for a pound
On the recommendation of a consultant hired to identify immediate needs at Stony Point Center north of New York City, the Presbyterian Mission Agency Board voted Wednesday to spend $630,750 in unrestricted bequests on projects including roof repairs, a sewer line replacement and a commercial-grade electric mower.
When Mother's Day Hurts
The closest the Rev. Bethany Peerbolte has come to heartache associated with Mother's Day was a couple years ago, when her parents moved from Michigan to North Carolina. "I'm like, 'If that was hard for me, I can't imagine what the people in my church are going through when they've lost a mother or haven't had a mother figure who's really been kind and loving to them, like a mother should be.'"


text:
Во́льва (, буквально — «обгортка», пор. «вульва»), також піхва — чашоподібне утворення в основі плодового тіла гастероміцетів, являє собою залишок велума (покривала) або перидію. Грає важливу роль для ідентифікації грибів, допомагає з їх класифікацією або виявленням отруйних, наприклад, вольва часто є ознакою родини Мухоморові.

Вольва часто повністю чи частково прихована в ґрунті, тому виймати гриб для ідентифікації слід з обережністю, до фатальної помилки може призвести виривання ніжки гриба або її зрізання.

Примітки

Морфологія грибів

redpajama_set_name: RedPajamaWikipedia


text:
package bcfipsin100.cmstsp;

import java.io.IOException;
import java.security.GeneralSecurityException;
import java.security.KeyPair;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
import java.security.PrivateKey;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;

import javax.crypto.SecretKey;
import javax.crypto.spec.OAEPParameterSpec;

import bcfipsin100.base.EC;
import bcfipsin100.base.Rsa;
import bcfipsin100.base.Setup;
import bcfipsin100.cert.Cert;
import bcfipsin100.util.ExValues;
import org.bouncycastle.asn1.ASN1EncodableVector;
import org.bouncycastle.asn1.ASN1ObjectIdentifier;
import org.bouncycastle.asn1.ASN1Primitive;
import org.bouncycastle.asn1.DERSet;
import org.bouncycastle.asn1.cms.Attribute;
import org.bouncycastle.asn1.cms.AttributeTable;
import org.bouncycastle.asn1.cms.ContentInfo;
import org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers;
import org.bouncycastle.cert.X509CertificateHolder;
import org.bouncycastle.cert.jcajce.JcaCertStore;
import org.bouncycastle.cert.jcajce.JcaX509CertificateHolder;
import org.bouncycastle.cms.CMSAlgorithm;
import org.bouncycastle.cms.CMSAuthenticatedData;
import org.bouncycastle.cms.CMSAuthenticatedDataGenerator;
import org.bouncycastle.cms.CMSEnvelopedData;
import org.bouncycastle.cms.CMSEnvelopedDataGenerator;
import org.bouncycastle.cms.CMSException;
import org.bouncycastle.cms.CMSProcessableByteArray;
import org.bouncycastle.cms.CMSSignedData;
import org.bouncycastle.cms.CMSSignedDataGenerator;
import org.bouncycastle.cms.CMSTypedData;
import org.bouncycastle.cms.KEKRecipientId;
import org.bouncycastle.cms.KeyAgreeRecipientId;
import org.bouncycastle.cms.OriginatorInfoGenerator;
import org.bouncycastle.cms.PasswordRecipient;
import org.bouncycastle.cms.PasswordRecipientId;
import org.bouncycastle.cms.RecipientId;
import org.bouncycastle.cms.RecipientInformation;
import org.bouncycastle.cms.RecipientInformationStore;
import org.bouncycastle.cms.SignerInformation;
import org.bouncycastle.cms.SignerInformationStore;
import org.bouncycastle.cms.jcajce.JcaSignerInfoGeneratorBuilder;
import org.bouncycastle.cms.jcajce.JcaSimpleSignerInfoVerifierBuilder;
import org.bouncycastle.cms.jcajce.JceCMSContentEncryptorBuilder;
import org.bouncycastle.cms.jcajce.JceCMSMacCalculatorBuilder;
import org.bouncycastle.cms.jcajce.JceKEKEnvelopedRecipient;
import org.bouncycastle.cms.jcajce.JceKEKRecipientInfoGenerator;
import org.bouncycastle.cms.jcajce.JceKeyAgreeEnvelopedRecipient;
import org.bouncycastle.cms.jcajce.JceKeyAgreeRecipientId;
import org.bouncycastle.cms.jcajce.JceKeyAgreeRecipientInfoGenerator;
import org.bouncycastle.cms.jcajce.JceKeyTransAuthenticatedRecipient;
import org.bouncycastle.cms.jcajce.JceKeyTransEnvelopedRecipient;
import org.bouncycastle.cms.jcajce.JceKeyTransRecipientId;
import org.bouncycastle.cms.jcajce.JceKeyTransRecipientInfoGenerator;
import org.bouncycastle.cms.jcajce.JcePasswordEnvelopedRecipient;
import org.bouncycastle.cms.jcajce.JcePasswordRecipientInfoGenerator;
import org.bouncycastle.operator.ContentSigner;
import org.bouncycastle.operator.DigestCalculatorProvider;
import org.bouncycastle.operator.OperatorCreationException;
import org.bouncycastle.operator.jcajce.JcaAlgorithmParametersConverter;
import org.bouncycastle.operator.jcajce.JcaContentSignerBuilder;
import org.bouncycastle.operator.jcajce.JcaDigestCalculatorProviderBuilder;
import org.bouncycastle.tsp.TSPException;
import org.bouncycastle.tsp.TimeStampResponse;
import org.bouncycastle.tsp.TimeStampToken;
import org.bouncycastle.util.Arrays;
import org.bouncycastle.util.Store;
import org.bouncycastle.util.encoders.Hex;

public class Cms
{
    public static byte[] createSignedObject(PrivateKey signingKey, X509Certificate signingCert, byte[] data)
        throws GeneralSecurityException, OperatorCreationException, CMSException, IOException
    {
        List<X509Certificate> certList = new ArrayList<X509Certificate>();
        CMSTypedData msg = new CMSProcessableByteArray(data);

        certList.add(signingCert);

        Store certs = new JcaCertStore(certList);

        DigestCalculatorProvider digProvider = new JcaDigestCalculatorProviderBuilder().setProvider("BCFIPS").build();
        JcaSignerInfoGeneratorBuilder signerInfoGeneratorBuilder = new JcaSignerInfoGeneratorBuilder(digProvider);

        ContentSigner signer = new JcaContentSignerBuilder("SHA384withECDSA").setProvider("BCFIPS").build(signingKey);

        CMSSignedDataGenerator gen = new CMSSignedDataGenerator();

        gen.addSignerInfoGenerator(signerInfoGeneratorBuilder.build(signer, signingCert));

        gen.addCertificates(certs);

        return gen.generate(msg, true).getEncoded();
    }

    public static boolean verifySignedObject(byte[] cmsSignedData)
        throws GeneralSecurityException, OperatorCreationException, CMSException
    {
        CMSSignedData          signedData = new CMSSignedData(cmsSignedData);
        Store                  certStore = signedData.getCertificates();
        SignerInformationStore signers = signedData.getSignerInfos();

        Collection c = signers.getSigners();
        Iterator it = c.iterator();

        while (it.hasNext())
        {
            SignerInformation signer = (SignerInformation)it.next();
            Collection          certCollection = certStore.getMatches(signer.getSID());

            Iterator        certIt = certCollection.iterator();
            X509CertificateHolder cert = (X509CertificateHolder)certIt.next();

            if (!signer.verify(new JcaSimpleSignerInfoVerifierBuilder().setProvider("BCFIPS").build(cert)))
            {
                return false;
            }
        }

        return true;
    }

    public static byte[] createDetachedSignature(PrivateKey signingKey, X509Certificate signingCert, byte[] data)
        throws GeneralSecurityException, OperatorCreationException, CMSException, IOException
    {
        List<X509Certificate> certList = new ArrayList<X509Certificate>();
        CMSTypedData msg = new CMSProcessableByteArray(data);

        certList.add(signingCert);

        Store certs = new JcaCertStore(certList);

        DigestCalculatorProvider digProvider = new JcaDigestCalculatorProviderBuilder().setProvider("BCFIPS").build();
        JcaSignerInfoGeneratorBuilder signerInfoGeneratorBuilder = new JcaSignerInfoGeneratorBuilder(digProvider);

        ContentSigner signer = new JcaContentSignerBuilder("SHA384withECDSA").setProvider("BCFIPS").build(signingKey);

        CMSSignedDataGenerator gen = new CMSSignedDataGenerator();

        gen.addSignerInfoGenerator(signerInfoGeneratorBuilder.build(signer, signingCert));

        gen.addCertificates(certs);

        return gen.generate(msg).getEncoded();
    }

    public static boolean verifyDetachedData(byte[] cmsSignedData, byte[] data)
        throws GeneralSecurityException, OperatorCreationException, CMSException
    {
        CMSSignedData          signedData = new CMSSignedData(new CMSProcessableByteArray(data), cmsSignedData);
        Store                  certStore = signedData.getCertificates();
        SignerInformationStore signers = signedData.getSignerInfos();

        Collection c = signers.getSigners();
        Iterator it = c.iterator();

        while (it.hasNext())
        {
            SignerInformation signer = (SignerInformation)it.next();
            Collection          certCollection = certStore.getMatches(signer.getSID());

            Iterator        certIt = certCollection.iterator();
            X509CertificateHolder cert = (X509CertificateHolder)certIt.next();

            if (!signer.verify(new JcaSimpleSignerInfoVerifierBuilder().setProvider("BCFIPS").build(cert)))
            {
                return false;
            }
        }

        return true;
    }

    public static byte[] createCounterSignedData(PrivateKey signingKey, X509Certificate signingCert, byte[] data, PrivateKey counterSignerKey, X509Certificate counterSignerCert)
        throws OperatorCreationException, GeneralSecurityException, CMSException, IOException
    {
        CMSSignedData signedData = new CMSSignedData(createSignedObject(signingKey, signingCert, data));

        SignerInformation signer = signedData.getSignerInfos().iterator().next();

        CMSSignedDataGenerator counterSignerGen = new CMSSignedDataGenerator();

        DigestCalculatorProvider digProvider = new JcaDigestCalculatorProviderBuilder().setProvider("BCFIPS").build();
        JcaSignerInfoGeneratorBuilder signerInfoGeneratorBuilder = new JcaSignerInfoGeneratorBuilder(digProvider);

        counterSignerGen.addSignerInfoGenerator(signerInfoGeneratorBuilder.build(new JcaContentSignerBuilder("SHA384withRSA").setProvider("BCFIPS").build(counterSignerKey), counterSignerCert));

        SignerInformationStore counterSigners = counterSignerGen.generateCounterSigners(signer);

        signer = SignerInformation.addCounterSigners(signer, counterSigners);

        CMSSignedDataGenerator signerGen = new CMSSignedDataGenerator();

        signerGen.addCertificate(new JcaX509CertificateHolder(signingCert));
        signerGen.addCertificate(new JcaX509CertificateHolder(counterSignerCert));

        signerGen.addSigners(new SignerInformationStore(signer));

        return signerGen.generate(new CMSProcessableByteArray(data), true).getEncoded();
    }

    public static boolean verifyCounterSignature(byte[] cmsSignedData)
        throws OperatorCreationException, GeneralSecurityException, CMSException, IOException
    {
        CMSSignedData         signedData = new CMSSignedData(cmsSignedData);
        SignerInformation     signer = signedData.getSignerInfos().iterator().next();
        SignerInformation     counterSigner = signer.getCounterSignatures().iterator().next();
        Collection            certCollection = signedData.getCertificates().getMatches(counterSigner.getSID());
        Iterator              certIt = certCollection.iterator();
        X509CertificateHolder cert = (X509CertificateHolder)certIt.next();

        return counterSigner.verify(new JcaSimpleSignerInfoVerifierBuilder().setProvider("BCFIPS").build(cert));
    }

    public static Attribute createTspAttribute(PrivateKey tspSigningKey, X509Certificate tspSignerCert, byte[] data)
        throws GeneralSecurityException, OperatorCreationException, TSPException, IOException
    {
        MessageDigest digest = MessageDigest.getInstance("SHA-384", "BCFIPS");
        TimeStampResponse response = new TimeStampResponse(Tsp.createTspResponse(tspSigningKey, tspSignerCert, Tsp.createTspRequest(digest.digest(data))));
        TimeStampToken timestampToken = response.getTimeStampToken();

        return new Attribute(PKCSObjectIdentifiers.id_aa_signatureTimeStampToken, new DERSet(timestampToken.toCMSSignedData().toASN1Structure()));
    }

    public static byte[] createTimeStampedSigner(PrivateKey signingKey, X509Certificate signingCert, byte[] data, PrivateKey tspSigningKey, X509Certificate tspSignerCert)
        throws OperatorCreationException, GeneralSecurityException, CMSException, TSPException, IOException
    {
        CMSSignedData signedData = new CMSSignedData(createSignedObject(signingKey, signingCert, data));

        SignerInformation signer = signedData.getSignerInfos().iterator().next();

        ASN1EncodableVector timestampVector = new ASN1EncodableVector();
        timestampVector.add(createTspAttribute(tspSigningKey, tspSignerCert, signer.getSignature()));
        AttributeTable at = new AttributeTable(timestampVector);

        signer = SignerInformation.replaceUnsignedAttributes(signer, at);

        SignerInformationStore newSignerStore = new SignerInformationStore(signer);

        return CMSSignedData.replaceSigners(signedData, newSignerStore).getEncoded();
    }

    public static boolean verifyTimeStampedSigner(byte[] cmsSignedData)
        throws OperatorCreationException, GeneralSecurityException, CMSException, IOException, TSPException
    {
        CMSSignedData         signedData = new CMSSignedData(cmsSignedData);
        SignerInformation     signer = signedData.getSignerInfos().iterator().next();
        TimeStampToken        tspToken = new TimeStampToken(ContentInfo.getInstance(signer.getUnsignedAttributes().get(PKCSObjectIdentifiers.id_aa_signatureTimeStampToken).getAttributeValues()[0]));
        Collection            certCollection = tspToken.getCertificates().getMatches(tspToken.getSID());
        Iterator              certIt = certCollection.iterator();
        X509CertificateHolder cert = (X509CertificateHolder)certIt.next();

        tspToken.validate(new JcaSimpleSignerInfoVerifierBuilder().setProvider("BCFIPS").build(cert));

        return true;
    }

    public static byte[] createKeyTransEnvelopedObject(X509Certificate encryptionCert, byte[] data)
        throws GeneralSecurityException, CMSException, IOException
    {
        CMSEnvelopedDataGenerator envelopedGen = new CMSEnvelopedDataGenerator();
        JcaAlgorithmParametersConverter paramsConverter = new JcaAlgorithmParametersConverter();

        envelopedGen.addRecipientInfoGenerator(new JceKeyTransRecipientInfoGenerator(encryptionCert, paramsConverter.getAlgorithmIdentifier(PKCSObjectIdentifiers.id_RSAES_OAEP, OAEPParameterSpec.DEFAULT)).setProvider("BCFIPS"));

        return envelopedGen.generate(
            new CMSProcessableByteArray(data),
            new JceCMSContentEncryptorBuilder(CMSAlgorithm.AES256_CBC).setProvider("BCFIPS").build()).getEncoded();
    }

    public static byte[] extractKeyTransEnvelopedData(PrivateKey privateKey, X509Certificate encryptionCert, byte[] encEnvelopedData)
        throws CMSException
    {
        CMSEnvelopedData envelopedData = new CMSEnvelopedData(encEnvelopedData);
        RecipientInformationStore recipients = envelopedData.getRecipientInfos();

        Collection c = recipients.getRecipients(new JceKeyTransRecipientId(encryptionCert));

        Iterator it = c.iterator();

        if (it.hasNext())
        {
            RecipientInformation recipient = (RecipientInformation)it.next();

            return recipient.getContent(new JceKeyTransEnvelopedRecipient(privateKey).setProvider("BCFIPS"));
        }

        throw new IllegalArgumentException("recipient for certificate not found");
    }

    public static byte[] createKeyAgreeEnvelopedObject(PrivateKey initiatorKey, X509Certificate initiatorCert, X509Certificate recipientCert, byte[] data)
        throws GeneralSecurityException, CMSException, IOException
    {
        CMSEnvelopedDataGenerator envelopedGen = new CMSEnvelopedDataGenerator();

        envelopedGen.addRecipientInfoGenerator(new JceKeyAgreeRecipientInfoGenerator(CMSAlgorithm.ECCDH_SHA384KDF,
            initiatorKey, initiatorCert.getPublicKey(),
            CMSAlgorithm.AES256_WRAP).addRecipient(recipientCert).setProvider("BCFIPS"));

        return envelopedGen.generate(
            new CMSProcessableByteArray(data),
            new JceCMSContentEncryptorBuilder(CMSAlgorithm.AES256_CBC).setProvider("BCFIPS").build()).getEncoded();

    }

    public static byte[] extractKeyAgreeEnvelopedData(PrivateKey recipientKey, X509Certificate recipientCert, byte[] encEnvelopedData)
        throws GeneralSecurityException, CMSException
    {
        CMSEnvelopedData envelopedData = new CMSEnvelopedData(encEnvelopedData);
        RecipientInformationStore recipients = envelopedData.getRecipientInfos();
        RecipientId rid = new JceKeyAgreeRecipientId(recipientCert);

        RecipientInformation recipient = recipients.get(rid);

        return recipient.getContent(new JceKeyAgreeEnvelopedRecipient(recipientKey).setProvider("BCFIPS"));
    }

    public static byte[] createKekEnvelopedObject(byte[] keyID, SecretKey keyEncryptionKey, byte[] data)
        throws GeneralSecurityException, CMSException, IOException
    {
        CMSEnvelopedDataGenerator envelopedGen = new CMSEnvelopedDataGenerator();

        envelopedGen.addRecipientInfoGenerator(
            new JceKEKRecipientInfoGenerator(keyID, keyEncryptionKey));

        return envelopedGen.generate(
            new CMSProcessableByteArray(data),
            new JceCMSContentEncryptorBuilder(CMSAlgorithm.AES256_CBC).setProvider("BCFIPS").build()).getEncoded();
    }

    public static byte[] extractKekEnvelopedData(byte[] keyID, SecretKey keyEncryptionKey, byte[] encEnvelopedData)
        throws GeneralSecurityException, CMSException
    {
        CMSEnvelopedData envelopedData = new CMSEnvelopedData(encEnvelopedData);
        RecipientInformationStore recipients = envelopedData.getRecipientInfos();
        RecipientId rid = new KEKRecipientId(keyID);

        RecipientInformation recipient = recipients.get(rid);

        return recipient.getContent(
            new JceKEKEnvelopedRecipient(keyEncryptionKey)
            .setProvider("BCFIPS"));
    }

    public static byte[] createPasswordEnvelopedObject(char[] passwd, byte[] salt, int iterationCount, byte[] data)
        throws GeneralSecurityException, CMSException, IOException
    {
        CMSEnvelopedDataGenerator envelopedGen = new CMSEnvelopedDataGenerator();

        envelopedGen.addRecipientInfoGenerator(
            new JcePasswordRecipientInfoGenerator(CMSAlgorithm.AES256_CBC, passwd)
            .setProvider("BCFIPS")
            .setPasswordConversionScheme(PasswordRecipient.PKCS5_SCHEME2_UTF8)
            .setPRF(PasswordRecipient.PRF.HMacSHA384)
            .setSaltAndIterationCount(salt, iterationCount));

        return envelopedGen.generate(
            new CMSProcessableByteArray(data),
            new JceCMSContentEncryptorBuilder(CMSAlgorithm.AES256_CBC).setProvider("BCFIPS").build()).getEncoded();
    }

    public static byte[] extractPasswordEnvelopedData(char[] passwd, byte[] encEnvelopedData)
        throws GeneralSecurityException, CMSException
    {
        CMSEnvelopedData envelopedData = new CMSEnvelopedData(encEnvelopedData);
        RecipientInformationStore recipients = envelopedData.getRecipientInfos();
        RecipientId rid = new PasswordRecipientId();

        RecipientInformation recipient = recipients.get(rid);

        return recipient.getContent(
            new JcePasswordEnvelopedRecipient(passwd)
            .setProvider("BCFIPS")
            .setPasswordConversionScheme(PasswordRecipient.PKCS5_SCHEME2_UTF8));
    }

    public static byte[] createAuthenticatedData(X509Certificate originatorCertificate, X509Certificate recipientCertificate, byte[] data)
        throws GeneralSecurityException, CMSException, IOException
    {
        ASN1ObjectIdentifier macAlg = CMSAlgorithm.DES_EDE3_CBC;

        CMSAuthenticatedDataGenerator authDataGenerator = new CMSAuthenticatedDataGenerator();

        X509CertificateHolder origCert = new JcaX509CertificateHolder(originatorCertificate);

        authDataGenerator.setOriginatorInfo(new OriginatorInfoGenerator(origCert).generate());

        authDataGenerator.addRecipientInfoGenerator(new JceKeyTransRecipientInfoGenerator(recipientCertificate).setProvider("BCFIPS"));

        return authDataGenerator.generate(
                                new CMSProcessableByteArray(data),
                                new JceCMSMacCalculatorBuilder(macAlg).setProvider("BCFIPS").build()).getEncoded();
    }

    public static byte[] extractAuthenticatedData(PrivateKey recipientPrivateKey, X509Certificate recipientCert, byte[] encAuthData)
        throws GeneralSecurityException, CMSException
    {
        CMSAuthenticatedData authData = new CMSAuthenticatedData(encAuthData);

        RecipientInformationStore recipients = authData.getRecipientInfos();

        RecipientInformation recipient = recipients.get(new JceKeyTransRecipientId(recipientCert));

        if (recipient != null)
        {
            byte[] recData = recipient.getContent(new JceKeyTransAuthenticatedRecipient(recipientPrivateKey).setProvider("BCFIPS"));

            if (Arrays.constantTimeAreEqual(authData.getMac(), recipient.getMac()))
            {
                return recData;
            }
            else
            {
                throw new IllegalStateException("MAC check failed");
            }
        }

        throw new IllegalStateException("no recipient found");
    }

    public static void main(String[] args)
        throws GeneralSecurityException, OperatorCreationException, CMSException, IOException, TSPException
    {
        Setup.installProvider();

        KeyPair ecSigningKeyPair = EC.generateKeyPair();
        KeyPair ecEncryptionKeyPair1 = EC.generateKeyPair();
        KeyPair ecEncryptionKeyPair2 = EC.generateKeyPair();
        KeyPair rsaSigningKeyPair = Rsa.generateKeyPair();
        KeyPair rsaEncryptionKeyPair = Rsa.generateKeyPair();

        X509Certificate ecSigningCert = Cert.makeV1Certificate(ecSigningKeyPair.getPrivate(), ecSigningKeyPair.getPublic());
        X509Certificate ecEncryptionCert1 = Cert.makeV1Certificate(ecSigningKeyPair.getPrivate(), ecEncryptionKeyPair1.getPublic());
        X509Certificate ecEncryptionCert2 = Cert.makeV1Certificate(ecSigningKeyPair.getPrivate(), ecEncryptionKeyPair2.getPublic());
        X509Certificate rsaSigningCert = Cert.makeV1RsaCertificate(rsaSigningKeyPair.getPrivate(), rsaSigningKeyPair.getPublic());
        X509Certificate rsaEncryptionCert = Cert.makeV1RsaCertificate(rsaSigningKeyPair.getPrivate(), rsaEncryptionKeyPair.getPublic());

        System.err.println(verifySignedObject(createSignedObject(ecSigningKeyPair.getPrivate(), ecSigningCert, ExValues.SampleInput)));
        System.err.println(verifyDetachedData(createDetachedSignature(ecSigningKeyPair.getPrivate(), ecSigningCert, ExValues.SampleInput), ExValues.SampleInput));
        System.err.println(verifyCounterSignature(createCounterSignedData(ecSigningKeyPair.getPrivate(), ecSigningCert, ExValues.SampleInput, rsaSigningKeyPair.getPrivate(), rsaSigningCert)));
        System.err.println(Arrays.areEqual(ExValues.SampleInput, extractKeyTransEnvelopedData(rsaEncryptionKeyPair.getPrivate(), rsaEncryptionCert, createKeyTransEnvelopedObject(rsaEncryptionCert, ExValues.SampleInput))));
        System.err.println(Arrays.areEqual(ExValues.SampleInput, extractKeyAgreeEnvelopedData(ecEncryptionKeyPair2.getPrivate(), ecEncryptionCert2, createKeyAgreeEnvelopedObject(ecEncryptionKeyPair1.getPrivate(), ecEncryptionCert1, ecEncryptionCert2, ExValues.SampleInput))));
        System.err.println(Arrays.areEqual(ExValues.SampleInput, extractPasswordEnvelopedData("password".toCharArray(), createPasswordEnvelopedObject("password".toCharArray(), Hex.decode("000102030405060708090a0b0c0d0e0f"), 1024, ExValues.SampleInput))));
        System.err.println(Arrays.areEqual(ExValues.SampleInput, extractKekEnvelopedData(new byte[4], ExValues.SampleAesKey, createKekEnvelopedObject(new byte[4], ExValues.SampleAesKey, ExValues.SampleInput))));
        System.err.println(Arrays.areEqual(ExValues.SampleInput, extractAuthenticatedData(rsaEncryptionKeyPair.getPrivate(), rsaEncryptionCert, createAuthenticatedData(rsaSigningCert, rsaEncryptionCert, ExValues.SampleInput))));
        System.err.println(verifyTimeStampedSigner(createTimeStampedSigner(ecSigningKeyPair.getPrivate(), ecSigningCert, ExValues.SampleInput, rsaSigningKeyPair.getPrivate(), Cert.makeRsaTspCertificate(rsaSigningCert, rsaSigningKeyPair.getPrivate(), rsaSigningKeyPair.getPublic()))));
    }
}