ALSource Class Reference
| Inherits from | NSObject |
| Conforms to | ALSoundSource OALSuspendManager |
| Declared in | ALSource.h ALSource.m |
Overview
A source represents an object that emits sound which can be heard by a listener. This source can have position, velocity, and direction.
(INTERNAL USE) Private methods for ALSource.
Tasks
Other Methods
-
buffer
The sound buffer this source is attached to (set to nil to detach the currently attached buffer).
property -
buffersQueued
How many buffers this source has queued.
property -
buffersProcessed
How many of these buffers have been processed during playback.
property -
context
The context this source was opened on.
property -
offsetInBytes
The offset into the current buffer (in bytes).
property -
offsetInSamples
The offset into the current buffer (in samples).
property -
offsetInSeconds
The offset into the current buffer (in seconds).
property -
sourceId
OpenAL’s ID for this source.
property -
state
The state of this source.
property -
+ source
Create a new source.
-
+ sourceOnContext:
-
– initOnContext:
-
– play
Play the currently attached buffer.
-
– queueBuffer:
-
– queueBuffer:repeats:
Add a buffer to the buffer queue, repeating it multiple times.
-
– queueBuffers:
Add buffers to the buffer queue.
-
– queueBuffers:repeats:
Add buffers to the buffer queue, repeating it multiple times. The buffers will be played in order, repeating the specified number of times.
-
– unqueueBuffer:
-
– unqueueBuffers:
Remove buffers from the buffer queue
-
– registerNotification:callback:userData:
Register to receive notifications about an event on this source. (iOS 5.0+)
-
– unregisterNotification:
Unregister notifications for a notification type on this source. (iOS 5.0+)
-
– unregisterAllNotifications
Unregister all notifications for this source. (iOS 5.0+)
Other Methods
-
– coneInnerAngle
Cone inner angle (OpenAL property).
-
– setConeInnerAngle:
Cone inner angle (OpenAL property).
-
– coneOuterAngle
Cone outer angle (OpenAL property).
-
– setConeOuterAngle:
Cone outer angle (OpenAL property).
-
– coneOuterGain
Cone outer gain (OpenAL property).
-
– setConeOuterGain:
Cone outer gain (OpenAL property).
-
– direction
Direction (OpenAL property).
-
– setDirection:
Direction (OpenAL property).
-
– volume
Volume (alias to gain).
-
– setVolume:
Volume (alias to gain).
-
– gain
Gain (volume) (OpenAL property).
-
– setGain:
Gain (volume) (OpenAL property).
-
– looping
Looping (OpenAL property).
-
– setLooping:
Looping (OpenAL property).
-
– maxDistance
Max distance (OpenAL property).
-
– setMaxDistance:
Max distance (OpenAL property).
-
– maxGain
Max gain (OpenAL property).
-
– setMaxGain:
Max gain (OpenAL property).
-
– minGain
Min gain (OpenAL property).
-
– setMinGain:
Min gain (OpenAL property).
-
– muted
If true, this source is muted.
-
– setMuted:
If true, this source is muted.
-
– paused
If true, this source is currently paused.
-
– setPaused:
If true, this source is currently paused.
-
– pitch
Pitch (OpenAL property).
-
– setPitch:
Pitch (OpenAL property).
-
– playing
If true, this source is currently playing audio.
-
– position
Position (OpenAL property).
-
– setPosition:
Position (OpenAL property).
-
– pan
Pan value (-1.0 = far left, 1.0 = far right). Note: This effect is simulated by changing the source’s X position. Do not use this property if you are modifying the position property as well.
-
– setPan:
Pan value (-1.0 = far left, 1.0 = far right). Note: This effect is simulated by changing the source’s X position. Do not use this property if you are modifying the position property as well.
-
– referenceDistance
Reference distance (OpenAL property).
-
– setReferenceDistance:
Reference distance (OpenAL property).
-
– rolloffFactor
Rolloff factor (OpenAL property).
-
– setRolloffFactor:
Rolloff factor (OpenAL property).
-
– sourceRelative
Source relative (OpenAL property).
-
– setSourceRelative:
Source relative (OpenAL property).
-
– sourceType
Source type (OpenAL property).
-
– setSourceType:
Source type (OpenAL property).
-
– velocity
Velocity (OpenAL property).
-
– setVelocity:
Velocity (OpenAL property).
-
– reverbSendLevel
Reverb send level (how much reverb affects this source). (iOS 5.0+) 0.0 = fully dry, 1.0 = fully wet. Default 0.
-
– setReverbSendLevel:
Reverb send level (how much reverb affects this source). (iOS 5.0+) 0.0 = fully dry, 1.0 = fully wet. Default 0.
-
– reverbOcclusion
Reverb occlusion (wall/door between listener and source). (iOS 5.0+) -100.0db (most occlusion) to 0.0 (no occlusion). Default 0.
-
– setReverbOcclusion:
Reverb occlusion (wall/door between listener and source). (iOS 5.0+) -100.0db (most occlusion) to 0.0 (no occlusion). Default 0.
-
– reverbObstruction
Reverb obstruction (object between listener and source). (iOS 5.0+) -100.0db (most obstruction) to 0.0 (no obstruction). Default 0.
-
– setReverbObstruction:
Reverb obstruction (object between listener and source). (iOS 5.0+) -100.0db (most obstruction) to 0.0 (no obstruction). Default 0.
-
– addSuspendListener:
Add a listener that will receive manual suspend and interrupt events.
-
– removeSuspendListener:
Remove a registered listener.
-
– suspended
If YES, this object is suspended.
-
– setSuspended:
(INTERNAL USE) Called by SuspendHandler.
-
– delayedResumePlayback
(INTERNAL USE) Callback for resuming playback after delay to get around OpenAL bug.
-
– play:
Play a sound.
-
– play:loop:
Play a sound, optionally looping.
-
– play:gain:pitch:pan:loop:
-
– stop
Stop playing the current sound.
-
– rewind
Stop playing the current sound and set its state to AL_INITIAL.
-
– fadeTo:duration:target:selector:
Fade to the specified gain value.
-
– stopFade
Stop the currently running fade operation, if any.
-
– panTo:duration:target:selector:
pan to the specified value.
-
– stopPan
Stop the currently running pan operation, if any.
-
– pitchTo:duration:target:selector:
Gradually change pitch to the specified value.
-
– stopPitch
Stop the currently running pitch operation, if any.
-
– stopActions
-
– clear
Clear any buffers this source is currently using.
-
– receiveNotification:userData:
\endcond
Properties
buffer
The sound buffer this source is attached to (set to nil to detach the currently attached buffer).
@property (nonatomic, readwrite, retain) ALBuffer *buffer
Declared In
ALSource.h
buffersProcessed
How many of these buffers have been processed during playback.
@property (nonatomic, readonly, assign) int buffersProcessed
Declared In
ALSource.h
buffersQueued
How many buffers this source has queued.
@property (nonatomic, readonly, assign) int buffersQueued
Declared In
ALSource.h
context
The context this source was opened on.
@property (nonatomic, readonly, retain) ALContext *context
Declared In
ALSource.h
offsetInBytes
The offset into the current buffer (in bytes).
@property (nonatomic, readwrite, assign) float offsetInBytes
Declared In
ALSource.h
offsetInSamples
The offset into the current buffer (in samples).
@property (nonatomic, readwrite, assign) float offsetInSamples
Declared In
ALSource.h
offsetInSeconds
The offset into the current buffer (in seconds).
@property (nonatomic, readwrite, assign) float offsetInSeconds
Declared In
ALSource.h
sourceId
OpenAL’s ID for this source.
@property (nonatomic, readonly, assign) ALuint sourceId
Declared In
ALSource.h
state
The state of this source.
@property (nonatomic, readwrite, assign) int state
Declared In
ALSource.h
Instance Methods
addSuspendListener:
Add a listener that will receive manual suspend and interrupt events.
- (void)addSuspendListener:(id<OALSuspendListener>)listenerIn
Parameters
- listener
The listener to register with this handler.
Declared In
OALSuspendHandler.h
coneInnerAngle
Cone inner angle (OpenAL property).
- (float)coneInnerAngle
Declared In
ALSoundSource.h
coneOuterAngle
Cone outer angle (OpenAL property).
- (float)coneOuterAngle
Declared In
ALSoundSource.h
delayedResumePlayback
(INTERNAL USE) Callback for resuming playback after delay to get around OpenAL bug.
- (void)delayedResumePlayback
Declared In
ALSource.m
fadeTo:duration:target:selector:
Fade to the specified gain value.
- (void)fadeTo:(float)value duration:(float)duration target:(id)target selector:(SEL)selector
Parameters
- gain
The gain to fade to.
- duration
The duration of the fade operation in seconds.
- target
The target to notify when the fade completes (can be nil).
- selector
The selector to call when the fade completes. The selector must accept a single parameter, which will be the object that performed the fade.
Declared In
ALSoundSource.h
initOnContext:
- (id)initOnContext:(ALContext *)context
Return Value
A new source.
Declared In
ALSource.h
pan
Pan value (-1.0 = far left, 1.0 = far right). Note: This effect is simulated by changing the source’s X position. Do not use this property if you are modifying the position property as well.
- (float)pan
Declared In
ALSoundSource.h
panTo:duration:target:selector:
pan to the specified value.
- (void)panTo:(float)value duration:(float)duration target:(id)target selector:(SEL)selector
Parameters
- pan
The value to pan to.
- duration
The duration of the pan operation in seconds.
- target
The target to notify when the pan completes (can be nil).
Declared In
ALSoundSource.h
pitchTo:duration:target:selector:
Gradually change pitch to the specified value.
- (void)pitchTo:(float)value duration:(float)duration target:(id)target selector:(SEL)selector
Parameters
- pitch
The value to change pitch to.
- duration
The duration of the pitch operation in seconds.
- target
The target to notify when the pitch change completes (can be nil).
Declared In
ALSoundSource.h
play:
Play a sound.
- (id<ALSoundSource>)play:(ALBuffer *)bufferIn
Parameters
- buffer
the buffer to play.
Return Value
the source playing the sound, or nil if the sound could not be played.
Declared In
ALSoundSource.h
play:gain:pitch:pan:loop:
- (id<ALSoundSource>)play:(ALBuffer *)bufferIn gain:(float)gainIn pitch:(float)pitchIn pan:(float)panIn loop:(bool)loopIn
Parameters
- buffer
the buffer to play.
- pan
Left-right panning (-1.0 = far left, 1.0 = far right).
- loop
If TRUE, the sound will loop until you call “stop” on the returned sound source.
Return Value
the source playing the sound, or nil if the sound could not be played.
Declared In
ALSoundSource.h
play:loop:
Play a sound, optionally looping.
- (id<ALSoundSource>)play:(ALBuffer *)bufferIn loop:(bool)loop
Parameters
- buffer
the buffer to play.
- loop
If TRUE, the sound will loop until you call “stop” on the returned sound source.
Return Value
the source playing the sound, or nil if the sound could not be played.
Declared In
ALSoundSource.h
playing
If true, this source is currently playing audio.
- (bool)playing
Declared In
ALSoundSource.h
queueBuffer:
- (bool)queueBuffer:(ALBuffer *)buffer
Parameters
- buffer
the buffer to add to the queue.
Return Value
TRUE if the operation was successful.
Declared In
ALSource.h
queueBuffer:repeats:
- (bool)queueBuffer:(ALBuffer *)buffer repeats:(NSUInteger)repeats
Parameters
- buffer
the buffer to add to the queue.
- repeats
the number of times to repeat the buffer in the queue.
Return Value
TRUE if the operation was successful.
Declared In
ALSource.h
queueBuffers:
Add buffers to the buffer queue.
- (bool)queueBuffers:(NSArray *)buffers
Parameters
- buffers
the buffers to add to the queue.
Return Value
TRUE if the operation was successful.
Declared In
ALSource.h
queueBuffers:repeats:
Add buffers to the buffer queue, repeating it multiple times. The buffers will be played in order, repeating the specified number of times.
- (bool)queueBuffers:(NSArray *)buffers repeats:(NSUInteger)repeats
Parameters
- buffers
the buffers to add to the queue.
- repeats
the number of times to repeat the buffer in the queue.
Return Value
TRUE if the operation was successful.
Declared In
ALSource.h
receiveNotification:userData:
\endcond
- (void)receiveNotification:(ALuint)notificationID userData:(void *)userData
Declared In
ALSource.m
referenceDistance
Reference distance (OpenAL property).
- (float)referenceDistance
Declared In
ALSoundSource.h
registerNotification:callback:userData:
Register to receive notifications about an event on this source. (iOS 5.0+)
- (void)registerNotification:(ALuint)notificationID callback:(OALSourceNotificationCallback)callback userData:(void *)userData
Parameters
- notificationID
The kind of notification to be informed of (see above).
- callback
The block to call for notification.
- userData
a pointer that will be passed to the callback.
Discussion
The following notification types are recognized: AL_SOURCE_STATE - Sent when a source’s state changes. AL_BUFFERS_PROCESSED - Sent when all buffers have been processed. AL_QUEUE_HAS_LOOPED - Sent when a looping source has looped to it’s start point.
Declared In
ALSource.h
removeSuspendListener:
Remove a registered listener.
- (void)removeSuspendListener:(id<OALSuspendListener>)listenerIn
Parameters
- listener
The listener to unregister from this handler.
Declared In
OALSuspendHandler.h
reverbObstruction
Reverb obstruction (object between listener and source). (iOS 5.0+) -100.0db (most obstruction) to 0.0 (no obstruction). Default 0.
- (float)reverbObstruction
Declared In
ALSoundSource.h
reverbOcclusion
Reverb occlusion (wall/door between listener and source). (iOS 5.0+) -100.0db (most occlusion) to 0.0 (no occlusion). Default 0.
- (float)reverbOcclusion
Declared In
ALSoundSource.h
reverbSendLevel
Reverb send level (how much reverb affects this source). (iOS 5.0+) 0.0 = fully dry, 1.0 = fully wet. Default 0.
- (float)reverbSendLevel
Declared In
ALSoundSource.h
rewind
Stop playing the current sound and set its state to AL_INITIAL.
- (void)rewind
Declared In
ALSoundSource.h
setConeInnerAngle:
Cone inner angle (OpenAL property).
- (void)setConeInnerAngle:(float)value
Declared In
ALSoundSource.h
setConeOuterAngle:
Cone outer angle (OpenAL property).
- (void)setConeOuterAngle:(float)value
Declared In
ALSoundSource.h
setConeOuterGain:
Cone outer gain (OpenAL property).
- (void)setConeOuterGain:(float)value
Declared In
ALSoundSource.h
setDirection:
Direction (OpenAL property).
- (void)setDirection:(ALVector)value
Declared In
ALSoundSource.h
setMaxDistance:
Max distance (OpenAL property).
- (void)setMaxDistance:(float)value
Declared In
ALSoundSource.h
setPan:
Pan value (-1.0 = far left, 1.0 = far right). Note: This effect is simulated by changing the source’s X position. Do not use this property if you are modifying the position property as well.
- (void)setPan:(float)value
Declared In
ALSoundSource.h
setPaused:
If true, this source is currently paused.
- (void)setPaused:(bool)shouldPause
Declared In
ALSoundSource.h
setPosition:
Position (OpenAL property).
- (void)setPosition:(ALPoint)value
Declared In
ALSoundSource.h
setReferenceDistance:
Reference distance (OpenAL property).
- (void)setReferenceDistance:(float)value
Declared In
ALSoundSource.h
setReverbObstruction:
Reverb obstruction (object between listener and source). (iOS 5.0+) -100.0db (most obstruction) to 0.0 (no obstruction). Default 0.
- (void)setReverbObstruction:(float)reverbObstruction
Declared In
ALSoundSource.h
setReverbOcclusion:
Reverb occlusion (wall/door between listener and source). (iOS 5.0+) -100.0db (most occlusion) to 0.0 (no occlusion). Default 0.
- (void)setReverbOcclusion:(float)reverbOcclusion
Declared In
ALSoundSource.h
setReverbSendLevel:
Reverb send level (how much reverb affects this source). (iOS 5.0+) 0.0 = fully dry, 1.0 = fully wet. Default 0.
- (void)setReverbSendLevel:(float)reverbSendLevel
Declared In
ALSoundSource.h
setRolloffFactor:
Rolloff factor (OpenAL property).
- (void)setRolloffFactor:(float)value
Declared In
ALSoundSource.h
setSourceRelative:
Source relative (OpenAL property).
- (void)setSourceRelative:(int)value
Declared In
ALSoundSource.h
setSourceType:
Source type (OpenAL property).
- (void)setSourceType:(int)value
Declared In
ALSoundSource.h
setSuspended:
(INTERNAL USE) Called by SuspendHandler.
- (void)setSuspended:(bool)value
Declared In
ALSource.m
setVelocity:
Velocity (OpenAL property).
- (void)setVelocity:(ALVector)value
Declared In
ALSoundSource.h
stopFade
Stop the currently running fade operation, if any.
- (void)stopFade
Declared In
ALSoundSource.h
stopPan
Stop the currently running pan operation, if any.
- (void)stopPan
Declared In
ALSoundSource.h
stopPitch
Stop the currently running pitch operation, if any.
- (void)stopPitch
Declared In
ALSoundSource.h
unqueueBuffer:
- (bool)unqueueBuffer:(ALBuffer *)buffer
Parameters
- buffer
the buffer to remove from the queue.
Return Value
TRUE if the operation was successful.
Declared In
ALSource.h
unqueueBuffers:
Remove buffers from the buffer queue
- (bool)unqueueBuffers:(NSArray *)buffers
Parameters
- buffers
the buffers to remove from the queue.
Return Value
TRUE if the operation was successful.
Declared In
ALSource.h
unregisterAllNotifications
Unregister all notifications for this source. (iOS 5.0+)
- (void)unregisterAllNotifications
Declared In
ALSource.h
unregisterNotification:
Unregister notifications for a notification type on this source. (iOS 5.0+)
- (void)unregisterNotification:(ALuint)notificationID
Parameters
- notificationID
The kind of notification to remove.
Declared In
ALSource.h


Controls
Settings
Loop duration
Sample files
Tracks
Samples
header
body
reject
resolve
Audio folder locations
Add location
Disable
Delete
x


{{define "email-footer"}}
You are receiving this email because you set up a RetroGit account.
Update your email preferences | View digest in browser
RetroGit is a project by Mihai Parparita.


Shaolin Cosmos Chi Kung
"Shaolin Cosmos Chi Kung" is a comprehensive energy art that focuses on restoring Yin-Yang harmony in the body. This allows practitioners to enjoy good health, vitality, longevity and spiritual cultivation in the here and now. Benefits include: reduced stress, more mental clarity, improved overall health, a renewed zest for life and inner peace.
In Chinese, Chi Kung literally means "work with energy" and is an umbrella term that refers to many different styles of energy arts. The chi kung that Sifu Wong teaches is termed Shaolin Cosmos Chi Kung as it was developed at the Shaolin Temple and is focused on cultivating chi, or energy, from the heavens, or the cosmos. The essence of Shaolin Cosmos Chi Kung lies in the skills of entering a chi kung state of mind and generating a chi flow to cleanse the system.
One practice session of Cosmos Chi Kung generally lasts between 10-20 minutes, making it ideal for the daily schedule that most people maintain. While the practice time is short compared to many other arts, Cosmos Chi Kung is highly efficient and effective and the benefits are quickly evident.


--- layout: page title: Lean Prover Zulip Chat Archive permalink: archive/113489newmembers/39266Sequentcalculus.html ---
Hi all,
I’m a new member. I was wondering if it could be useful to extend the logic library by introducing sequent calculus. Is it?
I think it would be mostly useful if you want to do a deep embedding of some logic into Lean
{% endraw %}


|
Bitstream Interpretation Library (BIL)
0.1
|
A register for storing configuration data. More...
#include <packetprocessor/V5FDRIRegister.hpp>
Public Member Functions | |
| V5FDRIRegister (const V5CMDRegister &cmdReg, V5FARRegister &farReg) | |
| Constructs a V5FDRIRegister instance. | |
| virtual void | write (const boost::uint32_t *words, size_t wordCount) |
| Every frame-sized data chunk will be packed into a frame and stored in configuration memory at the frame address denoted by the FAR register. After a frame is written, the FAR register is auto-incremented. | |
| void | writePreviousFrame () |
| Writes the previous written frame again, but to the current FAR register's frame address. | |
| const V5CMDRegister & | cmdRegister () const |
| Gets linked V5CMDRegister register instance. | |
| V5FARRegister & | farRegister () const |
| Gets linked V5FARRegister register instance. | |
| V5Configuration & | configuration () |
| Gets configuration. | |
| const V5Configuration & | configuration () const |
| Gets read only configuration. | |
| Public Member Functions inherited from bil::Register | |
| Register (RegisterAddress::address_t address, const std::string &name, bool writable=true, bool readable=true) | |
| Constructs a Register instance. | |
| virtual | ~Register ()=0 |
| Destructs a Register instance. | |
| RegisterAddress::address_t | address () const |
| Gets register address. | |
| const std::string & | name () const |
| Gets register name. | |
| bool | writable () const |
| Tells if register is writable. | |
| bool | readable () const |
| Tells if register is readable. | |
| virtual void | read (boost::uint32_t *words, size_t wordCount) const |
| Reads data words from the register. |
A register for storing configuration data.
The FDRI register is the input for configuration data. Because of this it is a write-only register and writes to it must be a multiple of the frame size. Every frame-sized data chunk will be packed into a frame and stored in configuration memory at the frame address denoted by the FAR register. After a frame is written, the FAR register is auto-incremented.
Definition at line 30 of file V5FDRIRegister.hpp.
| V5FDRIRegister::V5FDRIRegister | ( | const V5CMDRegister & | cmdReg, |
| V5FARRegister & | farReg | ||
| ) |
Constructs a V5FDRIRegister instance.
| cmdReg | V5CMDRegister instance reference that should be linked to this register (e.g. for querying state). |
| farReg | V5FARRegister instance reference that should be linked to this register (e.g. for querying frame address). The FAR register's frame address layout pointer will also be set V5Configuration member's address layout. |
Definition at line 15 of file V5FDRIRegister.cpp.
|
virtual |
Every frame-sized data chunk will be packed into a frame and stored in configuration memory at the frame address denoted by the FAR register. After a frame is written, the FAR register is auto-incremented.
| words | Pointer to data words to write. |
| wordCount | Number of data words to write. |
| . |
Reimplemented from bil::Register.
Definition at line 28 of file V5FDRIRegister.cpp.
| void V5FDRIRegister::writePreviousFrame | ( | ) |
Writes the previous written frame again, but to the current FAR register's frame address.
This feature is used by the MFWRRegister for writing the same frame data to many different locations.
| . |
Definition at line 69 of file V5FDRIRegister.cpp.
| const V5CMDRegister & V5FDRIRegister::cmdRegister | ( | ) | const |
Gets linked V5CMDRegister register instance.
Definition at line 90 of file V5FDRIRegister.cpp.
| V5FARRegister & V5FDRIRegister::farRegister | ( | ) | const |
Gets linked V5FARRegister register instance.
Definition at line 96 of file V5FDRIRegister.cpp.
| V5Configuration & V5FDRIRegister::configuration | ( | ) |
Gets configuration.
Definition at line 78 of file V5FDRIRegister.cpp.
| const V5Configuration & V5FDRIRegister::configuration | ( | ) | const |
Gets read only configuration.
Definition at line 84 of file V5FDRIRegister.cpp.


--- title: LZMA Tarballs Are Coming layout: post tags: [compression] uuid: 8abde298-3c30-3a06-a978-679230b0b3dc ---
Any developer that uses a non-toy operating system will be familiar with gzip and bzip2 tarballs (.tar.gz, .tgz, and .tar.bz2). Most places will provide both versions so that the user can use his preferred decompresser.
Both types are useful because they make tradeoffs at different points: gzip is very fast with low memory requirements and bzip2 has much better compression ratios at the cost of more memory and CPU time. Users of older hardware will prefer gzip, because the benefits of bzip2 are negated by the long decompression times, around 6 times longer. This is why OpenBSD prefers gzip.
But there is a new compression algorithm in town. Well, it has been around for about 10 years now, but, if I understand correctly, was patent encumbered (aka useless) for awhile. It is called the Lempel-Ziv-Markov chain algorithm (LZMA). It is still maturing and different software that uses LZMA still can't quite talk to each other. 7-zip and LZMA Utils are a couple examples.
GNU tar added an
--lzma
option just last April, and finally gave it a
short option, -J
, this past December. I take this as a
sign that LZMA tarballs (.tar.lzma) are going to become common over
the next several years. It also would seem that the GNU project has
officially blessed LZMA.
And not only that, I think LZMA tarballs will supplant bzip2 tarballs. The reason is because it is even more asymmetric than bzip2.
According to the LZMA Utils page, LZMA compression ratios are 15% better than those of bzip2, but at the cost of being 4 to 12 times slower on compression. In many applications, including tarball distribution, this is completely acceptable because decompression is faster than bzip2! There is an extreme asymmetry here that can readily be exploited.
So, when a developer has a new release he tells his version control system, or maybe his build system, to make a tar archive and compress it with LZMA. If he has a computer from this millennium, it won't take a lifetime to do, but it will still take some time. Since it could take as much as two orders of magnitude longer to make than a gzip tarball, he could make a gzip tarball first and put it up for distribution. When the LZMA tarball is done, it will be about 30% smaller and decompress almost as fast as the gzip tarball (but while using a large amount of memory).
At this point, why would someone download a bzip2 archive? It's bigger and slower. Right now possible reasons may be a lack of an LZMA decompresser and/or lack of familiarity. Over time, these will both be remedied.
Don't get me wrong. I don't hate bzip2. It is a very interesting algorithm. In fact, I was breathless when I first understood the Burrows-Wheeler transform, which bzip2 uses at one stage. I would argue that bzip2 is more elegant than gzip and LZMA because it is less arbitrary. But I do think it will become obsolete.
Unfortunately, the confused zip archive is here to stay for now because it is the only compression tool that a certain popular, but inferior, operating system ships with. I say "confused" because it makes the mistake of combining three tools into one: archive, compression, and encryption. As a result, instead of doing one thing well it does three things poorly. Cell phone designers also make the same mistake. Fortunately I don't have to touch zip archives often.
Finally, don't forget that LZMA is mostly useful where the asymmetry can be exploited: data is compressed once and decompressed many times. Take the gitweb interface, which provides access to a git repository through a browser. It will provide a gzip tarball of any commit on the fly. It doesn't do this by having all these tarballs lying around, but creates them on demand. Data is compressed once and decompressed once. Because of this, gzip is, and will remain, the best option for this setting.
In conclusion, consider creating LZMA tarballs next time, and don't be afraid to use them when you come across them.


Prime Numbers as Building Blocks
For as long as I remember, I always had a deep interest in prime numbers. And that’s why – this – in an attempt to document its vast literature and carry out my research on this subject. Prime Numbers are the building blocks of the numbers and perhaps the processes in the Universe, as I like to think. While it may seem simple to understand what are prime numbers, its startling to find their presence in unusual places. From the prime-numbered life span of Cicada to ensuring security on your credit card, it has profound value in both nature and applied science.
Mathematicians have tried in vain to this day to discover some order in the sequence of prime numbers, and we have reason to believe that it is a mystery into which the mind will never penetrate”. – Euler
The fundamental theorem of arithmetic states that every positive integer has a unique prime factorization. This theorem is thus also referred as unique factorization theorem.
The theorem states that the factors of a number can be expressed uniquely only with prime numbers or its factors. While a number may have composite factors, but the combination of such numbers cannot be unique.
For example,
This theorem in fact, is the reason why some numbers are called Prime and also why 1 is not referred as a prime number, so to avoid non-unique combinations of factors.
Prime makes the composite numbers. But, what are primes made up of? Are prime numbers the result of how we framed the rules of Maths to be? Or did it always exist?
Well whether or not if they are real, it has irrespectively awakened my curiosity to study it and perhaps define a formula. How can something that appears simple and yet not understood entirely?
Now that being said, I’m sometimes put down by imagining the incredible literature available on the Prime numbers, which have been studied for more than 2000 years. The earliest surviving records come from the Ancient Egypt and dates back to 1550 BC! Imagine what could be possibly appealing about these numbers for the ancient Egyptians? What might have been their motivations?
Intrinsically, I looked for the hidden visual model but never could able to get past any existing research. It is incredibly distracting as it appears to follow an unknown rule. Prime numbers have indisputably kept me occupied for many years now. And with the computers we have now, it is probably going to be the very exciting era for mathematical research and a significant leap is not so far away.
There are two facts about the distribution of prime numbers of which I hope to convince you so overwhelmingly that they will be permanently engraved in your hearts. The first is that, despite their simple definition and role as the building blocks of the natural numbers, the prime numbers grow like weeds among the natural numbers, seeming to obey no other law than that of chance, and nobody can predict where the next one will sprout. The second fact is even more astonishing, for it states just the opposite: that the prime numbers exhibit stunning regularity, that there are laws governing their behaviour, and that they obey these laws with almost military precision”. – D. Zagier at a lecture (1975)
I began looking at the sequence and what a fantastic puzzle this is! The distribution despite following a rule does not let us pinpoint the next occurrence of prime. Is Mathematics advance enough to write the solution? Or it will remain in the class of hard problems which cannot be otherwise solved by non-brute force approach.
Any number either is prime or is measured by some prime number.  And a method for determining whether a number is prime or not is called as Primality Test. Other integers which are not Prime numbers are referred as Composite numbers.
where $p_i$ are unique prime numbers, $n_i$ are the powers of prime factors and $k$ is the number of such factors.
This form is called as Canonical representation of $n$.
Such representation can be yielded by trial division. For example 32 can be expressed as –
2 32
2 16
2 8
2 4
2 2
1
Alternatively, prime numbers can be also defined as the natural numbers greater than one that are not products of two smaller natural numbers.
If you look at it, any number except Prime numbers can be reduced to Prime numbers through the canonical form. This is why it makes sense to call Prime numbers as the building blocks, which can be used to construct other numbers. And if so, can prime numbers be used to encode information optimally?
These are some of the few questions that incited me to pursue this subject and eventually start Mathscapes Research.
Cite as
Gaurav Singh (2018, April 15). Prime Numbers as Building Blocks. Retrieved , from https://mathscapes.xyz/notes/prime-numbers-as-building-blocks/.


To search for any github profile, input the name of the user in the field and you will get your result.
{{ profile.followers }} Followers Following {{ profile.following }} {{ profile.public_gist }} Public gists {{ profile.public_repos }} Public repos


Feb 7, 2018 12:00 PM - Feb 7, 2018 1:30 PM
We have a reading crisis in America. Despite one billion dollars spent each year on supplemental literacy products, 2/3 of American students are still below expected reading level by 4th grade. We don’t have a system to provide a clear view on what, when, and how often students are reading. A recent Common Sense Media report found that children under 9 spend more than 2 hours a day on screens. What if we could use kid’s love for devices to generate a new view into the secret reading lives of students? Then turn that reading data into a Reading Fitness Tracker — motivating them to read more and engage in their own reading communities. In this seminar, Mim explores how technology offers new opportunities to engage with student reading and provide unique perspectives into reading activity.
Topic: Using data to enhance reading instruction
Leader: Mim Ingvarson, Co-Founder and CEO of MoxieReader
Description: In this seminar, Mim explores how technology offers new opportunities to engage with student reading and provide unique perspectives into reading activity.
Pre-Read/Media: http://www.moxiereader.com
Location: 5th Floor
RSVP by Mon, Feb 5th
Light Lunch: TBD
Tech: TBD
Vialogues Commenters: TBD
Producers: Cinthia Fabian


40 unregistered, uninsured motorbikes seized in swoop
Police in South Tongu District of the Volta Region have swooped on owners of 40 unregistered and uninsured motorbikes in the area.
The exercise which was led by the District Motor Transport and Traffic Directorate (MTTD) of the Divisional Command, was in collaboration with the Driver and Vehicle Licensing Authority (DVLA).
Chief Superintendent of Police, Dennis Koku Fiakpui, the Divisional Police Commander told Ghana News Agency (GNA), the exercise was part of activities to decongest the roads and reduce the rate of crime involving unregistered motorbikes in the District.
He said this had become necessary because of the numerous activities leading to the yuletide.
“We are approaching the yuletide and the roads would be busy. We need to take off those motorists who are not ready to be on the roads,” the Commander said.
He said the agenda of the Command was to make sure majority of the motorbikes in the District were registered and insured by March 2020.
Police Inspector Evanz Attitsogbui Grunitzky, the District Inspector of the MTTD said owners of impounded motorbikes were asked to register and insure their bikes and present the documents at the police station for their bikes.
He told the GNA "some have already started with the registration."


The WSJ report of academic research on career hot streaks has snagged a lot of LinkedIn eyeballs today (Career ‘hot steaks’ are real 1h ago • 3,526 readers).
Reading the paper (https://goo.gl/2Mwqjn), you can see that it is an observational study of a convenience sample (these were the people about whom data were available, in the thousands or tens of thousands, an impressive collection).
Two mysteries: Why were the data not stratified into a training set and a test set? How could temporal auto-correlation fail to be addressed?
\[f(x)=y\]
isn’t data science. And observational data of temporal patterns in somewhat simplistic metrics of an arbitrarily selected population tells you menos de zero about individuals outside the population.
Finally, you need a theory to account for your results – a chain of reasoning that takes you from what you see to what you can reliably predict with your shiny new analysis.
The academics have no robes, and I am failing adequately to defer to their superior credentials and posts. Too bad, because I would liked to have learned something useful.
Reading further, there’s no indication that the nominal prices were inflation adjusted. Whatever the latest auction price was recorded was used.
Cinema directors include assistant directors and art directors, who have primarily administrative, not creative, roles. The authors measure director success by the IMDB user ratings. I don’t know how IMDB handles it, but it’s easy to imagine that as users come and go, and tastes change, the scores from that source may not share a common scale.
Academics get measured by citation. Often for good reason, a researcher will cite her previous related publications. Are those “self-citations” included or excluded?
We aren’t even told whether the three measures of “goodness” were standardized to have a mean of 1 and standard deviation of 0.
The data and code, however, are provided at https://goo.gl/p8WYqH. Because the code won’t load, due to a couple of type errors, the results can’t be checks. Although scipy.stats is imported, it’s not used, so it’s unlikely that the data were standardized.
Such is Nature, I suppose.


ALLHALLOWS-EVE AT ST IVES.
THE ancient custom of providing children with a large apple on Allhallows-eve is still observed, to a great extent, at St Ives. "Allan-day," as it is called, is the day of days to hundreds' of children, who would deem it a great misfortune were they to go to bed on "Allan-night" without the time-honoured Allan apple to hide beneath their pillows. A quantity of large apples are thus disposed of the sale of which is dignified by the term Allan Market.


We have registered at IKEA. Please see the link below to view our registry. Can't find anything you're excited about here? Try browsing our other registries!
View RegistryWe have registered at Bed Bath & Beyond. Please see the link below to view our registry. Can't find anything you're excited about here? Try browsing our other registries!
View RegistryWe have registered at REI. Please see the link below to view our registry. Can't find anything you're excited about here? Try browsing our other registries!
View Registry


Manage Agreements
Create Agreement
{% if searchText %}
Search results for ({{ searchText }})
{% endif %}
{% for agreement in agreements %}
{% if agreement.transferInstitution and agreement.transfereeInstitution %} {{ agreement.transferInstitution.name }} -> {{ agreement.transfereeInstitution.name }}
{% endif %}
{{ agreement.filename }}
-
{% endfor %}


{{ partial "header.html" . }} {{ partial "blog-content.html" . }} Back to posts {{ template "_internal/disqus.html" . }} {{ partial "footer.html" . }}
Back to posts


Compiling CUDA with clang¶
Introduction¶
This document describes how to compile CUDA code with clang, and gives some details about LLVM and clang’s CUDA implementations.
This document assumes a basic familiarity with CUDA. Information about CUDA programming can be found in the CUDA programming guide.
Compiling CUDA Code¶
Prerequisites¶
CUDA is supported in llvm 3.9, but it’s still in active development, so we recommend you compile clang/LLVM from HEAD.
Before you build CUDA code, you’ll need to have installed the appropriate driver for your nvidia GPU and the CUDA SDK. See NVIDIA’s CUDA installation guide for details. Note that clang does not support the CUDA toolkit as installed by many Linux package managers; you probably need to install nvidia’s package.
You will need CUDA 7.0, 7.5, or 8.0 to compile with clang.
CUDA compilation is supported on Linux, on MacOS as of 2016-11-18, and on Windows as of 2017-01-05.
Invoking clang¶
Invoking clang for CUDA compilation works similarly to compiling regular C++. You just need to be aware of a few additional flags.
You can use this
program as a toy example. Save it as axpy.cu
. (Clang detects that you’re
compiling CUDA code by noticing that your filename ends with .cu
.
Alternatively, you can pass -x cuda
.)
To build and run, run the following commands, filling in the parts in angle brackets as described below:
$ clang++ axpy.cu -o axpy --cuda-gpu-arch=<GPU arch> \
-L<CUDA install path>/<lib64 or lib> \
-lcudart_static -ldl -lrt -pthread
$ ./axpy
y[0] = 2
y[1] = 4
y[2] = 6
y[3] = 8
On MacOS, replace -lcudart_static with -lcudart; otherwise, you may get “CUDA driver version is insufficient for CUDA runtime version” errors when you run your program.
<CUDA install path>
– the directory where you installed CUDA SDK. Typically,/usr/local/cuda
.Pass e.g.
-L/usr/local/cuda/lib64
if compiling in 64-bit mode; otherwise, pass e.g.-L/usr/local/cuda/lib
. (In CUDA, the device code and host code always have the same pointer widths, so if you’re compiling 64-bit code for the host, you’re also compiling 64-bit code for the device.)<GPU arch>
– the compute capability of your GPU. For example, if you want to run your program on a GPU with compute capability of 3.5, specify--cuda-gpu-arch=sm_35
.Note: You cannot pass
compute_XX
as an argument to--cuda-gpu-arch
; onlysm_XX
is currently supported. However, clang always includes PTX in its binaries, so e.g. a binary compiled with--cuda-gpu-arch=sm_30
would be forwards-compatible with e.g.sm_35
GPUs.You can pass
--cuda-gpu-arch
multiple times to compile for multiple archs.
The -L and -l flags only need to be passed when linking. When compiling,
you may also need to pass --cuda-path=/path/to/cuda
if you didn’t install
the CUDA SDK into /usr/local/cuda
, /usr/local/cuda-7.0
, or
/usr/local/cuda-7.5
.
Flags that control numerical code¶
If you’re using GPUs, you probably care about making numerical code run fast. GPU hardware allows for more control over numerical operations than most CPUs, but this results in more compiler options for you to juggle.
Flags you may wish to tweak include:
-ffp-contract={on,off,fast}
(defaults tofast
on host and device when compiling CUDA) Controls whether the compiler emits fused multiply-add operations.off
: never emit fma operations, and prevent ptxas from fusing multiply and add instructions.on
: fuse multiplies and adds within a single statement, but never across statements (C11 semantics). Prevent ptxas from fusing other multiplies and adds.fast
: fuse multiplies and adds wherever profitable, even across statements. Doesn’t prevent ptxas from fusing additional multiplies and adds.
Fused multiply-add instructions can be much faster than the unfused equivalents, but because the intermediate result in an fma is not rounded, this flag can affect numerical code.
-fcuda-flush-denormals-to-zero
(default: off) When this is enabled, floating point operations may flush denormal inputs and/or outputs to 0. Operations on denormal numbers are often much slower than the same operations on normal numbers.-fcuda-approx-transcendentals
(default: off) When this is enabled, the compiler may emit calls to faster, approximate versions of transcendental functions, instead of using the slower, fully IEEE-compliant versions. For example, this flag allows clang to emit the ptxsin.approx.f32
instruction.This is implied by
-ffast-math
.
Standard library support¶
In clang and nvcc, most of the C++ standard library is not supported on the device side.
<math.h>
and <cmath>
¶
In clang, math.h
and cmath
are available and pass
tests
adapted from libc++’s test suite.
In nvcc math.h
and cmath
are mostly available. Versions of ::foof
in namespace std (e.g. std::sinf
) are not available, and where the standard
calls for overloads that take integral arguments, these are usually not
available.
#include <math.h>
#include <cmath.h>
// clang is OK with everything in this function.
__device__ void test() {
std::sin(0.); // nvcc - ok
std::sin(0); // nvcc - error, because no std::sin(int) override is available.
sin(0); // nvcc - same as above.
sinf(0.); // nvcc - ok
std::sinf(0.); // nvcc - no such function
}
<std::complex>
¶
nvcc does not officially support std::complex
. It’s an error to use
std::complex
in __device__
code, but it often works in __host__
__device__
code due to nvcc’s interpretation of the “wrong-side rule” (see
below). However, we have heard from implementers that it’s possible to get
into situations where nvcc will omit a call to an std::complex
function,
especially when compiling without optimizations.
As of 2016-11-16, clang supports std::complex
without these caveats. It is
tested with libstdc++ 4.8.5 and newer, but is known to work only with libc++
newer than 2016-11-16.
<algorithm>
¶
In C++14, many useful functions from <algorithm>
(notably, std::min
and
std::max
) become constexpr. You can therefore use these in device code,
when compiling with clang.
Detecting clang vs NVCC from code¶
Although clang’s CUDA implementation is largely compatible with NVCC’s, you may still want to detect when you’re compiling CUDA code specifically with clang.
This is tricky, because NVCC may invoke clang as part of its own compilation process! For example, NVCC uses the host compiler’s preprocessor when compiling for device code, and that host compiler may in fact be clang.
When clang is actually compiling CUDA code – rather than being used as a
subtool of NVCC’s – it defines the __CUDA__
macro. __CUDA_ARCH__
is
defined only in device mode (but will be defined if NVCC is using clang as a
preprocessor). So you can use the following incantations to detect clang CUDA
compilation, in host and device modes:
#if defined(__clang__) && defined(__CUDA__) && !defined(__CUDA_ARCH__)
// clang compiling CUDA code, host mode.
#endif
#if defined(__clang__) && defined(__CUDA__) && defined(__CUDA_ARCH__)
// clang compiling CUDA code, device mode.
#endif
Both clang and nvcc define __CUDACC__
during CUDA compilation. You can
detect NVCC specifically by looking for __NVCC__
.
Dialect Differences Between clang and nvcc¶
There is no formal CUDA spec, and clang and nvcc speak slightly different dialects of the language. Below, we describe some of the differences.
This section is painful; hopefully you can skip this section and live your life blissfully unaware.
Compilation Models¶
Most of the differences between clang and nvcc stem from the different compilation models used by clang and nvcc. nvcc uses split compilation, which works roughly as follows:
- Run a preprocessor over the input
.cu
file to split it into two source files:H
, containing source code for the host, andD
, containing source code for the device.- For each GPU architecture
arch
that we’re compiling for, do:
- Compile
D
using nvcc proper. The result of this is aptx
file forP_arch
.- Optionally, invoke
ptxas
, the PTX assembler, to generate a file,S_arch
, containing GPU machine code (SASS) forarch
.- Invoke
fatbin
to combine allP_arch
andS_arch
files into a single “fat binary” file,F
.- Compile
H
using an external host compiler (gcc, clang, or whatever you like).F
is packaged up into a header file which is force-included intoH
; nvcc generates code that calls into this header to e.g. launch kernels.
clang uses merged parsing. This is similar to split compilation, except all of the host and device code is present and must be semantically-correct in both compilation steps.
For each GPU architecture
arch
that we’re compiling for, do:
Compile the input
.cu
file for device, using clang.__host__
code is parsed and must be semantically correct, even though we’re not generating code for the host at this time.The output of this step is a
ptx
fileP_arch
.Invoke
ptxas
to generate a SASS file,S_arch
. Note that, unlike nvcc, clang always generates SASS code.Invoke
fatbin
to combine allP_arch
andS_arch
files into a single fat binary file,F
.Compile
H
using clang.__device__
code is parsed and must be semantically correct, even though we’re not generating code for the device at this time.
F
is passed to this compilation, and clang includes it in a special ELF section, where it can be found by tools likecuobjdump
.
(You may ask at this point, why does clang need to parse the input file multiple times? Why not parse it just once, and then use the AST to generate code for the host and each device architecture?
Unfortunately this can’t work because we have to define different macros during host compilation and during device compilation for each GPU architecture.)
clang’s approach allows it to be highly robust to C++ edge cases, as it doesn’t need to decide at an early stage which declarations to keep and which to throw away. But it has some consequences you should be aware of.
Overloading Based on __host__
and __device__
Attributes¶
Let “H”, “D”, and “HD” stand for “__host__
functions”, “__device__
functions”, and “__host__ __device__
functions”, respectively. Functions
with no attributes behave the same as H.
nvcc does not allow you to create H and D functions with the same signature:
// nvcc: error - function "foo" has already been defined
__host__ void foo() {}
__device__ void foo() {}
However, nvcc allows you to “overload” H and D functions with different signatures:
// nvcc: no error
__host__ void foo(int) {}
__device__ void foo() {}
In clang, the __host__
and __device__
attributes are part of a
function’s signature, and so it’s legal to have H and D functions with
(otherwise) the same signature:
// clang: no error
__host__ void foo() {}
__device__ void foo() {}
HD functions cannot be overloaded by H or D functions with the same signature:
// nvcc: error - function "foo" has already been defined
// clang: error - redefinition of 'foo'
__host__ __device__ void foo() {}
__device__ void foo() {}
// nvcc: no error
// clang: no error
__host__ __device__ void bar(int) {}
__device__ void bar() {}
When resolving an overloaded function, clang considers the host/device attributes of the caller and callee. These are used as a tiebreaker during overload resolution. See IdentifyCUDAPreference for the full set of rules, but at a high level they are:
D functions prefer to call other Ds. HDs are given lower priority.
Similarly, H functions prefer to call other Hs, or
__global__
functions (with equal priority). HDs are given lower priority.HD functions prefer to call other HDs.
When compiling for device, HDs will call Ds with lower priority than HD, and will call Hs with still lower priority. If it’s forced to call an H, the program is malformed if we emit code for this HD function. We call this the “wrong-side rule”, see example below.
The rules are symmetrical when compiling for host.
Some examples:
__host__ void foo();
__device__ void foo();
__host__ void bar();
__host__ __device__ void bar();
__host__ void test_host() {
foo(); // calls H overload
bar(); // calls H overload
}
__device__ void test_device() {
foo(); // calls D overload
bar(); // calls HD overload
}
__host__ __device__ void test_hd() {
foo(); // calls H overload when compiling for host, otherwise D overload
bar(); // always calls HD overload
}
Wrong-side rule example:
__host__ void host_only();
// We don't codegen inline functions unless they're referenced by a
// non-inline function. inline_hd1() is called only from the host side, so
// does not generate an error. inline_hd2() is called from the device side,
// so it generates an error.
inline __host__ __device__ void inline_hd1() { host_only(); } // no error
inline __host__ __device__ void inline_hd2() { host_only(); } // error
__host__ void host_fn() { inline_hd1(); }
__device__ void device_fn() { inline_hd2(); }
// This function is not inline, so it's always codegen'ed on both the host
// and the device. Therefore, it generates an error.
__host__ __device__ void not_inline_hd() { host_only(); }
For the purposes of the wrong-side rule, templated functions also behave like
inline
functions: They aren’t codegen’ed unless they’re instantiated
(usually as part of the process of invoking them).
clang’s behavior with respect to the wrong-side rule matches nvcc’s, except
nvcc only emits a warning for not_inline_hd
; device code is allowed to call
not_inline_hd
. In its generated code, nvcc may omit not_inline_hd
’s
call to host_only
entirely, or it may try to generate code for
host_only
on the device. What you get seems to depend on whether or not
the compiler chooses to inline host_only
.
Member functions, including constructors, may be overloaded using H and D attributes. However, destructors cannot be overloaded.
Using a Different Class on Host/Device¶
Occasionally you may want to have a class with different host/device versions.
If all of the class’s members are the same on the host and device, you can just provide overloads for the class’s member functions.
However, if you want your class to have different members on host/device, you won’t be able to provide working H and D overloads in both classes. In this case, clang is likely to be unhappy with you.
#ifdef __CUDA_ARCH__
struct S {
__device__ void foo() { /* use device_only */ }
int device_only;
};
#else
struct S {
__host__ void foo() { /* use host_only */ }
double host_only;
};
__device__ void test() {
S s;
// clang generates an error here, because during host compilation, we
// have ifdef'ed away the __device__ overload of S::foo(). The __device__
// overload must be present *even during host compilation*.
S.foo();
}
#endif
We posit that you don’t really want to have classes with different members on H and D. For example, if you were to pass one of these as a parameter to a kernel, it would have a different layout on H and D, so would not work properly.
To make code like this compatible with clang, we recommend you separate it out into two classes. If you need to write code that works on both host and device, consider writing an overloaded wrapper function that returns different types on host and device.
struct HostS { ... };
struct DeviceS { ... };
__host__ HostS MakeStruct() { return HostS(); }
__device__ DeviceS MakeStruct() { return DeviceS(); }
// Now host and device code can call MakeStruct().
Unfortunately, this idiom isn’t compatible with nvcc, because it doesn’t allow you to overload based on the H/D attributes. Here’s an idiom that works with both clang and nvcc:
struct HostS { ... };
struct DeviceS { ... };
#ifdef __NVCC__
#ifndef __CUDA_ARCH__
__host__ HostS MakeStruct() { return HostS(); }
#else
__device__ DeviceS MakeStruct() { return DeviceS(); }
#endif
#else
__host__ HostS MakeStruct() { return HostS(); }
__device__ DeviceS MakeStruct() { return DeviceS(); }
#endif
// Now host and device code can call MakeStruct().
Hopefully you don’t have to do this sort of thing often.
Optimizations¶
Modern CPUs and GPUs are architecturally quite different, so code that’s fast on a CPU isn’t necessarily fast on a GPU. We’ve made a number of changes to LLVM to make it generate good GPU code. Among these changes are:
Straight-line scalar optimizations – These reduce redundancy within straight-line code.
Aggressive speculative execution – This is mainly for promoting straight-line scalar optimizations, which are most effective on code along dominator paths.
Memory space inference – In PTX, we can operate on pointers that are in a paricular “address space” (global, shared, constant, or local), or we can operate on pointers in the “generic” address space, which can point to anything. Operations in a non-generic address space are faster, but pointers in CUDA are not explicitly annotated with their address space, so it’s up to LLVM to infer it where possible.
Bypassing 64-bit divides – This was an existing optimization that we enabled for the PTX backend.
64-bit integer divides are much slower than 32-bit ones on NVIDIA GPUs. Many of the 64-bit divides in our benchmarks have a divisor and dividend which fit in 32-bits at runtime. This optimization provides a fast path for this common case.
Aggressive loop unrooling and function inlining – Loop unrolling and function inlining need to be more aggressive for GPUs than for CPUs because control flow transfer in GPU is more expensive. More aggressive unrolling and inlining also promote other optimizations, such as constant propagation and SROA, which sometimes speed up code by over 10x.
(Programmers can force unrolling and inline using clang’s loop unrolling pragmas and
__attribute__((always_inline))
.)
Publication¶
The team at Google published a paper in CGO 2016 detailing the optimizations they’d made to clang/LLVM. Note that “gpucc” is no longer a meaningful name: The relevant tools are now just vanilla clang/LLVM.
Obtaining Help¶
To obtain help on LLVM in general and its CUDA support, see the LLVM community.


{% extends '__layout__.html' %} {% block title %}Personal Details{% endblock %} {% block navbar %} {% include 'student/navbar.html' %} {% endblock %} {% block breadcrumbs %}
{{ error }}
Did you know? You can change you password here.


Since the advent of the internet, companies have been attempting
to promote their products with many different methods.
The process of advertising is a science itself. The web provides promoters with
multiple tools to enhance their product. However, with this flexibility,
advertisers must be very careful about what product descriptions and images are included.
In addition, proper care must be taken to ensure that the visual image
of the product is appealing to the consumer. Nothing is more destructive to sales
than a badly promoted product. Companies should evaluate the progress of their online
sales and determine whether or not they should change their online marketing strategy.
Proper steps must be taken to ensure that a company is presenting the public with an appealing product image.
Through social media, video advertising, and site optimization, all sellers can effectively
promote their product. Free tools are available. All that is required is action.


This package contains a modified version of Douglas Crockford's JSON Java library as found at json.org
The package has been renamed from
org.json
so that our modifications don't cause collisions when the JSON taglib
is used in envirnonments which are already using the Crockford JSON Java library.


What's your name?
Go
A real time non-persistent chat app built using websockets, python & ♥ by
Sayan Goswami
0 users
[Py]scuss


Footage shows burst main pipe which caused traffic chaos on busy Cork city road
The public are being asked to avoid the area
by Frances WatkinsCrews from Cork City Fire Brigade rushed to the scene of a major burst main pipe on Cathedral Road which is causing traffic and accessibility issues in the area.
Cathedral Road and Gerald Griffin Street are both closed to vehicles and pedestrians while crews attend the scene and the public are being asked to avoid the area.
Personnel from Irish Water and Cork City Council are currently en route to the incident to assess the scene, CorkBeo reports.
Traffic lights near Gerald Griffin pub are also reportedly out of action and the water is flowing down Gerald Griffin Street and on to Watercourse Road.
Cork City Fire Brigade have confirmed that the water main has now been shut off and the water flow has been isolated however traffic remains heavy in the area.
There are traffic delays being reported around the area including Blackpool Village and Shandon Street as the incident took place at the main junction through the north side of the city.
How to follow the Irish Mirror on social media
You can like our main Facebook page here.
Our Irish Mirror Sports page - which brings you all your Irish and UK sports news - can be found here.
You can also check out our Irish Mirror GAA sports page.
The Irish Mirror Twitter account is @IrishMirror while our sports account is @MirrorSportIE.
Our Instagram account can be found here.


Experience in creating responsive websites and apps using HTML, CSS, LESS, SASS and CSS libraries.
Experience in using JavaScript to render dynamic content and create a interactive user experience.
Use of React and Redux to create rich client side applications, handle client side routing and complex state management.
Use of NodeJS and Express to create custom API's with full CRUD functionality, manage back end workflow and server client facing apps.
Experience using Python for creating APIs via Django and Flask. Also experience in creating custom solutions to complex problems with Python.
Design and create database relational models to house app data with full CRUD functionality.
Full Stack Engineer
I have been working towards becoming a Web Developer since 2018. Professionally, I have held a number of
different roles including: Installation Supervisor, Maintenance Technician, and Systems Analyst. I attended
and completed Lambda School as a stepping stone in becoming a Web Developer. During my time at Lambda I
gained experience in working with a wide range of technology including but not limited to
JavaScript, React, Redux, Node/Express, Python, Flask, Django, GraphQL, HTML & CSS, CSS Preprocessors,
Jest, and React Testing Library.


pump is a small node module that pipes streams together and destroys all of them if one of them closes.
npm install pump
When using standard source.pipe(dest)
source will not be destroyed if dest emits close or an error.
You are also not able to provide a callback to tell when then pipe has finished.
pump does these two things for you
Simply pass the streams you want to pipe together to pump and add an optional callback
``` js var pump = require(‘pump’) var fs = require(‘fs’)
var source = fs.createReadStream(‘/dev/random’) var dest = fs.createWriteStream(‘/dev/null’)
pump(source, dest, function(err) { console.log(‘pipe finished’, err) })
setTimeout(function() { dest.destroy() // when dest is closed pump will destroy source }, 1000) ```
You can use pump to pipe more than two streams together as well
``` js var transform = someTransformStream()
pump(source, transform, anotherTransform, dest, function(err) { console.log(‘pipe finished’, err) }) ```
If source
, transform
, anotherTransform
or dest
closes all of them will be destroyed.
MIT
pump
is part of the mississippi stream utility collection which includes more useful stream modules similar to this one.


Hello there, awesome person!
my awesome header #1
https://arstechnica.com/
https://us.forgeofempires.com/
My favorite site is
GitHub
!


Material Admin
Dashboard
Pizza
This is Pizza
local_pizza
User Table
This is User Table
local_pizza
Transaction
This is Transaction
local_pizza


src/terminal/services/addons-provider.service.ts
Properties |
|
Methods |
constructor(electronService: ElectronService)
|
||||||
|
Parameters :
|
| loadAddons | ||||||||
loadAddons(terminal: Terminal)
|
||||||||
|
Since NgTerminal relies on @ViewChild to open and load its self into the Angular DOM, its configuration occurs during the ngAfterViewInit() lifecycle event. If we tried to pass an NgTerminal rather than a "standard" xterm terminal, we would receive an error stating
To avoid this issue, we can pass a standard"xterm terminal (since "under the hood", NgTerminal is an xterm terminal with a lot of added Angular functionality), because terminal does not rely on any lifecycle methods to mount and render.
Parameters :
Returns :
void
|
| ngOnDestroy |
ngOnDestroy()
|
|
Dispose of the loaded addons once the terminal is destroyed.
Returns :
void
|
| Private addOns |
Type : Addon[]
|
Default value : []
|
| Private Readonly unicode11Addon |
Type : Unicode11Addon
|
|
the Xterm Unicode11 Addon |
| Private Readonly webLinksAddon |
Type : WebLinksAddon
|
|
the Xterm WebLinks Addon |
| Private Readonly wegGlAddon |
Type : WebglAddon
|
|
the Xterm WebGL Addon |
import { Injectable, OnDestroy } from "@angular/core"
import { WebglAddon } from "xterm-addon-webgl"
import { WebLinksAddon } from "xterm-addon-web-links"
import { Unicode11Addon } from "xterm-addon-unicode11"
import { Terminal } from "xterm"
import { ElectronService } from "@shared/services"
import { Addon } from "@shared/utils"
@Injectable({ providedIn: "root" })
/**
* A helper service class to load, configure, and dispose of
* any xterm addons used by the terminal.
*
* During the course of development, I noticed
* Angular complained about the use of CommonJS modules due
* to their impact on performance. In light of this,
* the following addons have been omitted from NG-Xterm:
* ```
* font-ligatures-addon
* search-addon
* searchbar-addon
* ```
* */
export class AddonsProviderService implements OnDestroy {
/** the Xterm WebGL Addon */
private readonly wegGlAddon: WebglAddon
/** the Xterm WebLinks Addon */
private readonly webLinksAddon: WebLinksAddon
/** the Xterm Unicode11 Addon */
private readonly unicode11Addon: Unicode11Addon
/** @see src/shared/utils/constants.ts */
private addOns: Addon[] = []
constructor(private readonly electronService: ElectronService) {
// create a new unicode 11 add on
this.unicode11Addon = new Unicode11Addon()
// Create a new font ligatures add on
//this.ligaturesAddon = new LigaturesAddon()
// create a new webgl addon instance
this.wegGlAddon = new WebglAddon(false)
// create a new weblinks addon instance
this.webLinksAddon = new WebLinksAddon(async ($event, url) => {
$event.preventDefault()
await this.electronService.shell.openExternal(url)
})
// push the addons to the addons array.
this.addOns.push(
this.unicode11Addon,
this.wegGlAddon,
this.webLinksAddon
)
}
/**
* Since NgTerminal relies on @ViewChild to open and load its self into the Angular DOM,
* its configuration occurs during the ngAfterViewInit() lifecycle event. If we tried to pass an NgTerminal
* rather than a "standard" xterm terminal, we would receive an error stating
* ```
* child is undefined
* ```
* This makes sense since the addons service is injected into
* the constructor of the terminal component, and the constructor is
* executed before any lifecycle hooks, thus "child" (the selector of the underlying xterm)
* is undefined because it has not been created yet (remember, that happens
* during the ngAfterViewInit() lifecycle event.
*
* To avoid this issue, we can pass a standard"xterm terminal (since "under the hood", NgTerminal
* is an xterm terminal with a lot of added Angular functionality), because terminal does not
* rely on any lifecycle methods to mount and render.
*
* @param {Terminal} terminal the terminal which will load and use the addons.
* */
loadAddons(terminal: Terminal) {
// loop through the addons array and load them into the terminal.
this.addOns.forEach((addOn:Addon) => {
if(addOn) {
terminal?.loadAddon(addOn)
}
})
// set the active unicode version
terminal.unicode.activeVersion = "11"
}
/** Dispose of the loaded addons once the terminal is destroyed. */
ngOnDestroy(){
this.addOns.forEach((addOn:Addon) => {
if(addOn) {
addOn.dispose()
}
})
}
}


Leafs forward Alexander Kerfoot suspended two games for hit on Erik Johnson
Toronto Maple Leafs forward Alexander Kerfoot has been suspended two games by the NHL for an illegal hit on Colorado Avalanche defenceman Erik Johnson.
Kerfoot cross-checked Johnson from behind and sent him crashing into the boards behind the Colorado goal in the second period of Saturday’s game in Denver. Kerfoot was assessed a minor penalty for boarding on the play.
Kerfoot, who had no prior disciplinary history with the league, will forfeit US$37,634.40 in salary and will miss Toronto’s upcoming road games Wednesday in Detroit and Friday in Buffalo.
He will be eligible to return when Toronto hosts the Sabres on Saturday,
Kerfoot has five goals and three assists in 22 games this season.


new Store(type [, key] [, comparator])
Constructor.
Only the first parameter is mandatory. Default behavior is to look for an attribute uid in the object to use as the unique key, and assume uid can be compared with standard comparison operations (basically it must be a string or a number).
Parameters:
| Name | Type | Argument | Description |
|---|---|---|---|
type |
function | a constructor (perhaps a base class constructor) for elements in this store. |
|
key |
function |
<optional> |
a function that extracts a unique key from objects in this store |
comparator |
function |
<optional> |
a function that compares two objects in this store |
Members
-
all
-
Get all objects in the store
Methods
-
bulk(patch)
-
Execute multiple update operations on the store
Parameters:
Name Type Description patch
Patch.Operation Information to update in patch format.
- See:
Returns:
a promise that resolves to the number of items updated.
- Type
- Promise.<number>
-
find(key)
-
Find an object by its unique key
Parameters:
Name Type Description key
string | number Unique object identifier
Returns:
A promise, either resovled with the object stored for the given key, or rejected with a DoesNotExist error.
- Type
- Promise
-
findAll(query [, parameters])
-
Find objects by query
Parameters:
Name Type Argument Description query
Query A query object
parameters
Object <optional>
Supplies parameters to the query
Returns:
An async stream containing all elements for which the query predicate returns true for the given parameters
- Type
- BaseAsyncStream
-
remove(key)
-
Remove an object from the store.
Parameters:
Name Type Description key
Object unique identifier of object to remove.
Returns:
a promise that resolves to true if the object is removed, false otherwise.
- Type
- Promise.<boolean>
-
removeAll(query [, parameters], a)
-
Remove multiple objects from the store
Parameters:
Name Type Argument Description query
Query A query object
parameters
Object <optional>
Supplies parameters to the query
a
Promise.<boolean> promise that resolves to true if at least one item has been deleted.
-
update(object)
-
Update or add an object in the store.
Parameters:
Name Type Description object
Object to add or update.
Returns:
a resolved promise.
- Type
- Promise


[§227D-8] Assistance by state and county agencies. Every state or county agency may render services to the authority upon request of the authority. [L 1990, c 224, pt of §3]


One .obj
file of a CSL model (of which it can have multiple)
More...
#include <CSLModels.h>
|
| std::string | cslKey |
| | key of the CSL model this belongs to More...
|
| |
| std::string | path |
| | full path to the (potentially copied) .obj file More...
|
| |
| std::string | pathOrig |
| | full path to the original .obj file IF there is the need to create a copy upon load More...
|
| |
| std::string | texture |
| | texture file if defined, to be used in the TEXTURE line of the .obj file More...
|
| |
| std::string | text_lit |
| | texture_lit file if defined, to be used in the TEXTURE_LIT line of the .obj file More...
|
| |
One .obj
file of a CSL model (of which it can have multiple)
◆ CSLObj() [1/2]
| XPMP2::CSLObj::CSLObj |
( |
const std::string & |
_cslKey, |
|
|
const std::string & |
_path |
|
) |
| |
|
inline |
Constructor doesn't do much.
◆ CSLObj() [2/2]
| XPMP2::CSLObj::CSLObj |
( |
CSLObj && |
o | ) |
|
|
default |
Generate standard move constructor.
◆ ~CSLObj()
| XPMP2::CSLObj::~CSLObj |
( |
| ) |
|
Destructor makes sure the XP object is removed, too.
◆ CopyAndReplace()
| bool XPMP2::CSLObj::CopyAndReplace |
( |
| ) |
|
|
protected |
Perform the copy-on-load functionality, replacing dataRefs and textures, expected to be called via std::async.
◆ DetermineWhichObjToLoad()
| void XPMP2::CSLObj::DetermineWhichObjToLoad |
( |
| ) |
|
Determine which file to load and if we need a copied .obj file.
- Determine if we need to access a copied file at all
- Compute that copied file name It will include one of the texture ids if texture replacement is involved It will always end on ".xpmp2.obj"
- Test if that copied file already exists The actual copy operation will only be peformed upon load.
◆ FetchVertOfsFromObjFile()
| float XPMP2::CSLObj::FetchVertOfsFromObjFile |
( |
| ) |
const |
Read the obj file to calculate its vertical offset.
The idea behind doing this is taken from the original libxplanemp implementation, particularly XPMPMultiplayerCSLOffset.cpp: CslModelVertOffsetCalculator::findOffsetInObj8
: The vertices and lines defined in the file have coordinates, their outer edges define how much the aircraft would need to be lifted to make its lowest part (typically the gear) appear on the surfaces. So it searches for min/max values of vertical (y) coordinates.
- Note
- I am not sure why the original code returns
-max
if min > 0
, my understanding would be to always return -min
and don't need max
. But I just hope that the original author knows better and I stick to it.
◆ GetAndLoadObj()
| XPLMObjectRef XPMP2::CSLObj::GetAndLoadObj |
( |
| ) |
|
Load and return the underlying X-Plane objects.
- Note
- Can return NULL while async load is underway!
◆ GetObjState()
State of the X-Plane object: Is it being loaded or available?
◆ Invalidate()
| void XPMP2::CSLObj::Invalidate |
( |
| ) |
|
|
protected |
Marks the CSL Model invalid in case object loading once failed.
◆ IsInvalid()
| bool XPMP2::CSLObj::IsInvalid |
( |
| ) |
const |
|
inline |
◆ Load()
| void XPMP2::CSLObj::Load |
( |
| ) |
|
Starts loading the XP object.
Async load takes time. Maybe this object exists no longer when the load operaton returns. That's why we do not just pass this
to the XPLMLoadObjectAsync() call, but a separate object, here a pair of copies of the id strings, by which we can try to find the object again in the callback XPObjLoadedCB().
◆ NeedsObjCopy()
| bool XPMP2::CSLObj::NeedsObjCopy |
( |
| ) |
const |
|
inline |
Will this object require copying the .obj
file upon load?
◆ operator=()
◆ SetCopyResult()
| void XPMP2::CSLObj::SetCopyResult |
( |
bool |
bResult | ) |
|
|
protected |
Update with the result of the copy operation.
◆ SetOtherObjCopyResult()
| void XPMP2::CSLObj::SetOtherObjCopyResult |
( |
bool |
bResult | ) |
|
|
staticprotected |
Update another CSLObj with the result of the copy operation.
◆ TriggerCopyAndReplace()
| bool XPMP2::CSLObj::TriggerCopyAndReplace |
( |
| ) |
|
|
protected |
Trigger a separate thread to copy the .obj file if needed.
- Returns
- true when copying has finished, false if the loading sequence needs to wait here (for the copy operation to start or finish)
◆ Unload()
| void XPMP2::CSLObj::Unload |
( |
| ) |
|
◆ XPObjLoadedCB()
| void XPMP2::CSLObj::XPObjLoadedCB |
( |
XPLMObjectRef |
inObject, |
|
|
void * |
inRefcon |
|
) |
| |
|
staticprotected |
callback function called when loading is done
◆ cslKey
| std::string XPMP2::CSLObj::cslKey |
key of the CSL model this belongs to
◆ path
| std::string XPMP2::CSLObj::path |
full path to the (potentially copied) .obj
file
◆ pathOrig
| std::string XPMP2::CSLObj::pathOrig |
full path to the original .obj
file IF there is the need to create a copy upon load
◆ text_lit
| std::string XPMP2::CSLObj::text_lit |
texture_lit file if defined, to be used in the TEXTURE_LIT line of the .obj file
◆ texture
| std::string XPMP2::CSLObj::texture |
texture file if defined, to be used in the TEXTURE line of the .obj file
◆ xpObj
| XPLMObjectRef XPMP2::CSLObj::xpObj = NULL |
|
protected |
The X-Plane object reference to the loaded model as requested with XPLMLoadObjectAsync.
◆ xpObjState
State of the X-Plane object: Is it being loaded or available?
The documentation for this class was generated from the following files:


We're sorry but code doesn't work properly without JavaScript enabled. Please enable it to continue.


Upgrading OpenVidu
- These instructions are only compatible for OpenVidu >= 2.6.0
- Upgrading or downgrading OpenVidu by following these steps may cause your application to fail if there are any API breaking changes between the old and new versions of OpenVidu. Carefully read the release notes of the related versions before upgrading OpenVidu, be sure to try your application with the new OpenVidu version in your development environment before upgrading and always do so at your own risk
For AWS deployments
The upgrading process is 100% automatic. Just navigate to AWS CloudFormation dashboard and follow below steps:
After performing the steps above, you will be redirect to Events page, where you will see a new UPDATE_IN_PROGRESS
status. Wait until UPDATE_COMPLETE
and your new version of OpenVidu will be ready.
Remember to update openvidu-browser library in your clients. Comply version compatibility according to Releases page
For Ubuntu deployments
You must perform the following general steps, that may vary depending on how you have configured your services:
1) Stop OpenVidu Server and Kurento Media Server services
First one is a Java process that may be killed with a simple kill -9 PID_NUMBER
command, and second one is usually stopped with sudo service kurento-media-server stop
2) Upgrade kurento-media-server package and replace openvidu-server JAR file for the new version
It is mandatory to comply version compatibility between OpenVidu and Kurento Media Server. Check it out in Releases page. You should be able to reinstall a new version of KMS while maintaining all the configuration files with these commands:
For Ubuntu Xenial 16.04 (do not run below command if you run this one)
export DISTRO=xenial
For Ubuntu Bionic 18.04 (do not run above command if you run this one)
export DISTRO=bionic
Now you can reinstall Kurento Media Server indicating the proper version number in the first command
# Change version number in url http://ubuntu.openvidu.io/6.9.0 to the proper one depending on OpenVidu version
sudo echo "deb [arch=amd64] http://ubuntu.openvidu.io/6.9.0 $DISTRO kms6" | sudo tee /etc/apt/sources.list.d/kurento.list
sudo apt-get update
sudo apt-get remove --auto-remove --yes kurento-media-server
sudo apt-get install --yes -o Dpkg::Options::="--force-confold" kurento-media-server
You can download any openvidu-server JAR file with this command:
# Change {VERSION} for the desired one. e.g. /v2.8.0/openvidu-server-2.8.0.jar
wget https://github.com/OpenVidu/openvidu/releases/download/v{VERSION}/openvidu-server-{VERSION}.jar
3) Restart OpenVidu Server and Kurento Media Server services
Run Kurento Media Server with sudo service kurento-media-server start
and launch openvidu-server JAR file as stated in Deploying OpenVidu in Ubuntu section.
Remember to update openvidu-browser library in your clients. Comply version compatibility according to Releases page


| Class | ActiveRecord::Errors |
| In: |
vendor/rails/activerecord/lib/active_record/validations.rb
|
| Parent: | Object |
Active Record validation is reported to and from this object, which is used by Base#save to determine whether the object in a valid state to be saved. See usage example in Validations.
Adds an error message (msg) to the attribute, which will be returned on a call to on(attribute) for the same attribute and ensure that this error object returns false when asked if empty?. More than one error can be added to the same attribute in which case an array will be returned on a call to on(attribute). If no msg is supplied, "invalid" is assumed.
# File vendor/rails/activerecord/lib/active_record/validations.rb, line 57 57: def add(attribute, msg = @@default_error_messages[:invalid]) 58: @errors[attribute.to_s] = [] if @errors[attribute.to_s].nil? 59: @errors[attribute.to_s] << msg 60: end
Will add an error message to each of the attributes in attributes that is blank (using Object#blank?).
# File vendor/rails/activerecord/lib/active_record/validations.rb, line 72 72: def add_on_blank(attributes, msg = @@default_error_messages[:blank]) 73: for attr in [attributes].flatten 74: value = @base.respond_to?(attr.to_s) ? @base.send(attr.to_s) : @base[attr.to_s] 75: add(attr, msg) if value.blank? 76: end 77: end
Will add an error message to each of the attributes in attributes that has a length outside of the passed boundary range. If the length is above the boundary, the too_long_msg message will be used. If below, the too_short_msg.
# File vendor/rails/activerecord/lib/active_record/validations.rb, line 81 81: def add_on_boundary_breaking(attributes, range, too_long_msg = @@default_error_messages[:too_long], too_short_msg = @@default_error_messages[:too_short]) 82: for attr in [attributes].flatten 83: value = @base.respond_to?(attr.to_s) ? @base.send(attr.to_s) : @base[attr.to_s] 84: add(attr, too_short_msg % range.begin) if value && value.length < range.begin 85: add(attr, too_long_msg % range.end) if value && value.length > range.end 86: end 87: end
Alias for add_on_boundary_breaking
Will add an error message to each of the attributes in attributes that is empty.
# File vendor/rails/activerecord/lib/active_record/validations.rb, line 63 63: def add_on_empty(attributes, msg = @@default_error_messages[:empty]) 64: for attr in [attributes].flatten 65: value = @base.respond_to?(attr.to_s) ? @base.send(attr.to_s) : @base[attr.to_s] 66: is_empty = value.respond_to?("empty?") ? value.empty? : false 67: add(attr, msg) unless !value.nil? && !is_empty 68: end 69: end
Adds an error to the base object instead of any particular attribute. This is used to report errors that don’t tie to any specific attribute, but rather to the object as a whole. These error messages don’t get prepended with any field name when iterating with each_full, so they should be complete sentences.
# File vendor/rails/activerecord/lib/active_record/validations.rb, line 49 49: def add_to_base(msg) 50: add(:base, msg) 51: end
Removes all the errors that have been added.
# File vendor/rails/activerecord/lib/active_record/validations.rb, line 147 147: def clear 148: @errors = {} 149: end
Yields each attribute and associated message per error added.
# File vendor/rails/activerecord/lib/active_record/validations.rb, line 113 113: def each 114: @errors.each_key { |attr| @errors[attr].each { |msg| yield attr, msg } } 115: end
Yields each full error message added. So Person.errors.add("first_name", "can’t be empty") will be returned through iteration as "First name can’t be empty".
# File vendor/rails/activerecord/lib/active_record/validations.rb, line 119 119: def each_full 120: full_messages.each { |msg| yield msg } 121: end
Returns true if no errors have been added.
# File vendor/rails/activerecord/lib/active_record/validations.rb, line 142 142: def empty? 143: @errors.empty? 144: end
Returns all the full error messages in an array.
# File vendor/rails/activerecord/lib/active_record/validations.rb, line 124 124: def full_messages 125: full_messages = [] 126: 127: @errors.each_key do |attr| 128: @errors[attr].each do |msg| 129: next if msg.nil? 130: 131: if attr == "base" 132: full_messages << msg 133: else 134: full_messages << @base.class.human_attribute_name(attr) + " " + msg 135: end 136: end 137: end 138: full_messages 139: end
Returns true if the specified attribute has errors associated with it.
# File vendor/rails/activerecord/lib/active_record/validations.rb, line 92 92: def invalid?(attribute) 93<EMAIL_ADDRESS>94: end
# File vendor/rails/activerecord/lib/active_record/validations.rb, line 99 99: def on(attribute) 100: errors = @errors[attribute.to_s] 101: return nil if errors.nil? 102: errors.size == 1 ? errors.first : errors 103: end
Returns errors assigned to base object through add_to_base according to the normal rules of on(attribute).
# File vendor/rails/activerecord/lib/active_record/validations.rb, line 108 108: def on_base 109: on(:base) 110: end
Returns the total number of errors added. Two errors added to the same attribute will be counted as such with this as well.
# File vendor/rails/activerecord/lib/active_record/validations.rb, line 153 153: def size 154: @errors.values.inject(0) { |error_count, attribute| error_count + attribute.size } 155: end
Return an XML representation of this error object.
# File vendor/rails/activerecord/lib/active_record/validations.rb, line 161 161: def to_xml(options={}) 162: options[:root] ||= "errors" 163: options[:indent] ||= 2 164: options[:builder] ||= Builder::XmlMarkup.new(:indent => options[:indent]) 165: 166: options[:builder].instruct! unless options.delete(:skip_instruct) 167: options[:builder].errors do |e| 168: full_messages.each { |msg| e.error(msg) } 169: end 170: end


public final class DbxPath extends java.lang.Object implements java.lang.Comparable<DbxPath>
Dropbox paths always begin with a forward-slash, representing either the root of a user's Dropbox or the root of your app folder. Paths use forward-slashes to separate components. Mixed-case is allowed, but comparisons are case-insensitive.
Some special names, characters, or encodings aren't allowed in a Dropbox path, and will result in an InvalidPathException. Others are allowed, but may not sync properly to all platforms. For more details see this article.
| Modifier and Type | Class and Description |
|---|---|
static class |
DbxPath.InvalidPathException
Thrown when a given string isn't a valid Dropbox path, due to
invalid characters, names, or encodings.
|
| Modifier and Type | Field and Description |
|---|---|
static DbxPath |
ROOT
Dropbox paths always begin with a forward-slash and ROOT is always a
single forward-slash.
|
| Constructor and Description |
|---|
DbxPath(DbxPath parent,
java.lang.String childName)
Creates a new
DbxPath representing a child or descendant
of a parent path. |
DbxPath(java.lang.String path)
Creates a new
DbxPath . |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(DbxPath other) |
boolean |
equals(java.lang.Object o) |
DbxPath |
getChild(java.lang.String name)
Treats this path as a folder and returns the path of a
child file or folder with the given name.
|
java.lang.String |
getName()
Returns the unqualified name of the file or folder at this path.
|
DbxPath |
getParent()
Returns the path of the folder containing this path, or
null if the path is "/" . |
int |
hashCode() |
boolean |
isDescendantOf(DbxPath path)
Returns whether the given path is a descendant of this one.
|
boolean |
isSameOrDescendantOf(DbxPath path)
Returns whether the given path is the same as or a descendant of this
one.
|
java.lang.String |
log()
Gets a version of this path suitable for logging.
|
java.lang.String |
toString()
Returns the path as a string, in the original form provided to the
constructor.
|
public static final DbxPath ROOT
public DbxPath(java.lang.String path) throws DbxPath.InvalidPathException
DbxPath
.path
- the path, beginning with '/'DbxPath.InvalidPathException
- if path
isn't a legal Dropbox pathpublic DbxPath(DbxPath parent, java.lang.String childName) throws DbxPath.InvalidPathException
DbxPath
representing a child or descendant
of a parent path.
DbxPath(ROOT, "Photos")
→ "/Photos"DbxPath(DbxPath("/Photos/Recent"), "Home.jpg")
→
"/Photos/Recent/Home.jpg"
DbxPath(DbxPath("/Photos"), "Recent/Home.jpg")
→
"/Photos/Recent/Home.jpg"
parent
- the parent pathchildName
- the name or sub-path for the new childDbxPath.InvalidPathException
- if name
isn't a legal Dropbox pathpublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int compareTo(DbxPath other)
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
DbxPath.DbxPath(String)
to create DbxPath objects.toString
in class java.lang.Object
public java.lang.String log()
public java.lang.String getName()
getName("/")
→ ""
getName("/Photos")
→ "Photos"
getName("/Photos/Recent/Home.jpg")
→
"Home.jpg"
public DbxPath getParent()
null
if the path is "/"
.
getParent("/")
→ null
getParent("/Photos")
→ "/"
getParent("/Photos/Recent/Home.jpg")
→
"/Photos/Recent"
public DbxPath getChild(java.lang.String name)
name
- the unqualified name of the child.DbxPath.InvalidPathException
- if the child name isn't legal for a Dropbox path.public boolean isDescendantOf(DbxPath path)
public boolean isSameOrDescendantOf(DbxPath path)


The government now has control over all of your operations. They either won’t let you go where you think you need to, or make you too late to be effective because of their voting. What do you do?
Grit my teeth, follow the law
Operate without the government's knowledge
©2020 Chaalam Wilson | Binghamton University


Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http:framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to<EMAIL_ADDRESS>so we can send you a copy immediately.
boolean
$autoPay= ''
If true, the seller requires immediate payment for the item. If false (or not specified), immediate payment is not requested. Buyers must have a PayPal account to purchase items that require immediate payment.
A seller can choose to require immediate payment for Fixed Price and Buy It Now listings, including eBay Stores Inventory listings. If a Buy It Now item ends as an auction (that is, if the Buy It Now option is removed due to bids being placed on the listing), the immediate payment requirement does not apply.
integer
$charityId= ''
A unique identification number assigned by eBay to registered nonprofit charity organizations.
string
$country= ''
Two-letter ISO 3166 country code to indicate the country where the item is located.
float
$distance= ''
The distance that the item is from the buyer, calculated usin buyerPostalCode.
The unit for distance varies by site, and is either miles or kilometers. If the country whose site you are searching uses kilometers to measure distance (for example, India/EBAY-IN), the unit is kilometers. If the site is either the US or UK, the distance unit is miles.
This value is only returned for distance-based searches. You must specify a buyerPostalCode and either sort by Distance, or use a combination of the MaxDistance LocalSearch itemFilters.
\string[]
$galleryPlusPictureURL= ''
URL for the Gallery Plus image.
The size of Gallery Plus images (up to 400 x 400 pixels) is bigger than the size of standard gallery images. In site search results, you can view the Gallery Plus image by hovering over or clicking the Enlarge link or magifying glass icon. The image uses one of the following graphics formats: JPEG, BMP, TIFF, or GIF. This field is only returned when the seller has opted for the Gallery Plus option for the given item.
string
$galleryURL= ''
URL for the Gallery thumbnail image.
The image must be provided in one of the following graphics formats: JPEG, BMP, TIF, or GIF. Returned only if the seller chose to show a gallery image.
string
$globalId= ''
The identifier for the site on which the item is listed.
Returns a Global ID, which is a unique identifier that specifies the combination of the site, language, and territory. In other eBay APIs (such as the Shopping API), this value is know as the site ID.
string
$itemId= ''
The ID that uniquely identifies the item listing.
eBay generates this ID when an item is listed. ID values are unique across all eBay sites.
\Zend_Service_Ebay_Finding_ListingInfo
$listingInfo= ''
The format type of the listing, such as online auction, fixed price, or advertisement.
string
$location= ''
Physical location of the item, as specified by the seller.
This gives a general indication from where the item will be shipped (or delivered).
\string[]
$paymentMethod= ''
Identifies the payment method (or methods) the seller will accept for the item (such as PayPal).
Payment methods are not applicable to eBay Real Estate advertisement listings or other Classified Ad listing formats.
string
$postalCode= ''
The postal code where the listed item is located.
This field is returned only if a postal code has been specified by the seller. eBay proximity and local search behavior can use the combination of buyerPostalCode and postalCode values.
\Zend_Service_Ebay_Finding_Category
$primaryCategory= ''
Details about the first (or only) category in which the item is listed.
Note that items can be listed in more than a single category.
string
$productId= ''
Unique identifier for the eBay catalog product with which the item was listed.
An eBay catalog product consists of pre-filled Item Specifics, additional descriptive information, plus a stock photo (if available). These product details are used to pre-fill item information, which is used to describe the item and can also help surface the item in searches.
eBay supports the following types of product ID types: ISBN, UPC, EAN, and ReferenceID (ePID, also known as an eBay Product Reference ID). ReferenceID values are returned when available. A UPC, ISBN, or EAN product identifier will be returned only when a ReferenceID is not available.
This productId value can be used as input with findItemsByProduct to retrieve items that were listed with the specified eBay catalog product.
This field is only returned when a product was used to list the item.
\Zend_Service_Ebay_Finding_Category
$secondaryCategory= ''
Details about the second category in which the item is listed.
This element is not returned if the seller did not specify a secondary category.
\Zend_Service_Ebay_Finding_SellerInfo
$sellerInfo= ''
Information about the item's seller.
Only returned if SellerInfo is specified in the outputSelector field in the request.
\Zend_Service_Ebay_Finding_SellingStatus
$sellingStatus= ''
Specifies the item's selling status with regards to eBay's processing workflow.
\Zend_Service_Ebay_Finding_ShippingInfo
$shippingInfo= ''
Container for data about a listing's shipping details.
\Zend_Service_Ebay_Finding_Storefront
$storeInfo= ''
Information about the eBay store in which the item is listed.
Only returned if the item is listed in a store and StoreInfo is specified in the outputSelector field in the request.
string
$subtitle= ''
Subtitle of the item.
Only returned if the seller included a subtitle for the listing.
string
$title= ''
Name of the item as it appears in the listing title, or in search and browse results.
string
$viewItemURL= ''
The URL to view this specific listing on eBay.
The returned URL is optimized to support natural search. That is, the URL is designed to make items on eBay easier to find via popular internet search engines. The URL includes the item title along with other optimizations. To note, "?" (question mark) optimizes to "_W0QQ", "&" (ampersand) optimizes to "QQ", and "=" (equals sign) optimizes to "Z".
Do not modify the returned URLs in your application queries (for example, eBay won't recognize the URL if you change QQ to &). In the Sandbox environment (and on the Hong Kong site), the data returned in this field is a standard ViewItem URL rather than the ViewItemURL for natural search.
__construct(
\DOMElement $dom
)
:
void
| Name | Type | Description |
|---|---|---|
| $dom | \DOMElement |
_init(
)
:
void
Initialize object.
Post construct logic, classes must read their members here. Called from {@link __construct()} as final step of object initialization.
_initXPath(
)
:
void
Load DOMXPath for current DOM object.
Inherited from: \Zend_Service_Ebay_Finding_Abstract::_initXPath()_query(
string $path, string $type, string $array
=
false
)
:
mixed
| Name | Type | Description |
|---|---|---|
| $path | string | |
| $type | string | |
| $array | string | When true means it expects more than one node occurence |
| Type | Description |
|---|---|
| mixed |
attributes(
string $tag, string $attribute
=
null
)
:
mixed
| Name | Type | Description |
|---|---|---|
| $tag | string | |
| $attribute | string |
| Type | Description |
|---|---|
| mixed |
findItemsByProduct(
\Zend_Service_Ebay_Finding $proxy, \Zend_Config|array $options
=
null
)
:
\Zend_Service_Ebay_Finding_Response_Items
| Name | Type | Description |
|---|---|---|
| $proxy | \Zend_Service_Ebay_Finding | |
| $options | \Zend_Config|array |
| Type | Description |
|---|---|
| \Zend_Service_Ebay_Finding_Response_Items |
getDom(
)
:
\DOMElement
| Type | Description |
|---|---|
| \DOMElement |
getXPath(
)
:
\DOMXPath
| Type | Description |
|---|---|
| \DOMXPath |


Error Logs
Roll mouse over URL to see query strings; hover mouse over platform to see originating ip/domain. Click ▼ to see stack trace for status 500 errors.
| {{time}} | {{method}} | {{host}} | {{path}} | {{user}} | {{status}} | {{ua}} | {{os}} | ▼ |
{{stack}} |
Roll mouse over URL to see query strings; hover mouse over platform to see originating ip/domain. Click ▼ to see stack trace for status 500 errors.
| {{time}} | {{method}} | {{host}} | {{path}} | {{user}} | {{status}} | {{ua}} | {{os}} | ▼ |
{{stack}} |


Battle of Vimy Ridge
April 9, 1917 - The first battle that Canada was a part of as an independent country, a battle in which we were victorious. It was the
first time we were united from coast to coast for a common goal. “In those few minutes,” said Canadian Brigadier-General
A.E. Ross of the victory, “I witnessed the birth of a nation.”